@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.
Files changed (71) hide show
  1. package/dist/builder-contracts.test.js +71 -1
  2. package/dist/builder-settings.d.ts +9 -666
  3. package/dist/builder-settings.d.ts.map +1 -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/events.d.ts +35 -240
  8. package/dist/events.d.ts.map +1 -1
  9. package/dist/events.js +7 -0
  10. package/dist/fields.d.ts +169 -8
  11. package/dist/fields.d.ts.map +1 -1
  12. package/dist/fields.js +27 -0
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +7 -0
  16. package/dist/legacy-manifest.d.ts +11 -0
  17. package/dist/legacy-manifest.d.ts.map +1 -1
  18. package/dist/legacy-manifest.js +106 -16
  19. package/dist/migrations.d.ts.map +1 -1
  20. package/dist/migrations.js +50 -4
  21. package/dist/persistence.d.ts +7 -0
  22. package/dist/persistence.d.ts.map +1 -0
  23. package/dist/persistence.js +58 -0
  24. package/dist/preview-boot.d.ts +68 -0
  25. package/dist/preview-boot.d.ts.map +1 -0
  26. package/dist/preview-boot.js +36 -0
  27. package/dist/preview-protocol.d.ts +227 -459
  28. package/dist/preview-protocol.d.ts.map +1 -1
  29. package/dist/preview-protocol.js +112 -0
  30. package/dist/preview-session-resolve.d.ts +115 -0
  31. package/dist/preview-session-resolve.d.ts.map +1 -0
  32. package/dist/preview-session-resolve.js +25 -0
  33. package/dist/preview-trusted-origins.d.ts +4 -0
  34. package/dist/preview-trusted-origins.d.ts.map +1 -0
  35. package/dist/preview-trusted-origins.js +26 -0
  36. package/dist/storefront-initial-data-html.d.ts +17 -0
  37. package/dist/storefront-initial-data-html.d.ts.map +1 -0
  38. package/dist/storefront-initial-data-html.js +83 -0
  39. package/dist/style-slots.d.ts +49 -151
  40. package/dist/style-slots.d.ts.map +1 -1
  41. package/dist/style-slots.js +75 -29
  42. package/dist/theme-manifest.d.ts +229 -454
  43. package/dist/theme-manifest.d.ts.map +1 -1
  44. package/dist/theme-manifest.js +92 -0
  45. package/dist/theme-schemes.d.ts +10 -0
  46. package/dist/theme-schemes.d.ts.map +1 -0
  47. package/dist/theme-schemes.js +24 -0
  48. package/dist/validation.d.ts +1 -1
  49. package/dist/validation.d.ts.map +1 -1
  50. package/dist/validation.js +18 -9
  51. package/package.json +43 -1
  52. package/src/builder-contracts.test.ts +398 -3
  53. package/src/canonical-settings.ts +156 -0
  54. package/src/events.ts +8 -0
  55. package/src/fields.ts +30 -0
  56. package/src/index.ts +7 -0
  57. package/src/legacy-manifest.ts +107 -16
  58. package/src/migrations.ts +65 -4
  59. package/src/persistence.ts +77 -0
  60. package/src/preview-boot.ts +47 -0
  61. package/src/preview-protocol.test.ts +132 -0
  62. package/src/preview-protocol.ts +122 -0
  63. package/src/preview-session-resolve.ts +34 -0
  64. package/src/preview-trusted-origins.test.ts +24 -0
  65. package/src/preview-trusted-origins.ts +35 -0
  66. package/src/storefront-initial-data-html.test.ts +63 -0
  67. package/src/storefront-initial-data-html.ts +112 -0
  68. package/src/style-slots.ts +96 -31
  69. package/src/theme-manifest.ts +118 -1
  70. package/src/theme-schemes.ts +33 -0
  71. package/src/validation.ts +27 -10
@@ -1 +1 @@
1
- {"version":3,"file":"preview-protocol.d.ts","sourceRoot":"","sources":["../src/preview-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;kBAYxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMhC,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;kBAM5B,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;kBAMnC,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;kBAIlC,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAK/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B;;;kBAK5B,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;kBAK9B,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;;;kBAMlC,CAAC;AAEZ,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;kBAMrC,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAKhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"preview-protocol.d.ts","sourceRoot":"","sources":["../src/preview-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;kBAYxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMhC,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;kBAM5B,CAAC;AAEZ,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;kBAMnC,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;kBAIlC,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;EAA8B,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC;;;;;;kBAKxC,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gCAAgC;;;;;;kBAQlC,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;;kBAa5B,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;kBAK9B,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;;;kBAMlC,CAAC;AAEZ,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;kBAMrC,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0B5B,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;kBAOnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,8BAA8B;;;;;;;;;;kBAOhC,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;kBAOpC,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,qCAAqC;;;;;;kBAQvC,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAUhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -39,16 +39,47 @@ export const PreviewRequestReadyMessageSchema = z
39
39
  type: z.literal('REQUEST_READY'),
40
40
  })
41
41
  .strict();
