fix: clamp page margin values to [0, 100] to prevent crash on paste (#3277)

Co-authored-by: Amruth Pillai <im.amruth@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
EMRAN
2026-07-29 18:13:42 +02:00
committed by GitHub
co-authored by Amruth Pillai Cursor Agent
parent b303b89758
commit 4ac19f81b3
3 changed files with 39 additions and 7 deletions
+2 -2
View File
@@ -444,8 +444,8 @@ export const layoutSchema = z.object({
export const pageSchema = z.object({
gapX: z.number().min(0).describe("The horizontal gap between the sections of the page, defined in points (pt)."),
gapY: z.number().min(0).describe("The vertical gap between the sections of the page, defined in points (pt)."),
marginX: z.number().min(0).describe("The horizontal margin of the page, defined in points (pt)."),
marginY: z.number().min(0).describe("The vertical margin of the page, defined in points (pt)."),
marginX: z.number().min(0).max(100).catch(14).describe("The horizontal margin of the page, defined in points (pt)."),
marginY: z.number().min(0).max(100).catch(12).describe("The vertical margin of the page, defined in points (pt)."),
format: z
.enum(["a4", "letter", "free-form"])
.describe("The format of the page. Can be 'a4', 'letter', or 'free-form'.")