@orion-studios/payload-studio 0.5.0-beta.11 → 0.5.0-beta.111
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/README.md +54 -0
- package/dist/admin/client.d.mts +3 -0
- package/dist/admin/client.d.ts +3 -0
- package/dist/admin/client.js +1745 -200
- package/dist/admin/client.mjs +1756 -214
- package/dist/admin/index.d.mts +2 -1
- package/dist/admin/index.d.ts +2 -1
- package/dist/admin/index.js +424 -11
- package/dist/admin/index.mjs +19 -1
- package/dist/admin-app/client.d.mts +7 -0
- package/dist/admin-app/client.d.ts +7 -0
- package/dist/admin-app/client.js +1270 -3
- package/dist/admin-app/client.mjs +1172 -2
- package/dist/admin-app/index.d.mts +1 -1
- package/dist/admin-app/index.d.ts +1 -1
- package/dist/admin-app/index.js +167 -0
- package/dist/admin-app/index.mjs +13 -1
- package/dist/admin-app/styles.css +247 -0
- package/dist/admin.css +8 -0
- package/dist/blocks/index.js +1011 -191
- package/dist/blocks/index.mjs +2 -2
- package/dist/chunk-ADIIWIYL.mjs +322 -0
- package/dist/{chunk-ZLLNO5FM.mjs → chunk-BET2YLAS.mjs} +104 -15
- package/dist/chunk-DAIZDGHL.mjs +614 -0
- package/dist/chunk-GKMBYYXF.mjs +776 -0
- package/dist/chunk-JQAHXYAM.mjs +1829 -0
- package/dist/chunk-OQSEJXC4.mjs +166 -0
- package/dist/chunk-PF3EBZXF.mjs +326 -0
- package/dist/chunk-ROTPP5CU.mjs +99 -0
- package/dist/chunk-XVH5SCBD.mjs +234 -0
- package/dist/chunk-ZTXJG4K5.mjs +85 -0
- package/dist/index-7lxTrxSG.d.mts +128 -0
- package/dist/index-7lxTrxSG.d.ts +128 -0
- package/dist/index-B7QvY3yF.d.mts +245 -0
- package/dist/index-BK03FiEM.d.ts +245 -0
- package/dist/{index-CmR6NInu.d.ts → index-BzKOThsI.d.mts} +30 -3
- package/dist/{index-CmR6NInu.d.mts → index-BzKOThsI.d.ts} +30 -3
- package/dist/{index-DbH0Ljwp.d.mts → index-D8BNfUJb.d.mts} +17 -2
- package/dist/{index-DbH0Ljwp.d.ts → index-DD_E2UfJ.d.ts} +17 -2
- package/dist/index-DUi_XND6.d.ts +193 -0
- package/dist/index-gLl_358v.d.mts +193 -0
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +2876 -460
- package/dist/index.mjs +12 -10
- package/dist/nextjs/index.d.mts +2 -1
- package/dist/nextjs/index.d.ts +2 -1
- package/dist/nextjs/index.js +497 -16
- package/dist/nextjs/index.mjs +8 -3
- package/dist/socialMedia-C05Iy-SV.d.mts +21 -0
- package/dist/socialMedia-C05Iy-SV.d.ts +21 -0
- package/dist/studio/index.d.mts +2 -1
- package/dist/studio/index.d.ts +2 -1
- package/dist/studio/index.js +171 -5
- package/dist/studio/index.mjs +7 -3
- package/dist/studio-pages/builder.css +517 -32
- package/dist/studio-pages/client.d.mts +75 -1
- package/dist/studio-pages/client.d.ts +75 -1
- package/dist/studio-pages/client.js +5662 -2759
- package/dist/studio-pages/client.mjs +5578 -2767
- package/dist/studio-pages/index.d.mts +4 -2
- package/dist/studio-pages/index.d.ts +4 -2
- package/dist/studio-pages/index.js +859 -71
- package/dist/studio-pages/index.mjs +10 -4
- package/package.json +35 -13
- package/dist/chunk-AAOHJDNS.mjs +0 -67
- package/dist/chunk-ETRRXURT.mjs +0 -141
- package/dist/chunk-J7W5EE3B.mjs +0 -278
- package/dist/chunk-N67KVM2S.mjs +0 -156
- package/dist/chunk-NESLJZFE.mjs +0 -303
- package/dist/chunk-U5BSPWAD.mjs +0 -1034
- package/dist/index-B9N5MyjF.d.mts +0 -39
- package/dist/index-BallJs-K.d.mts +0 -43
- package/dist/index-BallJs-K.d.ts +0 -43
- package/dist/index-DJFhANvJ.d.mts +0 -128
- package/dist/index-DJFhANvJ.d.ts +0 -128
- package/dist/index-g8tBHLKD.d.ts +0 -39
|
@@ -21,11 +21,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var studio_pages_exports = {};
|
|
22
22
|
__export(studio_pages_exports, {
|
|
23
23
|
createDefaultStudioDocument: () => createDefaultStudioDocument,
|
|
24
|
+
defaultBuilderThemeTokens: () => defaultBuilderThemeTokens,
|
|
24
25
|
layoutToStudioDocument: () => layoutToStudioDocument,
|
|
25
26
|
pageInspectorPanels: () => pageInspectorPanels,
|
|
26
27
|
pageNodeTypes: () => pageNodeTypes,
|
|
27
28
|
pagePaletteGroups: () => pagePaletteGroups,
|
|
28
29
|
pageStudioModuleManifest: () => pageStudioModuleManifest,
|
|
30
|
+
resolveBuilderThemeTokens: () => resolveBuilderThemeTokens,
|
|
29
31
|
studioDocumentToLayout: () => studioDocumentToLayout
|
|
30
32
|
});
|
|
31
33
|
module.exports = __toCommonJS(studio_pages_exports);
|
|
@@ -37,18 +39,790 @@ var sectionStyleDefaults = {
|
|
|
37
39
|
contentGradientAngle: "135",
|
|
38
40
|
contentGradientFrom: "#ffffff",
|
|
39
41
|
contentGradientPreset: "none",
|
|
40
|
-
contentGradientTo: "#
|
|
42
|
+
contentGradientTo: "#f4f6f8",
|
|
41
43
|
contentWidth: "inherit",
|
|
44
|
+
sectionPaddingX: "inherit",
|
|
42
45
|
sectionBackgroundColor: "#ffffff",
|
|
43
46
|
sectionBackgroundMode: "none",
|
|
44
47
|
sectionGradientAngle: "135",
|
|
45
|
-
sectionGradientFrom: "#
|
|
46
|
-
sectionGradientPreset: "
|
|
47
|
-
sectionGradientTo: "#
|
|
48
|
+
sectionGradientFrom: "#334b63",
|
|
49
|
+
sectionGradientPreset: "slate",
|
|
50
|
+
sectionGradientTo: "#496582",
|
|
48
51
|
sectionPaddingY: "md",
|
|
49
52
|
sectionWidth: "content"
|
|
50
53
|
};
|
|
51
54
|
|
|
55
|
+
// src/studio-pages/builder/settings-v2/types.ts
|
|
56
|
+
var defaultBuilderBlockSettingsV2 = {
|
|
57
|
+
advanced: {
|
|
58
|
+
customClassName: "",
|
|
59
|
+
editCopyInPanel: false,
|
|
60
|
+
hideOnMobile: false
|
|
61
|
+
},
|
|
62
|
+
appearance: {
|
|
63
|
+
contentBackgroundColor: "#ffffff",
|
|
64
|
+
contentBackgroundMode: "none",
|
|
65
|
+
contentGradientAngle: "135",
|
|
66
|
+
contentGradientFrom: "#ffffff",
|
|
67
|
+
contentGradientPreset: "none",
|
|
68
|
+
contentGradientTo: "#f4f6f8",
|
|
69
|
+
sectionBackgroundColor: "#ffffff",
|
|
70
|
+
sectionBackgroundMode: "none",
|
|
71
|
+
sectionGradientAngle: "135",
|
|
72
|
+
sectionGradientFrom: "#334b63",
|
|
73
|
+
sectionGradientPreset: "slate",
|
|
74
|
+
sectionGradientTo: "#496582"
|
|
75
|
+
},
|
|
76
|
+
layout: {
|
|
77
|
+
contentWidth: "inherit",
|
|
78
|
+
linkHorizontalPadding: true,
|
|
79
|
+
linkVerticalPadding: true,
|
|
80
|
+
paddingBottomPt: null,
|
|
81
|
+
paddingLeftPt: null,
|
|
82
|
+
paddingRightPt: null,
|
|
83
|
+
paddingTopPt: null,
|
|
84
|
+
sectionPaddingX: "inherit",
|
|
85
|
+
sectionPaddingY: "md"
|
|
86
|
+
},
|
|
87
|
+
media: {
|
|
88
|
+
cornerStyle: "rounded",
|
|
89
|
+
fit: "cover",
|
|
90
|
+
height: null,
|
|
91
|
+
position: "center",
|
|
92
|
+
positionX: null,
|
|
93
|
+
positionY: null
|
|
94
|
+
},
|
|
95
|
+
typography: {
|
|
96
|
+
bodyAlign: "left",
|
|
97
|
+
headingAlign: "left",
|
|
98
|
+
letterSpacingPreset: "normal",
|
|
99
|
+
lineHeightPreset: "normal",
|
|
100
|
+
maxTextWidth: "auto"
|
|
101
|
+
},
|
|
102
|
+
version: 2
|
|
103
|
+
};
|
|
104
|
+
var defaultBuilderItemSettingsV2 = {
|
|
105
|
+
layout: {
|
|
106
|
+
contentWidth: "inherit",
|
|
107
|
+
linkHorizontalPadding: true,
|
|
108
|
+
linkVerticalPadding: true,
|
|
109
|
+
paddingBottomPt: null,
|
|
110
|
+
paddingLeftPt: null,
|
|
111
|
+
paddingRightPt: null,
|
|
112
|
+
paddingTopPt: null,
|
|
113
|
+
sectionPaddingX: "inherit",
|
|
114
|
+
sectionPaddingY: "md"
|
|
115
|
+
},
|
|
116
|
+
media: {
|
|
117
|
+
cornerStyle: "rounded",
|
|
118
|
+
fit: "cover",
|
|
119
|
+
height: null,
|
|
120
|
+
position: "center",
|
|
121
|
+
positionX: null,
|
|
122
|
+
positionY: null
|
|
123
|
+
},
|
|
124
|
+
typography: {
|
|
125
|
+
bodyAlign: "left",
|
|
126
|
+
headingAlign: "left",
|
|
127
|
+
letterSpacingPreset: "normal",
|
|
128
|
+
lineHeightPreset: "normal",
|
|
129
|
+
maxTextWidth: "auto"
|
|
130
|
+
},
|
|
131
|
+
version: 2
|
|
132
|
+
};
|
|
133
|
+
var defaultBuilderThemeTokens = {
|
|
134
|
+
colors: {
|
|
135
|
+
accent: "#334b63",
|
|
136
|
+
bodyText: "#425163",
|
|
137
|
+
headingText: "#182332",
|
|
138
|
+
surface: "#ffffff"
|
|
139
|
+
},
|
|
140
|
+
radii: {
|
|
141
|
+
card: 16,
|
|
142
|
+
panel: 14
|
|
143
|
+
},
|
|
144
|
+
spacing: {
|
|
145
|
+
sectionGap: "md",
|
|
146
|
+
sectionPadding: "md"
|
|
147
|
+
},
|
|
148
|
+
typography: {
|
|
149
|
+
bodySize: "md",
|
|
150
|
+
headingSize: "md"
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
155
|
+
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
156
|
+
var parsePercent = (value) => {
|
|
157
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
158
|
+
return Math.max(0, Math.min(100, value));
|
|
159
|
+
}
|
|
160
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
161
|
+
const parsed = Number(value);
|
|
162
|
+
if (Number.isFinite(parsed)) {
|
|
163
|
+
return Math.max(0, Math.min(100, parsed));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return null;
|
|
167
|
+
};
|
|
168
|
+
var parsePixel = (value) => {
|
|
169
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
173
|
+
const parsed = Number(value);
|
|
174
|
+
if (Number.isFinite(parsed)) {
|
|
175
|
+
return parsed;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
};
|
|
180
|
+
var mergeSettings = (defaults, input) => {
|
|
181
|
+
if (!isRecord(input)) {
|
|
182
|
+
return structuredClone(defaults);
|
|
183
|
+
}
|
|
184
|
+
const next = structuredClone(defaults);
|
|
185
|
+
for (const [key, value] of Object.entries(input)) {
|
|
186
|
+
if (isRecord(value) && isRecord(next[key])) {
|
|
187
|
+
next[key] = mergeSettings(next[key], value);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (typeof value !== "undefined") {
|
|
191
|
+
next[key] = value;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return next;
|
|
195
|
+
};
|
|
196
|
+
var legacyBlockToV2Settings = (block) => {
|
|
197
|
+
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
198
|
+
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
199
|
+
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
200
|
+
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
201
|
+
current.appearance.sectionBackgroundMode = block.sectionBackgroundMode === "none" || block.sectionBackgroundMode === "color" || block.sectionBackgroundMode === "gradient" ? block.sectionBackgroundMode : current.appearance.sectionBackgroundMode;
|
|
202
|
+
current.appearance.sectionBackgroundColor = typeof block.sectionBackgroundColor === "string" ? block.sectionBackgroundColor : current.appearance.sectionBackgroundColor;
|
|
203
|
+
current.appearance.sectionGradientPreset = typeof block.sectionGradientPreset === "string" ? block.sectionGradientPreset : current.appearance.sectionGradientPreset;
|
|
204
|
+
current.appearance.sectionGradientFrom = typeof block.sectionGradientFrom === "string" ? block.sectionGradientFrom : current.appearance.sectionGradientFrom;
|
|
205
|
+
current.appearance.sectionGradientTo = typeof block.sectionGradientTo === "string" ? block.sectionGradientTo : current.appearance.sectionGradientTo;
|
|
206
|
+
current.appearance.sectionGradientAngle = typeof block.sectionGradientAngle === "string" ? block.sectionGradientAngle : current.appearance.sectionGradientAngle;
|
|
207
|
+
current.appearance.contentBackgroundMode = block.contentBackgroundMode === "none" || block.contentBackgroundMode === "color" || block.contentBackgroundMode === "gradient" ? block.contentBackgroundMode : current.appearance.contentBackgroundMode;
|
|
208
|
+
current.appearance.contentBackgroundColor = typeof block.contentBackgroundColor === "string" ? block.contentBackgroundColor : current.appearance.contentBackgroundColor;
|
|
209
|
+
current.appearance.contentGradientPreset = typeof block.contentGradientPreset === "string" ? block.contentGradientPreset : current.appearance.contentGradientPreset;
|
|
210
|
+
current.appearance.contentGradientFrom = typeof block.contentGradientFrom === "string" ? block.contentGradientFrom : current.appearance.contentGradientFrom;
|
|
211
|
+
current.appearance.contentGradientTo = typeof block.contentGradientTo === "string" ? block.contentGradientTo : current.appearance.contentGradientTo;
|
|
212
|
+
current.appearance.contentGradientAngle = typeof block.contentGradientAngle === "string" ? block.contentGradientAngle : current.appearance.contentGradientAngle;
|
|
213
|
+
if (block.backgroundImageFit === "cover" || block.backgroundImageFit === "contain") {
|
|
214
|
+
current.media.fit = block.backgroundImageFit;
|
|
215
|
+
}
|
|
216
|
+
if (block.imageFit === "cover" || block.imageFit === "contain") {
|
|
217
|
+
current.media.fit = block.imageFit;
|
|
218
|
+
}
|
|
219
|
+
if (block.backgroundImageCornerStyle === "rounded" || block.backgroundImageCornerStyle === "square") {
|
|
220
|
+
current.media.cornerStyle = block.backgroundImageCornerStyle;
|
|
221
|
+
}
|
|
222
|
+
if (block.imageCornerStyle === "rounded" || block.imageCornerStyle === "square") {
|
|
223
|
+
current.media.cornerStyle = block.imageCornerStyle;
|
|
224
|
+
}
|
|
225
|
+
if (block.backgroundImagePosition === "top" || block.backgroundImagePosition === "bottom" || block.backgroundImagePosition === "left" || block.backgroundImagePosition === "right" || block.backgroundImagePosition === "center") {
|
|
226
|
+
current.media.position = block.backgroundImagePosition;
|
|
227
|
+
}
|
|
228
|
+
if (block.imagePosition === "top" || block.imagePosition === "bottom" || block.imagePosition === "left" || block.imagePosition === "right" || block.imagePosition === "center") {
|
|
229
|
+
current.media.position = block.imagePosition;
|
|
230
|
+
}
|
|
231
|
+
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
232
|
+
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
233
|
+
current.media.height = parsePixel(block.imageHeight);
|
|
234
|
+
current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
|
|
235
|
+
current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
|
|
236
|
+
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
237
|
+
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
238
|
+
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
239
|
+
current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
|
|
240
|
+
current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
|
|
241
|
+
current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
|
|
242
|
+
return mergeSettings(current, block.settings);
|
|
243
|
+
};
|
|
244
|
+
var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
245
|
+
const settings = legacyBlockToV2Settings(blockWithSettings);
|
|
246
|
+
const next = {
|
|
247
|
+
...blockWithSettings,
|
|
248
|
+
settings
|
|
249
|
+
};
|
|
250
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
251
|
+
next.contentWidth = settings.layout.contentWidth;
|
|
252
|
+
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
253
|
+
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
254
|
+
next.sectionBackgroundMode = settings.appearance.sectionBackgroundMode;
|
|
255
|
+
next.sectionBackgroundColor = settings.appearance.sectionBackgroundColor;
|
|
256
|
+
next.sectionGradientPreset = settings.appearance.sectionGradientPreset;
|
|
257
|
+
next.sectionGradientFrom = settings.appearance.sectionGradientFrom;
|
|
258
|
+
next.sectionGradientTo = settings.appearance.sectionGradientTo;
|
|
259
|
+
next.sectionGradientAngle = settings.appearance.sectionGradientAngle;
|
|
260
|
+
next.contentBackgroundMode = settings.appearance.contentBackgroundMode;
|
|
261
|
+
next.contentBackgroundColor = settings.appearance.contentBackgroundColor;
|
|
262
|
+
next.contentGradientPreset = settings.appearance.contentGradientPreset;
|
|
263
|
+
next.contentGradientFrom = settings.appearance.contentGradientFrom;
|
|
264
|
+
next.contentGradientTo = settings.appearance.contentGradientTo;
|
|
265
|
+
next.contentGradientAngle = settings.appearance.contentGradientAngle;
|
|
266
|
+
next.textHeadingAlign = settings.typography.headingAlign;
|
|
267
|
+
next.textBodyAlign = settings.typography.bodyAlign;
|
|
268
|
+
next.textMaxWidth = settings.typography.maxTextWidth;
|
|
269
|
+
next.textLineHeightPreset = settings.typography.lineHeightPreset;
|
|
270
|
+
next.textLetterSpacingPreset = settings.typography.letterSpacingPreset;
|
|
271
|
+
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
272
|
+
next.customClassName = settings.advanced.customClassName;
|
|
273
|
+
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
274
|
+
delete next.backgroundImagePositionX;
|
|
275
|
+
delete next.backgroundImagePositionY;
|
|
276
|
+
delete next.imageHeight;
|
|
277
|
+
delete next.imagePositionX;
|
|
278
|
+
delete next.imagePositionY;
|
|
279
|
+
if (blockType === "hero") {
|
|
280
|
+
next.backgroundImageFit = settings.media.fit;
|
|
281
|
+
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
282
|
+
next.backgroundImagePosition = settings.media.position;
|
|
283
|
+
} else if (blockType === "media") {
|
|
284
|
+
next.imageFit = settings.media.fit;
|
|
285
|
+
next.imageCornerStyle = settings.media.cornerStyle;
|
|
286
|
+
next.imagePosition = settings.media.position;
|
|
287
|
+
}
|
|
288
|
+
if (Array.isArray(next.items)) {
|
|
289
|
+
next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
290
|
+
}
|
|
291
|
+
return next;
|
|
292
|
+
};
|
|
293
|
+
var legacyItemToV2Settings = (item) => {
|
|
294
|
+
const current = structuredClone(defaultBuilderItemSettingsV2);
|
|
295
|
+
if (item.imageFit === "cover" || item.imageFit === "contain") {
|
|
296
|
+
current.media.fit = item.imageFit;
|
|
297
|
+
}
|
|
298
|
+
if (item.imageCornerStyle === "rounded" || item.imageCornerStyle === "square") {
|
|
299
|
+
current.media.cornerStyle = item.imageCornerStyle;
|
|
300
|
+
}
|
|
301
|
+
if (item.imagePosition === "top" || item.imagePosition === "bottom" || item.imagePosition === "left" || item.imagePosition === "right" || item.imagePosition === "center") {
|
|
302
|
+
current.media.position = item.imagePosition;
|
|
303
|
+
}
|
|
304
|
+
current.media.positionX = parsePercent(item.imagePositionX);
|
|
305
|
+
current.media.positionY = parsePercent(item.imagePositionY);
|
|
306
|
+
current.media.height = parsePixel(item.imageHeight);
|
|
307
|
+
return mergeSettings(current, item.settings);
|
|
308
|
+
};
|
|
309
|
+
var v2SettingsToLegacyItem = (itemWithSettings) => {
|
|
310
|
+
const settings = legacyItemToV2Settings(itemWithSettings);
|
|
311
|
+
return {
|
|
312
|
+
...itemWithSettings,
|
|
313
|
+
imageCornerStyle: settings.media.cornerStyle,
|
|
314
|
+
imageFit: settings.media.fit,
|
|
315
|
+
imageHeight: settings.media.height,
|
|
316
|
+
imagePosition: settings.media.position,
|
|
317
|
+
imagePositionX: settings.media.positionX,
|
|
318
|
+
imagePositionY: settings.media.positionY,
|
|
319
|
+
settings
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
var migrateBlockToSettingsV2 = (block) => {
|
|
323
|
+
const withLegacyMirrors = v2SettingsToLegacyBlock(block);
|
|
324
|
+
if (!Array.isArray(withLegacyMirrors.items)) {
|
|
325
|
+
return withLegacyMirrors;
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
...withLegacyMirrors,
|
|
329
|
+
items: withLegacyMirrors.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem)
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
// src/studio-pages/builder/settings-v2/themeTokens.ts
|
|
334
|
+
var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
335
|
+
var merge = (base, next) => {
|
|
336
|
+
if (!next || !isRecord2(next)) {
|
|
337
|
+
return base;
|
|
338
|
+
}
|
|
339
|
+
const merged = { ...base };
|
|
340
|
+
for (const [key, value] of Object.entries(next)) {
|
|
341
|
+
if (isRecord2(value) && isRecord2(merged[key])) {
|
|
342
|
+
merged[key] = merge(merged[key], value);
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
if (typeof value !== "undefined") {
|
|
346
|
+
merged[key] = value;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return merged;
|
|
350
|
+
};
|
|
351
|
+
var resolveBuilderThemeTokens = (layers) => {
|
|
352
|
+
const withSite = merge(defaultBuilderThemeTokens, layers.site);
|
|
353
|
+
const withPage = merge(withSite, layers.page);
|
|
354
|
+
return merge(withPage, layers.block);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
358
|
+
var import_react2 = require("react");
|
|
359
|
+
|
|
360
|
+
// src/studio-pages/builder/ui/Accordion.tsx
|
|
361
|
+
var import_react = require("react");
|
|
362
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
363
|
+
|
|
364
|
+
// src/studio-pages/builder/ui/ImageControls.tsx
|
|
365
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
366
|
+
|
|
367
|
+
// src/studio-pages/builder/settings-v2/inspectorSchema.ts
|
|
368
|
+
var alignOptions = [
|
|
369
|
+
{ label: "Left", value: "left" },
|
|
370
|
+
{ label: "Center", value: "center" },
|
|
371
|
+
{ label: "Right", value: "right" },
|
|
372
|
+
{ label: "Justify", value: "justify" }
|
|
373
|
+
];
|
|
374
|
+
var layoutFieldSet = [];
|
|
375
|
+
var typographyFieldSet = [
|
|
376
|
+
{
|
|
377
|
+
group: "typography",
|
|
378
|
+
key: "settings.typography.headingAlign",
|
|
379
|
+
label: "Heading Alignment",
|
|
380
|
+
options: alignOptions,
|
|
381
|
+
tags: ["text", "align", "heading"],
|
|
382
|
+
type: "select"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
group: "typography",
|
|
386
|
+
key: "settings.typography.bodyAlign",
|
|
387
|
+
label: "Body Alignment",
|
|
388
|
+
options: alignOptions,
|
|
389
|
+
tags: ["text", "align", "paragraph"],
|
|
390
|
+
type: "select"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
group: "typography",
|
|
394
|
+
key: "settings.typography.maxTextWidth",
|
|
395
|
+
label: "Text Width",
|
|
396
|
+
options: [
|
|
397
|
+
{ label: "Auto", value: "auto" },
|
|
398
|
+
{ label: "Small", value: "sm" },
|
|
399
|
+
{ label: "Medium", value: "md" },
|
|
400
|
+
{ label: "Large", value: "lg" },
|
|
401
|
+
{ label: "Full", value: "full" }
|
|
402
|
+
],
|
|
403
|
+
tags: ["readability", "measure", "line length"],
|
|
404
|
+
type: "select"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
advanced: true,
|
|
408
|
+
group: "typography",
|
|
409
|
+
key: "settings.typography.lineHeightPreset",
|
|
410
|
+
label: "Line Height",
|
|
411
|
+
options: [
|
|
412
|
+
{ label: "Tight", value: "tight" },
|
|
413
|
+
{ label: "Normal", value: "normal" },
|
|
414
|
+
{ label: "Relaxed", value: "relaxed" }
|
|
415
|
+
],
|
|
416
|
+
type: "select"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
advanced: true,
|
|
420
|
+
group: "typography",
|
|
421
|
+
key: "settings.typography.letterSpacingPreset",
|
|
422
|
+
label: "Letter Spacing",
|
|
423
|
+
options: [
|
|
424
|
+
{ label: "Tight", value: "tight" },
|
|
425
|
+
{ label: "Normal", value: "normal" },
|
|
426
|
+
{ label: "Relaxed", value: "relaxed" }
|
|
427
|
+
],
|
|
428
|
+
type: "select"
|
|
429
|
+
}
|
|
430
|
+
];
|
|
431
|
+
var styleFieldSet = [];
|
|
432
|
+
var commonAdvanced = [
|
|
433
|
+
{
|
|
434
|
+
group: "advanced",
|
|
435
|
+
inlineEditable: false,
|
|
436
|
+
key: "settings.advanced.editCopyInPanel",
|
|
437
|
+
label: "Edit Copy In Panel",
|
|
438
|
+
tags: ["inline", "copy", "text"],
|
|
439
|
+
type: "checkbox"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
advanced: true,
|
|
443
|
+
group: "advanced",
|
|
444
|
+
key: "settings.advanced.hideOnMobile",
|
|
445
|
+
label: "Hide On Mobile",
|
|
446
|
+
type: "checkbox"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
advanced: true,
|
|
450
|
+
group: "advanced",
|
|
451
|
+
key: "settings.advanced.customClassName",
|
|
452
|
+
label: "Custom Class Name",
|
|
453
|
+
type: "text"
|
|
454
|
+
}
|
|
455
|
+
];
|
|
456
|
+
var mediaFieldSet = [
|
|
457
|
+
{
|
|
458
|
+
group: "media",
|
|
459
|
+
key: "settings.media.fit",
|
|
460
|
+
label: "Image Fit",
|
|
461
|
+
options: [
|
|
462
|
+
{ label: "Cover", value: "cover" },
|
|
463
|
+
{ label: "Contain", value: "contain" }
|
|
464
|
+
],
|
|
465
|
+
tags: ["image", "media"],
|
|
466
|
+
type: "select"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
group: "media",
|
|
470
|
+
key: "settings.media.cornerStyle",
|
|
471
|
+
label: "Image Corners",
|
|
472
|
+
options: [
|
|
473
|
+
{ label: "Rounded", value: "rounded" },
|
|
474
|
+
{ label: "Square", value: "square" }
|
|
475
|
+
],
|
|
476
|
+
tags: ["image", "radius", "corners"],
|
|
477
|
+
type: "select"
|
|
478
|
+
}
|
|
479
|
+
];
|
|
480
|
+
var inspectorDefinitionByBlockType = {
|
|
481
|
+
beforeAfter: {
|
|
482
|
+
blockType: "beforeAfter",
|
|
483
|
+
fields: [
|
|
484
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
485
|
+
{ group: "basics", inlineEditable: true, key: "subtitle", label: "Subtitle", type: "textarea" },
|
|
486
|
+
{ group: "basics", key: "itemsPerRow", label: "Items Per Row", max: 4, min: 1, type: "number" },
|
|
487
|
+
...layoutFieldSet,
|
|
488
|
+
...typographyFieldSet,
|
|
489
|
+
...styleFieldSet,
|
|
490
|
+
...commonAdvanced
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
bookingEmbed: {
|
|
494
|
+
blockType: "bookingEmbed",
|
|
495
|
+
fields: [
|
|
496
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
497
|
+
{ group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
|
|
498
|
+
{ group: "basics", inlineEditable: false, key: "buttonLabel", label: "Button Label", type: "text" },
|
|
499
|
+
{ group: "basics", inlineEditable: false, key: "buttonHref", label: "Button URL", type: "text" },
|
|
500
|
+
...layoutFieldSet,
|
|
501
|
+
...typographyFieldSet,
|
|
502
|
+
...styleFieldSet,
|
|
503
|
+
...commonAdvanced
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
cta: {
|
|
507
|
+
blockType: "cta",
|
|
508
|
+
fields: [
|
|
509
|
+
{ group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
|
|
510
|
+
{ group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
|
|
511
|
+
{ group: "basics", inlineEditable: false, key: "buttonLabel", label: "Button Label", type: "text" },
|
|
512
|
+
{ group: "basics", inlineEditable: false, key: "buttonHref", label: "Button URL", type: "text" },
|
|
513
|
+
{
|
|
514
|
+
group: "basics",
|
|
515
|
+
key: "style",
|
|
516
|
+
label: "Variant",
|
|
517
|
+
options: [
|
|
518
|
+
{ label: "Light", value: "light" },
|
|
519
|
+
{ label: "Dark", value: "dark" }
|
|
520
|
+
],
|
|
521
|
+
type: "select"
|
|
522
|
+
},
|
|
523
|
+
...layoutFieldSet,
|
|
524
|
+
...typographyFieldSet,
|
|
525
|
+
...styleFieldSet,
|
|
526
|
+
...commonAdvanced
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
faq: {
|
|
530
|
+
blockType: "faq",
|
|
531
|
+
fields: [
|
|
532
|
+
{ group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
|
|
533
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
534
|
+
...layoutFieldSet,
|
|
535
|
+
...typographyFieldSet,
|
|
536
|
+
...styleFieldSet,
|
|
537
|
+
...commonAdvanced
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
featureGrid: {
|
|
541
|
+
blockType: "featureGrid",
|
|
542
|
+
fields: [
|
|
543
|
+
{ group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
|
|
544
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
545
|
+
{
|
|
546
|
+
group: "basics",
|
|
547
|
+
key: "variant",
|
|
548
|
+
label: "Variant",
|
|
549
|
+
options: [
|
|
550
|
+
{ label: "Cards", value: "cards" },
|
|
551
|
+
{ label: "Highlight", value: "highlight" },
|
|
552
|
+
{ label: "Split List", value: "splitList" },
|
|
553
|
+
{ label: "Panels", value: "panels" },
|
|
554
|
+
{ label: "Catalog", value: "catalog" },
|
|
555
|
+
{ label: "Contact Split", value: "contact" }
|
|
556
|
+
],
|
|
557
|
+
type: "select"
|
|
558
|
+
},
|
|
559
|
+
{ group: "basics", key: "itemsPerRow", label: "Items Per Row", max: 6, min: 1, type: "number" },
|
|
560
|
+
...layoutFieldSet,
|
|
561
|
+
...typographyFieldSet,
|
|
562
|
+
...mediaFieldSet,
|
|
563
|
+
...styleFieldSet,
|
|
564
|
+
...commonAdvanced
|
|
565
|
+
]
|
|
566
|
+
},
|
|
567
|
+
formEmbed: {
|
|
568
|
+
blockType: "formEmbed",
|
|
569
|
+
fields: [
|
|
570
|
+
{ group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
|
|
571
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
572
|
+
{ group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
|
|
573
|
+
{
|
|
574
|
+
group: "basics",
|
|
575
|
+
key: "formType",
|
|
576
|
+
label: "Form Type",
|
|
577
|
+
options: [{ label: "Quote", value: "quote" }],
|
|
578
|
+
type: "select"
|
|
579
|
+
},
|
|
580
|
+
...layoutFieldSet,
|
|
581
|
+
...typographyFieldSet,
|
|
582
|
+
...styleFieldSet,
|
|
583
|
+
...commonAdvanced
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
hero: {
|
|
587
|
+
blockType: "hero",
|
|
588
|
+
fields: [
|
|
589
|
+
{ group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
|
|
590
|
+
{ group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
|
|
591
|
+
{ group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
|
|
592
|
+
{
|
|
593
|
+
group: "basics",
|
|
594
|
+
key: "variant",
|
|
595
|
+
label: "Variant",
|
|
596
|
+
options: [
|
|
597
|
+
{ label: "Default", value: "default" },
|
|
598
|
+
{ label: "Centered", value: "centered" }
|
|
599
|
+
],
|
|
600
|
+
type: "select"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
group: "basics",
|
|
604
|
+
key: "heroHeight",
|
|
605
|
+
label: "Hero Height",
|
|
606
|
+
options: [
|
|
607
|
+
{ label: "Small", value: "sm" },
|
|
608
|
+
{ label: "Medium (Half Screen)", value: "md" },
|
|
609
|
+
{ label: "Full Screen", value: "full" }
|
|
610
|
+
],
|
|
611
|
+
type: "select"
|
|
612
|
+
},
|
|
613
|
+
...layoutFieldSet,
|
|
614
|
+
...typographyFieldSet,
|
|
615
|
+
...mediaFieldSet,
|
|
616
|
+
...styleFieldSet,
|
|
617
|
+
...commonAdvanced
|
|
618
|
+
]
|
|
619
|
+
},
|
|
620
|
+
logoWall: {
|
|
621
|
+
blockType: "logoWall",
|
|
622
|
+
fields: [
|
|
623
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
624
|
+
{ group: "basics", inlineEditable: true, key: "subtitle", label: "Subtitle", type: "textarea" },
|
|
625
|
+
...layoutFieldSet,
|
|
626
|
+
...typographyFieldSet,
|
|
627
|
+
...mediaFieldSet,
|
|
628
|
+
...styleFieldSet,
|
|
629
|
+
...commonAdvanced
|
|
630
|
+
]
|
|
631
|
+
},
|
|
632
|
+
media: {
|
|
633
|
+
blockType: "media",
|
|
634
|
+
fields: [
|
|
635
|
+
{ group: "basics", inlineEditable: true, key: "caption", label: "Caption", type: "text" },
|
|
636
|
+
{
|
|
637
|
+
group: "basics",
|
|
638
|
+
key: "size",
|
|
639
|
+
label: "Size",
|
|
640
|
+
options: [
|
|
641
|
+
{ label: "Default", value: "default" },
|
|
642
|
+
{ label: "Wide", value: "wide" }
|
|
643
|
+
],
|
|
644
|
+
type: "select"
|
|
645
|
+
},
|
|
646
|
+
...layoutFieldSet,
|
|
647
|
+
...typographyFieldSet,
|
|
648
|
+
...mediaFieldSet,
|
|
649
|
+
...styleFieldSet,
|
|
650
|
+
...commonAdvanced
|
|
651
|
+
]
|
|
652
|
+
},
|
|
653
|
+
richText: {
|
|
654
|
+
blockType: "richText",
|
|
655
|
+
fields: [
|
|
656
|
+
{
|
|
657
|
+
group: "basics",
|
|
658
|
+
key: "variant",
|
|
659
|
+
label: "Variant",
|
|
660
|
+
options: [
|
|
661
|
+
{ label: "Default", value: "default" },
|
|
662
|
+
{ label: "Quote Banner", value: "quoteBanner" }
|
|
663
|
+
],
|
|
664
|
+
type: "select"
|
|
665
|
+
},
|
|
666
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
667
|
+
{
|
|
668
|
+
group: "basics",
|
|
669
|
+
key: "width",
|
|
670
|
+
label: "Rich Text Width",
|
|
671
|
+
options: [
|
|
672
|
+
{ label: "Normal", value: "normal" },
|
|
673
|
+
{ label: "Narrow", value: "narrow" }
|
|
674
|
+
],
|
|
675
|
+
type: "select"
|
|
676
|
+
},
|
|
677
|
+
...layoutFieldSet,
|
|
678
|
+
...typographyFieldSet,
|
|
679
|
+
...styleFieldSet,
|
|
680
|
+
...commonAdvanced
|
|
681
|
+
]
|
|
682
|
+
},
|
|
683
|
+
stats: {
|
|
684
|
+
blockType: "stats",
|
|
685
|
+
fields: [
|
|
686
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
687
|
+
{ group: "basics", inlineEditable: true, key: "subtitle", label: "Subtitle", type: "textarea" },
|
|
688
|
+
...layoutFieldSet,
|
|
689
|
+
...typographyFieldSet,
|
|
690
|
+
...styleFieldSet,
|
|
691
|
+
...commonAdvanced
|
|
692
|
+
]
|
|
693
|
+
},
|
|
694
|
+
testimonials: {
|
|
695
|
+
blockType: "testimonials",
|
|
696
|
+
fields: [
|
|
697
|
+
{ group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
|
|
698
|
+
{ group: "basics", key: "visibleCount", label: "Visible At Once", max: 6, min: 1, type: "number" },
|
|
699
|
+
{ group: "basics", key: "autoRotate", label: "Auto Rotate", type: "checkbox" },
|
|
700
|
+
{
|
|
701
|
+
advanced: true,
|
|
702
|
+
group: "advanced",
|
|
703
|
+
key: "rotateIntervalSeconds",
|
|
704
|
+
label: "Rotate Interval Seconds",
|
|
705
|
+
max: 30,
|
|
706
|
+
min: 2,
|
|
707
|
+
type: "number"
|
|
708
|
+
},
|
|
709
|
+
...layoutFieldSet,
|
|
710
|
+
...typographyFieldSet,
|
|
711
|
+
...styleFieldSet,
|
|
712
|
+
...commonAdvanced
|
|
713
|
+
]
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
718
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
719
|
+
|
|
720
|
+
// src/studio-pages/document.ts
|
|
721
|
+
var ensureNodeID = (value, index) => {
|
|
722
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
723
|
+
return value.trim();
|
|
724
|
+
}
|
|
725
|
+
return `node-${index + 1}`;
|
|
726
|
+
};
|
|
727
|
+
var layoutToStudioDocument = (layout, title, metadata) => {
|
|
728
|
+
const nodes = layout.filter((block) => typeof block.blockType === "string").map((rawBlock, index) => {
|
|
729
|
+
const block = migrateBlockToSettingsV2(rawBlock);
|
|
730
|
+
const blockType = String(block.blockType);
|
|
731
|
+
const { id, blockType: _ignoredBlockType, ...data } = block;
|
|
732
|
+
return {
|
|
733
|
+
id: ensureNodeID(id, index),
|
|
734
|
+
type: blockType,
|
|
735
|
+
data
|
|
736
|
+
};
|
|
737
|
+
});
|
|
738
|
+
return {
|
|
739
|
+
metadata,
|
|
740
|
+
schemaVersion: 1,
|
|
741
|
+
title,
|
|
742
|
+
nodes,
|
|
743
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
var studioDocumentToLayout = (document) => document.nodes.map(
|
|
747
|
+
(node) => migrateBlockToSettingsV2({
|
|
748
|
+
id: node.id,
|
|
749
|
+
blockType: node.type,
|
|
750
|
+
...node.data
|
|
751
|
+
})
|
|
752
|
+
);
|
|
753
|
+
var createDefaultStudioDocument = (title) => ({
|
|
754
|
+
metadata: {},
|
|
755
|
+
schemaVersion: 1,
|
|
756
|
+
title,
|
|
757
|
+
nodes: [],
|
|
758
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
759
|
+
});
|
|
760
|
+
|
|
761
|
+
// src/studio-pages/migrations.ts
|
|
762
|
+
var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
763
|
+
var assertPageStudioDocumentV1 = (value) => {
|
|
764
|
+
if (!isRecord3(value)) {
|
|
765
|
+
throw new Error("Studio document must be an object");
|
|
766
|
+
}
|
|
767
|
+
if (value.schemaVersion !== 1) {
|
|
768
|
+
throw new Error("Unsupported studio schemaVersion");
|
|
769
|
+
}
|
|
770
|
+
if (!Array.isArray(value.nodes)) {
|
|
771
|
+
throw new Error("Studio document nodes must be an array");
|
|
772
|
+
}
|
|
773
|
+
const nodes = value.nodes.map((node, index) => {
|
|
774
|
+
if (!isRecord3(node)) {
|
|
775
|
+
throw new Error(`Node at index ${index} must be an object`);
|
|
776
|
+
}
|
|
777
|
+
if (typeof node.id !== "string" || node.id.length === 0) {
|
|
778
|
+
throw new Error(`Node at index ${index} has invalid id`);
|
|
779
|
+
}
|
|
780
|
+
if (typeof node.type !== "string" || node.type.length === 0) {
|
|
781
|
+
throw new Error(`Node at index ${index} has invalid type`);
|
|
782
|
+
}
|
|
783
|
+
if (!isRecord3(node.data)) {
|
|
784
|
+
throw new Error(`Node at index ${index} has invalid data`);
|
|
785
|
+
}
|
|
786
|
+
return {
|
|
787
|
+
data: node.data,
|
|
788
|
+
id: node.id,
|
|
789
|
+
type: node.type
|
|
790
|
+
};
|
|
791
|
+
});
|
|
792
|
+
return {
|
|
793
|
+
metadata: isRecord3(value.metadata) ? value.metadata : void 0,
|
|
794
|
+
nodes,
|
|
795
|
+
schemaVersion: 1,
|
|
796
|
+
title: typeof value.title === "string" ? value.title : void 0,
|
|
797
|
+
updatedAt: typeof value.updatedAt === "string" ? value.updatedAt : void 0
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
var migratePageNodeToSettingsV2 = (node) => {
|
|
801
|
+
const normalized = migrateBlockToSettingsV2({
|
|
802
|
+
blockType: node.type,
|
|
803
|
+
...node.data
|
|
804
|
+
});
|
|
805
|
+
const { blockType: _ignoredBlockType, ...data } = normalized;
|
|
806
|
+
return {
|
|
807
|
+
...node,
|
|
808
|
+
data
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
var migratePageDocumentSettingsToV2 = (value) => {
|
|
812
|
+
const current = assertPageStudioDocumentV1(value);
|
|
813
|
+
return {
|
|
814
|
+
...current,
|
|
815
|
+
nodes: current.nodes.map(migratePageNodeToSettingsV2)
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
var pageStudioMigrations = [
|
|
819
|
+
{
|
|
820
|
+
fromVersion: 1,
|
|
821
|
+
migrate: migratePageDocumentSettingsToV2,
|
|
822
|
+
toVersion: 1
|
|
823
|
+
}
|
|
824
|
+
];
|
|
825
|
+
|
|
52
826
|
// src/studio-pages/index.ts
|
|
53
827
|
var withSectionStyleDefaults = (value) => ({
|
|
54
828
|
...sectionStyleDefaults,
|
|
@@ -63,9 +837,13 @@ var defaultNodeData = {
|
|
|
63
837
|
title: "Book a Time"
|
|
64
838
|
},
|
|
65
839
|
beforeAfter: withSectionStyleDefaults({
|
|
840
|
+
itemsPerRow: 2,
|
|
66
841
|
items: [
|
|
67
842
|
{
|
|
68
843
|
description: "Before and after result summary.",
|
|
844
|
+
imageCornerStyle: "rounded",
|
|
845
|
+
imageFit: "cover",
|
|
846
|
+
imagePosition: "center",
|
|
69
847
|
label: "Project One"
|
|
70
848
|
}
|
|
71
849
|
],
|
|
@@ -74,11 +852,14 @@ var defaultNodeData = {
|
|
|
74
852
|
}),
|
|
75
853
|
cta: {
|
|
76
854
|
...withSectionStyleDefaults({}),
|
|
77
|
-
backgroundColor: "
|
|
855
|
+
backgroundColor: "",
|
|
856
|
+
bullets: [],
|
|
78
857
|
buttonHref: "/contact",
|
|
79
858
|
buttonLabel: "Contact Us",
|
|
80
859
|
description: "Optional supporting copy.",
|
|
860
|
+
eyebrow: "",
|
|
81
861
|
headline: "Ready to get started?",
|
|
862
|
+
imageURL: "",
|
|
82
863
|
style: "light"
|
|
83
864
|
},
|
|
84
865
|
faq: {
|
|
@@ -88,11 +869,13 @@ var defaultNodeData = {
|
|
|
88
869
|
},
|
|
89
870
|
featureGrid: {
|
|
90
871
|
...withSectionStyleDefaults({}),
|
|
872
|
+
itemsPerRow: 3,
|
|
91
873
|
items: [
|
|
92
|
-
{ description: "Explain this point.", icon: "01", title: "Feature One" },
|
|
93
|
-
{ description: "Explain this point.", icon: "02", title: "Feature Two" },
|
|
94
|
-
{ description: "Explain this point.", icon: "03", title: "Feature Three" }
|
|
874
|
+
{ description: "Explain this point.", iconType: "badge", icon: "01", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature One" },
|
|
875
|
+
{ description: "Explain this point.", iconType: "badge", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
|
|
876
|
+
{ description: "Explain this point.", iconType: "badge", icon: "03", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Three" }
|
|
95
877
|
],
|
|
878
|
+
subtitle: "",
|
|
96
879
|
title: "Section Title",
|
|
97
880
|
variant: "cards"
|
|
98
881
|
},
|
|
@@ -100,13 +883,28 @@ var defaultNodeData = {
|
|
|
100
883
|
...withSectionStyleDefaults({}),
|
|
101
884
|
description: "Collect lead details from visitors.",
|
|
102
885
|
formType: "quote",
|
|
886
|
+
submitLabel: "Submit",
|
|
103
887
|
title: "Request a Quote"
|
|
104
888
|
},
|
|
105
889
|
hero: {
|
|
106
890
|
...withSectionStyleDefaults({}),
|
|
107
891
|
backgroundColor: "",
|
|
892
|
+
backgroundImageURL: "",
|
|
893
|
+
backgroundOverlayMode: "none",
|
|
894
|
+
backgroundOverlayOpacity: 45,
|
|
895
|
+
backgroundOverlayColor: "#000000",
|
|
896
|
+
backgroundOverlayGradientFrom: "#334b63",
|
|
897
|
+
backgroundOverlayGradientTo: "#496582",
|
|
898
|
+
backgroundOverlayGradientAngle: "135",
|
|
899
|
+
backgroundOverlayGradientFromStrength: 100,
|
|
900
|
+
backgroundOverlayGradientToStrength: 100,
|
|
901
|
+
backgroundOverlayGradientStart: 0,
|
|
902
|
+
backgroundOverlayGradientEnd: 100,
|
|
903
|
+
backgroundOverlayGradientFeather: 100,
|
|
904
|
+
backgroundImageCornerStyle: "rounded",
|
|
108
905
|
backgroundImageFit: "cover",
|
|
109
906
|
backgroundImagePosition: "center",
|
|
907
|
+
heroHeight: "sm",
|
|
110
908
|
headline: "New Hero Section",
|
|
111
909
|
kicker: "Optional kicker",
|
|
112
910
|
primaryHref: "/contact",
|
|
@@ -119,19 +917,23 @@ var defaultNodeData = {
|
|
|
119
917
|
media: {
|
|
120
918
|
...withSectionStyleDefaults({}),
|
|
121
919
|
caption: "Add a caption",
|
|
920
|
+
imageCornerStyle: "rounded",
|
|
921
|
+
imageFit: "cover",
|
|
922
|
+
imagePosition: "center",
|
|
122
923
|
size: "default"
|
|
123
924
|
},
|
|
124
925
|
logoWall: withSectionStyleDefaults({
|
|
125
926
|
items: [
|
|
126
|
-
{ name: "Trusted Partner 1" },
|
|
127
|
-
{ name: "Trusted Partner 2" },
|
|
128
|
-
{ name: "Trusted Partner 3" }
|
|
927
|
+
{ imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 1" },
|
|
928
|
+
{ imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
|
|
929
|
+
{ imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
|
|
129
930
|
],
|
|
130
|
-
subtitle: "
|
|
131
|
-
title: "Trusted by
|
|
931
|
+
subtitle: "Show logos from trusted associations, partners, or collaborators.",
|
|
932
|
+
title: "Trusted by Great Partners"
|
|
132
933
|
}),
|
|
133
934
|
richText: {
|
|
134
935
|
...withSectionStyleDefaults({}),
|
|
936
|
+
cards: [],
|
|
135
937
|
content: {
|
|
136
938
|
root: {
|
|
137
939
|
children: [
|
|
@@ -161,19 +963,23 @@ var defaultNodeData = {
|
|
|
161
963
|
version: 1
|
|
162
964
|
}
|
|
163
965
|
},
|
|
966
|
+
statsItems: [],
|
|
164
967
|
title: "Section Heading",
|
|
165
968
|
width: "normal"
|
|
166
969
|
},
|
|
167
970
|
testimonials: {
|
|
168
971
|
...withSectionStyleDefaults({}),
|
|
169
|
-
|
|
170
|
-
|
|
972
|
+
autoRotate: true,
|
|
973
|
+
items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here.", rating: 5 }],
|
|
974
|
+
rotateIntervalSeconds: 7,
|
|
975
|
+
title: "What Customers Say",
|
|
976
|
+
visibleCount: 3
|
|
171
977
|
},
|
|
172
978
|
stats: withSectionStyleDefaults({
|
|
173
979
|
items: [
|
|
174
|
-
{ description: "Average response
|
|
175
|
-
{ description: "
|
|
176
|
-
{ description: "
|
|
980
|
+
{ description: "Average first response", label: "Response Time", value: "24h" },
|
|
981
|
+
{ description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" },
|
|
982
|
+
{ description: "Recent projects or clients served", label: "Recent Work", value: "150+" }
|
|
177
983
|
],
|
|
178
984
|
subtitle: "Highlight measurable outcomes to build trust quickly.",
|
|
179
985
|
title: "Performance Highlights"
|
|
@@ -197,7 +1003,11 @@ var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
|
|
|
197
1003
|
type,
|
|
198
1004
|
displayName: nodeTypeLabels[type] || type,
|
|
199
1005
|
description: `Page node for ${nodeTypeLabels[type] || type}`,
|
|
200
|
-
getDefaultData: () =>
|
|
1006
|
+
getDefaultData: () => {
|
|
1007
|
+
const migrated = migrateBlockToSettingsV2(structuredClone(defaultNodeData[type]));
|
|
1008
|
+
const { blockType: _ignoredBlockType, ...data } = migrated;
|
|
1009
|
+
return data;
|
|
1010
|
+
}
|
|
201
1011
|
}));
|
|
202
1012
|
var validatePageDocument = (document) => {
|
|
203
1013
|
const issues = [];
|
|
@@ -249,17 +1059,24 @@ var pagePaletteGroups = [
|
|
|
249
1059
|
]
|
|
250
1060
|
}
|
|
251
1061
|
];
|
|
252
|
-
var
|
|
253
|
-
id: `${nodeType}-panel`,
|
|
254
|
-
label: `${nodeTypeLabels[nodeType] || nodeType} Settings`,
|
|
1062
|
+
var pageInspectorPanelRegistry = Object.keys(defaultNodeData).map((nodeType) => ({
|
|
255
1063
|
nodeType,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
1064
|
+
panelID: `${nodeType}-panel`,
|
|
1065
|
+
panelLabel: `${nodeTypeLabels[nodeType] || nodeType} Settings`
|
|
1066
|
+
}));
|
|
1067
|
+
var resolvePanelFields = (nodeType) => inspectorDefinitionByBlockType[nodeType]?.fields.map((field) => ({
|
|
1068
|
+
advanced: field.advanced,
|
|
1069
|
+
group: field.group,
|
|
1070
|
+
inlineEditable: field.inlineEditable,
|
|
1071
|
+
key: field.key,
|
|
1072
|
+
label: field.label,
|
|
1073
|
+
type: field.type
|
|
1074
|
+
})) || [];
|
|
1075
|
+
var pageInspectorPanels = pageInspectorPanelRegistry.map((entry) => ({
|
|
1076
|
+
fields: resolvePanelFields(entry.nodeType),
|
|
1077
|
+
id: entry.panelID,
|
|
1078
|
+
label: entry.panelLabel,
|
|
1079
|
+
nodeType: entry.nodeType
|
|
263
1080
|
}));
|
|
264
1081
|
var pageStudioModuleManifest = {
|
|
265
1082
|
id: "studio-pages",
|
|
@@ -269,13 +1086,18 @@ var pageStudioModuleManifest = {
|
|
|
269
1086
|
paletteGroups: pagePaletteGroups,
|
|
270
1087
|
inspectorPanels: pageInspectorPanels,
|
|
271
1088
|
validators: [validatePageDocument],
|
|
272
|
-
migrations:
|
|
1089
|
+
migrations: pageStudioMigrations,
|
|
273
1090
|
compiler: {
|
|
274
|
-
compileNode: (node) =>
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
1091
|
+
compileNode: (node) => {
|
|
1092
|
+
const normalized = migrateBlockToSettingsV2({
|
|
1093
|
+
blockType: node.type,
|
|
1094
|
+
...node.data
|
|
1095
|
+
});
|
|
1096
|
+
return {
|
|
1097
|
+
id: node.id,
|
|
1098
|
+
...normalized
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
279
1101
|
},
|
|
280
1102
|
permissions: [
|
|
281
1103
|
{ action: "read", role: "admin" },
|
|
@@ -288,49 +1110,15 @@ var pageStudioModuleManifest = {
|
|
|
288
1110
|
{ action: "publish", role: "editor" }
|
|
289
1111
|
]
|
|
290
1112
|
};
|
|
291
|
-
var ensureNodeID = (inputID, index) => {
|
|
292
|
-
if (typeof inputID === "string" && inputID.length > 0) {
|
|
293
|
-
return inputID;
|
|
294
|
-
}
|
|
295
|
-
return `node-${index + 1}`;
|
|
296
|
-
};
|
|
297
|
-
var layoutToStudioDocument = (layout, title, metadata) => {
|
|
298
|
-
const nodes = layout.filter((block) => typeof block.blockType === "string").map((block, index) => {
|
|
299
|
-
const blockType = String(block.blockType);
|
|
300
|
-
const { id, blockType: _, ...data } = block;
|
|
301
|
-
return {
|
|
302
|
-
id: ensureNodeID(id, index),
|
|
303
|
-
type: blockType,
|
|
304
|
-
data
|
|
305
|
-
};
|
|
306
|
-
});
|
|
307
|
-
return {
|
|
308
|
-
metadata,
|
|
309
|
-
schemaVersion: 1,
|
|
310
|
-
title,
|
|
311
|
-
nodes,
|
|
312
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
var studioDocumentToLayout = (document) => document.nodes.map((node) => ({
|
|
316
|
-
id: node.id,
|
|
317
|
-
blockType: node.type,
|
|
318
|
-
...node.data
|
|
319
|
-
}));
|
|
320
|
-
var createDefaultStudioDocument = (title) => ({
|
|
321
|
-
metadata: {},
|
|
322
|
-
schemaVersion: 1,
|
|
323
|
-
title,
|
|
324
|
-
nodes: [],
|
|
325
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
326
|
-
});
|
|
327
1113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
328
1114
|
0 && (module.exports = {
|
|
329
1115
|
createDefaultStudioDocument,
|
|
1116
|
+
defaultBuilderThemeTokens,
|
|
330
1117
|
layoutToStudioDocument,
|
|
331
1118
|
pageInspectorPanels,
|
|
332
1119
|
pageNodeTypes,
|
|
333
1120
|
pagePaletteGroups,
|
|
334
1121
|
pageStudioModuleManifest,
|
|
1122
|
+
resolveBuilderThemeTokens,
|
|
335
1123
|
studioDocumentToLayout
|
|
336
1124
|
});
|