mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
feat: add transaction to all events if possible, see #1461
This commit is contained in:
parent
d9abb0c736
commit
7f6ed0b1c0
@ -322,6 +322,7 @@ export class Editor extends EventEmitter {
|
||||
if (selectionHasChanged) {
|
||||
this.emit('selectionUpdate', {
|
||||
editor: this,
|
||||
transaction,
|
||||
})
|
||||
}
|
||||
|
||||
@ -332,6 +333,7 @@ export class Editor extends EventEmitter {
|
||||
this.emit('focus', {
|
||||
editor: this,
|
||||
event: focus.event,
|
||||
transaction,
|
||||
})
|
||||
}
|
||||
|
||||
@ -339,6 +341,7 @@ export class Editor extends EventEmitter {
|
||||
this.emit('blur', {
|
||||
editor: this,
|
||||
event: blur.event,
|
||||
transaction,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -52,11 +52,11 @@ export interface EditorOptions {
|
||||
enablePasteRules: boolean,
|
||||
onBeforeCreate: (props: { editor: Editor }) => void,
|
||||
onCreate: (props: { editor: Editor }) => void,
|
||||
onUpdate: (props: { editor: Editor }) => void,
|
||||
onSelectionUpdate: (props: { editor: Editor }) => void,
|
||||
onUpdate: (props: { editor: Editor, transaction: Transaction }) => void,
|
||||
onSelectionUpdate: (props: { editor: Editor, transaction: Transaction }) => void,
|
||||
onTransaction: (props: { editor: Editor, transaction: Transaction }) => void,
|
||||
onFocus: (props: { editor: Editor, event: FocusEvent }) => void,
|
||||
onBlur: (props: { editor: Editor, event: FocusEvent }) => void,
|
||||
onFocus: (props: { editor: Editor, event: FocusEvent, transaction: Transaction }) => void,
|
||||
onBlur: (props: { editor: Editor, event: FocusEvent, transaction: Transaction }) => void,
|
||||
onDestroy: () => void,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user