From 8db3bead13441a5882d8689dfc6a9f09c82375d9 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 25 Mar 2026 16:47:22 +0100 Subject: feat: masks, properties refactor, shaders, storage migrations, and more --- apps/web/src/lib/animation/keyframe-query.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'apps/web/src/lib/animation/keyframe-query.ts') diff --git a/apps/web/src/lib/animation/keyframe-query.ts b/apps/web/src/lib/animation/keyframe-query.ts index 6626e3e8..753e31d0 100644 --- a/apps/web/src/lib/animation/keyframe-query.ts +++ b/apps/web/src/lib/animation/keyframe-query.ts @@ -1,9 +1,10 @@ import { TIME_EPSILON_SECONDS } from "@/constants/animation-constants"; import type { - AnimationPropertyPath, + AnimationPath, ElementAnimations, ElementKeyframe, -} from "@/types/animation"; +} from "@/lib/animation/types"; +import { isAnimationPath } from "./target-resolver"; export function getElementKeyframes({ animations, @@ -16,12 +17,16 @@ export function getElementKeyframes({ return Object.entries(animations.channels).flatMap( ([propertyPath, channel]) => { - if (!channel || channel.keyframes.length === 0) { + if ( + !channel || + channel.keyframes.length === 0 || + !isAnimationPath({ propertyPath }) + ) { return []; } return channel.keyframes.map((keyframe) => ({ - propertyPath: propertyPath as AnimationPropertyPath, + propertyPath, id: keyframe.id, time: keyframe.time, value: keyframe.value, @@ -36,7 +41,7 @@ export function hasKeyframesForPath({ propertyPath, }: { animations: ElementAnimations | undefined; - propertyPath: AnimationPropertyPath; + propertyPath: AnimationPath; }): boolean { const channel = animations?.channels[propertyPath]; return Boolean(channel && channel.keyframes.length > 0); @@ -48,7 +53,7 @@ export function getKeyframeAtTime({ time, }: { animations: ElementAnimations | undefined; - propertyPath: AnimationPropertyPath; + propertyPath: AnimationPath; time: number; }): ElementKeyframe | null { const channel = animations?.channels[propertyPath]; -- cgit v1.3.1