From cd116b229861858a785bfe22a2a1533f6f9db23a Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 13 Apr 2025 17:51:25 +0800 Subject: [PATCH] refactor: update ComponentDrag to use command reference in event props --- packages/core/src/commands/view/ComponentDrag.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/commands/view/ComponentDrag.ts b/packages/core/src/commands/view/ComponentDrag.ts index 562648379..a8abba45c 100644 --- a/packages/core/src/commands/view/ComponentDrag.ts +++ b/packages/core/src/commands/view/ComponentDrag.ts @@ -6,6 +6,7 @@ import type Component from '../../dom_components/model/Component'; import type EditorModel from '../../editor/model/Editor'; import { getComponentModel, getComponentView } from '../../utils/mixins'; import type ComponentView from '../../dom_components/view/ComponentView'; +import type CommandAbstract from './CommandAbstract'; const evName = 'dmode'; @@ -71,7 +72,7 @@ export default { guidesTarget: this.guidesTarget, guidesStatic: this.guidesStatic, guidesMatched: this.getGuidesMatched(guidesActive), - opts: this.opts, + command: this, }; }, @@ -659,7 +660,7 @@ export interface ComponentDragEventProps { /** * The options used for the drag event. */ - opts: ComponentDragOpts; + command: ComponentDragProps & CommandAbstract; } /**