@ohhwells/bridge 0.1.52-next.139 → 0.1.52-next.141
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 +885 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +885 -268
- package/dist/index.js.map +1 -1
- package/dist/styles.css +80 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -69,7 +69,7 @@ __export(index_exports, {
|
|
|
69
69
|
module.exports = __toCommonJS(index_exports);
|
|
70
70
|
|
|
71
71
|
// src/OhhwellsBridge.tsx
|
|
72
|
-
var
|
|
72
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
73
73
|
var import_client = require("react-dom/client");
|
|
74
74
|
var import_react_dom2 = require("react-dom");
|
|
75
75
|
|
|
@@ -9104,7 +9104,8 @@ function applyLogoImage(url, alt) {
|
|
|
9104
9104
|
img.setAttribute("data-ohw-editable", "image");
|
|
9105
9105
|
img.setAttribute("data-ohw-key", imageKey);
|
|
9106
9106
|
img.alt = displayAlt;
|
|
9107
|
-
img.style.
|
|
9107
|
+
img.style.height = "";
|
|
9108
|
+
img.style.maxHeight = "none";
|
|
9108
9109
|
img.style.width = "auto";
|
|
9109
9110
|
img.style.display = "block";
|
|
9110
9111
|
img.style.objectFit = "contain";
|
|
@@ -9192,6 +9193,121 @@ function readLogoIdentityFromDom() {
|
|
|
9192
9193
|
const href = (logoRoot instanceof HTMLAnchorElement ? logoRoot.getAttribute("href") : null) || logoRoot?.closest("a")?.getAttribute("href") || "/";
|
|
9193
9194
|
return { text, isPlaceholder, imageUrl: null, href, alt: text };
|
|
9194
9195
|
}
|
|
9196
|
+
function applyLogoFromContent(content) {
|
|
9197
|
+
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);
|
|
9198
|
+
if (!hasLogoIdentity) return false;
|
|
9199
|
+
const logoText = content[LOGO_TEXT_KEYS[0]] ?? content[LOGO_TEXT_KEYS[1]] ?? readLogoIdentityFromDom().text;
|
|
9200
|
+
const logoAlt = content[LOGO_ALT_KEY] ?? logoText;
|
|
9201
|
+
const rawLogoImage = content[LOGO_IMAGE_URL_KEY] ?? content["footer-logo"] ?? content["footer-logo-image"] ?? null;
|
|
9202
|
+
const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
|
|
9203
|
+
const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
|
|
9204
|
+
const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
|
|
9205
|
+
if (logoImageUrl) {
|
|
9206
|
+
applyLogoImage(logoImageUrl, logoAlt);
|
|
9207
|
+
} else {
|
|
9208
|
+
if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
|
|
9209
|
+
applyLogoIdentity(logoText, logoIsPlaceholder);
|
|
9210
|
+
}
|
|
9211
|
+
const logoHref = content["nav-logo-href"] ?? content["footer-logo-href"] ?? content["logo-href"];
|
|
9212
|
+
if (typeof logoHref === "string" && logoHref.trim()) {
|
|
9213
|
+
applyLogoHref(logoHref);
|
|
9214
|
+
}
|
|
9215
|
+
return true;
|
|
9216
|
+
}
|
|
9217
|
+
|
|
9218
|
+
// src/lib/logo-size.ts
|
|
9219
|
+
var LOGO_SIZE_DEFAULTS = {
|
|
9220
|
+
navbar: 28,
|
|
9221
|
+
footer: 32
|
|
9222
|
+
};
|
|
9223
|
+
var LOGO_SIZE_MIN = 16;
|
|
9224
|
+
var LOGO_SIZE_MAX = 80;
|
|
9225
|
+
var LOGO_SIZE_DESKTOP_KEYS = {
|
|
9226
|
+
navbar: "nav-logo-size",
|
|
9227
|
+
footer: "footer-logo-size"
|
|
9228
|
+
};
|
|
9229
|
+
var LOGO_SIZE_MOBILE_KEYS = {
|
|
9230
|
+
navbar: "nav-logo-size-mobile",
|
|
9231
|
+
footer: "footer-logo-size-mobile"
|
|
9232
|
+
};
|
|
9233
|
+
var LOGO_SIZE_KEYS = [
|
|
9234
|
+
LOGO_SIZE_DESKTOP_KEYS.navbar,
|
|
9235
|
+
LOGO_SIZE_DESKTOP_KEYS.footer,
|
|
9236
|
+
LOGO_SIZE_MOBILE_KEYS.navbar,
|
|
9237
|
+
LOGO_SIZE_MOBILE_KEYS.footer
|
|
9238
|
+
];
|
|
9239
|
+
function isFooterLogoRoot2(root) {
|
|
9240
|
+
return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
|
|
9241
|
+
}
|
|
9242
|
+
function getLogoPlacement(root) {
|
|
9243
|
+
return isFooterLogoRoot2(root) ? "footer" : "navbar";
|
|
9244
|
+
}
|
|
9245
|
+
function parseLogoSizePx(raw, fallback) {
|
|
9246
|
+
if (raw == null || raw === "") return fallback;
|
|
9247
|
+
const n = Number.parseFloat(raw);
|
|
9248
|
+
if (!Number.isFinite(n)) return fallback;
|
|
9249
|
+
return Math.min(LOGO_SIZE_MAX, Math.max(LOGO_SIZE_MIN, Math.round(n)));
|
|
9250
|
+
}
|
|
9251
|
+
function isMobileLogoSizeFollowing(content, placement) {
|
|
9252
|
+
const raw = content[LOGO_SIZE_MOBILE_KEYS[placement]];
|
|
9253
|
+
return raw == null || raw.trim() === "";
|
|
9254
|
+
}
|
|
9255
|
+
function resolveDesktopLogoSize(content, placement) {
|
|
9256
|
+
return parseLogoSizePx(content[LOGO_SIZE_DESKTOP_KEYS[placement]], LOGO_SIZE_DEFAULTS[placement]);
|
|
9257
|
+
}
|
|
9258
|
+
function resolveMobileLogoSize(content, placement) {
|
|
9259
|
+
if (isMobileLogoSizeFollowing(content, placement)) {
|
|
9260
|
+
return resolveDesktopLogoSize(content, placement);
|
|
9261
|
+
}
|
|
9262
|
+
return parseLogoSizePx(
|
|
9263
|
+
content[LOGO_SIZE_MOBILE_KEYS[placement]],
|
|
9264
|
+
resolveDesktopLogoSize(content, placement)
|
|
9265
|
+
);
|
|
9266
|
+
}
|
|
9267
|
+
function setRootSizeVars(root, desktopPx, mobilePx, following) {
|
|
9268
|
+
root.style.setProperty("--ohw-logo-size", `${desktopPx}px`);
|
|
9269
|
+
if (following) {
|
|
9270
|
+
root.style.removeProperty("--ohw-logo-size-mobile");
|
|
9271
|
+
} else {
|
|
9272
|
+
root.style.setProperty("--ohw-logo-size-mobile", `${mobilePx}px`);
|
|
9273
|
+
}
|
|
9274
|
+
root.querySelectorAll("img").forEach((img) => {
|
|
9275
|
+
img.style.height = "";
|
|
9276
|
+
img.style.maxHeight = "none";
|
|
9277
|
+
img.style.width = "auto";
|
|
9278
|
+
img.style.objectFit = "contain";
|
|
9279
|
+
});
|
|
9280
|
+
}
|
|
9281
|
+
function applyLogoSizes(content) {
|
|
9282
|
+
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
9283
|
+
const placement = getLogoPlacement(root);
|
|
9284
|
+
const desktop = resolveDesktopLogoSize(content, placement);
|
|
9285
|
+
const following = isMobileLogoSizeFollowing(content, placement);
|
|
9286
|
+
const mobile = following ? desktop : resolveMobileLogoSize(content, placement);
|
|
9287
|
+
setRootSizeVars(root, desktop, mobile, following);
|
|
9288
|
+
});
|
|
9289
|
+
}
|
|
9290
|
+
function applyLogoSizeToPlacement(placement, desktopPx, mobilePx, following) {
|
|
9291
|
+
document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
|
|
9292
|
+
if (getLogoPlacement(root) !== placement) return;
|
|
9293
|
+
setRootSizeVars(root, desktopPx, mobilePx, following);
|
|
9294
|
+
});
|
|
9295
|
+
}
|
|
9296
|
+
function logoHasUploadedImage(logoEl) {
|
|
9297
|
+
if (logoEl.hasAttribute("data-ohw-placeholder")) return false;
|
|
9298
|
+
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");
|
|
9299
|
+
if (!img) return false;
|
|
9300
|
+
const src = img.getAttribute("src")?.trim() ?? "";
|
|
9301
|
+
if (!src || src.startsWith("data:")) return false;
|
|
9302
|
+
if (img.style.display === "none") return false;
|
|
9303
|
+
return true;
|
|
9304
|
+
}
|
|
9305
|
+
function readLogoSizeState(content, placement) {
|
|
9306
|
+
const desktopPx = resolveDesktopLogoSize(content, placement);
|
|
9307
|
+
const mobileFollowing = isMobileLogoSizeFollowing(content, placement);
|
|
9308
|
+
const mobilePx = mobileFollowing ? desktopPx : resolveMobileLogoSize(content, placement);
|
|
9309
|
+
return { desktopPx, mobilePx, mobileFollowing };
|
|
9310
|
+
}
|
|
9195
9311
|
|
|
9196
9312
|
// src/lib/site-wide-scope.ts
|
|
9197
9313
|
function getLogoElement(el) {
|
|
@@ -9262,6 +9378,292 @@ function addFooterColumnWithPersist({
|
|
|
9262
9378
|
return result;
|
|
9263
9379
|
}
|
|
9264
9380
|
|
|
9381
|
+
// src/ui/FloatingPanel.tsx
|
|
9382
|
+
var import_react12 = require("react");
|
|
9383
|
+
var import_lucide_react12 = require("lucide-react");
|
|
9384
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
9385
|
+
var PANEL_WIDTH = 256;
|
|
9386
|
+
var EDGE_MARGIN = 16;
|
|
9387
|
+
function getVisibleClip(parentScroll) {
|
|
9388
|
+
const left = 0;
|
|
9389
|
+
const right = window.innerWidth;
|
|
9390
|
+
if (!parentScroll) {
|
|
9391
|
+
return { top: 0, bottom: window.innerHeight, left, right };
|
|
9392
|
+
}
|
|
9393
|
+
const { iframeOffsetTop, headerH: visibleCanvasTop, canvasH } = parentScroll;
|
|
9394
|
+
const top = Math.max(0, visibleCanvasTop - iframeOffsetTop);
|
|
9395
|
+
const bottom = Math.min(window.innerHeight, visibleCanvasTop + canvasH - iframeOffsetTop);
|
|
9396
|
+
return { top, bottom: Math.max(top, bottom), left, right };
|
|
9397
|
+
}
|
|
9398
|
+
function defaultFloatingPanelPosition(parentScroll, panelHeight = 280) {
|
|
9399
|
+
const clip = getVisibleClip(parentScroll);
|
|
9400
|
+
return {
|
|
9401
|
+
x: Math.max(EDGE_MARGIN, clip.right - PANEL_WIDTH - EDGE_MARGIN),
|
|
9402
|
+
y: Math.min(
|
|
9403
|
+
Math.max(clip.top + EDGE_MARGIN, EDGE_MARGIN),
|
|
9404
|
+
Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelHeight - EDGE_MARGIN)
|
|
9405
|
+
)
|
|
9406
|
+
};
|
|
9407
|
+
}
|
|
9408
|
+
function clampPosition(pos, parentScroll, panelW, panelH) {
|
|
9409
|
+
const clip = getVisibleClip(parentScroll);
|
|
9410
|
+
const maxX = Math.max(clip.left + EDGE_MARGIN, clip.right - panelW - EDGE_MARGIN);
|
|
9411
|
+
const maxY = Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelH - EDGE_MARGIN);
|
|
9412
|
+
return {
|
|
9413
|
+
x: Math.min(Math.max(pos.x, clip.left + EDGE_MARGIN), maxX),
|
|
9414
|
+
y: Math.min(Math.max(pos.y, clip.top + EDGE_MARGIN), maxY)
|
|
9415
|
+
};
|
|
9416
|
+
}
|
|
9417
|
+
function FloatingPanel({
|
|
9418
|
+
open,
|
|
9419
|
+
title,
|
|
9420
|
+
context,
|
|
9421
|
+
icon,
|
|
9422
|
+
onClose,
|
|
9423
|
+
children,
|
|
9424
|
+
position,
|
|
9425
|
+
onPositionChange,
|
|
9426
|
+
parentScroll = null,
|
|
9427
|
+
className,
|
|
9428
|
+
bodyClassName
|
|
9429
|
+
}) {
|
|
9430
|
+
const panelRef = (0, import_react12.useRef)(null);
|
|
9431
|
+
const [measured, setMeasured] = (0, import_react12.useState)({ w: PANEL_WIDTH, h: 280 });
|
|
9432
|
+
const dragRef = (0, import_react12.useRef)(null);
|
|
9433
|
+
const resolved = position ?? defaultFloatingPanelPosition(parentScroll, measured.h);
|
|
9434
|
+
const clamped = clampPosition(resolved, parentScroll, measured.w, measured.h);
|
|
9435
|
+
(0, import_react12.useLayoutEffect)(() => {
|
|
9436
|
+
if (!open || !panelRef.current) return;
|
|
9437
|
+
const el = panelRef.current;
|
|
9438
|
+
const next = { w: el.offsetWidth || PANEL_WIDTH, h: el.offsetHeight || 280 };
|
|
9439
|
+
setMeasured((prev) => prev.w === next.w && prev.h === next.h ? prev : next);
|
|
9440
|
+
}, [open, children, title, context]);
|
|
9441
|
+
(0, import_react12.useEffect)(() => {
|
|
9442
|
+
if (!open || !position || !onPositionChange) return;
|
|
9443
|
+
const next = clampPosition(position, parentScroll, measured.w, measured.h);
|
|
9444
|
+
if (next.x !== position.x || next.y !== position.y) onPositionChange(next);
|
|
9445
|
+
}, [open, parentScroll, measured.w, measured.h, position, onPositionChange]);
|
|
9446
|
+
const onHeaderPointerDown = (0, import_react12.useCallback)(
|
|
9447
|
+
(e) => {
|
|
9448
|
+
if (e.button !== 0) return;
|
|
9449
|
+
if (e.target.closest("[data-ohw-floating-panel-close]")) return;
|
|
9450
|
+
e.preventDefault();
|
|
9451
|
+
e.stopPropagation();
|
|
9452
|
+
const el = e.currentTarget;
|
|
9453
|
+
el.setPointerCapture(e.pointerId);
|
|
9454
|
+
dragRef.current = {
|
|
9455
|
+
pointerId: e.pointerId,
|
|
9456
|
+
startX: e.clientX,
|
|
9457
|
+
startY: e.clientY,
|
|
9458
|
+
originX: clamped.x,
|
|
9459
|
+
originY: clamped.y
|
|
9460
|
+
};
|
|
9461
|
+
},
|
|
9462
|
+
[clamped.x, clamped.y]
|
|
9463
|
+
);
|
|
9464
|
+
const onHeaderPointerMove = (0, import_react12.useCallback)(
|
|
9465
|
+
(e) => {
|
|
9466
|
+
const drag = dragRef.current;
|
|
9467
|
+
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
9468
|
+
e.preventDefault();
|
|
9469
|
+
const next = clampPosition(
|
|
9470
|
+
{
|
|
9471
|
+
x: drag.originX + (e.clientX - drag.startX),
|
|
9472
|
+
y: drag.originY + (e.clientY - drag.startY)
|
|
9473
|
+
},
|
|
9474
|
+
parentScroll,
|
|
9475
|
+
measured.w,
|
|
9476
|
+
measured.h
|
|
9477
|
+
);
|
|
9478
|
+
onPositionChange?.(next);
|
|
9479
|
+
},
|
|
9480
|
+
[measured.h, measured.w, onPositionChange, parentScroll]
|
|
9481
|
+
);
|
|
9482
|
+
const endDrag = (0, import_react12.useCallback)((e) => {
|
|
9483
|
+
const drag = dragRef.current;
|
|
9484
|
+
if (!drag || drag.pointerId !== e.pointerId) return;
|
|
9485
|
+
dragRef.current = null;
|
|
9486
|
+
try {
|
|
9487
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
9488
|
+
} catch {
|
|
9489
|
+
}
|
|
9490
|
+
}, []);
|
|
9491
|
+
if (!open) return null;
|
|
9492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
9493
|
+
"div",
|
|
9494
|
+
{
|
|
9495
|
+
ref: panelRef,
|
|
9496
|
+
"data-ohw-floating-panel": "",
|
|
9497
|
+
role: "dialog",
|
|
9498
|
+
"aria-label": title,
|
|
9499
|
+
className: cn(
|
|
9500
|
+
"fixed z-[2147483645] flex w-64 flex-col overflow-hidden rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
9501
|
+
className
|
|
9502
|
+
),
|
|
9503
|
+
style: { left: clamped.x, top: clamped.y },
|
|
9504
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
9505
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
9506
|
+
onClick: (e) => e.stopPropagation(),
|
|
9507
|
+
children: [
|
|
9508
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
9509
|
+
"div",
|
|
9510
|
+
{
|
|
9511
|
+
"data-ohw-floating-panel-header": "",
|
|
9512
|
+
className: "relative flex cursor-grab items-start gap-2 border-b border-border py-5 pl-5 pr-11 active:cursor-grabbing",
|
|
9513
|
+
onPointerDown: onHeaderPointerDown,
|
|
9514
|
+
onPointerMove: onHeaderPointerMove,
|
|
9515
|
+
onPointerUp: endDrag,
|
|
9516
|
+
onPointerCancel: endDrag,
|
|
9517
|
+
children: [
|
|
9518
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
9519
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9520
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "shrink-0 text-foreground", children: icon }) : null,
|
|
9521
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "min-w-0 flex-1 text-lg font-semibold leading-7 text-foreground", children: title })
|
|
9522
|
+
] }),
|
|
9523
|
+
context ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "w-full text-sm leading-5 text-muted-foreground", children: context }) : null
|
|
9524
|
+
] }),
|
|
9525
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
9526
|
+
"button",
|
|
9527
|
+
{
|
|
9528
|
+
type: "button",
|
|
9529
|
+
"data-ohw-floating-panel-close": "",
|
|
9530
|
+
"aria-label": "Close",
|
|
9531
|
+
className: "absolute right-2.5 top-2.5 rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
9532
|
+
onClick: (e) => {
|
|
9533
|
+
e.stopPropagation();
|
|
9534
|
+
onClose();
|
|
9535
|
+
},
|
|
9536
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
9537
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
|
|
9538
|
+
}
|
|
9539
|
+
)
|
|
9540
|
+
]
|
|
9541
|
+
}
|
|
9542
|
+
),
|
|
9543
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
9544
|
+
"div",
|
|
9545
|
+
{
|
|
9546
|
+
"data-ohw-floating-panel-body": "",
|
|
9547
|
+
className: cn("flex w-full flex-col gap-4 p-5", bodyClassName),
|
|
9548
|
+
children
|
|
9549
|
+
}
|
|
9550
|
+
)
|
|
9551
|
+
]
|
|
9552
|
+
}
|
|
9553
|
+
);
|
|
9554
|
+
}
|
|
9555
|
+
|
|
9556
|
+
// src/ui/logo-size-panel.tsx
|
|
9557
|
+
var import_lucide_react13 = require("lucide-react");
|
|
9558
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
9559
|
+
function SizeSlider({
|
|
9560
|
+
value,
|
|
9561
|
+
onChange
|
|
9562
|
+
}) {
|
|
9563
|
+
const pct = (value - LOGO_SIZE_MIN) / (LOGO_SIZE_MAX - LOGO_SIZE_MIN) * 100;
|
|
9564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
9565
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex w-full items-center gap-2 text-sm font-medium leading-5", children: [
|
|
9566
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "min-w-0 flex-1 text-foreground", children: "Size" }),
|
|
9567
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: [
|
|
9568
|
+
value,
|
|
9569
|
+
" px"
|
|
9570
|
+
] })
|
|
9571
|
+
] }),
|
|
9572
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative h-2 w-full rounded-full bg-primary-50", children: [
|
|
9573
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9574
|
+
"div",
|
|
9575
|
+
{
|
|
9576
|
+
className: "absolute inset-y-0 left-0 rounded-full bg-primary",
|
|
9577
|
+
style: { width: `${pct}%` }
|
|
9578
|
+
}
|
|
9579
|
+
),
|
|
9580
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9581
|
+
"input",
|
|
9582
|
+
{
|
|
9583
|
+
type: "range",
|
|
9584
|
+
min: LOGO_SIZE_MIN,
|
|
9585
|
+
max: LOGO_SIZE_MAX,
|
|
9586
|
+
step: 1,
|
|
9587
|
+
value,
|
|
9588
|
+
"aria-label": "Logo size",
|
|
9589
|
+
className: cn(
|
|
9590
|
+
"absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent",
|
|
9591
|
+
"[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:size-5",
|
|
9592
|
+
"[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2",
|
|
9593
|
+
"[&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background",
|
|
9594
|
+
"[&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:rounded-full",
|
|
9595
|
+
"[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary",
|
|
9596
|
+
"[&::-moz-range-thumb]:bg-background"
|
|
9597
|
+
),
|
|
9598
|
+
onChange: (e) => onChange(Number(e.target.value))
|
|
9599
|
+
}
|
|
9600
|
+
)
|
|
9601
|
+
] })
|
|
9602
|
+
] });
|
|
9603
|
+
}
|
|
9604
|
+
function LogoSizePanel({
|
|
9605
|
+
viewport,
|
|
9606
|
+
sizePx,
|
|
9607
|
+
mobileFollowing = true,
|
|
9608
|
+
onSizeChange,
|
|
9609
|
+
onCustomizeMobile,
|
|
9610
|
+
onResetMobile,
|
|
9611
|
+
onUpdateEverywhere,
|
|
9612
|
+
className
|
|
9613
|
+
}) {
|
|
9614
|
+
const showFollowing = viewport === "mobile" && mobileFollowing;
|
|
9615
|
+
const showMobileSlider = viewport === "mobile" && !mobileFollowing;
|
|
9616
|
+
const showDesktopSlider = viewport === "desktop";
|
|
9617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex w-full flex-col gap-4", className), children: [
|
|
9618
|
+
showFollowing ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex w-full flex-col gap-2", children: [
|
|
9619
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start gap-1", children: [
|
|
9620
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.Link, { size: 16, className: "mt-0.5 shrink-0 text-foreground", "aria-hidden": true }),
|
|
9621
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm font-semibold leading-5 text-foreground", children: "Following desktop size" })
|
|
9622
|
+
] }),
|
|
9623
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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." }),
|
|
9624
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9625
|
+
Button,
|
|
9626
|
+
{
|
|
9627
|
+
type: "button",
|
|
9628
|
+
variant: "outline",
|
|
9629
|
+
size: "sm",
|
|
9630
|
+
className: "h-9 w-full min-w-0 cursor-pointer",
|
|
9631
|
+
onClick: onCustomizeMobile,
|
|
9632
|
+
children: "Customize for mobile"
|
|
9633
|
+
}
|
|
9634
|
+
)
|
|
9635
|
+
] }) : null,
|
|
9636
|
+
showDesktopSlider || showMobileSlider ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SizeSlider, { value: sizePx, onChange: onSizeChange }) : null,
|
|
9637
|
+
showMobileSlider ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9638
|
+
Button,
|
|
9639
|
+
{
|
|
9640
|
+
type: "button",
|
|
9641
|
+
variant: "outline",
|
|
9642
|
+
size: "sm",
|
|
9643
|
+
className: "h-9 w-full min-w-0 cursor-pointer",
|
|
9644
|
+
onClick: onResetMobile,
|
|
9645
|
+
children: "Reset to desktop size"
|
|
9646
|
+
}
|
|
9647
|
+
) : null,
|
|
9648
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-px w-full bg-border", role: "separator" }),
|
|
9649
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
9650
|
+
Button,
|
|
9651
|
+
{
|
|
9652
|
+
type: "button",
|
|
9653
|
+
variant: "outline",
|
|
9654
|
+
size: "sm",
|
|
9655
|
+
className: "h-9 w-full min-w-0 cursor-pointer gap-1",
|
|
9656
|
+
onClick: onUpdateEverywhere,
|
|
9657
|
+
children: [
|
|
9658
|
+
"Update logo everywhere",
|
|
9659
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.ArrowUpRight, { size: 16, "aria-hidden": true })
|
|
9660
|
+
]
|
|
9661
|
+
}
|
|
9662
|
+
),
|
|
9663
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", children: "Matches the right version to your background." })
|
|
9664
|
+
] });
|
|
9665
|
+
}
|
|
9666
|
+
|
|
9265
9667
|
// src/lib/item-drag-interaction.ts
|
|
9266
9668
|
function disableNativeHrefDrag(el) {
|
|
9267
9669
|
if (el.draggable) el.draggable = false;
|
|
@@ -9460,7 +9862,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
|
|
|
9460
9862
|
}
|
|
9461
9863
|
|
|
9462
9864
|
// src/useNavItemDrag.ts
|
|
9463
|
-
var
|
|
9865
|
+
var import_react13 = require("react");
|
|
9464
9866
|
function useNavItemDrag({
|
|
9465
9867
|
isEditMode,
|
|
9466
9868
|
editContentRef,
|
|
@@ -9484,11 +9886,11 @@ function useNavItemDrag({
|
|
|
9484
9886
|
getNavigationItemAnchor: getNavigationItemAnchor2,
|
|
9485
9887
|
isDragHandleDisabled: isDragHandleDisabled2
|
|
9486
9888
|
}) {
|
|
9487
|
-
const navDragRef = (0,
|
|
9488
|
-
const [navDropSlots, setNavDropSlots] = (0,
|
|
9489
|
-
const [activeNavDropIndex, setActiveNavDropIndex] = (0,
|
|
9490
|
-
const navPointerDragRef = (0,
|
|
9491
|
-
const clearNavDragVisuals = (0,
|
|
9889
|
+
const navDragRef = (0, import_react13.useRef)(null);
|
|
9890
|
+
const [navDropSlots, setNavDropSlots] = (0, import_react13.useState)([]);
|
|
9891
|
+
const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react13.useState)(null);
|
|
9892
|
+
const navPointerDragRef = (0, import_react13.useRef)(null);
|
|
9893
|
+
const clearNavDragVisuals = (0, import_react13.useCallback)(() => {
|
|
9492
9894
|
const session = navDragRef.current;
|
|
9493
9895
|
const keepOpenEl = session?.draggedEl?.closest("[data-ohw-nav-children]") != null ? session.draggedEl : null;
|
|
9494
9896
|
navDragRef.current = null;
|
|
@@ -9505,7 +9907,7 @@ function useNavItemDrag({
|
|
|
9505
9907
|
document.documentElement.removeAttribute("data-ohw-nav-dragging-root");
|
|
9506
9908
|
unlockItemDragInteraction();
|
|
9507
9909
|
}, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
|
|
9508
|
-
const refreshNavDragVisuals = (0,
|
|
9910
|
+
const refreshNavDragVisuals = (0, import_react13.useCallback)(
|
|
9509
9911
|
(session, activeSlot, clientX, clientY) => {
|
|
9510
9912
|
setDraggedItemRect(session.draggedEl.getBoundingClientRect());
|
|
9511
9913
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -9523,13 +9925,13 @@ function useNavItemDrag({
|
|
|
9523
9925
|
},
|
|
9524
9926
|
[setDraggedItemRect, setSiblingHintRects]
|
|
9525
9927
|
);
|
|
9526
|
-
const refreshNavDragVisualsRef = (0,
|
|
9928
|
+
const refreshNavDragVisualsRef = (0, import_react13.useRef)(refreshNavDragVisuals);
|
|
9527
9929
|
refreshNavDragVisualsRef.current = refreshNavDragVisuals;
|
|
9528
|
-
const commitNavDragRef = (0,
|
|
9930
|
+
const commitNavDragRef = (0, import_react13.useRef)(() => {
|
|
9529
9931
|
});
|
|
9530
|
-
const beginNavDragRef = (0,
|
|
9932
|
+
const beginNavDragRef = (0, import_react13.useRef)(() => {
|
|
9531
9933
|
});
|
|
9532
|
-
const beginNavDrag = (0,
|
|
9934
|
+
const beginNavDrag = (0, import_react13.useCallback)(
|
|
9533
9935
|
(session) => {
|
|
9534
9936
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
9535
9937
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -9563,7 +9965,7 @@ function useNavItemDrag({
|
|
|
9563
9965
|
]
|
|
9564
9966
|
);
|
|
9565
9967
|
beginNavDragRef.current = beginNavDrag;
|
|
9566
|
-
const commitNavDrag = (0,
|
|
9968
|
+
const commitNavDrag = (0, import_react13.useCallback)(
|
|
9567
9969
|
(clientX, clientY) => {
|
|
9568
9970
|
const session = navDragRef.current;
|
|
9569
9971
|
if (!session) {
|
|
@@ -9624,7 +10026,7 @@ function useNavItemDrag({
|
|
|
9624
10026
|
[clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
|
|
9625
10027
|
);
|
|
9626
10028
|
commitNavDragRef.current = commitNavDrag;
|
|
9627
|
-
const startNavLinkDrag = (0,
|
|
10029
|
+
const startNavLinkDrag = (0, import_react13.useCallback)(
|
|
9628
10030
|
(anchor, clientX, clientY, wasSelected) => {
|
|
9629
10031
|
if (footerDragRef.current) return false;
|
|
9630
10032
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -9642,7 +10044,7 @@ function useNavItemDrag({
|
|
|
9642
10044
|
},
|
|
9643
10045
|
[beginNavDrag, footerDragRef, isDragHandleDisabled2, isCtaButton]
|
|
9644
10046
|
);
|
|
9645
|
-
const onNavDragOver = (0,
|
|
10047
|
+
const onNavDragOver = (0, import_react13.useCallback)(
|
|
9646
10048
|
(e) => {
|
|
9647
10049
|
const session = navDragRef.current;
|
|
9648
10050
|
if (!session) return false;
|
|
@@ -9654,7 +10056,7 @@ function useNavItemDrag({
|
|
|
9654
10056
|
},
|
|
9655
10057
|
[]
|
|
9656
10058
|
);
|
|
9657
|
-
(0,
|
|
10059
|
+
(0, import_react13.useEffect)(() => {
|
|
9658
10060
|
if (!isEditMode) return;
|
|
9659
10061
|
const THRESHOLD = 10;
|
|
9660
10062
|
const resolveWasSelected = (el) => {
|
|
@@ -9779,7 +10181,7 @@ function useNavItemDrag({
|
|
|
9779
10181
|
setLinkPopover,
|
|
9780
10182
|
suppressNextClickRef
|
|
9781
10183
|
]);
|
|
9782
|
-
const armNavPressFromChrome = (0,
|
|
10184
|
+
const armNavPressFromChrome = (0, import_react13.useCallback)(
|
|
9783
10185
|
(selected, clientX, clientY, pointerId) => {
|
|
9784
10186
|
const hrefKey = selected.getAttribute("data-ohw-href-key");
|
|
9785
10187
|
if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
|
|
@@ -9810,8 +10212,8 @@ function useNavItemDrag({
|
|
|
9810
10212
|
}
|
|
9811
10213
|
|
|
9812
10214
|
// src/ui/footer-container-chrome.tsx
|
|
9813
|
-
var
|
|
9814
|
-
var
|
|
10215
|
+
var import_lucide_react14 = require("lucide-react");
|
|
10216
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9815
10217
|
function FooterContainerChrome({
|
|
9816
10218
|
rect,
|
|
9817
10219
|
onAdd,
|
|
@@ -9819,7 +10221,7 @@ function FooterContainerChrome({
|
|
|
9819
10221
|
}) {
|
|
9820
10222
|
const chromeGap = 6;
|
|
9821
10223
|
const buttonMargin = 7;
|
|
9822
|
-
return /* @__PURE__ */ (0,
|
|
10224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9823
10225
|
"div",
|
|
9824
10226
|
{
|
|
9825
10227
|
"data-ohw-footer-container-chrome": "",
|
|
@@ -9831,8 +10233,8 @@ function FooterContainerChrome({
|
|
|
9831
10233
|
width: rect.width + chromeGap * 2,
|
|
9832
10234
|
height: rect.height + chromeGap * 2
|
|
9833
10235
|
},
|
|
9834
|
-
children: /* @__PURE__ */ (0,
|
|
9835
|
-
/* @__PURE__ */ (0,
|
|
10236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
|
|
10237
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9836
10238
|
"button",
|
|
9837
10239
|
{
|
|
9838
10240
|
type: "button",
|
|
@@ -9851,17 +10253,17 @@ function FooterContainerChrome({
|
|
|
9851
10253
|
if (addDisabled) return;
|
|
9852
10254
|
onAdd();
|
|
9853
10255
|
},
|
|
9854
|
-
children: /* @__PURE__ */ (0,
|
|
10256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
9855
10257
|
}
|
|
9856
10258
|
) }),
|
|
9857
|
-
/* @__PURE__ */ (0,
|
|
10259
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
9858
10260
|
] })
|
|
9859
10261
|
}
|
|
9860
10262
|
) });
|
|
9861
10263
|
}
|
|
9862
10264
|
|
|
9863
10265
|
// src/lib/carousel.ts
|
|
9864
|
-
var
|
|
10266
|
+
var import_react14 = require("react");
|
|
9865
10267
|
var CAROUSEL_ATTR = "data-ohw-carousel";
|
|
9866
10268
|
var CAROUSEL_VALUE_ATTR = "data-ohw-carousel-value";
|
|
9867
10269
|
var CAROUSEL_SLIDE_ATTR = "data-ohw-carousel-slide";
|
|
@@ -9923,8 +10325,8 @@ function applyCarouselNode(key, val) {
|
|
|
9923
10325
|
return true;
|
|
9924
10326
|
}
|
|
9925
10327
|
function useOhwCarousel(key, initial) {
|
|
9926
|
-
const [images, setImages] = (0,
|
|
9927
|
-
(0,
|
|
10328
|
+
const [images, setImages] = (0, import_react14.useState)(initial);
|
|
10329
|
+
(0, import_react14.useEffect)(() => {
|
|
9928
10330
|
const el = document.querySelector(
|
|
9929
10331
|
`[${CAROUSEL_ATTR}][data-ohw-key="${CSS.escape(key)}"]`
|
|
9930
10332
|
);
|
|
@@ -10034,6 +10436,18 @@ function collectEditableNodes(extraContent, root = document) {
|
|
|
10034
10436
|
}
|
|
10035
10437
|
if (extraContent && !isScoped) {
|
|
10036
10438
|
applyNavFooterDeleteOverrides(byKey, extraContent);
|
|
10439
|
+
for (const key of LOGO_IMAGE_KEYS) {
|
|
10440
|
+
if (!(key in extraContent)) continue;
|
|
10441
|
+
byKey.set(key, { key, type: "image", text: extraContent[key] ?? "" });
|
|
10442
|
+
}
|
|
10443
|
+
for (const key of [LOGO_PLACEHOLDER_KEY, LOGO_ALT_KEY]) {
|
|
10444
|
+
if (!(key in extraContent)) continue;
|
|
10445
|
+
byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
|
|
10446
|
+
}
|
|
10447
|
+
for (const key of LOGO_SIZE_KEYS) {
|
|
10448
|
+
if (!(key in extraContent)) continue;
|
|
10449
|
+
byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
|
|
10450
|
+
}
|
|
10037
10451
|
}
|
|
10038
10452
|
return Array.from(byKey.values());
|
|
10039
10453
|
}
|
|
@@ -10282,14 +10696,14 @@ function deleteSelectedNavFooterItem(deps) {
|
|
|
10282
10696
|
}
|
|
10283
10697
|
|
|
10284
10698
|
// src/ui/navbar-container-chrome.tsx
|
|
10285
|
-
var
|
|
10286
|
-
var
|
|
10699
|
+
var import_lucide_react15 = require("lucide-react");
|
|
10700
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10287
10701
|
function NavbarContainerChrome({
|
|
10288
10702
|
rect,
|
|
10289
10703
|
onAdd
|
|
10290
10704
|
}) {
|
|
10291
10705
|
const chromeGap = 6;
|
|
10292
|
-
return /* @__PURE__ */ (0,
|
|
10706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
10293
10707
|
"div",
|
|
10294
10708
|
{
|
|
10295
10709
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -10301,7 +10715,7 @@ function NavbarContainerChrome({
|
|
|
10301
10715
|
width: rect.width + chromeGap * 2,
|
|
10302
10716
|
height: rect.height + chromeGap * 2
|
|
10303
10717
|
},
|
|
10304
|
-
children: /* @__PURE__ */ (0,
|
|
10718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
10305
10719
|
"button",
|
|
10306
10720
|
{
|
|
10307
10721
|
type: "button",
|
|
@@ -10318,7 +10732,7 @@ function NavbarContainerChrome({
|
|
|
10318
10732
|
e.stopPropagation();
|
|
10319
10733
|
onAdd();
|
|
10320
10734
|
},
|
|
10321
|
-
children: /* @__PURE__ */ (0,
|
|
10735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
10322
10736
|
}
|
|
10323
10737
|
)
|
|
10324
10738
|
}
|
|
@@ -10327,7 +10741,7 @@ function NavbarContainerChrome({
|
|
|
10327
10741
|
|
|
10328
10742
|
// src/ui/drop-indicator.tsx
|
|
10329
10743
|
var React9 = __toESM(require("react"), 1);
|
|
10330
|
-
var
|
|
10744
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
10331
10745
|
var dropIndicatorVariants = cva(
|
|
10332
10746
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
10333
10747
|
{
|
|
@@ -10351,7 +10765,7 @@ var dropIndicatorVariants = cva(
|
|
|
10351
10765
|
);
|
|
10352
10766
|
var DropIndicator = React9.forwardRef(
|
|
10353
10767
|
({ className, direction, state, ...props }, ref) => {
|
|
10354
|
-
return /* @__PURE__ */ (0,
|
|
10768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
10355
10769
|
"div",
|
|
10356
10770
|
{
|
|
10357
10771
|
ref,
|
|
@@ -10368,7 +10782,7 @@ var DropIndicator = React9.forwardRef(
|
|
|
10368
10782
|
DropIndicator.displayName = "DropIndicator";
|
|
10369
10783
|
|
|
10370
10784
|
// src/ui/badge.tsx
|
|
10371
|
-
var
|
|
10785
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10372
10786
|
var badgeVariants = cva(
|
|
10373
10787
|
"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",
|
|
10374
10788
|
{
|
|
@@ -10386,12 +10800,12 @@ var badgeVariants = cva(
|
|
|
10386
10800
|
}
|
|
10387
10801
|
);
|
|
10388
10802
|
function Badge({ className, variant, ...props }) {
|
|
10389
|
-
return /* @__PURE__ */ (0,
|
|
10803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
10390
10804
|
}
|
|
10391
10805
|
|
|
10392
10806
|
// src/OhhwellsBridge.tsx
|
|
10393
|
-
var
|
|
10394
|
-
var
|
|
10807
|
+
var import_lucide_react16 = require("lucide-react");
|
|
10808
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10395
10809
|
var PRIMARY3 = "#0885FE";
|
|
10396
10810
|
var IMAGE_FADE_MS = 300;
|
|
10397
10811
|
function runOpacityFade(el, onDone) {
|
|
@@ -10570,7 +10984,7 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
|
|
|
10570
10984
|
const root = (0, import_client.createRoot)(container);
|
|
10571
10985
|
(0, import_react_dom2.flushSync)(() => {
|
|
10572
10986
|
root.render(
|
|
10573
|
-
/* @__PURE__ */ (0,
|
|
10987
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
10574
10988
|
SchedulingWidget,
|
|
10575
10989
|
{
|
|
10576
10990
|
notifyOnConnect,
|
|
@@ -10725,6 +11139,9 @@ function isInsideLinkEditor(target) {
|
|
|
10725
11139
|
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"]')
|
|
10726
11140
|
);
|
|
10727
11141
|
}
|
|
11142
|
+
function isInsideFloatingPanel(target) {
|
|
11143
|
+
return Boolean(target.closest("[data-ohw-floating-panel]"));
|
|
11144
|
+
}
|
|
10728
11145
|
function getHrefKeyFromElement(el) {
|
|
10729
11146
|
if (!el) return null;
|
|
10730
11147
|
const anchor = el.closest("[data-ohw-href-key]");
|
|
@@ -11177,7 +11594,7 @@ function EditGlowChrome({
|
|
|
11177
11594
|
hideHandle = false
|
|
11178
11595
|
}) {
|
|
11179
11596
|
const GAP = SELECTION_CHROME_GAP2;
|
|
11180
|
-
return /* @__PURE__ */ (0,
|
|
11597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
11181
11598
|
"div",
|
|
11182
11599
|
{
|
|
11183
11600
|
ref: elRef,
|
|
@@ -11192,7 +11609,7 @@ function EditGlowChrome({
|
|
|
11192
11609
|
zIndex: 2147483646
|
|
11193
11610
|
},
|
|
11194
11611
|
children: [
|
|
11195
|
-
/* @__PURE__ */ (0,
|
|
11612
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11196
11613
|
"div",
|
|
11197
11614
|
{
|
|
11198
11615
|
style: {
|
|
@@ -11205,7 +11622,7 @@ function EditGlowChrome({
|
|
|
11205
11622
|
}
|
|
11206
11623
|
}
|
|
11207
11624
|
),
|
|
11208
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */ (0,
|
|
11625
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11209
11626
|
"div",
|
|
11210
11627
|
{
|
|
11211
11628
|
"data-ohw-drag-handle-container": "",
|
|
@@ -11217,7 +11634,7 @@ function EditGlowChrome({
|
|
|
11217
11634
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
11218
11635
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
11219
11636
|
},
|
|
11220
|
-
children: /* @__PURE__ */ (0,
|
|
11637
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11221
11638
|
DragHandle,
|
|
11222
11639
|
{
|
|
11223
11640
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -11400,9 +11817,9 @@ function FloatingToolbar({
|
|
|
11400
11817
|
showEditLink,
|
|
11401
11818
|
onEditLink
|
|
11402
11819
|
}) {
|
|
11403
|
-
const localRef =
|
|
11404
|
-
const [measuredW, setMeasuredW] =
|
|
11405
|
-
const setRefs =
|
|
11820
|
+
const localRef = import_react15.default.useRef(null);
|
|
11821
|
+
const [measuredW, setMeasuredW] = import_react15.default.useState(330);
|
|
11822
|
+
const setRefs = import_react15.default.useCallback(
|
|
11406
11823
|
(node) => {
|
|
11407
11824
|
localRef.current = node;
|
|
11408
11825
|
if (typeof elRef === "function") elRef(node);
|
|
@@ -11414,7 +11831,7 @@ function FloatingToolbar({
|
|
|
11414
11831
|
},
|
|
11415
11832
|
[elRef]
|
|
11416
11833
|
);
|
|
11417
|
-
|
|
11834
|
+
import_react15.default.useLayoutEffect(() => {
|
|
11418
11835
|
const node = localRef.current;
|
|
11419
11836
|
if (!node) return;
|
|
11420
11837
|
const update = () => {
|
|
@@ -11427,7 +11844,7 @@ function FloatingToolbar({
|
|
|
11427
11844
|
return () => ro.disconnect();
|
|
11428
11845
|
}, [showEditLink, activeCommands]);
|
|
11429
11846
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
11430
|
-
return /* @__PURE__ */ (0,
|
|
11847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11431
11848
|
"div",
|
|
11432
11849
|
{
|
|
11433
11850
|
ref: setRefs,
|
|
@@ -11439,12 +11856,12 @@ function FloatingToolbar({
|
|
|
11439
11856
|
zIndex: 2147483647,
|
|
11440
11857
|
pointerEvents: "auto"
|
|
11441
11858
|
},
|
|
11442
|
-
children: /* @__PURE__ */ (0,
|
|
11443
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0,
|
|
11444
|
-
gi > 0 && /* @__PURE__ */ (0,
|
|
11859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CustomToolbar, { children: [
|
|
11860
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react15.default.Fragment, { children: [
|
|
11861
|
+
gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CustomToolbarDivider, {}),
|
|
11445
11862
|
btns.map((btn) => {
|
|
11446
11863
|
const isActive = activeCommands.has(btn.cmd);
|
|
11447
|
-
return /* @__PURE__ */ (0,
|
|
11864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11448
11865
|
CustomToolbarButton,
|
|
11449
11866
|
{
|
|
11450
11867
|
title: btn.title,
|
|
@@ -11453,7 +11870,7 @@ function FloatingToolbar({
|
|
|
11453
11870
|
e.preventDefault();
|
|
11454
11871
|
onCommand(btn.cmd);
|
|
11455
11872
|
},
|
|
11456
|
-
children: /* @__PURE__ */ (0,
|
|
11873
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11457
11874
|
"svg",
|
|
11458
11875
|
{
|
|
11459
11876
|
width: "16",
|
|
@@ -11474,7 +11891,7 @@ function FloatingToolbar({
|
|
|
11474
11891
|
);
|
|
11475
11892
|
})
|
|
11476
11893
|
] }, gi)),
|
|
11477
|
-
showEditLink ? /* @__PURE__ */ (0,
|
|
11894
|
+
showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11478
11895
|
CustomToolbarButton,
|
|
11479
11896
|
{
|
|
11480
11897
|
type: "button",
|
|
@@ -11488,7 +11905,7 @@ function FloatingToolbar({
|
|
|
11488
11905
|
e.preventDefault();
|
|
11489
11906
|
e.stopPropagation();
|
|
11490
11907
|
},
|
|
11491
|
-
children: /* @__PURE__ */ (0,
|
|
11908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Link, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
11492
11909
|
}
|
|
11493
11910
|
) : null
|
|
11494
11911
|
] })
|
|
@@ -11505,7 +11922,7 @@ function StateToggle({
|
|
|
11505
11922
|
states,
|
|
11506
11923
|
onStateChange
|
|
11507
11924
|
}) {
|
|
11508
|
-
return /* @__PURE__ */ (0,
|
|
11925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11509
11926
|
ToggleGroup,
|
|
11510
11927
|
{
|
|
11511
11928
|
"data-ohw-state-toggle": "",
|
|
@@ -11519,7 +11936,7 @@ function StateToggle({
|
|
|
11519
11936
|
left: rect.right - 8,
|
|
11520
11937
|
transform: "translateX(-100%)"
|
|
11521
11938
|
},
|
|
11522
|
-
children: states.map((state) => /* @__PURE__ */ (0,
|
|
11939
|
+
children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
11523
11940
|
}
|
|
11524
11941
|
);
|
|
11525
11942
|
}
|
|
@@ -11546,8 +11963,8 @@ function OhhwellsBridge() {
|
|
|
11546
11963
|
const router = (0, import_navigation3.useRouter)();
|
|
11547
11964
|
const searchParams = (0, import_navigation3.useSearchParams)();
|
|
11548
11965
|
const isEditMode = isEditSessionActive();
|
|
11549
|
-
const [bridgeRoot, setBridgeRoot] = (0,
|
|
11550
|
-
(0,
|
|
11966
|
+
const [bridgeRoot, setBridgeRoot] = (0, import_react15.useState)(null);
|
|
11967
|
+
(0, import_react15.useEffect)(() => {
|
|
11551
11968
|
const figtreeFontId = "ohw-figtree-font";
|
|
11552
11969
|
if (!document.getElementById(figtreeFontId)) {
|
|
11553
11970
|
const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
|
|
@@ -11576,109 +11993,133 @@ function OhhwellsBridge() {
|
|
|
11576
11993
|
const subdomain = resolveSubdomain(subdomainFromQuery);
|
|
11577
11994
|
useLinkHrefGuardian(pathname, subdomain, isEditMode);
|
|
11578
11995
|
useSavedLinkNavigation(isEditMode);
|
|
11579
|
-
const postToParent2 = (0,
|
|
11996
|
+
const postToParent2 = (0, import_react15.useCallback)((data) => {
|
|
11580
11997
|
if (typeof window !== "undefined" && window.parent !== window) {
|
|
11581
11998
|
window.parent.postMessage(data, "*");
|
|
11582
11999
|
}
|
|
11583
12000
|
}, []);
|
|
11584
|
-
const [fetchState, setFetchState] = (0,
|
|
11585
|
-
const autoSaveTimers = (0,
|
|
11586
|
-
const activeElRef = (0,
|
|
11587
|
-
const pointerHeldRef = (0,
|
|
11588
|
-
const selectedElRef = (0,
|
|
11589
|
-
const selectedHrefKeyRef = (0,
|
|
11590
|
-
const selectedFooterColAttrRef = (0,
|
|
11591
|
-
const originalContentRef = (0,
|
|
11592
|
-
const activeStateElRef = (0,
|
|
11593
|
-
const parentScrollRef = (0,
|
|
11594
|
-
const visibleViewportRef = (0,
|
|
11595
|
-
const [dialogPortalContainer, setDialogPortalContainer] = (0,
|
|
11596
|
-
const attachVisibleViewport = (0,
|
|
12001
|
+
const [fetchState, setFetchState] = (0, import_react15.useState)("idle");
|
|
12002
|
+
const autoSaveTimers = (0, import_react15.useRef)(/* @__PURE__ */ new Map());
|
|
12003
|
+
const activeElRef = (0, import_react15.useRef)(null);
|
|
12004
|
+
const pointerHeldRef = (0, import_react15.useRef)(false);
|
|
12005
|
+
const selectedElRef = (0, import_react15.useRef)(null);
|
|
12006
|
+
const selectedHrefKeyRef = (0, import_react15.useRef)(null);
|
|
12007
|
+
const selectedFooterColAttrRef = (0, import_react15.useRef)(null);
|
|
12008
|
+
const originalContentRef = (0, import_react15.useRef)(null);
|
|
12009
|
+
const activeStateElRef = (0, import_react15.useRef)(null);
|
|
12010
|
+
const parentScrollRef = (0, import_react15.useRef)(null);
|
|
12011
|
+
const visibleViewportRef = (0, import_react15.useRef)(null);
|
|
12012
|
+
const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react15.useState)(null);
|
|
12013
|
+
const attachVisibleViewport = (0, import_react15.useCallback)((node) => {
|
|
11597
12014
|
visibleViewportRef.current = node;
|
|
11598
12015
|
setDialogPortalContainer(node);
|
|
11599
12016
|
if (node) applyVisibleViewport(node, parentScrollRef.current);
|
|
11600
12017
|
}, []);
|
|
11601
|
-
const toolbarElRef = (0,
|
|
11602
|
-
const glowElRef = (0,
|
|
11603
|
-
const hoveredImageRef = (0,
|
|
11604
|
-
const hoveredImageHasTextOverlapRef = (0,
|
|
11605
|
-
const dragOverElRef = (0,
|
|
11606
|
-
const [mediaHover, setMediaHover] = (0,
|
|
11607
|
-
const [carouselHover, setCarouselHover] = (0,
|
|
11608
|
-
const [uploadingRects, setUploadingRects] = (0,
|
|
11609
|
-
const hoveredGapRef = (0,
|
|
11610
|
-
const imageUnhoverTimerRef = (0,
|
|
11611
|
-
const imageShowTimerRef = (0,
|
|
11612
|
-
const editStylesRef = (0,
|
|
11613
|
-
const activateRef = (0,
|
|
12018
|
+
const toolbarElRef = (0, import_react15.useRef)(null);
|
|
12019
|
+
const glowElRef = (0, import_react15.useRef)(null);
|
|
12020
|
+
const hoveredImageRef = (0, import_react15.useRef)(null);
|
|
12021
|
+
const hoveredImageHasTextOverlapRef = (0, import_react15.useRef)(false);
|
|
12022
|
+
const dragOverElRef = (0, import_react15.useRef)(null);
|
|
12023
|
+
const [mediaHover, setMediaHover] = (0, import_react15.useState)(null);
|
|
12024
|
+
const [carouselHover, setCarouselHover] = (0, import_react15.useState)(null);
|
|
12025
|
+
const [uploadingRects, setUploadingRects] = (0, import_react15.useState)({});
|
|
12026
|
+
const hoveredGapRef = (0, import_react15.useRef)(null);
|
|
12027
|
+
const imageUnhoverTimerRef = (0, import_react15.useRef)(null);
|
|
12028
|
+
const imageShowTimerRef = (0, import_react15.useRef)(null);
|
|
12029
|
+
const editStylesRef = (0, import_react15.useRef)(null);
|
|
12030
|
+
const activateRef = (0, import_react15.useRef)(() => {
|
|
11614
12031
|
});
|
|
11615
|
-
const deactivateRef = (0,
|
|
12032
|
+
const deactivateRef = (0, import_react15.useRef)(() => {
|
|
11616
12033
|
});
|
|
11617
|
-
const selectRef = (0,
|
|
12034
|
+
const selectRef = (0, import_react15.useRef)(() => {
|
|
11618
12035
|
});
|
|
11619
|
-
const selectFrameRef = (0,
|
|
12036
|
+
const selectFrameRef = (0, import_react15.useRef)(() => {
|
|
11620
12037
|
});
|
|
11621
|
-
const
|
|
12038
|
+
const selectLogoRef = (0, import_react15.useRef)(() => {
|
|
11622
12039
|
});
|
|
11623
|
-
const
|
|
12040
|
+
const openLogoSizePanelRef = (0, import_react15.useRef)(() => {
|
|
11624
12041
|
});
|
|
11625
|
-
const
|
|
12042
|
+
const deselectRef = (0, import_react15.useRef)(() => {
|
|
11626
12043
|
});
|
|
11627
|
-
const
|
|
11628
|
-
const runPendingDeleteUndoRef = (0, import_react14.useRef)(() => false);
|
|
11629
|
-
const isFooterFrameSelectionRef = (0, import_react14.useRef)(false);
|
|
11630
|
-
const refreshActiveCommandsRef = (0, import_react14.useRef)(() => {
|
|
12044
|
+
const closeFloatingPanelOnlyRef = (0, import_react15.useRef)(() => {
|
|
11631
12045
|
});
|
|
11632
|
-
const
|
|
12046
|
+
const reselectNavigationItemRef = (0, import_react15.useRef)(() => {
|
|
12047
|
+
});
|
|
12048
|
+
const commitNavigationTextEditRef = (0, import_react15.useRef)(() => {
|
|
12049
|
+
});
|
|
12050
|
+
const handleDeleteSelectedRef = (0, import_react15.useRef)(() => false);
|
|
12051
|
+
const runPendingDeleteUndoRef = (0, import_react15.useRef)(() => false);
|
|
12052
|
+
const isFooterFrameSelectionRef = (0, import_react15.useRef)(false);
|
|
12053
|
+
const refreshActiveCommandsRef = (0, import_react15.useRef)(() => {
|
|
12054
|
+
});
|
|
12055
|
+
const postToParentRef = (0, import_react15.useRef)(postToParent2);
|
|
11633
12056
|
postToParentRef.current = postToParent2;
|
|
11634
|
-
const aiSectionApiRef = (0,
|
|
11635
|
-
const sectionsLoadedRef = (0,
|
|
11636
|
-
const pendingScheduleConfigRequests = (0,
|
|
11637
|
-
const [toolbarRect, setToolbarRect] = (0,
|
|
11638
|
-
const [toolbarVariant, setToolbarVariant] = (0,
|
|
11639
|
-
const toolbarVariantRef = (0,
|
|
12057
|
+
const aiSectionApiRef = (0, import_react15.useRef)(null);
|
|
12058
|
+
const sectionsLoadedRef = (0, import_react15.useRef)(false);
|
|
12059
|
+
const pendingScheduleConfigRequests = (0, import_react15.useRef)([]);
|
|
12060
|
+
const [toolbarRect, setToolbarRect] = (0, import_react15.useState)(null);
|
|
12061
|
+
const [toolbarVariant, setToolbarVariant] = (0, import_react15.useState)("none");
|
|
12062
|
+
const toolbarVariantRef = (0, import_react15.useRef)("none");
|
|
11640
12063
|
toolbarVariantRef.current = toolbarVariant;
|
|
11641
|
-
const [selectedIsCta, setSelectedIsCta] = (0,
|
|
11642
|
-
const [reorderHrefKey, setReorderHrefKey] = (0,
|
|
11643
|
-
const [reorderDragDisabled, setReorderDragDisabled] = (0,
|
|
11644
|
-
const [toggleState, setToggleState] = (0,
|
|
11645
|
-
const [maxBadge, setMaxBadge] = (0,
|
|
11646
|
-
const [activeCommands, setActiveCommands] = (0,
|
|
11647
|
-
const [sectionGap, setSectionGap] = (0,
|
|
11648
|
-
const [toolbarShowEditLink, setToolbarShowEditLink] = (0,
|
|
11649
|
-
const hoveredNavContainerRef = (0,
|
|
11650
|
-
const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0,
|
|
11651
|
-
const hoveredItemElRef = (0,
|
|
11652
|
-
const [hoveredItemRect, setHoveredItemRect] = (0,
|
|
11653
|
-
const siblingHintElRef = (0,
|
|
11654
|
-
const [siblingHintRect, setSiblingHintRect] = (0,
|
|
11655
|
-
const [siblingHintRects, setSiblingHintRects] = (0,
|
|
11656
|
-
const [isItemDragging, setIsItemDragging] = (0,
|
|
11657
|
-
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0,
|
|
12064
|
+
const [selectedIsCta, setSelectedIsCta] = (0, import_react15.useState)(false);
|
|
12065
|
+
const [reorderHrefKey, setReorderHrefKey] = (0, import_react15.useState)(null);
|
|
12066
|
+
const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react15.useState)(false);
|
|
12067
|
+
const [toggleState, setToggleState] = (0, import_react15.useState)(null);
|
|
12068
|
+
const [maxBadge, setMaxBadge] = (0, import_react15.useState)(null);
|
|
12069
|
+
const [activeCommands, setActiveCommands] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
|
|
12070
|
+
const [sectionGap, setSectionGap] = (0, import_react15.useState)(null);
|
|
12071
|
+
const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react15.useState)(false);
|
|
12072
|
+
const hoveredNavContainerRef = (0, import_react15.useRef)(null);
|
|
12073
|
+
const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react15.useState)(null);
|
|
12074
|
+
const hoveredItemElRef = (0, import_react15.useRef)(null);
|
|
12075
|
+
const [hoveredItemRect, setHoveredItemRect] = (0, import_react15.useState)(null);
|
|
12076
|
+
const siblingHintElRef = (0, import_react15.useRef)(null);
|
|
12077
|
+
const [siblingHintRect, setSiblingHintRect] = (0, import_react15.useState)(null);
|
|
12078
|
+
const [siblingHintRects, setSiblingHintRects] = (0, import_react15.useState)([]);
|
|
12079
|
+
const [isItemDragging, setIsItemDragging] = (0, import_react15.useState)(false);
|
|
12080
|
+
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react15.useState)(false);
|
|
11658
12081
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
11659
|
-
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0,
|
|
11660
|
-
const [footerHeadingVisible, setFooterHeadingVisible] = (0,
|
|
11661
|
-
const footerDragRef = (0,
|
|
11662
|
-
const [footerDropSlots, setFooterDropSlots] = (0,
|
|
11663
|
-
const [activeFooterDropIndex, setActiveFooterDropIndex] = (0,
|
|
11664
|
-
const [draggedItemRect, setDraggedItemRect] = (0,
|
|
11665
|
-
const footerPointerDragRef = (0,
|
|
11666
|
-
const suppressNextClickRef = (0,
|
|
11667
|
-
const suppressClickUntilRef = (0,
|
|
11668
|
-
const [linkPopover, setLinkPopover] = (0,
|
|
11669
|
-
const linkPopoverSessionRef = (0,
|
|
11670
|
-
const addNavAfterAnchorRef = (0,
|
|
11671
|
-
const editContentRef = (0,
|
|
11672
|
-
const pendingDeleteUndoRef = (0,
|
|
11673
|
-
const [
|
|
11674
|
-
const
|
|
11675
|
-
const
|
|
11676
|
-
const
|
|
11677
|
-
const
|
|
11678
|
-
const
|
|
11679
|
-
const
|
|
12082
|
+
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react15.useState)(null);
|
|
12083
|
+
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react15.useState)(null);
|
|
12084
|
+
const footerDragRef = (0, import_react15.useRef)(null);
|
|
12085
|
+
const [footerDropSlots, setFooterDropSlots] = (0, import_react15.useState)([]);
|
|
12086
|
+
const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react15.useState)(null);
|
|
12087
|
+
const [draggedItemRect, setDraggedItemRect] = (0, import_react15.useState)(null);
|
|
12088
|
+
const footerPointerDragRef = (0, import_react15.useRef)(null);
|
|
12089
|
+
const suppressNextClickRef = (0, import_react15.useRef)(false);
|
|
12090
|
+
const suppressClickUntilRef = (0, import_react15.useRef)(0);
|
|
12091
|
+
const [linkPopover, setLinkPopover] = (0, import_react15.useState)(null);
|
|
12092
|
+
const linkPopoverSessionRef = (0, import_react15.useRef)(null);
|
|
12093
|
+
const addNavAfterAnchorRef = (0, import_react15.useRef)(null);
|
|
12094
|
+
const editContentRef = (0, import_react15.useRef)({});
|
|
12095
|
+
const pendingDeleteUndoRef = (0, import_react15.useRef)(null);
|
|
12096
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react15.useState)(null);
|
|
12097
|
+
const floatingPanelOpenRef = (0, import_react15.useRef)(false);
|
|
12098
|
+
const setFloatingPanelRef = (0, import_react15.useRef)(setFloatingPanel);
|
|
12099
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react15.useState)(null);
|
|
12100
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react15.useState)(null);
|
|
12101
|
+
const [editorViewport, setEditorViewport] = (0, import_react15.useState)("desktop");
|
|
12102
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react15.useState)(null);
|
|
12103
|
+
const [sitePages, setSitePages] = (0, import_react15.useState)([]);
|
|
12104
|
+
const [sectionsByPath, setSectionsByPath] = (0, import_react15.useState)({});
|
|
12105
|
+
const sectionsPrefetchGenRef = (0, import_react15.useRef)(0);
|
|
12106
|
+
const setLinkPopoverRef = (0, import_react15.useRef)(setLinkPopover);
|
|
12107
|
+
const linkPopoverPanelRef = (0, import_react15.useRef)(null);
|
|
12108
|
+
const linkPopoverOpenRef = (0, import_react15.useRef)(false);
|
|
12109
|
+
const linkPopoverGraceUntilRef = (0, import_react15.useRef)(0);
|
|
11680
12110
|
setLinkPopoverRef.current = setLinkPopover;
|
|
12111
|
+
setFloatingPanelRef.current = setFloatingPanel;
|
|
11681
12112
|
linkPopoverSessionRef.current = linkPopover;
|
|
12113
|
+
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
12114
|
+
(0, import_react15.useEffect)(() => {
|
|
12115
|
+
const syncViewport = () => {
|
|
12116
|
+
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
12117
|
+
setEditorViewport((prev) => prev === next ? prev : next);
|
|
12118
|
+
};
|
|
12119
|
+
syncViewport();
|
|
12120
|
+
window.addEventListener("resize", syncViewport);
|
|
12121
|
+
return () => window.removeEventListener("resize", syncViewport);
|
|
12122
|
+
}, []);
|
|
11682
12123
|
const {
|
|
11683
12124
|
navDragRef,
|
|
11684
12125
|
navDropSlots,
|
|
@@ -11714,7 +12155,7 @@ function OhhwellsBridge() {
|
|
|
11714
12155
|
const bumpLinkPopoverGrace = () => {
|
|
11715
12156
|
linkPopoverGraceUntilRef.current = Date.now() + 350;
|
|
11716
12157
|
};
|
|
11717
|
-
const runSectionsPrefetch = (0,
|
|
12158
|
+
const runSectionsPrefetch = (0, import_react15.useCallback)((pages) => {
|
|
11718
12159
|
if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
|
|
11719
12160
|
const gen = ++sectionsPrefetchGenRef.current;
|
|
11720
12161
|
const paths = pages.map((p) => p.path);
|
|
@@ -11733,9 +12174,9 @@ function OhhwellsBridge() {
|
|
|
11733
12174
|
);
|
|
11734
12175
|
});
|
|
11735
12176
|
}, [isEditMode, pathname]);
|
|
11736
|
-
const runSectionsPrefetchRef = (0,
|
|
12177
|
+
const runSectionsPrefetchRef = (0, import_react15.useRef)(runSectionsPrefetch);
|
|
11737
12178
|
runSectionsPrefetchRef.current = runSectionsPrefetch;
|
|
11738
|
-
(0,
|
|
12179
|
+
(0, import_react15.useEffect)(() => {
|
|
11739
12180
|
if (!linkPopover) {
|
|
11740
12181
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
11741
12182
|
return;
|
|
@@ -11763,7 +12204,7 @@ function OhhwellsBridge() {
|
|
|
11763
12204
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
11764
12205
|
};
|
|
11765
12206
|
}, [linkPopover, postToParent2]);
|
|
11766
|
-
(0,
|
|
12207
|
+
(0, import_react15.useEffect)(() => {
|
|
11767
12208
|
if (!isEditMode) return;
|
|
11768
12209
|
const useFixtures = shouldUseDevFixtures();
|
|
11769
12210
|
if (useFixtures) {
|
|
@@ -11787,14 +12228,14 @@ function OhhwellsBridge() {
|
|
|
11787
12228
|
if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
|
|
11788
12229
|
return () => window.removeEventListener("message", onSitePages);
|
|
11789
12230
|
}, [isEditMode, postToParent2]);
|
|
11790
|
-
(0,
|
|
12231
|
+
(0, import_react15.useEffect)(() => {
|
|
11791
12232
|
if (!isEditMode || shouldUseDevFixtures()) return;
|
|
11792
12233
|
void loadAllSectionsManifest().then((manifest) => {
|
|
11793
12234
|
if (Object.keys(manifest).length === 0) return;
|
|
11794
12235
|
setSectionsByPath((prev) => ({ ...manifest, ...prev }));
|
|
11795
12236
|
});
|
|
11796
12237
|
}, [isEditMode]);
|
|
11797
|
-
(0,
|
|
12238
|
+
(0, import_react15.useEffect)(() => {
|
|
11798
12239
|
const update = () => {
|
|
11799
12240
|
const el = activeElRef.current ?? selectedElRef.current;
|
|
11800
12241
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
@@ -11818,10 +12259,10 @@ function OhhwellsBridge() {
|
|
|
11818
12259
|
vvp.removeEventListener("resize", update);
|
|
11819
12260
|
};
|
|
11820
12261
|
}, []);
|
|
11821
|
-
const refreshStateRules = (0,
|
|
12262
|
+
const refreshStateRules = (0, import_react15.useCallback)(() => {
|
|
11822
12263
|
editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
|
|
11823
12264
|
}, []);
|
|
11824
|
-
const processConfigRequest = (0,
|
|
12265
|
+
const processConfigRequest = (0, import_react15.useCallback)((insertAfterVal) => {
|
|
11825
12266
|
const tracker = getSectionsTracker();
|
|
11826
12267
|
let entries = [];
|
|
11827
12268
|
try {
|
|
@@ -11844,7 +12285,7 @@ function OhhwellsBridge() {
|
|
|
11844
12285
|
}
|
|
11845
12286
|
window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
|
|
11846
12287
|
}, [isEditMode]);
|
|
11847
|
-
const deactivate = (0,
|
|
12288
|
+
const deactivate = (0, import_react15.useCallback)(() => {
|
|
11848
12289
|
const el = activeElRef.current;
|
|
11849
12290
|
if (!el) return;
|
|
11850
12291
|
const key = el.dataset.ohwKey;
|
|
@@ -11877,12 +12318,12 @@ function OhhwellsBridge() {
|
|
|
11877
12318
|
setToolbarShowEditLink(false);
|
|
11878
12319
|
postToParent2({ type: "ow:exit-edit" });
|
|
11879
12320
|
}, [postToParent2]);
|
|
11880
|
-
const clearSelectedAttr = (0,
|
|
12321
|
+
const clearSelectedAttr = (0, import_react15.useCallback)(() => {
|
|
11881
12322
|
document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
|
|
11882
12323
|
el.removeAttribute("data-ohw-selected");
|
|
11883
12324
|
});
|
|
11884
12325
|
}, []);
|
|
11885
|
-
const deselect = (0,
|
|
12326
|
+
const deselect = (0, import_react15.useCallback)(() => {
|
|
11886
12327
|
clearSelectedAttr();
|
|
11887
12328
|
selectedElRef.current = null;
|
|
11888
12329
|
selectedHrefKeyRef.current = null;
|
|
@@ -11901,17 +12342,19 @@ function OhhwellsBridge() {
|
|
|
11901
12342
|
setHoveredNavContainerRect(null);
|
|
11902
12343
|
hoveredItemElRef.current = null;
|
|
11903
12344
|
setHoveredItemRect(null);
|
|
12345
|
+
setFloatingPanel(null);
|
|
12346
|
+
setLogoSizeDraft(null);
|
|
11904
12347
|
if (!activeElRef.current) {
|
|
11905
12348
|
setNavGroupForceOpen(null, false);
|
|
11906
12349
|
setToolbarRect(null);
|
|
11907
12350
|
setToolbarVariant("none");
|
|
11908
12351
|
}
|
|
11909
12352
|
}, [clearSelectedAttr]);
|
|
11910
|
-
const markSelected = (0,
|
|
12353
|
+
const markSelected = (0, import_react15.useCallback)((el) => {
|
|
11911
12354
|
clearSelectedAttr();
|
|
11912
12355
|
el.setAttribute("data-ohw-selected", "");
|
|
11913
12356
|
}, [clearSelectedAttr]);
|
|
11914
|
-
const resolveHrefKeyElement = (0,
|
|
12357
|
+
const resolveHrefKeyElement = (0, import_react15.useCallback)((hrefKey) => {
|
|
11915
12358
|
if (isFooterHrefKey(hrefKey)) {
|
|
11916
12359
|
return document.querySelector(
|
|
11917
12360
|
`footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
@@ -11926,7 +12369,7 @@ function OhhwellsBridge() {
|
|
|
11926
12369
|
`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
11927
12370
|
);
|
|
11928
12371
|
}, []);
|
|
11929
|
-
const resyncSelectedNavigationItem = (0,
|
|
12372
|
+
const resyncSelectedNavigationItem = (0, import_react15.useCallback)(() => {
|
|
11930
12373
|
const hrefKey = selectedHrefKeyRef.current;
|
|
11931
12374
|
if (hrefKey) {
|
|
11932
12375
|
const link = resolveHrefKeyElement(hrefKey);
|
|
@@ -11964,7 +12407,7 @@ function OhhwellsBridge() {
|
|
|
11964
12407
|
);
|
|
11965
12408
|
}
|
|
11966
12409
|
}, [resolveHrefKeyElement]);
|
|
11967
|
-
const reselectNavigationItem = (0,
|
|
12410
|
+
const reselectNavigationItem = (0, import_react15.useCallback)((navAnchor) => {
|
|
11968
12411
|
selectedElRef.current = navAnchor;
|
|
11969
12412
|
selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
|
|
11970
12413
|
selectedFooterColAttrRef.current = null;
|
|
@@ -11993,7 +12436,7 @@ function OhhwellsBridge() {
|
|
|
11993
12436
|
setToolbarShowEditLink(false);
|
|
11994
12437
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
11995
12438
|
}, [markSelected]);
|
|
11996
|
-
const commitNavigationTextEdit = (0,
|
|
12439
|
+
const commitNavigationTextEdit = (0, import_react15.useCallback)((navAnchor) => {
|
|
11997
12440
|
const el = activeElRef.current;
|
|
11998
12441
|
if (!el) return;
|
|
11999
12442
|
const key = el.dataset.ohwKey;
|
|
@@ -12020,7 +12463,7 @@ function OhhwellsBridge() {
|
|
|
12020
12463
|
postToParent2({ type: "ow:exit-edit" });
|
|
12021
12464
|
reselectNavigationItem(navAnchor);
|
|
12022
12465
|
}, [postToParent2, reselectNavigationItem]);
|
|
12023
|
-
const handleAddTopLevelNavItem = (0,
|
|
12466
|
+
const handleAddTopLevelNavItem = (0, import_react15.useCallback)(() => {
|
|
12024
12467
|
const items = listNavbarRootItems();
|
|
12025
12468
|
addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
|
|
12026
12469
|
deselectRef.current();
|
|
@@ -12032,7 +12475,7 @@ function OhhwellsBridge() {
|
|
|
12032
12475
|
intent: "add-nav"
|
|
12033
12476
|
});
|
|
12034
12477
|
}, []);
|
|
12035
|
-
const maybeWarnNavLinkDropdownConflict = (0,
|
|
12478
|
+
const maybeWarnNavLinkDropdownConflict = (0, import_react15.useCallback)(
|
|
12036
12479
|
(anchor) => {
|
|
12037
12480
|
if (!isNavbarHrefKey(anchor.getAttribute("data-ohw-href-key"))) return;
|
|
12038
12481
|
if (!navDropdownsOpenOnClick()) return;
|
|
@@ -12045,7 +12488,7 @@ function OhhwellsBridge() {
|
|
|
12045
12488
|
},
|
|
12046
12489
|
[postToParent2]
|
|
12047
12490
|
);
|
|
12048
|
-
const handleNavDropdownOpenChange = (0,
|
|
12491
|
+
const handleNavDropdownOpenChange = (0, import_react15.useCallback)((open) => {
|
|
12049
12492
|
const selected = selectedElRef.current;
|
|
12050
12493
|
if (!selected || !isNavigationItem2(selected)) return;
|
|
12051
12494
|
setNavGroupForceOpen(selected, open);
|
|
@@ -12057,7 +12500,7 @@ function OhhwellsBridge() {
|
|
|
12057
12500
|
}
|
|
12058
12501
|
});
|
|
12059
12502
|
}, []);
|
|
12060
|
-
const handleFooterHeadingVisibleChange = (0,
|
|
12503
|
+
const handleFooterHeadingVisibleChange = (0, import_react15.useCallback)(
|
|
12061
12504
|
(visible) => {
|
|
12062
12505
|
const selected = selectedElRef.current;
|
|
12063
12506
|
if (!selected || !isFooterFrameSelectionRef.current) return;
|
|
@@ -12081,7 +12524,7 @@ function OhhwellsBridge() {
|
|
|
12081
12524
|
},
|
|
12082
12525
|
[postToParent2]
|
|
12083
12526
|
);
|
|
12084
|
-
const enterEditOnNewItem = (0,
|
|
12527
|
+
const enterEditOnNewItem = (0, import_react15.useCallback)((anchor) => {
|
|
12085
12528
|
const label = anchor.querySelector('[data-ohw-editable="text"]');
|
|
12086
12529
|
if (!label) {
|
|
12087
12530
|
selectRef.current(anchor);
|
|
@@ -12090,7 +12533,7 @@ function OhhwellsBridge() {
|
|
|
12090
12533
|
setNavGroupForceOpen(anchor, true);
|
|
12091
12534
|
activateRef.current(label);
|
|
12092
12535
|
}, []);
|
|
12093
|
-
const handleAddChildItem = (0,
|
|
12536
|
+
const handleAddChildItem = (0, import_react15.useCallback)(() => {
|
|
12094
12537
|
const selected = selectedElRef.current;
|
|
12095
12538
|
if (!selected) return;
|
|
12096
12539
|
if (toolbarVariantRef.current === "select-frame" && isFooterFrameSelection) {
|
|
@@ -12166,7 +12609,7 @@ function OhhwellsBridge() {
|
|
|
12166
12609
|
enterEditOnNewItem(result.anchor);
|
|
12167
12610
|
});
|
|
12168
12611
|
}, [enterEditOnNewItem, isFooterFrameSelection, maybeWarnNavLinkDropdownConflict, postToParent2]);
|
|
12169
|
-
const handleAddFooterColumn = (0,
|
|
12612
|
+
const handleAddFooterColumn = (0, import_react15.useCallback)(() => {
|
|
12170
12613
|
if (!canAddFooterColumn()) {
|
|
12171
12614
|
postToParent2({
|
|
12172
12615
|
type: "ow:toast",
|
|
@@ -12187,7 +12630,7 @@ function OhhwellsBridge() {
|
|
|
12187
12630
|
selectRef.current(result.firstLink);
|
|
12188
12631
|
});
|
|
12189
12632
|
}, [postToParent2]);
|
|
12190
|
-
const clearFooterDragVisuals = (0,
|
|
12633
|
+
const clearFooterDragVisuals = (0, import_react15.useCallback)(() => {
|
|
12191
12634
|
footerDragRef.current = null;
|
|
12192
12635
|
setSiblingHintRects([]);
|
|
12193
12636
|
setFooterDropSlots([]);
|
|
@@ -12196,7 +12639,7 @@ function OhhwellsBridge() {
|
|
|
12196
12639
|
setIsItemDragging(false);
|
|
12197
12640
|
unlockFooterDragInteraction();
|
|
12198
12641
|
}, []);
|
|
12199
|
-
const refreshFooterDragVisuals = (0,
|
|
12642
|
+
const refreshFooterDragVisuals = (0, import_react15.useCallback)((session, activeSlot, clientX, clientY) => {
|
|
12200
12643
|
const dragged = session.draggedEl;
|
|
12201
12644
|
setDraggedItemRect(dragged.getBoundingClientRect());
|
|
12202
12645
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -12221,13 +12664,13 @@ function OhhwellsBridge() {
|
|
|
12221
12664
|
const activeIdx = activeSlot ? slots.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
|
|
12222
12665
|
setActiveFooterDropIndex(activeIdx >= 0 ? activeIdx : null);
|
|
12223
12666
|
}, []);
|
|
12224
|
-
const refreshFooterDragVisualsRef = (0,
|
|
12667
|
+
const refreshFooterDragVisualsRef = (0, import_react15.useRef)(refreshFooterDragVisuals);
|
|
12225
12668
|
refreshFooterDragVisualsRef.current = refreshFooterDragVisuals;
|
|
12226
|
-
const commitFooterDragRef = (0,
|
|
12669
|
+
const commitFooterDragRef = (0, import_react15.useRef)(() => {
|
|
12227
12670
|
});
|
|
12228
|
-
const beginFooterDragRef = (0,
|
|
12671
|
+
const beginFooterDragRef = (0, import_react15.useRef)(() => {
|
|
12229
12672
|
});
|
|
12230
|
-
const beginFooterDrag = (0,
|
|
12673
|
+
const beginFooterDrag = (0, import_react15.useCallback)(
|
|
12231
12674
|
(session) => {
|
|
12232
12675
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
12233
12676
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -12247,7 +12690,7 @@ function OhhwellsBridge() {
|
|
|
12247
12690
|
[refreshFooterDragVisuals]
|
|
12248
12691
|
);
|
|
12249
12692
|
beginFooterDragRef.current = beginFooterDrag;
|
|
12250
|
-
const commitFooterDrag = (0,
|
|
12693
|
+
const commitFooterDrag = (0, import_react15.useCallback)(
|
|
12251
12694
|
(clientX, clientY) => {
|
|
12252
12695
|
const session = footerDragRef.current;
|
|
12253
12696
|
if (!session) {
|
|
@@ -12351,7 +12794,7 @@ function OhhwellsBridge() {
|
|
|
12351
12794
|
[clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
|
|
12352
12795
|
);
|
|
12353
12796
|
commitFooterDragRef.current = commitFooterDrag;
|
|
12354
|
-
const startFooterLinkDrag = (0,
|
|
12797
|
+
const startFooterLinkDrag = (0, import_react15.useCallback)(
|
|
12355
12798
|
(anchor, clientX, clientY, wasSelected) => {
|
|
12356
12799
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
12357
12800
|
if (!hrefKey || !isFooterHrefKey(hrefKey)) return false;
|
|
@@ -12372,7 +12815,7 @@ function OhhwellsBridge() {
|
|
|
12372
12815
|
},
|
|
12373
12816
|
[beginFooterDrag]
|
|
12374
12817
|
);
|
|
12375
|
-
const startFooterColumnDrag = (0,
|
|
12818
|
+
const startFooterColumnDrag = (0, import_react15.useCallback)(
|
|
12376
12819
|
(columnEl, clientX, clientY, wasSelected) => {
|
|
12377
12820
|
const columns = listFooterColumns();
|
|
12378
12821
|
const idx = columns.indexOf(columnEl);
|
|
@@ -12392,7 +12835,7 @@ function OhhwellsBridge() {
|
|
|
12392
12835
|
},
|
|
12393
12836
|
[beginFooterDrag]
|
|
12394
12837
|
);
|
|
12395
|
-
const handleItemDragStart = (0,
|
|
12838
|
+
const handleItemDragStart = (0, import_react15.useCallback)(
|
|
12396
12839
|
(e) => {
|
|
12397
12840
|
const selected = selectedElRef.current;
|
|
12398
12841
|
if (!selected) {
|
|
@@ -12412,7 +12855,7 @@ function OhhwellsBridge() {
|
|
|
12412
12855
|
},
|
|
12413
12856
|
[startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag]
|
|
12414
12857
|
);
|
|
12415
|
-
const handleItemDragEnd = (0,
|
|
12858
|
+
const handleItemDragEnd = (0, import_react15.useCallback)(
|
|
12416
12859
|
(e) => {
|
|
12417
12860
|
if (footerDragRef.current) {
|
|
12418
12861
|
const x = e?.clientX;
|
|
@@ -12438,7 +12881,7 @@ function OhhwellsBridge() {
|
|
|
12438
12881
|
},
|
|
12439
12882
|
[commitFooterDrag, commitNavDrag, navDragRef]
|
|
12440
12883
|
);
|
|
12441
|
-
const handleItemChromePointerDown = (0,
|
|
12884
|
+
const handleItemChromePointerDown = (0, import_react15.useCallback)((e) => {
|
|
12442
12885
|
if (e.button !== 0) return;
|
|
12443
12886
|
const selected = selectedElRef.current;
|
|
12444
12887
|
if (!selected) return;
|
|
@@ -12469,7 +12912,7 @@ function OhhwellsBridge() {
|
|
|
12469
12912
|
}
|
|
12470
12913
|
if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
|
|
12471
12914
|
}, [armNavPressFromChrome]);
|
|
12472
|
-
const handleItemChromeClick = (0,
|
|
12915
|
+
const handleItemChromeClick = (0, import_react15.useCallback)((clientX, clientY) => {
|
|
12473
12916
|
if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
|
|
12474
12917
|
suppressNextClickRef.current = false;
|
|
12475
12918
|
return;
|
|
@@ -12482,7 +12925,7 @@ function OhhwellsBridge() {
|
|
|
12482
12925
|
}, []);
|
|
12483
12926
|
reselectNavigationItemRef.current = reselectNavigationItem;
|
|
12484
12927
|
commitNavigationTextEditRef.current = commitNavigationTextEdit;
|
|
12485
|
-
const select = (0,
|
|
12928
|
+
const select = (0, import_react15.useCallback)((anchor) => {
|
|
12486
12929
|
if (!isNavigationItem2(anchor)) return;
|
|
12487
12930
|
if (activeElRef.current) deactivate();
|
|
12488
12931
|
aiSectionApiRef.current?.selectFromElement(anchor);
|
|
@@ -12520,8 +12963,10 @@ function OhhwellsBridge() {
|
|
|
12520
12963
|
setToolbarRect(anchor.getBoundingClientRect());
|
|
12521
12964
|
setToolbarShowEditLink(false);
|
|
12522
12965
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
12966
|
+
setFloatingPanel(null);
|
|
12967
|
+
setLogoSizeDraft(null);
|
|
12523
12968
|
}, [deactivate, markSelected]);
|
|
12524
|
-
const selectFrame = (0,
|
|
12969
|
+
const selectFrame = (0, import_react15.useCallback)((el) => {
|
|
12525
12970
|
if (!isNavigationContainer(el)) return;
|
|
12526
12971
|
if (activeElRef.current) deactivate();
|
|
12527
12972
|
aiSectionApiRef.current?.selectFromElement(el);
|
|
@@ -12567,8 +13012,86 @@ function OhhwellsBridge() {
|
|
|
12567
13012
|
setToolbarRect(el.getBoundingClientRect());
|
|
12568
13013
|
setToolbarShowEditLink(false);
|
|
12569
13014
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
13015
|
+
setFloatingPanel(null);
|
|
13016
|
+
setLogoSizeDraft(null);
|
|
12570
13017
|
}, [deactivate, markSelected, postToParent2]);
|
|
12571
|
-
const
|
|
13018
|
+
const selectLogo = (0, import_react15.useCallback)(
|
|
13019
|
+
(logoEl) => {
|
|
13020
|
+
if (activeElRef.current) deactivate();
|
|
13021
|
+
selectedElRef.current = logoEl;
|
|
13022
|
+
selectedHrefKeyRef.current = null;
|
|
13023
|
+
selectedFooterColAttrRef.current = null;
|
|
13024
|
+
markSelected(logoEl);
|
|
13025
|
+
setSelectedIsCta(false);
|
|
13026
|
+
clearHrefKeyHover(logoEl);
|
|
13027
|
+
hoveredNavContainerRef.current = null;
|
|
13028
|
+
setHoveredNavContainerRect(null);
|
|
13029
|
+
setHoveredItemRect(null);
|
|
13030
|
+
hoveredItemElRef.current = null;
|
|
13031
|
+
siblingHintElRef.current = null;
|
|
13032
|
+
setSiblingHintRect(null);
|
|
13033
|
+
setSiblingHintRects([]);
|
|
13034
|
+
setIsItemDragging(false);
|
|
13035
|
+
setReorderHrefKey(null);
|
|
13036
|
+
setReorderDragDisabled(false);
|
|
13037
|
+
setIsFooterFrameSelection(false);
|
|
13038
|
+
setToolbarVariant("logo");
|
|
13039
|
+
setToolbarRect(logoEl.getBoundingClientRect());
|
|
13040
|
+
setToolbarShowEditLink(false);
|
|
13041
|
+
setActiveCommands(/* @__PURE__ */ new Set());
|
|
13042
|
+
},
|
|
13043
|
+
[deactivate, markSelected]
|
|
13044
|
+
);
|
|
13045
|
+
const openLogoSizePanel = (0, import_react15.useCallback)((logoEl) => {
|
|
13046
|
+
const placement = getLogoPlacement(logoEl);
|
|
13047
|
+
const draft = readLogoSizeState(editContentRef.current, placement);
|
|
13048
|
+
setLogoSizeDraft(draft);
|
|
13049
|
+
setParentScrollSnap(parentScrollRef.current);
|
|
13050
|
+
setFloatingPanel({
|
|
13051
|
+
key: `logo-size:${placement}`,
|
|
13052
|
+
title: "Logo",
|
|
13053
|
+
context: placement === "navbar" ? "Navbar" : "Footer",
|
|
13054
|
+
kind: "logo-size",
|
|
13055
|
+
placement
|
|
13056
|
+
});
|
|
13057
|
+
}, []);
|
|
13058
|
+
const closeFloatingPanelOnly = (0, import_react15.useCallback)(() => {
|
|
13059
|
+
setFloatingPanel(null);
|
|
13060
|
+
setLogoSizeDraft(null);
|
|
13061
|
+
}, []);
|
|
13062
|
+
const closeFloatingPanelAndDeselect = (0, import_react15.useCallback)(() => {
|
|
13063
|
+
setFloatingPanel(null);
|
|
13064
|
+
setLogoSizeDraft(null);
|
|
13065
|
+
deselectRef.current();
|
|
13066
|
+
}, []);
|
|
13067
|
+
const persistLogoSizeDraft = (0, import_react15.useCallback)(
|
|
13068
|
+
(placement, draft) => {
|
|
13069
|
+
const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
|
|
13070
|
+
const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
|
|
13071
|
+
const nodes = [
|
|
13072
|
+
{ key: desktopKey, text: String(draft.desktopPx) }
|
|
13073
|
+
];
|
|
13074
|
+
if (draft.mobileFollowing) {
|
|
13075
|
+
nodes.push({ key: mobileKey, text: "" });
|
|
13076
|
+
} else {
|
|
13077
|
+
nodes.push({ key: mobileKey, text: String(draft.mobilePx) });
|
|
13078
|
+
}
|
|
13079
|
+
editContentRef.current = {
|
|
13080
|
+
...editContentRef.current,
|
|
13081
|
+
[desktopKey]: String(draft.desktopPx),
|
|
13082
|
+
[mobileKey]: draft.mobileFollowing ? "" : String(draft.mobilePx)
|
|
13083
|
+
};
|
|
13084
|
+
applyLogoSizeToPlacement(
|
|
13085
|
+
placement,
|
|
13086
|
+
draft.desktopPx,
|
|
13087
|
+
draft.mobileFollowing ? draft.desktopPx : draft.mobilePx,
|
|
13088
|
+
draft.mobileFollowing
|
|
13089
|
+
);
|
|
13090
|
+
postToParent2({ type: "ow:change", nodes });
|
|
13091
|
+
},
|
|
13092
|
+
[postToParent2]
|
|
13093
|
+
);
|
|
13094
|
+
const activate = (0, import_react15.useCallback)((el, options) => {
|
|
12572
13095
|
if (activeElRef.current === el) return;
|
|
12573
13096
|
clearSelectedAttr();
|
|
12574
13097
|
selectedElRef.current = null;
|
|
@@ -12644,9 +13167,12 @@ function OhhwellsBridge() {
|
|
|
12644
13167
|
deactivateRef.current = deactivate;
|
|
12645
13168
|
selectRef.current = select;
|
|
12646
13169
|
selectFrameRef.current = selectFrame;
|
|
13170
|
+
selectLogoRef.current = selectLogo;
|
|
13171
|
+
openLogoSizePanelRef.current = openLogoSizePanel;
|
|
12647
13172
|
deselectRef.current = deselect;
|
|
12648
|
-
|
|
12649
|
-
(0,
|
|
13173
|
+
closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
|
|
13174
|
+
const lastSiteWideScopeRef = (0, import_react15.useRef)(null);
|
|
13175
|
+
(0, import_react15.useEffect)(() => {
|
|
12650
13176
|
if (!isEditMode) {
|
|
12651
13177
|
if (lastSiteWideScopeRef.current !== false) {
|
|
12652
13178
|
lastSiteWideScopeRef.current = false;
|
|
@@ -12672,7 +13198,7 @@ function OhhwellsBridge() {
|
|
|
12672
13198
|
isFooterFrameSelection,
|
|
12673
13199
|
postToParent2
|
|
12674
13200
|
]);
|
|
12675
|
-
(0,
|
|
13201
|
+
(0, import_react15.useLayoutEffect)(() => {
|
|
12676
13202
|
if (!subdomain || isEditMode) {
|
|
12677
13203
|
setFetchState("done");
|
|
12678
13204
|
return;
|
|
@@ -12681,6 +13207,8 @@ function OhhwellsBridge() {
|
|
|
12681
13207
|
const imageLoads = [];
|
|
12682
13208
|
for (const [key, val] of Object.entries(content)) {
|
|
12683
13209
|
if (key === "__ohw_sections") continue;
|
|
13210
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
13211
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
12684
13212
|
if (applyVideoSettingNode(key, val)) continue;
|
|
12685
13213
|
if (applyCarouselNode(key, val)) continue;
|
|
12686
13214
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -12713,6 +13241,8 @@ function OhhwellsBridge() {
|
|
|
12713
13241
|
});
|
|
12714
13242
|
applyLinkByKey(key, val);
|
|
12715
13243
|
}
|
|
13244
|
+
applyLogoFromContent(content);
|
|
13245
|
+
applyLogoSizes(content);
|
|
12716
13246
|
reconcileNavbarItemsFromContent(content);
|
|
12717
13247
|
reconcileFooterOrderFromContent(content);
|
|
12718
13248
|
enforceLinkHrefs();
|
|
@@ -12743,7 +13273,7 @@ function OhhwellsBridge() {
|
|
|
12743
13273
|
cancelled = true;
|
|
12744
13274
|
};
|
|
12745
13275
|
}, [subdomain, isEditMode]);
|
|
12746
|
-
(0,
|
|
13276
|
+
(0, import_react15.useEffect)(() => {
|
|
12747
13277
|
if (!subdomain || isEditMode) return;
|
|
12748
13278
|
let debounceTimer = null;
|
|
12749
13279
|
let observer = null;
|
|
@@ -12755,6 +13285,8 @@ function OhhwellsBridge() {
|
|
|
12755
13285
|
try {
|
|
12756
13286
|
for (const [key, val] of Object.entries(content)) {
|
|
12757
13287
|
if (key === "__ohw_sections") continue;
|
|
13288
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
13289
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
12758
13290
|
if (applyVideoSettingNode(key, val)) continue;
|
|
12759
13291
|
if (applyCarouselNode(key, val)) continue;
|
|
12760
13292
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -12775,6 +13307,7 @@ function OhhwellsBridge() {
|
|
|
12775
13307
|
});
|
|
12776
13308
|
applyLinkByKey(key, val);
|
|
12777
13309
|
}
|
|
13310
|
+
applyLogoFromContent(content);
|
|
12778
13311
|
reconcileNavbarItemsFromContent(content);
|
|
12779
13312
|
reconcileFooterOrderFromContent(content);
|
|
12780
13313
|
} finally {
|
|
@@ -12794,16 +13327,16 @@ function OhhwellsBridge() {
|
|
|
12794
13327
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
12795
13328
|
};
|
|
12796
13329
|
}, [subdomain, isEditMode, pathname]);
|
|
12797
|
-
(0,
|
|
13330
|
+
(0, import_react15.useLayoutEffect)(() => {
|
|
12798
13331
|
const el = document.getElementById("ohw-loader");
|
|
12799
13332
|
if (!el) return;
|
|
12800
13333
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
12801
13334
|
el.style.display = visible ? "flex" : "none";
|
|
12802
13335
|
}, [subdomain, fetchState]);
|
|
12803
|
-
(0,
|
|
13336
|
+
(0, import_react15.useEffect)(() => {
|
|
12804
13337
|
postToParent2({ type: "ow:navigation", path: pathname });
|
|
12805
13338
|
}, [pathname, postToParent2]);
|
|
12806
|
-
(0,
|
|
13339
|
+
(0, import_react15.useEffect)(() => {
|
|
12807
13340
|
if (!isEditMode) return;
|
|
12808
13341
|
if (linkPopoverSessionRef.current?.intent === "add-nav") return;
|
|
12809
13342
|
if (document.querySelector("[data-ohw-section-picker]")) return;
|
|
@@ -12811,7 +13344,7 @@ function OhhwellsBridge() {
|
|
|
12811
13344
|
deselectRef.current();
|
|
12812
13345
|
deactivateRef.current();
|
|
12813
13346
|
}, [pathname, isEditMode]);
|
|
12814
|
-
(0,
|
|
13347
|
+
(0, import_react15.useEffect)(() => {
|
|
12815
13348
|
const contentForNav = () => {
|
|
12816
13349
|
if (isEditMode) return editContentRef.current;
|
|
12817
13350
|
if (!subdomain) return {};
|
|
@@ -12876,7 +13409,7 @@ function OhhwellsBridge() {
|
|
|
12876
13409
|
observer?.disconnect();
|
|
12877
13410
|
};
|
|
12878
13411
|
}, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
|
|
12879
|
-
(0,
|
|
13412
|
+
(0, import_react15.useEffect)(() => {
|
|
12880
13413
|
if (!isEditMode) return;
|
|
12881
13414
|
const measure = () => {
|
|
12882
13415
|
const h = document.body.scrollHeight;
|
|
@@ -12900,7 +13433,7 @@ function OhhwellsBridge() {
|
|
|
12900
13433
|
window.removeEventListener("resize", handleResize);
|
|
12901
13434
|
};
|
|
12902
13435
|
}, [pathname, isEditMode, postToParent2]);
|
|
12903
|
-
(0,
|
|
13436
|
+
(0, import_react15.useEffect)(() => {
|
|
12904
13437
|
if (!subdomainFromQuery || isEditMode) return;
|
|
12905
13438
|
const handleClick = (e) => {
|
|
12906
13439
|
const anchor = e.target.closest("a");
|
|
@@ -12916,7 +13449,7 @@ function OhhwellsBridge() {
|
|
|
12916
13449
|
document.addEventListener("click", handleClick, true);
|
|
12917
13450
|
return () => document.removeEventListener("click", handleClick, true);
|
|
12918
13451
|
}, [subdomainFromQuery, isEditMode, router]);
|
|
12919
|
-
(0,
|
|
13452
|
+
(0, import_react15.useEffect)(() => {
|
|
12920
13453
|
if (!isEditMode) {
|
|
12921
13454
|
editStylesRef.current?.base.remove();
|
|
12922
13455
|
editStylesRef.current?.forceHover.remove();
|
|
@@ -13045,6 +13578,7 @@ function OhhwellsBridge() {
|
|
|
13045
13578
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
13046
13579
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
13047
13580
|
if (isInsideLinkEditor(target)) return;
|
|
13581
|
+
if (isInsideFloatingPanel(target)) return;
|
|
13048
13582
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
13049
13583
|
const beneath = document.elementsFromPoint(e.clientX, e.clientY).find(
|
|
13050
13584
|
(el) => el instanceof HTMLElement && !el.closest("[data-ohw-bridge-root]") && el.closest("[data-ohw-section]") != null
|
|
@@ -13112,10 +13646,15 @@ function OhhwellsBridge() {
|
|
|
13112
13646
|
if (logoEl) {
|
|
13113
13647
|
e.preventDefault();
|
|
13114
13648
|
e.stopPropagation();
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13649
|
+
if (!logoHasUploadedImage(logoEl)) {
|
|
13650
|
+
deselectRef.current();
|
|
13651
|
+
deactivateRef.current();
|
|
13652
|
+
const identity = readLogoIdentityFromDom();
|
|
13653
|
+
postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
|
|
13654
|
+
return;
|
|
13655
|
+
}
|
|
13656
|
+
selectLogoRef.current(logoEl);
|
|
13657
|
+
openLogoSizePanelRef.current(logoEl);
|
|
13119
13658
|
return;
|
|
13120
13659
|
}
|
|
13121
13660
|
const editable = target.closest("[data-ohw-editable]");
|
|
@@ -13250,6 +13789,7 @@ function OhhwellsBridge() {
|
|
|
13250
13789
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
13251
13790
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
13252
13791
|
if (isInsideLinkEditor(target)) return;
|
|
13792
|
+
if (isInsideFloatingPanel(target)) return;
|
|
13253
13793
|
if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
|
|
13254
13794
|
return;
|
|
13255
13795
|
}
|
|
@@ -14193,28 +14733,8 @@ function OhhwellsBridge() {
|
|
|
14193
14733
|
});
|
|
14194
14734
|
applyLinkByKey(key, val);
|
|
14195
14735
|
}
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
const logoText = content[LOGO_TEXT_KEYS[0]] ?? content[LOGO_TEXT_KEYS[1]] ?? readLogoIdentityFromDom().text;
|
|
14199
|
-
const logoAlt = content[LOGO_ALT_KEY] ?? logoText;
|
|
14200
|
-
const rawLogoImage = content[LOGO_IMAGE_URL_KEY] ?? content["footer-logo"] ?? content["footer-logo-image"] ?? null;
|
|
14201
|
-
const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
|
|
14202
|
-
const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
|
|
14203
|
-
const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
|
|
14204
|
-
if (logoImageUrl) {
|
|
14205
|
-
applyLogoImage(logoImageUrl, logoAlt);
|
|
14206
|
-
} else {
|
|
14207
|
-
if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
|
|
14208
|
-
applyLogoIdentity(logoText, logoIsPlaceholder);
|
|
14209
|
-
}
|
|
14210
|
-
const logoHref = content["nav-logo-href"] ?? content["footer-logo-href"] ?? content["logo-href"];
|
|
14211
|
-
if (typeof logoHref === "string" && logoHref.trim()) {
|
|
14212
|
-
applyLogoHref(logoHref);
|
|
14213
|
-
applyLinkByKey("nav-logo-href", logoHref);
|
|
14214
|
-
applyLinkByKey("footer-logo-href", logoHref);
|
|
14215
|
-
applyLinkByKey("logo-href", logoHref);
|
|
14216
|
-
}
|
|
14217
|
-
}
|
|
14736
|
+
applyLogoFromContent(content);
|
|
14737
|
+
applyLogoSizes(content);
|
|
14218
14738
|
if (sectionsJson) {
|
|
14219
14739
|
initSectionsFromContent({ __ohw_sections: sectionsJson }, true);
|
|
14220
14740
|
sectionsLoadedRef.current = true;
|
|
@@ -14276,6 +14796,7 @@ function OhhwellsBridge() {
|
|
|
14276
14796
|
...editContentRef.current,
|
|
14277
14797
|
...Object.fromEntries(nodes.map(({ key, text }) => [key, text]))
|
|
14278
14798
|
};
|
|
14799
|
+
applyLogoSizes(editContentRef.current);
|
|
14279
14800
|
postToParentRef.current({ type: "ow:change", nodes });
|
|
14280
14801
|
};
|
|
14281
14802
|
window.addEventListener("message", handleHydrate);
|
|
@@ -14287,6 +14808,12 @@ function OhhwellsBridge() {
|
|
|
14287
14808
|
closeLinkPopoverRef.current();
|
|
14288
14809
|
return;
|
|
14289
14810
|
}
|
|
14811
|
+
if (floatingPanelOpenRef.current) {
|
|
14812
|
+
setFloatingPanelRef.current(null);
|
|
14813
|
+
deselectRef.current();
|
|
14814
|
+
deactivateRef.current();
|
|
14815
|
+
return;
|
|
14816
|
+
}
|
|
14290
14817
|
deselectRef.current();
|
|
14291
14818
|
deactivateRef.current();
|
|
14292
14819
|
};
|
|
@@ -14306,6 +14833,10 @@ function OhhwellsBridge() {
|
|
|
14306
14833
|
closeLinkPopoverRef.current();
|
|
14307
14834
|
return;
|
|
14308
14835
|
}
|
|
14836
|
+
if (floatingPanelOpenRef.current) {
|
|
14837
|
+
closeFloatingPanelOnlyRef.current();
|
|
14838
|
+
return;
|
|
14839
|
+
}
|
|
14309
14840
|
if (activeElRef.current) {
|
|
14310
14841
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
14311
14842
|
const navAnchor = hrefCtx ? getNavigationItemAnchor(hrefCtx.anchor) : null;
|
|
@@ -14336,6 +14867,10 @@ function OhhwellsBridge() {
|
|
|
14336
14867
|
return;
|
|
14337
14868
|
}
|
|
14338
14869
|
if (selectedElRef.current) {
|
|
14870
|
+
if (toolbarVariantRef.current === "logo") {
|
|
14871
|
+
deselectRef.current();
|
|
14872
|
+
return;
|
|
14873
|
+
}
|
|
14339
14874
|
if (toolbarVariantRef.current === "select-frame") {
|
|
14340
14875
|
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
14341
14876
|
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
@@ -14369,7 +14904,16 @@ function OhhwellsBridge() {
|
|
|
14369
14904
|
closeLinkPopoverRef.current();
|
|
14370
14905
|
return;
|
|
14371
14906
|
}
|
|
14907
|
+
if (e.key === "Escape" && floatingPanelOpenRef.current) {
|
|
14908
|
+
e.preventDefault();
|
|
14909
|
+
closeFloatingPanelOnlyRef.current();
|
|
14910
|
+
return;
|
|
14911
|
+
}
|
|
14372
14912
|
if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
|
|
14913
|
+
if (toolbarVariantRef.current === "logo") {
|
|
14914
|
+
deselectRef.current();
|
|
14915
|
+
return;
|
|
14916
|
+
}
|
|
14373
14917
|
if (toolbarVariantRef.current === "select-frame") {
|
|
14374
14918
|
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
14375
14919
|
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
@@ -14702,6 +15246,9 @@ function OhhwellsBridge() {
|
|
|
14702
15246
|
if (e.data?.type !== "ow:parent-scroll") return;
|
|
14703
15247
|
const { iframeOffsetTop, headerH, canvasH } = e.data;
|
|
14704
15248
|
parentScrollRef.current = { iframeOffsetTop, headerH, canvasH };
|
|
15249
|
+
if (floatingPanelOpenRef.current) {
|
|
15250
|
+
setParentScrollSnap({ iframeOffsetTop, headerH, canvasH });
|
|
15251
|
+
}
|
|
14705
15252
|
if (visibleViewportRef.current) {
|
|
14706
15253
|
applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
|
|
14707
15254
|
}
|
|
@@ -14741,10 +15288,15 @@ function OhhwellsBridge() {
|
|
|
14741
15288
|
return clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
|
|
14742
15289
|
});
|
|
14743
15290
|
if (logoAtPoint) {
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
15291
|
+
if (!logoHasUploadedImage(logoAtPoint)) {
|
|
15292
|
+
deselectRef.current();
|
|
15293
|
+
deactivateRef.current();
|
|
15294
|
+
const identity = readLogoIdentityFromDom();
|
|
15295
|
+
postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
|
|
15296
|
+
return;
|
|
15297
|
+
}
|
|
15298
|
+
selectLogoRef.current(logoAtPoint);
|
|
15299
|
+
openLogoSizePanelRef.current(logoAtPoint);
|
|
14748
15300
|
return;
|
|
14749
15301
|
}
|
|
14750
15302
|
const textEditable = Array.from(
|
|
@@ -14816,6 +15368,13 @@ function OhhwellsBridge() {
|
|
|
14816
15368
|
window.addEventListener("message", handlePointerSync);
|
|
14817
15369
|
window.addEventListener("message", handleClickAt);
|
|
14818
15370
|
window.addEventListener("message", handleUpdateLogoIdentity);
|
|
15371
|
+
const handleViewMode = (e) => {
|
|
15372
|
+
if (e.data?.type !== "ow:view-mode") return;
|
|
15373
|
+
const mode = e.data.mode === "Mobile" || e.data.mode === "mobile" ? "mobile" : "desktop";
|
|
15374
|
+
setEditorViewport(mode);
|
|
15375
|
+
applyLogoSizes(editContentRef.current);
|
|
15376
|
+
};
|
|
15377
|
+
window.addEventListener("message", handleViewMode);
|
|
14819
15378
|
const handleViewportResize = () => {
|
|
14820
15379
|
if (visibleViewportRef.current) {
|
|
14821
15380
|
applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
|
|
@@ -14869,6 +15428,7 @@ function OhhwellsBridge() {
|
|
|
14869
15428
|
window.removeEventListener("message", handlePointerSync);
|
|
14870
15429
|
window.removeEventListener("message", handleClickAt);
|
|
14871
15430
|
window.removeEventListener("message", handleUpdateLogoIdentity);
|
|
15431
|
+
window.removeEventListener("message", handleViewMode);
|
|
14872
15432
|
window.removeEventListener("message", handleHydrate);
|
|
14873
15433
|
window.removeEventListener("message", handleDeactivate);
|
|
14874
15434
|
window.removeEventListener("message", handleToastAction);
|
|
@@ -14879,7 +15439,7 @@ function OhhwellsBridge() {
|
|
|
14879
15439
|
if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
|
|
14880
15440
|
};
|
|
14881
15441
|
}, [isEditMode, refreshStateRules]);
|
|
14882
|
-
(0,
|
|
15442
|
+
(0, import_react15.useEffect)(() => {
|
|
14883
15443
|
if (!isEditMode) return;
|
|
14884
15444
|
const THRESHOLD = 10;
|
|
14885
15445
|
const resolveWasSelected = (el) => {
|
|
@@ -15033,7 +15593,7 @@ function OhhwellsBridge() {
|
|
|
15033
15593
|
unlockFooterDragInteraction();
|
|
15034
15594
|
};
|
|
15035
15595
|
}, [isEditMode]);
|
|
15036
|
-
(0,
|
|
15596
|
+
(0, import_react15.useEffect)(() => {
|
|
15037
15597
|
const handler = (e) => {
|
|
15038
15598
|
if (e.data?.type !== "ow:request-schedule-config") return;
|
|
15039
15599
|
const insertAfterVal = e.data.insertAfter;
|
|
@@ -15049,7 +15609,7 @@ function OhhwellsBridge() {
|
|
|
15049
15609
|
window.addEventListener("message", handler);
|
|
15050
15610
|
return () => window.removeEventListener("message", handler);
|
|
15051
15611
|
}, [processConfigRequest]);
|
|
15052
|
-
(0,
|
|
15612
|
+
(0, import_react15.useEffect)(() => {
|
|
15053
15613
|
if (!isEditMode) return;
|
|
15054
15614
|
document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
|
|
15055
15615
|
el.removeAttribute("data-ohw-active-state");
|
|
@@ -15085,13 +15645,13 @@ function OhhwellsBridge() {
|
|
|
15085
15645
|
clearTimeout(timer);
|
|
15086
15646
|
};
|
|
15087
15647
|
}, [pathname, isEditMode, refreshStateRules, postToParent2]);
|
|
15088
|
-
(0,
|
|
15648
|
+
(0, import_react15.useEffect)(() => {
|
|
15089
15649
|
scrollToHashSectionWhenReady();
|
|
15090
15650
|
const onHashChange = () => scrollToHashSectionWhenReady();
|
|
15091
15651
|
window.addEventListener("hashchange", onHashChange);
|
|
15092
15652
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
15093
15653
|
}, [pathname]);
|
|
15094
|
-
const handleCommand = (0,
|
|
15654
|
+
const handleCommand = (0, import_react15.useCallback)((cmd) => {
|
|
15095
15655
|
const el = activeElRef.current;
|
|
15096
15656
|
const selBefore = window.getSelection();
|
|
15097
15657
|
let savedOffsets = null;
|
|
@@ -15127,7 +15687,7 @@ function OhhwellsBridge() {
|
|
|
15127
15687
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
15128
15688
|
refreshActiveCommandsRef.current();
|
|
15129
15689
|
}, []);
|
|
15130
|
-
const handleStateChange = (0,
|
|
15690
|
+
const handleStateChange = (0, import_react15.useCallback)((state) => {
|
|
15131
15691
|
if (!activeStateElRef.current) return;
|
|
15132
15692
|
const el = activeStateElRef.current;
|
|
15133
15693
|
if (state === "Default") {
|
|
@@ -15140,7 +15700,7 @@ function OhhwellsBridge() {
|
|
|
15140
15700
|
}
|
|
15141
15701
|
setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
|
|
15142
15702
|
}, [deactivate]);
|
|
15143
|
-
const reselectAfterLinkPopover = (0,
|
|
15703
|
+
const reselectAfterLinkPopover = (0, import_react15.useCallback)(
|
|
15144
15704
|
(hrefKey) => {
|
|
15145
15705
|
requestAnimationFrame(() => {
|
|
15146
15706
|
const el = resolveHrefKeyElement(hrefKey);
|
|
@@ -15149,7 +15709,7 @@ function OhhwellsBridge() {
|
|
|
15149
15709
|
},
|
|
15150
15710
|
[resolveHrefKeyElement]
|
|
15151
15711
|
);
|
|
15152
|
-
const closeLinkPopover = (0,
|
|
15712
|
+
const closeLinkPopover = (0, import_react15.useCallback)(() => {
|
|
15153
15713
|
const session = linkPopoverSessionRef.current;
|
|
15154
15714
|
addNavAfterAnchorRef.current = null;
|
|
15155
15715
|
setLinkPopover(null);
|
|
@@ -15157,9 +15717,9 @@ function OhhwellsBridge() {
|
|
|
15157
15717
|
reselectAfterLinkPopover(session.key);
|
|
15158
15718
|
}
|
|
15159
15719
|
}, [reselectAfterLinkPopover]);
|
|
15160
|
-
const closeLinkPopoverRef = (0,
|
|
15720
|
+
const closeLinkPopoverRef = (0, import_react15.useRef)(closeLinkPopover);
|
|
15161
15721
|
closeLinkPopoverRef.current = closeLinkPopover;
|
|
15162
|
-
const openLinkPopoverForActive = (0,
|
|
15722
|
+
const openLinkPopoverForActive = (0, import_react15.useCallback)(() => {
|
|
15163
15723
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
15164
15724
|
if (!hrefCtx) return;
|
|
15165
15725
|
bumpLinkPopoverGrace();
|
|
@@ -15170,7 +15730,7 @@ function OhhwellsBridge() {
|
|
|
15170
15730
|
});
|
|
15171
15731
|
deactivate();
|
|
15172
15732
|
}, [deactivate]);
|
|
15173
|
-
const openLinkPopoverForSelected = (0,
|
|
15733
|
+
const openLinkPopoverForSelected = (0, import_react15.useCallback)(() => {
|
|
15174
15734
|
const anchor = selectedElRef.current;
|
|
15175
15735
|
if (!anchor) return;
|
|
15176
15736
|
const key = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -15183,7 +15743,7 @@ function OhhwellsBridge() {
|
|
|
15183
15743
|
});
|
|
15184
15744
|
deselect();
|
|
15185
15745
|
}, [deselect]);
|
|
15186
|
-
const handleSelectParent = (0,
|
|
15746
|
+
const handleSelectParent = (0, import_react15.useCallback)(() => {
|
|
15187
15747
|
const selected = selectedElRef.current;
|
|
15188
15748
|
if (!selected) return;
|
|
15189
15749
|
if (toolbarVariantRef.current === "select-frame") {
|
|
@@ -15210,7 +15770,7 @@ function OhhwellsBridge() {
|
|
|
15210
15770
|
}
|
|
15211
15771
|
deselectRef.current();
|
|
15212
15772
|
}, []);
|
|
15213
|
-
const handleDuplicateSelected = (0,
|
|
15773
|
+
const handleDuplicateSelected = (0, import_react15.useCallback)(() => {
|
|
15214
15774
|
const selected = selectedElRef.current;
|
|
15215
15775
|
if (!selected || !isNavigationItem2(selected)) return;
|
|
15216
15776
|
const hrefKey = selected.getAttribute("data-ohw-href-key");
|
|
@@ -15300,7 +15860,7 @@ function OhhwellsBridge() {
|
|
|
15300
15860
|
});
|
|
15301
15861
|
}
|
|
15302
15862
|
}, [postToParent2]);
|
|
15303
|
-
const runPendingDeleteUndo = (0,
|
|
15863
|
+
const runPendingDeleteUndo = (0, import_react15.useCallback)(() => {
|
|
15304
15864
|
const pending = pendingDeleteUndoRef.current;
|
|
15305
15865
|
if (!pending) return false;
|
|
15306
15866
|
pendingDeleteUndoRef.current = null;
|
|
@@ -15308,7 +15868,7 @@ function OhhwellsBridge() {
|
|
|
15308
15868
|
enforceLinkHrefs();
|
|
15309
15869
|
return true;
|
|
15310
15870
|
}, []);
|
|
15311
|
-
const handleDeleteSelected = (0,
|
|
15871
|
+
const handleDeleteSelected = (0, import_react15.useCallback)(() => {
|
|
15312
15872
|
const selected = selectedElRef.current;
|
|
15313
15873
|
if (!selected) return false;
|
|
15314
15874
|
return deleteSelectedNavFooterItem({
|
|
@@ -15329,7 +15889,7 @@ function OhhwellsBridge() {
|
|
|
15329
15889
|
}, [postToParent2]);
|
|
15330
15890
|
handleDeleteSelectedRef.current = handleDeleteSelected;
|
|
15331
15891
|
runPendingDeleteUndoRef.current = runPendingDeleteUndo;
|
|
15332
|
-
const handleLinkPopoverSubmit = (0,
|
|
15892
|
+
const handleLinkPopoverSubmit = (0, import_react15.useCallback)(
|
|
15333
15893
|
(target) => {
|
|
15334
15894
|
const session = linkPopoverSessionRef.current;
|
|
15335
15895
|
if (!session) return;
|
|
@@ -15395,19 +15955,19 @@ function OhhwellsBridge() {
|
|
|
15395
15955
|
const showEditLink = toolbarShowEditLink;
|
|
15396
15956
|
const currentSections = sectionsByPath[pathname] ?? [];
|
|
15397
15957
|
linkPopoverOpenRef.current = linkPopover !== null;
|
|
15398
|
-
const handleMediaReplace = (0,
|
|
15958
|
+
const handleMediaReplace = (0, import_react15.useCallback)(
|
|
15399
15959
|
(key) => {
|
|
15400
15960
|
postToParent2({ type: "ow:image-pick", key, elementType: mediaHover?.elementType ?? "image" });
|
|
15401
15961
|
},
|
|
15402
15962
|
[postToParent2, mediaHover?.elementType]
|
|
15403
15963
|
);
|
|
15404
|
-
const handleEditCarousel = (0,
|
|
15964
|
+
const handleEditCarousel = (0, import_react15.useCallback)(
|
|
15405
15965
|
(key) => {
|
|
15406
15966
|
postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
|
|
15407
15967
|
},
|
|
15408
15968
|
[postToParent2]
|
|
15409
15969
|
);
|
|
15410
|
-
const handleMediaFadeOutComplete = (0,
|
|
15970
|
+
const handleMediaFadeOutComplete = (0, import_react15.useCallback)((key) => {
|
|
15411
15971
|
setUploadingRects((prev) => {
|
|
15412
15972
|
if (!(key in prev)) return prev;
|
|
15413
15973
|
const next = { ...prev };
|
|
@@ -15415,7 +15975,7 @@ function OhhwellsBridge() {
|
|
|
15415
15975
|
return next;
|
|
15416
15976
|
});
|
|
15417
15977
|
}, []);
|
|
15418
|
-
const handleVideoSettingsChange = (0,
|
|
15978
|
+
const handleVideoSettingsChange = (0, import_react15.useCallback)(
|
|
15419
15979
|
(key, settings) => {
|
|
15420
15980
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
15421
15981
|
const video = getVideoEl2(el);
|
|
@@ -15438,10 +15998,10 @@ function OhhwellsBridge() {
|
|
|
15438
15998
|
[postToParent2]
|
|
15439
15999
|
);
|
|
15440
16000
|
return bridgeRoot ? (0, import_react_dom3.createPortal)(
|
|
15441
|
-
/* @__PURE__ */ (0,
|
|
15442
|
-
/* @__PURE__ */ (0,
|
|
15443
|
-
isEditMode && /* @__PURE__ */ (0,
|
|
15444
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0,
|
|
16001
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
16002
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
16003
|
+
isEditMode && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
|
|
16004
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15445
16005
|
MediaOverlay,
|
|
15446
16006
|
{
|
|
15447
16007
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -15452,7 +16012,7 @@ function OhhwellsBridge() {
|
|
|
15452
16012
|
},
|
|
15453
16013
|
`uploading-${key}`
|
|
15454
16014
|
)),
|
|
15455
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0,
|
|
16015
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15456
16016
|
MediaOverlay,
|
|
15457
16017
|
{
|
|
15458
16018
|
hover: mediaHover,
|
|
@@ -15461,11 +16021,11 @@ function OhhwellsBridge() {
|
|
|
15461
16021
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
15462
16022
|
}
|
|
15463
16023
|
),
|
|
15464
|
-
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0,
|
|
15465
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0,
|
|
15466
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0,
|
|
15467
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0,
|
|
15468
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0,
|
|
16024
|
+
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
|
|
16025
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
16026
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
16027
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
16028
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15469
16029
|
"div",
|
|
15470
16030
|
{
|
|
15471
16031
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -15475,7 +16035,7 @@ function OhhwellsBridge() {
|
|
|
15475
16035
|
width: slot.width,
|
|
15476
16036
|
height: slot.height
|
|
15477
16037
|
},
|
|
15478
|
-
children: /* @__PURE__ */ (0,
|
|
16038
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15479
16039
|
DropIndicator,
|
|
15480
16040
|
{
|
|
15481
16041
|
direction: slot.direction,
|
|
@@ -15486,7 +16046,7 @@ function OhhwellsBridge() {
|
|
|
15486
16046
|
},
|
|
15487
16047
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
15488
16048
|
)),
|
|
15489
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0,
|
|
16049
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15490
16050
|
"div",
|
|
15491
16051
|
{
|
|
15492
16052
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -15496,7 +16056,7 @@ function OhhwellsBridge() {
|
|
|
15496
16056
|
width: slot.width,
|
|
15497
16057
|
height: slot.height
|
|
15498
16058
|
},
|
|
15499
|
-
children: /* @__PURE__ */ (0,
|
|
16059
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15500
16060
|
DropIndicator,
|
|
15501
16061
|
{
|
|
15502
16062
|
direction: slot.direction,
|
|
@@ -15507,10 +16067,10 @@ function OhhwellsBridge() {
|
|
|
15507
16067
|
},
|
|
15508
16068
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
15509
16069
|
)),
|
|
15510
|
-
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0,
|
|
15511
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0,
|
|
15512
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0,
|
|
15513
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0,
|
|
16070
|
+
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
16071
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
16072
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
16073
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15514
16074
|
FooterContainerChrome,
|
|
15515
16075
|
{
|
|
15516
16076
|
rect: toolbarRect,
|
|
@@ -15518,7 +16078,7 @@ function OhhwellsBridge() {
|
|
|
15518
16078
|
addDisabled: !canAddFooterColumn()
|
|
15519
16079
|
}
|
|
15520
16080
|
),
|
|
15521
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0,
|
|
16081
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15522
16082
|
ItemInteractionLayer,
|
|
15523
16083
|
{
|
|
15524
16084
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -15530,10 +16090,10 @@ function OhhwellsBridge() {
|
|
|
15530
16090
|
dragHandleLabel: reorderHrefKey ? `Reorder ${reorderHrefKey}` : "Reorder item",
|
|
15531
16091
|
onDragHandleDragStart: handleItemDragStart,
|
|
15532
16092
|
onDragHandleDragEnd: handleItemDragEnd,
|
|
15533
|
-
onItemPointerDown: handleItemChromePointerDown,
|
|
15534
|
-
onItemClick: handleItemChromeClick,
|
|
15535
|
-
itemDragSurface: !isFooterFrameSelection,
|
|
15536
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */ (0,
|
|
16093
|
+
onItemPointerDown: toolbarVariant === "logo" ? void 0 : handleItemChromePointerDown,
|
|
16094
|
+
onItemClick: toolbarVariant === "logo" ? void 0 : handleItemChromeClick,
|
|
16095
|
+
itemDragSurface: toolbarVariant !== "logo" && !isFooterFrameSelection,
|
|
16096
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15537
16097
|
ItemActionToolbar,
|
|
15538
16098
|
{
|
|
15539
16099
|
onEditLink: openLinkPopoverForSelected,
|
|
@@ -15558,8 +16118,8 @@ function OhhwellsBridge() {
|
|
|
15558
16118
|
) : void 0
|
|
15559
16119
|
}
|
|
15560
16120
|
),
|
|
15561
|
-
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0,
|
|
15562
|
-
/* @__PURE__ */ (0,
|
|
16121
|
+
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
16122
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15563
16123
|
EditGlowChrome,
|
|
15564
16124
|
{
|
|
15565
16125
|
rect: toolbarRect,
|
|
@@ -15569,7 +16129,7 @@ function OhhwellsBridge() {
|
|
|
15569
16129
|
hideHandle: isItemDragging
|
|
15570
16130
|
}
|
|
15571
16131
|
),
|
|
15572
|
-
/* @__PURE__ */ (0,
|
|
16132
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15573
16133
|
FloatingToolbar,
|
|
15574
16134
|
{
|
|
15575
16135
|
rect: toolbarRect,
|
|
@@ -15582,7 +16142,7 @@ function OhhwellsBridge() {
|
|
|
15582
16142
|
}
|
|
15583
16143
|
)
|
|
15584
16144
|
] }),
|
|
15585
|
-
maxBadge && /* @__PURE__ */ (0,
|
|
16145
|
+
maxBadge && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
15586
16146
|
"div",
|
|
15587
16147
|
{
|
|
15588
16148
|
"data-ohw-max-badge": "",
|
|
@@ -15608,7 +16168,7 @@ function OhhwellsBridge() {
|
|
|
15608
16168
|
]
|
|
15609
16169
|
}
|
|
15610
16170
|
),
|
|
15611
|
-
toggleState && !linkPopover && /* @__PURE__ */ (0,
|
|
16171
|
+
toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15612
16172
|
StateToggle,
|
|
15613
16173
|
{
|
|
15614
16174
|
rect: toggleState.rect,
|
|
@@ -15617,15 +16177,15 @@ function OhhwellsBridge() {
|
|
|
15617
16177
|
onStateChange: handleStateChange
|
|
15618
16178
|
}
|
|
15619
16179
|
),
|
|
15620
|
-
sectionGap && !linkPopover && /* @__PURE__ */ (0,
|
|
16180
|
+
sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
15621
16181
|
"div",
|
|
15622
16182
|
{
|
|
15623
16183
|
"data-ohw-section-insert-line": "",
|
|
15624
16184
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
15625
16185
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
15626
16186
|
children: [
|
|
15627
|
-
/* @__PURE__ */ (0,
|
|
15628
|
-
/* @__PURE__ */ (0,
|
|
16187
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
16188
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15629
16189
|
Badge,
|
|
15630
16190
|
{
|
|
15631
16191
|
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",
|
|
@@ -15642,11 +16202,11 @@ function OhhwellsBridge() {
|
|
|
15642
16202
|
children: "Add Section"
|
|
15643
16203
|
}
|
|
15644
16204
|
),
|
|
15645
|
-
/* @__PURE__ */ (0,
|
|
16205
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
15646
16206
|
]
|
|
15647
16207
|
}
|
|
15648
16208
|
),
|
|
15649
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0,
|
|
16209
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
15650
16210
|
LinkPopover,
|
|
15651
16211
|
{
|
|
15652
16212
|
panelRef: linkPopoverPanelRef,
|
|
@@ -15662,6 +16222,57 @@ function OhhwellsBridge() {
|
|
|
15662
16222
|
onSubmit: handleLinkPopoverSubmit
|
|
15663
16223
|
},
|
|
15664
16224
|
linkPopover.key
|
|
16225
|
+
) : null,
|
|
16226
|
+
floatingPanel && floatingPanel.kind === "logo-size" && logoSizeDraft ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16227
|
+
FloatingPanel,
|
|
16228
|
+
{
|
|
16229
|
+
open: true,
|
|
16230
|
+
title: floatingPanel.title,
|
|
16231
|
+
context: floatingPanel.context,
|
|
16232
|
+
position: floatingPanelPos,
|
|
16233
|
+
onPositionChange: setFloatingPanelPos,
|
|
16234
|
+
parentScroll: parentScrollSnap ?? parentScrollRef.current,
|
|
16235
|
+
onClose: closeFloatingPanelAndDeselect,
|
|
16236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16237
|
+
LogoSizePanel,
|
|
16238
|
+
{
|
|
16239
|
+
viewport: editorViewport,
|
|
16240
|
+
sizePx: editorViewport === "mobile" && !logoSizeDraft.mobileFollowing ? logoSizeDraft.mobilePx : logoSizeDraft.desktopPx,
|
|
16241
|
+
mobileFollowing: logoSizeDraft.mobileFollowing,
|
|
16242
|
+
onSizeChange: (px) => {
|
|
16243
|
+
const next = editorViewport === "mobile" ? { ...logoSizeDraft, mobilePx: px, mobileFollowing: false } : {
|
|
16244
|
+
...logoSizeDraft,
|
|
16245
|
+
desktopPx: px,
|
|
16246
|
+
mobilePx: logoSizeDraft.mobileFollowing ? px : logoSizeDraft.mobilePx
|
|
16247
|
+
};
|
|
16248
|
+
setLogoSizeDraft(next);
|
|
16249
|
+
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
16250
|
+
},
|
|
16251
|
+
onCustomizeMobile: () => {
|
|
16252
|
+
const next = {
|
|
16253
|
+
...logoSizeDraft,
|
|
16254
|
+
mobileFollowing: false,
|
|
16255
|
+
mobilePx: logoSizeDraft.desktopPx
|
|
16256
|
+
};
|
|
16257
|
+
setLogoSizeDraft(next);
|
|
16258
|
+
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
16259
|
+
},
|
|
16260
|
+
onResetMobile: () => {
|
|
16261
|
+
const next = {
|
|
16262
|
+
...logoSizeDraft,
|
|
16263
|
+
mobileFollowing: true,
|
|
16264
|
+
mobilePx: logoSizeDraft.desktopPx
|
|
16265
|
+
};
|
|
16266
|
+
setLogoSizeDraft(next);
|
|
16267
|
+
persistLogoSizeDraft(floatingPanel.placement, next);
|
|
16268
|
+
},
|
|
16269
|
+
onUpdateEverywhere: () => {
|
|
16270
|
+
const identity = readLogoIdentityFromDom();
|
|
16271
|
+
postToParent2({ type: "ow:open-logo-settings", ...identity });
|
|
16272
|
+
}
|
|
16273
|
+
}
|
|
16274
|
+
)
|
|
16275
|
+
}
|
|
15665
16276
|
) : null
|
|
15666
16277
|
] }),
|
|
15667
16278
|
bridgeRoot
|