Skip to content

Commit

Permalink
Allow calc
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed Feb 18, 2025
1 parent b00f452 commit 33db65c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,10 @@ export const AnimationPanelContent = ({ onChange, value, type }: Props) => {
}}
/>
</Grid>
<Grid gap={1} align={"center"} css={{ gridTemplateColumns: "1fr 1fr" }}>
<Grid gap={1} align={"center"} css={{ gridTemplateColumns: "2fr 1fr" }}>
<Label htmlFor={fieldIds.rangeStartName}>Range Start</Label>
<Label htmlFor={fieldIds.rangeStartValue}>Value</Label>

<Select
id={fieldIds.rangeStartName}
options={timelineRangeNames}
Expand Down Expand Up @@ -333,6 +334,7 @@ export const AnimationPanelContent = ({ onChange, value, type }: Props) => {
});
}}
/>

<Label htmlFor={fieldIds.rangeEndName}>Range End</Label>
<Label htmlFor={fieldIds.rangeEndValue}>Value</Label>
<Select
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-animation/private-src
16 changes: 11 additions & 5 deletions packages/sdk/src/schema/animation-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ export const RANGE_UNITS = [

export const rangeUnitSchema = literalUnion(RANGE_UNITS);

export const rangeUnitValueSchema = z.object({
type: z.literal("unit"),
value: z.number(),
unit: rangeUnitSchema,
});
export const rangeUnitValueSchema = z.union([
z.object({
type: z.literal("unit"),
value: z.number(),
unit: rangeUnitSchema,
}),
z.object({
type: z.literal("unparsed"),
value: z.string(),
}),
]);

// @todo: Fix Keyframe Styles
export const keyframeStylesSchema = z.record(StyleValue);
Expand Down

0 comments on commit 33db65c

Please sign in to comment.