42
+ export const InteractionModeSchema = z.enum(['edit', 'preview']);
43
+ /**
44
+ * Dashboard tells the runtime which interaction mode is active:
45
+ * - "edit" (default) intercepts clicks for selection.
46
+ * - "preview" lets the storefront react to clicks/links normally so
47
+ * a merchant can test buy-now flows or anchor links.
48
+ */
49
+ export const PreviewSetInteractionModeMessageSchema = z
50
+ .object({
51
+ type: z.literal('SET_INTERACTION_MODE'),
52
+ mode: InteractionModeSchema,
53
+ })
54
+ .strict();
42
55
  export const PreviewMessageSchema = z.discriminatedUnion('type', [
43
56
  PreviewApplyStateMessageSchema,
44
57
  PreviewReloadMessageSchema,
45
58
  PreviewSelectElementMessageSchema,
46
59
  PreviewRequestReadyMessageSchema,
60
+ PreviewSetInteractionModeMessageSchema,
47
61
  ]);
62
+ export const PreviewBootstrapOkResponseSchema = z
63
+ .object({
64
+ type: z.literal('BOOTSTRAP_OK'),
65
+ revision: z.number().int().nonnegative(),
66
+ shopSlug: z.string().min(1),
67
+ shopId: z.string().min(1),
68
+ artifactStale: z.boolean().optional(),
69
+ })
70
+ .strict();
48
71
  export const PreviewReadyResponseSchema = z
49
72
  .object({
50
73
  type: z.literal('READY'),
51
74
  revision: z.number().int().nonnegative(),
75
+ health: z
76
+ .object({
77
+ reactMounted: z.literal(true),
78
+ builderRuntimeProvider: z.literal(true),
79
+ protocolVersion: z.literal(2),
80
+ })
81
+ .strict()
82
+ .optional(),
52
83
  })
53
84
  .strict();
54
85
  export const PreviewAppliedResponseSchema = z
@@ -71,9 +102,90 @@ export const PreviewElementClickedResponseSchema = z
71
102
  selection: BuilderSelectionSchema,
72
103
  })
73
104
  .strict();
105
+ export const PreviewErrorResponseSchema = z
106
+ .object({
107
+ type: z.literal('PREVIEW_ERROR'),
108
+ revision: z.number().int().nonnegative().optional(),
109
+ message: z.string().min(1),
110
+ stack: z.string().optional(),
111
+ source: z.enum(['bootstrap', 'error', 'unhandledrejection']).optional(),
112
+ phase: z.enum(['bootstrap', 'runtime']).optional(),
113
+ diagnostics: z
114
+ .object({
115
+ name: z.string().optional(),
116
+ filename: z.string().optional(),
117
+ lineno: z.number().optional(),
118
+ colno: z.number().optional(),
119
+ href: z.string().optional(),
120
+ referrer: z.string().optional(),
121
+ parentOrigin: z.string().optional(),
122
+ previewMode: z.string().optional(),
123
+ userAgent: z.string().optional(),
124
+ localStorage: z.enum(['available', 'blocked', 'unknown']).optional(),
125
+ sessionStorage: z.enum(['available', 'blocked', 'unknown']).optional(),
126
+ historyScrollRestoration: z.enum(['available', 'blocked', 'unknown']).optional(),
127
+ })
128
+ .strict()
129
+ .optional(),
130
+ })
131
+ .strict();
132
+ /**
133
+ * Geometry of a block inside the preview iframe, expressed in the iframe's
134
+ * own coordinate space (viewport-relative). The dashboard converts these
135
+ * coordinates to its own overlay layer when positioning the floating
136
+ * toolbar / drag handle / insert affordances.
137
+ */
138
+ export const PreviewRectSchema = z
139
+ .object({
140
+ top: z.number().finite(),
141
+ left: z.number().finite(),
142
+ width: z.number().finite(),
143
+ height: z.number().finite(),
144
+ })
145
+ .strict();
146
+ export const PreviewBlockRectResponseSchema = z
147
+ .object({
148
+ type: z.literal('BLOCK_RECT'),
149
+ revision: z.number().int().nonnegative().optional(),
150
+ blockId: z.string().min(1),
151
+ rect: PreviewRectSchema.nullable(),
152
+ })
153
+ .strict();
154
+ /**
155
+ * Preview reports a gap between two consecutive blocks that the user is
156
+ * hovering. The dashboard renders a "+" insert affordance there. When
157
+ * the user moves away from any gap, `index` is null.
158
+ */
159
+ export const PreviewInserterHoverResponseSchema = z
160
+ .object({
161
+ type: z.literal('INSERTER_HOVER'),
162
+ revision: z.number().int().nonnegative().optional(),
163
+ index: z.number().int().nonnegative().nullable(),
164
+ rect: PreviewRectSchema.nullable(),
165
+ })
166
+ .strict();
167
+ /**
168
+ * Inline-edit commit. The runtime captures contenteditable text on
169
+ * blur/Enter and sends the result back to the dashboard, which writes
170
+ * it to the corresponding block/content path through the store.
171
+ */
172
+ export const PreviewInlineEditCommitResponseSchema = z
173
+ .object({
174
+ type: z.literal('INLINE_EDIT_COMMIT'),
175
+ revision: z.number().int().nonnegative().optional(),
176
+ blockId: z.string().min(1),
177
+ contentPath: z.string().min(1),
178
+ value: z.string(),
179
+ })
180
+ .strict();
74
181
  export const PreviewResponseSchema = z.discriminatedUnion('type', [
182
+ PreviewBootstrapOkResponseSchema,
75
183
  PreviewReadyResponseSchema,
76
184
  PreviewAppliedResponseSchema,
77
185
  PreviewApplyFailedResponseSchema,
78
186
  PreviewElementClickedResponseSchema,
187
+ PreviewErrorResponseSchema,
188
+ PreviewBlockRectResponseSchema,
189
+ PreviewInserterHoverResponseSchema,
190
+ PreviewInlineEditCommitResponseSchema,
79
191
  ]);
