@shoppexio/builder-contracts 0.1.0 → 0.1.2

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.
Files changed (92) hide show
  1. package/dist/builder-settings.d.ts +11 -666
  2. package/dist/builder-settings.d.ts.map +1 -1
  3. package/dist/builder-settings.js +2 -1
  4. package/dist/canonical-settings.d.ts +18 -0
  5. package/dist/canonical-settings.d.ts.map +1 -0
  6. package/dist/canonical-settings.js +106 -0
  7. package/dist/custom-pages.d.ts +15 -0
  8. package/dist/custom-pages.d.ts.map +1 -0
  9. package/dist/custom-pages.js +40 -0
  10. package/dist/dedicated-pages.d.ts +15 -0
  11. package/dist/dedicated-pages.d.ts.map +1 -0
  12. package/dist/dedicated-pages.js +142 -0
  13. package/dist/events.d.ts +35 -240
  14. package/dist/events.d.ts.map +1 -1
  15. package/dist/events.js +7 -0
  16. package/dist/fields.d.ts +229 -10
  17. package/dist/fields.d.ts.map +1 -1
  18. package/dist/fields.js +27 -0
  19. package/dist/index.d.ts +10 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +10 -0
  22. package/dist/legacy-manifest.d.ts +18 -0
  23. package/dist/legacy-manifest.d.ts.map +1 -1
  24. package/dist/legacy-manifest.js +137 -22
  25. package/dist/migrations.d.ts.map +1 -1
  26. package/dist/migrations.js +55 -6
  27. package/dist/persistence.d.ts +7 -0
  28. package/dist/persistence.d.ts.map +1 -0
  29. package/dist/persistence.js +58 -0
  30. package/dist/preview-boot.d.ts +68 -0
  31. package/dist/preview-boot.d.ts.map +1 -0
  32. package/dist/preview-boot.js +38 -0
  33. package/dist/preview-protocol.d.ts +227 -459
  34. package/dist/preview-protocol.d.ts.map +1 -1
  35. package/dist/preview-protocol.js +112 -0
  36. package/dist/preview-session-resolve.d.ts +115 -0
  37. package/dist/preview-session-resolve.d.ts.map +1 -0
  38. package/dist/preview-session-resolve.js +25 -0
  39. package/dist/preview-trusted-origins.d.ts +4 -0
  40. package/dist/preview-trusted-origins.d.ts.map +1 -0
  41. package/dist/preview-trusted-origins.js +28 -0
  42. package/dist/storefront-initial-data-html.d.ts +17 -0
  43. package/dist/storefront-initial-data-html.d.ts.map +1 -0
  44. package/dist/storefront-initial-data-html.js +83 -0
  45. package/dist/storefront-typography-fonts.d.ts +18 -0
  46. package/dist/storefront-typography-fonts.d.ts.map +1 -0
  47. package/dist/storefront-typography-fonts.js +89 -0
  48. package/dist/style-slots.d.ts +50 -152
  49. package/dist/style-slots.d.ts.map +1 -1
  50. package/dist/style-slots.js +80 -32
  51. package/dist/theme-manifest.d.ts +287 -456
  52. package/dist/theme-manifest.d.ts.map +1 -1
  53. package/dist/theme-manifest.js +92 -0
  54. package/dist/theme-schemes.d.ts +10 -0
  55. package/dist/theme-schemes.d.ts.map +1 -0
  56. package/dist/theme-schemes.js +25 -0
  57. package/dist/validation.d.ts +1 -1
  58. package/dist/validation.d.ts.map +1 -1
  59. package/dist/validation.js +23 -12
  60. package/package.json +43 -1
  61. package/src/builder-contracts.test.ts +416 -3
  62. package/src/builder-settings.ts +4 -1
  63. package/src/canonical-settings.ts +156 -0
  64. package/src/custom-pages.test.ts +74 -0
  65. package/src/custom-pages.ts +70 -0
  66. package/src/dedicated-pages.test.ts +88 -0
  67. package/src/dedicated-pages.ts +173 -0
  68. package/src/events.ts +8 -0
  69. package/src/fields.ts +30 -0
  70. package/src/index.ts +10 -0
  71. package/src/legacy-manifest.ts +147 -23
  72. package/src/migrations.ts +70 -6
  73. package/src/persistence.ts +77 -0
  74. package/src/preview-boot.test.ts +72 -0
  75. package/src/preview-boot.ts +49 -0
  76. package/src/preview-protocol.test.ts +132 -0
  77. package/src/preview-protocol.ts +122 -0
  78. package/src/preview-session-resolve.test.ts +37 -0
  79. package/src/preview-session-resolve.ts +34 -0
  80. package/src/preview-trusted-origins.test.ts +24 -0
  81. package/src/preview-trusted-origins.ts +35 -0
  82. package/src/storefront-initial-data-html.test.ts +73 -0
  83. package/src/storefront-initial-data-html.ts +112 -0
  84. package/src/storefront-typography-fonts.test.ts +48 -0
  85. package/src/storefront-typography-fonts.ts +108 -0
  86. package/src/style-slots.ts +102 -34
  87. package/src/theme-manifest.ts +118 -1
  88. package/src/theme-schemes.ts +34 -0
  89. package/src/validation.ts +32 -13
  90. package/dist/builder-contracts.test.d.ts +0 -2
  91. package/dist/builder-contracts.test.d.ts.map +0 -1
  92. package/dist/builder-contracts.test.js +0 -361
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,18 @@ 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
+ search: "search";
33
+ content: "content";
34
+ profile: "profile";
35
+ style: "style";
36
+ }>>;
25
37
  type: z.ZodEnum<{
26
38
  number: "number";
27
39
  boolean: "boolean";
40
+ link: "link";
28
41
  text: "text";
29
42
  richtext: "richtext";
30
- link: "link";
31
43
  image: "image";
32
44
  range: "range";
33
45
  select: "select";
@@ -50,6 +62,12 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
50
62
  description: z.ZodOptional<z.ZodString>;
51
63
  defaultValue: z.ZodOptional<z.ZodUnknown>;
52
64
  required: z.ZodOptional<z.ZodBoolean>;
65
+ group: z.ZodOptional<z.ZodEnum<{
66
+ search: "search";
67
+ content: "content";
68
+ profile: "profile";
69
+ style: "style";
70
+ }>>;
53
71
  type: z.ZodLiteral<"text">;
54
72
  placeholder: z.ZodOptional<z.ZodString>;
55
73
  minLength: z.ZodOptional<z.ZodNumber>;
@@ -59,18 +77,55 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
59
77
  description: z.ZodOptional<z.ZodString>;
60
78
  defaultValue: z.ZodOptional<z.ZodUnknown>;
61
79
  required: z.ZodOptional<z.ZodBoolean>;
80
+ group: z.ZodOptional<z.ZodEnum<{
81
+ search: "search";
82
+ content: "content";
83
+ profile: "profile";
84
+ style: "style";
85
+ }>>;
62
86
  type: z.ZodLiteral<"richtext">;
63
87
  allowedMarks: z.ZodOptional<z.ZodArray<z.ZodEnum<{
88
+ code: "code";
64
89
  bold: "bold";
65
- italic: "italic";
66
90
  link: "link";
67
- code: "code";
91
+ italic: "italic";
68
92
  }>>>;
69
93
  }, z.core.$strict>, z.ZodObject<{
70
94
  label: z.ZodString;
71
95
  description: z.ZodOptional<z.ZodString>;
72
96
  defaultValue: z.ZodOptional<z.ZodUnknown>;
73
97
  required: z.ZodOptional<z.ZodBoolean>;
98
+ group: z.ZodOptional<z.ZodEnum<{
99
+ search: "search";
100
+ content: "content";
101
+ profile: "profile";
102
+ style: "style";
103
+ }>>;
104
+ type: z.ZodLiteral<"code">;
105
+ language: z.ZodOptional<z.ZodEnum<{
106
+ html: "html";
107
+ css: "css";
108
+ javascript: "javascript";
109
+ json: "json";
110
+ }>>;
111
+ placeholder: z.ZodOptional<z.ZodString>;
112
+ maxLength: z.ZodOptional<z.ZodNumber>;
113
+ templates: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
+ label: z.ZodString;
115
+ snippet: z.ZodString;
116
+ description: z.ZodOptional<z.ZodString>;
117
+ }, z.core.$strict>>>;
118
+ }, z.core.$strict>, z.ZodObject<{
119
+ label: z.ZodString;
120
+ description: z.ZodOptional<z.ZodString>;
121
+ defaultValue: z.ZodOptional<z.ZodUnknown>;
122
+ required: z.ZodOptional<z.ZodBoolean>;
123
+ group: z.ZodOptional<z.ZodEnum<{
124
+ search: "search";
125
+ content: "content";
126
+ profile: "profile";
127
+ style: "style";
128
+ }>>;
74
129
  type: z.ZodLiteral<"image">;
75
130
  aspectRatio: z.ZodOptional<z.ZodString>;
76
131
  }, z.core.$strict>, z.ZodObject<{
@@ -78,17 +133,35 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
78
133
  description: z.ZodOptional<z.ZodString>;
79
134
  defaultValue: z.ZodOptional<z.ZodUnknown>;
80
135
  required: z.ZodOptional<z.ZodBoolean>;
136
+ group: z.ZodOptional<z.ZodEnum<{
137
+ search: "search";
138
+ content: "content";
139
+ profile: "profile";
140
+ style: "style";
141
+ }>>;
81
142
  type: z.ZodLiteral<"link">;
82
143
  }, z.core.$strict>, z.ZodObject<{
83
144
  label: z.ZodString;
84
145
  description: z.ZodOptional<z.ZodString>;
85
146
  required: z.ZodOptional<z.ZodBoolean>;
147
+ group: z.ZodOptional<z.ZodEnum<{
148
+ search: "search";
149
+ content: "content";
150
+ profile: "profile";
151
+ style: "style";
152
+ }>>;
86
153
  type: z.ZodLiteral<"boolean">;
87
154
  defaultValue: z.ZodOptional<z.ZodBoolean>;
88
155
  }, z.core.$strict>, z.ZodObject<{
89
156
  label: z.ZodString;
90
157
  description: z.ZodOptional<z.ZodString>;
91
158
  required: z.ZodOptional<z.ZodBoolean>;
159
+ group: z.ZodOptional<z.ZodEnum<{
160
+ search: "search";
161
+ content: "content";
162
+ profile: "profile";
163
+ style: "style";
164
+ }>>;
92
165
  type: z.ZodLiteral<"number">;
93
166
  defaultValue: z.ZodOptional<z.ZodNumber>;
94
167
  min: z.ZodOptional<z.ZodNumber>;
@@ -98,6 +171,12 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
98
171
  label: z.ZodString;
99
172
  description: z.ZodOptional<z.ZodString>;
100
173
  required: z.ZodOptional<z.ZodBoolean>;
174
+ group: z.ZodOptional<z.ZodEnum<{
175
+ search: "search";
176
+ content: "content";
177
+ profile: "profile";
178
+ style: "style";
179
+ }>>;
101
180
  type: z.ZodLiteral<"range">;
102
181
  defaultValue: z.ZodOptional<z.ZodNumber>;
103
182
  min: z.ZodNumber;
@@ -108,6 +187,12 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
108
187
  label: z.ZodString;
109
188
  description: z.ZodOptional<z.ZodString>;
110
189
  required: z.ZodOptional<z.ZodBoolean>;
190
+ group: z.ZodOptional<z.ZodEnum<{
191
+ search: "search";
192
+ content: "content";
193
+ profile: "profile";
194
+ style: "style";
195
+ }>>;
111
196
  type: z.ZodLiteral<"select">;
112
197
  defaultValue: z.ZodOptional<z.ZodString>;
113
198
  options: z.ZodArray<z.ZodObject<{
@@ -118,19 +203,37 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
118
203
  label: z.ZodString;
119
204
  description: z.ZodOptional<z.ZodString>;
120
205
  required: z.ZodOptional<z.ZodBoolean>;
206
+ group: z.ZodOptional<z.ZodEnum<{
207
+ search: "search";
208
+ content: "content";
209
+ profile: "profile";
210
+ style: "style";
211
+ }>>;
121
212
  type: z.ZodLiteral<"color">;
122
- defaultValue: z.ZodOptional<z.ZodString>;
213
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"transparent">, z.ZodString]>>;
123
214
  }, z.core.$strict>, z.ZodObject<{
124
215
  label: z.ZodString;
125
216
  description: z.ZodOptional<z.ZodString>;
126
217
  defaultValue: z.ZodOptional<z.ZodUnknown>;
127
218
  required: z.ZodOptional<z.ZodBoolean>;
219
+ group: z.ZodOptional<z.ZodEnum<{
220
+ search: "search";
221
+ content: "content";
222
+ profile: "profile";
223
+ style: "style";
224
+ }>>;
128
225
  type: z.ZodLiteral<"product">;
129
226
  }, z.core.$strict>, z.ZodObject<{
130
227
  label: z.ZodString;
131
228
  description: z.ZodOptional<z.ZodString>;
132
229
  defaultValue: z.ZodOptional<z.ZodUnknown>;
133
230
  required: z.ZodOptional<z.ZodBoolean>;
231
+ group: z.ZodOptional<z.ZodEnum<{
232
+ search: "search";
233
+ content: "content";
234
+ profile: "profile";
235
+ style: "style";
236
+ }>>;
134
237
  type: z.ZodLiteral<"products">;
135
238
  minItems: z.ZodOptional<z.ZodNumber>;
136
239
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -139,6 +242,12 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
139
242
  description: z.ZodOptional<z.ZodString>;
140
243
  defaultValue: z.ZodOptional<z.ZodUnknown>;
141
244
  required: z.ZodOptional<z.ZodBoolean>;
245
+ group: z.ZodOptional<z.ZodEnum<{
246
+ search: "search";
247
+ content: "content";
248
+ profile: "profile";
249
+ style: "style";
250
+ }>>;
142
251
  type: z.ZodLiteral<"list">;
143
252
  minItems: z.ZodOptional<z.ZodNumber>;
144
253
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -147,12 +256,18 @@ export declare const BuilderFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
147
256
  description: z.ZodOptional<z.ZodString>;
148
257
  defaultValue: z.ZodOptional<z.ZodUnknown>;
149
258
  required: z.ZodOptional<z.ZodBoolean>;
259
+ group: z.ZodOptional<z.ZodEnum<{
260
+ search: "search";
261
+ content: "content";
262
+ profile: "profile";
263
+ style: "style";
264
+ }>>;
150
265
  type: z.ZodEnum<{
151
266
  number: "number";
152
267
  boolean: "boolean";
268
+ link: "link";
153
269
  text: "text";
154
270
  richtext: "richtext";
155
- link: "link";
156
271
  image: "image";
157
272
  range: "range";
158
273
  select: "select";
@@ -176,6 +291,12 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
176
291
  description: z.ZodOptional<z.ZodString>;
177
292
  defaultValue: z.ZodOptional<z.ZodUnknown>;
178
293
  required: z.ZodOptional<z.ZodBoolean>;
294
+ group: z.ZodOptional<z.ZodEnum<{
295
+ search: "search";
296
+ content: "content";
297
+ profile: "profile";
298
+ style: "style";
299
+ }>>;
179
300
  type: z.ZodLiteral<"text">;
180
301
  placeholder: z.ZodOptional<z.ZodString>;
181
302
  minLength: z.ZodOptional<z.ZodNumber>;
@@ -185,18 +306,55 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
185
306
  description: z.ZodOptional<z.ZodString>;
186
307
  defaultValue: z.ZodOptional<z.ZodUnknown>;
187
308
  required: z.ZodOptional<z.ZodBoolean>;
309
+ group: z.ZodOptional<z.ZodEnum<{
310
+ search: "search";
311
+ content: "content";
312
+ profile: "profile";
313
+ style: "style";
314
+ }>>;
188
315
  type: z.ZodLiteral<"richtext">;
189
316
  allowedMarks: z.ZodOptional<z.ZodArray<z.ZodEnum<{
317
+ code: "code";
190
318
  bold: "bold";
191
- italic: "italic";
192
319
  link: "link";
193
- code: "code";
320
+ italic: "italic";
194
321
  }>>>;
195
322
  }, z.core.$strict>, z.ZodObject<{
196
323
  label: z.ZodString;
197
324
  description: z.ZodOptional<z.ZodString>;
198
325
  defaultValue: z.ZodOptional<z.ZodUnknown>;
199
326
  required: z.ZodOptional<z.ZodBoolean>;
327
+ group: z.ZodOptional<z.ZodEnum<{
328
+ search: "search";
329
+ content: "content";
330
+ profile: "profile";
331
+ style: "style";
332
+ }>>;
333
+ type: z.ZodLiteral<"code">;
334
+ language: z.ZodOptional<z.ZodEnum<{
335
+ html: "html";
336
+ css: "css";
337
+ javascript: "javascript";
338
+ json: "json";
339
+ }>>;
340
+ placeholder: z.ZodOptional<z.ZodString>;
341
+ maxLength: z.ZodOptional<z.ZodNumber>;
342
+ templates: z.ZodOptional<z.ZodArray<z.ZodObject<{
343
+ label: z.ZodString;
344
+ snippet: z.ZodString;
345
+ description: z.ZodOptional<z.ZodString>;
346
+ }, z.core.$strict>>>;
347
+ }, z.core.$strict>, z.ZodObject<{
348
+ label: z.ZodString;
349
+ description: z.ZodOptional<z.ZodString>;
350
+ defaultValue: z.ZodOptional<z.ZodUnknown>;
351
+ required: z.ZodOptional<z.ZodBoolean>;
352
+ group: z.ZodOptional<z.ZodEnum<{
353
+ search: "search";
354
+ content: "content";
355
+ profile: "profile";
356
+ style: "style";
357
+ }>>;
200
358
  type: z.ZodLiteral<"image">;
201
359
  aspectRatio: z.ZodOptional<z.ZodString>;
202
360
  }, z.core.$strict>, z.ZodObject<{
@@ -204,17 +362,35 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
204
362
  description: z.ZodOptional<z.ZodString>;
205
363
  defaultValue: z.ZodOptional<z.ZodUnknown>;
206
364
  required: z.ZodOptional<z.ZodBoolean>;
365
+ group: z.ZodOptional<z.ZodEnum<{
366
+ search: "search";
367
+ content: "content";
368
+ profile: "profile";
369
+ style: "style";
370
+ }>>;
207
371
  type: z.ZodLiteral<"link">;
208
372
  }, z.core.$strict>, z.ZodObject<{
209
373
  label: z.ZodString;
210
374
  description: z.ZodOptional<z.ZodString>;
211
375
  required: z.ZodOptional<z.ZodBoolean>;
376
+ group: z.ZodOptional<z.ZodEnum<{
377
+ search: "search";
378
+ content: "content";
379
+ profile: "profile";
380
+ style: "style";
381
+ }>>;
212
382
  type: z.ZodLiteral<"boolean">;
213
383
  defaultValue: z.ZodOptional<z.ZodBoolean>;
214
384
  }, z.core.$strict>, z.ZodObject<{
215
385
  label: z.ZodString;
216
386
  description: z.ZodOptional<z.ZodString>;
217
387
  required: z.ZodOptional<z.ZodBoolean>;
388
+ group: z.ZodOptional<z.ZodEnum<{
389
+ search: "search";
390
+ content: "content";
391
+ profile: "profile";
392
+ style: "style";
393
+ }>>;
218
394
  type: z.ZodLiteral<"number">;
219
395
  defaultValue: z.ZodOptional<z.ZodNumber>;
220
396
  min: z.ZodOptional<z.ZodNumber>;
@@ -224,6 +400,12 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
224
400
  label: z.ZodString;
225
401
  description: z.ZodOptional<z.ZodString>;
226
402
  required: z.ZodOptional<z.ZodBoolean>;
403
+ group: z.ZodOptional<z.ZodEnum<{
404
+ search: "search";
405
+ content: "content";
406
+ profile: "profile";
407
+ style: "style";
408
+ }>>;
227
409
  type: z.ZodLiteral<"range">;
228
410
  defaultValue: z.ZodOptional<z.ZodNumber>;
229
411
  min: z.ZodNumber;
@@ -234,6 +416,12 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
234
416
  label: z.ZodString;
235
417
  description: z.ZodOptional<z.ZodString>;
236
418
  required: z.ZodOptional<z.ZodBoolean>;
419
+ group: z.ZodOptional<z.ZodEnum<{
420
+ search: "search";
421
+ content: "content";
422
+ profile: "profile";
423
+ style: "style";
424
+ }>>;
237
425
  type: z.ZodLiteral<"select">;
238
426
  defaultValue: z.ZodOptional<z.ZodString>;
239
427
  options: z.ZodArray<z.ZodObject<{
@@ -244,19 +432,37 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
244
432
  label: z.ZodString;
245
433
  description: z.ZodOptional<z.ZodString>;
246
434
  required: z.ZodOptional<z.ZodBoolean>;
435
+ group: z.ZodOptional<z.ZodEnum<{
436
+ search: "search";
437
+ content: "content";
438
+ profile: "profile";
439
+ style: "style";
440
+ }>>;
247
441
  type: z.ZodLiteral<"color">;
248
- defaultValue: z.ZodOptional<z.ZodString>;
442
+ defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"transparent">, z.ZodString]>>;
249
443
  }, z.core.$strict>, z.ZodObject<{
250
444
  label: z.ZodString;
251
445
  description: z.ZodOptional<z.ZodString>;
252
446
  defaultValue: z.ZodOptional<z.ZodUnknown>;
253
447
  required: z.ZodOptional<z.ZodBoolean>;
448
+ group: z.ZodOptional<z.ZodEnum<{
449
+ search: "search";
450
+ content: "content";
451
+ profile: "profile";
452
+ style: "style";
453
+ }>>;
254
454
  type: z.ZodLiteral<"product">;
255
455
  }, z.core.$strict>, z.ZodObject<{
256
456
  label: z.ZodString;
257
457
  description: z.ZodOptional<z.ZodString>;
258
458
  defaultValue: z.ZodOptional<z.ZodUnknown>;
259
459
  required: z.ZodOptional<z.ZodBoolean>;
460
+ group: z.ZodOptional<z.ZodEnum<{
461
+ search: "search";
462
+ content: "content";
463
+ profile: "profile";
464
+ style: "style";
465
+ }>>;
260
466
  type: z.ZodLiteral<"products">;
261
467
  minItems: z.ZodOptional<z.ZodNumber>;
262
468
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -265,6 +471,12 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
265
471
  description: z.ZodOptional<z.ZodString>;
266
472
  defaultValue: z.ZodOptional<z.ZodUnknown>;
267
473
  required: z.ZodOptional<z.ZodBoolean>;
474
+ group: z.ZodOptional<z.ZodEnum<{
475
+ search: "search";
476
+ content: "content";
477
+ profile: "profile";
478
+ style: "style";
479
+ }>>;
268
480
  type: z.ZodLiteral<"list">;
269
481
  minItems: z.ZodOptional<z.ZodNumber>;
270
482
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -273,12 +485,18 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
273
485
  description: z.ZodOptional<z.ZodString>;
274
486
  defaultValue: z.ZodOptional<z.ZodUnknown>;
275
487
  required: z.ZodOptional<z.ZodBoolean>;
488
+ group: z.ZodOptional<z.ZodEnum<{
489
+ search: "search";
490
+ content: "content";
491
+ profile: "profile";
492
+ style: "style";
493
+ }>>;
276
494
  type: z.ZodEnum<{
277
495
  number: "number";
278
496
  boolean: "boolean";
497
+ link: "link";
279
498
  text: "text";
280
499
  richtext: "richtext";
281
- link: "link";
282
500
  image: "image";
283
501
  range: "range";
284
502
  select: "select";
@@ -297,4 +515,5 @@ export declare const BlockSettingsSchema: z.ZodRecord<z.ZodString, z.ZodDiscrimi
297
515
  }, z.core.$strict>>;
298
516
  }, z.core.$strict>], "type">>;
