@orion-studios/payload-studio 0.5.0-beta.98 → 0.6.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +58 -68
  2. package/dist/admin/client.d.mts +5 -0
  3. package/dist/admin/client.d.ts +5 -0
  4. package/dist/admin/client.js +4491 -736
  5. package/dist/admin/client.mjs +3367 -752
  6. package/dist/admin/index.d.mts +2 -1
  7. package/dist/admin/index.d.ts +2 -1
  8. package/dist/admin/index.js +498 -53
  9. package/dist/admin/index.mjs +2 -1
  10. package/dist/admin-app/client.d.mts +1 -0
  11. package/dist/admin-app/client.d.ts +1 -0
  12. package/dist/admin-app/client.js +285 -109
  13. package/dist/admin-app/client.mjs +59 -871
  14. package/dist/admin-app/index.d.mts +2 -1
  15. package/dist/admin-app/index.d.ts +2 -1
  16. package/dist/admin-app/index.mjs +5 -3
  17. package/dist/admin-app/styles.css +1708 -56
  18. package/dist/admin.css +158 -35
  19. package/dist/blocks/index.js +415 -200
  20. package/dist/blocks/index.mjs +2 -2
  21. package/dist/{chunk-XK3K5GRP.mjs → chunk-JQAHXYAM.mjs} +271 -67
  22. package/dist/chunk-KPIX7OSV.mjs +1051 -0
  23. package/dist/chunk-OQSEJXC4.mjs +166 -0
  24. package/dist/{chunk-XHWQJUX5.mjs → chunk-OTHERBGX.mjs} +3 -3
  25. package/dist/chunk-PF3EBZXF.mjs +326 -0
  26. package/dist/chunk-Q2HGC67S.mjs +904 -0
  27. package/dist/{chunk-XVH5SCBD.mjs → chunk-RKTIFEUY.mjs} +4 -19
  28. package/dist/chunk-W2UOCJDX.mjs +32 -0
  29. package/dist/{chunk-C4J35SPJ.mjs → chunk-XKUTZ7IU.mjs} +257 -452
  30. package/dist/{index-ZbOx4OCF.d.ts → index-52HdVLQq.d.ts} +12 -22
  31. package/dist/index-BMitiKK8.d.ts +435 -0
  32. package/dist/index-Crx_MtPw.d.ts +223 -0
  33. package/dist/index-Cv-6qnrw.d.mts +223 -0
  34. package/dist/{index-ZbOx4OCF.d.mts → index-DEQC3Dwj.d.mts} +12 -22
  35. package/dist/{index-BIwu3qIH.d.mts → index-DWmudwDm.d.mts} +2 -1
  36. package/dist/{index-BIwu3qIH.d.ts → index-DWmudwDm.d.ts} +2 -1
  37. package/dist/index-D_b24Gef.d.mts +435 -0
  38. package/dist/index.d.mts +5 -4
  39. package/dist/index.d.ts +5 -4
  40. package/dist/index.js +1968 -1198
  41. package/dist/index.mjs +10 -8
  42. package/dist/nextjs/index.js +5 -684
  43. package/dist/nextjs/index.mjs +2 -3
  44. package/dist/sitePreviewTypes-BkHCWxNW.d.mts +58 -0
  45. package/dist/sitePreviewTypes-BkHCWxNW.d.ts +58 -0
  46. package/dist/studio/index.d.mts +1 -1
  47. package/dist/studio/index.d.ts +1 -1
  48. package/dist/studio-pages/builder.css +125 -83
  49. package/dist/studio-pages/client.d.mts +58 -1
  50. package/dist/studio-pages/client.d.ts +58 -1
  51. package/dist/studio-pages/client.js +450 -241
  52. package/dist/studio-pages/client.mjs +455 -247
  53. package/dist/studio-pages/index.d.mts +3 -2
  54. package/dist/studio-pages/index.d.ts +3 -2
  55. package/dist/studio-pages/index.js +418 -183
  56. package/dist/studio-pages/index.mjs +15 -6
  57. package/package.json +19 -5
  58. package/dist/chunk-2FO2ROW4.mjs +0 -468
  59. package/dist/chunk-SIL2J5MF.mjs +0 -155
  60. package/dist/index-BFXZue5i.d.ts +0 -178
  61. package/dist/index-CoYRBbf6.d.mts +0 -178
  62. package/dist/index-R7hA134j.d.mts +0 -140
  63. package/dist/index-vjrjy0P4.d.ts +0 -140
@@ -1,6 +1,19 @@
1
1
  import {
2
2
  sectionStyleDefaults
3
- } from "./chunk-SIL2J5MF.mjs";
3
+ } from "./chunk-OQSEJXC4.mjs";
4
+ import {
5
+ createDefaultStudioDocument,
6
+ defaultBuilderThemeTokens,
7
+ layoutToStudioDocument,
8
+ migrateBlockToSettingsV2,
9
+ studioDocumentToLayout
10
+ } from "./chunk-PF3EBZXF.mjs";
11
+ import {
12
+ assertStudioDocumentV1,
13
+ compileStudioDocument,
14
+ createEmptyStudioDocument,
15
+ validateStudioDocument
16
+ } from "./chunk-ADIIWIYL.mjs";
4
17
  import {
5
18
  __export
6
19
  } from "./chunk-6BWS3CLP.mjs";
