From 870f574f6be1c312b856d8000cecd0838470fc92 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 3 Feb 2025 16:34:30 +0400 Subject: [PATCH] Remove deprecated command options --- packages/core/src/commands/index.ts | 4 ++-- packages/core/src/commands/types.ts | 5 ----- packages/core/src/commands/view/CommandAbstract.ts | 10 ---------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/packages/core/src/commands/index.ts b/packages/core/src/commands/index.ts index 0cd98354c..94dd4b00b 100644 --- a/packages/core/src/commands/index.ts +++ b/packages/core/src/commands/index.ts @@ -383,7 +383,7 @@ export default class CommandsModule extends Module { ... }); */ runCommand = 'command:run:', - _runCommand = 'run:', /** * @event `command:run:before:COMMAND-ID` Triggered before the command is called. @@ -38,7 +36,6 @@ export enum CommandsEvents { * }); */ abort = 'command:abort:', - _abort = 'abort:', /** * @event `command:stop` Triggered on stop of any command. @@ -48,7 +45,6 @@ export enum CommandsEvents { * }); */ stop = 'command:stop', - _stop = 'stop', /** * @event `command:stop:COMMAND-ID` Triggered on stop of a specific command. @@ -56,7 +52,6 @@ export enum CommandsEvents { * editor.on('command:run:my-command', ({ result, options }) => { ... }); */ stopCommand = 'command:stop:', - _stopCommand = 'stop:', /** * @event `command:stop:before:COMMAND-ID` Triggered before the command is called to stop. diff --git a/packages/core/src/commands/view/CommandAbstract.ts b/packages/core/src/commands/view/CommandAbstract.ts index 6ada4faec..c1fd979f2 100644 --- a/packages/core/src/commands/view/CommandAbstract.ts +++ b/packages/core/src/commands/view/CommandAbstract.ts @@ -111,11 +111,9 @@ export default class CommandAbstract extends Model { callRun(editor: Editor, options: any = {}) { const { id } = this; editor.trigger(`${CommandsEvents.runBeforeCommand}${id}`, { options }); - editor.trigger(`${CommandsEvents._runCommand}${id}:before`, options); if (options.abort) { editor.trigger(`${CommandsEvents.abort}${id}`, { options }); - editor.trigger(`${CommandsEvents._abort}${id}`, options); return; } @@ -124,9 +122,6 @@ export default class CommandAbstract extends Model { const data = { id, result, options }; editor.trigger(`${CommandsEvents.runCommand}${id}`, data); editor.trigger(CommandsEvents.run, data); - // deprecated - editor.trigger(`${CommandsEvents._runCommand}${id}`, result, options); - editor.trigger(CommandsEvents._run, id, result, options); return result; } @@ -140,15 +135,10 @@ export default class CommandAbstract extends Model { const { id } = this; const sender = options.sender || editor; editor.trigger(`${CommandsEvents.stopBeforeCommand}${id}`, { options }); - editor.trigger(`${CommandsEvents._stopCommand}${id}:before`, options); const result = this.stop(editor, sender, options); const data = { id, result, options }; editor.trigger(`${CommandsEvents.stopCommand}${id}`, data); editor.trigger(CommandsEvents.stop, data); - - // deprecated - editor.trigger(`${CommandsEvents._stopCommand}${id}`, result, options); - editor.trigger(CommandsEvents._stop, id, result, options); return result; }