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 ++++++------------------------ 1 file changed, 8 insertions(+), 32 deletions(-) (limited to 'apps/web/src/timeline/animation-targets.ts') 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({ -- cgit v1.3.1