@orion-studios/payload-studio 0.5.0-beta.4 → 0.5.0-beta.40

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 (46) hide show
  1. package/dist/admin/client.js +68 -7
  2. package/dist/admin/client.mjs +68 -7
  3. package/dist/admin/index.d.mts +1 -1
  4. package/dist/admin/index.d.ts +1 -1
  5. package/dist/admin/index.js +37 -0
  6. package/dist/admin/index.mjs +3 -1
  7. package/dist/admin-app/client.d.mts +4 -0
  8. package/dist/admin-app/client.d.ts +4 -0
  9. package/dist/admin-app/client.js +705 -2
  10. package/dist/admin-app/client.mjs +701 -1
  11. package/dist/admin-app/index.d.mts +1 -1
  12. package/dist/admin-app/index.d.ts +1 -1
  13. package/dist/admin-app/index.js +167 -0
  14. package/dist/admin-app/index.mjs +13 -1
  15. package/dist/admin-app/styles.css +127 -0
  16. package/dist/blocks/index.js +424 -4
  17. package/dist/blocks/index.mjs +2 -2
  18. package/dist/{chunk-UJFU323N.mjs → chunk-34J4T7X3.mjs} +33 -9
  19. package/dist/{chunk-J7W5EE3B.mjs → chunk-7IGLXLUB.mjs} +37 -0
  20. package/dist/{chunk-PC5622T7.mjs → chunk-I4NH636V.mjs} +411 -5
  21. package/dist/{chunk-ZLLNO5FM.mjs → chunk-RXXPFQWL.mjs} +44 -13
  22. package/dist/{chunk-ETRRXURT.mjs → chunk-SIL2J5MF.mjs} +14 -0
  23. package/dist/chunk-XVH5SCBD.mjs +234 -0
  24. package/dist/index-BBvk9b9i.d.mts +97 -0
  25. package/dist/index-BBvk9b9i.d.ts +97 -0
  26. package/dist/{index-DbH0Ljwp.d.mts → index-CpG3UHcS.d.mts} +1 -0
  27. package/dist/{index-DbH0Ljwp.d.ts → index-CpG3UHcS.d.ts} +1 -0
  28. package/dist/{index-DJFhANvJ.d.ts → index-Dj21uD_B.d.mts} +5 -2
  29. package/dist/{index-DJFhANvJ.d.mts → index-Dj21uD_B.d.ts} +5 -2
  30. package/dist/index.d.mts +3 -3
  31. package/dist/index.d.ts +3 -3
  32. package/dist/index.js +871 -203
  33. package/dist/index.mjs +11 -11
  34. package/dist/nextjs/index.d.mts +1 -1
  35. package/dist/nextjs/index.d.ts +1 -1
  36. package/dist/nextjs/index.js +290 -13
  37. package/dist/nextjs/index.mjs +4 -1
  38. package/dist/studio-pages/builder.css +25 -1
  39. package/dist/studio-pages/client.js +3545 -1279
  40. package/dist/studio-pages/client.mjs +3545 -1279
  41. package/dist/studio-pages/index.js +33 -8
  42. package/dist/studio-pages/index.mjs +2 -2
  43. package/package.json +24 -12
  44. package/dist/chunk-AAOHJDNS.mjs +0 -67
  45. package/dist/index-BallJs-K.d.mts +0 -43
  46. package/dist/index-BallJs-K.d.ts +0 -43
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sectionStyleFields
3
- } from "./chunk-ETRRXURT.mjs";
3
+ } from "./chunk-SIL2J5MF.mjs";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-6BWS3CLP.mjs";
@@ -81,6 +81,67 @@ var BeforeAfterBlock = {
81
81
  relationTo: "media",
82
82
  required: false
83
83
  },
