@ohhwells/bridge 0.1.48-next.113 → 0.1.49

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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // src/OhhwellsBridge.tsx
4
- import React11, { useCallback as useCallback5, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState8 } from "react";
4
+ import React11, { useCallback as useCallback4, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState8 } 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 { useCallback, useEffect, useId, useMemo, useRef, useState as useState2 } from "react";
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
- const trimmed = email.trim();
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(trimmed);
101
- setSubmittedEmail(trimmed);
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 target = new Date(date);
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
- const bookingDate = new Date(b.classDate);
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
- cls.showAvailability !== false && /* @__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: [
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
- cls.showAvailability !== false && /* @__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: [
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" : formatBookingLabel(cls)
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
- liveScheduleIdRef.current = effectiveId;
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
- window.parent.postMessage(
768
- { type: "ow:scheduling-not-connected", insertAfter, currentScheduleId: schedule?.id },
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();
@@ -5718,7 +5658,7 @@ function LinkEditorPanel({ state, onClose }) {
5718
5658
  }
5719
5659
 
5720
5660
  // src/ui/link-modal/SectionPickerOverlay.tsx
5721
- import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as useState4 } from "react";
5661
+ import { useCallback, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as useState4 } from "react";
5722
5662
  import { createPortal } from "react-dom";
5723
5663
  import { ArrowLeft, Check } from "lucide-react";
5724
5664
  import { usePathname, useRouter } from "next/navigation";
@@ -5849,7 +5789,7 @@ function SectionPickerOverlay({
5849
5789
  );
5850
5790
  sectionIdsRef.current = sectionIds;
5851
5791
  const rects = useSectionRects(sectionIdsKey, isOnTargetPage);
5852
- const applyHoverAt = useCallback2(
5792
+ const applyHoverAt = useCallback(
5853
5793
  (x, y, liveRects) => {
5854
5794
  const ids = sectionIdsRef.current;
5855
5795
  const map = liveRects ?? readSectionRects(ids);
@@ -5929,7 +5869,7 @@ function SectionPickerOverlay({
5929
5869
  window.removeEventListener("message", onPointerSync);
5930
5870
  };
5931
5871
  }, [rects, applyHoverAt]);
5932
- const handleSelect = useCallback2(
5872
+ const handleSelect = useCallback(
5933
5873
  (section) => {
5934
5874
  if (selectedId) return;
5935
5875
  setSelectedId(section.id);
@@ -6060,7 +6000,7 @@ function SectionPickerOverlay({
6060
6000
  }
6061
6001
 
6062
6002
  // src/ui/link-modal/useLinkModalState.ts
6063
- import { useCallback as useCallback3, useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
6003
+ import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
6064
6004
  function useLinkModalState({
6065
6005
  open,
6066
6006
  mode,
@@ -6079,7 +6019,7 @@ function useLinkModalState({
6079
6019
  const [step, setStep] = useState5("input");
6080
6020
  const [dropdownOpen, setDropdownOpen] = useState5(false);
6081
6021
  const [urlError, setUrlError] = useState5("");
6082
- const reset = useCallback3(() => {
6022
+ const reset = useCallback2(() => {
6083
6023
  setSearchValue("");
6084
6024
  setSelectedPage(null);
6085
6025
  setSelectedSection(null);
@@ -7065,195 +7005,7 @@ function parseFooterOrder(content) {
7065
7005
  return null;
7066
7006
  }
7067
7007
  }
7068
- var FOOTER_HEADING_RE = /^footer-(\d+)-heading$/;
7069
- var FOOTER_LABEL_RE = /^footer-(\d+)-(\d+)-label$/;
7070
- var DEFAULT_FOOTER_COLUMN_HEADING = "New";
7071
- var DEFAULT_FOOTER_COLUMN_LINK_LABEL = "New link";
7072
- var DEFAULT_FOOTER_COLUMN_LINK_HREF = "";
7073
- function isFooterLinksContainer(el) {
7074
- return el.hasAttribute("data-ohw-footer-links") || el.classList.contains("rb-footer-links");
7075
- }
7076
- function getFooterColumnIndicesInDom() {
7077
- const indices = /* @__PURE__ */ new Set();
7078
- for (const col of listFooterColumns()) {
7079
- const attr = col.getAttribute("data-ohw-footer-col");
7080
- if (attr != null) {
7081
- const n = parseInt(attr, 10);
7082
- if (Number.isFinite(n)) indices.add(n);
7083
- }
7084
- for (const link of listFooterLinksInColumn(col)) {
7085
- const parsed = parseFooterHrefKey(link.getAttribute("data-ohw-href-key"));
7086
- if (parsed) indices.add(parsed.col);
7087
- }
7088
- const heading = col.querySelector('[data-ohw-key^="footer-"][data-ohw-key$="-heading"]');
7089
- const headingKey = heading?.getAttribute("data-ohw-key");
7090
- if (headingKey) {
7091
- const match = headingKey.match(FOOTER_HEADING_RE);
7092
- if (match) indices.add(parseInt(match[1], 10));
7093
- }
7094
- }
7095
- return [...indices].sort((a, b) => a - b);
7096
- }
7097
- function getNextFooterColumnIndex() {
7098
- const indices = getFooterColumnIndicesInDom();
7099
- if (indices.length === 0) return 0;
7100
- return Math.max(...indices) + 1;
7101
- }
7102
- function cloneFooterLinkShell(template) {
7103
- const anchor = document.createElement("a");
7104
- if (template) {
7105
- anchor.style.cssText = template.style.cssText;
7106
- if (template.className) anchor.className = template.className;
7107
- }
7108
- anchor.style.cursor = "pointer";
7109
- anchor.style.textDecoration = "none";
7110
- return anchor;
7111
- }
7112
- function buildFooterHeading(colIndex, text) {
7113
- const heading = document.createElement("p");
7114
- heading.setAttribute("data-ohw-editable", "text");
7115
- heading.setAttribute("data-ohw-key", `footer-${colIndex}-heading`);
7116
- heading.textContent = text;
7117
- heading.style.cssText = [
7118
- "color: var(--espresso, #3d312b)",
7119
- "font-size: 14px",
7120
- "font-weight: 800",
7121
- "opacity: 0.82",
7122
- "margin: 0 0 6px",
7123
- "padding: 0",
7124
- "line-height: 1.2"
7125
- ].join(";");
7126
- return heading;
7127
- }
7128
- function buildFooterLink(colIndex, itemIndex, href, label, template) {
7129
- const anchor = cloneFooterLinkShell(template);
7130
- anchor.setAttribute("href", href);
7131
- anchor.setAttribute("data-ohw-href-key", `footer-${colIndex}-${itemIndex}-href`);
7132
- const span = document.createElement("span");
7133
- span.setAttribute("data-ohw-editable", "text");
7134
- span.setAttribute("data-ohw-key", `footer-${colIndex}-${itemIndex}-label`);
7135
- span.textContent = label;
7136
- anchor.appendChild(span);
7137
- return anchor;
7138
- }
7139
- function footerColumnExistsInDom(colIndex) {
7140
- 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;
7141
- }
7142
- function getFooterLinkTemplate() {
7143
- for (const col of listFooterColumns()) {
7144
- const link = listFooterLinksInColumn(col)[0];
7145
- if (link) return link;
7146
- }
7147
- return null;
7148
- }
7149
- function getFooterColumnTemplate() {
7150
- return listFooterColumns()[0] ?? null;
7151
- }
7152
- function insertFooterColumnDom(colIndex, heading, items) {
7153
- const container = getFooterLinksContainer();
7154
- if (!container) return null;
7155
- const colTemplate = getFooterColumnTemplate();
7156
- const linkTemplate = getFooterLinkTemplate();
7157
- const column = document.createElement("div");
7158
- if (colTemplate?.className) column.className = colTemplate.className;
7159
- else column.className = "rb-footer-link-col";
7160
- column.setAttribute("data-ohw-footer-col", String(colIndex));
7161
- if (colTemplate) {
7162
- const gap = getComputedStyle(colTemplate).gap;
7163
- if (gap && gap !== "normal") column.style.gap = gap;
7164
- column.style.display = getComputedStyle(colTemplate).display || "flex";
7165
- column.style.flexDirection = "column";
7166
- }
7167
- column.appendChild(buildFooterHeading(colIndex, heading));
7168
- let firstLink = null;
7169
- items.forEach((item, itemIndex) => {
7170
- const link = buildFooterLink(colIndex, itemIndex, item.href, item.label, linkTemplate);
7171
- column.appendChild(link);
7172
- if (!firstLink) firstLink = link;
7173
- });
7174
- container.appendChild(column);
7175
- return { column, firstLink };
7176
- }
7177
- function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL, linkHref = DEFAULT_FOOTER_COLUMN_LINK_HREF) {
7178
- const colIndex = getNextFooterColumnIndex();
7179
- const inserted = insertFooterColumnDom(colIndex, heading, [{ href: linkHref, label: linkLabel }]);
7180
- if (!inserted?.firstLink) throw new Error("Failed to insert footer column");
7181
- syncFooterColumnIndices(listFooterColumns());
7182
- return {
7183
- column: inserted.column,
7184
- firstLink: inserted.firstLink,
7185
- colIndex,
7186
- headingKey: `footer-${colIndex}-heading`,
7187
- hrefKey: `footer-${colIndex}-0-href`,
7188
- labelKey: `footer-${colIndex}-0-label`,
7189
- heading,
7190
- label: linkLabel,
7191
- href: linkHref,
7192
- order: getFooterOrderFromDom()
7193
- };
7194
- }
7195
- function collectFooterColumnIndicesFromContent(content) {
7196
- const indices = /* @__PURE__ */ new Set();
7197
- for (const key of Object.keys(content)) {
7198
- const href = parseFooterHrefKey(key);
7199
- if (href) indices.add(href.col);
7200
- const heading = key.match(FOOTER_HEADING_RE);
7201
- if (heading) indices.add(parseInt(heading[1], 10));
7202
- const label = key.match(FOOTER_LABEL_RE);
7203
- if (label) indices.add(parseInt(label[1], 10));
7204
- }
7205
- const order = parseFooterOrder(content);
7206
- if (order) {
7207
- for (const col of order) {
7208
- for (const hrefKey of col) {
7209
- const parsed = parseFooterHrefKey(hrefKey);
7210
- if (parsed) indices.add(parsed.col);
7211
- }
7212
- }
7213
- }
7214
- return [...indices].sort((a, b) => a - b);
7215
- }
7216
- function collectFooterItemsForColumn(content, colIndex) {
7217
- const itemIndices = /* @__PURE__ */ new Set();
7218
- for (const key of Object.keys(content)) {
7219
- const href = parseFooterHrefKey(key);
7220
- if (href?.col === colIndex) itemIndices.add(href.item);
7221
- const label = key.match(FOOTER_LABEL_RE);
7222
- if (label && parseInt(label[1], 10) === colIndex) {
7223
- itemIndices.add(parseInt(label[2], 10));
7224
- }
7225
- }
7226
- const sorted = [...itemIndices].sort((a, b) => a - b);
7227
- if (sorted.length === 0) {
7228
- return [
7229
- {
7230
- href: content[`footer-${colIndex}-0-href`] ?? DEFAULT_FOOTER_COLUMN_LINK_HREF,
7231
- label: content[`footer-${colIndex}-0-label`] ?? DEFAULT_FOOTER_COLUMN_LINK_LABEL
7232
- }
7233
- ];
7234
- }
7235
- return sorted.map((itemIndex) => ({
7236
- href: content[`footer-${colIndex}-${itemIndex}-href`] ?? DEFAULT_FOOTER_COLUMN_LINK_HREF,
7237
- label: content[`footer-${colIndex}-${itemIndex}-label`] ?? DEFAULT_FOOTER_COLUMN_LINK_LABEL
7238
- }));
7239
- }
7240
- function reconcileFooterColumnsFromContent(content) {
7241
- const indices = collectFooterColumnIndicesFromContent(content);
7242
- for (const colIndex of indices) {
7243
- if (footerColumnExistsInDom(colIndex)) continue;
7244
- const heading = content[`footer-${colIndex}-heading`] ?? DEFAULT_FOOTER_COLUMN_HEADING;
7245
- const items = collectFooterItemsForColumn(content, colIndex);
7246
- const hasPayload = Boolean(content[`footer-${colIndex}-heading`]) || items.some(
7247
- (_, i) => content[`footer-${colIndex}-${i}-href`] !== void 0 || content[`footer-${colIndex}-${i}-label`] !== void 0
7248
- ) || (parseFooterOrder(content)?.some(
7249
- (col) => col.some((k) => parseFooterHrefKey(k)?.col === colIndex)
7250
- ) ?? false);
7251
- if (!hasPayload) continue;
7252
- insertFooterColumnDom(colIndex, heading, items);
7253
- }
7254
- }
7255
7008
  function reconcileFooterOrderFromContent(content) {
7256
- reconcileFooterColumnsFromContent(content);
7257
7009
  const order = parseFooterOrder(content);
7258
7010
  if (!order?.length) return;
7259
7011
  const current = getFooterOrderFromDom();
@@ -7263,26 +7015,6 @@ function reconcileFooterOrderFromContent(content) {
7263
7015
  }
7264
7016
  applyFooterOrder(order);
7265
7017
  }
