Skip to content

Commit 33db65c

Browse files
committed
Allow calc
1 parent b00f452 commit 33db65c

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,10 @@ export const AnimationPanelContent = ({ onChange, value, type }: Props) => {
269269
}}
270270
/>
271271
</Grid>
272-
<Grid gap={1} align={"center"} css={{ gridTemplateColumns: "1fr 1fr" }}>
272+
<Grid gap={1} align={"center"} css={{ gridTemplateColumns: "2fr 1fr" }}>
273273
<Label htmlFor={fieldIds.rangeStartName}>Range Start</Label>
274274
<Label htmlFor={fieldIds.rangeStartValue}>Value</Label>
275+
275276
<Select
276277
id={fieldIds.rangeStartName}
277278
options={timelineRangeNames}
@@ -333,6 +334,7 @@ export const AnimationPanelContent = ({ onChange, value, type }: Props) => {
333334
});
334335
}}
335336
/>
337+
336338
<Label htmlFor={fieldIds.rangeEndName}>Range End</Label>
337339
<Label htmlFor={fieldIds.rangeEndValue}>Value</Label>
338340
<Select

packages/sdk/src/schema/animation-schema.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,17 @@ export const RANGE_UNITS = [
5959

6060
export const rangeUnitSchema = literalUnion(RANGE_UNITS);
6161

62-
export const rangeUnitValueSchema = z.object({
63-
type: z.literal("unit"),
64-
value: z.number(),
65-
unit: rangeUnitSchema,
66-
});
62+
export const rangeUnitValueSchema = z.union([
63+
z.object({
64+
type: z.literal("unit"),
65+
value: z.number(),
66+
unit: rangeUnitSchema,
67+
}),
68+
z.object({
69+
type: z.literal("unparsed"),
70+
value: z.string(),
71+
}),
72+
]);
6773

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

0 commit comments

Comments
 (0)