84
+ {
85
+ name: "imageHeight",
86
+ type: "number",
87
+ defaultValue: 160,
88
+ min: 60,
89
+ max: 600,
90
+ admin: {
91
+ description: "Overrides the before/after image height (in pixels).",
92
+ step: 10
93
+ }
94
+ },
95
+ {
96
+ name: "imageFit",
97
+ type: "select",
98
+ defaultValue: "cover",
99
+ options: [
100
+ { label: "Cover", value: "cover" },
101
+ { label: "Contain", value: "contain" }
102
+ ]
103
+ },
104
+ {
105
+ name: "imageCornerStyle",
106
+ type: "select",
107
+ defaultValue: "rounded",
108
+ options: [
109
+ { label: "Rounded", value: "rounded" },
110
+ { label: "Square", value: "square" }
111
+ ]
112
+ },
113
+ {
114
+ name: "imagePosition",
115
+ type: "select",
116
+ defaultValue: "center",
117
+ options: [
118
+ { label: "Center", value: "center" },
119
+ { label: "Top", value: "top" },
120
+ { label: "Bottom", value: "bottom" },
121
+ { label: "Left", value: "left" },
122
+ { label: "Right", value: "right" }
123
+ ]
124
+ },
125
+ {
126
+ name: "imagePositionX",
127
+ type: "number",
128
+ min: 0,
129
+ max: 100,
130
+ admin: {
131
+ description: "Optional custom horizontal focus (0-100). Overrides Image Position when set.",
132
+ step: 1
133
+ }
134
+ },
135
+ {
136
+ name: "imagePositionY",
137
+ type: "number",
138
+ min: 0,
139
+ max: 100,
140
+ admin: {
141
+ description: "Optional custom vertical focus (0-100). Overrides Image Position when set.",
142
+ step: 1
143
+ }
144
+ },
84
145
  {
85
146
  name: "description",
86
147
  type: "textarea"
@@ -278,6 +339,67 @@ var FeatureGridBlock = {
278
339
  type: "upload",
279
340
  relationTo: "media",
280
341
  required: false
342
+ },
343
+ {
344
+ name: "imageHeight",
345
+ type: "number",
346
+ defaultValue: 160,
347
+ min: 40,
348
+ max: 600,
349
+ admin: {
350
+ description: "Overrides the image height in the builder/section (in pixels).",
351
+ step: 10
352
+ }
353
+ },
354
+ {
355
+ name: "imageFit",
356
+ type: "select",
357
+ defaultValue: "cover",
358
+ options: [
359
+ { label: "Cover", value: "cover" },
360
+ { label: "Contain", value: "contain" }
361
+ ]
362
+ },
363
+ {
364
+ name: "imageCornerStyle",
365
+ type: "select",
366
+ defaultValue: "rounded",
367
+ options: [
368
+ { label: "Rounded", value: "rounded" },
369
+ { label: "Square", value: "square" }
370
+ ]
371
+ },
372
+ {
373
+ name: "imagePosition",
374
+ type: "select",
375
+ defaultValue: "center",
376
+ options: [
377
+ { label: "Center", value: "center" },
378
+ { label: "Top", value: "top" },
379
+ { label: "Bottom", value: "bottom" },
380
+ { label: "Left", value: "left" },
381
+ { label: "Right", value: "right" }
382
+ ]
383
+ },
384
+ {
385
+ name: "imagePositionX",
386
+ type: "number",
387
+ min: 0,
388
+ max: 100,
389
+ admin: {
390
+ description: "Optional custom horizontal focus (0-100). Overrides Image Position when set.",
391
+ step: 1
392
+ }
393
+ },
394
+ {
395
+ name: "imagePositionY",
396
+ type: "number",
397
+ min: 0,
398
+ max: 100,
399
+ admin: {
400
+ description: "Optional custom vertical focus (0-100). Overrides Image Position when set.",
401
+ step: 1
402
+ }
281
403
  }
282
404
  ]
283
405
  },
@@ -404,10 +526,44 @@ var HeroBlock = {
404
526
  relationTo: "media"
405
527
  },
406
528
  {
407
- name: "backgroundImageURL",
408
- type: "text",
529
+ name: "backgroundImageFit",
530
+ type: "select",
531
+ defaultValue: "cover",
532
+ options: [
533
+ { label: "Cover", value: "cover" },
534
+ { label: "Cover (Square)", value: "cover-square" },
535
+ { label: "Contain", value: "contain" },
536
+ { label: "Contain (Square)", value: "contain-square" }
537
+ ],
538
+ admin: {
539
+ description: "How the hero image should be sized within the section."
540
+ }
541
+ },
542
+ {
543
+ name: "backgroundImageCornerStyle",
544
+ type: "select",
545
+ defaultValue: "rounded",
546
+ options: [
547
+ { label: "Rounded", value: "rounded" },
548
+ { label: "Square", value: "square" }
549
+ ],
550
+ admin: {
551
+ description: "How the hero image corners should appear."
552
+ }
553
+ },
554
+ {
555
+ name: "backgroundImagePosition",
556
+ type: "select",
557
+ defaultValue: "center",
558
+ options: [
559
+ { label: "Center", value: "center" },
560
+ { label: "Top", value: "top" },
561
+ { label: "Bottom", value: "bottom" },
562
+ { label: "Left", value: "left" },
563
+ { label: "Right", value: "right" }
564
+ ],
409
565
  admin: {
410
- description: "Optional external/background image URL override for this hero section."
566
+ description: "Where the hero image should anchor inside the section."
411
567
  }
412
568
  },
