fix: support both legacy and current currentItemRoundness formats
Add union type to accept both the old object format {type, value} and
the new enum format for backwards compatibility with existing drawings.
This commit is contained in:
+10
-1
@@ -319,7 +319,16 @@ export const appStateSchema = z
|
|||||||
.enum(["solid", "dashed", "dotted"])
|
.enum(["solid", "dashed", "dotted"])
|
||||||
.optional()
|
.optional()
|
||||||
.nullable(),
|
.nullable(),
|
||||||
currentItemRoundness: z.enum(["sharp", "round"]).optional().nullable(),
|
currentItemRoundness: z
|
||||||
|
.union([
|
||||||
|
z.enum(["sharp", "round"]),
|
||||||
|
z.object({
|
||||||
|
type: z.enum(["round", "sharp"]),
|
||||||
|
value: z.number().finite().min(0).max(1),
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
.optional()
|
||||||
|
.nullable(),
|
||||||
currentItemFontSize: z
|
currentItemFontSize: z
|
||||||
.number()
|
.number()
|
||||||
.finite()
|
.finite()
|
||||||
|
|||||||
Reference in New Issue
Block a user