diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index aee6a066..1bebe18b 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -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, }) } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index fb9692dd..7656c215 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -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, }