413
569
  {
@@ -417,6 +573,113 @@ var HeroBlock = {
417
573
  description: "Optional background color override (example: #124a37)."
418
574
  }
419
575
  },
576
+ {
577
+ name: "backgroundOverlayMode",
578
+ type: "select",
579
+ defaultValue: "none",
580
+ options: [
581
+ { label: "None", value: "none" },
582
+ { label: "Solid", value: "solid" },
583
+ { label: "Gradient", value: "gradient" }
584
+ ],
585
+ admin: {
586
+ description: "Optional overlay on top of the hero image (applies when an image is present)."
587
+ }
588
+ },
589
+ {
590
+ name: "backgroundOverlayOpacity",
591
+ type: "number",
592
+ defaultValue: 45,
593
+ min: 0,
594
+ max: 100,
595
+ admin: {
596
+ description: "Overlay opacity (0-100).",
597
+ step: 1
598
+ }
599
+ },
600
+ {
601
+ name: "backgroundOverlayColor",
602
+ type: "text",
603
+ admin: {
604
+ description: "Overlay solid color (example: #000000). Used when Overlay Mode is Solid."
605
+ }
606
+ },
607
+ {
608
+ name: "backgroundOverlayGradientFrom",
609
+ type: "text",
610
+ admin: {
611
+ description: "Gradient overlay start color (example: #0d4a37). Used when Overlay Mode is Gradient."
612
+ }
613
+ },
614
+ {
615
+ name: "backgroundOverlayGradientTo",
616
+ type: "text",
617
+ admin: {
618
+ description: "Gradient overlay end color (example: #1f684f). Used when Overlay Mode is Gradient."
619
+ }
620
+ },
621
+ {
622
+ name: "backgroundOverlayGradientAngle",
623
+ type: "text",
624
+ admin: {
625
+ description: "Gradient overlay angle in degrees (0-360). Used when Overlay Mode is Gradient."
626
+ }
627
+ },
628
+ {
629
+ name: "backgroundOverlayGradientFromStrength",
630
+ type: "number",
631
+ defaultValue: 100,
632
+ min: 0,
633
+ max: 100,
634
+ admin: {
635
+ description: "Gradient start strength (0-100). Set to 0 for transparent.",
636
+ step: 1
637
+ }
638
+ },
639
+ {
640
+ name: "backgroundOverlayGradientToStrength",
641
+ type: "number",
642
+ defaultValue: 100,
643
+ min: 0,
644
+ max: 100,
645
+ admin: {
646
+ description: "Gradient end strength (0-100). Set to 0 for transparent.",
647
+ step: 1
648
+ }
649
+ },
650
+ {
651
+ name: "backgroundOverlayGradientStart",
652
+ type: "number",
653
+ defaultValue: 0,
654
+ min: 0,
655
+ max: 100,
656
+ admin: {
657
+ description: "Where the gradient starts (0-100).",
658
+ step: 1
659
+ }
660
+ },
661
+ {
662
+ name: "backgroundOverlayGradientEnd",
663
+ type: "number",
664
+ defaultValue: 100,
665
+ min: 0,
666
+ max: 100,
667
+ admin: {
668
+ description: "Where the gradient ends (0-100).",
669
+ step: 1
670
+ }
671
+ },
672
+ {
673
+ name: "backgroundOverlayGradientFeather",
674
+ type: "number",
675
+ defaultValue: 100,
676
+ min: 0,
677
+ max: 100,
678
+ admin: {
679
+ description: "How soft the transition is (0 = hard edge, 100 = smooth).",
680
+ step: 1
681
+ }
682
+ },
420
683
  {
421
684
  name: "variant",
422
685
  type: "select",
@@ -432,6 +695,28 @@ var HeroBlock = {
432
695
  }
433
696
  ]
434
697
  },
698
+ {
699
+ name: "heroHeight",
700
+ type: "select",
701
+ defaultValue: "sm",
702
+ options: [
703
+ {
704
+ label: "Small",
705
+ value: "sm"
706
+ },
707
+ {
708
+ label: "Medium (Half Screen)",
709
+ value: "md"
710
+ },
711
+ {
712
+ label: "Full Screen",
713
+ value: "full"
714
+ }
715
+ ],
716
+ admin: {
717
+ description: "Controls the vertical height of the hero section."
718
+ }
719
+ },
435
720
  ...sectionStyleFields()
436
721
  ]
437
722
  };
@@ -477,6 +762,67 @@ var LogoWallBlock = {
477
762
  relationTo: "media",
478
763
  required: false
479
764
  },
