@ohhwells/bridge 0.1.46-next.109 → 0.1.47
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/README.md +0 -12
- package/dist/index.cjs +114 -535
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +165 -586
- package/dist/index.js.map +1 -1
- package/dist/styles.css +18 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/OhhwellsBridge.tsx
|
|
4
|
-
import React11, { useCallback as
|
|
4
|
+
import React11, { useCallback as useCallback4, useEffect as useEffect8, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState7 } from "react";
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
6
6
|
import { flushSync } from "react-dom";
|
|
7
7
|
|
|
@@ -48,13 +48,12 @@ function useLinkHrefGuardian(...deps) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// src/ui/SchedulingWidget.tsx
|
|
51
|
-
import {
|
|
51
|
+
import { useEffect, useId, useMemo, useRef, useState as useState2 } from "react";
|
|
52
52
|
|
|
53
53
|
// src/ui/EmailCaptureModal.tsx
|
|
54
54
|
import { useState } from "react";
|
|
55
55
|
import { Dialog } from "radix-ui";
|
|
56
56
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
57
|
-
var isValidEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
58
57
|
function Spinner() {
|
|
59
58
|
return /* @__PURE__ */ jsxs(
|
|
60
59
|
"svg",
|
|
@@ -88,17 +87,12 @@ function EmailCaptureModal({ title, subtitle, onSubmit, onClose }) {
|
|
|
88
87
|
const [error, setError] = useState(null);
|
|
89
88
|
const isBook = title === "Confirm your spot";
|
|
90
89
|
const handleSubmit = async () => {
|
|
91
|
-
|
|
92
|
-
if (!trimmed) return;
|
|
93
|
-
if (!isValidEmail(trimmed)) {
|
|
94
|
-
setError("Please enter a valid email address.");
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
90
|
+
if (!email.trim()) return;
|
|
97
91
|
setLoading(true);
|
|
98
92
|
setError(null);
|
|
99
93
|
try {
|
|
100
|
-
await onSubmit(
|
|
101
|
-
setSubmittedEmail(
|
|
94
|
+
await onSubmit(email.trim());
|
|
95
|
+
setSubmittedEmail(email.trim());
|
|
102
96
|
setSuccess(true);
|
|
103
97
|
} catch (e) {
|
|
104
98
|
setError(e instanceof Error ? e.message : "Something went wrong. Please try again.");
|
|
@@ -173,10 +167,7 @@ function EmailCaptureModal({ title, subtitle, onSubmit, onClose }) {
|
|
|
173
167
|
{
|
|
174
168
|
type: "email",
|
|
175
169
|
value: email,
|
|
176
|
-
onChange: (e) =>
|
|
177
|
-
setEmail(e.target.value);
|
|
178
|
-
if (error) setError(null);
|
|
179
|
-
},
|
|
170
|
+
onChange: (e) => setEmail(e.target.value),
|
|
180
171
|
onKeyDown: handleKeyDown,
|
|
181
172
|
placeholder: "hello@gmail.com",
|
|
182
173
|
autoFocus: true,
|
|
@@ -233,20 +224,12 @@ function formatClassTime(cls) {
|
|
|
233
224
|
const em = endTotal % 60;
|
|
234
225
|
return `${h}:${cls.startTime.minutes}-${eh}:${String(em).padStart(2, "0")}`;
|
|
235
226
|
}
|
|
236
|
-
function formatBookingLabel(cls) {
|
|
237
|
-
const price = cls.price;
|
|
238
|
-
const isFree = price === null || price === void 0 || `${price}` === "" || `${price}` === "0";
|
|
239
|
-
return isFree ? "Book for free" : `Book for ${cls.currency ?? ""} ${price}`.trim();
|
|
240
|
-
}
|
|
241
227
|
function getBookingsOnDate(cls, date) {
|
|
242
228
|
if (!cls.bookings?.length) return 0;
|
|
243
|
-
const
|
|
244
|
-
target.setHours(0, 0, 0, 0);
|
|
229
|
+
const ds = date.toISOString().split("T")[0];
|
|
245
230
|
return cls.bookings.filter((b) => {
|
|
246
231
|
try {
|
|
247
|
-
|
|
248
|
-
bookingDate.setHours(0, 0, 0, 0);
|
|
249
|
-
return bookingDate.getTime() === target.getTime();
|
|
232
|
+
return new Date(b.classDate).toISOString().split("T")[0] === ds;
|
|
250
233
|
} catch {
|
|
251
234
|
return false;
|
|
252
235
|
}
|
|
@@ -511,7 +494,7 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
|
|
|
511
494
|
}
|
|
512
495
|
)
|
|
513
496
|
] }),
|
|
514
|
-
|
|
497
|
+
/* @__PURE__ */ jsx2("div", { className: "sm:hidden flex flex-col gap-px", children: isFull ? /* @__PURE__ */ jsx2("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: "Full" }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
515
498
|
/* @__PURE__ */ jsxs2("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: [
|
|
516
499
|
available,
|
|
517
500
|
"/",
|
|
@@ -523,17 +506,9 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
|
|
|
523
506
|
/* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col gap-2 min-w-0 sm:contents", children: [
|
|
524
507
|
/* @__PURE__ */ jsxs2("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
525
508
|
/* @__PURE__ */ jsx2("span", { className: "font-body text-base font-bold text-(--color-dark,#200C02) block truncate", children: cls.name }),
|
|
526
|
-
cls.hostName && /* @__PURE__ */ jsx2("span", { className: "font-body text-base font-normal text-(--color-dark,#200C02) opacity-80 block truncate", children: cls.hostName })
|
|
527
|
-
cls.description && /* @__PURE__ */ jsx2(
|
|
528
|
-
"span",
|
|
529
|
-
{
|
|
530
|
-
className: "font-body text-base font-normal text-(--color-dark,#200C02) opacity-80 block",
|
|
531
|
-
style: { wordBreak: "break-word" },
|
|
532
|
-
children: cls.description
|
|
533
|
-
}
|
|
534
|
-
)
|
|
509
|
+
cls.hostName && /* @__PURE__ */ jsx2("span", { className: "font-body text-base font-normal text-(--color-dark,#200C02) opacity-80 block truncate", children: cls.hostName })
|
|
535
510
|
] }),
|
|
536
|
-
|
|
511
|
+
/* @__PURE__ */ jsx2("div", { className: "hidden sm:flex w-14 shrink-0 flex-col gap-px", children: isFull ? /* @__PURE__ */ jsx2("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: "Full" }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
537
512
|
/* @__PURE__ */ jsxs2("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: [
|
|
538
513
|
available,
|
|
539
514
|
"/",
|
|
@@ -558,7 +533,7 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
|
|
|
558
533
|
if (!cls.id) return;
|
|
559
534
|
onOpenModal?.(isFull ? "waitlist" : "book", cls.id, selectedDate);
|
|
560
535
|
},
|
|
561
|
-
children: isFull ? "Join Waitlist" :
|
|
536
|
+
children: isFull ? "Join Waitlist" : "Book Now"
|
|
562
537
|
}
|
|
563
538
|
)
|
|
564
539
|
] })
|
|
@@ -600,17 +575,6 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
600
575
|
const [isHovered, setIsHovered] = useState2(false);
|
|
601
576
|
const [modalState, setModalState] = useState2(null);
|
|
602
577
|
const switchScheduleIdRef = useRef(null);
|
|
603
|
-
const liveScheduleIdRef = useRef(null);
|
|
604
|
-
const refetchLiveSchedule = useCallback(async () => {
|
|
605
|
-
const id = liveScheduleIdRef.current;
|
|
606
|
-
if (!id) return;
|
|
607
|
-
try {
|
|
608
|
-
const res = await fetch(`${API_URL}/api/schedule/id/${id}`);
|
|
609
|
-
const data = await res.json();
|
|
610
|
-
if (data?.id) setSchedule(data);
|
|
611
|
-
} catch {
|
|
612
|
-
}
|
|
613
|
-
}, []);
|
|
614
578
|
const dates = useMemo(() => {
|
|
615
579
|
const today = /* @__PURE__ */ new Date();
|
|
616
580
|
today.setHours(0, 0, 0, 0);
|
|
@@ -630,18 +594,6 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
630
594
|
}
|
|
631
595
|
}
|
|
632
596
|
}, [schedule, dates]);
|
|
633
|
-
useEffect(() => {
|
|
634
|
-
if (typeof window === "undefined") return;
|
|
635
|
-
const onVisible = () => {
|
|
636
|
-
if (!document.hidden) void refetchLiveSchedule();
|
|
637
|
-
};
|
|
638
|
-
window.addEventListener("focus", refetchLiveSchedule);
|
|
639
|
-
document.addEventListener("visibilitychange", onVisible);
|
|
640
|
-
return () => {
|
|
641
|
-
window.removeEventListener("focus", refetchLiveSchedule);
|
|
642
|
-
document.removeEventListener("visibilitychange", onVisible);
|
|
643
|
-
};
|
|
644
|
-
}, [refetchLiveSchedule]);
|
|
645
597
|
useEffect(() => {
|
|
646
598
|
if (typeof window === "undefined") return;
|
|
647
599
|
const isInEditor = window.self !== window.top;
|
|
@@ -703,7 +655,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
703
655
|
setLoading(false);
|
|
704
656
|
return;
|
|
705
657
|
}
|
|
706
|
-
|
|
658
|
+
;
|
|
707
659
|
(async () => {
|
|
708
660
|
try {
|
|
709
661
|
const res = await fetch(`${API_URL}/api/schedule/id/${effectiveId}`);
|
|
@@ -760,14 +712,18 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
760
712
|
const data = await res.json().catch(() => ({}));
|
|
761
713
|
throw new Error(data?.message ?? "Something went wrong. Please try again.");
|
|
762
714
|
}
|
|
763
|
-
await refetchLiveSchedule();
|
|
764
715
|
};
|
|
765
716
|
const handleReplaceSchedule = () => {
|
|
766
717
|
setIsHovered(false);
|
|
767
|
-
|
|
768
|
-
{
|
|
769
|
-
|
|
770
|
-
|
|
718
|
+
if (schedule) {
|
|
719
|
+
window.parent.postMessage({
|
|
720
|
+
type: "ow:schedule-connected",
|
|
721
|
+
schedule: { id: schedule.id, name: schedule.name },
|
|
722
|
+
insertAfter
|
|
723
|
+
}, "*");
|
|
724
|
+
} else {
|
|
725
|
+
window.parent.postMessage({ type: "ow:scheduling-not-connected", insertAfter }, "*");
|
|
726
|
+
}
|
|
771
727
|
};
|
|
772
728
|
if (!inEditor && !loading && !schedule) return null;
|
|
773
729
|
const sectionId = `scheduling-${insertAfter}`;
|
|
@@ -810,19 +766,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
810
766
|
),
|
|
811
767
|
/* @__PURE__ */ jsxs2("div", { className: "max-w-[1280px] mx-auto flex flex-col items-center gap-16", children: [
|
|
812
768
|
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-4", children: [
|
|
813
|
-
/* @__PURE__ */ jsx2(
|
|
814
|
-
"h2",
|
|
815
|
-
{
|
|
816
|
-
className: "font-display text-center m-0 text-(--color-dark,#200C02)",
|
|
817
|
-
style: {
|
|
818
|
-
fontSize: "var(--fs-section-h2, clamp(40px, 4.4vw, 64px))",
|
|
819
|
-
fontWeight: "var(--font-weight-heading, 400)",
|
|
820
|
-
lineHeight: 1.05,
|
|
821
|
-
letterSpacing: "-0.02em"
|
|
822
|
-
},
|
|
823
|
-
children: schedule?.name ?? "Book an appointment"
|
|
824
|
-
}
|
|
825
|
-
),
|
|
769
|
+
/* @__PURE__ */ jsx2("h2", { className: "font-display text-4xl sm:text-5xl font-bold text-center m-0 text-(--color-dark,#200C02)", children: schedule?.name ?? "Book an appointment" }),
|
|
826
770
|
schedule?.description && /* @__PURE__ */ jsx2("p", { className: "font-body text-body text-center m-0 text-(--color-accent,#A89B83)", children: schedule.description })
|
|
827
771
|
] }),
|
|
828
772
|
/* @__PURE__ */ jsxs2("div", { className: "w-full flex flex-col items-end gap-3", children: [
|
|
@@ -4882,11 +4826,7 @@ function MediaOverlay({
|
|
|
4882
4826
|
variant: "outline",
|
|
4883
4827
|
size: "sm",
|
|
4884
4828
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
4885
|
-
style:
|
|
4886
|
-
...OVERLAY_BUTTON_STYLE,
|
|
4887
|
-
// Don't let Replace steal clicks when text (e.g. nav) sits on top of this media.
|
|
4888
|
-
pointerEvents: hover.hasTextOverlap ? "none" : "auto"
|
|
4889
|
-
},
|
|
4829
|
+
style: OVERLAY_BUTTON_STYLE,
|
|
4890
4830
|
onMouseDown: (e) => e.preventDefault(),
|
|
4891
4831
|
onClick: (e) => {
|
|
4892
4832
|
e.stopPropagation();
|
|
@@ -5663,7 +5603,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
5663
5603
|
}
|
|
5664
5604
|
|
|
5665
5605
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
5666
|
-
import { useCallback
|
|
5606
|
+
import { useCallback, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as useState4 } from "react";
|
|
5667
5607
|
import { createPortal } from "react-dom";
|
|
5668
5608
|
import { ArrowLeft, Check } from "lucide-react";
|
|
5669
5609
|
import { usePathname, useRouter } from "next/navigation";
|
|
@@ -5794,7 +5734,7 @@ function SectionPickerOverlay({
|
|
|
5794
5734
|
);
|
|
5795
5735
|
sectionIdsRef.current = sectionIds;
|
|
5796
5736
|
const rects = useSectionRects(sectionIdsKey, isOnTargetPage);
|
|
5797
|
-
const applyHoverAt =
|
|
5737
|
+
const applyHoverAt = useCallback(
|
|
5798
5738
|
(x, y, liveRects) => {
|
|
5799
5739
|
const ids = sectionIdsRef.current;
|
|
5800
5740
|
const map = liveRects ?? readSectionRects(ids);
|
|
@@ -5874,7 +5814,7 @@ function SectionPickerOverlay({
|
|
|
5874
5814
|
window.removeEventListener("message", onPointerSync);
|
|
5875
5815
|
};
|
|
5876
5816
|
}, [rects, applyHoverAt]);
|
|
5877
|
-
const handleSelect =
|
|
5817
|
+
const handleSelect = useCallback(
|
|
5878
5818
|
(section) => {
|
|
5879
5819
|
if (selectedId) return;
|
|
5880
5820
|
setSelectedId(section.id);
|
|
@@ -6005,7 +5945,7 @@ function SectionPickerOverlay({
|
|
|
6005
5945
|
}
|
|
6006
5946
|
|
|
6007
5947
|
// src/ui/link-modal/useLinkModalState.ts
|
|
6008
|
-
import { useCallback as
|
|
5948
|
+
import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
|
|
6009
5949
|
function useLinkModalState({
|
|
6010
5950
|
open,
|
|
6011
5951
|
mode,
|
|
@@ -6024,7 +5964,7 @@ function useLinkModalState({
|
|
|
6024
5964
|
const [step, setStep] = useState5("input");
|
|
6025
5965
|
const [dropdownOpen, setDropdownOpen] = useState5(false);
|
|
6026
5966
|
const [urlError, setUrlError] = useState5("");
|
|
6027
|
-
const reset =
|
|
5967
|
+
const reset = useCallback2(() => {
|
|
6028
5968
|
setSearchValue("");
|
|
6029
5969
|
setSelectedPage(null);
|
|
6030
5970
|
setSelectedSection(null);
|
|
@@ -7010,195 +6950,7 @@ function parseFooterOrder(content) {
|
|
|
7010
6950
|
return null;
|
|
7011
6951
|
}
|
|
7012
6952
|
}
|
|
7013
|
-
var FOOTER_HEADING_RE = /^footer-(\d+)-heading$/;
|
|
7014
|
-
var FOOTER_LABEL_RE = /^footer-(\d+)-(\d+)-label$/;
|
|
7015
|
-
var DEFAULT_FOOTER_COLUMN_HEADING = "New";
|
|
7016
|
-
var DEFAULT_FOOTER_COLUMN_LINK_LABEL = "New link";
|
|
7017
|
-
var DEFAULT_FOOTER_COLUMN_LINK_HREF = "";
|
|
7018
|
-
function isFooterLinksContainer(el) {
|
|
7019
|
-
return el.hasAttribute("data-ohw-footer-links") || el.classList.contains("rb-footer-links");
|
|
7020
|
-
}
|
|
7021
|
-
function getFooterColumnIndicesInDom() {
|
|
7022
|
-
const indices = /* @__PURE__ */ new Set();
|
|
7023
|
-
for (const col of listFooterColumns()) {
|
|
7024
|
-
const attr = col.getAttribute("data-ohw-footer-col");
|
|
7025
|
-
if (attr != null) {
|
|
7026
|
-
const n = parseInt(attr, 10);
|
|
7027
|
-
if (Number.isFinite(n)) indices.add(n);
|
|
7028
|
-
}
|
|
7029
|
-
for (const link of listFooterLinksInColumn(col)) {
|
|
7030
|
-
const parsed = parseFooterHrefKey(link.getAttribute("data-ohw-href-key"));
|
|
7031
|
-
if (parsed) indices.add(parsed.col);
|
|
7032
|
-
}
|
|
7033
|
-
const heading = col.querySelector('[data-ohw-key^="footer-"][data-ohw-key$="-heading"]');
|
|
7034
|
-
const headingKey = heading?.getAttribute("data-ohw-key");
|
|
7035
|
-
if (headingKey) {
|
|
7036
|
-
const match = headingKey.match(FOOTER_HEADING_RE);
|
|
7037
|
-
if (match) indices.add(parseInt(match[1], 10));
|
|
7038
|
-
}
|
|
7039
|
-
}
|
|
7040
|
-
return [...indices].sort((a, b) => a - b);
|
|
7041
|
-
}
|
|
7042
|
-
function getNextFooterColumnIndex() {
|
|
7043
|
-
const indices = getFooterColumnIndicesInDom();
|
|
7044
|
-
if (indices.length === 0) return 0;
|
|
7045
|
-
return Math.max(...indices) + 1;
|
|
7046
|
-
}
|
|
7047
|
-
function cloneFooterLinkShell(template) {
|
|
7048
|
-
const anchor = document.createElement("a");
|
|
7049
|
-
if (template) {
|
|
7050
|
-
anchor.style.cssText = template.style.cssText;
|
|
7051
|
-
if (template.className) anchor.className = template.className;
|
|
7052
|
-
}
|
|
7053
|
-
anchor.style.cursor = "pointer";
|
|
7054
|
-
anchor.style.textDecoration = "none";
|
|
7055
|
-
return anchor;
|
|
7056
|
-
}
|
|
7057
|
-
function buildFooterHeading(colIndex, text) {
|
|
7058
|
-
const heading = document.createElement("p");
|
|
7059
|
-
heading.setAttribute("data-ohw-editable", "text");
|
|
7060
|
-
heading.setAttribute("data-ohw-key", `footer-${colIndex}-heading`);
|
|
7061
|
-
heading.textContent = text;
|
|
7062
|
-
heading.style.cssText = [
|
|
7063
|
-
"color: var(--espresso, #3d312b)",
|
|
7064
|
-
"font-size: 14px",
|
|
7065
|
-
"font-weight: 800",
|
|
7066
|
-
"opacity: 0.82",
|
|
7067
|
-
"margin: 0 0 6px",
|
|
7068
|
-
"padding: 0",
|
|
7069
|
-
"line-height: 1.2"
|
|
7070
|
-
].join(";");
|
|
7071
|
-
return heading;
|
|
7072
|
-
}
|
|
7073
|
-
function buildFooterLink(colIndex, itemIndex, href, label, template) {
|
|
7074
|
-
const anchor = cloneFooterLinkShell(template);
|
|
7075
|
-
anchor.setAttribute("href", href);
|
|
7076
|
-
anchor.setAttribute("data-ohw-href-key", `footer-${colIndex}-${itemIndex}-href`);
|
|
7077
|
-
const span = document.createElement("span");
|
|
7078
|
-
span.setAttribute("data-ohw-editable", "text");
|
|
7079
|
-
span.setAttribute("data-ohw-key", `footer-${colIndex}-${itemIndex}-label`);
|
|
7080
|
-
span.textContent = label;
|
|
7081
|
-
anchor.appendChild(span);
|
|
7082
|
-
return anchor;
|
|
7083
|
-
}
|
|
7084
|
-
function footerColumnExistsInDom(colIndex) {
|
|
7085
|
-
return document.querySelector(`[data-ohw-footer-col="${colIndex}"]`) !== null || document.querySelector(`[data-ohw-href-key^="footer-${colIndex}-"]`) !== null || document.querySelector(`[data-ohw-key="footer-${colIndex}-heading"]`) !== null;
|
|
7086
|
-
}
|
|
7087
|
-
function getFooterLinkTemplate() {
|
|
7088
|
-
for (const col of listFooterColumns()) {
|
|
7089
|
-
const link = listFooterLinksInColumn(col)[0];
|
|
7090
|
-
if (link) return link;
|
|
7091
|
-
}
|
|
7092
|
-
return null;
|
|
7093
|
-
}
|
|
7094
|
-
function getFooterColumnTemplate() {
|
|
7095
|
-
return listFooterColumns()[0] ?? null;
|
|
7096
|
-
}
|
|
7097
|
-
function insertFooterColumnDom(colIndex, heading, items) {
|
|
7098
|
-
const container = getFooterLinksContainer();
|
|
7099
|
-
if (!container) return null;
|
|
7100
|
-
const colTemplate = getFooterColumnTemplate();
|
|
7101
|
-
const linkTemplate = getFooterLinkTemplate();
|
|
7102
|
-
const column = document.createElement("div");
|
|
7103
|
-
if (colTemplate?.className) column.className = colTemplate.className;
|
|
7104
|
-
else column.className = "rb-footer-link-col";
|
|
7105
|
-
column.setAttribute("data-ohw-footer-col", String(colIndex));
|
|
7106
|
-
if (colTemplate) {
|
|
7107
|
-
const gap = getComputedStyle(colTemplate).gap;
|
|
7108
|
-
if (gap && gap !== "normal") column.style.gap = gap;
|
|
7109
|
-
column.style.display = getComputedStyle(colTemplate).display || "flex";
|
|
7110
|
-
column.style.flexDirection = "column";
|
|
7111
|
-
}
|
|
7112
|
-
column.appendChild(buildFooterHeading(colIndex, heading));
|
|
7113
|
-
let firstLink = null;
|
|
7114
|
-
items.forEach((item, itemIndex) => {
|
|
7115
|
-
const link = buildFooterLink(colIndex, itemIndex, item.href, item.label, linkTemplate);
|
|
7116
|
-
column.appendChild(link);
|
|
7117
|
-
if (!firstLink) firstLink = link;
|
|
7118
|
-
});
|
|
7119
|
-
container.appendChild(column);
|
|
7120
|
-
return { column, firstLink };
|
|
7121
|
-
}
|
|
7122
|
-
function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL, linkHref = DEFAULT_FOOTER_COLUMN_LINK_HREF) {
|
|
7123
|
-
const colIndex = getNextFooterColumnIndex();
|
|
7124
|
-
const inserted = insertFooterColumnDom(colIndex, heading, [{ href: linkHref, label: linkLabel }]);
|
|
7125
|
-
if (!inserted?.firstLink) throw new Error("Failed to insert footer column");
|
|
7126
|
-
syncFooterColumnIndices(listFooterColumns());
|
|
7127
|
-
return {
|
|
7128
|
-
column: inserted.column,
|
|
7129
|
-
firstLink: inserted.firstLink,
|
|
7130
|
-
colIndex,
|
|
7131
|
-
headingKey: `footer-${colIndex}-heading`,
|
|
7132
|
-
hrefKey: `footer-${colIndex}-0-href`,
|
|
7133
|
-
labelKey: `footer-${colIndex}-0-label`,
|
|
7134
|
-
heading,
|
|
7135
|
-
label: linkLabel,
|
|
7136
|
-
href: linkHref,
|
|
7137
|
-
order: getFooterOrderFromDom()
|
|
7138
|
-
};
|
|
7139
|
-
}
|
|
7140
|
-
function collectFooterColumnIndicesFromContent(content) {
|
|
7141
|
-
const indices = /* @__PURE__ */ new Set();
|
|
7142
|
-
for (const key of Object.keys(content)) {
|
|
7143
|
-
const href = parseFooterHrefKey(key);
|
|
7144
|
-
if (href) indices.add(href.col);
|
|
7145
|
-
const heading = key.match(FOOTER_HEADING_RE);
|
|
7146
|
-
if (heading) indices.add(parseInt(heading[1], 10));
|
|
7147
|
-
const label = key.match(FOOTER_LABEL_RE);
|
|
7148
|
-
if (label) indices.add(parseInt(label[1], 10));
|
|
7149
|
-
}
|
|
7150
|
-
const order = parseFooterOrder(content);
|
|
7151
|
-
if (order) {
|
|
7152
|
-
for (const col of order) {
|
|
7153
|
-
for (const hrefKey of col) {
|
|
7154
|
-
const parsed = parseFooterHrefKey(hrefKey);
|
|
7155
|
-
if (parsed) indices.add(parsed.col);
|
|
7156
|
-
}
|
|
7157
|
-
}
|
|
7158
|
-
}
|
|
7159
|
-
return [...indices].sort((a, b) => a - b);
|
|
7160
|
-
}
|
|
7161
|
-
function collectFooterItemsForColumn(content, colIndex) {
|
|
7162
|
-
const itemIndices = /* @__PURE__ */ new Set();
|
|
7163
|
-
for (const key of Object.keys(content)) {
|
|
7164
|
-
const href = parseFooterHrefKey(key);
|
|
7165
|
-
if (href?.col === colIndex) itemIndices.add(href.item);
|
|
7166
|
-
const label = key.match(FOOTER_LABEL_RE);
|
|
7167
|
-
if (label && parseInt(label[1], 10) === colIndex) {
|
|
7168
|
-
itemIndices.add(parseInt(label[2], 10));
|
|
7169
|
-
}
|
|
7170
|
-
}
|
|
7171
|
-
const sorted = [...itemIndices].sort((a, b) => a - b);
|
|
7172
|
-
if (sorted.length === 0) {
|
|
7173
|
-
return [
|
|
7174
|
-
{
|
|
7175
|
-
href: content[`footer-${colIndex}-0-href`] ?? DEFAULT_FOOTER_COLUMN_LINK_HREF,
|
|
7176
|
-
label: content[`footer-${colIndex}-0-label`] ?? DEFAULT_FOOTER_COLUMN_LINK_LABEL
|
|
7177
|
-
}
|
|
7178
|
-
];
|
|
7179
|
-
}
|
|
7180
|
-
return sorted.map((itemIndex) => ({
|
|
7181
|
-
href: content[`footer-${colIndex}-${itemIndex}-href`] ?? DEFAULT_FOOTER_COLUMN_LINK_HREF,
|
|
7182
|
-
label: content[`footer-${colIndex}-${itemIndex}-label`] ?? DEFAULT_FOOTER_COLUMN_LINK_LABEL
|
|
7183
|
-
}));
|
|
7184
|
-
}
|
|
7185
|
-
function reconcileFooterColumnsFromContent(content) {
|
|
7186
|
-
const indices = collectFooterColumnIndicesFromContent(content);
|
|
7187
|
-
for (const colIndex of indices) {
|
|
7188
|
-
if (footerColumnExistsInDom(colIndex)) continue;
|
|
7189
|
-
const heading = content[`footer-${colIndex}-heading`] ?? DEFAULT_FOOTER_COLUMN_HEADING;
|
|
7190
|
-
const items = collectFooterItemsForColumn(content, colIndex);
|
|
7191
|
-
const hasPayload = Boolean(content[`footer-${colIndex}-heading`]) || items.some(
|
|
7192
|
-
(_, i) => content[`footer-${colIndex}-${i}-href`] !== void 0 || content[`footer-${colIndex}-${i}-label`] !== void 0
|
|
7193
|
-
) || (parseFooterOrder(content)?.some(
|
|
7194
|
-
(col) => col.some((k) => parseFooterHrefKey(k)?.col === colIndex)
|
|
7195
|
-
) ?? false);
|
|
7196
|
-
if (!hasPayload) continue;
|
|
7197
|
-
insertFooterColumnDom(colIndex, heading, items);
|
|
7198
|
-
}
|
|
7199
|
-
}
|
|
7200
6953
|
function reconcileFooterOrderFromContent(content) {
|
|
7201
|
-
reconcileFooterColumnsFromContent(content);
|
|
7202
6954
|
const order = parseFooterOrder(content);
|
|
7203
6955
|
if (!order?.length) return;
|
|
7204
6956
|
const current = getFooterOrderFromDom();
|
|
@@ -7208,26 +6960,6 @@ function reconcileFooterOrderFromContent(content) {
|
|
|
7208
6960
|
}
|
|
7209
6961
|
applyFooterOrder(order);
|
|
7210
6962
|
}
|
|
7211
|
-
function resolveFooterLinksContainerSelectionTarget(target, clientX, clientY, isPointOverItem) {
|
|
7212
|
-
const container = getFooterLinksContainer();
|
|
7213
|
-
if (!container) return null;
|
|
7214
|
-
const inContainer = target === container || container.contains(target) && Boolean(target.closest("[data-ohw-footer-links], .rb-footer-links"));
|
|
7215
|
-
if (!inContainer && target !== container) {
|
|
7216
|
-
const r2 = container.getBoundingClientRect();
|
|
7217
|
-
const over = clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
|
|
7218
|
-
if (!over) return null;
|
|
7219
|
-
}
|
|
7220
|
-
if (isPointOverItem(container, clientX, clientY)) return null;
|
|
7221
|
-
const column = target.closest("[data-ohw-footer-col], [data-ohw-footer-column]") ?? null;
|
|
7222
|
-
if (column && container.contains(column)) {
|
|
7223
|
-
if (target === column || column.contains(target)) return null;
|
|
7224
|
-
}
|
|
7225
|
-
if (target === container || container.contains(target) || inContainer) {
|
|
7226
|
-
if (target === container || isFooterLinksContainer(target)) return container;
|
|
7227
|
-
if (!column) return container;
|
|
7228
|
-
}
|
|
7229
|
-
return null;
|
|
7230
|
-
}
|
|
7231
6963
|
function isRowLayoutColumn(links) {
|
|
7232
6964
|
if (links.length < 2) return false;
|
|
7233
6965
|
const firstTop = links[0].getBoundingClientRect().top;
|
|
@@ -7383,30 +7115,6 @@ function hitTestColumnDropSlot(clientX, _clientY) {
|
|
|
7383
7115
|
return best?.slot ?? null;
|
|
7384
7116
|
}
|
|
7385
7117
|
|
|
7386
|
-
// src/lib/add-footer-column.ts
|
|
7387
|
-
function buildFooterColumnEditContentPatch(result) {
|
|
7388
|
-
return {
|
|
7389
|
-
[result.headingKey]: result.heading,
|
|
7390
|
-
[result.hrefKey]: result.href,
|
|
7391
|
-
[result.labelKey]: result.label,
|
|
7392
|
-
[FOOTER_ORDER_KEY]: JSON.stringify(result.order)
|
|
7393
|
-
};
|
|
7394
|
-
}
|
|
7395
|
-
function addFooterColumnWithPersist({
|
|
7396
|
-
postToParent: postToParent2
|
|
7397
|
-
}) {
|
|
7398
|
-
const result = insertFooterColumn();
|
|
7399
|
-
const patch = buildFooterColumnEditContentPatch(result);
|
|
7400
|
-
setStoredLinkHref(result.hrefKey, result.href);
|
|
7401
|
-
postToParent2({
|
|
7402
|
-
type: "ow:change",
|
|
7403
|
-
nodes: Object.entries(patch).map(([key, text]) => ({ key, text }))
|
|
7404
|
-
});
|
|
7405
|
-
postToParent2({ type: "ow:toast", title: "Item added", toastType: "success" });
|
|
7406
|
-
enforceLinkHrefs();
|
|
7407
|
-
return result;
|
|
7408
|
-
}
|
|
7409
|
-
|
|
7410
7118
|
// src/lib/item-drag-interaction.ts
|
|
7411
7119
|
function disableNativeHrefDrag(el) {
|
|
7412
7120
|
if (el.draggable) el.draggable = false;
|
|
@@ -7604,7 +7312,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
|
|
|
7604
7312
|
}
|
|
7605
7313
|
|
|
7606
7314
|
// src/useNavItemDrag.ts
|
|
7607
|
-
import { useCallback as
|
|
7315
|
+
import { useCallback as useCallback3, useEffect as useEffect7, useRef as useRef6, useState as useState6 } from "react";
|
|
7608
7316
|
function useNavItemDrag({
|
|
7609
7317
|
isEditMode,
|
|
7610
7318
|
editContentRef,
|
|
@@ -7633,7 +7341,7 @@ function useNavItemDrag({
|
|
|
7633
7341
|
const [navDropSlots, setNavDropSlots] = useState6([]);
|
|
7634
7342
|
const [activeNavDropIndex, setActiveNavDropIndex] = useState6(null);
|
|
7635
7343
|
const navPointerDragRef = useRef6(null);
|
|
7636
|
-
const clearNavDragVisuals =
|
|
7344
|
+
const clearNavDragVisuals = useCallback3(() => {
|
|
7637
7345
|
navDragRef.current = null;
|
|
7638
7346
|
setNavDropSlots([]);
|
|
7639
7347
|
setActiveNavDropIndex(null);
|
|
@@ -7642,7 +7350,7 @@ function useNavItemDrag({
|
|
|
7642
7350
|
setIsItemDragging(false);
|
|
7643
7351
|
unlockItemDragInteraction();
|
|
7644
7352
|
}, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
|
|
7645
|
-
const refreshNavDragVisuals =
|
|
7353
|
+
const refreshNavDragVisuals = useCallback3(
|
|
7646
7354
|
(session, activeSlot, clientX, clientY) => {
|
|
7647
7355
|
setDraggedItemRect(session.draggedEl.getBoundingClientRect());
|
|
7648
7356
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -7666,7 +7374,7 @@ function useNavItemDrag({
|
|
|
7666
7374
|
});
|
|
7667
7375
|
const beginNavDragRef = useRef6(() => {
|
|
7668
7376
|
});
|
|
7669
|
-
const beginNavDrag =
|
|
7377
|
+
const beginNavDrag = useCallback3(
|
|
7670
7378
|
(session) => {
|
|
7671
7379
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
7672
7380
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -7693,7 +7401,7 @@ function useNavItemDrag({
|
|
|
7693
7401
|
]
|
|
7694
7402
|
);
|
|
7695
7403
|
beginNavDragRef.current = beginNavDrag;
|
|
7696
|
-
const commitNavDrag =
|
|
7404
|
+
const commitNavDrag = useCallback3(
|
|
7697
7405
|
(clientX, clientY) => {
|
|
7698
7406
|
const session = navDragRef.current;
|
|
7699
7407
|
if (!session) {
|
|
@@ -7754,7 +7462,7 @@ function useNavItemDrag({
|
|
|
7754
7462
|
[clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
|
|
7755
7463
|
);
|
|
7756
7464
|
commitNavDragRef.current = commitNavDrag;
|
|
7757
|
-
const startNavLinkDrag =
|
|
7465
|
+
const startNavLinkDrag = useCallback3(
|
|
7758
7466
|
(anchor, clientX, clientY, wasSelected) => {
|
|
7759
7467
|
if (footerDragRef.current) return false;
|
|
7760
7468
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -7772,7 +7480,7 @@ function useNavItemDrag({
|
|
|
7772
7480
|
},
|
|
7773
7481
|
[beginNavDrag, footerDragRef, isDragHandleDisabled2, isNavbarButton3]
|
|
7774
7482
|
);
|
|
7775
|
-
const onNavDragOver =
|
|
7483
|
+
const onNavDragOver = useCallback3(
|
|
7776
7484
|
(e) => {
|
|
7777
7485
|
const session = navDragRef.current;
|
|
7778
7486
|
if (!session) return false;
|
|
@@ -7909,7 +7617,7 @@ function useNavItemDrag({
|
|
|
7909
7617
|
setLinkPopover,
|
|
7910
7618
|
suppressNextClickRef
|
|
7911
7619
|
]);
|
|
7912
|
-
const armNavPressFromChrome =
|
|
7620
|
+
const armNavPressFromChrome = useCallback3(
|
|
7913
7621
|
(selected, clientX, clientY, pointerId) => {
|
|
7914
7622
|
const hrefKey = selected.getAttribute("data-ohw-href-key");
|
|
7915
7623
|
if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
|
|
@@ -7939,60 +7647,15 @@ function useNavItemDrag({
|
|
|
7939
7647
|
};
|
|
7940
7648
|
}
|
|
7941
7649
|
|
|
7942
|
-
// src/ui/footer-container-chrome.tsx
|
|
7943
|
-
import { Plus as Plus2 } from "lucide-react";
|
|
7944
|
-
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
7945
|
-
function FooterContainerChrome({ rect, onAdd }) {
|
|
7946
|
-
const chromeGap = 6;
|
|
7947
|
-
const buttonMargin = 7;
|
|
7948
|
-
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx21(
|
|
7949
|
-
"div",
|
|
7950
|
-
{
|
|
7951
|
-
"data-ohw-footer-container-chrome": "",
|
|
7952
|
-
"data-ohw-bridge": "",
|
|
7953
|
-
className: "pointer-events-none fixed z-[2147483647]",
|
|
7954
|
-
style: {
|
|
7955
|
-
top: rect.top - chromeGap,
|
|
7956
|
-
left: rect.left - chromeGap,
|
|
7957
|
-
width: rect.width + chromeGap * 2,
|
|
7958
|
-
height: rect.height + chromeGap * 2
|
|
7959
|
-
},
|
|
7960
|
-
children: /* @__PURE__ */ jsxs13(Tooltip, { children: [
|
|
7961
|
-
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
7962
|
-
"button",
|
|
7963
|
-
{
|
|
7964
|
-
type: "button",
|
|
7965
|
-
"data-ohw-footer-add-button": "",
|
|
7966
|
-
className: "pointer-events-auto absolute left-1/2 flex size-7 -translate-x-1/2 -translate-y-full items-center justify-center rounded-[10px] border border-border bg-background p-0.5 shadow-sm transition-colors hover:bg-muted/80",
|
|
7967
|
-
style: { top: chromeGap - buttonMargin },
|
|
7968
|
-
"aria-label": "Add item",
|
|
7969
|
-
onMouseDown: (e) => {
|
|
7970
|
-
e.preventDefault();
|
|
7971
|
-
e.stopPropagation();
|
|
7972
|
-
},
|
|
7973
|
-
onClick: (e) => {
|
|
7974
|
-
e.preventDefault();
|
|
7975
|
-
e.stopPropagation();
|
|
7976
|
-
onAdd();
|
|
7977
|
-
},
|
|
7978
|
-
children: /* @__PURE__ */ jsx21(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
7979
|
-
}
|
|
7980
|
-
) }),
|
|
7981
|
-
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 9, children: "Add item" })
|
|
7982
|
-
] })
|
|
7983
|
-
}
|
|
7984
|
-
) });
|
|
7985
|
-
}
|
|
7986
|
-
|
|
7987
7650
|
// src/ui/navbar-container-chrome.tsx
|
|
7988
|
-
import { Plus as
|
|
7989
|
-
import { jsx as
|
|
7651
|
+
import { Plus as Plus2 } from "lucide-react";
|
|
7652
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
7990
7653
|
function NavbarContainerChrome({
|
|
7991
7654
|
rect,
|
|
7992
7655
|
onAdd
|
|
7993
7656
|
}) {
|
|
7994
7657
|
const chromeGap = 6;
|
|
7995
|
-
return /* @__PURE__ */
|
|
7658
|
+
return /* @__PURE__ */ jsx21(
|
|
7996
7659
|
"div",
|
|
7997
7660
|
{
|
|
7998
7661
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -8004,7 +7667,7 @@ function NavbarContainerChrome({
|
|
|
8004
7667
|
width: rect.width + chromeGap * 2,
|
|
8005
7668
|
height: rect.height + chromeGap * 2
|
|
8006
7669
|
},
|
|
8007
|
-
children: /* @__PURE__ */
|
|
7670
|
+
children: /* @__PURE__ */ jsx21(
|
|
8008
7671
|
"button",
|
|
8009
7672
|
{
|
|
8010
7673
|
type: "button",
|
|
@@ -8021,7 +7684,7 @@ function NavbarContainerChrome({
|
|
|
8021
7684
|
e.stopPropagation();
|
|
8022
7685
|
onAdd();
|
|
8023
7686
|
},
|
|
8024
|
-
children: /* @__PURE__ */
|
|
7687
|
+
children: /* @__PURE__ */ jsx21(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
8025
7688
|
}
|
|
8026
7689
|
)
|
|
8027
7690
|
}
|
|
@@ -8030,7 +7693,7 @@ function NavbarContainerChrome({
|
|
|
8030
7693
|
|
|
8031
7694
|
// src/ui/drop-indicator.tsx
|
|
8032
7695
|
import * as React10 from "react";
|
|
8033
|
-
import { jsx as
|
|
7696
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
8034
7697
|
var dropIndicatorVariants = cva(
|
|
8035
7698
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
8036
7699
|
{
|
|
@@ -8054,7 +7717,7 @@ var dropIndicatorVariants = cva(
|
|
|
8054
7717
|
);
|
|
8055
7718
|
var DropIndicator = React10.forwardRef(
|
|
8056
7719
|
({ className, direction, state, ...props }, ref) => {
|
|
8057
|
-
return /* @__PURE__ */
|
|
7720
|
+
return /* @__PURE__ */ jsx22(
|
|
8058
7721
|
"div",
|
|
8059
7722
|
{
|
|
8060
7723
|
ref,
|
|
@@ -8071,7 +7734,7 @@ var DropIndicator = React10.forwardRef(
|
|
|
8071
7734
|
DropIndicator.displayName = "DropIndicator";
|
|
8072
7735
|
|
|
8073
7736
|
// src/ui/badge.tsx
|
|
8074
|
-
import { jsx as
|
|
7737
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
8075
7738
|
var badgeVariants = cva(
|
|
8076
7739
|
"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",
|
|
8077
7740
|
{
|
|
@@ -8089,12 +7752,12 @@ var badgeVariants = cva(
|
|
|
8089
7752
|
}
|
|
8090
7753
|
);
|
|
8091
7754
|
function Badge({ className, variant, ...props }) {
|
|
8092
|
-
return /* @__PURE__ */
|
|
7755
|
+
return /* @__PURE__ */ jsx23("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
8093
7756
|
}
|
|
8094
7757
|
|
|
8095
7758
|
// src/OhhwellsBridge.tsx
|
|
8096
7759
|
import { Link as Link2 } from "lucide-react";
|
|
8097
|
-
import { Fragment as Fragment5, jsx as
|
|
7760
|
+
import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8098
7761
|
var PRIMARY2 = "#0885FE";
|
|
8099
7762
|
var IMAGE_FADE_MS = 300;
|
|
8100
7763
|
function runOpacityFade(el, onDone) {
|
|
@@ -8273,7 +7936,7 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
|
|
|
8273
7936
|
const root = createRoot(container);
|
|
8274
7937
|
flushSync(() => {
|
|
8275
7938
|
root.render(
|
|
8276
|
-
/* @__PURE__ */
|
|
7939
|
+
/* @__PURE__ */ jsx24(
|
|
8277
7940
|
SchedulingWidget,
|
|
8278
7941
|
{
|
|
8279
7942
|
notifyOnConnect,
|
|
@@ -8474,7 +8137,7 @@ function applyLinkByKey(key, val) {
|
|
|
8474
8137
|
}
|
|
8475
8138
|
function isInsideLinkEditor(target) {
|
|
8476
8139
|
return Boolean(
|
|
8477
|
-
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(
|
|
8140
|
+
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-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
|
|
8478
8141
|
);
|
|
8479
8142
|
}
|
|
8480
8143
|
function getHrefKeyFromElement(el) {
|
|
@@ -8555,7 +8218,7 @@ function isInferredFooterGroup(el) {
|
|
|
8555
8218
|
return countFooterNavItems(el) >= 2;
|
|
8556
8219
|
}
|
|
8557
8220
|
function isNavigationContainer(el) {
|
|
8558
|
-
return el.hasAttribute("data-ohw-nav-container") ||
|
|
8221
|
+
return el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isNavigationRoot(el) || isInferredFooterGroup(el);
|
|
8559
8222
|
}
|
|
8560
8223
|
function isNavbarLinksContainer(el) {
|
|
8561
8224
|
return el.hasAttribute("data-ohw-nav-container");
|
|
@@ -8574,9 +8237,6 @@ function isPointOverNavigation(x, y) {
|
|
|
8574
8237
|
const roots = /* @__PURE__ */ new Set();
|
|
8575
8238
|
const navRoot = document.querySelector("[data-ohw-nav-root]") ?? document.querySelector("nav");
|
|
8576
8239
|
if (navRoot) roots.add(navRoot);
|
|
8577
|
-
document.querySelectorAll("[data-ohw-nav-drawer], [data-ohw-nav-container]").forEach((el) => {
|
|
8578
|
-
roots.add(el);
|
|
8579
|
-
});
|
|
8580
8240
|
const footer = document.querySelector("footer");
|
|
8581
8241
|
if (footer) roots.add(footer);
|
|
8582
8242
|
for (const root of roots) {
|
|
@@ -8605,12 +8265,6 @@ function isPointOverNavItem(container, x, y) {
|
|
|
8605
8265
|
return x >= itemRect.left && x <= itemRect.right && y >= itemRect.top && y <= itemRect.bottom;
|
|
8606
8266
|
});
|
|
8607
8267
|
}
|
|
8608
|
-
function isPointOverFooterColumn(x, y) {
|
|
8609
|
-
return listFooterColumns().some((col) => {
|
|
8610
|
-
const r2 = col.getBoundingClientRect();
|
|
8611
|
-
return x >= r2.left && x <= r2.right && y >= r2.top && y <= r2.bottom;
|
|
8612
|
-
});
|
|
8613
|
-
}
|
|
8614
8268
|
function resolveNavContainerSelectionTarget(target, clientX, clientY) {
|
|
8615
8269
|
if (getNavigationItemAnchor(target)) return null;
|
|
8616
8270
|
if (target.closest('[data-ohw-role="navbar-button"]')) return null;
|
|
@@ -8641,10 +8295,7 @@ function getNavigationSelectionParent(el) {
|
|
|
8641
8295
|
if (footerGroup) return footerGroup;
|
|
8642
8296
|
return getNavigationRoot(el);
|
|
8643
8297
|
}
|
|
8644
|
-
if (
|
|
8645
|
-
return getFooterLinksContainer();
|
|
8646
|
-
}
|
|
8647
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup(el)) {
|
|
8298
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup(el)) {
|
|
8648
8299
|
return getNavigationRoot(el);
|
|
8649
8300
|
}
|
|
8650
8301
|
return null;
|
|
@@ -8871,7 +8522,7 @@ function EditGlowChrome({
|
|
|
8871
8522
|
hideHandle = false
|
|
8872
8523
|
}) {
|
|
8873
8524
|
const GAP = SELECTION_CHROME_GAP2;
|
|
8874
|
-
return /* @__PURE__ */
|
|
8525
|
+
return /* @__PURE__ */ jsxs13(
|
|
8875
8526
|
"div",
|
|
8876
8527
|
{
|
|
8877
8528
|
ref: elRef,
|
|
@@ -8886,7 +8537,7 @@ function EditGlowChrome({
|
|
|
8886
8537
|
zIndex: 2147483646
|
|
8887
8538
|
},
|
|
8888
8539
|
children: [
|
|
8889
|
-
/* @__PURE__ */
|
|
8540
|
+
/* @__PURE__ */ jsx24(
|
|
8890
8541
|
"div",
|
|
8891
8542
|
{
|
|
8892
8543
|
style: {
|
|
@@ -8899,7 +8550,7 @@ function EditGlowChrome({
|
|
|
8899
8550
|
}
|
|
8900
8551
|
}
|
|
8901
8552
|
),
|
|
8902
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */
|
|
8553
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ jsx24(
|
|
8903
8554
|
"div",
|
|
8904
8555
|
{
|
|
8905
8556
|
"data-ohw-drag-handle-container": "",
|
|
@@ -8911,7 +8562,7 @@ function EditGlowChrome({
|
|
|
8911
8562
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
8912
8563
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
8913
8564
|
},
|
|
8914
|
-
children: /* @__PURE__ */
|
|
8565
|
+
children: /* @__PURE__ */ jsx24(
|
|
8915
8566
|
DragHandle,
|
|
8916
8567
|
{
|
|
8917
8568
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -9121,7 +8772,7 @@ function FloatingToolbar({
|
|
|
9121
8772
|
return () => ro.disconnect();
|
|
9122
8773
|
}, [showEditLink, activeCommands]);
|
|
9123
8774
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
9124
|
-
return /* @__PURE__ */
|
|
8775
|
+
return /* @__PURE__ */ jsx24(
|
|
9125
8776
|
"div",
|
|
9126
8777
|
{
|
|
9127
8778
|
ref: setRefs,
|
|
@@ -9133,12 +8784,12 @@ function FloatingToolbar({
|
|
|
9133
8784
|
zIndex: 2147483647,
|
|
9134
8785
|
pointerEvents: "auto"
|
|
9135
8786
|
},
|
|
9136
|
-
children: /* @__PURE__ */
|
|
9137
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */
|
|
9138
|
-
gi > 0 && /* @__PURE__ */
|
|
8787
|
+
children: /* @__PURE__ */ jsxs13(CustomToolbar, { children: [
|
|
8788
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ jsxs13(React11.Fragment, { children: [
|
|
8789
|
+
gi > 0 && /* @__PURE__ */ jsx24(CustomToolbarDivider, {}),
|
|
9139
8790
|
btns.map((btn) => {
|
|
9140
8791
|
const isActive = activeCommands.has(btn.cmd);
|
|
9141
|
-
return /* @__PURE__ */
|
|
8792
|
+
return /* @__PURE__ */ jsx24(
|
|
9142
8793
|
CustomToolbarButton,
|
|
9143
8794
|
{
|
|
9144
8795
|
title: btn.title,
|
|
@@ -9147,7 +8798,7 @@ function FloatingToolbar({
|
|
|
9147
8798
|
e.preventDefault();
|
|
9148
8799
|
onCommand(btn.cmd);
|
|
9149
8800
|
},
|
|
9150
|
-
children: /* @__PURE__ */
|
|
8801
|
+
children: /* @__PURE__ */ jsx24(
|
|
9151
8802
|
"svg",
|
|
9152
8803
|
{
|
|
9153
8804
|
width: "16",
|
|
@@ -9168,7 +8819,7 @@ function FloatingToolbar({
|
|
|
9168
8819
|
);
|
|
9169
8820
|
})
|
|
9170
8821
|
] }, gi)),
|
|
9171
|
-
showEditLink ? /* @__PURE__ */
|
|
8822
|
+
showEditLink ? /* @__PURE__ */ jsx24(
|
|
9172
8823
|
CustomToolbarButton,
|
|
9173
8824
|
{
|
|
9174
8825
|
type: "button",
|
|
@@ -9182,7 +8833,7 @@ function FloatingToolbar({
|
|
|
9182
8833
|
e.preventDefault();
|
|
9183
8834
|
e.stopPropagation();
|
|
9184
8835
|
},
|
|
9185
|
-
children: /* @__PURE__ */
|
|
8836
|
+
children: /* @__PURE__ */ jsx24(Link2, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
9186
8837
|
}
|
|
9187
8838
|
) : null
|
|
9188
8839
|
] })
|
|
@@ -9199,7 +8850,7 @@ function StateToggle({
|
|
|
9199
8850
|
states,
|
|
9200
8851
|
onStateChange
|
|
9201
8852
|
}) {
|
|
9202
|
-
return /* @__PURE__ */
|
|
8853
|
+
return /* @__PURE__ */ jsx24(
|
|
9203
8854
|
ToggleGroup,
|
|
9204
8855
|
{
|
|
9205
8856
|
"data-ohw-state-toggle": "",
|
|
@@ -9213,7 +8864,7 @@ function StateToggle({
|
|
|
9213
8864
|
left: rect.right - 8,
|
|
9214
8865
|
transform: "translateX(-100%)"
|
|
9215
8866
|
},
|
|
9216
|
-
children: states.map((state) => /* @__PURE__ */
|
|
8867
|
+
children: states.map((state) => /* @__PURE__ */ jsx24(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
9217
8868
|
}
|
|
9218
8869
|
);
|
|
9219
8870
|
}
|
|
@@ -9269,7 +8920,7 @@ function OhhwellsBridge() {
|
|
|
9269
8920
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
9270
8921
|
const subdomain = resolveSubdomain(subdomainFromQuery);
|
|
9271
8922
|
useLinkHrefGuardian(pathname, subdomain, isEditMode);
|
|
9272
|
-
const postToParent2 =
|
|
8923
|
+
const postToParent2 = useCallback4((data) => {
|
|
9273
8924
|
if (typeof window !== "undefined" && window.parent !== window) {
|
|
9274
8925
|
window.parent.postMessage(data, "*");
|
|
9275
8926
|
}
|
|
@@ -9286,7 +8937,7 @@ function OhhwellsBridge() {
|
|
|
9286
8937
|
const parentScrollRef = useRef7(null);
|
|
9287
8938
|
const visibleViewportRef = useRef7(null);
|
|
9288
8939
|
const [dialogPortalContainer, setDialogPortalContainer] = useState7(null);
|
|
9289
|
-
const attachVisibleViewport =
|
|
8940
|
+
const attachVisibleViewport = useCallback4((node) => {
|
|
9290
8941
|
visibleViewportRef.current = node;
|
|
9291
8942
|
setDialogPortalContainer(node);
|
|
9292
8943
|
if (node) applyVisibleViewport(node, parentScrollRef.current);
|
|
@@ -9399,7 +9050,7 @@ function OhhwellsBridge() {
|
|
|
9399
9050
|
const bumpLinkPopoverGrace = () => {
|
|
9400
9051
|
linkPopoverGraceUntilRef.current = Date.now() + 350;
|
|
9401
9052
|
};
|
|
9402
|
-
const runSectionsPrefetch =
|
|
9053
|
+
const runSectionsPrefetch = useCallback4((pages) => {
|
|
9403
9054
|
if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
|
|
9404
9055
|
const gen = ++sectionsPrefetchGenRef.current;
|
|
9405
9056
|
const paths = pages.map((p) => p.path);
|
|
@@ -9525,10 +9176,10 @@ function OhhwellsBridge() {
|
|
|
9525
9176
|
vvp.removeEventListener("resize", update);
|
|
9526
9177
|
};
|
|
9527
9178
|
}, []);
|
|
9528
|
-
const refreshStateRules =
|
|
9179
|
+
const refreshStateRules = useCallback4(() => {
|
|
9529
9180
|
editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
|
|
9530
9181
|
}, []);
|
|
9531
|
-
const processConfigRequest =
|
|
9182
|
+
const processConfigRequest = useCallback4((insertAfterVal) => {
|
|
9532
9183
|
const tracker = getSectionsTracker();
|
|
9533
9184
|
let entries = [];
|
|
9534
9185
|
try {
|
|
@@ -9551,7 +9202,7 @@ function OhhwellsBridge() {
|
|
|
9551
9202
|
}
|
|
9552
9203
|
window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
|
|
9553
9204
|
}, [isEditMode]);
|
|
9554
|
-
const deactivate =
|
|
9205
|
+
const deactivate = useCallback4(() => {
|
|
9555
9206
|
const el = activeElRef.current;
|
|
9556
9207
|
if (!el) return;
|
|
9557
9208
|
const key = el.dataset.ohwKey;
|
|
@@ -9583,12 +9234,12 @@ function OhhwellsBridge() {
|
|
|
9583
9234
|
setToolbarShowEditLink(false);
|
|
9584
9235
|
postToParent2({ type: "ow:exit-edit" });
|
|
9585
9236
|
}, [postToParent2]);
|
|
9586
|
-
const clearSelectedAttr =
|
|
9237
|
+
const clearSelectedAttr = useCallback4(() => {
|
|
9587
9238
|
document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
|
|
9588
9239
|
el.removeAttribute("data-ohw-selected");
|
|
9589
9240
|
});
|
|
9590
9241
|
}, []);
|
|
9591
|
-
const deselect =
|
|
9242
|
+
const deselect = useCallback4(() => {
|
|
9592
9243
|
clearSelectedAttr();
|
|
9593
9244
|
selectedElRef.current = null;
|
|
9594
9245
|
selectedHrefKeyRef.current = null;
|
|
@@ -9608,11 +9259,11 @@ function OhhwellsBridge() {
|
|
|
9608
9259
|
setToolbarVariant("none");
|
|
9609
9260
|
}
|
|
9610
9261
|
}, [clearSelectedAttr]);
|
|
9611
|
-
const markSelected =
|
|
9262
|
+
const markSelected = useCallback4((el) => {
|
|
9612
9263
|
clearSelectedAttr();
|
|
9613
9264
|
el.setAttribute("data-ohw-selected", "");
|
|
9614
9265
|
}, [clearSelectedAttr]);
|
|
9615
|
-
const resolveHrefKeyElement =
|
|
9266
|
+
const resolveHrefKeyElement = useCallback4((hrefKey) => {
|
|
9616
9267
|
if (isFooterHrefKey(hrefKey)) {
|
|
9617
9268
|
return document.querySelector(
|
|
9618
9269
|
`footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
@@ -9627,7 +9278,7 @@ function OhhwellsBridge() {
|
|
|
9627
9278
|
`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
|
|
9628
9279
|
);
|
|
9629
9280
|
}, []);
|
|
9630
|
-
const resyncSelectedNavigationItem =
|
|
9281
|
+
const resyncSelectedNavigationItem = useCallback4(() => {
|
|
9631
9282
|
const hrefKey = selectedHrefKeyRef.current;
|
|
9632
9283
|
if (hrefKey) {
|
|
9633
9284
|
const link = resolveHrefKeyElement(hrefKey);
|
|
@@ -9655,7 +9306,7 @@ function OhhwellsBridge() {
|
|
|
9655
9306
|
);
|
|
9656
9307
|
}
|
|
9657
9308
|
}, [resolveHrefKeyElement]);
|
|
9658
|
-
const reselectNavigationItem =
|
|
9309
|
+
const reselectNavigationItem = useCallback4((navAnchor) => {
|
|
9659
9310
|
selectedElRef.current = navAnchor;
|
|
9660
9311
|
selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
|
|
9661
9312
|
selectedFooterColAttrRef.current = null;
|
|
@@ -9670,7 +9321,7 @@ function OhhwellsBridge() {
|
|
|
9670
9321
|
setToolbarShowEditLink(false);
|
|
9671
9322
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
9672
9323
|
}, [markSelected]);
|
|
9673
|
-
const commitNavigationTextEdit =
|
|
9324
|
+
const commitNavigationTextEdit = useCallback4((navAnchor) => {
|
|
9674
9325
|
const el = activeElRef.current;
|
|
9675
9326
|
if (!el) return;
|
|
9676
9327
|
const key = el.dataset.ohwKey;
|
|
@@ -9697,7 +9348,7 @@ function OhhwellsBridge() {
|
|
|
9697
9348
|
postToParent2({ type: "ow:exit-edit" });
|
|
9698
9349
|
reselectNavigationItem(navAnchor);
|
|
9699
9350
|
}, [postToParent2, reselectNavigationItem]);
|
|
9700
|
-
const handleAddTopLevelNavItem =
|
|
9351
|
+
const handleAddTopLevelNavItem = useCallback4(() => {
|
|
9701
9352
|
const items = listNavbarItems();
|
|
9702
9353
|
addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
|
|
9703
9354
|
deselectRef.current();
|
|
@@ -9709,19 +9360,7 @@ function OhhwellsBridge() {
|
|
|
9709
9360
|
intent: "add-nav"
|
|
9710
9361
|
});
|
|
9711
9362
|
}, []);
|
|
9712
|
-
const
|
|
9713
|
-
deselectRef.current();
|
|
9714
|
-
deactivateRef.current();
|
|
9715
|
-
const result = addFooterColumnWithPersist({ postToParent: postToParent2 });
|
|
9716
|
-
editContentRef.current = {
|
|
9717
|
-
...editContentRef.current,
|
|
9718
|
-
...buildFooterColumnEditContentPatch(result)
|
|
9719
|
-
};
|
|
9720
|
-
requestAnimationFrame(() => {
|
|
9721
|
-
selectRef.current(result.firstLink);
|
|
9722
|
-
});
|
|
9723
|
-
}, [postToParent2]);
|
|
9724
|
-
const clearFooterDragVisuals = useCallback5(() => {
|
|
9363
|
+
const clearFooterDragVisuals = useCallback4(() => {
|
|
9725
9364
|
footerDragRef.current = null;
|
|
9726
9365
|
setSiblingHintRects([]);
|
|
9727
9366
|
setFooterDropSlots([]);
|
|
@@ -9730,7 +9369,7 @@ function OhhwellsBridge() {
|
|
|
9730
9369
|
setIsItemDragging(false);
|
|
9731
9370
|
unlockFooterDragInteraction();
|
|
9732
9371
|
}, []);
|
|
9733
|
-
const refreshFooterDragVisuals =
|
|
9372
|
+
const refreshFooterDragVisuals = useCallback4((session, activeSlot, clientX, clientY) => {
|
|
9734
9373
|
const dragged = session.draggedEl;
|
|
9735
9374
|
setDraggedItemRect(dragged.getBoundingClientRect());
|
|
9736
9375
|
if (typeof clientX === "number" && typeof clientY === "number") {
|
|
@@ -9761,7 +9400,7 @@ function OhhwellsBridge() {
|
|
|
9761
9400
|
});
|
|
9762
9401
|
const beginFooterDragRef = useRef7(() => {
|
|
9763
9402
|
});
|
|
9764
|
-
const beginFooterDrag =
|
|
9403
|
+
const beginFooterDrag = useCallback4(
|
|
9765
9404
|
(session) => {
|
|
9766
9405
|
const rect = session.draggedEl.getBoundingClientRect();
|
|
9767
9406
|
session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
|
|
@@ -9781,7 +9420,7 @@ function OhhwellsBridge() {
|
|
|
9781
9420
|
[refreshFooterDragVisuals]
|
|
9782
9421
|
);
|
|
9783
9422
|
beginFooterDragRef.current = beginFooterDrag;
|
|
9784
|
-
const commitFooterDrag =
|
|
9423
|
+
const commitFooterDrag = useCallback4(
|
|
9785
9424
|
(clientX, clientY) => {
|
|
9786
9425
|
const session = footerDragRef.current;
|
|
9787
9426
|
if (!session) {
|
|
@@ -9885,7 +9524,7 @@ function OhhwellsBridge() {
|
|
|
9885
9524
|
[clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
|
|
9886
9525
|
);
|
|
9887
9526
|
commitFooterDragRef.current = commitFooterDrag;
|
|
9888
|
-
const startFooterLinkDrag =
|
|
9527
|
+
const startFooterLinkDrag = useCallback4(
|
|
9889
9528
|
(anchor, clientX, clientY, wasSelected) => {
|
|
9890
9529
|
const hrefKey = anchor.getAttribute("data-ohw-href-key");
|
|
9891
9530
|
if (!hrefKey || !isFooterHrefKey(hrefKey)) return false;
|
|
@@ -9906,7 +9545,7 @@ function OhhwellsBridge() {
|
|
|
9906
9545
|
},
|
|
9907
9546
|
[beginFooterDrag]
|
|
9908
9547
|
);
|
|
9909
|
-
const startFooterColumnDrag =
|
|
9548
|
+
const startFooterColumnDrag = useCallback4(
|
|
9910
9549
|
(columnEl, clientX, clientY, wasSelected) => {
|
|
9911
9550
|
const columns = listFooterColumns();
|
|
9912
9551
|
const idx = columns.indexOf(columnEl);
|
|
@@ -9926,7 +9565,7 @@ function OhhwellsBridge() {
|
|
|
9926
9565
|
},
|
|
9927
9566
|
[beginFooterDrag]
|
|
9928
9567
|
);
|
|
9929
|
-
const handleItemDragStart =
|
|
9568
|
+
const handleItemDragStart = useCallback4(
|
|
9930
9569
|
(e) => {
|
|
9931
9570
|
const selected = selectedElRef.current;
|
|
9932
9571
|
if (!selected) {
|
|
@@ -9946,7 +9585,7 @@ function OhhwellsBridge() {
|
|
|
9946
9585
|
},
|
|
9947
9586
|
[startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag]
|
|
9948
9587
|
);
|
|
9949
|
-
const handleItemDragEnd =
|
|
9588
|
+
const handleItemDragEnd = useCallback4(
|
|
9950
9589
|
(e) => {
|
|
9951
9590
|
if (footerDragRef.current) {
|
|
9952
9591
|
const x = e?.clientX;
|
|
@@ -9972,7 +9611,7 @@ function OhhwellsBridge() {
|
|
|
9972
9611
|
},
|
|
9973
9612
|
[commitFooterDrag, commitNavDrag, navDragRef]
|
|
9974
9613
|
);
|
|
9975
|
-
const handleItemChromePointerDown =
|
|
9614
|
+
const handleItemChromePointerDown = useCallback4((e) => {
|
|
9976
9615
|
if (e.button !== 0) return;
|
|
9977
9616
|
const selected = selectedElRef.current;
|
|
9978
9617
|
if (!selected) return;
|
|
@@ -10003,7 +9642,7 @@ function OhhwellsBridge() {
|
|
|
10003
9642
|
}
|
|
10004
9643
|
if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
|
|
10005
9644
|
}, [armNavPressFromChrome]);
|
|
10006
|
-
const handleItemChromeClick =
|
|
9645
|
+
const handleItemChromeClick = useCallback4((clientX, clientY) => {
|
|
10007
9646
|
if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
|
|
10008
9647
|
suppressNextClickRef.current = false;
|
|
10009
9648
|
return;
|
|
@@ -10016,7 +9655,7 @@ function OhhwellsBridge() {
|
|
|
10016
9655
|
}, []);
|
|
10017
9656
|
reselectNavigationItemRef.current = reselectNavigationItem;
|
|
10018
9657
|
commitNavigationTextEditRef.current = commitNavigationTextEdit;
|
|
10019
|
-
const select =
|
|
9658
|
+
const select = useCallback4((anchor) => {
|
|
10020
9659
|
if (!isNavigationItem(anchor)) return;
|
|
10021
9660
|
if (activeElRef.current) deactivate();
|
|
10022
9661
|
selectedElRef.current = anchor;
|
|
@@ -10042,10 +9681,10 @@ function OhhwellsBridge() {
|
|
|
10042
9681
|
setToolbarShowEditLink(false);
|
|
10043
9682
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
10044
9683
|
}, [deactivate, markSelected]);
|
|
10045
|
-
const selectFrame =
|
|
9684
|
+
const selectFrame = useCallback4((el) => {
|
|
10046
9685
|
if (!isNavigationContainer(el)) return;
|
|
10047
9686
|
if (activeElRef.current) deactivate();
|
|
10048
|
-
const isFooterColumn =
|
|
9687
|
+
const isFooterColumn = el.hasAttribute("data-ohw-footer-col") || Boolean(el.closest("footer") && isInferredFooterGroup(el));
|
|
10049
9688
|
selectedElRef.current = el;
|
|
10050
9689
|
selectedHrefKeyRef.current = null;
|
|
10051
9690
|
selectedFooterColAttrRef.current = isFooterColumn ? el.getAttribute("data-ohw-footer-col") ?? String(listFooterColumns().indexOf(el)) : null;
|
|
@@ -10070,7 +9709,7 @@ function OhhwellsBridge() {
|
|
|
10070
9709
|
setToolbarShowEditLink(false);
|
|
10071
9710
|
setActiveCommands(/* @__PURE__ */ new Set());
|
|
10072
9711
|
}, [deactivate, markSelected]);
|
|
10073
|
-
const activate =
|
|
9712
|
+
const activate = useCallback4((el, options) => {
|
|
10074
9713
|
if (activeElRef.current === el) return;
|
|
10075
9714
|
clearSelectedAttr();
|
|
10076
9715
|
selectedElRef.current = null;
|
|
@@ -10601,7 +10240,7 @@ function OhhwellsBridge() {
|
|
|
10601
10240
|
}
|
|
10602
10241
|
e.preventDefault();
|
|
10603
10242
|
e.stopPropagation();
|
|
10604
|
-
activateRef.current(editable
|
|
10243
|
+
activateRef.current(editable);
|
|
10605
10244
|
return;
|
|
10606
10245
|
}
|
|
10607
10246
|
const hrefAnchor = getNavigationItemAnchor(target);
|
|
@@ -10628,18 +10267,6 @@ function OhhwellsBridge() {
|
|
|
10628
10267
|
selectFrameRef.current(footerColClick);
|
|
10629
10268
|
return;
|
|
10630
10269
|
}
|
|
10631
|
-
const footerLinksToSelect = resolveFooterLinksContainerSelectionTarget(
|
|
10632
|
-
target,
|
|
10633
|
-
e.clientX,
|
|
10634
|
-
e.clientY,
|
|
10635
|
-
isPointOverNavItem
|
|
10636
|
-
);
|
|
10637
|
-
if (footerLinksToSelect) {
|
|
10638
|
-
e.preventDefault();
|
|
10639
|
-
e.stopPropagation();
|
|
10640
|
-
selectFrameRef.current(footerLinksToSelect);
|
|
10641
|
-
return;
|
|
10642
|
-
}
|
|
10643
10270
|
const navContainerToSelect = resolveNavContainerSelectionTarget(target, e.clientX, e.clientY);
|
|
10644
10271
|
if (navContainerToSelect) {
|
|
10645
10272
|
e.preventDefault();
|
|
@@ -10698,8 +10325,8 @@ function OhhwellsBridge() {
|
|
|
10698
10325
|
return;
|
|
10699
10326
|
}
|
|
10700
10327
|
const navLabel = getNavigationLabelEditable(target);
|
|
10701
|
-
|
|
10702
|
-
|
|
10328
|
+
if (!navLabel) return;
|
|
10329
|
+
const { editable } = navLabel;
|
|
10703
10330
|
e.preventDefault();
|
|
10704
10331
|
e.stopPropagation();
|
|
10705
10332
|
if (activeElRef.current !== editable) {
|
|
@@ -10720,38 +10347,16 @@ function OhhwellsBridge() {
|
|
|
10720
10347
|
setHoveredNavContainerRect(null);
|
|
10721
10348
|
return;
|
|
10722
10349
|
}
|
|
10723
|
-
{
|
|
10724
|
-
const
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
hoveredNavContainerRef.current = navContainer;
|
|
10732
|
-
setHoveredNavContainerRect(navContainer.getBoundingClientRect());
|
|
10733
|
-
hoveredItemElRef.current = null;
|
|
10734
|
-
setHoveredItemRect(null);
|
|
10735
|
-
return;
|
|
10736
|
-
}
|
|
10350
|
+
if (toolbarVariantRef.current !== "select-frame") {
|
|
10351
|
+
const navContainer = target.closest("[data-ohw-nav-container]");
|
|
10352
|
+
if (navContainer && !getNavigationItemAnchor(target)) {
|
|
10353
|
+
hoveredNavContainerRef.current = navContainer;
|
|
10354
|
+
setHoveredNavContainerRect(navContainer.getBoundingClientRect());
|
|
10355
|
+
hoveredItemElRef.current = null;
|
|
10356
|
+
setHoveredItemRect(null);
|
|
10357
|
+
return;
|
|
10737
10358
|
}
|
|
10738
|
-
if (
|
|
10739
|
-
const navContainer = target.closest("[data-ohw-nav-container]");
|
|
10740
|
-
if (!navContainer) {
|
|
10741
|
-
const footerLinks = target.closest("[data-ohw-footer-links], .rb-footer-links") ?? null;
|
|
10742
|
-
if (footerLinks && selected2 !== footerLinks && !getNavigationItemAnchor(target) && !target.closest("[data-ohw-footer-col], [data-ohw-footer-column]")) {
|
|
10743
|
-
hoveredNavContainerRef.current = footerLinks;
|
|
10744
|
-
setHoveredNavContainerRect(footerLinks.getBoundingClientRect());
|
|
10745
|
-
hoveredItemElRef.current = null;
|
|
10746
|
-
setHoveredItemRect(null);
|
|
10747
|
-
return;
|
|
10748
|
-
}
|
|
10749
|
-
if (!footerLinks) {
|
|
10750
|
-
hoveredNavContainerRef.current = null;
|
|
10751
|
-
setHoveredNavContainerRect(null);
|
|
10752
|
-
}
|
|
10753
|
-
}
|
|
10754
|
-
} else if (toolbarVariantRef.current === "select-frame") {
|
|
10359
|
+
if (!target.closest("[data-ohw-nav-container]")) {
|
|
10755
10360
|
hoveredNavContainerRef.current = null;
|
|
10756
10361
|
setHoveredNavContainerRect(null);
|
|
10757
10362
|
}
|
|
@@ -10793,9 +10398,9 @@ function OhhwellsBridge() {
|
|
|
10793
10398
|
};
|
|
10794
10399
|
const handleMouseOut = (e) => {
|
|
10795
10400
|
const target = e.target;
|
|
10796
|
-
if (target.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column]
|
|
10401
|
+
if (target.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column]")) {
|
|
10797
10402
|
const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
|
|
10798
|
-
if (related2?.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column], [data-ohw-
|
|
10403
|
+
if (related2?.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column], [data-ohw-navbar-container-chrome], [data-ohw-navbar-add-button]")) {
|
|
10799
10404
|
return;
|
|
10800
10405
|
}
|
|
10801
10406
|
hoveredNavContainerRef.current = null;
|
|
@@ -10890,15 +10495,6 @@ function OhhwellsBridge() {
|
|
|
10890
10495
|
if (track) track.setAttribute("data-ohw-hover-paused", "");
|
|
10891
10496
|
};
|
|
10892
10497
|
const clearImageHover = () => setMediaHover(null);
|
|
10893
|
-
const dismissImageHover = () => {
|
|
10894
|
-
if (hoveredImageRef.current) {
|
|
10895
|
-
hoveredImageRef.current = null;
|
|
10896
|
-
hoveredImageHasTextOverlapRef.current = false;
|
|
10897
|
-
resumeAnimTracks();
|
|
10898
|
-
postToParentRef.current({ type: "ow:image-unhover" });
|
|
10899
|
-
}
|
|
10900
|
-
clearImageHover();
|
|
10901
|
-
};
|
|
10902
10498
|
const findImageAtPoint = (clientX, clientY, fromParentViewport) => {
|
|
10903
10499
|
const { x, y } = toProbeCoords(clientX, clientY, fromParentViewport);
|
|
10904
10500
|
const images = Array.from(document.querySelectorAll(MEDIA_SELECTOR));
|
|
@@ -10942,13 +10538,16 @@ function OhhwellsBridge() {
|
|
|
10942
10538
|
}
|
|
10943
10539
|
return smallest;
|
|
10944
10540
|
};
|
|
10541
|
+
const dismissImageHover = () => {
|
|
10542
|
+
if (hoveredImageRef.current) {
|
|
10543
|
+
hoveredImageRef.current = null;
|
|
10544
|
+
hoveredImageHasTextOverlapRef.current = false;
|
|
10545
|
+
resumeAnimTracks();
|
|
10546
|
+
postToParentRef.current({ type: "ow:image-unhover" });
|
|
10547
|
+
}
|
|
10548
|
+
};
|
|
10945
10549
|
const probeNavigationHoverAt = (x, y) => {
|
|
10946
|
-
|
|
10947
|
-
const selectedIsFooterColumn = Boolean(selected) && !isFooterLinksContainer(selected) && (selected.hasAttribute("data-ohw-footer-col") || selected.hasAttribute("data-ohw-footer-column") || Boolean(selected.closest("footer") && isInferredFooterGroup(selected)));
|
|
10948
|
-
const selectedIsFooterLinks = Boolean(selected && isFooterLinksContainer(selected));
|
|
10949
|
-
const allowNavContainerHover = toolbarVariantRef.current !== "select-frame";
|
|
10950
|
-
const allowFooterLinksHover = (toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn) && !selectedIsFooterLinks;
|
|
10951
|
-
if (toolbarVariantRef.current === "select-frame" && !allowFooterLinksHover) {
|
|
10550
|
+
if (toolbarVariantRef.current === "select-frame") {
|
|
10952
10551
|
hoveredNavContainerRef.current = null;
|
|
10953
10552
|
setHoveredNavContainerRect(null);
|
|
10954
10553
|
}
|
|
@@ -10970,6 +10569,7 @@ function OhhwellsBridge() {
|
|
|
10970
10569
|
if (navItemHit) {
|
|
10971
10570
|
hoveredNavContainerRef.current = null;
|
|
10972
10571
|
setHoveredNavContainerRect(null);
|
|
10572
|
+
const selected = selectedElRef.current;
|
|
10973
10573
|
if (selected !== navItemHit) {
|
|
10974
10574
|
clearHrefKeyHover(navItemHit);
|
|
10975
10575
|
hoveredItemElRef.current = navItemHit;
|
|
@@ -10981,7 +10581,7 @@ function OhhwellsBridge() {
|
|
|
10981
10581
|
return;
|
|
10982
10582
|
}
|
|
10983
10583
|
}
|
|
10984
|
-
if (
|
|
10584
|
+
if (toolbarVariantRef.current !== "select-frame") {
|
|
10985
10585
|
for (const container of navContainers) {
|
|
10986
10586
|
const containerRect = container.getBoundingClientRect();
|
|
10987
10587
|
const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
|
|
@@ -10993,23 +10593,12 @@ function OhhwellsBridge() {
|
|
|
10993
10593
|
setHoveredItemRect(null);
|
|
10994
10594
|
return;
|
|
10995
10595
|
}
|
|
10596
|
+
hoveredNavContainerRef.current = null;
|
|
10597
|
+
setHoveredNavContainerRect(null);
|
|
10598
|
+
} else {
|
|
10599
|
+
hoveredNavContainerRef.current = null;
|
|
10600
|
+
setHoveredNavContainerRect(null);
|
|
10996
10601
|
}
|
|
10997
|
-
if (allowFooterLinksHover) {
|
|
10998
|
-
const footerLinks = getFooterLinksContainer();
|
|
10999
|
-
if (footerLinks) {
|
|
11000
|
-
const containerRect = footerLinks.getBoundingClientRect();
|
|
11001
|
-
const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
|
|
11002
|
-
if (overContainer && !isPointOverNavItem(footerLinks, x, y) && !isPointOverFooterColumn(x, y)) {
|
|
11003
|
-
hoveredNavContainerRef.current = footerLinks;
|
|
11004
|
-
setHoveredNavContainerRect(footerLinks.getBoundingClientRect());
|
|
11005
|
-
hoveredItemElRef.current = null;
|
|
11006
|
-
setHoveredItemRect(null);
|
|
11007
|
-
return;
|
|
11008
|
-
}
|
|
11009
|
-
}
|
|
11010
|
-
}
|
|
11011
|
-
hoveredNavContainerRef.current = null;
|
|
11012
|
-
setHoveredNavContainerRect(null);
|
|
11013
10602
|
for (const column of footerColumns) {
|
|
11014
10603
|
const containerRect = column.getBoundingClientRect();
|
|
11015
10604
|
const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
|
|
@@ -11516,7 +11105,6 @@ function OhhwellsBridge() {
|
|
|
11516
11105
|
}
|
|
11517
11106
|
editContentRef.current = { ...editContentRef.current, ...content };
|
|
11518
11107
|
reconcileNavbarItemsFromContent(editContentRef.current);
|
|
11519
|
-
reconcileFooterOrderFromContent(editContentRef.current);
|
|
11520
11108
|
syncNavigationDragCursorAttrs();
|
|
11521
11109
|
enforceLinkHrefs();
|
|
11522
11110
|
postToParentRef.current({ type: "ow:hydrate-done" });
|
|
@@ -11571,11 +11159,6 @@ function OhhwellsBridge() {
|
|
|
11571
11159
|
}
|
|
11572
11160
|
if (selectedElRef.current) {
|
|
11573
11161
|
if (toolbarVariantRef.current === "select-frame") {
|
|
11574
|
-
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
11575
|
-
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
11576
|
-
selectFrameRef.current(parent2);
|
|
11577
|
-
return;
|
|
11578
|
-
}
|
|
11579
11162
|
deselectRef.current();
|
|
11580
11163
|
return;
|
|
11581
11164
|
}
|
|
@@ -11591,10 +11174,13 @@ function OhhwellsBridge() {
|
|
|
11591
11174
|
const handleKeyDown = (e) => {
|
|
11592
11175
|
if (e.key === "Escape" && document.querySelector("[data-ohw-section-picker]")) return;
|
|
11593
11176
|
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a" && activeElRef.current) {
|
|
11594
|
-
|
|
11595
|
-
|
|
11596
|
-
|
|
11597
|
-
|
|
11177
|
+
const navAnchor = getNavigationItemAnchor(activeElRef.current);
|
|
11178
|
+
if (navAnchor) {
|
|
11179
|
+
e.preventDefault();
|
|
11180
|
+
selectAllTextInEditable(activeElRef.current);
|
|
11181
|
+
refreshActiveCommandsRef.current();
|
|
11182
|
+
return;
|
|
11183
|
+
}
|
|
11598
11184
|
}
|
|
11599
11185
|
if (e.key === "Escape" && linkPopoverOpenRef.current) {
|
|
11600
11186
|
setLinkPopoverRef.current(null);
|
|
@@ -11602,12 +11188,6 @@ function OhhwellsBridge() {
|
|
|
11602
11188
|
}
|
|
11603
11189
|
if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
|
|
11604
11190
|
if (toolbarVariantRef.current === "select-frame") {
|
|
11605
|
-
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
11606
|
-
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
11607
|
-
e.preventDefault();
|
|
11608
|
-
selectFrameRef.current(parent2);
|
|
11609
|
-
return;
|
|
11610
|
-
}
|
|
11611
11191
|
deselectRef.current();
|
|
11612
11192
|
return;
|
|
11613
11193
|
}
|
|
@@ -12221,7 +11801,7 @@ function OhhwellsBridge() {
|
|
|
12221
11801
|
window.addEventListener("hashchange", onHashChange);
|
|
12222
11802
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
12223
11803
|
}, [pathname]);
|
|
12224
|
-
const handleCommand =
|
|
11804
|
+
const handleCommand = useCallback4((cmd) => {
|
|
12225
11805
|
const el = activeElRef.current;
|
|
12226
11806
|
const selBefore = window.getSelection();
|
|
12227
11807
|
let savedOffsets = null;
|
|
@@ -12257,7 +11837,7 @@ function OhhwellsBridge() {
|
|
|
12257
11837
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
12258
11838
|
refreshActiveCommandsRef.current();
|
|
12259
11839
|
}, []);
|
|
12260
|
-
const handleStateChange =
|
|
11840
|
+
const handleStateChange = useCallback4((state) => {
|
|
12261
11841
|
if (!activeStateElRef.current) return;
|
|
12262
11842
|
const el = activeStateElRef.current;
|
|
12263
11843
|
if (state === "Default") {
|
|
@@ -12270,11 +11850,11 @@ function OhhwellsBridge() {
|
|
|
12270
11850
|
}
|
|
12271
11851
|
setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
|
|
12272
11852
|
}, [deactivate]);
|
|
12273
|
-
const closeLinkPopover =
|
|
11853
|
+
const closeLinkPopover = useCallback4(() => {
|
|
12274
11854
|
addNavAfterAnchorRef.current = null;
|
|
12275
11855
|
setLinkPopover(null);
|
|
12276
11856
|
}, []);
|
|
12277
|
-
const openLinkPopoverForActive =
|
|
11857
|
+
const openLinkPopoverForActive = useCallback4(() => {
|
|
12278
11858
|
const hrefCtx = getHrefKeyFromElement(activeElRef.current);
|
|
12279
11859
|
if (!hrefCtx) return;
|
|
12280
11860
|
bumpLinkPopoverGrace();
|
|
@@ -12285,7 +11865,7 @@ function OhhwellsBridge() {
|
|
|
12285
11865
|
});
|
|
12286
11866
|
deactivate();
|
|
12287
11867
|
}, [deactivate]);
|
|
12288
|
-
const openLinkPopoverForSelected =
|
|
11868
|
+
const openLinkPopoverForSelected = useCallback4(() => {
|
|
12289
11869
|
const anchor = selectedElRef.current;
|
|
12290
11870
|
if (!anchor) return;
|
|
12291
11871
|
const key = anchor.getAttribute("data-ohw-href-key");
|
|
@@ -12298,7 +11878,7 @@ function OhhwellsBridge() {
|
|
|
12298
11878
|
});
|
|
12299
11879
|
deselect();
|
|
12300
11880
|
}, [deselect]);
|
|
12301
|
-
const handleLinkPopoverSubmit =
|
|
11881
|
+
const handleLinkPopoverSubmit = useCallback4(
|
|
12302
11882
|
(target) => {
|
|
12303
11883
|
const session = linkPopoverSessionRef.current;
|
|
12304
11884
|
if (!session) return;
|
|
@@ -12357,13 +11937,13 @@ function OhhwellsBridge() {
|
|
|
12357
11937
|
const showEditLink = toolbarShowEditLink;
|
|
12358
11938
|
const currentSections = sectionsByPath[pathname] ?? [];
|
|
12359
11939
|
linkPopoverOpenRef.current = linkPopover !== null;
|
|
12360
|
-
const handleMediaReplace =
|
|
11940
|
+
const handleMediaReplace = useCallback4(
|
|
12361
11941
|
(key) => {
|
|
12362
11942
|
postToParent2({ type: "ow:image-pick", key, elementType: mediaHover?.elementType ?? "image" });
|
|
12363
11943
|
},
|
|
12364
11944
|
[postToParent2, mediaHover?.elementType]
|
|
12365
11945
|
);
|
|
12366
|
-
const handleMediaFadeOutComplete =
|
|
11946
|
+
const handleMediaFadeOutComplete = useCallback4((key) => {
|
|
12367
11947
|
setUploadingRects((prev) => {
|
|
12368
11948
|
if (!(key in prev)) return prev;
|
|
12369
11949
|
const next = { ...prev };
|
|
@@ -12371,7 +11951,7 @@ function OhhwellsBridge() {
|
|
|
12371
11951
|
return next;
|
|
12372
11952
|
});
|
|
12373
11953
|
}, []);
|
|
12374
|
-
const handleVideoSettingsChange =
|
|
11954
|
+
const handleVideoSettingsChange = useCallback4(
|
|
12375
11955
|
(key, settings) => {
|
|
12376
11956
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
12377
11957
|
const video = getVideoEl(el);
|
|
@@ -12394,9 +11974,9 @@ function OhhwellsBridge() {
|
|
|
12394
11974
|
[postToParent2]
|
|
12395
11975
|
);
|
|
12396
11976
|
return bridgeRoot ? createPortal2(
|
|
12397
|
-
/* @__PURE__ */
|
|
12398
|
-
/* @__PURE__ */
|
|
12399
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */
|
|
11977
|
+
/* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
11978
|
+
/* @__PURE__ */ jsx24("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
11979
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ jsx24(
|
|
12400
11980
|
MediaOverlay,
|
|
12401
11981
|
{
|
|
12402
11982
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -12407,7 +11987,7 @@ function OhhwellsBridge() {
|
|
|
12407
11987
|
},
|
|
12408
11988
|
`uploading-${key}`
|
|
12409
11989
|
)),
|
|
12410
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */
|
|
11990
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ jsx24(
|
|
12411
11991
|
MediaOverlay,
|
|
12412
11992
|
{
|
|
12413
11993
|
hover: mediaHover,
|
|
@@ -12416,10 +11996,10 @@ function OhhwellsBridge() {
|
|
|
12416
11996
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
12417
11997
|
}
|
|
12418
11998
|
),
|
|
12419
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */
|
|
12420
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */
|
|
12421
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */
|
|
12422
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */
|
|
11999
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ jsx24(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
12000
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ jsx24(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
12001
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ jsx24(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
12002
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ jsx24(
|
|
12423
12003
|
"div",
|
|
12424
12004
|
{
|
|
12425
12005
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -12429,7 +12009,7 @@ function OhhwellsBridge() {
|
|
|
12429
12009
|
width: slot.width,
|
|
12430
12010
|
height: slot.height
|
|
12431
12011
|
},
|
|
12432
|
-
children: /* @__PURE__ */
|
|
12012
|
+
children: /* @__PURE__ */ jsx24(
|
|
12433
12013
|
DropIndicator,
|
|
12434
12014
|
{
|
|
12435
12015
|
direction: slot.direction,
|
|
@@ -12440,7 +12020,7 @@ function OhhwellsBridge() {
|
|
|
12440
12020
|
},
|
|
12441
12021
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
12442
12022
|
)),
|
|
12443
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */
|
|
12023
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ jsx24(
|
|
12444
12024
|
"div",
|
|
12445
12025
|
{
|
|
12446
12026
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -12450,7 +12030,7 @@ function OhhwellsBridge() {
|
|
|
12450
12030
|
width: slot.width,
|
|
12451
12031
|
height: slot.height
|
|
12452
12032
|
},
|
|
12453
|
-
children: /* @__PURE__ */
|
|
12033
|
+
children: /* @__PURE__ */ jsx24(
|
|
12454
12034
|
DropIndicator,
|
|
12455
12035
|
{
|
|
12456
12036
|
direction: slot.direction,
|
|
@@ -12461,11 +12041,10 @@ function OhhwellsBridge() {
|
|
|
12461
12041
|
},
|
|
12462
12042
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
12463
12043
|
)),
|
|
12464
|
-
hoveredNavContainerRect &&
|
|
12465
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */
|
|
12466
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */
|
|
12467
|
-
|
|
12468
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx25(
|
|
12044
|
+
hoveredNavContainerRect && toolbarVariant !== "select-frame" && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx24(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
12045
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ jsx24(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
12046
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx24(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
12047
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx24(
|
|
12469
12048
|
ItemInteractionLayer,
|
|
12470
12049
|
{
|
|
12471
12050
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -12479,7 +12058,7 @@ function OhhwellsBridge() {
|
|
|
12479
12058
|
onItemPointerDown: handleItemChromePointerDown,
|
|
12480
12059
|
onItemClick: handleItemChromeClick,
|
|
12481
12060
|
itemDragSurface: !isFooterFrameSelection,
|
|
12482
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */
|
|
12061
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */ jsx24(
|
|
12483
12062
|
ItemActionToolbar,
|
|
12484
12063
|
{
|
|
12485
12064
|
onEditLink: openLinkPopoverForSelected,
|
|
@@ -12492,8 +12071,8 @@ function OhhwellsBridge() {
|
|
|
12492
12071
|
) : void 0
|
|
12493
12072
|
}
|
|
12494
12073
|
),
|
|
12495
|
-
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */
|
|
12496
|
-
/* @__PURE__ */
|
|
12074
|
+
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
12075
|
+
/* @__PURE__ */ jsx24(
|
|
12497
12076
|
EditGlowChrome,
|
|
12498
12077
|
{
|
|
12499
12078
|
rect: toolbarRect,
|
|
@@ -12503,7 +12082,7 @@ function OhhwellsBridge() {
|
|
|
12503
12082
|
hideHandle: isItemDragging
|
|
12504
12083
|
}
|
|
12505
12084
|
),
|
|
12506
|
-
/* @__PURE__ */
|
|
12085
|
+
/* @__PURE__ */ jsx24(
|
|
12507
12086
|
FloatingToolbar,
|
|
12508
12087
|
{
|
|
12509
12088
|
rect: toolbarRect,
|
|
@@ -12516,7 +12095,7 @@ function OhhwellsBridge() {
|
|
|
12516
12095
|
}
|
|
12517
12096
|
)
|
|
12518
12097
|
] }),
|
|
12519
|
-
maxBadge && /* @__PURE__ */
|
|
12098
|
+
maxBadge && /* @__PURE__ */ jsxs13(
|
|
12520
12099
|
"div",
|
|
12521
12100
|
{
|
|
12522
12101
|
"data-ohw-max-badge": "",
|
|
@@ -12542,7 +12121,7 @@ function OhhwellsBridge() {
|
|
|
12542
12121
|
]
|
|
12543
12122
|
}
|
|
12544
12123
|
),
|
|
12545
|
-
toggleState && !linkPopover && /* @__PURE__ */
|
|
12124
|
+
toggleState && !linkPopover && /* @__PURE__ */ jsx24(
|
|
12546
12125
|
StateToggle,
|
|
12547
12126
|
{
|
|
12548
12127
|
rect: toggleState.rect,
|
|
@@ -12551,15 +12130,15 @@ function OhhwellsBridge() {
|
|
|
12551
12130
|
onStateChange: handleStateChange
|
|
12552
12131
|
}
|
|
12553
12132
|
),
|
|
12554
|
-
sectionGap && !linkPopover && /* @__PURE__ */
|
|
12133
|
+
sectionGap && !linkPopover && /* @__PURE__ */ jsxs13(
|
|
12555
12134
|
"div",
|
|
12556
12135
|
{
|
|
12557
12136
|
"data-ohw-section-insert-line": "",
|
|
12558
12137
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
12559
12138
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
12560
12139
|
children: [
|
|
12561
|
-
/* @__PURE__ */
|
|
12562
|
-
/* @__PURE__ */
|
|
12140
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
12141
|
+
/* @__PURE__ */ jsx24(
|
|
12563
12142
|
Badge,
|
|
12564
12143
|
{
|
|
12565
12144
|
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",
|
|
@@ -12576,11 +12155,11 @@ function OhhwellsBridge() {
|
|
|
12576
12155
|
children: "Add Section"
|
|
12577
12156
|
}
|
|
12578
12157
|
),
|
|
12579
|
-
/* @__PURE__ */
|
|
12158
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
12580
12159
|
]
|
|
12581
12160
|
}
|
|
12582
12161
|
),
|
|
12583
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */
|
|
12162
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ jsx24(
|
|
12584
12163
|
LinkPopover,
|
|
12585
12164
|
{
|
|
12586
12165
|
panelRef: linkPopoverPanelRef,
|