@@ -9,303 +22,28 @@ import {
9
22
  var studio_pages_exports = {};
10
23
  __export(studio_pages_exports, {
11
24
  createDefaultStudioDocument: () => createDefaultStudioDocument,
25
+ createStudioPageService: () => createStudioPageService,
12
26
  defaultBuilderThemeTokens: () => defaultBuilderThemeTokens,
27
+ getStudioDocumentFromPage: () => getStudioDocumentFromPage,
13
28
  layoutToStudioDocument: () => layoutToStudioDocument,
14
29
  pageInspectorPanels: () => pageInspectorPanels,
15
30
  pageNodeTypes: () => pageNodeTypes,
16
31
  pagePaletteGroups: () => pagePaletteGroups,
17
32
  pageStudioModuleManifest: () => pageStudioModuleManifest,
18
33
  resolveBuilderThemeTokens: () => resolveBuilderThemeTokens,
19
- studioDocumentToLayout: () => studioDocumentToLayout
34
+ studioDocumentToLayout: () => studioDocumentToLayout,
35
+ toEditorInitialDoc: () => toEditorInitialDoc
20
36
  });
21
37
 
22
- // src/studio-pages/builder/settings-v2/types.ts
23
- var defaultBuilderBlockSettingsV2 = {
24
- advanced: {
25
- customClassName: "",
26
- editCopyInPanel: false,
27
- hideOnMobile: false
28
- },
29
- appearance: {
30
- contentBackgroundColor: "#ffffff",
31
- contentBackgroundMode: "none",
32
- contentGradientAngle: "135",
33
- contentGradientFrom: "#ffffff",
34
- contentGradientPreset: "none",
35
- contentGradientTo: "#f4f6f2",
36
- sectionBackgroundColor: "#ffffff",
37
- sectionBackgroundMode: "none",
38
- sectionGradientAngle: "135",
39
- sectionGradientFrom: "#124a37",
40
- sectionGradientPreset: "forest",
41
- sectionGradientTo: "#1f684f"
42
- },
43
- layout: {
44
- contentWidth: "inherit",
45
- linkHorizontalPadding: true,
46
- linkVerticalPadding: true,
47
- paddingBottomPt: null,
48
- paddingLeftPt: null,
49
- paddingRightPt: null,
50
- paddingTopPt: null,
51
- sectionPaddingX: "inherit",
52
- sectionPaddingY: "md"
53
- },
54
- media: {
55
- cornerStyle: "rounded",
56
- fit: "cover",
57
- height: null,
58
- position: "center",
59
- positionX: null,
60
- positionY: null
61
- },
62
- typography: {
63
- bodyAlign: "left",
64
- headingAlign: "left",
65
- letterSpacingPreset: "normal",
66
- lineHeightPreset: "normal",
67
- maxTextWidth: "auto"
68
- },
69
- version: 2
70
- };
71
- var defaultBuilderItemSettingsV2 = {
72
- layout: {
73
- contentWidth: "inherit",
74
- linkHorizontalPadding: true,
75
- linkVerticalPadding: true,
76
- paddingBottomPt: null,
77
- paddingLeftPt: null,
78
- paddingRightPt: null,
79
- paddingTopPt: null,
80
- sectionPaddingX: "inherit",
81
- sectionPaddingY: "md"
82
- },
83
- media: {
84
- cornerStyle: "rounded",
85
- fit: "cover",
86
- height: null,
87
- position: "center",
88
- positionX: null,
89
- positionY: null
90
- },
91
- typography: {
92
- bodyAlign: "left",
93
- headingAlign: "left",
94
- letterSpacingPreset: "normal",
95
- lineHeightPreset: "normal",
96
- maxTextWidth: "auto"
97
- },
98
- version: 2
99
- };
100
- var defaultBuilderThemeTokens = {
101
- colors: {
102
- accent: "#0d4a37",
103
- bodyText: "#13211c",
104
- headingText: "#13211c",
105
- surface: "#ffffff"
106
- },
107
- radii: {
108
- card: 16,
109
- panel: 14
110
- },
111
- spacing: {
112
- sectionGap: "md",
113
- sectionPadding: "md"
114
- },
115
- typography: {
116
- bodySize: "md",
117
- headingSize: "md"
118
- }
119
- };
120
-
121
- // src/studio-pages/builder/adapters/settingsV2.ts
122
- var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
123
- var parsePercent = (value) => {
124
- if (typeof value === "number" && Number.isFinite(value)) {
125
- return Math.max(0, Math.min(100, value));
126
- }
127
- if (typeof value === "string" && value.trim().length > 0) {
128
- const parsed = Number(value);
129
- if (Number.isFinite(parsed)) {
130
- return Math.max(0, Math.min(100, parsed));
131
- }
132
- }
133
- return null;
134
- };
135
- var parsePixel = (value) => {
136
- if (typeof value === "number" && Number.isFinite(value)) {
137
- return value;
138
- }
139
- if (typeof value === "string" && value.trim().length > 0) {
140
- const parsed = Number(value);
141
- if (Number.isFinite(parsed)) {
142
- return parsed;
143
- }
144
- }
145
- return null;
146
- };
147
- var mergeSettings = (defaults, input) => {
148
- if (!isRecord(input)) {
149
- return structuredClone(defaults);
150
- }
151
- const next = structuredClone(defaults);
152
- for (const [key, value] of Object.entries(input)) {
153
- if (isRecord(value) && isRecord(next[key])) {
154
- next[key] = mergeSettings(next[key], value);
155
- continue;
156
- }
157
- if (typeof value !== "undefined") {
158
- next[key] = value;
159
- }
160
- }
161
- return next;
162
- };
163
- var legacyBlockToV2Settings = (block) => {
164
- const current = structuredClone(defaultBuilderBlockSettingsV2);
165
- current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
166
- current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
167
- current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
168
- current.appearance.sectionBackgroundMode = block.sectionBackgroundMode === "none" || block.sectionBackgroundMode === "color" || block.sectionBackgroundMode === "gradient" ? block.sectionBackgroundMode : current.appearance.sectionBackgroundMode;
169
- current.appearance.sectionBackgroundColor = typeof block.sectionBackgroundColor === "string" ? block.sectionBackgroundColor : current.appearance.sectionBackgroundColor;
170
- current.appearance.sectionGradientPreset = typeof block.sectionGradientPreset === "string" ? block.sectionGradientPreset : current.appearance.sectionGradientPreset;
171
- current.appearance.sectionGradientFrom = typeof block.sectionGradientFrom === "string" ? block.sectionGradientFrom : current.appearance.sectionGradientFrom;
172
- current.appearance.sectionGradientTo = typeof block.sectionGradientTo === "string" ? block.sectionGradientTo : current.appearance.sectionGradientTo;
173
- current.appearance.sectionGradientAngle = typeof block.sectionGradientAngle === "string" ? block.sectionGradientAngle : current.appearance.sectionGradientAngle;
174
- current.appearance.contentBackgroundMode = block.contentBackgroundMode === "none" || block.contentBackgroundMode === "color" || block.contentBackgroundMode === "gradient" ? block.contentBackgroundMode : current.appearance.contentBackgroundMode;
175
- current.appearance.contentBackgroundColor = typeof block.contentBackgroundColor === "string" ? block.contentBackgroundColor : current.appearance.contentBackgroundColor;
176
- current.appearance.contentGradientPreset = typeof block.contentGradientPreset === "string" ? block.contentGradientPreset : current.appearance.contentGradientPreset;
177
- current.appearance.contentGradientFrom = typeof block.contentGradientFrom === "string" ? block.contentGradientFrom : current.appearance.contentGradientFrom;
178
- current.appearance.contentGradientTo = typeof block.contentGradientTo === "string" ? block.contentGradientTo : current.appearance.contentGradientTo;
179
- current.appearance.contentGradientAngle = typeof block.contentGradientAngle === "string" ? block.contentGradientAngle : current.appearance.contentGradientAngle;
180
- if (block.backgroundImageFit === "cover" || block.backgroundImageFit === "contain") {
181
- current.media.fit = block.backgroundImageFit;
182
- }
183
- if (block.imageFit === "cover" || block.imageFit === "contain") {
184
- current.media.fit = block.imageFit;
185
- }
186
- if (block.backgroundImageCornerStyle === "rounded" || block.backgroundImageCornerStyle === "square") {
187
- current.media.cornerStyle = block.backgroundImageCornerStyle;
188
- }
189
- if (block.imageCornerStyle === "rounded" || block.imageCornerStyle === "square") {
190
- current.media.cornerStyle = block.imageCornerStyle;
191
- }
192
- if (block.backgroundImagePosition === "top" || block.backgroundImagePosition === "bottom" || block.backgroundImagePosition === "left" || block.backgroundImagePosition === "right" || block.backgroundImagePosition === "center") {
193
- current.media.position = block.backgroundImagePosition;
194
- }
195
- if (block.imagePosition === "top" || block.imagePosition === "bottom" || block.imagePosition === "left" || block.imagePosition === "right" || block.imagePosition === "center") {
196
- current.media.position = block.imagePosition;
197
- }
198
- current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
199
- current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
200
- current.media.height = parsePixel(block.imageHeight);
201
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
202
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
203
- current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
204
- current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
205
- current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
206
- current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
207
- current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
208
- current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
209
- return mergeSettings(current, block.settings);
210
- };
211
- var v2SettingsToLegacyBlock = (blockWithSettings) => {
212
- const settings = legacyBlockToV2Settings(blockWithSettings);
213
- const next = {
214
- ...blockWithSettings,
215
- settings
216
- };
217
- const blockType = typeof next.blockType === "string" ? next.blockType : "";
218
- next.contentWidth = settings.layout.contentWidth;
219
- next.sectionPaddingX = settings.layout.sectionPaddingX;
220
- next.sectionPaddingY = settings.layout.sectionPaddingY;
221
- next.sectionBackgroundMode = settings.appearance.sectionBackgroundMode;
222
- next.sectionBackgroundColor = settings.appearance.sectionBackgroundColor;
223
- next.sectionGradientPreset = settings.appearance.sectionGradientPreset;
224
- next.sectionGradientFrom = settings.appearance.sectionGradientFrom;
225
- next.sectionGradientTo = settings.appearance.sectionGradientTo;
226
- next.sectionGradientAngle = settings.appearance.sectionGradientAngle;
227
- next.contentBackgroundMode = settings.appearance.contentBackgroundMode;
228
- next.contentBackgroundColor = settings.appearance.contentBackgroundColor;
229
- next.contentGradientPreset = settings.appearance.contentGradientPreset;
230
- next.contentGradientFrom = settings.appearance.contentGradientFrom;
231
- next.contentGradientTo = settings.appearance.contentGradientTo;
232
- next.contentGradientAngle = settings.appearance.contentGradientAngle;
233
- next.textHeadingAlign = settings.typography.headingAlign;
234
- next.textBodyAlign = settings.typography.bodyAlign;
235
- next.textMaxWidth = settings.typography.maxTextWidth;
236
- next.textLineHeightPreset = settings.typography.lineHeightPreset;
237
- next.textLetterSpacingPreset = settings.typography.letterSpacingPreset;
238
- next.editCopyInPanel = settings.advanced.editCopyInPanel;
239
- next.customClassName = settings.advanced.customClassName;
240
- next.hideOnMobile = settings.advanced.hideOnMobile;
241
- delete next.backgroundImagePositionX;
242
- delete next.backgroundImagePositionY;
243
- delete next.imageHeight;
244
- delete next.imagePositionX;
245
- delete next.imagePositionY;
246
- if (blockType === "hero") {
247
- next.backgroundImageFit = settings.media.fit;
248
- next.backgroundImageCornerStyle = settings.media.cornerStyle;
249
- next.backgroundImagePosition = settings.media.position;
250
- } else if (blockType === "media") {
251
- next.imageFit = settings.media.fit;
252
- next.imageCornerStyle = settings.media.cornerStyle;
253
- next.imagePosition = settings.media.position;
254
- }
255
- if (Array.isArray(next.items)) {
256
- next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
257
- }
258
- return next;
259
- };
260
- var legacyItemToV2Settings = (item) => {
261
- const current = structuredClone(defaultBuilderItemSettingsV2);
262
- if (item.imageFit === "cover" || item.imageFit === "contain") {
263
- current.media.fit = item.imageFit;
264
- }
265
- if (item.imageCornerStyle === "rounded" || item.imageCornerStyle === "square") {
266
- current.media.cornerStyle = item.imageCornerStyle;
267
- }
268
- if (item.imagePosition === "top" || item.imagePosition === "bottom" || item.imagePosition === "left" || item.imagePosition === "right" || item.imagePosition === "center") {
269
- current.media.position = item.imagePosition;
270
- }
271
- current.media.positionX = parsePercent(item.imagePositionX);
272
- current.media.positionY = parsePercent(item.imagePositionY);
273
- current.media.height = parsePixel(item.imageHeight);
274
- return mergeSettings(current, item.settings);
275
- };
276
- var v2SettingsToLegacyItem = (itemWithSettings) => {
277
- const settings = legacyItemToV2Settings(itemWithSettings);
278
- return {
279
- ...itemWithSettings,
280
- imageCornerStyle: settings.media.cornerStyle,
281
- imageFit: settings.media.fit,
282
- imageHeight: settings.media.height,
283
- imagePosition: settings.media.position,
284
- imagePositionX: settings.media.positionX,
285
- imagePositionY: settings.media.positionY,
286
- settings
287
- };
288
- };
289
- var migrateBlockToSettingsV2 = (block) => {
290
- const withLegacyMirrors = v2SettingsToLegacyBlock(block);
291
- if (!Array.isArray(withLegacyMirrors.items)) {
292
- return withLegacyMirrors;
293
- }
294
- return {
295
- ...withLegacyMirrors,
296
- items: withLegacyMirrors.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem)
297
- };
298
- };
299
-
300
38
  // src/studio-pages/builder/settings-v2/themeTokens.ts
