@orion-studios/payload-studio 0.6.0-beta.17 → 0.6.0-beta.19

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.
@@ -323,6 +323,49 @@ function configureAdmin(config) {
323
323
  }
324
324
  };
325
325
  };
326
+ const attachStudioEditRedirectToCollection = (collection, options) => {
327
+ if (!studioEnabled) {
328
+ return collection;
329
+ }
330
+ const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(collection);
331
+ const existingViews = collectionWithBreadcrumb.admin?.components?.views;
332
+ const existingEditViews = existingViews?.edit;
333
+ const hasCustomEditView = Boolean(
334
+ existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
335
+ );
336
+ if (hasCustomEditView) {
337
+ return collectionWithBreadcrumb;
338
+ }
339
+ return {
340
+ ...collectionWithBreadcrumb,
341
+ admin: {
342
+ ...collectionWithBreadcrumb.admin,
343
+ components: {
344
+ ...collectionWithBreadcrumb.admin?.components,
345
+ views: {
346
+ ...existingViews,
347
+ edit: {
348
+ ...existingEditViews,
349
+ default: {
350
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
351
+ Component: {
352
+ exportName: "StudioDocumentRedirect",
353
+ path: clientPath,
354
+ clientProps: {
355
+ description: options.description,
356
+ ...options.emptyHref ? { emptyHref: options.emptyHref } : {},
357
+ ...options.emptyLabel ? { emptyLabel: options.emptyLabel } : {},
358
+ pathBase: options.pathBase,
359
+ title: options.title
360
+ }
361
+ }
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
367
+ };
368
+ };
326
369
  return {
327
370
  admin: {
328
371
  css: cssPath,
@@ -433,6 +476,42 @@ function configureAdmin(config) {
433
476
  formUploadsCollectionSlug
434
477
  }
435
478
  }
479
+ },
480
+ studioFormSubmission: {
481
+ path: `${formsBasePath}/submissions/:id`,
482
+ Component: {
483
+ exportName: "AdminStudioFormSubmissionView",
484
+ path: clientPath,
485
+ clientProps: {
486
+ ...studioNavClientProps,
487
+ formsCollectionSlug,
488
+ formSubmissionsCollectionSlug,
489
+ formUploadsCollectionSlug
490
+ }
491
+ }
492
+ },
493
+ studioFormUpload: {
494
+ path: `${formsBasePath}/uploads/:id`,
495
+ Component: {
496
+ exportName: "AdminStudioFormUploadView",
497
+ path: clientPath,
498
+ clientProps: {
499
+ ...studioNavClientProps,
500
+ formUploadsCollectionSlug
501
+ }
502
+ }
503
+ },
504
+ studioFormDetail: {
505
+ path: `${formsBasePath}/:id`,
506
+ Component: {
507
+ exportName: "AdminStudioFormDetailView",
508
+ path: clientPath,
509
+ clientProps: {
510
+ ...studioNavClientProps,
511
+ formsCollectionSlug,
512
+ formSubmissionsCollectionSlug
513
+ }
514
+ }
436
515
  }
437
516
  } : {},
438
517
  studioMedia: {
@@ -611,13 +690,31 @@ function configureAdmin(config) {
611
690
  return attachStudioBackBreadcrumbToCollection(mediaCollection);
612
691
  },
613
692
  wrapFormsCollection(formsCollection) {
614
- return attachStudioBackBreadcrumbToCollection(formsCollection);
693
+ return attachStudioEditRedirectToCollection(formsCollection, {
694
+ description: "Redirecting to the Studio form workspace.",
695
+ emptyHref: formsBasePath,
696
+ emptyLabel: "Open Forms",
697
+ pathBase: formsBasePath,
698
+ title: "Opening Form..."
699
+ });
615
700
  },
616
701
  wrapFormSubmissionsCollection(formSubmissionsCollection) {
617
- return attachStudioBackBreadcrumbToCollection(formSubmissionsCollection);
702
+ return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
703
+ description: "Redirecting to the Studio submission workspace.",
704
+ emptyHref: formsBasePath,
705
+ emptyLabel: "Open Forms",
706
+ pathBase: `${formsBasePath}/submissions`,
707
+ title: "Opening Submission..."
708
+ });
618
709
  },
619
710
  wrapFormUploadsCollection(formUploadsCollection) {
620
- return attachStudioBackBreadcrumbToCollection(formUploadsCollection);
711
+ return attachStudioEditRedirectToCollection(formUploadsCollection, {
712
+ description: "Redirecting to the Studio upload workspace.",
713
+ emptyHref: formsBasePath,
714
+ emptyLabel: "Open Forms",
715
+ pathBase: `${formsBasePath}/uploads`,
716
+ title: "Opening Upload..."
717
+ });
621
718
  },
622
719
  wrapGlobals(globals2) {
623
720
  const labelMap = {
@@ -7,7 +7,7 @@ import {
7
7
  socialMediaConnectionsField,
8
8
  themePreferenceField,
9
9
  withTooltips
10
- } from "../chunk-XZQILJK3.mjs";
10
+ } from "../chunk-3AHBR7RI.mjs";
11
11
  import "../chunk-W2UOCJDX.mjs";
12
12
  import {
13
13
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
@@ -294,6 +294,49 @@ function configureAdmin(config) {
294
294
  }
295
295
  };
296
296
  };
297
+ const attachStudioEditRedirectToCollection = (collection, options) => {
298
+ if (!studioEnabled) {
299
+ return collection;
300
+ }
301
+ const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(collection);
302
+ const existingViews = collectionWithBreadcrumb.admin?.components?.views;
303
+ const existingEditViews = existingViews?.edit;
304
+ const hasCustomEditView = Boolean(
305
+ existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
306
+ );
307
+ if (hasCustomEditView) {
308
+ return collectionWithBreadcrumb;
309
+ }
310
+ return {
311
+ ...collectionWithBreadcrumb,
312
+ admin: {
313
+ ...collectionWithBreadcrumb.admin,
314
+ components: {
315
+ ...collectionWithBreadcrumb.admin?.components,
316
+ views: {
317
+ ...existingViews,
318
+ edit: {
319
+ ...existingEditViews,
320
+ default: {
321
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
322
+ Component: {
323
+ exportName: "StudioDocumentRedirect",
324
+ path: clientPath,
325
+ clientProps: {
326
+ description: options.description,
327
+ ...options.emptyHref ? { emptyHref: options.emptyHref } : {},
328
+ ...options.emptyLabel ? { emptyLabel: options.emptyLabel } : {},
329
+ pathBase: options.pathBase,
330
+ title: options.title
331
+ }
332
+ }
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ };
339
+ };
297
340
  return {
298
341
  admin: {
299
342
  css: cssPath,
@@ -404,6 +447,42 @@ function configureAdmin(config) {
404
447
  formUploadsCollectionSlug
405
448
  }
406
449
  }
450
+ },
451
+ studioFormSubmission: {
452
+ path: `${formsBasePath}/submissions/:id`,
453
+ Component: {
454
+ exportName: "AdminStudioFormSubmissionView",
455
+ path: clientPath,
456
+ clientProps: {
457
+ ...studioNavClientProps,
458
+ formsCollectionSlug,
459
+ formSubmissionsCollectionSlug,
460
+ formUploadsCollectionSlug
461
+ }
462
+ }
463
+ },
464
+ studioFormUpload: {
465
+ path: `${formsBasePath}/uploads/:id`,
466
+ Component: {
467
+ exportName: "AdminStudioFormUploadView",
468
+ path: clientPath,
469
+ clientProps: {
470
+ ...studioNavClientProps,
471
+ formUploadsCollectionSlug
472
+ }
473
+ }
474
+ },
475
+ studioFormDetail: {
476
+ path: `${formsBasePath}/:id`,
477
+ Component: {
478
+ exportName: "AdminStudioFormDetailView",
479
+ path: clientPath,
480
+ clientProps: {
481
+ ...studioNavClientProps,
482
+ formsCollectionSlug,
483
+ formSubmissionsCollectionSlug
484
+ }
485
+ }
407
486
  }
408
487
  } : {},
409
488
  studioMedia: {
@@ -582,13 +661,31 @@ function configureAdmin(config) {
582
661
  return attachStudioBackBreadcrumbToCollection(mediaCollection);
583
662
  },
584
663
  wrapFormsCollection(formsCollection) {
585
- return attachStudioBackBreadcrumbToCollection(formsCollection);
664
+ return attachStudioEditRedirectToCollection(formsCollection, {
665
+ description: "Redirecting to the Studio form workspace.",
666
+ emptyHref: formsBasePath,
667
+ emptyLabel: "Open Forms",
668
+ pathBase: formsBasePath,
669
+ title: "Opening Form..."
670
+ });
586
671
  },
587
672
  wrapFormSubmissionsCollection(formSubmissionsCollection) {
588
- return attachStudioBackBreadcrumbToCollection(formSubmissionsCollection);
673
+ return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
674
+ description: "Redirecting to the Studio submission workspace.",
675
+ emptyHref: formsBasePath,
676
+ emptyLabel: "Open Forms",
677
+ pathBase: `${formsBasePath}/submissions`,
678
+ title: "Opening Submission..."
679
+ });
589
680
  },
590
681
  wrapFormUploadsCollection(formUploadsCollection) {
591
- return attachStudioBackBreadcrumbToCollection(formUploadsCollection);
682
+ return attachStudioEditRedirectToCollection(formUploadsCollection, {
683
+ description: "Redirecting to the Studio upload workspace.",
684
+ emptyHref: formsBasePath,
685
+ emptyLabel: "Open Forms",
686
+ pathBase: `${formsBasePath}/uploads`,
687
+ title: "Opening Upload..."
688
+ });
592
689
  },
593
690
  wrapGlobals(globals2) {
594
691
  const labelMap = {
@@ -99,6 +99,7 @@ var defaultBuilderThemeTokens = {
99
99
 
100
100
  // src/studio-pages/builder/adapters/settingsV2.ts
101
101
  var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
102
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
102
103
  var parsePercent = (value) => {
103
104
  if (typeof value === "number" && Number.isFinite(value)) {
104
105
  return Math.max(0, Math.min(100, value));
@@ -141,6 +142,10 @@ var mergeSettings = (defaults, input) => {
141
142
  };
142
143
  var legacyBlockToV2Settings = (block) => {
143
144
  const current = structuredClone(defaultBuilderBlockSettingsV2);
145
+ if (block.blockType === "hero" && block.variant === "centered") {
146
+ current.typography.headingAlign = "center";
147
+ current.typography.bodyAlign = "center";
148
+ }
144
149
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
145
150
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
146
151
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -177,8 +182,8 @@ var legacyBlockToV2Settings = (block) => {
177
182
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
178
183
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
179
184
  current.media.height = parsePixel(block.imageHeight);
180
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
181
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
185
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
186
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
182
187
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
183
188
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
184
189
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
@@ -7,7 +7,7 @@ import {
7
7
  layoutToStudioDocument,
8
8
  migrateBlockToSettingsV2,
9
9
  studioDocumentToLayout
10
- } from "./chunk-PF3EBZXF.mjs";
10
+ } from "./chunk-4LSIUED5.mjs";
11
11
  import {
12
12
  assertStudioDocumentV1,
13
13
  compileStudioDocument,
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-ZTXJG4K5.mjs";
6
6
  import {
7
7
  studioDocumentToLayout
8
- } from "./chunk-PF3EBZXF.mjs";
8
+ } from "./chunk-4LSIUED5.mjs";
9
9
  import {
10
10
  assertStudioDocumentV1
11
11
  } from "./chunk-ADIIWIYL.mjs";
package/dist/index.js CHANGED
@@ -349,6 +349,49 @@ function configureAdmin(config) {
349
349
  }
350
350
  };
351
351
  };
352
+ const attachStudioEditRedirectToCollection = (collection, options) => {
353
+ if (!studioEnabled) {
354
+ return collection;
355
+ }
356
+ const collectionWithBreadcrumb = attachStudioBackBreadcrumbToCollection(collection);
357
+ const existingViews = collectionWithBreadcrumb.admin?.components?.views;
358
+ const existingEditViews = existingViews?.edit;
359
+ const hasCustomEditView = Boolean(
360
+ existingEditViews?.root || existingEditViews?.default && typeof existingEditViews.default === "object" && existingEditViews.default.Component
361
+ );
362
+ if (hasCustomEditView) {
363
+ return collectionWithBreadcrumb;
364
+ }
365
+ return {
366
+ ...collectionWithBreadcrumb,
367
+ admin: {
368
+ ...collectionWithBreadcrumb.admin,
369
+ components: {
370
+ ...collectionWithBreadcrumb.admin?.components,
371
+ views: {
372
+ ...existingViews,
373
+ edit: {
374
+ ...existingEditViews,
375
+ default: {
376
+ ...typeof existingEditViews?.default === "object" ? existingEditViews.default : {},
377
+ Component: {
378
+ exportName: "StudioDocumentRedirect",
379
+ path: clientPath,
380
+ clientProps: {
381
+ description: options.description,
382
+ ...options.emptyHref ? { emptyHref: options.emptyHref } : {},
383
+ ...options.emptyLabel ? { emptyLabel: options.emptyLabel } : {},
384
+ pathBase: options.pathBase,
385
+ title: options.title
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+ }
392
+ }
393
+ };
394
+ };
352
395
  return {
353
396
  admin: {
354
397
  css: cssPath,
@@ -459,6 +502,42 @@ function configureAdmin(config) {
459
502
  formUploadsCollectionSlug
460
503
  }
461
504
  }
505
+ },
506
+ studioFormSubmission: {
507
+ path: `${formsBasePath}/submissions/:id`,
508
+ Component: {
509
+ exportName: "AdminStudioFormSubmissionView",
510
+ path: clientPath,
511
+ clientProps: {
512
+ ...studioNavClientProps,
513
+ formsCollectionSlug,
514
+ formSubmissionsCollectionSlug,
515
+ formUploadsCollectionSlug
516
+ }
517
+ }
518
+ },
519
+ studioFormUpload: {
520
+ path: `${formsBasePath}/uploads/:id`,
521
+ Component: {
522
+ exportName: "AdminStudioFormUploadView",
523
+ path: clientPath,
524
+ clientProps: {
525
+ ...studioNavClientProps,
526
+ formUploadsCollectionSlug
527
+ }
528
+ }
529
+ },
530
+ studioFormDetail: {
531
+ path: `${formsBasePath}/:id`,
532
+ Component: {
533
+ exportName: "AdminStudioFormDetailView",
534
+ path: clientPath,
535
+ clientProps: {
536
+ ...studioNavClientProps,
537
+ formsCollectionSlug,
538
+ formSubmissionsCollectionSlug
539
+ }
540
+ }
462
541
  }
463
542
  } : {},
464
543
  studioMedia: {
@@ -637,13 +716,31 @@ function configureAdmin(config) {
637
716
  return attachStudioBackBreadcrumbToCollection(mediaCollection);
638
717
  },
639
718
  wrapFormsCollection(formsCollection) {
640
- return attachStudioBackBreadcrumbToCollection(formsCollection);
719
+ return attachStudioEditRedirectToCollection(formsCollection, {
720
+ description: "Redirecting to the Studio form workspace.",
721
+ emptyHref: formsBasePath,
722
+ emptyLabel: "Open Forms",
723
+ pathBase: formsBasePath,
724
+ title: "Opening Form..."
725
+ });
641
726
  },
642
727
  wrapFormSubmissionsCollection(formSubmissionsCollection) {
643
- return attachStudioBackBreadcrumbToCollection(formSubmissionsCollection);
728
+ return attachStudioEditRedirectToCollection(formSubmissionsCollection, {
729
+ description: "Redirecting to the Studio submission workspace.",
730
+ emptyHref: formsBasePath,
731
+ emptyLabel: "Open Forms",
732
+ pathBase: `${formsBasePath}/submissions`,
733
+ title: "Opening Submission..."
734
+ });
644
735
  },
645
736
  wrapFormUploadsCollection(formUploadsCollection) {
646
- return attachStudioBackBreadcrumbToCollection(formUploadsCollection);
737
+ return attachStudioEditRedirectToCollection(formUploadsCollection, {
738
+ description: "Redirecting to the Studio upload workspace.",
739
+ emptyHref: formsBasePath,
740
+ emptyLabel: "Open Forms",
741
+ pathBase: `${formsBasePath}/uploads`,
742
+ title: "Opening Upload..."
743
+ });
647
744
  },
648
745
  wrapGlobals(globals2) {
649
746
  const labelMap = {
@@ -3643,6 +3740,7 @@ var defaultBuilderThemeTokens = {
3643
3740
 
3644
3741
  // src/studio-pages/builder/adapters/settingsV2.ts
3645
3742
  var isRecord3 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
3743
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
3646
3744
  var parsePercent = (value) => {
3647
3745
  if (typeof value === "number" && Number.isFinite(value)) {
3648
3746
  return Math.max(0, Math.min(100, value));
@@ -3685,6 +3783,10 @@ var mergeSettings = (defaults, input) => {
3685
3783
  };
3686
3784
  var legacyBlockToV2Settings = (block) => {
3687
3785
  const current = structuredClone(defaultBuilderBlockSettingsV2);
3786
+ if (block.blockType === "hero" && block.variant === "centered") {
3787
+ current.typography.headingAlign = "center";
3788
+ current.typography.bodyAlign = "center";
3789
+ }
3688
3790
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
3689
3791
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
3690
3792
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -3721,8 +3823,8 @@ var legacyBlockToV2Settings = (block) => {
3721
3823
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
3722
3824
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
3723
3825
  current.media.height = parsePixel(block.imageHeight);
3724
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
3725
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
3826
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
3827
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
3726
3828
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
3727
3829
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
3728
3830
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  admin_exports
3
- } from "./chunk-XZQILJK3.mjs";
3
+ } from "./chunk-3AHBR7RI.mjs";
4
4
  import {
5
5
  admin_app_exports
6
6
  } from "./chunk-RKTIFEUY.mjs";
@@ -10,13 +10,13 @@ import {
10
10
  } from "./chunk-JQAHXYAM.mjs";
11
11
  import {
12
12
  nextjs_exports
13
- } from "./chunk-OTHERBGX.mjs";
13
+ } from "./chunk-H4GTEY24.mjs";
14
14
  import "./chunk-ZTXJG4K5.mjs";
15
15
  import {
16
16
  studio_pages_exports
17
- } from "./chunk-XKUTZ7IU.mjs";
17
+ } from "./chunk-EDW7DPXW.mjs";
18
18
  import "./chunk-OQSEJXC4.mjs";
19
- import "./chunk-PF3EBZXF.mjs";
19
+ import "./chunk-4LSIUED5.mjs";
20
20
  import {
21
21
  studio_exports
22
22
  } from "./chunk-ADIIWIYL.mjs";
@@ -166,6 +166,7 @@ var defaultBuilderItemSettingsV2 = {
166
166
 
167
167
  // src/studio-pages/builder/adapters/settingsV2.ts
168
168
  var isRecord2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
169
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
169
170
  var parsePercent = (value) => {
170
171
  if (typeof value === "number" && Number.isFinite(value)) {
171
172
  return Math.max(0, Math.min(100, value));
@@ -208,6 +209,10 @@ var mergeSettings = (defaults, input) => {
208
209
  };
209
210
  var legacyBlockToV2Settings = (block) => {
210
211
  const current = structuredClone(defaultBuilderBlockSettingsV2);
212
+ if (block.blockType === "hero" && block.variant === "centered") {
213
+ current.typography.headingAlign = "center";
214
+ current.typography.bodyAlign = "center";
215
+ }
211
216
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
212
217
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
213
218
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -244,8 +249,8 @@ var legacyBlockToV2Settings = (block) => {
244
249
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
245
250
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
246
251
  current.media.height = parsePixel(block.imageHeight);
247
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
248
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
252
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
253
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
249
254
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
250
255
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
251
256
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
@@ -5,9 +5,9 @@ import {
5
5
  createSiteQueries,
6
6
  resolveMedia,
7
7
  resolveSocialMediaLinks
8
- } from "../chunk-OTHERBGX.mjs";
8
+ } from "../chunk-H4GTEY24.mjs";
9
9
  import "../chunk-ZTXJG4K5.mjs";
10
- import "../chunk-PF3EBZXF.mjs";
10
+ import "../chunk-4LSIUED5.mjs";
11
11
  import "../chunk-ADIIWIYL.mjs";
12
12
  import "../chunk-6BWS3CLP.mjs";
13
13
  export {
@@ -156,6 +156,7 @@ var defaultBuilderThemeTokens = {
156
156
 
157
157
  // src/studio-pages/builder/adapters/settingsV2.ts
158
158
  var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
159
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
159
160
  var parsePercent = (value) => {
160
161
  if (typeof value === "number" && Number.isFinite(value)) {
161
162
  return Math.max(0, Math.min(100, value));
@@ -198,6 +199,10 @@ var mergeSettings = (defaults, input) => {
198
199
  };
199
200
  var legacyBlockToV2Settings = (block) => {
200
201
  const current = structuredClone(defaultBuilderBlockSettingsV2);
202
+ if (block.blockType === "hero" && block.variant === "centered") {
203
+ current.typography.headingAlign = "center";
204
+ current.typography.bodyAlign = "center";
205
+ }
201
206
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
202
207
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
203
208
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -234,8 +239,8 @@ var legacyBlockToV2Settings = (block) => {
234
239
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
235
240
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
236
241
  current.media.height = parsePixel(block.imageHeight);
237
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
238
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
242
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
243
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
239
244
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
240
245
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
241
246
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
@@ -129,6 +129,7 @@ var defaultBuilderThemeTokens = {
129
129
 
130
130
  // src/studio-pages/builder/adapters/settingsV2.ts
131
131
  var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
132
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
132
133
  var parsePercent = (value) => {
133
134
  if (typeof value === "number" && Number.isFinite(value)) {
134
135
  return Math.max(0, Math.min(100, value));
@@ -171,6 +172,10 @@ var mergeSettings = (defaults, input) => {
171
172
  };
172
173
  var legacyBlockToV2Settings = (block) => {
173
174
  const current = structuredClone(defaultBuilderBlockSettingsV2);
175
+ if (block.blockType === "hero" && block.variant === "centered") {
176
+ current.typography.headingAlign = "center";
177
+ current.typography.bodyAlign = "center";
178
+ }
174
179
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
175
180
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
176
181
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -207,8 +212,8 @@ var legacyBlockToV2Settings = (block) => {
207
212
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
208
213
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
209
214
  current.media.height = parsePixel(block.imageHeight);
210
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
211
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
215
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
216
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
212
217
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
213
218
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
214
219
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
@@ -156,6 +156,7 @@ var defaultBuilderThemeTokens = {
156
156
 
157
157
  // src/studio-pages/builder/adapters/settingsV2.ts
158
158
  var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
159
+ var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
159
160
  var parsePercent = (value) => {
160
161
  if (typeof value === "number" && Number.isFinite(value)) {
161
162
  return Math.max(0, Math.min(100, value));
@@ -198,6 +199,10 @@ var mergeSettings = (defaults, input) => {
198
199
  };
199
200
  var legacyBlockToV2Settings = (block) => {
200
201
  const current = structuredClone(defaultBuilderBlockSettingsV2);
202
+ if (block.blockType === "hero" && block.variant === "centered") {
203
+ current.typography.headingAlign = "center";
204
+ current.typography.bodyAlign = "center";
205
+ }
201
206
  current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
202
207
  current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
203
208
  current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
@@ -234,8 +239,8 @@ var legacyBlockToV2Settings = (block) => {
234
239
  current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
235
240
  current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
236
241
  current.media.height = parsePixel(block.imageHeight);
237
- current.typography.headingAlign = block.textHeadingAlign === "left" || block.textHeadingAlign === "center" || block.textHeadingAlign === "right" || block.textHeadingAlign === "justify" ? block.textHeadingAlign : current.typography.headingAlign;
238
- current.typography.bodyAlign = block.textBodyAlign === "left" || block.textBodyAlign === "center" || block.textBodyAlign === "right" || block.textBodyAlign === "justify" ? block.textBodyAlign : current.typography.bodyAlign;
242
+ current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
243
+ current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
239
244
  current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
240
245
  current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
241
246
  current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;