299
517
  export type BlockSettings = z.infer<typeof BlockSettingsSchema>;
518
+ export {};
300
519
  //# sourceMappingURL=fields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAY5B,eAAO,MAAM,iBAAiB;;;kBAKnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAkE5D,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAa7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAkD,CAAC;AACnF,MAAM,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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; "profile" shows under Profile
11
+ // banner; "style" shows under Style; "search" shows under Search bar.
12
+ // Themes pick up the value via the existing block.settings.path lookup.
13
+ group: z.enum(['content', 'profile', 'style', 'search']).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,20 @@
1
+ export * from './custom-pages.ts';
2
+ export * from './dedicated-pages.ts';
1
3
  export * from './builder-settings.ts';
4
+ export * from './canonical-settings.ts';
2
5
  export * from './events.ts';
3
6
  export * from './fields.ts';
4
7
  export * from './legacy-manifest.ts';
5
8
  export * from './migrations.ts';
9
+ export * from './persistence.ts';
10
+ export * from './preview-boot.ts';
6
11
  export * from './preview-protocol.ts';
12
+ export * from './preview-session-resolve.ts';
13
+ export * from './preview-trusted-origins.ts';
14
+ export * from './storefront-initial-data-html.ts';
15
+ export * from './storefront-typography-fonts.ts';
7
16
  export * from './style-slots.ts';