301
- var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
39
+ var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
302
40
  var merge = (base, next) => {
303
- if (!next || !isRecord2(next)) {
41
+ if (!next || !isRecord(next)) {
304
42
  return base;
305
43
  }
306
44
  const merged = { ...base };
307
45
  for (const [key, value] of Object.entries(next)) {
308
- if (isRecord2(value) && isRecord2(merged[key])) {
46
+ if (isRecord(value) && isRecord(merged[key])) {
309
47
  merged[key] = merge(merged[key], value);
310
48
  continue;
311
49
  }
@@ -321,16 +59,6 @@ var resolveBuilderThemeTokens = (layers) => {
321
59
  return merge(withPage, layers.block);
322
60
  };
323
61
 
324
- // src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
325
- import { useMemo, useState as useState2 } from "react";
326
-
327
- // src/studio-pages/builder/ui/Accordion.tsx
328
- import { useEffect, useState } from "react";
329
- import { jsx, jsxs } from "react/jsx-runtime";
330
-
331
- // src/studio-pages/builder/ui/ImageControls.tsx
332
- import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
333
-
334
62
  // src/studio-pages/builder/settings-v2/inspectorSchema.ts
335
63
  var alignOptions = [
336
64
  { label: "Left", value: "left" },
@@ -338,72 +66,7 @@ var alignOptions = [
338
66
  { label: "Right", value: "right" },
339
67
  { label: "Justify", value: "justify" }
340
68
  ];
341
- var layoutFieldSet = [
342
- {
343
- group: "layout",
344
- key: "settings.layout.contentWidth",
345
- label: "Content Width",
346
- options: [
347
- { label: "Inherit Page Default", value: "inherit" },
348
- { label: "Narrow", value: "narrow" },
349
- { label: "Content", value: "content" },
350
- { label: "Wide", value: "wide" },
351
- { label: "Full", value: "full" }
352
- ],
353
- tags: ["width", "container"],
354
- type: "select"
355
- },
356
- {
357
- group: "layout",
358
- key: "settings.layout.linkVerticalPadding",
359
- label: "Keep Top and Bottom Equal",
360
- tags: ["spacing", "padding", "equal", "lock", "vertical"],
361
- type: "checkbox"
362
- },
363
- {
364
- group: "layout",
365
- key: "settings.layout.paddingTopPt",
366
- label: "Top Padding (pt)",
367
- max: 240,
368
- min: 0,
369
- tags: ["spacing", "padding", "top", "vertical"],
370
- type: "number"
371
- },
372
- {
373
- group: "layout",
374
- key: "settings.layout.paddingBottomPt",
375
- label: "Bottom Padding (pt)",
376
- max: 240,
377
- min: 0,
378
- tags: ["spacing", "padding", "bottom", "vertical"],
379
- type: "number"
380
- },
381
- {
382
- group: "layout",
383
- key: "settings.layout.linkHorizontalPadding",
384
- label: "Keep Left and Right Equal",
385
- tags: ["spacing", "padding", "equal", "lock", "horizontal"],
386
- type: "checkbox"
387
- },
388
- {
389
- group: "layout",
390
- key: "settings.layout.paddingLeftPt",
391
- label: "Left Padding (pt)",
392
- max: 240,
393
- min: 0,
394
- tags: ["spacing", "padding", "left", "horizontal"],
395
- type: "number"
396
- },
397
- {
398
- group: "layout",
399
- key: "settings.layout.paddingRightPt",
400
- label: "Right Padding (pt)",
401
- max: 240,
402
- min: 0,
403
- tags: ["spacing", "padding", "right", "horizontal"],
404
- type: "number"
405
- }
406
- ];
69
+ var layoutFieldSet = [];
407
70
  var typographyFieldSet = [
408
71
  {
409
72
  group: "typography",
@@ -460,44 +123,7 @@ var typographyFieldSet = [
460
123
  type: "select"
461
124
  }
462
125
  ];
463
- var styleFieldSet = [
464
- {
465
- group: "style",
466
- key: "settings.appearance.sectionBackgroundMode",
467
- label: "Section Background",
468
- options: [
469
- { label: "None", value: "none" },
470
- { label: "Color", value: "color" },
471
- { label: "Gradient", value: "gradient" }
472
- ],
473
- tags: ["background", "section"],
474
- type: "select"
475
- },
476
- {
477
- group: "style",
478
- key: "settings.appearance.sectionBackgroundColor",
479
- label: "Section Background Color",
480
- type: "color"
481
- },
482
- {
483
- group: "style",
484
- key: "settings.appearance.contentBackgroundMode",
485
- label: "Content Background",
486
- options: [
487
- { label: "None", value: "none" },
488
- { label: "Color", value: "color" },
489
- { label: "Gradient", value: "gradient" }
490
- ],
491
- tags: ["background", "content"],
492
- type: "select"
493
- },
494
- {
495
- group: "style",
496
- key: "settings.appearance.contentBackgroundColor",
497
- label: "Content Background Color",
498
- type: "color"
499
- }
500
- ];
126
+ var styleFieldSet = [];
501
127
  var commonAdvanced = [
502
128
  {
503
129
  group: "advanced",
@@ -598,6 +224,7 @@ var inspectorDefinitionByBlockType = {
598
224
  faq: {
599
225
  blockType: "faq",
600
226
  fields: [
227
+ { group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
601
228
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
602
229
  ...layoutFieldSet,
603
230
  ...typographyFieldSet,
@@ -608,6 +235,7 @@ var inspectorDefinitionByBlockType = {
608
235
  featureGrid: {
609
236
  blockType: "featureGrid",
610
237
  fields: [
238
+ { group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
611
239
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
612
240
  {
613
241
  group: "basics",
@@ -615,7 +243,11 @@ var inspectorDefinitionByBlockType = {
615
243
  label: "Variant",
616
244
  options: [
617
245
  { label: "Cards", value: "cards" },
618
- { label: "Highlight", value: "highlight" }
246
+ { label: "Highlight", value: "highlight" },
247
+ { label: "Split List", value: "splitList" },
248
+ { label: "Panels", value: "panels" },
249
+ { label: "Catalog", value: "catalog" },
250
+ { label: "Contact Split", value: "contact" }
619
251
  ],
620
252
  type: "select"
621
253
  },
@@ -630,6 +262,7 @@ var inspectorDefinitionByBlockType = {
630
262
  formEmbed: {
631
263
  blockType: "formEmbed",
632
264
  fields: [
265
+ { group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
633
266
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
634
267
  { group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
635
268
  {
@@ -662,7 +295,7 @@ var inspectorDefinitionByBlockType = {
662
295
  type: "select"
663
296
  },
664
297
  {
665
- group: "layout",
298
+ group: "basics",
666
299
  key: "heroHeight",
667
300
  label: "Hero Height",
668
301
  options: [
@@ -715,6 +348,16 @@ var inspectorDefinitionByBlockType = {
715
348
  richText: {
716
349
  blockType: "richText",
717
350
  fields: [
351
+ {
352
+ group: "basics",
353
+ key: "variant",
354
+ label: "Variant",
355
+ options: [
356
+ { label: "Default", value: "default" },
357
+ { label: "Quote Banner", value: "quoteBanner" }
358
+ ],
359
+ type: "select"
360
+ },
718
361
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
719
362
  {
720
363
  group: "basics",
@@ -766,8 +409,202 @@ var inspectorDefinitionByBlockType = {
766
409
  }
767
410
  };
768
411
 
769
- // src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
770
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
412
+ // src/studio-pages/pageService.ts
413
+ var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
414
+ var toRecordArray = (value) => Array.isArray(value) ? value.filter((item) => isRecord2(item)) : [];
415
+ var getRelationID = (value) => {
416
+ if (typeof value === "number" || typeof value === "string") {
417
+ return value;
418
+ }
419
+ if (!isRecord2(value)) {
420
+ return null;
421
+ }
422
+ const id = value.id;
423
+ return typeof id === "number" || typeof id === "string" ? id : null;
424
+ };
425
+ var asLayoutArray = (value) => toRecordArray(value);
426
+ var hydrateRelationship = (valueFromStudio, valueFromLayout) => {
427
+ if (isRecord2(valueFromStudio)) {
428
+ return valueFromStudio;
429
+ }
430
+ if (!isRecord2(valueFromLayout)) {
431
+ return valueFromStudio;
432
+ }
433
+ const studioID = getRelationID(valueFromStudio);
434
+ const layoutID = getRelationID(valueFromLayout);
435
+ if (studioID === null || layoutID === null || String(studioID) !== String(layoutID)) {
436
+ return valueFromStudio;
437
+ }
438
+ return valueFromLayout;
439
+ };
440
+ var hydrateDocumentWithLayoutRelations = (document, layout) => {
441
+ const nextNodes = document.nodes.map((node, index) => {
442
+ const layoutBlock = layout[index];
443
+ if (!isRecord2(layoutBlock)) {
444
+ return node;
445
+ }
446
+ if (typeof layoutBlock.blockType !== "string" || layoutBlock.blockType !== node.type) {
447
+ return node;
448
+ }
449
+ const nextData = { ...node.data };
450
+ if (node.type === "hero") {
451
+ nextData.media = hydrateRelationship(nextData.media, layoutBlock.media);
452
+ }
453
+ if (node.type === "media") {
454
+ nextData.image = hydrateRelationship(nextData.image, layoutBlock.image);
455
+ }
456
+ if (node.type === "featureGrid" || node.type === "logoWall" || node.type === "beforeAfter") {
457
+ const studioItems = Array.isArray(nextData.items) ? nextData.items : [];
458
+ const layoutItems = Array.isArray(layoutBlock.items) ? layoutBlock.items : [];
459
+ nextData.items = studioItems.map((rawStudioItem, itemIndex) => {
460
+ if (!isRecord2(rawStudioItem)) {
461
+ return rawStudioItem;
462
+ }
463
+ const layoutItem = layoutItems[itemIndex];
464
+ if (!isRecord2(layoutItem)) {
465
+ return rawStudioItem;
466
+ }
467
+ const nextItem = { ...rawStudioItem };
468
+ nextItem.media = hydrateRelationship(nextItem.media, layoutItem.media);
469
+ nextItem.beforeMedia = hydrateRelationship(nextItem.beforeMedia, layoutItem.beforeMedia);
470
+ nextItem.afterMedia = hydrateRelationship(nextItem.afterMedia, layoutItem.afterMedia);
471
+ return nextItem;
472
+ });
473
+ }
474
+ return {
475
+ ...node,
476
+ data: nextData
477
+ };
478
+ });
479
+ return {
480
+ ...document,
481
+ nodes: nextNodes
482
+ };
483
+ };
484
+ var normalizeDocument = (document) => ({
485
+ ...document,
486
+ schemaVersion: 1,
487
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
488
+ });
489
+ var normalizeLegacyHeroDefaults = (document) => {
490
+ const nodes = document.nodes.map((node) => {
491
+ if (node.type !== "hero" || !isRecord2(node.data)) {
492
+ return node;
493
+ }
494
+ const nextData = { ...node.data };
495
+ const heroBackgroundColor = typeof nextData.backgroundColor === "string" ? nextData.backgroundColor.trim().toLowerCase() : "";
496
+ const sectionBackgroundMode = typeof nextData.sectionBackgroundMode === "string" ? nextData.sectionBackgroundMode : "none";
497
+ const hasBackgroundImageURL = typeof nextData.backgroundImageURL === "string" && nextData.backgroundImageURL.trim().length > 0;
498
+ const mediaRelation = getRelationID(nextData.media);
499
+ if (heroBackgroundColor === "#124a37" && sectionBackgroundMode === "none" && !hasBackgroundImageURL && mediaRelation === null) {
500
+ nextData.backgroundColor = "";
501
+ }
502
+ return {
503
+ ...node,
504
+ data: nextData
505
+ };
506
+ });
507
+ return {
508
+ ...document,
509
+ nodes
510
+ };
511
+ };
512
+ var assertCanPublish = (issues) => {
513
+ const publishErrors = issues.filter((issue) => issue.severity === "error");
514
+ if (publishErrors.length > 0) {
515
+ throw new Error(`Cannot publish page: ${publishErrors[0].message}`);
516
+ }
517
+ };
518
+ var getStudioDocumentFromPage = (doc) => {
519
+ const title = typeof doc.title === "string" ? doc.title : void 0;
520
+ const layout = asLayoutArray(doc.layout);
521
+ try {
522
+ const studioDocument = assertStudioDocumentV1(doc.studioDocument);
523
+ if (layout.length > 0) {
524
+ return hydrateDocumentWithLayoutRelations(studioDocument, layout);
525
+ }
526
+ return studioDocument;
527
+ } catch {
528
+ if (layout.length > 0) {
529
+ return layoutToStudioDocument(layout, title);
530
+ }
531
+ return createEmptyStudioDocument(title);
532
+ }
533
+ };
534
+ var createStudioPageService = ({
535
+ collectionSlug = "pages",
536
+ modules,
537
+ payload,
538
+ user
539
+ }) => ({
540
+ getPageForStudio: async (pageID) => {
541
+ const page = await payload.findByID({
542
+ collection: collectionSlug,
543
+ depth: 2,
544
+ draft: true,
545
+ id: pageID,
546
+ overrideAccess: false,
547
+ user
548
+ });
549
+ const studioDocument = getStudioDocumentFromPage(page);
550
+ return {
551
+ id: String(page.id),
552
+ slug: typeof page.slug === "string" ? page.slug : "",
553
+ studioDocument,
554
+ title: typeof page.title === "string" ? page.title : "Untitled Page"
555
+ };
556
+ },
557
+ validateStudioDocument: (document) => validateStudioDocument(document, modules),
558
+ saveDraft: async (pageID, document, _metadata) => {
559
+ const normalizedDocument = normalizeLegacyHeroDefaults(normalizeDocument(document));
560
+ const compileResult = compileStudioDocument(normalizedDocument, modules);
561
+ await payload.update({
562
+ collection: collectionSlug,
563
+ data: {
564
+ _status: "draft",
565
+ layout: compileResult.layout,
566
+ studioDocument: normalizedDocument,
567
+ studioValidationIssues: compileResult.issues,
568
+ title: normalizedDocument.title
569
+ },
570
+ id: pageID,
571
+ overrideAccess: false,
572
+ user
573
+ });
574
+ return {
575
+ id: pageID,
576
+ status: "draft"
577
+ };
578
+ },
579
+ publish: async (pageID, document, _metadata) => {
580
+ const normalizedDocument = normalizeLegacyHeroDefaults(normalizeDocument(document));
581
+ const compileResult = compileStudioDocument(normalizedDocument, modules);
582
+ assertCanPublish(compileResult.issues);
583
+ await payload.update({
584
+ collection: collectionSlug,
585
+ data: {
586
+ _status: "published",
587
+ layout: compileResult.layout,
588
+ studioDocument: normalizedDocument,
589
+ studioValidationIssues: compileResult.issues,
590
+ title: normalizedDocument.title
591
+ },
592
+ id: pageID,
593
+ overrideAccess: false,
594
+ user
595
+ });
596
+ return {
597
+ id: pageID,
598
+ status: "published"
599
+ };
600
+ }
601
+ });
602
+ var toEditorInitialDoc = (payloadPage) => ({
603
+ layout: studioDocumentToLayout(payloadPage.studioDocument),
604
+ slug: typeof payloadPage.slug === "string" ? payloadPage.slug : "",
605
+ studioDocument: payloadPage.studioDocument,
606
+ title: payloadPage.title
607
+ });
771
608
 
772
609
  // src/studio-pages/migrations.ts
773
610
  var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -863,11 +700,14 @@ var defaultNodeData = {
863
700
  }),
864
701
  cta: {
865
702
  ...withSectionStyleDefaults({}),
866
- backgroundColor: "#1f684f",
703
+ backgroundColor: "",
704
+ bullets: [],
867
705
  buttonHref: "/contact",
868
706
  buttonLabel: "Contact Us",
869
707
  description: "Optional supporting copy.",
708
+ eyebrow: "",
870
709
  headline: "Ready to get started?",
710
+ imageURL: "",
871
711
  style: "light"
872
712
  },
873
713
  faq: {
@@ -883,6 +723,7 @@ var defaultNodeData = {
883
723
  { description: "Explain this point.", iconType: "badge", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
884
724
  { description: "Explain this point.", iconType: "badge", icon: "03", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Three" }
885
725
  ],
726
+ subtitle: "",
886
727
  title: "Section Title",
887
728
  variant: "cards"
888
729
  },
@@ -890,16 +731,18 @@ var defaultNodeData = {
890
731
  ...withSectionStyleDefaults({}),
891
732
  description: "Collect lead details from visitors.",
892
733
  formType: "quote",
734
+ submitLabel: "Submit",
893
735
  title: "Request a Quote"
894
736
  },
895
737
  hero: {
896
738
  ...withSectionStyleDefaults({}),
897
739
  backgroundColor: "",
740
+ backgroundImageURL: "",
898
741
  backgroundOverlayMode: "none",
899
742
  backgroundOverlayOpacity: 45,
900
743
  backgroundOverlayColor: "#000000",
901
- backgroundOverlayGradientFrom: "#0d4a37",
902
- backgroundOverlayGradientTo: "#1f684f",
744
+ backgroundOverlayGradientFrom: "#334b63",
745
+ backgroundOverlayGradientTo: "#496582",
903
746
  backgroundOverlayGradientAngle: "135",
904
747
  backgroundOverlayGradientFromStrength: 100,
905
748
  backgroundOverlayGradientToStrength: 100,
@@ -933,11 +776,12 @@ var defaultNodeData = {
933
776
  { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
934
777
  { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
935
778
  ],
936
- subtitle: "Trusted by teams and homeowners across Central Texas.",
937
- title: "Trusted by Local Organizations"
779
+ subtitle: "Show logos from trusted associations, partners, or collaborators.",
780
+ title: "Trusted by Great Partners"
938
781
  }),
939
782
  richText: {
940
783
  ...withSectionStyleDefaults({}),
784
+ cards: [],
941
785
  content: {
942
786
  root: {
943
787
  children: [
@@ -967,6 +811,7 @@ var defaultNodeData = {
967
811
  version: 1
968
812
  }
969
813
  },
814
+ statsItems: [],
970
815
  title: "Section Heading",
971
816
  width: "normal"
972
817
  },
@@ -980,9 +825,9 @@ var defaultNodeData = {
980
825
  },
981
826
  stats: withSectionStyleDefaults({
982
827
  items: [
983
- { description: "Average response time", label: "Same-Day Quotes", value: "24h" },
984
- { description: "Projects completed", label: "Completed Jobs", value: "1,200+" },
985
- { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" }
828
+ { description: "Average first response", label: "Response Time", value: "24h" },
829
+ { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" },
830
+ { description: "Recent projects or clients served", label: "Recent Work", value: "150+" }
986
831
  ],
987
832
  subtitle: "Highlight measurable outcomes to build trust quickly.",
988
833
  title: "Performance Highlights"
@@ -1113,55 +958,15 @@ var pageStudioModuleManifest = {
1113
958
  { action: "publish", role: "editor" }
1114
959
  ]
1115
960
  };
1116
- var ensureNodeID = (inputID, index) => {
1117
- if (typeof inputID === "string" && inputID.length > 0) {
1118
- return inputID;
1119
- }
1120
- return `node-${index + 1}`;
1121
- };
1122
- var layoutToStudioDocument = (layout, title, metadata) => {
1123
- const nodes = layout.filter((block) => typeof block.blockType === "string").map((rawBlock, index) => {
1124
- const block = migrateBlockToSettingsV2(rawBlock);
1125
- const blockType = String(block.blockType);
1126
- const { id, blockType: _ignoredBlockType, ...data } = block;
1127
- return {
1128
- id: ensureNodeID(id, index),
1129
- type: blockType,
1130
- data
1131
- };
1132
- });
1133
- return {
1134
- metadata,
1135
- schemaVersion: 1,
1136
- title,
1137
- nodes,
1138
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1139
- };
1140
- };
1141
- var studioDocumentToLayout = (document) => document.nodes.map(
1142
- (node) => migrateBlockToSettingsV2({
1143
- id: node.id,
1144
- blockType: node.type,
1145
- ...node.data
1146
- })
1147
- );
1148
- var createDefaultStudioDocument = (title) => ({
1149
- metadata: {},
1150
- schemaVersion: 1,
1151
- title,
1152
- nodes: [],
1153
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1154
- });
1155
961
 
1156
962
  export {
1157
- defaultBuilderThemeTokens,
1158
963
  resolveBuilderThemeTokens,
964
+ getStudioDocumentFromPage,
965
+ createStudioPageService,
966
+ toEditorInitialDoc,
1159
967
  pageNodeTypes,
1160
968
  pagePaletteGroups,
1161
969
  pageInspectorPanels,
1162
970
  pageStudioModuleManifest,
1163
- layoutToStudioDocument,
1164
- studioDocumentToLayout,
1165
- createDefaultStudioDocument,
1166
971
  studio_pages_exports
1167
972
  };