@shoppexio/builder-contracts 0.1.0 → 0.1.1
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/builder-contracts.test.js +71 -1
- package/dist/builder-settings.d.ts +9 -666
- package/dist/builder-settings.d.ts.map +1 -1
- package/dist/canonical-settings.d.ts +18 -0
- package/dist/canonical-settings.d.ts.map +1 -0
- package/dist/canonical-settings.js +106 -0
- package/dist/events.d.ts +35 -240
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +7 -0
- package/dist/fields.d.ts +169 -8
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +27 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/legacy-manifest.d.ts +11 -0
- package/dist/legacy-manifest.d.ts.map +1 -1
- package/dist/legacy-manifest.js +106 -16
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +50 -4
- package/dist/persistence.d.ts +7 -0
- package/dist/persistence.d.ts.map +1 -0
- package/dist/persistence.js +58 -0
- package/dist/preview-boot.d.ts +68 -0
- package/dist/preview-boot.d.ts.map +1 -0
- package/dist/preview-boot.js +36 -0
- package/dist/preview-protocol.d.ts +227 -459
- package/dist/preview-protocol.d.ts.map +1 -1
- package/dist/preview-protocol.js +112 -0
- package/dist/preview-session-resolve.d.ts +115 -0
- package/dist/preview-session-resolve.d.ts.map +1 -0
- package/dist/preview-session-resolve.js +25 -0
- package/dist/preview-trusted-origins.d.ts +4 -0
- package/dist/preview-trusted-origins.d.ts.map +1 -0
- package/dist/preview-trusted-origins.js +26 -0
- package/dist/storefront-initial-data-html.d.ts +17 -0
- package/dist/storefront-initial-data-html.d.ts.map +1 -0
- package/dist/storefront-initial-data-html.js +83 -0
- package/dist/style-slots.d.ts +49 -151
- package/dist/style-slots.d.ts.map +1 -1
- package/dist/style-slots.js +75 -29
- package/dist/theme-manifest.d.ts +229 -454
- package/dist/theme-manifest.d.ts.map +1 -1
- package/dist/theme-manifest.js +92 -0
- package/dist/theme-schemes.d.ts +10 -0
- package/dist/theme-schemes.d.ts.map +1 -0
- package/dist/theme-schemes.js +24 -0
- package/dist/validation.d.ts +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +18 -9
- package/package.json +43 -1
- package/src/builder-contracts.test.ts +398 -3
- package/src/canonical-settings.ts +156 -0
- package/src/events.ts +8 -0
- package/src/fields.ts +30 -0
- package/src/index.ts +7 -0
- package/src/legacy-manifest.ts +107 -16
- package/src/migrations.ts +65 -4
- package/src/persistence.ts +77 -0
- package/src/preview-boot.ts +47 -0
- package/src/preview-protocol.test.ts +132 -0
- package/src/preview-protocol.ts +122 -0
- package/src/preview-session-resolve.ts +34 -0
- package/src/preview-trusted-origins.test.ts +24 -0
- package/src/preview-trusted-origins.ts +35 -0
- package/src/storefront-initial-data-html.test.ts +63 -0
- package/src/storefront-initial-data-html.ts +112 -0
- package/src/style-slots.ts +96 -31
- package/src/theme-manifest.ts +118 -1
- package/src/theme-schemes.ts +33 -0
- package/src/validation.ts +27 -10
package/dist/fields.d.ts
CHANGED
|
@@ -4,12 +4,18 @@ export declare const FieldOptionSchema: z.ZodObject<{
|
|
|
4
4
|
value: z.ZodString;
|
|
5
5
|
}, z.core.$strict>;
|
|
6
6
|
export type FieldOption = z.infer<typeof FieldOptionSchema>;
|
|
7
|
+
declare const CodeFieldTemplateSchema: z.ZodObject<{
|
|
8
|
+
label: z.ZodString;
|
|
9
|
+
snippet: z.ZodString;
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type CodeFieldTemplate = z.infer<typeof CodeFieldTemplateSchema>;
|
|
7
13
|
export declare const ListItemFieldTypeSchema: z.ZodEnum<{
|
|
8
14
|
number: "number";
|
|
9
15
|
boolean: "boolean";
|
|
16
|
+
link: "link";
|
|
10
17
|
text: "text";
|
|
11
18
|
richtext: "richtext";
|
|
12
|
-
link: "link";
|
|
13
19
|
image: "image";
|
|
14
20
|
range: "range";
|
|
15
21
|
select: "select";
|
|
@@ -22,12 +28,16 @@ export declare const ListItemFieldSchema: z.ZodObject<{
|
|
|
22
28
|
description: z.ZodOptional<z.ZodString>;
|
|
23
29
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
24
30
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
content: "content";
|
|
33
|
+
style: "style";
|
|
34
|
+
}>>;
|
|
25
35
|
type: z.ZodEnum<{
|
|
26
36
|
number: "number";
|
|
27
37
|
boolean: "boolean";
|
|
38
|
+
link: "link";
|
|
28
39
|
text: "text";
|
|
29
40
|
richtext: "richtext";
|
|
30
|
-
link: "link";
|
|
31
41
|
image: "image";
|
|
32
42
|
range: "range";
|
|
33
43
|
select: "select";
|
|
@@ -50,6 +60,10 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
50
60
|
description: z.ZodOptional<z.ZodString>;
|
|
51
61
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
52
62
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
content: "content";
|
|
65
|
+
style: "style";
|
|
66
|
+
}>>;
|
|
53
67
|
type: z.ZodLiteral<"text">;
|
|
54
68
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
55
69
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -59,18 +73,49 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
59
73
|
description: z.ZodOptional<z.ZodString>;
|
|
60
74
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
61
75
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
content: "content";
|
|
78
|
+
style: "style";
|
|
79
|
+
}>>;
|
|
62
80
|
type: z.ZodLiteral<"richtext">;
|
|
63
81
|
allowedMarks: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
82
|
+
code: "code";
|
|
64
83
|
bold: "bold";
|
|
65
|
-
italic: "italic";
|
|
66
84
|
link: "link";
|
|
67
|
-
|
|
85
|
+
italic: "italic";
|
|
68
86
|
}>>>;
|
|
69
87
|
}, z.core.$strict>, z.ZodObject<{
|
|
70
88
|
label: z.ZodString;
|
|
71
89
|
description: z.ZodOptional<z.ZodString>;
|
|
72
90
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
73
91
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
content: "content";
|
|
94
|
+
style: "style";
|
|
95
|
+
}>>;
|
|
96
|
+
type: z.ZodLiteral<"code">;
|
|
97
|
+
language: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
html: "html";
|
|
99
|
+
css: "css";
|
|
100
|
+
javascript: "javascript";
|
|
101
|
+
json: "json";
|
|
102
|
+
}>>;
|
|
103
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
104
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
|
+
label: z.ZodString;
|
|
107
|
+
snippet: z.ZodString;
|
|
108
|
+
description: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strict>>>;
|
|
110
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
+
label: z.ZodString;
|
|
112
|
+
description: z.ZodOptional<z.ZodString>;
|
|
113
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
114
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
content: "content";
|
|
117
|
+
style: "style";
|
|
118
|
+
}>>;
|
|
74
119
|
type: z.ZodLiteral<"image">;
|
|
75
120
|
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
76
121
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -78,17 +123,29 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
78
123
|
description: z.ZodOptional<z.ZodString>;
|
|
79
124
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
80
125
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
127
|
+
content: "content";
|
|
128
|
+
style: "style";
|
|
129
|
+
}>>;
|
|
81
130
|
type: z.ZodLiteral<"link">;
|
|
82
131
|
}, z.core.$strict>, z.ZodObject<{
|
|
83
132
|
label: z.ZodString;
|
|
84
133
|
description: z.ZodOptional<z.ZodString>;
|
|
85
134
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
content: "content";
|
|
137
|
+
style: "style";
|
|
138
|
+
}>>;
|
|
86
139
|
type: z.ZodLiteral<"boolean">;
|
|
87
140
|
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
88
141
|
}, z.core.$strict>, z.ZodObject<{
|
|
89
142
|
label: z.ZodString;
|
|
90
143
|
description: z.ZodOptional<z.ZodString>;
|
|
91
144
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
content: "content";
|
|
147
|
+
style: "style";
|
|
148
|
+
}>>;
|
|
92
149
|
type: z.ZodLiteral<"number">;
|
|
93
150
|
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
94
151
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -98,6 +155,10 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
98
155
|
label: z.ZodString;
|
|
99
156
|
description: z.ZodOptional<z.ZodString>;
|
|
100
157
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
content: "content";
|
|
160
|
+
style: "style";
|
|
161
|
+
}>>;
|
|
101
162
|
type: z.ZodLiteral<"range">;
|
|
102
163
|
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
103
164
|
min: z.ZodNumber;
|
|
@@ -108,6 +169,10 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
108
169
|
label: z.ZodString;
|
|
109
170
|
description: z.ZodOptional<z.ZodString>;
|
|
110
171
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
content: "content";
|
|
174
|
+
style: "style";
|
|
175
|
+
}>>;
|
|
111
176
|
type: z.ZodLiteral<"select">;
|
|
112
177
|
defaultValue: z.ZodOptional<z.ZodString>;
|
|
113
178
|
options: z.ZodArray<z.ZodObject<{
|
|
@@ -118,6 +183,10 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
118
183
|
label: z.ZodString;
|
|
119
184
|
description: z.ZodOptional<z.ZodString>;
|
|
120
185
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
187
|
+
content: "content";
|
|
188
|
+
style: "style";
|
|
189
|
+
}>>;
|
|
121
190
|
type: z.ZodLiteral<"color">;
|
|
122
191
|
defaultValue: z.ZodOptional<z.ZodString>;
|
|
123
192
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -125,12 +194,20 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
125
194
|
description: z.ZodOptional<z.ZodString>;
|
|
126
195
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
127
196
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
198
|
+
content: "content";
|
|
199
|
+
style: "style";
|
|
200
|
+
}>>;
|
|
128
201
|
type: z.ZodLiteral<"product">;
|
|
129
202
|
}, z.core.$strict>, z.ZodObject<{
|
|
130
203
|
label: z.ZodString;
|
|
131
204
|
description: z.ZodOptional<z.ZodString>;
|
|
132
205
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
133
206
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
208
|
+
content: "content";
|
|
209
|
+
style: "style";
|
|
210
|
+
}>>;
|
|
134
211
|
type: z.ZodLiteral<"products">;
|
|
135
212
|
minItems: z.ZodOptional<z.ZodNumber>;
|
|
136
213
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -139,6 +216,10 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
216
|
description: z.ZodOptional<z.ZodString>;
|
|
140
217
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
141
218
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
220
|
+
content: "content";
|
|
221
|
+
style: "style";
|
|
222
|
+
}>>;
|
|
142
223
|
type: z.ZodLiteral<"list">;
|
|
143
224
|
minItems: z.ZodOptional<z.ZodNumber>;
|
|
144
225
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -147,12 +228,16 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
147
228
|
description: z.ZodOptional<z.ZodString>;
|
|
148
229
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
149
230
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
content: "content";
|
|
233
|
+
style: "style";
|
|
234
|
+
}>>;
|
|
150
235
|
type: z.ZodEnum<{
|
|
151
236
|
number: "number";
|
|
152
237
|
boolean: "boolean";
|
|
238
|
+
link: "link";
|
|
153
239
|
text: "text";
|
|
154
240
|
richtext: "richtext";
|
|
155
|
-
link: "link";
|
|
156
241
|
image: "image";
|
|
157
242
|
range: "range";
|
|
158
243
|
select: "select";
|
|
@@ -176,6 +261,10 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
176
261
|
description: z.ZodOptional<z.ZodString>;
|
|
177
262
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
178
263
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
265
|
+
content: "content";
|
|
266
|
+
style: "style";
|
|
267
|
+
}>>;
|
|
179
268
|
type: z.ZodLiteral<"text">;
|
|
180
269
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
181
270
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -185,18 +274,49 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
185
274
|
description: z.ZodOptional<z.ZodString>;
|
|
186
275
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
187
276
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
278
|
+
content: "content";
|
|
279
|
+
style: "style";
|
|
280
|
+
}>>;
|
|
188
281
|
type: z.ZodLiteral<"richtext">;
|
|
189
282
|
allowedMarks: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
283
|
+
code: "code";
|
|
190
284
|
bold: "bold";
|
|
191
|
-
italic: "italic";
|
|
192
285
|
link: "link";
|
|
193
|
-
|
|
286
|
+
italic: "italic";
|
|
194
287
|
}>>>;
|
|
195
288
|
}, z.core.$strict>, z.ZodObject<{
|
|
196
289
|
label: z.ZodString;
|
|
197
290
|
description: z.ZodOptional<z.ZodString>;
|
|
198
291
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
199
292
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
293
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
294
|
+
content: "content";
|
|
295
|
+
style: "style";
|
|
296
|
+
}>>;
|
|
297
|
+
type: z.ZodLiteral<"code">;
|
|
298
|
+
language: z.ZodOptional<z.ZodEnum<{
|
|
299
|
+
html: "html";
|
|
300
|
+
css: "css";
|
|
301
|
+
javascript: "javascript";
|
|
302
|
+
json: "json";
|
|
303
|
+
}>>;
|
|
304
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
305
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
307
|
+
label: z.ZodString;
|
|
308
|
+
snippet: z.ZodString;
|
|
309
|
+
description: z.ZodOptional<z.ZodString>;
|
|
310
|
+
}, z.core.$strict>>>;
|
|
311
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
312
|
+
label: z.ZodString;
|
|
313
|
+
description: z.ZodOptional<z.ZodString>;
|
|
314
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
315
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
317
|
+
content: "content";
|
|
318
|
+
style: "style";
|
|
319
|
+
}>>;
|
|
200
320
|
type: z.ZodLiteral<"image">;
|
|
201
321
|
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
202
322
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -204,17 +324,29 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
204
324
|
description: z.ZodOptional<z.ZodString>;
|
|
205
325
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
206
326
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
328
|
+
content: "content";
|
|
329
|
+
style: "style";
|
|
330
|
+
}>>;
|
|
207
331
|
type: z.ZodLiteral<"link">;
|
|
208
332
|
}, z.core.$strict>, z.ZodObject<{
|
|
209
333
|
label: z.ZodString;
|
|
210
334
|
description: z.ZodOptional<z.ZodString>;
|
|
211
335
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
336
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
337
|
+
content: "content";
|
|
338
|
+
style: "style";
|
|
339
|
+
}>>;
|
|
212
340
|
type: z.ZodLiteral<"boolean">;
|
|
213
341
|
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
214
342
|
}, z.core.$strict>, z.ZodObject<{
|
|
215
343
|
label: z.ZodString;
|
|
216
344
|
description: z.ZodOptional<z.ZodString>;
|
|
217
345
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
347
|
+
content: "content";
|
|
348
|
+
style: "style";
|
|
349
|
+
}>>;
|
|
218
350
|
type: z.ZodLiteral<"number">;
|
|
219
351
|
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
220
352
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -224,6 +356,10 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
224
356
|
label: z.ZodString;
|
|
225
357
|
description: z.ZodOptional<z.ZodString>;
|
|
226
358
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
359
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
360
|
+
content: "content";
|
|
361
|
+
style: "style";
|
|
362
|
+
}>>;
|
|
227
363
|
type: z.ZodLiteral<"range">;
|
|
228
364
|
defaultValue: z.ZodOptional<z.ZodNumber>;
|
|
229
365
|
min: z.ZodNumber;
|
|
@@ -234,6 +370,10 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
234
370
|
label: z.ZodString;
|
|
235
371
|
description: z.ZodOptional<z.ZodString>;
|
|
236
372
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
373
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
374
|
+
content: "content";
|
|
375
|
+
style: "style";
|
|
376
|
+
}>>;
|
|
237
377
|
type: z.ZodLiteral<"select">;
|
|
238
378
|
defaultValue: z.ZodOptional<z.ZodString>;
|
|
239
379
|
options: z.ZodArray<z.ZodObject<{
|
|
@@ -244,6 +384,10 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
244
384
|
label: z.ZodString;
|
|
245
385
|
description: z.ZodOptional<z.ZodString>;
|
|
246
386
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
388
|
+
content: "content";
|
|
389
|
+
style: "style";
|
|
390
|
+
}>>;
|
|
247
391
|
type: z.ZodLiteral<"color">;
|
|
248
392
|
defaultValue: z.ZodOptional<z.ZodString>;
|
|
249
393
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -251,12 +395,20 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
251
395
|
description: z.ZodOptional<z.ZodString>;
|
|
252
396
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
253
397
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
398
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
399
|
+
content: "content";
|
|
400
|
+
style: "style";
|
|
401
|
+
}>>;
|
|
254
402
|
type: z.ZodLiteral<"product">;
|
|
255
403
|
}, z.core.$strict>, z.ZodObject<{
|
|
256
404
|
label: z.ZodString;
|
|
257
405
|
description: z.ZodOptional<z.ZodString>;
|
|
258
406
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
259
407
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
409
|
+
content: "content";
|
|
410
|
+
style: "style";
|
|
411
|
+
}>>;
|
|
260
412
|
type: z.ZodLiteral<"products">;
|
|
261
413
|
minItems: z.ZodOptional<z.ZodNumber>;
|
|
262
414
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -265,6 +417,10 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
265
417
|
description: z.ZodOptional<z.ZodString>;
|
|
266
418
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
267
419
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
421
|
+
content: "content";
|
|
422
|
+
style: "style";
|
|
423
|
+
}>>;
|
|
268
424
|
type: z.ZodLiteral<"list">;
|
|
269
425
|
minItems: z.ZodOptional<z.ZodNumber>;
|
|
270
426
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -273,12 +429,16 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
273
429
|
description: z.ZodOptional<z.ZodString>;
|
|
274
430
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
275
431
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
432
|
+
group: z.ZodOptional<z.ZodEnum<{
|
|
433
|
+
content: "content";
|
|
434
|
+
style: "style";
|
|
435
|
+
}>>;
|
|
276
436
|
type: z.ZodEnum<{
|
|
277
437
|
number: "number";
|
|
278
438
|
boolean: "boolean";
|
|
439
|
+
link: "link";
|
|
279
440
|
text: "text";
|
|
280
441
|
richtext: "richtext";
|
|
281
|
-
link: "link";
|
|
282
442
|
image: "image";
|
|
283
443
|
range: "range";
|
|
284
444
|
select: "select";
|
|
@@ -297,4 +457,5 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
|
|
|
297
457
|
}, z.core.$strict>>;
|
|
298
458
|
}, z.core.$strict>], "type">>;
|
|
299
459
|
export type BlockSettings = z.infer<typeof BlockSettingsSchema>;
|
|
460
|
+
export {};
|
|
300
461
|
//# sourceMappingURL=fields.d.ts.map
|
package/dist/fields.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAiB5B,eAAO,MAAM,iBAAiB;;;kBAKnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAmB5D,QAAA,MAAM,uBAAuB;;;;kBAMlB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAgExE,eAAO,MAAM,uBAAuB;;;;;;;;;;;EAWlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAShE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAc7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAkD,CAAC;AACnF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/fields.js
CHANGED
|
@@ -6,6 +6,11 @@ const FieldBaseSchema = z
|
|
|
6
6
|
description: z.string().min(1).optional(),
|
|
7
7
|
defaultValue: z.unknown().optional(),
|
|
8
8
|
required: z.boolean().optional(),
|
|
9
|
+
// Groups settings within the Inspector. "content" (default) shows
|
|
10
|
+
// under the Block Settings collapsible; "style" shows under a
|
|
11
|
+
// separate Style collapsible. Themes pick up the value via the
|
|
12
|
+
// existing block.settings.path lookup — no runtime change.
|
|
13
|
+
group: z.enum(['content', 'style']).optional(),
|
|
9
14
|
})
|
|
10
15
|
.strict();
|
|
11
16
|
export const FieldOptionSchema = z
|
|
@@ -24,6 +29,27 @@ const RichTextFieldSchema = FieldBaseSchema.extend({
|
|
|
24
29
|
type: z.literal('richtext'),
|
|
25
30
|
allowedMarks: z.array(z.enum(['bold', 'italic', 'link', 'code'])).optional(),
|
|
26
31
|
}).strict();
|
|
32
|
+
// Plain-text source code field. Renders a Monaco editor in the
|
|
33
|
+
// Inspector and persists the raw string back into block.settings.
|
|
34
|
+
// Used by the `custom-html` block (and any future block that needs
|
|
35
|
+
// a code-shaped setting). Themes interpret the string however they
|
|
36
|
+
// see fit — sandboxed iframe srcDoc for HTML, etc.
|
|
37
|
+
const CodeFieldTemplateSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
label: z.string().min(1),
|
|
40
|
+
snippet: z.string().min(1),
|
|
41
|
+
description: z.string().min(1).optional(),
|
|
42
|
+
})
|
|
43
|
+
.strict();
|
|
44
|
+
const CodeFieldSchema = FieldBaseSchema.extend({
|
|
45
|
+
type: z.literal('code'),
|
|
46
|
+
language: z.enum(['html', 'css', 'javascript', 'json']).optional(),
|
|
47
|
+
placeholder: z.string().optional(),
|
|
48
|
+
maxLength: z.number().int().positive().optional(),
|
|
49
|
+
// Optional quick-insert chips rendered above the editor. Clicking a
|
|
50
|
+
// template replaces the field value with the snippet.
|
|
51
|
+
templates: z.array(CodeFieldTemplateSchema).optional(),
|
|
52
|
+
}).strict();
|
|
27
53
|
const ImageFieldSchema = FieldBaseSchema.extend({
|
|
28
54
|
type: z.literal('image'),
|
|
29
55
|
aspectRatio: z.string().min(1).optional(),
|
|
@@ -97,6 +123,7 @@ const ListFieldSchema = FieldBaseSchema.extend({
|
|
|
97
123
|
export const BuilderFieldSchema = z.discriminatedUnion('type', [
|
|
98
124
|
TextFieldSchema,
|
|
99
125
|
RichTextFieldSchema,
|
|
126
|
+
CodeFieldSchema,
|
|
100
127
|
ImageFieldSchema,
|
|
101
128
|
LinkFieldSchema,
|
|
102
129
|
BooleanFieldSchema,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
export * from './builder-settings.ts';
|
|
2
|
+
export * from './canonical-settings.ts';
|
|
2
3
|
export * from './events.ts';
|
|
3
4
|
export * from './fields.ts';
|
|
4
5
|
export * from './legacy-manifest.ts';
|
|
5
6
|
export * from './migrations.ts';
|
|
7
|
+
export * from './persistence.ts';
|
|
8
|
+
export * from './preview-boot.ts';
|
|
6
9
|
export * from './preview-protocol.ts';
|
|
10
|
+
export * from './preview-session-resolve.ts';
|
|
11
|
+
export * from './preview-trusted-origins.ts';
|
|
12
|
+
export * from './storefront-initial-data-html.ts';
|
|
7
13
|
export * from './style-slots.ts';
|
|
8
14
|
export * from './theme-manifest.ts';
|
|
15
|
+
export * from './theme-schemes.ts';
|
|
9
16
|
export * from './validation.ts';
|
|
10
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export * from "./builder-settings.js";
|
|
2
|
+
export * from "./canonical-settings.js";
|
|
2
3
|
export * from "./events.js";
|
|
3
4
|
export * from "./fields.js";
|
|
4
5
|
export * from "./legacy-manifest.js";
|
|
5
6
|
export * from "./migrations.js";
|
|
7
|
+
export * from "./persistence.js";
|
|
8
|
+
export * from "./preview-boot.js";
|
|
6
9
|
export * from "./preview-protocol.js";
|
|
10
|
+
export * from "./preview-session-resolve.js";
|
|
11
|
+
export * from "./preview-trusted-origins.js";
|
|
12
|
+
export * from "./storefront-initial-data-html.js";
|
|
7
13
|
export * from "./style-slots.js";
|
|
8
14
|
export * from "./theme-manifest.js";
|
|
15
|
+
export * from "./theme-schemes.js";
|
|
9
16
|
export * from "./validation.js";
|
|
@@ -96,6 +96,17 @@ export declare const LegacyThemeManifestSchema: z.ZodObject<{
|
|
|
96
96
|
id: z.ZodString;
|
|
97
97
|
name: z.ZodString;
|
|
98
98
|
version: z.ZodString;
|
|
99
|
+
author: z.ZodOptional<z.ZodString>;
|
|
100
|
+
description: z.ZodOptional<z.ZodString>;
|
|
101
|
+
preview: z.ZodOptional<z.ZodString>;
|
|
102
|
+
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
techStack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
106
|
+
demoUrl: z.ZodOptional<z.ZodString>;
|
|
107
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
108
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
109
|
+
hotfixPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
110
|
presets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
111
|
id: z.ZodString;
|
|
101
112
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-manifest.d.ts","sourceRoot":"","sources":["../src/legacy-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"legacy-manifest.d.ts","sourceRoot":"","sources":["../src/legacy-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAU9E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;iBAarB,CAAC;AACjB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,uBAAuB;;;;;iBAOpB,CAAC;AACjB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;iBASrB,CAAC;AACjB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;iBASpB,CAAC;AACjB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,QAAA,MAAM,uBAAuB;;;;;;;;;;;iBAgBb,CAAC;AACjB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBtB,CAAC;AACjB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAoFxE"}
|