765
+ {
766
+ name: "imageHeight",
767
+ type: "number",
768
+ defaultValue: 64,
769
+ min: 24,
770
+ max: 200,
771
+ admin: {
772
+ description: "Overrides the logo image height (in pixels).",
773
+ step: 4
774
+ }
775
+ },
776
+ {
777
+ name: "imageFit",
778
+ type: "select",
779
+ defaultValue: "contain",
780
+ options: [
781
+ { label: "Cover", value: "cover" },
782
+ { label: "Contain", value: "contain" }
783
+ ]
784
+ },
785
+ {
786
+ name: "imageCornerStyle",
787
+ type: "select",
788
+ defaultValue: "rounded",
789
+ options: [
790
+ { label: "Rounded", value: "rounded" },
791
+ { label: "Square", value: "square" }
792
+ ]
793
+ },
794
+ {
795
+ name: "imagePosition",
796
+ type: "select",
797
+ defaultValue: "center",
798
+ options: [
799
+ { label: "Center", value: "center" },
800
+ { label: "Top", value: "top" },
801
+ { label: "Bottom", value: "bottom" },
802
+ { label: "Left", value: "left" },
803
+ { label: "Right", value: "right" }
804
+ ]
805
+ },
806
+ {
807
+ name: "imagePositionX",
808
+ type: "number",
809
+ min: 0,
810
+ max: 100,
811
+ admin: {
812
+ description: "Optional custom horizontal focus (0-100). Overrides Image Position when set.",
813
+ step: 1
814
+ }
815
+ },
816
+ {
817
+ name: "imagePositionY",
818
+ type: "number",
819
+ min: 0,
820
+ max: 100,
821
+ admin: {
822
+ description: "Optional custom vertical focus (0-100). Overrides Image Position when set.",
823
+ step: 1
824
+ }
825
+ },
480
826
  {
481
827
  name: "href",
482
828
  type: "text"
@@ -527,6 +873,36 @@ var MediaBlock = {
527
873
  }
528
874
  ]
529
875
  },
876
+ {
877
+ name: "imageFit",
878
+ type: "select",
879
+ defaultValue: "cover",
880
+ options: [
881
+ { label: "Cover", value: "cover" },
882
+ { label: "Contain", value: "contain" }
883
+ ]
884
+ },
885
+ {
886
+ name: "imageCornerStyle",
887
+ type: "select",
888
+ defaultValue: "rounded",
889
+ options: [
890
+ { label: "Rounded", value: "rounded" },
891
+ { label: "Square", value: "square" }
892
+ ]
893
+ },
894
+ {
895
+ name: "imagePosition",
896
+ type: "select",
897
+ defaultValue: "center",
898
+ options: [
899
+ { label: "Center", value: "center" },
900
+ { label: "Top", value: "top" },
901
+ { label: "Bottom", value: "bottom" },
902
+ { label: "Left", value: "left" },
903
+ { label: "Right", value: "right" }
904
+ ]
905
+ },
530
906
  ...sectionStyleFields()
531
907
  ]
532
908
  };
@@ -644,11 +1020,41 @@ var TestimonialsBlock = {
644
1020
  type: "text",
645
1021
  required: true
646
1022
  },
