diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-02-08 18:01:45 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-02-08 18:01:45 +0100 |
| commit | dc0b57cd6a5517dc6b57c6ebd1d0f6f7c8ee5e40 (patch) | |
| tree | 065b4428b3a92266e2e3ea9c24023149f48c60e9 /apps/web/src/core/managers/timeline-manager.ts | |
| parent | a218a52d2d6ffa3d4b358d5a50e0816c16ebd51e (diff) | |
| download | opencut-dc0b57cd6a5517dc6b57c6ebd1d0f6f7c8ee5e40.tar.gz | |
refactor: replace text-specific update command with generic
Diffstat (limited to 'apps/web/src/core/managers/timeline-manager.ts')
| -rw-r--r-- | apps/web/src/core/managers/timeline-manager.ts | 24 |
1 files changed, 4 insertions, 20 deletions
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<Record<string, unknown>>; }): void { - const command = new UpdateTextElementCommand(trackId, elementId, updates); + const command = new UpdateElementCommand(trackId, elementId, updates); this.editor.command.execute({ command }); } |
