@orion-studios/payload-studio 0.5.0-beta.95 → 0.5.0-beta.96
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-SHC2KLT3.mjs → chunk-C4J35SPJ.mjs} +2 -1
- package/dist/{chunk-H3UCUO3C.mjs → chunk-MH25M24L.mjs} +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +5 -5
- package/dist/nextjs/index.js +2 -1
- package/dist/nextjs/index.mjs +2 -2
- package/dist/studio-pages/client.js +80 -66
- package/dist/studio-pages/client.mjs +67 -53
- package/dist/studio-pages/index.js +2 -1
- package/dist/studio-pages/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -322,9 +322,10 @@ var resolveBuilderThemeTokens = (layers) => {
|
|
|
322
322
|
};
|
|
323
323
|
|
|
324
324
|
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
325
|
-
import { useMemo, useState } from "react";
|
|
325
|
+
import { useMemo, useState as useState2 } from "react";
|
|
326
326
|
|
|
327
327
|
// src/studio-pages/builder/ui/Accordion.tsx
|
|
328
|
+
import { useEffect, useState } from "react";
|
|
328
329
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
329
330
|
|
|
330
331
|
// src/studio-pages/builder/ui/ImageControls.tsx
|
package/dist/index.js
CHANGED
|
@@ -3012,9 +3012,10 @@ var resolveBuilderThemeTokens = (layers) => {
|
|
|
3012
3012
|
};
|
|
3013
3013
|
|
|
3014
3014
|
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
3015
|
-
var
|
|
3015
|
+
var import_react2 = require("react");
|
|
3016
3016
|
|
|
3017
3017
|
// src/studio-pages/builder/ui/Accordion.tsx
|
|
3018
|
+
var import_react = require("react");
|
|
3018
3019
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3019
3020
|
|
|
3020
3021
|
// src/studio-pages/builder/ui/ImageControls.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
admin_app_exports
|
|
6
6
|
} from "./chunk-XVH5SCBD.mjs";
|
|
7
|
-
import {
|
|
8
|
-
blocks_exports
|
|
9
|
-
} from "./chunk-XK3K5GRP.mjs";
|
|
10
7
|
import {
|
|
11
8
|
nextjs_exports
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MH25M24L.mjs";
|
|
13
10
|
import {
|
|
14
11
|
studio_exports
|
|
15
12
|
} from "./chunk-ADIIWIYL.mjs";
|
|
16
13
|
import {
|
|
17
14
|
studio_pages_exports
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C4J35SPJ.mjs";
|
|
16
|
+
import {
|
|
17
|
+
blocks_exports
|
|
18
|
+
} from "./chunk-XK3K5GRP.mjs";
|
|
19
19
|
import "./chunk-SIL2J5MF.mjs";
|
|
20
20
|
import "./chunk-6BWS3CLP.mjs";
|
|
21
21
|
export {
|
package/dist/nextjs/index.js
CHANGED
|
@@ -378,9 +378,10 @@ var migrateBlockToSettingsV2 = (block) => {
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
381
|
-
var
|
|
381
|
+
var import_react2 = require("react");
|
|
382
382
|
|
|
383
383
|
// src/studio-pages/builder/ui/Accordion.tsx
|
|
384
|
+
var import_react = require("react");
|
|
384
385
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
385
386
|
|
|
386
387
|
// src/studio-pages/builder/ui/ImageControls.tsx
|
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-MH25M24L.mjs";
|
|
8
8
|
import "../chunk-ADIIWIYL.mjs";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-C4J35SPJ.mjs";
|
|
10
10
|
import "../chunk-SIL2J5MF.mjs";
|
|
11
11
|
import "../chunk-6BWS3CLP.mjs";
|
|
12
12
|
export {
|
|
@@ -32,7 +32,7 @@ __export(client_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(client_exports);
|
|
33
33
|
|
|
34
34
|
// src/studio-pages/builder/BuilderPageEditor.tsx
|
|
35
|
-
var
|
|
35
|
+
var import_react6 = require("react");
|
|
36
36
|
|
|
37
37
|
// src/blocks/blocks/sectionStyleFields.ts
|
|
38
38
|
var sectionStyleDefaults = {
|
|
@@ -369,19 +369,33 @@ var resolveTypographyStyleFromSettings = (settings) => {
|
|
|
369
369
|
};
|
|
370
370
|
|
|
371
371
|
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
372
|
-
var
|
|
372
|
+
var import_react2 = require("react");
|
|
373
373
|
|
|
374
374
|
// src/studio-pages/builder/ui/Accordion.tsx
|
|
375
|
+
var import_react = require("react");
|
|
375
376
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
376
377
|
function Accordion({ children, defaultOpen = false, onToggle, open, subtitle, title }) {
|
|
377
378
|
const controlled = typeof open === "boolean";
|
|
378
|
-
const
|
|
379
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react.useState)(defaultOpen);
|
|
380
|
+
(0, import_react.useEffect)(() => {
|
|
381
|
+
if (!controlled) {
|
|
382
|
+
setUncontrolledOpen(defaultOpen);
|
|
383
|
+
}
|
|
384
|
+
}, [controlled, defaultOpen]);
|
|
385
|
+
const isOpen = controlled ? open : uncontrolledOpen;
|
|
386
|
+
const handleToggle = () => {
|
|
387
|
+
const next = !isOpen;
|
|
388
|
+
if (!controlled) {
|
|
389
|
+
setUncontrolledOpen(next);
|
|
390
|
+
}
|
|
391
|
+
onToggle?.(next);
|
|
392
|
+
};
|
|
379
393
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { className: "orion-builder-settings-group", children: [
|
|
380
394
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
381
395
|
"button",
|
|
382
396
|
{
|
|
383
397
|
className: "orion-builder-settings-group-header",
|
|
384
|
-
onClick:
|
|
398
|
+
onClick: handleToggle,
|
|
385
399
|
type: "button",
|
|
386
400
|
children: [
|
|
387
401
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "orion-builder-settings-group-title-wrap", children: [
|
|
@@ -1038,7 +1052,7 @@ function BlockInspectorRenderer({
|
|
|
1038
1052
|
onUpdateSetting,
|
|
1039
1053
|
searchQuery
|
|
1040
1054
|
}) {
|
|
1041
|
-
const [expandedGroups, setExpandedGroups] = (0,
|
|
1055
|
+
const [expandedGroups, setExpandedGroups] = (0, import_react2.useState)({
|
|
1042
1056
|
advanced: false,
|
|
1043
1057
|
basics: false,
|
|
1044
1058
|
layout: false,
|
|
@@ -1048,14 +1062,14 @@ function BlockInspectorRenderer({
|
|
|
1048
1062
|
});
|
|
1049
1063
|
const definition = inspectorDefinitionByBlockType[blockType];
|
|
1050
1064
|
const fields = definition?.fields || [];
|
|
1051
|
-
const resolvedFields = (0,
|
|
1065
|
+
const resolvedFields = (0, import_react2.useMemo)(() => {
|
|
1052
1066
|
return filterInspectorFields(fields, {
|
|
1053
1067
|
editCopyInPanel: Boolean(getByPath(block, "settings.advanced.editCopyInPanel")),
|
|
1054
1068
|
mode,
|
|
1055
1069
|
query: searchQuery
|
|
1056
1070
|
});
|
|
1057
1071
|
}, [block, fields, mode, searchQuery]);
|
|
1058
|
-
const groups = (0,
|
|
1072
|
+
const groups = (0, import_react2.useMemo)(() => {
|
|
1059
1073
|
const baseGroups = commonInspectorGroups.map((group) => ({
|
|
1060
1074
|
key: group.key,
|
|
1061
1075
|
label: group.label,
|
|
@@ -1664,15 +1678,15 @@ async function optimizeImageForUpload(file) {
|
|
|
1664
1678
|
}
|
|
1665
1679
|
|
|
1666
1680
|
// src/studio-pages/builder/hooks/usePersistentSidebarPanel.ts
|
|
1667
|
-
var
|
|
1681
|
+
var import_react3 = require("react");
|
|
1668
1682
|
|
|
1669
1683
|
// src/studio-pages/builder/sidebar/types.ts
|
|
1670
1684
|
var isSidebarPanelKey = (value) => value === "pageDefaults" || value === "addSections" || value === "selected";
|
|
1671
1685
|
|
|
1672
1686
|
// src/studio-pages/builder/hooks/usePersistentSidebarPanel.ts
|
|
1673
1687
|
function usePersistentSidebarPanel(pageID) {
|
|
1674
|
-
const [activeSidebarPanel, setActiveSidebarPanel] = (0,
|
|
1675
|
-
(0,
|
|
1688
|
+
const [activeSidebarPanel, setActiveSidebarPanel] = (0, import_react3.useState)("selected");
|
|
1689
|
+
(0, import_react3.useEffect)(() => {
|
|
1676
1690
|
const storageKey = `orion-builder-panels:${pageID}`;
|
|
1677
1691
|
const raw = window.localStorage.getItem(storageKey);
|
|
1678
1692
|
if (!raw) {
|
|
@@ -1698,7 +1712,7 @@ function usePersistentSidebarPanel(pageID) {
|
|
|
1698
1712
|
} catch {
|
|
1699
1713
|
}
|
|
1700
1714
|
}, [pageID]);
|
|
1701
|
-
(0,
|
|
1715
|
+
(0, import_react3.useEffect)(() => {
|
|
1702
1716
|
const storageKey = `orion-builder-panels:${pageID}`;
|
|
1703
1717
|
window.localStorage.setItem(storageKey, JSON.stringify({ activePanel: activeSidebarPanel }));
|
|
1704
1718
|
}, [activeSidebarPanel, pageID]);
|
|
@@ -1970,7 +1984,7 @@ function clonePresetBlocks(blocks) {
|
|
|
1970
1984
|
}
|
|
1971
1985
|
|
|
1972
1986
|
// src/studio-pages/builder/ui/InlineText.tsx
|
|
1973
|
-
var
|
|
1987
|
+
var import_react4 = require("react");
|
|
1974
1988
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1975
1989
|
function InlineText({
|
|
1976
1990
|
as = "p",
|
|
@@ -1981,8 +1995,8 @@ function InlineText({
|
|
|
1981
1995
|
style,
|
|
1982
1996
|
value
|
|
1983
1997
|
}) {
|
|
1984
|
-
const [editing, setEditing] = (0,
|
|
1985
|
-
const editableRef = (0,
|
|
1998
|
+
const [editing, setEditing] = (0, import_react4.useState)(false);
|
|
1999
|
+
const editableRef = (0, import_react4.useRef)(null);
|
|
1986
2000
|
const Tag = as;
|
|
1987
2001
|
const normalizeValue = (raw) => {
|
|
1988
2002
|
if (multiline) {
|
|
@@ -1990,7 +2004,7 @@ function InlineText({
|
|
|
1990
2004
|
}
|
|
1991
2005
|
return raw.replace(/\r?\n/g, " ").replace(/\s+/g, " ").trim();
|
|
1992
2006
|
};
|
|
1993
|
-
(0,
|
|
2007
|
+
(0, import_react4.useEffect)(() => {
|
|
1994
2008
|
if (!editing || !editableRef.current) {
|
|
1995
2009
|
return;
|
|
1996
2010
|
}
|
|
@@ -2068,7 +2082,7 @@ function UploadOverlay({ label = "Uploading image..." }) {
|
|
|
2068
2082
|
}
|
|
2069
2083
|
|
|
2070
2084
|
// src/studio-pages/builder/ui/BlockFrame.tsx
|
|
2071
|
-
var
|
|
2085
|
+
var import_react5 = require("react");
|
|
2072
2086
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2073
2087
|
function BlockFrame({
|
|
2074
2088
|
children,
|
|
@@ -2080,14 +2094,14 @@ function BlockFrame({
|
|
|
2080
2094
|
selected,
|
|
2081
2095
|
setDragIndex
|
|
2082
2096
|
}) {
|
|
2083
|
-
const [dropPosition, setDropPosition] = (0,
|
|
2084
|
-
const [dropHovered, setDropHovered] = (0,
|
|
2097
|
+
const [dropPosition, setDropPosition] = (0, import_react5.useState)(null);
|
|
2098
|
+
const [dropHovered, setDropHovered] = (0, import_react5.useState)(false);
|
|
2085
2099
|
const isDragging = dragIndex === index;
|
|
2086
2100
|
const isAnyDragging = dragIndex !== null;
|
|
2087
2101
|
const isDropTarget = dragIndex !== null && dragIndex !== index && dropPosition !== null;
|
|
2088
2102
|
const showDropBefore = isDropTarget && dropPosition === "before";
|
|
2089
2103
|
const showDropAfter = isDropTarget && dropPosition === "after";
|
|
2090
|
-
(0,
|
|
2104
|
+
(0, import_react5.useEffect)(() => {
|
|
2091
2105
|
if (dragIndex === null) {
|
|
2092
2106
|
setDropPosition(null);
|
|
2093
2107
|
setDropHovered(false);
|
|
@@ -4006,7 +4020,7 @@ var cloneSnapshot = (value) => ({
|
|
|
4006
4020
|
pageDefaults: clonePageDefaults(value.pageDefaults)
|
|
4007
4021
|
});
|
|
4008
4022
|
function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, siteThemeTokens }) {
|
|
4009
|
-
const editorRootRef = (0,
|
|
4023
|
+
const editorRootRef = (0, import_react6.useRef)(null);
|
|
4010
4024
|
const doc = initialDoc ?? {};
|
|
4011
4025
|
const sourceStudioDocument = doc.studioDocument && typeof doc.studioDocument === "object" ? doc.studioDocument : {};
|
|
4012
4026
|
const sourceMetadata = sourceStudioDocument.metadata && typeof sourceStudioDocument.metadata === "object" ? sourceStudioDocument.metadata : {};
|
|
@@ -4018,39 +4032,39 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4018
4032
|
pageWidthDefault: sourceMetadata.pageWidthDefault === "wide" || sourceMetadata.pageWidthDefault === "full" ? sourceMetadata.pageWidthDefault : defaultPageDefaults.pageWidthDefault,
|
|
4019
4033
|
themePage: isRecord6(sourceThemePage.page) ? sourceThemePage.page : {}
|
|
4020
4034
|
};
|
|
4021
|
-
const [layout, setLayout] = (0,
|
|
4035
|
+
const [layout, setLayout] = (0, import_react6.useState)(
|
|
4022
4036
|
migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block)))
|
|
4023
4037
|
);
|
|
4024
|
-
const [pageDefaults, setPageDefaults] = (0,
|
|
4025
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
4026
|
-
const [dragIndex, setDragIndex] = (0,
|
|
4027
|
-
const [sidebarOpen, setSidebarOpen] = (0,
|
|
4028
|
-
const [savingStatus, setSavingStatus] = (0,
|
|
4029
|
-
const [uploadingTarget, setUploadingTarget] = (0,
|
|
4030
|
-
const [topViewportHeight, setTopViewportHeight] = (0,
|
|
4031
|
-
const [uploadError, setUploadError] = (0,
|
|
4032
|
-
const [uploadMessage, setUploadMessage] = (0,
|
|
4033
|
-
const [uploadAltText, setUploadAltText] = (0,
|
|
4034
|
-
const [mediaLibrary, setMediaLibrary] = (0,
|
|
4035
|
-
const [mediaLibraryError, setMediaLibraryError] = (0,
|
|
4036
|
-
const [mediaLibraryLoading, setMediaLibraryLoading] = (0,
|
|
4037
|
-
const [selectedItemIndex, setSelectedItemIndex] = (0,
|
|
4038
|
-
const [expandedItemIndex, setExpandedItemIndex] = (0,
|
|
4039
|
-
const [testimonialsOffsets, setTestimonialsOffsets] = (0,
|
|
4040
|
-
const [presetQuery, setPresetQuery] = (0,
|
|
4041
|
-
const [sessionExpired, setSessionExpired] = (0,
|
|
4042
|
-
const [pastSnapshots, setPastSnapshots] = (0,
|
|
4043
|
-
const [futureSnapshots, setFutureSnapshots] = (0,
|
|
4044
|
-
const [settingsPanelMode, setSettingsPanelMode] = (0,
|
|
4045
|
-
const [settingsSearchQuery, setSettingsSearchQuery] = (0,
|
|
4038
|
+
const [pageDefaults, setPageDefaults] = (0, import_react6.useState)(clonePageDefaults(initialPageDefaults));
|
|
4039
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react6.useState)(null);
|
|
4040
|
+
const [dragIndex, setDragIndex] = (0, import_react6.useState)(null);
|
|
4041
|
+
const [sidebarOpen, setSidebarOpen] = (0, import_react6.useState)(true);
|
|
4042
|
+
const [savingStatus, setSavingStatus] = (0, import_react6.useState)(null);
|
|
4043
|
+
const [uploadingTarget, setUploadingTarget] = (0, import_react6.useState)(null);
|
|
4044
|
+
const [topViewportHeight, setTopViewportHeight] = (0, import_react6.useState)(null);
|
|
4045
|
+
const [uploadError, setUploadError] = (0, import_react6.useState)("");
|
|
4046
|
+
const [uploadMessage, setUploadMessage] = (0, import_react6.useState)("");
|
|
4047
|
+
const [uploadAltText, setUploadAltText] = (0, import_react6.useState)("");
|
|
4048
|
+
const [mediaLibrary, setMediaLibrary] = (0, import_react6.useState)([]);
|
|
4049
|
+
const [mediaLibraryError, setMediaLibraryError] = (0, import_react6.useState)("");
|
|
4050
|
+
const [mediaLibraryLoading, setMediaLibraryLoading] = (0, import_react6.useState)(false);
|
|
4051
|
+
const [selectedItemIndex, setSelectedItemIndex] = (0, import_react6.useState)(null);
|
|
4052
|
+
const [expandedItemIndex, setExpandedItemIndex] = (0, import_react6.useState)(null);
|
|
4053
|
+
const [testimonialsOffsets, setTestimonialsOffsets] = (0, import_react6.useState)({});
|
|
4054
|
+
const [presetQuery, setPresetQuery] = (0, import_react6.useState)("");
|
|
4055
|
+
const [sessionExpired, setSessionExpired] = (0, import_react6.useState)(false);
|
|
4056
|
+
const [pastSnapshots, setPastSnapshots] = (0, import_react6.useState)([]);
|
|
4057
|
+
const [futureSnapshots, setFutureSnapshots] = (0, import_react6.useState)([]);
|
|
4058
|
+
const [settingsPanelMode, setSettingsPanelMode] = (0, import_react6.useState)("basic");
|
|
4059
|
+
const [settingsSearchQuery, setSettingsSearchQuery] = (0, import_react6.useState)("");
|
|
4046
4060
|
const { activeSidebarPanel, setActiveSidebarPanel } = usePersistentSidebarPanel(pageID);
|
|
4047
|
-
const historyBypassRef = (0,
|
|
4048
|
-
const previousSnapshotRef = (0,
|
|
4061
|
+
const historyBypassRef = (0, import_react6.useRef)(true);
|
|
4062
|
+
const previousSnapshotRef = (0, import_react6.useRef)({
|
|
4049
4063
|
layout: migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block))),
|
|
4050
4064
|
pageDefaults: clonePageDefaults(initialPageDefaults)
|
|
4051
4065
|
});
|
|
4052
|
-
const lastSavedRef = (0,
|
|
4053
|
-
const selectedBlock = (0,
|
|
4066
|
+
const lastSavedRef = (0, import_react6.useRef)(cloneSnapshot(previousSnapshotRef.current));
|
|
4067
|
+
const selectedBlock = (0, import_react6.useMemo)(
|
|
4054
4068
|
() => selectedIndex !== null ? layout[selectedIndex] : null,
|
|
4055
4069
|
[layout, selectedIndex]
|
|
4056
4070
|
);
|
|
@@ -4083,7 +4097,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4083
4097
|
return false;
|
|
4084
4098
|
};
|
|
4085
4099
|
const isSelectedBlockMediaUploading = selectedIndex !== null && (selectedType === "hero" && uploadingTarget?.kind === "hero" || selectedType === "media" && uploadingTarget?.kind === "media");
|
|
4086
|
-
const filteredSectionPresets = (0,
|
|
4100
|
+
const filteredSectionPresets = (0, import_react6.useMemo)(() => {
|
|
4087
4101
|
const query = presetQuery.trim().toLowerCase();
|
|
4088
4102
|
if (!query) {
|
|
4089
4103
|
return sectionPresets;
|
|
@@ -4092,7 +4106,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4092
4106
|
(preset) => `${preset.title} ${preset.description}`.toLowerCase().includes(query)
|
|
4093
4107
|
);
|
|
4094
4108
|
}, [presetQuery]);
|
|
4095
|
-
const loadMediaLibrary = (0,
|
|
4109
|
+
const loadMediaLibrary = (0, import_react6.useCallback)(async () => {
|
|
4096
4110
|
setMediaLibraryLoading(true);
|
|
4097
4111
|
setMediaLibraryError("");
|
|
4098
4112
|
try {
|
|
@@ -4113,10 +4127,10 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4113
4127
|
setMediaLibraryLoading(false);
|
|
4114
4128
|
}
|
|
4115
4129
|
}, []);
|
|
4116
|
-
(0,
|
|
4130
|
+
(0, import_react6.useEffect)(() => {
|
|
4117
4131
|
void loadMediaLibrary();
|
|
4118
4132
|
}, [loadMediaLibrary]);
|
|
4119
|
-
(0,
|
|
4133
|
+
(0, import_react6.useEffect)(() => {
|
|
4120
4134
|
const refreshMediaLibrary = () => {
|
|
4121
4135
|
void loadMediaLibrary();
|
|
4122
4136
|
};
|
|
@@ -4141,7 +4155,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4141
4155
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
4142
4156
|
};
|
|
4143
4157
|
}, [loadMediaLibrary]);
|
|
4144
|
-
(0,
|
|
4158
|
+
(0, import_react6.useEffect)(() => {
|
|
4145
4159
|
let active = true;
|
|
4146
4160
|
const checkSession = async () => {
|
|
4147
4161
|
try {
|
|
@@ -4558,7 +4572,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4558
4572
|
}
|
|
4559
4573
|
return nextBlock;
|
|
4560
4574
|
});
|
|
4561
|
-
const resolvedThemeTokens = (0,
|
|
4575
|
+
const resolvedThemeTokens = (0, import_react6.useMemo)(
|
|
4562
4576
|
() => resolveBuilderThemeTokens({
|
|
4563
4577
|
page: pageDefaults.themePage,
|
|
4564
4578
|
site: siteThemeTokens
|
|
@@ -4773,14 +4787,14 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4773
4787
|
return next;
|
|
4774
4788
|
});
|
|
4775
4789
|
};
|
|
4776
|
-
const currentSnapshot = (0,
|
|
4790
|
+
const currentSnapshot = (0, import_react6.useMemo)(
|
|
4777
4791
|
() => ({
|
|
4778
4792
|
layout: cloneBlockLayout(layout),
|
|
4779
4793
|
pageDefaults: clonePageDefaults(pageDefaults)
|
|
4780
4794
|
}),
|
|
4781
4795
|
[layout, pageDefaults]
|
|
4782
4796
|
);
|
|
4783
|
-
(0,
|
|
4797
|
+
(0, import_react6.useEffect)(() => {
|
|
4784
4798
|
const readTopViewportHeight = () => {
|
|
4785
4799
|
if (typeof window === "undefined") {
|
|
4786
4800
|
setTopViewportHeight(null);
|
|
@@ -4805,7 +4819,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4805
4819
|
layout: toPersistedLayout(snapshot.layout),
|
|
4806
4820
|
pageDefaults: snapshot.pageDefaults
|
|
4807
4821
|
});
|
|
4808
|
-
const isDirty = (0,
|
|
4822
|
+
const isDirty = (0, import_react6.useMemo)(
|
|
4809
4823
|
() => snapshotKey(currentSnapshot) !== snapshotKey(lastSavedRef.current),
|
|
4810
4824
|
[currentSnapshot]
|
|
4811
4825
|
);
|
|
@@ -4939,14 +4953,14 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4939
4953
|
setSavingStatus(null);
|
|
4940
4954
|
}
|
|
4941
4955
|
};
|
|
4942
|
-
(0,
|
|
4956
|
+
(0, import_react6.useEffect)(() => {
|
|
4943
4957
|
if (selectedIndex === null) {
|
|
4944
4958
|
return;
|
|
4945
4959
|
}
|
|
4946
4960
|
setSidebarOpen(true);
|
|
4947
4961
|
setActiveSidebarPanel("selected");
|
|
4948
4962
|
}, [selectedIndex]);
|
|
4949
|
-
(0,
|
|
4963
|
+
(0, import_react6.useEffect)(() => {
|
|
4950
4964
|
if (selectedIndex === null) {
|
|
4951
4965
|
setSelectedItemIndex(null);
|
|
4952
4966
|
setExpandedItemIndex(null);
|
|
@@ -4964,7 +4978,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4964
4978
|
(current) => typeof current === "number" && current >= 0 && current < selectedItems.length ? current : 0
|
|
4965
4979
|
);
|
|
4966
4980
|
}, [selectedIndex, selectedItems.length]);
|
|
4967
|
-
(0,
|
|
4981
|
+
(0, import_react6.useEffect)(() => {
|
|
4968
4982
|
if (layout.length > 0) {
|
|
4969
4983
|
return;
|
|
4970
4984
|
}
|
|
@@ -5061,10 +5075,10 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5061
5075
|
positionX: parsePercentNumber(selectedItemRecord.imagePositionX, 50),
|
|
5062
5076
|
positionY: parsePercentNumber(selectedItemRecord.imagePositionY, 50)
|
|
5063
5077
|
} : void 0;
|
|
5064
|
-
(0,
|
|
5078
|
+
(0, import_react6.useEffect)(() => {
|
|
5065
5079
|
return;
|
|
5066
5080
|
}, [layout]);
|
|
5067
|
-
(0,
|
|
5081
|
+
(0, import_react6.useEffect)(() => {
|
|
5068
5082
|
if (historyBypassRef.current) {
|
|
5069
5083
|
historyBypassRef.current = false;
|
|
5070
5084
|
previousSnapshotRef.current = cloneSnapshot(currentSnapshot);
|
|
@@ -5075,7 +5089,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5075
5089
|
setFutureSnapshots([]);
|
|
5076
5090
|
previousSnapshotRef.current = cloneSnapshot(currentSnapshot);
|
|
5077
5091
|
}, [currentSnapshot]);
|
|
5078
|
-
(0,
|
|
5092
|
+
(0, import_react6.useEffect)(() => {
|
|
5079
5093
|
const onKeyDown = (event) => {
|
|
5080
5094
|
const key = event.key.toLowerCase();
|
|
5081
5095
|
const isUndo = (event.metaKey || event.ctrlKey) && key === "z" && !event.shiftKey;
|
|
@@ -5093,7 +5107,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5093
5107
|
window.addEventListener("keydown", onKeyDown);
|
|
5094
5108
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
5095
5109
|
}, [canRedo, canUndo, futureSnapshots, pastSnapshots, currentSnapshot]);
|
|
5096
|
-
(0,
|
|
5110
|
+
(0, import_react6.useEffect)(() => {
|
|
5097
5111
|
window.parent?.postMessage(
|
|
5098
5112
|
{
|
|
5099
5113
|
dirty: isDirty,
|
|
@@ -5103,7 +5117,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5103
5117
|
"*"
|
|
5104
5118
|
);
|
|
5105
5119
|
}, [isDirty]);
|
|
5106
|
-
(0,
|
|
5120
|
+
(0, import_react6.useEffect)(() => {
|
|
5107
5121
|
window.parent?.postMessage(
|
|
5108
5122
|
{
|
|
5109
5123
|
canRedo,
|
|
@@ -5114,7 +5128,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5114
5128
|
"*"
|
|
5115
5129
|
);
|
|
5116
5130
|
}, [canRedo, canUndo]);
|
|
5117
|
-
(0,
|
|
5131
|
+
(0, import_react6.useEffect)(() => {
|
|
5118
5132
|
const onMessage = (event) => {
|
|
5119
5133
|
const data = event.data;
|
|
5120
5134
|
if (!data || data.source !== "payload-visual-builder-parent") {
|
|
@@ -5167,7 +5181,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5167
5181
|
window.addEventListener("message", onMessage);
|
|
5168
5182
|
return () => window.removeEventListener("message", onMessage);
|
|
5169
5183
|
}, [canRedo, canUndo, isDirty, layout, pageDefaults.pageWidthDefault, title]);
|
|
5170
|
-
(0,
|
|
5184
|
+
(0, import_react6.useEffect)(() => {
|
|
5171
5185
|
const preventNavigationWhileEditing = (event) => {
|
|
5172
5186
|
const editorRoot = editorRootRef.current;
|
|
5173
5187
|
if (!editorRoot) {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../chunk-ROTPP5CU.mjs";
|
|
7
7
|
|
|
8
8
|
// src/studio-pages/builder/BuilderPageEditor.tsx
|
|
9
|
-
import { useCallback, useEffect as
|
|
9
|
+
import { useCallback, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef2, useState as useState6 } from "react";
|
|
10
10
|
|
|
11
11
|
// src/blocks/blocks/sectionStyleFields.ts
|
|
12
12
|
var sectionStyleDefaults = {
|
|
@@ -343,19 +343,33 @@ var resolveTypographyStyleFromSettings = (settings) => {
|
|
|
343
343
|
};
|
|
344
344
|
|
|
345
345
|
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
346
|
-
import { useMemo, useState } from "react";
|
|
346
|
+
import { useMemo, useState as useState2 } from "react";
|
|
347
347
|
|
|
348
348
|
// src/studio-pages/builder/ui/Accordion.tsx
|
|
349
|
+
import { useEffect, useState } from "react";
|
|
349
350
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
350
351
|
function Accordion({ children, defaultOpen = false, onToggle, open, subtitle, title }) {
|
|
351
352
|
const controlled = typeof open === "boolean";
|
|
352
|
-
const
|
|
353
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
354
|
+
useEffect(() => {
|
|
355
|
+
if (!controlled) {
|
|
356
|
+
setUncontrolledOpen(defaultOpen);
|
|
357
|
+
}
|
|
358
|
+
}, [controlled, defaultOpen]);
|
|
359
|
+
const isOpen = controlled ? open : uncontrolledOpen;
|
|
360
|
+
const handleToggle = () => {
|
|
361
|
+
const next = !isOpen;
|
|
362
|
+
if (!controlled) {
|
|
363
|
+
setUncontrolledOpen(next);
|
|
364
|
+
}
|
|
365
|
+
onToggle?.(next);
|
|
366
|
+
};
|
|
353
367
|
return /* @__PURE__ */ jsxs("article", { className: "orion-builder-settings-group", children: [
|
|
354
368
|
/* @__PURE__ */ jsxs(
|
|
355
369
|
"button",
|
|
356
370
|
{
|
|
357
371
|
className: "orion-builder-settings-group-header",
|
|
358
|
-
onClick:
|
|
372
|
+
onClick: handleToggle,
|
|
359
373
|
type: "button",
|
|
360
374
|
children: [
|
|
361
375
|
/* @__PURE__ */ jsxs("span", { className: "orion-builder-settings-group-title-wrap", children: [
|
|
@@ -1012,7 +1026,7 @@ function BlockInspectorRenderer({
|
|
|
1012
1026
|
onUpdateSetting,
|
|
1013
1027
|
searchQuery
|
|
1014
1028
|
}) {
|
|
1015
|
-
const [expandedGroups, setExpandedGroups] =
|
|
1029
|
+
const [expandedGroups, setExpandedGroups] = useState2({
|
|
1016
1030
|
advanced: false,
|
|
1017
1031
|
basics: false,
|
|
1018
1032
|
layout: false,
|
|
@@ -1545,15 +1559,15 @@ var layoutToStudioDocument = (layout, title, metadata) => {
|
|
|
1545
1559
|
};
|
|
1546
1560
|
|
|
1547
1561
|
// src/studio-pages/builder/hooks/usePersistentSidebarPanel.ts
|
|
1548
|
-
import { useEffect, useState as
|
|
1562
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
1549
1563
|
|
|
1550
1564
|
// src/studio-pages/builder/sidebar/types.ts
|
|
1551
1565
|
var isSidebarPanelKey = (value) => value === "pageDefaults" || value === "addSections" || value === "selected";
|
|
1552
1566
|
|
|
1553
1567
|
// src/studio-pages/builder/hooks/usePersistentSidebarPanel.ts
|
|
1554
1568
|
function usePersistentSidebarPanel(pageID) {
|
|
1555
|
-
const [activeSidebarPanel, setActiveSidebarPanel] =
|
|
1556
|
-
|
|
1569
|
+
const [activeSidebarPanel, setActiveSidebarPanel] = useState3("selected");
|
|
1570
|
+
useEffect2(() => {
|
|
1557
1571
|
const storageKey = `orion-builder-panels:${pageID}`;
|
|
1558
1572
|
const raw = window.localStorage.getItem(storageKey);
|
|
1559
1573
|
if (!raw) {
|
|
@@ -1579,7 +1593,7 @@ function usePersistentSidebarPanel(pageID) {
|
|
|
1579
1593
|
} catch {
|
|
1580
1594
|
}
|
|
1581
1595
|
}, [pageID]);
|
|
1582
|
-
|
|
1596
|
+
useEffect2(() => {
|
|
1583
1597
|
const storageKey = `orion-builder-panels:${pageID}`;
|
|
1584
1598
|
window.localStorage.setItem(storageKey, JSON.stringify({ activePanel: activeSidebarPanel }));
|
|
1585
1599
|
}, [activeSidebarPanel, pageID]);
|
|
@@ -1851,7 +1865,7 @@ function clonePresetBlocks(blocks) {
|
|
|
1851
1865
|
}
|
|
1852
1866
|
|
|
1853
1867
|
// src/studio-pages/builder/ui/InlineText.tsx
|
|
1854
|
-
import { useEffect as
|
|
1868
|
+
import { useEffect as useEffect3, useRef, useState as useState4 } from "react";
|
|
1855
1869
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1856
1870
|
function InlineText({
|
|
1857
1871
|
as = "p",
|
|
@@ -1862,7 +1876,7 @@ function InlineText({
|
|
|
1862
1876
|
style,
|
|
1863
1877
|
value
|
|
1864
1878
|
}) {
|
|
1865
|
-
const [editing, setEditing] =
|
|
1879
|
+
const [editing, setEditing] = useState4(false);
|
|
1866
1880
|
const editableRef = useRef(null);
|
|
1867
1881
|
const Tag = as;
|
|
1868
1882
|
const normalizeValue = (raw) => {
|
|
@@ -1871,7 +1885,7 @@ function InlineText({
|
|
|
1871
1885
|
}
|
|
1872
1886
|
return raw.replace(/\r?\n/g, " ").replace(/\s+/g, " ").trim();
|
|
1873
1887
|
};
|
|
1874
|
-
|
|
1888
|
+
useEffect3(() => {
|
|
1875
1889
|
if (!editing || !editableRef.current) {
|
|
1876
1890
|
return;
|
|
1877
1891
|
}
|
|
@@ -1949,7 +1963,7 @@ function UploadOverlay({ label = "Uploading image..." }) {
|
|
|
1949
1963
|
}
|
|
1950
1964
|
|
|
1951
1965
|
// src/studio-pages/builder/ui/BlockFrame.tsx
|
|
1952
|
-
import { useEffect as
|
|
1966
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1953
1967
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1954
1968
|
function BlockFrame({
|
|
1955
1969
|
children,
|
|
@@ -1961,14 +1975,14 @@ function BlockFrame({
|
|
|
1961
1975
|
selected,
|
|
1962
1976
|
setDragIndex
|
|
1963
1977
|
}) {
|
|
1964
|
-
const [dropPosition, setDropPosition] =
|
|
1965
|
-
const [dropHovered, setDropHovered] =
|
|
1978
|
+
const [dropPosition, setDropPosition] = useState5(null);
|
|
1979
|
+
const [dropHovered, setDropHovered] = useState5(false);
|
|
1966
1980
|
const isDragging = dragIndex === index;
|
|
1967
1981
|
const isAnyDragging = dragIndex !== null;
|
|
1968
1982
|
const isDropTarget = dragIndex !== null && dragIndex !== index && dropPosition !== null;
|
|
1969
1983
|
const showDropBefore = isDropTarget && dropPosition === "before";
|
|
1970
1984
|
const showDropAfter = isDropTarget && dropPosition === "after";
|
|
1971
|
-
|
|
1985
|
+
useEffect4(() => {
|
|
1972
1986
|
if (dragIndex === null) {
|
|
1973
1987
|
setDropPosition(null);
|
|
1974
1988
|
setDropHovered(false);
|
|
@@ -3899,31 +3913,31 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
3899
3913
|
pageWidthDefault: sourceMetadata.pageWidthDefault === "wide" || sourceMetadata.pageWidthDefault === "full" ? sourceMetadata.pageWidthDefault : defaultPageDefaults.pageWidthDefault,
|
|
3900
3914
|
themePage: isRecord6(sourceThemePage.page) ? sourceThemePage.page : {}
|
|
3901
3915
|
};
|
|
3902
|
-
const [layout, setLayout] =
|
|
3916
|
+
const [layout, setLayout] = useState6(
|
|
3903
3917
|
migrateLayoutToSettingsV2(cloneBlockLayout(initialLayout).map((block) => withSectionStyleDefaults2(block)))
|
|
3904
3918
|
);
|
|
3905
|
-
const [pageDefaults, setPageDefaults] =
|
|
3906
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3907
|
-
const [dragIndex, setDragIndex] =
|
|
3908
|
-
const [sidebarOpen, setSidebarOpen] =
|
|
3909
|
-
const [savingStatus, setSavingStatus] =
|
|
3910
|
-
const [uploadingTarget, setUploadingTarget] =
|
|
3911
|
-
const [topViewportHeight, setTopViewportHeight] =
|
|
3912
|
-
const [uploadError, setUploadError] =
|
|
3913
|
-
const [uploadMessage, setUploadMessage] =
|
|
3914
|
-
const [uploadAltText, setUploadAltText] =
|
|
3915
|
-
const [mediaLibrary, setMediaLibrary] =
|
|
3916
|
-
const [mediaLibraryError, setMediaLibraryError] =
|
|
3917
|
-
const [mediaLibraryLoading, setMediaLibraryLoading] =
|
|
3918
|
-
const [selectedItemIndex, setSelectedItemIndex] =
|
|
3919
|
-
const [expandedItemIndex, setExpandedItemIndex] =
|
|
3920
|
-
const [testimonialsOffsets, setTestimonialsOffsets] =
|
|
3921
|
-
const [presetQuery, setPresetQuery] =
|
|
3922
|
-
const [sessionExpired, setSessionExpired] =
|
|
3923
|
-
const [pastSnapshots, setPastSnapshots] =
|
|
3924
|
-
const [futureSnapshots, setFutureSnapshots] =
|
|
3925
|
-
const [settingsPanelMode, setSettingsPanelMode] =
|
|
3926
|
-
const [settingsSearchQuery, setSettingsSearchQuery] =
|
|
3919
|
+
const [pageDefaults, setPageDefaults] = useState6(clonePageDefaults(initialPageDefaults));
|
|
3920
|
+
const [selectedIndex, setSelectedIndex] = useState6(null);
|
|
3921
|
+
const [dragIndex, setDragIndex] = useState6(null);
|
|
3922
|
+
const [sidebarOpen, setSidebarOpen] = useState6(true);
|
|
3923
|
+
const [savingStatus, setSavingStatus] = useState6(null);
|
|
3924
|
+
const [uploadingTarget, setUploadingTarget] = useState6(null);
|
|
3925
|
+
const [topViewportHeight, setTopViewportHeight] = useState6(null);
|
|
3926
|
+
const [uploadError, setUploadError] = useState6("");
|
|
3927
|
+
const [uploadMessage, setUploadMessage] = useState6("");
|
|
3928
|
+
const [uploadAltText, setUploadAltText] = useState6("");
|
|
3929
|
+
const [mediaLibrary, setMediaLibrary] = useState6([]);
|
|
3930
|
+
const [mediaLibraryError, setMediaLibraryError] = useState6("");
|
|
3931
|
+
const [mediaLibraryLoading, setMediaLibraryLoading] = useState6(false);
|
|
3932
|
+
const [selectedItemIndex, setSelectedItemIndex] = useState6(null);
|
|
3933
|
+
const [expandedItemIndex, setExpandedItemIndex] = useState6(null);
|
|
3934
|
+
const [testimonialsOffsets, setTestimonialsOffsets] = useState6({});
|
|
3935
|
+
const [presetQuery, setPresetQuery] = useState6("");
|
|
3936
|
+
const [sessionExpired, setSessionExpired] = useState6(false);
|
|
3937
|
+
const [pastSnapshots, setPastSnapshots] = useState6([]);
|
|
3938
|
+
const [futureSnapshots, setFutureSnapshots] = useState6([]);
|
|
3939
|
+
const [settingsPanelMode, setSettingsPanelMode] = useState6("basic");
|
|
3940
|
+
const [settingsSearchQuery, setSettingsSearchQuery] = useState6("");
|
|
3927
3941
|
const { activeSidebarPanel, setActiveSidebarPanel } = usePersistentSidebarPanel(pageID);
|
|
3928
3942
|
const historyBypassRef = useRef2(true);
|
|
3929
3943
|
const previousSnapshotRef = useRef2({
|
|
@@ -3994,10 +4008,10 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
3994
4008
|
setMediaLibraryLoading(false);
|
|
3995
4009
|
}
|
|
3996
4010
|
}, []);
|
|
3997
|
-
|
|
4011
|
+
useEffect5(() => {
|
|
3998
4012
|
void loadMediaLibrary();
|
|
3999
4013
|
}, [loadMediaLibrary]);
|
|
4000
|
-
|
|
4014
|
+
useEffect5(() => {
|
|
4001
4015
|
const refreshMediaLibrary = () => {
|
|
4002
4016
|
void loadMediaLibrary();
|
|
4003
4017
|
};
|
|
@@ -4022,7 +4036,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4022
4036
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
4023
4037
|
};
|
|
4024
4038
|
}, [loadMediaLibrary]);
|
|
4025
|
-
|
|
4039
|
+
useEffect5(() => {
|
|
4026
4040
|
let active = true;
|
|
4027
4041
|
const checkSession = async () => {
|
|
4028
4042
|
try {
|
|
@@ -4661,7 +4675,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4661
4675
|
}),
|
|
4662
4676
|
[layout, pageDefaults]
|
|
4663
4677
|
);
|
|
4664
|
-
|
|
4678
|
+
useEffect5(() => {
|
|
4665
4679
|
const readTopViewportHeight = () => {
|
|
4666
4680
|
if (typeof window === "undefined") {
|
|
4667
4681
|
setTopViewportHeight(null);
|
|
@@ -4820,14 +4834,14 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4820
4834
|
setSavingStatus(null);
|
|
4821
4835
|
}
|
|
4822
4836
|
};
|
|
4823
|
-
|
|
4837
|
+
useEffect5(() => {
|
|
4824
4838
|
if (selectedIndex === null) {
|
|
4825
4839
|
return;
|
|
4826
4840
|
}
|
|
4827
4841
|
setSidebarOpen(true);
|
|
4828
4842
|
setActiveSidebarPanel("selected");
|
|
4829
4843
|
}, [selectedIndex]);
|
|
4830
|
-
|
|
4844
|
+
useEffect5(() => {
|
|
4831
4845
|
if (selectedIndex === null) {
|
|
4832
4846
|
setSelectedItemIndex(null);
|
|
4833
4847
|
setExpandedItemIndex(null);
|
|
@@ -4845,7 +4859,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4845
4859
|
(current) => typeof current === "number" && current >= 0 && current < selectedItems.length ? current : 0
|
|
4846
4860
|
);
|
|
4847
4861
|
}, [selectedIndex, selectedItems.length]);
|
|
4848
|
-
|
|
4862
|
+
useEffect5(() => {
|
|
4849
4863
|
if (layout.length > 0) {
|
|
4850
4864
|
return;
|
|
4851
4865
|
}
|
|
@@ -4942,10 +4956,10 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4942
4956
|
positionX: parsePercentNumber(selectedItemRecord.imagePositionX, 50),
|
|
4943
4957
|
positionY: parsePercentNumber(selectedItemRecord.imagePositionY, 50)
|
|
4944
4958
|
} : void 0;
|
|
4945
|
-
|
|
4959
|
+
useEffect5(() => {
|
|
4946
4960
|
return;
|
|
4947
4961
|
}, [layout]);
|
|
4948
|
-
|
|
4962
|
+
useEffect5(() => {
|
|
4949
4963
|
if (historyBypassRef.current) {
|
|
4950
4964
|
historyBypassRef.current = false;
|
|
4951
4965
|
previousSnapshotRef.current = cloneSnapshot(currentSnapshot);
|
|
@@ -4956,7 +4970,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4956
4970
|
setFutureSnapshots([]);
|
|
4957
4971
|
previousSnapshotRef.current = cloneSnapshot(currentSnapshot);
|
|
4958
4972
|
}, [currentSnapshot]);
|
|
4959
|
-
|
|
4973
|
+
useEffect5(() => {
|
|
4960
4974
|
const onKeyDown = (event) => {
|
|
4961
4975
|
const key = event.key.toLowerCase();
|
|
4962
4976
|
const isUndo = (event.metaKey || event.ctrlKey) && key === "z" && !event.shiftKey;
|
|
@@ -4974,7 +4988,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4974
4988
|
window.addEventListener("keydown", onKeyDown);
|
|
4975
4989
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
4976
4990
|
}, [canRedo, canUndo, futureSnapshots, pastSnapshots, currentSnapshot]);
|
|
4977
|
-
|
|
4991
|
+
useEffect5(() => {
|
|
4978
4992
|
window.parent?.postMessage(
|
|
4979
4993
|
{
|
|
4980
4994
|
dirty: isDirty,
|
|
@@ -4984,7 +4998,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4984
4998
|
"*"
|
|
4985
4999
|
);
|
|
4986
5000
|
}, [isDirty]);
|
|
4987
|
-
|
|
5001
|
+
useEffect5(() => {
|
|
4988
5002
|
window.parent?.postMessage(
|
|
4989
5003
|
{
|
|
4990
5004
|
canRedo,
|
|
@@ -4995,7 +5009,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
4995
5009
|
"*"
|
|
4996
5010
|
);
|
|
4997
5011
|
}, [canRedo, canUndo]);
|
|
4998
|
-
|
|
5012
|
+
useEffect5(() => {
|
|
4999
5013
|
const onMessage = (event) => {
|
|
5000
5014
|
const data = event.data;
|
|
5001
5015
|
if (!data || data.source !== "payload-visual-builder-parent") {
|
|
@@ -5048,7 +5062,7 @@ function BuilderPageEditor({ featureFlags: _featureFlags, initialDoc, pageID, si
|
|
|
5048
5062
|
window.addEventListener("message", onMessage);
|
|
5049
5063
|
return () => window.removeEventListener("message", onMessage);
|
|
5050
5064
|
}, [canRedo, canUndo, isDirty, layout, pageDefaults.pageWidthDefault, title]);
|
|
5051
|
-
|
|
5065
|
+
useEffect5(() => {
|
|
5052
5066
|
const preventNavigationWhileEditing = (event) => {
|
|
5053
5067
|
const editorRoot = editorRootRef.current;
|
|
5054
5068
|
if (!editorRoot) {
|
|
@@ -355,9 +355,10 @@ var resolveBuilderThemeTokens = (layers) => {
|
|
|
355
355
|
};
|
|
356
356
|
|
|
357
357
|
// src/studio-pages/builder/settings-v2/BlockInspectorRenderer.tsx
|
|
358
|
-
var
|
|
358
|
+
var import_react2 = require("react");
|
|
359
359
|
|
|
360
360
|
// src/studio-pages/builder/ui/Accordion.tsx
|
|
361
|
+
var import_react = require("react");
|
|
361
362
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
362
363
|
|
|
363
364
|
// src/studio-pages/builder/ui/ImageControls.tsx
|