1023
+ {
1024
+ name: "visibleCount",
1025
+ type: "number",
1026
+ defaultValue: 3,
1027
+ min: 1,
1028
+ max: 6,
1029
+ admin: {
1030
+ description: "How many testimonials to show at once.",
1031
+ step: 1
1032
+ }
1033
+ },
1034
+ {
1035
+ name: "autoRotate",
1036
+ type: "checkbox",
1037
+ defaultValue: true,
1038
+ admin: {
1039
+ description: "Automatically rotates through all testimonials."
1040
+ }
1041
+ },
1042
+ {
1043
+ name: "rotateIntervalSeconds",
1044
+ type: "number",
1045
+ defaultValue: 7,
1046
+ min: 2,
1047
+ max: 30,
1048
+ admin: {
1049
+ description: "How often to rotate (in seconds).",
1050
+ step: 1
1051
+ }
1052
+ },
647
1053
  {
648
1054
  name: "items",
649
1055
  type: "array",
650
1056
  minRows: 1,
651
- maxRows: 6,
1057
+ maxRows: 30,
652
1058
  fields: [
653
1059
  {
654
1060
  name: "quote",
@@ -1,3 +1,9 @@
1
+ import {
2
+ assertStudioDocumentV1
3
+ } from "./chunk-N67KVM2S.mjs";
4
+ import {
5
+ studioDocumentToLayout
6
+ } from "./chunk-34J4T7X3.mjs";
1
7
  import {
2
8
  __export
3
9
  } from "./chunk-6BWS3CLP.mjs";
@@ -27,6 +33,24 @@ function createPayloadClient(config) {
27
33
 
28
34
  // src/nextjs/queries/pages.ts
29
35
  import { unstable_cache } from "next/cache";
36
+ var PAGE_QUERY_CACHE_VERSION = "v2-studio-layout-published-only";
37
+ function withStudioDocumentLayout(page) {
38
+ if (!page) {
39
+ return null;
40
+ }
41
+ try {
42
+ const studioDocument = assertStudioDocumentV1(page.studioDocument);
43
+ const compiledLayout = studioDocumentToLayout(studioDocument);
44
+ if (Array.isArray(compiledLayout) && compiledLayout.length > 0) {
45
+ return {
46
+ ...page,
47
+ layout: compiledLayout
48
+ };
49
+ }
50
+ } catch {
51
+ }
52
+ return page;
53
+ }
30
54
  function normalizePath(segments) {
31
55
  if (!segments || segments.length === 0) {
32
56
  return "/";
@@ -35,35 +59,42 @@ function normalizePath(segments) {
35
59
  return cleaned.length > 0 ? `/${cleaned}` : "/";
36
60
  }
37
61
  async function queryPageByPath(payload, path, draft) {
62
+ const pathWhere = {
63
+ path: {
64
+ equals: path
65
+ }
66
+ };
67
+ const publishedWhere = {
68
+ _status: {
69
+ equals: "published"
70
+ }
71
+ };
38
72
  const result = await payload.find({
39
73
  collection: "pages",
40
74
  depth: 2,
41
75
  draft,
42
76
  limit: 1,
43
77
  overrideAccess: false,
44
- where: {
45
- path: {
46
- equals: path
47
- }
48
- }
78
+ where: draft ? pathWhere : { and: [pathWhere, publishedWhere] }
49
79
  });
50
80
  if (result.docs.length > 0) {
51
- return result.docs[0] || null;
81
+ return withStudioDocumentLayout(result.docs[0] || null);
52
82
  }
53
83
  if (path === "/") {
84
+ const homeWhere = {
85
+ slug: {
86
+ equals: "home"
87
+ }
88
+ };
54
89
  const homeResult = await payload.find({
55
90
  collection: "pages",
56
91
  depth: 2,
57
92
  draft,
58
93
  limit: 1,
59
94
  overrideAccess: false,
60
- where: {
61
- slug: {
62
- equals: "home"
63
- }
64
- }
95
+ where: draft ? homeWhere : { and: [homeWhere, publishedWhere] }
65
96
  });
66
- return homeResult.docs[0] || null;
97
+ return withStudioDocumentLayout(homeResult.docs[0] || null);
67
98
  }
68
99
  return null;
69
100
  }
@@ -73,7 +104,7 @@ function createPageQueries(getPayloadClient, contentTag = "website-content") {
73
104
  const payload = await getPayloadClient();
74
105
  return queryPageByPath(payload, path, false);
75
106
  },
76
- ["page-by-path"],
107
+ ["page-by-path", PAGE_QUERY_CACHE_VERSION],
77
108
  { tags: [contentTag] }
78
109
  );
79
110
  async function getPageBySegments(segments, draft = false) {
@@ -7,6 +7,7 @@ var sectionStyleDefaults = {
7
7
  contentGradientPreset: "none",
8
8
  contentGradientTo: "#f4f6f2",
9
9
  contentWidth: "inherit",
10
+ sectionPaddingX: "inherit",
10
11
  sectionBackgroundColor: "#ffffff",
11
12
  sectionBackgroundMode: "none",
12
13
  sectionGradientAngle: "135",
@@ -44,6 +45,19 @@ var sectionStyleFields = () => [
44
45
  type: "select",
45
46
  defaultValue: sectionStyleDefaults.sectionPaddingY,
46
47
  options: [
48
+ { label: "None", value: "none" },
49
+ { label: "Small", value: "sm" },
50
+ { label: "Medium", value: "md" },
51
+ { label: "Large", value: "lg" }
52
+ ]
53
+ },
54
+ {
55
+ name: "sectionPaddingX",
56
+ type: "select",
57
+ defaultValue: sectionStyleDefaults.sectionPaddingX,
58
+ options: [
59
+ { label: "Inherit", value: "inherit" },
60
+ { label: "None", value: "none" },
47
61
  { label: "Small", value: "sm" },
48
62
  { label: "Medium", value: "md" },
49
63
  { label: "Large", value: "lg" }