8
17
  export * from './theme-manifest.ts';
18
+ export * from './theme-schemes.ts';
9
19
  export * from './validation.ts';
10
20
  //# sourceMappingURL=index.d.ts.map
@@ -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,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,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,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,19 @@
1
+ export * from "./custom-pages.js";
2
+ export * from "./dedicated-pages.js";
1
3
  export * from "./builder-settings.js";
4
+ export * from "./canonical-settings.js";
2
5
  export * from "./events.js";
3
6
  export * from "./fields.js";
4
7
  export * from "./legacy-manifest.js";
5
8
  export * from "./migrations.js";
9
+ export * from "./persistence.js";
10
+ export * from "./preview-boot.js";
6
11
  export * from "./preview-protocol.js";
12
+ export * from "./preview-session-resolve.js";
13
+ export * from "./preview-trusted-origins.js";
14
+ export * from "./storefront-initial-data-html.js";
15
+ export * from "./storefront-typography-fonts.js";
7
16
  export * from "./style-slots.js";
8
17
  export * from "./theme-manifest.js";
18
+ export * from "./theme-schemes.js";
9
19
  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>;
@@ -168,5 +179,12 @@ export declare const LegacyThemeManifestSchema: z.ZodObject<{
168
179
  }, z.core.$loose>;
169
180
  export type LegacyThemeManifest = z.infer<typeof LegacyThemeManifestSchema>;
170
181
  export declare function convertLegacyThemeManifest(input: unknown): ThemeManifest;
182
+ export type ThemePageBlockOrderPage = {
183
+ allowedBlocks?: string[];
184
+ defaultBlocks?: Array<{
185
+ type?: string;
186
+ }>;
187
+ };
188
+ export declare function getThemePageBlockOrderFromManifest(manifest: unknown, pageId: string): string[];
171
189
  export {};
172
190
  //# sourceMappingURL=legacy-manifest.d.ts.map
@@ -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;AAS9E,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,CAA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