@orion-studios/payload-studio 0.5.0-beta.99 → 0.6.0-beta.10

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 (62) hide show
  1. package/README.md +58 -68
  2. package/dist/admin/client.d.mts +7 -1
  3. package/dist/admin/client.d.ts +7 -1
  4. package/dist/admin/client.js +5446 -985
  5. package/dist/admin/client.mjs +4408 -1090
  6. package/dist/admin/index.d.mts +2 -1
  7. package/dist/admin/index.d.ts +2 -1
  8. package/dist/admin/index.js +396 -55
  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 +2118 -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-XVH5SCBD.mjs → chunk-RKTIFEUY.mjs} +4 -19
  27. package/dist/chunk-W2UOCJDX.mjs +32 -0
  28. package/dist/{chunk-74XFAVXU.mjs → chunk-WLOPFFN2.mjs} +387 -55
  29. package/dist/{chunk-C4J35SPJ.mjs → chunk-XKUTZ7IU.mjs} +257 -452
  30. package/dist/{index-ZbOx4OCF.d.mts → index-52HdVLQq.d.ts} +12 -22
  31. package/dist/index-Bm2SaC3r.d.mts +187 -0
  32. package/dist/index-CkT_eyhK.d.ts +187 -0
  33. package/dist/index-Crx_MtPw.d.ts +223 -0
  34. package/dist/index-Cv-6qnrw.d.mts +223 -0
  35. package/dist/{index-ZbOx4OCF.d.ts → index-DEQC3Dwj.d.mts} +12 -22
  36. package/dist/{index-BIwu3qIH.d.mts → index-DWmudwDm.d.mts} +2 -1
  37. package/dist/{index-BIwu3qIH.d.ts → index-DWmudwDm.d.ts} +2 -1
  38. package/dist/index.d.mts +5 -4
  39. package/dist/index.d.ts +5 -4
  40. package/dist/index.js +1868 -1202
  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 +10 -4
  58. package/dist/chunk-SIL2J5MF.mjs +0 -155
  59. package/dist/index-BnoqmQDP.d.mts +0 -219
  60. package/dist/index-CTpik6fR.d.ts +0 -219
  61. package/dist/index-R7hA134j.d.mts +0 -140
  62. package/dist/index-vjrjy0P4.d.ts +0 -140
package/dist/index.js CHANGED
@@ -79,8 +79,36 @@ var createThemePreferenceField = (defaultTheme = "brand-light") => ({
79
79
  });
80
80
  var themePreferenceField = createThemePreferenceField("brand-light");
81
81
 
82
+ // src/admin-app/routeRegistry.ts
83
+ var adminNavIcons = [
84
+ "dashboard",
85
+ "pages",
86
+ "forms",
87
+ "globals",
88
+ "media",
89
+ "tools",
90
+ "account",
91
+ "analytics"
92
+ ];
93
+ var roleCanAccessNav = (role, item) => {
94
+ if (!item.roles || item.roles.length === 0) {
95
+ return true;
96
+ }
97
+ if (!role) {
98
+ return false;
99
+ }
100
+ return item.roles.includes(role);
101
+ };
102
+ var navItemIsActive = (pathname, item) => {
103
+ if (item.href === "/admin") {
104
+ return pathname === "/admin";
105
+ }
106
+ return item.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
107
+ };
108
+
82
109
  // src/shared/studioSections.ts
83
110
  var studioRoles = /* @__PURE__ */ new Set(["admin", "editor", "client"]);
111
+ var studioIcons = new Set(adminNavIcons);
84
112
  var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
85
113
  var isAbsoluteExternalURL = (value) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(value) || value.startsWith("//");
86
114
  var normalizePathLikeValue = (value) => {
@@ -121,6 +149,7 @@ var normalizeCard = (value) => {
121
149
  ...typeof value.description === "string" && value.description.trim().length > 0 ? { description: value.description.trim() } : {}
122
150
  };
123
151
  };
