From bd9ec023eefc4b5d26fa8b66c4338e97104f0f96 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 1 Apr 2026 19:27:49 +0200 Subject: refactor: split constants by domain and isolate timeline panel from core --- apps/web/src/lib/commands/timeline/element/insert-element.ts | 4 ++-- .../src/lib/commands/timeline/element/retime/update-element-retime.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/web/src/lib/commands/timeline/element') diff --git a/apps/web/src/lib/commands/timeline/element/insert-element.ts b/apps/web/src/lib/commands/timeline/element/insert-element.ts index cdff3565..2119d219 100644 --- a/apps/web/src/lib/commands/timeline/element/insert-element.ts +++ b/apps/web/src/lib/commands/timeline/element/insert-element.ts @@ -9,7 +9,7 @@ import type { import { generateUUID } from "@/utils/id"; import { requiresMediaId } from "@/lib/timeline/element-utils"; import type { MediaAsset } from "@/lib/media/types"; -import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants"; +import { DEFAULT_NEW_ELEMENT_DURATION_SECONDS } from "@/lib/timeline/creation"; import { graphicsRegistry, registerDefaultGraphics } from "@/lib/graphics"; import { applyPlacement, @@ -136,7 +136,7 @@ export class InsertElementCommand extends Command { startTime: element.startTime, trimStart: element.trimStart ?? 0, trimEnd: element.trimEnd ?? 0, - duration: element.duration ?? TIMELINE_CONSTANTS.DEFAULT_ELEMENT_DURATION, + duration: element.duration ?? DEFAULT_NEW_ELEMENT_DURATION_SECONDS, } as TimelineElement; } diff --git a/apps/web/src/lib/commands/timeline/element/retime/update-element-retime.ts b/apps/web/src/lib/commands/timeline/element/retime/update-element-retime.ts index 4057ec41..f0574ce7 100644 --- a/apps/web/src/lib/commands/timeline/element/retime/update-element-retime.ts +++ b/apps/web/src/lib/commands/timeline/element/retime/update-element-retime.ts @@ -1,5 +1,5 @@ import { EditorCore } from "@/core"; -import { clampRetimeRate } from "@/constants/retime-constants"; +import { clampRetimeRate } from "@/lib/retime/rate"; import { clampAnimationsToDuration } from "@/lib/animation"; import { Command } from "@/lib/commands/base-command"; import { getTimelineDurationForSourceSpan, getSourceSpanAtClipTime } from "@/lib/retime"; -- cgit v1.3.1