@@ -0,0 +1,115 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const BuilderPreviewResolveDataSchema: z.ZodObject<{
3
+ sessionId: z.ZodString;
4
+ shopId: z.ZodString;
5
+ shopSlug: z.ZodString;
6
+ themeId: z.ZodString;
7
+ artifactPrefix: z.ZodString;
8
+ builderSettings: z.ZodObject<{
9
+ version: z.ZodLiteral<2>;
10
+ revision: z.ZodNumber;
11
+ theme: z.ZodObject<{
12
+ content: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
+ layout: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
14
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ type: z.ZodString;
17
+ variant: z.ZodOptional<z.ZodString>;
18
+ visible: z.ZodDefault<z.ZodBoolean>;
19
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
+ style_overrides: z.ZodOptional<z.ZodType<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown>>>;
21
+ }, z.core.$strict>>>;
22
+ }, z.core.$strict>>>;
23
+ style_slots: z.ZodDefault<z.ZodType<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown>>>;
24
+ pages: z.ZodDefault<z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ title: z.ZodString;
27
+ slug: z.ZodString;
28
+ visible: z.ZodDefault<z.ZodBoolean>;
29
+ layout: z.ZodDefault<z.ZodObject<{
30
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
31
+ id: z.ZodString;
32
+ type: z.ZodString;
33
+ variant: z.ZodOptional<z.ZodString>;
34
+ visible: z.ZodDefault<z.ZodBoolean>;
35
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
36
+ style_overrides: z.ZodOptional<z.ZodType<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown>>>;
37
+ }, z.core.$strict>>>;
38
+ }, z.core.$strict>>;
39
+ seo: z.ZodOptional<z.ZodObject<{
40
+ title: z.ZodOptional<z.ZodString>;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strict>>;
43
+ }, z.core.$strict>>>;
44
+ terms: z.ZodDefault<z.ZodObject<{
45
+ termsOfService: z.ZodOptional<z.ZodString>;
46
+ privacyPolicy: z.ZodOptional<z.ZodString>;
47
+ refundPolicy: z.ZodOptional<z.ZodString>;
48
+ imprint: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>;
51
+ }, z.core.$strict>;
52
+ artifactStale: z.ZodOptional<z.ZodBoolean>;
53
+ sourceRevision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ }, z.core.$strict>;
55
+ export type BuilderPreviewResolveData = z.infer<typeof BuilderPreviewResolveDataSchema>;
56
+ export declare const BuilderPreviewResolveResponseSchema: z.ZodObject<{
57
+ status: z.ZodNumber;
58
+ data: z.ZodNullable<z.ZodObject<{
59
+ sessionId: z.ZodString;
60
+ shopId: z.ZodString;
61
+ shopSlug: z.ZodString;
62
+ themeId: z.ZodString;
63
+ artifactPrefix: z.ZodString;
64
+ builderSettings: z.ZodObject<{
65
+ version: z.ZodLiteral<2>;
66
+ revision: z.ZodNumber;
67
+ theme: z.ZodObject<{
68
+ content: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
69
+ layout: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
70
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
71
+ id: z.ZodString;
72
+ type: z.ZodString;
73
+ variant: z.ZodOptional<z.ZodString>;
74
+ visible: z.ZodDefault<z.ZodBoolean>;
75
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
76
+ style_overrides: z.ZodOptional<z.ZodType<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown>>>;
77
+ }, z.core.$strict>>>;
78
+ }, z.core.$strict>>>;
79
+ style_slots: z.ZodDefault<z.ZodType<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown>>>;
80
+ pages: z.ZodDefault<z.ZodArray<z.ZodObject<{
81
+ id: z.ZodString;
82
+ title: z.ZodString;
83
+ slug: z.ZodString;
84
+ visible: z.ZodDefault<z.ZodBoolean>;
85
+ layout: z.ZodDefault<z.ZodObject<{
86
+ blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
87
+ id: z.ZodString;
88
+ type: z.ZodString;
89
+ variant: z.ZodOptional<z.ZodString>;
90
+ visible: z.ZodDefault<z.ZodBoolean>;
91
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
92
+ style_overrides: z.ZodOptional<z.ZodType<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<import("./style-slots.ts").StyleSlotId, import("./style-slots.ts").StyleSlotValue>>, unknown>>>;
93
+ }, z.core.$strict>>>;
94
+ }, z.core.$strict>>;
95
+ seo: z.ZodOptional<z.ZodObject<{
96
+ title: z.ZodOptional<z.ZodString>;
97
+ description: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strict>>;
99
+ }, z.core.$strict>>>;
100
+ terms: z.ZodDefault<z.ZodObject<{
101
+ termsOfService: z.ZodOptional<z.ZodString>;
102
+ privacyPolicy: z.ZodOptional<z.ZodString>;
103
+ refundPolicy: z.ZodOptional<z.ZodString>;
104
+ imprint: z.ZodOptional<z.ZodString>;
105
+ }, z.core.$strict>>;
106
+ }, z.core.$strict>;
107
+ }, z.core.$strict>;
108
+ artifactStale: z.ZodOptional<z.ZodBoolean>;
109
+ sourceRevision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
+ }, z.core.$strict>>;
111
+ error: z.ZodNullable<z.ZodString>;
112
+ }, z.core.$strict>;
113
+ export type BuilderPreviewResolveResponse = z.infer<typeof BuilderPreviewResolveResponseSchema>;
114
+ export declare function parseBuilderPreviewResolveResponse(value: unknown): BuilderPreviewResolveResponse | null;
115
+ //# sourceMappingURL=preview-session-resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-session-resolve.d.ts","sourceRoot":"","sources":["../src/preview-session-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAWjC,CAAC;AAEZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMrC,CAAC;AAEZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,GACb,6BAA6B,GAAG,IAAI,CAGtC"}
@@ -0,0 +1,25 @@
1
+ import * as z from 'zod/v4';
2
+ import { BuilderSettingsSchema } from "./builder-settings.js";
3
+ export const BuilderPreviewResolveDataSchema = z
4
+ .object({
5
+ sessionId: z.string().min(1),
6
+ shopId: z.string().min(1),
7
+ shopSlug: z.string().min(1),
8
+ themeId: z.string().min(1),
9
+ artifactPrefix: z.string().min(1),
10
+ builderSettings: BuilderSettingsSchema,
11
+ artifactStale: z.boolean().optional(),
12
+ sourceRevision: z.string().nullable().optional(),
13
+ })
14
+ .strict();
15
+ export const BuilderPreviewResolveResponseSchema = z
16
+ .object({
17
+ status: z.number(),
18
+ data: BuilderPreviewResolveDataSchema.nullable(),
19
+ error: z.string().nullable(),
20
+ })
21
+ .strict();
22
+ export function parseBuilderPreviewResolveResponse(value) {
23
+ const parsed = BuilderPreviewResolveResponseSchema.safeParse(value);
24
+ return parsed.success ? parsed.data : null;
25
+ }
@@ -0,0 +1,4 @@
1
+ export declare const TRUSTED_PREVIEW_PARENT_ORIGINS: readonly ["https://app.shoppex.io", "https://dashboard.shoppex.io", "https://dashboard.shoppex.test", "https://shoppex-dashboard.vercel.app", "http://localhost:3000", "http://127.0.0.1:3000"];
2
+ export type TrustedPreviewParentOrigin = (typeof TRUSTED_PREVIEW_PARENT_ORIGINS)[number];
3
+ export declare function isTrustedPreviewParentOrigin(origin: string): boolean;
4
+ //# sourceMappingURL=preview-trusted-origins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-trusted-origins.d.ts","sourceRoot":"","sources":["../src/preview-trusted-origins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,iMAOjC,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAmBpE"}
@@ -0,0 +1,26 @@
1
+ export const TRUSTED_PREVIEW_PARENT_ORIGINS = [
2
+ 'https://app.shoppex.io',
3
+ 'https://dashboard.shoppex.io',
4
+ 'https://dashboard.shoppex.test',
5
+ 'https://shoppex-dashboard.vercel.app',
6
+ 'http://localhost:3000',
7
+ 'http://127.0.0.1:3000',
8
+ ];
9
+ export function isTrustedPreviewParentOrigin(origin) {
10
+ if (TRUSTED_PREVIEW_PARENT_ORIGINS.includes(origin)) {
11
+ return true;
12
+ }
13
+ try {
14
+ const hostname = new URL(origin).hostname.toLowerCase();
15
+ return (hostname === 'dashboard.shoppex.test'
16
+ || hostname === 'localhost'
17
+ || hostname === '127.0.0.1'
18
+ || hostname === '::1'
19
+ || hostname.endsWith('.localhost')
20
+ || hostname.endsWith('.vercel.app')
21
+ || hostname.endsWith('.vercel.run'));
22
+ }
23
+ catch {
24
+ return false;
25
+ }
26
+ }
@@ -0,0 +1,17 @@
1
+ import type { PreviewBootPayload } from './preview-boot.ts';
2
+ export declare const HTML_INITIAL_BLOCK_PATTERN: RegExp;
3
+ export declare const LEGACY_HTML_INITIAL_PATTERN: RegExp;
4
+ export type InitialDataScriptMatch = {
5
+ json: string;
6
+ };
7
+ export declare function stripAllInitialDataScripts(html: string): string;
8
+ export declare function findInitialDataScriptJson(html: string): InitialDataScriptMatch | null;
9
+ export declare function findInitialDataPayload(html: string): Record<string, unknown> | null;
10
+ export declare function countInitialDataScripts(html: string): number;
11
+ export declare function buildPlainInitialDataScript(initialData: Record<string, unknown>): string;
12
+ export declare function buildWrappedStorefrontInitialDataScript(serialized: string, deployedThemeEntryPathPattern: RegExp): string;
13
+ export declare function injectPlainInitialDataBeforeHeadClose(html: string, script: string): string;
14
+ export declare function injectPreviewInitialData(html: string, payload: PreviewBootPayload): string;
15
+ export declare function assertSingleInitialDataScript(html: string, expectedSlug: string): void;
16
+ export declare function safeJson(value: unknown): string;
17
+ //# sourceMappingURL=storefront-initial-data-html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storefront-initial-data-html.d.ts","sourceRoot":"","sources":["../src/storefront-initial-data-html.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,eAAO,MAAM,0BAA0B,QAC8K,CAAC;AAEtN,eAAO,MAAM,2BAA2B,QACuB,CAAC;AAOhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,GAAG,IAAI,CAYrF;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAWnF;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK5D;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAExF;AAED,wBAAgB,uCAAuC,CACrD,UAAU,EAAE,MAAM,EAClB,6BAA6B,EAAE,MAAM,GACpC,MAAM,CAOR;AAED,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAK1F;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAK1F;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAmBtF;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/C"}
@@ -0,0 +1,83 @@
1
+ import { mergePreviewBootIntoInitialData } from "./preview-boot.js";
2
+ export const HTML_INITIAL_BLOCK_PATTERN = /<!--shoppex-initial-data:start--><script>\(function\(\)\{[\s\S]*?window\.__SHOPPEX_INITIAL__=([\s\S]*?)(?=;\}\)\(\);<\/script><!--shoppex-initial-data:end-->);\}\)\(\);<\/script><!--shoppex-initial-data:end-->/;
3
+ export const LEGACY_HTML_INITIAL_PATTERN = /<script>\s*window\.__SHOPPEX_INITIAL__=([\s\S]*?)<\/script>/;
4
+ const HTML_INITIAL_BLOCK_GLOBAL_PATTERN = new RegExp(HTML_INITIAL_BLOCK_PATTERN.source, 'g');
5
+ const LEGACY_HTML_INITIAL_GLOBAL_PATTERN = new RegExp(LEGACY_HTML_INITIAL_PATTERN.source, 'g');
6
+ const CLOSING_HEAD_PATTERN = /<\/head>/i;
7
+ export function stripAllInitialDataScripts(html) {
8
+ return html
9
+ .replace(HTML_INITIAL_BLOCK_GLOBAL_PATTERN, '')
10
+ .replace(LEGACY_HTML_INITIAL_GLOBAL_PATTERN, '');
11
+ }
12
+ export function findInitialDataScriptJson(html) {
13
+ const blockMatch = html.match(HTML_INITIAL_BLOCK_PATTERN);
14
+ if (blockMatch?.[1]) {
15
+ return { json: blockMatch[1] };
16
+ }
17
+ const legacyMatch = html.match(LEGACY_HTML_INITIAL_PATTERN);
18
+ if (legacyMatch?.[1]) {
19
+ return { json: legacyMatch[1] };
20
+ }
21
+ return null;
22
+ }
23
+ export function findInitialDataPayload(html) {
24
+ const match = findInitialDataScriptJson(html);
25
+ if (!match) {
26
+ return null;
27
+ }
28
+ try {
29
+ return JSON.parse(match.json.replace(/;\s*$/, ''));
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ export function countInitialDataScripts(html) {
36
+ const blockMatches = html.match(HTML_INITIAL_BLOCK_GLOBAL_PATTERN)?.length ?? 0;
37
+ const stripped = html.replace(HTML_INITIAL_BLOCK_GLOBAL_PATTERN, '');
38
+ const legacyMatches = stripped.match(LEGACY_HTML_INITIAL_GLOBAL_PATTERN)?.length ?? 0;
39
+ return blockMatches + legacyMatches;
40
+ }
41
+ export function buildPlainInitialDataScript(initialData) {
42
+ return `<script>window.__SHOPPEX_INITIAL__=${safeJson(initialData)};</script>`;
43
+ }
44
+ export function buildWrappedStorefrontInitialDataScript(serialized, deployedThemeEntryPathPattern) {
45
+ return [
46
+ '<!--shoppex-initial-data:start--><script>(function(){',
47
+ 'if(typeof window!=="undefined"){var path=window.location.pathname||"";',
48
+ `if(${deployedThemeEntryPathPattern}.test(path)){window.__SHOPPEX_DEPLOYED_THEME_ARTIFACT_PATH__=path;window.history.replaceState(window.history.state,"","/"+window.location.search+window.location.hash);}}`,
49
+ `window.__SHOPPEX_INITIAL__=${serialized};})();</script><!--shoppex-initial-data:end-->`,
50
+ ].join('');
51
+ }
52
+ export function injectPlainInitialDataBeforeHeadClose(html, script) {
53
+ if (CLOSING_HEAD_PATTERN.test(html)) {
54
+ return html.replace(CLOSING_HEAD_PATTERN, `${script}\n</head>`);
55
+ }
56
+ return `${script}\n${html}`;
57
+ }
58
+ export function injectPreviewInitialData(html, payload) {
59
+ const withoutScripts = stripAllInitialDataScripts(html);
60
+ const initialData = mergePreviewBootIntoInitialData(payload);
61
+ const script = buildPlainInitialDataScript(initialData);
62
+ return injectPlainInitialDataBeforeHeadClose(withoutScripts, script);
63
+ }
64
+ export function assertSingleInitialDataScript(html, expectedSlug) {
65
+ const count = countInitialDataScripts(html);
66
+ if (count !== 1) {
67
+ throw new Error(`Expected exactly one initial-data script, found ${count}`);
68
+ }
69
+ const payload = findInitialDataPayload(html);
70
+ const store = payload?.store;
71
+ const slug = typeof store === 'object' && store !== null && !Array.isArray(store)
72
+ ? store.slug
73
+ : null;
74
+ if (typeof slug !== 'string' || slug.trim().length === 0) {
75
+ throw new Error('Initial-data script is missing store.slug');
76
+ }
77
+ if (slug.trim() !== expectedSlug) {
78
+ throw new Error(`Initial-data slug mismatch: expected ${expectedSlug}, got ${slug}`);
79
+ }
80
+ }
81
+ export function safeJson(value) {
82
+ return JSON.stringify(value).replace(/</g, '\\u003c');
83
+ }
@@ -27,7 +27,7 @@ export declare const ColorSchema: z.ZodString;
27
27
  export type Color = z.infer<typeof ColorSchema>;
28
28
  export declare const FontWeightSchema: z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<300>, z.ZodLiteral<400>, z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>, z.ZodLiteral<800>, z.ZodLiteral<900>]>;
29
29
  export type FontWeight = z.infer<typeof FontWeightSchema>;
30
- export declare const StyleSlotIdSchema: z.ZodEnum<{
30
+ export declare const CoreStyleSlotIdSchema: z.ZodEnum<{
31
31
  "button.radius": "button.radius";
32
32
  "button.background": "button.background";
33
33
  "button.foreground": "button.foreground";
@@ -53,157 +53,55 @@ export declare const StyleSlotIdSchema: z.ZodEnum<{
53
53
  "typography.heading.weight": "typography.heading.weight";
54
54
  "typography.body.size": "typography.body.size";
55
55
  }>;
56
- export type StyleSlotId = z.infer<typeof StyleSlotIdSchema>;
56
+ export type CoreStyleSlotId = z.infer<typeof CoreStyleSlotIdSchema>;
57
+ export declare const ThemeStyleSlotIdSchema: z.ZodString;
58
+ export type ThemeStyleSlotId = `theme.${string}`;
59
+ export declare const StyleSlotIdSchema: z.ZodUnion<readonly [z.ZodEnum<{
60
+ "button.radius": "button.radius";
61
+ "button.background": "button.background";
62
+ "button.foreground": "button.foreground";
63
+ "button.border": "button.border";
64
+ "button.font.weight": "button.font.weight";
65
+ "input.radius": "input.radius";
66
+ "input.height": "input.height";
67
+ "input.border": "input.border";
68
+ "input.background": "input.background";
69
+ "input.foreground": "input.foreground";
70
+ "card.radius": "card.radius";
71
+ "card.background": "card.background";
72
+ "card.border": "card.border";
73
+ "section.padding.y": "section.padding.y";
74
+ "section.padding.x": "section.padding.x";
75
+ "container.width": "container.width";
76
+ "color.primary": "color.primary";
77
+ "color.accent": "color.accent";
78
+ "color.background": "color.background";
79
+ "color.foreground": "color.foreground";
80
+ "color.muted": "color.muted";
81
+ "link.color": "link.color";
82
+ "typography.heading.weight": "typography.heading.weight";
83
+ "typography.body.size": "typography.body.size";
84
+ }>, z.ZodString]>;
85
+ export type StyleSlotId = CoreStyleSlotId | ThemeStyleSlotId;
57
86
  export declare const CORE_STYLE_SLOT_IDS: ("button.radius" | "button.background" | "button.foreground" | "button.border" | "button.font.weight" | "input.radius" | "input.height" | "input.border" | "input.background" | "input.foreground" | "card.radius" | "card.background" | "card.border" | "section.padding.y" | "section.padding.x" | "container.width" | "color.primary" | "color.accent" | "color.background" | "color.foreground" | "color.muted" | "link.color" | "typography.heading.weight" | "typography.body.size")[];
58
- export declare const StyleSlotsSchema: z.ZodObject<{
59
- 'button.radius': z.ZodOptional<z.ZodObject<{
60
- base: z.ZodNumber;
61
- sm: z.ZodOptional<z.ZodNumber>;
62
- md: z.ZodOptional<z.ZodNumber>;
63
- lg: z.ZodOptional<z.ZodNumber>;
64
- xl: z.ZodOptional<z.ZodNumber>;
65
- }, z.core.$strict>>;
66
- 'button.background': z.ZodOptional<z.ZodString>;
67
- 'button.foreground': z.ZodOptional<z.ZodString>;
68
- 'button.border': z.ZodOptional<z.ZodString>;
69
- 'button.font.weight': z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<300>, z.ZodLiteral<400>, z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>, z.ZodLiteral<800>, z.ZodLiteral<900>]>>;
70
- 'input.radius': z.ZodOptional<z.ZodObject<{
71
- base: z.ZodNumber;
72
- sm: z.ZodOptional<z.ZodNumber>;
73
- md: z.ZodOptional<z.ZodNumber>;
74
- lg: z.ZodOptional<z.ZodNumber>;
75
- xl: z.ZodOptional<z.ZodNumber>;
76
- }, z.core.$strict>>;
77
- 'input.height': z.ZodOptional<z.ZodObject<{
78
- base: z.ZodNumber;
79
- sm: z.ZodOptional<z.ZodNumber>;
80
- md: z.ZodOptional<z.ZodNumber>;
81
- lg: z.ZodOptional<z.ZodNumber>;
82
- xl: z.ZodOptional<z.ZodNumber>;
83
- }, z.core.$strict>>;
84
- 'input.border': z.ZodOptional<z.ZodString>;
85
- 'input.background': z.ZodOptional<z.ZodString>;
86
- 'input.foreground': z.ZodOptional<z.ZodString>;
87
- 'card.radius': z.ZodOptional<z.ZodObject<{
88
- base: z.ZodNumber;
89
- sm: z.ZodOptional<z.ZodNumber>;
90
- md: z.ZodOptional<z.ZodNumber>;
91
- lg: z.ZodOptional<z.ZodNumber>;
92
- xl: z.ZodOptional<z.ZodNumber>;
93
- }, z.core.$strict>>;
94
- 'card.background': z.ZodOptional<z.ZodString>;
95
- 'card.border': z.ZodOptional<z.ZodString>;
96
- 'section.padding.y': z.ZodOptional<z.ZodObject<{
97
- base: z.ZodNumber;
98
- sm: z.ZodOptional<z.ZodNumber>;
99
- md: z.ZodOptional<z.ZodNumber>;
100
- lg: z.ZodOptional<z.ZodNumber>;
101
- xl: z.ZodOptional<z.ZodNumber>;
102
- }, z.core.$strict>>;
103
- 'section.padding.x': z.ZodOptional<z.ZodObject<{
104
- base: z.ZodNumber;
105
- sm: z.ZodOptional<z.ZodNumber>;
106
- md: z.ZodOptional<z.ZodNumber>;
107
- lg: z.ZodOptional<z.ZodNumber>;
108
- xl: z.ZodOptional<z.ZodNumber>;
109
- }, z.core.$strict>>;
110
- 'container.width': z.ZodOptional<z.ZodObject<{
111
- base: z.ZodNumber;
112
- sm: z.ZodOptional<z.ZodNumber>;
113
- md: z.ZodOptional<z.ZodNumber>;
114
- lg: z.ZodOptional<z.ZodNumber>;
115
- xl: z.ZodOptional<z.ZodNumber>;
116
- }, z.core.$strict>>;
117
- 'color.primary': z.ZodOptional<z.ZodString>;
118
- 'color.accent': z.ZodOptional<z.ZodString>;
119
- 'color.background': z.ZodOptional<z.ZodString>;
120
- 'color.foreground': z.ZodOptional<z.ZodString>;
121
- 'color.muted': z.ZodOptional<z.ZodString>;
122
- 'link.color': z.ZodOptional<z.ZodString>;
123
- 'typography.heading.weight': z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<300>, z.ZodLiteral<400>, z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>, z.ZodLiteral<800>, z.ZodLiteral<900>]>>;
124
- 'typography.body.size': z.ZodOptional<z.ZodObject<{
125
- base: z.ZodNumber;
126
- sm: z.ZodOptional<z.ZodNumber>;
127
- md: z.ZodOptional<z.ZodNumber>;
128
- lg: z.ZodOptional<z.ZodNumber>;
129
- xl: z.ZodOptional<z.ZodNumber>;
130
- }, z.core.$strict>>;
131
- }, z.core.$strict>;
132
- export type StyleSlots = z.infer<typeof StyleSlotsSchema>;
133
- export declare const StyleSlotDefaultsSchema: z.ZodObject<{
134
- 'button.radius': z.ZodOptional<z.ZodObject<{
135
- base: z.ZodNumber;
136
- sm: z.ZodOptional<z.ZodNumber>;
137
- md: z.ZodOptional<z.ZodNumber>;
138
- lg: z.ZodOptional<z.ZodNumber>;
139
- xl: z.ZodOptional<z.ZodNumber>;
140
- }, z.core.$strict>>;
141
- 'button.background': z.ZodOptional<z.ZodString>;
142
- 'button.foreground': z.ZodOptional<z.ZodString>;
143
- 'button.border': z.ZodOptional<z.ZodString>;
144
- 'button.font.weight': z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<300>, z.ZodLiteral<400>, z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>, z.ZodLiteral<800>, z.ZodLiteral<900>]>>;
145
- 'input.radius': z.ZodOptional<z.ZodObject<{
146
- base: z.ZodNumber;
147
- sm: z.ZodOptional<z.ZodNumber>;
148
- md: z.ZodOptional<z.ZodNumber>;
149
- lg: z.ZodOptional<z.ZodNumber>;
150
- xl: z.ZodOptional<z.ZodNumber>;
151
- }, z.core.$strict>>;
152
- 'input.height': z.ZodOptional<z.ZodObject<{
153
- base: z.ZodNumber;
154
- sm: z.ZodOptional<z.ZodNumber>;
155
- md: z.ZodOptional<z.ZodNumber>;
156
- lg: z.ZodOptional<z.ZodNumber>;
157
- xl: z.ZodOptional<z.ZodNumber>;
158
- }, z.core.$strict>>;
159
- 'input.border': z.ZodOptional<z.ZodString>;
160
- 'input.background': z.ZodOptional<z.ZodString>;
161
- 'input.foreground': z.ZodOptional<z.ZodString>;
162
- 'card.radius': z.ZodOptional<z.ZodObject<{
163
- base: z.ZodNumber;
164
- sm: z.ZodOptional<z.ZodNumber>;
165
- md: z.ZodOptional<z.ZodNumber>;
166
- lg: z.ZodOptional<z.ZodNumber>;
167
- xl: z.ZodOptional<z.ZodNumber>;
168
- }, z.core.$strict>>;
169
- 'card.background': z.ZodOptional<z.ZodString>;
170
- 'card.border': z.ZodOptional<z.ZodString>;
171
- 'section.padding.y': z.ZodOptional<z.ZodObject<{
172
- base: z.ZodNumber;
173
- sm: z.ZodOptional<z.ZodNumber>;
174
- md: z.ZodOptional<z.ZodNumber>;
175
- lg: z.ZodOptional<z.ZodNumber>;
176
- xl: z.ZodOptional<z.ZodNumber>;
177
- }, z.core.$strict>>;
178
- 'section.padding.x': z.ZodOptional<z.ZodObject<{
179
- base: z.ZodNumber;
180
- sm: z.ZodOptional<z.ZodNumber>;
181
- md: z.ZodOptional<z.ZodNumber>;
182
- lg: z.ZodOptional<z.ZodNumber>;
183
- xl: z.ZodOptional<z.ZodNumber>;
184
- }, z.core.$strict>>;
185
- 'container.width': z.ZodOptional<z.ZodObject<{
186
- base: z.ZodNumber;
187
- sm: z.ZodOptional<z.ZodNumber>;
188
- md: z.ZodOptional<z.ZodNumber>;
189
- lg: z.ZodOptional<z.ZodNumber>;
190
- xl: z.ZodOptional<z.ZodNumber>;
191
- }, z.core.$strict>>;
192
- 'color.primary': z.ZodOptional<z.ZodString>;
193
- 'color.accent': z.ZodOptional<z.ZodString>;
194
- 'color.background': z.ZodOptional<z.ZodString>;
195
- 'color.foreground': z.ZodOptional<z.ZodString>;
196
- 'color.muted': z.ZodOptional<z.ZodString>;
197
- 'link.color': z.ZodOptional<z.ZodString>;
198
- 'typography.heading.weight': z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<300>, z.ZodLiteral<400>, z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>, z.ZodLiteral<800>, z.ZodLiteral<900>]>>;
199
- 'typography.body.size': z.ZodOptional<z.ZodObject<{
200
- base: z.ZodNumber;
201
- sm: z.ZodOptional<z.ZodNumber>;
202
- md: z.ZodOptional<z.ZodNumber>;
203
- lg: z.ZodOptional<z.ZodNumber>;
204
- xl: z.ZodOptional<z.ZodNumber>;
205
- }, z.core.$strict>>;
206
- }, z.core.$strict>;
87
+ export declare const ThemeStyleSlotValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
88
+ base: z.ZodNumber;
89
+ sm: z.ZodOptional<z.ZodNumber>;
90
+ md: z.ZodOptional<z.ZodNumber>;
91
+ lg: z.ZodOptional<z.ZodNumber>;
92
+ xl: z.ZodOptional<z.ZodNumber>;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ base: z.ZodString;
95
+ sm: z.ZodOptional<z.ZodString>;
96
+ md: z.ZodOptional<z.ZodString>;
97
+ lg: z.ZodOptional<z.ZodString>;
98
+ xl: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodLiteral<100>, z.ZodLiteral<200>, z.ZodLiteral<300>, z.ZodLiteral<400>, z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>, z.ZodLiteral<800>, z.ZodLiteral<900>]>, z.ZodString, z.ZodNumber, z.ZodBoolean]>;
100
+ export type ThemeStyleSlotValue = z.infer<typeof ThemeStyleSlotValueSchema>;
101
+ export type StyleSlotValue = Color | ResponsiveNumber | ResponsiveString | FontWeight | string | number | boolean;
102
+ export type StyleSlots = Partial<Record<StyleSlotId, StyleSlotValue>>;
103
+ export declare const StyleSlotsSchema: z.ZodType<StyleSlots>;
104
+ export declare const StyleSlotDefaultsSchema: z.ZodType<Partial<Record<StyleSlotId, StyleSlotValue>>, unknown, z.core.$ZodTypeInternals<Partial<Record<StyleSlotId, StyleSlotValue>>, unknown>>;
207
105
  export type StyleSlotDefaults = StyleSlots;
208
106
  export declare function parseStyleSlots(input: unknown): StyleSlots;
209
107
  //# sourceMappingURL=style-slots.d.ts.map