@ohhwells/bridge 0.1.160-next.432 → 0.1.160-next.437
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/index.cjs +446 -305
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +200 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -86,6 +86,7 @@ __export(index_exports, {
|
|
|
86
86
|
hasMountedContentNodes: () => hasMountedContentNodes,
|
|
87
87
|
indexCollectionItems: () => indexCollectionItems,
|
|
88
88
|
insertFooterHours: () => insertFooterHours,
|
|
89
|
+
isDeadPageHref: () => isDeadPageHref,
|
|
89
90
|
isEditSessionActive: () => isEditSessionActive,
|
|
90
91
|
isPlainLeftClick: () => isPlainLeftClick,
|
|
91
92
|
isRenderableFooterTree: () => isRenderableFooterTree,
|
|
@@ -97,6 +98,7 @@ __export(index_exports, {
|
|
|
97
98
|
parseAiFooterState: () => parseAiFooterState,
|
|
98
99
|
parseAiSectionsState: () => parseAiSectionsState,
|
|
99
100
|
parseTarget: () => parseTarget,
|
|
101
|
+
planBuildPageSync: () => planBuildPageSync,
|
|
100
102
|
recordOverriddenPaths: () => recordOverriddenPaths,
|
|
101
103
|
releaseTemplateLogoIfReplaced: () => releaseTemplateLogoIfReplaced,
|
|
102
104
|
removeFooterBlock: () => removeFooterBlock,
|
|
@@ -115,7 +117,7 @@ __export(index_exports, {
|
|
|
115
117
|
module.exports = __toCommonJS(index_exports);
|
|
116
118
|
|
|
117
119
|
// src/OhhwellsBridge.tsx
|
|
118
|
-
var
|
|
120
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
119
121
|
var import_client3 = require("react-dom/client");
|
|
120
122
|
var import_react_dom5 = require("react-dom");
|
|
121
123
|
|
|
@@ -954,6 +956,10 @@ function useOhwCarousel(key, initial) {
|
|
|
954
956
|
if (Array.isArray(detail?.images)) setImages(detail.images);
|
|
955
957
|
};
|
|
956
958
|
el.addEventListener(CAROUSEL_EVENT, onChange);
|
|
959
|
+
const pending = parseSlides(el.getAttribute(CAROUSEL_VALUE_ATTR));
|
|
960
|
+
if (pending.length > 0) {
|
|
961
|
+
setImages((prev) => JSON.stringify(prev) === JSON.stringify(pending) ? prev : pending);
|
|
962
|
+
}
|
|
957
963
|
return () => el.removeEventListener(CAROUSEL_EVENT, onChange);
|
|
958
964
|
}, [key]);
|
|
959
965
|
const bind = {
|
|
@@ -3610,11 +3616,11 @@ function insertFooterColumnDom(colIndex, heading, items) {
|
|
|
3610
3616
|
container.appendChild(column);
|
|
3611
3617
|
return { column, firstLink };
|
|
3612
3618
|
}
|
|
3613
|
-
function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL,
|
|
3619
|
+
function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL, linkHref2 = DEFAULT_FOOTER_COLUMN_LINK_HREF) {
|
|
3614
3620
|
if (!canAddFooterColumn()) {
|
|
3615
3621
|
throw new Error(`Footer column limit reached (${MAX_FOOTER_COLUMNS})`);
|
|
3616
3622
|
}
|
|
3617
|
-
const resolvedHref =
|
|
3623
|
+
const resolvedHref = linkHref2 || (document.querySelector("[data-ai-footer], [data-ohw-ai-footer]") ? "/" : DEFAULT_FOOTER_COLUMN_LINK_HREF);
|
|
3618
3624
|
const colIndex = getNextFooterColumnIndex();
|
|
3619
3625
|
const inserted = insertFooterColumnDom(colIndex, heading, [{ href: resolvedHref, label: linkLabel }]);
|
|
3620
3626
|
if (!inserted?.firstLink) throw new Error("Failed to insert footer column");
|
|
@@ -3993,8 +3999,8 @@ function duplicateFooterItem(sourceAnchor) {
|
|
|
3993
3999
|
const column = findFooterColumnForLink(sourceAnchor);
|
|
3994
4000
|
if (!column) return null;
|
|
3995
4001
|
const href = getLinkHref(sourceAnchor);
|
|
3996
|
-
const
|
|
3997
|
-
const label = (
|
|
4002
|
+
const labelEl2 = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
4003
|
+
const label = (labelEl2?.textContent ?? "").trim() || "Untitled";
|
|
3998
4004
|
return insertFooterItem(column, href || "/", label, sourceAnchor);
|
|
3999
4005
|
}
|
|
4000
4006
|
function footerLabelKeyFromHrefKey(hrefKey) {
|
|
@@ -4004,8 +4010,8 @@ function deleteFooterItem(sourceAnchor) {
|
|
|
4004
4010
|
if (!isFooterLinkAnchor(sourceAnchor)) return null;
|
|
4005
4011
|
const hrefKey = sourceAnchor.getAttribute("data-ohw-href-key");
|
|
4006
4012
|
if (!hrefKey || !isFooterHrefKey(hrefKey)) return null;
|
|
4007
|
-
const
|
|
4008
|
-
const label = (
|
|
4013
|
+
const labelEl2 = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
4014
|
+
const label = (labelEl2?.textContent ?? "").trim() || "Untitled";
|
|
4009
4015
|
const labelKey = footerLabelKeyFromHrefKey(hrefKey);
|
|
4010
4016
|
const previousOrder = getFooterOrderFromDom();
|
|
4011
4017
|
const previousOrderJson = JSON.stringify(previousOrder);
|
|
@@ -4973,8 +4979,8 @@ function remapNavKeysInSubtree(root, keyMap) {
|
|
|
4973
4979
|
const mapped = keyMap.get(oldHrefKey);
|
|
4974
4980
|
if (!mapped) return;
|
|
4975
4981
|
el.setAttribute("data-ohw-href-key", mapped.hrefKey);
|
|
4976
|
-
const
|
|
4977
|
-
if (
|
|
4982
|
+
const labelEl2 = el.querySelector(':scope > [data-ohw-editable="text"][data-ohw-key]') ?? el.querySelector('[data-ohw-editable="text"][data-ohw-key]');
|
|
4983
|
+
if (labelEl2) labelEl2.setAttribute("data-ohw-key", mapped.labelKey);
|
|
4978
4984
|
};
|
|
4979
4985
|
if (root.matches("[data-ohw-href-key]")) remapAnchor(root);
|
|
4980
4986
|
root.querySelectorAll("[data-ohw-href-key]").forEach(remapAnchor);
|
|
@@ -4982,10 +4988,10 @@ function remapNavKeysInSubtree(root, keyMap) {
|
|
|
4982
4988
|
function readNavLinkSnapshot(hrefKey) {
|
|
4983
4989
|
const el = findCounterpartByHrefKey(hrefKey, document) ?? document.querySelector(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`);
|
|
4984
4990
|
if (!el) return { href: "/", label: "Untitled" };
|
|
4985
|
-
const
|
|
4991
|
+
const labelEl2 = el.querySelector('[data-ohw-editable="text"]');
|
|
4986
4992
|
return {
|
|
4987
4993
|
href: getLinkHref2(el),
|
|
4988
|
-
label: (
|
|
4994
|
+
label: (labelEl2?.textContent ?? "").trim() || "Untitled"
|
|
4989
4995
|
};
|
|
4990
4996
|
}
|
|
4991
4997
|
function findClonedNavAnchor(unit, hrefKey) {
|
|
@@ -5159,8 +5165,8 @@ function deleteNavbarItem(sourceAnchor) {
|
|
|
5159
5165
|
if (!isNavbarLinkItem(sourceAnchor)) return null;
|
|
5160
5166
|
const sourceHrefKey = sourceAnchor.getAttribute("data-ohw-href-key");
|
|
5161
5167
|
if (!sourceHrefKey || !isNavbarHrefKey(sourceHrefKey)) return null;
|
|
5162
|
-
const
|
|
5163
|
-
const label = (
|
|
5168
|
+
const labelEl2 = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
5169
|
+
const label = (labelEl2?.textContent ?? "").trim() || "Untitled";
|
|
5164
5170
|
const previousForest = getNavForestFromDom();
|
|
5165
5171
|
const previousOrderJson = serializeNavOrder(previousForest);
|
|
5166
5172
|
const parentHrefKey = previousForest.find((n) => n.children.some((c) => c.id === sourceHrefKey))?.id ?? null;
|
|
@@ -11955,8 +11961,8 @@ function syncFooterTreeLinksFromDom(tree) {
|
|
|
11955
11961
|
const heading = getFooterColumnHeadingEl(col);
|
|
11956
11962
|
const title = heading ? textOf2(heading) : void 0;
|
|
11957
11963
|
const items = listFooterLinksInColumn(col).map((anchor) => {
|
|
11958
|
-
const
|
|
11959
|
-
const label = textOf2(
|
|
11964
|
+
const labelEl2 = anchor.querySelector('[data-ohw-editable="text"]');
|
|
11965
|
+
const label = textOf2(labelEl2) || textOf2(anchor);
|
|
11960
11966
|
const href = hrefToFooterTreeRef(anchor.getAttribute("href"));
|
|
11961
11967
|
return label ? { label, href: href || "home" } : null;
|
|
11962
11968
|
}).filter((x) => Boolean(x));
|
|
@@ -17655,7 +17661,7 @@ function apiBase() {
|
|
|
17655
17661
|
function bridgeVersion() {
|
|
17656
17662
|
try {
|
|
17657
17663
|
if (true) {
|
|
17658
|
-
return "0.1.160-next.
|
|
17664
|
+
return "0.1.160-next.437";
|
|
17659
17665
|
}
|
|
17660
17666
|
} catch {
|
|
17661
17667
|
}
|
|
@@ -17669,7 +17675,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17669
17675
|
return;
|
|
17670
17676
|
}
|
|
17671
17677
|
try {
|
|
17672
|
-
const v = true ? "0.1.160-next.
|
|
17678
|
+
const v = true ? "0.1.160-next.437" : "";
|
|
17673
17679
|
if (v) {
|
|
17674
17680
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17675
17681
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -24384,6 +24390,138 @@ function deleteSelectedNavFooterItem(deps) {
|
|
|
24384
24390
|
return false;
|
|
24385
24391
|
}
|
|
24386
24392
|
|
|
24393
|
+
// src/lib/build-page-sync.ts
|
|
24394
|
+
var import_react23 = require("react");
|
|
24395
|
+
var CHROME_KEY_RE = /^(nav|footer|header|navbar)[-_]/u;
|
|
24396
|
+
function normalisePath(path) {
|
|
24397
|
+
const trimmed = path.trim().replace(/[?#].*$/u, "");
|
|
24398
|
+
if (!trimmed || trimmed === "/") return "/";
|
|
24399
|
+
return `/${trimmed.replace(/^\/+|\/+$/gu, "")}`;
|
|
24400
|
+
}
|
|
24401
|
+
function isDeadPageHref(href, livePaths) {
|
|
24402
|
+
const value = href.trim();
|
|
24403
|
+
if (!value.startsWith("/") || value.startsWith("//")) return false;
|
|
24404
|
+
const path = normalisePath(value);
|
|
24405
|
+
if (path === "/") return false;
|
|
24406
|
+
return !livePaths.some((live) => {
|
|
24407
|
+
const p = normalisePath(live);
|
|
24408
|
+
return p === path || p !== "/" && path.startsWith(`${p}/`);
|
|
24409
|
+
});
|
|
24410
|
+
}
|
|
24411
|
+
var sameWords = (a, b) => a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
24412
|
+
function planBuildPageSync(links, msg) {
|
|
24413
|
+
const live = Array.isArray(msg.livePaths) ? msg.livePaths : [];
|
|
24414
|
+
const removed = new Set((msg.removed ?? []).map(normalisePath));
|
|
24415
|
+
const remove = [];
|
|
24416
|
+
const relabel = [];
|
|
24417
|
+
const retarget = [];
|
|
24418
|
+
const fallback = live.some((p) => normalisePath(p) === "/contact") ? "/contact" : "/";
|
|
24419
|
+
for (const link of links) {
|
|
24420
|
+
const href = link.href.trim();
|
|
24421
|
+
const isPage = href.startsWith("/") && !href.startsWith("//");
|
|
24422
|
+
if (isPage && (removed.has(normalisePath(href)) || live.length > 0 && isDeadPageHref(href, live))) {
|
|
24423
|
+
if (link.area === "chrome") retarget.push({ hrefKey: link.hrefKey, href: fallback });
|
|
24424
|
+
else remove.push(link.hrefKey);
|
|
24425
|
+
continue;
|
|
24426
|
+
}
|
|
24427
|
+
if (isPage) {
|
|
24428
|
+
const path = normalisePath(href);
|
|
24429
|
+
const rename = (msg.relabel ?? []).find((r2) => normalisePath(r2.path) === path);
|
|
24430
|
+
if (rename && sameWords(link.label, rename.oldTitle) && !sameWords(link.label, rename.label)) {
|
|
24431
|
+
relabel.push({ hrefKey: link.hrefKey, label: rename.label });
|
|
24432
|
+
}
|
|
24433
|
+
continue;
|
|
24434
|
+
}
|
|
24435
|
+
if (href.startsWith("#") || href.startsWith("/#")) {
|
|
24436
|
+
const anchor = href.replace(/^\/?#/u, "").toLowerCase();
|
|
24437
|
+
const target = (msg.anchorLabels ?? []).find((a) => a.anchors.some((id) => id.toLowerCase() === anchor));
|
|
24438
|
+
if (target && sameWords(link.label.replace(/\s+/gu, "-"), anchor) && !sameWords(link.label, target.label)) {
|
|
24439
|
+
relabel.push({ hrefKey: link.hrefKey, label: target.label });
|
|
24440
|
+
}
|
|
24441
|
+
}
|
|
24442
|
+
}
|
|
24443
|
+
return { remove, relabel, retarget };
|
|
24444
|
+
}
|
|
24445
|
+
function linkHref(el) {
|
|
24446
|
+
const key = el.getAttribute("data-ohw-href-key");
|
|
24447
|
+
const stored = key ? getStoredLinkHref(key) : void 0;
|
|
24448
|
+
return stored ?? el.getAttribute("href") ?? "";
|
|
24449
|
+
}
|
|
24450
|
+
function labelEl(anchor) {
|
|
24451
|
+
return anchor.querySelector('[data-ohw-editable="text"]');
|
|
24452
|
+
}
|
|
24453
|
+
function collectLinks() {
|
|
24454
|
+
const seen = /* @__PURE__ */ new Set();
|
|
24455
|
+
const links = [];
|
|
24456
|
+
document.querySelectorAll("[data-ohw-href-key]").forEach((el) => {
|
|
24457
|
+
const hrefKey = el.getAttribute("data-ohw-href-key") ?? "";
|
|
24458
|
+
if (seen.has(hrefKey)) return;
|
|
24459
|
+
const area = isNavbarHrefKey(hrefKey) ? "nav" : isFooterHrefKey(hrefKey) ? "footer" : CHROME_KEY_RE.test(hrefKey) ? "chrome" : null;
|
|
24460
|
+
if (!area) return;
|
|
24461
|
+
const label = labelEl(el);
|
|
24462
|
+
if (!label && area !== "chrome") return;
|
|
24463
|
+
seen.add(hrefKey);
|
|
24464
|
+
links.push({ hrefKey, href: linkHref(el), label: label?.textContent ?? el.textContent ?? "", area });
|
|
24465
|
+
});
|
|
24466
|
+
return links;
|
|
24467
|
+
}
|
|
24468
|
+
function applyBuildPageSync(msg, deps) {
|
|
24469
|
+
const plan = planBuildPageSync(collectLinks(), msg);
|
|
24470
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
24471
|
+
for (const hrefKey of plan.remove) {
|
|
24472
|
+
const anchor = document.querySelector(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`);
|
|
24473
|
+
if (!anchor) continue;
|
|
24474
|
+
const nav = isNavbarHrefKey(hrefKey);
|
|
24475
|
+
const result = nav ? deleteNavbarItem(anchor) : deleteFooterItem(anchor);
|
|
24476
|
+
if (!result) continue;
|
|
24477
|
+
for (const key of result.removedKeys) {
|
|
24478
|
+
nodes.set(key, "");
|
|
24479
|
+
clearStoredLinkHref(key);
|
|
24480
|
+
}
|
|
24481
|
+
nodes.set(nav ? NAV_ORDER_KEY : FOOTER_ORDER_KEY, result.orderJson);
|
|
24482
|
+
}
|
|
24483
|
+
for (const { hrefKey, label } of plan.relabel) {
|
|
24484
|
+
const labelKey = hrefKey.replace(/-href$/u, "-label");
|
|
24485
|
+
document.querySelectorAll(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`).forEach((anchor) => {
|
|
24486
|
+
const el = labelEl(anchor);
|
|
24487
|
+
if (el) el.textContent = label;
|
|
24488
|
+
});
|
|
24489
|
+
nodes.set(labelKey, label);
|
|
24490
|
+
}
|
|
24491
|
+
for (const { hrefKey, href } of plan.retarget) {
|
|
24492
|
+
setStoredLinkHref(hrefKey, href);
|
|
24493
|
+
document.querySelectorAll(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`).forEach((anchor) => {
|
|
24494
|
+
if (anchor instanceof HTMLAnchorElement) anchor.setAttribute("href", href);
|
|
24495
|
+
});
|
|
24496
|
+
nodes.set(hrefKey, href);
|
|
24497
|
+
}
|
|
24498
|
+
if (nodes.size === 0) return 0;
|
|
24499
|
+
deps.setEditContent({ ...deps.getEditContent(), ...Object.fromEntries(nodes) });
|
|
24500
|
+
deps.postToParent({
|
|
24501
|
+
type: "ow:change",
|
|
24502
|
+
nodes: [...nodes].map(([key, text]) => ({ key, text }))
|
|
24503
|
+
});
|
|
24504
|
+
return plan.remove.length + plan.relabel.length + plan.retarget.length;
|
|
24505
|
+
}
|
|
24506
|
+
function useBuildPageSync(isEditMode, editContentRef, postToParent2) {
|
|
24507
|
+
(0, import_react23.useEffect)(() => {
|
|
24508
|
+
if (!isEditMode) return;
|
|
24509
|
+
const onMessage = (e) => {
|
|
24510
|
+
if (e.source !== window.parent || e.data?.type !== "ow:pages-sync") return;
|
|
24511
|
+
const changed = applyBuildPageSync(e.data, {
|
|
24512
|
+
getEditContent: () => editContentRef.current,
|
|
24513
|
+
setEditContent: (next) => {
|
|
24514
|
+
editContentRef.current = next;
|
|
24515
|
+
},
|
|
24516
|
+
postToParent: postToParent2
|
|
24517
|
+
});
|
|
24518
|
+
postToParent2({ type: "ow:pages-synced", changed });
|
|
24519
|
+
};
|
|
24520
|
+
window.addEventListener("message", onMessage);
|
|
24521
|
+
return () => window.removeEventListener("message", onMessage);
|
|
24522
|
+
}, [isEditMode, editContentRef, postToParent2]);
|
|
24523
|
+
}
|
|
24524
|
+
|
|
24387
24525
|
// src/lib/nav-page-sync.ts
|
|
24388
24526
|
function labelKeyFor(hrefKey) {
|
|
24389
24527
|
return hrefKey.replace(/-href$/, "-label");
|
|
@@ -25838,9 +25976,9 @@ function FloatingToolbar({
|
|
|
25838
25976
|
showEditLink,
|
|
25839
25977
|
onEditLink
|
|
25840
25978
|
}) {
|
|
25841
|
-
const localRef =
|
|
25842
|
-
const [measuredW, setMeasuredW] =
|
|
25843
|
-
const setRefs =
|
|
25979
|
+
const localRef = import_react24.default.useRef(null);
|
|
25980
|
+
const [measuredW, setMeasuredW] = import_react24.default.useState(330);
|
|
25981
|
+
const setRefs = import_react24.default.useCallback(
|
|
25844
25982
|
(node) => {
|
|
25845
25983
|
localRef.current = node;
|
|
25846
25984
|
if (typeof elRef === "function") elRef(node);
|
|
@@ -25852,7 +25990,7 @@ function FloatingToolbar({
|
|
|
25852
25990
|
},
|
|
25853
25991
|
[elRef]
|
|
25854
25992
|
);
|
|
25855
|
-
|
|
25993
|
+
import_react24.default.useLayoutEffect(() => {
|
|
25856
25994
|
const node = localRef.current;
|
|
25857
25995
|
if (!node) return;
|
|
25858
25996
|
const update = () => {
|
|
@@ -25878,7 +26016,7 @@ function FloatingToolbar({
|
|
|
25878
26016
|
pointerEvents: "auto"
|
|
25879
26017
|
},
|
|
25880
26018
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(CustomToolbar, { children: [
|
|
25881
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
26019
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react24.default.Fragment, { children: [
|
|
25882
26020
|
gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CustomToolbarDivider, {}),
|
|
25883
26021
|
btns.map((btn) => {
|
|
25884
26022
|
const isActive = activeCommands.has(btn.cmd);
|
|
@@ -26087,8 +26225,8 @@ function OhhwellsBridge() {
|
|
|
26087
26225
|
const router = (0, import_navigation4.useRouter)();
|
|
26088
26226
|
const searchParams = (0, import_navigation4.useSearchParams)();
|
|
26089
26227
|
const isEditMode = isEditSessionActive();
|
|
26090
|
-
const [bridgeRoot, setBridgeRoot] = (0,
|
|
26091
|
-
(0,
|
|
26228
|
+
const [bridgeRoot, setBridgeRoot] = (0, import_react24.useState)(null);
|
|
26229
|
+
(0, import_react24.useEffect)(() => {
|
|
26092
26230
|
const figtreeFontId = "ohw-figtree-font";
|
|
26093
26231
|
if (!document.getElementById(figtreeFontId)) {
|
|
26094
26232
|
const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
|
|
@@ -26114,8 +26252,8 @@ function OhhwellsBridge() {
|
|
|
26114
26252
|
};
|
|
26115
26253
|
}, []);
|
|
26116
26254
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
26117
|
-
const [subdomain, setSubdomain] = (0,
|
|
26118
|
-
(0,
|
|
26255
|
+
const [subdomain, setSubdomain] = (0, import_react24.useState)(() => resolveSubdomain(subdomainFromQuery));
|
|
26256
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
26119
26257
|
const next = resolveSubdomain(subdomainFromQuery);
|
|
26120
26258
|
if (next !== subdomain) setSubdomain(next);
|
|
26121
26259
|
if (next) return;
|
|
@@ -26127,7 +26265,7 @@ function OhhwellsBridge() {
|
|
|
26127
26265
|
}, 0);
|
|
26128
26266
|
return () => window.clearTimeout(t);
|
|
26129
26267
|
}, [subdomainFromQuery, subdomain]);
|
|
26130
|
-
(0,
|
|
26268
|
+
(0, import_react24.useEffect)(() => {
|
|
26131
26269
|
if (!subdomainFromQuery || typeof window === "undefined") return;
|
|
26132
26270
|
const url = new URL(window.location.href);
|
|
26133
26271
|
if (!url.searchParams.has("subdomain")) return;
|
|
@@ -26139,22 +26277,22 @@ function OhhwellsBridge() {
|
|
|
26139
26277
|
useSavedLinkNavigation(isEditMode);
|
|
26140
26278
|
useNavDropdownToggle(isEditMode);
|
|
26141
26279
|
useHashLinkScroll(isEditMode);
|
|
26142
|
-
const postToParent2 = (0,
|
|
26280
|
+
const postToParent2 = (0, import_react24.useCallback)((data) => {
|
|
26143
26281
|
if (typeof window !== "undefined" && window.parent !== window) {
|
|
26144
26282
|
window.parent.postMessage(data, "*");
|
|
26145
26283
|
}
|
|
26146
26284
|
}, []);
|
|
26147
|
-
const [fetchState, setFetchState] = (0,
|
|
26148
|
-
const [showBranding, setShowBranding] = (0,
|
|
26149
|
-
const autoSaveTimers = (0,
|
|
26150
|
-
(0,
|
|
26285
|
+
const [fetchState, setFetchState] = (0, import_react24.useState)("idle");
|
|
26286
|
+
const [showBranding, setShowBranding] = (0, import_react24.useState)(false);
|
|
26287
|
+
const autoSaveTimers = (0, import_react24.useRef)(/* @__PURE__ */ new Map());
|
|
26288
|
+
(0, import_react24.useEffect)(() => {
|
|
26151
26289
|
stampBridgeVersionOnDocument();
|
|
26152
26290
|
}, []);
|
|
26153
|
-
(0,
|
|
26291
|
+
(0, import_react24.useEffect)(() => {
|
|
26154
26292
|
if (isEditMode) return;
|
|
26155
26293
|
return armLoaderHangBeacon(subdomain, fetchState);
|
|
26156
26294
|
}, [isEditMode, subdomain, fetchState]);
|
|
26157
|
-
(0,
|
|
26295
|
+
(0, import_react24.useEffect)(() => {
|
|
26158
26296
|
if (isEditMode || !subdomain) return;
|
|
26159
26297
|
const onError = (event) => {
|
|
26160
26298
|
reportOutageBeacon({
|
|
@@ -26175,40 +26313,40 @@ function OhhwellsBridge() {
|
|
|
26175
26313
|
window.removeEventListener("unhandledrejection", onRejection);
|
|
26176
26314
|
};
|
|
26177
26315
|
}, [isEditMode, subdomain]);
|
|
26178
|
-
const activeElRef = (0,
|
|
26179
|
-
const pointerHeldRef = (0,
|
|
26180
|
-
const selectedElRef = (0,
|
|
26181
|
-
const selectedHrefKeyRef = (0,
|
|
26182
|
-
const selectedFooterColAttrRef = (0,
|
|
26183
|
-
const footerHeadingTitleCacheRef = (0,
|
|
26184
|
-
const originalContentRef = (0,
|
|
26185
|
-
const activeStateElRef = (0,
|
|
26186
|
-
const parentScrollRef = (0,
|
|
26187
|
-
const visibleViewportRef = (0,
|
|
26188
|
-
const [dialogPortalContainer, setDialogPortalContainer] = (0,
|
|
26189
|
-
const attachVisibleViewport = (0,
|
|
26316
|
+
const activeElRef = (0, import_react24.useRef)(null);
|
|
26317
|
+
const pointerHeldRef = (0, import_react24.useRef)(false);
|
|
26318
|
+
const selectedElRef = (0, import_react24.useRef)(null);
|
|
26319
|
+
const selectedHrefKeyRef = (0, import_react24.useRef)(null);
|
|
26320
|
+
const selectedFooterColAttrRef = (0, import_react24.useRef)(null);
|
|
26321
|
+
const footerHeadingTitleCacheRef = (0, import_react24.useRef)(/* @__PURE__ */ new Map());
|
|
26322
|
+
const originalContentRef = (0, import_react24.useRef)(null);
|
|
26323
|
+
const activeStateElRef = (0, import_react24.useRef)(null);
|
|
26324
|
+
const parentScrollRef = (0, import_react24.useRef)(null);
|
|
26325
|
+
const visibleViewportRef = (0, import_react24.useRef)(null);
|
|
26326
|
+
const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react24.useState)(null);
|
|
26327
|
+
const attachVisibleViewport = (0, import_react24.useCallback)((node) => {
|
|
26190
26328
|
visibleViewportRef.current = node;
|
|
26191
26329
|
setDialogPortalContainer(node);
|
|
26192
26330
|
if (node) applyVisibleViewport(node, parentScrollRef.current);
|
|
26193
26331
|
}, []);
|
|
26194
|
-
const toolbarElRef = (0,
|
|
26195
|
-
const glowElRef = (0,
|
|
26196
|
-
const hoveredImageRef = (0,
|
|
26197
|
-
const hoveredImageHasTextOverlapRef = (0,
|
|
26198
|
-
const dragOverElRef = (0,
|
|
26199
|
-
const [mediaHover, setMediaHover] = (0,
|
|
26200
|
-
const [selectedAiSectionId, setSelectedAiSectionId] = (0,
|
|
26201
|
-
const selectedAiSectionIdRef = (0,
|
|
26202
|
-
const handleAiSectionSelectionChange = (0,
|
|
26332
|
+
const toolbarElRef = (0, import_react24.useRef)(null);
|
|
26333
|
+
const glowElRef = (0, import_react24.useRef)(null);
|
|
26334
|
+
const hoveredImageRef = (0, import_react24.useRef)(null);
|
|
26335
|
+
const hoveredImageHasTextOverlapRef = (0, import_react24.useRef)(false);
|
|
26336
|
+
const dragOverElRef = (0, import_react24.useRef)(null);
|
|
26337
|
+
const [mediaHover, setMediaHover] = (0, import_react24.useState)(null);
|
|
26338
|
+
const [selectedAiSectionId, setSelectedAiSectionId] = (0, import_react24.useState)(null);
|
|
26339
|
+
const selectedAiSectionIdRef = (0, import_react24.useRef)(null);
|
|
26340
|
+
const handleAiSectionSelectionChange = (0, import_react24.useCallback)((id) => {
|
|
26203
26341
|
selectedAiSectionIdRef.current = id;
|
|
26204
26342
|
setSelectedAiSectionId(id);
|
|
26205
26343
|
}, []);
|
|
26206
|
-
const [selectedMedia, setSelectedMedia] = (0,
|
|
26207
|
-
const selectedMediaElRef = (0,
|
|
26208
|
-
const mediaKeyDropTokenRef = (0,
|
|
26209
|
-
const selectedIconElRef = (0,
|
|
26210
|
-
const selectedSocialElRef = (0,
|
|
26211
|
-
const queueSectionKeyDrop = (0,
|
|
26344
|
+
const [selectedMedia, setSelectedMedia] = (0, import_react24.useState)(null);
|
|
26345
|
+
const selectedMediaElRef = (0, import_react24.useRef)(null);
|
|
26346
|
+
const mediaKeyDropTokenRef = (0, import_react24.useRef)(0);
|
|
26347
|
+
const selectedIconElRef = (0, import_react24.useRef)(null);
|
|
26348
|
+
const selectedSocialElRef = (0, import_react24.useRef)(null);
|
|
26349
|
+
const queueSectionKeyDrop = (0, import_react24.useCallback)((prev) => {
|
|
26212
26350
|
const sectionEl = prev?.closest("[data-ohw-section]") ?? null;
|
|
26213
26351
|
if (!sectionEl) return;
|
|
26214
26352
|
const sectionInstanceId = instanceIdOf(movableUnit(sectionEl)) || null;
|
|
@@ -26229,31 +26367,31 @@ function OhhwellsBridge() {
|
|
|
26229
26367
|
window.addEventListener("message", onQueueDrained);
|
|
26230
26368
|
window.postMessage({ type: "ow:media-key-drop", token }, "*");
|
|
26231
26369
|
}, []);
|
|
26232
|
-
const clearMediaSelection = (0,
|
|
26370
|
+
const clearMediaSelection = (0, import_react24.useCallback)(() => {
|
|
26233
26371
|
const prev = selectedMediaElRef.current;
|
|
26234
26372
|
selectedMediaElRef.current = null;
|
|
26235
26373
|
setSelectedMedia(null);
|
|
26236
26374
|
queueSectionKeyDrop(prev);
|
|
26237
26375
|
}, [queueSectionKeyDrop]);
|
|
26238
|
-
const clearMediaSelectionRef = (0,
|
|
26376
|
+
const clearMediaSelectionRef = (0, import_react24.useRef)(clearMediaSelection);
|
|
26239
26377
|
clearMediaSelectionRef.current = clearMediaSelection;
|
|
26240
|
-
const clearIconSelection = (0,
|
|
26378
|
+
const clearIconSelection = (0, import_react24.useCallback)(() => {
|
|
26241
26379
|
const prev = selectedIconElRef.current;
|
|
26242
26380
|
if (!prev) return;
|
|
26243
26381
|
selectedIconElRef.current = null;
|
|
26244
26382
|
queueSectionKeyDrop(prev);
|
|
26245
26383
|
}, [queueSectionKeyDrop]);
|
|
26246
|
-
const clearIconSelectionRef = (0,
|
|
26384
|
+
const clearIconSelectionRef = (0, import_react24.useRef)(clearIconSelection);
|
|
26247
26385
|
clearIconSelectionRef.current = clearIconSelection;
|
|
26248
|
-
const clearSocialSelection = (0,
|
|
26386
|
+
const clearSocialSelection = (0, import_react24.useCallback)(() => {
|
|
26249
26387
|
const prev = selectedSocialElRef.current;
|
|
26250
26388
|
if (!prev) return;
|
|
26251
26389
|
selectedSocialElRef.current = null;
|
|
26252
26390
|
queueSectionKeyDrop(prev);
|
|
26253
26391
|
}, [queueSectionKeyDrop]);
|
|
26254
|
-
const clearSocialSelectionRef = (0,
|
|
26392
|
+
const clearSocialSelectionRef = (0, import_react24.useRef)(clearSocialSelection);
|
|
26255
26393
|
clearSocialSelectionRef.current = clearSocialSelection;
|
|
26256
|
-
const selectIconElement = (0,
|
|
26394
|
+
const selectIconElement = (0, import_react24.useCallback)((el) => {
|
|
26257
26395
|
if (selectedMediaElRef.current) clearMediaSelectionRef.current();
|
|
26258
26396
|
selectedIconElRef.current = el;
|
|
26259
26397
|
const sectionEl = el.closest("[data-ohw-section]");
|
|
@@ -26266,9 +26404,9 @@ function OhhwellsBridge() {
|
|
|
26266
26404
|
keyLabel: "Icon"
|
|
26267
26405
|
});
|
|
26268
26406
|
}, []);
|
|
26269
|
-
const selectIconElementRef = (0,
|
|
26407
|
+
const selectIconElementRef = (0, import_react24.useRef)(selectIconElement);
|
|
26270
26408
|
selectIconElementRef.current = selectIconElement;
|
|
26271
|
-
const selectMediaElement = (0,
|
|
26409
|
+
const selectMediaElement = (0, import_react24.useCallback)((el) => {
|
|
26272
26410
|
const r2 = el.getBoundingClientRect();
|
|
26273
26411
|
const video = el.dataset.ohwEditable === "video" ? el.querySelector("video") : null;
|
|
26274
26412
|
selectedIconElRef.current = null;
|
|
@@ -26293,9 +26431,9 @@ function OhhwellsBridge() {
|
|
|
26293
26431
|
keyLabel: el.dataset.ohwEditable === "video" ? "Video" : el.dataset.ohwEditable === "bg-image" ? "Background" : "Image"
|
|
26294
26432
|
});
|
|
26295
26433
|
}, []);
|
|
26296
|
-
const selectMediaElementRef = (0,
|
|
26434
|
+
const selectMediaElementRef = (0, import_react24.useRef)(selectMediaElement);
|
|
26297
26435
|
selectMediaElementRef.current = selectMediaElement;
|
|
26298
|
-
(0,
|
|
26436
|
+
(0, import_react24.useEffect)(() => {
|
|
26299
26437
|
if (!selectedMedia) return;
|
|
26300
26438
|
const update = () => {
|
|
26301
26439
|
const el = selectedMediaElRef.current;
|
|
@@ -26315,54 +26453,54 @@ function OhhwellsBridge() {
|
|
|
26315
26453
|
window.removeEventListener("resize", update);
|
|
26316
26454
|
};
|
|
26317
26455
|
}, [selectedMedia !== null]);
|
|
26318
|
-
const [carouselHover, setCarouselHover] = (0,
|
|
26319
|
-
const [uploadingRects, setUploadingRects] = (0,
|
|
26320
|
-
const hoveredGapRef = (0,
|
|
26321
|
-
const imageUnhoverTimerRef = (0,
|
|
26322
|
-
const imageShowTimerRef = (0,
|
|
26323
|
-
const editStylesRef = (0,
|
|
26324
|
-
const activateRef = (0,
|
|
26456
|
+
const [carouselHover, setCarouselHover] = (0, import_react24.useState)(null);
|
|
26457
|
+
const [uploadingRects, setUploadingRects] = (0, import_react24.useState)({});
|
|
26458
|
+
const hoveredGapRef = (0, import_react24.useRef)(null);
|
|
26459
|
+
const imageUnhoverTimerRef = (0, import_react24.useRef)(null);
|
|
26460
|
+
const imageShowTimerRef = (0, import_react24.useRef)(null);
|
|
26461
|
+
const editStylesRef = (0, import_react24.useRef)(null);
|
|
26462
|
+
const activateRef = (0, import_react24.useRef)(() => {
|
|
26325
26463
|
});
|
|
26326
|
-
const deactivateRef = (0,
|
|
26464
|
+
const deactivateRef = (0, import_react24.useRef)(() => {
|
|
26327
26465
|
});
|
|
26328
|
-
const selectRef = (0,
|
|
26466
|
+
const selectRef = (0, import_react24.useRef)(() => {
|
|
26329
26467
|
});
|
|
26330
|
-
const selectFrameRef = (0,
|
|
26468
|
+
const selectFrameRef = (0, import_react24.useRef)(() => {
|
|
26331
26469
|
});
|
|
26332
|
-
const selectLogoRef = (0,
|
|
26470
|
+
const selectLogoRef = (0, import_react24.useRef)(() => {
|
|
26333
26471
|
});
|
|
26334
|
-
const openLogoSizePanelRef = (0,
|
|
26472
|
+
const openLogoSizePanelRef = (0, import_react24.useRef)(() => {
|
|
26335
26473
|
});
|
|
26336
|
-
const deselectRef = (0,
|
|
26474
|
+
const deselectRef = (0, import_react24.useRef)(() => {
|
|
26337
26475
|
});
|
|
26338
|
-
const closeFloatingPanelOnlyRef = (0,
|
|
26476
|
+
const closeFloatingPanelOnlyRef = (0, import_react24.useRef)(() => {
|
|
26339
26477
|
});
|
|
26340
|
-
const reselectNavigationItemRef = (0,
|
|
26478
|
+
const reselectNavigationItemRef = (0, import_react24.useRef)(() => {
|
|
26341
26479
|
});
|
|
26342
|
-
const commitNavigationTextEditRef = (0,
|
|
26480
|
+
const commitNavigationTextEditRef = (0, import_react24.useRef)(() => {
|
|
26343
26481
|
});
|
|
26344
|
-
const handleDeleteSelectedRef = (0,
|
|
26345
|
-
const runPendingDeleteUndoRef = (0,
|
|
26346
|
-
const isFooterFrameSelectionRef = (0,
|
|
26347
|
-
const refreshActiveCommandsRef = (0,
|
|
26482
|
+
const handleDeleteSelectedRef = (0, import_react24.useRef)(() => false);
|
|
26483
|
+
const runPendingDeleteUndoRef = (0, import_react24.useRef)(() => false);
|
|
26484
|
+
const isFooterFrameSelectionRef = (0, import_react24.useRef)(false);
|
|
26485
|
+
const refreshActiveCommandsRef = (0, import_react24.useRef)(() => {
|
|
26348
26486
|
});
|
|
26349
|
-
const postToParentRef = (0,
|
|
26487
|
+
const postToParentRef = (0, import_react24.useRef)(postToParent2);
|
|
26350
26488
|
postToParentRef.current = postToParent2;
|
|
26351
|
-
const aiSectionApiRef = (0,
|
|
26352
|
-
const sectionsLoadedRef = (0,
|
|
26353
|
-
const pendingScheduleConfigRequests = (0,
|
|
26354
|
-
const [toolbarRect, setToolbarRect] = (0,
|
|
26355
|
-
const [formPickRect, setFormPickRect] = (0,
|
|
26356
|
-
const formPickElRef = (0,
|
|
26357
|
-
const [formViewState, setFormViewStateUi] = (0,
|
|
26358
|
-
const [formPickCount, setFormPickCount] = (0,
|
|
26359
|
-
const [formHoverRect, setFormHoverRect] = (0,
|
|
26360
|
-
const formHoverElRef = (0,
|
|
26361
|
-
const [fieldPickRect, setFieldPickRect] = (0,
|
|
26362
|
-
const fieldPickElRef = (0,
|
|
26363
|
-
const [fieldPickState, setFieldPickState] = (0,
|
|
26364
|
-
const [fieldTypePickerOpen, setFieldTypePickerOpen] = (0,
|
|
26365
|
-
const clearFormPick = (0,
|
|
26489
|
+
const aiSectionApiRef = (0, import_react24.useRef)(null);
|
|
26490
|
+
const sectionsLoadedRef = (0, import_react24.useRef)(false);
|
|
26491
|
+
const pendingScheduleConfigRequests = (0, import_react24.useRef)([]);
|
|
26492
|
+
const [toolbarRect, setToolbarRect] = (0, import_react24.useState)(null);
|
|
26493
|
+
const [formPickRect, setFormPickRect] = (0, import_react24.useState)(null);
|
|
26494
|
+
const formPickElRef = (0, import_react24.useRef)(null);
|
|
26495
|
+
const [formViewState, setFormViewStateUi] = (0, import_react24.useState)("default");
|
|
26496
|
+
const [formPickCount, setFormPickCount] = (0, import_react24.useState)(null);
|
|
26497
|
+
const [formHoverRect, setFormHoverRect] = (0, import_react24.useState)(null);
|
|
26498
|
+
const formHoverElRef = (0, import_react24.useRef)(null);
|
|
26499
|
+
const [fieldPickRect, setFieldPickRect] = (0, import_react24.useState)(null);
|
|
26500
|
+
const fieldPickElRef = (0, import_react24.useRef)(null);
|
|
26501
|
+
const [fieldPickState, setFieldPickState] = (0, import_react24.useState)(null);
|
|
26502
|
+
const [fieldTypePickerOpen, setFieldTypePickerOpen] = (0, import_react24.useState)(false);
|
|
26503
|
+
const clearFormPick = (0, import_react24.useCallback)(() => {
|
|
26366
26504
|
const form = formPickElRef.current;
|
|
26367
26505
|
const editing = fieldPickElRef.current;
|
|
26368
26506
|
if (commitPlaceholderEdit(editing) && editing) {
|
|
@@ -26382,7 +26520,7 @@ function OhhwellsBridge() {
|
|
|
26382
26520
|
formPickElRef.current = null;
|
|
26383
26521
|
setFormPickRect(null);
|
|
26384
26522
|
}, []);
|
|
26385
|
-
const clearFieldPick = (0,
|
|
26523
|
+
const clearFieldPick = (0, import_react24.useCallback)(() => {
|
|
26386
26524
|
const wrapper = fieldPickElRef.current;
|
|
26387
26525
|
if (commitPlaceholderEdit(wrapper) && wrapper) {
|
|
26388
26526
|
const form = wrapper.closest('[data-ohw-editable="form"]');
|
|
@@ -26392,9 +26530,9 @@ function OhhwellsBridge() {
|
|
|
26392
26530
|
setFieldPickRect(null);
|
|
26393
26531
|
setFieldPickState(null);
|
|
26394
26532
|
}, []);
|
|
26395
|
-
const persistFieldsRef = (0,
|
|
26533
|
+
const persistFieldsRef = (0, import_react24.useRef)(() => {
|
|
26396
26534
|
});
|
|
26397
|
-
const persistFields = (0,
|
|
26535
|
+
const persistFields = (0, import_react24.useCallback)(
|
|
26398
26536
|
(form) => {
|
|
26399
26537
|
const key = formKeyOf(form);
|
|
26400
26538
|
if (!key) return;
|
|
@@ -26405,7 +26543,7 @@ function OhhwellsBridge() {
|
|
|
26405
26543
|
[]
|
|
26406
26544
|
);
|
|
26407
26545
|
persistFieldsRef.current = persistFields;
|
|
26408
|
-
const selectField = (0,
|
|
26546
|
+
const selectField = (0, import_react24.useCallback)((wrapper) => {
|
|
26409
26547
|
if (fieldPickElRef.current && fieldPickElRef.current !== wrapper) {
|
|
26410
26548
|
commitPlaceholderEdit(fieldPickElRef.current);
|
|
26411
26549
|
}
|
|
@@ -26418,7 +26556,7 @@ function OhhwellsBridge() {
|
|
|
26418
26556
|
setFieldPickState({ type: fieldTypeOf(wrapper), required: isFieldRequired(wrapper) });
|
|
26419
26557
|
setFieldTypePickerOpen(false);
|
|
26420
26558
|
}, []);
|
|
26421
|
-
const withSelectedField = (0,
|
|
26559
|
+
const withSelectedField = (0, import_react24.useCallback)(
|
|
26422
26560
|
(run) => {
|
|
26423
26561
|
const wrapper = fieldPickElRef.current;
|
|
26424
26562
|
const form = formPickElRef.current;
|
|
@@ -26431,28 +26569,28 @@ function OhhwellsBridge() {
|
|
|
26431
26569
|
},
|
|
26432
26570
|
[persistFields]
|
|
26433
26571
|
);
|
|
26434
|
-
const handleFieldTypeChange = (0,
|
|
26572
|
+
const handleFieldTypeChange = (0, import_react24.useCallback)(
|
|
26435
26573
|
(type) => withSelectedField((_form, wrapper) => {
|
|
26436
26574
|
applyFieldType(wrapper, type);
|
|
26437
26575
|
selectField(wrapper);
|
|
26438
26576
|
}),
|
|
26439
26577
|
[selectField, withSelectedField]
|
|
26440
26578
|
);
|
|
26441
|
-
const handleFieldRequiredToggle = (0,
|
|
26579
|
+
const handleFieldRequiredToggle = (0, import_react24.useCallback)(
|
|
26442
26580
|
() => withSelectedField((_form, wrapper) => {
|
|
26443
26581
|
setFieldRequired(wrapper, !isFieldRequired(wrapper));
|
|
26444
26582
|
selectField(wrapper);
|
|
26445
26583
|
}),
|
|
26446
26584
|
[selectField, withSelectedField]
|
|
26447
26585
|
);
|
|
26448
|
-
const handleFieldDuplicate = (0,
|
|
26586
|
+
const handleFieldDuplicate = (0, import_react24.useCallback)(
|
|
26449
26587
|
() => withSelectedField((form, wrapper) => {
|
|
26450
26588
|
const copy = duplicateField(form, wrapper);
|
|
26451
26589
|
selectField(copy);
|
|
26452
26590
|
}),
|
|
26453
26591
|
[selectField, withSelectedField]
|
|
26454
26592
|
);
|
|
26455
|
-
const handleFieldDelete = (0,
|
|
26593
|
+
const handleFieldDelete = (0, import_react24.useCallback)(
|
|
26456
26594
|
() => withSelectedField((_form, wrapper) => {
|
|
26457
26595
|
removeField(wrapper);
|
|
26458
26596
|
clearFieldPick();
|
|
@@ -26460,7 +26598,7 @@ function OhhwellsBridge() {
|
|
|
26460
26598
|
}),
|
|
26461
26599
|
[clearFieldPick, withSelectedField]
|
|
26462
26600
|
);
|
|
26463
|
-
const handleAddField = (0,
|
|
26601
|
+
const handleAddField = (0, import_react24.useCallback)(
|
|
26464
26602
|
(type) => {
|
|
26465
26603
|
const form = formPickElRef.current;
|
|
26466
26604
|
if (!form) return;
|
|
@@ -26476,8 +26614,8 @@ function OhhwellsBridge() {
|
|
|
26476
26614
|
},
|
|
26477
26615
|
[persistFields, selectField]
|
|
26478
26616
|
);
|
|
26479
|
-
const fieldDragRef = (0,
|
|
26480
|
-
const buildFieldDropSlots = (0,
|
|
26617
|
+
const fieldDragRef = (0, import_react24.useRef)(null);
|
|
26618
|
+
const buildFieldDropSlots = (0, import_react24.useCallback)((form, draggedKey) => {
|
|
26481
26619
|
const others = listFieldWrappers(form).filter((el) => fieldKeyOf(el) !== draggedKey);
|
|
26482
26620
|
const slots = others.map((el) => {
|
|
26483
26621
|
const rect = el.getBoundingClientRect();
|
|
@@ -26490,7 +26628,7 @@ function OhhwellsBridge() {
|
|
|
26490
26628
|
}
|
|
26491
26629
|
return slots;
|
|
26492
26630
|
}, []);
|
|
26493
|
-
const handleFieldDragStart = (0,
|
|
26631
|
+
const handleFieldDragStart = (0, import_react24.useCallback)(() => {
|
|
26494
26632
|
const wrapper = fieldPickElRef.current;
|
|
26495
26633
|
const form = formPickElRef.current;
|
|
26496
26634
|
if (!wrapper || !form) return;
|
|
@@ -26499,18 +26637,18 @@ function OhhwellsBridge() {
|
|
|
26499
26637
|
setFieldDragging(true);
|
|
26500
26638
|
setFieldDropSlots(buildFieldDropSlots(form, key));
|
|
26501
26639
|
}, [buildFieldDropSlots]);
|
|
26502
|
-
const handleFieldDragEnd = (0,
|
|
26640
|
+
const handleFieldDragEnd = (0, import_react24.useCallback)(() => {
|
|
26503
26641
|
fieldDragRef.current = null;
|
|
26504
26642
|
setFieldDropIndex(null);
|
|
26505
26643
|
setFieldDropSlots([]);
|
|
26506
26644
|
setFieldDragging(false);
|
|
26507
26645
|
}, []);
|
|
26508
|
-
const [fieldDropIndex, setFieldDropIndex] = (0,
|
|
26509
|
-
const [fieldDropSlots, setFieldDropSlots] = (0,
|
|
26510
|
-
const [fieldDragging, setFieldDragging] = (0,
|
|
26511
|
-
const clearFormPickRef = (0,
|
|
26646
|
+
const [fieldDropIndex, setFieldDropIndex] = (0, import_react24.useState)(null);
|
|
26647
|
+
const [fieldDropSlots, setFieldDropSlots] = (0, import_react24.useState)([]);
|
|
26648
|
+
const [fieldDragging, setFieldDragging] = (0, import_react24.useState)(false);
|
|
26649
|
+
const clearFormPickRef = (0, import_react24.useRef)(clearFormPick);
|
|
26512
26650
|
clearFormPickRef.current = clearFormPick;
|
|
26513
|
-
(0,
|
|
26651
|
+
(0, import_react24.useEffect)(() => {
|
|
26514
26652
|
const el = fieldPickElRef.current;
|
|
26515
26653
|
if (!el || fieldPickRect === null) return;
|
|
26516
26654
|
const observer = new ResizeObserver(() => {
|
|
@@ -26519,7 +26657,7 @@ function OhhwellsBridge() {
|
|
|
26519
26657
|
observer.observe(el);
|
|
26520
26658
|
return () => observer.disconnect();
|
|
26521
26659
|
}, [fieldPickRect !== null, fieldPickState]);
|
|
26522
|
-
(0,
|
|
26660
|
+
(0, import_react24.useEffect)(() => {
|
|
26523
26661
|
const el = formPickElRef.current;
|
|
26524
26662
|
if (!el || formPickRect === null) return;
|
|
26525
26663
|
const observer = new ResizeObserver(() => {
|
|
@@ -26528,25 +26666,25 @@ function OhhwellsBridge() {
|
|
|
26528
26666
|
observer.observe(el);
|
|
26529
26667
|
return () => observer.disconnect();
|
|
26530
26668
|
}, [formPickRect !== null, formViewState]);
|
|
26531
|
-
const [toolbarVariant, setToolbarVariant] = (0,
|
|
26532
|
-
const toolbarVariantRef = (0,
|
|
26669
|
+
const [toolbarVariant, setToolbarVariant] = (0, import_react24.useState)("none");
|
|
26670
|
+
const toolbarVariantRef = (0, import_react24.useRef)("none");
|
|
26533
26671
|
toolbarVariantRef.current = toolbarVariant;
|
|
26534
|
-
const [selectedIsCta, setSelectedIsCta] = (0,
|
|
26535
|
-
const [selectedIsSocial, setSelectedIsSocial] = (0,
|
|
26536
|
-
const [selectedIsSocialsRow, setSelectedIsSocialsRow] = (0,
|
|
26537
|
-
const [reorderHrefKey, setReorderHrefKey] = (0,
|
|
26538
|
-
const [reorderDragDisabled, setReorderDragDisabled] = (0,
|
|
26539
|
-
const [toggleState, setToggleState] = (0,
|
|
26540
|
-
const [maxBadge, setMaxBadge] = (0,
|
|
26541
|
-
const [activeCommands, setActiveCommands] = (0,
|
|
26542
|
-
const [sectionGap, setSectionGap] = (0,
|
|
26543
|
-
const [toolbarShowEditLink, setToolbarShowEditLink] = (0,
|
|
26544
|
-
const hoveredNavContainerRef = (0,
|
|
26545
|
-
const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0,
|
|
26546
|
-
const hoveredItemElRef = (0,
|
|
26547
|
-
const [hoveredItemRect, setHoveredItemRect] = (0,
|
|
26548
|
-
const [hoveredTextRect, setHoveredTextRect] = (0,
|
|
26549
|
-
(0,
|
|
26672
|
+
const [selectedIsCta, setSelectedIsCta] = (0, import_react24.useState)(false);
|
|
26673
|
+
const [selectedIsSocial, setSelectedIsSocial] = (0, import_react24.useState)(false);
|
|
26674
|
+
const [selectedIsSocialsRow, setSelectedIsSocialsRow] = (0, import_react24.useState)(false);
|
|
26675
|
+
const [reorderHrefKey, setReorderHrefKey] = (0, import_react24.useState)(null);
|
|
26676
|
+
const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react24.useState)(false);
|
|
26677
|
+
const [toggleState, setToggleState] = (0, import_react24.useState)(null);
|
|
26678
|
+
const [maxBadge, setMaxBadge] = (0, import_react24.useState)(null);
|
|
26679
|
+
const [activeCommands, setActiveCommands] = (0, import_react24.useState)(/* @__PURE__ */ new Set());
|
|
26680
|
+
const [sectionGap, setSectionGap] = (0, import_react24.useState)(null);
|
|
26681
|
+
const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react24.useState)(false);
|
|
26682
|
+
const hoveredNavContainerRef = (0, import_react24.useRef)(null);
|
|
26683
|
+
const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react24.useState)(null);
|
|
26684
|
+
const hoveredItemElRef = (0, import_react24.useRef)(null);
|
|
26685
|
+
const [hoveredItemRect, setHoveredItemRect] = (0, import_react24.useState)(null);
|
|
26686
|
+
const [hoveredTextRect, setHoveredTextRect] = (0, import_react24.useState)(null);
|
|
26687
|
+
(0, import_react24.useEffect)(() => {
|
|
26550
26688
|
const sync = () => {
|
|
26551
26689
|
const el = document.querySelector(
|
|
26552
26690
|
'[data-ohw-hovered]:not([contenteditable]):not([data-ohw-href-key]):not([data-ohw-editable="form"] *)'
|
|
@@ -26590,65 +26728,66 @@ function OhhwellsBridge() {
|
|
|
26590
26728
|
});
|
|
26591
26729
|
return () => observer.disconnect();
|
|
26592
26730
|
}, []);
|
|
26593
|
-
const siblingHintElRef = (0,
|
|
26594
|
-
const [siblingHintRect, setSiblingHintRect] = (0,
|
|
26595
|
-
const [siblingHintRects, setSiblingHintRects] = (0,
|
|
26596
|
-
const [isItemDragging, setIsItemDragging] = (0,
|
|
26597
|
-
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0,
|
|
26731
|
+
const siblingHintElRef = (0, import_react24.useRef)(null);
|
|
26732
|
+
const [siblingHintRect, setSiblingHintRect] = (0, import_react24.useState)(null);
|
|
26733
|
+
const [siblingHintRects, setSiblingHintRects] = (0, import_react24.useState)([]);
|
|
26734
|
+
const [isItemDragging, setIsItemDragging] = (0, import_react24.useState)(false);
|
|
26735
|
+
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react24.useState)(false);
|
|
26598
26736
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26599
|
-
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0,
|
|
26600
|
-
const [footerHeadingVisible, setFooterHeadingVisible] = (0,
|
|
26601
|
-
const footerDragRef = (0,
|
|
26602
|
-
const [footerDropSlots, setFooterDropSlots] = (0,
|
|
26603
|
-
const [activeFooterDropIndex, setActiveFooterDropIndex] = (0,
|
|
26604
|
-
const [draggedItemRect, setDraggedItemRect] = (0,
|
|
26605
|
-
const footerPointerDragRef = (0,
|
|
26606
|
-
const suppressNextClickRef = (0,
|
|
26607
|
-
const suppressClickUntilRef = (0,
|
|
26608
|
-
const [linkPopover, setLinkPopover] = (0,
|
|
26609
|
-
const linkPopoverSessionRef = (0,
|
|
26610
|
-
const addNavAfterAnchorRef = (0,
|
|
26611
|
-
const editContentRef = (0,
|
|
26612
|
-
|
|
26613
|
-
const
|
|
26614
|
-
const
|
|
26737
|
+
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react24.useState)(null);
|
|
26738
|
+
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react24.useState)(null);
|
|
26739
|
+
const footerDragRef = (0, import_react24.useRef)(null);
|
|
26740
|
+
const [footerDropSlots, setFooterDropSlots] = (0, import_react24.useState)([]);
|
|
26741
|
+
const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react24.useState)(null);
|
|
26742
|
+
const [draggedItemRect, setDraggedItemRect] = (0, import_react24.useState)(null);
|
|
26743
|
+
const footerPointerDragRef = (0, import_react24.useRef)(null);
|
|
26744
|
+
const suppressNextClickRef = (0, import_react24.useRef)(false);
|
|
26745
|
+
const suppressClickUntilRef = (0, import_react24.useRef)(0);
|
|
26746
|
+
const [linkPopover, setLinkPopover] = (0, import_react24.useState)(null);
|
|
26747
|
+
const linkPopoverSessionRef = (0, import_react24.useRef)(null);
|
|
26748
|
+
const addNavAfterAnchorRef = (0, import_react24.useRef)(null);
|
|
26749
|
+
const editContentRef = (0, import_react24.useRef)({});
|
|
26750
|
+
useBuildPageSync(isEditMode, editContentRef, postToParent2);
|
|
26751
|
+
const aiSectionsRef = (0, import_react24.useRef)("");
|
|
26752
|
+
const aiFooterRef = (0, import_react24.useRef)("");
|
|
26753
|
+
const applyTreeLocalRef = (0, import_react24.useRef)(
|
|
26615
26754
|
null
|
|
26616
26755
|
);
|
|
26617
|
-
const applyFooterTreeLocalRef = (0,
|
|
26618
|
-
const clearInteractionChromeRef = (0,
|
|
26756
|
+
const applyFooterTreeLocalRef = (0, import_react24.useRef)(null);
|
|
26757
|
+
const clearInteractionChromeRef = (0, import_react24.useRef)(() => {
|
|
26619
26758
|
});
|
|
26620
|
-
const brandKitRef = (0,
|
|
26621
|
-
const stylesRef = (0,
|
|
26622
|
-
const appliedDrawerRef = (0,
|
|
26623
|
-
const pendingDeleteUndoRef = (0,
|
|
26624
|
-
const [floatingPanel, setFloatingPanel] = (0,
|
|
26625
|
-
const floatingPanelOpenRef = (0,
|
|
26626
|
-
const floatingPanelRef = (0,
|
|
26759
|
+
const brandKitRef = (0, import_react24.useRef)("");
|
|
26760
|
+
const stylesRef = (0, import_react24.useRef)("");
|
|
26761
|
+
const appliedDrawerRef = (0, import_react24.useRef)(null);
|
|
26762
|
+
const pendingDeleteUndoRef = (0, import_react24.useRef)(null);
|
|
26763
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react24.useState)(null);
|
|
26764
|
+
const floatingPanelOpenRef = (0, import_react24.useRef)(false);
|
|
26765
|
+
const floatingPanelRef = (0, import_react24.useRef)(null);
|
|
26627
26766
|
floatingPanelRef.current = floatingPanel;
|
|
26628
|
-
const setFloatingPanelRef = (0,
|
|
26629
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0,
|
|
26630
|
-
const buttonCollectionDragRef = (0,
|
|
26631
|
-
const buttonDropInsertIndexRef = (0,
|
|
26632
|
-
const [buttonDropSlots, setButtonDropSlots] = (0,
|
|
26633
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0,
|
|
26634
|
-
const buttonPointerDragRef = (0,
|
|
26635
|
-
const [buttonStyleTick, setButtonStyleTick] = (0,
|
|
26636
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0,
|
|
26637
|
-
const [editorViewport, setEditorViewport] = (0,
|
|
26638
|
-
const [parentScrollSnap, setParentScrollSnap] = (0,
|
|
26639
|
-
const [sitePages, setSitePages] = (0,
|
|
26640
|
-
const collectionItemsRef = (0,
|
|
26641
|
-
const [sectionsByPath, setSectionsByPath] = (0,
|
|
26642
|
-
const sectionsPrefetchGenRef = (0,
|
|
26643
|
-
const setLinkPopoverRef = (0,
|
|
26644
|
-
const linkPopoverPanelRef = (0,
|
|
26645
|
-
const linkPopoverOpenRef = (0,
|
|
26646
|
-
const linkPopoverGraceUntilRef = (0,
|
|
26767
|
+
const setFloatingPanelRef = (0, import_react24.useRef)(setFloatingPanel);
|
|
26768
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react24.useState)(null);
|
|
26769
|
+
const buttonCollectionDragRef = (0, import_react24.useRef)(null);
|
|
26770
|
+
const buttonDropInsertIndexRef = (0, import_react24.useRef)(null);
|
|
26771
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react24.useState)([]);
|
|
26772
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react24.useState)(null);
|
|
26773
|
+
const buttonPointerDragRef = (0, import_react24.useRef)(null);
|
|
26774
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react24.useState)(0);
|
|
26775
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react24.useState)(null);
|
|
26776
|
+
const [editorViewport, setEditorViewport] = (0, import_react24.useState)("desktop");
|
|
26777
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react24.useState)(null);
|
|
26778
|
+
const [sitePages, setSitePages] = (0, import_react24.useState)([]);
|
|
26779
|
+
const collectionItemsRef = (0, import_react24.useRef)(/* @__PURE__ */ new Map());
|
|
26780
|
+
const [sectionsByPath, setSectionsByPath] = (0, import_react24.useState)({});
|
|
26781
|
+
const sectionsPrefetchGenRef = (0, import_react24.useRef)(0);
|
|
26782
|
+
const setLinkPopoverRef = (0, import_react24.useRef)(setLinkPopover);
|
|
26783
|
+
const linkPopoverPanelRef = (0, import_react24.useRef)(null);
|
|
26784
|
+
const linkPopoverOpenRef = (0, import_react24.useRef)(false);
|
|
26785
|
+
const linkPopoverGraceUntilRef = (0, import_react24.useRef)(0);
|
|
26647
26786
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26648
26787
|
setFloatingPanelRef.current = setFloatingPanel;
|
|
26649
26788
|
linkPopoverSessionRef.current = linkPopover;
|
|
26650
26789
|
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
26651
|
-
(0,
|
|
26790
|
+
(0, import_react24.useEffect)(() => {
|
|
26652
26791
|
const syncViewport = () => {
|
|
26653
26792
|
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26654
26793
|
setEditorViewport((prev) => prev === next ? prev : next);
|
|
@@ -26657,7 +26796,7 @@ function OhhwellsBridge() {
|
|
|
26657
26796
|
window.addEventListener("resize", syncViewport);
|
|
26658
26797
|
return () => window.removeEventListener("resize", syncViewport);
|
|
26659
26798
|
}, []);
|
|
26660
|
-
(0,
|
|
26799
|
+
(0, import_react24.useEffect)(() => {
|
|
26661
26800
|
setSectionOrderPersistHandler((entries) => {
|
|
26662
26801
|
const currentPath = window.location.pathname;
|
|
26663
26802
|
const merged = mergePageSectionOrder(editContentRef.current[SECTION_ORDER_KEY], currentPath, entries);
|
|
@@ -26667,7 +26806,7 @@ function OhhwellsBridge() {
|
|
|
26667
26806
|
});
|
|
26668
26807
|
return () => setSectionOrderPersistHandler(null);
|
|
26669
26808
|
}, []);
|
|
26670
|
-
(0,
|
|
26809
|
+
(0, import_react24.useEffect)(() => {
|
|
26671
26810
|
setAiFooterMountOptions({
|
|
26672
26811
|
resolvePageHref: (pageOrAnchorId) => {
|
|
26673
26812
|
const [pageId, anchor] = pageOrAnchorId.split("#");
|
|
@@ -26730,7 +26869,7 @@ function OhhwellsBridge() {
|
|
|
26730
26869
|
const bumpLinkPopoverGrace = () => {
|
|
26731
26870
|
linkPopoverGraceUntilRef.current = Date.now() + 350;
|
|
26732
26871
|
};
|
|
26733
|
-
const runSectionsPrefetch = (0,
|
|
26872
|
+
const runSectionsPrefetch = (0, import_react24.useCallback)((pages) => {
|
|
26734
26873
|
if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
|
|
26735
26874
|
const gen = ++sectionsPrefetchGenRef.current;
|
|
26736
26875
|
const paths = pages.map((p) => p.path);
|
|
@@ -26749,9 +26888,9 @@ function OhhwellsBridge() {
|
|
|
26749
26888
|
);
|
|
26750
26889
|
});
|
|
26751
26890
|
}, [isEditMode, pathname]);
|
|
26752
|
-
const runSectionsPrefetchRef = (0,
|
|
26891
|
+
const runSectionsPrefetchRef = (0, import_react24.useRef)(runSectionsPrefetch);
|
|
26753
26892
|
runSectionsPrefetchRef.current = runSectionsPrefetch;
|
|
26754
|
-
(0,
|
|
26893
|
+
(0, import_react24.useEffect)(() => {
|
|
26755
26894
|
if (!linkPopover) {
|
|
26756
26895
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
26757
26896
|
return;
|
|
@@ -26779,7 +26918,7 @@ function OhhwellsBridge() {
|
|
|
26779
26918
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
26780
26919
|
};
|
|
26781
26920
|
}, [linkPopover, postToParent2]);
|
|
26782
|
-
(0,
|
|
26921
|
+
(0, import_react24.useEffect)(() => {
|
|
26783
26922
|
if (!isEditMode) return;
|
|
26784
26923
|
const useFixtures = shouldUseDevFixtures();
|
|
26785
26924
|
if (useFixtures) {
|
|
@@ -26805,7 +26944,7 @@ function OhhwellsBridge() {
|
|
|
26805
26944
|
if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
|
|
26806
26945
|
return () => window.removeEventListener("message", onSitePages);
|
|
26807
26946
|
}, [isEditMode, postToParent2]);
|
|
26808
|
-
(0,
|
|
26947
|
+
(0, import_react24.useEffect)(() => {
|
|
26809
26948
|
if (!isEditMode) return;
|
|
26810
26949
|
const deps = {
|
|
26811
26950
|
getEditContent: () => editContentRef.current,
|
|
@@ -26842,14 +26981,14 @@ function OhhwellsBridge() {
|
|
|
26842
26981
|
window.addEventListener("message", onPageMessage);
|
|
26843
26982
|
return () => window.removeEventListener("message", onPageMessage);
|
|
26844
26983
|
}, [isEditMode, postToParent2]);
|
|
26845
|
-
(0,
|
|
26984
|
+
(0, import_react24.useEffect)(() => {
|
|
26846
26985
|
if (!isEditMode || shouldUseDevFixtures()) return;
|
|
26847
26986
|
void loadAllSectionsManifest().then((manifest) => {
|
|
26848
26987
|
if (Object.keys(manifest).length === 0) return;
|
|
26849
26988
|
setSectionsByPath((prev) => ({ ...manifest, ...prev }));
|
|
26850
26989
|
});
|
|
26851
26990
|
}, [isEditMode]);
|
|
26852
|
-
(0,
|
|
26991
|
+
(0, import_react24.useEffect)(() => {
|
|
26853
26992
|
const update = () => {
|
|
26854
26993
|
const el = activeElRef.current ?? selectedElRef.current;
|
|
26855
26994
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
@@ -26873,10 +27012,10 @@ function OhhwellsBridge() {
|
|
|
26873
27012
|
vvp.removeEventListener("resize", update);
|
|
26874
27013
|
};
|
|
26875
27014
|
}, []);
|
|
26876
|
-
const refreshStateRules = (0,
|
|
27015
|
+
const refreshStateRules = (0, import_react24.useCallback)(() => {
|
|
26877
27016
|
editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
|
|
26878
27017
|
}, []);
|
|
26879
|
-
const processConfigRequest = (0,
|
|
27018
|
+
const processConfigRequest = (0, import_react24.useCallback)((insertAfterVal) => {
|
|
26880
27019
|
const tracker = getSectionsTracker();
|
|
26881
27020
|
let entries = [];
|
|
26882
27021
|
try {
|
|
@@ -26899,7 +27038,7 @@ function OhhwellsBridge() {
|
|
|
26899
27038
|
}
|
|
26900
27039
|
window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
|
|
26901
27040
|
}, [isEditMode]);
|
|
26902
|
-
const deactivate = (0,
|
|
27041
|
+
const deactivate = (0, import_react24.useCallback)(() => {
|
|
26903
27042
|
const el = activeElRef.current;
|
|
26904
27043
|
if (!el) return;
|
|
26905
27044
|
const isFormBlock = el.dataset.ohwEditable === "form";
|
|
@@ -26965,12 +27104,12 @@ function OhhwellsBridge() {
|
|
|
26965
27104
|
setToolbarShowEditLink(false);
|
|
26966
27105
|
postToParent2({ type: "ow:exit-edit" });
|
|
26967
27106
|
}, [postToParent2]);
|
|
26968
|
-
const clearSelectedAttr = (0,
|
|
27107
|
+
const clearSelectedAttr = (0, import_react24.useCallback)(() => {
|
|
26969
27108
|
document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
|
|
26970
27109
|
el.removeAttribute("data-ohw-selected");
|
|
26971
27110
|
});
|
|
26972
27111
|
}, []);
|
|
26973
|
-
const deselect = (0,
|
|
27112
|
+
const deselect = (0, import_react24.useCallback)(() => {
|
|
26974
27113
|
const nestedGroup = selectedElRef.current?.closest("[data-ohw-nav-children]") != null ? selectedElRef.current.closest("[data-ohw-nav-group]") : null;
|
|
26975
27114
|
clearSelectedAttr();
|
|
26976
27115
|
selectedElRef.current = null;
|
|
@@ -27006,20 +27145,20 @@ function OhhwellsBridge() {
|
|
|
27006
27145
|
setToolbarVariant("none");
|
|
27007
27146
|
}
|
|
27008
27147
|
}, [clearSelectedAttr]);
|
|
27009
|
-
const markSelected = (0,
|
|
27148
|
+
const markSelected = (0, import_react24.useCallback)((el) => {
|
|
27010
27149
|
clearSelectedAttr();
|
|
27011
27150
|
el.removeAttribute("data-ohw-hovered");
|
|
27012
27151
|
el.setAttribute("data-ohw-selected", "");
|
|
27013
27152
|
}, [clearSelectedAttr]);
|
|
27014
|
-
const isSelectedForHover = (0,
|
|
27153
|
+
const isSelectedForHover = (0, import_react24.useCallback)((el) => {
|
|
27015
27154
|
if (!el) return false;
|
|
27016
27155
|
return [selectedElRef.current, activeElRef.current].some(
|
|
27017
27156
|
(busy) => busy && (el === busy || busy.contains(el) || el.contains(busy))
|
|
27018
27157
|
);
|
|
27019
27158
|
}, []);
|
|
27020
|
-
const isSelectedForHoverRef = (0,
|
|
27159
|
+
const isSelectedForHoverRef = (0, import_react24.useRef)(isSelectedForHover);
|
|
27021
27160
|
isSelectedForHoverRef.current = isSelectedForHover;
|
|
27022
|
-
const resolveHrefKeyElement = (0,
|
|
27161
|
+
const resolveHrefKeyElement = (0, import_react24.useCallback)((hrefKey) => {
|
|
27023
27162
|
if (isFooterHrefKey(hrefKey)) {
|
|
27024
27163
|
return document.querySelector(
|
|
27025
27164
|
`footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
@@ -27034,7 +27173,7 @@ function OhhwellsBridge() {
|
|
|
27034
27173
|
`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
27035
27174
|
);
|
|
27036
27175
|
}, []);
|
|
27037
|
-
const resyncSelectedNavigationItem = (0,
|
|
27176
|
+
const resyncSelectedNavigationItem = (0, import_react24.useCallback)(() => {
|
|
27038
27177
|
const hrefKey = selectedHrefKeyRef.current;
|
|
27039
27178
|
if (hrefKey) {
|
|
27040
27179
|
const link = resolveHrefKeyElement(hrefKey);
|
|
@@ -27072,7 +27211,7 @@ function OhhwellsBridge() {
|
|
|
27072
27211
|
);
|
|
27073
27212
|
}
|
|
27074
27213
|
}, [resolveHrefKeyElement]);
|
|
27075
|
-
const reselectNavigationItem = (0,
|
|
27214
|
+
const reselectNavigationItem = (0, import_react24.useCallback)((navAnchor) => {
|
|
27076
27215
|
selectedElRef.current = navAnchor;
|
|
27077
27216
|
selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
|
|
27078
27217
|
selectedFooterColAttrRef.current = null;
|
|
@@ -27103,7 +27242,7 @@ function OhhwellsBridge() {
|
|
|
27103
27242
|
setToolbarShowEditLink(false);
|
|
27104
27243
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
27105
27244
|
}, [markSelected]);
|
|
27106
|
-
const commitNavigationTextEdit = (0,
|
|
27245
|
+
const commitNavigationTextEdit = (0, import_react24.useCallback)((navAnchor) => {
|
|
27107
27246
|
const el = activeElRef.current;
|
|
27108
27247
|
if (!el) return;
|
|
27109
27248
|
const key = el.dataset.ohwKey;
|
|
@@ -27136,7 +27275,7 @@ function OhhwellsBridge() {
|
|
|
27136
27275
|
postToParent2({ type: "ow:exit-edit" });
|
|
27137
27276
|
reselectNavigationItem(navAnchor);
|
|
27138
27277
|
}, [postToParent2, reselectNavigationItem]);
|
|
27139
|
-
const handleAddTopLevelNavItem = (0,
|
|
27278
|
+
const handleAddTopLevelNavItem = (0, import_react24.useCallback)(() => {
|
|
27140
27279
|
const items = listNavbarRootItems();
|
|
27141
27280
|
addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
|
|
27142
27281
|
deselectRef.current();
|
|
@@ -27148,7 +27287,7 @@ function OhhwellsBridge() {
|
|
|
27148
27287
|
intent: "add-nav"
|
|
27149
27288
|
});
|
|
27150
27289
|
}, []);
|
|
27151
|
-
const maybeWarnNavLinkDropdownConflict = (0,
|
|
27290
|
+
const maybeWarnNavLinkDropdownConflict = (0, import_react24.useCallback)(
|
|
27152
27291
|
(anchor) => {
|
|
27153
27292
|
if (!isNavbarHrefKey(anchor.getAttribute("data-ohw-href-key"))) return;
|
|
27154
27293
|
if (!navDropdownsOpenOnClick()) return;
|
|
@@ -27161,7 +27300,7 @@ function OhhwellsBridge() {
|
|
|
27161
27300
|
},
|
|
27162
27301
|
[postToParent2]
|
|
27163
27302
|
);
|
|
27164
|
-
const handleNavDropdownOpenChange = (0,
|
|
27303
|
+
const handleNavDropdownOpenChange = (0, import_react24.useCallback)((open) => {
|
|
27165
27304
|
const selected = selectedElRef.current;
|
|
27166
27305
|
if (!selected || !isNavigationItem2(selected)) return;
|
|
27167
27306
|
if (isNestedNavChild(selected)) return;
|
|
@@ -27177,7 +27316,7 @@ function OhhwellsBridge() {
|
|
|
27177
27316
|
}
|
|
27178
27317
|
});
|
|
27179
27318
|
}, []);
|
|
27180
|
-
const handleFooterHeadingVisibleChange = (0,
|
|
27319
|
+
const handleFooterHeadingVisibleChange = (0, import_react24.useCallback)(
|
|
27181
27320
|
(visible) => {
|
|
27182
27321
|
const selected = selectedElRef.current;
|
|
27183
27322
|
if (!selected || !isFooterFrameSelectionRef.current) return;
|
|
@@ -27230,7 +27369,7 @@ function OhhwellsBridge() {
|
|
|
27230
27369
|
},
|
|
27231
27370
|
[postToParent2]
|
|
27232
27371
|
);
|
|
27233
|
-
const enterEditOnNewItem = (0,
|
|
27372
|
+
const enterEditOnNewItem = (0, import_react24.useCallback)((anchor) => {
|
|
27234
27373
|
const label = anchor.querySelector('[data-ohw-editable="text"]');
|
|
27235
27374
|
if (!label) {
|
|
27236
27375
|
selectRef.current(anchor);
|
|
@@ -27239,8 +27378,8 @@ function OhhwellsBridge() {
|
|
|
27239
27378
|
setNavGroupForceOpen(anchor, true);
|
|
27240
27379
|
activateRef.current(label);
|
|
27241
27380
|
}, []);
|
|
27242
|
-
const pendingSocialAddRef = (0,
|
|
27243
|
-
const handleAddChildItem = (0,
|
|
27381
|
+
const pendingSocialAddRef = (0, import_react24.useRef)(null);
|
|
27382
|
+
const handleAddChildItem = (0, import_react24.useCallback)(() => {
|
|
27244
27383
|
const selected = selectedElRef.current;
|
|
27245
27384
|
if (!selected) return;
|
|
27246
27385
|
const socialsRow = isSocialsRow(selected) ? selected : findSocialsRow(selected);
|
|
@@ -27367,7 +27506,7 @@ function OhhwellsBridge() {
|
|
|
27367
27506
|
});
|
|
27368
27507
|
});
|
|
27369
27508
|
}, [enterEditOnNewItem, isFooterFrameSelection, maybeWarnNavLinkDropdownConflict, postToParent2]);
|
|
27370
|
-
const handleAddFooterColumn = (0,
|
|
27509
|
+
const handleAddFooterColumn = (0, import_react24.useCallback)(() => {
|
|
27371
27510
|
if (document.querySelector("[data-ai-footer]")) {
|
|
27372
27511
|
const state = parseAiFooterState(aiFooterRef.current);
|
|
27373
27512
|
if (!state?.tree) return;
|
|
@@ -27423,7 +27562,7 @@ function OhhwellsBridge() {
|
|
|
27423
27562
|
selectRef.current(result.firstLink);
|
|
27424
27563
|
});
|
|
27425
27564
|
}, [postToParent2]);
|
|
27426
|
-
const clearFooterDragVisuals = (0,
|
|
27565
|
+
const clearFooterDragVisuals = (0, import_react24.useCallback)(() => {
|
|
27427
27566
|
footerDragRef.current = null;
|
|
27428
27567
|
setSiblingHintRects([]);
|
|
27429
27568
|
setFooterDropSlots([]);
|
|
@@ -27432,7 +27571,7 @@ function OhhwellsBridge() {
|
|
|
27432
27571
|
setIsItemDragging(false);
|
|
27433
27572
|
unlockFooterDragInteraction();
|
|
27434
27573
|
}, []);
|
|
27435
|
-
const refreshFooterDragVisuals = (0,
|
|
27574
|
+
const refreshFooterDragVisuals = (0, import_react24.useCallback)((session, activeSlot, clientX, clientY) => {
|
|
27436
27575
|
const dragged = session.draggedEl;
|
|
27437
27576
|
setDraggedItemRect(dragged.getBoundingClientRect());
|
|
27438
27577
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -27464,13 +27603,13 @@ function OhhwellsBridge() {
|
|
|
27464
27603
|
const activeIdx = activeSlot ? slots.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
|
|
27465
27604
|
setActiveFooterDropIndex(activeIdx >= 0 ? activeIdx : null);
|
|
27466
27605
|
}, []);
|
|
27467
|
-
const refreshFooterDragVisualsRef = (0,
|
|
27606
|
+
const refreshFooterDragVisualsRef = (0, import_react24.useRef)(refreshFooterDragVisuals);
|
|
27468
27607
|
refreshFooterDragVisualsRef.current = refreshFooterDragVisuals;
|
|
27469
|
-
const commitFooterDragRef = (0,
|
|
27608
|
+
const commitFooterDragRef = (0, import_react24.useRef)(() => {
|
|
27470
27609
|
});
|
|
27471
|
-
const beginFooterDragRef = (0,
|
|
27610
|
+
const beginFooterDragRef = (0, import_react24.useRef)(() => {
|
|
27472
27611
|
});
|
|
27473
|
-
const beginFooterDrag = (0,
|
|
27612
|
+
const beginFooterDrag = (0, import_react24.useCallback)(
|
|
27474
27613
|
(session) => {
|
|
27475
27614
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
27476
27615
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -27490,7 +27629,7 @@ function OhhwellsBridge() {
|
|
|
27490
27629
|
[refreshFooterDragVisuals]
|
|
27491
27630
|
);
|
|
27492
27631
|
beginFooterDragRef.current = beginFooterDrag;
|
|
27493
|
-
const commitFooterDrag = (0,
|
|
27632
|
+
const commitFooterDrag = (0, import_react24.useCallback)(
|
|
27494
27633
|
(clientX, clientY) => {
|
|
27495
27634
|
const session = footerDragRef.current;
|
|
27496
27635
|
if (!session) {
|
|
@@ -27662,7 +27801,7 @@ function OhhwellsBridge() {
|
|
|
27662
27801
|
[clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
|
|
27663
27802
|
);
|
|
27664
27803
|
commitFooterDragRef.current = commitFooterDrag;
|
|
27665
|
-
const startFooterLinkDrag = (0,
|
|
27804
|
+
const startFooterLinkDrag = (0, import_react24.useCallback)(
|
|
27666
27805
|
(anchor, clientX, clientY, wasSelected) => {
|
|
27667
27806
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
27668
27807
|
if (!hrefKey) return false;
|
|
@@ -27698,7 +27837,7 @@ function OhhwellsBridge() {
|
|
|
27698
27837
|
},
|
|
27699
27838
|
[beginFooterDrag]
|
|
27700
27839
|
);
|
|
27701
|
-
const startFooterColumnDrag = (0,
|
|
27840
|
+
const startFooterColumnDrag = (0, import_react24.useCallback)(
|
|
27702
27841
|
(columnEl, clientX, clientY, wasSelected) => {
|
|
27703
27842
|
const columns = listFooterColumns(columnEl);
|
|
27704
27843
|
const idx = columns.indexOf(columnEl);
|
|
@@ -27718,7 +27857,7 @@ function OhhwellsBridge() {
|
|
|
27718
27857
|
},
|
|
27719
27858
|
[beginFooterDrag]
|
|
27720
27859
|
);
|
|
27721
|
-
const persistButtonCollectionDrag = (0,
|
|
27860
|
+
const persistButtonCollectionDrag = (0, import_react24.useCallback)(
|
|
27722
27861
|
(button, clientX) => {
|
|
27723
27862
|
const insertIndex = buttonDropInsertIndexRef.current;
|
|
27724
27863
|
if (insertIndex != null) insertButtonAtCollectionIndex(button, insertIndex);
|
|
@@ -27742,7 +27881,7 @@ function OhhwellsBridge() {
|
|
|
27742
27881
|
},
|
|
27743
27882
|
[postToParent2]
|
|
27744
27883
|
);
|
|
27745
|
-
const refreshButtonDragVisuals = (0,
|
|
27884
|
+
const refreshButtonDragVisuals = (0, import_react24.useCallback)((button, clientX, clientY) => {
|
|
27746
27885
|
const collection = buttonCollectionOf(button);
|
|
27747
27886
|
if (!collection) {
|
|
27748
27887
|
setButtonDropSlots([]);
|
|
@@ -27759,7 +27898,7 @@ function OhhwellsBridge() {
|
|
|
27759
27898
|
setDraggedItemRect(button.getBoundingClientRect());
|
|
27760
27899
|
if (selectedElRef.current === button) setToolbarRect(button.getBoundingClientRect());
|
|
27761
27900
|
}, []);
|
|
27762
|
-
const handleItemDragStart = (0,
|
|
27901
|
+
const handleItemDragStart = (0, import_react24.useCallback)(
|
|
27763
27902
|
(e) => {
|
|
27764
27903
|
const selected = selectedElRef.current;
|
|
27765
27904
|
if (!selected) {
|
|
@@ -27790,7 +27929,7 @@ function OhhwellsBridge() {
|
|
|
27790
27929
|
},
|
|
27791
27930
|
[startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag, refreshButtonDragVisuals]
|
|
27792
27931
|
);
|
|
27793
|
-
const handleItemDragEnd = (0,
|
|
27932
|
+
const handleItemDragEnd = (0, import_react24.useCallback)(
|
|
27794
27933
|
(e) => {
|
|
27795
27934
|
const collectionButton = buttonCollectionDragRef.current;
|
|
27796
27935
|
if (collectionButton) {
|
|
@@ -27821,7 +27960,7 @@ function OhhwellsBridge() {
|
|
|
27821
27960
|
},
|
|
27822
27961
|
[commitFooterDrag, commitNavDrag, navDragRef, persistButtonCollectionDrag]
|
|
27823
27962
|
);
|
|
27824
|
-
const handleItemChromePointerDown = (0,
|
|
27963
|
+
const handleItemChromePointerDown = (0, import_react24.useCallback)((e) => {
|
|
27825
27964
|
if (e.button !== 0) return;
|
|
27826
27965
|
const selected = selectedElRef.current;
|
|
27827
27966
|
if (!selected) return;
|
|
@@ -27862,7 +28001,7 @@ function OhhwellsBridge() {
|
|
|
27862
28001
|
}
|
|
27863
28002
|
if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
|
|
27864
28003
|
}, [armNavPressFromChrome]);
|
|
27865
|
-
const handleItemChromeClick = (0,
|
|
28004
|
+
const handleItemChromeClick = (0, import_react24.useCallback)((clientX, clientY) => {
|
|
27866
28005
|
if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
|
|
27867
28006
|
suppressNextClickRef.current = false;
|
|
27868
28007
|
return;
|
|
@@ -27875,7 +28014,7 @@ function OhhwellsBridge() {
|
|
|
27875
28014
|
}, []);
|
|
27876
28015
|
reselectNavigationItemRef.current = reselectNavigationItem;
|
|
27877
28016
|
commitNavigationTextEditRef.current = commitNavigationTextEdit;
|
|
27878
|
-
const select = (0,
|
|
28017
|
+
const select = (0, import_react24.useCallback)((anchor) => {
|
|
27879
28018
|
if (!isNavigationItem2(anchor)) return;
|
|
27880
28019
|
if (activeElRef.current) deactivate();
|
|
27881
28020
|
clearSocialSelectionRef.current();
|
|
@@ -27952,7 +28091,7 @@ function OhhwellsBridge() {
|
|
|
27952
28091
|
setLogoSizeDraft(null);
|
|
27953
28092
|
}
|
|
27954
28093
|
}, [deactivate, markSelected]);
|
|
27955
|
-
const selectFrame = (0,
|
|
28094
|
+
const selectFrame = (0, import_react24.useCallback)((el) => {
|
|
27956
28095
|
if (!isNavigationContainer(el)) return;
|
|
27957
28096
|
if (activeElRef.current) deactivate();
|
|
27958
28097
|
aiSectionApiRef.current?.selectFromElement(el);
|
|
@@ -27993,7 +28132,7 @@ function OhhwellsBridge() {
|
|
|
27993
28132
|
setFloatingPanelPos(null);
|
|
27994
28133
|
setLogoSizeDraft(null);
|
|
27995
28134
|
}, [deactivate, markSelected, postToParent2]);
|
|
27996
|
-
const selectLogo = (0,
|
|
28135
|
+
const selectLogo = (0, import_react24.useCallback)(
|
|
27997
28136
|
(logoEl) => {
|
|
27998
28137
|
if (activeElRef.current) deactivate();
|
|
27999
28138
|
selectedElRef.current = logoEl;
|
|
@@ -28022,7 +28161,7 @@ function OhhwellsBridge() {
|
|
|
28022
28161
|
},
|
|
28023
28162
|
[deactivate, markSelected]
|
|
28024
28163
|
);
|
|
28025
|
-
const openLogoSizePanel = (0,
|
|
28164
|
+
const openLogoSizePanel = (0, import_react24.useCallback)((logoEl) => {
|
|
28026
28165
|
const placement = getLogoPlacement(logoEl);
|
|
28027
28166
|
const draft = readLogoSizeState(editContentRef.current, placement);
|
|
28028
28167
|
setLogoSizeDraft(draft);
|
|
@@ -28035,7 +28174,7 @@ function OhhwellsBridge() {
|
|
|
28035
28174
|
placement
|
|
28036
28175
|
});
|
|
28037
28176
|
}, []);
|
|
28038
|
-
const openSocialsDisplayPanel = (0,
|
|
28177
|
+
const openSocialsDisplayPanel = (0, import_react24.useCallback)((row) => {
|
|
28039
28178
|
setFloatingPanelPos(null);
|
|
28040
28179
|
setParentScrollSnap(parentScrollRef.current);
|
|
28041
28180
|
setFloatingPanel({
|
|
@@ -28046,7 +28185,7 @@ function OhhwellsBridge() {
|
|
|
28046
28185
|
row
|
|
28047
28186
|
});
|
|
28048
28187
|
}, []);
|
|
28049
|
-
const rememberButtonTokens = (0,
|
|
28188
|
+
const rememberButtonTokens = (0, import_react24.useCallback)(
|
|
28050
28189
|
(content, tokens, nodes) => {
|
|
28051
28190
|
if (nodes.length === 0) return content;
|
|
28052
28191
|
const next = { ...content };
|
|
@@ -28057,7 +28196,7 @@ function OhhwellsBridge() {
|
|
|
28057
28196
|
},
|
|
28058
28197
|
[postToParent2]
|
|
28059
28198
|
);
|
|
28060
|
-
const tokensForButton = (0,
|
|
28199
|
+
const tokensForButton = (0, import_react24.useCallback)(
|
|
28061
28200
|
(el, persistFallback = false) => {
|
|
28062
28201
|
const stored = readStoredStyleTokens(editContentRef.current);
|
|
28063
28202
|
if (stored) return stored;
|
|
@@ -28072,7 +28211,7 @@ function OhhwellsBridge() {
|
|
|
28072
28211
|
},
|
|
28073
28212
|
[rememberButtonTokens]
|
|
28074
28213
|
);
|
|
28075
|
-
const openButtonStylePanel = (0,
|
|
28214
|
+
const openButtonStylePanel = (0, import_react24.useCallback)(
|
|
28076
28215
|
(anchor) => {
|
|
28077
28216
|
const id = buttonId(anchor);
|
|
28078
28217
|
if (!id) return;
|
|
@@ -28090,7 +28229,7 @@ function OhhwellsBridge() {
|
|
|
28090
28229
|
},
|
|
28091
28230
|
[tokensForButton]
|
|
28092
28231
|
);
|
|
28093
|
-
const applySelectedButtonStyle = (0,
|
|
28232
|
+
const applySelectedButtonStyle = (0, import_react24.useCallback)(
|
|
28094
28233
|
(patch) => {
|
|
28095
28234
|
const panel = floatingPanelRef.current;
|
|
28096
28235
|
const id = panel?.kind === "button-style" ? panel.buttonId : null;
|
|
@@ -28108,7 +28247,7 @@ function OhhwellsBridge() {
|
|
|
28108
28247
|
},
|
|
28109
28248
|
[postToParent2]
|
|
28110
28249
|
);
|
|
28111
|
-
(0,
|
|
28250
|
+
(0, import_react24.useEffect)(() => {
|
|
28112
28251
|
const onDragOver = (e) => {
|
|
28113
28252
|
const dragged = buttonCollectionDragRef.current;
|
|
28114
28253
|
if (!dragged) return;
|
|
@@ -28127,11 +28266,11 @@ function OhhwellsBridge() {
|
|
|
28127
28266
|
document.removeEventListener("drop", onDrop);
|
|
28128
28267
|
};
|
|
28129
28268
|
}, [refreshButtonDragVisuals]);
|
|
28130
|
-
const isEditModeRef = (0,
|
|
28131
|
-
const requestMissingSocialIconsRef = (0,
|
|
28269
|
+
const isEditModeRef = (0, import_react24.useRef)(false);
|
|
28270
|
+
const requestMissingSocialIconsRef = (0, import_react24.useRef)(() => {
|
|
28132
28271
|
});
|
|
28133
|
-
const askedSocialIconsRef = (0,
|
|
28134
|
-
const requestMissingSocialIcons = (0,
|
|
28272
|
+
const askedSocialIconsRef = (0, import_react24.useRef)(/* @__PURE__ */ new Set());
|
|
28273
|
+
const requestMissingSocialIcons = (0, import_react24.useCallback)(() => {
|
|
28135
28274
|
const items = Array.from(document.querySelectorAll(`[${SOCIALS_ROW_ATTR}]`)).filter((row) => socialsDisplayFor(row, editContentRef.current).icon).flatMap((row) => {
|
|
28136
28275
|
const missing = socialsMissingIcons(row);
|
|
28137
28276
|
listSocialItems(row).forEach((item) => ensureIconSlot(item));
|
|
@@ -28143,7 +28282,7 @@ function OhhwellsBridge() {
|
|
|
28143
28282
|
}, []);
|
|
28144
28283
|
requestMissingSocialIconsRef.current = requestMissingSocialIcons;
|
|
28145
28284
|
isEditModeRef.current = isEditMode;
|
|
28146
|
-
const changeSocialsDisplay = (0,
|
|
28285
|
+
const changeSocialsDisplay = (0, import_react24.useCallback)(
|
|
28147
28286
|
(row, next) => {
|
|
28148
28287
|
if (next.icon) {
|
|
28149
28288
|
const missing = socialsMissingIcons(row);
|
|
@@ -28167,19 +28306,19 @@ function OhhwellsBridge() {
|
|
|
28167
28306
|
},
|
|
28168
28307
|
[]
|
|
28169
28308
|
);
|
|
28170
|
-
const closeFloatingPanelOnly = (0,
|
|
28309
|
+
const closeFloatingPanelOnly = (0, import_react24.useCallback)(() => {
|
|
28171
28310
|
setFloatingPanel(null);
|
|
28172
28311
|
setFloatingPanelPos(null);
|
|
28173
28312
|
setLogoSizeDraft(null);
|
|
28174
28313
|
}, []);
|
|
28175
28314
|
closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
|
|
28176
|
-
const closeFloatingPanelAndDeselect = (0,
|
|
28315
|
+
const closeFloatingPanelAndDeselect = (0, import_react24.useCallback)(() => {
|
|
28177
28316
|
setFloatingPanel(null);
|
|
28178
28317
|
setFloatingPanelPos(null);
|
|
28179
28318
|
setLogoSizeDraft(null);
|
|
28180
28319
|
deselectRef.current();
|
|
28181
28320
|
}, []);
|
|
28182
|
-
(0,
|
|
28321
|
+
(0, import_react24.useEffect)(() => {
|
|
28183
28322
|
const session = floatingPanel && floatingPanel.kind === "logo-size" ? floatingPanel : null;
|
|
28184
28323
|
if (!session || !logoSizeDraft) {
|
|
28185
28324
|
postToParentRef.current({ type: "ow:logo-size-panel", open: false });
|
|
@@ -28198,7 +28337,7 @@ function OhhwellsBridge() {
|
|
|
28198
28337
|
max: LOGO_SIZE_MAX
|
|
28199
28338
|
});
|
|
28200
28339
|
}, [floatingPanel, logoSizeDraft, editorViewport]);
|
|
28201
|
-
const persistLogoSizeDraft = (0,
|
|
28340
|
+
const persistLogoSizeDraft = (0, import_react24.useCallback)(
|
|
28202
28341
|
(placement, draft) => {
|
|
28203
28342
|
const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
|
|
28204
28343
|
const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
|
|
@@ -28238,7 +28377,7 @@ function OhhwellsBridge() {
|
|
|
28238
28377
|
},
|
|
28239
28378
|
[postToParent2]
|
|
28240
28379
|
);
|
|
28241
|
-
const activate = (0,
|
|
28380
|
+
const activate = (0, import_react24.useCallback)((el, options) => {
|
|
28242
28381
|
if (activeElRef.current === el) return;
|
|
28243
28382
|
document.querySelectorAll("[data-ohw-hovered]").forEach((hovered) => {
|
|
28244
28383
|
hovered.removeAttribute("data-ohw-hovered");
|
|
@@ -28336,8 +28475,8 @@ function OhhwellsBridge() {
|
|
|
28336
28475
|
openLogoSizePanelRef.current = openLogoSizePanel;
|
|
28337
28476
|
deselectRef.current = deselect;
|
|
28338
28477
|
closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
|
|
28339
|
-
const lastSiteWideScopeRef = (0,
|
|
28340
|
-
(0,
|
|
28478
|
+
const lastSiteWideScopeRef = (0, import_react24.useRef)(null);
|
|
28479
|
+
(0, import_react24.useEffect)(() => {
|
|
28341
28480
|
if (!isEditMode) {
|
|
28342
28481
|
if (lastSiteWideScopeRef.current !== false) {
|
|
28343
28482
|
lastSiteWideScopeRef.current = false;
|
|
@@ -28363,7 +28502,7 @@ function OhhwellsBridge() {
|
|
|
28363
28502
|
isFooterFrameSelection,
|
|
28364
28503
|
postToParent2
|
|
28365
28504
|
]);
|
|
28366
|
-
(0,
|
|
28505
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
28367
28506
|
if (!subdomain || isEditMode) {
|
|
28368
28507
|
setFetchState("done");
|
|
28369
28508
|
return;
|
|
@@ -28517,7 +28656,7 @@ function OhhwellsBridge() {
|
|
|
28517
28656
|
cancelled = true;
|
|
28518
28657
|
};
|
|
28519
28658
|
}, [subdomain, isEditMode]);
|
|
28520
|
-
(0,
|
|
28659
|
+
(0, import_react24.useEffect)(() => {
|
|
28521
28660
|
if (!isEditMode) return;
|
|
28522
28661
|
const resolveIndex = (form, clientY) => {
|
|
28523
28662
|
const wrappers = listFieldWrappers(form).filter((el) => fieldKeyOf(el) !== fieldDragRef.current?.key);
|
|
@@ -28558,7 +28697,7 @@ function OhhwellsBridge() {
|
|
|
28558
28697
|
window.removeEventListener("drop", onDrop, true);
|
|
28559
28698
|
};
|
|
28560
28699
|
}, [buildFieldDropSlots, isEditMode, persistFields, selectField]);
|
|
28561
|
-
(0,
|
|
28700
|
+
(0, import_react24.useEffect)(() => {
|
|
28562
28701
|
if (!isEditMode) return;
|
|
28563
28702
|
const mark = () => document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
28564
28703
|
markFormFields(form);
|
|
@@ -28570,7 +28709,7 @@ function OhhwellsBridge() {
|
|
|
28570
28709
|
});
|
|
28571
28710
|
return () => observer.disconnect();
|
|
28572
28711
|
}, [isEditMode, fetchState, pathname]);
|
|
28573
|
-
(0,
|
|
28712
|
+
(0, import_react24.useEffect)(() => {
|
|
28574
28713
|
if (!isEditMode) return;
|
|
28575
28714
|
let saveTimer = null;
|
|
28576
28715
|
const onInput = (e) => {
|
|
@@ -28592,14 +28731,14 @@ function OhhwellsBridge() {
|
|
|
28592
28731
|
document.addEventListener("input", onInput, true);
|
|
28593
28732
|
return () => document.removeEventListener("input", onInput, true);
|
|
28594
28733
|
}, [isEditMode, persistFields]);
|
|
28595
|
-
(0,
|
|
28734
|
+
(0, import_react24.useEffect)(() => {
|
|
28596
28735
|
if (isEditMode || fetchState !== "done") return;
|
|
28597
28736
|
const content = contentCache.get(subdomain) ?? {};
|
|
28598
28737
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
28599
28738
|
reconcileFieldsFromContent(form, content);
|
|
28600
28739
|
});
|
|
28601
28740
|
}, [isEditMode, fetchState, subdomain]);
|
|
28602
|
-
(0,
|
|
28741
|
+
(0, import_react24.useEffect)(() => {
|
|
28603
28742
|
if (!isEditMode) return;
|
|
28604
28743
|
const swallow = (e) => {
|
|
28605
28744
|
const target = e.target;
|
|
@@ -28608,14 +28747,14 @@ function OhhwellsBridge() {
|
|
|
28608
28747
|
document.addEventListener("submit", swallow, true);
|
|
28609
28748
|
return () => document.removeEventListener("submit", swallow, true);
|
|
28610
28749
|
}, [isEditMode]);
|
|
28611
|
-
(0,
|
|
28750
|
+
(0, import_react24.useEffect)(() => {
|
|
28612
28751
|
if (isEditMode || fetchState !== "done") return;
|
|
28613
28752
|
console.log("env", process.env.NEXT_PUBLIC_FLOWOPS_API_URL);
|
|
28614
28753
|
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
28615
28754
|
console.log({ apiUrl, subdomain });
|
|
28616
28755
|
bindPublishedForms(apiUrl, subdomain, contentCache.get(subdomain) ?? {});
|
|
28617
28756
|
}, [isEditMode, fetchState, subdomain]);
|
|
28618
|
-
(0,
|
|
28757
|
+
(0, import_react24.useEffect)(() => {
|
|
28619
28758
|
if (!subdomain || isEditMode) return;
|
|
28620
28759
|
let debounceTimer = null;
|
|
28621
28760
|
let observer = null;
|
|
@@ -28735,16 +28874,16 @@ function OhhwellsBridge() {
|
|
|
28735
28874
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
28736
28875
|
};
|
|
28737
28876
|
}, [subdomain, isEditMode, pathname]);
|
|
28738
|
-
(0,
|
|
28877
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
28739
28878
|
const el = document.getElementById("ohw-loader");
|
|
28740
28879
|
if (!el) return;
|
|
28741
28880
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
28742
28881
|
el.style.display = visible ? "flex" : "none";
|
|
28743
28882
|
}, [subdomain, fetchState]);
|
|
28744
|
-
(0,
|
|
28883
|
+
(0, import_react24.useEffect)(() => {
|
|
28745
28884
|
postToParent2({ type: "ow:navigation", path: pathname });
|
|
28746
28885
|
}, [pathname, postToParent2]);
|
|
28747
|
-
(0,
|
|
28886
|
+
(0, import_react24.useEffect)(() => {
|
|
28748
28887
|
if (!subdomain || isEditMode) return;
|
|
28749
28888
|
const content = contentCache.get(subdomain);
|
|
28750
28889
|
if (!content) return;
|
|
@@ -28762,7 +28901,7 @@ function OhhwellsBridge() {
|
|
|
28762
28901
|
}
|
|
28763
28902
|
applyAiFooterFromContent(content);
|
|
28764
28903
|
}, [pathname, subdomain, isEditMode]);
|
|
28765
|
-
(0,
|
|
28904
|
+
(0, import_react24.useEffect)(() => {
|
|
28766
28905
|
if (!isEditMode) return;
|
|
28767
28906
|
if (linkPopoverSessionRef.current?.intent === "add-nav") return;
|
|
28768
28907
|
if (document.querySelector("[data-ohw-section-picker]")) return;
|
|
@@ -28770,12 +28909,12 @@ function OhhwellsBridge() {
|
|
|
28770
28909
|
deselectRef.current();
|
|
28771
28910
|
deactivateRef.current();
|
|
28772
28911
|
}, [pathname, isEditMode]);
|
|
28773
|
-
(0,
|
|
28912
|
+
(0, import_react24.useEffect)(() => {
|
|
28774
28913
|
if (!isEditMode) return;
|
|
28775
28914
|
initSectionInstancesFromContent(editContentRef.current, pathname);
|
|
28776
28915
|
initItemInstancesFromContent(editContentRef.current);
|
|
28777
28916
|
}, [pathname, isEditMode]);
|
|
28778
|
-
(0,
|
|
28917
|
+
(0, import_react24.useEffect)(() => {
|
|
28779
28918
|
if (!isEditMode) return;
|
|
28780
28919
|
const observer = new MutationObserver(() => {
|
|
28781
28920
|
const drawer = document.querySelector("[data-ohw-nav-drawer]");
|
|
@@ -28786,7 +28925,7 @@ function OhhwellsBridge() {
|
|
|
28786
28925
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
28787
28926
|
return () => observer.disconnect();
|
|
28788
28927
|
}, [isEditMode, pathname]);
|
|
28789
|
-
(0,
|
|
28928
|
+
(0, import_react24.useEffect)(() => {
|
|
28790
28929
|
const contentForNav = () => {
|
|
28791
28930
|
if (isEditMode) return editContentRef.current;
|
|
28792
28931
|
if (!subdomain) return {};
|
|
@@ -28859,7 +28998,7 @@ function OhhwellsBridge() {
|
|
|
28859
28998
|
observer?.disconnect();
|
|
28860
28999
|
};
|
|
28861
29000
|
}, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
|
|
28862
|
-
(0,
|
|
29001
|
+
(0, import_react24.useEffect)(() => {
|
|
28863
29002
|
if (!isEditMode) return;
|
|
28864
29003
|
let applying = false;
|
|
28865
29004
|
let rafId = null;
|
|
@@ -28897,7 +29036,7 @@ function OhhwellsBridge() {
|
|
|
28897
29036
|
observer.disconnect();
|
|
28898
29037
|
};
|
|
28899
29038
|
}, [isEditMode, pathname]);
|
|
28900
|
-
(0,
|
|
29039
|
+
(0, import_react24.useEffect)(() => {
|
|
28901
29040
|
if (!isEditMode) return;
|
|
28902
29041
|
let lastPosted = 0;
|
|
28903
29042
|
const measure = () => {
|
|
@@ -28926,7 +29065,7 @@ function OhhwellsBridge() {
|
|
|
28926
29065
|
ro.disconnect();
|
|
28927
29066
|
};
|
|
28928
29067
|
}, [pathname, isEditMode, postToParent2]);
|
|
28929
|
-
(0,
|
|
29068
|
+
(0, import_react24.useEffect)(() => {
|
|
28930
29069
|
if (isEditMode) return;
|
|
28931
29070
|
const handleClick = (e) => {
|
|
28932
29071
|
if (!isPlainLeftClick(e)) return;
|
|
@@ -28940,7 +29079,7 @@ function OhhwellsBridge() {
|
|
|
28940
29079
|
document.addEventListener("click", handleClick, true);
|
|
28941
29080
|
return () => document.removeEventListener("click", handleClick, true);
|
|
28942
29081
|
}, [isEditMode, router, pathname]);
|
|
28943
|
-
(0,
|
|
29082
|
+
(0, import_react24.useEffect)(() => {
|
|
28944
29083
|
if (!isEditMode) {
|
|
28945
29084
|
editStylesRef.current?.base.remove();
|
|
28946
29085
|
editStylesRef.current?.forceHover.remove();
|
|
@@ -32423,7 +32562,7 @@ function OhhwellsBridge() {
|
|
|
32423
32562
|
if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
|
|
32424
32563
|
};
|
|
32425
32564
|
}, [isEditMode, refreshStateRules]);
|
|
32426
|
-
(0,
|
|
32565
|
+
(0, import_react24.useEffect)(() => {
|
|
32427
32566
|
if (!isEditMode) return;
|
|
32428
32567
|
const THRESHOLD = 10;
|
|
32429
32568
|
const resolveWasSelected = (el) => {
|
|
@@ -32579,7 +32718,7 @@ function OhhwellsBridge() {
|
|
|
32579
32718
|
unlockFooterDragInteraction();
|
|
32580
32719
|
};
|
|
32581
32720
|
}, [isEditMode]);
|
|
32582
|
-
(0,
|
|
32721
|
+
(0, import_react24.useEffect)(() => {
|
|
32583
32722
|
if (!isEditMode) return;
|
|
32584
32723
|
const THRESHOLD = 10;
|
|
32585
32724
|
const onPointerDown = (e) => {
|
|
@@ -32670,7 +32809,7 @@ function OhhwellsBridge() {
|
|
|
32670
32809
|
document.removeEventListener("selectstart", blockSelectStart, true);
|
|
32671
32810
|
};
|
|
32672
32811
|
}, [isEditMode, persistButtonCollectionDrag, refreshButtonDragVisuals]);
|
|
32673
|
-
(0,
|
|
32812
|
+
(0, import_react24.useEffect)(() => {
|
|
32674
32813
|
const handler = (e) => {
|
|
32675
32814
|
if (e.data?.type !== "ow:request-schedule-config") return;
|
|
32676
32815
|
const insertAfterVal = e.data.insertAfter;
|
|
@@ -32686,7 +32825,7 @@ function OhhwellsBridge() {
|
|
|
32686
32825
|
window.addEventListener("message", handler);
|
|
32687
32826
|
return () => window.removeEventListener("message", handler);
|
|
32688
32827
|
}, [processConfigRequest]);
|
|
32689
|
-
(0,
|
|
32828
|
+
(0, import_react24.useEffect)(() => {
|
|
32690
32829
|
if (!isEditMode) return;
|
|
32691
32830
|
document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
|
|
32692
32831
|
el.removeAttribute("data-ohw-active-state");
|
|
@@ -32710,7 +32849,7 @@ function OhhwellsBridge() {
|
|
|
32710
32849
|
postToParent2({
|
|
32711
32850
|
type: "ow:ready",
|
|
32712
32851
|
version: "1",
|
|
32713
|
-
bridgeVersion: "0.1.160-next.
|
|
32852
|
+
bridgeVersion: "0.1.160-next.437",
|
|
32714
32853
|
path: pathname,
|
|
32715
32854
|
nodes: collectEditableNodes(editContentRef.current),
|
|
32716
32855
|
sections
|
|
@@ -32722,13 +32861,13 @@ function OhhwellsBridge() {
|
|
|
32722
32861
|
clearTimeout(timer);
|
|
32723
32862
|
};
|
|
32724
32863
|
}, [pathname, isEditMode, refreshStateRules, postToParent2]);
|
|
32725
|
-
(0,
|
|
32864
|
+
(0, import_react24.useEffect)(() => {
|
|
32726
32865
|
scrollToHashSectionWhenReady();
|
|
32727
32866
|
const onHashChange = () => scrollToHashSectionWhenReady();
|
|
32728
32867
|
window.addEventListener("hashchange", onHashChange);
|
|
32729
32868
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
32730
32869
|
}, [pathname]);
|
|
32731
|
-
const handleCommand = (0,
|
|
32870
|
+
const handleCommand = (0, import_react24.useCallback)((cmd) => {
|
|
32732
32871
|
const el = activeElRef.current;
|
|
32733
32872
|
const selBefore = window.getSelection();
|
|
32734
32873
|
let savedOffsets = null;
|
|
@@ -32764,7 +32903,7 @@ function OhhwellsBridge() {
|
|
|
32764
32903
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
32765
32904
|
refreshActiveCommandsRef.current();
|
|
32766
32905
|
}, []);
|
|
32767
|
-
(0,
|
|
32906
|
+
(0, import_react24.useEffect)(() => {
|
|
32768
32907
|
const session = floatingPanel && floatingPanel.kind === "logo-size" ? floatingPanel : null;
|
|
32769
32908
|
if (!session || !logoSizeDraft) return;
|
|
32770
32909
|
const onPanelAction = (e) => {
|
|
@@ -32802,7 +32941,7 @@ function OhhwellsBridge() {
|
|
|
32802
32941
|
window.addEventListener("message", onPanelAction);
|
|
32803
32942
|
return () => window.removeEventListener("message", onPanelAction);
|
|
32804
32943
|
}, [floatingPanel, logoSizeDraft, editorViewport, persistLogoSizeDraft, closeFloatingPanelAndDeselect]);
|
|
32805
|
-
const handleStateChange = (0,
|
|
32944
|
+
const handleStateChange = (0, import_react24.useCallback)((state) => {
|
|
32806
32945
|
if (!activeStateElRef.current) return;
|
|
32807
32946
|
const el = activeStateElRef.current;
|
|
32808
32947
|
if (state === "Default") {
|
|
@@ -32815,7 +32954,7 @@ function OhhwellsBridge() {
|
|
|
32815
32954
|
}
|
|
32816
32955
|
setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
|
|
32817
32956
|
}, [deactivate]);
|
|
32818
|
-
const reselectAfterLinkPopover = (0,
|
|
32957
|
+
const reselectAfterLinkPopover = (0, import_react24.useCallback)(
|
|
32819
32958
|
(hrefKey) => {
|
|
32820
32959
|
requestAnimationFrame(() => {
|
|
32821
32960
|
const el = resolveHrefKeyElement(hrefKey);
|
|
@@ -32824,7 +32963,7 @@ function OhhwellsBridge() {
|
|
|
32824
32963
|
},
|
|
32825
32964
|
[resolveHrefKeyElement]
|
|
32826
32965
|
);
|
|
32827
|
-
const closeLinkPopover = (0,
|
|
32966
|
+
const closeLinkPopover = (0, import_react24.useCallback)(() => {
|
|
32828
32967
|
const session = linkPopoverSessionRef.current;
|
|
32829
32968
|
addNavAfterAnchorRef.current = null;
|
|
32830
32969
|
setLinkPopover(null);
|
|
@@ -32832,9 +32971,9 @@ function OhhwellsBridge() {
|
|
|
32832
32971
|
reselectAfterLinkPopover(session.key);
|
|
32833
32972
|
}
|
|
32834
32973
|
}, [reselectAfterLinkPopover]);
|
|
32835
|
-
const closeLinkPopoverRef = (0,
|
|
32974
|
+
const closeLinkPopoverRef = (0, import_react24.useRef)(closeLinkPopover);
|
|
32836
32975
|
closeLinkPopoverRef.current = closeLinkPopover;
|
|
32837
|
-
const openLinkPopoverForActive = (0,
|
|
32976
|
+
const openLinkPopoverForActive = (0, import_react24.useCallback)(() => {
|
|
32838
32977
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
32839
32978
|
if (!hrefCtx) return;
|
|
32840
32979
|
bumpLinkPopoverGrace();
|
|
@@ -32845,7 +32984,7 @@ function OhhwellsBridge() {
|
|
|
32845
32984
|
});
|
|
32846
32985
|
deactivate();
|
|
32847
32986
|
}, [deactivate]);
|
|
32848
|
-
const openLinkPopoverForSelected = (0,
|
|
32987
|
+
const openLinkPopoverForSelected = (0, import_react24.useCallback)(() => {
|
|
32849
32988
|
const anchor = selectedElRef.current;
|
|
32850
32989
|
if (!anchor) return;
|
|
32851
32990
|
const key = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -32862,7 +33001,7 @@ function OhhwellsBridge() {
|
|
|
32862
33001
|
});
|
|
32863
33002
|
deselect();
|
|
32864
33003
|
}, [deselect]);
|
|
32865
|
-
const handleSelectParent = (0,
|
|
33004
|
+
const handleSelectParent = (0, import_react24.useCallback)(() => {
|
|
32866
33005
|
const selected = selectedElRef.current;
|
|
32867
33006
|
if (!selected) return;
|
|
32868
33007
|
if (toolbarVariantRef.current === "select-frame") {
|
|
@@ -32889,7 +33028,7 @@ function OhhwellsBridge() {
|
|
|
32889
33028
|
}
|
|
32890
33029
|
deselectRef.current();
|
|
32891
33030
|
}, []);
|
|
32892
|
-
const handleDuplicateSelected = (0,
|
|
33031
|
+
const handleDuplicateSelected = (0, import_react24.useCallback)(() => {
|
|
32893
33032
|
const selected = selectedElRef.current;
|
|
32894
33033
|
if (!selected || !isNavigationItem2(selected)) return;
|
|
32895
33034
|
if (isCtaButton(selected)) {
|
|
@@ -33058,7 +33197,7 @@ function OhhwellsBridge() {
|
|
|
33058
33197
|
});
|
|
33059
33198
|
}
|
|
33060
33199
|
}, [postToParent2, tokensForButton]);
|
|
33061
|
-
const runPendingDeleteUndo = (0,
|
|
33200
|
+
const runPendingDeleteUndo = (0, import_react24.useCallback)(() => {
|
|
33062
33201
|
const pending = pendingDeleteUndoRef.current;
|
|
33063
33202
|
if (!pending) return false;
|
|
33064
33203
|
pendingDeleteUndoRef.current = null;
|
|
@@ -33066,7 +33205,7 @@ function OhhwellsBridge() {
|
|
|
33066
33205
|
enforceLinkHrefs();
|
|
33067
33206
|
return true;
|
|
33068
33207
|
}, []);
|
|
33069
|
-
const handleDeleteSelected = (0,
|
|
33208
|
+
const handleDeleteSelected = (0, import_react24.useCallback)(() => {
|
|
33070
33209
|
const selected = selectedElRef.current;
|
|
33071
33210
|
if (!selected) return false;
|
|
33072
33211
|
if (isCtaButton(selected)) {
|
|
@@ -33128,7 +33267,7 @@ function OhhwellsBridge() {
|
|
|
33128
33267
|
}, [postToParent2]);
|
|
33129
33268
|
handleDeleteSelectedRef.current = handleDeleteSelected;
|
|
33130
33269
|
runPendingDeleteUndoRef.current = runPendingDeleteUndo;
|
|
33131
|
-
const handleLinkPopoverSubmit = (0,
|
|
33270
|
+
const handleLinkPopoverSubmit = (0, import_react24.useCallback)(
|
|
33132
33271
|
(target) => {
|
|
33133
33272
|
const session = linkPopoverSessionRef.current;
|
|
33134
33273
|
if (!session) return;
|
|
@@ -33194,14 +33333,14 @@ function OhhwellsBridge() {
|
|
|
33194
33333
|
const showEditLink = toolbarShowEditLink;
|
|
33195
33334
|
const currentSections = sectionsByPath[pathname] ?? [];
|
|
33196
33335
|
linkPopoverOpenRef.current = linkPopover !== null;
|
|
33197
|
-
const handleMediaSelect = (0,
|
|
33336
|
+
const handleMediaSelect = (0, import_react24.useCallback)((key) => {
|
|
33198
33337
|
const el = hoveredImageRef.current?.dataset.ohwKey === key ? hoveredImageRef.current : Array.from(document.querySelectorAll(MEDIA_SELECTOR)).find(
|
|
33199
33338
|
(m) => (m.dataset.ohwKey ?? "") === key
|
|
33200
33339
|
) ?? null;
|
|
33201
33340
|
if (!el) return;
|
|
33202
33341
|
selectMediaElementRef.current(el);
|
|
33203
33342
|
}, []);
|
|
33204
|
-
const handleMediaReplace = (0,
|
|
33343
|
+
const handleMediaReplace = (0, import_react24.useCallback)(
|
|
33205
33344
|
(key) => {
|
|
33206
33345
|
postToParent2({
|
|
33207
33346
|
type: "ow:image-pick",
|
|
@@ -33211,13 +33350,13 @@ function OhhwellsBridge() {
|
|
|
33211
33350
|
},
|
|
33212
33351
|
[postToParent2, mediaHover?.elementType, selectedMedia?.elementType]
|
|
33213
33352
|
);
|
|
33214
|
-
const handleEditCarousel = (0,
|
|
33353
|
+
const handleEditCarousel = (0, import_react24.useCallback)(
|
|
33215
33354
|
(key) => {
|
|
33216
33355
|
postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
|
|
33217
33356
|
},
|
|
33218
33357
|
[postToParent2]
|
|
33219
33358
|
);
|
|
33220
|
-
const handleMediaFadeOutComplete = (0,
|
|
33359
|
+
const handleMediaFadeOutComplete = (0, import_react24.useCallback)((key) => {
|
|
33221
33360
|
setUploadingRects((prev) => {
|
|
33222
33361
|
if (!(key in prev)) return prev;
|
|
33223
33362
|
const next = { ...prev };
|
|
@@ -33225,7 +33364,7 @@ function OhhwellsBridge() {
|
|
|
33225
33364
|
return next;
|
|
33226
33365
|
});
|
|
33227
33366
|
}, []);
|
|
33228
|
-
const handleVideoSettingsChange = (0,
|
|
33367
|
+
const handleVideoSettingsChange = (0, import_react24.useCallback)(
|
|
33229
33368
|
(key, settings) => {
|
|
33230
33369
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
33231
33370
|
const video = getVideoEl2(el);
|
|
@@ -33939,6 +34078,7 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
|
|
|
33939
34078
|
hasMountedContentNodes,
|
|
33940
34079
|
indexCollectionItems,
|
|
33941
34080
|
insertFooterHours,
|
|
34081
|
+
isDeadPageHref,
|
|
33942
34082
|
isEditSessionActive,
|
|
33943
34083
|
isPlainLeftClick,
|
|
33944
34084
|
isRenderableFooterTree,
|
|
@@ -33950,6 +34090,7 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
|
|
|
33950
34090
|
parseAiFooterState,
|
|
33951
34091
|
parseAiSectionsState,
|
|
33952
34092
|
parseTarget,
|
|
34093
|
+
planBuildPageSync,
|
|
33953
34094
|
recordOverriddenPaths,
|
|
33954
34095
|
releaseTemplateLogoIfReplaced,
|
|
33955
34096
|
removeFooterBlock,
|