@orion-studios/payload-studio 0.5.0-beta.61 → 0.5.0-beta.63
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-app/client.js +80 -1
- package/dist/admin-app/client.mjs +80 -1
- package/dist/index.mjs +4 -4
- package/dist/nextjs/index.mjs +2 -2
- package/dist/studio-pages/builder.css +38 -0
- package/dist/studio-pages/client.js +108 -60
- package/dist/studio-pages/client.mjs +108 -60
- package/package.json +1 -1
- package/dist/{chunk-Z7NIOJNB.mjs → chunk-SBJHEKTV.mjs} +3 -3
package/dist/admin-app/client.js
CHANGED
|
@@ -851,6 +851,18 @@ function MediaUploadForm() {
|
|
|
851
851
|
// src/admin-app/components/PageEditorFrame.tsx
|
|
852
852
|
var import_react6 = require("react");
|
|
853
853
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
854
|
+
var extractPageIDFromBuilderSrc = (value) => {
|
|
855
|
+
if (!value || typeof value !== "string") {
|
|
856
|
+
return null;
|
|
857
|
+
}
|
|
858
|
+
try {
|
|
859
|
+
const url = new URL(value, "http://localhost");
|
|
860
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
861
|
+
return segments.length > 0 ? segments[segments.length - 1] || null : null;
|
|
862
|
+
} catch {
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
};
|
|
854
866
|
function PageEditorFrame({ src }) {
|
|
855
867
|
const iframeRef = (0, import_react6.useRef)(null);
|
|
856
868
|
const dirtyCheckTimerRef = (0, import_react6.useRef)(null);
|
|
@@ -864,6 +876,42 @@ function PageEditorFrame({ src }) {
|
|
|
864
876
|
const [canUndo, setCanUndo] = (0, import_react6.useState)(false);
|
|
865
877
|
const [canRedo, setCanRedo] = (0, import_react6.useState)(false);
|
|
866
878
|
const [sessionExpired, setSessionExpired] = (0, import_react6.useState)(false);
|
|
879
|
+
const [hasUnpublishedChanges, setHasUnpublishedChanges] = (0, import_react6.useState)(false);
|
|
880
|
+
const pageID = extractPageIDFromBuilderSrc(src);
|
|
881
|
+
const refreshUnpublishedChanges = async () => {
|
|
882
|
+
if (!pageID) {
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
try {
|
|
886
|
+
const response = await fetch(
|
|
887
|
+
`/api/pages/versions?depth=0&limit=25&sort=-updatedAt&where[parent][equals]=${encodeURIComponent(pageID)}`,
|
|
888
|
+
{
|
|
889
|
+
credentials: "include"
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
if (!response.ok) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const payload = await response.json();
|
|
896
|
+
const docs = Array.isArray(payload.docs) ? payload.docs : [];
|
|
897
|
+
let latestDraft = 0;
|
|
898
|
+
let latestPublished = 0;
|
|
899
|
+
docs.forEach((doc) => {
|
|
900
|
+
const status = doc.version?._status;
|
|
901
|
+
const millis = typeof doc.updatedAt === "string" ? Date.parse(doc.updatedAt) : Number.NaN;
|
|
902
|
+
if (!Number.isFinite(millis)) {
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
if (status === "draft") {
|
|
906
|
+
latestDraft = Math.max(latestDraft, millis);
|
|
907
|
+
} else if (status === "published") {
|
|
908
|
+
latestPublished = Math.max(latestPublished, millis);
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
setHasUnpublishedChanges(latestDraft > 0 && latestDraft >= latestPublished);
|
|
912
|
+
} catch {
|
|
913
|
+
}
|
|
914
|
+
};
|
|
867
915
|
const clearDirtyCheckTimer = () => {
|
|
868
916
|
if (dirtyCheckTimerRef.current) {
|
|
869
917
|
window.clearTimeout(dirtyCheckTimerRef.current);
|
|
@@ -943,6 +991,13 @@ function PageEditorFrame({ src }) {
|
|
|
943
991
|
}
|
|
944
992
|
setSaving(null);
|
|
945
993
|
if (data.ok) {
|
|
994
|
+
if (data.status === "draft") {
|
|
995
|
+
setHasUnpublishedChanges(true);
|
|
996
|
+
} else if (data.status === "published") {
|
|
997
|
+
setHasUnpublishedChanges(false);
|
|
998
|
+
} else {
|
|
999
|
+
void refreshUnpublishedChanges();
|
|
1000
|
+
}
|
|
946
1001
|
setMessage(typeof data.message === "string" ? data.message : "Saved.");
|
|
947
1002
|
setError("");
|
|
948
1003
|
setHasUnsavedChanges(false);
|
|
@@ -954,6 +1009,9 @@ function PageEditorFrame({ src }) {
|
|
|
954
1009
|
window.addEventListener("message", onMessage);
|
|
955
1010
|
return () => window.removeEventListener("message", onMessage);
|
|
956
1011
|
}, [awaitingDirtyCheck, pendingNavigationURL]);
|
|
1012
|
+
(0, import_react6.useEffect)(() => {
|
|
1013
|
+
void refreshUnpublishedChanges();
|
|
1014
|
+
}, [pageID]);
|
|
957
1015
|
(0, import_react6.useEffect)(() => {
|
|
958
1016
|
const onDocumentClick = (event) => {
|
|
959
1017
|
if (!hasUnsavedChanges) {
|
|
@@ -1050,7 +1108,28 @@ function PageEditorFrame({ src }) {
|
|
|
1050
1108
|
padding: "0.7rem 0.8rem"
|
|
1051
1109
|
},
|
|
1052
1110
|
children: [
|
|
1053
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.
|
|
1111
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", gap: "0.2rem" }, children: [
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { color: "var(--orion-admin-muted)", fontSize: "0.9rem" }, children: "Save changes to update the page layout and content." }),
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1114
|
+
"div",
|
|
1115
|
+
{
|
|
1116
|
+
style: {
|
|
1117
|
+
alignItems: "center",
|
|
1118
|
+
background: hasUnpublishedChanges ? "#fff3cd" : "#e7f7ee",
|
|
1119
|
+
border: `1px solid ${hasUnpublishedChanges ? "#f0c36d" : "#87c79e"}`,
|
|
1120
|
+
borderRadius: 999,
|
|
1121
|
+
color: hasUnpublishedChanges ? "#6a4a00" : "#0e5a2a",
|
|
1122
|
+
display: "inline-flex",
|
|
1123
|
+
fontSize: "0.75rem",
|
|
1124
|
+
fontWeight: 800,
|
|
1125
|
+
padding: "0.2rem 0.55rem",
|
|
1126
|
+
width: "fit-content"
|
|
1127
|
+
},
|
|
1128
|
+
title: hasUnpublishedChanges ? "This page has saved draft changes not published yet." : "The live page matches the latest published version.",
|
|
1129
|
+
children: hasUnpublishedChanges ? "Unpublished draft changes" : "Live is up to date"
|
|
1130
|
+
}
|
|
1131
|
+
)
|
|
1132
|
+
] }),
|
|
1054
1133
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
|
|
1055
1134
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1056
1135
|
"button",
|
|
@@ -820,6 +820,18 @@ function MediaUploadForm() {
|
|
|
820
820
|
// src/admin-app/components/PageEditorFrame.tsx
|
|
821
821
|
import { useEffect as useEffect3, useRef as useRef2, useState as useState6 } from "react";
|
|
822
822
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
823
|
+
var extractPageIDFromBuilderSrc = (value) => {
|
|
824
|
+
if (!value || typeof value !== "string") {
|
|
825
|
+
return null;
|
|
826
|
+
}
|
|
827
|
+
try {
|
|
828
|
+
const url = new URL(value, "http://localhost");
|
|
829
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
830
|
+
return segments.length > 0 ? segments[segments.length - 1] || null : null;
|
|
831
|
+
} catch {
|
|
832
|
+
return null;
|
|
833
|
+
}
|
|
834
|
+
};
|
|
823
835
|
function PageEditorFrame({ src }) {
|
|
824
836
|
const iframeRef = useRef2(null);
|
|
825
837
|
const dirtyCheckTimerRef = useRef2(null);
|
|
@@ -833,6 +845,42 @@ function PageEditorFrame({ src }) {
|
|
|
833
845
|
const [canUndo, setCanUndo] = useState6(false);
|
|
834
846
|
const [canRedo, setCanRedo] = useState6(false);
|
|
835
847
|
const [sessionExpired, setSessionExpired] = useState6(false);
|
|
848
|
+
const [hasUnpublishedChanges, setHasUnpublishedChanges] = useState6(false);
|
|
849
|
+
const pageID = extractPageIDFromBuilderSrc(src);
|
|
850
|
+
const refreshUnpublishedChanges = async () => {
|
|
851
|
+
if (!pageID) {
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
try {
|
|
855
|
+
const response = await fetch(
|
|
856
|
+
`/api/pages/versions?depth=0&limit=25&sort=-updatedAt&where[parent][equals]=${encodeURIComponent(pageID)}`,
|
|
857
|
+
{
|
|
858
|
+
credentials: "include"
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
if (!response.ok) {
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
const payload = await response.json();
|
|
865
|
+
const docs = Array.isArray(payload.docs) ? payload.docs : [];
|
|
866
|
+
let latestDraft = 0;
|
|
867
|
+
let latestPublished = 0;
|
|
868
|
+
docs.forEach((doc) => {
|
|
869
|
+
const status = doc.version?._status;
|
|
870
|
+
const millis = typeof doc.updatedAt === "string" ? Date.parse(doc.updatedAt) : Number.NaN;
|
|
871
|
+
if (!Number.isFinite(millis)) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
if (status === "draft") {
|
|
875
|
+
latestDraft = Math.max(latestDraft, millis);
|
|
876
|
+
} else if (status === "published") {
|
|
877
|
+
latestPublished = Math.max(latestPublished, millis);
|
|
878
|
+
}
|
|
879
|
+
});
|
|
880
|
+
setHasUnpublishedChanges(latestDraft > 0 && latestDraft >= latestPublished);
|
|
881
|
+
} catch {
|
|
882
|
+
}
|
|
883
|
+
};
|
|
836
884
|
const clearDirtyCheckTimer = () => {
|
|
837
885
|
if (dirtyCheckTimerRef.current) {
|
|
838
886
|
window.clearTimeout(dirtyCheckTimerRef.current);
|
|
@@ -912,6 +960,13 @@ function PageEditorFrame({ src }) {
|
|
|
912
960
|
}
|
|
913
961
|
setSaving(null);
|
|
914
962
|
if (data.ok) {
|
|
963
|
+
if (data.status === "draft") {
|
|
964
|
+
setHasUnpublishedChanges(true);
|
|
965
|
+
} else if (data.status === "published") {
|
|
966
|
+
setHasUnpublishedChanges(false);
|
|
967
|
+
} else {
|
|
968
|
+
void refreshUnpublishedChanges();
|
|
969
|
+
}
|
|
915
970
|
setMessage(typeof data.message === "string" ? data.message : "Saved.");
|
|
916
971
|
setError("");
|
|
917
972
|
setHasUnsavedChanges(false);
|
|
@@ -923,6 +978,9 @@ function PageEditorFrame({ src }) {
|
|
|
923
978
|
window.addEventListener("message", onMessage);
|
|
924
979
|
return () => window.removeEventListener("message", onMessage);
|
|
925
980
|
}, [awaitingDirtyCheck, pendingNavigationURL]);
|
|
981
|
+
useEffect3(() => {
|
|
982
|
+
void refreshUnpublishedChanges();
|
|
983
|
+
}, [pageID]);
|
|
926
984
|
useEffect3(() => {
|
|
927
985
|
const onDocumentClick = (event) => {
|
|
928
986
|
if (!hasUnsavedChanges) {
|
|
@@ -1019,7 +1077,28 @@ function PageEditorFrame({ src }) {
|
|
|
1019
1077
|
padding: "0.7rem 0.8rem"
|
|
1020
1078
|
},
|
|
1021
1079
|
children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ jsxs7("div", { style: { display: "grid", gap: "0.2rem" }, children: [
|
|
1081
|
+
/* @__PURE__ */ jsx7("div", { style: { color: "var(--orion-admin-muted)", fontSize: "0.9rem" }, children: "Save changes to update the page layout and content." }),
|
|
1082
|
+
/* @__PURE__ */ jsx7(
|
|
1083
|
+
"div",
|
|
1084
|
+
{
|
|
1085
|
+
style: {
|
|
1086
|
+
alignItems: "center",
|
|
1087
|
+
background: hasUnpublishedChanges ? "#fff3cd" : "#e7f7ee",
|
|
1088
|
+
border: `1px solid ${hasUnpublishedChanges ? "#f0c36d" : "#87c79e"}`,
|
|
1089
|
+
borderRadius: 999,
|
|
1090
|
+
color: hasUnpublishedChanges ? "#6a4a00" : "#0e5a2a",
|
|
1091
|
+
display: "inline-flex",
|
|
1092
|
+
fontSize: "0.75rem",
|
|
1093
|
+
fontWeight: 800,
|
|
1094
|
+
padding: "0.2rem 0.55rem",
|
|
1095
|
+
width: "fit-content"
|
|
1096
|
+
},
|
|
1097
|
+
title: hasUnpublishedChanges ? "This page has saved draft changes not published yet." : "The live page matches the latest published version.",
|
|
1098
|
+
children: hasUnpublishedChanges ? "Unpublished draft changes" : "Live is up to date"
|
|
1099
|
+
}
|
|
1100
|
+
)
|
|
1101
|
+
] }),
|
|
1023
1102
|
/* @__PURE__ */ jsxs7("div", { style: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
|
|
1024
1103
|
/* @__PURE__ */ jsx7(
|
|
1025
1104
|
"button",
|
package/dist/index.mjs
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
} from "./chunk-4AOYZGIY.mjs";
|
|
10
10
|
import {
|
|
11
11
|
nextjs_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SBJHEKTV.mjs";
|
|
13
|
+
import {
|
|
14
|
+
studio_exports
|
|
15
|
+
} from "./chunk-HXGAG6I7.mjs";
|
|
13
16
|
import {
|
|
14
17
|
studio_pages_exports
|
|
15
18
|
} from "./chunk-OHAGPJBM.mjs";
|
|
16
19
|
import "./chunk-SIL2J5MF.mjs";
|
|
17
|
-
import {
|
|
18
|
-
studio_exports
|
|
19
|
-
} from "./chunk-HXGAG6I7.mjs";
|
|
20
20
|
import "./chunk-6BWS3CLP.mjs";
|
|
21
21
|
export {
|
|
22
22
|
admin_exports as admin,
|
package/dist/nextjs/index.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
createPayloadClient,
|
|
5
5
|
createSiteQueries,
|
|
6
6
|
resolveMedia
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-SBJHEKTV.mjs";
|
|
8
|
+
import "../chunk-HXGAG6I7.mjs";
|
|
8
9
|
import "../chunk-OHAGPJBM.mjs";
|
|
9
10
|
import "../chunk-SIL2J5MF.mjs";
|
|
10
|
-
import "../chunk-HXGAG6I7.mjs";
|
|
11
11
|
import "../chunk-6BWS3CLP.mjs";
|
|
12
12
|
export {
|
|
13
13
|
WEBSITE_CONTENT_TAG,
|
|
@@ -180,6 +180,43 @@ h4 {
|
|
|
180
180
|
border-radius: inherit;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
.orion-builder-upload-slot {
|
|
184
|
+
position: relative;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.orion-builder-upload-overlay {
|
|
188
|
+
align-items: center;
|
|
189
|
+
background: rgba(9, 28, 21, 0.58);
|
|
190
|
+
border-radius: inherit;
|
|
191
|
+
color: #ffffff;
|
|
192
|
+
display: inline-flex;
|
|
193
|
+
font-size: 0.8rem;
|
|
194
|
+
font-weight: 700;
|
|
195
|
+
gap: 0.5rem;
|
|
196
|
+
inset: 0;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
letter-spacing: 0.01em;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
position: absolute;
|
|
201
|
+
z-index: 4;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.orion-builder-upload-spinner {
|
|
205
|
+
animation: orion-builder-upload-spin 0.9s linear infinite;
|
|
206
|
+
border: 2px solid rgba(255, 255, 255, 0.35);
|
|
207
|
+
border-radius: 999px;
|
|
208
|
+
border-top-color: #ffffff;
|
|
209
|
+
display: inline-block;
|
|
210
|
+
height: 18px;
|
|
211
|
+
width: 18px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@keyframes orion-builder-upload-spin {
|
|
215
|
+
to {
|
|
216
|
+
transform: rotate(360deg);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
183
220
|
.hero-content {
|
|
184
221
|
position: absolute;
|
|
185
222
|
inset: 0;
|
|
@@ -417,6 +454,7 @@ h4 {
|
|
|
417
454
|
border: 1px solid rgba(19, 33, 28, 0.12);
|
|
418
455
|
border-radius: 18px;
|
|
419
456
|
overflow: hidden;
|
|
457
|
+
position: relative;
|
|
420
458
|
}
|
|
421
459
|
|
|
422
460
|
.media-figure img {
|
|
@@ -507,10 +507,11 @@ var normalizeHeroHeight = (value) => {
|
|
|
507
507
|
}
|
|
508
508
|
return "sm";
|
|
509
509
|
};
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
510
|
+
var resolveBuilderMediumHeroHeight = (topViewportHeight) => {
|
|
511
|
+
if (typeof topViewportHeight === "number" && Number.isFinite(topViewportHeight) && topViewportHeight > 0) {
|
|
512
|
+
return `${Math.round(topViewportHeight * 0.5)}px`;
|
|
513
|
+
}
|
|
514
|
+
return "50svh";
|
|
514
515
|
};
|
|
515
516
|
var normalizeImageFit = (value) => normalizeHeroImageFit(value);
|
|
516
517
|
var normalizeImageCornerStyle = (value, legacyFitValue) => normalizeHeroImageCornerStyle(value, legacyFitValue);
|
|
@@ -1380,6 +1381,12 @@ function BlockFrame({
|
|
|
1380
1381
|
}
|
|
1381
1382
|
);
|
|
1382
1383
|
}
|
|
1384
|
+
function UploadOverlay({ label = "Uploading image..." }) {
|
|
1385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "orion-builder-upload-overlay", role: "status", "aria-live": "polite", children: [
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", className: "orion-builder-upload-spinner" }),
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: label })
|
|
1388
|
+
] });
|
|
1389
|
+
}
|
|
1383
1390
|
var clonePageDefaults = (value) => ({
|
|
1384
1391
|
pageWidthDefault: value.pageWidthDefault
|
|
1385
1392
|
});
|
|
@@ -1407,6 +1414,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1407
1414
|
const [sidebarOpen, setSidebarOpen] = (0, import_react.useState)(true);
|
|
1408
1415
|
const [savingStatus, setSavingStatus] = (0, import_react.useState)(null);
|
|
1409
1416
|
const [uploadingTarget, setUploadingTarget] = (0, import_react.useState)(null);
|
|
1417
|
+
const [topViewportHeight, setTopViewportHeight] = (0, import_react.useState)(null);
|
|
1410
1418
|
const [uploadError, setUploadError] = (0, import_react.useState)("");
|
|
1411
1419
|
const [uploadMessage, setUploadMessage] = (0, import_react.useState)("");
|
|
1412
1420
|
const [uploadAltText, setUploadAltText] = (0, import_react.useState)("");
|
|
@@ -1439,6 +1447,10 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1439
1447
|
...defaultSectionStyle,
|
|
1440
1448
|
...selectedBlock || {}
|
|
1441
1449
|
};
|
|
1450
|
+
const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
|
|
1451
|
+
const isFeatureGridItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "featureGridItem" && uploadingTarget.itemIndex === itemIndex;
|
|
1452
|
+
const isLogoWallItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "logoWallItem" && uploadingTarget.itemIndex === itemIndex;
|
|
1453
|
+
const isBeforeAfterItemUploading = (blockIndex, itemIndex, field) => selectedIndex === blockIndex && uploadingTarget?.kind === "beforeAfterItem" && uploadingTarget.itemIndex === itemIndex && uploadingTarget.field === field;
|
|
1442
1454
|
const resolveMediaLibraryItemFromValue = (value) => {
|
|
1443
1455
|
const direct = toMediaLibraryItem(value);
|
|
1444
1456
|
if (direct) {
|
|
@@ -1876,6 +1888,27 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1876
1888
|
}),
|
|
1877
1889
|
[layout, pageDefaults]
|
|
1878
1890
|
);
|
|
1891
|
+
(0, import_react.useEffect)(() => {
|
|
1892
|
+
const readTopViewportHeight = () => {
|
|
1893
|
+
if (typeof window === "undefined") {
|
|
1894
|
+
setTopViewportHeight(null);
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1897
|
+
try {
|
|
1898
|
+
const topHeight = window.top?.innerHeight;
|
|
1899
|
+
if (typeof topHeight === "number" && Number.isFinite(topHeight) && topHeight > 0) {
|
|
1900
|
+
setTopViewportHeight(topHeight);
|
|
1901
|
+
return;
|
|
1902
|
+
}
|
|
1903
|
+
} catch {
|
|
1904
|
+
}
|
|
1905
|
+
const ownHeight = window.innerHeight;
|
|
1906
|
+
setTopViewportHeight(typeof ownHeight === "number" && Number.isFinite(ownHeight) ? ownHeight : null);
|
|
1907
|
+
};
|
|
1908
|
+
readTopViewportHeight();
|
|
1909
|
+
window.addEventListener("resize", readTopViewportHeight);
|
|
1910
|
+
return () => window.removeEventListener("resize", readTopViewportHeight);
|
|
1911
|
+
}, []);
|
|
1879
1912
|
const snapshotKey = (snapshot) => JSON.stringify({
|
|
1880
1913
|
layout: toPersistedLayout(snapshot.layout),
|
|
1881
1914
|
pageDefaults: snapshot.pageDefaults
|
|
@@ -2344,7 +2377,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2344
2377
|
);
|
|
2345
2378
|
const backgroundImagePosition = normalizeHeroImagePosition(block.backgroundImagePosition);
|
|
2346
2379
|
const heroHeight = normalizeHeroHeight(block.heroHeight);
|
|
2347
|
-
const heroMinHeight =
|
|
2380
|
+
const heroMinHeight = heroHeight === "full" ? "100svh" : heroHeight === "md" ? resolveBuilderMediumHeroHeight(topViewportHeight) : "360px";
|
|
2348
2381
|
const heroCornerRadius = getHeroImageCornerRadius(backgroundImageCornerStyle);
|
|
2349
2382
|
const sectionBackgroundMode = normalizeText(
|
|
2350
2383
|
block.sectionBackgroundMode,
|
|
@@ -2410,7 +2443,10 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2410
2443
|
block,
|
|
2411
2444
|
"",
|
|
2412
2445
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: `hero ${variant === "centered" ? "hero-centered" : ""}`, style: heroStyle, children: [
|
|
2413
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "hero-grid", children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "hero-grid", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "orion-builder-upload-slot", children: [
|
|
2447
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "hero-media", role: "img", style: mediaStyle }),
|
|
2448
|
+
isBlockUploadTarget(index, "hero") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading hero image..." }) : null
|
|
2449
|
+
] }) }),
|
|
2414
2450
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "hero-content", children: [
|
|
2415
2451
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "kicker", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2416
2452
|
InlineText,
|
|
@@ -2535,26 +2571,29 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2535
2571
|
},
|
|
2536
2572
|
style: isItemSelected ? { outline: "2px solid rgba(255, 255, 255, 0.72)", outlineOffset: 2 } : void 0,
|
|
2537
2573
|
children: [
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2574
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "orion-builder-upload-slot", children: [
|
|
2575
|
+
itemMedia?.url ? (
|
|
2576
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2578
|
+
"img",
|
|
2579
|
+
{
|
|
2580
|
+
alt: itemMedia.alt || normalizeText(itemRecord?.title, "Feature image"),
|
|
2581
|
+
className: "feature-item-media",
|
|
2582
|
+
src: itemMedia.url,
|
|
2583
|
+
style: { ...itemImageStyle, height: itemImageHeight }
|
|
2584
|
+
}
|
|
2585
|
+
)
|
|
2586
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "feature-icon", children: iconType === "lucide" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: iconLucide || "Icon" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2587
|
+
InlineText,
|
|
2542
2588
|
{
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2589
|
+
as: "span",
|
|
2590
|
+
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2591
|
+
placeholder: "01",
|
|
2592
|
+
value: iconBadge
|
|
2547
2593
|
}
|
|
2548
|
-
)
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
{
|
|
2552
|
-
as: "span",
|
|
2553
|
-
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2554
|
-
placeholder: "01",
|
|
2555
|
-
value: iconBadge
|
|
2556
|
-
}
|
|
2557
|
-
) }),
|
|
2594
|
+
) }),
|
|
2595
|
+
isFeatureGridItemUploading(index, itemIndex) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading image..." }) : null
|
|
2596
|
+
] }),
|
|
2558
2597
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2559
2598
|
InlineText,
|
|
2560
2599
|
{
|
|
@@ -2647,26 +2686,29 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2647
2686
|
},
|
|
2648
2687
|
style: isItemSelected ? { outline: "2px solid rgba(15, 125, 82, 0.55)", outlineOffset: 3 } : void 0,
|
|
2649
2688
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "service-body", children: [
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2689
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "orion-builder-upload-slot", children: [
|
|
2690
|
+
itemMedia?.url ? (
|
|
2691
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2692
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2693
|
+
"img",
|
|
2694
|
+
{
|
|
2695
|
+
alt: itemMedia.alt || normalizeText(itemRecord?.title, "Feature image"),
|
|
2696
|
+
className: "feature-item-media feature-item-media-card",
|
|
2697
|
+
src: itemMedia.url,
|
|
2698
|
+
style: { ...itemImageStyle, height: itemImageHeight }
|
|
2699
|
+
}
|
|
2700
|
+
)
|
|
2701
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "service-tag", children: iconType === "lucide" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: iconLucide || "Icon" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2702
|
+
InlineText,
|
|
2654
2703
|
{
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2704
|
+
as: "span",
|
|
2705
|
+
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2706
|
+
placeholder: "01",
|
|
2707
|
+
value: iconBadge
|
|
2659
2708
|
}
|
|
2660
|
-
)
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
{
|
|
2664
|
-
as: "span",
|
|
2665
|
-
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2666
|
-
placeholder: "01",
|
|
2667
|
-
value: iconBadge
|
|
2668
|
-
}
|
|
2669
|
-
) }),
|
|
2709
|
+
) }),
|
|
2710
|
+
isFeatureGridItemUploading(index, itemIndex) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading image..." }) : null
|
|
2711
|
+
] }),
|
|
2670
2712
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2671
2713
|
InlineText,
|
|
2672
2714
|
{
|
|
@@ -2848,26 +2890,29 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2848
2890
|
openSelectedItem(itemIndex);
|
|
2849
2891
|
},
|
|
2850
2892
|
style: isItemSelected ? { outline: "2px solid rgba(15, 125, 82, 0.55)", outlineOffset: 3 } : void 0,
|
|
2851
|
-
children:
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2893
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "orion-builder-upload-slot", children: [
|
|
2894
|
+
media?.url ? (
|
|
2895
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2897
|
+
"img",
|
|
2898
|
+
{
|
|
2899
|
+
alt: media.alt || normalizeText(itemRecord?.name, "Logo"),
|
|
2900
|
+
className: "orion-logo-wall-image",
|
|
2901
|
+
src: media.url,
|
|
2902
|
+
style: { ...imageStyle, height: imageHeight }
|
|
2903
|
+
}
|
|
2904
|
+
)
|
|
2905
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2906
|
+
InlineText,
|
|
2855
2907
|
{
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2908
|
+
as: "span",
|
|
2909
|
+
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "name", value),
|
|
2910
|
+
placeholder: "Partner name",
|
|
2911
|
+
value: normalizeText(itemRecord?.name)
|
|
2860
2912
|
}
|
|
2861
|
-
)
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
{
|
|
2865
|
-
as: "span",
|
|
2866
|
-
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "name", value),
|
|
2867
|
-
placeholder: "Partner name",
|
|
2868
|
-
value: normalizeText(itemRecord?.name)
|
|
2869
|
-
}
|
|
2870
|
-
)
|
|
2913
|
+
),
|
|
2914
|
+
isLogoWallItemUploading(index, itemIndex) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading logo..." }) : null
|
|
2915
|
+
] })
|
|
2871
2916
|
},
|
|
2872
2917
|
`logo-${itemIndex}`
|
|
2873
2918
|
);
|
|
@@ -2965,6 +3010,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2965
3010
|
}
|
|
2966
3011
|
)
|
|
2967
3012
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "orion-before-after-placeholder", style: { height: imageHeight }, children: "Before" }),
|
|
3013
|
+
isBeforeAfterItemUploading(index, itemIndex, "beforeMedia") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading before image..." }) : null,
|
|
2968
3014
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("figcaption", { children: "Before" })
|
|
2969
3015
|
] }),
|
|
2970
3016
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", { children: [
|
|
@@ -2979,6 +3025,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2979
3025
|
}
|
|
2980
3026
|
)
|
|
2981
3027
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "orion-before-after-placeholder", style: { height: imageHeight }, children: "After" }),
|
|
3028
|
+
isBeforeAfterItemUploading(index, itemIndex, "afterMedia") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading after image..." }) : null,
|
|
2982
3029
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("figcaption", { children: "After" })
|
|
2983
3030
|
] })
|
|
2984
3031
|
] }),
|
|
@@ -3400,6 +3447,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
3400
3447
|
children: "No image selected"
|
|
3401
3448
|
}
|
|
3402
3449
|
),
|
|
3450
|
+
isBlockUploadTarget(index, "media") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UploadOverlay, { label: "Uploading image..." }) : null,
|
|
3403
3451
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("figcaption", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3404
3452
|
InlineText,
|
|
3405
3453
|
{
|
|
@@ -479,10 +479,11 @@ var normalizeHeroHeight = (value) => {
|
|
|
479
479
|
}
|
|
480
480
|
return "sm";
|
|
481
481
|
};
|
|
482
|
-
var
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
482
|
+
var resolveBuilderMediumHeroHeight = (topViewportHeight) => {
|
|
483
|
+
if (typeof topViewportHeight === "number" && Number.isFinite(topViewportHeight) && topViewportHeight > 0) {
|
|
484
|
+
return `${Math.round(topViewportHeight * 0.5)}px`;
|
|
485
|
+
}
|
|
486
|
+
return "50svh";
|
|
486
487
|
};
|
|
487
488
|
var normalizeImageFit = (value) => normalizeHeroImageFit(value);
|
|
488
489
|
var normalizeImageCornerStyle = (value, legacyFitValue) => normalizeHeroImageCornerStyle(value, legacyFitValue);
|
|
@@ -1352,6 +1353,12 @@ function BlockFrame({
|
|
|
1352
1353
|
}
|
|
1353
1354
|
);
|
|
1354
1355
|
}
|
|
1356
|
+
function UploadOverlay({ label = "Uploading image..." }) {
|
|
1357
|
+
return /* @__PURE__ */ jsxs("div", { className: "orion-builder-upload-overlay", role: "status", "aria-live": "polite", children: [
|
|
1358
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "orion-builder-upload-spinner" }),
|
|
1359
|
+
/* @__PURE__ */ jsx("span", { children: label })
|
|
1360
|
+
] });
|
|
1361
|
+
}
|
|
1355
1362
|
var clonePageDefaults = (value) => ({
|
|
1356
1363
|
pageWidthDefault: value.pageWidthDefault
|
|
1357
1364
|
});
|
|
@@ -1379,6 +1386,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1379
1386
|
const [sidebarOpen, setSidebarOpen] = useState(true);
|
|
1380
1387
|
const [savingStatus, setSavingStatus] = useState(null);
|
|
1381
1388
|
const [uploadingTarget, setUploadingTarget] = useState(null);
|
|
1389
|
+
const [topViewportHeight, setTopViewportHeight] = useState(null);
|
|
1382
1390
|
const [uploadError, setUploadError] = useState("");
|
|
1383
1391
|
const [uploadMessage, setUploadMessage] = useState("");
|
|
1384
1392
|
const [uploadAltText, setUploadAltText] = useState("");
|
|
@@ -1411,6 +1419,10 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1411
1419
|
...defaultSectionStyle,
|
|
1412
1420
|
...selectedBlock || {}
|
|
1413
1421
|
};
|
|
1422
|
+
const isBlockUploadTarget = (blockIndex, kind) => selectedIndex === blockIndex && uploadingTarget?.kind === kind;
|
|
1423
|
+
const isFeatureGridItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "featureGridItem" && uploadingTarget.itemIndex === itemIndex;
|
|
1424
|
+
const isLogoWallItemUploading = (blockIndex, itemIndex) => selectedIndex === blockIndex && uploadingTarget?.kind === "logoWallItem" && uploadingTarget.itemIndex === itemIndex;
|
|
1425
|
+
const isBeforeAfterItemUploading = (blockIndex, itemIndex, field) => selectedIndex === blockIndex && uploadingTarget?.kind === "beforeAfterItem" && uploadingTarget.itemIndex === itemIndex && uploadingTarget.field === field;
|
|
1414
1426
|
const resolveMediaLibraryItemFromValue = (value) => {
|
|
1415
1427
|
const direct = toMediaLibraryItem(value);
|
|
1416
1428
|
if (direct) {
|
|
@@ -1848,6 +1860,27 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
1848
1860
|
}),
|
|
1849
1861
|
[layout, pageDefaults]
|
|
1850
1862
|
);
|
|
1863
|
+
useEffect(() => {
|
|
1864
|
+
const readTopViewportHeight = () => {
|
|
1865
|
+
if (typeof window === "undefined") {
|
|
1866
|
+
setTopViewportHeight(null);
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1869
|
+
try {
|
|
1870
|
+
const topHeight = window.top?.innerHeight;
|
|
1871
|
+
if (typeof topHeight === "number" && Number.isFinite(topHeight) && topHeight > 0) {
|
|
1872
|
+
setTopViewportHeight(topHeight);
|
|
1873
|
+
return;
|
|
1874
|
+
}
|
|
1875
|
+
} catch {
|
|
1876
|
+
}
|
|
1877
|
+
const ownHeight = window.innerHeight;
|
|
1878
|
+
setTopViewportHeight(typeof ownHeight === "number" && Number.isFinite(ownHeight) ? ownHeight : null);
|
|
1879
|
+
};
|
|
1880
|
+
readTopViewportHeight();
|
|
1881
|
+
window.addEventListener("resize", readTopViewportHeight);
|
|
1882
|
+
return () => window.removeEventListener("resize", readTopViewportHeight);
|
|
1883
|
+
}, []);
|
|
1851
1884
|
const snapshotKey = (snapshot) => JSON.stringify({
|
|
1852
1885
|
layout: toPersistedLayout(snapshot.layout),
|
|
1853
1886
|
pageDefaults: snapshot.pageDefaults
|
|
@@ -2316,7 +2349,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2316
2349
|
);
|
|
2317
2350
|
const backgroundImagePosition = normalizeHeroImagePosition(block.backgroundImagePosition);
|
|
2318
2351
|
const heroHeight = normalizeHeroHeight(block.heroHeight);
|
|
2319
|
-
const heroMinHeight =
|
|
2352
|
+
const heroMinHeight = heroHeight === "full" ? "100svh" : heroHeight === "md" ? resolveBuilderMediumHeroHeight(topViewportHeight) : "360px";
|
|
2320
2353
|
const heroCornerRadius = getHeroImageCornerRadius(backgroundImageCornerStyle);
|
|
2321
2354
|
const sectionBackgroundMode = normalizeText(
|
|
2322
2355
|
block.sectionBackgroundMode,
|
|
@@ -2382,7 +2415,10 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2382
2415
|
block,
|
|
2383
2416
|
"",
|
|
2384
2417
|
/* @__PURE__ */ jsxs("section", { className: `hero ${variant === "centered" ? "hero-centered" : ""}`, style: heroStyle, children: [
|
|
2385
|
-
/* @__PURE__ */ jsx("div", { className: "hero-grid", children: /* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsx("div", { className: "hero-grid", children: /* @__PURE__ */ jsxs("div", { className: "orion-builder-upload-slot", children: [
|
|
2419
|
+
/* @__PURE__ */ jsx("div", { className: "hero-media", role: "img", style: mediaStyle }),
|
|
2420
|
+
isBlockUploadTarget(index, "hero") ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading hero image..." }) : null
|
|
2421
|
+
] }) }),
|
|
2386
2422
|
/* @__PURE__ */ jsxs("div", { className: "hero-content", children: [
|
|
2387
2423
|
/* @__PURE__ */ jsx("div", { className: "kicker", children: /* @__PURE__ */ jsx(
|
|
2388
2424
|
InlineText,
|
|
@@ -2507,26 +2543,29 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2507
2543
|
},
|
|
2508
2544
|
style: isItemSelected ? { outline: "2px solid rgba(255, 255, 255, 0.72)", outlineOffset: 2 } : void 0,
|
|
2509
2545
|
children: [
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2546
|
+
/* @__PURE__ */ jsxs("div", { className: "orion-builder-upload-slot", children: [
|
|
2547
|
+
itemMedia?.url ? (
|
|
2548
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2549
|
+
/* @__PURE__ */ jsx(
|
|
2550
|
+
"img",
|
|
2551
|
+
{
|
|
2552
|
+
alt: itemMedia.alt || normalizeText(itemRecord?.title, "Feature image"),
|
|
2553
|
+
className: "feature-item-media",
|
|
2554
|
+
src: itemMedia.url,
|
|
2555
|
+
style: { ...itemImageStyle, height: itemImageHeight }
|
|
2556
|
+
}
|
|
2557
|
+
)
|
|
2558
|
+
) : /* @__PURE__ */ jsx("div", { className: "feature-icon", children: iconType === "lucide" ? /* @__PURE__ */ jsx("span", { children: iconLucide || "Icon" }) : /* @__PURE__ */ jsx(
|
|
2559
|
+
InlineText,
|
|
2514
2560
|
{
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2561
|
+
as: "span",
|
|
2562
|
+
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2563
|
+
placeholder: "01",
|
|
2564
|
+
value: iconBadge
|
|
2519
2565
|
}
|
|
2520
|
-
)
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
{
|
|
2524
|
-
as: "span",
|
|
2525
|
-
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2526
|
-
placeholder: "01",
|
|
2527
|
-
value: iconBadge
|
|
2528
|
-
}
|
|
2529
|
-
) }),
|
|
2566
|
+
) }),
|
|
2567
|
+
isFeatureGridItemUploading(index, itemIndex) ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading image..." }) : null
|
|
2568
|
+
] }),
|
|
2530
2569
|
/* @__PURE__ */ jsx(
|
|
2531
2570
|
InlineText,
|
|
2532
2571
|
{
|
|
@@ -2619,26 +2658,29 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2619
2658
|
},
|
|
2620
2659
|
style: isItemSelected ? { outline: "2px solid rgba(15, 125, 82, 0.55)", outlineOffset: 3 } : void 0,
|
|
2621
2660
|
children: /* @__PURE__ */ jsxs("div", { className: "service-body", children: [
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2661
|
+
/* @__PURE__ */ jsxs("div", { className: "orion-builder-upload-slot", children: [
|
|
2662
|
+
itemMedia?.url ? (
|
|
2663
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2664
|
+
/* @__PURE__ */ jsx(
|
|
2665
|
+
"img",
|
|
2666
|
+
{
|
|
2667
|
+
alt: itemMedia.alt || normalizeText(itemRecord?.title, "Feature image"),
|
|
2668
|
+
className: "feature-item-media feature-item-media-card",
|
|
2669
|
+
src: itemMedia.url,
|
|
2670
|
+
style: { ...itemImageStyle, height: itemImageHeight }
|
|
2671
|
+
}
|
|
2672
|
+
)
|
|
2673
|
+
) : /* @__PURE__ */ jsx("div", { className: "service-tag", children: iconType === "lucide" ? /* @__PURE__ */ jsx("span", { children: iconLucide || "Icon" }) : /* @__PURE__ */ jsx(
|
|
2674
|
+
InlineText,
|
|
2626
2675
|
{
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2676
|
+
as: "span",
|
|
2677
|
+
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2678
|
+
placeholder: "01",
|
|
2679
|
+
value: iconBadge
|
|
2631
2680
|
}
|
|
2632
|
-
)
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
{
|
|
2636
|
-
as: "span",
|
|
2637
|
-
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "icon", value),
|
|
2638
|
-
placeholder: "01",
|
|
2639
|
-
value: iconBadge
|
|
2640
|
-
}
|
|
2641
|
-
) }),
|
|
2681
|
+
) }),
|
|
2682
|
+
isFeatureGridItemUploading(index, itemIndex) ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading image..." }) : null
|
|
2683
|
+
] }),
|
|
2642
2684
|
/* @__PURE__ */ jsx(
|
|
2643
2685
|
InlineText,
|
|
2644
2686
|
{
|
|
@@ -2820,26 +2862,29 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2820
2862
|
openSelectedItem(itemIndex);
|
|
2821
2863
|
},
|
|
2822
2864
|
style: isItemSelected ? { outline: "2px solid rgba(15, 125, 82, 0.55)", outlineOffset: 3 } : void 0,
|
|
2823
|
-
children:
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2865
|
+
children: /* @__PURE__ */ jsxs("div", { className: "orion-builder-upload-slot", children: [
|
|
2866
|
+
media?.url ? (
|
|
2867
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
2868
|
+
/* @__PURE__ */ jsx(
|
|
2869
|
+
"img",
|
|
2870
|
+
{
|
|
2871
|
+
alt: media.alt || normalizeText(itemRecord?.name, "Logo"),
|
|
2872
|
+
className: "orion-logo-wall-image",
|
|
2873
|
+
src: media.url,
|
|
2874
|
+
style: { ...imageStyle, height: imageHeight }
|
|
2875
|
+
}
|
|
2876
|
+
)
|
|
2877
|
+
) : /* @__PURE__ */ jsx(
|
|
2878
|
+
InlineText,
|
|
2827
2879
|
{
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2880
|
+
as: "span",
|
|
2881
|
+
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "name", value),
|
|
2882
|
+
placeholder: "Partner name",
|
|
2883
|
+
value: normalizeText(itemRecord?.name)
|
|
2832
2884
|
}
|
|
2833
|
-
)
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
{
|
|
2837
|
-
as: "span",
|
|
2838
|
-
onCommit: (value) => updateArrayItemField(index, "items", itemIndex, "name", value),
|
|
2839
|
-
placeholder: "Partner name",
|
|
2840
|
-
value: normalizeText(itemRecord?.name)
|
|
2841
|
-
}
|
|
2842
|
-
)
|
|
2885
|
+
),
|
|
2886
|
+
isLogoWallItemUploading(index, itemIndex) ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading logo..." }) : null
|
|
2887
|
+
] })
|
|
2843
2888
|
},
|
|
2844
2889
|
`logo-${itemIndex}`
|
|
2845
2890
|
);
|
|
@@ -2937,6 +2982,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2937
2982
|
}
|
|
2938
2983
|
)
|
|
2939
2984
|
) : /* @__PURE__ */ jsx("div", { className: "orion-before-after-placeholder", style: { height: imageHeight }, children: "Before" }),
|
|
2985
|
+
isBeforeAfterItemUploading(index, itemIndex, "beforeMedia") ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading before image..." }) : null,
|
|
2940
2986
|
/* @__PURE__ */ jsx("figcaption", { children: "Before" })
|
|
2941
2987
|
] }),
|
|
2942
2988
|
/* @__PURE__ */ jsxs("figure", { children: [
|
|
@@ -2951,6 +2997,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
2951
2997
|
}
|
|
2952
2998
|
)
|
|
2953
2999
|
) : /* @__PURE__ */ jsx("div", { className: "orion-before-after-placeholder", style: { height: imageHeight }, children: "After" }),
|
|
3000
|
+
isBeforeAfterItemUploading(index, itemIndex, "afterMedia") ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading after image..." }) : null,
|
|
2954
3001
|
/* @__PURE__ */ jsx("figcaption", { children: "After" })
|
|
2955
3002
|
] })
|
|
2956
3003
|
] }),
|
|
@@ -3372,6 +3419,7 @@ function BuilderPageEditor({ initialDoc, pageID }) {
|
|
|
3372
3419
|
children: "No image selected"
|
|
3373
3420
|
}
|
|
3374
3421
|
),
|
|
3422
|
+
isBlockUploadTarget(index, "media") ? /* @__PURE__ */ jsx(UploadOverlay, { label: "Uploading image..." }) : null,
|
|
3375
3423
|
/* @__PURE__ */ jsx("figcaption", { children: /* @__PURE__ */ jsx(
|
|
3376
3424
|
InlineText,
|
|
3377
3425
|
{
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
studioDocumentToLayout
|
|
3
|
-
} from "./chunk-OHAGPJBM.mjs";
|
|
4
1
|
import {
|
|
5
2
|
assertStudioDocumentV1
|
|
6
3
|
} from "./chunk-HXGAG6I7.mjs";
|
|
4
|
+
import {
|
|
5
|
+
studioDocumentToLayout
|
|
6
|
+
} from "./chunk-OHAGPJBM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./chunk-6BWS3CLP.mjs";
|