@json-render/image 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js ADDED
@@ -0,0 +1,248 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/server.ts
21
+ var server_exports = {};
22
+ __export(server_exports, {
23
+ schema: () => schema,
24
+ standardComponentDefinitions: () => standardComponentDefinitions
25
+ });
26
+ module.exports = __toCommonJS(server_exports);
27
+
28
+ // src/schema.ts
29
+ var import_core = require("@json-render/core");
30
+ var schema = (0, import_core.defineSchema)(
31
+ (s) => ({
32
+ spec: s.object({
33
+ root: s.string(),
34
+ elements: s.record(
35
+ s.object({
36
+ type: s.ref("catalog.components"),
37
+ props: s.propsOf("catalog.components"),
38
+ children: s.array(s.string()),
39
+ visible: s.any()
40
+ })
41
+ )
42
+ }),
43
+ catalog: s.object({
44
+ components: s.map({
45
+ props: s.zod(),
46
+ slots: s.array(s.string()),
47
+ description: s.string(),
48
+ example: s.any()
49
+ })
50
+ })
51
+ }),
52
+ {
53
+ defaultRules: [
54
+ "The root element MUST be a Frame component. It defines the image dimensions (width, height) and background.",
55
+ "Frame width and height determine the output image size. Common sizes: 1200x630 (OG image), 1080x1080 (social square), 1920x1080 (banner).",
56
+ "Use Row for horizontal layouts and Column for vertical layouts. Both support gap, align, and justify props.",
57
+ "All text content must use Heading or Text components. Raw strings are not supported.",
58
+ "Image src must be a fully qualified URL. For placeholder images, use https://picsum.photos/{width}/{height}?random={n}.",
59
+ "Satori renders a subset of CSS: flexbox layout, borders, backgrounds, text styling. Absolute positioning is supported via position/top/left/right/bottom.",
60
+ "CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist."
61
+ ]
62
+ }
63
+ );
64
+
65
+ // src/catalog.ts
66
+ var import_zod = require("zod");
67
+ var standardComponentDefinitions = {
68
+ // ==========================================================================
69
+ // Root
70
+ // ==========================================================================
71
+ Frame: {
72
+ props: import_zod.z.object({
73
+ width: import_zod.z.number(),
74
+ height: import_zod.z.number(),
75
+ backgroundColor: import_zod.z.string().nullable(),
76
+ padding: import_zod.z.number().nullable(),
77
+ display: import_zod.z.enum(["flex", "none"]).nullable(),
78
+ flexDirection: import_zod.z.enum(["row", "column"]).nullable(),
79
+ alignItems: import_zod.z.enum(["flex-start", "center", "flex-end", "stretch"]).nullable(),
80
+ justifyContent: import_zod.z.enum([
81
+ "flex-start",
82
+ "center",
83
+ "flex-end",
84
+ "space-between",
85
+ "space-around"
86
+ ]).nullable()
87
+ }),
88
+ slots: ["default"],
89
+ description: "Root image container. Defines the output image dimensions and background. Must be the root element.",
90
+ example: { width: 1200, height: 630, backgroundColor: "#ffffff" }
91
+ },
92
+ // ==========================================================================
93
+ // Layout Components
94
+ // ==========================================================================
95
+ Box: {
96
+ props: import_zod.z.object({
97
+ padding: import_zod.z.number().nullable(),
98
+ paddingTop: import_zod.z.number().nullable(),
99
+ paddingBottom: import_zod.z.number().nullable(),
100
+ paddingLeft: import_zod.z.number().nullable(),
101
+ paddingRight: import_zod.z.number().nullable(),
102
+ margin: import_zod.z.number().nullable(),
103
+ backgroundColor: import_zod.z.string().nullable(),
104
+ borderWidth: import_zod.z.number().nullable(),
105
+ borderColor: import_zod.z.string().nullable(),
106
+ borderRadius: import_zod.z.number().nullable(),
107
+ flex: import_zod.z.number().nullable(),
108
+ width: import_zod.z.union([import_zod.z.number(), import_zod.z.string()]).nullable(),
109
+ height: import_zod.z.union([import_zod.z.number(), import_zod.z.string()]).nullable(),
110
+ alignItems: import_zod.z.enum(["flex-start", "center", "flex-end", "stretch"]).nullable(),
111
+ justifyContent: import_zod.z.enum([
112
+ "flex-start",
113
+ "center",
114
+ "flex-end",
115
+ "space-between",
116
+ "space-around"
117
+ ]).nullable(),
118
+ flexDirection: import_zod.z.enum(["row", "column"]).nullable(),
119
+ position: import_zod.z.enum(["relative", "absolute"]).nullable(),
120
+ top: import_zod.z.number().nullable(),
121
+ left: import_zod.z.number().nullable(),
122
+ right: import_zod.z.number().nullable(),
123
+ bottom: import_zod.z.number().nullable(),
124
+ overflow: import_zod.z.enum(["visible", "hidden"]).nullable()
125
+ }),
126
+ slots: ["default"],
127
+ description: "Generic container with padding, margin, background, border, and flex alignment. Supports absolute positioning.",
128
+ example: {
129
+ padding: 20,
130
+ backgroundColor: "#f9f9f9",
131
+ borderRadius: 8,
132
+ alignItems: "center"
133
+ }
134
+ },
135
+ Row: {
136
+ props: import_zod.z.object({
137
+ gap: import_zod.z.number().nullable(),
138
+ alignItems: import_zod.z.enum(["flex-start", "center", "flex-end", "stretch"]).nullable(),
139
+ justifyContent: import_zod.z.enum([
140
+ "flex-start",
141
+ "center",
142
+ "flex-end",
143
+ "space-between",
144
+ "space-around"
145
+ ]).nullable(),
146
+ padding: import_zod.z.number().nullable(),
147
+ flex: import_zod.z.number().nullable(),
148
+ wrap: import_zod.z.boolean().nullable()
149
+ }),
150
+ slots: ["default"],
151
+ description: "Horizontal flex layout. Use for placing elements side by side.",
152
+ example: { gap: 10, alignItems: "center" }
153
+ },
154
+ Column: {
155
+ props: import_zod.z.object({
156
+ gap: import_zod.z.number().nullable(),
157
+ alignItems: import_zod.z.enum(["flex-start", "center", "flex-end", "stretch"]).nullable(),
158
+ justifyContent: import_zod.z.enum([
159
+ "flex-start",
160
+ "center",
161
+ "flex-end",
162
+ "space-between",
163
+ "space-around"
164
+ ]).nullable(),
165
+ padding: import_zod.z.number().nullable(),
166
+ flex: import_zod.z.number().nullable()
167
+ }),
168
+ slots: ["default"],
169
+ description: "Vertical flex layout. Use for stacking elements top to bottom.",
170
+ example: { gap: 8, padding: 10 }
171
+ },
172
+ // ==========================================================================
173
+ // Content Components
174
+ // ==========================================================================
175
+ Heading: {
176
+ props: import_zod.z.object({
177
+ text: import_zod.z.string(),
178
+ level: import_zod.z.enum(["h1", "h2", "h3", "h4"]).nullable(),
179
+ color: import_zod.z.string().nullable(),
180
+ align: import_zod.z.enum(["left", "center", "right"]).nullable(),
181
+ letterSpacing: import_zod.z.union([import_zod.z.number(), import_zod.z.string()]).nullable(),
182
+ lineHeight: import_zod.z.number().nullable()
183
+ }),
184
+ slots: [],
185
+ description: "Heading text at various levels. h1 is largest, h4 is smallest.",
186
+ example: { text: "Hello World", level: "h1", color: "#000000" }
187
+ },
188
+ Text: {
189
+ props: import_zod.z.object({
190
+ text: import_zod.z.string(),
191
+ fontSize: import_zod.z.number().nullable(),
192
+ color: import_zod.z.string().nullable(),
193
+ align: import_zod.z.enum(["left", "center", "right"]).nullable(),
194
+ fontWeight: import_zod.z.enum(["normal", "bold"]).nullable(),
195
+ fontStyle: import_zod.z.enum(["normal", "italic"]).nullable(),
196
+ lineHeight: import_zod.z.number().nullable(),
197
+ letterSpacing: import_zod.z.union([import_zod.z.number(), import_zod.z.string()]).nullable(),
198
+ textDecoration: import_zod.z.enum(["none", "underline", "line-through"]).nullable()
199
+ }),
200
+ slots: [],
201
+ description: "Body text with configurable size, color, weight, and alignment.",
202
+ example: { text: "Some content here.", fontSize: 16, color: "#333333" }
203
+ },
204
+ Image: {
205
+ props: import_zod.z.object({
206
+ src: import_zod.z.string(),
207
+ width: import_zod.z.number().nullable(),
208
+ height: import_zod.z.number().nullable(),
209
+ borderRadius: import_zod.z.number().nullable(),
210
+ objectFit: import_zod.z.enum(["contain", "cover", "fill", "none"]).nullable()
211
+ }),
212
+ slots: [],
213
+ description: "Image from a URL. Specify width and/or height to control size. For placeholder images use https://picsum.photos/{width}/{height}?random={n}.",
214
+ example: {
215
+ src: "https://picsum.photos/400/300?random=1",
216
+ width: 400,
217
+ height: 300
218
+ }
219
+ },
220
+ // ==========================================================================
221
+ // Decorative Components
222
+ // ==========================================================================
223
+ Divider: {
224
+ props: import_zod.z.object({
225
+ color: import_zod.z.string().nullable(),
226
+ thickness: import_zod.z.number().nullable(),
227
+ marginTop: import_zod.z.number().nullable(),
228
+ marginBottom: import_zod.z.number().nullable()
229
+ }),
230
+ slots: [],
231
+ description: "Horizontal line separator between content sections.",
232
+ example: { color: "#e5e7eb", thickness: 1 }
233
+ },
234
+ Spacer: {
235
+ props: import_zod.z.object({
236
+ height: import_zod.z.number().nullable()
237
+ }),
238
+ slots: [],
239
+ description: "Empty vertical space between elements.",
240
+ example: { height: 20 }
241
+ }
242
+ };
243
+ // Annotate the CommonJS export names for ESM import in node:
244
+ 0 && (module.exports = {
245
+ schema,
246
+ standardComponentDefinitions
247
+ });
248
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server.ts","../src/schema.ts","../src/catalog.ts"],"sourcesContent":["// Server-safe entry point: schema and catalog definitions only.\n// Does not import React or Satori.\n\nexport { schema, type ImageSchema, type ImageSpec } from \"./schema\";\n\nexport {\n standardComponentDefinitions,\n type StandardComponentDefinitions,\n type StandardComponentProps,\n} from \"./catalog\";\n\nexport type { Spec } from \"@json-render/core\";\n\nexport type {\n SetState,\n StateModel,\n ComponentContext,\n ComponentFn,\n Components,\n} from \"./catalog-types\";\n","import { defineSchema } from \"@json-render/core\";\n\n/**\n * The schema for @json-render/image\n *\n * Defines:\n * - Spec: A flat tree of elements with keys, types, props, and children references\n * - Catalog: Components with props schemas\n *\n * Reuses the same { root, elements } spec format as the React and React PDF renderers.\n */\nexport const schema = defineSchema(\n (s) => ({\n spec: s.object({\n root: s.string(),\n elements: s.record(\n s.object({\n type: s.ref(\"catalog.components\"),\n props: s.propsOf(\"catalog.components\"),\n children: s.array(s.string()),\n visible: s.any(),\n }),\n ),\n }),\n\n catalog: s.object({\n components: s.map({\n props: s.zod(),\n slots: s.array(s.string()),\n description: s.string(),\n example: s.any(),\n }),\n }),\n }),\n {\n defaultRules: [\n \"The root element MUST be a Frame component. It defines the image dimensions (width, height) and background.\",\n \"Frame width and height determine the output image size. Common sizes: 1200x630 (OG image), 1080x1080 (social square), 1920x1080 (banner).\",\n \"Use Row for horizontal layouts and Column for vertical layouts. Both support gap, align, and justify props.\",\n \"All text content must use Heading or Text components. Raw strings are not supported.\",\n \"Image src must be a fully qualified URL. For placeholder images, use https://picsum.photos/{width}/{height}?random={n}.\",\n \"Satori renders a subset of CSS: flexbox layout, borders, backgrounds, text styling. Absolute positioning is supported via position/top/left/right/bottom.\",\n \"CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist.\",\n ],\n },\n);\n\nexport type ImageSchema = typeof schema;\n\nexport type ImageSpec<TCatalog> = typeof schema extends {\n createCatalog: (catalog: TCatalog) => { _specType: infer S };\n}\n ? S\n : never;\n","import { z } from \"zod\";\n\n/**\n * Standard component definitions for image catalogs.\n *\n * These define the available image components with their Zod prop schemas.\n * All components render to Satori-compatible JSX (HTML-like elements with\n * inline CSS flexbox styles).\n */\nexport const standardComponentDefinitions = {\n // ==========================================================================\n // Root\n // ==========================================================================\n\n Frame: {\n props: z.object({\n width: z.number(),\n height: z.number(),\n backgroundColor: z.string().nullable(),\n padding: z.number().nullable(),\n display: z.enum([\"flex\", \"none\"]).nullable(),\n flexDirection: z.enum([\"row\", \"column\"]).nullable(),\n alignItems: z\n .enum([\"flex-start\", \"center\", \"flex-end\", \"stretch\"])\n .nullable(),\n justifyContent: z\n .enum([\n \"flex-start\",\n \"center\",\n \"flex-end\",\n \"space-between\",\n \"space-around\",\n ])\n .nullable(),\n }),\n slots: [\"default\"],\n description:\n \"Root image container. Defines the output image dimensions and background. Must be the root element.\",\n example: { width: 1200, height: 630, backgroundColor: \"#ffffff\" },\n },\n\n // ==========================================================================\n // Layout Components\n // ==========================================================================\n\n Box: {\n props: z.object({\n padding: z.number().nullable(),\n paddingTop: z.number().nullable(),\n paddingBottom: z.number().nullable(),\n paddingLeft: z.number().nullable(),\n paddingRight: z.number().nullable(),\n margin: z.number().nullable(),\n backgroundColor: z.string().nullable(),\n borderWidth: z.number().nullable(),\n borderColor: z.string().nullable(),\n borderRadius: z.number().nullable(),\n flex: z.number().nullable(),\n width: z.union([z.number(), z.string()]).nullable(),\n height: z.union([z.number(), z.string()]).nullable(),\n alignItems: z\n .enum([\"flex-start\", \"center\", \"flex-end\", \"stretch\"])\n .nullable(),\n justifyContent: z\n .enum([\n \"flex-start\",\n \"center\",\n \"flex-end\",\n \"space-between\",\n \"space-around\",\n ])\n .nullable(),\n flexDirection: z.enum([\"row\", \"column\"]).nullable(),\n position: z.enum([\"relative\", \"absolute\"]).nullable(),\n top: z.number().nullable(),\n left: z.number().nullable(),\n right: z.number().nullable(),\n bottom: z.number().nullable(),\n overflow: z.enum([\"visible\", \"hidden\"]).nullable(),\n }),\n slots: [\"default\"],\n description:\n \"Generic container with padding, margin, background, border, and flex alignment. Supports absolute positioning.\",\n example: {\n padding: 20,\n backgroundColor: \"#f9f9f9\",\n borderRadius: 8,\n alignItems: \"center\",\n },\n },\n\n Row: {\n props: z.object({\n gap: z.number().nullable(),\n alignItems: z\n .enum([\"flex-start\", \"center\", \"flex-end\", \"stretch\"])\n .nullable(),\n justifyContent: z\n .enum([\n \"flex-start\",\n \"center\",\n \"flex-end\",\n \"space-between\",\n \"space-around\",\n ])\n .nullable(),\n padding: z.number().nullable(),\n flex: z.number().nullable(),\n wrap: z.boolean().nullable(),\n }),\n slots: [\"default\"],\n description:\n \"Horizontal flex layout. Use for placing elements side by side.\",\n example: { gap: 10, alignItems: \"center\" },\n },\n\n Column: {\n props: z.object({\n gap: z.number().nullable(),\n alignItems: z\n .enum([\"flex-start\", \"center\", \"flex-end\", \"stretch\"])\n .nullable(),\n justifyContent: z\n .enum([\n \"flex-start\",\n \"center\",\n \"flex-end\",\n \"space-between\",\n \"space-around\",\n ])\n .nullable(),\n padding: z.number().nullable(),\n flex: z.number().nullable(),\n }),\n slots: [\"default\"],\n description:\n \"Vertical flex layout. Use for stacking elements top to bottom.\",\n example: { gap: 8, padding: 10 },\n },\n\n // ==========================================================================\n // Content Components\n // ==========================================================================\n\n Heading: {\n props: z.object({\n text: z.string(),\n level: z.enum([\"h1\", \"h2\", \"h3\", \"h4\"]).nullable(),\n color: z.string().nullable(),\n align: z.enum([\"left\", \"center\", \"right\"]).nullable(),\n letterSpacing: z.union([z.number(), z.string()]).nullable(),\n lineHeight: z.number().nullable(),\n }),\n slots: [],\n description:\n \"Heading text at various levels. h1 is largest, h4 is smallest.\",\n example: { text: \"Hello World\", level: \"h1\", color: \"#000000\" },\n },\n\n Text: {\n props: z.object({\n text: z.string(),\n fontSize: z.number().nullable(),\n color: z.string().nullable(),\n align: z.enum([\"left\", \"center\", \"right\"]).nullable(),\n fontWeight: z.enum([\"normal\", \"bold\"]).nullable(),\n fontStyle: z.enum([\"normal\", \"italic\"]).nullable(),\n lineHeight: z.number().nullable(),\n letterSpacing: z.union([z.number(), z.string()]).nullable(),\n textDecoration: z.enum([\"none\", \"underline\", \"line-through\"]).nullable(),\n }),\n slots: [],\n description:\n \"Body text with configurable size, color, weight, and alignment.\",\n example: { text: \"Some content here.\", fontSize: 16, color: \"#333333\" },\n },\n\n Image: {\n props: z.object({\n src: z.string(),\n width: z.number().nullable(),\n height: z.number().nullable(),\n borderRadius: z.number().nullable(),\n objectFit: z.enum([\"contain\", \"cover\", \"fill\", \"none\"]).nullable(),\n }),\n slots: [],\n description:\n \"Image from a URL. Specify width and/or height to control size. For placeholder images use https://picsum.photos/{width}/{height}?random={n}.\",\n example: {\n src: \"https://picsum.photos/400/300?random=1\",\n width: 400,\n height: 300,\n },\n },\n\n // ==========================================================================\n // Decorative Components\n // ==========================================================================\n\n Divider: {\n props: z.object({\n color: z.string().nullable(),\n thickness: z.number().nullable(),\n marginTop: z.number().nullable(),\n marginBottom: z.number().nullable(),\n }),\n slots: [],\n description: \"Horizontal line separator between content sections.\",\n example: { color: \"#e5e7eb\", thickness: 1 },\n },\n\n Spacer: {\n props: z.object({\n height: z.number().nullable(),\n }),\n slots: [],\n description: \"Empty vertical space between elements.\",\n example: { height: 20 },\n },\n};\n\nexport type StandardComponentDefinitions = typeof standardComponentDefinitions;\n\nexport type StandardComponentProps<\n K extends keyof StandardComponentDefinitions,\n> = StandardComponentDefinitions[K][\"props\"] extends { _output: infer O }\n ? O\n : z.output<StandardComponentDefinitions[K][\"props\"]>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA6B;AAWtB,IAAM,aAAS;AAAA,EACpB,CAAC,OAAO;AAAA,IACN,MAAM,EAAE,OAAO;AAAA,MACb,MAAM,EAAE,OAAO;AAAA,MACf,UAAU,EAAE;AAAA,QACV,EAAE,OAAO;AAAA,UACP,MAAM,EAAE,IAAI,oBAAoB;AAAA,UAChC,OAAO,EAAE,QAAQ,oBAAoB;AAAA,UACrC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,UAC5B,SAAS,EAAE,IAAI;AAAA,QACjB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,IAED,SAAS,EAAE,OAAO;AAAA,MAChB,YAAY,EAAE,IAAI;AAAA,QAChB,OAAO,EAAE,IAAI;AAAA,QACb,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,QACzB,aAAa,EAAE,OAAO;AAAA,QACtB,SAAS,EA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IACnE,CAAC;AAAA,IACD,OAAO,CAAC;AAAA,IACR,aACE;AAAA,IACF,SAAS;AAAA,MACP,KAAK;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS;AAAA,IACP,OAAO,aAAE,OAAO;AAAA,MACd,OAAO,aAAE,OAAO,EAAE,SAAS;AAAA,MAC3B,WAAW,aAAE,OAAO,EAAE,SAAS;AAAA,MAC/B,WAAW,aAAE,OAAO,EAAE,SAAS;AAAA,MAC/B,cAAc,aAAE,OAAO,EAAE,SAAS;AAAA,IACpC,CAAC;AAAA,IACD,OAAO,CAAC;AAAA,IACR,aAAa;AAAA,IACb,SAAS,EAAE,OAAO,WAAW,WAAW,EAAE;AAAA,EAC5C;AAAA,EAEA,QAAQ;AAAA,IACN,OAAO,aAAE,OAAO;AAAA,MACd,QAAQ,aAAE,OAAO,EAAE,SAAS;AAAA,IAC9B,CAAC;AAAA,IACD,OAAO,CAAC;AAAA,IACR,aAAa;AAAA,IACb,SAAS,EAAE,QAAQ,GAAG;AAAA,EACxB;AACF;","names":[]}
@@ -0,0 +1,11 @@
1
+ import {
2
+ schema
3
+ } from "./chunk-A67OT34V.mjs";
4
+ import {
5
+ standardComponentDefinitions
6
+ } from "./chunk-PMEELRVP.mjs";
7
+ export {
8
+ schema,
9
+ standardComponentDefinitions
10
+ };
11
+ //# sourceMappingURL=server.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@json-render/image",
3
+ "version": "0.1.0",
4
+ "license": "Apache-2.0",
5
+ "description": "Image renderer for @json-render/core. JSON becomes SVG and PNG images via Satori.",
6
+ "keywords": [
7
+ "json",
8
+ "image",
9
+ "svg",
10
+ "png",
11
+ "og",
12
+ "satori",
13
+ "ai",
14
+ "generative-ui",
15
+ "llm",
16
+ "renderer"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/vercel-labs/json-render.git",
21
+ "directory": "packages/image"
22
+ },
23
+ "homepage": "https://github.com/vercel-labs/json-render#readme",
24
+ "bugs": {
25
+ "url": "https://github.com/vercel-labs/json-render/issues"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.mjs",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.mjs",
37
+ "require": "./dist/index.js"
38
+ },
39
+ "./server": {
40
+ "types": "./dist/server.d.ts",
41
+ "import": "./dist/server.mjs",
42
+ "require": "./dist/server.js"
43
+ },
44
+ "./catalog": {
45
+ "types": "./dist/catalog.d.ts",
46
+ "import": "./dist/catalog.mjs",
47
+ "require": "./dist/catalog.js"
48
+ },
49
+ "./render": {
50
+ "types": "./dist/render.d.ts",
51
+ "import": "./dist/render.mjs",
52
+ "require": "./dist/render.js"
53
+ }
54
+ },
55
+ "files": [
56
+ "dist"
57
+ ],
58
+ "dependencies": {
59
+ "satori": "^0.19.2",
60
+ "@json-render/core": "0.10.0"
61
+ },
62
+ "devDependencies": {
63
+ "@types/react": "19.2.3",
64
+ "tsup": "^8.5.1",
65
+ "typescript": "^5.4.5",
66
+ "zod": "^4.3.6",
67
+ "@internal/typescript-config": "0.0.0"
68
+ },
69
+ "peerDependencies": {
70
+ "@resvg/resvg-js": ">=2.0.0",
71
+ "react": "^18.0.0 || ^19.0.0",
72
+ "zod": "^4.0.0"
73
+ },
74
+ "peerDependenciesMeta": {
75
+ "@resvg/resvg-js": {
76
+ "optional": true
77
+ }
78
+ },
79
+ "scripts": {
80
+ "build": "tsup",
81
+ "dev": "tsup --watch",
82
+ "check-types": "tsc --noEmit",
83
+ "typecheck": "tsc --noEmit"
84
+ }
85
+ }