mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +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) {
|
if (selectionHasChanged) {
|
||||||
this.emit('selectionUpdate', {
|
this.emit('selectionUpdate', {
|
||||||
editor: this,
|
editor: this,
|
||||||
|
transaction,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,6 +333,7 @@ export class Editor extends EventEmitter {
|
|||||||
this.emit('focus', {
|
this.emit('focus', {
|
||||||
editor: this,
|
editor: this,
|
||||||
event: focus.event,
|
event: focus.event,
|
||||||
|
transaction,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,6 +341,7 @@ export class Editor extends EventEmitter {
|
|||||||
this.emit('blur', {
|
this.emit('blur', {
|
||||||
editor: this,
|
editor: this,
|
||||||
event: blur.event,
|
event: blur.event,
|
||||||
|
transaction,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,11 +52,11 @@ export interface EditorOptions {
|
|||||||
enablePasteRules: boolean,
|
enablePasteRules: boolean,
|
||||||
onBeforeCreate: (props: { editor: Editor }) => void,
|
onBeforeCreate: (props: { editor: Editor }) => void,
|
||||||
onCreate: (props: { editor: Editor }) => void,
|
onCreate: (props: { editor: Editor }) => void,
|
||||||
onUpdate: (props: { editor: Editor }) => void,
|
onUpdate: (props: { editor: Editor, transaction: Transaction }) => void,
|
||||||
onSelectionUpdate: (props: { editor: Editor }) => void,
|
onSelectionUpdate: (props: { editor: Editor, transaction: Transaction }) => void,
|
||||||
onTransaction: (props: { editor: Editor, transaction: Transaction }) => void,
|
onTransaction: (props: { editor: Editor, transaction: Transaction }) => void,
|
||||||
onFocus: (props: { editor: Editor, event: FocusEvent }) => void,
|
onFocus: (props: { editor: Editor, event: FocusEvent, transaction: Transaction }) => void,
|
||||||
onBlur: (props: { editor: Editor, event: FocusEvent }) => void,
|
onBlur: (props: { editor: Editor, event: FocusEvent, transaction: Transaction }) => void,
|
||||||
onDestroy: () => void,
|
onDestroy: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user