@orion-studios/payload-studio 0.6.0-beta.4 → 0.6.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.
- package/dist/admin/client.d.mts +1 -0
- package/dist/admin/client.d.ts +1 -0
- package/dist/admin/client.js +3924 -1355
- package/dist/admin/client.mjs +4090 -1533
- package/dist/admin/index.d.mts +2 -3
- package/dist/admin/index.d.ts +2 -3
- package/dist/admin/index.js +141 -1522
- package/dist/admin/index.mjs +2 -4
- package/dist/admin-app/client.js +11 -4
- package/dist/admin-app/client.mjs +1 -1
- package/dist/admin-app/index.d.mts +2 -2
- package/dist/admin-app/index.d.ts +2 -2
- package/dist/admin-app/index.mjs +4 -4
- package/dist/admin-app/styles.css +343 -41
- package/dist/admin.css +18 -2
- package/dist/{chunk-KPIX7OSV.mjs → chunk-2XH7X34N.mjs} +11 -4
- package/dist/{chunk-OTHERBGX.mjs → chunk-AWL7TIEI.mjs} +1 -1
- package/dist/{chunk-PF3EBZXF.mjs → chunk-CUPMTHGX.mjs} +19 -3
- package/dist/chunk-JC3UV74N.mjs +1033 -0
- package/dist/{chunk-XKUTZ7IU.mjs → chunk-LUF62ZWF.mjs} +31 -5
- package/dist/{chunk-EHUE4LCT.mjs → chunk-RKTIFEUY.mjs} +33 -3
- package/dist/chunk-W2UOCJDX.mjs +32 -0
- package/dist/{index-bbA3HSxa.d.ts → index-BV0vEGl6.d.ts} +6 -9
- package/dist/{index-52HdVLQq.d.ts → index-DAdN56fM.d.ts} +1 -1
- package/dist/{index-DEkV-sMs.d.mts → index-DLfPOqYA.d.mts} +6 -9
- package/dist/{index-Cv-6qnrw.d.mts → index-DRu4fKxf.d.mts} +1 -1
- package/dist/{index-DEQC3Dwj.d.mts → index-G_uTNffQ.d.mts} +1 -1
- package/dist/{index-Crx_MtPw.d.ts → index-vkEwwsoC.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +249 -1542
- package/dist/index.mjs +10 -10
- package/dist/nextjs/index.js +19 -3
- package/dist/nextjs/index.mjs +2 -2
- package/dist/{sitePreviewTypes-BkHCWxNW.d.mts → sitePreviewTypes-BrJwGzJj.d.mts} +1 -1
- package/dist/{sitePreviewTypes-BkHCWxNW.d.ts → sitePreviewTypes-BrJwGzJj.d.ts} +1 -1
- package/dist/studio-pages/builder.css +24 -5
- package/dist/studio-pages/client.js +455 -63
- package/dist/studio-pages/client.mjs +455 -63
- package/dist/studio-pages/index.d.mts +1 -1
- package/dist/studio-pages/index.d.ts +1 -1
- package/dist/studio-pages/index.js +46 -4
- package/dist/studio-pages/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-DYXSAVUQ.mjs +0 -2372
- package/dist/chunk-Z6L5K5MH.mjs +0 -64
|
@@ -129,6 +129,7 @@ var defaultBuilderThemeTokens = {
|
|
|
129
129
|
|
|
130
130
|
// src/studio-pages/builder/adapters/settingsV2.ts
|
|
131
131
|
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
132
|
+
var isTextAlign = (value) => value === "left" || value === "center" || value === "right" || value === "justify";
|
|
132
133
|
var parsePercent = (value) => {
|
|
133
134
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
134
135
|
return Math.max(0, Math.min(100, value));
|
|
@@ -171,6 +172,10 @@ var mergeSettings = (defaults, input) => {
|
|
|
171
172
|
};
|
|
172
173
|
var legacyBlockToV2Settings = (block) => {
|
|
173
174
|
const current = structuredClone(defaultBuilderBlockSettingsV2);
|
|
175
|
+
if (block.blockType === "hero" && block.variant === "centered") {
|
|
176
|
+
current.typography.headingAlign = "center";
|
|
177
|
+
current.typography.bodyAlign = "center";
|
|
178
|
+
}
|
|
174
179
|
current.layout.contentWidth = block.contentWidth === "narrow" || block.contentWidth === "content" || block.contentWidth === "wide" || block.contentWidth === "full" || block.contentWidth === "inherit" ? block.contentWidth : current.layout.contentWidth;
|
|
175
180
|
current.layout.sectionPaddingX = block.sectionPaddingX === "none" || block.sectionPaddingX === "sm" || block.sectionPaddingX === "md" || block.sectionPaddingX === "lg" || block.sectionPaddingX === "inherit" ? block.sectionPaddingX : current.layout.sectionPaddingX;
|
|
176
181
|
current.layout.sectionPaddingY = block.sectionPaddingY === "none" || block.sectionPaddingY === "sm" || block.sectionPaddingY === "lg" ? block.sectionPaddingY : current.layout.sectionPaddingY;
|
|
@@ -207,15 +212,26 @@ var legacyBlockToV2Settings = (block) => {
|
|
|
207
212
|
current.media.positionX = parsePercent(block.imagePositionX ?? block.backgroundImagePositionX);
|
|
208
213
|
current.media.positionY = parsePercent(block.imagePositionY ?? block.backgroundImagePositionY);
|
|
209
214
|
current.media.height = parsePixel(block.imageHeight);
|
|
210
|
-
current.typography.headingAlign = block.textHeadingAlign
|
|
211
|
-
current.typography.bodyAlign = block.textBodyAlign
|
|
215
|
+
current.typography.headingAlign = isTextAlign(block.textHeadingAlign) ? block.textHeadingAlign : current.typography.headingAlign;
|
|
216
|
+
current.typography.bodyAlign = isTextAlign(block.textBodyAlign) ? block.textBodyAlign : current.typography.bodyAlign;
|
|
212
217
|
current.typography.maxTextWidth = block.textMaxWidth === "auto" || block.textMaxWidth === "sm" || block.textMaxWidth === "md" || block.textMaxWidth === "lg" || block.textMaxWidth === "full" ? block.textMaxWidth : current.typography.maxTextWidth;
|
|
213
218
|
current.typography.lineHeightPreset = block.textLineHeightPreset === "tight" || block.textLineHeightPreset === "normal" || block.textLineHeightPreset === "relaxed" ? block.textLineHeightPreset : current.typography.lineHeightPreset;
|
|
214
219
|
current.typography.letterSpacingPreset = block.textLetterSpacingPreset === "tight" || block.textLetterSpacingPreset === "normal" || block.textLetterSpacingPreset === "relaxed" ? block.textLetterSpacingPreset : current.typography.letterSpacingPreset;
|
|
215
220
|
current.advanced.editCopyInPanel = Boolean(block.editCopyInPanel ?? current.advanced.editCopyInPanel);
|
|
216
221
|
current.advanced.customClassName = typeof block.customClassName === "string" ? block.customClassName : current.advanced.customClassName;
|
|
217
222
|
current.advanced.hideOnMobile = Boolean(block.hideOnMobile ?? current.advanced.hideOnMobile);
|
|
218
|
-
|
|
223
|
+
const settings = mergeSettings(current, block.settings);
|
|
224
|
+
if (block.blockType === "hero") {
|
|
225
|
+
const top = settings.layout.paddingTopPt;
|
|
226
|
+
const bottom = settings.layout.paddingBottomPt;
|
|
227
|
+
const hasLegacyLinkedHeroPadding = settings.layout.linkVerticalPadding !== false && (top === null || typeof top === "undefined" || top === 30) && (bottom === null || typeof bottom === "undefined" || bottom === 30 || bottom === 20);
|
|
228
|
+
if (hasLegacyLinkedHeroPadding) {
|
|
229
|
+
settings.layout.linkVerticalPadding = false;
|
|
230
|
+
settings.layout.paddingTopPt = 30;
|
|
231
|
+
settings.layout.paddingBottomPt = 20;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return settings;
|
|
219
235
|
};
|
|
220
236
|
var v2SettingsToLegacyBlock = (blockWithSettings) => {
|
|
221
237
|
const settings = legacyBlockToV2Settings(blockWithSettings);
|
|
@@ -504,7 +520,33 @@ var alignOptions = [
|
|
|
504
520
|
{ label: "Right", value: "right" },
|
|
505
521
|
{ label: "Justify", value: "justify" }
|
|
506
522
|
];
|
|
507
|
-
var layoutFieldSet = [
|
|
523
|
+
var layoutFieldSet = [
|
|
524
|
+
{
|
|
525
|
+
group: "layout",
|
|
526
|
+
key: "settings.layout.linkVerticalPadding",
|
|
527
|
+
label: "Link Top/Bottom Padding",
|
|
528
|
+
tags: ["spacing", "padding", "vertical"],
|
|
529
|
+
type: "checkbox"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
group: "layout",
|
|
533
|
+
key: "settings.layout.paddingTopPt",
|
|
534
|
+
label: "Top Padding (pt)",
|
|
535
|
+
max: 240,
|
|
536
|
+
min: 0,
|
|
537
|
+
tags: ["spacing", "padding", "top"],
|
|
538
|
+
type: "number"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
group: "layout",
|
|
542
|
+
key: "settings.layout.paddingBottomPt",
|
|
543
|
+
label: "Bottom Padding (pt)",
|
|
544
|
+
max: 240,
|
|
545
|
+
min: 0,
|
|
546
|
+
tags: ["spacing", "padding", "bottom"],
|
|
547
|
+
type: "number"
|
|
548
|
+
}
|
|
549
|
+
];
|
|
508
550
|
var typographyFieldSet = [
|
|
509
551
|
{
|
|
510
552
|
group: "typography",
|
|
@@ -612,6 +654,7 @@ var mediaFieldSet = [
|
|
|
612
654
|
];
|
|
613
655
|
var commonInspectorGroups = [
|
|
614
656
|
{ key: "basics", label: "Basics" },
|
|
657
|
+
{ key: "layout", label: "Layout" },
|
|
615
658
|
{ key: "typography", label: "Typography" },
|
|
616
659
|
{ key: "media", label: "Media" },
|
|
617
660
|
{ key: "advanced", label: "Advanced" }
|
|
@@ -897,6 +940,37 @@ var normalizeNumber = (value, fallback) => {
|
|
|
897
940
|
}
|
|
898
941
|
return fallback;
|
|
899
942
|
};
|
|
943
|
+
var sectionPaddingPointMap = {
|
|
944
|
+
none: 0,
|
|
945
|
+
sm: 17,
|
|
946
|
+
md: 31,
|
|
947
|
+
lg: 41
|
|
948
|
+
};
|
|
949
|
+
var heroDefaultPaddingTopPt = 30;
|
|
950
|
+
var heroDefaultPaddingBottomPt = 20;
|
|
951
|
+
var normalizeSectionPaddingY = (value) => value === "none" || value === "sm" || value === "lg" ? value : "md";
|
|
952
|
+
var normalizePaddingPointValue = (value) => {
|
|
953
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
954
|
+
return Math.max(0, Math.min(240, Math.round(value)));
|
|
955
|
+
}
|
|
956
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
957
|
+
const parsed = Number(value);
|
|
958
|
+
if (Number.isFinite(parsed)) {
|
|
959
|
+
return Math.max(0, Math.min(240, Math.round(parsed)));
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
return null;
|
|
963
|
+
};
|
|
964
|
+
var getEffectiveVerticalPaddingValue = (block, key) => {
|
|
965
|
+
const explicit = normalizePaddingPointValue(getByPath(block, key));
|
|
966
|
+
if (explicit !== null) {
|
|
967
|
+
return explicit;
|
|
968
|
+
}
|
|
969
|
+
const layoutSectionPaddingY = getByPath(block, "settings.layout.sectionPaddingY");
|
|
970
|
+
const legacySectionPaddingY = block.sectionPaddingY;
|
|
971
|
+
const inherited = block.blockType === "hero" ? key === "settings.layout.paddingBottomPt" ? heroDefaultPaddingBottomPt : heroDefaultPaddingTopPt : sectionPaddingPointMap[normalizeSectionPaddingY(layoutSectionPaddingY || legacySectionPaddingY)];
|
|
972
|
+
return inherited;
|
|
973
|
+
};
|
|
900
974
|
var getRelationID = (value) => {
|
|
901
975
|
if (typeof value === "number" || typeof value === "string") {
|
|
902
976
|
return value;
|
|
@@ -925,6 +999,12 @@ var toMediaLibraryItem = (value) => {
|
|
|
925
999
|
};
|
|
926
1000
|
};
|
|
927
1001
|
var mediaLabel = (item) => item.filename || item.alt || `Media #${item.id}`;
|
|
1002
|
+
var findMediaLibraryItem = (library, id) => {
|
|
1003
|
+
if (id === null) {
|
|
1004
|
+
return null;
|
|
1005
|
+
}
|
|
1006
|
+
return library.find((item) => String(item.id) === String(id)) || null;
|
|
1007
|
+
};
|
|
928
1008
|
var groupLabel = (key) => commonInspectorGroups.find((group) => group.key === key)?.label || key;
|
|
929
1009
|
function BlockInspectorRenderer({
|
|
930
1010
|
block,
|
|
@@ -1048,8 +1128,9 @@ function BlockInspectorRenderer({
|
|
|
1048
1128
|
title: group.label,
|
|
1049
1129
|
children: /* @__PURE__ */ jsxs3("div", { className: "orion-builder-settings-field-list", children: [
|
|
1050
1130
|
group.key === "media" ? effectiveMediaSources.map((source) => {
|
|
1051
|
-
const selectedSourceMedia = toMediaLibraryItem(source.value);
|
|
1052
1131
|
const selectedSourceMediaID = getRelationID(source.value);
|
|
1132
|
+
const selectedRelationMedia = toMediaLibraryItem(source.value);
|
|
1133
|
+
const selectedSourceMedia = selectedRelationMedia ?? findMediaLibraryItem(source.library, selectedSourceMediaID);
|
|
1053
1134
|
const sourceOptions = selectedSourceMedia && !source.library.some((item) => String(item.id) === String(selectedSourceMedia.id)) ? [selectedSourceMedia, ...source.library] : source.library;
|
|
1054
1135
|
return /* @__PURE__ */ jsxs3(
|
|
1055
1136
|
"div",
|
|
@@ -1074,6 +1155,10 @@ function BlockInspectorRenderer({
|
|
|
1074
1155
|
}
|
|
1075
1156
|
)
|
|
1076
1157
|
] }),
|
|
1158
|
+
selectedSourceMedia?.alt ? /* @__PURE__ */ jsxs3("label", { className: "orion-builder-settings-label", children: [
|
|
1159
|
+
"Media Description",
|
|
1160
|
+
/* @__PURE__ */ jsx3("input", { className: "orion-builder-settings-input", readOnly: true, type: "text", value: selectedSourceMedia.alt })
|
|
1161
|
+
] }) : selectedSourceMediaID !== null ? /* @__PURE__ */ jsx3("div", { className: "orion-builder-settings-note", children: "This media item does not have a description yet." }) : null,
|
|
1077
1162
|
/* @__PURE__ */ jsx3(
|
|
1078
1163
|
"button",
|
|
1079
1164
|
{
|
|
@@ -1130,19 +1215,20 @@ function BlockInspectorRenderer({
|
|
|
1130
1215
|
}
|
|
1131
1216
|
) : null,
|
|
1132
1217
|
(hasMediaGroupContent ? group.fields.filter((field) => !(group.key === "media" && field.key.startsWith("settings.media."))) : group.fields).map((field) => {
|
|
1133
|
-
if (field.key === "settings.layout.paddingBottomPt" &&
|
|
1218
|
+
if (field.key === "settings.layout.paddingBottomPt" && getByPath(block, "settings.layout.linkVerticalPadding") !== false && block.blockType !== "hero") {
|
|
1134
1219
|
return null;
|
|
1135
1220
|
}
|
|
1136
|
-
if (field.key === "settings.layout.paddingRightPt" &&
|
|
1221
|
+
if (field.key === "settings.layout.paddingRightPt" && getByPath(block, "settings.layout.linkHorizontalPadding") !== false) {
|
|
1137
1222
|
return null;
|
|
1138
1223
|
}
|
|
1139
1224
|
const fieldValue = getByPath(block, field.key);
|
|
1140
1225
|
if (field.type === "checkbox") {
|
|
1226
|
+
const checked = field.key === "settings.layout.linkVerticalPadding" || field.key === "settings.layout.linkHorizontalPadding" ? typeof fieldValue === "boolean" ? fieldValue : block.blockType === "hero" ? false : true : Boolean(fieldValue);
|
|
1141
1227
|
return /* @__PURE__ */ jsxs3("label", { className: "orion-builder-settings-label is-checkbox", children: [
|
|
1142
1228
|
/* @__PURE__ */ jsx3(
|
|
1143
1229
|
"input",
|
|
1144
1230
|
{
|
|
1145
|
-
checked
|
|
1231
|
+
checked,
|
|
1146
1232
|
onChange: (event) => updateForKey(field.key, event.target.checked),
|
|
1147
1233
|
type: "checkbox"
|
|
1148
1234
|
}
|
|
@@ -1165,8 +1251,8 @@ function BlockInspectorRenderer({
|
|
|
1165
1251
|
] }, field.key);
|
|
1166
1252
|
}
|
|
1167
1253
|
if (field.type === "number") {
|
|
1168
|
-
const numberValue =
|
|
1169
|
-
const resolvedValue =
|
|
1254
|
+
const numberValue = normalizePaddingPointValue(fieldValue);
|
|
1255
|
+
const resolvedValue = numberValue !== null ? numberValue : field.key === "settings.layout.paddingTopPt" || field.key === "settings.layout.paddingBottomPt" ? getEffectiveVerticalPaddingValue(block, field.key) : "";
|
|
1170
1256
|
return /* @__PURE__ */ jsxs3("label", { className: "orion-builder-settings-label", children: [
|
|
1171
1257
|
field.label,
|
|
1172
1258
|
/* @__PURE__ */ jsx3(
|
|
@@ -2129,8 +2215,8 @@ function renderSimpleBlockPreview(args) {
|
|
|
2129
2215
|
getImagePresentationStyle: getImagePresentationStyle2,
|
|
2130
2216
|
index,
|
|
2131
2217
|
isBlockUploadTarget,
|
|
2132
|
-
normalizeImageCornerStyle:
|
|
2133
|
-
normalizeImageFit:
|
|
2218
|
+
normalizeImageCornerStyle: normalizeImageCornerStyle3,
|
|
2219
|
+
normalizeImageFit: normalizeImageFit3,
|
|
2134
2220
|
normalizeText: normalizeText3,
|
|
2135
2221
|
onDropAt,
|
|
2136
2222
|
renderWithSectionShell,
|
|
@@ -2314,8 +2400,8 @@ function renderSimpleBlockPreview(args) {
|
|
|
2314
2400
|
const imagePositionX = parseOptionalPercentNumber(mediaSettings.positionX ?? block?.imagePositionX);
|
|
2315
2401
|
const imagePositionY = parseOptionalPercentNumber(mediaSettings.positionY ?? block?.imagePositionY);
|
|
2316
2402
|
const imageStyle = getImagePresentationStyle2({
|
|
2317
|
-
cornerStyle:
|
|
2318
|
-
fit:
|
|
2403
|
+
cornerStyle: normalizeImageCornerStyle3(mediaSettings.cornerStyle ?? block?.imageCornerStyle),
|
|
2404
|
+
fit: normalizeImageFit3(mediaSettings.fit ?? block?.imageFit),
|
|
2319
2405
|
positionX: imagePositionX,
|
|
2320
2406
|
positionY: imagePositionY
|
|
2321
2407
|
});
|
|
@@ -2845,6 +2931,63 @@ var normalizeNumber2 = (value, fallback) => {
|
|
|
2845
2931
|
return fallback;
|
|
2846
2932
|
};
|
|
2847
2933
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2934
|
+
var getRelationID2 = (value) => {
|
|
2935
|
+
if (typeof value === "number" || typeof value === "string") {
|
|
2936
|
+
return value;
|
|
2937
|
+
}
|
|
2938
|
+
if (!isRecord5(value)) {
|
|
2939
|
+
return null;
|
|
2940
|
+
}
|
|
2941
|
+
const id = value.id;
|
|
2942
|
+
return typeof id === "number" || typeof id === "string" ? id : null;
|
|
2943
|
+
};
|
|
2944
|
+
var toMediaLibraryItem2 = (value) => {
|
|
2945
|
+
if (!isRecord5(value)) {
|
|
2946
|
+
return null;
|
|
2947
|
+
}
|
|
2948
|
+
const id = getRelationID2(value);
|
|
2949
|
+
if (id === null) {
|
|
2950
|
+
return null;
|
|
2951
|
+
}
|
|
2952
|
+
const filename = typeof value.filename === "string" ? value.filename : "";
|
|
2953
|
+
const url = typeof value.url === "string" && value.url.length > 0 ? value.url : filename ? `/api/media/file/${encodeURIComponent(filename)}` : "";
|
|
2954
|
+
return {
|
|
2955
|
+
alt: typeof value.alt === "string" ? value.alt : "",
|
|
2956
|
+
filename,
|
|
2957
|
+
id,
|
|
2958
|
+
url
|
|
2959
|
+
};
|
|
2960
|
+
};
|
|
2961
|
+
var mediaLabel2 = (item) => item.filename || item.alt || `Media #${item.id}`;
|
|
2962
|
+
var findMediaLibraryItem2 = (library, id) => {
|
|
2963
|
+
if (id === null) {
|
|
2964
|
+
return null;
|
|
2965
|
+
}
|
|
2966
|
+
return library.find((item) => String(item.id) === String(id)) || null;
|
|
2967
|
+
};
|
|
2968
|
+
var normalizeImageFit = (value) => value === "contain" ? "contain" : "cover";
|
|
2969
|
+
var normalizeImageCornerStyle = (value) => value === "square" ? "square" : "rounded";
|
|
2970
|
+
var getItemMediaSettings = (item) => {
|
|
2971
|
+
const settings = isRecord5(item.settings) ? item.settings : {};
|
|
2972
|
+
const media = isRecord5(settings.media) ? settings.media : {};
|
|
2973
|
+
return {
|
|
2974
|
+
cornerStyle: normalizeImageCornerStyle(media.cornerStyle ?? item.imageCornerStyle),
|
|
2975
|
+
fit: normalizeImageFit(media.fit ?? item.imageFit),
|
|
2976
|
+
height: (() => {
|
|
2977
|
+
const value = media.height ?? item.imageHeight;
|
|
2978
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
2979
|
+
return value;
|
|
2980
|
+
}
|
|
2981
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
2982
|
+
const parsed = Number(value);
|
|
2983
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
2984
|
+
}
|
|
2985
|
+
return null;
|
|
2986
|
+
})(),
|
|
2987
|
+
positionX: clamp(normalizeNumber2(media.positionX ?? item.imagePositionX, 50), 0, 100),
|
|
2988
|
+
positionY: clamp(normalizeNumber2(media.positionY ?? item.imagePositionY, 50), 0, 100)
|
|
2989
|
+
};
|
|
2990
|
+
};
|
|
2848
2991
|
var hasQueryMatch = (query, ...values) => {
|
|
2849
2992
|
const normalized = query.trim().toLowerCase();
|
|
2850
2993
|
if (!normalized) {
|
|
@@ -2891,18 +3034,157 @@ var bulletsToTextareaValue = (value) => {
|
|
|
2891
3034
|
return value.map((item) => isRecord5(item) && typeof item.label === "string" ? item.label.trim() : "").filter(Boolean).join("\n");
|
|
2892
3035
|
};
|
|
2893
3036
|
var textareaValueToBullets = (value) => value.split("\n").map((line) => line.trim()).filter(Boolean).map((label) => ({ label }));
|
|
3037
|
+
function ItemMediaControl({
|
|
3038
|
+
fieldName,
|
|
3039
|
+
imageURLFieldName,
|
|
3040
|
+
item,
|
|
3041
|
+
itemIndex,
|
|
3042
|
+
label,
|
|
3043
|
+
mediaLibrary,
|
|
3044
|
+
mediaLibraryError,
|
|
3045
|
+
mediaLibraryLoading,
|
|
3046
|
+
maxHeight,
|
|
3047
|
+
minHeight,
|
|
3048
|
+
onRemoveItemMedia,
|
|
3049
|
+
onSelectItemMedia,
|
|
3050
|
+
onUpdateItemField,
|
|
3051
|
+
onUpdateItemMediaPresentation,
|
|
3052
|
+
onUploadItemMedia,
|
|
3053
|
+
searchQuery,
|
|
3054
|
+
uploadDisabled,
|
|
3055
|
+
uploadLabel,
|
|
3056
|
+
uploading
|
|
3057
|
+
}) {
|
|
3058
|
+
const selectedMediaID = getRelationID2(item[fieldName]);
|
|
3059
|
+
const selectedRelationMedia = toMediaLibraryItem2(item[fieldName]);
|
|
3060
|
+
const selectedMedia = selectedRelationMedia ?? findMediaLibraryItem2(mediaLibrary, selectedMediaID);
|
|
3061
|
+
const directImageURL = normalizeText(item[imageURLFieldName]);
|
|
3062
|
+
const previewURL = selectedMedia?.url || directImageURL;
|
|
3063
|
+
const mediaSettings = getItemMediaSettings(item);
|
|
3064
|
+
const sourceOptions = selectedMedia && !mediaLibrary.some((libraryItem) => String(libraryItem.id) === String(selectedMedia.id)) ? [selectedMedia, ...mediaLibrary] : mediaLibrary;
|
|
3065
|
+
if (!hasQueryMatch(searchQuery, label, "image", "media", "photo", "picture", "url", "fit", "crop", "height")) {
|
|
3066
|
+
return null;
|
|
3067
|
+
}
|
|
3068
|
+
return /* @__PURE__ */ jsxs11("div", { className: "orion-builder-settings-item-card", style: { padding: "0.56rem" }, children: [
|
|
3069
|
+
/* @__PURE__ */ jsx12("div", { className: "orion-builder-settings-label", children: label }),
|
|
3070
|
+
previewURL ? (
|
|
3071
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
3072
|
+
/* @__PURE__ */ jsx12(
|
|
3073
|
+
"img",
|
|
3074
|
+
{
|
|
3075
|
+
alt: selectedMedia?.alt || label,
|
|
3076
|
+
src: previewURL,
|
|
3077
|
+
style: {
|
|
3078
|
+
aspectRatio: "16 / 9",
|
|
3079
|
+
border: "1px solid rgba(35, 51, 82, 0.14)",
|
|
3080
|
+
borderRadius: mediaSettings.cornerStyle === "square" ? 4 : 10,
|
|
3081
|
+
display: "block",
|
|
3082
|
+
objectFit: mediaSettings.fit,
|
|
3083
|
+
objectPosition: `${mediaSettings.positionX}% ${mediaSettings.positionY}%`,
|
|
3084
|
+
width: "100%"
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
)
|
|
3088
|
+
) : /* @__PURE__ */ jsx12("div", { className: "orion-builder-settings-empty", children: "No image selected." }),
|
|
3089
|
+
mediaLibraryLoading ? /* @__PURE__ */ jsx12("div", { className: "orion-builder-settings-note", children: "Loading media library..." }) : null,
|
|
3090
|
+
mediaLibraryError ? /* @__PURE__ */ jsx12("div", { className: "orion-builder-settings-error", children: mediaLibraryError }) : null,
|
|
3091
|
+
/* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
|
|
3092
|
+
"Media Library Image",
|
|
3093
|
+
/* @__PURE__ */ jsxs11(
|
|
3094
|
+
"select",
|
|
3095
|
+
{
|
|
3096
|
+
className: "orion-builder-settings-input",
|
|
3097
|
+
onChange: (event) => onSelectItemMedia?.(itemIndex, fieldName, event.target.value),
|
|
3098
|
+
value: selectedMediaID !== null ? String(selectedMediaID) : "",
|
|
3099
|
+
children: [
|
|
3100
|
+
/* @__PURE__ */ jsx12("option", { value: "", children: "No library image" }),
|
|
3101
|
+
sourceOptions.map((libraryItem) => /* @__PURE__ */ jsx12("option", { value: String(libraryItem.id), children: mediaLabel2(libraryItem) }, String(libraryItem.id)))
|
|
3102
|
+
]
|
|
3103
|
+
}
|
|
3104
|
+
)
|
|
3105
|
+
] }),
|
|
3106
|
+
selectedMedia?.alt ? /* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
|
|
3107
|
+
"Media Description",
|
|
3108
|
+
/* @__PURE__ */ jsx12("input", { className: "orion-builder-settings-input", readOnly: true, type: "text", value: selectedMedia.alt })
|
|
3109
|
+
] }) : selectedMediaID !== null ? /* @__PURE__ */ jsx12("div", { className: "orion-builder-settings-note", children: "This media item does not have a description yet." }) : null,
|
|
3110
|
+
/* @__PURE__ */ jsx12(
|
|
3111
|
+
"button",
|
|
3112
|
+
{
|
|
3113
|
+
className: "orion-builder-settings-inline-btn",
|
|
3114
|
+
disabled: selectedMediaID === null,
|
|
3115
|
+
onClick: () => onRemoveItemMedia?.(itemIndex, fieldName),
|
|
3116
|
+
type: "button",
|
|
3117
|
+
children: "Remove Library Image"
|
|
3118
|
+
}
|
|
3119
|
+
),
|
|
3120
|
+
/* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
|
|
3121
|
+
"Direct Image URL",
|
|
3122
|
+
/* @__PURE__ */ jsx12(
|
|
3123
|
+
"input",
|
|
3124
|
+
{
|
|
3125
|
+
className: "orion-builder-settings-input",
|
|
3126
|
+
onChange: (event) => onUpdateItemField(itemIndex, imageURLFieldName, event.target.value),
|
|
3127
|
+
type: "text",
|
|
3128
|
+
value: directImageURL
|
|
3129
|
+
}
|
|
3130
|
+
)
|
|
3131
|
+
] }),
|
|
3132
|
+
/* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
|
|
3133
|
+
uploadLabel,
|
|
3134
|
+
/* @__PURE__ */ jsx12(
|
|
3135
|
+
"input",
|
|
3136
|
+
{
|
|
3137
|
+
accept: "image/*",
|
|
3138
|
+
className: "orion-builder-settings-input",
|
|
3139
|
+
disabled: uploadDisabled,
|
|
3140
|
+
onChange: (event) => {
|
|
3141
|
+
const file = event.currentTarget.files?.[0];
|
|
3142
|
+
if (file) {
|
|
3143
|
+
onUploadItemMedia?.(itemIndex, fieldName, file);
|
|
3144
|
+
}
|
|
3145
|
+
event.currentTarget.value = "";
|
|
3146
|
+
},
|
|
3147
|
+
type: "file"
|
|
3148
|
+
}
|
|
3149
|
+
)
|
|
3150
|
+
] }),
|
|
3151
|
+
uploading ? /* @__PURE__ */ jsx12("div", { className: "orion-builder-settings-note", children: "Uploading image..." }) : null,
|
|
3152
|
+
/* @__PURE__ */ jsx12(
|
|
3153
|
+
ImageControls,
|
|
3154
|
+
{
|
|
3155
|
+
cornerStyle: mediaSettings.cornerStyle,
|
|
3156
|
+
fit: mediaSettings.fit,
|
|
3157
|
+
height: mediaSettings.height,
|
|
3158
|
+
maxHeight,
|
|
3159
|
+
minHeight,
|
|
3160
|
+
onChange: (field, value) => onUpdateItemMediaPresentation?.(itemIndex, field, value),
|
|
3161
|
+
positionX: mediaSettings.positionX,
|
|
3162
|
+
positionY: mediaSettings.positionY
|
|
3163
|
+
}
|
|
3164
|
+
)
|
|
3165
|
+
] });
|
|
3166
|
+
}
|
|
2894
3167
|
function ArrayItemsEditor({
|
|
2895
3168
|
blockType,
|
|
2896
3169
|
expandedItemIndex,
|
|
2897
3170
|
items,
|
|
3171
|
+
mediaLibrary = [],
|
|
3172
|
+
mediaLibraryError = "",
|
|
3173
|
+
mediaLibraryLoading = false,
|
|
2898
3174
|
mode,
|
|
2899
3175
|
onAddItem,
|
|
3176
|
+
onRemoveItemMedia,
|
|
2900
3177
|
onRemoveItem,
|
|
3178
|
+
onSelectItemMedia,
|
|
2901
3179
|
onToggleItem,
|
|
2902
3180
|
onUpdateItemField,
|
|
3181
|
+
onUpdateItemMediaPresentation,
|
|
2903
3182
|
onUpdateItemSetting,
|
|
3183
|
+
onUploadItemMedia,
|
|
2904
3184
|
searchQuery,
|
|
2905
|
-
showInlineCopyFields
|
|
3185
|
+
showInlineCopyFields,
|
|
3186
|
+
uploadDisabled = false,
|
|
3187
|
+
isItemMediaUploading
|
|
2906
3188
|
}) {
|
|
2907
3189
|
const config = blockConfig[blockType];
|
|
2908
3190
|
const normalizedQuery = searchQuery.trim().toLowerCase();
|
|
@@ -3052,11 +3334,30 @@ function ArrayItemsEditor({
|
|
|
3052
3334
|
}
|
|
3053
3335
|
)
|
|
3054
3336
|
] }) : null,
|
|
3055
|
-
/* @__PURE__ */
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3337
|
+
/* @__PURE__ */ jsx12(
|
|
3338
|
+
ItemMediaControl,
|
|
3339
|
+
{
|
|
3340
|
+
fieldName: "media",
|
|
3341
|
+
imageURLFieldName: "imageURL",
|
|
3342
|
+
item,
|
|
3343
|
+
itemIndex,
|
|
3344
|
+
label: "Feature Image",
|
|
3345
|
+
maxHeight: 600,
|
|
3346
|
+
mediaLibrary,
|
|
3347
|
+
mediaLibraryError,
|
|
3348
|
+
mediaLibraryLoading,
|
|
3349
|
+
minHeight: 40,
|
|
3350
|
+
onRemoveItemMedia,
|
|
3351
|
+
onSelectItemMedia,
|
|
3352
|
+
onUpdateItemField,
|
|
3353
|
+
onUpdateItemMediaPresentation,
|
|
3354
|
+
onUploadItemMedia,
|
|
3355
|
+
searchQuery: normalizedQuery,
|
|
3356
|
+
uploadDisabled,
|
|
3357
|
+
uploadLabel: "Upload Feature Image",
|
|
3358
|
+
uploading: Boolean(isItemMediaUploading?.(itemIndex, "media"))
|
|
3359
|
+
}
|
|
3360
|
+
)
|
|
3060
3361
|
] }) : null,
|
|
3061
3362
|
blockType === "logoWall" ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3062
3363
|
showInlineCopyFields ? /* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
|
|
@@ -3083,11 +3384,30 @@ function ArrayItemsEditor({
|
|
|
3083
3384
|
}
|
|
3084
3385
|
)
|
|
3085
3386
|
] }) : null,
|
|
3086
|
-
/* @__PURE__ */
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3387
|
+
/* @__PURE__ */ jsx12(
|
|
3388
|
+
ItemMediaControl,
|
|
3389
|
+
{
|
|
3390
|
+
fieldName: "media",
|
|
3391
|
+
imageURLFieldName: "imageURL",
|
|
3392
|
+
item,
|
|
3393
|
+
itemIndex,
|
|
3394
|
+
label: "Logo Image",
|
|
3395
|
+
maxHeight: 200,
|
|
3396
|
+
mediaLibrary,
|
|
3397
|
+
mediaLibraryError,
|
|
3398
|
+
mediaLibraryLoading,
|
|
3399
|
+
minHeight: 24,
|
|
3400
|
+
onRemoveItemMedia,
|
|
3401
|
+
onSelectItemMedia,
|
|
3402
|
+
onUpdateItemField,
|
|
3403
|
+
onUpdateItemMediaPresentation,
|
|
3404
|
+
onUploadItemMedia,
|
|
3405
|
+
searchQuery: normalizedQuery,
|
|
3406
|
+
uploadDisabled,
|
|
3407
|
+
uploadLabel: "Upload Logo Image",
|
|
3408
|
+
uploading: Boolean(isItemMediaUploading?.(itemIndex, "media"))
|
|
3409
|
+
}
|
|
3410
|
+
)
|
|
3091
3411
|
] }) : null,
|
|
3092
3412
|
blockType === "beforeAfter" ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3093
3413
|
showInlineCopyFields ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
@@ -3115,11 +3435,54 @@ function ArrayItemsEditor({
|
|
|
3115
3435
|
)
|
|
3116
3436
|
] })
|
|
3117
3437
|
] }) : null,
|
|
3118
|
-
/* @__PURE__ */
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3438
|
+
/* @__PURE__ */ jsx12(
|
|
3439
|
+
ItemMediaControl,
|
|
3440
|
+
{
|
|
3441
|
+
fieldName: "beforeMedia",
|
|
3442
|
+
imageURLFieldName: "beforeImageURL",
|
|
3443
|
+
item,
|
|
3444
|
+
itemIndex,
|
|
3445
|
+
label: "Before Image",
|
|
3446
|
+
maxHeight: 600,
|
|
3447
|
+
mediaLibrary,
|
|
3448
|
+
mediaLibraryError,
|
|
3449
|
+
mediaLibraryLoading,
|
|
3450
|
+
minHeight: 60,
|
|
3451
|
+
onRemoveItemMedia,
|
|
3452
|
+
onSelectItemMedia,
|
|
3453
|
+
onUpdateItemField,
|
|
3454
|
+
onUpdateItemMediaPresentation,
|
|
3455
|
+
onUploadItemMedia,
|
|
3456
|
+
searchQuery: normalizedQuery,
|
|
3457
|
+
uploadDisabled,
|
|
3458
|
+
uploadLabel: "Upload Before Image",
|
|
3459
|
+
uploading: Boolean(isItemMediaUploading?.(itemIndex, "beforeMedia"))
|
|
3460
|
+
}
|
|
3461
|
+
),
|
|
3462
|
+
/* @__PURE__ */ jsx12(
|
|
3463
|
+
ItemMediaControl,
|
|
3464
|
+
{
|
|
3465
|
+
fieldName: "afterMedia",
|
|
3466
|
+
imageURLFieldName: "afterImageURL",
|
|
3467
|
+
item,
|
|
3468
|
+
itemIndex,
|
|
3469
|
+
label: "After Image",
|
|
3470
|
+
maxHeight: 600,
|
|
3471
|
+
mediaLibrary,
|
|
3472
|
+
mediaLibraryError,
|
|
3473
|
+
mediaLibraryLoading,
|
|
3474
|
+
minHeight: 60,
|
|
3475
|
+
onRemoveItemMedia,
|
|
3476
|
+
onSelectItemMedia,
|
|
3477
|
+
onUpdateItemField,
|
|
3478
|
+
onUpdateItemMediaPresentation,
|
|
3479
|
+
onUploadItemMedia,
|
|
3480
|
+
searchQuery: normalizedQuery,
|
|
3481
|
+
uploadDisabled,
|
|
3482
|
+
uploadLabel: "Upload After Image",
|
|
3483
|
+
uploading: Boolean(isItemMediaUploading?.(itemIndex, "afterMedia"))
|
|
3484
|
+
}
|
|
3485
|
+
)
|
|
3123
3486
|
] }) : null,
|
|
3124
3487
|
blockType === "stats" ? /* @__PURE__ */ jsx12(Fragment4, { children: showInlineCopyFields ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3125
3488
|
/* @__PURE__ */ jsxs11("label", { className: "orion-builder-settings-label", children: [
|
|
@@ -3325,8 +3688,8 @@ var resolveBuilderMediumHeroHeight = (topViewportHeight) => {
|
|
|
3325
3688
|
}
|
|
3326
3689
|
return "50svh";
|
|
3327
3690
|
};
|
|
3328
|
-
var
|
|
3329
|
-
var
|
|
3691
|
+
var normalizeImageFit2 = (value) => normalizeHeroImageFit(value);
|
|
3692
|
+
var normalizeImageCornerStyle2 = (value, legacyFitValue) => normalizeHeroImageCornerStyle(value, legacyFitValue);
|
|
3330
3693
|
var positionPercent = (value, fit) => {
|
|
3331
3694
|
const resolved = fit === "cover" && (value === "left" || value === "right") ? "center" : value;
|
|
3332
3695
|
switch (resolved) {
|
|
@@ -3495,6 +3858,8 @@ var sectionPaddingMap = {
|
|
|
3495
3858
|
md: "2.6rem",
|
|
3496
3859
|
lg: "3.4rem"
|
|
3497
3860
|
};
|
|
3861
|
+
var heroDefaultPaddingTop = "30pt";
|
|
3862
|
+
var heroDefaultPaddingBottom = "20pt";
|
|
3498
3863
|
var quickAddBlockTypes = [
|
|
3499
3864
|
"hero",
|
|
3500
3865
|
"featureGrid",
|
|
@@ -3758,6 +4123,12 @@ function getThemeColorOverride(tokens, colorKey) {
|
|
|
3758
4123
|
const normalized = value.trim();
|
|
3759
4124
|
return normalized.length > 0 ? normalized : null;
|
|
3760
4125
|
}
|
|
4126
|
+
function normalizeCustomClassName(value) {
|
|
4127
|
+
if (typeof value !== "string") {
|
|
4128
|
+
return "";
|
|
4129
|
+
}
|
|
4130
|
+
return value.split(/\s+/).map((className) => className.trim()).filter(Boolean).join(" ");
|
|
4131
|
+
}
|
|
3761
4132
|
var sectionStyleFromBlock = (block, pageDefaults) => {
|
|
3762
4133
|
const settings = isRecord6(block.settings) ? block.settings : {};
|
|
3763
4134
|
const layoutSettings = isRecord6(settings.layout) ? settings.layout : {};
|
|
@@ -3843,15 +4214,15 @@ var sectionStyleFromBlock = (block, pageDefaults) => {
|
|
|
3843
4214
|
} : {},
|
|
3844
4215
|
sectionClass: `orion-builder-shell is-${pageDefaults.pageWidthDefault} padx-${resolvedSectionPaddingX}`,
|
|
3845
4216
|
sectionInnerStyle: {
|
|
3846
|
-
paddingBottom: customPaddingBottom === null ? sectionPaddingMap[sectionPaddingY] : `${customPaddingBottom}pt`,
|
|
4217
|
+
paddingBottom: customPaddingBottom === null ? block.blockType === "hero" ? heroDefaultPaddingBottom : sectionPaddingMap[sectionPaddingY] : `${customPaddingBottom}pt`,
|
|
3847
4218
|
paddingLeft: customPaddingLeft === null ? void 0 : `${customPaddingLeft}pt`,
|
|
3848
4219
|
paddingRight: customPaddingRight === null ? void 0 : `${customPaddingRight}pt`,
|
|
3849
|
-
paddingTop: customPaddingTop === null ? sectionPaddingMap[sectionPaddingY] : `${customPaddingTop}pt`
|
|
4220
|
+
paddingTop: customPaddingTop === null ? block.blockType === "hero" ? heroDefaultPaddingTop : sectionPaddingMap[sectionPaddingY] : `${customPaddingTop}pt`
|
|
3850
4221
|
},
|
|
3851
4222
|
sectionStyle: sectionMode === "color" ? { background: sectionColor } : sectionMode === "gradient" ? { background: sectionGradient } : block.blockType === "hero" ? { background: "transparent" } : {}
|
|
3852
4223
|
};
|
|
3853
4224
|
};
|
|
3854
|
-
function
|
|
4225
|
+
function getRelationID3(value) {
|
|
3855
4226
|
if (typeof value === "number" || typeof value === "string") {
|
|
3856
4227
|
return value;
|
|
3857
4228
|
}
|
|
@@ -3884,7 +4255,7 @@ function extractUploadedMedia(value) {
|
|
|
3884
4255
|
if (!candidate || typeof candidate !== "object") {
|
|
3885
4256
|
return null;
|
|
3886
4257
|
}
|
|
3887
|
-
const id =
|
|
4258
|
+
const id = getRelationID3(candidate);
|
|
3888
4259
|
if (id === null) {
|
|
3889
4260
|
return null;
|
|
3890
4261
|
}
|
|
@@ -3895,11 +4266,11 @@ function extractUploadedMedia(value) {
|
|
|
3895
4266
|
url: typeof candidate.url === "string" ? candidate.url : ""
|
|
3896
4267
|
};
|
|
3897
4268
|
}
|
|
3898
|
-
function
|
|
4269
|
+
function toMediaLibraryItem3(value) {
|
|
3899
4270
|
if (!value || typeof value !== "object") {
|
|
3900
4271
|
return null;
|
|
3901
4272
|
}
|
|
3902
|
-
const id =
|
|
4273
|
+
const id = getRelationID3(value);
|
|
3903
4274
|
if (id === null) {
|
|
3904
4275
|
return null;
|
|
3905
4276
|
}
|
|
@@ -4077,7 +4448,7 @@ function BuilderPageEditor({
|
|
|
4077
4448
|
}
|
|
4078
4449
|
const json = await response.json();
|
|
4079
4450
|
const docs = Array.isArray(json.docs) ? json.docs : [];
|
|
4080
|
-
const items = docs.map((doc2) =>
|
|
4451
|
+
const items = docs.map((doc2) => toMediaLibraryItem3(doc2)).filter((item) => item !== null);
|
|
4081
4452
|
setMediaLibrary(items);
|
|
4082
4453
|
} catch (error) {
|
|
4083
4454
|
setMediaLibraryError(error instanceof Error ? error.message : "Could not load media library.");
|
|
@@ -4431,7 +4802,7 @@ function BuilderPageEditor({
|
|
|
4431
4802
|
const nextLayout = cloneBlockLayout(layout);
|
|
4432
4803
|
const block = nextLayout[selectedIndex];
|
|
4433
4804
|
if (target.kind === "hero") {
|
|
4434
|
-
const uploadedItem =
|
|
4805
|
+
const uploadedItem = toMediaLibraryItem3(uploaded);
|
|
4435
4806
|
nextLayout[selectedIndex] = {
|
|
4436
4807
|
...block,
|
|
4437
4808
|
backgroundImageURL: uploadedItem?.url || normalizeText2(uploaded.url),
|
|
@@ -4495,13 +4866,13 @@ function BuilderPageEditor({
|
|
|
4495
4866
|
const nextBlock = { ...migrateBlockToSettingsV2(block) };
|
|
4496
4867
|
const blockType = normalizeText2(nextBlock.blockType);
|
|
4497
4868
|
if (blockType === "hero") {
|
|
4498
|
-
const mediaID =
|
|
4869
|
+
const mediaID = getRelationID3(nextBlock.media);
|
|
4499
4870
|
if (mediaID !== null) {
|
|
4500
4871
|
nextBlock.media = mediaID;
|
|
4501
4872
|
}
|
|
4502
4873
|
}
|
|
4503
4874
|
if (blockType === "media") {
|
|
4504
|
-
const imageID =
|
|
4875
|
+
const imageID = getRelationID3(nextBlock.image);
|
|
4505
4876
|
if (imageID !== null) {
|
|
4506
4877
|
nextBlock.image = imageID;
|
|
4507
4878
|
}
|
|
@@ -4513,15 +4884,15 @@ function BuilderPageEditor({
|
|
|
4513
4884
|
return rawItem;
|
|
4514
4885
|
}
|
|
4515
4886
|
const nextItem = { ...rawItem };
|
|
4516
|
-
const mediaID =
|
|
4887
|
+
const mediaID = getRelationID3(nextItem.media);
|
|
4517
4888
|
if (mediaID !== null) {
|
|
4518
4889
|
nextItem.media = mediaID;
|
|
4519
4890
|
}
|
|
4520
|
-
const beforeMediaID =
|
|
4891
|
+
const beforeMediaID = getRelationID3(nextItem.beforeMedia);
|
|
4521
4892
|
if (beforeMediaID !== null) {
|
|
4522
4893
|
nextItem.beforeMedia = beforeMediaID;
|
|
4523
4894
|
}
|
|
4524
|
-
const afterMediaID =
|
|
4895
|
+
const afterMediaID = getRelationID3(nextItem.afterMedia);
|
|
4525
4896
|
if (afterMediaID !== null) {
|
|
4526
4897
|
nextItem.afterMedia = afterMediaID;
|
|
4527
4898
|
}
|
|
@@ -4577,6 +4948,7 @@ function BuilderPageEditor({
|
|
|
4577
4948
|
const inheritProjectStyles = options?.inheritProjectStyles === true;
|
|
4578
4949
|
const shell = sectionStyleFromBlock(block, pageDefaults);
|
|
4579
4950
|
const blockSettings = isRecord6(block.settings) ? block.settings : {};
|
|
4951
|
+
const blockAdvanced = isRecord6(blockSettings.advanced) ? blockSettings.advanced : {};
|
|
4580
4952
|
const blockTypography = isRecord6(blockSettings.typography) ? blockSettings.typography : {};
|
|
4581
4953
|
const blockTheme = isRecord6(blockSettings.theme) ? blockSettings.theme : {};
|
|
4582
4954
|
const heroBackgroundColor = normalizeText2(block.backgroundColor).trim();
|
|
@@ -4584,8 +4956,9 @@ function BuilderPageEditor({
|
|
|
4584
4956
|
const heroMedia = block.blockType === "hero" ? resolveMedia(block.media) : null;
|
|
4585
4957
|
const heroHasImage = block.blockType === "hero" && Boolean(heroBackgroundImageURL || heroMedia?.url);
|
|
4586
4958
|
const heroTextColor = block.blockType === "hero" ? heroHasImage ? "#ffffff" : heroBackgroundColor ? getReadableTextColor(heroBackgroundColor, resolvedThemeTokens.colors.headingText, "#ffffff") : resolvedThemeTokens.colors.headingText : null;
|
|
4959
|
+
const bodyAlign = blockTypography.bodyAlign === "center" || blockTypography.bodyAlign === "justify" || blockTypography.bodyAlign === "right" ? blockTypography.bodyAlign : "left";
|
|
4587
4960
|
const typographyStyle = resolveTypographyStyleFromSettings({
|
|
4588
|
-
bodyAlign
|
|
4961
|
+
bodyAlign,
|
|
4589
4962
|
letterSpacingPreset: blockTypography.letterSpacingPreset === "tight" || blockTypography.letterSpacingPreset === "relaxed" ? blockTypography.letterSpacingPreset : "normal",
|
|
4590
4963
|
lineHeightPreset: blockTypography.lineHeightPreset === "tight" || blockTypography.lineHeightPreset === "relaxed" ? blockTypography.lineHeightPreset : "normal",
|
|
4591
4964
|
maxTextWidth: blockTypography.maxTextWidth === "sm" || blockTypography.maxTextWidth === "md" || blockTypography.maxTextWidth === "lg" || blockTypography.maxTextWidth === "full" ? blockTypography.maxTextWidth : "auto"
|
|
@@ -4593,14 +4966,24 @@ function BuilderPageEditor({
|
|
|
4593
4966
|
const headingAlign = blockTypography.headingAlign === "center" || blockTypography.headingAlign === "justify" || blockTypography.headingAlign === "right" ? blockTypography.headingAlign : "left";
|
|
4594
4967
|
const headingColor = getThemeColorOverride(blockTheme, "headingText") || getThemeColorOverride(pageDefaults.themePage, "headingText") || getThemeColorOverride(siteThemeTokens, "headingText") || heroTextColor || resolvedThemeTokens.colors.headingText;
|
|
4595
4968
|
const bodyColor = getThemeColorOverride(blockTheme, "bodyText") || getThemeColorOverride(pageDefaults.themePage, "bodyText") || getThemeColorOverride(siteThemeTokens, "bodyText") || heroTextColor || resolvedThemeTokens.colors.bodyText;
|
|
4596
|
-
|
|
4969
|
+
const customClassName = normalizeCustomClassName(blockAdvanced.customClassName ?? block.customClassName);
|
|
4970
|
+
const hideOnMobile = Boolean(blockAdvanced.hideOnMobile ?? block.hideOnMobile);
|
|
4971
|
+
const sectionClassName = [
|
|
4972
|
+
className,
|
|
4973
|
+
shell.sectionClass,
|
|
4974
|
+
customClassName,
|
|
4975
|
+
hideOnMobile ? "orion-builder-hide-mobile" : ""
|
|
4976
|
+
].filter(Boolean).join(" ");
|
|
4977
|
+
return /* @__PURE__ */ jsx13("section", { className: sectionClassName, style: shell.sectionStyle, children: /* @__PURE__ */ jsx13("div", { style: shell.sectionInnerStyle, children: /* @__PURE__ */ jsx13(
|
|
4597
4978
|
"div",
|
|
4598
4979
|
{
|
|
4599
4980
|
className: shell.contentClass,
|
|
4600
4981
|
style: {
|
|
4601
4982
|
...shell.contentStyle,
|
|
4983
|
+
"--orion-builder-heading-align": headingAlign,
|
|
4984
|
+
"--orion-builder-body-align": bodyAlign,
|
|
4985
|
+
"--orion-builder-actions-align": bodyAlign === "center" ? "center" : bodyAlign === "right" ? "flex-end" : "flex-start",
|
|
4602
4986
|
...inheritProjectStyles ? {} : {
|
|
4603
|
-
"--orion-builder-heading-align": headingAlign,
|
|
4604
4987
|
"--orion-builder-heading-color": headingColor,
|
|
4605
4988
|
color: bodyColor,
|
|
4606
4989
|
...typographyStyle
|
|
@@ -5087,8 +5470,8 @@ function BuilderPageEditor({
|
|
|
5087
5470
|
}
|
|
5088
5471
|
] : [];
|
|
5089
5472
|
const selectedMediaImageControls = selectedItemRecord && typeof selectedItemIndex === "number" && (selectedType === "featureGrid" || selectedType === "logoWall" || selectedType === "beforeAfter") ? {
|
|
5090
|
-
cornerStyle:
|
|
5091
|
-
fit:
|
|
5473
|
+
cornerStyle: normalizeImageCornerStyle2(selectedItemRecord.imageCornerStyle),
|
|
5474
|
+
fit: normalizeImageFit2(selectedItemRecord.imageFit),
|
|
5092
5475
|
height: (() => {
|
|
5093
5476
|
if (typeof selectedItemRecord.imageHeight === "number" && Number.isFinite(selectedItemRecord.imageHeight)) {
|
|
5094
5477
|
return selectedItemRecord.imageHeight;
|
|
@@ -5563,8 +5946,8 @@ function BuilderPageEditor({
|
|
|
5563
5946
|
const itemPositionX = parseOptionalPercentNumber2(itemRecord?.imagePositionX);
|
|
5564
5947
|
const itemPositionY = parseOptionalPercentNumber2(itemRecord?.imagePositionY);
|
|
5565
5948
|
const itemImageStyle = getImagePresentationStyle({
|
|
5566
|
-
cornerStyle:
|
|
5567
|
-
fit:
|
|
5949
|
+
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
5950
|
+
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5568
5951
|
positionX: itemPositionX,
|
|
5569
5952
|
positionY: itemPositionY
|
|
5570
5953
|
});
|
|
@@ -5681,8 +6064,8 @@ function BuilderPageEditor({
|
|
|
5681
6064
|
const itemPositionX = parseOptionalPercentNumber2(itemRecord?.imagePositionX);
|
|
5682
6065
|
const itemPositionY = parseOptionalPercentNumber2(itemRecord?.imagePositionY);
|
|
5683
6066
|
const itemImageStyle = getImagePresentationStyle({
|
|
5684
|
-
cornerStyle:
|
|
5685
|
-
fit:
|
|
6067
|
+
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
6068
|
+
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5686
6069
|
positionX: itemPositionX,
|
|
5687
6070
|
positionY: itemPositionY
|
|
5688
6071
|
});
|
|
@@ -5888,8 +6271,8 @@ function BuilderPageEditor({
|
|
|
5888
6271
|
const itemPositionX = parseOptionalPercentNumber2(itemRecord?.imagePositionX);
|
|
5889
6272
|
const itemPositionY = parseOptionalPercentNumber2(itemRecord?.imagePositionY);
|
|
5890
6273
|
const imageStyle = getImagePresentationStyle({
|
|
5891
|
-
cornerStyle:
|
|
5892
|
-
fit:
|
|
6274
|
+
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
6275
|
+
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
5893
6276
|
positionX: itemPositionX,
|
|
5894
6277
|
positionY: itemPositionY,
|
|
5895
6278
|
roundedRadius: 10
|
|
@@ -6002,8 +6385,8 @@ function BuilderPageEditor({
|
|
|
6002
6385
|
const itemPositionX = parseOptionalPercentNumber2(itemRecord?.imagePositionX);
|
|
6003
6386
|
const itemPositionY = parseOptionalPercentNumber2(itemRecord?.imagePositionY);
|
|
6004
6387
|
const imageStyle = getImagePresentationStyle({
|
|
6005
|
-
cornerStyle:
|
|
6006
|
-
fit:
|
|
6388
|
+
cornerStyle: normalizeImageCornerStyle2(itemRecord?.imageCornerStyle),
|
|
6389
|
+
fit: normalizeImageFit2(itemRecord?.imageFit),
|
|
6007
6390
|
positionX: itemPositionX,
|
|
6008
6391
|
positionY: itemPositionY
|
|
6009
6392
|
});
|
|
@@ -6309,8 +6692,8 @@ function BuilderPageEditor({
|
|
|
6309
6692
|
getImagePresentationStyle,
|
|
6310
6693
|
index,
|
|
6311
6694
|
isBlockUploadTarget,
|
|
6312
|
-
normalizeImageCornerStyle,
|
|
6313
|
-
normalizeImageFit,
|
|
6695
|
+
normalizeImageCornerStyle: normalizeImageCornerStyle2,
|
|
6696
|
+
normalizeImageFit: normalizeImageFit2,
|
|
6314
6697
|
normalizeText: normalizeText2,
|
|
6315
6698
|
onDropAt,
|
|
6316
6699
|
renderWithSectionShell,
|
|
@@ -6539,23 +6922,32 @@ function BuilderPageEditor({
|
|
|
6539
6922
|
blockType: selectedType,
|
|
6540
6923
|
expandedItemIndex,
|
|
6541
6924
|
items: selectedItems,
|
|
6925
|
+
isItemMediaUploading: isSelectedItemMediaUploading,
|
|
6926
|
+
mediaLibrary,
|
|
6927
|
+
mediaLibraryError,
|
|
6928
|
+
mediaLibraryLoading,
|
|
6542
6929
|
mode: settingsPanelMode,
|
|
6543
6930
|
onAddItem: appendDefaultItemToSelected,
|
|
6544
6931
|
onRemoveItem: (itemIndex) => removeItemFromSelected("items", itemIndex),
|
|
6932
|
+
onRemoveItemMedia: (itemIndex, fieldName) => setSelectedItemMediaFieldFromLibrary(itemIndex, fieldName, ""),
|
|
6933
|
+
onSelectItemMedia: (itemIndex, fieldName, mediaID) => setSelectedItemMediaFieldFromLibrary(itemIndex, fieldName, mediaID),
|
|
6545
6934
|
onToggleItem: toggleSelectedItem,
|
|
6546
6935
|
onUpdateItemField: (itemIndex, fieldName, value) => updateArrayItemField(selectedIndex ?? 0, "items", itemIndex, fieldName, value),
|
|
6936
|
+
onUpdateItemMediaPresentation: (itemIndex, fieldName, value) => updateArrayItemSettingField(selectedIndex ?? 0, "items", itemIndex, `media.${fieldName}`, value),
|
|
6547
6937
|
onUpdateItemSetting: (itemIndex, path, value) => updateArrayItemSettingField(selectedIndex ?? 0, "items", itemIndex, path, value),
|
|
6938
|
+
onUploadItemMedia: uploadItemMediaFromV2,
|
|
6548
6939
|
searchQuery: settingsSearchQuery,
|
|
6549
|
-
showInlineCopyFields: editCopyInPanelEnabled
|
|
6940
|
+
showInlineCopyFields: editCopyInPanelEnabled,
|
|
6941
|
+
uploadDisabled: uploadingTarget !== null
|
|
6550
6942
|
}
|
|
6551
6943
|
) : null,
|
|
6552
6944
|
/* @__PURE__ */ jsxs12("label", { style: sidebarLabelStyle, children: [
|
|
6553
|
-
"Upload Alt Text",
|
|
6945
|
+
"New Upload Alt Text",
|
|
6554
6946
|
/* @__PURE__ */ jsx13(
|
|
6555
6947
|
"input",
|
|
6556
6948
|
{
|
|
6557
6949
|
onChange: (event) => setUploadAltText(event.target.value),
|
|
6558
|
-
placeholder: "
|
|
6950
|
+
placeholder: "Used only when uploading a new image",
|
|
6559
6951
|
style: sidebarInputStyle,
|
|
6560
6952
|
type: "text",
|
|
6561
6953
|
value: uploadAltText
|