@shoppexio/builder-contracts 0.1.1 → 0.1.3
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-settings.d.ts +2 -0
- package/dist/builder-settings.d.ts.map +1 -1
- package/dist/builder-settings.js +2 -1
- package/dist/custom-pages.d.ts +15 -0
- package/dist/custom-pages.d.ts.map +1 -0
- package/dist/custom-pages.js +40 -0
- package/dist/dedicated-pages.d.ts +15 -0
- package/dist/dedicated-pages.d.ts.map +1 -0
- package/dist/dedicated-pages.js +142 -0
- package/dist/fields.d.ts +64 -6
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +4 -4
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/legacy-manifest.d.ts +7 -0
- package/dist/legacy-manifest.d.ts.map +1 -1
- package/dist/legacy-manifest.js +31 -6
- package/dist/migrations.d.ts +1 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +30 -2
- package/dist/persistence.d.ts +9 -0
- package/dist/persistence.d.ts.map +1 -1
- package/dist/persistence.js +80 -0
- package/dist/preview-boot.d.ts +2 -2
- package/dist/preview-boot.d.ts.map +1 -1
- package/dist/preview-boot.js +3 -1
- package/dist/preview-protocol.d.ts +88 -4
- package/dist/preview-protocol.d.ts.map +1 -1
- package/dist/preview-protocol.js +57 -7
- package/dist/preview-session-resolve.d.ts +2 -2
- package/dist/preview-session-resolve.d.ts.map +1 -1
- package/dist/preview-session-resolve.js +2 -2
- package/dist/preview-trusted-origins.d.ts.map +1 -1
- package/dist/preview-trusted-origins.js +10 -8
- package/dist/storefront-initial-data-html.js +1 -1
- package/dist/storefront-typography-fonts.d.ts +18 -0
- package/dist/storefront-typography-fonts.d.ts.map +1 -0
- package/dist/storefront-typography-fonts.js +89 -0
- package/dist/style-slots.d.ts +2 -2
- package/dist/style-slots.d.ts.map +1 -1
- package/dist/style-slots.js +5 -3
- package/dist/theme-manifest.d.ts +60 -4
- package/dist/theme-manifest.d.ts.map +1 -1
- package/dist/theme-schemes.d.ts +2 -2
- package/dist/theme-schemes.d.ts.map +1 -1
- package/dist/theme-schemes.js +2 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +6 -4
- package/package.json +1 -1
- package/src/builder-contracts.test.ts +66 -0
- package/src/builder-settings.ts +4 -1
- package/src/custom-pages.test.ts +74 -0
- package/src/custom-pages.ts +70 -0
- package/src/dedicated-pages.test.ts +88 -0
- package/src/dedicated-pages.ts +173 -0
- package/src/fields.ts +4 -4
- package/src/index.ts +3 -0
- package/src/legacy-manifest.ts +40 -7
- package/src/migrations.ts +41 -2
- package/src/persistence.ts +107 -0
- package/src/preview-boot.test.ts +72 -0
- package/src/preview-boot.ts +3 -1
- package/src/preview-protocol.test.ts +90 -0
- package/src/preview-protocol.ts +67 -8
- package/src/preview-session-resolve.test.ts +37 -0
- package/src/preview-session-resolve.ts +2 -2
- package/src/storefront-initial-data-html.test.ts +18 -0
- package/src/storefront-initial-data-html.ts +1 -1
- package/src/storefront-typography-fonts.test.ts +48 -0
- package/src/storefront-typography-fonts.ts +108 -0
- package/src/style-slots.ts +6 -3
- package/src/theme-schemes.ts +2 -0
- package/src/validation.ts +6 -4
- package/dist/builder-contracts.test.d.ts +0 -2
- package/dist/builder-contracts.test.d.ts.map +0 -1
- package/dist/builder-contracts.test.js +0 -431
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StorefrontCuratedFont = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
stack: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const STOREFRONT_SYSTEM_FONTS: Set<string>;
|
|
7
|
+
export declare const STOREFRONT_CURATED_FONTS: StorefrontCuratedFont[];
|
|
8
|
+
export declare function resolvePrimaryFontFamilyName(raw: unknown): string | null;
|
|
9
|
+
export declare function resolveCuratedFontValue(raw: unknown, fallback: string): string;
|
|
10
|
+
export declare function curatedFontOptionsForValue(value: string): StorefrontCuratedFont[];
|
|
11
|
+
export declare function findStorefrontCuratedFont(value: string): StorefrontCuratedFont | undefined;
|
|
12
|
+
export declare function isValidGoogleFontFamily(value: unknown): value is string;
|
|
13
|
+
export declare function buildStorefrontGoogleFontHref(family: string): string;
|
|
14
|
+
export declare function getStorefrontGoogleFontHrefs(input: {
|
|
15
|
+
bodyFont?: unknown;
|
|
16
|
+
headingFont?: unknown;
|
|
17
|
+
}): string[];
|
|
18
|
+
//# sourceMappingURL=storefront-typography-fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-typography-fonts.d.ts","sourceRoot":"","sources":["../src/storefront-typography-fonts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,uBAAuB,aAA6C,CAAC;AAElF,eAAO,MAAM,wBAAwB,EAAE,qBAAqB,EAwB3D,CAAC;AAIF,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAoBxE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAajF;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAE1F;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAIvE;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,MAAM,EAAE,CAYX"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export const STOREFRONT_SYSTEM_FONTS = new Set(['Arial', 'Georgia', 'System UI']);
|
|
2
|
+
export const STOREFRONT_CURATED_FONTS = [
|
|
3
|
+
{ value: 'Inter', label: 'Inter', stack: 'Inter, system-ui, sans-serif' },
|
|
4
|
+
{ value: 'Geist', label: 'Geist', stack: 'Geist, system-ui, sans-serif' },
|
|
5
|
+
{ value: 'Manrope', label: 'Manrope', stack: 'Manrope, system-ui, sans-serif' },
|
|
6
|
+
{
|
|
7
|
+
value: 'Plus Jakarta Sans',
|
|
8
|
+
label: 'Plus Jakarta Sans',
|
|
9
|
+
stack: '"Plus Jakarta Sans", system-ui, sans-serif',
|
|
10
|
+
},
|
|
11
|
+
{ value: 'DM Sans', label: 'DM Sans', stack: '"DM Sans", system-ui, sans-serif' },
|
|
12
|
+
{
|
|
13
|
+
value: 'Space Grotesk',
|
|
14
|
+
label: 'Space Grotesk',
|
|
15
|
+
stack: '"Space Grotesk", system-ui, sans-serif',
|
|
16
|
+
},
|
|
17
|
+
{ value: 'Sora', label: 'Sora', stack: 'Sora, system-ui, sans-serif' },
|
|
18
|
+
{
|
|
19
|
+
value: 'IBM Plex Sans',
|
|
20
|
+
label: 'IBM Plex Sans',
|
|
21
|
+
stack: '"IBM Plex Sans", system-ui, sans-serif',
|
|
22
|
+
},
|
|
23
|
+
{ value: 'Arial', label: 'Arial', stack: 'Arial, sans-serif' },
|
|
24
|
+
{ value: 'Georgia', label: 'Georgia', stack: 'Georgia, serif' },
|
|
25
|
+
{ value: 'System UI', label: 'System UI', stack: 'system-ui, sans-serif' },
|
|
26
|
+
];
|
|
27
|
+
const GOOGLE_FONT_FAMILY_PATTERN = /^[A-Za-z0-9 +\-_]+$/;
|
|
28
|
+
export function resolvePrimaryFontFamilyName(raw) {
|
|
29
|
+
if (typeof raw !== 'string')
|
|
30
|
+
return null;
|
|
31
|
+
const trimmed = raw.trim();
|
|
32
|
+
if (!trimmed)
|
|
33
|
+
return null;
|
|
34
|
+
const exact = STOREFRONT_CURATED_FONTS.find((font) => font.value === trimmed || font.stack === trimmed);
|
|
35
|
+
if (exact)
|
|
36
|
+
return exact.value;
|
|
37
|
+
const prefix = STOREFRONT_CURATED_FONTS.find((font) => trimmed.startsWith(`${font.value},`));
|
|
38
|
+
if (prefix)
|
|
39
|
+
return prefix.value;
|
|
40
|
+
const quoted = trimmed.match(/^["'](.+?)["']/);
|
|
41
|
+
if (quoted?.[1]) {
|
|
42
|
+
return quoted[1].trim() || null;
|
|
43
|
+
}
|
|
44
|
+
const primary = trimmed.split(',')[0]?.trim();
|
|
45
|
+
return primary && primary.length > 0 ? primary : null;
|
|
46
|
+
}
|
|
47
|
+
export function resolveCuratedFontValue(raw, fallback) {
|
|
48
|
+
return resolvePrimaryFontFamilyName(raw) ?? fallback;
|
|
49
|
+
}
|
|
50
|
+
export function curatedFontOptionsForValue(value) {
|
|
51
|
+
if (STOREFRONT_CURATED_FONTS.some((font) => font.value === value)) {
|
|
52
|
+
return STOREFRONT_CURATED_FONTS;
|
|
53
|
+
}
|
|
54
|
+
return [
|
|
55
|
+
...STOREFRONT_CURATED_FONTS,
|
|
56
|
+
{
|
|
57
|
+
value,
|
|
58
|
+
label: value,
|
|
59
|
+
stack: value.includes(',') ? value : `${value}, system-ui, sans-serif`,
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
export function findStorefrontCuratedFont(value) {
|
|
64
|
+
return curatedFontOptionsForValue(value).find((font) => font.value === value);
|
|
65
|
+
}
|
|
66
|
+
export function isValidGoogleFontFamily(value) {
|
|
67
|
+
if (typeof value !== 'string')
|
|
68
|
+
return false;
|
|
69
|
+
const trimmed = value.trim();
|
|
70
|
+
return trimmed.length > 0 && trimmed.length <= 60 && GOOGLE_FONT_FAMILY_PATTERN.test(trimmed);
|
|
71
|
+
}
|
|
72
|
+
export function buildStorefrontGoogleFontHref(family) {
|
|
73
|
+
const familyParam = family.trim().replace(/\s+/g, '+');
|
|
74
|
+
return `https://fonts.googleapis.com/css2?family=${familyParam}:wght@400;500;600;700&display=swap`;
|
|
75
|
+
}
|
|
76
|
+
export function getStorefrontGoogleFontHrefs(input) {
|
|
77
|
+
const families = new Set();
|
|
78
|
+
for (const raw of [input.bodyFont, input.headingFont]) {
|
|
79
|
+
const family = resolvePrimaryFontFamilyName(raw);
|
|
80
|
+
if (!family)
|
|
81
|
+
continue;
|
|
82
|
+
if (STOREFRONT_SYSTEM_FONTS.has(family))
|
|
83
|
+
continue;
|
|
84
|
+
if (!isValidGoogleFontFamily(family))
|
|
85
|
+
continue;
|
|
86
|
+
families.add(family);
|
|
87
|
+
}
|
|
88
|
+
return [...families].map((family) => buildStorefrontGoogleFontHref(family));
|
|
89
|
+
}
|
package/dist/style-slots.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare const ResponsiveStringSchema: z.ZodObject<{
|
|
|
23
23
|
xl: z.ZodOptional<z.ZodString>;
|
|
24
24
|
}, z.core.$strict>;
|
|
25
25
|
export type ResponsiveString = z.infer<typeof ResponsiveStringSchema>;
|
|
26
|
-
export declare const ColorSchema: z.ZodString
|
|
26
|
+
export declare const ColorSchema: z.ZodUnion<readonly [z.ZodLiteral<"transparent">, 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>;
|
|
@@ -84,7 +84,7 @@ export declare const StyleSlotIdSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
|
84
84
|
}>, z.ZodString]>;
|
|
85
85
|
export type StyleSlotId = CoreStyleSlotId | ThemeStyleSlotId;
|
|
86
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")[];
|
|
87
|
-
export declare const ThemeStyleSlotValueSchema: z.ZodUnion<readonly [z.ZodString
|
|
87
|
+
export declare const ThemeStyleSlotValueSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"transparent">, z.ZodString]>, z.ZodObject<{
|
|
88
88
|
base: z.ZodNumber;
|
|
89
89
|
sm: z.ZodOptional<z.ZodNumber>;
|
|
90
90
|
md: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-slots.d.ts","sourceRoot":"","sources":["../src/style-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAAM,gBAAgB;;;;;;EAA2C,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,sBAAsB;;;;;;kBAQxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB;;;;;;kBAQxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"style-slots.d.ts","sourceRoot":"","sources":["../src/style-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,eAAO,MAA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AChB,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,CAAC;AA6BZ,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;AAEtE,eAAO,MAAM,gBAAgB,EAoCrB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9B,eAAO,MAAM,uBAAuB,mJAAmB,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAE1D"}
|
package/dist/style-slots.js
CHANGED
|
@@ -18,9 +18,11 @@ export const ResponsiveStringSchema = z
|
|
|
18
18
|
xl: z.string().min(1).optional(),
|
|
19
19
|
})
|
|
20
20
|
.strict();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.
|
|
21
|
+
const HEX_COLOR_PATTERN = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
22
|
+
export const ColorSchema = z.union([
|
|
23
|
+
z.literal('transparent'),
|
|
24
|
+
z.string().regex(HEX_COLOR_PATTERN, 'Expected a hex color'),
|
|
25
|
+
]);
|
|
24
26
|
export const FontWeightSchema = z.union([
|
|
25
27
|
z.literal(100),
|
|
26
28
|
z.literal(200),
|
package/dist/theme-manifest.d.ts
CHANGED
|
@@ -49,7 +49,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
49
49
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
50
50
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
51
51
|
group: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
search: "search";
|
|
52
53
|
content: "content";
|
|
54
|
+
profile: "profile";
|
|
53
55
|
style: "style";
|
|
54
56
|
}>>;
|
|
55
57
|
type: z.ZodLiteral<"text">;
|
|
@@ -62,7 +64,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
62
64
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
63
65
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
64
66
|
group: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
search: "search";
|
|
65
68
|
content: "content";
|
|
69
|
+
profile: "profile";
|
|
66
70
|
style: "style";
|
|
67
71
|
}>>;
|
|
68
72
|
type: z.ZodLiteral<"richtext">;
|
|
@@ -78,7 +82,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
78
82
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
79
83
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
80
84
|
group: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
search: "search";
|
|
81
86
|
content: "content";
|
|
87
|
+
profile: "profile";
|
|
82
88
|
style: "style";
|
|
83
89
|
}>>;
|
|
84
90
|
type: z.ZodLiteral<"code">;
|
|
@@ -101,7 +107,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
101
107
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
102
108
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
103
109
|
group: z.ZodOptional<z.ZodEnum<{
|
|
110
|
+
search: "search";
|
|
104
111
|
content: "content";
|
|
112
|
+
profile: "profile";
|
|
105
113
|
style: "style";
|
|
106
114
|
}>>;
|
|
107
115
|
type: z.ZodLiteral<"image">;
|
|
@@ -112,7 +120,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
112
120
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
113
121
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
114
122
|
group: z.ZodOptional<z.ZodEnum<{
|
|
123
|
+
search: "search";
|
|
115
124
|
content: "content";
|
|
125
|
+
profile: "profile";
|
|
116
126
|
style: "style";
|
|
117
127
|
}>>;
|
|
118
128
|
type: z.ZodLiteral<"link">;
|
|
@@ -121,7 +131,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
121
131
|
description: z.ZodOptional<z.ZodString>;
|
|
122
132
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
123
133
|
group: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
search: "search";
|
|
124
135
|
content: "content";
|
|
136
|
+
profile: "profile";
|
|
125
137
|
style: "style";
|
|
126
138
|
}>>;
|
|
127
139
|
type: z.ZodLiteral<"boolean">;
|
|
@@ -131,7 +143,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
131
143
|
description: z.ZodOptional<z.ZodString>;
|
|
132
144
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
133
145
|
group: z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
search: "search";
|
|
134
147
|
content: "content";
|
|
148
|
+
profile: "profile";
|
|
135
149
|
style: "style";
|
|
136
150
|
}>>;
|
|
137
151
|
type: z.ZodLiteral<"number">;
|
|
@@ -144,7 +158,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
144
158
|
description: z.ZodOptional<z.ZodString>;
|
|
145
159
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
146
160
|
group: z.ZodOptional<z.ZodEnum<{
|
|
161
|
+
search: "search";
|
|
147
162
|
content: "content";
|
|
163
|
+
profile: "profile";
|
|
148
164
|
style: "style";
|
|
149
165
|
}>>;
|
|
150
166
|
type: z.ZodLiteral<"range">;
|
|
@@ -158,7 +174,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
158
174
|
description: z.ZodOptional<z.ZodString>;
|
|
159
175
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
160
176
|
group: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
search: "search";
|
|
161
178
|
content: "content";
|
|
179
|
+
profile: "profile";
|
|
162
180
|
style: "style";
|
|
163
181
|
}>>;
|
|
164
182
|
type: z.ZodLiteral<"select">;
|
|
@@ -172,18 +190,22 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
172
190
|
description: z.ZodOptional<z.ZodString>;
|
|
173
191
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
174
192
|
group: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
search: "search";
|
|
175
194
|
content: "content";
|
|
195
|
+
profile: "profile";
|
|
176
196
|
style: "style";
|
|
177
197
|
}>>;
|
|
178
198
|
type: z.ZodLiteral<"color">;
|
|
179
|
-
defaultValue: z.ZodOptional<z.ZodString
|
|
199
|
+
defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"transparent">, z.ZodString]>>;
|
|
180
200
|
}, z.core.$strict>, z.ZodObject<{
|
|
181
201
|
label: z.ZodString;
|
|
182
202
|
description: z.ZodOptional<z.ZodString>;
|
|
183
203
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
184
204
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
185
205
|
group: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
search: "search";
|
|
186
207
|
content: "content";
|
|
208
|
+
profile: "profile";
|
|
187
209
|
style: "style";
|
|
188
210
|
}>>;
|
|
189
211
|
type: z.ZodLiteral<"product">;
|
|
@@ -193,7 +215,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
193
215
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
194
216
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
195
217
|
group: z.ZodOptional<z.ZodEnum<{
|
|
218
|
+
search: "search";
|
|
196
219
|
content: "content";
|
|
220
|
+
profile: "profile";
|
|
197
221
|
style: "style";
|
|
198
222
|
}>>;
|
|
199
223
|
type: z.ZodLiteral<"products">;
|
|
@@ -205,7 +229,9 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
205
229
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
206
230
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
207
231
|
group: z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
search: "search";
|
|
208
233
|
content: "content";
|
|
234
|
+
profile: "profile";
|
|
209
235
|
style: "style";
|
|
210
236
|
}>>;
|
|
211
237
|
type: z.ZodLiteral<"list">;
|
|
@@ -217,20 +243,22 @@ export declare const ManifestBlockSchema: z.ZodObject<{
|
|
|
217
243
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
218
244
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
219
245
|
group: z.ZodOptional<z.ZodEnum<{
|
|
246
|
+
search: "search";
|
|
220
247
|
content: "content";
|
|
248
|
+
profile: "profile";
|
|
221
249
|
style: "style";
|
|
222
250
|
}>>;
|
|
223
251
|
type: z.ZodEnum<{
|
|
224
252
|
number: "number";
|
|
225
253
|
boolean: "boolean";
|
|
226
254
|
link: "link";
|
|
255
|
+
product: "product";
|
|
227
256
|
text: "text";
|
|
228
257
|
richtext: "richtext";
|
|
229
258
|
image: "image";
|
|
230
259
|
range: "range";
|
|
231
260
|
select: "select";
|
|
232
261
|
color: "color";
|
|
233
|
-
product: "product";
|
|
234
262
|
}>;
|
|
235
263
|
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
264
|
label: z.ZodString;
|
|
@@ -354,7 +382,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
354
382
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
355
383
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
356
384
|
group: z.ZodOptional<z.ZodEnum<{
|
|
385
|
+
search: "search";
|
|
357
386
|
content: "content";
|
|
387
|
+
profile: "profile";
|
|
358
388
|
style: "style";
|
|
359
389
|
}>>;
|
|
360
390
|
type: z.ZodLiteral<"text">;
|
|
@@ -367,7 +397,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
367
397
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
368
398
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
369
399
|
group: z.ZodOptional<z.ZodEnum<{
|
|
400
|
+
search: "search";
|
|
370
401
|
content: "content";
|
|
402
|
+
profile: "profile";
|
|
371
403
|
style: "style";
|
|
372
404
|
}>>;
|
|
373
405
|
type: z.ZodLiteral<"richtext">;
|
|
@@ -383,7 +415,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
383
415
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
384
416
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
385
417
|
group: z.ZodOptional<z.ZodEnum<{
|
|
418
|
+
search: "search";
|
|
386
419
|
content: "content";
|
|
420
|
+
profile: "profile";
|
|
387
421
|
style: "style";
|
|
388
422
|
}>>;
|
|
389
423
|
type: z.ZodLiteral<"code">;
|
|
@@ -406,7 +440,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
406
440
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
407
441
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
408
442
|
group: z.ZodOptional<z.ZodEnum<{
|
|
443
|
+
search: "search";
|
|
409
444
|
content: "content";
|
|
445
|
+
profile: "profile";
|
|
410
446
|
style: "style";
|
|
411
447
|
}>>;
|
|
412
448
|
type: z.ZodLiteral<"image">;
|
|
@@ -417,7 +453,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
417
453
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
418
454
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
419
455
|
group: z.ZodOptional<z.ZodEnum<{
|
|
456
|
+
search: "search";
|
|
420
457
|
content: "content";
|
|
458
|
+
profile: "profile";
|
|
421
459
|
style: "style";
|
|
422
460
|
}>>;
|
|
423
461
|
type: z.ZodLiteral<"link">;
|
|
@@ -426,7 +464,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
426
464
|
description: z.ZodOptional<z.ZodString>;
|
|
427
465
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
428
466
|
group: z.ZodOptional<z.ZodEnum<{
|
|
467
|
+
search: "search";
|
|
429
468
|
content: "content";
|
|
469
|
+
profile: "profile";
|
|
430
470
|
style: "style";
|
|
431
471
|
}>>;
|
|
432
472
|
type: z.ZodLiteral<"boolean">;
|
|
@@ -436,7 +476,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
436
476
|
description: z.ZodOptional<z.ZodString>;
|
|
437
477
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
438
478
|
group: z.ZodOptional<z.ZodEnum<{
|
|
479
|
+
search: "search";
|
|
439
480
|
content: "content";
|
|
481
|
+
profile: "profile";
|
|
440
482
|
style: "style";
|
|
441
483
|
}>>;
|
|
442
484
|
type: z.ZodLiteral<"number">;
|
|
@@ -449,7 +491,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
449
491
|
description: z.ZodOptional<z.ZodString>;
|
|
450
492
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
451
493
|
group: z.ZodOptional<z.ZodEnum<{
|
|
494
|
+
search: "search";
|
|
452
495
|
content: "content";
|
|
496
|
+
profile: "profile";
|
|
453
497
|
style: "style";
|
|
454
498
|
}>>;
|
|
455
499
|
type: z.ZodLiteral<"range">;
|
|
@@ -463,7 +507,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
463
507
|
description: z.ZodOptional<z.ZodString>;
|
|
464
508
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
465
509
|
group: z.ZodOptional<z.ZodEnum<{
|
|
510
|
+
search: "search";
|
|
466
511
|
content: "content";
|
|
512
|
+
profile: "profile";
|
|
467
513
|
style: "style";
|
|
468
514
|
}>>;
|
|
469
515
|
type: z.ZodLiteral<"select">;
|
|
@@ -477,18 +523,22 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
477
523
|
description: z.ZodOptional<z.ZodString>;
|
|
478
524
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
479
525
|
group: z.ZodOptional<z.ZodEnum<{
|
|
526
|
+
search: "search";
|
|
480
527
|
content: "content";
|
|
528
|
+
profile: "profile";
|
|
481
529
|
style: "style";
|
|
482
530
|
}>>;
|
|
483
531
|
type: z.ZodLiteral<"color">;
|
|
484
|
-
defaultValue: z.ZodOptional<z.ZodString
|
|
532
|
+
defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"transparent">, z.ZodString]>>;
|
|
485
533
|
}, z.core.$strict>, z.ZodObject<{
|
|
486
534
|
label: z.ZodString;
|
|
487
535
|
description: z.ZodOptional<z.ZodString>;
|
|
488
536
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
489
537
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
490
538
|
group: z.ZodOptional<z.ZodEnum<{
|
|
539
|
+
search: "search";
|
|
491
540
|
content: "content";
|
|
541
|
+
profile: "profile";
|
|
492
542
|
style: "style";
|
|
493
543
|
}>>;
|
|
494
544
|
type: z.ZodLiteral<"product">;
|
|
@@ -498,7 +548,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
498
548
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
499
549
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
500
550
|
group: z.ZodOptional<z.ZodEnum<{
|
|
551
|
+
search: "search";
|
|
501
552
|
content: "content";
|
|
553
|
+
profile: "profile";
|
|
502
554
|
style: "style";
|
|
503
555
|
}>>;
|
|
504
556
|
type: z.ZodLiteral<"products">;
|
|
@@ -510,7 +562,9 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
510
562
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
511
563
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
512
564
|
group: z.ZodOptional<z.ZodEnum<{
|
|
565
|
+
search: "search";
|
|
513
566
|
content: "content";
|
|
567
|
+
profile: "profile";
|
|
514
568
|
style: "style";
|
|
515
569
|
}>>;
|
|
516
570
|
type: z.ZodLiteral<"list">;
|
|
@@ -522,20 +576,22 @@ export declare const ThemeManifestSchema: z.ZodObject<{
|
|
|
522
576
|
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
523
577
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
524
578
|
group: z.ZodOptional<z.ZodEnum<{
|
|
579
|
+
search: "search";
|
|
525
580
|
content: "content";
|
|
581
|
+
profile: "profile";
|
|
526
582
|
style: "style";
|
|
527
583
|
}>>;
|
|
528
584
|
type: z.ZodEnum<{
|
|
529
585
|
number: "number";
|
|
530
586
|
boolean: "boolean";
|
|
531
587
|
link: "link";
|
|
588
|
+
product: "product";
|
|
532
589
|
text: "text";
|
|
533
590
|
richtext: "richtext";
|
|
534
591
|
image: "image";
|
|
535
592
|
range: "range";
|
|
536
593
|
select: "select";
|
|
537
594
|
color: "color";
|
|
538
|
-
product: "product";
|
|
539
595
|
}>;
|
|
540
596
|
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
541
597
|
label: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-manifest.d.ts","sourceRoot":"","sources":["../src/theme-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEtG,eAAO,MAAM,aAAa,aAAoD,CAAC;AAC/E,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,eAAO,MAAM,kBAAkB;;;;kBAMpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;kBAMpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;;;;;;kBAOpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AA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BAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAEhE;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,WAAW,CAAC,EAAE,iBAAiB,CAAC;KACjC,CAAC;CACH,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,EAAE,CAwBtF"}
|
package/dist/theme-schemes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const PUBLIC_BUILDER_THEME_SCHEMES: readonly ["default", "classic", "nebula", "pulse", "phantom", "starlight", "apex", "vault"];
|
|
1
|
+
export declare const PUBLIC_BUILDER_THEME_SCHEMES: readonly ["default", "classic", "nebula", "pulse", "phantom", "starlight", "apex", "vault", "vortex", "clean-minimal"];
|
|
2
2
|
export declare const STARTER_BUILDER_THEME_SCHEMES: readonly ["blank"];
|
|
3
|
-
export declare const BUILDER_READY_THEME_SCHEMES: readonly ["blank", "default", "classic", "nebula", "pulse", "phantom", "starlight", "apex", "vault"];
|
|
3
|
+
export declare const BUILDER_READY_THEME_SCHEMES: readonly ["blank", "default", "classic", "nebula", "pulse", "phantom", "starlight", "apex", "vault", "vortex", "clean-minimal"];
|
|
4
4
|
export type PublicBuilderThemeScheme = (typeof PUBLIC_BUILDER_THEME_SCHEMES)[number];
|
|
5
5
|
export type StarterBuilderThemeScheme = (typeof STARTER_BUILDER_THEME_SCHEMES)[number];
|
|
6
6
|
export type BuilderReadyThemeScheme = (typeof BUILDER_READY_THEME_SCHEMES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-schemes.d.ts","sourceRoot":"","sources":["../src/theme-schemes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"theme-schemes.d.ts","sourceRoot":"","sources":["../src/theme-schemes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,wHAW/B,CAAC;AAEX,eAAO,MAAM,6BAA6B,oBAAqB,CAAC;AAEhE,eAAO,MAAM,2BAA2B,iIAG9B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AACrF,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AACvF,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,wBAAwB,CAE3F;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,yBAAyB,CAE7F;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,uBAAuB,CAEzF"}
|
package/dist/theme-schemes.js
CHANGED
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,kCAAkC,GAC1C,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,GACnB,0BAA0B,GAC1B,uBAAuB,GACvB,uBAAuB,GACvB,oBAAoB,GACpB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,kCAAkC,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,QAAQ,CAAC,MAAM,EAAE,8BAA8B,EAAE,CAAC;gBAEtC,MAAM,EAAE,8BAA8B,EAAE;CAKrD;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,aAAa,GACtB,8BAA8B,EAAE,CAqElC;AAwBD,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAKN;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,8BAA8B,EAAE,GACvC,MAAM,CAQR"}
|
package/dist/validation.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeCustomPagesIntoManifest } from "./custom-pages.js";
|
|
1
2
|
import { ThemeStyleSlotIdSchema } from "./style-slots.js";
|
|
2
3
|
export class BuilderManifestValidationError extends Error {
|
|
3
4
|
issues;
|
|
@@ -8,10 +9,11 @@ export class BuilderManifestValidationError extends Error {
|
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export function validateBuilderSettingsAgainstManifest(settings, manifest) {
|
|
12
|
+
const effectiveManifest = mergeCustomPagesIntoManifest(manifest, settings);
|
|
11
13
|
const issues = [];
|
|
12
|
-
validateGlobalStyleSlots(settings,
|
|
14
|
+
validateGlobalStyleSlots(settings, effectiveManifest, issues);
|
|
13
15
|
for (const [pageId, layout] of Object.entries(settings.theme.layout)) {
|
|
14
|
-
const page =
|
|
16
|
+
const page = effectiveManifest.pages[pageId];
|
|
15
17
|
if (!page) {
|
|
16
18
|
issues.push({
|
|
17
19
|
code: 'unknown_page',
|
|
@@ -32,7 +34,7 @@ export function validateBuilderSettingsAgainstManifest(settings, manifest) {
|
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
blockIds.add(block.id);
|
|
35
|
-
const blockDefinition =
|
|
37
|
+
const blockDefinition = effectiveManifest.blocks[block.type];
|
|
36
38
|
if (!blockDefinition) {
|
|
37
39
|
issues.push({
|
|
38
40
|
code: 'unknown_block_type',
|
|
@@ -54,7 +56,7 @@ export function validateBuilderSettingsAgainstManifest(settings, manifest) {
|
|
|
54
56
|
validateBlockStyleOverrides(block, blockDefinition.exposedStyleSlots, blockPath, issues);
|
|
55
57
|
}
|
|
56
58
|
for (const [blockType, count] of blockTypeCounts.entries()) {
|
|
57
|
-
const maxInstances =
|
|
59
|
+
const maxInstances = effectiveManifest.blocks[blockType]?.maxInstances;
|
|
58
60
|
if (maxInstances !== undefined && count > maxInstances) {
|
|
59
61
|
issues.push({
|
|
60
62
|
code: 'too_many_block_instances',
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
2
4
|
import {
|
|
3
5
|
BuilderEventSchema,
|
|
4
6
|
BuilderSettingsSchema,
|
|
@@ -11,12 +13,15 @@ import {
|
|
|
11
13
|
createBlockInstance,
|
|
12
14
|
createEmptyBuilderSettings,
|
|
13
15
|
convertLegacyThemeManifest,
|
|
16
|
+
coercePersistedBuilderSettings,
|
|
17
|
+
exportCoercedBuilderSettingsBlob,
|
|
14
18
|
extractPersistedBuilderSettings,
|
|
15
19
|
canonicalizeBuilderSettingsForManifestWithReport,
|
|
16
20
|
mergeBuilderSettingsIntoThemeSettings,
|
|
17
21
|
migrateLegacyBuilderSettings,
|
|
18
22
|
listThemeManifestPresets,
|
|
19
23
|
} from './index.ts';
|
|
24
|
+
import { ColorSchema } from './style-slots.ts';
|
|
20
25
|
|
|
21
26
|
describe('@shoppex/builder-contracts', () => {
|
|
22
27
|
test('accepts an empty builder settings document', () => {
|
|
@@ -217,6 +222,52 @@ describe('@shoppex/builder-contracts', () => {
|
|
|
217
222
|
expect(extractPersistedBuilderSettings(persisted)).toEqual(settings);
|
|
218
223
|
});
|
|
219
224
|
|
|
225
|
+
test('coerces polluted v2 theme.typography into style_slots and strips invalid keys', () => {
|
|
226
|
+
const coerced = coercePersistedBuilderSettings({
|
|
227
|
+
version: 2,
|
|
228
|
+
revision: 9,
|
|
229
|
+
theme: {
|
|
230
|
+
content: {},
|
|
231
|
+
layout: {},
|
|
232
|
+
style_slots: {
|
|
233
|
+
'theme.typography.font.family': 'Manrope, sans-serif',
|
|
234
|
+
},
|
|
235
|
+
typography: {
|
|
236
|
+
font_family: 'Legacy Body',
|
|
237
|
+
heading_font: 'Legacy Heading',
|
|
238
|
+
},
|
|
239
|
+
pages: [],
|
|
240
|
+
terms: {},
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
expect(coerced).not.toBeNull();
|
|
245
|
+
expect(coerced?.theme.style_slots['theme.typography.font.family']).toBe('Manrope, sans-serif');
|
|
246
|
+
expect(coerced?.theme.style_slots['theme.typography.heading.font']).toBe('Legacy Heading');
|
|
247
|
+
expect(coerced?.theme).not.toHaveProperty('typography');
|
|
248
|
+
expect(() => BuilderSettingsSchema.parse(coerced)).not.toThrow();
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
test('exportCoercedBuilderSettingsBlob preserves non-v2 siblings', () => {
|
|
252
|
+
const exported = exportCoercedBuilderSettingsBlob({
|
|
253
|
+
seo: { default_title: 'Keep this title' },
|
|
254
|
+
version: 2,
|
|
255
|
+
revision: 4,
|
|
256
|
+
theme: {
|
|
257
|
+
content: {},
|
|
258
|
+
layout: {},
|
|
259
|
+
style_slots: {},
|
|
260
|
+
typography: { font_family: 'Inter' },
|
|
261
|
+
pages: [],
|
|
262
|
+
terms: {},
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
expect(exported?.seo).toEqual({ default_title: 'Keep this title' });
|
|
267
|
+
expect(exported?.theme).not.toHaveProperty('typography');
|
|
268
|
+
expect(exported?.theme.style_slots['theme.typography.font.family']).toBe('Inter');
|
|
269
|
+
});
|
|
270
|
+
|
|
220
271
|
test('removes reserved content keys from persisted builder v2 state', () => {
|
|
221
272
|
const settings = BuilderSettingsSchema.parse({
|
|
222
273
|
...createEmptyBuilderSettings(5),
|
|
@@ -797,4 +848,19 @@ describe('@shoppex/builder-contracts', () => {
|
|
|
797
848
|
});
|
|
798
849
|
expect(validateBuilderSettingsAgainstManifest(result.settings, manifest)).toEqual([]);
|
|
799
850
|
});
|
|
851
|
+
|
|
852
|
+
test('accepts transparent color literals used by theme manifests', () => {
|
|
853
|
+
expect(ColorSchema.parse('transparent')).toBe('transparent');
|
|
854
|
+
expect(ColorSchema.parse('#ffffff')).toBe('#ffffff');
|
|
855
|
+
expect(ColorSchema.parse('#00000080')).toBe('#00000080');
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
test('parses official theme manifests with transparent contact-form backgrounds', () => {
|
|
859
|
+
const repoRoot = join(import.meta.dir, '../../..');
|
|
860
|
+
for (const theme of ['default', 'nebula', 'classic', 'pulse', 'starlight', 'vault', 'phantom', 'apex', 'vortex']) {
|
|
861
|
+
const manifestPath = join(repoRoot, 'themes', theme, 'theme.manifest.json');
|
|
862
|
+
const raw = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
863
|
+
expect(ThemeManifestSchema.safeParse(raw).success, `${theme} manifest should validate`).toBe(true);
|
|
864
|
+
}
|
|
865
|
+
});
|
|
800
866
|
});
|