@orion-studios/payload-studio 0.5.0-beta.7 → 0.5.0-beta.70

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 (67) hide show
  1. package/README.md +20 -0
  2. package/dist/admin/client.d.mts +2 -0
  3. package/dist/admin/client.d.ts +2 -0
  4. package/dist/admin/client.js +779 -137
  5. package/dist/admin/client.mjs +769 -129
  6. package/dist/admin/index.d.mts +1 -1
  7. package/dist/admin/index.d.ts +1 -1
  8. package/dist/admin/index.js +100 -8
  9. package/dist/admin/index.mjs +3 -1
  10. package/dist/admin-app/client.d.mts +7 -0
  11. package/dist/admin-app/client.d.ts +7 -0
  12. package/dist/admin-app/client.js +1262 -3
  13. package/dist/admin-app/client.mjs +1164 -2
  14. package/dist/admin-app/index.d.mts +1 -1
  15. package/dist/admin-app/index.d.ts +1 -1
  16. package/dist/admin-app/index.js +167 -0
  17. package/dist/admin-app/index.mjs +13 -1
  18. package/dist/admin-app/styles.css +229 -0
  19. package/dist/blocks/index.js +633 -8
  20. package/dist/blocks/index.mjs +2 -2
  21. package/dist/{chunk-ZLLNO5FM.mjs → chunk-CKX5Y2HU.mjs} +44 -13
  22. package/dist/{chunk-J7W5EE3B.mjs → chunk-HCEPGEAI.mjs} +100 -8
  23. package/dist/chunk-HXGAG6I7.mjs +325 -0
  24. package/dist/chunk-ROTPP5CU.mjs +99 -0
  25. package/dist/{chunk-ETRRXURT.mjs → chunk-SIL2J5MF.mjs} +14 -0
  26. package/dist/chunk-VDGSMD6H.mjs +1072 -0
  27. package/dist/{chunk-PC5622T7.mjs → chunk-XK3K5GRP.mjs} +620 -9
  28. package/dist/chunk-XVH5SCBD.mjs +234 -0
  29. package/dist/{index-CmR6NInu.d.ts → index-BIwu3qIH.d.mts} +29 -3
  30. package/dist/{index-CmR6NInu.d.mts → index-BIwu3qIH.d.ts} +29 -3
  31. package/dist/index-CdnUNrvX.d.mts +134 -0
  32. package/dist/{index-DbH0Ljwp.d.ts → index-CpG3UHcS.d.mts} +1 -0
  33. package/dist/{index-DbH0Ljwp.d.mts → index-CpG3UHcS.d.ts} +1 -0
  34. package/dist/index-DyHbWliW.d.ts +134 -0
  35. package/dist/index-ZbOx4OCF.d.mts +128 -0
  36. package/dist/index-ZbOx4OCF.d.ts +128 -0
  37. package/dist/{index-DJFhANvJ.d.mts → index-cDYkEj29.d.mts} +20 -2
  38. package/dist/{index-DJFhANvJ.d.ts → index-cDYkEj29.d.ts} +20 -2
  39. package/dist/index.d.mts +5 -5
  40. package/dist/index.d.ts +5 -5
  41. package/dist/index.js +2145 -305
  42. package/dist/index.mjs +9 -9
  43. package/dist/nextjs/index.d.mts +1 -1
  44. package/dist/nextjs/index.d.ts +1 -1
  45. package/dist/nextjs/index.js +996 -13
  46. package/dist/nextjs/index.mjs +4 -1
  47. package/dist/studio/index.d.mts +2 -1
  48. package/dist/studio/index.d.ts +2 -1
  49. package/dist/studio/index.js +171 -2
  50. package/dist/studio/index.mjs +7 -3
  51. package/dist/studio-pages/builder.css +358 -8
  52. package/dist/studio-pages/client.d.mts +17 -0
  53. package/dist/studio-pages/client.d.ts +17 -0
  54. package/dist/studio-pages/client.js +5657 -1478
  55. package/dist/studio-pages/client.mjs +5549 -1461
  56. package/dist/studio-pages/index.d.mts +3 -2
  57. package/dist/studio-pages/index.d.ts +3 -2
  58. package/dist/studio-pages/index.js +799 -29
  59. package/dist/studio-pages/index.mjs +6 -2
  60. package/package.json +26 -12
  61. package/dist/chunk-AAOHJDNS.mjs +0 -67
  62. package/dist/chunk-N67KVM2S.mjs +0 -156
  63. package/dist/chunk-UJFU323N.mjs +0 -301
  64. package/dist/index-B9N5MyjF.d.mts +0 -39
  65. package/dist/index-BallJs-K.d.mts +0 -43
  66. package/dist/index-BallJs-K.d.ts +0 -43
  67. 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);
