@orion-studios/payload-studio 0.5.0-beta.10 → 0.5.0-beta.11
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.
- package/dist/blocks/index.js +27 -0
- package/dist/blocks/index.mjs +1 -1
- package/dist/{chunk-TVDMZNKU.mjs → chunk-NESLJZFE.mjs} +2 -0
- package/dist/{chunk-HRO4MFA3.mjs → chunk-U5BSPWAD.mjs} +27 -0
- package/dist/index.js +29 -0
- package/dist/index.mjs +7 -7
- package/dist/studio-pages/client.js +48 -2
- package/dist/studio-pages/client.mjs +48 -2
- package/dist/studio-pages/index.js +2 -0
- package/dist/studio-pages/index.mjs +1 -1
- package/package.json +1 -1
package/dist/blocks/index.js
CHANGED
|
@@ -553,6 +553,33 @@ var HeroBlock = {
|
|
|
553
553
|
type: "upload",
|
|
554
554
|
relationTo: "media"
|
|
555
555
|
},
|
|
556
|
+
{
|
|
557
|
+
name: "backgroundImageFit",
|
|
558
|
+
type: "select",
|
|
559
|
+
defaultValue: "cover",
|
|
560
|
+
options: [
|
|
561
|
+
{ label: "Cover", value: "cover" },
|
|
562
|
+
{ label: "Contain", value: "contain" }
|
|
563
|
+
],
|
|
564
|
+
admin: {
|
|
565
|
+
description: "How the hero image should be sized within the section."
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: "backgroundImagePosition",
|
|
570
|
+
type: "select",
|
|
571
|
+
defaultValue: "center",
|
|
572
|
+
options: [
|
|
573
|
+
{ label: "Center", value: "center" },
|
|
574
|
+
{ label: "Top", value: "top" },
|
|
575
|
+
{ label: "Bottom", value: "bottom" },
|
|
576
|
+
{ label: "Left", value: "left" },
|
|
577
|
+
{ label: "Right", value: "right" }
|
|
578
|
+
],
|
|
579
|
+
admin: {
|
|
580
|
+
description: "Where the hero image should anchor inside the section."
|
|
581
|
+
}
|
|
582
|
+
},
|
|
556
583
|
{
|
|
557
584
|
name: "backgroundColor",
|
|
558
585
|
type: "text",
|
package/dist/blocks/index.mjs
CHANGED
|
@@ -403,6 +403,33 @@ var HeroBlock = {
|
|
|
403
403
|
type: "upload",
|
|
404
404
|
relationTo: "media"
|
|
405
405
|
},
|
|
406
|
+
{
|
|
407
|
+
name: "backgroundImageFit",
|
|
408
|
+
type: "select",
|
|
409
|
+
defaultValue: "cover",
|
|
410
|
+
options: [
|
|
411
|
+
{ label: "Cover", value: "cover" },
|
|
412
|
+
{ label: "Contain", value: "contain" }
|
|
413
|
+
],
|
|
414
|
+
admin: {
|
|
415
|
+
description: "How the hero image should be sized within the section."
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: "backgroundImagePosition",
|
|
420
|
+
type: "select",
|
|
421
|
+
defaultValue: "center",
|
|
422
|
+
options: [
|
|
423
|
+
{ label: "Center", value: "center" },
|
|
424
|
+
{ label: "Top", value: "top" },
|
|
425
|
+
{ label: "Bottom", value: "bottom" },
|
|
426
|
+
{ label: "Left", value: "left" },
|
|
427
|
+
{ label: "Right", value: "right" }
|
|
428
|
+
],
|
|
429
|
+
admin: {
|
|
430
|
+
description: "Where the hero image should anchor inside the section."
|
|
431
|
+
}
|
|
432
|
+
},
|
|
406
433
|
{
|
|
407
434
|
name: "backgroundColor",
|
|
408
435
|
type: "text",
|
package/dist/index.js
CHANGED
|
@@ -897,6 +897,33 @@ var HeroBlock = {
|
|
|
897
897
|
type: "upload",
|
|
898
898
|
relationTo: "media"
|
|
899
899
|
},
|
|
900
|
+
{
|
|
901
|
+
name: "backgroundImageFit",
|
|
902
|
+
type: "select",
|
|
903
|
+
defaultValue: "cover",
|
|
904
|
+
options: [
|
|
905
|
+
{ label: "Cover", value: "cover" },
|
|
906
|
+
{ label: "Contain", value: "contain" }
|
|
907
|
+
],
|
|
908
|
+
admin: {
|
|
909
|
+
description: "How the hero image should be sized within the section."
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
name: "backgroundImagePosition",
|
|
914
|
+
type: "select",
|
|
915
|
+
defaultValue: "center",
|
|
916
|
+
options: [
|
|
917
|
+
{ label: "Center", value: "center" },
|
|
918
|
+
{ label: "Top", value: "top" },
|
|
919
|
+
{ label: "Bottom", value: "bottom" },
|
|
920
|
+
{ label: "Left", value: "left" },
|
|
921
|
+
{ label: "Right", value: "right" }
|
|
922
|
+
],
|
|
923
|
+
admin: {
|
|
924
|
+
description: "Where the hero image should anchor inside the section."
|
|
925
|
+
}
|
|
926
|
+
},
|
|
900
927
|
{
|
|
901
928
|
name: "backgroundColor",
|
|
902
929
|
type: "text",
|
|
@@ -1904,6 +1931,8 @@ var defaultNodeData = {
|
|
|
1904
1931
|
hero: {
|
|
1905
1932
|
...withSectionStyleDefaults({}),
|
|
1906
1933
|
backgroundColor: "",
|
|
1934
|
+
backgroundImageFit: "cover",
|
|
1935
|
+
backgroundImagePosition: "center",
|
|
1907
1936
|
headline: "New Hero Section",
|
|
1908
1937
|
kicker: "Optional kicker",
|
|
1909
1938
|
primaryHref: "/contact",
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
admin_app_exports
|
|
3
|
+
} from "./chunk-AAOHJDNS.mjs";
|
|
1
4
|
import {
|
|
2
5
|
admin_exports
|
|
3
6
|
} from "./chunk-J7W5EE3B.mjs";
|
|
4
7
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
studio_exports
|
|
9
|
+
} from "./chunk-N67KVM2S.mjs";
|
|
7
10
|
import {
|
|
8
11
|
blocks_exports
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-U5BSPWAD.mjs";
|
|
10
13
|
import {
|
|
11
14
|
nextjs_exports
|
|
12
15
|
} from "./chunk-ZLLNO5FM.mjs";
|
|
13
|
-
import {
|
|
14
|
-
studio_exports
|
|
15
|
-
} from "./chunk-N67KVM2S.mjs";
|
|
16
16
|
import {
|
|
17
17
|
studio_pages_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NESLJZFE.mjs";
|
|
19
19
|
import "./chunk-ETRRXURT.mjs";
|
|
20
20
|
import "./chunk-6BWS3CLP.mjs";
|
|
21
21
|
export {
|
|
@@ -108,6 +108,8 @@ var defaultNodeData = {
|
|
|
108
108
|
hero: {
|
|
109
109
|
...withSectionStyleDefaults({}),
|
|
110
110
|
backgroundColor: "",
|
|
111
|
+
backgroundImageFit: "cover",
|
|
112
|
+
backgroundImagePosition: "center",
|
|
111
113
|
headline: "New Hero Section",
|
|
112
114
|
kicker: "Optional kicker",
|
|
113
115
|
primaryHref: "/contact",
|
|
@@ -453,6 +455,13 @@ var resolveMedia = (value) => {
|
|
|
453
455
|
}
|
|
454
456
|
return null;
|
|
455
457
|
};
|
|
458
|
+
var normalizeHeroImageFit = (value) => value === "contain" ? "contain" : "cover";
|
|
459
|
+
var normalizeHeroImagePosition = (value) => {
|
|
460
|
+
if (value === "top" || value === "bottom" || value === "left" || value === "right") {
|
|
461
|
+
return value;
|
|
462
|
+
}
|
|
463
|
+
return "center";
|
|
464
|
+
};
|
|
456
465
|
function cloneBlockLayout(layout) {
|
|
457
466
|
return JSON.parse(JSON.stringify(layout));
|
|
458
467
|
}
|
|
@@ -591,6 +600,8 @@ function getDefaultBlock(blockType) {
|
|
|
591
600
|
case "hero":
|
|
592
601
|
return withSectionStyleDefaults2({
|
|
593
602
|
backgroundColor: "",
|
|
603
|
+
backgroundImageFit: "cover",
|
|
604
|
+
backgroundImagePosition: "center",
|
|
594
605
|
blockType: "hero",
|
|
595
606
|
headline: "New Hero Section",
|
|
596
607
|
kicker: "Optional kicker",
|
|
@@ -1825,6 +1836,8 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1825
1836
|
const media = resolveMedia(block.media);
|
|
1826
1837
|
const variant = normalizeText(block.variant, "default");
|
|
1827
1838
|
const backgroundColor = normalizeText(block.backgroundColor).trim();
|
|
1839
|
+
const backgroundImageFit = normalizeHeroImageFit(block.backgroundImageFit);
|
|
1840
|
+
const backgroundImagePosition = normalizeHeroImagePosition(block.backgroundImagePosition);
|
|
1828
1841
|
const sectionBackgroundMode = normalizeText(
|
|
1829
1842
|
block.sectionBackgroundMode,
|
|
1830
1843
|
defaultSectionStyle.sectionBackgroundMode
|
|
@@ -1835,9 +1848,9 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1835
1848
|
const mediaStyle = backgroundImage && variant === "default" ? {
|
|
1836
1849
|
...hasCustomHeroColor ? { backgroundColor } : {},
|
|
1837
1850
|
backgroundImage: `linear-gradient(145deg, rgba(13, 74, 55, 0.34), rgba(13, 74, 55, 0.74)), url('${backgroundImage}')`,
|
|
1838
|
-
backgroundPosition:
|
|
1851
|
+
backgroundPosition: `center, ${backgroundImagePosition}`,
|
|
1839
1852
|
backgroundRepeat: "no-repeat, no-repeat",
|
|
1840
|
-
backgroundSize:
|
|
1853
|
+
backgroundSize: `100% 100%, ${backgroundImageFit}`
|
|
1841
1854
|
} : hasCustomHeroColor && sectionBackgroundMode !== "none" ? {
|
|
1842
1855
|
backgroundColor
|
|
1843
1856
|
} : {};
|
|
@@ -3298,6 +3311,39 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
3298
3311
|
type: "file"
|
|
3299
3312
|
}
|
|
3300
3313
|
)
|
|
3314
|
+
] }),
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { style: sidebarLabelStyle, children: [
|
|
3316
|
+
"Image Fit",
|
|
3317
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3318
|
+
"select",
|
|
3319
|
+
{
|
|
3320
|
+
onChange: (event) => updateSelectedField("backgroundImageFit", event.target.value),
|
|
3321
|
+
style: sidebarInputStyle,
|
|
3322
|
+
value: normalizeHeroImageFit(selectedBlock.backgroundImageFit),
|
|
3323
|
+
children: [
|
|
3324
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "cover", children: "Cover" }),
|
|
3325
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "contain", children: "Contain" })
|
|
3326
|
+
]
|
|
3327
|
+
}
|
|
3328
|
+
)
|
|
3329
|
+
] }),
|
|
3330
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { style: sidebarLabelStyle, children: [
|
|
3331
|
+
"Image Position",
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3333
|
+
"select",
|
|
3334
|
+
{
|
|
3335
|
+
onChange: (event) => updateSelectedField("backgroundImagePosition", event.target.value),
|
|
3336
|
+
style: sidebarInputStyle,
|
|
3337
|
+
value: normalizeHeroImagePosition(selectedBlock.backgroundImagePosition),
|
|
3338
|
+
children: [
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "center", children: "Center" }),
|
|
3340
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "top", children: "Top" }),
|
|
3341
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "bottom", children: "Bottom" }),
|
|
3342
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "left", children: "Left" }),
|
|
3343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "right", children: "Right" })
|
|
3344
|
+
]
|
|
3345
|
+
}
|
|
3346
|
+
)
|
|
3301
3347
|
] })
|
|
3302
3348
|
] }),
|
|
3303
3349
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { style: sidebarLabelStyle, children: [
|
|
@@ -80,6 +80,8 @@ var defaultNodeData = {
|
|
|
80
80
|
hero: {
|
|
81
81
|
...withSectionStyleDefaults({}),
|
|
82
82
|
backgroundColor: "",
|
|
83
|
+
backgroundImageFit: "cover",
|
|
84
|
+
backgroundImagePosition: "center",
|
|
83
85
|
headline: "New Hero Section",
|
|
84
86
|
kicker: "Optional kicker",
|
|
85
87
|
primaryHref: "/contact",
|
|
@@ -425,6 +427,13 @@ var resolveMedia = (value) => {
|
|
|
425
427
|
}
|
|
426
428
|
return null;
|
|
427
429
|
};
|
|
430
|
+
var normalizeHeroImageFit = (value) => value === "contain" ? "contain" : "cover";
|
|
431
|
+
var normalizeHeroImagePosition = (value) => {
|
|
432
|
+
if (value === "top" || value === "bottom" || value === "left" || value === "right") {
|
|
433
|
+
return value;
|
|
434
|
+
}
|
|
435
|
+
return "center";
|
|
436
|
+
};
|
|
428
437
|
function cloneBlockLayout(layout) {
|
|
429
438
|
return JSON.parse(JSON.stringify(layout));
|
|
430
439
|
}
|
|
@@ -563,6 +572,8 @@ function getDefaultBlock(blockType) {
|
|
|
563
572
|
case "hero":
|
|
564
573
|
return withSectionStyleDefaults2({
|
|
565
574
|
backgroundColor: "",
|
|
575
|
+
backgroundImageFit: "cover",
|
|
576
|
+
backgroundImagePosition: "center",
|
|
566
577
|
blockType: "hero",
|
|
567
578
|
headline: "New Hero Section",
|
|
568
579
|
kicker: "Optional kicker",
|
|
@@ -1797,6 +1808,8 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1797
1808
|
const media = resolveMedia(block.media);
|
|
1798
1809
|
const variant = normalizeText(block.variant, "default");
|
|
1799
1810
|
const backgroundColor = normalizeText(block.backgroundColor).trim();
|
|
1811
|
+
const backgroundImageFit = normalizeHeroImageFit(block.backgroundImageFit);
|
|
1812
|
+
const backgroundImagePosition = normalizeHeroImagePosition(block.backgroundImagePosition);
|
|
1800
1813
|
const sectionBackgroundMode = normalizeText(
|
|
1801
1814
|
block.sectionBackgroundMode,
|
|
1802
1815
|
defaultSectionStyle.sectionBackgroundMode
|
|
@@ -1807,9 +1820,9 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1807
1820
|
const mediaStyle = backgroundImage && variant === "default" ? {
|
|
1808
1821
|
...hasCustomHeroColor ? { backgroundColor } : {},
|
|
1809
1822
|
backgroundImage: `linear-gradient(145deg, rgba(13, 74, 55, 0.34), rgba(13, 74, 55, 0.74)), url('${backgroundImage}')`,
|
|
1810
|
-
backgroundPosition:
|
|
1823
|
+
backgroundPosition: `center, ${backgroundImagePosition}`,
|
|
1811
1824
|
backgroundRepeat: "no-repeat, no-repeat",
|
|
1812
|
-
backgroundSize:
|
|
1825
|
+
backgroundSize: `100% 100%, ${backgroundImageFit}`
|
|
1813
1826
|
} : hasCustomHeroColor && sectionBackgroundMode !== "none" ? {
|
|
1814
1827
|
backgroundColor
|
|
1815
1828
|
} : {};
|
|
@@ -3270,6 +3283,39 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
3270
3283
|
type: "file"
|
|
3271
3284
|
}
|
|
3272
3285
|
)
|
|
3286
|
+
] }),
|
|
3287
|
+
/* @__PURE__ */ jsxs("label", { style: sidebarLabelStyle, children: [
|
|
3288
|
+
"Image Fit",
|
|
3289
|
+
/* @__PURE__ */ jsxs(
|
|
3290
|
+
"select",
|
|
3291
|
+
{
|
|
3292
|
+
onChange: (event) => updateSelectedField("backgroundImageFit", event.target.value),
|
|
3293
|
+
style: sidebarInputStyle,
|
|
3294
|
+
value: normalizeHeroImageFit(selectedBlock.backgroundImageFit),
|
|
3295
|
+
children: [
|
|
3296
|
+
/* @__PURE__ */ jsx("option", { value: "cover", children: "Cover" }),
|
|
3297
|
+
/* @__PURE__ */ jsx("option", { value: "contain", children: "Contain" })
|
|
3298
|
+
]
|
|
3299
|
+
}
|
|
3300
|
+
)
|
|
3301
|
+
] }),
|
|
3302
|
+
/* @__PURE__ */ jsxs("label", { style: sidebarLabelStyle, children: [
|
|
3303
|
+
"Image Position",
|
|
3304
|
+
/* @__PURE__ */ jsxs(
|
|
3305
|
+
"select",
|
|
3306
|
+
{
|
|
3307
|
+
onChange: (event) => updateSelectedField("backgroundImagePosition", event.target.value),
|
|
3308
|
+
style: sidebarInputStyle,
|
|
3309
|
+
value: normalizeHeroImagePosition(selectedBlock.backgroundImagePosition),
|
|
3310
|
+
children: [
|
|
3311
|
+
/* @__PURE__ */ jsx("option", { value: "center", children: "Center" }),
|
|
3312
|
+
/* @__PURE__ */ jsx("option", { value: "top", children: "Top" }),
|
|
3313
|
+
/* @__PURE__ */ jsx("option", { value: "bottom", children: "Bottom" }),
|
|
3314
|
+
/* @__PURE__ */ jsx("option", { value: "left", children: "Left" }),
|
|
3315
|
+
/* @__PURE__ */ jsx("option", { value: "right", children: "Right" })
|
|
3316
|
+
]
|
|
3317
|
+
}
|
|
3318
|
+
)
|
|
3273
3319
|
] })
|
|
3274
3320
|
] }),
|
|
3275
3321
|
/* @__PURE__ */ jsxs("label", { style: sidebarLabelStyle, children: [
|
|
@@ -105,6 +105,8 @@ var defaultNodeData = {
|
|
|
105
105
|
hero: {
|
|
106
106
|
...withSectionStyleDefaults({}),
|
|
107
107
|
backgroundColor: "",
|
|
108
|
+
backgroundImageFit: "cover",
|
|
109
|
+
backgroundImagePosition: "center",
|
|
108
110
|
headline: "New Hero Section",
|
|
109
111
|
kicker: "Optional kicker",
|
|
110
112
|
primaryHref: "/contact",
|