feat: image resizer

This commit is contained in:
Ivan Rezchikov
2026-07-13 19:18:15 +03:00
parent d59b4a79f8
commit 22122aedeb
5 changed files with 61 additions and 19 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ export type BlockContent =
| { type: "QUOTE"; text: string; author?: string }
| { type: "DIVIDER" }
| { type: "CALLOUT"; title: string; text: string }
| { type: "IMAGE"; url: string; caption?: string }
| { type: "IMAGE"; url: string; caption?: string; width?: number }
| { type: "LIST"; style: "BULLET" | "ORDERED"; items: string[] }
| { type: "TABLE"; headers: string[]; rows: string[][] }
| { type: "LINK"; label: string; href: string }
+1 -1
View File
@@ -6,7 +6,7 @@ const blockContentSchema = z.discriminatedUnion("type", [
z.object({ type: z.literal("QUOTE"), text: z.string(), author: z.string().optional() }),
z.object({ type: z.literal("DIVIDER") }),
z.object({ type: z.literal("CALLOUT"), title: z.string(), text: z.string() }),
z.object({ type: z.literal("IMAGE"), url: z.string(), caption: z.string().optional() }),
z.object({ type: z.literal("IMAGE"), url: z.string(), caption: z.string().optional(), width: z.number().min(1).max(100).optional() }),
z.object({ type: z.literal("LIST"), style: z.enum(["BULLET", "ORDERED"]), items: z.array(z.string()) }),
z.object({ type: z.literal("TABLE"), headers: z.array(z.string()), rows: z.array(z.array(z.string())) }),
z.object({ type: z.literal("LINK"), label: z.string(), href: z.string() }),