@@ -39,6 +41,7 @@ var sectionStyleDefaults = {
39
41
  contentGradientPreset: "none",
40
42
  contentGradientTo: "#f4f6f2",
41
43
  contentWidth: "inherit",
44
+ sectionPaddingX: "inherit",
42
45
  sectionBackgroundColor: "#ffffff",
43
46
  sectionBackgroundMode: "none",
44
47
  sectionGradientAngle: "135",
@@ -49,6 +52,732 @@ var sectionStyleDefaults = {
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: "#f4f6f2",
69
+ sectionBackgroundColor: "#ffffff",
70
+ sectionBackgroundMode: "none",
71
+ sectionGradientAngle: "135",
72
+ sectionGradientFrom: "#124a37",
73
+ sectionGradientPreset: "forest",
74
+ sectionGradientTo: "#1f684f"
75
+ },
76
+ layout: {
77
+ contentWidth: "inherit",
78
+ sectionPaddingX: "inherit",
79
+ sectionPaddingY: "md"
80
+ },
81
+ media: {
82
+ cornerStyle: "rounded",
83
+ fit: "cover",
84
+ height: null,
85
+ position: "center",
86
+ positionX: null,
87
+ positionY: null
88
+ },
89
+ typography: {
90
+ bodyAlign: "left",
91
+ headingAlign: "left",
92
+ letterSpacingPreset: "normal",
93
+ lineHeightPreset: "normal",
94
+ maxTextWidth: "auto"
95
+ },
96
+ version: 2
97
+ };
98
+ var defaultBuilderItemSettingsV2 = {
99
+ layout: {
100
+ contentWidth: "inherit",
101
+ sectionPaddingX: "inherit",
102
+ sectionPaddingY: "md"
103
+ },
104
+ media: {
105
+ cornerStyle: "rounded",
106
+ fit: "cover",
107
+ height: null,
108
+ position: "center",
109
+ positionX: null,
110
+ positionY: null
111
+ },
112
+ typography: {
113
+ bodyAlign: "left",
114
+ headingAlign: "left",
115
+ letterSpacingPreset: "normal",
116
+ lineHeightPreset: "normal",
117
+ maxTextWidth: "auto"
118
+ },
119
+ version: 2
120
+ };
121
+ var defaultBuilderThemeTokens = {
122
+ colors: {
123
+ accent: "#0d4a37",
124
+ bodyText: "#13211c",
125
+ headingText: "#13211c",
126
+ surface: "#ffffff"
127
+ },
128
+ radii: {
129
+ card: 16,
130
+ panel: 14
131
+ },
132
+ spacing: {
133
+ sectionGap: "md",
134
+ sectionPadding: "md"
135
+ },
136
+ typography: {
137
+ bodySize: "md",
138
+ headingSize: "md"
139
+ }
140
+ };
141
+
142
+ // src/studio-pages/builder/adapters/settingsV2.ts
143
+ var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
144
+ var parsePercent = (value) => {
145
+ if (typeof value === "number" && Number.isFinite(value)) {
146
+ return Math.max(0, Math.min(100, value));
147
+ }
148
+ if (typeof value === "string" && value.trim().length > 0) {
149
+ const parsed = Number(value);
150
+ if (Number.isFinite(parsed)) {
151
+ return Math.max(0, Math.min(100, parsed));
152
+ }
153
+ }
154
+ return null;
155
+ };
156
+ var parsePixel = (value) => {
157
+ if (typeof value === "number" && Number.isFinite(value)) {
158
+ return value;
159
+ }
160
+ if (typeof value === "string" && value.trim().length > 0) {
161
+ const parsed = Number(value);
162
+ if (Number.isFinite(parsed)) {
163
+ return parsed;
164
+ }
165
+ }
166
+ return null;
167
+ };
168
+ var mergeSettings = (defaults, input) => {
169
+ if (!isRecord(input)) {
170
+ return structuredClone(defaults);
171
+ }
172
+ const next = structuredClone(defaults);
173
+ for (const [key, value] of Object.entries(input)) {
174
+ if (isRecord(value) && isRecord(next[key])) {
175
+ next[key] = mergeSettings(next[key], value);
176
+ continue;
177
+ }
178
+ if (typeof value !== "undefined") {
179
+ next[key] = value;
180
+ }
181
+ }
182
+ return next;
183
+ };
184
+ var legacyBlockToV2Settings = (block) => {
185
+ const current = mergeSettings(defaultBuilderBlockSettingsV2, block.settings);
186
+ current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
187
+ current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
188
+ current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
189
+ current.appearance.sectionBackgroundMode = block.sectionBackgroundMode === "none" || block.sectionBackgroundMode === "color" || block.sectionBackgroundMode === "gradient" ? block.sectionBackgroundMode : current.appearance.sectionBackgroundMode;
190
+ current.appearance.sectionBackgroundColor = typeof block.sectionBackgroundColor === "string" ? block.sectionBackgroundColor : current.appearance.sectionBackgroundColor;
191
+ current.appearance.sectionGradientPreset = typeof block.sectionGradientPreset === "string" ? block.sectionGradientPreset : current.appearance.sectionGradientPreset;
192
+ current.appearance.sectionGradientFrom = typeof block.sectionGradientFrom === "string" ? block.sectionGradientFrom : current.appearance.sectionGradientFrom;
193
+ current.appearance.sectionGradientTo = typeof block.sectionGradientTo === "string" ? block.sectionGradientTo : current.appearance.sectionGradientTo;
194
+ current.appearance.sectionGradientAngle = typeof block.sectionGradientAngle === "string" ? block.sectionGradientAngle : current.appearance.sectionGradientAngle;
195
+ current.appearance.contentBackgroundMode = block.contentBackgroundMode === "none" || block.contentBackgroundMode === "color" || block.contentBackgroundMode === "gradient" ? block.contentBackgroundMode : current.appearance.contentBackgroundMode;
196
+ current.appearance.contentBackgroundColor = typeof block.contentBackgroundColor === "string" ? block.contentBackgroundColor : current.appearance.contentBackgroundColor;
197
+ current.appearance.contentGradientPreset = typeof block.contentGradientPreset === "string" ? block.contentGradientPreset : current.appearance.contentGradientPreset;
198
+ current.appearance.contentGradientFrom = typeof block.contentGradientFrom === "string" ? block.contentGradientFrom : current.appearance.contentGradientFrom;
199
+ current.appearance.contentGradientTo = typeof block.contentGradientTo === "string" ? block.contentGradientTo : current.appearance.contentGradientTo;
200
+ current.appearance.contentGradientAngle = typeof block.contentGradientAngle === "string" ? block.contentGradientAngle : current.appearance.contentGradientAngle;
201
+ if (block.backgroundImageFit === "cover" || block.backgroundImageFit === "contain") {
202
+ current.media.fit = block.backgroundImageFit;
203
+ }
204
+ if (block.imageFit === "cover" || block.imageFit === "contain") {
205
+ current.media.fit = block.imageFit;
206
+ }
207
+ if (block.backgroundImageCornerStyle === "rounded" || block.backgroundImageCornerStyle === "square") {
208
+ current.media.cornerStyle = block.backgroundImageCornerStyle;
209
+ }
210
+ if (block.imageCornerStyle === "rounded" || block.imageCornerStyle === "square") {
211
+ current.media.cornerStyle = block.imageCornerStyle;
212
+ }
213
+ if (block.backgroundImagePosition === "top" || block.backgroundImagePosition === "bottom" || block.backgroundImagePosition === "left" || block.backgroundImagePosition === "right" || block.backgroundImagePosition === "center") {
214
+ current.media.position = block.backgroundImagePosition;
215
+ }
216
+ if (block.imagePosition === "top" || block.imagePosition === "bottom" || block.imagePosition === "left" || block.imagePosition === "right" || block.imagePosition === "center") {
217
+ current.media.position = block.imagePosition;
218
+ }
219
+ current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
220
+ current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
221
+ current.media.height = parsePixel(block.imageHeight);
222
+ current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
223
+ current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
224
+ current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
225
+ current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
226
+ current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
227
+ current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
228
+ current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
229
+ current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
230
+ return current;
231
+ };
232
+ var v2SettingsToLegacyBlock = (blockWithSettings) => {
233
+ const settings = legacyBlockToV2Settings(blockWithSettings);
234
+ const next = {
235
+ ...blockWithSettings,
236
+ settings
237
+ };
238
+ next.contentWidth = settings.layout.contentWidth;
239
+ next.sectionPaddingX = settings.layout.sectionPaddingX;
240
+ next.sectionPaddingY = settings.layout.sectionPaddingY;
241
+ next.sectionBackgroundMode = settings.appearance.sectionBackgroundMode;
242
+ next.sectionBackgroundColor = settings.appearance.sectionBackgroundColor;
243
+ next.sectionGradientPreset = settings.appearance.sectionGradientPreset;
244
+ next.sectionGradientFrom = settings.appearance.sectionGradientFrom;
245
+ next.sectionGradientTo = settings.appearance.sectionGradientTo;
246
+ next.sectionGradientAngle = settings.appearance.sectionGradientAngle;
247
+ next.contentBackgroundMode = settings.appearance.contentBackgroundMode;
248
+ next.contentBackgroundColor = settings.appearance.contentBackgroundColor;
249
+ next.contentGradientPreset = settings.appearance.contentGradientPreset;
250
+ next.contentGradientFrom = settings.appearance.contentGradientFrom;
251
+ next.contentGradientTo = settings.appearance.contentGradientTo;
252
+ next.contentGradientAngle = settings.appearance.contentGradientAngle;
253
+ next.textHeadingAlign = settings.typography.headingAlign;
254
+ next.textBodyAlign = settings.typography.bodyAlign;
255
+ next.textMaxWidth = settings.typography.maxTextWidth;
256
+ next.textLineHeightPreset = settings.typography.lineHeightPreset;
257
+ next.textLetterSpacingPreset = settings.typography.letterSpacingPreset;
258
+ next.editCopyInPanel = settings.advanced.editCopyInPanel;
259
+ next.customClassName = settings.advanced.customClassName;
260
+ next.hideOnMobile = settings.advanced.hideOnMobile;
261
+ if (next.blockType === "hero") {
262
+ next.backgroundImageFit = settings.media.fit;
263
+ next.backgroundImageCornerStyle = settings.media.cornerStyle;
264
+ next.backgroundImagePosition = settings.media.position;
265
+ next.backgroundImagePositionX = settings.media.positionX;
266
+ next.backgroundImagePositionY = settings.media.positionY;
267
+ } else {
268
+ next.imageFit = settings.media.fit;
269
+ next.imageCornerStyle = settings.media.cornerStyle;
270
+ next.imagePosition = settings.media.position;
271
+ next.imagePositionX = settings.media.positionX;
272
+ next.imagePositionY = settings.media.positionY;
273
+ next.imageHeight = settings.media.height;
274
+ }
275
+ if (Array.isArray(next.items)) {
276
+ next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
277
+ }
278
+ return next;
279
+ };
280
+ var legacyItemToV2Settings = (item) => {
281
+ const current = mergeSettings(defaultBuilderItemSettingsV2, item.settings);
282
+ if (item.imageFit === "cover" || item.imageFit === "contain") {
283
+ current.media.fit = item.imageFit;
284
+ }
285
+ if (item.imageCornerStyle === "rounded" || item.imageCornerStyle === "square") {
286
+ current.media.cornerStyle = item.imageCornerStyle;
287
+ }
288
+ if (item.imagePosition === "top" || item.imagePosition === "bottom" || item.imagePosition === "left" || item.imagePosition === "right" || item.imagePosition === "center") {
289
+ current.media.position = item.imagePosition;
290
+ }
291
+ current.media.positionX = parsePercent(item.imagePositionX);
292
+ current.media.positionY = parsePercent(item.imagePositionY);
293
+ current.media.height = parsePixel(item.imageHeight);
294
+ return current;
295
+ };
296
+ var v2SettingsToLegacyItem = (itemWithSettings) => {
297
+ const settings = legacyItemToV2Settings(itemWithSettings);
298
+ return {
299
+ ...itemWithSettings,
300
+ imageCornerStyle: settings.media.cornerStyle,
301
+ imageFit: settings.media.fit,
302
+ imageHeight: settings.media.height,
303
+ imagePosition: settings.media.position,
304
+ imagePositionX: settings.media.positionX,
305
+ imagePositionY: settings.media.positionY,
306
+ settings
307
+ };
308
+ };
309
+ var migrateBlockToSettingsV2 = (block) => {
310
+ const withLegacyMirrors = v2SettingsToLegacyBlock(block);
311
+ if (!Array.isArray(withLegacyMirrors.items)) {
312
+ return withLegacyMirrors;
313
+ }
314
+ return {
315
+ ...withLegacyMirrors,
316
+ items: withLegacyMirrors.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem)
317
+ };
318
+ };
319
+
320
+ // src/studio-pages/builder/settings-v2/themeTokens.ts
321
+ var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
322
+ var merge = (base, next) => {
323
+ if (!next || !isRecord2(next)) {
324
+ return base;
325
+ }
326
+ const merged = { ...base };
327
+ for (const [key, value] of Object.entries(next)) {
328
+ if (isRecord2(value) && isRecord2(merged[key])) {
329
+ merged[key] = merge(merged[key], value);
330
+ continue;
331
+ }
332
+ if (typeof value !== "undefined") {
333
+ merged[key] = value;
334
+ }
335
+ }
336
+ return merged;
337
+ };
338
+ var resolveBuilderThemeTokens = (layers) => {
339
+ const withSite = merge(defaultBuilderThemeTokens, layers.site);
340
+ const withPage = merge(withSite, layers.page);
341
+ return merge(withPage, layers.block);
342
+ };
343
+
344
+ // src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
345
+ var import_react = require("react");
346
+
347
+ // src/studio-pages/builder/ui/Accordion.tsx
348
+ var import_jsx_runtime = require("react/jsx-runtime");
349
+
350
+ // src/studio-pages/builder/ui/ImageControls.tsx
351
+ var import_jsx_runtime2 = require("react/jsx-runtime");
352
+
353
+ // src/studio-pages/builder/settings-v2/inspectorSchema.ts
354
+ var alignOptions = [
355
+ { label: "Left", value: "left" },
356
+ { label: "Center", value: "center" },
357
+ { label: "Right", value: "right" },
358
+ { label: "Justify", value: "justify" }
359
+ ];
360
+ var layoutFieldSet = [
361
+ {
362
+ group: "layout",
363
+ key: "settings.layout.contentWidth",
364
+ label: "Content Width",
365
+ options: [
366
+ { label: "Inherit Page Default", value: "inherit" },
367
+ { label: "Narrow", value: "narrow" },
368
+ { label: "Content", value: "content" },
369
+ { label: "Wide", value: "wide" },
370
+ { label: "Full", value: "full" }
371
+ ],
372
+ tags: ["width", "container"],
373
+ type: "select"
374
+ },
375
+ {
376
+ group: "layout",
377
+ key: "settings.layout.sectionPaddingY",
378
+ label: "Section Vertical Spacing",
379
+ options: [
380
+ { label: "None", value: "none" },
381
+ { label: "Small", value: "sm" },
382
+ { label: "Medium", value: "md" },
383
+ { label: "Large", value: "lg" }
384
+ ],
385
+ tags: ["spacing", "padding"],
386
+ type: "select"
387
+ },
388
+ {
389
+ group: "layout",
390
+ key: "settings.layout.sectionPaddingX",
391
+ label: "Section Horizontal Spacing",
392
+ options: [
393
+ { label: "Inherit", value: "inherit" },
394
+ { label: "None", value: "none" },
395
+ { label: "Small", value: "sm" },
396
+ { label: "Medium", value: "md" },
397
+ { label: "Large", value: "lg" }
398
+ ],
399
+ tags: ["spacing", "padding"],
400
+ type: "select"
401
+ }
402
+ ];
403
+ var typographyFieldSet = [
404
+ {
405
+ group: "typography",
406
+ key: "settings.typography.headingAlign",
407
+ label: "Heading Alignment",
408
+ options: alignOptions,
409
+ tags: ["text", "align", "heading"],
410
+ type: "select"
411
+ },
412
+ {
413
+ group: "typography",
414
+ key: "settings.typography.bodyAlign",
415
+ label: "Body Alignment",
416
+ options: alignOptions,
417
+ tags: ["text", "align", "paragraph"],
418
+ type: "select"
419
+ },
420
+ {
421
+ group: "typography",
422
+ key: "settings.typography.maxTextWidth",
423
+ label: "Text Width",
424
+ options: [
425
+ { label: "Auto", value: "auto" },
426
+ { label: "Small", value: "sm" },
427
+ { label: "Medium", value: "md" },
428
+ { label: "Large", value: "lg" },
429
+ { label: "Full", value: "full" }
430
+ ],
431
+ tags: ["readability", "measure", "line length"],
432
+ type: "select"
433
+ },
434
+ {
435
+ advanced: true,
436
+ group: "typography",
437
+ key: "settings.typography.lineHeightPreset",
438
+ label: "Line Height",
439
+ options: [
440
+ { label: "Tight", value: "tight" },
441
+ { label: "Normal", value: "normal" },
442
+ { label: "Relaxed", value: "relaxed" }
443
+ ],
444
+ type: "select"
445
+ },
446
+ {
447
+ advanced: true,
448
+ group: "typography",
449
+ key: "settings.typography.letterSpacingPreset",
450
+ label: "Letter Spacing",
451
+ options: [
452
+ { label: "Tight", value: "tight" },
453
+ { label: "Normal", value: "normal" },
454
+ { label: "Relaxed", value: "relaxed" }
455
+ ],
456
+ type: "select"
457
+ }
458
+ ];
459
+ var styleFieldSet = [
460
+ {
461
+ group: "style",
462
+ key: "settings.appearance.sectionBackgroundMode",
463
+ label: "Section Background",
464
+ options: [
465
+ { label: "None", value: "none" },
466
+ { label: "Color", value: "color" },
467
+ { label: "Gradient", value: "gradient" }
468
+ ],
469
+ tags: ["background", "section"],
470
+ type: "select"
471
+ },
472
+ {
473
+ group: "style",
474
+ key: "settings.appearance.sectionBackgroundColor",
475
+ label: "Section Background Color",
476
+ type: "color"
477
+ },
478
+ {
479
+ group: "style",
480
+ key: "settings.appearance.contentBackgroundMode",
481
+ label: "Content Background",
482
+ options: [
483
+ { label: "None", value: "none" },
484
+ { label: "Color", value: "color" },
485
+ { label: "Gradient", value: "gradient" }
486
+ ],
487
+ tags: ["background", "content"],
488
+ type: "select"
489
+ },
490
+ {
491
+ group: "style",
492
+ key: "settings.appearance.contentBackgroundColor",
493
+ label: "Content Background Color",
494
+ type: "color"
495
+ }
496
+ ];
497
+ var commonAdvanced = [
498
+ {
499
+ group: "advanced",
500
+ inlineEditable: false,
501
+ key: "settings.advanced.editCopyInPanel",
502
+ label: "Edit Copy In Panel",
503
+ tags: ["inline", "copy", "text"],
504
+ type: "checkbox"
505
+ },
506
+ {
507
+ advanced: true,
508
+ group: "advanced",
509
+ key: "settings.advanced.hideOnMobile",
510
+ label: "Hide On Mobile",
511
+ type: "checkbox"
512
+ },
513
+ {
514
+ advanced: true,
515
+ group: "advanced",
516
+ key: "settings.advanced.customClassName",
517
+ label: "Custom Class Name",
518
+ type: "text"
519
+ }
520
+ ];
521
+ var mediaFieldSet = [
522
+ {
523
+ group: "media",
524
+ key: "settings.media.fit",
525
+ label: "Image Fit",
526
+ options: [
527
+ { label: "Cover", value: "cover" },
528
+ { label: "Contain", value: "contain" }
529
+ ],
530
+ tags: ["image", "media"],
531
+ type: "select"
532
+ },
533
+ {
534
+ group: "media",
535
+ key: "settings.media.cornerStyle",
536
+ label: "Image Corners",
537
+ options: [
538
+ { label: "Rounded", value: "rounded" },
539
+ { label: "Square", value: "square" }
540
+ ],
541
+ tags: ["image", "radius", "corners"],
542
+ type: "select"
543
+ },
544
+ {
545
+ group: "media",
546
+ key: "settings.media.position",
547
+ label: "Image Position",
548
+ options: [
549
+ { label: "Center", value: "center" },
550
+ { label: "Top", value: "top" },
551
+ { label: "Bottom", value: "bottom" },
552
+ { label: "Left", value: "left" },
553
+ { label: "Right", value: "right" }
554
+ ],
555
+ type: "select"
556
+ }
557
+ ];
558
+ var inspectorDefinitionByBlockType = {
559
+ beforeAfter: {
560
+ blockType: "beforeAfter",
561
+ fields: [
562
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
563
+ { group: "basics", inlineEditable: true, key: "subtitle", label: "Subtitle", type: "textarea" },
564
+ { group: "basics", key: "itemsPerRow", label: "Items Per Row", max: 4, min: 1, type: "number" },
565
+ ...layoutFieldSet,
566
+ ...typographyFieldSet,
567
+ ...styleFieldSet,
568
+ ...commonAdvanced
569
+ ]
570
+ },
571
+ bookingEmbed: {
572
+ blockType: "bookingEmbed",
573
+ fields: [
574
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
575
+ { group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
576
+ { group: "basics", inlineEditable: false, key: "buttonLabel", label: "Button Label", type: "text" },
577
+ { group: "basics", inlineEditable: false, key: "buttonHref", label: "Button URL", type: "text" },
578
+ ...layoutFieldSet,
579
+ ...typographyFieldSet,
580
+ ...styleFieldSet,
581
+ ...commonAdvanced
582
+ ]
583
+ },
584
+ cta: {
585
+ blockType: "cta",
586
+ fields: [
587
+ { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
588
+ { group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
589
+ { group: "basics", inlineEditable: false, key: "buttonLabel", label: "Button Label", type: "text" },
590
+ { group: "basics", inlineEditable: false, key: "buttonHref", label: "Button URL", type: "text" },
591
+ {
592
+ group: "basics",
593
+ key: "style",
594
+ label: "Variant",
595
+ options: [
596
+ { label: "Light", value: "light" },
597
+ { label: "Dark", value: "dark" }
598
+ ],
599
+ type: "select"
600
+ },
601
+ ...layoutFieldSet,
602
+ ...typographyFieldSet,
603
+ ...styleFieldSet,
604
+ ...commonAdvanced
605
+ ]
606
+ },
607
+ faq: {
608
+ blockType: "faq",
609
+ fields: [
610
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
611
+ ...layoutFieldSet,
612
+ ...typographyFieldSet,
613
+ ...styleFieldSet,
614
+ ...commonAdvanced
615
+ ]
616
+ },
617
+ featureGrid: {
618
+ blockType: "featureGrid",
619
+ fields: [
620
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
621
+ {
622
+ group: "basics",
623
+ key: "variant",
624
+ label: "Variant",
625
+ options: [
626
+ { label: "Cards", value: "cards" },
627
+ { label: "Highlight", value: "highlight" }
628
+ ],
629
+ type: "select"
630
+ },
631
+ { group: "basics", key: "itemsPerRow", label: "Items Per Row", max: 6, min: 1, type: "number" },
632
+ ...layoutFieldSet,
633
+ ...typographyFieldSet,
634
+ ...mediaFieldSet,
635
+ ...styleFieldSet,
636
+ ...commonAdvanced
637
+ ]
638
+ },
639
+ formEmbed: {
640
+ blockType: "formEmbed",
641
+ fields: [
642
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
643
+ { group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
644
+ {
645
+ group: "basics",
646
+ key: "formType",
647
+ label: "Form Type",
648
+ options: [{ label: "Quote", value: "quote" }],
649
+ type: "select"
650
+ },
651
+ ...layoutFieldSet,
652
+ ...typographyFieldSet,
653
+ ...styleFieldSet,
654
+ ...commonAdvanced
655
+ ]
656
+ },
657
+ hero: {
658
+ blockType: "hero",
659
+ fields: [
660
+ { group: "basics", inlineEditable: true, key: "kicker", label: "Kicker", type: "text" },
661
+ { group: "basics", inlineEditable: true, key: "headline", label: "Headline", type: "text" },
662
+ { group: "basics", inlineEditable: true, key: "subheadline", label: "Subheadline", type: "textarea" },
663
+ {
664
+ group: "basics",
665
+ key: "variant",
666
+ label: "Variant",
667
+ options: [
668
+ { label: "Default", value: "default" },
669
+ { label: "Centered", value: "centered" }
670
+ ],
671
+ type: "select"
672
+ },
673
+ {
674
+ group: "layout",
675
+ key: "heroHeight",
676
+ label: "Hero Height",
677
+ options: [
678
+ { label: "Small", value: "sm" },
679
+ { label: "Medium (Half Screen)", value: "md" },
680
+ { label: "Full Screen", value: "full" }
681
+ ],
682
+ type: "select"
683
+ },
684
+ ...layoutFieldSet,
685
+ ...typographyFieldSet,
686
+ ...mediaFieldSet,
687
+ ...styleFieldSet,
688
+ ...commonAdvanced
689
+ ]
690
+ },
691
+ logoWall: {
692
+ blockType: "logoWall",
693
+ fields: [
694
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
695
+ { group: "basics", inlineEditable: true, key: "subtitle", label: "Subtitle", type: "textarea" },
696
+ ...layoutFieldSet,
697
+ ...typographyFieldSet,
698
+ ...mediaFieldSet,
699
+ ...styleFieldSet,
700
+ ...commonAdvanced
701
+ ]
702
+ },
703
+ media: {
704
+ blockType: "media",
705
+ fields: [
706
+ { group: "basics", inlineEditable: true, key: "caption", label: "Caption", type: "text" },
707
+ {
708
+ group: "basics",
709
+ key: "size",
710
+ label: "Size",
711
+ options: [
712
+ { label: "Default", value: "default" },
713
+ { label: "Wide", value: "wide" }
714
+ ],
715
+ type: "select"
716
+ },
717
+ ...layoutFieldSet,
718
+ ...typographyFieldSet,
719
+ ...mediaFieldSet,
720
+ ...styleFieldSet,
721
+ ...commonAdvanced
722
+ ]
723
+ },
724
+ richText: {
725
+ blockType: "richText",
726
+ fields: [
727
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
728
+ {
729
+ group: "basics",
730
+ key: "width",
731
+ label: "Rich Text Width",
732
+ options: [
733
+ { label: "Normal", value: "normal" },
734
+ { label: "Narrow", value: "narrow" }
735
+ ],
736
+ type: "select"
737
+ },
738
+ ...layoutFieldSet,
739
+ ...typographyFieldSet,
740
+ ...styleFieldSet,
741
+ ...commonAdvanced
742
+ ]
743
+ },
744
+ stats: {
745
+ blockType: "stats",
746
+ fields: [
747
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
748
+ { group: "basics", inlineEditable: true, key: "subtitle", label: "Subtitle", type: "textarea" },
749
+ ...layoutFieldSet,
750
+ ...typographyFieldSet,
751
+ ...styleFieldSet,
752
+ ...commonAdvanced
753
+ ]
754
+ },
755
+ testimonials: {
756
+ blockType: "testimonials",
757
+ fields: [
758
+ { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
759
+ { group: "basics", key: "visibleCount", label: "Visible At Once", max: 6, min: 1, type: "number" },
760
+ { group: "basics", key: "autoRotate", label: "Auto Rotate", type: "checkbox" },
761
+ {
762
+ advanced: true,
763
+ group: "advanced",
764
+ key: "rotateIntervalSeconds",
765
+ label: "Rotate Interval Seconds",
766
+ max: 30,
767
+ min: 2,
768
+ type: "number"
769
+ },
770
+ ...layoutFieldSet,
771
+ ...typographyFieldSet,
772
+ ...styleFieldSet,
773
+ ...commonAdvanced
774
+ ]
775
+ }
776
+ };
777
+
778
+ // src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
779
+ var import_jsx_runtime3 = require("react/jsx-runtime");
780
+
52
781
  // src/studio-pages/index.ts
53
782
  var withSectionStyleDefaults = (value) => ({
54
783
  ...sectionStyleDefaults,
@@ -63,9 +792,13 @@ var defaultNodeData = {
63
792
  title: "Book a Time"
64
793
  },
65
794
  beforeAfter: withSectionStyleDefaults({
795
+ itemsPerRow: 2,
66
796
  items: [
67
797
  {
68
798
  description: "Before and after result summary.",
799
+ imageCornerStyle: "rounded",
800
+ imageFit: "cover",
801
+ imagePosition: "center",
69
802
  label: "Project One"
70
803
  }
71
804
  ],
@@ -88,10 +821,11 @@ var defaultNodeData = {
88
821
  },
89
822
  featureGrid: {
90
823
  ...withSectionStyleDefaults({}),
824
+ itemsPerRow: 3,
91
825
  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" }
826
+ { description: "Explain this point.", iconType: "badge", icon: "01", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature One" },
827
+ { description: "Explain this point.", iconType: "badge", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
828
+ { description: "Explain this point.", iconType: "badge", icon: "03", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Three" }
95
829
  ],
96
830
  title: "Section Title",
97
831
  variant: "cards"
@@ -104,7 +838,22 @@ var defaultNodeData = {
104
838
  },
105
839
  hero: {
106
840
  ...withSectionStyleDefaults({}),
107
- backgroundColor: "#124a37",
841
+ backgroundColor: "",
842
+ backgroundOverlayMode: "none",
843
+ backgroundOverlayOpacity: 45,
844
+ backgroundOverlayColor: "#000000",
845
+ backgroundOverlayGradientFrom: "#0d4a37",
846
+ backgroundOverlayGradientTo: "#1f684f",
847
+ backgroundOverlayGradientAngle: "135",
848
+ backgroundOverlayGradientFromStrength: 100,
849
+ backgroundOverlayGradientToStrength: 100,
850
+ backgroundOverlayGradientStart: 0,
851
+ backgroundOverlayGradientEnd: 100,
852
+ backgroundOverlayGradientFeather: 100,
853
+ backgroundImageCornerStyle: "rounded",
854
+ backgroundImageFit: "cover",
855
+ backgroundImagePosition: "center",
856
+ heroHeight: "sm",
108
857
  headline: "New Hero Section",
109
858
  kicker: "Optional kicker",
110
859
  primaryHref: "/contact",
@@ -117,13 +866,16 @@ var defaultNodeData = {
117
866
  media: {
118
867
  ...withSectionStyleDefaults({}),
119
868
  caption: "Add a caption",
869
+ imageCornerStyle: "rounded",
870
+ imageFit: "cover",
871
+ imagePosition: "center",
120
872
  size: "default"
121
873
  },
122
874
  logoWall: withSectionStyleDefaults({
123
875
  items: [
124
- { name: "Trusted Partner 1" },
125
- { name: "Trusted Partner 2" },
126
- { name: "Trusted Partner 3" }
876
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 1" },
877
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
878
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
127
879
  ],
128
880
  subtitle: "Trusted by teams and homeowners across Central Texas.",
129
881
  title: "Trusted by Local Organizations"
@@ -164,8 +916,11 @@ var defaultNodeData = {
164
916
  },
165
917
  testimonials: {
166
918
  ...withSectionStyleDefaults({}),
167
- items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here." }],
168
- title: "What Customers Say"
919
+ autoRotate: true,
920
+ items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here.", rating: 5 }],
921
+ rotateIntervalSeconds: 7,
922
+ title: "What Customers Say",
923
+ visibleCount: 3
169
924
  },
170
925
  stats: withSectionStyleDefaults({
171
926
  items: [
@@ -195,7 +950,11 @@ var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
195
950
  type,
196
951
  displayName: nodeTypeLabels[type] || type,
197
952
  description: `Page node for ${nodeTypeLabels[type] || type}`,
198
- getDefaultData: () => structuredClone(defaultNodeData[type])
953
+ getDefaultData: () => {
954
+ const migrated = migrateBlockToSettingsV2(structuredClone(defaultNodeData[type]));
955
+ const { blockType: _ignoredBlockType, ...data } = migrated;
956
+ return data;
957
+ }
199
958
  }));
200
959
  var validatePageDocument = (document) => {
201
960
  const issues = [];
@@ -251,13 +1010,14 @@ var pageInspectorPanels = Object.keys(defaultNodeData).map((nodeType) => ({
251
1010
  id: `${nodeType}-panel`,
252
1011
  label: `${nodeTypeLabels[nodeType] || nodeType} Settings`,
253
1012
  nodeType,
254
- fields: [
255
- {
256
- key: "title",
257
- label: "Title",
258
- type: "text"
259
- }
260
- ]
1013
+ fields: inspectorDefinitionByBlockType[nodeType]?.fields.map((field) => ({
1014
+ advanced: field.advanced,
1015
+ group: field.group,
1016
+ inlineEditable: field.inlineEditable,
1017
+ key: field.key,
1018
+ label: field.label,
1019
+ type: field.type
1020
+ })) || []
261
1021
  }));
262
1022
  var pageStudioModuleManifest = {
263
1023
  id: "studio-pages",
@@ -269,11 +1029,16 @@ var pageStudioModuleManifest = {
269
1029
  validators: [validatePageDocument],
270
1030
  migrations: [],
271
1031
  compiler: {
272
- compileNode: (node) => ({
273
- id: node.id,
274
- blockType: node.type,
275
- ...node.data
276
- })
1032
+ compileNode: (node) => {
1033
+ const normalized = migrateBlockToSettingsV2({
1034
+ blockType: node.type,
1035
+ ...node.data
1036
+ });
1037
+ return {
1038
+ id: node.id,
1039
+ ...normalized
1040
+ };
1041
+ }
277
1042
  },
278
1043
  permissions: [
279
1044
  { action: "read", role: "admin" },
@@ -293,9 +1058,10 @@ var ensureNodeID = (inputID, index) => {
293
1058
  return `node-${index + 1}`;
294
1059
  };
295
1060
  var layoutToStudioDocument = (layout, title, metadata) => {
296
- const nodes = layout.filter((block) => typeof block.blockType === "string").map((block, index) => {
1061
+ const nodes = layout.filter((block) => typeof block.blockType === "string").map((rawBlock, index) => {
1062
+ const block = migrateBlockToSettingsV2(rawBlock);
297
1063
  const blockType = String(block.blockType);
298
- const { id, blockType: _, ...data } = block;
1064
+ const { id, blockType: _ignoredBlockType, ...data } = block;
299
1065
  return {
300
1066
  id: ensureNodeID(id, index),
301
1067
  type: blockType,
@@ -310,11 +1076,13 @@ var layoutToStudioDocument = (layout, title, metadata) => {
310
1076
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
311
1077
  };
312
1078
  };
313
- var studioDocumentToLayout = (document) => document.nodes.map((node) => ({
314
- id: node.id,
315
- blockType: node.type,
316
- ...node.data
317
- }));
1079
+ var studioDocumentToLayout = (document) => document.nodes.map(
1080
+ (node) => migrateBlockToSettingsV2({
1081
+ id: node.id,
1082
+ blockType: node.type,
1083
+ ...node.data
1084
+ })
1085
+ );
318
1086
  var createDefaultStudioDocument = (title) => ({
319
1087
  metadata: {},
320
1088
  schemaVersion: 1,
@@ -325,10 +1093,12 @@ var createDefaultStudioDocument = (title) => ({
325
1093
  // Annotate the CommonJS export names for ESM import in node:
326
1094
  0 && (module.exports = {
327
1095
  createDefaultStudioDocument,
1096
+ defaultBuilderThemeTokens,
328
1097
  layoutToStudioDocument,
329
1098
  pageInspectorPanels,
330
1099
  pageNodeTypes,
331
1100
  pagePaletteGroups,
332
1101
  pageStudioModuleManifest,
1102
+ resolveBuilderThemeTokens,
333
1103
  studioDocumentToLayout
334
1104
  });