mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-14 22:32:24 +08:00
refactor: export focusEvents plugin key (#6204)
* refactor(focus): export plugin key * chore: changeset * refactor: remove space * refactor: extract focusEvents plugin key and export it chore: changeset revert: unwanted changes
This commit is contained in:
parent
9abb0190c5
commit
826cfe7406
5
.changeset/eighty-hotels-listen.md
Normal file
5
.changeset/eighty-hotels-listen.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tiptap/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Export focusEvents plugin key
|
@ -2,6 +2,8 @@ import { Plugin, PluginKey } from '@tiptap/pm/state'
|
|||||||
|
|
||||||
import { Extension } from '../Extension.js'
|
import { Extension } from '../Extension.js'
|
||||||
|
|
||||||
|
export const focusEventsPluginKey = new PluginKey('focusEvents')
|
||||||
|
|
||||||
export const FocusEvents = Extension.create({
|
export const FocusEvents = Extension.create({
|
||||||
name: 'focusEvents',
|
name: 'focusEvents',
|
||||||
|
|
||||||
@ -10,7 +12,7 @@ export const FocusEvents = Extension.create({
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
new Plugin({
|
new Plugin({
|
||||||
key: new PluginKey('focusEvents'),
|
key: focusEventsPluginKey,
|
||||||
props: {
|
props: {
|
||||||
handleDOMEvents: {
|
handleDOMEvents: {
|
||||||
focus: (view, event: Event) => {
|
focus: (view, event: Event) => {
|
||||||
|
@ -2,7 +2,7 @@ export { ClipboardTextSerializer } from './clipboardTextSerializer.js'
|
|||||||
export { Commands } from './commands.js'
|
export { Commands } from './commands.js'
|
||||||
export { Drop } from './drop.js'
|
export { Drop } from './drop.js'
|
||||||
export { Editable } from './editable.js'
|
export { Editable } from './editable.js'
|
||||||
export { FocusEvents } from './focusEvents.js'
|
export { FocusEvents, focusEventsPluginKey } from './focusEvents.js'
|
||||||
export { Keymap } from './keymap.js'
|
export { Keymap } from './keymap.js'
|
||||||
export { Paste } from './paste.js'
|
export { Paste } from './paste.js'
|
||||||
export { Tabindex } from './tabindex.js'
|
export { Tabindex } from './tabindex.js'
|
||||||
|
Loading…
Reference in New Issue
Block a user