From dc0b57cd6a5517dc6b57c6ebd1d0f6f7c8ee5e40 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sun, 8 Feb 2026 18:01:45 +0100 Subject: refactor: replace text-specific update command with generic --- apps/web/src/core/managers/timeline-manager.ts | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'apps/web/src/core/managers') diff --git a/apps/web/src/core/managers/timeline-manager.ts b/apps/web/src/core/managers/timeline-manager.ts index 867df3a8..22cba52d 100644 --- a/apps/web/src/core/managers/timeline-manager.ts +++ b/apps/web/src/core/managers/timeline-manager.ts @@ -2,7 +2,6 @@ import type { EditorCore } from "@/core"; import type { TrackType, TimelineTrack, - TextElement, TimelineElement, ClipboardItem, } from "@/types/timeline"; @@ -19,7 +18,7 @@ import { DuplicateElementsCommand, ToggleElementsVisibilityCommand, ToggleElementsMutedCommand, - UpdateTextElementCommand, + UpdateElementCommand, SplitElementsCommand, PasteCommand, UpdateElementStartTimeCommand, @@ -199,31 +198,16 @@ export class TimelineManager { this.editor.command.execute({ command }); } - updateTextElement({ + updateElement({ trackId, elementId, updates, }: { trackId: string; elementId: string; - updates: Partial< - Pick< - TextElement, - | "content" - | "fontSize" - | "fontFamily" - | "color" - | "backgroundColor" - | "textAlign" - | "fontWeight" - | "fontStyle" - | "textDecoration" - | "transform" - | "opacity" - > - >; + updates: Partial>; }): void { - const command = new UpdateTextElementCommand(trackId, elementId, updates); + const command = new UpdateElementCommand(trackId, elementId, updates); this.editor.command.execute({ command }); } -- cgit v1.3.1