@orion-studios/payload-studio 0.5.0-beta.86 → 0.5.0-beta.88
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/{chunk-FWVVRZ32.mjs → chunk-2BWLRH75.mjs} +8 -20
- package/dist/{chunk-AFLEATYB.mjs → chunk-QWLMYY4E.mjs} +1 -1
- package/dist/index.js +8 -20
- package/dist/index.mjs +2 -2
- package/dist/nextjs/index.js +8 -20
- package/dist/nextjs/index.mjs +2 -2
- package/dist/studio-pages/client.js +54 -99
- package/dist/studio-pages/client.mjs +54 -99
- package/dist/studio-pages/index.js +8 -20
- package/dist/studio-pages/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -202,6 +202,7 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
202
202
|
...blockWithSettings,
|
|
203
203
|
settings
|
|
204
204
|
};
|
|
205
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
205
206
|
next.contentWidth = settings.layout.contentWidth;
|
|
206
207
|
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
207
208
|
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
@@ -225,19 +226,19 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
225
226
|
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
226
227
|
next.customClassName = settings.advanced.customClassName;
|
|
227
228
|
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
228
|
-
|
|
229
|
+
delete next.backgroundImagePositionX;
|
|
230
|
+
delete next.backgroundImagePositionY;
|
|
231
|
+
delete next.imageHeight;
|
|
232
|
+
delete next.imagePositionX;
|
|
233
|
+
delete next.imagePositionY;
|
|
234
|
+
if (blockType === "hero") {
|
|
229
235
|
next.backgroundImageFit = settings.media.fit;
|
|
230
236
|
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
231
237
|
next.backgroundImagePosition = settings.media.position;
|
|
232
|
-
|
|
233
|
-
next.backgroundImagePositionY = settings.media.positionY;
|
|
234
|
-
} else {
|
|
238
|
+
} else if (blockType === "media") {
|
|
235
239
|
next.imageFit = settings.media.fit;
|
|
236
240
|
next.imageCornerStyle = settings.media.cornerStyle;
|
|
237
241
|
next.imagePosition = settings.media.position;
|
|
238
|
-
next.imagePositionX = settings.media.positionX;
|
|
239
|
-
next.imagePositionY = settings.media.positionY;
|
|
240
|
-
next.imageHeight = settings.media.height;
|
|
241
242
|
}
|
|
242
243
|
if (Array.isArray(next.items)) {
|
|
243
244
|
next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
@@ -507,19 +508,6 @@ var mediaFieldSet = [
|
|
|
507
508
|
],
|
|
508
509
|
tags: ["image", "radius", "corners"],
|
|
509
510
|
type: "select"
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
group: "media",
|
|
513
|
-
key: "settings.media.position",
|
|
514
|
-
label: "Image Position",
|
|
515
|
-
options: [
|
|
516
|
-
{ label: "Center", value: "center" },
|
|
517
|
-
{ label: "Top", value: "top" },
|
|
518
|
-
{ label: "Bottom", value: "bottom" },
|
|
519
|
-
{ label: "Left", value: "left" },
|
|
520
|
-
{ label: "Right", value: "right" }
|
|
521
|
-
],
|
|
522
|
-
type: "select"
|
|
523
511
|
}
|
|
524
512
|
];
|
|
525
513
|
var inspectorDefinitionByBlockType = {
|
package/dist/index.js
CHANGED
|
@@ -2892,6 +2892,7 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
2892
2892
|
...blockWithSettings,
|
|
2893
2893
|
settings
|
|
2894
2894
|
};
|
|
2895
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
2895
2896
|
next.contentWidth = settings.layout.contentWidth;
|
|
2896
2897
|
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
2897
2898
|
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
@@ -2915,19 +2916,19 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
2915
2916
|
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
2916
2917
|
next.customClassName = settings.advanced.customClassName;
|
|
2917
2918
|
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
2918
|
-
|
|
2919
|
+
delete next.backgroundImagePositionX;
|
|
2920
|
+
delete next.backgroundImagePositionY;
|
|
2921
|
+
delete next.imageHeight;
|
|
2922
|
+
delete next.imagePositionX;
|
|
2923
|
+
delete next.imagePositionY;
|
|
2924
|
+
if (blockType === "hero") {
|
|
2919
2925
|
next.backgroundImageFit = settings.media.fit;
|
|
2920
2926
|
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
2921
2927
|
next.backgroundImagePosition = settings.media.position;
|
|
2922
|
-
|
|
2923
|
-
next.backgroundImagePositionY = settings.media.positionY;
|
|
2924
|
-
} else {
|
|
2928
|
+
} else if (blockType === "media") {
|
|
2925
2929
|
next.imageFit = settings.media.fit;
|
|
2926
2930
|
next.imageCornerStyle = settings.media.cornerStyle;
|
|
2927
2931
|
next.imagePosition = settings.media.position;
|
|
2928
|
-
next.imagePositionX = settings.media.positionX;
|
|
2929
|
-
next.imagePositionY = settings.media.positionY;
|
|
2930
|
-
next.imageHeight = settings.media.height;
|
|
2931
2932
|
}
|
|
2932
2933
|
if (Array.isArray(next.items)) {
|
|
2933
2934
|
next.items = next.items.map((rawItem) => isRecord2(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
@@ -3197,19 +3198,6 @@ var mediaFieldSet = [
|
|
|
3197
3198
|
],
|
|
3198
3199
|
tags: ["image", "radius", "corners"],
|
|
3199
3200
|
type: "select"
|
|
3200
|
-
},
|
|
3201
|
-
{
|
|
3202
|
-
group: "media",
|
|
3203
|
-
key: "settings.media.position",
|
|
3204
|
-
label: "Image Position",
|
|
3205
|
-
options: [
|
|
3206
|
-
{ label: "Center", value: "center" },
|
|
3207
|
-
{ label: "Top", value: "top" },
|
|
3208
|
-
{ label: "Bottom", value: "bottom" },
|
|
3209
|
-
{ label: "Left", value: "left" },
|
|
3210
|
-
{ label: "Right", value: "right" }
|
|
3211
|
-
],
|
|
3212
|
-
type: "select"
|
|
3213
3201
|
}
|
|
3214
3202
|
];
|
|
3215
3203
|
var inspectorDefinitionByBlockType = {
|
package/dist/index.mjs
CHANGED
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
} from "./chunk-XK3K5GRP.mjs";
|
|
10
10
|
import {
|
|
11
11
|
nextjs_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QWLMYY4E.mjs";
|
|
13
13
|
import {
|
|
14
14
|
studio_exports
|
|
15
15
|
} from "./chunk-ADIIWIYL.mjs";
|
|
16
16
|
import {
|
|
17
17
|
studio_pages_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2BWLRH75.mjs";
|
|
19
19
|
import "./chunk-SIL2J5MF.mjs";
|
|
20
20
|
import "./chunk-6BWS3CLP.mjs";
|
|
21
21
|
export {
|
package/dist/nextjs/index.js
CHANGED
|
@@ -282,6 +282,7 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
282
282
|
...blockWithSettings,
|
|
283
283
|
settings
|
|
284
284
|
};
|
|
285
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
285
286
|
next.contentWidth = settings.layout.contentWidth;
|
|
286
287
|
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
287
288
|
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
@@ -305,19 +306,19 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
305
306
|
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
306
307
|
next.customClassName = settings.advanced.customClassName;
|
|
307
308
|
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
308
|
-
|
|
309
|
+
delete next.backgroundImagePositionX;
|
|
310
|
+
delete next.backgroundImagePositionY;
|
|
311
|
+
delete next.imageHeight;
|
|
312
|
+
delete next.imagePositionX;
|
|
313
|
+
delete next.imagePositionY;
|
|
314
|
+
if (blockType === "hero") {
|
|
309
315
|
next.backgroundImageFit = settings.media.fit;
|
|
310
316
|
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
311
317
|
next.backgroundImagePosition = settings.media.position;
|
|
312
|
-
|
|
313
|
-
next.backgroundImagePositionY = settings.media.positionY;
|
|
314
|
-
} else {
|
|
318
|
+
} else if (blockType === "media") {
|
|
315
319
|
next.imageFit = settings.media.fit;
|
|
316
320
|
next.imageCornerStyle = settings.media.cornerStyle;
|
|
317
321
|
next.imagePosition = settings.media.position;
|
|
318
|
-
next.imagePositionX = settings.media.positionX;
|
|
319
|
-
next.imagePositionY = settings.media.positionY;
|
|
320
|
-
next.imageHeight = settings.media.height;
|
|
321
322
|
}
|
|
322
323
|
if (Array.isArray(next.items)) {
|
|
323
324
|
next.items = next.items.map((rawItem) => isRecord2(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
@@ -563,19 +564,6 @@ var mediaFieldSet = [
|
|
|
563
564
|
],
|
|
564
565
|
tags: ["image", "radius", "corners"],
|
|
565
566
|
type: "select"
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
group: "media",
|
|
569
|
-
key: "settings.media.position",
|
|
570
|
-
label: "Image Position",
|
|
571
|
-
options: [
|
|
572
|
-
{ label: "Center", value: "center" },
|
|
573
|
-
{ label: "Top", value: "top" },
|
|
574
|
-
{ label: "Bottom", value: "bottom" },
|
|
575
|
-
{ label: "Left", value: "left" },
|
|
576
|
-
{ label: "Right", value: "right" }
|
|
577
|
-
],
|
|
578
|
-
type: "select"
|
|
579
567
|
}
|
|
580
568
|
];
|
|
581
569
|
var inspectorDefinitionByBlockType = {
|
package/dist/nextjs/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
createPayloadClient,
|
|
5
5
|
createSiteQueries,
|
|
6
6
|
resolveMedia
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-QWLMYY4E.mjs";
|
|
8
8
|
import "../chunk-ADIIWIYL.mjs";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-2BWLRH75.mjs";
|
|
10
10
|
import "../chunk-SIL2J5MF.mjs";
|
|
11
11
|
import "../chunk-6BWS3CLP.mjs";
|
|
12
12
|
export {
|
|
@@ -237,6 +237,7 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
237
237
|
...blockWithSettings,
|
|
238
238
|
settings
|
|
239
239
|
};
|
|
240
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
240
241
|
next.contentWidth = settings.layout.contentWidth;
|
|
241
242
|
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
242
243
|
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
@@ -260,19 +261,19 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
260
261
|
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
261
262
|
next.customClassName = settings.advanced.customClassName;
|
|
262
263
|
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
263
|
-
|
|
264
|
+
delete next.backgroundImagePositionX;
|
|
265
|
+
delete next.backgroundImagePositionY;
|
|
266
|
+
delete next.imageHeight;
|
|
267
|
+
delete next.imagePositionX;
|
|
268
|
+
delete next.imagePositionY;
|
|
269
|
+
if (blockType === "hero") {
|
|
264
270
|
next.backgroundImageFit = settings.media.fit;
|
|
265
271
|
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
266
272
|
next.backgroundImagePosition = settings.media.position;
|
|
267
|
-
|
|
268
|
-
next.backgroundImagePositionY = settings.media.positionY;
|
|
269
|
-
} else {
|
|
273
|
+
} else if (blockType === "media") {
|
|
270
274
|
next.imageFit = settings.media.fit;
|
|
271
275
|
next.imageCornerStyle = settings.media.cornerStyle;
|
|
272
276
|
next.imagePosition = settings.media.position;
|
|
273
|
-
next.imagePositionX = settings.media.positionX;
|
|
274
|
-
next.imagePositionY = settings.media.positionY;
|
|
275
|
-
next.imageHeight = settings.media.height;
|
|
276
277
|
}
|
|
277
278
|
if (Array.isArray(next.items)) {
|
|
278
279
|
next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
@@ -393,7 +394,6 @@ function ImageControls({
|
|
|
393
394
|
maxHeight = 600,
|
|
394
395
|
minHeight = 40,
|
|
395
396
|
onChange,
|
|
396
|
-
position,
|
|
397
397
|
positionX,
|
|
398
398
|
positionY
|
|
399
399
|
}) {
|
|
@@ -429,25 +429,7 @@ function ImageControls({
|
|
|
429
429
|
)
|
|
430
430
|
] }),
|
|
431
431
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "orion-builder-settings-label", children: [
|
|
432
|
-
"Image Position",
|
|
433
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
434
|
-
"select",
|
|
435
|
-
{
|
|
436
|
-
className: "orion-builder-settings-input",
|
|
437
|
-
onChange: (event) => onChange("position", event.target.value),
|
|
438
|
-
value: position,
|
|
439
|
-
children: [
|
|
440
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "center", children: "Center" }),
|
|
441
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "top", children: "Top" }),
|
|
442
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "bottom", children: "Bottom" }),
|
|
443
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "left", children: "Left" }),
|
|
444
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "right", children: "Right" })
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
)
|
|
448
|
-
] }),
|
|
449
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "orion-builder-settings-label", children: [
|
|
450
|
-
"Horizontal Image Focus (%)",
|
|
432
|
+
"Horizontal Image Position",
|
|
451
433
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "orion-builder-settings-input-split", children: [
|
|
452
434
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
453
435
|
"input",
|
|
@@ -473,7 +455,7 @@ function ImageControls({
|
|
|
473
455
|
] })
|
|
474
456
|
] }),
|
|
475
457
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "orion-builder-settings-label", children: [
|
|
476
|
-
"Vertical Image
|
|
458
|
+
"Vertical Image Position",
|
|
477
459
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "orion-builder-settings-input-split", children: [
|
|
478
460
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
479
461
|
"input",
|
|
@@ -705,19 +687,6 @@ var mediaFieldSet = [
|
|
|
705
687
|
],
|
|
706
688
|
tags: ["image", "radius", "corners"],
|
|
707
689
|
type: "select"
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
group: "media",
|
|
711
|
-
key: "settings.media.position",
|
|
712
|
-
label: "Image Position",
|
|
713
|
-
options: [
|
|
714
|
-
{ label: "Center", value: "center" },
|
|
715
|
-
{ label: "Top", value: "top" },
|
|
716
|
-
{ label: "Bottom", value: "bottom" },
|
|
717
|
-
{ label: "Left", value: "left" },
|
|
718
|
-
{ label: "Right", value: "right" }
|
|
719
|
-
],
|
|
720
|
-
type: "select"
|
|
721
690
|
}
|
|
722
691
|
];
|
|
723
692
|
var commonInspectorGroups = [
|
|
@@ -1123,16 +1092,13 @@ function BlockInspectorRenderer({
|
|
|
1123
1092
|
groups.map((group) => {
|
|
1124
1093
|
const mediaFit = getByPath(block, "settings.media.fit");
|
|
1125
1094
|
const mediaCornerStyle = getByPath(block, "settings.media.cornerStyle");
|
|
1126
|
-
const mediaPosition = getByPath(block, "settings.media.position");
|
|
1127
1095
|
const mediaPositionX = normalizeNumber(getByPath(block, "settings.media.positionX"), 50);
|
|
1128
1096
|
const mediaPositionY = normalizeNumber(getByPath(block, "settings.media.positionY"), 50);
|
|
1129
1097
|
const mediaHeight = getByPath(block, "settings.media.height");
|
|
1130
|
-
const fallbackMediaPosition = mediaPosition === "top" || mediaPosition === "bottom" || mediaPosition === "left" || mediaPosition === "right" ? mediaPosition : "center";
|
|
1131
1098
|
const fallbackMediaControls = {
|
|
1132
1099
|
cornerStyle: mediaCornerStyle === "square" ? "square" : "rounded",
|
|
1133
1100
|
fit: mediaFit === "contain" ? "contain" : "cover",
|
|
1134
1101
|
height: typeof mediaHeight === "number" ? mediaHeight : null,
|
|
1135
|
-
position: fallbackMediaPosition,
|
|
1136
1102
|
positionX: mediaPositionX,
|
|
1137
1103
|
positionY: mediaPositionY
|
|
1138
1104
|
};
|
|
@@ -1228,7 +1194,6 @@ function BlockInspectorRenderer({
|
|
|
1228
1194
|
}
|
|
1229
1195
|
updateForKey(`settings.media.${field}`, value);
|
|
1230
1196
|
},
|
|
1231
|
-
position: effectiveMedia.position,
|
|
1232
1197
|
positionX: effectiveMedia.positionX,
|
|
1233
1198
|
positionY: effectiveMedia.positionY
|
|
1234
1199
|
}
|
|
@@ -2247,6 +2212,7 @@ function BlockFrame({
|
|
|
2247
2212
|
|
|
2248
2213
|
// src/studio-pages/builder/renderers/renderSimpleBlockPreview.tsx
|
|
2249
2214
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2215
|
+
var isRecord4 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2250
2216
|
var parseOptionalPercentNumber = (value) => {
|
|
2251
2217
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
2252
2218
|
return Math.max(0, Math.min(100, value));
|
|
@@ -2268,7 +2234,7 @@ function renderSimpleBlockPreview(args) {
|
|
|
2268
2234
|
isBlockUploadTarget,
|
|
2269
2235
|
normalizeImageCornerStyle: normalizeImageCornerStyle3,
|
|
2270
2236
|
normalizeImageFit: normalizeImageFit3,
|
|
2271
|
-
normalizeImagePosition:
|
|
2237
|
+
normalizeImagePosition: normalizeImagePosition2,
|
|
2272
2238
|
normalizeText: normalizeText3,
|
|
2273
2239
|
onDropAt,
|
|
2274
2240
|
renderWithSectionShell,
|
|
@@ -2442,12 +2408,14 @@ function renderSimpleBlockPreview(args) {
|
|
|
2442
2408
|
if (type === "media") {
|
|
2443
2409
|
const image = resolveMedia2(block.image);
|
|
2444
2410
|
const size = normalizeText3(block.size, "default");
|
|
2445
|
-
const
|
|
2446
|
-
const
|
|
2411
|
+
const blockSettings = isRecord4(block.settings) ? block.settings : {};
|
|
2412
|
+
const mediaSettings = isRecord4(blockSettings.media) ? blockSettings.media : {};
|
|
2413
|
+
const imagePositionX = parseOptionalPercentNumber(mediaSettings.positionX ?? block?.imagePositionX);
|
|
2414
|
+
const imagePositionY = parseOptionalPercentNumber(mediaSettings.positionY ?? block?.imagePositionY);
|
|
2447
2415
|
const imageStyle = getImagePresentationStyle2({
|
|
2448
|
-
cornerStyle: normalizeImageCornerStyle3(block?.imageCornerStyle),
|
|
2449
|
-
fit: normalizeImageFit3(block?.imageFit),
|
|
2450
|
-
position:
|
|
2416
|
+
cornerStyle: normalizeImageCornerStyle3(mediaSettings.cornerStyle ?? block?.imageCornerStyle),
|
|
2417
|
+
fit: normalizeImageFit3(mediaSettings.fit ?? block?.imageFit),
|
|
2418
|
+
position: normalizeImagePosition2(mediaSettings.position ?? block?.imagePosition),
|
|
2451
2419
|
positionX: imagePositionX,
|
|
2452
2420
|
positionY: imagePositionY
|
|
2453
2421
|
});
|
|
@@ -2962,20 +2930,20 @@ var lucideIconOptions = [
|
|
|
2962
2930
|
"BadgeCheck",
|
|
2963
2931
|
"CalendarClock"
|
|
2964
2932
|
];
|
|
2965
|
-
var
|
|
2933
|
+
var isRecord5 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2966
2934
|
var normalizeText = (value, fallback = "") => typeof value === "string" ? value : fallback;
|
|
2967
2935
|
var getRelationID2 = (value) => {
|
|
2968
2936
|
if (typeof value === "number" || typeof value === "string") {
|
|
2969
2937
|
return value;
|
|
2970
2938
|
}
|
|
2971
|
-
if (!
|
|
2939
|
+
if (!isRecord5(value)) {
|
|
2972
2940
|
return null;
|
|
2973
2941
|
}
|
|
2974
2942
|
const id = value.id;
|
|
2975
2943
|
return typeof id === "number" || typeof id === "string" ? id : null;
|
|
2976
2944
|
};
|
|
2977
2945
|
var toMediaLibraryItem2 = (value) => {
|
|
2978
|
-
if (!
|
|
2946
|
+
if (!isRecord5(value)) {
|
|
2979
2947
|
return null;
|
|
2980
2948
|
}
|
|
2981
2949
|
const id = getRelationID2(value);
|
|
@@ -3007,7 +2975,6 @@ var normalizeNumber2 = (value, fallback) => {
|
|
|
3007
2975
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
3008
2976
|
var normalizeImageFit = (value) => value === "contain" ? "contain" : "cover";
|
|
3009
2977
|
var normalizeImageCornerStyle = (value) => value === "square" ? "square" : "rounded";
|
|
3010
|
-
var normalizeImagePosition = (value) => value === "top" || value === "bottom" || value === "left" || value === "right" ? value : "center";
|
|
3011
2978
|
var hasQueryMatch = (query, ...values) => {
|
|
3012
2979
|
const normalized = query.trim().toLowerCase();
|
|
3013
2980
|
if (!normalized) {
|
|
@@ -3042,8 +3009,8 @@ var blockConfig = {
|
|
|
3042
3009
|
}
|
|
3043
3010
|
};
|
|
3044
3011
|
var getItemTypographyAlign = (item) => {
|
|
3045
|
-
const settings =
|
|
3046
|
-
const typography =
|
|
3012
|
+
const settings = isRecord5(item.settings) ? item.settings : {};
|
|
3013
|
+
const typography = isRecord5(settings.typography) ? settings.typography : {};
|
|
3047
3014
|
const value = typography.bodyAlign;
|
|
3048
3015
|
return value === "center" || value === "justify" || value === "right" ? value : "left";
|
|
3049
3016
|
};
|
|
@@ -3415,17 +3382,10 @@ function ArrayItemsEditor({
|
|
|
3415
3382
|
onUpdateItemSetting(itemIndex, "media.cornerStyle", value);
|
|
3416
3383
|
return;
|
|
3417
3384
|
}
|
|
3418
|
-
if (field === "position") {
|
|
3419
|
-
onUpdateItemSetting(itemIndex, "media.position", value);
|
|
3420
|
-
onUpdateItemSetting(itemIndex, "media.positionX", null);
|
|
3421
|
-
onUpdateItemSetting(itemIndex, "media.positionY", null);
|
|
3422
|
-
return;
|
|
3423
|
-
}
|
|
3424
3385
|
if (field === "positionX" || field === "positionY") {
|
|
3425
3386
|
onUpdateItemSetting(itemIndex, `media.${field}`, value);
|
|
3426
3387
|
}
|
|
3427
3388
|
},
|
|
3428
|
-
position: normalizeImagePosition(item.imagePosition),
|
|
3429
3389
|
positionX: clamp(normalizeNumber2(item.imagePositionX, 50), 0, 100),
|
|
3430
3390
|
positionY: clamp(normalizeNumber2(item.imagePositionY, 50), 0, 100)
|
|
3431
3391
|
}
|
|
@@ -3459,18 +3419,18 @@ function ArrayItemsEditor({
|
|
|
3459
3419
|
|
|
3460
3420
|
// src/studio-pages/builder/BuilderPageEditor.tsx
|
|
3461
3421
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3462
|
-
var
|
|
3422
|
+
var isRecord6 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3463
3423
|
var resolveMedia = (value) => {
|
|
3464
3424
|
if (!value) return null;
|
|
3465
3425
|
if (typeof value === "string" || typeof value === "number") return null;
|
|
3466
|
-
if (!
|
|
3426
|
+
if (!isRecord6(value)) return null;
|
|
3467
3427
|
if (typeof value.url === "string") {
|
|
3468
3428
|
return {
|
|
3469
3429
|
url: value.url,
|
|
3470
3430
|
alt: typeof value.alt === "string" ? value.alt : void 0
|
|
3471
3431
|
};
|
|
3472
3432
|
}
|
|
3473
|
-
if (
|
|
3433
|
+
if (isRecord6(value.value) && typeof value.value.url === "string") {
|
|
3474
3434
|
return {
|
|
3475
3435
|
url: value.value.url,
|
|
3476
3436
|
alt: typeof value.value.alt === "string" ? value.value.alt : void 0
|
|
@@ -3514,7 +3474,7 @@ var resolveBuilderMediumHeroHeight = (topViewportHeight) => {
|
|
|
3514
3474
|
};
|
|
3515
3475
|
var normalizeImageFit2 = (value) => normalizeHeroImageFit(value);
|
|
3516
3476
|
var normalizeImageCornerStyle2 = (value, legacyFitValue) => normalizeHeroImageCornerStyle(value, legacyFitValue);
|
|
3517
|
-
var
|
|
3477
|
+
var normalizeImagePosition = (value) => normalizeHeroImagePosition(value);
|
|
3518
3478
|
var positionPercent = (value, fit) => {
|
|
3519
3479
|
const resolved = fit === "cover" && (value === "left" || value === "right") ? "center" : value;
|
|
3520
3480
|
switch (resolved) {
|
|
@@ -4079,10 +4039,10 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4079
4039
|
const title = normalizeText2(doc.title, "Untitled Page");
|
|
4080
4040
|
const pageTemplate = normalizeText2(doc.template, "standard");
|
|
4081
4041
|
const initialLayout = Array.isArray(doc.layout) ? doc.layout : [];
|
|
4082
|
-
const sourceThemePage =
|
|
4042
|
+
const sourceThemePage = isRecord6(sourceMetadata.theme) ? sourceMetadata.theme : {};
|
|
4083
4043
|
const initialPageDefaults = {
|
|
4084
4044
|
pageWidthDefault: sourceMetadata.pageWidthDefault === "wide" || sourceMetadata.pageWidthDefault === "full" ? sourceMetadata.pageWidthDefault : defaultPageDefaults.pageWidthDefault,
|
|
4085
|
-
themePage:
|
|
4045
|
+
themePage: isRecord6(sourceThemePage.page) ? sourceThemePage.page : {}
|
|
4086
4046
|
};
|
|
4087
4047
|
const [layout, setLayout] = (0, import_react5.useState)(
|
|
4088
4048
|
migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block)))
|
|
@@ -4122,12 +4082,12 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4122
4082
|
);
|
|
4123
4083
|
const selectedType = normalizeText2(selectedBlock?.blockType, "");
|
|
4124
4084
|
const selectedItems = Array.isArray(selectedBlock?.items) ? selectedBlock?.items : [];
|
|
4125
|
-
const selectedBlockSettings =
|
|
4126
|
-
const selectedBlockAdvancedSettings =
|
|
4085
|
+
const selectedBlockSettings = isRecord6(selectedBlock?.settings) ? selectedBlock.settings : {};
|
|
4086
|
+
const selectedBlockAdvancedSettings = isRecord6(selectedBlockSettings.advanced) ? selectedBlockSettings.advanced : {};
|
|
4127
4087
|
const isArrayItemBlockSelected = selectedType === "featureGrid" || selectedType === "logoWall" || selectedType === "beforeAfter" || selectedType === "stats" || selectedType === "faq" || selectedType === "testimonials";
|
|
4128
4088
|
const selectedBlockHasMediaSource = selectedType === "hero" || selectedType === "media";
|
|
4129
4089
|
const selectedBlockMediaValue = selectedType === "hero" ? selectedBlock?.media : selectedType === "media" ? selectedBlock?.image : null;
|
|
4130
|
-
const selectedItemRecord = typeof selectedItemIndex === "number" && selectedItemIndex >= 0 && selectedItemIndex < selectedItems.length &&
|
|
4090
|
+
const selectedItemRecord = typeof selectedItemIndex === "number" && selectedItemIndex >= 0 && selectedItemIndex < selectedItems.length && isRecord6(selectedItems[selectedItemIndex]) ? selectedItems[selectedItemIndex] : null;
|
|
4131
4091
|
const editCopyInPanelEnabled = Boolean(selectedBlockAdvancedSettings.editCopyInPanel);
|
|
4132
4092
|
const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
|
|
4133
4093
|
const isFeatureGridItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "featureGridItem" && uploadingTarget.itemIndex === itemIndex;
|
|
@@ -4469,12 +4429,6 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4469
4429
|
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.cornerStyle", value);
|
|
4470
4430
|
return;
|
|
4471
4431
|
}
|
|
4472
|
-
if (field === "position") {
|
|
4473
|
-
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.position", value);
|
|
4474
|
-
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.positionX", null);
|
|
4475
|
-
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.positionY", null);
|
|
4476
|
-
return;
|
|
4477
|
-
}
|
|
4478
4432
|
if (field === "positionX") {
|
|
4479
4433
|
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.positionX", value);
|
|
4480
4434
|
return;
|
|
@@ -4609,7 +4563,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4609
4563
|
if (blockType === "featureGrid" || blockType === "logoWall" || blockType === "beforeAfter") {
|
|
4610
4564
|
const items = Array.isArray(nextBlock.items) ? nextBlock.items : [];
|
|
4611
4565
|
nextBlock.items = items.map((rawItem) => {
|
|
4612
|
-
if (!
|
|
4566
|
+
if (!isRecord6(rawItem)) {
|
|
4613
4567
|
return rawItem;
|
|
4614
4568
|
}
|
|
4615
4569
|
const nextItem = { ...rawItem };
|
|
@@ -4639,9 +4593,9 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4639
4593
|
);
|
|
4640
4594
|
const renderWithSectionShell = (block, className, content) => {
|
|
4641
4595
|
const shell = sectionStyleFromBlock(block, pageDefaults);
|
|
4642
|
-
const blockSettings =
|
|
4643
|
-
const blockTypography =
|
|
4644
|
-
const blockTheme =
|
|
4596
|
+
const blockSettings = isRecord6(block.settings) ? block.settings : {};
|
|
4597
|
+
const blockTypography = isRecord6(blockSettings.typography) ? blockSettings.typography : {};
|
|
4598
|
+
const blockTheme = isRecord6(blockSettings.theme) ? blockSettings.theme : {};
|
|
4645
4599
|
const typographyStyle = resolveTypographyStyleFromSettings({
|
|
4646
4600
|
bodyAlign: blockTypography.bodyAlign === "center" || blockTypography.bodyAlign === "justify" || blockTypography.bodyAlign === "right" ? blockTypography.bodyAlign : "left",
|
|
4647
4601
|
letterSpacingPreset: blockTypography.letterSpacingPreset === "tight" || blockTypography.letterSpacingPreset === "relaxed" ? blockTypography.letterSpacingPreset : "normal",
|
|
@@ -4700,7 +4654,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4700
4654
|
break;
|
|
4701
4655
|
}
|
|
4702
4656
|
const currentValue = cursor[key];
|
|
4703
|
-
const child =
|
|
4657
|
+
const child = isRecord6(currentValue) ? { ...currentValue } : {};
|
|
4704
4658
|
cursor[key] = child;
|
|
4705
4659
|
cursor = child;
|
|
4706
4660
|
}
|
|
@@ -4720,8 +4674,8 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4720
4674
|
const updateBlockSettingsField = (blockIndex, path, value) => {
|
|
4721
4675
|
setLayout((current) => {
|
|
4722
4676
|
const next = cloneBlockLayout(current);
|
|
4723
|
-
const currentBlock =
|
|
4724
|
-
const currentSettings =
|
|
4677
|
+
const currentBlock = isRecord6(next[blockIndex]) ? next[blockIndex] : {};
|
|
4678
|
+
const currentSettings = isRecord6(currentBlock.settings) ? currentBlock.settings : {};
|
|
4725
4679
|
const nextSettings = setByPath(currentSettings, path, value);
|
|
4726
4680
|
next[blockIndex] = migrateBlockToSettingsV2({
|
|
4727
4681
|
...currentBlock,
|
|
@@ -4755,7 +4709,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4755
4709
|
const existingArray = Array.isArray(block[arrayField]) ? block[arrayField] : [];
|
|
4756
4710
|
const nextArray = [...existingArray];
|
|
4757
4711
|
const targetItem = nextArray[itemIndex] && typeof nextArray[itemIndex] === "object" ? nextArray[itemIndex] : {};
|
|
4758
|
-
const currentSettings =
|
|
4712
|
+
const currentSettings = isRecord6(targetItem.settings) ? targetItem.settings : {};
|
|
4759
4713
|
nextArray[itemIndex] = {
|
|
4760
4714
|
...targetItem,
|
|
4761
4715
|
settings: setByPath(currentSettings, path, value)
|
|
@@ -5052,7 +5006,6 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5052
5006
|
})(),
|
|
5053
5007
|
maxHeight: selectedType === "logoWall" ? 200 : 600,
|
|
5054
5008
|
minHeight: selectedType === "logoWall" ? 24 : selectedType === "beforeAfter" ? 60 : 40,
|
|
5055
|
-
position: normalizeImagePosition2(selectedItemRecord.imagePosition),
|
|
5056
5009
|
positionX: parsePercentNumber(selectedItemRecord.imagePositionX, 50),
|
|
5057
5010
|
positionY: parsePercentNumber(selectedItemRecord.imagePositionY, 50)
|
|
5058
5011
|
} : void 0;
|
|
@@ -5280,16 +5233,18 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5280
5233
|
};
|
|
5281
5234
|
if (type === "hero") {
|
|
5282
5235
|
const media = resolveMedia(block.media);
|
|
5236
|
+
const blockSettings = isRecord6(block.settings) ? block.settings : {};
|
|
5237
|
+
const mediaSettings = isRecord6(blockSettings.media) ? blockSettings.media : {};
|
|
5283
5238
|
const variant = normalizeText2(block.variant, "default");
|
|
5284
5239
|
const backgroundColor = normalizeText2(block.backgroundColor).trim();
|
|
5285
|
-
const backgroundImageFit = normalizeHeroImageFit(block.backgroundImageFit);
|
|
5240
|
+
const backgroundImageFit = normalizeHeroImageFit(mediaSettings.fit ?? block.backgroundImageFit);
|
|
5286
5241
|
const backgroundImageCornerStyle = normalizeHeroImageCornerStyle(
|
|
5287
|
-
block.backgroundImageCornerStyle,
|
|
5288
|
-
block.backgroundImageFit
|
|
5242
|
+
mediaSettings.cornerStyle ?? block.backgroundImageCornerStyle,
|
|
5243
|
+
mediaSettings.fit ?? block.backgroundImageFit
|
|
5289
5244
|
);
|
|
5290
|
-
const backgroundImagePosition = normalizeHeroImagePosition(block.backgroundImagePosition);
|
|
5291
|
-
const backgroundImagePositionX = parseOptionalPercentNumber2(block.backgroundImagePositionX);
|
|
5292
|
-
const backgroundImagePositionY = parseOptionalPercentNumber2(block.backgroundImagePositionY);
|
|
5245
|
+
const backgroundImagePosition = normalizeHeroImagePosition(mediaSettings.position ?? block.backgroundImagePosition);
|
|
5246
|
+
const backgroundImagePositionX = parseOptionalPercentNumber2(mediaSettings.positionX ?? block.backgroundImagePositionX);
|
|
5247
|
+
const backgroundImagePositionY = parseOptionalPercentNumber2(mediaSettings.positionY ?? block.backgroundImagePositionY);
|
|
5293
5248
|
const heroHeight = normalizeHeroHeight(block.heroHeight);
|
|
5294
5249
|
const heroMinHeight = heroHeight === "full" ? "100svh" : heroHeight === "md" ? resolveBuilderMediumHeroHeight(topViewportHeight) : "360px";
|
|
5295
5250
|
const heroCornerRadius = getHeroImageCornerRadius(backgroundImageCornerStyle);
|
|
@@ -5474,7 +5429,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5474
5429
|
const itemImageStyle = getImagePresentationStyle({
|
|
5475
5430
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5476
5431
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5477
|
-
position:
|
|
5432
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5478
5433
|
positionX: itemPositionX,
|
|
5479
5434
|
positionY: itemPositionY
|
|
5480
5435
|
});
|
|
@@ -5589,7 +5544,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5589
5544
|
const itemImageStyle = getImagePresentationStyle({
|
|
5590
5545
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5591
5546
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5592
|
-
position:
|
|
5547
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5593
5548
|
positionX: itemPositionX,
|
|
5594
5549
|
positionY: itemPositionY
|
|
5595
5550
|
});
|
|
@@ -5793,7 +5748,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5793
5748
|
const imageStyle = getImagePresentationStyle({
|
|
5794
5749
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5795
5750
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5796
|
-
position:
|
|
5751
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5797
5752
|
positionX: itemPositionX,
|
|
5798
5753
|
positionY: itemPositionY,
|
|
5799
5754
|
roundedRadius: 10
|
|
@@ -5900,7 +5855,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5900
5855
|
const imageStyle = getImagePresentationStyle({
|
|
5901
5856
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5902
5857
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5903
|
-
position:
|
|
5858
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5904
5859
|
positionX: itemPositionX,
|
|
5905
5860
|
positionY: itemPositionY
|
|
5906
5861
|
});
|
|
@@ -6208,7 +6163,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
6208
6163
|
isBlockUploadTarget,
|
|
6209
6164
|
normalizeImageCornerStyle: normalizeImageCornerStyle2,
|
|
6210
6165
|
normalizeImageFit: normalizeImageFit2,
|
|
6211
|
-
normalizeImagePosition
|
|
6166
|
+
normalizeImagePosition,
|
|
6212
6167
|
normalizeText: normalizeText2,
|
|
6213
6168
|
onDropAt,
|
|
6214
6169
|
renderWithSectionShell,
|
|
@@ -211,6 +211,7 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
211
211
|
...blockWithSettings,
|
|
212
212
|
settings
|
|
213
213
|
};
|
|
214
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
214
215
|
next.contentWidth = settings.layout.contentWidth;
|
|
215
216
|
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
216
217
|
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
@@ -234,19 +235,19 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
234
235
|
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
235
236
|
next.customClassName = settings.advanced.customClassName;
|
|
236
237
|
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
237
|
-
|
|
238
|
+
delete next.backgroundImagePositionX;
|
|
239
|
+
delete next.backgroundImagePositionY;
|
|
240
|
+
delete next.imageHeight;
|
|
241
|
+
delete next.imagePositionX;
|
|
242
|
+
delete next.imagePositionY;
|
|
243
|
+
if (blockType === "hero") {
|
|
238
244
|
next.backgroundImageFit = settings.media.fit;
|
|
239
245
|
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
240
246
|
next.backgroundImagePosition = settings.media.position;
|
|
241
|
-
|
|
242
|
-
next.backgroundImagePositionY = settings.media.positionY;
|
|
243
|
-
} else {
|
|
247
|
+
} else if (blockType === "media") {
|
|
244
248
|
next.imageFit = settings.media.fit;
|
|
245
249
|
next.imageCornerStyle = settings.media.cornerStyle;
|
|
246
250
|
next.imagePosition = settings.media.position;
|
|
247
|
-
next.imagePositionX = settings.media.positionX;
|
|
248
|
-
next.imagePositionY = settings.media.positionY;
|
|
249
|
-
next.imageHeight = settings.media.height;
|
|
250
251
|
}
|
|
251
252
|
if (Array.isArray(next.items)) {
|
|
252
253
|
next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
@@ -367,7 +368,6 @@ function ImageControls({
|
|
|
367
368
|
maxHeight = 600,
|
|
368
369
|
minHeight = 40,
|
|
369
370
|
onChange,
|
|
370
|
-
position,
|
|
371
371
|
positionX,
|
|
372
372
|
positionY
|
|
373
373
|
}) {
|
|
@@ -403,25 +403,7 @@ function ImageControls({
|
|
|
403
403
|
)
|
|
404
404
|
] }),
|
|
405
405
|
/* @__PURE__ */ jsxs2("label", { className: "orion-builder-settings-label", children: [
|
|
406
|
-
"Image Position",
|
|
407
|
-
/* @__PURE__ */ jsxs2(
|
|
408
|
-
"select",
|
|
409
|
-
{
|
|
410
|
-
className: "orion-builder-settings-input",
|
|
411
|
-
onChange: (event) => onChange("position", event.target.value),
|
|
412
|
-
value: position,
|
|
413
|
-
children: [
|
|
414
|
-
/* @__PURE__ */ jsx2("option", { value: "center", children: "Center" }),
|
|
415
|
-
/* @__PURE__ */ jsx2("option", { value: "top", children: "Top" }),
|
|
416
|
-
/* @__PURE__ */ jsx2("option", { value: "bottom", children: "Bottom" }),
|
|
417
|
-
/* @__PURE__ */ jsx2("option", { value: "left", children: "Left" }),
|
|
418
|
-
/* @__PURE__ */ jsx2("option", { value: "right", children: "Right" })
|
|
419
|
-
]
|
|
420
|
-
}
|
|
421
|
-
)
|
|
422
|
-
] }),
|
|
423
|
-
/* @__PURE__ */ jsxs2("label", { className: "orion-builder-settings-label", children: [
|
|
424
|
-
"Horizontal Image Focus (%)",
|
|
406
|
+
"Horizontal Image Position",
|
|
425
407
|
/* @__PURE__ */ jsxs2("div", { className: "orion-builder-settings-input-split", children: [
|
|
426
408
|
/* @__PURE__ */ jsx2(
|
|
427
409
|
"input",
|
|
@@ -447,7 +429,7 @@ function ImageControls({
|
|
|
447
429
|
] })
|
|
448
430
|
] }),
|
|
449
431
|
/* @__PURE__ */ jsxs2("label", { className: "orion-builder-settings-label", children: [
|
|
450
|
-
"Vertical Image
|
|
432
|
+
"Vertical Image Position",
|
|
451
433
|
/* @__PURE__ */ jsxs2("div", { className: "orion-builder-settings-input-split", children: [
|
|
452
434
|
/* @__PURE__ */ jsx2(
|
|
453
435
|
"input",
|
|
@@ -679,19 +661,6 @@ var mediaFieldSet = [
|
|
|
679
661
|
],
|
|
680
662
|
tags: ["image", "radius", "corners"],
|
|
681
663
|
type: "select"
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
group: "media",
|
|
685
|
-
key: "settings.media.position",
|
|
686
|
-
label: "Image Position",
|
|
687
|
-
options: [
|
|
688
|
-
{ label: "Center", value: "center" },
|
|
689
|
-
{ label: "Top", value: "top" },
|
|
690
|
-
{ label: "Bottom", value: "bottom" },
|
|
691
|
-
{ label: "Left", value: "left" },
|
|
692
|
-
{ label: "Right", value: "right" }
|
|
693
|
-
],
|
|
694
|
-
type: "select"
|
|
695
664
|
}
|
|
696
665
|
];
|
|
697
666
|
var commonInspectorGroups = [
|
|
@@ -1097,16 +1066,13 @@ function BlockInspectorRenderer({
|
|
|
1097
1066
|
groups.map((group) => {
|
|
1098
1067
|
const mediaFit = getByPath(block, "settings.media.fit");
|
|
1099
1068
|
const mediaCornerStyle = getByPath(block, "settings.media.cornerStyle");
|
|
1100
|
-
const mediaPosition = getByPath(block, "settings.media.position");
|
|
1101
1069
|
const mediaPositionX = normalizeNumber(getByPath(block, "settings.media.positionX"), 50);
|
|
1102
1070
|
const mediaPositionY = normalizeNumber(getByPath(block, "settings.media.positionY"), 50);
|
|
1103
1071
|
const mediaHeight = getByPath(block, "settings.media.height");
|
|
1104
|
-
const fallbackMediaPosition = mediaPosition === "top" || mediaPosition === "bottom" || mediaPosition === "left" || mediaPosition === "right" ? mediaPosition : "center";
|
|
1105
1072
|
const fallbackMediaControls = {
|
|
1106
1073
|
cornerStyle: mediaCornerStyle === "square" ? "square" : "rounded",
|
|
1107
1074
|
fit: mediaFit === "contain" ? "contain" : "cover",
|
|
1108
1075
|
height: typeof mediaHeight === "number" ? mediaHeight : null,
|
|
1109
|
-
position: fallbackMediaPosition,
|
|
1110
1076
|
positionX: mediaPositionX,
|
|
1111
1077
|
positionY: mediaPositionY
|
|
1112
1078
|
};
|
|
@@ -1202,7 +1168,6 @@ function BlockInspectorRenderer({
|
|
|
1202
1168
|
}
|
|
1203
1169
|
updateForKey(`settings.media.${field}`, value);
|
|
1204
1170
|
},
|
|
1205
|
-
position: effectiveMedia.position,
|
|
1206
1171
|
positionX: effectiveMedia.positionX,
|
|
1207
1172
|
positionY: effectiveMedia.positionY
|
|
1208
1173
|
}
|
|
@@ -2128,6 +2093,7 @@ function BlockFrame({
|
|
|
2128
2093
|
|
|
2129
2094
|
// src/studio-pages/builder/renderers/renderSimpleBlockPreview.tsx
|
|
2130
2095
|
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2096
|
+
var isRecord4 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2131
2097
|
var parseOptionalPercentNumber = (value) => {
|
|
2132
2098
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
2133
2099
|
return Math.max(0, Math.min(100, value));
|
|
@@ -2149,7 +2115,7 @@ function renderSimpleBlockPreview(args) {
|
|
|
2149
2115
|
isBlockUploadTarget,
|
|
2150
2116
|
normalizeImageCornerStyle: normalizeImageCornerStyle3,
|
|
2151
2117
|
normalizeImageFit: normalizeImageFit3,
|
|
2152
|
-
normalizeImagePosition:
|
|
2118
|
+
normalizeImagePosition: normalizeImagePosition2,
|
|
2153
2119
|
normalizeText: normalizeText3,
|
|
2154
2120
|
onDropAt,
|
|
2155
2121
|
renderWithSectionShell,
|
|
@@ -2323,12 +2289,14 @@ function renderSimpleBlockPreview(args) {
|
|
|
2323
2289
|
if (type === "media") {
|
|
2324
2290
|
const image = resolveMedia2(block.image);
|
|
2325
2291
|
const size = normalizeText3(block.size, "default");
|
|
2326
|
-
const
|
|
2327
|
-
const
|
|
2292
|
+
const blockSettings = isRecord4(block.settings) ? block.settings : {};
|
|
2293
|
+
const mediaSettings = isRecord4(blockSettings.media) ? blockSettings.media : {};
|
|
2294
|
+
const imagePositionX = parseOptionalPercentNumber(mediaSettings.positionX ?? block?.imagePositionX);
|
|
2295
|
+
const imagePositionY = parseOptionalPercentNumber(mediaSettings.positionY ?? block?.imagePositionY);
|
|
2328
2296
|
const imageStyle = getImagePresentationStyle2({
|
|
2329
|
-
cornerStyle: normalizeImageCornerStyle3(block?.imageCornerStyle),
|
|
2330
|
-
fit: normalizeImageFit3(block?.imageFit),
|
|
2331
|
-
position:
|
|
2297
|
+
cornerStyle: normalizeImageCornerStyle3(mediaSettings.cornerStyle ?? block?.imageCornerStyle),
|
|
2298
|
+
fit: normalizeImageFit3(mediaSettings.fit ?? block?.imageFit),
|
|
2299
|
+
position: normalizeImagePosition2(mediaSettings.position ?? block?.imagePosition),
|
|
2332
2300
|
positionX: imagePositionX,
|
|
2333
2301
|
positionY: imagePositionY
|
|
2334
2302
|
});
|
|
@@ -2843,20 +2811,20 @@ var lucideIconOptions = [
|
|
|
2843
2811
|
"BadgeCheck",
|
|
2844
2812
|
"CalendarClock"
|
|
2845
2813
|
];
|
|
2846
|
-
var
|
|
2814
|
+
var isRecord5 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2847
2815
|
var normalizeText = (value, fallback = "") => typeof value === "string" ? value : fallback;
|
|
2848
2816
|
var getRelationID2 = (value) => {
|
|
2849
2817
|
if (typeof value === "number" || typeof value === "string") {
|
|
2850
2818
|
return value;
|
|
2851
2819
|
}
|
|
2852
|
-
if (!
|
|
2820
|
+
if (!isRecord5(value)) {
|
|
2853
2821
|
return null;
|
|
2854
2822
|
}
|
|
2855
2823
|
const id = value.id;
|
|
2856
2824
|
return typeof id === "number" || typeof id === "string" ? id : null;
|
|
2857
2825
|
};
|
|
2858
2826
|
var toMediaLibraryItem2 = (value) => {
|
|
2859
|
-
if (!
|
|
2827
|
+
if (!isRecord5(value)) {
|
|
2860
2828
|
return null;
|
|
2861
2829
|
}
|
|
2862
2830
|
const id = getRelationID2(value);
|
|
@@ -2888,7 +2856,6 @@ var normalizeNumber2 = (value, fallback) => {
|
|
|
2888
2856
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2889
2857
|
var normalizeImageFit = (value) => value === "contain" ? "contain" : "cover";
|
|
2890
2858
|
var normalizeImageCornerStyle = (value) => value === "square" ? "square" : "rounded";
|
|
2891
|
-
var normalizeImagePosition = (value) => value === "top" || value === "bottom" || value === "left" || value === "right" ? value : "center";
|
|
2892
2859
|
var hasQueryMatch = (query, ...values) => {
|
|
2893
2860
|
const normalized = query.trim().toLowerCase();
|
|
2894
2861
|
if (!normalized) {
|
|
@@ -2923,8 +2890,8 @@ var blockConfig = {
|
|
|
2923
2890
|
}
|
|
2924
2891
|
};
|
|
2925
2892
|
var getItemTypographyAlign = (item) => {
|
|
2926
|
-
const settings =
|
|
2927
|
-
const typography =
|
|
2893
|
+
const settings = isRecord5(item.settings) ? item.settings : {};
|
|
2894
|
+
const typography = isRecord5(settings.typography) ? settings.typography : {};
|
|
2928
2895
|
const value = typography.bodyAlign;
|
|
2929
2896
|
return value === "center" || value === "justify" || value === "right" ? value : "left";
|
|
2930
2897
|
};
|
|
@@ -3296,17 +3263,10 @@ function ArrayItemsEditor({
|
|
|
3296
3263
|
onUpdateItemSetting(itemIndex, "media.cornerStyle", value);
|
|
3297
3264
|
return;
|
|
3298
3265
|
}
|
|
3299
|
-
if (field === "position") {
|
|
3300
|
-
onUpdateItemSetting(itemIndex, "media.position", value);
|
|
3301
|
-
onUpdateItemSetting(itemIndex, "media.positionX", null);
|
|
3302
|
-
onUpdateItemSetting(itemIndex, "media.positionY", null);
|
|
3303
|
-
return;
|
|
3304
|
-
}
|
|
3305
3266
|
if (field === "positionX" || field === "positionY") {
|
|
3306
3267
|
onUpdateItemSetting(itemIndex, `media.${field}`, value);
|
|
3307
3268
|
}
|
|
3308
3269
|
},
|
|
3309
|
-
position: normalizeImagePosition(item.imagePosition),
|
|
3310
3270
|
positionX: clamp(normalizeNumber2(item.imagePositionX, 50), 0, 100),
|
|
3311
3271
|
positionY: clamp(normalizeNumber2(item.imagePositionY, 50), 0, 100)
|
|
3312
3272
|
}
|
|
@@ -3340,18 +3300,18 @@ function ArrayItemsEditor({
|
|
|
3340
3300
|
|
|
3341
3301
|
// src/studio-pages/builder/BuilderPageEditor.tsx
|
|
3342
3302
|
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3343
|
-
var
|
|
3303
|
+
var isRecord6 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
3344
3304
|
var resolveMedia = (value) => {
|
|
3345
3305
|
if (!value) return null;
|
|
3346
3306
|
if (typeof value === "string" || typeof value === "number") return null;
|
|
3347
|
-
if (!
|
|
3307
|
+
if (!isRecord6(value)) return null;
|
|
3348
3308
|
if (typeof value.url === "string") {
|
|
3349
3309
|
return {
|
|
3350
3310
|
url: value.url,
|
|
3351
3311
|
alt: typeof value.alt === "string" ? value.alt : void 0
|
|
3352
3312
|
};
|
|
3353
3313
|
}
|
|
3354
|
-
if (
|
|
3314
|
+
if (isRecord6(value.value) && typeof value.value.url === "string") {
|
|
3355
3315
|
return {
|
|
3356
3316
|
url: value.value.url,
|
|
3357
3317
|
alt: typeof value.value.alt === "string" ? value.value.alt : void 0
|
|
@@ -3395,7 +3355,7 @@ var resolveBuilderMediumHeroHeight = (topViewportHeight) => {
|
|
|
3395
3355
|
};
|
|
3396
3356
|
var normalizeImageFit2 = (value) => normalizeHeroImageFit(value);
|
|
3397
3357
|
var normalizeImageCornerStyle2 = (value, legacyFitValue) => normalizeHeroImageCornerStyle(value, legacyFitValue);
|
|
3398
|
-
var
|
|
3358
|
+
var normalizeImagePosition = (value) => normalizeHeroImagePosition(value);
|
|
3399
3359
|
var positionPercent = (value, fit) => {
|
|
3400
3360
|
const resolved = fit === "cover" && (value === "left" || value === "right") ? "center" : value;
|
|
3401
3361
|
switch (resolved) {
|
|
@@ -3960,10 +3920,10 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
3960
3920
|
const title = normalizeText2(doc.title, "Untitled Page");
|
|
3961
3921
|
const pageTemplate = normalizeText2(doc.template, "standard");
|
|
3962
3922
|
const initialLayout = Array.isArray(doc.layout) ? doc.layout : [];
|
|
3963
|
-
const sourceThemePage =
|
|
3923
|
+
const sourceThemePage = isRecord6(sourceMetadata.theme) ? sourceMetadata.theme : {};
|
|
3964
3924
|
const initialPageDefaults = {
|
|
3965
3925
|
pageWidthDefault: sourceMetadata.pageWidthDefault === "wide" || sourceMetadata.pageWidthDefault === "full" ? sourceMetadata.pageWidthDefault : defaultPageDefaults.pageWidthDefault,
|
|
3966
|
-
themePage:
|
|
3926
|
+
themePage: isRecord6(sourceThemePage.page) ? sourceThemePage.page : {}
|
|
3967
3927
|
};
|
|
3968
3928
|
const [layout, setLayout] = useState5(
|
|
3969
3929
|
migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block)))
|
|
@@ -4003,12 +3963,12 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4003
3963
|
);
|
|
4004
3964
|
const selectedType = normalizeText2(selectedBlock?.blockType, "");
|
|
4005
3965
|
const selectedItems = Array.isArray(selectedBlock?.items) ? selectedBlock?.items : [];
|
|
4006
|
-
const selectedBlockSettings =
|
|
4007
|
-
const selectedBlockAdvancedSettings =
|
|
3966
|
+
const selectedBlockSettings = isRecord6(selectedBlock?.settings) ? selectedBlock.settings : {};
|
|
3967
|
+
const selectedBlockAdvancedSettings = isRecord6(selectedBlockSettings.advanced) ? selectedBlockSettings.advanced : {};
|
|
4008
3968
|
const isArrayItemBlockSelected = selectedType === "featureGrid" || selectedType === "logoWall" || selectedType === "beforeAfter" || selectedType === "stats" || selectedType === "faq" || selectedType === "testimonials";
|
|
4009
3969
|
const selectedBlockHasMediaSource = selectedType === "hero" || selectedType === "media";
|
|
4010
3970
|
const selectedBlockMediaValue = selectedType === "hero" ? selectedBlock?.media : selectedType === "media" ? selectedBlock?.image : null;
|
|
4011
|
-
const selectedItemRecord = typeof selectedItemIndex === "number" && selectedItemIndex >= 0 && selectedItemIndex < selectedItems.length &&
|
|
3971
|
+
const selectedItemRecord = typeof selectedItemIndex === "number" && selectedItemIndex >= 0 && selectedItemIndex < selectedItems.length && isRecord6(selectedItems[selectedItemIndex]) ? selectedItems[selectedItemIndex] : null;
|
|
4012
3972
|
const editCopyInPanelEnabled = Boolean(selectedBlockAdvancedSettings.editCopyInPanel);
|
|
4013
3973
|
const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
|
|
4014
3974
|
const isFeatureGridItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "featureGridItem" && uploadingTarget.itemIndex === itemIndex;
|
|
@@ -4350,12 +4310,6 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4350
4310
|
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.cornerStyle", value);
|
|
4351
4311
|
return;
|
|
4352
4312
|
}
|
|
4353
|
-
if (field === "position") {
|
|
4354
|
-
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.position", value);
|
|
4355
|
-
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.positionX", null);
|
|
4356
|
-
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.positionY", null);
|
|
4357
|
-
return;
|
|
4358
|
-
}
|
|
4359
4313
|
if (field === "positionX") {
|
|
4360
4314
|
updateArrayItemSettingField(selectedIndex, "items", selectedItemIndex, "media.positionX", value);
|
|
4361
4315
|
return;
|
|
@@ -4490,7 +4444,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4490
4444
|
if (blockType === "featureGrid" || blockType === "logoWall" || blockType === "beforeAfter") {
|
|
4491
4445
|
const items = Array.isArray(nextBlock.items) ? nextBlock.items : [];
|
|
4492
4446
|
nextBlock.items = items.map((rawItem) => {
|
|
4493
|
-
if (!
|
|
4447
|
+
if (!isRecord6(rawItem)) {
|
|
4494
4448
|
return rawItem;
|
|
4495
4449
|
}
|
|
4496
4450
|
const nextItem = { ...rawItem };
|
|
@@ -4520,9 +4474,9 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4520
4474
|
);
|
|
4521
4475
|
const renderWithSectionShell = (block, className, content) => {
|
|
4522
4476
|
const shell = sectionStyleFromBlock(block, pageDefaults);
|
|
4523
|
-
const blockSettings =
|
|
4524
|
-
const blockTypography =
|
|
4525
|
-
const blockTheme =
|
|
4477
|
+
const blockSettings = isRecord6(block.settings) ? block.settings : {};
|
|
4478
|
+
const blockTypography = isRecord6(blockSettings.typography) ? blockSettings.typography : {};
|
|
4479
|
+
const blockTheme = isRecord6(blockSettings.theme) ? blockSettings.theme : {};
|
|
4526
4480
|
const typographyStyle = resolveTypographyStyleFromSettings({
|
|
4527
4481
|
bodyAlign: blockTypography.bodyAlign === "center" || blockTypography.bodyAlign === "justify" || blockTypography.bodyAlign === "right" ? blockTypography.bodyAlign : "left",
|
|
4528
4482
|
letterSpacingPreset: blockTypography.letterSpacingPreset === "tight" || blockTypography.letterSpacingPreset === "relaxed" ? blockTypography.letterSpacingPreset : "normal",
|
|
@@ -4581,7 +4535,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4581
4535
|
break;
|
|
4582
4536
|
}
|
|
4583
4537
|
const currentValue = cursor[key];
|
|
4584
|
-
const child =
|
|
4538
|
+
const child = isRecord6(currentValue) ? { ...currentValue } : {};
|
|
4585
4539
|
cursor[key] = child;
|
|
4586
4540
|
cursor = child;
|
|
4587
4541
|
}
|
|
@@ -4601,8 +4555,8 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4601
4555
|
const updateBlockSettingsField = (blockIndex, path, value) => {
|
|
4602
4556
|
setLayout((current) => {
|
|
4603
4557
|
const next = cloneBlockLayout(current);
|
|
4604
|
-
const currentBlock =
|
|
4605
|
-
const currentSettings =
|
|
4558
|
+
const currentBlock = isRecord6(next[blockIndex]) ? next[blockIndex] : {};
|
|
4559
|
+
const currentSettings = isRecord6(currentBlock.settings) ? currentBlock.settings : {};
|
|
4606
4560
|
const nextSettings = setByPath(currentSettings, path, value);
|
|
4607
4561
|
next[blockIndex] = migrateBlockToSettingsV2({
|
|
4608
4562
|
...currentBlock,
|
|
@@ -4636,7 +4590,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4636
4590
|
const existingArray = Array.isArray(block[arrayField]) ? block[arrayField] : [];
|
|
4637
4591
|
const nextArray = [...existingArray];
|
|
4638
4592
|
const targetItem = nextArray[itemIndex] && typeof nextArray[itemIndex] === "object" ? nextArray[itemIndex] : {};
|
|
4639
|
-
const currentSettings =
|
|
4593
|
+
const currentSettings = isRecord6(targetItem.settings) ? targetItem.settings : {};
|
|
4640
4594
|
nextArray[itemIndex] = {
|
|
4641
4595
|
...targetItem,
|
|
4642
4596
|
settings: setByPath(currentSettings, path, value)
|
|
@@ -4933,7 +4887,6 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4933
4887
|
})(),
|
|
4934
4888
|
maxHeight: selectedType === "logoWall" ? 200 : 600,
|
|
4935
4889
|
minHeight: selectedType === "logoWall" ? 24 : selectedType === "beforeAfter" ? 60 : 40,
|
|
4936
|
-
position: normalizeImagePosition2(selectedItemRecord.imagePosition),
|
|
4937
4890
|
positionX: parsePercentNumber(selectedItemRecord.imagePositionX, 50),
|
|
4938
4891
|
positionY: parsePercentNumber(selectedItemRecord.imagePositionY, 50)
|
|
4939
4892
|
} : void 0;
|
|
@@ -5161,16 +5114,18 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5161
5114
|
};
|
|
5162
5115
|
if (type === "hero") {
|
|
5163
5116
|
const media = resolveMedia(block.media);
|
|
5117
|
+
const blockSettings = isRecord6(block.settings) ? block.settings : {};
|
|
5118
|
+
const mediaSettings = isRecord6(blockSettings.media) ? blockSettings.media : {};
|
|
5164
5119
|
const variant = normalizeText2(block.variant, "default");
|
|
5165
5120
|
const backgroundColor = normalizeText2(block.backgroundColor).trim();
|
|
5166
|
-
const backgroundImageFit = normalizeHeroImageFit(block.backgroundImageFit);
|
|
5121
|
+
const backgroundImageFit = normalizeHeroImageFit(mediaSettings.fit ?? block.backgroundImageFit);
|
|
5167
5122
|
const backgroundImageCornerStyle = normalizeHeroImageCornerStyle(
|
|
5168
|
-
block.backgroundImageCornerStyle,
|
|
5169
|
-
block.backgroundImageFit
|
|
5123
|
+
mediaSettings.cornerStyle ?? block.backgroundImageCornerStyle,
|
|
5124
|
+
mediaSettings.fit ?? block.backgroundImageFit
|
|
5170
5125
|
);
|
|
5171
|
-
const backgroundImagePosition = normalizeHeroImagePosition(block.backgroundImagePosition);
|
|
5172
|
-
const backgroundImagePositionX = parseOptionalPercentNumber2(block.backgroundImagePositionX);
|
|
5173
|
-
const backgroundImagePositionY = parseOptionalPercentNumber2(block.backgroundImagePositionY);
|
|
5126
|
+
const backgroundImagePosition = normalizeHeroImagePosition(mediaSettings.position ?? block.backgroundImagePosition);
|
|
5127
|
+
const backgroundImagePositionX = parseOptionalPercentNumber2(mediaSettings.positionX ?? block.backgroundImagePositionX);
|
|
5128
|
+
const backgroundImagePositionY = parseOptionalPercentNumber2(mediaSettings.positionY ?? block.backgroundImagePositionY);
|
|
5174
5129
|
const heroHeight = normalizeHeroHeight(block.heroHeight);
|
|
5175
5130
|
const heroMinHeight = heroHeight === "full" ? "100svh" : heroHeight === "md" ? resolveBuilderMediumHeroHeight(topViewportHeight) : "360px";
|
|
5176
5131
|
const heroCornerRadius = getHeroImageCornerRadius(backgroundImageCornerStyle);
|
|
@@ -5355,7 +5310,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5355
5310
|
const itemImageStyle = getImagePresentationStyle({
|
|
5356
5311
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5357
5312
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5358
|
-
position:
|
|
5313
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5359
5314
|
positionX: itemPositionX,
|
|
5360
5315
|
positionY: itemPositionY
|
|
5361
5316
|
});
|
|
@@ -5470,7 +5425,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5470
5425
|
const itemImageStyle = getImagePresentationStyle({
|
|
5471
5426
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5472
5427
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5473
|
-
position:
|
|
5428
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5474
5429
|
positionX: itemPositionX,
|
|
5475
5430
|
positionY: itemPositionY
|
|
5476
5431
|
});
|
|
@@ -5674,7 +5629,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5674
5629
|
const imageStyle = getImagePresentationStyle({
|
|
5675
5630
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5676
5631
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5677
|
-
position:
|
|
5632
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5678
5633
|
positionX: itemPositionX,
|
|
5679
5634
|
positionY: itemPositionY,
|
|
5680
5635
|
roundedRadius: 10
|
|
@@ -5781,7 +5736,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5781
5736
|
const imageStyle = getImagePresentationStyle({
|
|
5782
5737
|
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5783
5738
|
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5784
|
-
position:
|
|
5739
|
+
position: normalizeImagePosition(itemRecord?.imagePosition),
|
|
5785
5740
|
positionX: itemPositionX,
|
|
5786
5741
|
positionY: itemPositionY
|
|
5787
5742
|
});
|
|
@@ -6089,7 +6044,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
6089
6044
|
isBlockUploadTarget,
|
|
6090
6045
|
normalizeImageCornerStyle: normalizeImageCornerStyle2,
|
|
6091
6046
|
normalizeImageFit: normalizeImageFit2,
|
|
6092
|
-
normalizeImagePosition
|
|
6047
|
+
normalizeImagePosition,
|
|
6093
6048
|
normalizeText: normalizeText2,
|
|
6094
6049
|
onDropAt,
|
|
6095
6050
|
renderWithSectionShell,
|
|
@@ -235,6 +235,7 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
235
235
|
...blockWithSettings,
|
|
236
236
|
settings
|
|
237
237
|
};
|
|
238
|
+
const blockType = typeof next.blockType === "string" ? next.blockType : "";
|
|
238
239
|
next.contentWidth = settings.layout.contentWidth;
|
|
239
240
|
next.sectionPaddingX = settings.layout.sectionPaddingX;
|
|
240
241
|
next.sectionPaddingY = settings.layout.sectionPaddingY;
|
|
@@ -258,19 +259,19 @@ var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
|
258
259
|
next.editCopyInPanel = settings.advanced.editCopyInPanel;
|
|
259
260
|
next.customClassName = settings.advanced.customClassName;
|
|
260
261
|
next.hideOnMobile = settings.advanced.hideOnMobile;
|
|
261
|
-
|
|
262
|
+
delete next.backgroundImagePositionX;
|
|
263
|
+
delete next.backgroundImagePositionY;
|
|
264
|
+
delete next.imageHeight;
|
|
265
|
+
delete next.imagePositionX;
|
|
266
|
+
delete next.imagePositionY;
|
|
267
|
+
if (blockType === "hero") {
|
|
262
268
|
next.backgroundImageFit = settings.media.fit;
|
|
263
269
|
next.backgroundImageCornerStyle = settings.media.cornerStyle;
|
|
264
270
|
next.backgroundImagePosition = settings.media.position;
|
|
265
|
-
|
|
266
|
-
next.backgroundImagePositionY = settings.media.positionY;
|
|
267
|
-
} else {
|
|
271
|
+
} else if (blockType === "media") {
|
|
268
272
|
next.imageFit = settings.media.fit;
|
|
269
273
|
next.imageCornerStyle = settings.media.cornerStyle;
|
|
270
274
|
next.imagePosition = settings.media.position;
|
|
271
|
-
next.imagePositionX = settings.media.positionX;
|
|
272
|
-
next.imagePositionY = settings.media.positionY;
|
|
273
|
-
next.imageHeight = settings.media.height;
|
|
274
275
|
}
|
|
275
276
|
if (Array.isArray(next.items)) {
|
|
276
277
|
next.items = next.items.map((rawItem) => isRecord(rawItem) ? v2SettingsToLegacyItem(rawItem) : rawItem);
|
|
@@ -540,19 +541,6 @@ var mediaFieldSet = [
|
|
|
540
541
|
],
|
|
541
542
|
tags: ["image", "radius", "corners"],
|
|
542
543
|
type: "select"
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
group: "media",
|
|
546
|
-
key: "settings.media.position",
|
|
547
|
-
label: "Image Position",
|
|
548
|
-
options: [
|
|
549
|
-
{ label: "Center", value: "center" },
|
|
550
|
-
{ label: "Top", value: "top" },
|
|
551
|
-
{ label: "Bottom", value: "bottom" },
|
|
552
|
-
{ label: "Left", value: "left" },
|
|
553
|
-
{ label: "Right", value: "right" }
|
|
554
|
-
],
|
|
555
|
-
type: "select"
|
|
556
544
|
}
|
|
557
545
|
];
|
|
558
546
|
var inspectorDefinitionByBlockType = {
|