@ohhwells/bridge 0.1.54-next.151 → 0.1.54
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 +295 -1474
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -12
- package/dist/index.d.ts +2 -12
- package/dist/index.js +289 -1473
- package/dist/index.js.map +1 -1
- package/dist/styles.css +0 -87
- package/package.json +1 -6
- package/dist/pages.cjs +0 -141
- package/dist/pages.cjs.map +0 -1
- package/dist/pages.d.cts +0 -45
- package/dist/pages.d.ts +0 -45
- package/dist/pages.js +0 -107
- package/dist/pages.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/OhhwellsBridge.tsx
|
|
4
|
-
import React11, { useCallback as
|
|
4
|
+
import React11, { useCallback as useCallback6, useEffect as useEffect11, useLayoutEffect as useLayoutEffect3, useRef as useRef8, useState as useState10 } from "react";
|
|
5
5
|
import { createRoot as createRoot2 } from "react-dom/client";
|
|
6
6
|
import { flushSync as flushSync2 } from "react-dom";
|
|
7
7
|
|
|
@@ -1953,7 +1953,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
1953
1953
|
const autoId = useId();
|
|
1954
1954
|
const insertAfter = insertAfterProp ?? autoId;
|
|
1955
1955
|
const [schedule, setSchedule] = useState2(null);
|
|
1956
|
-
const [loading, setLoading] = useState2(
|
|
1956
|
+
const [loading, setLoading] = useState2(true);
|
|
1957
1957
|
const [inEditor, setInEditor] = useState2(false);
|
|
1958
1958
|
const [isHovered, setIsHovered] = useState2(false);
|
|
1959
1959
|
const [modalState, setModalState] = useState2(null);
|
|
@@ -2127,10 +2127,8 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
2127
2127
|
"*"
|
|
2128
2128
|
);
|
|
2129
2129
|
};
|
|
2130
|
+
if (!inEditor && !loading && !schedule) return null;
|
|
2130
2131
|
const sectionId = `scheduling-${insertAfter}`;
|
|
2131
|
-
if (!inEditor && !loading && !schedule) {
|
|
2132
|
-
return /* @__PURE__ */ jsx4("section", { "data-ohw-section": sectionId, "data-ohw-scheduling-anchor": insertAfter, style: { display: "none" } });
|
|
2133
|
-
}
|
|
2134
2132
|
return /* @__PURE__ */ jsxs3(
|
|
2135
2133
|
"section",
|
|
2136
2134
|
{
|
|
@@ -10298,329 +10296,6 @@ function deleteFooterColumn(column) {
|
|
|
10298
10296
|
};
|
|
10299
10297
|
}
|
|
10300
10298
|
|
|
10301
|
-
// src/lib/logo-identity.ts
|
|
10302
|
-
var LOGO_TEXT_KEYS = ["nav-logo-text", "footer-logo-text", "logo-text"];
|
|
10303
|
-
var LOGO_IMAGE_KEYS = ["nav-logo-image", "footer-logo", "footer-logo-image"];
|
|
10304
|
-
var LOGO_HREF_KEYS = ["nav-logo-href", "footer-logo-href", "logo-href"];
|
|
10305
|
-
var LOGO_PLACEHOLDER_KEY = "logo-is-placeholder";
|
|
10306
|
-
var LOGO_ALT_KEY = "logo-alt";
|
|
10307
|
-
var LOGO_IMAGE_URL_KEY = "nav-logo-image";
|
|
10308
|
-
var PLACEHOLDER_BUSINESS_NAME = "Business name";
|
|
10309
|
-
function resolveLogoDisplayText(text) {
|
|
10310
|
-
const trimmed = (text ?? "").trim();
|
|
10311
|
-
return trimmed || PLACEHOLDER_BUSINESS_NAME;
|
|
10312
|
-
}
|
|
10313
|
-
function isFooterLogoRoot(root) {
|
|
10314
|
-
return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
|
|
10315
|
-
}
|
|
10316
|
-
function imageKeyForRoot(root) {
|
|
10317
|
-
return isFooterLogoRoot(root) ? "footer-logo" : "nav-logo-image";
|
|
10318
|
-
}
|
|
10319
|
-
function textKeyForRoot(root) {
|
|
10320
|
-
return isFooterLogoRoot(root) ? "footer-logo-text" : "nav-logo-text";
|
|
10321
|
-
}
|
|
10322
|
-
function ensureLogoHrefKey(root) {
|
|
10323
|
-
if (!(root instanceof HTMLAnchorElement)) return;
|
|
10324
|
-
if (root.hasAttribute("data-ohw-href-key")) return;
|
|
10325
|
-
root.setAttribute("data-ohw-href-key", isFooterLogoRoot(root) ? "footer-logo-href" : "nav-logo-href");
|
|
10326
|
-
}
|
|
10327
|
-
function applyLogoIdentity(text, isPlaceholder) {
|
|
10328
|
-
const display = resolveLogoDisplayText(text);
|
|
10329
|
-
const placeholder = isPlaceholder || !text.trim() || display === PLACEHOLDER_BUSINESS_NAME;
|
|
10330
|
-
for (const key of LOGO_TEXT_KEYS) {
|
|
10331
|
-
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
10332
|
-
if (el.textContent !== display) el.textContent = display;
|
|
10333
|
-
});
|
|
10334
|
-
}
|
|
10335
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
10336
|
-
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
10337
|
-
const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
|
|
10338
|
-
if (img) img.alt = display;
|
|
10339
|
-
});
|
|
10340
|
-
}
|
|
10341
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((el) => {
|
|
10342
|
-
if (placeholder) el.setAttribute("data-ohw-placeholder", "");
|
|
10343
|
-
else el.removeAttribute("data-ohw-placeholder");
|
|
10344
|
-
});
|
|
10345
|
-
return display;
|
|
10346
|
-
}
|
|
10347
|
-
function applyLogoImage(url, alt) {
|
|
10348
|
-
const displayAlt = resolveLogoDisplayText(alt);
|
|
10349
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
10350
|
-
ensureLogoHrefKey(root);
|
|
10351
|
-
const imageKey = imageKeyForRoot(root);
|
|
10352
|
-
const textKey = textKeyForRoot(root);
|
|
10353
|
-
let img = root.querySelector(`img[data-ohw-key="${imageKey}"]`) ?? (root.querySelector(`[data-ohw-key="${imageKey}"]`) instanceof HTMLImageElement ? root.querySelector(`[data-ohw-key="${imageKey}"]`) : null) ?? root.querySelector("img");
|
|
10354
|
-
let textEl = root.querySelector(`[data-ohw-key="${textKey}"]`) ?? root.querySelector('[data-ohw-key="logo-text"]');
|
|
10355
|
-
if (url) {
|
|
10356
|
-
if (!img) {
|
|
10357
|
-
img = document.createElement("img");
|
|
10358
|
-
img.setAttribute("data-ohw-editable", "image");
|
|
10359
|
-
img.setAttribute("data-ohw-key", imageKey);
|
|
10360
|
-
img.alt = displayAlt;
|
|
10361
|
-
img.style.height = "";
|
|
10362
|
-
img.style.maxHeight = "none";
|
|
10363
|
-
img.style.width = "auto";
|
|
10364
|
-
img.style.display = "block";
|
|
10365
|
-
img.style.objectFit = "contain";
|
|
10366
|
-
root.insertBefore(img, root.firstChild);
|
|
10367
|
-
} else {
|
|
10368
|
-
img.setAttribute("data-ohw-editable", "image");
|
|
10369
|
-
img.setAttribute("data-ohw-key", imageKey);
|
|
10370
|
-
}
|
|
10371
|
-
img.removeAttribute("srcset");
|
|
10372
|
-
img.removeAttribute("sizes");
|
|
10373
|
-
img.src = url;
|
|
10374
|
-
img.alt = displayAlt;
|
|
10375
|
-
img.style.display = "block";
|
|
10376
|
-
if (textEl) textEl.style.display = "none";
|
|
10377
|
-
root.removeAttribute("data-ohw-placeholder");
|
|
10378
|
-
return;
|
|
10379
|
-
}
|
|
10380
|
-
if (img) {
|
|
10381
|
-
img.removeAttribute("src");
|
|
10382
|
-
img.removeAttribute("srcset");
|
|
10383
|
-
img.removeAttribute("sizes");
|
|
10384
|
-
img.alt = displayAlt;
|
|
10385
|
-
img.style.display = "none";
|
|
10386
|
-
}
|
|
10387
|
-
if (!textEl) {
|
|
10388
|
-
textEl = document.createElement("span");
|
|
10389
|
-
textEl.setAttribute("data-ohw-editable", "plain");
|
|
10390
|
-
textEl.setAttribute("data-ohw-key", textKey);
|
|
10391
|
-
root.appendChild(textEl);
|
|
10392
|
-
}
|
|
10393
|
-
textEl.style.display = "";
|
|
10394
|
-
if (textEl.textContent !== displayAlt) textEl.textContent = displayAlt;
|
|
10395
|
-
if (!displayAlt.trim() || displayAlt === PLACEHOLDER_BUSINESS_NAME) {
|
|
10396
|
-
root.setAttribute("data-ohw-placeholder", "");
|
|
10397
|
-
} else {
|
|
10398
|
-
root.removeAttribute("data-ohw-placeholder");
|
|
10399
|
-
}
|
|
10400
|
-
});
|
|
10401
|
-
}
|
|
10402
|
-
function applyLogoHref(href) {
|
|
10403
|
-
const target = href.trim() || "/";
|
|
10404
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
10405
|
-
ensureLogoHrefKey(root);
|
|
10406
|
-
if (root instanceof HTMLAnchorElement) {
|
|
10407
|
-
root.setAttribute("href", target);
|
|
10408
|
-
}
|
|
10409
|
-
});
|
|
10410
|
-
for (const key of LOGO_HREF_KEYS) setStoredLinkHref(key, target);
|
|
10411
|
-
}
|
|
10412
|
-
function readLogoIdentityFromDom() {
|
|
10413
|
-
let imageUrl = null;
|
|
10414
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
10415
|
-
const el = document.querySelector(`[data-ohw-key="${key}"]`);
|
|
10416
|
-
const img = el instanceof HTMLImageElement ? el : el?.querySelector("img");
|
|
10417
|
-
const attrSrc = img?.getAttribute("src")?.trim() ?? "";
|
|
10418
|
-
if (attrSrc && !attrSrc.startsWith("data:") && img && img.style.display !== "none") {
|
|
10419
|
-
imageUrl = img.currentSrc || img.src;
|
|
10420
|
-
break;
|
|
10421
|
-
}
|
|
10422
|
-
}
|
|
10423
|
-
let text = PLACEHOLDER_BUSINESS_NAME;
|
|
10424
|
-
let isPlaceholder = true;
|
|
10425
|
-
for (const key of LOGO_TEXT_KEYS) {
|
|
10426
|
-
const el = document.querySelector(`[data-ohw-key="${key}"]`);
|
|
10427
|
-
if (el?.textContent?.trim()) {
|
|
10428
|
-
text = el.textContent.trim();
|
|
10429
|
-
const logoRoot2 = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
10430
|
-
isPlaceholder = logoRoot2?.hasAttribute("data-ohw-placeholder") === true || text === PLACEHOLDER_BUSINESS_NAME;
|
|
10431
|
-
break;
|
|
10432
|
-
}
|
|
10433
|
-
}
|
|
10434
|
-
if (imageUrl) {
|
|
10435
|
-
const logoImg = document.querySelector(
|
|
10436
|
-
'[data-ohw-key="nav-logo-image"], [data-ohw-key="footer-logo"]'
|
|
10437
|
-
);
|
|
10438
|
-
const alt = logoImg?.alt?.trim() || text;
|
|
10439
|
-
isPlaceholder = false;
|
|
10440
|
-
const hrefEl = document.querySelector(
|
|
10441
|
-
'a[data-ohw-role="logo"], a[data-ohw-logo], [data-ohw-role="logo"]'
|
|
10442
|
-
);
|
|
10443
|
-
const href2 = (hrefEl instanceof HTMLAnchorElement ? hrefEl.getAttribute("href") : null) || hrefEl?.closest("a")?.getAttribute("href") || "/";
|
|
10444
|
-
return { text, isPlaceholder, imageUrl, href: href2, alt };
|
|
10445
|
-
}
|
|
10446
|
-
const logoRoot = document.querySelector('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
10447
|
-
const href = (logoRoot instanceof HTMLAnchorElement ? logoRoot.getAttribute("href") : null) || logoRoot?.closest("a")?.getAttribute("href") || "/";
|
|
10448
|
-
return { text, isPlaceholder, imageUrl: null, href, alt: text };
|
|
10449
|
-
}
|
|
10450
|
-
function applyLogoFromContent(content) {
|
|
10451
|
-
const hasLogoIdentity = LOGO_PLACEHOLDER_KEY in content || LOGO_TEXT_KEYS.some((key) => key in content) || LOGO_IMAGE_KEYS.some((key) => key in content) || LOGO_ALT_KEY in content || LOGO_HREF_KEYS.some((key) => key in content);
|
|
10452
|
-
if (!hasLogoIdentity) return false;
|
|
10453
|
-
const logoText = content[LOGO_TEXT_KEYS[0]] ?? content[LOGO_TEXT_KEYS[1]] ?? readLogoIdentityFromDom().text;
|
|
10454
|
-
const logoAlt = content[LOGO_ALT_KEY] ?? logoText;
|
|
10455
|
-
const rawLogoImage = content[LOGO_IMAGE_URL_KEY] ?? content["footer-logo"] ?? content["footer-logo-image"] ?? null;
|
|
10456
|
-
const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
|
|
10457
|
-
const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
|
|
10458
|
-
const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
|
|
10459
|
-
if (logoImageUrl) {
|
|
10460
|
-
applyLogoImage(logoImageUrl, logoAlt);
|
|
10461
|
-
} else {
|
|
10462
|
-
if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
|
|
10463
|
-
applyLogoIdentity(logoText, logoIsPlaceholder);
|
|
10464
|
-
}
|
|
10465
|
-
const logoHref = content["nav-logo-href"] ?? content["footer-logo-href"] ?? content["logo-href"];
|
|
10466
|
-
if (typeof logoHref === "string" && logoHref.trim()) {
|
|
10467
|
-
applyLogoHref(logoHref);
|
|
10468
|
-
}
|
|
10469
|
-
return true;
|
|
10470
|
-
}
|
|
10471
|
-
|
|
10472
|
-
// src/lib/logo-size.ts
|
|
10473
|
-
var LOGO_SIZE_DEFAULTS = {
|
|
10474
|
-
navbar: 28,
|
|
10475
|
-
footer: 32
|
|
10476
|
-
};
|
|
10477
|
-
var LOGO_SIZE_MIN = 16;
|
|
10478
|
-
var LOGO_SIZE_MAX = 80;
|
|
10479
|
-
var LOGO_SIZE_DESKTOP_KEYS = {
|
|
10480
|
-
navbar: "nav-logo-size",
|
|
10481
|
-
footer: "footer-logo-size"
|
|
10482
|
-
};
|
|
10483
|
-
var LOGO_SIZE_MOBILE_KEYS = {
|
|
10484
|
-
navbar: "nav-logo-size-mobile",
|
|
10485
|
-
footer: "footer-logo-size-mobile"
|
|
10486
|
-
};
|
|
10487
|
-
var LOGO_SIZE_KEYS = [
|
|
10488
|
-
LOGO_SIZE_DESKTOP_KEYS.navbar,
|
|
10489
|
-
LOGO_SIZE_DESKTOP_KEYS.footer,
|
|
10490
|
-
LOGO_SIZE_MOBILE_KEYS.navbar,
|
|
10491
|
-
LOGO_SIZE_MOBILE_KEYS.footer
|
|
10492
|
-
];
|
|
10493
|
-
function isFooterLogoRoot2(root) {
|
|
10494
|
-
return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
|
|
10495
|
-
}
|
|
10496
|
-
function getLogoPlacement(root) {
|
|
10497
|
-
return isFooterLogoRoot2(root) ? "footer" : "navbar";
|
|
10498
|
-
}
|
|
10499
|
-
function parseLogoSizePx(raw, fallback) {
|
|
10500
|
-
if (raw == null || raw === "") return fallback;
|
|
10501
|
-
const n = Number.parseFloat(raw);
|
|
10502
|
-
if (!Number.isFinite(n)) return fallback;
|
|
10503
|
-
return Math.min(LOGO_SIZE_MAX, Math.max(LOGO_SIZE_MIN, Math.round(n)));
|
|
10504
|
-
}
|
|
10505
|
-
function isMobileLogoSizeFollowing(content, placement) {
|
|
10506
|
-
const raw = content[LOGO_SIZE_MOBILE_KEYS[placement]];
|
|
10507
|
-
return raw == null || raw.trim() === "";
|
|
10508
|
-
}
|
|
10509
|
-
function resolveDesktopLogoSize(content, placement) {
|
|
10510
|
-
return parseLogoSizePx(content[LOGO_SIZE_DESKTOP_KEYS[placement]], LOGO_SIZE_DEFAULTS[placement]);
|
|
10511
|
-
}
|
|
10512
|
-
function resolveMobileLogoSize(content, placement) {
|
|
10513
|
-
if (isMobileLogoSizeFollowing(content, placement)) {
|
|
10514
|
-
return resolveDesktopLogoSize(content, placement);
|
|
10515
|
-
}
|
|
10516
|
-
return parseLogoSizePx(
|
|
10517
|
-
content[LOGO_SIZE_MOBILE_KEYS[placement]],
|
|
10518
|
-
resolveDesktopLogoSize(content, placement)
|
|
10519
|
-
);
|
|
10520
|
-
}
|
|
10521
|
-
function setRootSizeVars(root, desktopPx, mobilePx, following) {
|
|
10522
|
-
root.style.setProperty("--ohw-logo-size", `${desktopPx}px`);
|
|
10523
|
-
if (following) {
|
|
10524
|
-
root.style.removeProperty("--ohw-logo-size-mobile");
|
|
10525
|
-
} else {
|
|
10526
|
-
root.style.setProperty("--ohw-logo-size-mobile", `${mobilePx}px`);
|
|
10527
|
-
}
|
|
10528
|
-
root.querySelectorAll("img").forEach((img) => {
|
|
10529
|
-
img.style.height = "";
|
|
10530
|
-
img.style.maxHeight = "none";
|
|
10531
|
-
img.style.width = "auto";
|
|
10532
|
-
img.style.objectFit = "contain";
|
|
10533
|
-
});
|
|
10534
|
-
}
|
|
10535
|
-
function applyLogoSizes(content) {
|
|
10536
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
10537
|
-
const placement = getLogoPlacement(root);
|
|
10538
|
-
const desktop = resolveDesktopLogoSize(content, placement);
|
|
10539
|
-
const following = isMobileLogoSizeFollowing(content, placement);
|
|
10540
|
-
const mobile = following ? desktop : resolveMobileLogoSize(content, placement);
|
|
10541
|
-
setRootSizeVars(root, desktop, mobile, following);
|
|
10542
|
-
});
|
|
10543
|
-
}
|
|
10544
|
-
function applyLogoSizeToPlacement(placement, desktopPx, mobilePx, following) {
|
|
10545
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
10546
|
-
if (getLogoPlacement(root) !== placement) return;
|
|
10547
|
-
setRootSizeVars(root, desktopPx, mobilePx, following);
|
|
10548
|
-
});
|
|
10549
|
-
}
|
|
10550
|
-
function logoHasUploadedImage(logoEl) {
|
|
10551
|
-
if (logoEl.hasAttribute("data-ohw-placeholder")) return false;
|
|
10552
|
-
const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
|
|
10553
|
-
if (!img) return false;
|
|
10554
|
-
const src = img.getAttribute("src")?.trim() ?? "";
|
|
10555
|
-
if (!src || src.startsWith("data:")) return false;
|
|
10556
|
-
if (img.style.display === "none") return false;
|
|
10557
|
-
return true;
|
|
10558
|
-
}
|
|
10559
|
-
function getLogoInteractionRect(logoEl) {
|
|
10560
|
-
if (logoHasUploadedImage(logoEl)) {
|
|
10561
|
-
const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
|
|
10562
|
-
if (img) {
|
|
10563
|
-
const r2 = img.getBoundingClientRect();
|
|
10564
|
-
if (r2.width > 0 && r2.height > 0) return r2;
|
|
10565
|
-
}
|
|
10566
|
-
}
|
|
10567
|
-
const text = logoEl.querySelector(
|
|
10568
|
-
'[data-ohw-key="nav-logo-text"], [data-ohw-key="footer-logo-text"]'
|
|
10569
|
-
);
|
|
10570
|
-
if (text) {
|
|
10571
|
-
const style = window.getComputedStyle(text);
|
|
10572
|
-
if (style.display !== "none" && style.visibility !== "hidden") {
|
|
10573
|
-
const r2 = text.getBoundingClientRect();
|
|
10574
|
-
if (r2.width > 0 && r2.height > 0) return r2;
|
|
10575
|
-
}
|
|
10576
|
-
}
|
|
10577
|
-
return logoEl.getBoundingClientRect();
|
|
10578
|
-
}
|
|
10579
|
-
function readLogoSizeState(content, placement) {
|
|
10580
|
-
const desktopPx = resolveDesktopLogoSize(content, placement);
|
|
10581
|
-
const mobileFollowing = isMobileLogoSizeFollowing(content, placement);
|
|
10582
|
-
const mobilePx = mobileFollowing ? desktopPx : resolveMobileLogoSize(content, placement);
|
|
10583
|
-
return { desktopPx, mobilePx, mobileFollowing };
|
|
10584
|
-
}
|
|
10585
|
-
|
|
10586
|
-
// src/lib/site-wide-scope.ts
|
|
10587
|
-
function getLogoElement(el) {
|
|
10588
|
-
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
10589
|
-
if (marked) return marked;
|
|
10590
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
10591
|
-
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
10592
|
-
if (!root) return null;
|
|
10593
|
-
const anchor = el.closest("a");
|
|
10594
|
-
if (anchor && root.contains(anchor) && !anchor.hasAttribute("data-ohw-href-key") && !anchor.closest("[data-ohw-nav-container]") && Boolean(anchor.querySelector("img") || anchor.matches("img"))) {
|
|
10595
|
-
return anchor;
|
|
10596
|
-
}
|
|
10597
|
-
const img = el.matches("img") ? el : null;
|
|
10598
|
-
if (img && !img.closest("[data-ohw-href-key]") && !img.closest("[data-ohw-nav-container]") && (img.closest("footer") || img.closest("nav, [data-ohw-nav-root]"))) {
|
|
10599
|
-
return img;
|
|
10600
|
-
}
|
|
10601
|
-
return null;
|
|
10602
|
-
}
|
|
10603
|
-
function isInFooter(el) {
|
|
10604
|
-
if (!el) return false;
|
|
10605
|
-
return Boolean(el.closest("footer") || el.closest('[data-ohw-section="footer"]'));
|
|
10606
|
-
}
|
|
10607
|
-
function isSiteWideElement(el) {
|
|
10608
|
-
if (!el) return false;
|
|
10609
|
-
if (getLogoElement(el)) return true;
|
|
10610
|
-
if (isInFooter(el)) return true;
|
|
10611
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-root")) {
|
|
10612
|
-
return true;
|
|
10613
|
-
}
|
|
10614
|
-
if (el.hasAttribute("data-ohw-href-key") && el.closest("nav, [data-ohw-nav-root], [data-ohw-nav-drawer], aside")) {
|
|
10615
|
-
return true;
|
|
10616
|
-
}
|
|
10617
|
-
if (el.closest('[data-ohw-role="navbar-button"]')) return true;
|
|
10618
|
-
return false;
|
|
10619
|
-
}
|
|
10620
|
-
function isSiteWideScopeActive(args) {
|
|
10621
|
-
return isSiteWideElement(args.selected) || isSiteWideElement(args.hoveredItem) || isSiteWideElement(args.hoveredNavContainer) || isSiteWideElement(args.active);
|
|
10622
|
-
}
|
|
10623
|
-
|
|
10624
10299
|
// src/lib/add-footer-column.ts
|
|
10625
10300
|
function buildFooterColumnEditContentPatch(result) {
|
|
10626
10301
|
return {
|
|
@@ -10653,299 +10328,6 @@ function addFooterColumnWithPersist({
|
|
|
10653
10328
|
return result;
|
|
10654
10329
|
}
|
|
10655
10330
|
|
|
10656
|
-
// src/ui/FloatingPanel.tsx
|
|
10657
|
-
import {
|
|
10658
|
-
useCallback as useCallback5,
|
|
10659
|
-
useEffect as useEffect9,
|
|
10660
|
-
useLayoutEffect as useLayoutEffect3,
|
|
10661
|
-
useRef as useRef7,
|
|
10662
|
-
useState as useState8
|
|
10663
|
-
} from "react";
|
|
10664
|
-
import { X as X5 } from "lucide-react";
|
|
10665
|
-
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10666
|
-
var PANEL_WIDTH = 256;
|
|
10667
|
-
var EDGE_MARGIN = 16;
|
|
10668
|
-
function getVisibleClip(parentScroll) {
|
|
10669
|
-
const left = 0;
|
|
10670
|
-
const right = window.innerWidth;
|
|
10671
|
-
if (!parentScroll) {
|
|
10672
|
-
return { top: 0, bottom: window.innerHeight, left, right };
|
|
10673
|
-
}
|
|
10674
|
-
const { iframeOffsetTop, headerH: visibleCanvasTop, canvasH } = parentScroll;
|
|
10675
|
-
const top = Math.max(0, visibleCanvasTop - iframeOffsetTop);
|
|
10676
|
-
const bottom = Math.min(window.innerHeight, visibleCanvasTop + canvasH - iframeOffsetTop);
|
|
10677
|
-
return { top, bottom: Math.max(top, bottom), left, right };
|
|
10678
|
-
}
|
|
10679
|
-
function defaultFloatingPanelPosition(parentScroll, panelHeight = 280) {
|
|
10680
|
-
const clip = getVisibleClip(parentScroll);
|
|
10681
|
-
return {
|
|
10682
|
-
x: Math.max(EDGE_MARGIN, clip.right - PANEL_WIDTH - EDGE_MARGIN),
|
|
10683
|
-
y: Math.min(
|
|
10684
|
-
Math.max(clip.top + EDGE_MARGIN, EDGE_MARGIN),
|
|
10685
|
-
Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelHeight - EDGE_MARGIN)
|
|
10686
|
-
)
|
|
10687
|
-
};
|
|
10688
|
-
}
|
|
10689
|
-
function clampPosition(pos, parentScroll, panelW, panelH) {
|
|
10690
|
-
const clip = getVisibleClip(parentScroll);
|
|
10691
|
-
const maxX = Math.max(clip.left + EDGE_MARGIN, clip.right - panelW - EDGE_MARGIN);
|
|
10692
|
-
const maxY = Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelH - EDGE_MARGIN);
|
|
10693
|
-
return {
|
|
10694
|
-
x: Math.min(Math.max(pos.x, clip.left + EDGE_MARGIN), maxX),
|
|
10695
|
-
y: Math.min(Math.max(pos.y, clip.top + EDGE_MARGIN), maxY)
|
|
10696
|
-
};
|
|
10697
|
-
}
|
|
10698
|
-
function FloatingPanel({
|
|
10699
|
-
open,
|
|
10700
|
-
title,
|
|
10701
|
-
context,
|
|
10702
|
-
icon,
|
|
10703
|
-
onClose,
|
|
10704
|
-
children,
|
|
10705
|
-
position,
|
|
10706
|
-
onPositionChange,
|
|
10707
|
-
parentScroll = null,
|
|
10708
|
-
className,
|
|
10709
|
-
bodyClassName
|
|
10710
|
-
}) {
|
|
10711
|
-
const panelRef = useRef7(null);
|
|
10712
|
-
const [measured, setMeasured] = useState8({ w: PANEL_WIDTH, h: 280 });
|
|
10713
|
-
const dragRef = useRef7(null);
|
|
10714
|
-
const resolved = position ?? defaultFloatingPanelPosition(parentScroll, measured.h);
|
|
10715
|
-
const clamped = clampPosition(resolved, parentScroll, measured.w, measured.h);
|
|
10716
|
-
useLayoutEffect3(() => {
|
|
10717
|
-
if (!open || !panelRef.current) return;
|
|
10718
|
-
const el = panelRef.current;
|
|
10719
|
-
const next = { w: el.offsetWidth || PANEL_WIDTH, h: el.offsetHeight || 280 };
|
|
10720
|
-
setMeasured((prev) => prev.w === next.w && prev.h === next.h ? prev : next);
|
|
10721
|
-
}, [open, children, title, context]);
|
|
10722
|
-
useEffect9(() => {
|
|
10723
|
-
if (!open || !position || !onPositionChange) return;
|
|
10724
|
-
const next = clampPosition(position, parentScroll, measured.w, measured.h);
|
|
10725
|
-
if (next.x !== position.x || next.y !== position.y) onPositionChange(next);
|
|
10726
|
-
}, [open, parentScroll, measured.w, measured.h, position, onPositionChange]);
|
|
10727
|
-
const onHeaderPointerDown = useCallback5(
|
|
10728
|
-
(e) => {
|
|
10729
|
-
if (e.button !== 0) return;
|
|
10730
|
-
if (e.target.closest("[data-ohw-floating-panel-close]")) return;
|
|
10731
|
-
e.preventDefault();
|
|
10732
|
-
e.stopPropagation();
|
|
10733
|
-
const el = e.currentTarget;
|
|
10734
|
-
el.setPointerCapture(e.pointerId);
|
|
10735
|
-
dragRef.current = {
|
|
10736
|
-
pointerId: e.pointerId,
|
|
10737
|
-
startX: e.clientX,
|
|
10738
|
-
startY: e.clientY,
|
|
10739
|
-
originX: clamped.x,
|
|
10740
|
-
originY: clamped.y
|
|
10741
|
-
};
|
|
10742
|
-
},
|
|
10743
|
-
[clamped.x, clamped.y]
|
|
10744
|
-
);
|
|
10745
|
-
const onHeaderPointerMove = useCallback5(
|
|
10746
|
-
(e) => {
|
|
10747
|
-
const drag = dragRef.current;
|
|
10748
|
-
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
10749
|
-
e.preventDefault();
|
|
10750
|
-
const next = clampPosition(
|
|
10751
|
-
{
|
|
10752
|
-
x: drag.originX + (e.clientX - drag.startX),
|
|
10753
|
-
y: drag.originY + (e.clientY - drag.startY)
|
|
10754
|
-
},
|
|
10755
|
-
parentScroll,
|
|
10756
|
-
measured.w,
|
|
10757
|
-
measured.h
|
|
10758
|
-
);
|
|
10759
|
-
onPositionChange?.(next);
|
|
10760
|
-
},
|
|
10761
|
-
[measured.h, measured.w, onPositionChange, parentScroll]
|
|
10762
|
-
);
|
|
10763
|
-
const endDrag = useCallback5((e) => {
|
|
10764
|
-
const drag = dragRef.current;
|
|
10765
|
-
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
10766
|
-
dragRef.current = null;
|
|
10767
|
-
try {
|
|
10768
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
10769
|
-
} catch {
|
|
10770
|
-
}
|
|
10771
|
-
}, []);
|
|
10772
|
-
if (!open) return null;
|
|
10773
|
-
return /* @__PURE__ */ jsxs16(
|
|
10774
|
-
"div",
|
|
10775
|
-
{
|
|
10776
|
-
ref: panelRef,
|
|
10777
|
-
"data-ohw-floating-panel": "",
|
|
10778
|
-
role: "dialog",
|
|
10779
|
-
"aria-label": title,
|
|
10780
|
-
className: cn(
|
|
10781
|
-
// Above MediaOverlay / item chrome (2147483646); link-modal content shares this tier.
|
|
10782
|
-
"fixed z-[2147483647] flex w-64 flex-col overflow-hidden rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
10783
|
-
className
|
|
10784
|
-
),
|
|
10785
|
-
style: { left: clamped.x, top: clamped.y },
|
|
10786
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
10787
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
10788
|
-
onClick: (e) => e.stopPropagation(),
|
|
10789
|
-
children: [
|
|
10790
|
-
/* @__PURE__ */ jsxs16(
|
|
10791
|
-
"div",
|
|
10792
|
-
{
|
|
10793
|
-
"data-ohw-floating-panel-header": "",
|
|
10794
|
-
className: "relative flex cursor-grab items-start gap-2 border-b border-border py-5 pl-5 pr-11 active:cursor-grabbing",
|
|
10795
|
-
onPointerDown: onHeaderPointerDown,
|
|
10796
|
-
onPointerMove: onHeaderPointerMove,
|
|
10797
|
-
onPointerUp: endDrag,
|
|
10798
|
-
onPointerCancel: endDrag,
|
|
10799
|
-
children: [
|
|
10800
|
-
/* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
10801
|
-
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
|
|
10802
|
-
icon ? /* @__PURE__ */ jsx26("span", { className: "shrink-0 text-foreground", children: icon }) : null,
|
|
10803
|
-
/* @__PURE__ */ jsx26("p", { className: "min-w-0 flex-1 text-lg font-semibold leading-7 text-foreground", children: title })
|
|
10804
|
-
] }),
|
|
10805
|
-
context ? /* @__PURE__ */ jsx26("p", { className: "w-full text-sm leading-5 text-muted-foreground", children: context }) : null
|
|
10806
|
-
] }),
|
|
10807
|
-
/* @__PURE__ */ jsx26(
|
|
10808
|
-
"button",
|
|
10809
|
-
{
|
|
10810
|
-
type: "button",
|
|
10811
|
-
"data-ohw-floating-panel-close": "",
|
|
10812
|
-
"aria-label": "Close",
|
|
10813
|
-
className: "absolute right-2.5 top-2.5 rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
10814
|
-
onClick: (e) => {
|
|
10815
|
-
e.stopPropagation();
|
|
10816
|
-
onClose();
|
|
10817
|
-
},
|
|
10818
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
10819
|
-
children: /* @__PURE__ */ jsx26(X5, { size: 16, "aria-hidden": true })
|
|
10820
|
-
}
|
|
10821
|
-
)
|
|
10822
|
-
]
|
|
10823
|
-
}
|
|
10824
|
-
),
|
|
10825
|
-
/* @__PURE__ */ jsx26(
|
|
10826
|
-
"div",
|
|
10827
|
-
{
|
|
10828
|
-
"data-ohw-floating-panel-body": "",
|
|
10829
|
-
className: cn("flex w-full flex-col gap-4 p-5", bodyClassName),
|
|
10830
|
-
children
|
|
10831
|
-
}
|
|
10832
|
-
)
|
|
10833
|
-
]
|
|
10834
|
-
}
|
|
10835
|
-
);
|
|
10836
|
-
}
|
|
10837
|
-
|
|
10838
|
-
// src/ui/logo-size-panel.tsx
|
|
10839
|
-
import { ArrowUpRight, Link as Link2 } from "lucide-react";
|
|
10840
|
-
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10841
|
-
function SizeSlider({
|
|
10842
|
-
value,
|
|
10843
|
-
onChange
|
|
10844
|
-
}) {
|
|
10845
|
-
const pct = (value - LOGO_SIZE_MIN) / (LOGO_SIZE_MAX - LOGO_SIZE_MIN) * 100;
|
|
10846
|
-
return /* @__PURE__ */ jsxs17("div", { className: "flex w-full flex-col gap-3", children: [
|
|
10847
|
-
/* @__PURE__ */ jsxs17("div", { className: "flex w-full items-center gap-2 text-sm font-medium leading-5", children: [
|
|
10848
|
-
/* @__PURE__ */ jsx27("span", { className: "min-w-0 flex-1 text-foreground", children: "Size" }),
|
|
10849
|
-
/* @__PURE__ */ jsxs17("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: [
|
|
10850
|
-
value,
|
|
10851
|
-
" px"
|
|
10852
|
-
] })
|
|
10853
|
-
] }),
|
|
10854
|
-
/* @__PURE__ */ jsxs17("div", { className: "relative h-2 w-full rounded-full bg-primary-50", children: [
|
|
10855
|
-
/* @__PURE__ */ jsx27(
|
|
10856
|
-
"div",
|
|
10857
|
-
{
|
|
10858
|
-
className: "absolute inset-y-0 left-0 rounded-full bg-primary",
|
|
10859
|
-
style: { width: `${pct}%` }
|
|
10860
|
-
}
|
|
10861
|
-
),
|
|
10862
|
-
/* @__PURE__ */ jsx27(
|
|
10863
|
-
"input",
|
|
10864
|
-
{
|
|
10865
|
-
type: "range",
|
|
10866
|
-
min: LOGO_SIZE_MIN,
|
|
10867
|
-
max: LOGO_SIZE_MAX,
|
|
10868
|
-
step: 1,
|
|
10869
|
-
value,
|
|
10870
|
-
"aria-label": "Logo size",
|
|
10871
|
-
className: cn(
|
|
10872
|
-
"absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent",
|
|
10873
|
-
"[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:size-5",
|
|
10874
|
-
"[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2",
|
|
10875
|
-
"[&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background",
|
|
10876
|
-
"[&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:rounded-full",
|
|
10877
|
-
"[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary",
|
|
10878
|
-
"[&::-moz-range-thumb]:bg-background"
|
|
10879
|
-
),
|
|
10880
|
-
onChange: (e) => onChange(Number(e.target.value))
|
|
10881
|
-
}
|
|
10882
|
-
)
|
|
10883
|
-
] })
|
|
10884
|
-
] });
|
|
10885
|
-
}
|
|
10886
|
-
function LogoSizePanel({
|
|
10887
|
-
viewport,
|
|
10888
|
-
sizePx,
|
|
10889
|
-
mobileFollowing = true,
|
|
10890
|
-
onSizeChange,
|
|
10891
|
-
onCustomizeMobile,
|
|
10892
|
-
onResetMobile,
|
|
10893
|
-
onUpdateEverywhere,
|
|
10894
|
-
className
|
|
10895
|
-
}) {
|
|
10896
|
-
const showFollowing = viewport === "mobile" && mobileFollowing;
|
|
10897
|
-
const showMobileSlider = viewport === "mobile" && !mobileFollowing;
|
|
10898
|
-
const showDesktopSlider = viewport === "desktop";
|
|
10899
|
-
return /* @__PURE__ */ jsxs17("div", { className: cn("flex w-full flex-col gap-4", className), children: [
|
|
10900
|
-
showFollowing ? /* @__PURE__ */ jsxs17("div", { className: "flex w-full flex-col gap-2", children: [
|
|
10901
|
-
/* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-1", children: [
|
|
10902
|
-
/* @__PURE__ */ jsx27(Link2, { size: 16, className: "mt-0.5 shrink-0 text-foreground", "aria-hidden": true }),
|
|
10903
|
-
/* @__PURE__ */ jsx27("p", { className: "text-sm font-semibold leading-5 text-foreground", children: "Following desktop size" })
|
|
10904
|
-
] }),
|
|
10905
|
-
/* @__PURE__ */ jsx27("p", { className: "text-sm leading-5 text-muted-foreground", children: "Mobile uses the desktop size until you customize it. Change the desktop size and it follows automatically." }),
|
|
10906
|
-
/* @__PURE__ */ jsx27(
|
|
10907
|
-
Button,
|
|
10908
|
-
{
|
|
10909
|
-
type: "button",
|
|
10910
|
-
variant: "outline",
|
|
10911
|
-
size: "sm",
|
|
10912
|
-
className: "h-9 w-full min-w-0 cursor-pointer",
|
|
10913
|
-
onClick: onCustomizeMobile,
|
|
10914
|
-
children: "Customize for mobile"
|
|
10915
|
-
}
|
|
10916
|
-
)
|
|
10917
|
-
] }) : null,
|
|
10918
|
-
showDesktopSlider || showMobileSlider ? /* @__PURE__ */ jsx27(SizeSlider, { value: sizePx, onChange: onSizeChange }) : null,
|
|
10919
|
-
showMobileSlider ? /* @__PURE__ */ jsx27(
|
|
10920
|
-
Button,
|
|
10921
|
-
{
|
|
10922
|
-
type: "button",
|
|
10923
|
-
variant: "outline",
|
|
10924
|
-
size: "sm",
|
|
10925
|
-
className: "h-9 w-full min-w-0 cursor-pointer",
|
|
10926
|
-
onClick: onResetMobile,
|
|
10927
|
-
children: "Reset to desktop size"
|
|
10928
|
-
}
|
|
10929
|
-
) : null,
|
|
10930
|
-
/* @__PURE__ */ jsx27("div", { className: "h-px w-full bg-border", role: "separator" }),
|
|
10931
|
-
/* @__PURE__ */ jsxs17(
|
|
10932
|
-
Button,
|
|
10933
|
-
{
|
|
10934
|
-
type: "button",
|
|
10935
|
-
variant: "outline",
|
|
10936
|
-
size: "sm",
|
|
10937
|
-
className: "h-9 w-full min-w-0 cursor-pointer gap-1",
|
|
10938
|
-
onClick: onUpdateEverywhere,
|
|
10939
|
-
children: [
|
|
10940
|
-
"Update logo everywhere",
|
|
10941
|
-
/* @__PURE__ */ jsx27(ArrowUpRight, { size: 16, "aria-hidden": true })
|
|
10942
|
-
]
|
|
10943
|
-
}
|
|
10944
|
-
),
|
|
10945
|
-
/* @__PURE__ */ jsx27("p", { className: "text-sm leading-5 text-muted-foreground", children: "Matches the right version to your background." })
|
|
10946
|
-
] });
|
|
10947
|
-
}
|
|
10948
|
-
|
|
10949
10331
|
// src/lib/item-drag-interaction.ts
|
|
10950
10332
|
function disableNativeHrefDrag(el) {
|
|
10951
10333
|
if (el.draggable) el.draggable = false;
|
|
@@ -11144,7 +10526,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
|
|
|
11144
10526
|
}
|
|
11145
10527
|
|
|
11146
10528
|
// src/useNavItemDrag.ts
|
|
11147
|
-
import { useCallback as
|
|
10529
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef7, useState as useState8 } from "react";
|
|
11148
10530
|
function useNavItemDrag({
|
|
11149
10531
|
isEditMode,
|
|
11150
10532
|
editContentRef,
|
|
@@ -11168,11 +10550,11 @@ function useNavItemDrag({
|
|
|
11168
10550
|
getNavigationItemAnchor: getNavigationItemAnchor2,
|
|
11169
10551
|
isDragHandleDisabled: isDragHandleDisabled2
|
|
11170
10552
|
}) {
|
|
11171
|
-
const navDragRef =
|
|
11172
|
-
const [navDropSlots, setNavDropSlots] =
|
|
11173
|
-
const [activeNavDropIndex, setActiveNavDropIndex] =
|
|
11174
|
-
const navPointerDragRef =
|
|
11175
|
-
const clearNavDragVisuals =
|
|
10553
|
+
const navDragRef = useRef7(null);
|
|
10554
|
+
const [navDropSlots, setNavDropSlots] = useState8([]);
|
|
10555
|
+
const [activeNavDropIndex, setActiveNavDropIndex] = useState8(null);
|
|
10556
|
+
const navPointerDragRef = useRef7(null);
|
|
10557
|
+
const clearNavDragVisuals = useCallback5(() => {
|
|
11176
10558
|
const session = navDragRef.current;
|
|
11177
10559
|
const keepOpenEl = session?.draggedEl?.closest("[data-ohw-nav-children]") != null ? session.draggedEl : null;
|
|
11178
10560
|
navDragRef.current = null;
|
|
@@ -11189,7 +10571,7 @@ function useNavItemDrag({
|
|
|
11189
10571
|
document.documentElement.removeAttribute("data-ohw-nav-dragging-root");
|
|
11190
10572
|
unlockItemDragInteraction();
|
|
11191
10573
|
}, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
|
|
11192
|
-
const refreshNavDragVisuals =
|
|
10574
|
+
const refreshNavDragVisuals = useCallback5(
|
|
11193
10575
|
(session, activeSlot, clientX, clientY) => {
|
|
11194
10576
|
setDraggedItemRect(session.draggedEl.getBoundingClientRect());
|
|
11195
10577
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -11207,13 +10589,13 @@ function useNavItemDrag({
|
|
|
11207
10589
|
},
|
|
11208
10590
|
[setDraggedItemRect, setSiblingHintRects]
|
|
11209
10591
|
);
|
|
11210
|
-
const refreshNavDragVisualsRef =
|
|
10592
|
+
const refreshNavDragVisualsRef = useRef7(refreshNavDragVisuals);
|
|
11211
10593
|
refreshNavDragVisualsRef.current = refreshNavDragVisuals;
|
|
11212
|
-
const commitNavDragRef =
|
|
10594
|
+
const commitNavDragRef = useRef7(() => {
|
|
11213
10595
|
});
|
|
11214
|
-
const beginNavDragRef =
|
|
10596
|
+
const beginNavDragRef = useRef7(() => {
|
|
11215
10597
|
});
|
|
11216
|
-
const beginNavDrag =
|
|
10598
|
+
const beginNavDrag = useCallback5(
|
|
11217
10599
|
(session) => {
|
|
11218
10600
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
11219
10601
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -11247,7 +10629,7 @@ function useNavItemDrag({
|
|
|
11247
10629
|
]
|
|
11248
10630
|
);
|
|
11249
10631
|
beginNavDragRef.current = beginNavDrag;
|
|
11250
|
-
const commitNavDrag =
|
|
10632
|
+
const commitNavDrag = useCallback5(
|
|
11251
10633
|
(clientX, clientY) => {
|
|
11252
10634
|
const session = navDragRef.current;
|
|
11253
10635
|
if (!session) {
|
|
@@ -11308,7 +10690,7 @@ function useNavItemDrag({
|
|
|
11308
10690
|
[clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
|
|
11309
10691
|
);
|
|
11310
10692
|
commitNavDragRef.current = commitNavDrag;
|
|
11311
|
-
const startNavLinkDrag =
|
|
10693
|
+
const startNavLinkDrag = useCallback5(
|
|
11312
10694
|
(anchor, clientX, clientY, wasSelected) => {
|
|
11313
10695
|
if (footerDragRef.current) return false;
|
|
11314
10696
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -11326,7 +10708,7 @@ function useNavItemDrag({
|
|
|
11326
10708
|
},
|
|
11327
10709
|
[beginNavDrag, footerDragRef, isDragHandleDisabled2, isCtaButton]
|
|
11328
10710
|
);
|
|
11329
|
-
const onNavDragOver =
|
|
10711
|
+
const onNavDragOver = useCallback5(
|
|
11330
10712
|
(e) => {
|
|
11331
10713
|
const session = navDragRef.current;
|
|
11332
10714
|
if (!session) return false;
|
|
@@ -11338,7 +10720,7 @@ function useNavItemDrag({
|
|
|
11338
10720
|
},
|
|
11339
10721
|
[]
|
|
11340
10722
|
);
|
|
11341
|
-
|
|
10723
|
+
useEffect9(() => {
|
|
11342
10724
|
if (!isEditMode) return;
|
|
11343
10725
|
const THRESHOLD = 10;
|
|
11344
10726
|
const resolveWasSelected = (el) => {
|
|
@@ -11463,7 +10845,7 @@ function useNavItemDrag({
|
|
|
11463
10845
|
setLinkPopover,
|
|
11464
10846
|
suppressNextClickRef
|
|
11465
10847
|
]);
|
|
11466
|
-
const armNavPressFromChrome =
|
|
10848
|
+
const armNavPressFromChrome = useCallback5(
|
|
11467
10849
|
(selected, clientX, clientY, pointerId) => {
|
|
11468
10850
|
const hrefKey = selected.getAttribute("data-ohw-href-key");
|
|
11469
10851
|
if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
|
|
@@ -11495,7 +10877,7 @@ function useNavItemDrag({
|
|
|
11495
10877
|
|
|
11496
10878
|
// src/ui/footer-container-chrome.tsx
|
|
11497
10879
|
import { Plus as Plus2 } from "lucide-react";
|
|
11498
|
-
import { jsx as
|
|
10880
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
11499
10881
|
function FooterContainerChrome({
|
|
11500
10882
|
rect,
|
|
11501
10883
|
onAdd,
|
|
@@ -11503,7 +10885,7 @@ function FooterContainerChrome({
|
|
|
11503
10885
|
}) {
|
|
11504
10886
|
const chromeGap = 6;
|
|
11505
10887
|
const buttonMargin = 7;
|
|
11506
|
-
return /* @__PURE__ */
|
|
10888
|
+
return /* @__PURE__ */ jsx26(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx26(
|
|
11507
10889
|
"div",
|
|
11508
10890
|
{
|
|
11509
10891
|
"data-ohw-footer-container-chrome": "",
|
|
@@ -11515,8 +10897,8 @@ function FooterContainerChrome({
|
|
|
11515
10897
|
width: rect.width + chromeGap * 2,
|
|
11516
10898
|
height: rect.height + chromeGap * 2
|
|
11517
10899
|
},
|
|
11518
|
-
children: /* @__PURE__ */
|
|
11519
|
-
/* @__PURE__ */
|
|
10900
|
+
children: /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
10901
|
+
/* @__PURE__ */ jsx26(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
11520
10902
|
"button",
|
|
11521
10903
|
{
|
|
11522
10904
|
type: "button",
|
|
@@ -11535,17 +10917,17 @@ function FooterContainerChrome({
|
|
|
11535
10917
|
if (addDisabled) return;
|
|
11536
10918
|
onAdd();
|
|
11537
10919
|
},
|
|
11538
|
-
children: /* @__PURE__ */
|
|
10920
|
+
children: /* @__PURE__ */ jsx26(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
11539
10921
|
}
|
|
11540
10922
|
) }),
|
|
11541
|
-
/* @__PURE__ */
|
|
10923
|
+
/* @__PURE__ */ jsx26(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
11542
10924
|
] })
|
|
11543
10925
|
}
|
|
11544
10926
|
) });
|
|
11545
10927
|
}
|
|
11546
10928
|
|
|
11547
10929
|
// src/lib/carousel.ts
|
|
11548
|
-
import { useEffect as
|
|
10930
|
+
import { useEffect as useEffect10, useState as useState9 } from "react";
|
|
11549
10931
|
var CAROUSEL_ATTR = "data-ohw-carousel";
|
|
11550
10932
|
var CAROUSEL_VALUE_ATTR = "data-ohw-carousel-value";
|
|
11551
10933
|
var CAROUSEL_SLIDE_ATTR = "data-ohw-carousel-slide";
|
|
@@ -11607,8 +10989,8 @@ function applyCarouselNode(key, val) {
|
|
|
11607
10989
|
return true;
|
|
11608
10990
|
}
|
|
11609
10991
|
function useOhwCarousel(key, initial) {
|
|
11610
|
-
const [images, setImages] =
|
|
11611
|
-
|
|
10992
|
+
const [images, setImages] = useState9(initial);
|
|
10993
|
+
useEffect10(() => {
|
|
11612
10994
|
const el = document.querySelector(
|
|
11613
10995
|
`[${CAROUSEL_ATTR}][data-ohw-key="${CSS.escape(key)}"]`
|
|
11614
10996
|
);
|
|
@@ -11721,18 +11103,6 @@ function collectEditableNodes(extraContent, root = document) {
|
|
|
11721
11103
|
}
|
|
11722
11104
|
if (extraContent && !isScoped) {
|
|
11723
11105
|
applyNavFooterDeleteOverrides(byKey, extraContent);
|
|
11724
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
11725
|
-
if (!(key in extraContent)) continue;
|
|
11726
|
-
byKey.set(key, { key, type: "image", text: extraContent[key] ?? "" });
|
|
11727
|
-
}
|
|
11728
|
-
for (const key of [LOGO_PLACEHOLDER_KEY, LOGO_ALT_KEY]) {
|
|
11729
|
-
if (!(key in extraContent)) continue;
|
|
11730
|
-
byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
|
|
11731
|
-
}
|
|
11732
|
-
for (const key of LOGO_SIZE_KEYS) {
|
|
11733
|
-
if (!(key in extraContent)) continue;
|
|
11734
|
-
byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
|
|
11735
|
-
}
|
|
11736
11106
|
}
|
|
11737
11107
|
return Array.from(byKey.values());
|
|
11738
11108
|
}
|
|
@@ -11982,13 +11352,13 @@ function deleteSelectedNavFooterItem(deps) {
|
|
|
11982
11352
|
|
|
11983
11353
|
// src/ui/navbar-container-chrome.tsx
|
|
11984
11354
|
import { Plus as Plus3 } from "lucide-react";
|
|
11985
|
-
import { jsx as
|
|
11355
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
11986
11356
|
function NavbarContainerChrome({
|
|
11987
11357
|
rect,
|
|
11988
11358
|
onAdd
|
|
11989
11359
|
}) {
|
|
11990
11360
|
const chromeGap = 6;
|
|
11991
|
-
return /* @__PURE__ */
|
|
11361
|
+
return /* @__PURE__ */ jsx27(
|
|
11992
11362
|
"div",
|
|
11993
11363
|
{
|
|
11994
11364
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -12000,7 +11370,7 @@ function NavbarContainerChrome({
|
|
|
12000
11370
|
width: rect.width + chromeGap * 2,
|
|
12001
11371
|
height: rect.height + chromeGap * 2
|
|
12002
11372
|
},
|
|
12003
|
-
children: /* @__PURE__ */
|
|
11373
|
+
children: /* @__PURE__ */ jsx27(
|
|
12004
11374
|
"button",
|
|
12005
11375
|
{
|
|
12006
11376
|
type: "button",
|
|
@@ -12017,7 +11387,7 @@ function NavbarContainerChrome({
|
|
|
12017
11387
|
e.stopPropagation();
|
|
12018
11388
|
onAdd();
|
|
12019
11389
|
},
|
|
12020
|
-
children: /* @__PURE__ */
|
|
11390
|
+
children: /* @__PURE__ */ jsx27(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
12021
11391
|
}
|
|
12022
11392
|
)
|
|
12023
11393
|
}
|
|
@@ -12026,7 +11396,7 @@ function NavbarContainerChrome({
|
|
|
12026
11396
|
|
|
12027
11397
|
// src/ui/drop-indicator.tsx
|
|
12028
11398
|
import * as React10 from "react";
|
|
12029
|
-
import { jsx as
|
|
11399
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
12030
11400
|
var dropIndicatorVariants = cva(
|
|
12031
11401
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
12032
11402
|
{
|
|
@@ -12050,7 +11420,7 @@ var dropIndicatorVariants = cva(
|
|
|
12050
11420
|
);
|
|
12051
11421
|
var DropIndicator = React10.forwardRef(
|
|
12052
11422
|
({ className, direction, state, ...props }, ref) => {
|
|
12053
|
-
return /* @__PURE__ */
|
|
11423
|
+
return /* @__PURE__ */ jsx28(
|
|
12054
11424
|
"div",
|
|
12055
11425
|
{
|
|
12056
11426
|
ref,
|
|
@@ -12067,7 +11437,7 @@ var DropIndicator = React10.forwardRef(
|
|
|
12067
11437
|
DropIndicator.displayName = "DropIndicator";
|
|
12068
11438
|
|
|
12069
11439
|
// src/ui/badge.tsx
|
|
12070
|
-
import { jsx as
|
|
11440
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
12071
11441
|
var badgeVariants = cva(
|
|
12072
11442
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
12073
11443
|
{
|
|
@@ -12085,12 +11455,12 @@ var badgeVariants = cva(
|
|
|
12085
11455
|
}
|
|
12086
11456
|
);
|
|
12087
11457
|
function Badge({ className, variant, ...props }) {
|
|
12088
|
-
return /* @__PURE__ */
|
|
11458
|
+
return /* @__PURE__ */ jsx29("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
12089
11459
|
}
|
|
12090
11460
|
|
|
12091
11461
|
// src/OhhwellsBridge.tsx
|
|
12092
|
-
import { Link as
|
|
12093
|
-
import { Fragment as Fragment8, jsx as
|
|
11462
|
+
import { Link as Link2 } from "lucide-react";
|
|
11463
|
+
import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
12094
11464
|
var PRIMARY3 = "#0885FE";
|
|
12095
11465
|
var IMAGE_FADE_MS = 300;
|
|
12096
11466
|
function runOpacityFade(el, onDone) {
|
|
@@ -12184,10 +11554,21 @@ function parseSchedulingInsertAfter(insertAfter) {
|
|
|
12184
11554
|
insertBefore: insertAfter.slice(idx + INSERT_BEFORE_MARKER.length)
|
|
12185
11555
|
};
|
|
12186
11556
|
}
|
|
12187
|
-
function
|
|
12188
|
-
|
|
12189
|
-
const
|
|
12190
|
-
|
|
11557
|
+
function resolveSchedulingInsert(insertAfter, explicitInsertBefore) {
|
|
11558
|
+
const parsed = parseSchedulingInsertAfter(insertAfter);
|
|
11559
|
+
const insertBefore = explicitInsertBefore ?? parsed.insertBefore;
|
|
11560
|
+
const effectiveInsertAfter = insertBefore && parsed.insertBefore === null ? `${insertAfter}${INSERT_BEFORE_MARKER}${insertBefore}` : insertAfter;
|
|
11561
|
+
return { effectiveInsertAfter, insertBefore };
|
|
11562
|
+
}
|
|
11563
|
+
function getSchedulingMountPoint(insertAfter) {
|
|
11564
|
+
const { anchor } = parseSchedulingInsertAfter(insertAfter);
|
|
11565
|
+
let anchorEl = document.querySelector(`[data-ohw-section="${anchor}"]`);
|
|
11566
|
+
if (!anchorEl && anchor === "scheduling") {
|
|
11567
|
+
const widgets = Array.from(document.querySelectorAll('[data-ohw-section^="scheduling-"]'));
|
|
11568
|
+
anchorEl = widgets.at(-1) ?? null;
|
|
11569
|
+
}
|
|
11570
|
+
if (!anchorEl) return null;
|
|
11571
|
+
return anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
|
|
12191
11572
|
}
|
|
12192
11573
|
function schedulingMountDepth(insertAfter) {
|
|
12193
11574
|
if (!insertAfter.includes(INSERT_BEFORE_MARKER)) return 0;
|
|
@@ -12204,7 +11585,8 @@ function getPageSchedulingEntries(raw) {
|
|
|
12204
11585
|
}
|
|
12205
11586
|
}
|
|
12206
11587
|
function isSchedulingWidgetMissing(entry) {
|
|
12207
|
-
|
|
11588
|
+
const { effectiveInsertAfter } = resolveSchedulingInsert(entry.insertAfter);
|
|
11589
|
+
return !document.querySelector(`[data-ohw-section="${schedulingSectionId(effectiveInsertAfter)}"]`);
|
|
12208
11590
|
}
|
|
12209
11591
|
function hasMissingSchedulingWidgets(entries) {
|
|
12210
11592
|
return entries.some(isSchedulingWidgetMissing);
|
|
@@ -12234,17 +11616,16 @@ function initSectionsFromContent(content, removeExisting = false) {
|
|
|
12234
11616
|
} catch {
|
|
12235
11617
|
}
|
|
12236
11618
|
}
|
|
12237
|
-
function mountSchedulingWidget(
|
|
12238
|
-
const
|
|
12239
|
-
const sectionId = schedulingSectionId(
|
|
11619
|
+
function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId, explicitInsertBefore) {
|
|
11620
|
+
const { effectiveInsertAfter, insertBefore } = resolveSchedulingInsert(insertAfter, explicitInsertBefore);
|
|
11621
|
+
const sectionId = schedulingSectionId(effectiveInsertAfter);
|
|
12240
11622
|
if (document.querySelector(`[data-ohw-section="${sectionId}"]`)) return false;
|
|
12241
|
-
const
|
|
12242
|
-
if (!
|
|
12243
|
-
const mountPoint = anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
|
|
11623
|
+
const mountPoint = getSchedulingMountPoint(effectiveInsertAfter);
|
|
11624
|
+
if (!mountPoint) return false;
|
|
12244
11625
|
const container = document.createElement("div");
|
|
12245
11626
|
container.dataset.ohwSectionContainer = "scheduling";
|
|
12246
|
-
if (
|
|
12247
|
-
const beforeAnchor = document.querySelector(`[data-ohw-section="${
|
|
11627
|
+
if (insertBefore) {
|
|
11628
|
+
const beforeAnchor = document.querySelector(`[data-ohw-section="${insertBefore}"]`);
|
|
12248
11629
|
const beforePoint = beforeAnchor?.closest('[data-ohw-section-container="scheduling"]') ?? beforeAnchor;
|
|
12249
11630
|
if (!beforePoint) return false;
|
|
12250
11631
|
beforePoint.insertAdjacentElement("beforebegin", container);
|
|
@@ -12255,25 +11636,19 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
|
|
|
12255
11636
|
}
|
|
12256
11637
|
tail.insertAdjacentElement("afterend", container);
|
|
12257
11638
|
}
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12271
|
-
});
|
|
12272
|
-
} catch (err) {
|
|
12273
|
-
console.error("[ow:scheduling] render threw", err);
|
|
12274
|
-
container.remove();
|
|
12275
|
-
return false;
|
|
12276
|
-
}
|
|
11639
|
+
const root = createRoot2(container);
|
|
11640
|
+
flushSync2(() => {
|
|
11641
|
+
root.render(
|
|
11642
|
+
/* @__PURE__ */ jsx30(
|
|
11643
|
+
SchedulingWidget,
|
|
11644
|
+
{
|
|
11645
|
+
notifyOnConnect,
|
|
11646
|
+
initialScheduleId: scheduleId,
|
|
11647
|
+
insertAfter: effectiveInsertAfter
|
|
11648
|
+
}
|
|
11649
|
+
)
|
|
11650
|
+
);
|
|
11651
|
+
});
|
|
12277
11652
|
const tracker = getSectionsTracker();
|
|
12278
11653
|
let sections = [];
|
|
12279
11654
|
try {
|
|
@@ -12281,12 +11656,10 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
|
|
|
12281
11656
|
} catch {
|
|
12282
11657
|
}
|
|
12283
11658
|
const inEditor = typeof window !== "undefined" && window.self !== window.top;
|
|
12284
|
-
if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter ===
|
|
11659
|
+
if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === effectiveInsertAfter)) {
|
|
12285
11660
|
sections.push({
|
|
12286
11661
|
type: "scheduling",
|
|
12287
|
-
insertAfter:
|
|
12288
|
-
anchorId,
|
|
12289
|
-
beforeId: beforeId ?? null,
|
|
11662
|
+
insertAfter: effectiveInsertAfter,
|
|
12290
11663
|
pagePath: window.location.pathname,
|
|
12291
11664
|
...scheduleId ? { scheduleId } : {}
|
|
12292
11665
|
});
|
|
@@ -12300,8 +11673,7 @@ function mountSchedulingEntries(entries, notifyOnConnect = false) {
|
|
|
12300
11673
|
for (let i = pending.length - 1; i >= 0; i--) {
|
|
12301
11674
|
const entry = pending[i];
|
|
12302
11675
|
const shouldNotify = typeof notifyOnConnect === "function" ? notifyOnConnect(entry) : notifyOnConnect;
|
|
12303
|
-
|
|
12304
|
-
if (mountSchedulingWidget(anchorId, shouldNotify, entry.scheduleId ?? null, beforeId, entry.insertAfter)) {
|
|
11676
|
+
if (mountSchedulingWidget(entry.insertAfter, shouldNotify, entry.scheduleId)) {
|
|
12305
11677
|
pending.splice(i, 1);
|
|
12306
11678
|
}
|
|
12307
11679
|
}
|
|
@@ -12315,17 +11687,6 @@ function applyLinkHref(el, val) {
|
|
|
12315
11687
|
const anchor = el instanceof HTMLAnchorElement ? el : el.querySelector("a");
|
|
12316
11688
|
if (anchor) anchor.setAttribute("href", val);
|
|
12317
11689
|
}
|
|
12318
|
-
function currentIconRef(el) {
|
|
12319
|
-
const uploaded = el instanceof HTMLImageElement ? el : el.querySelector("img");
|
|
12320
|
-
if (uploaded?.getAttribute("src")) {
|
|
12321
|
-
return uploaded.getAttribute("src") ?? "";
|
|
12322
|
-
}
|
|
12323
|
-
const svg = el instanceof SVGElement ? el : el.querySelector("svg");
|
|
12324
|
-
const named = Array.from(svg?.classList ?? []).find(
|
|
12325
|
-
(c) => c.startsWith("lucide-") && c !== "lucide-icon"
|
|
12326
|
-
);
|
|
12327
|
-
return named ? `lucide:${named.slice("lucide-".length)}` : "";
|
|
12328
|
-
}
|
|
12329
11690
|
function getEditMeasureEl(editable) {
|
|
12330
11691
|
return editable.closest("[data-ohw-href-key]") ?? editable;
|
|
12331
11692
|
}
|
|
@@ -12370,11 +11731,8 @@ function isMediaEditable(el) {
|
|
|
12370
11731
|
const t = el.dataset.ohwEditable;
|
|
12371
11732
|
return t === "image" || t === "bg-image" || t === "video";
|
|
12372
11733
|
}
|
|
12373
|
-
function isIconEditable(el) {
|
|
12374
|
-
return el.dataset.ohwEditable === "icon";
|
|
12375
|
-
}
|
|
12376
11734
|
var MEDIA_SELECTOR = '[data-ohw-editable="image"], [data-ohw-editable="bg-image"], [data-ohw-editable="video"]';
|
|
12377
|
-
var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"])
|
|
11735
|
+
var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"])';
|
|
12378
11736
|
function getVideoEl2(el) {
|
|
12379
11737
|
return el instanceof HTMLVideoElement ? el : el.querySelector("video");
|
|
12380
11738
|
}
|
|
@@ -12445,13 +11803,6 @@ function isInsideLinkEditor(target) {
|
|
|
12445
11803
|
target.closest("[data-ohw-link-popover-root]") || target.closest("[data-ohw-link-modal-root]") || target.closest("[data-ohw-link-page-dropdown]") || target.closest("[data-ohw-section-picker]") || target.closest("[data-ohw-navbar-container-chrome]") || target.closest("[data-ohw-navbar-add-button]") || target.closest("[data-ohw-footer-container-chrome]") || target.closest("[data-ohw-footer-add-button]") || target.closest("[data-ohw-more-menu]") || target.closest('[data-slot="dropdown-menu-content"]') || target.closest('[data-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
|
|
12446
11804
|
);
|
|
12447
11805
|
}
|
|
12448
|
-
function isInsideFloatingPanel(target) {
|
|
12449
|
-
return Boolean(target.closest("[data-ohw-floating-panel]"));
|
|
12450
|
-
}
|
|
12451
|
-
function isPointOverFloatingPanel(clientX, clientY) {
|
|
12452
|
-
const el = document.elementFromPoint(clientX, clientY);
|
|
12453
|
-
return Boolean(el instanceof Element && el.closest("[data-ohw-floating-panel]"));
|
|
12454
|
-
}
|
|
12455
11806
|
function getHrefKeyFromElement(el) {
|
|
12456
11807
|
if (!el) return null;
|
|
12457
11808
|
const anchor = el.closest("[data-ohw-href-key]");
|
|
@@ -12665,7 +12016,7 @@ function getNavigationSelectionParent(el) {
|
|
|
12665
12016
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
12666
12017
|
return getFooterLinksContainer();
|
|
12667
12018
|
}
|
|
12668
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
12019
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
12669
12020
|
return getNavigationRoot(el);
|
|
12670
12021
|
}
|
|
12671
12022
|
return null;
|
|
@@ -12904,7 +12255,7 @@ function EditGlowChrome({
|
|
|
12904
12255
|
hideHandle = false
|
|
12905
12256
|
}) {
|
|
12906
12257
|
const GAP = SELECTION_CHROME_GAP2;
|
|
12907
|
-
return /* @__PURE__ */
|
|
12258
|
+
return /* @__PURE__ */ jsxs17(
|
|
12908
12259
|
"div",
|
|
12909
12260
|
{
|
|
12910
12261
|
ref: elRef,
|
|
@@ -12919,7 +12270,7 @@ function EditGlowChrome({
|
|
|
12919
12270
|
zIndex: 2147483646
|
|
12920
12271
|
},
|
|
12921
12272
|
children: [
|
|
12922
|
-
/* @__PURE__ */
|
|
12273
|
+
/* @__PURE__ */ jsx30(
|
|
12923
12274
|
"div",
|
|
12924
12275
|
{
|
|
12925
12276
|
style: {
|
|
@@ -12932,7 +12283,7 @@ function EditGlowChrome({
|
|
|
12932
12283
|
}
|
|
12933
12284
|
}
|
|
12934
12285
|
),
|
|
12935
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */
|
|
12286
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ jsx30(
|
|
12936
12287
|
"div",
|
|
12937
12288
|
{
|
|
12938
12289
|
"data-ohw-drag-handle-container": "",
|
|
@@ -12944,7 +12295,7 @@ function EditGlowChrome({
|
|
|
12944
12295
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
12945
12296
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
12946
12297
|
},
|
|
12947
|
-
children: /* @__PURE__ */
|
|
12298
|
+
children: /* @__PURE__ */ jsx30(
|
|
12948
12299
|
DragHandle,
|
|
12949
12300
|
{
|
|
12950
12301
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -13154,7 +12505,7 @@ function FloatingToolbar({
|
|
|
13154
12505
|
return () => ro.disconnect();
|
|
13155
12506
|
}, [showEditLink, activeCommands]);
|
|
13156
12507
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
13157
|
-
return /* @__PURE__ */
|
|
12508
|
+
return /* @__PURE__ */ jsx30(
|
|
13158
12509
|
"div",
|
|
13159
12510
|
{
|
|
13160
12511
|
ref: setRefs,
|
|
@@ -13166,12 +12517,12 @@ function FloatingToolbar({
|
|
|
13166
12517
|
zIndex: 2147483647,
|
|
13167
12518
|
pointerEvents: "auto"
|
|
13168
12519
|
},
|
|
13169
|
-
children: /* @__PURE__ */
|
|
13170
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */
|
|
13171
|
-
gi > 0 && /* @__PURE__ */
|
|
12520
|
+
children: /* @__PURE__ */ jsxs17(CustomToolbar, { children: [
|
|
12521
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ jsxs17(React11.Fragment, { children: [
|
|
12522
|
+
gi > 0 && /* @__PURE__ */ jsx30(CustomToolbarDivider, {}),
|
|
13172
12523
|
btns.map((btn) => {
|
|
13173
12524
|
const isActive = activeCommands.has(btn.cmd);
|
|
13174
|
-
return /* @__PURE__ */
|
|
12525
|
+
return /* @__PURE__ */ jsx30(
|
|
13175
12526
|
CustomToolbarButton,
|
|
13176
12527
|
{
|
|
13177
12528
|
title: btn.title,
|
|
@@ -13180,7 +12531,7 @@ function FloatingToolbar({
|
|
|
13180
12531
|
e.preventDefault();
|
|
13181
12532
|
onCommand(btn.cmd);
|
|
13182
12533
|
},
|
|
13183
|
-
children: /* @__PURE__ */
|
|
12534
|
+
children: /* @__PURE__ */ jsx30(
|
|
13184
12535
|
"svg",
|
|
13185
12536
|
{
|
|
13186
12537
|
width: "16",
|
|
@@ -13201,7 +12552,7 @@ function FloatingToolbar({
|
|
|
13201
12552
|
);
|
|
13202
12553
|
})
|
|
13203
12554
|
] }, gi)),
|
|
13204
|
-
showEditLink ? /* @__PURE__ */
|
|
12555
|
+
showEditLink ? /* @__PURE__ */ jsx30(
|
|
13205
12556
|
CustomToolbarButton,
|
|
13206
12557
|
{
|
|
13207
12558
|
type: "button",
|
|
@@ -13215,7 +12566,7 @@ function FloatingToolbar({
|
|
|
13215
12566
|
e.preventDefault();
|
|
13216
12567
|
e.stopPropagation();
|
|
13217
12568
|
},
|
|
13218
|
-
children: /* @__PURE__ */
|
|
12569
|
+
children: /* @__PURE__ */ jsx30(Link2, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
13219
12570
|
}
|
|
13220
12571
|
) : null
|
|
13221
12572
|
] })
|
|
@@ -13232,7 +12583,7 @@ function StateToggle({
|
|
|
13232
12583
|
states,
|
|
13233
12584
|
onStateChange
|
|
13234
12585
|
}) {
|
|
13235
|
-
return /* @__PURE__ */
|
|
12586
|
+
return /* @__PURE__ */ jsx30(
|
|
13236
12587
|
ToggleGroup,
|
|
13237
12588
|
{
|
|
13238
12589
|
"data-ohw-state-toggle": "",
|
|
@@ -13246,12 +12597,11 @@ function StateToggle({
|
|
|
13246
12597
|
left: rect.right - 8,
|
|
13247
12598
|
transform: "translateX(-100%)"
|
|
13248
12599
|
},
|
|
13249
|
-
children: states.map((state) => /* @__PURE__ */
|
|
12600
|
+
children: states.map((state) => /* @__PURE__ */ jsx30(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
13250
12601
|
}
|
|
13251
12602
|
);
|
|
13252
12603
|
}
|
|
13253
12604
|
var contentCache = /* @__PURE__ */ new Map();
|
|
13254
|
-
var fetchedContentPaths = /* @__PURE__ */ new Set();
|
|
13255
12605
|
function resolveSubdomain(subdomainFromQuery) {
|
|
13256
12606
|
if (subdomainFromQuery) return subdomainFromQuery;
|
|
13257
12607
|
if (typeof window !== "undefined") {
|
|
@@ -13274,8 +12624,8 @@ function OhhwellsBridge() {
|
|
|
13274
12624
|
const router = useRouter3();
|
|
13275
12625
|
const searchParams = useSearchParams();
|
|
13276
12626
|
const isEditMode = isEditSessionActive();
|
|
13277
|
-
const [bridgeRoot, setBridgeRoot] =
|
|
13278
|
-
|
|
12627
|
+
const [bridgeRoot, setBridgeRoot] = useState10(null);
|
|
12628
|
+
useEffect11(() => {
|
|
13279
12629
|
const figtreeFontId = "ohw-figtree-font";
|
|
13280
12630
|
if (!document.getElementById(figtreeFontId)) {
|
|
13281
12631
|
const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
|
|
@@ -13304,134 +12654,110 @@ function OhhwellsBridge() {
|
|
|
13304
12654
|
const subdomain = resolveSubdomain(subdomainFromQuery);
|
|
13305
12655
|
useLinkHrefGuardian(pathname, subdomain, isEditMode);
|
|
13306
12656
|
useSavedLinkNavigation(isEditMode);
|
|
13307
|
-
const postToParent2 =
|
|
12657
|
+
const postToParent2 = useCallback6((data) => {
|
|
13308
12658
|
if (typeof window !== "undefined" && window.parent !== window) {
|
|
13309
12659
|
window.parent.postMessage(data, "*");
|
|
13310
12660
|
}
|
|
13311
12661
|
}, []);
|
|
13312
|
-
const [fetchState, setFetchState] =
|
|
13313
|
-
const autoSaveTimers =
|
|
13314
|
-
const activeElRef =
|
|
13315
|
-
const pointerHeldRef =
|
|
13316
|
-
const selectedElRef =
|
|
13317
|
-
const selectedHrefKeyRef =
|
|
13318
|
-
const selectedFooterColAttrRef =
|
|
13319
|
-
const originalContentRef =
|
|
13320
|
-
const activeStateElRef =
|
|
13321
|
-
const parentScrollRef =
|
|
13322
|
-
const visibleViewportRef =
|
|
13323
|
-
const [dialogPortalContainer, setDialogPortalContainer] =
|
|
13324
|
-
const attachVisibleViewport =
|
|
12662
|
+
const [fetchState, setFetchState] = useState10("idle");
|
|
12663
|
+
const autoSaveTimers = useRef8(/* @__PURE__ */ new Map());
|
|
12664
|
+
const activeElRef = useRef8(null);
|
|
12665
|
+
const pointerHeldRef = useRef8(false);
|
|
12666
|
+
const selectedElRef = useRef8(null);
|
|
12667
|
+
const selectedHrefKeyRef = useRef8(null);
|
|
12668
|
+
const selectedFooterColAttrRef = useRef8(null);
|
|
12669
|
+
const originalContentRef = useRef8(null);
|
|
12670
|
+
const activeStateElRef = useRef8(null);
|
|
12671
|
+
const parentScrollRef = useRef8(null);
|
|
12672
|
+
const visibleViewportRef = useRef8(null);
|
|
12673
|
+
const [dialogPortalContainer, setDialogPortalContainer] = useState10(null);
|
|
12674
|
+
const attachVisibleViewport = useCallback6((node) => {
|
|
13325
12675
|
visibleViewportRef.current = node;
|
|
13326
12676
|
setDialogPortalContainer(node);
|
|
13327
12677
|
if (node) applyVisibleViewport(node, parentScrollRef.current);
|
|
13328
12678
|
}, []);
|
|
13329
|
-
const toolbarElRef =
|
|
13330
|
-
const glowElRef =
|
|
13331
|
-
const hoveredImageRef =
|
|
13332
|
-
const hoveredImageHasTextOverlapRef =
|
|
13333
|
-
const dragOverElRef =
|
|
13334
|
-
const [mediaHover, setMediaHover] =
|
|
13335
|
-
const [carouselHover, setCarouselHover] =
|
|
13336
|
-
const [uploadingRects, setUploadingRects] =
|
|
13337
|
-
const hoveredGapRef =
|
|
13338
|
-
const imageUnhoverTimerRef =
|
|
13339
|
-
const imageShowTimerRef =
|
|
13340
|
-
const editStylesRef =
|
|
13341
|
-
const activateRef =
|
|
13342
|
-
});
|
|
13343
|
-
const deactivateRef = useRef9(() => {
|
|
12679
|
+
const toolbarElRef = useRef8(null);
|
|
12680
|
+
const glowElRef = useRef8(null);
|
|
12681
|
+
const hoveredImageRef = useRef8(null);
|
|
12682
|
+
const hoveredImageHasTextOverlapRef = useRef8(false);
|
|
12683
|
+
const dragOverElRef = useRef8(null);
|
|
12684
|
+
const [mediaHover, setMediaHover] = useState10(null);
|
|
12685
|
+
const [carouselHover, setCarouselHover] = useState10(null);
|
|
12686
|
+
const [uploadingRects, setUploadingRects] = useState10({});
|
|
12687
|
+
const hoveredGapRef = useRef8(null);
|
|
12688
|
+
const imageUnhoverTimerRef = useRef8(null);
|
|
12689
|
+
const imageShowTimerRef = useRef8(null);
|
|
12690
|
+
const editStylesRef = useRef8(null);
|
|
12691
|
+
const activateRef = useRef8(() => {
|
|
13344
12692
|
});
|
|
13345
|
-
const
|
|
12693
|
+
const deactivateRef = useRef8(() => {
|
|
13346
12694
|
});
|
|
13347
|
-
const
|
|
12695
|
+
const selectRef = useRef8(() => {
|
|
13348
12696
|
});
|
|
13349
|
-
const
|
|
12697
|
+
const selectFrameRef = useRef8(() => {
|
|
13350
12698
|
});
|
|
13351
|
-
const
|
|
12699
|
+
const deselectRef = useRef8(() => {
|
|
13352
12700
|
});
|
|
13353
|
-
const
|
|
12701
|
+
const reselectNavigationItemRef = useRef8(() => {
|
|
13354
12702
|
});
|
|
13355
|
-
const
|
|
12703
|
+
const commitNavigationTextEditRef = useRef8(() => {
|
|
13356
12704
|
});
|
|
13357
|
-
const
|
|
12705
|
+
const handleDeleteSelectedRef = useRef8(() => false);
|
|
12706
|
+
const runPendingDeleteUndoRef = useRef8(() => false);
|
|
12707
|
+
const isFooterFrameSelectionRef = useRef8(false);
|
|
12708
|
+
const refreshActiveCommandsRef = useRef8(() => {
|
|
13358
12709
|
});
|
|
13359
|
-
const
|
|
13360
|
-
});
|
|
13361
|
-
const handleDeleteSelectedRef = useRef9(() => false);
|
|
13362
|
-
const runPendingDeleteUndoRef = useRef9(() => false);
|
|
13363
|
-
const isFooterFrameSelectionRef = useRef9(false);
|
|
13364
|
-
const refreshActiveCommandsRef = useRef9(() => {
|
|
13365
|
-
});
|
|
13366
|
-
const postToParentRef = useRef9(postToParent2);
|
|
12710
|
+
const postToParentRef = useRef8(postToParent2);
|
|
13367
12711
|
postToParentRef.current = postToParent2;
|
|
13368
|
-
const aiSectionApiRef =
|
|
13369
|
-
const sectionsLoadedRef =
|
|
13370
|
-
const pendingScheduleConfigRequests =
|
|
13371
|
-
const [toolbarRect, setToolbarRect] =
|
|
13372
|
-
const [toolbarVariant, setToolbarVariant] =
|
|
13373
|
-
const toolbarVariantRef =
|
|
12712
|
+
const aiSectionApiRef = useRef8(null);
|
|
12713
|
+
const sectionsLoadedRef = useRef8(false);
|
|
12714
|
+
const pendingScheduleConfigRequests = useRef8([]);
|
|
12715
|
+
const [toolbarRect, setToolbarRect] = useState10(null);
|
|
12716
|
+
const [toolbarVariant, setToolbarVariant] = useState10("none");
|
|
12717
|
+
const toolbarVariantRef = useRef8("none");
|
|
13374
12718
|
toolbarVariantRef.current = toolbarVariant;
|
|
13375
|
-
const [selectedIsCta, setSelectedIsCta] =
|
|
13376
|
-
const [reorderHrefKey, setReorderHrefKey] =
|
|
13377
|
-
const [reorderDragDisabled, setReorderDragDisabled] =
|
|
13378
|
-
const [toggleState, setToggleState] =
|
|
13379
|
-
const [maxBadge, setMaxBadge] =
|
|
13380
|
-
const [activeCommands, setActiveCommands] =
|
|
13381
|
-
const [sectionGap, setSectionGap] =
|
|
13382
|
-
const [toolbarShowEditLink, setToolbarShowEditLink] =
|
|
13383
|
-
const hoveredNavContainerRef =
|
|
13384
|
-
const [hoveredNavContainerRect, setHoveredNavContainerRect] =
|
|
13385
|
-
const hoveredItemElRef =
|
|
13386
|
-
const [hoveredItemRect, setHoveredItemRect] =
|
|
13387
|
-
const siblingHintElRef =
|
|
13388
|
-
const [siblingHintRect, setSiblingHintRect] =
|
|
13389
|
-
const [siblingHintRects, setSiblingHintRects] =
|
|
13390
|
-
const [isItemDragging, setIsItemDragging] =
|
|
13391
|
-
const [isFooterFrameSelection, setIsFooterFrameSelection] =
|
|
12719
|
+
const [selectedIsCta, setSelectedIsCta] = useState10(false);
|
|
12720
|
+
const [reorderHrefKey, setReorderHrefKey] = useState10(null);
|
|
12721
|
+
const [reorderDragDisabled, setReorderDragDisabled] = useState10(false);
|
|
12722
|
+
const [toggleState, setToggleState] = useState10(null);
|
|
12723
|
+
const [maxBadge, setMaxBadge] = useState10(null);
|
|
12724
|
+
const [activeCommands, setActiveCommands] = useState10(/* @__PURE__ */ new Set());
|
|
12725
|
+
const [sectionGap, setSectionGap] = useState10(null);
|
|
12726
|
+
const [toolbarShowEditLink, setToolbarShowEditLink] = useState10(false);
|
|
12727
|
+
const hoveredNavContainerRef = useRef8(null);
|
|
12728
|
+
const [hoveredNavContainerRect, setHoveredNavContainerRect] = useState10(null);
|
|
12729
|
+
const hoveredItemElRef = useRef8(null);
|
|
12730
|
+
const [hoveredItemRect, setHoveredItemRect] = useState10(null);
|
|
12731
|
+
const siblingHintElRef = useRef8(null);
|
|
12732
|
+
const [siblingHintRect, setSiblingHintRect] = useState10(null);
|
|
12733
|
+
const [siblingHintRects, setSiblingHintRects] = useState10([]);
|
|
12734
|
+
const [isItemDragging, setIsItemDragging] = useState10(false);
|
|
12735
|
+
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState10(false);
|
|
13392
12736
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
13393
|
-
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] =
|
|
13394
|
-
const [footerHeadingVisible, setFooterHeadingVisible] =
|
|
13395
|
-
const footerDragRef =
|
|
13396
|
-
const [footerDropSlots, setFooterDropSlots] =
|
|
13397
|
-
const [activeFooterDropIndex, setActiveFooterDropIndex] =
|
|
13398
|
-
const [draggedItemRect, setDraggedItemRect] =
|
|
13399
|
-
const footerPointerDragRef =
|
|
13400
|
-
const suppressNextClickRef =
|
|
13401
|
-
const suppressClickUntilRef =
|
|
13402
|
-
const [linkPopover, setLinkPopover] =
|
|
13403
|
-
const linkPopoverSessionRef =
|
|
13404
|
-
const addNavAfterAnchorRef =
|
|
13405
|
-
const editContentRef =
|
|
13406
|
-
const aiSectionsRef =
|
|
13407
|
-
const pendingDeleteUndoRef =
|
|
13408
|
-
const [
|
|
13409
|
-
const
|
|
13410
|
-
const
|
|
13411
|
-
const
|
|
13412
|
-
const
|
|
13413
|
-
const
|
|
13414
|
-
const
|
|
13415
|
-
const [sitePages, setSitePages] = useState11([]);
|
|
13416
|
-
const [sectionsByPath, setSectionsByPath] = useState11({});
|
|
13417
|
-
const sectionsPrefetchGenRef = useRef9(0);
|
|
13418
|
-
const setLinkPopoverRef = useRef9(setLinkPopover);
|
|
13419
|
-
const linkPopoverPanelRef = useRef9(null);
|
|
13420
|
-
const linkPopoverOpenRef = useRef9(false);
|
|
13421
|
-
const linkPopoverGraceUntilRef = useRef9(0);
|
|
12737
|
+
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState10(null);
|
|
12738
|
+
const [footerHeadingVisible, setFooterHeadingVisible] = useState10(null);
|
|
12739
|
+
const footerDragRef = useRef8(null);
|
|
12740
|
+
const [footerDropSlots, setFooterDropSlots] = useState10([]);
|
|
12741
|
+
const [activeFooterDropIndex, setActiveFooterDropIndex] = useState10(null);
|
|
12742
|
+
const [draggedItemRect, setDraggedItemRect] = useState10(null);
|
|
12743
|
+
const footerPointerDragRef = useRef8(null);
|
|
12744
|
+
const suppressNextClickRef = useRef8(false);
|
|
12745
|
+
const suppressClickUntilRef = useRef8(0);
|
|
12746
|
+
const [linkPopover, setLinkPopover] = useState10(null);
|
|
12747
|
+
const linkPopoverSessionRef = useRef8(null);
|
|
12748
|
+
const addNavAfterAnchorRef = useRef8(null);
|
|
12749
|
+
const editContentRef = useRef8({});
|
|
12750
|
+
const aiSectionsRef = useRef8("");
|
|
12751
|
+
const pendingDeleteUndoRef = useRef8(null);
|
|
12752
|
+
const [sitePages, setSitePages] = useState10([]);
|
|
12753
|
+
const [sectionsByPath, setSectionsByPath] = useState10({});
|
|
12754
|
+
const sectionsPrefetchGenRef = useRef8(0);
|
|
12755
|
+
const setLinkPopoverRef = useRef8(setLinkPopover);
|
|
12756
|
+
const linkPopoverPanelRef = useRef8(null);
|
|
12757
|
+
const linkPopoverOpenRef = useRef8(false);
|
|
12758
|
+
const linkPopoverGraceUntilRef = useRef8(0);
|
|
13422
12759
|
setLinkPopoverRef.current = setLinkPopover;
|
|
13423
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
13424
12760
|
linkPopoverSessionRef.current = linkPopover;
|
|
13425
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
13426
|
-
useEffect12(() => {
|
|
13427
|
-
const syncViewport = () => {
|
|
13428
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
13429
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
13430
|
-
};
|
|
13431
|
-
syncViewport();
|
|
13432
|
-
window.addEventListener("resize", syncViewport);
|
|
13433
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
13434
|
-
}, []);
|
|
13435
12761
|
const {
|
|
13436
12762
|
navDragRef,
|
|
13437
12763
|
navDropSlots,
|
|
@@ -13467,7 +12793,7 @@ function OhhwellsBridge() {
|
|
|
13467
12793
|
const bumpLinkPopoverGrace = () => {
|
|
13468
12794
|
linkPopoverGraceUntilRef.current = Date.now() + 350;
|
|
13469
12795
|
};
|
|
13470
|
-
const runSectionsPrefetch =
|
|
12796
|
+
const runSectionsPrefetch = useCallback6((pages) => {
|
|
13471
12797
|
if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
|
|
13472
12798
|
const gen = ++sectionsPrefetchGenRef.current;
|
|
13473
12799
|
const paths = pages.map((p) => p.path);
|
|
@@ -13486,9 +12812,9 @@ function OhhwellsBridge() {
|
|
|
13486
12812
|
);
|
|
13487
12813
|
});
|
|
13488
12814
|
}, [isEditMode, pathname]);
|
|
13489
|
-
const runSectionsPrefetchRef =
|
|
12815
|
+
const runSectionsPrefetchRef = useRef8(runSectionsPrefetch);
|
|
13490
12816
|
runSectionsPrefetchRef.current = runSectionsPrefetch;
|
|
13491
|
-
|
|
12817
|
+
useEffect11(() => {
|
|
13492
12818
|
if (!linkPopover) {
|
|
13493
12819
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
13494
12820
|
return;
|
|
@@ -13516,7 +12842,7 @@ function OhhwellsBridge() {
|
|
|
13516
12842
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
13517
12843
|
};
|
|
13518
12844
|
}, [linkPopover, postToParent2]);
|
|
13519
|
-
|
|
12845
|
+
useEffect11(() => {
|
|
13520
12846
|
if (!isEditMode) return;
|
|
13521
12847
|
const useFixtures = shouldUseDevFixtures();
|
|
13522
12848
|
if (useFixtures) {
|
|
@@ -13540,14 +12866,14 @@ function OhhwellsBridge() {
|
|
|
13540
12866
|
if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
|
|
13541
12867
|
return () => window.removeEventListener("message", onSitePages);
|
|
13542
12868
|
}, [isEditMode, postToParent2]);
|
|
13543
|
-
|
|
12869
|
+
useEffect11(() => {
|
|
13544
12870
|
if (!isEditMode || shouldUseDevFixtures()) return;
|
|
13545
12871
|
void loadAllSectionsManifest().then((manifest) => {
|
|
13546
12872
|
if (Object.keys(manifest).length === 0) return;
|
|
13547
12873
|
setSectionsByPath((prev) => ({ ...manifest, ...prev }));
|
|
13548
12874
|
});
|
|
13549
12875
|
}, [isEditMode]);
|
|
13550
|
-
|
|
12876
|
+
useEffect11(() => {
|
|
13551
12877
|
const update = () => {
|
|
13552
12878
|
const el = activeElRef.current ?? selectedElRef.current;
|
|
13553
12879
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
@@ -13571,10 +12897,10 @@ function OhhwellsBridge() {
|
|
|
13571
12897
|
vvp.removeEventListener("resize", update);
|
|
13572
12898
|
};
|
|
13573
12899
|
}, []);
|
|
13574
|
-
const refreshStateRules =
|
|
12900
|
+
const refreshStateRules = useCallback6(() => {
|
|
13575
12901
|
editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
|
|
13576
12902
|
}, []);
|
|
13577
|
-
const processConfigRequest =
|
|
12903
|
+
const processConfigRequest = useCallback6((insertAfterVal) => {
|
|
13578
12904
|
const tracker = getSectionsTracker();
|
|
13579
12905
|
let entries = [];
|
|
13580
12906
|
try {
|
|
@@ -13597,7 +12923,7 @@ function OhhwellsBridge() {
|
|
|
13597
12923
|
}
|
|
13598
12924
|
window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
|
|
13599
12925
|
}, [isEditMode]);
|
|
13600
|
-
const deactivate =
|
|
12926
|
+
const deactivate = useCallback6(() => {
|
|
13601
12927
|
const el = activeElRef.current;
|
|
13602
12928
|
if (!el) return;
|
|
13603
12929
|
const key = el.dataset.ohwKey;
|
|
@@ -13630,12 +12956,12 @@ function OhhwellsBridge() {
|
|
|
13630
12956
|
setToolbarShowEditLink(false);
|
|
13631
12957
|
postToParent2({ type: "ow:exit-edit" });
|
|
13632
12958
|
}, [postToParent2]);
|
|
13633
|
-
const clearSelectedAttr =
|
|
12959
|
+
const clearSelectedAttr = useCallback6(() => {
|
|
13634
12960
|
document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
|
|
13635
12961
|
el.removeAttribute("data-ohw-selected");
|
|
13636
12962
|
});
|
|
13637
12963
|
}, []);
|
|
13638
|
-
const deselect =
|
|
12964
|
+
const deselect = useCallback6(() => {
|
|
13639
12965
|
clearSelectedAttr();
|
|
13640
12966
|
selectedElRef.current = null;
|
|
13641
12967
|
selectedHrefKeyRef.current = null;
|
|
@@ -13652,21 +12978,17 @@ function OhhwellsBridge() {
|
|
|
13652
12978
|
setIsItemDragging(false);
|
|
13653
12979
|
hoveredNavContainerRef.current = null;
|
|
13654
12980
|
setHoveredNavContainerRect(null);
|
|
13655
|
-
hoveredItemElRef.current = null;
|
|
13656
|
-
setHoveredItemRect(null);
|
|
13657
|
-
setFloatingPanel(null);
|
|
13658
|
-
setLogoSizeDraft(null);
|
|
13659
12981
|
if (!activeElRef.current) {
|
|
13660
12982
|
setNavGroupForceOpen(null, false);
|
|
13661
12983
|
setToolbarRect(null);
|
|
13662
12984
|
setToolbarVariant("none");
|
|
13663
12985
|
}
|
|
13664
12986
|
}, [clearSelectedAttr]);
|
|
13665
|
-
const markSelected =
|
|
12987
|
+
const markSelected = useCallback6((el) => {
|
|
13666
12988
|
clearSelectedAttr();
|
|
13667
12989
|
el.setAttribute("data-ohw-selected", "");
|
|
13668
12990
|
}, [clearSelectedAttr]);
|
|
13669
|
-
const resolveHrefKeyElement =
|
|
12991
|
+
const resolveHrefKeyElement = useCallback6((hrefKey) => {
|
|
13670
12992
|
if (isFooterHrefKey(hrefKey)) {
|
|
13671
12993
|
return document.querySelector(
|
|
13672
12994
|
`footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
@@ -13681,7 +13003,7 @@ function OhhwellsBridge() {
|
|
|
13681
13003
|
`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
13682
13004
|
);
|
|
13683
13005
|
}, []);
|
|
13684
|
-
const resyncSelectedNavigationItem =
|
|
13006
|
+
const resyncSelectedNavigationItem = useCallback6(() => {
|
|
13685
13007
|
const hrefKey = selectedHrefKeyRef.current;
|
|
13686
13008
|
if (hrefKey) {
|
|
13687
13009
|
const link = resolveHrefKeyElement(hrefKey);
|
|
@@ -13719,7 +13041,7 @@ function OhhwellsBridge() {
|
|
|
13719
13041
|
);
|
|
13720
13042
|
}
|
|
13721
13043
|
}, [resolveHrefKeyElement]);
|
|
13722
|
-
const reselectNavigationItem =
|
|
13044
|
+
const reselectNavigationItem = useCallback6((navAnchor) => {
|
|
13723
13045
|
selectedElRef.current = navAnchor;
|
|
13724
13046
|
selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
|
|
13725
13047
|
selectedFooterColAttrRef.current = null;
|
|
@@ -13748,7 +13070,7 @@ function OhhwellsBridge() {
|
|
|
13748
13070
|
setToolbarShowEditLink(false);
|
|
13749
13071
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
13750
13072
|
}, [markSelected]);
|
|
13751
|
-
const commitNavigationTextEdit =
|
|
13073
|
+
const commitNavigationTextEdit = useCallback6((navAnchor) => {
|
|
13752
13074
|
const el = activeElRef.current;
|
|
13753
13075
|
if (!el) return;
|
|
13754
13076
|
const key = el.dataset.ohwKey;
|
|
@@ -13775,7 +13097,7 @@ function OhhwellsBridge() {
|
|
|
13775
13097
|
postToParent2({ type: "ow:exit-edit" });
|
|
13776
13098
|
reselectNavigationItem(navAnchor);
|
|
13777
13099
|
}, [postToParent2, reselectNavigationItem]);
|
|
13778
|
-
const handleAddTopLevelNavItem =
|
|
13100
|
+
const handleAddTopLevelNavItem = useCallback6(() => {
|
|
13779
13101
|
const items = listNavbarRootItems();
|
|
13780
13102
|
addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
|
|
13781
13103
|
deselectRef.current();
|
|
@@ -13787,7 +13109,7 @@ function OhhwellsBridge() {
|
|
|
13787
13109
|
intent: "add-nav"
|
|
13788
13110
|
});
|
|
13789
13111
|
}, []);
|
|
13790
|
-
const maybeWarnNavLinkDropdownConflict =
|
|
13112
|
+
const maybeWarnNavLinkDropdownConflict = useCallback6(
|
|
13791
13113
|
(anchor) => {
|
|
13792
13114
|
if (!isNavbarHrefKey(anchor.getAttribute("data-ohw-href-key"))) return;
|
|
13793
13115
|
if (!navDropdownsOpenOnClick()) return;
|
|
@@ -13800,7 +13122,7 @@ function OhhwellsBridge() {
|
|
|
13800
13122
|
},
|
|
13801
13123
|
[postToParent2]
|
|
13802
13124
|
);
|
|
13803
|
-
const handleNavDropdownOpenChange =
|
|
13125
|
+
const handleNavDropdownOpenChange = useCallback6((open) => {
|
|
13804
13126
|
const selected = selectedElRef.current;
|
|
13805
13127
|
if (!selected || !isNavigationItem2(selected)) return;
|
|
13806
13128
|
setNavGroupForceOpen(selected, open);
|
|
@@ -13812,7 +13134,7 @@ function OhhwellsBridge() {
|
|
|
13812
13134
|
}
|
|
13813
13135
|
});
|
|
13814
13136
|
}, []);
|
|
13815
|
-
const handleFooterHeadingVisibleChange =
|
|
13137
|
+
const handleFooterHeadingVisibleChange = useCallback6(
|
|
13816
13138
|
(visible) => {
|
|
13817
13139
|
const selected = selectedElRef.current;
|
|
13818
13140
|
if (!selected || !isFooterFrameSelectionRef.current) return;
|
|
@@ -13836,7 +13158,7 @@ function OhhwellsBridge() {
|
|
|
13836
13158
|
},
|
|
13837
13159
|
[postToParent2]
|
|
13838
13160
|
);
|
|
13839
|
-
const enterEditOnNewItem =
|
|
13161
|
+
const enterEditOnNewItem = useCallback6((anchor) => {
|
|
13840
13162
|
const label = anchor.querySelector('[data-ohw-editable="text"]');
|
|
13841
13163
|
if (!label) {
|
|
13842
13164
|
selectRef.current(anchor);
|
|
@@ -13845,7 +13167,7 @@ function OhhwellsBridge() {
|
|
|
13845
13167
|
setNavGroupForceOpen(anchor, true);
|
|
13846
13168
|
activateRef.current(label);
|
|
13847
13169
|
}, []);
|
|
13848
|
-
const handleAddChildItem =
|
|
13170
|
+
const handleAddChildItem = useCallback6(() => {
|
|
13849
13171
|
const selected = selectedElRef.current;
|
|
13850
13172
|
if (!selected) return;
|
|
13851
13173
|
if (toolbarVariantRef.current === "select-frame" && isFooterFrameSelection) {
|
|
@@ -13921,7 +13243,7 @@ function OhhwellsBridge() {
|
|
|
13921
13243
|
enterEditOnNewItem(result.anchor);
|
|
13922
13244
|
});
|
|
13923
13245
|
}, [enterEditOnNewItem, isFooterFrameSelection, maybeWarnNavLinkDropdownConflict, postToParent2]);
|
|
13924
|
-
const handleAddFooterColumn =
|
|
13246
|
+
const handleAddFooterColumn = useCallback6(() => {
|
|
13925
13247
|
if (!canAddFooterColumn()) {
|
|
13926
13248
|
postToParent2({
|
|
13927
13249
|
type: "ow:toast",
|
|
@@ -13942,7 +13264,7 @@ function OhhwellsBridge() {
|
|
|
13942
13264
|
selectRef.current(result.firstLink);
|
|
13943
13265
|
});
|
|
13944
13266
|
}, [postToParent2]);
|
|
13945
|
-
const clearFooterDragVisuals =
|
|
13267
|
+
const clearFooterDragVisuals = useCallback6(() => {
|
|
13946
13268
|
footerDragRef.current = null;
|
|
13947
13269
|
setSiblingHintRects([]);
|
|
13948
13270
|
setFooterDropSlots([]);
|
|
@@ -13951,7 +13273,7 @@ function OhhwellsBridge() {
|
|
|
13951
13273
|
setIsItemDragging(false);
|
|
13952
13274
|
unlockFooterDragInteraction();
|
|
13953
13275
|
}, []);
|
|
13954
|
-
const refreshFooterDragVisuals =
|
|
13276
|
+
const refreshFooterDragVisuals = useCallback6((session, activeSlot, clientX, clientY) => {
|
|
13955
13277
|
const dragged = session.draggedEl;
|
|
13956
13278
|
setDraggedItemRect(dragged.getBoundingClientRect());
|
|
13957
13279
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -13976,13 +13298,13 @@ function OhhwellsBridge() {
|
|
|
13976
13298
|
const activeIdx = activeSlot ? slots.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
|
|
13977
13299
|
setActiveFooterDropIndex(activeIdx >= 0 ? activeIdx : null);
|
|
13978
13300
|
}, []);
|
|
13979
|
-
const refreshFooterDragVisualsRef =
|
|
13301
|
+
const refreshFooterDragVisualsRef = useRef8(refreshFooterDragVisuals);
|
|
13980
13302
|
refreshFooterDragVisualsRef.current = refreshFooterDragVisuals;
|
|
13981
|
-
const commitFooterDragRef =
|
|
13303
|
+
const commitFooterDragRef = useRef8(() => {
|
|
13982
13304
|
});
|
|
13983
|
-
const beginFooterDragRef =
|
|
13305
|
+
const beginFooterDragRef = useRef8(() => {
|
|
13984
13306
|
});
|
|
13985
|
-
const beginFooterDrag =
|
|
13307
|
+
const beginFooterDrag = useCallback6(
|
|
13986
13308
|
(session) => {
|
|
13987
13309
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
13988
13310
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -14002,7 +13324,7 @@ function OhhwellsBridge() {
|
|
|
14002
13324
|
[refreshFooterDragVisuals]
|
|
14003
13325
|
);
|
|
14004
13326
|
beginFooterDragRef.current = beginFooterDrag;
|
|
14005
|
-
const commitFooterDrag =
|
|
13327
|
+
const commitFooterDrag = useCallback6(
|
|
14006
13328
|
(clientX, clientY) => {
|
|
14007
13329
|
const session = footerDragRef.current;
|
|
14008
13330
|
if (!session) {
|
|
@@ -14106,7 +13428,7 @@ function OhhwellsBridge() {
|
|
|
14106
13428
|
[clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
|
|
14107
13429
|
);
|
|
14108
13430
|
commitFooterDragRef.current = commitFooterDrag;
|
|
14109
|
-
const startFooterLinkDrag =
|
|
13431
|
+
const startFooterLinkDrag = useCallback6(
|
|
14110
13432
|
(anchor, clientX, clientY, wasSelected) => {
|
|
14111
13433
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
14112
13434
|
if (!hrefKey || !isFooterHrefKey(hrefKey)) return false;
|
|
@@ -14127,7 +13449,7 @@ function OhhwellsBridge() {
|
|
|
14127
13449
|
},
|
|
14128
13450
|
[beginFooterDrag]
|
|
14129
13451
|
);
|
|
14130
|
-
const startFooterColumnDrag =
|
|
13452
|
+
const startFooterColumnDrag = useCallback6(
|
|
14131
13453
|
(columnEl, clientX, clientY, wasSelected) => {
|
|
14132
13454
|
const columns = listFooterColumns();
|
|
14133
13455
|
const idx = columns.indexOf(columnEl);
|
|
@@ -14147,7 +13469,7 @@ function OhhwellsBridge() {
|
|
|
14147
13469
|
},
|
|
14148
13470
|
[beginFooterDrag]
|
|
14149
13471
|
);
|
|
14150
|
-
const handleItemDragStart =
|
|
13472
|
+
const handleItemDragStart = useCallback6(
|
|
14151
13473
|
(e) => {
|
|
14152
13474
|
const selected = selectedElRef.current;
|
|
14153
13475
|
if (!selected) {
|
|
@@ -14167,7 +13489,7 @@ function OhhwellsBridge() {
|
|
|
14167
13489
|
},
|
|
14168
13490
|
[startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag]
|
|
14169
13491
|
);
|
|
14170
|
-
const handleItemDragEnd =
|
|
13492
|
+
const handleItemDragEnd = useCallback6(
|
|
14171
13493
|
(e) => {
|
|
14172
13494
|
if (footerDragRef.current) {
|
|
14173
13495
|
const x = e?.clientX;
|
|
@@ -14193,7 +13515,7 @@ function OhhwellsBridge() {
|
|
|
14193
13515
|
},
|
|
14194
13516
|
[commitFooterDrag, commitNavDrag, navDragRef]
|
|
14195
13517
|
);
|
|
14196
|
-
const handleItemChromePointerDown =
|
|
13518
|
+
const handleItemChromePointerDown = useCallback6((e) => {
|
|
14197
13519
|
if (e.button !== 0) return;
|
|
14198
13520
|
const selected = selectedElRef.current;
|
|
14199
13521
|
if (!selected) return;
|
|
@@ -14224,7 +13546,7 @@ function OhhwellsBridge() {
|
|
|
14224
13546
|
}
|
|
14225
13547
|
if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
|
|
14226
13548
|
}, [armNavPressFromChrome]);
|
|
14227
|
-
const handleItemChromeClick =
|
|
13549
|
+
const handleItemChromeClick = useCallback6((clientX, clientY) => {
|
|
14228
13550
|
if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
|
|
14229
13551
|
suppressNextClickRef.current = false;
|
|
14230
13552
|
return;
|
|
@@ -14237,7 +13559,7 @@ function OhhwellsBridge() {
|
|
|
14237
13559
|
}, []);
|
|
14238
13560
|
reselectNavigationItemRef.current = reselectNavigationItem;
|
|
14239
13561
|
commitNavigationTextEditRef.current = commitNavigationTextEdit;
|
|
14240
|
-
const select =
|
|
13562
|
+
const select = useCallback6((anchor) => {
|
|
14241
13563
|
if (!isNavigationItem2(anchor)) return;
|
|
14242
13564
|
if (activeElRef.current) deactivate();
|
|
14243
13565
|
aiSectionApiRef.current?.selectFromElement(anchor);
|
|
@@ -14275,10 +13597,8 @@ function OhhwellsBridge() {
|
|
|
14275
13597
|
setToolbarRect(anchor.getBoundingClientRect());
|
|
14276
13598
|
setToolbarShowEditLink(false);
|
|
14277
13599
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
14278
|
-
setFloatingPanel(null);
|
|
14279
|
-
setLogoSizeDraft(null);
|
|
14280
13600
|
}, [deactivate, markSelected]);
|
|
14281
|
-
const selectFrame =
|
|
13601
|
+
const selectFrame = useCallback6((el) => {
|
|
14282
13602
|
if (!isNavigationContainer(el)) return;
|
|
14283
13603
|
if (activeElRef.current) deactivate();
|
|
14284
13604
|
aiSectionApiRef.current?.selectFromElement(el);
|
|
@@ -14324,99 +13644,8 @@ function OhhwellsBridge() {
|
|
|
14324
13644
|
setToolbarRect(el.getBoundingClientRect());
|
|
14325
13645
|
setToolbarShowEditLink(false);
|
|
14326
13646
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
14327
|
-
setFloatingPanel(null);
|
|
14328
|
-
setLogoSizeDraft(null);
|
|
14329
13647
|
}, [deactivate, markSelected, postToParent2]);
|
|
14330
|
-
const
|
|
14331
|
-
(logoEl) => {
|
|
14332
|
-
if (activeElRef.current) deactivate();
|
|
14333
|
-
selectedElRef.current = logoEl;
|
|
14334
|
-
selectedHrefKeyRef.current = null;
|
|
14335
|
-
selectedFooterColAttrRef.current = null;
|
|
14336
|
-
markSelected(logoEl);
|
|
14337
|
-
setSelectedIsCta(false);
|
|
14338
|
-
clearHrefKeyHover(logoEl);
|
|
14339
|
-
hoveredNavContainerRef.current = null;
|
|
14340
|
-
setHoveredNavContainerRect(null);
|
|
14341
|
-
setHoveredItemRect(null);
|
|
14342
|
-
hoveredItemElRef.current = null;
|
|
14343
|
-
siblingHintElRef.current = null;
|
|
14344
|
-
setSiblingHintRect(null);
|
|
14345
|
-
setSiblingHintRects([]);
|
|
14346
|
-
setIsItemDragging(false);
|
|
14347
|
-
setReorderHrefKey(null);
|
|
14348
|
-
setReorderDragDisabled(false);
|
|
14349
|
-
setIsFooterFrameSelection(false);
|
|
14350
|
-
setToolbarVariant("logo");
|
|
14351
|
-
setToolbarRect(getLogoInteractionRect(logoEl));
|
|
14352
|
-
setToolbarShowEditLink(false);
|
|
14353
|
-
setActiveCommands(/* @__PURE__ */ new Set());
|
|
14354
|
-
},
|
|
14355
|
-
[deactivate, markSelected]
|
|
14356
|
-
);
|
|
14357
|
-
const openLogoSizePanel = useCallback7((logoEl) => {
|
|
14358
|
-
const placement = getLogoPlacement(logoEl);
|
|
14359
|
-
const draft = readLogoSizeState(editContentRef.current, placement);
|
|
14360
|
-
setLogoSizeDraft(draft);
|
|
14361
|
-
setParentScrollSnap(parentScrollRef.current);
|
|
14362
|
-
setFloatingPanel({
|
|
14363
|
-
key: `logo-size:${placement}`,
|
|
14364
|
-
title: "Logo",
|
|
14365
|
-
context: placement === "navbar" ? "Navbar" : "Footer",
|
|
14366
|
-
kind: "logo-size",
|
|
14367
|
-
placement
|
|
14368
|
-
});
|
|
14369
|
-
}, []);
|
|
14370
|
-
const closeFloatingPanelOnly = useCallback7(() => {
|
|
14371
|
-
setFloatingPanel(null);
|
|
14372
|
-
setLogoSizeDraft(null);
|
|
14373
|
-
}, []);
|
|
14374
|
-
const closeFloatingPanelAndDeselect = useCallback7(() => {
|
|
14375
|
-
setFloatingPanel(null);
|
|
14376
|
-
setLogoSizeDraft(null);
|
|
14377
|
-
deselectRef.current();
|
|
14378
|
-
}, []);
|
|
14379
|
-
const persistLogoSizeDraft = useCallback7(
|
|
14380
|
-
(placement, draft) => {
|
|
14381
|
-
const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
|
|
14382
|
-
const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
|
|
14383
|
-
const nodes = [
|
|
14384
|
-
{ key: desktopKey, text: String(draft.desktopPx) }
|
|
14385
|
-
];
|
|
14386
|
-
if (draft.mobileFollowing) {
|
|
14387
|
-
nodes.push({ key: mobileKey, text: "" });
|
|
14388
|
-
} else {
|
|
14389
|
-
nodes.push({ key: mobileKey, text: String(draft.mobilePx) });
|
|
14390
|
-
}
|
|
14391
|
-
editContentRef.current = {
|
|
14392
|
-
...editContentRef.current,
|
|
14393
|
-
[desktopKey]: String(draft.desktopPx),
|
|
14394
|
-
[mobileKey]: draft.mobileFollowing ? "" : String(draft.mobilePx)
|
|
14395
|
-
};
|
|
14396
|
-
applyLogoSizeToPlacement(
|
|
14397
|
-
placement,
|
|
14398
|
-
draft.desktopPx,
|
|
14399
|
-
draft.mobileFollowing ? draft.desktopPx : draft.mobilePx,
|
|
14400
|
-
draft.mobileFollowing
|
|
14401
|
-
);
|
|
14402
|
-
postToParent2({ type: "ow:change", nodes });
|
|
14403
|
-
requestAnimationFrame(() => {
|
|
14404
|
-
const selected = selectedElRef.current;
|
|
14405
|
-
if (!selected || toolbarVariantRef.current !== "logo") return;
|
|
14406
|
-
const rect = getLogoInteractionRect(selected);
|
|
14407
|
-
setToolbarRect(rect);
|
|
14408
|
-
if (glowElRef.current) {
|
|
14409
|
-
const GAP = SELECTION_CHROME_GAP2;
|
|
14410
|
-
glowElRef.current.style.top = `${rect.top - GAP}px`;
|
|
14411
|
-
glowElRef.current.style.left = `${rect.left - GAP}px`;
|
|
14412
|
-
glowElRef.current.style.width = `${rect.width + GAP * 2}px`;
|
|
14413
|
-
glowElRef.current.style.height = `${rect.height + GAP * 2}px`;
|
|
14414
|
-
}
|
|
14415
|
-
});
|
|
14416
|
-
},
|
|
14417
|
-
[postToParent2]
|
|
14418
|
-
);
|
|
14419
|
-
const activate = useCallback7((el, options) => {
|
|
13648
|
+
const activate = useCallback6((el, options) => {
|
|
14420
13649
|
if (activeElRef.current === el) return;
|
|
14421
13650
|
clearSelectedAttr();
|
|
14422
13651
|
selectedElRef.current = null;
|
|
@@ -14492,38 +13721,8 @@ function OhhwellsBridge() {
|
|
|
14492
13721
|
deactivateRef.current = deactivate;
|
|
14493
13722
|
selectRef.current = select;
|
|
14494
13723
|
selectFrameRef.current = selectFrame;
|
|
14495
|
-
selectLogoRef.current = selectLogo;
|
|
14496
|
-
openLogoSizePanelRef.current = openLogoSizePanel;
|
|
14497
13724
|
deselectRef.current = deselect;
|
|
14498
|
-
|
|
14499
|
-
const lastSiteWideScopeRef = useRef9(null);
|
|
14500
|
-
useEffect12(() => {
|
|
14501
|
-
if (!isEditMode) {
|
|
14502
|
-
if (lastSiteWideScopeRef.current !== false) {
|
|
14503
|
-
lastSiteWideScopeRef.current = false;
|
|
14504
|
-
postToParent2({ type: "ow:site-wide-scope", active: false });
|
|
14505
|
-
}
|
|
14506
|
-
return;
|
|
14507
|
-
}
|
|
14508
|
-
const active = isSiteWideScopeActive({
|
|
14509
|
-
selected: selectedElRef.current,
|
|
14510
|
-
hoveredItem: hoveredItemElRef.current,
|
|
14511
|
-
hoveredNavContainer: hoveredNavContainerRef.current,
|
|
14512
|
-
active: activeElRef.current
|
|
14513
|
-
});
|
|
14514
|
-
if (lastSiteWideScopeRef.current === active) return;
|
|
14515
|
-
lastSiteWideScopeRef.current = active;
|
|
14516
|
-
postToParent2({ type: "ow:site-wide-scope", active });
|
|
14517
|
-
}, [
|
|
14518
|
-
isEditMode,
|
|
14519
|
-
hoveredItemRect,
|
|
14520
|
-
hoveredNavContainerRect,
|
|
14521
|
-
toolbarVariant,
|
|
14522
|
-
toolbarRect,
|
|
14523
|
-
isFooterFrameSelection,
|
|
14524
|
-
postToParent2
|
|
14525
|
-
]);
|
|
14526
|
-
useLayoutEffect4(() => {
|
|
13725
|
+
useLayoutEffect3(() => {
|
|
14527
13726
|
if (!subdomain || isEditMode) {
|
|
14528
13727
|
setFetchState("done");
|
|
14529
13728
|
return;
|
|
@@ -14537,8 +13736,6 @@ function OhhwellsBridge() {
|
|
|
14537
13736
|
for (const [key, val] of Object.entries(content)) {
|
|
14538
13737
|
if (key === "__ohw_sections") continue;
|
|
14539
13738
|
if (key === AI_SECTIONS_KEY) continue;
|
|
14540
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
14541
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
14542
13739
|
if (applyVideoSettingNode(key, val)) continue;
|
|
14543
13740
|
if (applyCarouselNode(key, val)) continue;
|
|
14544
13741
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -14565,16 +13762,12 @@ function OhhwellsBridge() {
|
|
|
14565
13762
|
}
|
|
14566
13763
|
} else if (el.dataset.ohwEditable === "link") {
|
|
14567
13764
|
applyLinkHref(el, val);
|
|
14568
|
-
} else if (el.dataset.ohwEditable === "icon") {
|
|
14569
|
-
if (el.innerHTML !== val) el.innerHTML = val;
|
|
14570
13765
|
} else if (el.innerHTML !== val) {
|
|
14571
13766
|
el.innerHTML = val;
|
|
14572
13767
|
}
|
|
14573
13768
|
});
|
|
14574
13769
|
applyLinkByKey(key, val);
|
|
14575
13770
|
}
|
|
14576
|
-
applyLogoFromContent(content);
|
|
14577
|
-
applyLogoSizes(content);
|
|
14578
13771
|
reconcileNavbarItemsFromContent(content);
|
|
14579
13772
|
reconcileFooterOrderFromContent(content);
|
|
14580
13773
|
enforceLinkHrefs();
|
|
@@ -14592,9 +13785,7 @@ function OhhwellsBridge() {
|
|
|
14592
13785
|
let cancelled = false;
|
|
14593
13786
|
setFetchState("loading");
|
|
14594
13787
|
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
14595
|
-
|
|
14596
|
-
fetchedContentPaths.add(`${subdomain}::${initialPath}`);
|
|
14597
|
-
fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(initialPath)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
13788
|
+
fetch(`${apiUrl}/api/public/sites/${subdomain}/content`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
14598
13789
|
if (cancelled) return;
|
|
14599
13790
|
const content = data?.content ?? {};
|
|
14600
13791
|
contentCache.set(subdomain, content);
|
|
@@ -14607,7 +13798,7 @@ function OhhwellsBridge() {
|
|
|
14607
13798
|
cancelled = true;
|
|
14608
13799
|
};
|
|
14609
13800
|
}, [subdomain, isEditMode]);
|
|
14610
|
-
|
|
13801
|
+
useEffect11(() => {
|
|
14611
13802
|
if (!subdomain || isEditMode) return;
|
|
14612
13803
|
let debounceTimer = null;
|
|
14613
13804
|
let observer = null;
|
|
@@ -14619,8 +13810,6 @@ function OhhwellsBridge() {
|
|
|
14619
13810
|
try {
|
|
14620
13811
|
for (const [key, val] of Object.entries(content)) {
|
|
14621
13812
|
if (key === "__ohw_sections") continue;
|
|
14622
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
14623
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
14624
13813
|
if (applyVideoSettingNode(key, val)) continue;
|
|
14625
13814
|
if (applyCarouselNode(key, val)) continue;
|
|
14626
13815
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -14641,7 +13830,6 @@ function OhhwellsBridge() {
|
|
|
14641
13830
|
});
|
|
14642
13831
|
applyLinkByKey(key, val);
|
|
14643
13832
|
}
|
|
14644
|
-
applyLogoFromContent(content);
|
|
14645
13833
|
reconcileNavbarItemsFromContent(content);
|
|
14646
13834
|
reconcileFooterOrderFromContent(content);
|
|
14647
13835
|
} finally {
|
|
@@ -14654,17 +13842,6 @@ function OhhwellsBridge() {
|
|
|
14654
13842
|
debounceTimer = setTimeout(applyFromCache, 150);
|
|
14655
13843
|
};
|
|
14656
13844
|
applyFromCache();
|
|
14657
|
-
const pathCacheKey = `${subdomain}::${pathname}`;
|
|
14658
|
-
if (!fetchedContentPaths.has(pathCacheKey)) {
|
|
14659
|
-
fetchedContentPaths.add(pathCacheKey);
|
|
14660
|
-
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
14661
|
-
fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(pathname)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
14662
|
-
if (!data?.content) return;
|
|
14663
|
-
contentCache.set(subdomain, data.content);
|
|
14664
|
-
applyFromCache();
|
|
14665
|
-
}).catch(() => {
|
|
14666
|
-
});
|
|
14667
|
-
}
|
|
14668
13845
|
observer = new MutationObserver(scheduleApply);
|
|
14669
13846
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
14670
13847
|
return () => {
|
|
@@ -14672,16 +13849,16 @@ function OhhwellsBridge() {
|
|
|
14672
13849
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
14673
13850
|
};
|
|
14674
13851
|
}, [subdomain, isEditMode, pathname]);
|
|
14675
|
-
|
|
13852
|
+
useLayoutEffect3(() => {
|
|
14676
13853
|
const el = document.getElementById("ohw-loader");
|
|
14677
13854
|
if (!el) return;
|
|
14678
13855
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
14679
13856
|
el.style.display = visible ? "flex" : "none";
|
|
14680
13857
|
}, [subdomain, fetchState]);
|
|
14681
|
-
|
|
13858
|
+
useEffect11(() => {
|
|
14682
13859
|
postToParent2({ type: "ow:navigation", path: pathname });
|
|
14683
13860
|
}, [pathname, postToParent2]);
|
|
14684
|
-
|
|
13861
|
+
useEffect11(() => {
|
|
14685
13862
|
if (!isEditMode) return;
|
|
14686
13863
|
if (linkPopoverSessionRef.current?.intent === "add-nav") return;
|
|
14687
13864
|
if (document.querySelector("[data-ohw-section-picker]")) return;
|
|
@@ -14689,7 +13866,7 @@ function OhhwellsBridge() {
|
|
|
14689
13866
|
deselectRef.current();
|
|
14690
13867
|
deactivateRef.current();
|
|
14691
13868
|
}, [pathname, isEditMode]);
|
|
14692
|
-
|
|
13869
|
+
useEffect11(() => {
|
|
14693
13870
|
const contentForNav = () => {
|
|
14694
13871
|
if (isEditMode) return editContentRef.current;
|
|
14695
13872
|
if (!subdomain) return {};
|
|
@@ -14754,7 +13931,7 @@ function OhhwellsBridge() {
|
|
|
14754
13931
|
observer?.disconnect();
|
|
14755
13932
|
};
|
|
14756
13933
|
}, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
|
|
14757
|
-
|
|
13934
|
+
useEffect11(() => {
|
|
14758
13935
|
if (!isEditMode) return;
|
|
14759
13936
|
const measure = () => {
|
|
14760
13937
|
const h = document.body.scrollHeight;
|
|
@@ -14778,7 +13955,7 @@ function OhhwellsBridge() {
|
|
|
14778
13955
|
window.removeEventListener("resize", handleResize);
|
|
14779
13956
|
};
|
|
14780
13957
|
}, [pathname, isEditMode, postToParent2]);
|
|
14781
|
-
|
|
13958
|
+
useEffect11(() => {
|
|
14782
13959
|
if (!subdomainFromQuery || isEditMode) return;
|
|
14783
13960
|
const handleClick = (e) => {
|
|
14784
13961
|
const anchor = e.target.closest("a");
|
|
@@ -14794,7 +13971,7 @@ function OhhwellsBridge() {
|
|
|
14794
13971
|
document.addEventListener("click", handleClick, true);
|
|
14795
13972
|
return () => document.removeEventListener("click", handleClick, true);
|
|
14796
13973
|
}, [subdomainFromQuery, isEditMode, router]);
|
|
14797
|
-
|
|
13974
|
+
useEffect11(() => {
|
|
14798
13975
|
if (!isEditMode) {
|
|
14799
13976
|
editStylesRef.current?.base.remove();
|
|
14800
13977
|
editStylesRef.current?.forceHover.remove();
|
|
@@ -14923,7 +14100,6 @@ function OhhwellsBridge() {
|
|
|
14923
14100
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
14924
14101
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
14925
14102
|
if (isInsideLinkEditor(target)) return;
|
|
14926
|
-
if (isInsideFloatingPanel(target)) return;
|
|
14927
14103
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
14928
14104
|
const beneath = document.elementsFromPoint(e.clientX, e.clientY).find(
|
|
14929
14105
|
(el) => el instanceof HTMLElement && !el.closest("[data-ohw-bridge-root]") && el.closest("[data-ohw-section]") != null
|
|
@@ -14987,21 +14163,6 @@ function OhhwellsBridge() {
|
|
|
14987
14163
|
return;
|
|
14988
14164
|
}
|
|
14989
14165
|
}
|
|
14990
|
-
const logoEl = getLogoElement(target);
|
|
14991
|
-
if (logoEl) {
|
|
14992
|
-
e.preventDefault();
|
|
14993
|
-
e.stopPropagation();
|
|
14994
|
-
if (!logoHasUploadedImage(logoEl)) {
|
|
14995
|
-
deselectRef.current();
|
|
14996
|
-
deactivateRef.current();
|
|
14997
|
-
const identity = readLogoIdentityFromDom();
|
|
14998
|
-
postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
|
|
14999
|
-
return;
|
|
15000
|
-
}
|
|
15001
|
-
selectLogoRef.current(logoEl);
|
|
15002
|
-
openLogoSizePanelRef.current(logoEl);
|
|
15003
|
-
return;
|
|
15004
|
-
}
|
|
15005
14166
|
const editable = target.closest("[data-ohw-editable]");
|
|
15006
14167
|
if (editable) {
|
|
15007
14168
|
if (editable.dataset.ohwEditable === "link") {
|
|
@@ -15018,17 +14179,6 @@ function OhhwellsBridge() {
|
|
|
15018
14179
|
});
|
|
15019
14180
|
return;
|
|
15020
14181
|
}
|
|
15021
|
-
if (isIconEditable(editable)) {
|
|
15022
|
-
e.preventDefault();
|
|
15023
|
-
e.stopPropagation();
|
|
15024
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
15025
|
-
postToParentRef.current({
|
|
15026
|
-
type: "ow:icon-pick",
|
|
15027
|
-
key: editable.dataset.ohwKey ?? "",
|
|
15028
|
-
current: currentIconRef(editable)
|
|
15029
|
-
});
|
|
15030
|
-
return;
|
|
15031
|
-
}
|
|
15032
14182
|
if (isMediaEditable(editable)) {
|
|
15033
14183
|
e.preventDefault();
|
|
15034
14184
|
e.stopPropagation();
|
|
@@ -15145,7 +14295,6 @@ function OhhwellsBridge() {
|
|
|
15145
14295
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
15146
14296
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
15147
14297
|
if (isInsideLinkEditor(target)) return;
|
|
15148
|
-
if (isInsideFloatingPanel(target)) return;
|
|
15149
14298
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
15150
14299
|
return;
|
|
15151
14300
|
}
|
|
@@ -15172,16 +14321,6 @@ function OhhwellsBridge() {
|
|
|
15172
14321
|
setHoveredNavContainerRect(null);
|
|
15173
14322
|
return;
|
|
15174
14323
|
}
|
|
15175
|
-
if (isInsideFloatingPanel(target) || isPointOverFloatingPanel(e.clientX, e.clientY)) {
|
|
15176
|
-
hoveredItemElRef.current = null;
|
|
15177
|
-
setHoveredItemRect(null);
|
|
15178
|
-
hoveredNavContainerRef.current = null;
|
|
15179
|
-
setHoveredNavContainerRect(null);
|
|
15180
|
-
siblingHintElRef.current = null;
|
|
15181
|
-
setSiblingHintRect(null);
|
|
15182
|
-
setSiblingHintRects([]);
|
|
15183
|
-
return;
|
|
15184
|
-
}
|
|
15185
14324
|
{
|
|
15186
14325
|
const selected2 = selectedElRef.current;
|
|
15187
14326
|
const selectedIsFooterColumn = Boolean(selected2) && !isFooterLinksContainer(selected2) && (selected2.hasAttribute("data-ohw-footer-col") || selected2.hasAttribute("data-ohw-footer-column") || Boolean(selected2.closest("footer") && isInferredFooterGroup2(selected2)));
|
|
@@ -15189,7 +14328,7 @@ function OhhwellsBridge() {
|
|
|
15189
14328
|
const allowFooterLinksHover = toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn;
|
|
15190
14329
|
if (allowNavContainerHover) {
|
|
15191
14330
|
const navContainer = target.closest("[data-ohw-nav-container]");
|
|
15192
|
-
if (navContainer && !getNavigationItemAnchor(target)
|
|
14331
|
+
if (navContainer && !getNavigationItemAnchor(target)) {
|
|
15193
14332
|
hoveredNavContainerRef.current = navContainer;
|
|
15194
14333
|
setHoveredNavContainerRect(navContainer.getBoundingClientRect());
|
|
15195
14334
|
hoveredItemElRef.current = null;
|
|
@@ -15218,15 +14357,6 @@ function OhhwellsBridge() {
|
|
|
15218
14357
|
setHoveredNavContainerRect(null);
|
|
15219
14358
|
}
|
|
15220
14359
|
}
|
|
15221
|
-
const logoEl = getLogoElement(target);
|
|
15222
|
-
if (logoEl) {
|
|
15223
|
-
hoveredNavContainerRef.current = null;
|
|
15224
|
-
setHoveredNavContainerRect(null);
|
|
15225
|
-
if (selectedElRef.current === logoEl) return;
|
|
15226
|
-
hoveredItemElRef.current = logoEl;
|
|
15227
|
-
setHoveredItemRect(getLogoInteractionRect(logoEl));
|
|
15228
|
-
return;
|
|
15229
|
-
}
|
|
15230
14360
|
const navAnchor = getNavigationItemAnchor(target);
|
|
15231
14361
|
if (navAnchor) {
|
|
15232
14362
|
hoveredNavContainerRef.current = null;
|
|
@@ -15252,11 +14382,6 @@ function OhhwellsBridge() {
|
|
|
15252
14382
|
const selected = selectedElRef.current;
|
|
15253
14383
|
if (selected && (selected === editable || selected.contains(editable))) return;
|
|
15254
14384
|
if (!isMediaEditable(editable) && !editable.hasAttribute("contenteditable")) {
|
|
15255
|
-
if (isIconEditable(editable)) {
|
|
15256
|
-
hoveredItemElRef.current = editable;
|
|
15257
|
-
setHoveredItemRect(editable.getBoundingClientRect());
|
|
15258
|
-
return;
|
|
15259
|
-
}
|
|
15260
14385
|
const hoverTarget = editable.closest("[data-ohw-href-key]") ?? editable;
|
|
15261
14386
|
if (hoverTarget.hasAttribute("data-ohw-href-key")) {
|
|
15262
14387
|
clearHrefKeyHover(hoverTarget);
|
|
@@ -15264,12 +14389,6 @@ function OhhwellsBridge() {
|
|
|
15264
14389
|
setHoveredItemRect(hoverTarget.getBoundingClientRect());
|
|
15265
14390
|
} else if (!isInsideNavigationItem(editable)) {
|
|
15266
14391
|
hoverTarget.setAttribute("data-ohw-hovered", "");
|
|
15267
|
-
if (editable.closest("footer") || editable.closest('[data-ohw-section="footer"]')) {
|
|
15268
|
-
hoveredNavContainerRef.current = null;
|
|
15269
|
-
setHoveredNavContainerRect(null);
|
|
15270
|
-
hoveredItemElRef.current = editable;
|
|
15271
|
-
setHoveredItemRect(editable.getBoundingClientRect());
|
|
15272
|
-
}
|
|
15273
14392
|
}
|
|
15274
14393
|
}
|
|
15275
14394
|
};
|
|
@@ -15305,30 +14424,11 @@ function OhhwellsBridge() {
|
|
|
15305
14424
|
}
|
|
15306
14425
|
return;
|
|
15307
14426
|
}
|
|
15308
|
-
const logoEl = getLogoElement(target);
|
|
15309
|
-
if (logoEl) {
|
|
15310
|
-
const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
|
|
15311
|
-
if (related2 && (logoEl === related2 || logoEl.contains(related2) || related2.closest?.('[data-ohw-role="logo"], [data-ohw-logo]'))) {
|
|
15312
|
-
return;
|
|
15313
|
-
}
|
|
15314
|
-
if (hoveredItemElRef.current === logoEl) {
|
|
15315
|
-
hoveredItemElRef.current = null;
|
|
15316
|
-
setHoveredItemRect(null);
|
|
15317
|
-
}
|
|
15318
|
-
return;
|
|
15319
|
-
}
|
|
15320
14427
|
const editable = target.closest("[data-ohw-editable]");
|
|
15321
14428
|
if (!editable) return;
|
|
15322
14429
|
const related = e.relatedTarget instanceof Element ? e.relatedTarget : null;
|
|
15323
14430
|
if (related?.closest("[data-ohw-drag-handle-container], [data-ohw-item-interaction]")) return;
|
|
15324
14431
|
if (!isMediaEditable(editable)) {
|
|
15325
|
-
if (isIconEditable(editable) && hoveredItemElRef.current === editable) {
|
|
15326
|
-
if (!related?.closest("[data-ohw-item-interaction]")) {
|
|
15327
|
-
hoveredItemElRef.current = null;
|
|
15328
|
-
setHoveredItemRect(null);
|
|
15329
|
-
}
|
|
15330
|
-
return;
|
|
15331
|
-
}
|
|
15332
14432
|
const hoverTarget = editable.closest("[data-ohw-href-key]") ?? editable;
|
|
15333
14433
|
if (hoverTarget.hasAttribute("data-ohw-href-key")) {
|
|
15334
14434
|
if (!related?.closest("[data-ohw-href-key]")) {
|
|
@@ -15337,13 +14437,6 @@ function OhhwellsBridge() {
|
|
|
15337
14437
|
}
|
|
15338
14438
|
} else {
|
|
15339
14439
|
hoverTarget.removeAttribute("data-ohw-hovered");
|
|
15340
|
-
if (hoveredItemElRef.current === editable) {
|
|
15341
|
-
const stillOnEditable = related instanceof Element && related.closest("[data-ohw-editable]") === editable;
|
|
15342
|
-
if (!stillOnEditable) {
|
|
15343
|
-
hoveredItemElRef.current = null;
|
|
15344
|
-
setHoveredItemRect(null);
|
|
15345
|
-
}
|
|
15346
|
-
}
|
|
15347
14440
|
}
|
|
15348
14441
|
}
|
|
15349
14442
|
};
|
|
@@ -15460,26 +14553,6 @@ function OhhwellsBridge() {
|
|
|
15460
14553
|
hoveredNavContainerRef.current = null;
|
|
15461
14554
|
setHoveredNavContainerRect(null);
|
|
15462
14555
|
}
|
|
15463
|
-
const logoCandidates = [
|
|
15464
|
-
...document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]'),
|
|
15465
|
-
...document.querySelectorAll("nav a:not([data-ohw-href-key]), [data-ohw-nav-root] a:not([data-ohw-href-key])"),
|
|
15466
|
-
...document.querySelectorAll("footer img")
|
|
15467
|
-
];
|
|
15468
|
-
const seenLogos = /* @__PURE__ */ new Set();
|
|
15469
|
-
for (const candidate of logoCandidates) {
|
|
15470
|
-
const logo = getLogoElement(candidate);
|
|
15471
|
-
if (!logo || seenLogos.has(logo)) continue;
|
|
15472
|
-
seenLogos.add(logo);
|
|
15473
|
-
const r2 = logo.getBoundingClientRect();
|
|
15474
|
-
if (x < r2.left || x > r2.right || y < r2.top || y > r2.bottom) continue;
|
|
15475
|
-
hoveredNavContainerRef.current = null;
|
|
15476
|
-
setHoveredNavContainerRect(null);
|
|
15477
|
-
if (selectedElRef.current !== logo) {
|
|
15478
|
-
hoveredItemElRef.current = logo;
|
|
15479
|
-
setHoveredItemRect(getLogoInteractionRect(logo));
|
|
15480
|
-
}
|
|
15481
|
-
return;
|
|
15482
|
-
}
|
|
15483
14556
|
const navContainers = Array.from(
|
|
15484
14557
|
document.querySelectorAll("[data-ohw-nav-container]")
|
|
15485
14558
|
);
|
|
@@ -15565,7 +14638,7 @@ function OhhwellsBridge() {
|
|
|
15565
14638
|
}
|
|
15566
14639
|
};
|
|
15567
14640
|
const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false) => {
|
|
15568
|
-
if (linkPopoverOpenRef.current
|
|
14641
|
+
if (linkPopoverOpenRef.current) {
|
|
15569
14642
|
if (hoveredImageRef.current) {
|
|
15570
14643
|
hoveredImageRef.current = null;
|
|
15571
14644
|
hoveredImageHasTextOverlapRef.current = false;
|
|
@@ -15819,7 +14892,7 @@ function OhhwellsBridge() {
|
|
|
15819
14892
|
}
|
|
15820
14893
|
};
|
|
15821
14894
|
const probeHoverCardsAt = (clientX, clientY, fromParentViewport = false) => {
|
|
15822
|
-
if (linkPopoverOpenRef.current ||
|
|
14895
|
+
if (linkPopoverOpenRef.current || document.documentElement.hasAttribute("data-ohw-section-picking")) {
|
|
15823
14896
|
if (activeStateElRef.current) {
|
|
15824
14897
|
activeStateElRef.current.removeAttribute("data-ohw-state-hovered");
|
|
15825
14898
|
activeStateElRef.current = null;
|
|
@@ -15887,19 +14960,6 @@ function OhhwellsBridge() {
|
|
|
15887
14960
|
};
|
|
15888
14961
|
const handleMouseMove = (e) => {
|
|
15889
14962
|
const { clientX, clientY } = e;
|
|
15890
|
-
if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
|
|
15891
|
-
hoveredItemElRef.current = null;
|
|
15892
|
-
setHoveredItemRect(null);
|
|
15893
|
-
hoveredNavContainerRef.current = null;
|
|
15894
|
-
setHoveredNavContainerRect(null);
|
|
15895
|
-
siblingHintElRef.current = null;
|
|
15896
|
-
setSiblingHintRect(null);
|
|
15897
|
-
setSiblingHintRects([]);
|
|
15898
|
-
dismissImageHover();
|
|
15899
|
-
clearImageHover();
|
|
15900
|
-
setSectionGap(null);
|
|
15901
|
-
return;
|
|
15902
|
-
}
|
|
15903
14963
|
probeSectionGapAt(clientX, clientY);
|
|
15904
14964
|
probeImageAt(clientX, clientY);
|
|
15905
14965
|
probeHoverCardsAt(clientX, clientY);
|
|
@@ -15908,11 +14968,6 @@ function OhhwellsBridge() {
|
|
|
15908
14968
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
15909
14969
|
const { clientX, clientY } = e.data;
|
|
15910
14970
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
15911
|
-
if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
|
|
15912
|
-
dismissImageHover();
|
|
15913
|
-
clearImageHover();
|
|
15914
|
-
return;
|
|
15915
|
-
}
|
|
15916
14971
|
probeSectionGapAt(clientX, clientY);
|
|
15917
14972
|
probeImageAt(clientX, clientY);
|
|
15918
14973
|
probeHoverCardsAt(clientX, clientY);
|
|
@@ -15974,19 +15029,6 @@ function OhhwellsBridge() {
|
|
|
15974
15029
|
resumeAnimTracks();
|
|
15975
15030
|
clearImageHover();
|
|
15976
15031
|
};
|
|
15977
|
-
const handleIconMarkup = (e) => {
|
|
15978
|
-
if (e.data?.type !== "ow:icon-markup") return;
|
|
15979
|
-
const { key, markup } = e.data;
|
|
15980
|
-
if (!key || typeof markup !== "string") return;
|
|
15981
|
-
const targets = document.querySelectorAll(
|
|
15982
|
-
`[data-ohw-key="${key}"][data-ohw-editable="icon"]`
|
|
15983
|
-
);
|
|
15984
|
-
if (!targets.length) return;
|
|
15985
|
-
targets.forEach((el) => {
|
|
15986
|
-
el.innerHTML = markup;
|
|
15987
|
-
});
|
|
15988
|
-
postToParentRef.current({ type: "ow:change", nodes: [{ key, text: markup }] });
|
|
15989
|
-
};
|
|
15990
15032
|
const handleImageUrl = (e) => {
|
|
15991
15033
|
if (e.data?.type !== "ow:image-url") return;
|
|
15992
15034
|
const { key, url } = e.data;
|
|
@@ -16126,8 +15168,6 @@ function OhhwellsBridge() {
|
|
|
16126
15168
|
continue;
|
|
16127
15169
|
}
|
|
16128
15170
|
if (key === AI_SECTIONS_KEY) continue;
|
|
16129
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
16130
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
16131
15171
|
if (applyVideoSettingNode(key, val)) continue;
|
|
16132
15172
|
if (applyCarouselNode(key, val)) continue;
|
|
16133
15173
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -16147,8 +15187,6 @@ function OhhwellsBridge() {
|
|
|
16147
15187
|
});
|
|
16148
15188
|
applyLinkByKey(key, val);
|
|
16149
15189
|
}
|
|
16150
|
-
applyLogoFromContent(content);
|
|
16151
|
-
applyLogoSizes(content);
|
|
16152
15190
|
if (sectionsJson) {
|
|
16153
15191
|
initSectionsFromContent({ __ohw_sections: sectionsJson }, true);
|
|
16154
15192
|
sectionsLoadedRef.current = true;
|
|
@@ -16163,58 +15201,6 @@ function OhhwellsBridge() {
|
|
|
16163
15201
|
if (hydratedHeight > 50) postToParentRef.current({ type: "ow:height", height: hydratedHeight });
|
|
16164
15202
|
postToParentRef.current({ type: "ow:hydrate-done" });
|
|
16165
15203
|
};
|
|
16166
|
-
const handleUpdateLogoIdentity = (e) => {
|
|
16167
|
-
if (e.data?.type !== "ow:update-logo-identity") return;
|
|
16168
|
-
const rawText = typeof e.data.text === "string" ? e.data.text : "";
|
|
16169
|
-
const alt = typeof e.data.alt === "string" ? e.data.alt : rawText;
|
|
16170
|
-
const href = typeof e.data.href === "string" ? e.data.href : void 0;
|
|
16171
|
-
const imageProvided = "image" in e.data;
|
|
16172
|
-
const imageUrl = imageProvided && typeof e.data.image === "string" && e.data.image.trim() ? e.data.image.trim() : imageProvided ? null : void 0;
|
|
16173
|
-
let isPlaceholder = e.data.isPlaceholder !== false;
|
|
16174
|
-
if (imageUrl) isPlaceholder = false;
|
|
16175
|
-
else if (imageProvided && imageUrl === null) {
|
|
16176
|
-
isPlaceholder = e.data.isPlaceholder === true || !rawText.trim() || resolveLogoDisplayText(rawText) === PLACEHOLDER_BUSINESS_NAME;
|
|
16177
|
-
}
|
|
16178
|
-
const display = applyLogoIdentity(rawText, isPlaceholder);
|
|
16179
|
-
const displayAlt = resolveLogoDisplayText(alt || display);
|
|
16180
|
-
if (imageUrl !== void 0) {
|
|
16181
|
-
applyLogoImage(imageUrl, displayAlt);
|
|
16182
|
-
} else {
|
|
16183
|
-
for (const key of LOGO_IMAGE_KEYS) {
|
|
16184
|
-
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
16185
|
-
const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
|
|
16186
|
-
if (img) img.alt = displayAlt;
|
|
16187
|
-
});
|
|
16188
|
-
}
|
|
16189
|
-
}
|
|
16190
|
-
if (href !== void 0) {
|
|
16191
|
-
applyLogoHref(href);
|
|
16192
|
-
applyLinkByKey("nav-logo-href", href);
|
|
16193
|
-
applyLinkByKey("footer-logo-href", href);
|
|
16194
|
-
applyLinkByKey("logo-href", href);
|
|
16195
|
-
}
|
|
16196
|
-
const nodes = [
|
|
16197
|
-
...LOGO_TEXT_KEYS.map((key) => ({ key, text: display })),
|
|
16198
|
-
{ key: LOGO_PLACEHOLDER_KEY, text: isPlaceholder ? "true" : "false" },
|
|
16199
|
-
{ key: LOGO_ALT_KEY, text: displayAlt }
|
|
16200
|
-
];
|
|
16201
|
-
if (imageUrl !== void 0) {
|
|
16202
|
-
if (imageUrl) {
|
|
16203
|
-
for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: imageUrl });
|
|
16204
|
-
} else {
|
|
16205
|
-
for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: "" });
|
|
16206
|
-
}
|
|
16207
|
-
}
|
|
16208
|
-
if (href !== void 0) {
|
|
16209
|
-
for (const key of LOGO_HREF_KEYS) nodes.push({ key, text: href.trim() || "/" });
|
|
16210
|
-
}
|
|
16211
|
-
editContentRef.current = {
|
|
16212
|
-
...editContentRef.current,
|
|
16213
|
-
...Object.fromEntries(nodes.map(({ key, text }) => [key, text]))
|
|
16214
|
-
};
|
|
16215
|
-
applyLogoSizes(editContentRef.current);
|
|
16216
|
-
postToParentRef.current({ type: "ow:change", nodes });
|
|
16217
|
-
};
|
|
16218
15204
|
window.addEventListener("message", handleHydrate);
|
|
16219
15205
|
const postAiSectionsChanged = () => {
|
|
16220
15206
|
postToParentRef.current({
|
|
@@ -16279,12 +15265,6 @@ function OhhwellsBridge() {
|
|
|
16279
15265
|
closeLinkPopoverRef.current();
|
|
16280
15266
|
return;
|
|
16281
15267
|
}
|
|
16282
|
-
if (floatingPanelOpenRef.current) {
|
|
16283
|
-
setFloatingPanelRef.current(null);
|
|
16284
|
-
deselectRef.current();
|
|
16285
|
-
deactivateRef.current();
|
|
16286
|
-
return;
|
|
16287
|
-
}
|
|
16288
15268
|
deselectRef.current();
|
|
16289
15269
|
deactivateRef.current();
|
|
16290
15270
|
};
|
|
@@ -16304,10 +15284,6 @@ function OhhwellsBridge() {
|
|
|
16304
15284
|
closeLinkPopoverRef.current();
|
|
16305
15285
|
return;
|
|
16306
15286
|
}
|
|
16307
|
-
if (floatingPanelOpenRef.current) {
|
|
16308
|
-
closeFloatingPanelOnlyRef.current();
|
|
16309
|
-
return;
|
|
16310
|
-
}
|
|
16311
15287
|
if (activeElRef.current) {
|
|
16312
15288
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
16313
15289
|
const navAnchor = hrefCtx ? getNavigationItemAnchor(hrefCtx.anchor) : null;
|
|
@@ -16338,10 +15314,6 @@ function OhhwellsBridge() {
|
|
|
16338
15314
|
return;
|
|
16339
15315
|
}
|
|
16340
15316
|
if (selectedElRef.current) {
|
|
16341
|
-
if (toolbarVariantRef.current === "logo") {
|
|
16342
|
-
deselectRef.current();
|
|
16343
|
-
return;
|
|
16344
|
-
}
|
|
16345
15317
|
if (toolbarVariantRef.current === "select-frame") {
|
|
16346
15318
|
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
16347
15319
|
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
@@ -16375,16 +15347,7 @@ function OhhwellsBridge() {
|
|
|
16375
15347
|
closeLinkPopoverRef.current();
|
|
16376
15348
|
return;
|
|
16377
15349
|
}
|
|
16378
|
-
if (e.key === "Escape" && floatingPanelOpenRef.current) {
|
|
16379
|
-
e.preventDefault();
|
|
16380
|
-
closeFloatingPanelOnlyRef.current();
|
|
16381
|
-
return;
|
|
16382
|
-
}
|
|
16383
15350
|
if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
|
|
16384
|
-
if (toolbarVariantRef.current === "logo") {
|
|
16385
|
-
deselectRef.current();
|
|
16386
|
-
return;
|
|
16387
|
-
}
|
|
16388
15351
|
if (toolbarVariantRef.current === "select-frame") {
|
|
16389
15352
|
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
16390
15353
|
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
@@ -16462,8 +15425,7 @@ function OhhwellsBridge() {
|
|
|
16462
15425
|
const handleScroll = () => {
|
|
16463
15426
|
const focusEl = activeElRef.current ?? selectedElRef.current;
|
|
16464
15427
|
if (focusEl) {
|
|
16465
|
-
const
|
|
16466
|
-
const r2 = measureEl ? measureEl.getBoundingClientRect() : toolbarVariantRef.current === "logo" ? getLogoInteractionRect(focusEl) : focusEl.getBoundingClientRect();
|
|
15428
|
+
const r2 = activeElRef.current ? getEditMeasureEl(activeElRef.current).getBoundingClientRect() : focusEl.getBoundingClientRect();
|
|
16467
15429
|
applyToolbarPos(r2);
|
|
16468
15430
|
setToolbarRect(r2);
|
|
16469
15431
|
setMaxBadge((prev) => prev && activeElRef.current ? { ...prev, rect: r2 } : prev);
|
|
@@ -16473,9 +15435,7 @@ function OhhwellsBridge() {
|
|
|
16473
15435
|
setToggleState((prev) => prev ? { ...prev, rect } : null);
|
|
16474
15436
|
}
|
|
16475
15437
|
if (hoveredItemElRef.current) {
|
|
16476
|
-
|
|
16477
|
-
const logo = getLogoElement(hoverEl);
|
|
16478
|
-
setHoveredItemRect(logo ? getLogoInteractionRect(logo) : hoverEl.getBoundingClientRect());
|
|
15438
|
+
setHoveredItemRect(hoveredItemElRef.current.getBoundingClientRect());
|
|
16479
15439
|
}
|
|
16480
15440
|
if (hoveredNavContainerRef.current) {
|
|
16481
15441
|
setHoveredNavContainerRect(hoveredNavContainerRef.current.getBoundingClientRect());
|
|
@@ -16529,12 +15489,8 @@ function OhhwellsBridge() {
|
|
|
16529
15489
|
if (inserted) {
|
|
16530
15490
|
const tracker = getSectionsTracker();
|
|
16531
15491
|
postToParentRef.current({ type: "ow:change", nodes: [{ key: "__ohw_sections", text: tracker.textContent ?? "[]" }] });
|
|
16532
|
-
const
|
|
16533
|
-
|
|
16534
|
-
if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
|
|
16535
|
-
};
|
|
16536
|
-
reportHeight();
|
|
16537
|
-
setTimeout(reportHeight, 500);
|
|
15492
|
+
const h = document.documentElement.scrollHeight;
|
|
15493
|
+
if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
|
|
16538
15494
|
}
|
|
16539
15495
|
};
|
|
16540
15496
|
const handleSwitchSchedule = (e) => {
|
|
@@ -16727,17 +15683,13 @@ function OhhwellsBridge() {
|
|
|
16727
15683
|
if (e.data?.type !== "ow:parent-scroll") return;
|
|
16728
15684
|
const { iframeOffsetTop, headerH, canvasH } = e.data;
|
|
16729
15685
|
parentScrollRef.current = { iframeOffsetTop, headerH, canvasH };
|
|
16730
|
-
if (floatingPanelOpenRef.current) {
|
|
16731
|
-
setParentScrollSnap({ iframeOffsetTop, headerH, canvasH });
|
|
16732
|
-
}
|
|
16733
15686
|
if (visibleViewportRef.current) {
|
|
16734
15687
|
applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
|
|
16735
15688
|
}
|
|
16736
15689
|
const focusEl = activeElRef.current ?? selectedElRef.current;
|
|
16737
15690
|
if (focusEl) {
|
|
16738
|
-
const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) :
|
|
16739
|
-
|
|
16740
|
-
applyToolbarPos(r2);
|
|
15691
|
+
const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : focusEl;
|
|
15692
|
+
applyToolbarPos(measureEl.getBoundingClientRect());
|
|
16741
15693
|
}
|
|
16742
15694
|
};
|
|
16743
15695
|
const handleClickAt = (e) => {
|
|
@@ -16762,25 +15714,6 @@ function OhhwellsBridge() {
|
|
|
16762
15714
|
postToParentRef.current({ type: "ow:image-pick", key: stateCardImage.dataset.ohwKey ?? "", elementType: stateCardImage.dataset.ohwEditable ?? "image" });
|
|
16763
15715
|
return;
|
|
16764
15716
|
}
|
|
16765
|
-
const logoAtPoint = Array.from(
|
|
16766
|
-
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]')
|
|
16767
|
-
).map((el) => getLogoElement(el)).find((logo) => {
|
|
16768
|
-
if (!logo) return false;
|
|
16769
|
-
const r2 = logo.getBoundingClientRect();
|
|
16770
|
-
return clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
|
|
16771
|
-
});
|
|
16772
|
-
if (logoAtPoint) {
|
|
16773
|
-
if (!logoHasUploadedImage(logoAtPoint)) {
|
|
16774
|
-
deselectRef.current();
|
|
16775
|
-
deactivateRef.current();
|
|
16776
|
-
const identity = readLogoIdentityFromDom();
|
|
16777
|
-
postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
|
|
16778
|
-
return;
|
|
16779
|
-
}
|
|
16780
|
-
selectLogoRef.current(logoAtPoint);
|
|
16781
|
-
openLogoSizePanelRef.current(logoAtPoint);
|
|
16782
|
-
return;
|
|
16783
|
-
}
|
|
16784
15717
|
const textEditable = Array.from(
|
|
16785
15718
|
document.querySelectorAll(NON_MEDIA_SELECTOR)
|
|
16786
15719
|
).find((el) => {
|
|
@@ -16842,7 +15775,6 @@ function OhhwellsBridge() {
|
|
|
16842
15775
|
window.addEventListener("message", handleClearSchedulingWidget);
|
|
16843
15776
|
window.addEventListener("message", handleRemoveSchedulingSection);
|
|
16844
15777
|
window.addEventListener("message", handleCollectSection);
|
|
16845
|
-
window.addEventListener("message", handleIconMarkup);
|
|
16846
15778
|
window.addEventListener("message", handleImageUrl);
|
|
16847
15779
|
window.addEventListener("message", handleImageUploading);
|
|
16848
15780
|
window.addEventListener("message", handleCarouselChange);
|
|
@@ -16850,14 +15782,6 @@ function OhhwellsBridge() {
|
|
|
16850
15782
|
window.addEventListener("message", handleParentScroll);
|
|
16851
15783
|
window.addEventListener("message", handlePointerSync);
|
|
16852
15784
|
window.addEventListener("message", handleClickAt);
|
|
16853
|
-
window.addEventListener("message", handleUpdateLogoIdentity);
|
|
16854
|
-
const handleViewMode = (e) => {
|
|
16855
|
-
if (e.data?.type !== "ow:view-mode") return;
|
|
16856
|
-
const mode = e.data.mode === "Mobile" || e.data.mode === "mobile" ? "mobile" : "desktop";
|
|
16857
|
-
setEditorViewport(mode);
|
|
16858
|
-
applyLogoSizes(editContentRef.current);
|
|
16859
|
-
};
|
|
16860
|
-
window.addEventListener("message", handleViewMode);
|
|
16861
15785
|
const handleViewportResize = () => {
|
|
16862
15786
|
if (visibleViewportRef.current) {
|
|
16863
15787
|
applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
|
|
@@ -16902,7 +15826,6 @@ function OhhwellsBridge() {
|
|
|
16902
15826
|
window.removeEventListener("message", handleClearSchedulingWidget);
|
|
16903
15827
|
window.removeEventListener("message", handleRemoveSchedulingSection);
|
|
16904
15828
|
window.removeEventListener("message", handleCollectSection);
|
|
16905
|
-
window.removeEventListener("message", handleIconMarkup);
|
|
16906
15829
|
window.removeEventListener("message", handleImageUrl);
|
|
16907
15830
|
window.removeEventListener("message", handleImageUploading);
|
|
16908
15831
|
window.removeEventListener("message", handleCarouselChange);
|
|
@@ -16911,8 +15834,6 @@ function OhhwellsBridge() {
|
|
|
16911
15834
|
window.removeEventListener("resize", handleViewportResize);
|
|
16912
15835
|
window.removeEventListener("message", handlePointerSync);
|
|
16913
15836
|
window.removeEventListener("message", handleClickAt);
|
|
16914
|
-
window.removeEventListener("message", handleUpdateLogoIdentity);
|
|
16915
|
-
window.removeEventListener("message", handleViewMode);
|
|
16916
15837
|
window.removeEventListener("message", handleHydrate);
|
|
16917
15838
|
window.removeEventListener("message", handleAiApplyTree);
|
|
16918
15839
|
window.removeEventListener("message", handleAiDeleteSection);
|
|
@@ -16926,7 +15847,7 @@ function OhhwellsBridge() {
|
|
|
16926
15847
|
if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
|
|
16927
15848
|
};
|
|
16928
15849
|
}, [isEditMode, refreshStateRules]);
|
|
16929
|
-
|
|
15850
|
+
useEffect11(() => {
|
|
16930
15851
|
if (!isEditMode) return;
|
|
16931
15852
|
const THRESHOLD = 10;
|
|
16932
15853
|
const resolveWasSelected = (el) => {
|
|
@@ -17080,7 +16001,7 @@ function OhhwellsBridge() {
|
|
|
17080
16001
|
unlockFooterDragInteraction();
|
|
17081
16002
|
};
|
|
17082
16003
|
}, [isEditMode]);
|
|
17083
|
-
|
|
16004
|
+
useEffect11(() => {
|
|
17084
16005
|
const handler = (e) => {
|
|
17085
16006
|
if (e.data?.type !== "ow:request-schedule-config") return;
|
|
17086
16007
|
const insertAfterVal = e.data.insertAfter;
|
|
@@ -17096,7 +16017,7 @@ function OhhwellsBridge() {
|
|
|
17096
16017
|
window.addEventListener("message", handler);
|
|
17097
16018
|
return () => window.removeEventListener("message", handler);
|
|
17098
16019
|
}, [processConfigRequest]);
|
|
17099
|
-
|
|
16020
|
+
useEffect11(() => {
|
|
17100
16021
|
if (!isEditMode) return;
|
|
17101
16022
|
document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
|
|
17102
16023
|
el.removeAttribute("data-ohw-active-state");
|
|
@@ -17132,13 +16053,13 @@ function OhhwellsBridge() {
|
|
|
17132
16053
|
clearTimeout(timer);
|
|
17133
16054
|
};
|
|
17134
16055
|
}, [pathname, isEditMode, refreshStateRules, postToParent2]);
|
|
17135
|
-
|
|
16056
|
+
useEffect11(() => {
|
|
17136
16057
|
scrollToHashSectionWhenReady();
|
|
17137
16058
|
const onHashChange = () => scrollToHashSectionWhenReady();
|
|
17138
16059
|
window.addEventListener("hashchange", onHashChange);
|
|
17139
16060
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
17140
16061
|
}, [pathname]);
|
|
17141
|
-
const handleCommand =
|
|
16062
|
+
const handleCommand = useCallback6((cmd) => {
|
|
17142
16063
|
const el = activeElRef.current;
|
|
17143
16064
|
const selBefore = window.getSelection();
|
|
17144
16065
|
let savedOffsets = null;
|
|
@@ -17174,7 +16095,7 @@ function OhhwellsBridge() {
|
|
|
17174
16095
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
17175
16096
|
refreshActiveCommandsRef.current();
|
|
17176
16097
|
}, []);
|
|
17177
|
-
const handleStateChange =
|
|
16098
|
+
const handleStateChange = useCallback6((state) => {
|
|
17178
16099
|
if (!activeStateElRef.current) return;
|
|
17179
16100
|
const el = activeStateElRef.current;
|
|
17180
16101
|
if (state === "Default") {
|
|
@@ -17187,7 +16108,7 @@ function OhhwellsBridge() {
|
|
|
17187
16108
|
}
|
|
17188
16109
|
setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
|
|
17189
16110
|
}, [deactivate]);
|
|
17190
|
-
const reselectAfterLinkPopover =
|
|
16111
|
+
const reselectAfterLinkPopover = useCallback6(
|
|
17191
16112
|
(hrefKey) => {
|
|
17192
16113
|
requestAnimationFrame(() => {
|
|
17193
16114
|
const el = resolveHrefKeyElement(hrefKey);
|
|
@@ -17196,7 +16117,7 @@ function OhhwellsBridge() {
|
|
|
17196
16117
|
},
|
|
17197
16118
|
[resolveHrefKeyElement]
|
|
17198
16119
|
);
|
|
17199
|
-
const closeLinkPopover =
|
|
16120
|
+
const closeLinkPopover = useCallback6(() => {
|
|
17200
16121
|
const session = linkPopoverSessionRef.current;
|
|
17201
16122
|
addNavAfterAnchorRef.current = null;
|
|
17202
16123
|
setLinkPopover(null);
|
|
@@ -17204,9 +16125,9 @@ function OhhwellsBridge() {
|
|
|
17204
16125
|
reselectAfterLinkPopover(session.key);
|
|
17205
16126
|
}
|
|
17206
16127
|
}, [reselectAfterLinkPopover]);
|
|
17207
|
-
const closeLinkPopoverRef =
|
|
16128
|
+
const closeLinkPopoverRef = useRef8(closeLinkPopover);
|
|
17208
16129
|
closeLinkPopoverRef.current = closeLinkPopover;
|
|
17209
|
-
const openLinkPopoverForActive =
|
|
16130
|
+
const openLinkPopoverForActive = useCallback6(() => {
|
|
17210
16131
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
17211
16132
|
if (!hrefCtx) return;
|
|
17212
16133
|
bumpLinkPopoverGrace();
|
|
@@ -17217,7 +16138,7 @@ function OhhwellsBridge() {
|
|
|
17217
16138
|
});
|
|
17218
16139
|
deactivate();
|
|
17219
16140
|
}, [deactivate]);
|
|
17220
|
-
const openLinkPopoverForSelected =
|
|
16141
|
+
const openLinkPopoverForSelected = useCallback6(() => {
|
|
17221
16142
|
const anchor = selectedElRef.current;
|
|
17222
16143
|
if (!anchor) return;
|
|
17223
16144
|
const key = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -17230,7 +16151,7 @@ function OhhwellsBridge() {
|
|
|
17230
16151
|
});
|
|
17231
16152
|
deselect();
|
|
17232
16153
|
}, [deselect]);
|
|
17233
|
-
const handleSelectParent =
|
|
16154
|
+
const handleSelectParent = useCallback6(() => {
|
|
17234
16155
|
const selected = selectedElRef.current;
|
|
17235
16156
|
if (!selected) return;
|
|
17236
16157
|
if (toolbarVariantRef.current === "select-frame") {
|
|
@@ -17257,7 +16178,7 @@ function OhhwellsBridge() {
|
|
|
17257
16178
|
}
|
|
17258
16179
|
deselectRef.current();
|
|
17259
16180
|
}, []);
|
|
17260
|
-
const handleDuplicateSelected =
|
|
16181
|
+
const handleDuplicateSelected = useCallback6(() => {
|
|
17261
16182
|
const selected = selectedElRef.current;
|
|
17262
16183
|
if (!selected || !isNavigationItem2(selected)) return;
|
|
17263
16184
|
const hrefKey = selected.getAttribute("data-ohw-href-key");
|
|
@@ -17347,7 +16268,7 @@ function OhhwellsBridge() {
|
|
|
17347
16268
|
});
|
|
17348
16269
|
}
|
|
17349
16270
|
}, [postToParent2]);
|
|
17350
|
-
const runPendingDeleteUndo =
|
|
16271
|
+
const runPendingDeleteUndo = useCallback6(() => {
|
|
17351
16272
|
const pending = pendingDeleteUndoRef.current;
|
|
17352
16273
|
if (!pending) return false;
|
|
17353
16274
|
pendingDeleteUndoRef.current = null;
|
|
@@ -17355,7 +16276,7 @@ function OhhwellsBridge() {
|
|
|
17355
16276
|
enforceLinkHrefs();
|
|
17356
16277
|
return true;
|
|
17357
16278
|
}, []);
|
|
17358
|
-
const handleDeleteSelected =
|
|
16279
|
+
const handleDeleteSelected = useCallback6(() => {
|
|
17359
16280
|
const selected = selectedElRef.current;
|
|
17360
16281
|
if (!selected) return false;
|
|
17361
16282
|
return deleteSelectedNavFooterItem({
|
|
@@ -17376,7 +16297,7 @@ function OhhwellsBridge() {
|
|
|
17376
16297
|
}, [postToParent2]);
|
|
17377
16298
|
handleDeleteSelectedRef.current = handleDeleteSelected;
|
|
17378
16299
|
runPendingDeleteUndoRef.current = runPendingDeleteUndo;
|
|
17379
|
-
const handleLinkPopoverSubmit =
|
|
16300
|
+
const handleLinkPopoverSubmit = useCallback6(
|
|
17380
16301
|
(target) => {
|
|
17381
16302
|
const session = linkPopoverSessionRef.current;
|
|
17382
16303
|
if (!session) return;
|
|
@@ -17442,19 +16363,19 @@ function OhhwellsBridge() {
|
|
|
17442
16363
|
const showEditLink = toolbarShowEditLink;
|
|
17443
16364
|
const currentSections = sectionsByPath[pathname] ?? [];
|
|
17444
16365
|
linkPopoverOpenRef.current = linkPopover !== null;
|
|
17445
|
-
const handleMediaReplace =
|
|
16366
|
+
const handleMediaReplace = useCallback6(
|
|
17446
16367
|
(key) => {
|
|
17447
16368
|
postToParent2({ type: "ow:image-pick", key, elementType: mediaHover?.elementType ?? "image" });
|
|
17448
16369
|
},
|
|
17449
16370
|
[postToParent2, mediaHover?.elementType]
|
|
17450
16371
|
);
|
|
17451
|
-
const handleEditCarousel =
|
|
16372
|
+
const handleEditCarousel = useCallback6(
|
|
17452
16373
|
(key) => {
|
|
17453
16374
|
postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
|
|
17454
16375
|
},
|
|
17455
16376
|
[postToParent2]
|
|
17456
16377
|
);
|
|
17457
|
-
const handleMediaFadeOutComplete =
|
|
16378
|
+
const handleMediaFadeOutComplete = useCallback6((key) => {
|
|
17458
16379
|
setUploadingRects((prev) => {
|
|
17459
16380
|
if (!(key in prev)) return prev;
|
|
17460
16381
|
const next = { ...prev };
|
|
@@ -17462,7 +16383,7 @@ function OhhwellsBridge() {
|
|
|
17462
16383
|
return next;
|
|
17463
16384
|
});
|
|
17464
16385
|
}, []);
|
|
17465
|
-
const handleVideoSettingsChange =
|
|
16386
|
+
const handleVideoSettingsChange = useCallback6(
|
|
17466
16387
|
(key, settings) => {
|
|
17467
16388
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
17468
16389
|
const video = getVideoEl2(el);
|
|
@@ -17485,10 +16406,10 @@ function OhhwellsBridge() {
|
|
|
17485
16406
|
[postToParent2]
|
|
17486
16407
|
);
|
|
17487
16408
|
return bridgeRoot ? createPortal2(
|
|
17488
|
-
/* @__PURE__ */
|
|
17489
|
-
/* @__PURE__ */
|
|
17490
|
-
isEditMode && /* @__PURE__ */
|
|
17491
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */
|
|
16409
|
+
/* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
16410
|
+
/* @__PURE__ */ jsx30("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
16411
|
+
isEditMode && /* @__PURE__ */ jsx30(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
|
|
16412
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ jsx30(
|
|
17492
16413
|
MediaOverlay,
|
|
17493
16414
|
{
|
|
17494
16415
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -17499,7 +16420,7 @@ function OhhwellsBridge() {
|
|
|
17499
16420
|
},
|
|
17500
16421
|
`uploading-${key}`
|
|
17501
16422
|
)),
|
|
17502
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */
|
|
16423
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ jsx30(
|
|
17503
16424
|
MediaOverlay,
|
|
17504
16425
|
{
|
|
17505
16426
|
hover: mediaHover,
|
|
@@ -17508,11 +16429,11 @@ function OhhwellsBridge() {
|
|
|
17508
16429
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
17509
16430
|
}
|
|
17510
16431
|
),
|
|
17511
|
-
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */
|
|
17512
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */
|
|
17513
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */
|
|
17514
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */
|
|
17515
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */
|
|
16432
|
+
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx30(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
|
|
16433
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ jsx30(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
16434
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ jsx30(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
16435
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ jsx30(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
16436
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ jsx30(
|
|
17516
16437
|
"div",
|
|
17517
16438
|
{
|
|
17518
16439
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -17522,7 +16443,7 @@ function OhhwellsBridge() {
|
|
|
17522
16443
|
width: slot.width,
|
|
17523
16444
|
height: slot.height
|
|
17524
16445
|
},
|
|
17525
|
-
children: /* @__PURE__ */
|
|
16446
|
+
children: /* @__PURE__ */ jsx30(
|
|
17526
16447
|
DropIndicator,
|
|
17527
16448
|
{
|
|
17528
16449
|
direction: slot.direction,
|
|
@@ -17533,7 +16454,7 @@ function OhhwellsBridge() {
|
|
|
17533
16454
|
},
|
|
17534
16455
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
17535
16456
|
)),
|
|
17536
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */
|
|
16457
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ jsx30(
|
|
17537
16458
|
"div",
|
|
17538
16459
|
{
|
|
17539
16460
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -17543,7 +16464,7 @@ function OhhwellsBridge() {
|
|
|
17543
16464
|
width: slot.width,
|
|
17544
16465
|
height: slot.height
|
|
17545
16466
|
},
|
|
17546
|
-
children: /* @__PURE__ */
|
|
16467
|
+
children: /* @__PURE__ */ jsx30(
|
|
17547
16468
|
DropIndicator,
|
|
17548
16469
|
{
|
|
17549
16470
|
direction: slot.direction,
|
|
@@ -17554,10 +16475,10 @@ function OhhwellsBridge() {
|
|
|
17554
16475
|
},
|
|
17555
16476
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
17556
16477
|
)),
|
|
17557
|
-
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */
|
|
17558
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */
|
|
17559
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */
|
|
17560
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */
|
|
16478
|
+
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx30(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
16479
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ jsx30(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
16480
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ jsx30(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
16481
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx30(
|
|
17561
16482
|
FooterContainerChrome,
|
|
17562
16483
|
{
|
|
17563
16484
|
rect: toolbarRect,
|
|
@@ -17565,7 +16486,7 @@ function OhhwellsBridge() {
|
|
|
17565
16486
|
addDisabled: !canAddFooterColumn()
|
|
17566
16487
|
}
|
|
17567
16488
|
),
|
|
17568
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame"
|
|
16489
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx30(
|
|
17569
16490
|
ItemInteractionLayer,
|
|
17570
16491
|
{
|
|
17571
16492
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -17577,10 +16498,10 @@ function OhhwellsBridge() {
|
|
|
17577
16498
|
dragHandleLabel: reorderHrefKey ? `Reorder ${reorderHrefKey}` : "Reorder item",
|
|
17578
16499
|
onDragHandleDragStart: handleItemDragStart,
|
|
17579
16500
|
onDragHandleDragEnd: handleItemDragEnd,
|
|
17580
|
-
onItemPointerDown:
|
|
17581
|
-
onItemClick:
|
|
17582
|
-
itemDragSurface:
|
|
17583
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */
|
|
16501
|
+
onItemPointerDown: handleItemChromePointerDown,
|
|
16502
|
+
onItemClick: handleItemChromeClick,
|
|
16503
|
+
itemDragSurface: !isFooterFrameSelection,
|
|
16504
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */ jsx30(
|
|
17584
16505
|
ItemActionToolbar,
|
|
17585
16506
|
{
|
|
17586
16507
|
onEditLink: openLinkPopoverForSelected,
|
|
@@ -17605,8 +16526,8 @@ function OhhwellsBridge() {
|
|
|
17605
16526
|
) : void 0
|
|
17606
16527
|
}
|
|
17607
16528
|
),
|
|
17608
|
-
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */
|
|
17609
|
-
/* @__PURE__ */
|
|
16529
|
+
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
16530
|
+
/* @__PURE__ */ jsx30(
|
|
17610
16531
|
EditGlowChrome,
|
|
17611
16532
|
{
|
|
17612
16533
|
rect: toolbarRect,
|
|
@@ -17616,7 +16537,7 @@ function OhhwellsBridge() {
|
|
|
17616
16537
|
hideHandle: isItemDragging
|
|
17617
16538
|
}
|
|
17618
16539
|
),
|
|
17619
|
-
/* @__PURE__ */
|
|
16540
|
+
/* @__PURE__ */ jsx30(
|
|
17620
16541
|
FloatingToolbar,
|
|
17621
16542
|
{
|
|
17622
16543
|
rect: toolbarRect,
|
|
@@ -17629,7 +16550,7 @@ function OhhwellsBridge() {
|
|
|
17629
16550
|
}
|
|
17630
16551
|
)
|
|
17631
16552
|
] }),
|
|
17632
|
-
maxBadge && /* @__PURE__ */
|
|
16553
|
+
maxBadge && /* @__PURE__ */ jsxs17(
|
|
17633
16554
|
"div",
|
|
17634
16555
|
{
|
|
17635
16556
|
"data-ohw-max-badge": "",
|
|
@@ -17655,7 +16576,7 @@ function OhhwellsBridge() {
|
|
|
17655
16576
|
]
|
|
17656
16577
|
}
|
|
17657
16578
|
),
|
|
17658
|
-
toggleState && !linkPopover && /* @__PURE__ */
|
|
16579
|
+
toggleState && !linkPopover && /* @__PURE__ */ jsx30(
|
|
17659
16580
|
StateToggle,
|
|
17660
16581
|
{
|
|
17661
16582
|
rect: toggleState.rect,
|
|
@@ -17664,15 +16585,15 @@ function OhhwellsBridge() {
|
|
|
17664
16585
|
onStateChange: handleStateChange
|
|
17665
16586
|
}
|
|
17666
16587
|
),
|
|
17667
|
-
sectionGap && !linkPopover && /* @__PURE__ */
|
|
16588
|
+
sectionGap && !linkPopover && /* @__PURE__ */ jsxs17(
|
|
17668
16589
|
"div",
|
|
17669
16590
|
{
|
|
17670
16591
|
"data-ohw-section-insert-line": "",
|
|
17671
16592
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
17672
16593
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
17673
16594
|
children: [
|
|
17674
|
-
/* @__PURE__ */
|
|
17675
|
-
/* @__PURE__ */
|
|
16595
|
+
/* @__PURE__ */ jsx30("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
16596
|
+
/* @__PURE__ */ jsx30(
|
|
17676
16597
|
Badge,
|
|
17677
16598
|
{
|
|
17678
16599
|
className: "px-8 py-1 bg-primary hover:bg-primary text-primary-foreground text-xs font-medium shrink-0 rounded-full cursor-pointer pointer-events-auto",
|
|
@@ -17689,11 +16610,11 @@ function OhhwellsBridge() {
|
|
|
17689
16610
|
children: "Add Section"
|
|
17690
16611
|
}
|
|
17691
16612
|
),
|
|
17692
|
-
/* @__PURE__ */
|
|
16613
|
+
/* @__PURE__ */ jsx30("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
17693
16614
|
]
|
|
17694
16615
|
}
|
|
17695
16616
|
),
|
|
17696
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */
|
|
16617
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ jsx30(
|
|
17697
16618
|
LinkPopover,
|
|
17698
16619
|
{
|
|
17699
16620
|
panelRef: linkPopoverPanelRef,
|
|
@@ -17709,115 +16630,11 @@ function OhhwellsBridge() {
|
|
|
17709
16630
|
onSubmit: handleLinkPopoverSubmit
|
|
17710
16631
|
},
|
|
17711
16632
|
linkPopover.key
|
|
17712
|
-
) : null,
|
|
17713
|
-
floatingPanel && floatingPanel.kind === "logo-size" && logoSizeDraft ? /* @__PURE__ */ jsx32(
|
|
17714
|
-
FloatingPanel,
|
|
17715
|
-
{
|
|
17716
|
-
open: true,
|
|
17717
|
-
title: floatingPanel.title,
|
|
17718
|
-
context: floatingPanel.context,
|
|
17719
|
-
position: floatingPanelPos,
|
|
17720
|
-
onPositionChange: setFloatingPanelPos,
|
|
17721
|
-
parentScroll: parentScrollSnap ?? parentScrollRef.current,
|
|
17722
|
-
onClose: closeFloatingPanelAndDeselect,
|
|
17723
|
-
children: /* @__PURE__ */ jsx32(
|
|
17724
|
-
LogoSizePanel,
|
|
17725
|
-
{
|
|
17726
|
-
viewport: editorViewport,
|
|
17727
|
-
sizePx: editorViewport === "mobile" && !logoSizeDraft.mobileFollowing ? logoSizeDraft.mobilePx : logoSizeDraft.desktopPx,
|
|
17728
|
-
mobileFollowing: logoSizeDraft.mobileFollowing,
|
|
17729
|
-
onSizeChange: (px) => {
|
|
17730
|
-
const next = editorViewport === "mobile" ? { ...logoSizeDraft, mobilePx: px, mobileFollowing: false } : {
|
|
17731
|
-
...logoSizeDraft,
|
|
17732
|
-
desktopPx: px,
|
|
17733
|
-
mobilePx: logoSizeDraft.mobileFollowing ? px : logoSizeDraft.mobilePx
|
|
17734
|
-
};
|
|
17735
|
-
setLogoSizeDraft(next);
|
|
17736
|
-
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
17737
|
-
},
|
|
17738
|
-
onCustomizeMobile: () => {
|
|
17739
|
-
const next = {
|
|
17740
|
-
...logoSizeDraft,
|
|
17741
|
-
mobileFollowing: false,
|
|
17742
|
-
mobilePx: logoSizeDraft.desktopPx
|
|
17743
|
-
};
|
|
17744
|
-
setLogoSizeDraft(next);
|
|
17745
|
-
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
17746
|
-
},
|
|
17747
|
-
onResetMobile: () => {
|
|
17748
|
-
const next = {
|
|
17749
|
-
...logoSizeDraft,
|
|
17750
|
-
mobileFollowing: true,
|
|
17751
|
-
mobilePx: logoSizeDraft.desktopPx
|
|
17752
|
-
};
|
|
17753
|
-
setLogoSizeDraft(next);
|
|
17754
|
-
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
17755
|
-
},
|
|
17756
|
-
onUpdateEverywhere: () => {
|
|
17757
|
-
const identity = readLogoIdentityFromDom();
|
|
17758
|
-
postToParent2({ type: "ow:open-logo-settings", ...identity });
|
|
17759
|
-
}
|
|
17760
|
-
}
|
|
17761
|
-
)
|
|
17762
|
-
}
|
|
17763
16633
|
) : null
|
|
17764
16634
|
] }),
|
|
17765
16635
|
bridgeRoot
|
|
17766
16636
|
) : null;
|
|
17767
16637
|
}
|
|
17768
|
-
|
|
17769
|
-
// src/ui/EmptySection.tsx
|
|
17770
|
-
import Link4 from "next/link";
|
|
17771
|
-
import { Fragment as Fragment9, jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
17772
|
-
function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
|
|
17773
|
-
return /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
17774
|
-
/* @__PURE__ */ jsx33(
|
|
17775
|
-
"p",
|
|
17776
|
-
{
|
|
17777
|
-
style: {
|
|
17778
|
-
fontFamily: "var(--brand-font-body)",
|
|
17779
|
-
fontSize: "0.75rem",
|
|
17780
|
-
fontWeight: 500,
|
|
17781
|
-
letterSpacing: "0.15em",
|
|
17782
|
-
textTransform: "uppercase",
|
|
17783
|
-
color: "var(--brand-accent)",
|
|
17784
|
-
marginBottom: "1.5rem"
|
|
17785
|
-
},
|
|
17786
|
-
children: /* @__PURE__ */ jsx33(Link4, { href: homeHref, style: { color: "inherit" }, children: /* @__PURE__ */ jsx33("span", { ...eyebrowKey ? { "data-ohw-editable": "text", "data-ohw-key": eyebrowKey } : {}, children: "Home" }) })
|
|
17787
|
-
}
|
|
17788
|
-
),
|
|
17789
|
-
/* @__PURE__ */ jsx33(
|
|
17790
|
-
"h1",
|
|
17791
|
-
{
|
|
17792
|
-
style: {
|
|
17793
|
-
fontFamily: "var(--brand-font-heading)",
|
|
17794
|
-
fontSize: "clamp(2rem, 3.5vw, 2.75rem)",
|
|
17795
|
-
lineHeight: 1.1,
|
|
17796
|
-
letterSpacing: "-0.025em",
|
|
17797
|
-
color: "var(--brand-text)",
|
|
17798
|
-
marginBottom: "1rem"
|
|
17799
|
-
},
|
|
17800
|
-
...titleKey ? { "data-ohw-editable": "text", "data-ohw-key": titleKey, "data-ohw-max-length": 80 } : {},
|
|
17801
|
-
children: title
|
|
17802
|
-
}
|
|
17803
|
-
),
|
|
17804
|
-
/* @__PURE__ */ jsx33(
|
|
17805
|
-
"p",
|
|
17806
|
-
{
|
|
17807
|
-
style: {
|
|
17808
|
-
fontFamily: "var(--brand-font-body)",
|
|
17809
|
-
fontSize: "1rem",
|
|
17810
|
-
lineHeight: 1.7,
|
|
17811
|
-
fontWeight: 300,
|
|
17812
|
-
color: "var(--brand-text-muted)",
|
|
17813
|
-
maxWidth: "340px"
|
|
17814
|
-
},
|
|
17815
|
-
...subtitleKey ? { "data-ohw-editable": "text", "data-ohw-key": subtitleKey, "data-ohw-max-length": 160 } : {},
|
|
17816
|
-
children: "This page doesn't have any content yet."
|
|
17817
|
-
}
|
|
17818
|
-
)
|
|
17819
|
-
] });
|
|
17820
|
-
}
|
|
17821
16638
|
export {
|
|
17822
16639
|
AI_DEFAULT_BRAND,
|
|
17823
16640
|
AI_TREE_SCHEMA_VERSIONS,
|
|
@@ -17834,7 +16651,6 @@ export {
|
|
|
17834
16651
|
DropdownMenuItem,
|
|
17835
16652
|
DropdownMenuSeparator,
|
|
17836
16653
|
DropdownMenuTrigger,
|
|
17837
|
-
EmptySection,
|
|
17838
16654
|
ItemActionToolbar,
|
|
17839
16655
|
ItemInteractionLayer,
|
|
17840
16656
|
LinkEditorPanel,
|