From 8bdc894690752b1a9b29beb98d128eb0eec27d42 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sat, 18 Apr 2026 16:01:35 +0200 Subject: fix: migrate commands to CommandResult selection contract --- apps/web/src/lib/commands/timeline/clipboard/paste.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'apps/web/src/lib/commands/timeline/clipboard/paste.ts') diff --git a/apps/web/src/lib/commands/timeline/clipboard/paste.ts b/apps/web/src/lib/commands/timeline/clipboard/paste.ts index 347c4f68..58199a94 100644 --- a/apps/web/src/lib/commands/timeline/clipboard/paste.ts +++ b/apps/web/src/lib/commands/timeline/clipboard/paste.ts @@ -1,9 +1,17 @@ -import { Command, type CommandResult } from "@/lib/commands/base-command"; +import { + Command, + createElementSelectionResult, + type CommandResult, +} from "@/lib/commands/base-command"; import { EditorCore } from "@/core"; import type { SceneTracks, TimelineElement } from "@/lib/timeline"; import type { ElementClipboardItem } from "@/lib/clipboard"; import { generateUUID } from "@/utils/id"; -import { applyPlacement, resolveTrackPlacement, enforceMainTrackStart } from "@/lib/timeline/placement"; +import { + applyPlacement, + resolveTrackPlacement, + enforceMainTrackStart, +} from "@/lib/timeline/placement"; import { cloneAnimations } from "@/lib/animation"; export class PasteCommand extends Command { @@ -122,7 +130,7 @@ export class PasteCommand extends Command { editor.timeline.updateTracks(updatedTracks); if (this.pastedElements.length > 0) { - return { select: this.pastedElements }; + return createElementSelectionResult(this.pastedElements); } return undefined; } @@ -183,4 +191,3 @@ function buildPastedElements({ return elementsToAdd; } - -- cgit v1.3.1