7266
- function resolveFooterLinksContainerSelectionTarget(target, clientX, clientY, isPointOverItem) {
7267
- const container = getFooterLinksContainer();
7268
- if (!container) return null;
7269
- const inContainer = target === container || container.contains(target) && Boolean(target.closest("[data-ohw-footer-links], .rb-footer-links"));
7270
- if (!inContainer && target !== container) {
7271
- const r2 = container.getBoundingClientRect();
7272
- const over = clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
7273
- if (!over) return null;
7274
- }
7275
- if (isPointOverItem(container, clientX, clientY)) return null;
7276
- const column = target.closest("[data-ohw-footer-col], [data-ohw-footer-column]") ?? null;
7277
- if (column && container.contains(column)) {
7278
- if (target === column || column.contains(target)) return null;
7279
- }
7280
- if (target === container || container.contains(target) || inContainer) {
7281
- if (target === container || isFooterLinksContainer(target)) return container;
7282
- if (!column) return container;
7283
- }
7284
- return null;
7285
- }
7286
7018
  function isRowLayoutColumn(links) {
7287
7019
  if (links.length < 2) return false;
7288
7020
  const firstTop = links[0].getBoundingClientRect().top;
@@ -7438,30 +7170,6 @@ function hitTestColumnDropSlot(clientX, _clientY) {
7438
7170
  return best?.slot ?? null;
7439
7171
  }
7440
7172
 
7441
- // src/lib/add-footer-column.ts
7442
- function buildFooterColumnEditContentPatch(result) {
7443
- return {
7444
- [result.headingKey]: result.heading,
7445
- [result.hrefKey]: result.href,
7446
- [result.labelKey]: result.label,
7447
- [FOOTER_ORDER_KEY]: JSON.stringify(result.order)
7448
- };
7449
- }
7450
- function addFooterColumnWithPersist({
7451
- postToParent: postToParent2
7452
- }) {
7453
- const result = insertFooterColumn();
7454
- const patch = buildFooterColumnEditContentPatch(result);
7455
- setStoredLinkHref(result.hrefKey, result.href);
7456
- postToParent2({
7457
- type: "ow:change",
7458
- nodes: Object.entries(patch).map(([key, text]) => ({ key, text }))
7459
- });
7460
- postToParent2({ type: "ow:toast", title: "Item added", toastType: "success" });
7461
- enforceLinkHrefs();
7462
- return result;
7463
- }
7464
-
7465
7173
  // src/lib/item-drag-interaction.ts
7466
7174
  function disableNativeHrefDrag(el) {
7467
7175
  if (el.draggable) el.draggable = false;
@@ -7659,7 +7367,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
7659
7367
  }
7660
7368
 
7661
7369
  // src/useNavItemDrag.ts
7662
- import { useCallback as useCallback4, useEffect as useEffect7, useRef as useRef6, useState as useState6 } from "react";
7370
+ import { useCallback as useCallback3, useEffect as useEffect7, useRef as useRef6, useState as useState6 } from "react";
7663
7371
  function useNavItemDrag({
7664
7372
  isEditMode,
7665
7373
  editContentRef,
@@ -7688,7 +7396,7 @@ function useNavItemDrag({
7688
7396
  const [navDropSlots, setNavDropSlots] = useState6([]);
7689
7397
  const [activeNavDropIndex, setActiveNavDropIndex] = useState6(null);
7690
7398
  const navPointerDragRef = useRef6(null);
7691
- const clearNavDragVisuals = useCallback4(() => {
7399
+ const clearNavDragVisuals = useCallback3(() => {
7692
7400
  navDragRef.current = null;
7693
7401
  setNavDropSlots([]);
7694
7402
  setActiveNavDropIndex(null);
@@ -7697,7 +7405,7 @@ function useNavItemDrag({
7697
7405
  setIsItemDragging(false);
7698
7406
  unlockItemDragInteraction();
7699
7407
  }, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
7700
- const refreshNavDragVisuals = useCallback4(
7408
+ const refreshNavDragVisuals = useCallback3(
7701
7409
  (session, activeSlot, clientX, clientY) => {
7702
7410
  setDraggedItemRect(session.draggedEl.getBoundingClientRect());
7703
7411
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -7721,7 +7429,7 @@ function useNavItemDrag({
7721
7429
  });
7722
7430
  const beginNavDragRef = useRef6(() => {
7723
7431
  });
7724
- const beginNavDrag = useCallback4(
7432
+ const beginNavDrag = useCallback3(
7725
7433
  (session) => {
7726
7434
  const rect = session.draggedEl.getBoundingClientRect();
7727
7435
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -7748,7 +7456,7 @@ function useNavItemDrag({
7748
7456
  ]
7749
7457
  );
7750
7458
  beginNavDragRef.current = beginNavDrag;
7751
- const commitNavDrag = useCallback4(
7459
+ const commitNavDrag = useCallback3(
7752
7460
  (clientX, clientY) => {
7753
7461
  const session = navDragRef.current;
7754
7462
  if (!session) {
@@ -7809,7 +7517,7 @@ function useNavItemDrag({
7809
7517
  [clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
7810
7518
  );
7811
7519
  commitNavDragRef.current = commitNavDrag;
7812
- const startNavLinkDrag = useCallback4(
7520
+ const startNavLinkDrag = useCallback3(
7813
7521
  (anchor, clientX, clientY, wasSelected) => {
7814
7522
  if (footerDragRef.current) return false;
7815
7523
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
@@ -7827,7 +7535,7 @@ function useNavItemDrag({
7827
7535
  },
7828
7536
  [beginNavDrag, footerDragRef, isDragHandleDisabled2, isNavbarButton3]
7829
7537
  );
7830
- const onNavDragOver = useCallback4(
7538
+ const onNavDragOver = useCallback3(
7831
7539
  (e) => {
7832
7540
  const session = navDragRef.current;
7833
7541
  if (!session) return false;
@@ -7964,7 +7672,7 @@ function useNavItemDrag({
7964
7672
  setLinkPopover,
7965
7673
  suppressNextClickRef
7966
7674
  ]);
7967
- const armNavPressFromChrome = useCallback4(
7675
+ const armNavPressFromChrome = useCallback3(
7968
7676
  (selected, clientX, clientY, pointerId) => {
7969
7677
  const hrefKey = selected.getAttribute("data-ohw-href-key");
7970
7678
  if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
@@ -7994,51 +7702,6 @@ function useNavItemDrag({
7994
7702
  };
7995
7703
  }
7996
7704
 
7997
- // src/ui/footer-container-chrome.tsx
7998
- import { Plus as Plus2 } from "lucide-react";
7999
- import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
8000
- function FooterContainerChrome({ rect, onAdd }) {
8001
- const chromeGap = 6;
8002
- const buttonMargin = 7;
8003
- return /* @__PURE__ */ jsx22(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx22(
8004
- "div",
8005
- {
8006
- "data-ohw-footer-container-chrome": "",
8007
- "data-ohw-bridge": "",
8008
- className: "pointer-events-none fixed z-[2147483647]",
8009
- style: {
8010
- top: rect.top - chromeGap,
8011
- left: rect.left - chromeGap,
8012
- width: rect.width + chromeGap * 2,
8013
- height: rect.height + chromeGap * 2
8014
- },
8015
- children: /* @__PURE__ */ jsxs14(Tooltip, { children: [
8016
- /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
8017
- "button",
8018
- {
8019
- type: "button",
8020
- "data-ohw-footer-add-button": "",
8021
- 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",
8022
- style: { top: chromeGap - buttonMargin },
8023
- "aria-label": "Add item",
8024
- onMouseDown: (e) => {
8025
- e.preventDefault();
8026
- e.stopPropagation();
8027
- },
8028
- onClick: (e) => {
8029
- e.preventDefault();
8030
- e.stopPropagation();
8031
- onAdd();
8032
- },
8033
- children: /* @__PURE__ */ jsx22(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
8034
- }
8035
- ) }),
8036
- /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 9, children: "Add item" })
8037
- ] })
8038
- }
8039
- ) });
8040
- }
8041
-
8042
7705
  // src/lib/carousel.ts
8043
7706
  import { useEffect as useEffect8, useState as useState7 } from "react";
8044
7707
  var CAROUSEL_ATTR = "data-ohw-carousel";
@@ -8124,14 +7787,14 @@ function useOhwCarousel(key, initial) {
8124
7787
  }
8125
7788
 
8126
7789
  // src/ui/navbar-container-chrome.tsx
8127
- import { Plus as Plus3 } from "lucide-react";
8128
- import { jsx as jsx23 } from "react/jsx-runtime";
7790
+ import { Plus as Plus2 } from "lucide-react";
7791
+ import { jsx as jsx22 } from "react/jsx-runtime";
8129
7792
  function NavbarContainerChrome({
8130
7793
  rect,
8131
7794
  onAdd
8132
7795
  }) {
8133
7796
  const chromeGap = 6;
8134
- return /* @__PURE__ */ jsx23(
7797
+ return /* @__PURE__ */ jsx22(
8135
7798
  "div",
8136
7799
  {
8137
7800
  "data-ohw-navbar-container-chrome": "",
@@ -8143,7 +7806,7 @@ function NavbarContainerChrome({
8143
7806
  width: rect.width + chromeGap * 2,
8144
7807
  height: rect.height + chromeGap * 2
8145
7808
  },
8146
- children: /* @__PURE__ */ jsx23(
7809
+ children: /* @__PURE__ */ jsx22(
8147
7810
  "button",
8148
7811
  {
8149
7812
  type: "button",
@@ -8160,7 +7823,7 @@ function NavbarContainerChrome({
8160
7823
  e.stopPropagation();
8161
7824
  onAdd();
8162
7825
  },
8163
- children: /* @__PURE__ */ jsx23(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
7826
+ children: /* @__PURE__ */ jsx22(Plus2, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
8164
7827
  }
8165
7828
  )
8166
7829
  }
@@ -8169,7 +7832,7 @@ function NavbarContainerChrome({
8169
7832
 
8170
7833
  // src/ui/drop-indicator.tsx
8171
7834
  import * as React10 from "react";
8172
- import { jsx as jsx24 } from "react/jsx-runtime";
7835
+ import { jsx as jsx23 } from "react/jsx-runtime";
8173
7836
  var dropIndicatorVariants = cva(
8174
7837
  "ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
8175
7838
  {
@@ -8193,7 +7856,7 @@ var dropIndicatorVariants = cva(
8193
7856
  );
8194
7857
  var DropIndicator = React10.forwardRef(
8195
7858
  ({ className, direction, state, ...props }, ref) => {
8196
- return /* @__PURE__ */ jsx24(
7859
+ return /* @__PURE__ */ jsx23(
8197
7860
  "div",
8198
7861
  {
8199
7862
  ref,
@@ -8210,7 +7873,7 @@ var DropIndicator = React10.forwardRef(
8210
7873
  DropIndicator.displayName = "DropIndicator";
8211
7874
 
8212
7875
  // src/ui/badge.tsx
8213
- import { jsx as jsx25 } from "react/jsx-runtime";
7876
+ import { jsx as jsx24 } from "react/jsx-runtime";
8214
7877
  var badgeVariants = cva(
8215
7878
  "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",
8216
7879
  {
@@ -8228,12 +7891,12 @@ var badgeVariants = cva(
8228
7891
  }
8229
7892
  );
8230
7893
  function Badge({ className, variant, ...props }) {
8231
- return /* @__PURE__ */ jsx25("div", { className: cn(badgeVariants({ variant }), className), ...props });
7894
+ return /* @__PURE__ */ jsx24("div", { className: cn(badgeVariants({ variant }), className), ...props });
8232
7895
  }
8233
7896
 
8234
7897
  // src/OhhwellsBridge.tsx
8235
7898
  import { Link as Link2 } from "lucide-react";
8236
- import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
7899
+ import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
8237
7900
  var PRIMARY2 = "#0885FE";
8238
7901
  var IMAGE_FADE_MS = 300;
8239
7902
  function runOpacityFade(el, onDone) {
@@ -8412,7 +8075,7 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
8412
8075
  const root = createRoot(container);
8413
8076
  flushSync(() => {
8414
8077
  root.render(
8415
- /* @__PURE__ */ jsx26(
8078
+ /* @__PURE__ */ jsx25(
8416
8079
  SchedulingWidget,
8417
8080
  {
8418
8081
  notifyOnConnect,
@@ -8616,7 +8279,7 @@ function applyLinkByKey(key, val) {
8616
8279
  }
8617
8280
  function isInsideLinkEditor(target) {
8618
8281
  return Boolean(
8619
- 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-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
8282
+ 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"]')
8620
8283
  );
8621
8284
  }
8622
8285
  function getHrefKeyFromElement(el) {
@@ -8697,7 +8360,7 @@ function isInferredFooterGroup(el) {
8697
8360
  return countFooterNavItems(el) >= 2;
8698
8361
  }
8699
8362
  function isNavigationContainer(el) {
8700
- return el.hasAttribute("data-ohw-nav-container") || isFooterLinksContainer(el) || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isNavigationRoot(el) || isInferredFooterGroup(el);
8363
+ return el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isNavigationRoot(el) || isInferredFooterGroup(el);
8701
8364
  }
8702
8365
  function isNavbarLinksContainer(el) {
8703
8366
  return el.hasAttribute("data-ohw-nav-container");
@@ -8716,9 +8379,6 @@ function isPointOverNavigation(x, y) {
8716
8379
  const roots = /* @__PURE__ */ new Set();
8717
8380
  const navRoot = document.querySelector("[data-ohw-nav-root]") ?? document.querySelector("nav");
8718
8381
  if (navRoot) roots.add(navRoot);
8719
- document.querySelectorAll("[data-ohw-nav-drawer], [data-ohw-nav-container]").forEach((el) => {
8720
- roots.add(el);
8721
- });
8722
8382
  const footer = document.querySelector("footer");
8723
8383
  if (footer) roots.add(footer);
8724
8384
  for (const root of roots) {
@@ -8747,12 +8407,6 @@ function isPointOverNavItem(container, x, y) {
8747
8407
  return x >= itemRect.left && x <= itemRect.right && y >= itemRect.top && y <= itemRect.bottom;
8748
8408
  });
8749
8409
  }
8750
- function isPointOverFooterColumn(x, y) {
8751
- return listFooterColumns().some((col) => {
8752
- const r2 = col.getBoundingClientRect();
8753
- return x >= r2.left && x <= r2.right && y >= r2.top && y <= r2.bottom;
8754
- });
8755
- }
8756
8410
  function resolveNavContainerSelectionTarget(target, clientX, clientY) {
8757
8411
  if (getNavigationItemAnchor(target)) return null;
8758
8412
  if (target.closest('[data-ohw-role="navbar-button"]')) return null;
@@ -8783,10 +8437,7 @@ function getNavigationSelectionParent(el) {
8783
8437
  if (footerGroup) return footerGroup;
8784
8438
  return getNavigationRoot(el);
8785
8439
  }
8786
- if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup(el))) {
8787
- return getFooterLinksContainer();
8788
- }
8789
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup(el)) {
8440
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup(el)) {
8790
8441
  return getNavigationRoot(el);
8791
8442
  }
8792
8443
  return null;
@@ -9013,7 +8664,7 @@ function EditGlowChrome({
9013
8664
  hideHandle = false
9014
8665
  }) {
9015
8666
  const GAP = SELECTION_CHROME_GAP2;
9016
- return /* @__PURE__ */ jsxs15(
8667
+ return /* @__PURE__ */ jsxs14(
9017
8668
  "div",
9018
8669
  {
9019
8670
  ref: elRef,
@@ -9028,7 +8679,7 @@ function EditGlowChrome({
9028
8679
  zIndex: 2147483646
9029
8680
  },
9030
8681
  children: [
9031
- /* @__PURE__ */ jsx26(
8682
+ /* @__PURE__ */ jsx25(
9032
8683
  "div",
9033
8684
  {
9034
8685
  style: {
@@ -9041,7 +8692,7 @@ function EditGlowChrome({
9041
8692
  }
9042
8693
  }
9043
8694
  ),
9044
- reorderHrefKey && !hideHandle && /* @__PURE__ */ jsx26(
8695
+ reorderHrefKey && !hideHandle && /* @__PURE__ */ jsx25(
9045
8696
  "div",
9046
8697
  {
9047
8698
  "data-ohw-drag-handle-container": "",
@@ -9053,7 +8704,7 @@ function EditGlowChrome({
9053
8704
  transform: "translate(calc(-100% - 7px), -50%)",
9054
8705
  pointerEvents: dragDisabled ? "none" : "auto"
9055
8706
  },
9056
- children: /* @__PURE__ */ jsx26(
8707
+ children: /* @__PURE__ */ jsx25(
9057
8708
  DragHandle,
9058
8709
  {
9059
8710
  "aria-label": `Reorder ${reorderHrefKey}`,
@@ -9263,7 +8914,7 @@ function FloatingToolbar({
9263
8914
  return () => ro.disconnect();
9264
8915
  }, [showEditLink, activeCommands]);
9265
8916
  const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
9266
- return /* @__PURE__ */ jsx26(
8917
+ return /* @__PURE__ */ jsx25(
9267
8918
  "div",
9268
8919
  {
9269
8920
  ref: setRefs,
@@ -9275,12 +8926,12 @@ function FloatingToolbar({
9275
8926
  zIndex: 2147483647,
9276
8927
  pointerEvents: "auto"
9277
8928
  },
9278
- children: /* @__PURE__ */ jsxs15(CustomToolbar, { children: [
9279
- TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ jsxs15(React11.Fragment, { children: [
9280
- gi > 0 && /* @__PURE__ */ jsx26(CustomToolbarDivider, {}),
8929
+ children: /* @__PURE__ */ jsxs14(CustomToolbar, { children: [
8930
+ TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ jsxs14(React11.Fragment, { children: [
8931
+ gi > 0 && /* @__PURE__ */ jsx25(CustomToolbarDivider, {}),
9281
8932
  btns.map((btn) => {
9282
8933
  const isActive = activeCommands.has(btn.cmd);
9283
- return /* @__PURE__ */ jsx26(
8934
+ return /* @__PURE__ */ jsx25(
9284
8935
  CustomToolbarButton,
9285
8936
  {
9286
8937
  title: btn.title,
@@ -9289,7 +8940,7 @@ function FloatingToolbar({
9289
8940
  e.preventDefault();
9290
8941
  onCommand(btn.cmd);
9291
8942
  },
9292
- children: /* @__PURE__ */ jsx26(
8943
+ children: /* @__PURE__ */ jsx25(
9293
8944
  "svg",
9294
8945
  {
9295
8946
  width: "16",
@@ -9310,7 +8961,7 @@ function FloatingToolbar({
9310
8961
  );
9311
8962
  })
9312
8963
  ] }, gi)),
9313
- showEditLink ? /* @__PURE__ */ jsx26(
8964
+ showEditLink ? /* @__PURE__ */ jsx25(
9314
8965
  CustomToolbarButton,
9315
8966
  {
9316
8967
  type: "button",
@@ -9324,7 +8975,7 @@ function FloatingToolbar({
9324
8975
  e.preventDefault();
9325
8976
  e.stopPropagation();
9326
8977
  },
9327
- children: /* @__PURE__ */ jsx26(Link2, { className: "size-4 shrink-0", "aria-hidden": true })
8978
+ children: /* @__PURE__ */ jsx25(Link2, { className: "size-4 shrink-0", "aria-hidden": true })
9328
8979
  }
9329
8980
  ) : null
9330
8981
  ] })
@@ -9341,7 +8992,7 @@ function StateToggle({
9341
8992
  states,
9342
8993
  onStateChange
9343
8994
  }) {
9344
- return /* @__PURE__ */ jsx26(
8995
+ return /* @__PURE__ */ jsx25(
9345
8996
  ToggleGroup,
9346
8997
  {
9347
8998
  "data-ohw-state-toggle": "",
@@ -9355,7 +9006,7 @@ function StateToggle({
9355
9006
  left: rect.right - 8,
9356
9007
  transform: "translateX(-100%)"
9357
9008
  },
9358
- children: states.map((state) => /* @__PURE__ */ jsx26(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
9009
+ children: states.map((state) => /* @__PURE__ */ jsx25(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
9359
9010
  }
9360
9011
  );
9361
9012
  }
@@ -9411,7 +9062,7 @@ function OhhwellsBridge() {
9411
9062
  const subdomainFromQuery = searchParams.get("subdomain");
9412
9063
  const subdomain = resolveSubdomain(subdomainFromQuery);
9413
9064
  useLinkHrefGuardian(pathname, subdomain, isEditMode);
9414
- const postToParent2 = useCallback5((data) => {
9065
+ const postToParent2 = useCallback4((data) => {
9415
9066
  if (typeof window !== "undefined" && window.parent !== window) {
9416
9067
  window.parent.postMessage(data, "*");
9417
9068
  }
@@ -9428,7 +9079,7 @@ function OhhwellsBridge() {
9428
9079
  const parentScrollRef = useRef7(null);
9429
9080
  const visibleViewportRef = useRef7(null);
9430
9081
  const [dialogPortalContainer, setDialogPortalContainer] = useState8(null);
9431
- const attachVisibleViewport = useCallback5((node) => {
9082
+ const attachVisibleViewport = useCallback4((node) => {
9432
9083
  visibleViewportRef.current = node;
9433
9084
  setDialogPortalContainer(node);
9434
9085
  if (node) applyVisibleViewport(node, parentScrollRef.current);
@@ -9542,7 +9193,7 @@ function OhhwellsBridge() {
9542
9193
  const bumpLinkPopoverGrace = () => {
9543
9194
  linkPopoverGraceUntilRef.current = Date.now() + 350;
9544
9195
  };
9545
- const runSectionsPrefetch = useCallback5((pages) => {
9196
+ const runSectionsPrefetch = useCallback4((pages) => {
9546
9197
  if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
9547
9198
  const gen = ++sectionsPrefetchGenRef.current;
9548
9199
  const paths = pages.map((p) => p.path);
@@ -9668,10 +9319,10 @@ function OhhwellsBridge() {
9668
9319
  vvp.removeEventListener("resize", update);
9669
9320
  };
9670
9321
  }, []);
9671
- const refreshStateRules = useCallback5(() => {
9322
+ const refreshStateRules = useCallback4(() => {
9672
9323
  editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
9673
9324
  }, []);
9674
- const processConfigRequest = useCallback5((insertAfterVal) => {
9325
+ const processConfigRequest = useCallback4((insertAfterVal) => {
9675
9326
  const tracker = getSectionsTracker();
9676
9327
  let entries = [];
9677
9328
  try {
@@ -9694,7 +9345,7 @@ function OhhwellsBridge() {
9694
9345
  }
9695
9346
  window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
9696
9347
  }, [isEditMode]);
9697
- const deactivate = useCallback5(() => {
9348
+ const deactivate = useCallback4(() => {
9698
9349
  const el = activeElRef.current;
9699
9350
  if (!el) return;
9700
9351
  const key = el.dataset.ohwKey;
@@ -9726,12 +9377,12 @@ function OhhwellsBridge() {
9726
9377
  setToolbarShowEditLink(false);
9727
9378
  postToParent2({ type: "ow:exit-edit" });
9728
9379
  }, [postToParent2]);
9729
- const clearSelectedAttr = useCallback5(() => {
9380
+ const clearSelectedAttr = useCallback4(() => {
9730
9381
  document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
9731
9382
  el.removeAttribute("data-ohw-selected");
9732
9383
  });
9733
9384
  }, []);
9734
- const deselect = useCallback5(() => {
9385
+ const deselect = useCallback4(() => {
9735
9386
  clearSelectedAttr();
9736
9387
  selectedElRef.current = null;
9737
9388
  selectedHrefKeyRef.current = null;
@@ -9751,11 +9402,11 @@ function OhhwellsBridge() {
9751
9402
  setToolbarVariant("none");
9752
9403
  }
9753
9404
  }, [clearSelectedAttr]);
9754
- const markSelected = useCallback5((el) => {
9405
+ const markSelected = useCallback4((el) => {
9755
9406
  clearSelectedAttr();
9756
9407
  el.setAttribute("data-ohw-selected", "");
9757
9408
  }, [clearSelectedAttr]);
9758
- const resolveHrefKeyElement = useCallback5((hrefKey) => {
9409
+ const resolveHrefKeyElement = useCallback4((hrefKey) => {
9759
9410
  if (isFooterHrefKey(hrefKey)) {
9760
9411
  return document.querySelector(
9761
9412
  `footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
@@ -9770,7 +9421,7 @@ function OhhwellsBridge() {
9770
9421
  `[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
9771
9422
  );
9772
9423
  }, []);
9773
- const resyncSelectedNavigationItem = useCallback5(() => {
9424
+ const resyncSelectedNavigationItem = useCallback4(() => {
9774
9425
  const hrefKey = selectedHrefKeyRef.current;
9775
9426
  if (hrefKey) {
9776
9427
  const link = resolveHrefKeyElement(hrefKey);
@@ -9798,7 +9449,7 @@ function OhhwellsBridge() {
9798
9449
  );
9799
9450
  }
9800
9451
  }, [resolveHrefKeyElement]);
9801
- const reselectNavigationItem = useCallback5((navAnchor) => {
9452
+ const reselectNavigationItem = useCallback4((navAnchor) => {
9802
9453
  selectedElRef.current = navAnchor;
9803
9454
  selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
9804
9455
  selectedFooterColAttrRef.current = null;
@@ -9813,7 +9464,7 @@ function OhhwellsBridge() {
9813
9464
  setToolbarShowEditLink(false);
9814
9465
  setActiveCommands(/* @__PURE__ */ new Set());
9815
9466
  }, [markSelected]);
9816
- const commitNavigationTextEdit = useCallback5((navAnchor) => {
9467
+ const commitNavigationTextEdit = useCallback4((navAnchor) => {
9817
9468
  const el = activeElRef.current;
9818
9469
  if (!el) return;
9819
9470
  const key = el.dataset.ohwKey;
@@ -9840,7 +9491,7 @@ function OhhwellsBridge() {
9840
9491
  postToParent2({ type: "ow:exit-edit" });
9841
9492
  reselectNavigationItem(navAnchor);
9842
9493
  }, [postToParent2, reselectNavigationItem]);
9843
- const handleAddTopLevelNavItem = useCallback5(() => {
9494
+ const handleAddTopLevelNavItem = useCallback4(() => {
9844
9495
  const items = listNavbarItems();
9845
9496
  addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
9846
9497
  deselectRef.current();
@@ -9852,19 +9503,7 @@ function OhhwellsBridge() {
9852
9503
  intent: "add-nav"
9853
9504
  });
9854
9505
  }, []);
9855
- const handleAddFooterColumn = useCallback5(() => {
9856
- deselectRef.current();
9857
- deactivateRef.current();
9858
- const result = addFooterColumnWithPersist({ postToParent: postToParent2 });
9859
- editContentRef.current = {
9860
- ...editContentRef.current,
9861
- ...buildFooterColumnEditContentPatch(result)
9862
- };
9863
- requestAnimationFrame(() => {
9864
- selectRef.current(result.firstLink);
9865
- });
9866
- }, [postToParent2]);
9867
- const clearFooterDragVisuals = useCallback5(() => {
9506
+ const clearFooterDragVisuals = useCallback4(() => {
9868
9507
  footerDragRef.current = null;
9869
9508
  setSiblingHintRects([]);
9870
9509
  setFooterDropSlots([]);
@@ -9873,7 +9512,7 @@ function OhhwellsBridge() {
9873
9512
  setIsItemDragging(false);
9874
9513
  unlockFooterDragInteraction();
9875
9514
  }, []);
9876
- const refreshFooterDragVisuals = useCallback5((session, activeSlot, clientX, clientY) => {
9515
+ const refreshFooterDragVisuals = useCallback4((session, activeSlot, clientX, clientY) => {
9877
9516
  const dragged = session.draggedEl;
9878
9517
  setDraggedItemRect(dragged.getBoundingClientRect());
9879
9518
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -9904,7 +9543,7 @@ function OhhwellsBridge() {
9904
9543
  });
9905
9544
  const beginFooterDragRef = useRef7(() => {
9906
9545
  });
9907
- const beginFooterDrag = useCallback5(
9546
+ const beginFooterDrag = useCallback4(
9908
9547
  (session) => {
9909
9548
  const rect = session.draggedEl.getBoundingClientRect();
9910
9549
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -9924,7 +9563,7 @@ function OhhwellsBridge() {
9924
9563
  [refreshFooterDragVisuals]
9925
9564
  );
9926
9565
  beginFooterDragRef.current = beginFooterDrag;
9927
- const commitFooterDrag = useCallback5(
9566
+ const commitFooterDrag = useCallback4(
9928
9567
  (clientX, clientY) => {
9929
9568
  const session = footerDragRef.current;
9930
9569
  if (!session) {
@@ -10028,7 +9667,7 @@ function OhhwellsBridge() {
10028
9667
  [clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
10029
9668
  );
10030
9669
  commitFooterDragRef.current = commitFooterDrag;
10031
- const startFooterLinkDrag = useCallback5(
9670
+ const startFooterLinkDrag = useCallback4(
10032
9671
  (anchor, clientX, clientY, wasSelected) => {
10033
9672
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
10034
9673
  if (!hrefKey || !isFooterHrefKey(hrefKey)) return false;
@@ -10049,7 +9688,7 @@ function OhhwellsBridge() {
10049
9688
  },
10050
9689
  [beginFooterDrag]
10051
9690
  );
10052
- const startFooterColumnDrag = useCallback5(
9691
+ const startFooterColumnDrag = useCallback4(
10053
9692
  (columnEl, clientX, clientY, wasSelected) => {
10054
9693
  const columns = listFooterColumns();
10055
9694
  const idx = columns.indexOf(columnEl);
@@ -10069,7 +9708,7 @@ function OhhwellsBridge() {
10069
9708
  },
10070
9709
  [beginFooterDrag]
10071
9710
  );
10072
- const handleItemDragStart = useCallback5(
9711
+ const handleItemDragStart = useCallback4(
10073
9712
  (e) => {
10074
9713
  const selected = selectedElRef.current;
10075
9714
  if (!selected) {
@@ -10089,7 +9728,7 @@ function OhhwellsBridge() {
10089
9728
  },
10090
9729
  [startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag]
10091
9730
  );
10092
- const handleItemDragEnd = useCallback5(
9731
+ const handleItemDragEnd = useCallback4(
10093
9732
  (e) => {
10094
9733
  if (footerDragRef.current) {
10095
9734
  const x = e?.clientX;
@@ -10115,7 +9754,7 @@ function OhhwellsBridge() {
10115
9754
  },
10116
9755
  [commitFooterDrag, commitNavDrag, navDragRef]
10117
9756
  );
10118
- const handleItemChromePointerDown = useCallback5((e) => {
9757
+ const handleItemChromePointerDown = useCallback4((e) => {
10119
9758
  if (e.button !== 0) return;
10120
9759
  const selected = selectedElRef.current;
10121
9760
  if (!selected) return;
@@ -10146,7 +9785,7 @@ function OhhwellsBridge() {
10146
9785
  }
10147
9786
  if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
10148
9787
  }, [armNavPressFromChrome]);
10149
- const handleItemChromeClick = useCallback5((clientX, clientY) => {
9788
+ const handleItemChromeClick = useCallback4((clientX, clientY) => {
10150
9789
  if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
10151
9790
  suppressNextClickRef.current = false;
10152
9791
  return;
@@ -10159,7 +9798,7 @@ function OhhwellsBridge() {
10159
9798
  }, []);
10160
9799
  reselectNavigationItemRef.current = reselectNavigationItem;
10161
9800
  commitNavigationTextEditRef.current = commitNavigationTextEdit;
10162
- const select = useCallback5((anchor) => {
9801
+ const select = useCallback4((anchor) => {
10163
9802
  if (!isNavigationItem(anchor)) return;
10164
9803
  if (activeElRef.current) deactivate();
10165
9804
  selectedElRef.current = anchor;
@@ -10185,10 +9824,10 @@ function OhhwellsBridge() {
10185
9824
  setToolbarShowEditLink(false);
10186
9825
  setActiveCommands(/* @__PURE__ */ new Set());
10187
9826
  }, [deactivate, markSelected]);
10188
- const selectFrame = useCallback5((el) => {
9827
+ const selectFrame = useCallback4((el) => {
10189
9828
  if (!isNavigationContainer(el)) return;
10190
9829
  if (activeElRef.current) deactivate();
10191
- const isFooterColumn = !isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || Boolean(el.closest("footer") && isInferredFooterGroup(el)));
9830
+ const isFooterColumn = el.hasAttribute("data-ohw-footer-col") || Boolean(el.closest("footer") && isInferredFooterGroup(el));
10192
9831
  selectedElRef.current = el;
10193
9832
  selectedHrefKeyRef.current = null;
10194
9833
  selectedFooterColAttrRef.current = isFooterColumn ? el.getAttribute("data-ohw-footer-col") ?? String(listFooterColumns().indexOf(el)) : null;
@@ -10213,7 +9852,7 @@ function OhhwellsBridge() {
10213
9852
  setToolbarShowEditLink(false);
10214
9853
  setActiveCommands(/* @__PURE__ */ new Set());
10215
9854
  }, [deactivate, markSelected]);
10216
- const activate = useCallback5((el, options) => {
9855
+ const activate = useCallback4((el, options) => {
10217
9856
  if (activeElRef.current === el) return;
10218
9857
  clearSelectedAttr();
10219
9858
  selectedElRef.current = null;
@@ -10746,7 +10385,7 @@ function OhhwellsBridge() {
10746
10385
  }
10747
10386
  e.preventDefault();
10748
10387
  e.stopPropagation();
10749
- activateRef.current(editable, { caretX: e.clientX, caretY: e.clientY });
10388
+ activateRef.current(editable);
10750
10389
  return;
10751
10390
  }
10752
10391
  const hrefAnchor = getNavigationItemAnchor(target);
@@ -10773,18 +10412,6 @@ function OhhwellsBridge() {
10773
10412
  selectFrameRef.current(footerColClick);
10774
10413
  return;
10775
10414
  }
10776
- const footerLinksToSelect = resolveFooterLinksContainerSelectionTarget(
10777
- target,
10778
- e.clientX,
10779
- e.clientY,
10780
- isPointOverNavItem
10781
- );
10782
- if (footerLinksToSelect) {
10783
- e.preventDefault();
10784
- e.stopPropagation();
10785
- selectFrameRef.current(footerLinksToSelect);
10786
- return;
10787
- }
10788
10415
  const navContainerToSelect = resolveNavContainerSelectionTarget(target, e.clientX, e.clientY);
10789
10416
  if (navContainerToSelect) {
10790
10417
  e.preventDefault();
@@ -10843,8 +10470,8 @@ function OhhwellsBridge() {
10843
10470
  return;
10844
10471
  }
10845
10472
  const navLabel = getNavigationLabelEditable(target);
10846
- const editable = navLabel?.editable ?? target.closest('[data-ohw-editable="text"], [data-ohw-editable="plain"]');
10847
- if (!editable || isMediaEditable(editable) || editable.dataset.ohwEditable === "link") return;
10473
+ if (!navLabel) return;
10474
+ const { editable } = navLabel;
10848
10475
  e.preventDefault();
10849
10476
  e.stopPropagation();
10850
10477
  if (activeElRef.current !== editable) {
@@ -10865,38 +10492,16 @@ function OhhwellsBridge() {
10865
10492
  setHoveredNavContainerRect(null);
10866
10493
  return;
10867
10494
  }
10868
- {
10869
- const selected2 = selectedElRef.current;
10870
- const selectedIsFooterColumn = Boolean(selected2) && !isFooterLinksContainer(selected2) && (selected2.hasAttribute("data-ohw-footer-col") || selected2.hasAttribute("data-ohw-footer-column") || Boolean(selected2.closest("footer") && isInferredFooterGroup(selected2)));
10871
- const allowNavContainerHover = toolbarVariantRef.current !== "select-frame";
10872
- const allowFooterLinksHover = toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn;
10873
- if (allowNavContainerHover) {
10874
- const navContainer = target.closest("[data-ohw-nav-container]");
10875
- if (navContainer && !getNavigationItemAnchor(target)) {
10876
- hoveredNavContainerRef.current = navContainer;
10877
- setHoveredNavContainerRect(navContainer.getBoundingClientRect());
10878
- hoveredItemElRef.current = null;
10879
- setHoveredItemRect(null);
10880
- return;
10881
- }
10495
+ if (toolbarVariantRef.current !== "select-frame") {
10496
+ const navContainer = target.closest("[data-ohw-nav-container]");
10497
+ if (navContainer && !getNavigationItemAnchor(target)) {
10498
+ hoveredNavContainerRef.current = navContainer;
10499
+ setHoveredNavContainerRect(navContainer.getBoundingClientRect());
10500
+ hoveredItemElRef.current = null;
10501
+ setHoveredItemRect(null);
10502
+ return;
10882
10503
  }
10883
- if (allowFooterLinksHover) {
10884
- const navContainer = target.closest("[data-ohw-nav-container]");
10885
- if (!navContainer) {
10886
- const footerLinks = target.closest("[data-ohw-footer-links], .rb-footer-links") ?? null;
10887
- if (footerLinks && selected2 !== footerLinks && !getNavigationItemAnchor(target) && !target.closest("[data-ohw-footer-col], [data-ohw-footer-column]")) {
10888
- hoveredNavContainerRef.current = footerLinks;
10889
- setHoveredNavContainerRect(footerLinks.getBoundingClientRect());
10890
- hoveredItemElRef.current = null;
10891
- setHoveredItemRect(null);
10892
- return;
10893
- }
10894
- if (!footerLinks) {
10895
- hoveredNavContainerRef.current = null;
10896
- setHoveredNavContainerRect(null);
10897
- }
10898
- }
10899
- } else if (toolbarVariantRef.current === "select-frame") {
10504
+ if (!target.closest("[data-ohw-nav-container]")) {
10900
10505
  hoveredNavContainerRef.current = null;
10901
10506
  setHoveredNavContainerRect(null);
10902
10507
  }
@@ -10938,9 +10543,9 @@ function OhhwellsBridge() {
10938
10543
  };
10939
10544
  const handleMouseOut = (e) => {
10940
10545
  const target = e.target;
10941
- if (target.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column], [data-ohw-footer-links], .rb-footer-links")) {
10546
+ if (target.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column]")) {
10942
10547
  const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
10943
- if (related2?.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column], [data-ohw-footer-links], .rb-footer-links, [data-ohw-navbar-container-chrome], [data-ohw-navbar-add-button], [data-ohw-footer-container-chrome], [data-ohw-footer-add-button]")) {
10548
+ 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]")) {
10944
10549
  return;
10945
10550
  }
10946
10551
  hoveredNavContainerRef.current = null;
@@ -11035,15 +10640,6 @@ function OhhwellsBridge() {
11035
10640
  if (track) track.setAttribute("data-ohw-hover-paused", "");
11036
10641
  };
11037
10642
  const clearImageHover = () => setMediaHover(null);
11038
- const dismissImageHover = () => {
11039
- if (hoveredImageRef.current) {
11040
- hoveredImageRef.current = null;
11041
- hoveredImageHasTextOverlapRef.current = false;
11042
- resumeAnimTracks();
11043
- postToParentRef.current({ type: "ow:image-unhover" });
11044
- }
11045
- clearImageHover();
11046
- };
11047
10643
  const findImageAtPoint = (clientX, clientY, fromParentViewport) => {
11048
10644
  const { x, y } = toProbeCoords(clientX, clientY, fromParentViewport);
11049
10645
  const images = Array.from(document.querySelectorAll(MEDIA_SELECTOR));
@@ -11087,13 +10683,16 @@ function OhhwellsBridge() {
11087
10683
  }
11088
10684
  return smallest;
11089
10685
  };
10686
+ const dismissImageHover = () => {
10687
+ if (hoveredImageRef.current) {
10688
+ hoveredImageRef.current = null;
10689
+ hoveredImageHasTextOverlapRef.current = false;
10690
+ resumeAnimTracks();
10691
+ postToParentRef.current({ type: "ow:image-unhover" });
10692
+ }
10693
+ };
11090
10694
  const probeNavigationHoverAt = (x, y) => {
11091
- const selected = selectedElRef.current;
11092
- const selectedIsFooterColumn = Boolean(selected) && !isFooterLinksContainer(selected) && (selected.hasAttribute("data-ohw-footer-col") || selected.hasAttribute("data-ohw-footer-column") || Boolean(selected.closest("footer") && isInferredFooterGroup(selected)));
11093
- const selectedIsFooterLinks = Boolean(selected && isFooterLinksContainer(selected));
11094
- const allowNavContainerHover = toolbarVariantRef.current !== "select-frame";
11095
- const allowFooterLinksHover = (toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn) && !selectedIsFooterLinks;
11096
- if (toolbarVariantRef.current === "select-frame" && !allowFooterLinksHover) {
10695
+ if (toolbarVariantRef.current === "select-frame") {
11097
10696
  hoveredNavContainerRef.current = null;
11098
10697
  setHoveredNavContainerRect(null);
11099
10698
  }
@@ -11115,6 +10714,7 @@ function OhhwellsBridge() {
11115
10714
  if (navItemHit) {
11116
10715
  hoveredNavContainerRef.current = null;
11117
10716
  setHoveredNavContainerRect(null);
10717
+ const selected = selectedElRef.current;
11118
10718
  if (selected !== navItemHit) {
11119
10719
  clearHrefKeyHover(navItemHit);
11120
10720
  hoveredItemElRef.current = navItemHit;
@@ -11126,7 +10726,7 @@ function OhhwellsBridge() {
11126
10726
  return;
11127
10727
  }
11128
10728
  }
11129
- if (allowNavContainerHover) {
10729
+ if (toolbarVariantRef.current !== "select-frame") {
11130
10730
  for (const container of navContainers) {
11131
10731
  const containerRect = container.getBoundingClientRect();
11132
10732
  const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
@@ -11138,23 +10738,12 @@ function OhhwellsBridge() {
11138
10738
  setHoveredItemRect(null);
11139
10739
  return;
11140
10740
  }
10741
+ hoveredNavContainerRef.current = null;
10742
+ setHoveredNavContainerRect(null);
10743
+ } else {
10744
+ hoveredNavContainerRef.current = null;
10745
+ setHoveredNavContainerRect(null);
11141
10746
  }
11142
- if (allowFooterLinksHover) {
11143
- const footerLinks = getFooterLinksContainer();
11144
- if (footerLinks) {
11145
- const containerRect = footerLinks.getBoundingClientRect();
11146
- const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
11147
- if (overContainer && !isPointOverNavItem(footerLinks, x, y) && !isPointOverFooterColumn(x, y)) {
11148
- hoveredNavContainerRef.current = footerLinks;
11149
- setHoveredNavContainerRect(footerLinks.getBoundingClientRect());
11150
- hoveredItemElRef.current = null;
11151
- setHoveredItemRect(null);
11152
- return;
11153
- }
11154
- }
11155
- }
11156
- hoveredNavContainerRef.current = null;
11157
- setHoveredNavContainerRect(null);
11158
10747
  for (const column of footerColumns) {
11159
10748
  const containerRect = column.getBoundingClientRect();
11160
10749
  const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
@@ -11663,7 +11252,6 @@ function OhhwellsBridge() {
11663
11252
  }
11664
11253
  editContentRef.current = { ...editContentRef.current, ...content };
11665
11254
  reconcileNavbarItemsFromContent(editContentRef.current);
11666
- reconcileFooterOrderFromContent(editContentRef.current);
11667
11255
  syncNavigationDragCursorAttrs();
11668
11256
  enforceLinkHrefs();
11669
11257
  postToParentRef.current({ type: "ow:hydrate-done" });
@@ -11718,11 +11306,6 @@ function OhhwellsBridge() {
11718
11306
  }
11719
11307
  if (selectedElRef.current) {
11720
11308
  if (toolbarVariantRef.current === "select-frame") {
11721
- const parent2 = getNavigationSelectionParent(selectedElRef.current);
11722
- if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
11723
- selectFrameRef.current(parent2);
11724
- return;
11725
- }
11726
11309
  deselectRef.current();
11727
11310
  return;
11728
11311
  }
@@ -11738,10 +11321,13 @@ function OhhwellsBridge() {
11738
11321
  const handleKeyDown = (e) => {
11739
11322
  if (e.key === "Escape" && document.querySelector("[data-ohw-section-picker]")) return;
11740
11323
  if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a" && activeElRef.current) {
11741
- e.preventDefault();
11742
- selectAllTextInEditable(activeElRef.current);
11743
- refreshActiveCommandsRef.current();
11744
- return;
11324
+ const navAnchor = getNavigationItemAnchor(activeElRef.current);
11325
+ if (navAnchor) {
11326
+ e.preventDefault();
11327
+ selectAllTextInEditable(activeElRef.current);
11328
+ refreshActiveCommandsRef.current();
11329
+ return;
11330
+ }
11745
11331
  }
11746
11332
  if (e.key === "Escape" && linkPopoverOpenRef.current) {
11747
11333
  setLinkPopoverRef.current(null);
@@ -11749,12 +11335,6 @@ function OhhwellsBridge() {
11749
11335
  }
11750
11336
  if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
11751
11337
  if (toolbarVariantRef.current === "select-frame") {
11752
- const parent2 = getNavigationSelectionParent(selectedElRef.current);
11753
- if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
11754
- e.preventDefault();
11755
- selectFrameRef.current(parent2);
11756
- return;
11757
- }
11758
11338
  deselectRef.current();
11759
11339
  return;
11760
11340
  }
@@ -12415,7 +11995,7 @@ function OhhwellsBridge() {
12415
11995
  window.addEventListener("hashchange", onHashChange);
12416
11996
  return () => window.removeEventListener("hashchange", onHashChange);
12417
11997
  }, [pathname]);
12418
- const handleCommand = useCallback5((cmd) => {
11998
+ const handleCommand = useCallback4((cmd) => {
12419
11999
  const el = activeElRef.current;
12420
12000
  const selBefore = window.getSelection();
12421
12001
  let savedOffsets = null;
@@ -12451,7 +12031,7 @@ function OhhwellsBridge() {
12451
12031
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
12452
12032
  refreshActiveCommandsRef.current();
12453
12033
  }, []);
12454
- const handleStateChange = useCallback5((state) => {
12034
+ const handleStateChange = useCallback4((state) => {
12455
12035
  if (!activeStateElRef.current) return;
12456
12036
  const el = activeStateElRef.current;
12457
12037
  if (state === "Default") {
@@ -12464,11 +12044,11 @@ function OhhwellsBridge() {
12464
12044
  }
12465
12045
  setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
12466
12046
  }, [deactivate]);
12467
- const closeLinkPopover = useCallback5(() => {
12047
+ const closeLinkPopover = useCallback4(() => {
12468
12048
  addNavAfterAnchorRef.current = null;
12469
12049
  setLinkPopover(null);
12470
12050
  }, []);
12471
- const openLinkPopoverForActive = useCallback5(() => {
12051
+ const openLinkPopoverForActive = useCallback4(() => {
12472
12052
  const hrefCtx = getHrefKeyFromElement(activeElRef.current);
12473
12053
  if (!hrefCtx) return;
12474
12054
  bumpLinkPopoverGrace();
@@ -12479,7 +12059,7 @@ function OhhwellsBridge() {
12479
12059
  });
12480
12060
  deactivate();
12481
12061
  }, [deactivate]);
12482
- const openLinkPopoverForSelected = useCallback5(() => {
12062
+ const openLinkPopoverForSelected = useCallback4(() => {
12483
12063
  const anchor = selectedElRef.current;
12484
12064
  if (!anchor) return;
12485
12065
  const key = anchor.getAttribute("data-ohw-href-key");
@@ -12492,7 +12072,7 @@ function OhhwellsBridge() {
12492
12072
  });
12493
12073
  deselect();
12494
12074
  }, [deselect]);
12495
- const handleLinkPopoverSubmit = useCallback5(
12075
+ const handleLinkPopoverSubmit = useCallback4(
12496
12076
  (target) => {
12497
12077
  const session = linkPopoverSessionRef.current;
12498
12078
  if (!session) return;
@@ -12551,19 +12131,19 @@ function OhhwellsBridge() {
12551
12131
  const showEditLink = toolbarShowEditLink;
12552
12132
  const currentSections = sectionsByPath[pathname] ?? [];
12553
12133
  linkPopoverOpenRef.current = linkPopover !== null;
12554
- const handleMediaReplace = useCallback5(
12134
+ const handleMediaReplace = useCallback4(
12555
12135
  (key) => {
12556
12136
  postToParent2({ type: "ow:image-pick", key, elementType: mediaHover?.elementType ?? "image" });
12557
12137
  },
12558
12138
  [postToParent2, mediaHover?.elementType]
12559
12139
  );
12560
- const handleEditCarousel = useCallback5(
12140
+ const handleEditCarousel = useCallback4(
12561
12141
  (key) => {
12562
12142
  postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
12563
12143
  },
12564
12144
  [postToParent2]
12565
12145
  );
12566
- const handleMediaFadeOutComplete = useCallback5((key) => {
12146
+ const handleMediaFadeOutComplete = useCallback4((key) => {
12567
12147
  setUploadingRects((prev) => {
12568
12148
  if (!(key in prev)) return prev;
12569
12149
  const next = { ...prev };
@@ -12571,7 +12151,7 @@ function OhhwellsBridge() {
12571
12151
  return next;
12572
12152
  });
12573
12153
  }, []);
12574
- const handleVideoSettingsChange = useCallback5(
12154
+ const handleVideoSettingsChange = useCallback4(
12575
12155
  (key, settings) => {
12576
12156
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
12577
12157
  const video = getVideoEl(el);
@@ -12594,9 +12174,9 @@ function OhhwellsBridge() {
12594
12174
  [postToParent2]
12595
12175
  );
12596
12176
  return bridgeRoot ? createPortal2(
12597
- /* @__PURE__ */ jsxs15(Fragment5, { children: [
12598
- /* @__PURE__ */ jsx26("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
12599
- Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ jsx26(
12177
+ /* @__PURE__ */ jsxs14(Fragment5, { children: [
12178
+ /* @__PURE__ */ jsx25("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
12179
+ Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ jsx25(
12600
12180
  MediaOverlay,
12601
12181
  {
12602
12182
  hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
@@ -12607,7 +12187,7 @@ function OhhwellsBridge() {
12607
12187
  },
12608
12188
  `uploading-${key}`
12609
12189
  )),
12610
- mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ jsx26(
12190
+ mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ jsx25(
12611
12191
  MediaOverlay,
12612
12192
  {
12613
12193
  hover: mediaHover,
@@ -12616,11 +12196,11 @@ function OhhwellsBridge() {
12616
12196
  onVideoSettingsChange: handleVideoSettingsChange
12617
12197
  }
12618
12198
  ),
12619
- carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx26(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
12620
- siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ jsx26(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
12621
- siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ jsx26(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
12622
- isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ jsx26(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
12623
- isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ jsx26(
12199
+ carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx25(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
12200
+ siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ jsx25(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
12201
+ siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ jsx25(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
12202
+ isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ jsx25(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
12203
+ isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ jsx25(
12624
12204
  "div",
12625
12205
  {
12626
12206
  className: "pointer-events-none fixed z-2147483646",
@@ -12630,7 +12210,7 @@ function OhhwellsBridge() {
12630
12210
  width: slot.width,
12631
12211
  height: slot.height
12632
12212
  },
12633
- children: /* @__PURE__ */ jsx26(
12213
+ children: /* @__PURE__ */ jsx25(
12634
12214
  DropIndicator,
12635
12215
  {
12636
12216
  direction: slot.direction,
@@ -12641,7 +12221,7 @@ function OhhwellsBridge() {
12641
12221
  },
12642
12222
  `footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
12643
12223
  )),
12644
- isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ jsx26(
12224
+ isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ jsx25(
12645
12225
  "div",
12646
12226
  {
12647
12227
  className: "pointer-events-none fixed z-2147483646",
@@ -12651,7 +12231,7 @@ function OhhwellsBridge() {
12651
12231
  width: slot.width,
12652
12232
  height: slot.height
12653
12233
  },
12654
- children: /* @__PURE__ */ jsx26(
12234
+ children: /* @__PURE__ */ jsx25(
12655
12235
  DropIndicator,
12656
12236
  {
12657
12237
  direction: slot.direction,
@@ -12662,11 +12242,10 @@ function OhhwellsBridge() {
12662
12242
  },
12663
12243
  `nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
12664
12244
  )),
12665
- hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx26(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
12666
- hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ jsx26(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
12667
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx26(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
12668
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx26(FooterContainerChrome, { rect: toolbarRect, onAdd: handleAddFooterColumn }),
12669
- toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx26(
12245
+ hoveredNavContainerRect && toolbarVariant !== "select-frame" && !linkPopover && !isItemDragging && /* @__PURE__ */ jsx25(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
12246
+ hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ jsx25(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
12247
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ jsx25(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
12248
+ toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ jsx25(
12670
12249
  ItemInteractionLayer,
12671
12250
  {
12672
12251
  rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
@@ -12680,7 +12259,7 @@ function OhhwellsBridge() {
12680
12259
  onItemPointerDown: handleItemChromePointerDown,
12681
12260
  onItemClick: handleItemChromeClick,
12682
12261
  itemDragSurface: !isFooterFrameSelection,
12683
- toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */ jsx26(
12262
+ toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */ jsx25(
12684
12263
  ItemActionToolbar,
12685
12264
  {
12686
12265
  onEditLink: openLinkPopoverForSelected,
@@ -12693,8 +12272,8 @@ function OhhwellsBridge() {
12693
12272
  ) : void 0
12694
12273
  }
12695
12274
  ),
12696
- toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ jsxs15(Fragment5, { children: [
12697
- /* @__PURE__ */ jsx26(
12275
+ toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ jsxs14(Fragment5, { children: [
12276
+ /* @__PURE__ */ jsx25(
12698
12277
  EditGlowChrome,
12699
12278
  {
12700
12279
  rect: toolbarRect,
@@ -12704,7 +12283,7 @@ function OhhwellsBridge() {
12704
12283
  hideHandle: isItemDragging
12705
12284
  }
12706
12285
  ),
12707
- /* @__PURE__ */ jsx26(
12286
+ /* @__PURE__ */ jsx25(
12708
12287
  FloatingToolbar,
12709
12288
  {
12710
12289
  rect: toolbarRect,
@@ -12717,7 +12296,7 @@ function OhhwellsBridge() {
12717
12296
  }
12718
12297
  )
12719
12298
  ] }),
12720
- maxBadge && /* @__PURE__ */ jsxs15(
12299
+ maxBadge && /* @__PURE__ */ jsxs14(
12721
12300
  "div",
12722
12301
  {
12723
12302
  "data-ohw-max-badge": "",
@@ -12743,7 +12322,7 @@ function OhhwellsBridge() {
12743
12322
  ]
12744
12323
  }
12745
12324
  ),
12746
- toggleState && !linkPopover && /* @__PURE__ */ jsx26(
12325
+ toggleState && !linkPopover && /* @__PURE__ */ jsx25(
12747
12326
  StateToggle,
12748
12327
  {
12749
12328
  rect: toggleState.rect,
@@ -12752,15 +12331,15 @@ function OhhwellsBridge() {
12752
12331
  onStateChange: handleStateChange
12753
12332
  }
12754
12333
  ),
12755
- sectionGap && !linkPopover && /* @__PURE__ */ jsxs15(
12334
+ sectionGap && !linkPopover && /* @__PURE__ */ jsxs14(
12756
12335
  "div",
12757
12336
  {
12758
12337
  "data-ohw-section-insert-line": "",
12759
12338
  className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
12760
12339
  style: { top: sectionGap.y, transform: "translateY(-50%)" },
12761
12340
  children: [
12762
- /* @__PURE__ */ jsx26("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
12763
- /* @__PURE__ */ jsx26(
12341
+ /* @__PURE__ */ jsx25("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
12342
+ /* @__PURE__ */ jsx25(
12764
12343
  Badge,
12765
12344
  {
12766
12345
  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",
@@ -12777,11 +12356,11 @@ function OhhwellsBridge() {
12777
12356
  children: "Add Section"
12778
12357
  }
12779
12358
  ),
12780
- /* @__PURE__ */ jsx26("div", { className: "flex-1 bg-primary", style: { height: 3 } })
12359
+ /* @__PURE__ */ jsx25("div", { className: "flex-1 bg-primary", style: { height: 3 } })
12781
12360
  ]
12782
12361
  }
12783
12362
  ),
12784
- linkPopover && dialogPortalContainer ? /* @__PURE__ */ jsx26(
12363
+ linkPopover && dialogPortalContainer ? /* @__PURE__ */ jsx25(
12785
12364
  LinkPopover,
12786
12365
  {
12787
12366
  panelRef: linkPopoverPanelRef,