152
+ var normalizeIcon = (value) => typeof value === "string" && studioIcons.has(value) ? value : void 0;
124
153
  var resolveStudioSections = (value) => {
125
154
  if (!Array.isArray(value)) {
126
155
  return [];
@@ -146,6 +175,7 @@ var resolveStudioSections = (value) => {
146
175
  label,
147
176
  href,
148
177
  matchPrefixes,
178
+ ...normalizeIcon(entry.icon) ? { icon: normalizeIcon(entry.icon) } : {},
149
179
  ...normalizeRoles(entry.roles) ? { roles: normalizeRoles(entry.roles) } : {},
150
180
  ...normalizeCard(entry.card) ? { card: normalizeCard(entry.card) } : {}
151
181
  });
@@ -211,17 +241,29 @@ function configureAdmin(config) {
211
241
  brandPrimary = "#3b82f6",
212
242
  brandSecondary = "#8b5cf6",
213
243
  defaultTheme = "brand-light",
214
- logoUrl
244
+ logoUrl,
245
+ allowThemePreference = false,
246
+ userSessionDurationSeconds = 60 * 60 * 24
215
247
  } = config;
216
248
  const studioEnabled = config.studio?.enabled ?? true;
249
+ const formsEnabled = config.studio?.forms?.enabled ?? false;
250
+ const formsCollectionSlug = config.studio?.forms?.collectionSlug || "forms";
251
+ const formSubmissionsCollectionSlug = config.studio?.forms?.submissionsCollectionSlug || "form-submissions";
252
+ const formUploadsCollectionSlug = config.studio?.forms?.uploadsCollectionSlug || "form-uploads";
217
253
  const pagesCollectionSlug = config.studio?.pages?.collectionSlug || "pages";
254
+ const builderBasePath = config.studio?.pages?.builderBasePath || "/builder";
218
255
  const mediaCollectionSlug = config.studio?.media?.collectionSlug || "media";
219
- const contactFormStudioPath = "/studio-contact-form";
256
+ const globalsBasePath = "/site-globals";
257
+ const pagesBasePath = "/pages";
258
+ const formsBasePath = "/forms";
259
+ const mediaBasePath = "/media";
260
+ const toolsBasePath = "/tools";
261
+ const contactFormStudioPath = "/contact-form";
220
262
  const configuredGlobals = config.studio?.globals || [
221
263
  { slug: "site-settings", label: "Website Settings" },
222
264
  { slug: "header", label: "Header & Navigation" },
223
265
  { slug: "footer", label: "Footer" },
224
- { slug: "contact-form", label: "Contact Form" }
266
+ { slug: "social-media", label: "Social Media" }
225
267
  ];
226
268
  const globals = configuredGlobals.map((global) => {
227
269
  if (global.slug !== "contact-form" || global.href) {
@@ -234,24 +276,78 @@ function configureAdmin(config) {
234
276
  });
235
277
  const studioSections = resolveStudioSections(config.studio?.sections || []);
236
278
  const studioSectionViews = resolveStudioSectionViews(config.studio?.sections || []);
279
+ const sitePreview = config.studio?.sitePreview;
237
280
  let cssPath;
238
281
  const pkgDist = getPkgDistDir();
239
282
  const sourceCssPath = import_path.default.resolve(pkgDist, "admin.css");
240
- if (config.basePath && import_fs.default.existsSync(sourceCssPath)) {
241
- let css = import_fs.default.readFileSync(sourceCssPath, "utf-8");
242
- css = css.replace("--brand-primary: #3b82f6;", `--brand-primary: ${brandPrimary};`);
243
- css = css.replace("--brand-secondary: #8b5cf6;", `--brand-secondary: ${brandSecondary};`);
244
- const genDir = import_path.default.resolve(config.basePath, ".generated");
283
+ const adminAppCssPath = import_path.default.resolve(pkgDist, "admin-app", "styles.css");
284
+ const cssSources = [sourceCssPath, adminAppCssPath].filter((filePath) => import_fs.default.existsSync(filePath));
285
+ if (cssSources.length === 0) {
286
+ cssPath = sourceCssPath;
287
+ } else {
288
+ let css = cssSources.map((filePath) => import_fs.default.readFileSync(filePath, "utf-8")).join("\n\n");
289
+ css = css.replace(
290
+ "--orion-cms-brand-primary-fallback: #3b82f6;",
291
+ `--orion-cms-brand-primary-fallback: ${brandPrimary};`
292
+ );
293
+ css = css.replace(
294
+ "--orion-cms-brand-secondary-fallback: #8b5cf6;",
295
+ `--orion-cms-brand-secondary-fallback: ${brandSecondary};`
296
+ );
297
+ const outputBasePath = config.basePath || process.cwd();
298
+ const genDir = import_path.default.resolve(outputBasePath, ".generated");
245
299
  if (!import_fs.default.existsSync(genDir)) {
246
300
  import_fs.default.mkdirSync(genDir, { recursive: true });
247
301
  }
248
302
  const genPath = import_path.default.resolve(genDir, "admin.css");
249
303
  import_fs.default.writeFileSync(genPath, css);
250
304
  cssPath = genPath;
251
- } else {
252
- cssPath = sourceCssPath;
253
305
  }
254
306
  const clientPath = "@orion-studios/payload-studio/admin/client";
307
+ const studioNavClientProps = {
308
+ brandName,
309
+ formSubmissionsCollectionSlug,
310
+ formsCollectionSlug,
311
+ formsEnabled,
312
+ formUploadsCollectionSlug,
313
+ globalsBasePath,
314
+ globalsExtraMatchPrefixes: [contactFormStudioPath],
315
+ logoUrl,
316
+ mediaCollectionSlug,
317
+ pagesCollectionSlug,
318
+ sections: studioSections
319
+ };
320
+ const studioBackBreadcrumbComponent = {
321
+ exportName: "StudioBackBreadcrumb",
322
+ path: clientPath
323
+ };
324
+ const hasMatchingComponent = (items, exportName) => Array.isArray(items) && items.some(
325
+ (item) => item && typeof item === "object" && item.exportName === exportName && item.path === clientPath
326
+ );
327
+ const appendComponent = (items, component, exportName) => hasMatchingComponent(items, exportName) ? items || [] : [...items || [], component];
328
+ const attachStudioBackBreadcrumbToCollection = (collection) => {
329
+ if (!studioEnabled) {
330
+ return collection;
331
+ }
332
+ const existingBeforeDocumentControls = collection.admin?.components?.edit?.beforeDocumentControls;
333
+ return {
334
+ ...collection,
335
+ admin: {
336
+ ...collection.admin,
337
+ components: {
338
+ ...collection.admin?.components,
339
+ edit: {
340
+ ...collection.admin?.components?.edit,
341
+ beforeDocumentControls: appendComponent(
342
+ existingBeforeDocumentControls,
343
+ studioBackBreadcrumbComponent,
344
+ "StudioBackBreadcrumb"
345
+ )
346
+ }
347
+ }
348
+ }
349
+ };
350
+ };
255
351
  return {
256
352
  admin: {
257
353
  css: cssPath,
@@ -260,15 +356,7 @@ function configureAdmin(config) {
260
356
  Nav: {
261
357
  exportName: "AdminStudioNav",
262
358
  path: clientPath,
263
- clientProps: {
264
- brandName,
265
- logoUrl,
266
- globalsBasePath: "/studio-globals",
267
- globalsExtraMatchPrefixes: [contactFormStudioPath],
268
- mediaCollectionSlug,
269
- pagesCollectionSlug,
270
- sections: studioSections
271
- }
359
+ clientProps: studioNavClientProps
272
360
  }
273
361
  } : {},
274
362
  graphics: {
@@ -294,37 +382,113 @@ function configureAdmin(config) {
294
382
  Component: {
295
383
  exportName: studioEnabled ? "AdminStudioDashboard" : "Dashboard",
296
384
  path: clientPath,
297
- clientProps: {
298
- brandName,
299
- logoUrl,
300
- globalsBasePath: "/studio-globals",
301
- globalsExtraMatchPrefixes: [contactFormStudioPath],
302
- mediaCollectionSlug,
303
- pagesCollectionSlug,
304
- sections: studioSections
305
- }
385
+ clientProps: studioNavClientProps
306
386
  }
307
387
  },
308
388
  ...studioEnabled ? {
309
389
  studioGlobals: {
310
- path: "/studio-globals",
390
+ path: globalsBasePath,
311
391
  Component: {
312
392
  exportName: "AdminStudioGlobalsView",
313
393
  path: clientPath,
314
394
  clientProps: {
395
+ ...studioNavClientProps,
315
396
  globals,
316
- globalsBasePath: "/studio-globals"
397
+ globalsBasePath
398
+ }
399
+ }
400
+ },
401
+ studioPages: {
402
+ path: pagesBasePath,
403
+ Component: {
404
+ exportName: "AdminStudioPagesListView",
405
+ path: clientPath,
406
+ clientProps: {
407
+ ...studioNavClientProps,
408
+ pagesCollectionSlug
409
+ }
410
+ }
411
+ },
412
+ studioPageEditor: {
413
+ path: `${pagesBasePath}/:id`,
414
+ Component: {
415
+ exportName: "AdminStudioPageEditView",
416
+ path: clientPath,
417
+ clientProps: {
418
+ ...studioNavClientProps,
419
+ builderBasePath
420
+ }
421
+ }
422
+ },
423
+ studioPageNew: {
424
+ path: `${pagesBasePath}/new`,
425
+ Component: {
426
+ exportName: "AdminStudioNewPageView",
427
+ path: clientPath,
428
+ clientProps: {
429
+ ...studioNavClientProps,
430
+ pagesCollectionSlug
317
431
  }
318
432
  }
319
433
  },
320
434
  studioContactForm: {
321
- path: "/studio-contact-form",
435
+ path: contactFormStudioPath,
322
436
  Component: {
323
437
  exportName: "AdminStudioContactFormView",
324
438
  path: clientPath,
325
439
  clientProps: {
440
+ ...studioNavClientProps,
326
441
  globalSlug: "contact-form",
327
- globalsBasePath: "/studio-globals"
442
+ globalsBasePath
443
+ }
444
+ }
445
+ },
446
+ ...formsEnabled ? {
447
+ studioForms: {
448
+ path: formsBasePath,
449
+ Component: {
450
+ exportName: "AdminStudioFormsView",
451
+ path: clientPath,
452
+ clientProps: {
453
+ ...studioNavClientProps,
454
+ formsCollectionSlug,
455
+ formSubmissionsCollectionSlug,
456
+ formUploadsCollectionSlug
457
+ }
458
+ }
459
+ }
460
+ } : {},
461
+ studioMedia: {
462
+ path: mediaBasePath,
463
+ Component: {
464
+ exportName: "AdminStudioMediaView",
465
+ path: clientPath,
466
+ clientProps: {
467
+ ...studioNavClientProps,
468
+ mediaCollectionSlug
469
+ }
470
+ }
471
+ },
472
+ studioMediaItem: {
473
+ path: `${mediaBasePath}/:id`,
474
+ Component: {
475
+ exportName: "AdminStudioMediaItemView",
476
+ path: clientPath,
477
+ clientProps: {
478
+ ...studioNavClientProps,
479
+ mediaCollectionSlug
480
+ }
481
+ }
482
+ },
483
+ studioTools: {
484
+ path: toolsBasePath,
485
+ Component: {
486
+ exportName: "AdminStudioToolsView",
487
+ path: clientPath,
488
+ clientProps: {
489
+ ...studioNavClientProps,
490
+ mediaCollectionSlug,
491
+ pagesCollectionSlug
328
492
  }
329
493
  }
330
494
  },
@@ -333,7 +497,13 @@ function configureAdmin(config) {
333
497
  id,
334
498
  {
335
499
  path: view.path,
336
- Component: view.Component
500
+ Component: {
501
+ ...view.Component,
502
+ clientProps: {
503
+ ...studioNavClientProps,
504
+ ...view.Component.clientProps || {}
505
+ }
506
+ }
337
507
  }
338
508
  ])
339
509
  )
@@ -344,19 +514,39 @@ function configureAdmin(config) {
344
514
  exportName: "ThemeProvider",
345
515
  path: clientPath,
346
516
  clientProps: {
517
+ allowThemePreference,
347
518
  defaultTheme
348
519
  }
349
520
  }
350
521
  ],
351
- afterNavLinks: [
522
+ beforeLogin: [
352
523
  {
353
- exportName: "ThemeSwitcher",
524
+ exportName: "AdminLoginIntro",
354
525
  path: clientPath,
355
526
  clientProps: {
356
- defaultTheme
527
+ brandName,
528
+ logoUrl
357
529
  }
358
530
  }
359
- ]
531
+ ],
532
+ afterLogin: [
533
+ {
534
+ exportName: "AdminLoginPasswordToggle",
535
+ path: clientPath
536
+ }
537
+ ],
538
+ ...allowThemePreference ? {
539
+ afterNavLinks: [
540
+ {
541
+ exportName: "ThemeSwitcher",
542
+ path: clientPath,
543
+ clientProps: {
544
+ allowThemePreference,
545
+ defaultTheme
546
+ }
547
+ }
548
+ ]
549
+ } : {}
360
550
  },
361
551
  meta: {
362
552
  titleSuffix: ` \u2014 ${brandName}`
@@ -371,11 +561,86 @@ function configureAdmin(config) {
371
561
  const hasThemePreference = existingFields.some(
372
562
  (field) => typeof field === "object" && field !== null && "name" in field && field.name === "themePreference"
373
563
  );
374
- return {
564
+ const normalizedAuth = usersCollection.auth === true ? {
565
+ tokenExpiration: userSessionDurationSeconds,
566
+ useSessions: true
567
+ } : usersCollection.auth && typeof usersCollection.auth === "object" ? {
568
+ ...usersCollection.auth,
569
+ tokenExpiration: usersCollection.auth.tokenExpiration ?? userSessionDurationSeconds,
570
+ useSessions: usersCollection.auth.useSessions ?? true
571
+ } : usersCollection.auth;
572
+ const nextCollection = {
375
573
  ...usersCollection,
376
- fields: hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
574
+ auth: normalizedAuth,
575
+ fields: !allowThemePreference || hasThemePreference ? existingFields : [...existingFields, createThemePreferenceField(defaultTheme)]
576
+ };
577
+ return attachStudioBackBreadcrumbToCollection(nextCollection);
578
+ },
579
+ wrapPagesCollection(pagesCollection) {
580
+ if (!studioEnabled) {
581
+ return pagesCollection;
582
+ }
583
+ const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(pagesCollection);
584
+ const existingEditMenuItems = collectionWithBreadcrumb.admin?.components?.edit?.editMenuItems;
585
+ const existingViews = collectionWithBreadcrumb.admin?.components?.views;
586
+ const existingEditViews = existingViews?.edit;
587
+ const hasCustomEditView = Boolean(
588
+ existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
589
+ );
590
+ return {
591
+ ...collectionWithBreadcrumb,
592
+ admin: {
593
+ ...collectionWithBreadcrumb.admin,
594
+ components: {
595
+ ...collectionWithBreadcrumb.admin?.components,
596
+ edit: {
597
+ ...collectionWithBreadcrumb.admin?.components?.edit,
598
+ editMenuItems: appendComponent(
599
+ existingEditMenuItems,
600
+ {
601
+ exportName: "OpenInStudioMenuItem",
602
+ path: clientPath,
603
+ clientProps: {
604
+ pagesPathBase: pagesBasePath
605
+ }
606
+ },
607
+ "OpenInStudioMenuItem"
608
+ )
609
+ },
610
+ views: {
611
+ ...existingViews,
612
+ ...hasCustomEditView ? {} : {
613
+ edit: {
614
+ ...existingEditViews,
615
+ default: {
616
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
617
+ Component: {
618
+ exportName: "PageEditRedirectToStudio",
619
+ path: clientPath,
620
+ clientProps: {
621
+ pagesPathBase: pagesBasePath
622
+ }
623
+ }
624
+ }
625
+ }
626
+ }
627
+ }
628
+ }
629
+ }
377
630
  };
378
631
  },
632
+ wrapMediaCollection(mediaCollection) {
633
+ return attachStudioBackBreadcrumbToCollection(mediaCollection);
634
+ },
635
+ wrapFormsCollection(formsCollection) {
636
+ return attachStudioBackBreadcrumbToCollection(formsCollection);
637
+ },
638
+ wrapFormSubmissionsCollection(formSubmissionsCollection) {
639
+ return attachStudioBackBreadcrumbToCollection(formSubmissionsCollection);
640
+ },
641
+ wrapFormUploadsCollection(formUploadsCollection) {
642
+ return attachStudioBackBreadcrumbToCollection(formUploadsCollection);
643
+ },
379
644
  wrapGlobals(globals2) {
380
645
  const labelMap = {
381
646
  header: { group: "Site Design", label: "Header & Navigation" },
@@ -387,25 +652,110 @@ function configureAdmin(config) {
387
652
  return globals2.map((global) => {
388
653
  const mapping = labelMap[global.slug];
389
654
  if (!mapping) return global;
655
+ const shouldAttachSiteSettingsEditView = studioEnabled && global.slug === "site-settings";
656
+ const shouldAttachSocialMediaEditView = studioEnabled && global.slug === "social-media";
390
657
  const shouldAttachContactFormRedirect = studioEnabled && global.slug === "contact-form";
658
+ const shouldAttachHeaderEditView = studioEnabled && global.slug === "header";
659
+ const shouldAttachFooterEditView = studioEnabled && global.slug === "footer";
391
660
  const existingViews = global.admin?.components?.views;
392
661
  const existingEditViews = existingViews?.edit;
393
- const hasCustomContactFormEditView = Boolean(
662
+ const hasCustomEditView = Boolean(
394
663
  existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
395
664
  );
396
- const contactFormEditViews = shouldAttachContactFormRedirect && !hasCustomContactFormEditView ? {
397
- ...existingEditViews,
398
- default: {
399
- ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
400
- Component: {
401
- exportName: "StudioContactFormRedirect",
402
- path: clientPath,
403
- clientProps: {
404
- studioContactFormPath: contactFormStudioPath
665
+ const nextEditViews = (() => {
666
+ if (shouldAttachSiteSettingsEditView && !hasCustomEditView) {
667
+ return {
668
+ ...existingEditViews,
669
+ default: {
670
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
671
+ Component: {
672
+ exportName: "AdminStudioSiteSettingsGlobalView",
673
+ path: clientPath,
674
+ clientProps: {
675
+ ...studioNavClientProps,
676
+ globalSlug: global.slug,
677
+ mediaCollectionSlug
678
+ }
679
+ }
405
680
  }
406
- }
681
+ };
682
+ }
683
+ if (shouldAttachSocialMediaEditView && !hasCustomEditView) {
684
+ return {
685
+ ...existingEditViews,
686
+ default: {
687
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
688
+ Component: {
689
+ exportName: "AdminStudioSocialMediaGlobalView",
690
+ path: clientPath,
691
+ clientProps: {
692
+ ...studioNavClientProps,
693
+ globalSlug: global.slug
694
+ }
695
+ }
696
+ }
697
+ };
698
+ }
699
+ if (shouldAttachHeaderEditView && !hasCustomEditView) {
700
+ return {
701
+ ...existingEditViews,
702
+ default: {
703
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
704
+ Component: {
705
+ exportName: "AdminStudioHeaderGlobalView",
706
+ path: clientPath,
707
+ clientProps: {
708
+ ...studioNavClientProps,
709
+ actionHref: sitePreview?.header?.actionHref,
710
+ actionLabel: sitePreview?.header?.actionLabel,
711
+ globalSlug: global.slug,
712
+ locationSummary: sitePreview?.locationSummary,
713
+ pagesCollectionSlug
714
+ }
715
+ }
716
+ }
717
+ };
718
+ }
719
+ if (shouldAttachFooterEditView && !hasCustomEditView) {
720
+ return {
721
+ ...existingEditViews,
722
+ default: {
723
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
724
+ Component: {
725
+ exportName: "AdminStudioFooterGlobalView",
726
+ path: clientPath,
727
+ clientProps: {
728
+ ...studioNavClientProps,
729
+ builtByHref: sitePreview?.footer?.builtByHref,
730
+ builtByLabel: sitePreview?.footer?.builtByLabel,
731
+ description: sitePreview?.footer?.description,
732
+ footerCategories: sitePreview?.footer?.footerCategories,
733
+ footerLinks: sitePreview?.footer?.footerLinks,
734
+ globalSlug: global.slug,
735
+ locationSummary: sitePreview?.locationSummary
736
+ }
737
+ }
738
+ }
739
+ };
407
740
  }
408
- } : existingEditViews;
741
+ if (shouldAttachContactFormRedirect && !hasCustomEditView) {
742
+ return {
743
+ ...existingEditViews,
744
+ default: {
745
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
746
+ Component: {
747
+ exportName: "StudioContactFormRedirect",
748
+ path: clientPath,
749
+ clientProps: {
750
+ studioContactFormPath: contactFormStudioPath
751
+ }
752
+ }
753
+ }
754
+ };
755
+ }
756
+ return existingEditViews;
757
+ })();
758
+ const existingBeforeDocumentControls = global.admin?.components?.elements?.beforeDocumentControls;
409
759
  return {
410
760
  ...global,
411
761
  admin: {
@@ -413,12 +763,18 @@ function configureAdmin(config) {
413
763
  group: mapping.group,
414
764
  components: {
415
765
  ...global.admin?.components,
416
- ...shouldAttachContactFormRedirect ? {
766
+ elements: {
767
+ ...global.admin?.components?.elements,
768
+ beforeDocumentControls: studioEnabled ? appendComponent(
769
+ existingBeforeDocumentControls,
770
+ studioBackBreadcrumbComponent,
771
+ "StudioBackBreadcrumb"
772
+ ) : existingBeforeDocumentControls
773
+ },
774
+ ...nextEditViews ? {
417
775
  views: {
418
776
  ...existingViews,
419
- ...contactFormEditViews ? {
420
- edit: contactFormEditViews
421
- } : {}
777
+ edit: nextEditViews
422
778
  }
423
779
  } : {}
424
780
  }
@@ -885,23 +1241,6 @@ var parseAdminHeaderNavFromForm = (formData, pageOptions, maxRows = 24) => {
885
1241
  return [];
886
1242
  };
887
1243
 
888
- // src/admin-app/routeRegistry.ts
889
- var roleCanAccessNav = (role, item) => {
890
- if (!item.roles || item.roles.length === 0) {
891
- return true;
892
- }
893
- if (!role) {
894
- return false;
895
- }
896
- return item.roles.includes(role);
897
- };
898
- var navItemIsActive = (pathname, item) => {
899
- if (item.href === "/admin") {
900
- return pathname === "/admin";
901
- }
902
- return item.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
903
- };
904
-
905
1244
  // src/blocks/index.ts
906
1245
  var blocks_exports = {};
907
1246
  __export(blocks_exports, {
@@ -938,208 +1277,233 @@ var sectionStyleDefaults = {
938
1277
  contentGradientAngle: "135",
939
1278
  contentGradientFrom: "#ffffff",
940
1279
  contentGradientPreset: "none",
941
- contentGradientTo: "#f4f6f2",
1280
+ contentGradientTo: "#f4f6f8",
942
1281
  contentWidth: "inherit",
943
1282
  sectionPaddingX: "inherit",
944
1283
  sectionBackgroundColor: "#ffffff",
945
1284
  sectionBackgroundMode: "none",
946
1285
  sectionGradientAngle: "135",
947
- sectionGradientFrom: "#124a37",
948
- sectionGradientPreset: "forest",
949
- sectionGradientTo: "#1f684f",
1286
+ sectionGradientFrom: "#334b63",
1287
+ sectionGradientPreset: "slate",
1288
+ sectionGradientTo: "#496582",
950
1289
  sectionPaddingY: "md",
951
1290
  sectionWidth: "content"
952
1291
  };
953
- var sectionStyleFields = () => [
954
- {
955
- name: "sectionWidth",
956
- type: "select",
957
- defaultValue: sectionStyleDefaults.sectionWidth,
958
- options: [
959
- { label: "Content", value: "content" },
960
- { label: "Wide", value: "wide" },
961
- { label: "Full", value: "full" }
962
- ]
963
- },
964
- {
965
- name: "contentWidth",
966
- type: "select",
967
- defaultValue: sectionStyleDefaults.contentWidth,
968
- options: [
969
- { label: "Inherit", value: "inherit" },
970
- { label: "Narrow", value: "narrow" },
971
- { label: "Content", value: "content" },
972
- { label: "Wide", value: "wide" },
973
- { label: "Full", value: "full" }
974
- ]
975
- },
976
- {
977
- name: "sectionPaddingY",
978
- type: "select",
979
- defaultValue: sectionStyleDefaults.sectionPaddingY,
980
- options: [
981
- { label: "None", value: "none" },
982
- { label: "Small", value: "sm" },
983
- { label: "Medium", value: "md" },
984
- { label: "Large", value: "lg" }
985
- ]
986
- },
987
- {
988
- name: "sectionPaddingX",
989
- type: "select",
990
- defaultValue: sectionStyleDefaults.sectionPaddingX,
991
- options: [
992
- { label: "Inherit", value: "inherit" },
993
- { label: "None", value: "none" },
994
- { label: "Small", value: "sm" },
995
- { label: "Medium", value: "md" },
996
- { label: "Large", value: "lg" }
997
- ]
998
- },
999
- {
1000
- name: "sectionBackgroundMode",
1001
- type: "select",
1002
- defaultValue: sectionStyleDefaults.sectionBackgroundMode,
1003
- options: [
1004
- { label: "None", value: "none" },
1005
- { label: "Color", value: "color" },
1006
- { label: "Gradient", value: "gradient" }
1007
- ]
1008
- },
1009
- {
1010
- name: "sectionBackgroundColor",
1011
- type: "text",
1012
- defaultValue: sectionStyleDefaults.sectionBackgroundColor
1013
- },
1014
- {
1015
- name: "sectionGradientPreset",
1016
- type: "select",
1017
- defaultValue: sectionStyleDefaults.sectionGradientPreset,
1018
- options: [
1019
- { label: "None", value: "none" },
1020
- { label: "Forest", value: "forest" },
1021
- { label: "Moss", value: "moss" },
1022
- { label: "Cream", value: "cream" },
1023
- { label: "Slate", value: "slate" }
1024
- ]
1025
- },
1026
- {
1027
- name: "sectionGradientFrom",
1028
- type: "text",
1029
- defaultValue: sectionStyleDefaults.sectionGradientFrom
1030
- },
1031
- {
1032
- name: "sectionGradientTo",
1033
- type: "text",
1034
- defaultValue: sectionStyleDefaults.sectionGradientTo
1035
- },
1036
- {
1037
- name: "sectionGradientAngle",
1038
- type: "text",
1039
- defaultValue: sectionStyleDefaults.sectionGradientAngle
1040
- },
1041
- {
1042
- name: "contentBackgroundMode",
1043
- type: "select",
1044
- defaultValue: sectionStyleDefaults.contentBackgroundMode,
1045
- options: [
1046
- { label: "None", value: "none" },
1047
- { label: "Color", value: "color" },
1048
- { label: "Gradient", value: "gradient" }
1049
- ]
1050
- },
1051
- {
1052
- name: "contentBackgroundColor",
1053
- type: "text",
1054
- defaultValue: sectionStyleDefaults.contentBackgroundColor
1055
- },
1056
- {
1057
- name: "contentGradientPreset",
1058
- type: "select",
1059
- defaultValue: sectionStyleDefaults.contentGradientPreset,
1060
- options: [
1061
- { label: "None", value: "none" },
1062
- { label: "Cloud", value: "cloud" },
1063
- { label: "Sand", value: "sand" },
1064
- { label: "Mint", value: "mint" },
1065
- { label: "Night", value: "night" }
1066
- ]
1067
- },
1068
- {
1069
- name: "contentGradientFrom",
1070
- type: "text",
1071
- defaultValue: sectionStyleDefaults.contentGradientFrom
1072
- },
1073
- {
1074
- name: "contentGradientTo",
1075
- type: "text",
1076
- defaultValue: sectionStyleDefaults.contentGradientTo
1077
- },
1078
- {
1079
- name: "contentGradientAngle",
1080
- type: "text",
1081
- defaultValue: sectionStyleDefaults.contentGradientAngle
1082
- }
1083
- ];
1084
-
1085
- // src/blocks/blocks/BeforeAfter.ts
1086
- var BeforeAfterBlock = {
1087
- slug: "beforeAfter",
1088
- imageURL: "/images/project-before-2.svg",
1089
- imageAltText: "Before and after section preview",
1292
+ var hideFromCMS = (field) => ({
1293
+ ...field,
1090
1294
  admin: {
1091
- components: {
1092
- Label: builderBlockLabelComponent
1093
- }
1094
- },
1095
- labels: {
1096
- singular: "Before / After",
1097
- plural: "Before / After"
1098
- },
1099
- fields: [
1295
+ ...field.admin || {},
1296
+ hidden: true
1297
+ }
1298
+ });
1299
+ var sectionStyleFields = () => {
1300
+ const fields = [
1100
1301
  {
1101
- name: "title",
1102
- type: "text",
1103
- required: true
1302
+ name: "sectionWidth",
1303
+ type: "select",
1304
+ defaultValue: sectionStyleDefaults.sectionWidth,
1305
+ options: [
1306
+ { label: "Content", value: "content" },
1307
+ { label: "Wide", value: "wide" },
1308
+ { label: "Full", value: "full" }
1309
+ ]
1104
1310
  },
1105
1311
  {
1106
- name: "subtitle",
1107
- type: "textarea"
1312
+ name: "contentWidth",
1313
+ type: "select",
1314
+ defaultValue: sectionStyleDefaults.contentWidth,
1315
+ options: [
1316
+ { label: "Inherit", value: "inherit" },
1317
+ { label: "Narrow", value: "narrow" },
1318
+ { label: "Content", value: "content" },
1319
+ { label: "Wide", value: "wide" },
1320
+ { label: "Full", value: "full" }
1321
+ ]
1108
1322
  },
1109
1323
  {
1110
- name: "itemsPerRow",
1111
- type: "number",
1112
- defaultValue: 2,
1113
- min: 1,
1114
- max: 4,
1115
- admin: {
1116
- description: "How many project cards to show per row on desktop.",
1117
- step: 1
1118
- }
1324
+ name: "sectionPaddingY",
1325
+ type: "select",
1326
+ defaultValue: sectionStyleDefaults.sectionPaddingY,
1327
+ options: [
1328
+ { label: "None", value: "none" },
1329
+ { label: "Small", value: "sm" },
1330
+ { label: "Medium", value: "md" },
1331
+ { label: "Large", value: "lg" }
1332
+ ]
1119
1333
  },
1120
1334
  {
1121
- name: "items",
1122
- type: "array",
1123
- minRows: 1,
1124
- maxRows: 30,
1125
- fields: [
1126
- {
1127
- name: "label",
1128
- type: "text",
1129
- required: true
1130
- },
1131
- {
1132
- name: "beforeMedia",
1133
- type: "upload",
1134
- relationTo: "media",
1135
- required: false
1136
- },
1335
+ name: "sectionPaddingX",
1336
+ type: "select",
1337
+ defaultValue: sectionStyleDefaults.sectionPaddingX,
1338
+ options: [
1339
+ { label: "Inherit", value: "inherit" },
1340
+ { label: "None", value: "none" },
1341
+ { label: "Small", value: "sm" },
1342
+ { label: "Medium", value: "md" },
1343
+ { label: "Large", value: "lg" }
1344
+ ]
1345
+ },
1346
+ {
1347
+ name: "sectionBackgroundMode",
1348
+ type: "select",
1349
+ defaultValue: sectionStyleDefaults.sectionBackgroundMode,
1350
+ options: [
1351
+ { label: "None", value: "none" },
1352
+ { label: "Color", value: "color" },
1353
+ { label: "Gradient", value: "gradient" }
1354
+ ]
1355
+ },
1356
+ {
1357
+ name: "sectionBackgroundColor",
1358
+ type: "text",
1359
+ defaultValue: sectionStyleDefaults.sectionBackgroundColor
1360
+ },
1361
+ {
1362
+ name: "sectionGradientPreset",
1363
+ type: "select",
1364
+ defaultValue: sectionStyleDefaults.sectionGradientPreset,
1365
+ options: [
1366
+ { label: "None", value: "none" },
1367
+ { label: "Brand", value: "brand" },
1368
+ { label: "Forest", value: "forest" },
1369
+ { label: "Moss", value: "moss" },
1370
+ { label: "Cream", value: "cream" },
1371
+ { label: "Slate", value: "slate" }
1372
+ ]
1373
+ },
1374
+ {
1375
+ name: "sectionGradientFrom",
1376
+ type: "text",
1377
+ defaultValue: sectionStyleDefaults.sectionGradientFrom
1378
+ },
1379
+ {
1380
+ name: "sectionGradientTo",
1381
+ type: "text",
1382
+ defaultValue: sectionStyleDefaults.sectionGradientTo
1383
+ },
1384
+ {
1385
+ name: "sectionGradientAngle",
1386
+ type: "text",
1387
+ defaultValue: sectionStyleDefaults.sectionGradientAngle
1388
+ },
1389
+ {
1390
+ name: "contentBackgroundMode",
1391
+ type: "select",
1392
+ defaultValue: sectionStyleDefaults.contentBackgroundMode,
1393
+ options: [
1394
+ { label: "None", value: "none" },
1395
+ { label: "Color", value: "color" },
1396
+ { label: "Gradient", value: "gradient" }
1397
+ ]
1398
+ },
1399
+ {
1400
+ name: "contentBackgroundColor",
1401
+ type: "text",
1402
+ defaultValue: sectionStyleDefaults.contentBackgroundColor
1403
+ },
1404
+ {
1405
+ name: "contentGradientPreset",
1406
+ type: "select",
1407
+ defaultValue: sectionStyleDefaults.contentGradientPreset,
1408
+ options: [
1409
+ { label: "None", value: "none" },
1410
+ { label: "Cloud", value: "cloud" },
1411
+ { label: "Sand", value: "sand" },
1412
+ { label: "Mint", value: "mint" },
1413
+ { label: "Night", value: "night" }
1414
+ ]
1415
+ },
1416
+ {
1417
+ name: "contentGradientFrom",
1418
+ type: "text",
1419
+ defaultValue: sectionStyleDefaults.contentGradientFrom
1420
+ },
1421
+ {
1422
+ name: "contentGradientTo",
1423
+ type: "text",
1424
+ defaultValue: sectionStyleDefaults.contentGradientTo
1425
+ },
1426
+ {
1427
+ name: "contentGradientAngle",
1428
+ type: "text",
1429
+ defaultValue: sectionStyleDefaults.contentGradientAngle
1430
+ }
1431
+ ];
1432
+ return fields.map(hideFromCMS);
1433
+ };
1434
+
1435
+ // src/blocks/blocks/BeforeAfter.ts
1436
+ var BeforeAfterBlock = {
1437
+ slug: "beforeAfter",
1438
+ imageURL: "/images/project-before-2.svg",
1439
+ imageAltText: "Before and after section preview",
1440
+ admin: {
1441
+ components: {
1442
+ Label: builderBlockLabelComponent
1443
+ }
1444
+ },
1445
+ labels: {
1446
+ singular: "Before / After",
1447
+ plural: "Before / After"
1448
+ },
1449
+ fields: [
1450
+ {
1451
+ name: "title",
1452
+ type: "text",
1453
+ required: true
1454
+ },
1455
+ {
1456
+ name: "subtitle",
1457
+ type: "textarea"
1458
+ },
1459
+ {
1460
+ name: "itemsPerRow",
1461
+ type: "number",
1462
+ defaultValue: 2,
1463
+ min: 1,
1464
+ max: 4,
1465
+ admin: {
1466
+ description: "How many project cards to show per row on desktop.",
1467
+ step: 1
1468
+ }
1469
+ },
1470
+ {
1471
+ name: "items",
1472
+ type: "array",
1473
+ minRows: 1,
1474
+ maxRows: 30,
1475
+ fields: [
1476
+ {
1477
+ name: "label",
1478
+ type: "text",
1479
+ required: true
1480
+ },
1481
+ {
1482
+ name: "beforeMedia",
1483
+ type: "upload",
1484
+ relationTo: "media",
1485
+ required: false
1486
+ },
1487
+ {
1488
+ name: "beforeImageURL",
1489
+ type: "text",
1490
+ admin: {
1491
+ description: "Optional direct URL for the before image when using an external asset."
1492
+ }
1493
+ },
1137
1494
  {
1138
1495
  name: "afterMedia",
1139
1496
  type: "upload",
1140
1497
  relationTo: "media",
1141
1498
  required: false
1142
1499
  },
1500
+ {
1501
+ name: "afterImageURL",
1502
+ type: "text",
1503
+ admin: {
1504
+ description: "Optional direct URL for the after image when using an external asset."
1505
+ }
1506
+ },
1143
1507
  {
1144
1508
  name: "imageHeight",
1145
1509
  type: "number",
@@ -1295,6 +1659,10 @@ var CtaBlock = {
1295
1659
  name: "description",
1296
1660
  type: "textarea"
1297
1661
  },
1662
+ {
1663
+ name: "eyebrow",
1664
+ type: "text"
1665
+ },
1298
1666
  {
1299
1667
  name: "buttonLabel",
1300
1668
  type: "text"
@@ -1325,9 +1693,33 @@ var CtaBlock = {
1325
1693
  name: "backgroundColor",
1326
1694
  type: "text",
1327
1695
  admin: {
1328
- description: "Optional background color override for the CTA strip (example: #124a37)."
1696
+ description: "Optional background color override for the CTA strip (example: #334b63)."
1697
+ }
1698
+ },
1699
+ {
1700
+ name: "media",
1701
+ type: "upload",
1702
+ relationTo: "media",
1703
+ required: false
1704
+ },
1705
+ {
1706
+ name: "imageURL",
1707
+ type: "text",
1708
+ admin: {
1709
+ description: "Optional direct image URL when this CTA should use an external image."
1329
1710
  }
1330
1711
  },
1712
+ {
1713
+ name: "bullets",
1714
+ type: "array",
1715
+ fields: [
1716
+ {
1717
+ name: "label",
1718
+ type: "text",
1719
+ required: true
1720
+ }
1721
+ ]
1722
+ },
1331
1723
  {
1332
1724
  name: "settings",
1333
1725
  type: "json",
@@ -1355,6 +1747,10 @@ var FaqBlock = {
1355
1747
  plural: "FAQs"
1356
1748
  },
1357
1749
  fields: [
1750
+ {
1751
+ name: "eyebrow",
1752
+ type: "text"
1753
+ },
1358
1754
  {
1359
1755
  name: "title",
1360
1756
  type: "text",
@@ -1412,10 +1808,17 @@ var FeatureGridBlock = {
1412
1808
  plural: "Feature Grids"
1413
1809
  },
1414
1810
  fields: [
1811
+ {
1812
+ name: "eyebrow",
1813
+ type: "text"
1814
+ },
1415
1815
  {
1416
1816
  name: "title",
1417
- type: "text",
1418
- required: true
1817
+ type: "text"
1818
+ },
1819
+ {
1820
+ name: "subtitle",
1821
+ type: "textarea"
1419
1822
  },
1420
1823
  {
1421
1824
  name: "itemsPerRow",
@@ -1443,6 +1846,16 @@ var FeatureGridBlock = {
1443
1846
  name: "description",
1444
1847
  type: "textarea"
1445
1848
  },
1849
+ {
1850
+ name: "tone",
1851
+ type: "select",
1852
+ defaultValue: "warm",
1853
+ options: [
1854
+ { label: "Warm", value: "warm" },
1855
+ { label: "Cool", value: "cool" },
1856
+ { label: "Neutral", value: "neutral" }
1857
+ ]
1858
+ },
1446
1859
  {
1447
1860
  name: "iconType",
1448
1861
  type: "select",
@@ -1488,6 +1901,39 @@ var FeatureGridBlock = {
1488
1901
  relationTo: "media",
1489
1902
  required: false
1490
1903
  },
1904
+ {
1905
+ name: "imageURL",
1906
+ type: "text",
1907
+ admin: {
1908
+ description: "Optional direct image URL when this item should use an external image."
1909
+ }
1910
+ },
1911
+ {
1912
+ name: "embedURL",
1913
+ type: "text",
1914
+ admin: {
1915
+ description: "Optional iframe/embed URL for items like maps or other embedded content."
1916
+ }
1917
+ },
1918
+ {
1919
+ name: "buttonLabel",
1920
+ type: "text"
1921
+ },
1922
+ {
1923
+ name: "buttonHref",
1924
+ type: "text"
1925
+ },
1926
+ {
1927
+ name: "bullets",
1928
+ type: "array",
1929
+ fields: [
1930
+ {
1931
+ name: "label",
1932
+ type: "text",
1933
+ required: true
1934
+ }
1935
+ ]
1936
+ },
1491
1937
  {
1492
1938
  name: "imageHeight",
1493
1939
  type: "number",
@@ -1570,6 +2016,22 @@ var FeatureGridBlock = {
1570
2016
  {
1571
2017
  label: "Highlight",
1572
2018
  value: "highlight"
2019
+ },
2020
+ {
2021
+ label: "Split List",
2022
+ value: "splitList"
2023
+ },
2024
+ {
2025
+ label: "Panels",
2026
+ value: "panels"
2027
+ },
2028
+ {
2029
+ label: "Catalog",
2030
+ value: "catalog"
2031
+ },
2032
+ {
2033
+ label: "Contact Split",
2034
+ value: "contact"
1573
2035
  }
1574
2036
  ]
1575
2037
  },
@@ -1577,7 +2039,7 @@ var FeatureGridBlock = {
1577
2039
  name: "backgroundColor",
1578
2040
  type: "text",
1579
2041
  admin: {
1580
- description: "Optional background color override when using the Highlight variant (example: #1f684f)."
2042
+ description: "Optional background color override when using the Highlight variant (example: #334b63)."
1581
2043
  }
1582
2044
  },
1583
2045
  {
@@ -1607,6 +2069,10 @@ var FormEmbedBlock = {
1607
2069
  plural: "Form Embeds"
1608
2070
  },
1609
2071
  fields: [
2072
+ {
2073
+ name: "eyebrow",
2074
+ type: "text"
2075
+ },
1610
2076
  {
1611
2077
  name: "title",
1612
2078
  type: "text"
@@ -1615,6 +2081,10 @@ var FormEmbedBlock = {
1615
2081
  name: "description",
1616
2082
  type: "textarea"
1617
2083
  },
2084
+ {
2085
+ name: "submitLabel",
2086
+ type: "text"
2087
+ },
1618
2088
  {
1619
2089
  name: "formType",
1620
2090
  type: "select",
@@ -1696,6 +2166,13 @@ var HeroBlock = {
1696
2166
  type: "upload",
1697
2167
  relationTo: "media"
1698
2168
  },
2169
+ {
2170
+ name: "backgroundImageURL",
2171
+ type: "text",
2172
+ admin: {
2173
+ description: "Optional direct image URL when the hero should use an external image source."
2174
+ }
2175
+ },
1699
2176
  {
1700
2177
  name: "backgroundImageFit",
1701
2178
  type: "select",
@@ -1741,7 +2218,7 @@ var HeroBlock = {
1741
2218
  name: "backgroundColor",
1742
2219
  type: "text",
1743
2220
  admin: {
1744
- description: "Optional background color override (example: #124a37)."
2221
+ description: "Optional background color override (example: #334b63)."
1745
2222
  }
1746
2223
  },
1747
2224
  {
@@ -1779,14 +2256,14 @@ var HeroBlock = {
1779
2256
  name: "backgroundOverlayGradientFrom",
1780
2257
  type: "text",
1781
2258
  admin: {
1782
- description: "Gradient overlay start color (example: #0d4a37). Used when Overlay Mode is Gradient."
2259
+ description: "Gradient overlay start color (example: #334b63). Used when Overlay Mode is Gradient."
1783
2260
  }
1784
2261
  },
1785
2262
  {
1786
2263
  name: "backgroundOverlayGradientTo",
1787
2264
  type: "text",
1788
2265
  admin: {
1789
- description: "Gradient overlay end color (example: #1f684f). Used when Overlay Mode is Gradient."
2266
+ description: "Gradient overlay end color (example: #496582). Used when Overlay Mode is Gradient."
1790
2267
  }
1791
2268
  },
1792
2269
  {
@@ -1941,6 +2418,13 @@ var LogoWallBlock = {
1941
2418
  relationTo: "media",
1942
2419
  required: false
1943
2420
  },
2421
+ {
2422
+ name: "imageURL",
2423
+ type: "text",
2424
+ admin: {
2425
+ description: "Optional direct image URL for this logo when using an external asset."
2426
+ }
2427
+ },
1944
2428
  {
1945
2429
  name: "imageHeight",
1946
2430
  type: "number",
@@ -2046,7 +2530,14 @@ var MediaBlock = {
2046
2530
  name: "image",
2047
2531
  type: "upload",
2048
2532
  relationTo: "media",
2049
- required: true
2533
+ required: false
2534
+ },
2535
+ {
2536
+ name: "imageURL",
2537
+ type: "text",
2538
+ admin: {
2539
+ description: "Optional direct image URL when this section should use an external image."
2540
+ }
2050
2541
  },
2051
2542
  {
2052
2543
  name: "caption",
@@ -2124,6 +2615,21 @@ var RichTextBlock = {
2124
2615
  plural: "Rich Text Sections"
2125
2616
  },
2126
2617
  fields: [
2618
+ {
2619
+ name: "variant",
2620
+ type: "select",
2621
+ defaultValue: "default",
2622
+ options: [
2623
+ {
2624
+ label: "Default",
2625
+ value: "default"
2626
+ },
2627
+ {
2628
+ label: "Quote Banner",
2629
+ value: "quoteBanner"
2630
+ }
2631
+ ]
2632
+ },
2127
2633
  {
2128
2634
  name: "title",
2129
2635
  type: "text"
@@ -2134,36 +2640,84 @@ var RichTextBlock = {
2134
2640
  required: true
2135
2641
  },
2136
2642
  {
2137
- name: "width",
2138
- type: "select",
2139
- defaultValue: "normal",
2140
- options: [
2643
+ name: "statsItems",
2644
+ type: "array",
2645
+ fields: [
2141
2646
  {
2142
- label: "Normal",
2143
- value: "normal"
2647
+ name: "value",
2648
+ type: "text",
2649
+ required: true
2144
2650
  },
2145
2651
  {
2146
- label: "Narrow",
2147
- value: "narrow"
2652
+ name: "label",
2653
+ type: "text",
2654
+ required: true
2148
2655
  }
2149
2656
  ]
2150
2657
  },
2151
2658
  {
2152
- name: "settings",
2153
- type: "json",
2154
- admin: {
2155
- description: "Internal builder settings schema v2.",
2156
- hidden: true
2157
- }
2158
- },
2159
- ...sectionStyleFields()
2160
- ]
2161
- };
2162
-
2163
- // src/blocks/blocks/Stats.ts
2164
- var StatsBlock = {
2165
- slug: "stats",
2166
- imageURL: "/images/service-removal.svg",
2659
+ name: "cards",
2660
+ type: "array",
2661
+ fields: [
2662
+ {
2663
+ name: "eyebrow",
2664
+ type: "text"
2665
+ },
2666
+ {
2667
+ name: "title",
2668
+ type: "text",
2669
+ required: true
2670
+ },
2671
+ {
2672
+ name: "description",
2673
+ type: "textarea"
2674
+ },
2675
+ {
2676
+ name: "media",
2677
+ type: "upload",
2678
+ relationTo: "media",
2679
+ required: false
2680
+ },
2681
+ {
2682
+ name: "imageURL",
2683
+ type: "text",
2684
+ admin: {
2685
+ description: "Optional direct image URL when this card should use an external image."
2686
+ }
2687
+ }
2688
+ ]
2689
+ },
2690
+ {
2691
+ name: "width",
2692
+ type: "select",
2693
+ defaultValue: "normal",
2694
+ options: [
2695
+ {
2696
+ label: "Normal",
2697
+ value: "normal"
2698
+ },
2699
+ {
2700
+ label: "Narrow",
2701
+ value: "narrow"
2702
+ }
2703
+ ]
2704
+ },
2705
+ {
2706
+ name: "settings",
2707
+ type: "json",
2708
+ admin: {
2709
+ description: "Internal builder settings schema v2.",
2710
+ hidden: true
2711
+ }
2712
+ },
2713
+ ...sectionStyleFields()
2714
+ ]
2715
+ };
2716
+
2717
+ // src/blocks/blocks/Stats.ts
2718
+ var StatsBlock = {
2719
+ slug: "stats",
2720
+ imageURL: "/images/service-removal.svg",
2167
2721
  imageAltText: "Stats section preview",
2168
2722
  admin: {
2169
2723
  components: {
@@ -2387,18 +2941,18 @@ var sectionPresets = [
2387
2941
  blocks: [
2388
2942
  {
2389
2943
  blockType: "hero",
2390
- kicker: "Licensed + Insured",
2391
- headline: "Expert Tree Care for Central Texas",
2392
- subheadline: "Reliable trimming, safe removals, and stump grinding for residential and commercial properties.",
2393
- primaryLabel: "Get Your Free Quote",
2944
+ kicker: "Trusted Team",
2945
+ headline: "A clear headline for your primary offer",
2946
+ subheadline: "Explain what you offer, who it is for, and why it matters in one strong supporting sentence.",
2947
+ primaryLabel: "Get Started",
2394
2948
  primaryHref: "/contact",
2395
- secondaryLabel: "See Our Work",
2396
- secondaryHref: "/portfolio"
2949
+ secondaryLabel: "Learn More",
2950
+ secondaryHref: "/about"
2397
2951
  },
2398
2952
  {
2399
2953
  blockType: "cta",
2400
- headline: "Need a quote this week?",
2401
- description: "Call (512) 555-0149 or request an on-site estimate online.",
2954
+ headline: "Ready for the next step?",
2955
+ description: "Use a short call to action with a direct path to contact or purchase.",
2402
2956
  buttonLabel: "Contact Us",
2403
2957
  buttonHref: "/contact",
2404
2958
  style: "light"
@@ -2416,19 +2970,19 @@ var sectionPresets = [
2416
2970
  variant: "cards",
2417
2971
  items: [
2418
2972
  {
2419
- title: "Tree Trimming & Pruning",
2420
- description: "Canopy balancing, deadwood removal, and seasonal pruning.",
2421
- icon: "Trim"
2973
+ title: "Service One",
2974
+ description: "Briefly describe this offer or outcome.",
2975
+ icon: "01"
2422
2976
  },
2423
2977
  {
2424
- title: "Safe Tree Removal",
2425
- description: "Controlled removal for hazardous or unstable trees.",
2426
- icon: "Remove"
2978
+ title: "Service Two",
2979
+ description: "Briefly describe this offer or outcome.",
2980
+ icon: "02"
2427
2981
  },
2428
2982
  {
2429
- title: "Stump Grinding",
2430
- description: "Below-grade stump grinding and cleanup.",
2431
- icon: "Stump"
2983
+ title: "Service Three",
2984
+ description: "Briefly describe this offer or outcome.",
2985
+ icon: "03"
2432
2986
  }
2433
2987
  ]
2434
2988
  }
@@ -2444,15 +2998,15 @@ var sectionPresets = [
2444
2998
  title: "What Homeowners Say",
2445
2999
  items: [
2446
3000
  {
2447
- quote: "Great communication, fair pricing, and the cleanup was perfect. We will use them again.",
2448
- name: "Katie M.",
2449
- location: "Austin, TX",
3001
+ quote: "The experience was smooth, thoughtful, and exactly what we hoped for.",
3002
+ name: "Customer Name",
3003
+ location: "City, ST",
2450
3004
  rating: 5
2451
3005
  },
2452
3006
  {
2453
- quote: "They removed a dangerous limb over our driveway quickly and safely.",
2454
- name: "James R.",
2455
- location: "Round Rock, TX",
3007
+ quote: "Fast communication, strong service, and a result we would happily recommend.",
3008
+ name: "Customer Name",
3009
+ location: "City, ST",
2456
3010
  rating: 5
2457
3011
  }
2458
3012
  ]
@@ -2462,12 +3016,12 @@ var sectionPresets = [
2462
3016
  title: "Common Questions",
2463
3017
  items: [
2464
3018
  {
2465
- question: "How quickly can you schedule service?",
2466
- answer: "Most estimate requests are scheduled within 24 hours."
3019
+ question: "How quickly do you respond?",
3020
+ answer: "Replace this with a concise answer to a common customer question."
2467
3021
  },
2468
3022
  {
2469
- question: "Do you provide cleanup?",
2470
- answer: "Yes. Debris haul-off and cleanup are included in quoted scopes."
3023
+ question: "What is included?",
3024
+ answer: "Replace this with another concise answer that reduces buying friction."
2471
3025
  }
2472
3026
  ]
2473
3027
  }
@@ -2481,13 +3035,13 @@ var sectionPresets = [
2481
3035
  {
2482
3036
  blockType: "formEmbed",
2483
3037
  title: "Request a Quote",
2484
- description: "Share your project details and we will follow up quickly.",
3038
+ description: "Share a few details and your team can follow up with next steps.",
2485
3039
  formType: "quote"
2486
3040
  },
2487
3041
  {
2488
3042
  blockType: "bookingEmbed",
2489
3043
  title: "Prefer to book a consultation?",
2490
- description: "Choose a time window and we will confirm availability.",
3044
+ description: "Offer an alternative scheduling path for visitors who prefer to book directly.",
2491
3045
  buttonLabel: "Book Consultation",
2492
3046
  buttonHref: "/contact"
2493
3047
  }
@@ -2499,14 +3053,14 @@ var templateStarterPresets = {
2499
3053
  {
2500
3054
  blockType: "hero",
2501
3055
  headline: "Contact Us",
2502
- subheadline: "Request a quote, ask a question, or book a consultation window.",
2503
- primaryLabel: "Call (512) 555-0149",
2504
- primaryHref: "tel:+15125550149"
3056
+ subheadline: "Tell visitors exactly how to reach you and what to expect next.",
3057
+ primaryLabel: "Email Us",
3058
+ primaryHref: "mailto:hello@example.com"
2505
3059
  },
2506
3060
  {
2507
3061
  blockType: "formEmbed",
2508
3062
  title: "Request a Quote",
2509
- description: "Tell us about your project and we will follow up quickly.",
3063
+ description: "Use this space for a form embed or lead capture flow.",
2510
3064
  formType: "quote"
2511
3065
  },
2512
3066
  {
@@ -2514,8 +3068,8 @@ var templateStarterPresets = {
2514
3068
  title: "Common Questions",
2515
3069
  items: [
2516
3070
  {
2517
- question: "How quickly can you provide an estimate?",
2518
- answer: "Most estimates are scheduled within 24 hours."
3071
+ question: "How quickly will you respond?",
3072
+ answer: "Replace with the answer that best fits your operating process."
2519
3073
  }
2520
3074
  ]
2521
3075
  }
@@ -2524,27 +3078,27 @@ var templateStarterPresets = {
2524
3078
  {
2525
3079
  blockType: "hero",
2526
3080
  kicker: "Locally Owned",
2527
- headline: "Expert Tree Care for Central Texas",
2528
- subheadline: "Premium trimming, removal, and cleanup with safety-first execution.",
2529
- primaryLabel: "Get Your Free Quote",
3081
+ headline: "Lead with your strongest offer",
3082
+ subheadline: "Support the headline with a concise sentence that clarifies benefits and audience.",
3083
+ primaryLabel: "Get Started",
2530
3084
  primaryHref: "/contact",
2531
3085
  secondaryLabel: "View Services",
2532
3086
  secondaryHref: "/services"
2533
3087
  },
2534
3088
  {
2535
3089
  blockType: "featureGrid",
2536
- title: "Why Homeowners Choose Us",
3090
+ title: "Why clients choose us",
2537
3091
  variant: "highlight",
2538
3092
  items: [
2539
- { title: "Transparent Pricing", description: "Clear written estimates.", icon: "01" },
2540
- { title: "Safety-First Crew", description: "Property protection and planning.", icon: "02" },
2541
- { title: "Fast Scheduling", description: "Quick estimates and service windows.", icon: "03" }
3093
+ { title: "Clear Value", description: "Explain your first differentiator.", icon: "01" },
3094
+ { title: "Reliable Process", description: "Explain your second differentiator.", icon: "02" },
3095
+ { title: "Strong Results", description: "Explain your third differentiator.", icon: "03" }
2542
3096
  ]
2543
3097
  },
2544
3098
  {
2545
3099
  blockType: "cta",
2546
- headline: "Need a quote this week?",
2547
- description: "Call (512) 555-0149 or request an estimate online.",
3100
+ headline: "Ready to take the next step?",
3101
+ description: "Add a direct conversion prompt with a clear primary action.",
2548
3102
  buttonLabel: "Contact Us",
2549
3103
  buttonHref: "/contact",
2550
3104
  style: "light"
@@ -2553,9 +3107,9 @@ var templateStarterPresets = {
2553
3107
  services: [
2554
3108
  {
2555
3109
  blockType: "hero",
2556
- headline: "Tree Services Built for Safety and Curb Appeal",
2557
- subheadline: "Core offerings first, with clear scopes and scheduling.",
2558
- primaryLabel: "Schedule Estimate",
3110
+ headline: "Services Built Around Your Process",
3111
+ subheadline: "Summarize the core offerings with a short clarity-first introduction.",
3112
+ primaryLabel: "Request Info",
2559
3113
  primaryHref: "/contact"
2560
3114
  },
2561
3115
  {
@@ -2564,19 +3118,19 @@ var templateStarterPresets = {
2564
3118
  variant: "cards",
2565
3119
  items: [
2566
3120
  {
2567
- title: "Tree Trimming & Pruning",
2568
- description: "Selective pruning for structure, clearance, and health.",
2569
- icon: "Trim"
3121
+ title: "Service One",
3122
+ description: "Replace with a short description.",
3123
+ icon: "01"
2570
3124
  },
2571
3125
  {
2572
- title: "Tree Removal",
2573
- description: "Controlled removal for unstable or hazardous trees.",
2574
- icon: "Remove"
3126
+ title: "Service Two",
3127
+ description: "Replace with a short description.",
3128
+ icon: "02"
2575
3129
  },
2576
3130
  {
2577
- title: "Stump Grinding",
2578
- description: "Below-grade grinding and cleanup.",
2579
- icon: "Stump"
3131
+ title: "Service Three",
3132
+ description: "Replace with a short description.",
3133
+ icon: "03"
2580
3134
  }
2581
3135
  ]
2582
3136
  },
@@ -2585,8 +3139,8 @@ var templateStarterPresets = {
2585
3139
  title: "Frequently Asked Questions",
2586
3140
  items: [
2587
3141
  {
2588
- question: "Do you handle storm cleanup?",
2589
- answer: "Yes. We prioritize urgent hazards after severe weather."
3142
+ question: "Do you offer custom scopes?",
3143
+ answer: "Replace this with an answer that fits your business."
2590
3144
  }
2591
3145
  ]
2592
3146
  }
@@ -2984,20 +3538,6 @@ function migrateStudioDocument(value, migrations) {
2984
3538
  return assertStudioDocumentV1(current);
2985
3539
  }
2986
3540
 
2987
- // src/studio-pages/index.ts
2988
- var studio_pages_exports = {};
2989
- __export(studio_pages_exports, {
2990
- createDefaultStudioDocument: () => createDefaultStudioDocument,
2991
- defaultBuilderThemeTokens: () => defaultBuilderThemeTokens,
2992
- layoutToStudioDocument: () => layoutToStudioDocument,
2993
- pageInspectorPanels: () => pageInspectorPanels,
2994
- pageNodeTypes: () => pageNodeTypes,
2995
- pagePaletteGroups: () => pagePaletteGroups,
2996
- pageStudioModuleManifest: () => pageStudioModuleManifest,
2997
- resolveBuilderThemeTokens: () => resolveBuilderThemeTokens,
2998
- studioDocumentToLayout: () => studioDocumentToLayout
2999
- });
3000
-
3001
3541
  // src/studio-pages/builder/settings-v2/types.ts
3002
3542
  var defaultBuilderBlockSettingsV2 = {
3003
3543
  advanced: {
@@ -3011,13 +3551,13 @@ var defaultBuilderBlockSettingsV2 = {
3011
3551
  contentGradientAngle: "135",
3012
3552
  contentGradientFrom: "#ffffff",
3013
3553
  contentGradientPreset: "none",
3014
- contentGradientTo: "#f4f6f2",
3554
+ contentGradientTo: "#f4f6f8",
3015
3555
  sectionBackgroundColor: "#ffffff",
3016
3556
  sectionBackgroundMode: "none",
3017
3557
  sectionGradientAngle: "135",
3018
- sectionGradientFrom: "#124a37",
3019
- sectionGradientPreset: "forest",
3020
- sectionGradientTo: "#1f684f"
3558
+ sectionGradientFrom: "#334b63",
3559
+ sectionGradientPreset: "slate",
3560
+ sectionGradientTo: "#496582"
3021
3561
  },
3022
3562
  layout: {
3023
3563
  contentWidth: "inherit",
@@ -3078,9 +3618,9 @@ var defaultBuilderItemSettingsV2 = {
3078
3618
  };
3079
3619
  var defaultBuilderThemeTokens = {
3080
3620
  colors: {
3081
- accent: "#0d4a37",
3082
- bodyText: "#13211c",
3083
- headingText: "#13211c",
3621
+ accent: "#334b63",
3622
+ bodyText: "#425163",
3623
+ headingText: "#182332",
3084
3624
  surface: "#ffffff"
3085
3625
  },
3086
3626
  radii: {
@@ -3276,218 +3816,433 @@ var migrateBlockToSettingsV2 = (block) => {
3276
3816
  };
3277
3817
  };
3278
3818
 
3279
- // src/studio-pages/builder/settings-v2/themeTokens.ts
3280
- var isRecord4 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
3281
- var merge = (base, next) => {
3282
- if (!next || !isRecord4(next)) {
3283
- return base;
3284
- }
3285
- const merged = { ...base };
3286
- for (const [key, value] of Object.entries(next)) {
3287
- if (isRecord4(value) && isRecord4(merged[key])) {
3288
- merged[key] = merge(merged[key], value);
3289
- continue;
3290
- }
3291
- if (typeof value !== "undefined") {
3292
- merged[key] = value;
3293
- }
3819
+ // src/studio-pages/document.ts
3820
+ var ensureNodeID = (value, index) => {
3821
+ if (typeof value === "string" && value.trim().length > 0) {
3822
+ return value.trim();
3294
3823
  }
3295
- return merged;
3824
+ return `node-${index + 1}`;
3296
3825
  };
3297
- var resolveBuilderThemeTokens = (layers) => {
3298
- const withSite = merge(defaultBuilderThemeTokens, layers.site);
3299
- const withPage = merge(withSite, layers.page);
3300
- return merge(withPage, layers.block);
3826
+ var layoutToStudioDocument = (layout, title, metadata) => {
3827
+ const nodes = layout.filter((block) => typeof block.blockType === "string").map((rawBlock, index) => {
3828
+ const block = migrateBlockToSettingsV2(rawBlock);
3829
+ const blockType = String(block.blockType);
3830
+ const { id, blockType: _ignoredBlockType, ...data } = block;
3831
+ return {
3832
+ id: ensureNodeID(id, index),
3833
+ type: blockType,
3834
+ data
3835
+ };
3836
+ });
3837
+ return {
3838
+ metadata,
3839
+ schemaVersion: 1,
3840
+ title,
3841
+ nodes,
3842
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3843
+ };
3301
3844
  };
3845
+ var studioDocumentToLayout = (document) => document.nodes.map(
3846
+ (node) => migrateBlockToSettingsV2({
3847
+ id: node.id,
3848
+ blockType: node.type,
3849
+ ...node.data
3850
+ })
3851
+ );
3852
+ var createDefaultStudioDocument = (title) => ({
3853
+ metadata: {},
3854
+ schemaVersion: 1,
3855
+ title,
3856
+ nodes: [],
3857
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
3858
+ });
3302
3859
 
3303
- // src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
3304
- var import_react2 = require("react");
3305
-
3306
- // src/studio-pages/builder/ui/Accordion.tsx
3307
- var import_react = require("react");
3308
- var import_jsx_runtime4 = require("react/jsx-runtime");
3309
-
3310
- // src/studio-pages/builder/ui/ImageControls.tsx
3311
- var import_jsx_runtime5 = require("react/jsx-runtime");
3312
-
3313
- // src/studio-pages/builder/settings-v2/inspectorSchema.ts
3314
- var alignOptions = [
3315
- { label: "Left", value: "left" },
3316
- { label: "Center", value: "center" },
3317
- { label: "Right", value: "right" },
3318
- { label: "Justify", value: "justify" }
3319
- ];
3320
- var layoutFieldSet = [
3321
- {
3322
- group: "layout",
3323
- key: "settings.layout.contentWidth",
3324
- label: "Content Width",
3325
- options: [
3326
- { label: "Inherit Page Default", value: "inherit" },
3327
- { label: "Narrow", value: "narrow" },
3328
- { label: "Content", value: "content" },
3329
- { label: "Wide", value: "wide" },
3330
- { label: "Full", value: "full" }
3331
- ],
3332
- tags: ["width", "container"],
3333
- type: "select"
3334
- },
3335
- {
3336
- group: "layout",
3337
- key: "settings.layout.linkVerticalPadding",
3338
- label: "Keep Top and Bottom Equal",
3339
- tags: ["spacing", "padding", "equal", "lock", "vertical"],
3340
- type: "checkbox"
3341
- },
3342
- {
3343
- group: "layout",
3344
- key: "settings.layout.paddingTopPt",
3345
- label: "Top Padding (pt)",
3346
- max: 240,
3347
- min: 0,
3348
- tags: ["spacing", "padding", "top", "vertical"],
3349
- type: "number"
3350
- },
3351
- {
3352
- group: "layout",
3353
- key: "settings.layout.paddingBottomPt",
3354
- label: "Bottom Padding (pt)",
3355
- max: 240,
3356
- min: 0,
3357
- tags: ["spacing", "padding", "bottom", "vertical"],
3358
- type: "number"
3359
- },
3360
- {
3361
- group: "layout",
3362
- key: "settings.layout.linkHorizontalPadding",
3363
- label: "Keep Left and Right Equal",
3364
- tags: ["spacing", "padding", "equal", "lock", "horizontal"],
3365
- type: "checkbox"
3366
- },
3367
- {
3368
- group: "layout",
3369
- key: "settings.layout.paddingLeftPt",
3370
- label: "Left Padding (pt)",
3371
- max: 240,
3372
- min: 0,
3373
- tags: ["spacing", "padding", "left", "horizontal"],
3374
- type: "number"
3375
- },
3376
- {
3377
- group: "layout",
3378
- key: "settings.layout.paddingRightPt",
3379
- label: "Right Padding (pt)",
3380
- max: 240,
3381
- min: 0,
3382
- tags: ["spacing", "padding", "right", "horizontal"],
3383
- type: "number"
3860
+ // src/nextjs/queries/pages.ts
3861
+ var PAGE_QUERY_CACHE_VERSION = "v4-published-only-public";
3862
+ function withStudioDocumentLayout(page) {
3863
+ if (!page) {
3864
+ return null;
3384
3865
  }
3385
- ];
3386
- var typographyFieldSet = [
3387
- {
3388
- group: "typography",
3389
- key: "settings.typography.headingAlign",
3390
- label: "Heading Alignment",
3391
- options: alignOptions,
3392
- tags: ["text", "align", "heading"],
3393
- type: "select"
3394
- },
3395
- {
3396
- group: "typography",
3397
- key: "settings.typography.bodyAlign",
3398
- label: "Body Alignment",
3399
- options: alignOptions,
3400
- tags: ["text", "align", "paragraph"],
3401
- type: "select"
3402
- },
3403
- {
3404
- group: "typography",
3405
- key: "settings.typography.maxTextWidth",
3406
- label: "Text Width",
3407
- options: [
3408
- { label: "Auto", value: "auto" },
3409
- { label: "Small", value: "sm" },
3410
- { label: "Medium", value: "md" },
3411
- { label: "Large", value: "lg" },
3412
- { label: "Full", value: "full" }
3413
- ],
3414
- tags: ["readability", "measure", "line length"],
3415
- type: "select"
3416
- },
3417
- {
3418
- advanced: true,
3419
- group: "typography",
3420
- key: "settings.typography.lineHeightPreset",
3421
- label: "Line Height",
3422
- options: [
3423
- { label: "Tight", value: "tight" },
3424
- { label: "Normal", value: "normal" },
3425
- { label: "Relaxed", value: "relaxed" }
3426
- ],
3427
- type: "select"
3428
- },
3429
- {
3430
- advanced: true,
3431
- group: "typography",
3432
- key: "settings.typography.letterSpacingPreset",
3433
- label: "Letter Spacing",
3434
- options: [
3435
- { label: "Tight", value: "tight" },
3436
- { label: "Normal", value: "normal" },
3437
- { label: "Relaxed", value: "relaxed" }
3438
- ],
3439
- type: "select"
3866
+ try {
3867
+ const studioDocument = assertStudioDocumentV1(page.studioDocument);
3868
+ const compiledLayout = studioDocumentToLayout(studioDocument);
3869
+ if (Array.isArray(compiledLayout) && compiledLayout.length > 0) {
3870
+ return {
3871
+ ...page,
3872
+ layout: compiledLayout
3873
+ };
3874
+ }
3875
+ } catch {
3440
3876
  }
3441
- ];
3442
- var styleFieldSet = [
3443
- {
3444
- group: "style",
3445
- key: "settings.appearance.sectionBackgroundMode",
3446
- label: "Section Background",
3447
- options: [
3448
- { label: "None", value: "none" },
3449
- { label: "Color", value: "color" },
3450
- { label: "Gradient", value: "gradient" }
3451
- ],
3452
- tags: ["background", "section"],
3453
- type: "select"
3454
- },
3455
- {
3456
- group: "style",
3457
- key: "settings.appearance.sectionBackgroundColor",
3458
- label: "Section Background Color",
3459
- type: "color"
3460
- },
3461
- {
3462
- group: "style",
3463
- key: "settings.appearance.contentBackgroundMode",
3464
- label: "Content Background",
3465
- options: [
3466
- { label: "None", value: "none" },
3467
- { label: "Color", value: "color" },
3468
- { label: "Gradient", value: "gradient" }
3469
- ],
3470
- tags: ["background", "content"],
3471
- type: "select"
3472
- },
3473
- {
3474
- group: "style",
3475
- key: "settings.appearance.contentBackgroundColor",
3476
- label: "Content Background Color",
3477
- type: "color"
3877
+ return page;
3878
+ }
3879
+ function normalizePath(segments) {
3880
+ if (!segments || segments.length === 0) {
3881
+ return "/";
3478
3882
  }
3479
- ];
3480
- var commonAdvanced = [
3481
- {
3482
- group: "advanced",
3483
- inlineEditable: false,
3484
- key: "settings.advanced.editCopyInPanel",
3485
- label: "Edit Copy In Panel",
3486
- tags: ["inline", "copy", "text"],
3487
- type: "checkbox"
3488
- },
3489
- {
3490
- advanced: true,
3883
+ const cleaned = segments.map((segment) => segment.trim()).filter(Boolean).join("/");
3884
+ return cleaned.length > 0 ? `/${cleaned}` : "/";
3885
+ }
3886
+ async function queryPageByPath(payload, path2, draft) {
3887
+ const pathWhere = {
3888
+ path: {
3889
+ equals: path2
3890
+ }
3891
+ };
3892
+ const publishedWhere = {
3893
+ _status: {
3894
+ equals: "published"
3895
+ }
3896
+ };
3897
+ const result = await payload.find({
3898
+ collection: "pages",
3899
+ depth: 2,
3900
+ draft,
3901
+ limit: 1,
3902
+ overrideAccess: false,
3903
+ where: draft ? pathWhere : { and: [pathWhere, publishedWhere] }
3904
+ });
3905
+ if (result.docs.length > 0) {
3906
+ return withStudioDocumentLayout(result.docs[0] || null);
3907
+ }
3908
+ if (path2 === "/") {
3909
+ const homeWhere = {
3910
+ slug: {
3911
+ equals: "home"
3912
+ }
3913
+ };
3914
+ const homeResult = await payload.find({
3915
+ collection: "pages",
3916
+ depth: 2,
3917
+ draft,
3918
+ limit: 1,
3919
+ overrideAccess: false,
3920
+ where: draft ? homeWhere : { and: [homeWhere, publishedWhere] }
3921
+ });
3922
+ return withStudioDocumentLayout(homeResult.docs[0] || null);
3923
+ }
3924
+ return null;
3925
+ }
3926
+ function createPageQueries(getPayloadClient, contentTag = "website-content") {
3927
+ const getPublishedPageByPathCached = (0, import_cache.unstable_cache)(
3928
+ async (path2) => {
3929
+ const payload = await getPayloadClient();
3930
+ return queryPageByPath(payload, path2, false);
3931
+ },
3932
+ ["page-by-path", PAGE_QUERY_CACHE_VERSION],
3933
+ { tags: [contentTag] }
3934
+ );
3935
+ async function getPageBySegments(segments, draft = false) {
3936
+ const path2 = normalizePath(segments);
3937
+ const payload = await getPayloadClient();
3938
+ if (draft) {
3939
+ return queryPageByPath(payload, path2, true);
3940
+ }
3941
+ return getPublishedPageByPathCached(path2);
3942
+ }
3943
+ async function listPublishedPagePaths() {
3944
+ const payload = await getPayloadClient();
3945
+ const pages = await payload.find({
3946
+ collection: "pages",
3947
+ depth: 0,
3948
+ draft: false,
3949
+ limit: 1e3,
3950
+ pagination: false,
3951
+ overrideAccess: false,
3952
+ where: {
3953
+ _status: {
3954
+ equals: "published"
3955
+ }
3956
+ }
3957
+ });
3958
+ return pages.docs.map((doc) => doc.path).filter((path2) => typeof path2 === "string" && path2.length > 0);
3959
+ }
3960
+ function pathToSegments(path2) {
3961
+ if (!path2 || path2 === "/") {
3962
+ return [];
3963
+ }
3964
+ return path2.split("/").filter(Boolean);
3965
+ }
3966
+ return {
3967
+ getPageBySegments,
3968
+ listPublishedPagePaths,
3969
+ pathToSegments
3970
+ };
3971
+ }
3972
+
3973
+ // src/nextjs/queries/site.ts
3974
+ var import_cache2 = require("next/cache");
3975
+ function createSiteQueries(getPayloadClient, contentTag = "website-content") {
3976
+ const getSiteSettingsCached = (0, import_cache2.unstable_cache)(
3977
+ async () => {
3978
+ const payload = await getPayloadClient();
3979
+ const settings = await payload.findGlobal({
3980
+ slug: "site-settings",
3981
+ depth: 1
3982
+ });
3983
+ return settings;
3984
+ },
3985
+ ["site-settings-global"],
3986
+ { tags: [contentTag] }
3987
+ );
3988
+ const getHeaderCached = (0, import_cache2.unstable_cache)(
3989
+ async () => {
3990
+ const payload = await getPayloadClient();
3991
+ const header = await payload.findGlobal({
3992
+ slug: "header",
3993
+ depth: 1
3994
+ });
3995
+ return header;
3996
+ },
3997
+ ["header-global"],
3998
+ { tags: [contentTag] }
3999
+ );
4000
+ const getFooterCached = (0, import_cache2.unstable_cache)(
4001
+ async () => {
4002
+ const payload = await getPayloadClient();
4003
+ const footer = await payload.findGlobal({
4004
+ slug: "footer",
4005
+ depth: 1
4006
+ });
4007
+ return footer;
4008
+ },
4009
+ ["footer-global"],
4010
+ { tags: [contentTag] }
4011
+ );
4012
+ const getSocialMediaCached = (0, import_cache2.unstable_cache)(
4013
+ async () => {
4014
+ const payload = await getPayloadClient();
4015
+ const socialMedia = await payload.findGlobal({
4016
+ slug: "social-media",
4017
+ depth: 1
4018
+ });
4019
+ return socialMedia;
4020
+ },
4021
+ ["social-media-global"],
4022
+ { tags: [contentTag] }
4023
+ );
4024
+ async function getSiteSettings(draft = false) {
4025
+ if (draft) {
4026
+ const payload = await getPayloadClient();
4027
+ const settings = await payload.findGlobal({
4028
+ slug: "site-settings",
4029
+ depth: 1,
4030
+ draft: true
4031
+ });
4032
+ return settings;
4033
+ }
4034
+ return getSiteSettingsCached();
4035
+ }
4036
+ async function getHeader(draft = false) {
4037
+ if (draft) {
4038
+ const payload = await getPayloadClient();
4039
+ const header = await payload.findGlobal({
4040
+ slug: "header",
4041
+ depth: 1,
4042
+ draft: true
4043
+ });
4044
+ return header;
4045
+ }
4046
+ return getHeaderCached();
4047
+ }
4048
+ async function getFooter(draft = false) {
4049
+ if (draft) {
4050
+ const payload = await getPayloadClient();
4051
+ const footer = await payload.findGlobal({
4052
+ slug: "footer",
4053
+ depth: 1,
4054
+ draft: true
4055
+ });
4056
+ return footer;
4057
+ }
4058
+ return getFooterCached();
4059
+ }
4060
+ async function getSocialMedia(draft = false) {
4061
+ if (draft) {
4062
+ const payload = await getPayloadClient();
4063
+ const socialMedia = await payload.findGlobal({
4064
+ slug: "social-media",
4065
+ depth: 1,
4066
+ draft: true
4067
+ });
4068
+ return socialMedia;
4069
+ }
4070
+ return getSocialMediaCached();
4071
+ }
4072
+ return {
4073
+ getSiteSettings,
4074
+ getHeader,
4075
+ getFooter,
4076
+ getSocialMedia
4077
+ };
4078
+ }
4079
+
4080
+ // src/nextjs/utilities/media.ts
4081
+ function resolveMedia(media) {
4082
+ if (!media) {
4083
+ return null;
4084
+ }
4085
+ if (typeof media === "number" || typeof media === "string") {
4086
+ return null;
4087
+ }
4088
+ if (media.url) {
4089
+ return {
4090
+ url: media.url,
4091
+ alt: media.alt || ""
4092
+ };
4093
+ }
4094
+ if (media.filename) {
4095
+ return {
4096
+ url: `/media/${media.filename}`,
4097
+ alt: media.alt || ""
4098
+ };
4099
+ }
4100
+ return null;
4101
+ }
4102
+
4103
+ // src/nextjs/utilities/socialMedia.ts
4104
+ function resolveSocialMediaLinks(data) {
4105
+ const profiles = data?.profiles;
4106
+ if (!profiles || typeof profiles !== "object") {
4107
+ return [];
4108
+ }
4109
+ return SOCIAL_MEDIA_PLATFORMS.reduce((acc, platform) => {
4110
+ const profile = profiles[platform];
4111
+ if (!profile || typeof profile !== "object") {
4112
+ return acc;
4113
+ }
4114
+ const url = typeof profile.url === "string" ? profile.url.trim() : "";
4115
+ if (!url) {
4116
+ return acc;
4117
+ }
4118
+ const icon = typeof profile.icon === "string" && profile.icon.trim().length > 0 ? profile.icon.trim() : SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM[platform];
4119
+ acc.push({
4120
+ icon,
4121
+ label: SOCIAL_MEDIA_PLATFORM_LABELS[platform],
4122
+ platform,
4123
+ url
4124
+ });
4125
+ return acc;
4126
+ }, []);
4127
+ }
4128
+
4129
+ // src/studio-pages/index.ts
4130
+ var studio_pages_exports = {};
4131
+ __export(studio_pages_exports, {
4132
+ createDefaultStudioDocument: () => createDefaultStudioDocument,
4133
+ createStudioPageService: () => createStudioPageService,
4134
+ defaultBuilderThemeTokens: () => defaultBuilderThemeTokens,
4135
+ getStudioDocumentFromPage: () => getStudioDocumentFromPage,
4136
+ layoutToStudioDocument: () => layoutToStudioDocument,
4137
+ pageInspectorPanels: () => pageInspectorPanels,
4138
+ pageNodeTypes: () => pageNodeTypes,
4139
+ pagePaletteGroups: () => pagePaletteGroups,
4140
+ pageStudioModuleManifest: () => pageStudioModuleManifest,
4141
+ resolveBuilderThemeTokens: () => resolveBuilderThemeTokens,
4142
+ studioDocumentToLayout: () => studioDocumentToLayout,
4143
+ toEditorInitialDoc: () => toEditorInitialDoc
4144
+ });
4145
+
4146
+ // src/studio-pages/builder/settings-v2/themeTokens.ts
4147
+ var isRecord4 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
4148
+ var merge = (base, next) => {
4149
+ if (!next || !isRecord4(next)) {
4150
+ return base;
4151
+ }
4152
+ const merged = { ...base };
4153
+ for (const [key, value] of Object.entries(next)) {
4154
+ if (isRecord4(value) && isRecord4(merged[key])) {
4155
+ merged[key] = merge(merged[key], value);
4156
+ continue;
4157
+ }
4158
+ if (typeof value !== "undefined") {
4159
+ merged[key] = value;
4160
+ }
4161
+ }
4162
+ return merged;
4163
+ };
4164
+ var resolveBuilderThemeTokens = (layers) => {
4165
+ const withSite = merge(defaultBuilderThemeTokens, layers.site);
4166
+ const withPage = merge(withSite, layers.page);
4167
+ return merge(withPage, layers.block);
4168
+ };
4169
+
4170
+ // src/studio-pages/builder/settings-v2/inspectorSchema.ts
4171
+ var alignOptions = [
4172
+ { label: "Left", value: "left" },
4173
+ { label: "Center", value: "center" },
4174
+ { label: "Right", value: "right" },
4175
+ { label: "Justify", value: "justify" }
4176
+ ];
4177
+ var layoutFieldSet = [];
4178
+ var typographyFieldSet = [
4179
+ {
4180
+ group: "typography",
4181
+ key: "settings.typography.headingAlign",
4182
+ label: "Heading Alignment",
4183
+ options: alignOptions,
4184
+ tags: ["text", "align", "heading"],
4185
+ type: "select"
4186
+ },
4187
+ {
4188
+ group: "typography",
4189
+ key: "settings.typography.bodyAlign",
4190
+ label: "Body Alignment",
4191
+ options: alignOptions,
4192
+ tags: ["text", "align", "paragraph"],
4193
+ type: "select"
4194
+ },
4195
+ {
4196
+ group: "typography",
4197
+ key: "settings.typography.maxTextWidth",
4198
+ label: "Text Width",
4199
+ options: [
4200
+ { label: "Auto", value: "auto" },
4201
+ { label: "Small", value: "sm" },
4202
+ { label: "Medium", value: "md" },
4203
+ { label: "Large", value: "lg" },
4204
+ { label: "Full", value: "full" }
4205
+ ],
4206
+ tags: ["readability", "measure", "line length"],
4207
+ type: "select"
4208
+ },
4209
+ {
4210
+ advanced: true,
4211
+ group: "typography",
4212
+ key: "settings.typography.lineHeightPreset",
4213
+ label: "Line Height",
4214
+ options: [
4215
+ { label: "Tight", value: "tight" },
4216
+ { label: "Normal", value: "normal" },
4217
+ { label: "Relaxed", value: "relaxed" }
4218
+ ],
4219
+ type: "select"
4220
+ },
4221
+ {
4222
+ advanced: true,
4223
+ group: "typography",
4224
+ key: "settings.typography.letterSpacingPreset",
4225
+ label: "Letter Spacing",
4226
+ options: [
4227
+ { label: "Tight", value: "tight" },
4228
+ { label: "Normal", value: "normal" },
4229
+ { label: "Relaxed", value: "relaxed" }
4230
+ ],
4231
+ type: "select"
4232
+ }
4233
+ ];
4234
+ var styleFieldSet = [];
4235
+ var commonAdvanced = [
4236
+ {
4237
+ group: "advanced",
4238
+ inlineEditable: false,
4239
+ key: "settings.advanced.editCopyInPanel",
4240
+ label: "Edit Copy In Panel",
4241
+ tags: ["inline", "copy", "text"],
4242
+ type: "checkbox"
4243
+ },
4244
+ {
4245
+ advanced: true,
3491
4246
  group: "advanced",
3492
4247
  key: "settings.advanced.hideOnMobile",
3493
4248
  label: "Hide On Mobile",
@@ -3577,6 +4332,7 @@ var inspectorDefinitionByBlockType = {
3577
4332
  faq: {
3578
4333
  blockType: "faq",
3579
4334
  fields: [
4335
+ { group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
3580
4336
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
3581
4337
  ...layoutFieldSet,
3582
4338
  ...typographyFieldSet,
@@ -3587,6 +4343,7 @@ var inspectorDefinitionByBlockType = {
3587
4343
  featureGrid: {
3588
4344
  blockType: "featureGrid",
3589
4345
  fields: [
4346
+ { group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
3590
4347
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
3591
4348
  {
3592
4349
  group: "basics",
@@ -3594,7 +4351,11 @@ var inspectorDefinitionByBlockType = {
3594
4351
  label: "Variant",
3595
4352
  options: [
3596
4353
  { label: "Cards", value: "cards" },
3597
- { label: "Highlight", value: "highlight" }
4354
+ { label: "Highlight", value: "highlight" },
4355
+ { label: "Split List", value: "splitList" },
4356
+ { label: "Panels", value: "panels" },
4357
+ { label: "Catalog", value: "catalog" },
4358
+ { label: "Contact Split", value: "contact" }
3598
4359
  ],
3599
4360
  type: "select"
3600
4361
  },
@@ -3609,6 +4370,7 @@ var inspectorDefinitionByBlockType = {
3609
4370
  formEmbed: {
3610
4371
  blockType: "formEmbed",
3611
4372
  fields: [
4373
+ { group: "basics", inlineEditable: true, key: "eyebrow", label: "Eyebrow", type: "text" },
3612
4374
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
3613
4375
  { group: "basics", inlineEditable: true, key: "description", label: "Description", type: "textarea" },
3614
4376
  {
@@ -3641,7 +4403,7 @@ var inspectorDefinitionByBlockType = {
3641
4403
  type: "select"
3642
4404
  },
3643
4405
  {
3644
- group: "layout",
4406
+ group: "basics",
3645
4407
  key: "heroHeight",
3646
4408
  label: "Hero Height",
3647
4409
  options: [
@@ -3694,6 +4456,16 @@ var inspectorDefinitionByBlockType = {
3694
4456
  richText: {
3695
4457
  blockType: "richText",
3696
4458
  fields: [
4459
+ {
4460
+ group: "basics",
4461
+ key: "variant",
4462
+ label: "Variant",
4463
+ options: [
4464
+ { label: "Default", value: "default" },
4465
+ { label: "Quote Banner", value: "quoteBanner" }
4466
+ ],
4467
+ type: "select"
4468
+ },
3697
4469
  { group: "basics", inlineEditable: true, key: "title", label: "Title", type: "text" },
3698
4470
  {
3699
4471
  group: "basics",
@@ -3729,677 +4501,571 @@ var inspectorDefinitionByBlockType = {
3729
4501
  { group: "basics", key: "visibleCount", label: "Visible At Once", max: 6, min: 1, type: "number" },
3730
4502
  { group: "basics", key: "autoRotate", label: "Auto Rotate", type: "checkbox" },
3731
4503
  {
3732
- advanced: true,
3733
- group: "advanced",
3734
- key: "rotateIntervalSeconds",
3735
- label: "Rotate Interval Seconds",
3736
- max: 30,
3737
- min: 2,
3738
- type: "number"
3739
- },
3740
- ...layoutFieldSet,
3741
- ...typographyFieldSet,
3742
- ...styleFieldSet,
3743
- ...commonAdvanced
3744
- ]
3745
- }
3746
- };
3747
-
3748
- // src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
3749
- var import_jsx_runtime6 = require("react/jsx-runtime");
3750
-
3751
- // src/studio-pages/migrations.ts
3752
- var isRecord5 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
3753
- var assertPageStudioDocumentV1 = (value) => {
3754
- if (!isRecord5(value)) {
3755
- throw new Error("Studio document must be an object");
3756
- }
3757
- if (value.schemaVersion !== 1) {
3758
- throw new Error("Unsupported studio schemaVersion");
3759
- }
3760
- if (!Array.isArray(value.nodes)) {
3761
- throw new Error("Studio document nodes must be an array");
3762
- }
3763
- const nodes = value.nodes.map((node, index) => {
3764
- if (!isRecord5(node)) {
3765
- throw new Error(`Node at index ${index} must be an object`);
3766
- }
3767
- if (typeof node.id !== "string" || node.id.length === 0) {
3768
- throw new Error(`Node at index ${index} has invalid id`);
3769
- }
3770
- if (typeof node.type !== "string" || node.type.length === 0) {
3771
- throw new Error(`Node at index ${index} has invalid type`);
3772
- }
3773
- if (!isRecord5(node.data)) {
3774
- throw new Error(`Node at index ${index} has invalid data`);
3775
- }
3776
- return {
3777
- data: node.data,
3778
- id: node.id,
3779
- type: node.type
3780
- };
3781
- });
3782
- return {
3783
- metadata: isRecord5(value.metadata) ? value.metadata : void 0,
3784
- nodes,
3785
- schemaVersion: 1,
3786
- title: typeof value.title === "string" ? value.title : void 0,
3787
- updatedAt: typeof value.updatedAt === "string" ? value.updatedAt : void 0
3788
- };
3789
- };
3790
- var migratePageNodeToSettingsV2 = (node) => {
3791
- const normalized = migrateBlockToSettingsV2({
3792
- blockType: node.type,
3793
- ...node.data
3794
- });
3795
- const { blockType: _ignoredBlockType, ...data } = normalized;
3796
- return {
3797
- ...node,
3798
- data
3799
- };
3800
- };
3801
- var migratePageDocumentSettingsToV2 = (value) => {
3802
- const current = assertPageStudioDocumentV1(value);
3803
- return {
3804
- ...current,
3805
- nodes: current.nodes.map(migratePageNodeToSettingsV2)
3806
- };
3807
- };
3808
- var pageStudioMigrations = [
3809
- {
3810
- fromVersion: 1,
3811
- migrate: migratePageDocumentSettingsToV2,
3812
- toVersion: 1
3813
- }
3814
- ];
3815
-
3816
- // src/studio-pages/index.ts
3817
- var withSectionStyleDefaults = (value) => ({
3818
- ...sectionStyleDefaults,
3819
- ...value
3820
- });
3821
- var defaultNodeData = {
3822
- bookingEmbed: {
3823
- ...withSectionStyleDefaults({}),
3824
- buttonHref: "/contact",
3825
- buttonLabel: "Book Consultation",
3826
- description: "Let visitors book a consultation.",
3827
- title: "Book a Time"
3828
- },
3829
- beforeAfter: withSectionStyleDefaults({
3830
- itemsPerRow: 2,
3831
- items: [
3832
- {
3833
- description: "Before and after result summary.",
3834
- imageCornerStyle: "rounded",
3835
- imageFit: "cover",
3836
- imagePosition: "center",
3837
- label: "Project One"
3838
- }
3839
- ],
3840
- subtitle: "Show visual proof from real projects.",
3841
- title: "Before & After Results"
3842
- }),
3843
- cta: {
3844
- ...withSectionStyleDefaults({}),
3845
- backgroundColor: "#1f684f",
3846
- buttonHref: "/contact",
3847
- buttonLabel: "Contact Us",
3848
- description: "Optional supporting copy.",
3849
- headline: "Ready to get started?",
3850
- style: "light"
3851
- },
3852
- faq: {
3853
- ...withSectionStyleDefaults({}),
3854
- items: [{ answer: "Answer goes here.", question: "Frequently asked question?" }],
3855
- title: "Frequently Asked Questions"
3856
- },
3857
- featureGrid: {
3858
- ...withSectionStyleDefaults({}),
3859
- itemsPerRow: 3,
3860
- items: [
3861
- { description: "Explain this point.", iconType: "badge", icon: "01", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature One" },
3862
- { description: "Explain this point.", iconType: "badge", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
3863
- { description: "Explain this point.", iconType: "badge", icon: "03", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Three" }
3864
- ],
3865
- title: "Section Title",
3866
- variant: "cards"
3867
- },
3868
- formEmbed: {
3869
- ...withSectionStyleDefaults({}),
3870
- description: "Collect lead details from visitors.",
3871
- formType: "quote",
3872
- title: "Request a Quote"
3873
- },
3874
- hero: {
3875
- ...withSectionStyleDefaults({}),
3876
- backgroundColor: "",
3877
- backgroundOverlayMode: "none",
3878
- backgroundOverlayOpacity: 45,
3879
- backgroundOverlayColor: "#000000",
3880
- backgroundOverlayGradientFrom: "#0d4a37",
3881
- backgroundOverlayGradientTo: "#1f684f",
3882
- backgroundOverlayGradientAngle: "135",
3883
- backgroundOverlayGradientFromStrength: 100,
3884
- backgroundOverlayGradientToStrength: 100,
3885
- backgroundOverlayGradientStart: 0,
3886
- backgroundOverlayGradientEnd: 100,
3887
- backgroundOverlayGradientFeather: 100,
3888
- backgroundImageCornerStyle: "rounded",
3889
- backgroundImageFit: "cover",
3890
- backgroundImagePosition: "center",
3891
- heroHeight: "sm",
3892
- headline: "New Hero Section",
3893
- kicker: "Optional kicker",
3894
- primaryHref: "/contact",
3895
- primaryLabel: "Primary Action",
3896
- secondaryHref: "/services",
3897
- secondaryLabel: "Secondary Action",
3898
- subheadline: "Describe your offer clearly for website visitors.",
3899
- variant: "default"
3900
- },
3901
- media: {
3902
- ...withSectionStyleDefaults({}),
3903
- caption: "Add a caption",
3904
- imageCornerStyle: "rounded",
3905
- imageFit: "cover",
3906
- imagePosition: "center",
3907
- size: "default"
3908
- },
3909
- logoWall: withSectionStyleDefaults({
3910
- items: [
3911
- { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 1" },
3912
- { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
3913
- { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
3914
- ],
3915
- subtitle: "Trusted by teams and homeowners across Central Texas.",
3916
- title: "Trusted by Local Organizations"
3917
- }),
3918
- richText: {
3919
- ...withSectionStyleDefaults({}),
3920
- content: {
3921
- root: {
3922
- children: [
3923
- {
3924
- children: [
3925
- {
3926
- detail: 0,
3927
- format: 0,
3928
- mode: "normal",
3929
- style: "",
3930
- text: "Write your content here.",
3931
- type: "text",
3932
- version: 1
3933
- }
3934
- ],
3935
- direction: "ltr",
3936
- format: "",
3937
- indent: 0,
3938
- type: "paragraph",
3939
- version: 1
3940
- }
3941
- ],
3942
- direction: "ltr",
3943
- format: "",
3944
- indent: 0,
3945
- type: "root",
3946
- version: 1
3947
- }
3948
- },
3949
- title: "Section Heading",
3950
- width: "normal"
3951
- },
3952
- testimonials: {
3953
- ...withSectionStyleDefaults({}),
3954
- autoRotate: true,
3955
- items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here.", rating: 5 }],
3956
- rotateIntervalSeconds: 7,
3957
- title: "What Customers Say",
3958
- visibleCount: 3
3959
- },
3960
- stats: withSectionStyleDefaults({
3961
- items: [
3962
- { description: "Average response time", label: "Same-Day Quotes", value: "24h" },
3963
- { description: "Projects completed", label: "Completed Jobs", value: "1,200+" },
3964
- { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" }
3965
- ],
3966
- subtitle: "Highlight measurable outcomes to build trust quickly.",
3967
- title: "Performance Highlights"
3968
- })
4504
+ advanced: true,
4505
+ group: "advanced",
4506
+ key: "rotateIntervalSeconds",
4507
+ label: "Rotate Interval Seconds",
4508
+ max: 30,
4509
+ min: 2,
4510
+ type: "number"
4511
+ },
4512
+ ...layoutFieldSet,
4513
+ ...typographyFieldSet,
4514
+ ...styleFieldSet,
4515
+ ...commonAdvanced
4516
+ ]
4517
+ }
3969
4518
  };
3970
- var nodeTypeLabels = {
3971
- bookingEmbed: "Booking Embed",
3972
- beforeAfter: "Before / After",
3973
- cta: "Call To Action",
3974
- faq: "FAQ",
3975
- featureGrid: "Feature Grid",
3976
- formEmbed: "Form Embed",
3977
- hero: "Hero",
3978
- logoWall: "Logo Wall",
3979
- media: "Media",
3980
- richText: "Rich Text",
3981
- stats: "Stats",
3982
- testimonials: "Testimonials"
4519
+
4520
+ // src/studio-pages/pageService.ts
4521
+ var isRecord5 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
4522
+ var toRecordArray = (value) => Array.isArray(value) ? value.filter((item) => isRecord5(item)) : [];
4523
+ var getRelationID = (value) => {
4524
+ if (typeof value === "number" || typeof value === "string") {
4525
+ return value;
4526
+ }
4527
+ if (!isRecord5(value)) {
4528
+ return null;
4529
+ }
4530
+ const id = value.id;
4531
+ return typeof id === "number" || typeof id === "string" ? id : null;
3983
4532
  };
3984
- var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
3985
- type,
3986
- displayName: nodeTypeLabels[type] || type,
3987
- description: `Page node for ${nodeTypeLabels[type] || type}`,
3988
- getDefaultData: () => {
3989
- const migrated = migrateBlockToSettingsV2(structuredClone(defaultNodeData[type]));
3990
- const { blockType: _ignoredBlockType, ...data } = migrated;
3991
- return data;
4533
+ var asLayoutArray = (value) => toRecordArray(value);
4534
+ var hydrateRelationship = (valueFromStudio, valueFromLayout) => {
4535
+ if (isRecord5(valueFromStudio)) {
4536
+ return valueFromStudio;
3992
4537
  }
3993
- }));
3994
- var validatePageDocument = (document) => {
3995
- const issues = [];
3996
- if (!document.title || document.title.trim().length === 0) {
3997
- issues.push({
3998
- code: "pages.title.required",
3999
- message: "Page title is required before publishing.",
4000
- path: "title",
4001
- severity: "error"
4002
- });
4538
+ if (!isRecord5(valueFromLayout)) {
4539
+ return valueFromStudio;
4003
4540
  }
4004
- if (document.nodes.length === 0) {
4005
- issues.push({
4006
- code: "pages.nodes.required",
4007
- message: "At least one section is required.",
4008
- path: "nodes",
4009
- severity: "error"
4010
- });
4541
+ const studioID = getRelationID(valueFromStudio);
4542
+ const layoutID = getRelationID(valueFromLayout);
4543
+ if (studioID === null || layoutID === null || String(studioID) !== String(layoutID)) {
4544
+ return valueFromStudio;
4011
4545
  }
4012
- document.nodes.forEach((node, index) => {
4013
- if (node.type === "hero" && typeof node.data.headline !== "string") {
4014
- issues.push({
4015
- code: "pages.hero.headline",
4016
- message: "Hero section requires a headline.",
4017
- path: `nodes.${index}.data.headline`,
4018
- severity: "error"
4019
- });
4020
- }
4021
- });
4022
- return issues;
4546
+ return valueFromLayout;
4023
4547
  };
4024
- var pagePaletteGroups = [
4025
- {
4026
- id: "page-core",
4027
- label: "Core Sections",
4028
- items: [
4029
- { nodeType: "hero", title: "Hero", description: "Top-of-page headline and CTA" },
4030
- { nodeType: "featureGrid", title: "Feature Grid", description: "Service or value cards" },
4031
- { nodeType: "stats", title: "Stats", description: "Key performance highlights" },
4032
- { nodeType: "logoWall", title: "Logo Wall", description: "Trust logos and badges" },
4033
- { nodeType: "beforeAfter", title: "Before / After", description: "Visual before-and-after gallery" },
4034
- { nodeType: "richText", title: "Rich Text", description: "Long-form content area" },
4035
- { nodeType: "media", title: "Media", description: "Image/video section" },
4036
- { nodeType: "testimonials", title: "Testimonials", description: "Social proof quotes" },
4037
- { nodeType: "faq", title: "FAQ", description: "Question-and-answer section" },
4038
- { nodeType: "cta", title: "Call To Action", description: "Conversion strip with button" },
4039
- { nodeType: "formEmbed", title: "Form Embed", description: "Lead capture form" },
4040
- { nodeType: "bookingEmbed", title: "Booking Embed", description: "Scheduling panel" }
4041
- ]
4042
- }
4043
- ];
4044
- var pageInspectorPanelRegistry = Object.keys(defaultNodeData).map((nodeType) => ({
4045
- nodeType,
4046
- panelID: `${nodeType}-panel`,
4047
- panelLabel: `${nodeTypeLabels[nodeType] || nodeType} Settings`
4048
- }));
4049
- var resolvePanelFields = (nodeType) => inspectorDefinitionByBlockType[nodeType]?.fields.map((field) => ({
4050
- advanced: field.advanced,
4051
- group: field.group,
4052
- inlineEditable: field.inlineEditable,
4053
- key: field.key,
4054
- label: field.label,
4055
- type: field.type
4056
- })) || [];
4057
- var pageInspectorPanels = pageInspectorPanelRegistry.map((entry) => ({
4058
- fields: resolvePanelFields(entry.nodeType),
4059
- id: entry.panelID,
4060
- label: entry.panelLabel,
4061
- nodeType: entry.nodeType
4062
- }));
4063
- var pageStudioModuleManifest = {
4064
- id: "studio-pages",
4065
- version: "0.1.0-beta.0",
4066
- displayName: "Pages Studio Module",
4067
- nodeTypes: pageNodeTypes,
4068
- paletteGroups: pagePaletteGroups,
4069
- inspectorPanels: pageInspectorPanels,
4070
- validators: [validatePageDocument],
4071
- migrations: pageStudioMigrations,
4072
- compiler: {
4073
- compileNode: (node) => {
4074
- const normalized = migrateBlockToSettingsV2({
4075
- blockType: node.type,
4076
- ...node.data
4548
+ var hydrateDocumentWithLayoutRelations = (document, layout) => {
4549
+ const nextNodes = document.nodes.map((node, index) => {
4550
+ const layoutBlock = layout[index];
4551
+ if (!isRecord5(layoutBlock)) {
4552
+ return node;
4553
+ }
4554
+ if (typeof layoutBlock.blockType !== "string" || layoutBlock.blockType !== node.type) {
4555
+ return node;
4556
+ }
4557
+ const nextData = { ...node.data };
4558
+ if (node.type === "hero") {
4559
+ nextData.media = hydrateRelationship(nextData.media, layoutBlock.media);
4560
+ }
4561
+ if (node.type === "media") {
4562
+ nextData.image = hydrateRelationship(nextData.image, layoutBlock.image);
4563
+ }
4564
+ if (node.type === "featureGrid" || node.type === "logoWall" || node.type === "beforeAfter") {
4565
+ const studioItems = Array.isArray(nextData.items) ? nextData.items : [];
4566
+ const layoutItems = Array.isArray(layoutBlock.items) ? layoutBlock.items : [];
4567
+ nextData.items = studioItems.map((rawStudioItem, itemIndex) => {
4568
+ if (!isRecord5(rawStudioItem)) {
4569
+ return rawStudioItem;
4570
+ }
4571
+ const layoutItem = layoutItems[itemIndex];
4572
+ if (!isRecord5(layoutItem)) {
4573
+ return rawStudioItem;
4574
+ }
4575
+ const nextItem = { ...rawStudioItem };
4576
+ nextItem.media = hydrateRelationship(nextItem.media, layoutItem.media);
4577
+ nextItem.beforeMedia = hydrateRelationship(nextItem.beforeMedia, layoutItem.beforeMedia);
4578
+ nextItem.afterMedia = hydrateRelationship(nextItem.afterMedia, layoutItem.afterMedia);
4579
+ return nextItem;
4077
4580
  });
4078
- return {
4079
- id: node.id,
4080
- ...normalized
4081
- };
4082
4581
  }
4083
- },
4084
- permissions: [
4085
- { action: "read", role: "admin" },
4086
- { action: "read", role: "editor" },
4087
- { action: "read", role: "client" },
4088
- { action: "update", role: "admin" },
4089
- { action: "update", role: "editor" },
4090
- { action: "update", role: "client" },
4091
- { action: "publish", role: "admin" },
4092
- { action: "publish", role: "editor" }
4093
- ]
4094
- };
4095
- var ensureNodeID = (inputID, index) => {
4096
- if (typeof inputID === "string" && inputID.length > 0) {
4097
- return inputID;
4098
- }
4099
- return `node-${index + 1}`;
4100
- };
4101
- var layoutToStudioDocument = (layout, title, metadata) => {
4102
- const nodes = layout.filter((block) => typeof block.blockType === "string").map((rawBlock, index) => {
4103
- const block = migrateBlockToSettingsV2(rawBlock);
4104
- const blockType = String(block.blockType);
4105
- const { id, blockType: _ignoredBlockType, ...data } = block;
4106
4582
  return {
4107
- id: ensureNodeID(id, index),
4108
- type: blockType,
4109
- data
4583
+ ...node,
4584
+ data: nextData
4110
4585
  };
4111
4586
  });
4112
4587
  return {
4113
- metadata,
4114
- schemaVersion: 1,
4115
- title,
4116
- nodes,
4117
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
4588
+ ...document,
4589
+ nodes: nextNodes
4118
4590
  };
4119
4591
  };
4120
- var studioDocumentToLayout = (document) => document.nodes.map(
4121
- (node) => migrateBlockToSettingsV2({
4122
- id: node.id,
4123
- blockType: node.type,
4124
- ...node.data
4125
- })
4126
- );
4127
- var createDefaultStudioDocument = (title) => ({
4128
- metadata: {},
4592
+ var normalizeDocument = (document) => ({
4593
+ ...document,
4129
4594
  schemaVersion: 1,
4130
- title,
4131
- nodes: [],
4132
4595
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
4133
4596
  });
4134
-
4135
- // src/nextjs/queries/pages.ts
4136
- var PAGE_QUERY_CACHE_VERSION = "v4-published-only-public";
4137
- function withStudioDocumentLayout(page) {
4138
- if (!page) {
4139
- return null;
4140
- }
4141
- try {
4142
- const studioDocument = assertStudioDocumentV1(page.studioDocument);
4143
- const compiledLayout = studioDocumentToLayout(studioDocument);
4144
- if (Array.isArray(compiledLayout) && compiledLayout.length > 0) {
4145
- return {
4146
- ...page,
4147
- layout: compiledLayout
4148
- };
4149
- }
4150
- } catch {
4151
- }
4152
- return page;
4153
- }
4154
- function normalizePath(segments) {
4155
- if (!segments || segments.length === 0) {
4156
- return "/";
4157
- }
4158
- const cleaned = segments.map((segment) => segment.trim()).filter(Boolean).join("/");
4159
- return cleaned.length > 0 ? `/${cleaned}` : "/";
4160
- }
4161
- async function queryPageByPath(payload, path2, draft) {
4162
- const pathWhere = {
4163
- path: {
4164
- equals: path2
4597
+ var normalizeLegacyHeroDefaults = (document) => {
4598
+ const nodes = document.nodes.map((node) => {
4599
+ if (node.type !== "hero" || !isRecord5(node.data)) {
4600
+ return node;
4165
4601
  }
4166
- };
4167
- const publishedWhere = {
4168
- _status: {
4169
- equals: "published"
4602
+ const nextData = { ...node.data };
4603
+ const heroBackgroundColor = typeof nextData.backgroundColor === "string" ? nextData.backgroundColor.trim().toLowerCase() : "";
4604
+ const sectionBackgroundMode = typeof nextData.sectionBackgroundMode === "string" ? nextData.sectionBackgroundMode : "none";
4605
+ const hasBackgroundImageURL = typeof nextData.backgroundImageURL === "string" && nextData.backgroundImageURL.trim().length > 0;
4606
+ const mediaRelation = getRelationID(nextData.media);
4607
+ if (heroBackgroundColor === "#124a37" && sectionBackgroundMode === "none" && !hasBackgroundImageURL && mediaRelation === null) {
4608
+ nextData.backgroundColor = "";
4170
4609
  }
4171
- };
4172
- const result = await payload.find({
4173
- collection: "pages",
4174
- depth: 2,
4175
- draft,
4176
- limit: 1,
4177
- overrideAccess: false,
4178
- where: draft ? pathWhere : { and: [pathWhere, publishedWhere] }
4179
- });
4180
- if (result.docs.length > 0) {
4181
- return withStudioDocumentLayout(result.docs[0] || null);
4182
- }
4183
- if (path2 === "/") {
4184
- const homeWhere = {
4185
- slug: {
4186
- equals: "home"
4187
- }
4610
+ return {
4611
+ ...node,
4612
+ data: nextData
4188
4613
  };
4189
- const homeResult = await payload.find({
4190
- collection: "pages",
4191
- depth: 2,
4192
- draft,
4193
- limit: 1,
4194
- overrideAccess: false,
4195
- where: draft ? homeWhere : { and: [homeWhere, publishedWhere] }
4196
- });
4197
- return withStudioDocumentLayout(homeResult.docs[0] || null);
4614
+ });
4615
+ return {
4616
+ ...document,
4617
+ nodes
4618
+ };
4619
+ };
4620
+ var assertCanPublish = (issues) => {
4621
+ const publishErrors = issues.filter((issue) => issue.severity === "error");
4622
+ if (publishErrors.length > 0) {
4623
+ throw new Error(`Cannot publish page: ${publishErrors[0].message}`);
4198
4624
  }
4199
- return null;
4200
- }
4201
- function createPageQueries(getPayloadClient, contentTag = "website-content") {
4202
- const getPublishedPageByPathCached = (0, import_cache.unstable_cache)(
4203
- async (path2) => {
4204
- const payload = await getPayloadClient();
4205
- return queryPageByPath(payload, path2, false);
4206
- },
4207
- ["page-by-path", PAGE_QUERY_CACHE_VERSION],
4208
- { tags: [contentTag] }
4209
- );
4210
- async function getPageBySegments(segments, draft = false) {
4211
- const path2 = normalizePath(segments);
4212
- const payload = await getPayloadClient();
4213
- if (draft) {
4214
- return queryPageByPath(payload, path2, true);
4625
+ };
4626
+ var getStudioDocumentFromPage = (doc) => {
4627
+ const title = typeof doc.title === "string" ? doc.title : void 0;
4628
+ const layout = asLayoutArray(doc.layout);
4629
+ try {
4630
+ const studioDocument = assertStudioDocumentV1(doc.studioDocument);
4631
+ if (layout.length > 0) {
4632
+ return hydrateDocumentWithLayoutRelations(studioDocument, layout);
4215
4633
  }
4216
- return getPublishedPageByPathCached(path2);
4634
+ return studioDocument;
4635
+ } catch {
4636
+ if (layout.length > 0) {
4637
+ return layoutToStudioDocument(layout, title);
4638
+ }
4639
+ return createEmptyStudioDocument(title);
4217
4640
  }
4218
- async function listPublishedPagePaths() {
4219
- const payload = await getPayloadClient();
4220
- const pages = await payload.find({
4221
- collection: "pages",
4222
- depth: 0,
4223
- draft: false,
4224
- limit: 1e3,
4225
- pagination: false,
4641
+ };
4642
+ var createStudioPageService = ({
4643
+ collectionSlug = "pages",
4644
+ modules,
4645
+ payload,
4646
+ user
4647
+ }) => ({
4648
+ getPageForStudio: async (pageID) => {
4649
+ const page = await payload.findByID({
4650
+ collection: collectionSlug,
4651
+ depth: 2,
4652
+ draft: true,
4653
+ id: pageID,
4226
4654
  overrideAccess: false,
4227
- where: {
4228
- _status: {
4229
- equals: "published"
4230
- }
4231
- }
4655
+ user
4232
4656
  });
4233
- return pages.docs.map((doc) => doc.path).filter((path2) => typeof path2 === "string" && path2.length > 0);
4657
+ const studioDocument = getStudioDocumentFromPage(page);
4658
+ return {
4659
+ id: String(page.id),
4660
+ slug: typeof page.slug === "string" ? page.slug : "",
4661
+ studioDocument,
4662
+ title: typeof page.title === "string" ? page.title : "Untitled Page"
4663
+ };
4664
+ },
4665
+ validateStudioDocument: (document) => validateStudioDocument(document, modules),
4666
+ saveDraft: async (pageID, document, _metadata) => {
4667
+ const normalizedDocument = normalizeLegacyHeroDefaults(normalizeDocument(document));
4668
+ const compileResult = compileStudioDocument(normalizedDocument, modules);
4669
+ await payload.update({
4670
+ collection: collectionSlug,
4671
+ data: {
4672
+ _status: "draft",
4673
+ layout: compileResult.layout,
4674
+ studioDocument: normalizedDocument,
4675
+ studioValidationIssues: compileResult.issues,
4676
+ title: normalizedDocument.title
4677
+ },
4678
+ id: pageID,
4679
+ overrideAccess: false,
4680
+ user
4681
+ });
4682
+ return {
4683
+ id: pageID,
4684
+ status: "draft"
4685
+ };
4686
+ },
4687
+ publish: async (pageID, document, _metadata) => {
4688
+ const normalizedDocument = normalizeLegacyHeroDefaults(normalizeDocument(document));
4689
+ const compileResult = compileStudioDocument(normalizedDocument, modules);
4690
+ assertCanPublish(compileResult.issues);
4691
+ await payload.update({
4692
+ collection: collectionSlug,
4693
+ data: {
4694
+ _status: "published",
4695
+ layout: compileResult.layout,
4696
+ studioDocument: normalizedDocument,
4697
+ studioValidationIssues: compileResult.issues,
4698
+ title: normalizedDocument.title
4699
+ },
4700
+ id: pageID,
4701
+ overrideAccess: false,
4702
+ user
4703
+ });
4704
+ return {
4705
+ id: pageID,
4706
+ status: "published"
4707
+ };
4234
4708
  }
4235
- function pathToSegments(path2) {
4236
- if (!path2 || path2 === "/") {
4237
- return [];
4238
- }
4239
- return path2.split("/").filter(Boolean);
4709
+ });
4710
+ var toEditorInitialDoc = (payloadPage) => ({
4711
+ layout: studioDocumentToLayout(payloadPage.studioDocument),
4712
+ slug: typeof payloadPage.slug === "string" ? payloadPage.slug : "",
4713
+ studioDocument: payloadPage.studioDocument,
4714
+ title: payloadPage.title
4715
+ });
4716
+
4717
+ // src/studio-pages/migrations.ts
4718
+ var isRecord6 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
4719
+ var assertPageStudioDocumentV1 = (value) => {
4720
+ if (!isRecord6(value)) {
4721
+ throw new Error("Studio document must be an object");
4722
+ }
4723
+ if (value.schemaVersion !== 1) {
4724
+ throw new Error("Unsupported studio schemaVersion");
4725
+ }
4726
+ if (!Array.isArray(value.nodes)) {
4727
+ throw new Error("Studio document nodes must be an array");
4240
4728
  }
4729
+ const nodes = value.nodes.map((node, index) => {
4730
+ if (!isRecord6(node)) {
4731
+ throw new Error(`Node at index ${index} must be an object`);
4732
+ }
4733
+ if (typeof node.id !== "string" || node.id.length === 0) {
4734
+ throw new Error(`Node at index ${index} has invalid id`);
4735
+ }
4736
+ if (typeof node.type !== "string" || node.type.length === 0) {
4737
+ throw new Error(`Node at index ${index} has invalid type`);
4738
+ }
4739
+ if (!isRecord6(node.data)) {
4740
+ throw new Error(`Node at index ${index} has invalid data`);
4741
+ }
4742
+ return {
4743
+ data: node.data,
4744
+ id: node.id,
4745
+ type: node.type
4746
+ };
4747
+ });
4241
4748
  return {
4242
- getPageBySegments,
4243
- listPublishedPagePaths,
4244
- pathToSegments
4749
+ metadata: isRecord6(value.metadata) ? value.metadata : void 0,
4750
+ nodes,
4751
+ schemaVersion: 1,
4752
+ title: typeof value.title === "string" ? value.title : void 0,
4753
+ updatedAt: typeof value.updatedAt === "string" ? value.updatedAt : void 0
4245
4754
  };
4246
- }
4755
+ };
4756
+ var migratePageNodeToSettingsV2 = (node) => {
4757
+ const normalized = migrateBlockToSettingsV2({
4758
+ blockType: node.type,
4759
+ ...node.data
4760
+ });
4761
+ const { blockType: _ignoredBlockType, ...data } = normalized;
4762
+ return {
4763
+ ...node,
4764
+ data
4765
+ };
4766
+ };
4767
+ var migratePageDocumentSettingsToV2 = (value) => {
4768
+ const current = assertPageStudioDocumentV1(value);
4769
+ return {
4770
+ ...current,
4771
+ nodes: current.nodes.map(migratePageNodeToSettingsV2)
4772
+ };
4773
+ };
4774
+ var pageStudioMigrations = [
4775
+ {
4776
+ fromVersion: 1,
4777
+ migrate: migratePageDocumentSettingsToV2,
4778
+ toVersion: 1
4779
+ }
4780
+ ];
4247
4781
 
4248
- // src/nextjs/queries/site.ts
4249
- var import_cache2 = require("next/cache");
4250
- function createSiteQueries(getPayloadClient, contentTag = "website-content") {
4251
- const getSiteSettingsCached = (0, import_cache2.unstable_cache)(
4252
- async () => {
4253
- const payload = await getPayloadClient();
4254
- const settings = await payload.findGlobal({
4255
- slug: "site-settings",
4256
- depth: 1
4257
- });
4258
- return settings;
4259
- },
4260
- ["site-settings-global"],
4261
- { tags: [contentTag] }
4262
- );
4263
- const getHeaderCached = (0, import_cache2.unstable_cache)(
4264
- async () => {
4265
- const payload = await getPayloadClient();
4266
- const header = await payload.findGlobal({
4267
- slug: "header",
4268
- depth: 1
4269
- });
4270
- return header;
4271
- },
4272
- ["header-global"],
4273
- { tags: [contentTag] }
4274
- );
4275
- const getFooterCached = (0, import_cache2.unstable_cache)(
4276
- async () => {
4277
- const payload = await getPayloadClient();
4278
- const footer = await payload.findGlobal({
4279
- slug: "footer",
4280
- depth: 1
4281
- });
4282
- return footer;
4283
- },
4284
- ["footer-global"],
4285
- { tags: [contentTag] }
4286
- );
4287
- const getSocialMediaCached = (0, import_cache2.unstable_cache)(
4288
- async () => {
4289
- const payload = await getPayloadClient();
4290
- const socialMedia = await payload.findGlobal({
4291
- slug: "social-media",
4292
- depth: 1
4293
- });
4294
- return socialMedia;
4782
+ // src/studio-pages/index.ts
4783
+ var withSectionStyleDefaults = (value) => ({
4784
+ ...sectionStyleDefaults,
4785
+ ...value
4786
+ });
4787
+ var defaultNodeData = {
4788
+ bookingEmbed: {
4789
+ ...withSectionStyleDefaults({}),
4790
+ buttonHref: "/contact",
4791
+ buttonLabel: "Book Consultation",
4792
+ description: "Let visitors book a consultation.",
4793
+ title: "Book a Time"
4794
+ },
4795
+ beforeAfter: withSectionStyleDefaults({
4796
+ itemsPerRow: 2,
4797
+ items: [
4798
+ {
4799
+ description: "Before and after result summary.",
4800
+ imageCornerStyle: "rounded",
4801
+ imageFit: "cover",
4802
+ imagePosition: "center",
4803
+ label: "Project One"
4804
+ }
4805
+ ],
4806
+ subtitle: "Show visual proof from real projects.",
4807
+ title: "Before & After Results"
4808
+ }),
4809
+ cta: {
4810
+ ...withSectionStyleDefaults({}),
4811
+ backgroundColor: "",
4812
+ bullets: [],
4813
+ buttonHref: "/contact",
4814
+ buttonLabel: "Contact Us",
4815
+ description: "Optional supporting copy.",
4816
+ eyebrow: "",
4817
+ headline: "Ready to get started?",
4818
+ imageURL: "",
4819
+ style: "light"
4820
+ },
4821
+ faq: {
4822
+ ...withSectionStyleDefaults({}),
4823
+ items: [{ answer: "Answer goes here.", question: "Frequently asked question?" }],
4824
+ title: "Frequently Asked Questions"
4825
+ },
4826
+ featureGrid: {
4827
+ ...withSectionStyleDefaults({}),
4828
+ itemsPerRow: 3,
4829
+ items: [
4830
+ { description: "Explain this point.", iconType: "badge", icon: "01", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature One" },
4831
+ { description: "Explain this point.", iconType: "badge", icon: "02", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Two" },
4832
+ { description: "Explain this point.", iconType: "badge", icon: "03", imageCornerStyle: "rounded", imageFit: "cover", imagePosition: "center", title: "Feature Three" }
4833
+ ],
4834
+ subtitle: "",
4835
+ title: "Section Title",
4836
+ variant: "cards"
4837
+ },
4838
+ formEmbed: {
4839
+ ...withSectionStyleDefaults({}),
4840
+ description: "Collect lead details from visitors.",
4841
+ formType: "quote",
4842
+ submitLabel: "Submit",
4843
+ title: "Request a Quote"
4844
+ },
4845
+ hero: {
4846
+ ...withSectionStyleDefaults({}),
4847
+ backgroundColor: "",
4848
+ backgroundImageURL: "",
4849
+ backgroundOverlayMode: "none",
4850
+ backgroundOverlayOpacity: 45,
4851
+ backgroundOverlayColor: "#000000",
4852
+ backgroundOverlayGradientFrom: "#334b63",
4853
+ backgroundOverlayGradientTo: "#496582",
4854
+ backgroundOverlayGradientAngle: "135",
4855
+ backgroundOverlayGradientFromStrength: 100,
4856
+ backgroundOverlayGradientToStrength: 100,
4857
+ backgroundOverlayGradientStart: 0,
4858
+ backgroundOverlayGradientEnd: 100,
4859
+ backgroundOverlayGradientFeather: 100,
4860
+ backgroundImageCornerStyle: "rounded",
4861
+ backgroundImageFit: "cover",
4862
+ backgroundImagePosition: "center",
4863
+ heroHeight: "sm",
4864
+ headline: "New Hero Section",
4865
+ kicker: "Optional kicker",
4866
+ primaryHref: "/contact",
4867
+ primaryLabel: "Primary Action",
4868
+ secondaryHref: "/services",
4869
+ secondaryLabel: "Secondary Action",
4870
+ subheadline: "Describe your offer clearly for website visitors.",
4871
+ variant: "default"
4872
+ },
4873
+ media: {
4874
+ ...withSectionStyleDefaults({}),
4875
+ caption: "Add a caption",
4876
+ imageCornerStyle: "rounded",
4877
+ imageFit: "cover",
4878
+ imagePosition: "center",
4879
+ size: "default"
4880
+ },
4881
+ logoWall: withSectionStyleDefaults({
4882
+ items: [
4883
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 1" },
4884
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 2" },
4885
+ { imageCornerStyle: "rounded", imageFit: "contain", imagePosition: "center", name: "Trusted Partner 3" }
4886
+ ],
4887
+ subtitle: "Show logos from trusted associations, partners, or collaborators.",
4888
+ title: "Trusted by Great Partners"
4889
+ }),
4890
+ richText: {
4891
+ ...withSectionStyleDefaults({}),
4892
+ cards: [],
4893
+ content: {
4894
+ root: {
4895
+ children: [
4896
+ {
4897
+ children: [
4898
+ {
4899
+ detail: 0,
4900
+ format: 0,
4901
+ mode: "normal",
4902
+ style: "",
4903
+ text: "Write your content here.",
4904
+ type: "text",
4905
+ version: 1
4906
+ }
4907
+ ],
4908
+ direction: "ltr",
4909
+ format: "",
4910
+ indent: 0,
4911
+ type: "paragraph",
4912
+ version: 1
4913
+ }
4914
+ ],
4915
+ direction: "ltr",
4916
+ format: "",
4917
+ indent: 0,
4918
+ type: "root",
4919
+ version: 1
4920
+ }
4295
4921
  },
4296
- ["social-media-global"],
4297
- { tags: [contentTag] }
4298
- );
4299
- async function getSiteSettings(draft = false) {
4300
- if (draft) {
4301
- const payload = await getPayloadClient();
4302
- const settings = await payload.findGlobal({
4303
- slug: "site-settings",
4304
- depth: 1,
4305
- draft: true
4306
- });
4307
- return settings;
4308
- }
4309
- return getSiteSettingsCached();
4922
+ statsItems: [],
4923
+ title: "Section Heading",
4924
+ width: "normal"
4925
+ },
4926
+ testimonials: {
4927
+ ...withSectionStyleDefaults({}),
4928
+ autoRotate: true,
4929
+ items: [{ location: "City, ST", name: "Customer Name", quote: "Customer feedback goes here.", rating: 5 }],
4930
+ rotateIntervalSeconds: 7,
4931
+ title: "What Customers Say",
4932
+ visibleCount: 3
4933
+ },
4934
+ stats: withSectionStyleDefaults({
4935
+ items: [
4936
+ { description: "Average first response", label: "Response Time", value: "24h" },
4937
+ { description: "Client satisfaction score", label: "Satisfaction", value: "4.9/5" },
4938
+ { description: "Recent projects or clients served", label: "Recent Work", value: "150+" }
4939
+ ],
4940
+ subtitle: "Highlight measurable outcomes to build trust quickly.",
4941
+ title: "Performance Highlights"
4942
+ })
4943
+ };
4944
+ var nodeTypeLabels = {
4945
+ bookingEmbed: "Booking Embed",
4946
+ beforeAfter: "Before / After",
4947
+ cta: "Call To Action",
4948
+ faq: "FAQ",
4949
+ featureGrid: "Feature Grid",
4950
+ formEmbed: "Form Embed",
4951
+ hero: "Hero",
4952
+ logoWall: "Logo Wall",
4953
+ media: "Media",
4954
+ richText: "Rich Text",
4955
+ stats: "Stats",
4956
+ testimonials: "Testimonials"
4957
+ };
4958
+ var pageNodeTypes = Object.keys(defaultNodeData).map((type) => ({
4959
+ type,
4960
+ displayName: nodeTypeLabels[type] || type,
4961
+ description: `Page node for ${nodeTypeLabels[type] || type}`,
4962
+ getDefaultData: () => {
4963
+ const migrated = migrateBlockToSettingsV2(structuredClone(defaultNodeData[type]));
4964
+ const { blockType: _ignoredBlockType, ...data } = migrated;
4965
+ return data;
4310
4966
  }
4311
- async function getHeader(draft = false) {
4312
- if (draft) {
4313
- const payload = await getPayloadClient();
4314
- const header = await payload.findGlobal({
4315
- slug: "header",
4316
- depth: 1,
4317
- draft: true
4318
- });
4319
- return header;
4320
- }
4321
- return getHeaderCached();
4967
+ }));
4968
+ var validatePageDocument = (document) => {
4969
+ const issues = [];
4970
+ if (!document.title || document.title.trim().length === 0) {
4971
+ issues.push({
4972
+ code: "pages.title.required",
4973
+ message: "Page title is required before publishing.",
4974
+ path: "title",
4975
+ severity: "error"
4976
+ });
4322
4977
  }
4323
- async function getFooter(draft = false) {
4324
- if (draft) {
4325
- const payload = await getPayloadClient();
4326
- const footer = await payload.findGlobal({
4327
- slug: "footer",
4328
- depth: 1,
4329
- draft: true
4330
- });
4331
- return footer;
4332
- }
4333
- return getFooterCached();
4978
+ if (document.nodes.length === 0) {
4979
+ issues.push({
4980
+ code: "pages.nodes.required",
4981
+ message: "At least one section is required.",
4982
+ path: "nodes",
4983
+ severity: "error"
4984
+ });
4334
4985
  }
4335
- async function getSocialMedia(draft = false) {
4336
- if (draft) {
4337
- const payload = await getPayloadClient();
4338
- const socialMedia = await payload.findGlobal({
4339
- slug: "social-media",
4340
- depth: 1,
4341
- draft: true
4986
+ document.nodes.forEach((node, index) => {
4987
+ if (node.type === "hero" && typeof node.data.headline !== "string") {
4988
+ issues.push({
4989
+ code: "pages.hero.headline",
4990
+ message: "Hero section requires a headline.",
4991
+ path: `nodes.${index}.data.headline`,
4992
+ severity: "error"
4342
4993
  });
4343
- return socialMedia;
4344
4994
  }
4345
- return getSocialMediaCached();
4346
- }
4347
- return {
4348
- getSiteSettings,
4349
- getHeader,
4350
- getFooter,
4351
- getSocialMedia
4352
- };
4353
- }
4354
-
4355
- // src/nextjs/utilities/media.ts
4356
- function resolveMedia(media) {
4357
- if (!media) {
4358
- return null;
4359
- }
4360
- if (typeof media === "number" || typeof media === "string") {
4361
- return null;
4362
- }
4363
- if (media.url) {
4364
- return {
4365
- url: media.url,
4366
- alt: media.alt || ""
4367
- };
4368
- }
4369
- if (media.filename) {
4370
- return {
4371
- url: `/media/${media.filename}`,
4372
- alt: media.alt || ""
4373
- };
4374
- }
4375
- return null;
4376
- }
4377
-
4378
- // src/nextjs/utilities/socialMedia.ts
4379
- function resolveSocialMediaLinks(data) {
4380
- const profiles = data?.profiles;
4381
- if (!profiles || typeof profiles !== "object") {
4382
- return [];
4995
+ });
4996
+ return issues;
4997
+ };
4998
+ var pagePaletteGroups = [
4999
+ {
5000
+ id: "page-core",
5001
+ label: "Core Sections",
5002
+ items: [
5003
+ { nodeType: "hero", title: "Hero", description: "Top-of-page headline and CTA" },
5004
+ { nodeType: "featureGrid", title: "Feature Grid", description: "Service or value cards" },
5005
+ { nodeType: "stats", title: "Stats", description: "Key performance highlights" },
5006
+ { nodeType: "logoWall", title: "Logo Wall", description: "Trust logos and badges" },
5007
+ { nodeType: "beforeAfter", title: "Before / After", description: "Visual before-and-after gallery" },
5008
+ { nodeType: "richText", title: "Rich Text", description: "Long-form content area" },
5009
+ { nodeType: "media", title: "Media", description: "Image/video section" },
5010
+ { nodeType: "testimonials", title: "Testimonials", description: "Social proof quotes" },
5011
+ { nodeType: "faq", title: "FAQ", description: "Question-and-answer section" },
5012
+ { nodeType: "cta", title: "Call To Action", description: "Conversion strip with button" },
5013
+ { nodeType: "formEmbed", title: "Form Embed", description: "Lead capture form" },
5014
+ { nodeType: "bookingEmbed", title: "Booking Embed", description: "Scheduling panel" }
5015
+ ]
4383
5016
  }
4384
- return SOCIAL_MEDIA_PLATFORMS.reduce((acc, platform) => {
4385
- const profile = profiles[platform];
4386
- if (!profile || typeof profile !== "object") {
4387
- return acc;
4388
- }
4389
- const url = typeof profile.url === "string" ? profile.url.trim() : "";
4390
- if (!url) {
4391
- return acc;
5017
+ ];
5018
+ var pageInspectorPanelRegistry = Object.keys(defaultNodeData).map((nodeType) => ({
5019
+ nodeType,
5020
+ panelID: `${nodeType}-panel`,
5021
+ panelLabel: `${nodeTypeLabels[nodeType] || nodeType} Settings`
5022
+ }));
5023
+ var resolvePanelFields = (nodeType) => inspectorDefinitionByBlockType[nodeType]?.fields.map((field) => ({
5024
+ advanced: field.advanced,
5025
+ group: field.group,
5026
+ inlineEditable: field.inlineEditable,
5027
+ key: field.key,
5028
+ label: field.label,
5029
+ type: field.type
5030
+ })) || [];
5031
+ var pageInspectorPanels = pageInspectorPanelRegistry.map((entry) => ({
5032
+ fields: resolvePanelFields(entry.nodeType),
5033
+ id: entry.panelID,
5034
+ label: entry.panelLabel,
5035
+ nodeType: entry.nodeType
5036
+ }));
5037
+ var pageStudioModuleManifest = {
5038
+ id: "studio-pages",
5039
+ version: "0.1.0-beta.0",
5040
+ displayName: "Pages Studio Module",
5041
+ nodeTypes: pageNodeTypes,
5042
+ paletteGroups: pagePaletteGroups,
5043
+ inspectorPanels: pageInspectorPanels,
5044
+ validators: [validatePageDocument],
5045
+ migrations: pageStudioMigrations,
5046
+ compiler: {
5047
+ compileNode: (node) => {
5048
+ const normalized = migrateBlockToSettingsV2({
5049
+ blockType: node.type,
5050
+ ...node.data
5051
+ });
5052
+ return {
5053
+ id: node.id,
5054
+ ...normalized
5055
+ };
4392
5056
  }
4393
- const icon = typeof profile.icon === "string" && profile.icon.trim().length > 0 ? profile.icon.trim() : SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM[platform];
4394
- acc.push({
4395
- icon,
4396
- label: SOCIAL_MEDIA_PLATFORM_LABELS[platform],
4397
- platform,
4398
- url
4399
- });
4400
- return acc;
4401
- }, []);
4402
- }
5057
+ },
5058
+ permissions: [
5059
+ { action: "read", role: "admin" },
5060
+ { action: "read", role: "editor" },
5061
+ { action: "read", role: "client" },
5062
+ { action: "update", role: "admin" },
5063
+ { action: "update", role: "editor" },
5064
+ { action: "update", role: "client" },
5065
+ { action: "publish", role: "admin" },
5066
+ { action: "publish", role: "editor" }
5067
+ ]
5068
+ };
4403
5069
  // Annotate the CommonJS export names for ESM import in node:
4404
5070
  0 && (module.exports = {
4405
5071
  admin,