From b8d08df244b97b1d3131cb2d076166838189eeb0 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 29 Apr 2026 01:59:46 +0200 Subject: chore: cleanup --- apps/web/src/timeline/animation-targets.ts | 40 ++++++------------------------ apps/web/src/timeline/types.ts | 12 --------- 2 files changed, 8 insertions(+), 44 deletions(-) (limited to 'apps/web/src/timeline') diff --git a/apps/web/src/timeline/animation-targets.ts b/apps/web/src/timeline/animation-targets.ts index 8cccc78f..fcdb2915 100644 --- a/apps/web/src/timeline/animation-targets.ts +++ b/apps/web/src/timeline/animation-targets.ts @@ -23,9 +23,6 @@ import { } from "@/params"; import { getElementParam, - readElementParamValue, - writeElementParamValue, - type ElementParamDefinition, } from "@/params/registry"; import type { TimelineElement } from "@/timeline"; import { isVisualElement } from "@/timeline/element-utils"; @@ -96,35 +93,14 @@ function buildElementParamDescriptor({ return null; } - return buildTimelineElementParamDescriptor({ element, param }); -} - -function buildTimelineElementParamDescriptor({ - element, - param, -}: { - element: TimelineElement; - param: ElementParamDefinition; -}): AnimationPathDescriptor | null { - if (param.keyframable === false) { - return null; - } - - return { - kind: getParamValueKind({ param }), - defaultInterpolation: getParamDefaultInterpolation({ param }), - numericRanges: paramNumericRanges({ param }), - coerceValue: ({ value }) => coerceParamValue({ param, value }), - getBaseValue: () => readElementParamValue({ element, param }), - setBaseValue: ({ value }) => { - const coercedValue = coerceParamValue({ param, value }); - if (coercedValue === null) { - return element; - } - - return writeElementParamValue({ element, param, value: coercedValue }); - }, - }; + return buildParamDescriptor({ + param, + baseParams: element.params, + setParams: (params) => ({ + ...element, + params, + }), + }); } function buildGraphicParamDescriptor({ diff --git a/apps/web/src/timeline/types.ts b/apps/web/src/timeline/types.ts index c009bc16..5b3e4d29 100644 --- a/apps/web/src/timeline/types.ts +++ b/apps/web/src/timeline/types.ts @@ -117,8 +117,6 @@ interface BaseTimelineElement { export interface VideoElement extends BaseTimelineElement { type: "video"; mediaId: string; - volume?: number; - muted?: boolean; isSourceAudioEnabled?: boolean; hidden?: boolean; retime?: RetimeConfig; @@ -134,16 +132,6 @@ export interface ImageElement extends BaseTimelineElement { masks?: Mask[]; } -export interface TextBackground { - enabled: boolean; - color: string; - cornerRadius?: number; - paddingX?: number; - paddingY?: number; - offsetX?: number; - offsetY?: number; -} - export interface TextElement extends BaseTimelineElement { type: "text"; hidden?: boolean; -- cgit v1.3.1