@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/README.md +0 -12
- package/dist/index.cjs +116 -537
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +167 -588
- package/dist/index.js.map +1 -1
- package/dist/styles.css +18 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,7 +116,6 @@ var import_react3 = require("react");
|
|
|
116
116
|
var import_react2 = require("react");
|
|
117
117
|
var import_radix_ui = require("radix-ui");
|
|
118
118
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
119
|
-
var isValidEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
120
119
|
function Spinner() {
|
|
121
120
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
122
121
|
"svg",
|
|
@@ -150,17 +149,12 @@ function EmailCaptureModal({ title, subtitle, onSubmit, onClose }) {
|
|
|
150
149
|
const [error, setError] = (0, import_react2.useState)(null);
|
|
151
150
|
const isBook = title === "Confirm your spot";
|
|
152
151
|
const handleSubmit = async () => {
|
|
153
|
-
|
|
154
|
-
if (!trimmed) return;
|
|
155
|
-
if (!isValidEmail(trimmed)) {
|
|
156
|
-
setError("Please enter a valid email address.");
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
152
|
+
if (!email.trim()) return;
|
|
159
153
|
setLoading(true);
|
|
160
154
|
setError(null);
|
|
161
155
|
try {
|
|
162
|
-
await onSubmit(
|
|
163
|
-
setSubmittedEmail(
|
|
156
|
+
await onSubmit(email.trim());
|
|
157
|
+
setSubmittedEmail(email.trim());
|
|
164
158
|
setSuccess(true);
|
|
165
159
|
} catch (e) {
|
|
166
160
|
setError(e instanceof Error ? e.message : "Something went wrong. Please try again.");
|
|
@@ -235,10 +229,7 @@ function EmailCaptureModal({ title, subtitle, onSubmit, onClose }) {
|
|
|
235
229
|
{
|
|
236
230
|
type: "email",
|
|
237
231
|
value: email,
|
|
238
|
-
onChange: (e) =>
|
|
239
|
-
setEmail(e.target.value);
|
|
240
|
-
if (error) setError(null);
|
|
241
|
-
},
|
|
232
|
+
onChange: (e) => setEmail(e.target.value),
|
|
242
233
|
onKeyDown: handleKeyDown,
|
|
243
234
|
placeholder: "hello@gmail.com",
|
|
244
235
|
autoFocus: true,
|
|
@@ -295,20 +286,12 @@ function formatClassTime(cls) {
|
|
|
295
286
|
const em = endTotal % 60;
|
|
296
287
|
return `${h}:${cls.startTime.minutes}-${eh}:${String(em).padStart(2, "0")}`;
|
|
297
288
|
}
|
|
298
|
-
function formatBookingLabel(cls) {
|
|
299
|
-
const price = cls.price;
|
|
300
|
-
const isFree = price === null || price === void 0 || `${price}` === "" || `${price}` === "0";
|
|
301
|
-
return isFree ? "Book for free" : `Book for ${cls.currency ?? ""} ${price}`.trim();
|
|
302
|
-
}
|
|
303
289
|
function getBookingsOnDate(cls, date) {
|
|
304
290
|
if (!cls.bookings?.length) return 0;
|
|
305
|
-
const
|
|
306
|
-
target.setHours(0, 0, 0, 0);
|
|
291
|
+
const ds = date.toISOString().split("T")[0];
|
|
307
292
|
return cls.bookings.filter((b) => {
|
|
308
293
|
try {
|
|
309
|
-
|
|
310
|
-
bookingDate.setHours(0, 0, 0, 0);
|
|
311
|
-
return bookingDate.getTime() === target.getTime();
|
|
294
|
+
return new Date(b.classDate).toISOString().split("T")[0] === ds;
|
|
312
295
|
} catch {
|
|
313
296
|
return false;
|
|
314
297
|
}
|
|
@@ -573,7 +556,7 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
|
|
|
573
556
|
}
|
|
574
557
|
)
|
|
575
558
|
] }),
|
|
576
|
-
|
|
559
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "sm:hidden flex flex-col gap-px", children: isFull ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: "Full" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
577
560
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: [
|
|
578
561
|
available,
|
|
579
562
|
"/",
|
|
@@ -585,17 +568,9 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
|
|
|
585
568
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-1 flex-col gap-2 min-w-0 sm:contents", children: [
|
|
586
569
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
587
570
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-body text-base font-bold text-(--color-dark,#200C02) block truncate", children: cls.name }),
|
|
588
|
-
cls.hostName && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-body text-base font-normal text-(--color-dark,#200C02) opacity-80 block truncate", children: cls.hostName })
|
|
589
|
-
cls.description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
590
|
-
"span",
|
|
591
|
-
{
|
|
592
|
-
className: "font-body text-base font-normal text-(--color-dark,#200C02) opacity-80 block",
|
|
593
|
-
style: { wordBreak: "break-word" },
|
|
594
|
-
children: cls.description
|
|
595
|
-
}
|
|
596
|
-
)
|
|
571
|
+
cls.hostName && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-body text-base font-normal text-(--color-dark,#200C02) opacity-80 block truncate", children: cls.hostName })
|
|
597
572
|
] }),
|
|
598
|
-
|
|
573
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "hidden sm:flex w-14 shrink-0 flex-col gap-px", children: isFull ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: "Full" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
599
574
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "font-body text-sm text-(--color-dark,#200C02) opacity-80", children: [
|
|
600
575
|
available,
|
|
601
576
|
"/",
|
|
@@ -620,7 +595,7 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
|
|
|
620
595
|
if (!cls.id) return;
|
|
621
596
|
onOpenModal?.(isFull ? "waitlist" : "book", cls.id, selectedDate);
|
|
622
597
|
},
|
|
623
|
-
children: isFull ? "Join Waitlist" :
|
|
598
|
+
children: isFull ? "Join Waitlist" : "Book Now"
|
|
624
599
|
}
|
|
625
600
|
)
|
|
626
601
|
] })
|
|
@@ -662,17 +637,6 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
662
637
|
const [isHovered, setIsHovered] = (0, import_react3.useState)(false);
|
|
663
638
|
const [modalState, setModalState] = (0, import_react3.useState)(null);
|
|
664
639
|
const switchScheduleIdRef = (0, import_react3.useRef)(null);
|
|
665
|
-
const liveScheduleIdRef = (0, import_react3.useRef)(null);
|
|
666
|
-
const refetchLiveSchedule = (0, import_react3.useCallback)(async () => {
|
|
667
|
-
const id = liveScheduleIdRef.current;
|
|
668
|
-
if (!id) return;
|
|
669
|
-
try {
|
|
670
|
-
const res = await fetch(`${API_URL}/api/schedule/id/${id}`);
|
|
671
|
-
const data = await res.json();
|
|
672
|
-
if (data?.id) setSchedule(data);
|
|
673
|
-
} catch {
|
|
674
|
-
}
|
|
675
|
-
}, []);
|
|
676
640
|
const dates = (0, import_react3.useMemo)(() => {
|
|
677
641
|
const today = /* @__PURE__ */ new Date();
|
|
678
642
|
today.setHours(0, 0, 0, 0);
|
|
@@ -692,18 +656,6 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
692
656
|
}
|
|
693
657
|
}
|
|
694
658
|
}, [schedule, dates]);
|
|
695
|
-
(0, import_react3.useEffect)(() => {
|
|
696
|
-
if (typeof window === "undefined") return;
|
|
697
|
-
const onVisible = () => {
|
|
698
|
-
if (!document.hidden) void refetchLiveSchedule();
|
|
699
|
-
};
|
|
700
|
-
window.addEventListener("focus", refetchLiveSchedule);
|
|
701
|
-
document.addEventListener("visibilitychange", onVisible);
|
|
702
|
-
return () => {
|
|
703
|
-
window.removeEventListener("focus", refetchLiveSchedule);
|
|
704
|
-
document.removeEventListener("visibilitychange", onVisible);
|
|
705
|
-
};
|
|
706
|
-
}, [refetchLiveSchedule]);
|
|
707
659
|
(0, import_react3.useEffect)(() => {
|
|
708
660
|
if (typeof window === "undefined") return;
|
|
709
661
|
const isInEditor = window.self !== window.top;
|
|
@@ -765,7 +717,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
765
717
|
setLoading(false);
|
|
766
718
|
return;
|
|
767
719
|
}
|
|
768
|
-
|
|
720
|
+
;
|
|
769
721
|
(async () => {
|
|
770
722
|
try {
|
|
771
723
|
const res = await fetch(`${API_URL}/api/schedule/id/${effectiveId}`);
|
|
@@ -822,14 +774,18 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
822
774
|
const data = await res.json().catch(() => ({}));
|
|
823
775
|
throw new Error(data?.message ?? "Something went wrong. Please try again.");
|
|
824
776
|
}
|
|
825
|
-
await refetchLiveSchedule();
|
|
826
777
|
};
|
|
827
778
|
const handleReplaceSchedule = () => {
|
|
828
779
|
setIsHovered(false);
|
|
829
|
-
|
|
830
|
-
{
|
|
831
|
-
|
|
832
|
-
|
|
780
|
+
if (schedule) {
|
|
781
|
+
window.parent.postMessage({
|
|
782
|
+
type: "ow:schedule-connected",
|
|
783
|
+
schedule: { id: schedule.id, name: schedule.name },
|
|
784
|
+
insertAfter
|
|
785
|
+
}, "*");
|
|
786
|
+
} else {
|
|
787
|
+
window.parent.postMessage({ type: "ow:scheduling-not-connected", insertAfter }, "*");
|
|
788
|
+
}
|
|
833
789
|
};
|
|
834
790
|
if (!inEditor && !loading && !schedule) return null;
|
|
835
791
|
const sectionId = `scheduling-${insertAfter}`;
|
|
@@ -872,19 +828,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
872
828
|
),
|
|
873
829
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "max-w-[1280px] mx-auto flex flex-col items-center gap-16", children: [
|
|
874
830
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
875
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
876
|
-
"h2",
|
|
877
|
-
{
|
|
878
|
-
className: "font-display text-center m-0 text-(--color-dark,#200C02)",
|
|
879
|
-
style: {
|
|
880
|
-
fontSize: "var(--fs-section-h2, clamp(40px, 4.4vw, 64px))",
|
|
881
|
-
fontWeight: "var(--font-weight-heading, 400)",
|
|
882
|
-
lineHeight: 1.05,
|
|
883
|
-
letterSpacing: "-0.02em"
|
|
884
|
-
},
|
|
885
|
-
children: schedule?.name ?? "Book an appointment"
|
|
886
|
-
}
|
|
887
|
-
),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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" }),
|
|
888
832
|
schedule?.description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "font-body text-body text-center m-0 text-(--color-accent,#A89B83)", children: schedule.description })
|
|
889
833
|
] }),
|
|
890
834
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "w-full flex flex-col items-end gap-3", children: [
|
|
@@ -4944,11 +4888,7 @@ function MediaOverlay({
|
|
|
4944
4888
|
variant: "outline",
|
|
4945
4889
|
size: "sm",
|
|
4946
4890
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
4947
|
-
style:
|
|
4948
|
-
...OVERLAY_BUTTON_STYLE,
|
|
4949
|
-
// Don't let Replace steal clicks when text (e.g. nav) sits on top of this media.
|
|
4950
|
-
pointerEvents: hover.hasTextOverlap ? "none" : "auto"
|
|
4951
|
-
},
|
|
4891
|
+
style: OVERLAY_BUTTON_STYLE,
|
|
4952
4892
|
onMouseDown: (e) => e.preventDefault(),
|
|
4953
4893
|
onClick: (e) => {
|
|
4954
4894
|
e.stopPropagation();
|
|
@@ -7127,195 +7067,7 @@ function parseFooterOrder(content) {
|
|
|
7127
7067
|
return null;
|
|
7128
7068
|
}
|
|
7129
7069
|
}
|
|
7130
|
-
var FOOTER_HEADING_RE = /^footer-(\d+)-heading$/;
|
|
7131
|
-
var FOOTER_LABEL_RE = /^footer-(\d+)-(\d+)-label$/;
|
|
7132
|
-
var DEFAULT_FOOTER_COLUMN_HEADING = "New";
|
|
7133
|
-
var DEFAULT_FOOTER_COLUMN_LINK_LABEL = "New link";
|
|
7134
|
-
var DEFAULT_FOOTER_COLUMN_LINK_HREF = "";
|
|
7135
|
-
function isFooterLinksContainer(el) {
|
|
7136
|
-
return el.hasAttribute("data-ohw-footer-links") || el.classList.contains("rb-footer-links");
|
|
7137
|
-
}
|
|
7138
|
-
function getFooterColumnIndicesInDom() {
|
|
7139
|
-
const indices = /* @__PURE__ */ new Set();
|
|
7140
|
-
for (const col of listFooterColumns()) {
|
|
7141
|
-
const attr = col.getAttribute("data-ohw-footer-col");
|
|
7142
|
-
if (attr != null) {
|
|
7143
|
-
const n = parseInt(attr, 10);
|
|
7144
|
-
if (Number.isFinite(n)) indices.add(n);
|
|
7145
|
-
}
|
|
7146
|
-
for (const link of listFooterLinksInColumn(col)) {
|
|
7147
|
-
const parsed = parseFooterHrefKey(link.getAttribute("data-ohw-href-key"));
|
|
7148
|
-
if (parsed) indices.add(parsed.col);
|
|
7149
|
-
}
|
|
7150
|
-
const heading = col.querySelector('[data-ohw-key^="footer-"][data-ohw-key$="-heading"]');
|
|
7151
|
-
const headingKey = heading?.getAttribute("data-ohw-key");
|
|
7152
|
-
if (headingKey) {
|
|
7153
|
-
const match = headingKey.match(FOOTER_HEADING_RE);
|
|
7154
|
-
if (match) indices.add(parseInt(match[1], 10));
|
|
7155
|
-
}
|
|
7156
|
-
}
|
|
7157
|
-
return [...indices].sort((a, b) => a - b);
|
|
7158
|
-
}
|
|
7159
|
-
function getNextFooterColumnIndex() {
|
|
7160
|
-
const indices = getFooterColumnIndicesInDom();
|
|
7161
|
-
if (indices.length === 0) return 0;
|
|
7162
|
-
return Math.max(...indices) + 1;
|
|
7163
|
-
}
|
|
7164
|
-
function cloneFooterLinkShell(template) {
|
|
7165
|
-
const anchor = document.createElement("a");
|
|
7166
|
-
if (template) {
|
|
7167
|
-
anchor.style.cssText = template.style.cssText;
|
|
7168
|
-
if (template.className) anchor.className = template.className;
|
|
7169
|
-
}
|
|
7170
|
-
anchor.style.cursor = "pointer";
|
|
7171
|
-
anchor.style.textDecoration = "none";
|
|
7172
|
-
return anchor;
|
|
7173
|
-
}
|
|
7174
|
-
function buildFooterHeading(colIndex, text) {
|
|
7175
|
-
const heading = document.createElement("p");
|
|
7176
|
-
heading.setAttribute("data-ohw-editable", "text");
|
|
7177
|
-
heading.setAttribute("data-ohw-key", `footer-${colIndex}-heading`);
|
|
7178
|
-
heading.textContent = text;
|
|
7179
|
-
heading.style.cssText = [
|
|
7180
|
-
"color: var(--espresso, #3d312b)",
|
|
7181
|
-
"font-size: 14px",
|
|
7182
|
-
"font-weight: 800",
|
|
7183
|
-
"opacity: 0.82",
|
|
7184
|
-
"margin: 0 0 6px",
|
|
7185
|
-
"padding: 0",
|
|
7186
|
-
"line-height: 1.2"
|
|
7187
|
-
].join(";");
|
|
7188
|
-
return heading;
|
|
7189
|
-
}
|
|
7190
|
-
function buildFooterLink(colIndex, itemIndex, href, label, template) {
|
|
7191
|
-
const anchor = cloneFooterLinkShell(template);
|
|
7192
|
-
anchor.setAttribute("href", href);
|
|
7193
|
-
anchor.setAttribute("data-ohw-href-key", `footer-${colIndex}-${itemIndex}-href`);
|
|
7194
|
-
const span = document.createElement("span");
|
|
7195
|
-
span.setAttribute("data-ohw-editable", "text");
|
|
7196
|
-
span.setAttribute("data-ohw-key", `footer-${colIndex}-${itemIndex}-label`);
|
|
7197
|
-
span.textContent = label;
|
|
7198
|
-
anchor.appendChild(span);
|
|
7199
|
-
return anchor;
|
|
7200
|
-
}
|
|
7201
|
-
function footerColumnExistsInDom(colIndex) {
|
|
7202
|
-
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;
|
|
7203
|
-
}
|
|
7204
|
-
function getFooterLinkTemplate() {
|
|
7205
|
-
for (const col of listFooterColumns()) {
|
|
7206
|
-
const link = listFooterLinksInColumn(col)[0];
|
|
7207
|
-
if (link) return link;
|
|
7208
|
-
}
|
|
7209
|
-
return null;
|
|
7210
|
-
}
|
|
7211
|
-
function getFooterColumnTemplate() {
|
|
7212
|
-
return listFooterColumns()[0] ?? null;
|
|
7213
|
-
}
|
|
7214
|
-
function insertFooterColumnDom(colIndex, heading, items) {
|
|
7215
|
-
const container = getFooterLinksContainer();
|
|
7216
|
-
if (!container) return null;
|
|
7217
|
-
const colTemplate = getFooterColumnTemplate();
|
|
7218
|
-
const linkTemplate = getFooterLinkTemplate();
|
|
7219
|
-
const column = document.createElement("div");
|
|
7220
|
-
if (colTemplate?.className) column.className = colTemplate.className;
|
|
7221
|
-
else column.className = "rb-footer-link-col";
|
|
7222
|
-
column.setAttribute("data-ohw-footer-col", String(colIndex));
|
|
7223
|
-
if (colTemplate) {
|
|
7224
|
-
const gap = getComputedStyle(colTemplate).gap;
|
|
7225
|
-
if (gap && gap !== "normal") column.style.gap = gap;
|
|
7226
|
-
column.style.display = getComputedStyle(colTemplate).display || "flex";
|
|
7227
|
-
column.style.flexDirection = "column";
|
|
7228
|
-
}
|
|
7229
|
-
column.appendChild(buildFooterHeading(colIndex, heading));
|
|
7230
|
-
let firstLink = null;
|
|
7231
|
-
items.forEach((item, itemIndex) => {
|
|
7232
|
-
const link = buildFooterLink(colIndex, itemIndex, item.href, item.label, linkTemplate);
|
|
7233
|
-
column.appendChild(link);
|
|
7234
|
-
if (!firstLink) firstLink = link;
|
|
7235
|
-
});
|
|
7236
|
-
container.appendChild(column);
|
|
7237
|
-
return { column, firstLink };
|
|
7238
|
-
}
|
|
7239
|
-
function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL, linkHref = DEFAULT_FOOTER_COLUMN_LINK_HREF) {
|
|
7240
|
-
const colIndex = getNextFooterColumnIndex();
|
|
7241
|
-
const inserted = insertFooterColumnDom(colIndex, heading, [{ href: linkHref, label: linkLabel }]);
|
|
7242
|
-
if (!inserted?.firstLink) throw new Error("Failed to insert footer column");
|
|
7243
|
-
syncFooterColumnIndices(listFooterColumns());
|
|
7244
|
-
return {
|
|
7245
|
-
column: inserted.column,
|
|
7246
|
-
firstLink: inserted.firstLink,
|
|
7247
|
-
colIndex,
|
|
7248
|
-
headingKey: `footer-${colIndex}-heading`,
|
|
7249
|
-
hrefKey: `footer-${colIndex}-0-href`,
|
|
7250
|
-
labelKey: `footer-${colIndex}-0-label`,
|
|
7251
|
-
heading,
|
|
7252
|
-
label: linkLabel,
|
|
7253
|
-
href: linkHref,
|
|
7254
|
-
order: getFooterOrderFromDom()
|
|
7255
|
-
};
|
|
7256
|
-
}
|
|
7257
|
-
function collectFooterColumnIndicesFromContent(content) {
|
|
7258
|
-
const indices = /* @__PURE__ */ new Set();
|
|
7259
|
-
for (const key of Object.keys(content)) {
|
|
7260
|
-
const href = parseFooterHrefKey(key);
|
|
7261
|
-
if (href) indices.add(href.col);
|
|
7262
|
-
const heading = key.match(FOOTER_HEADING_RE);
|
|
7263
|
-
if (heading) indices.add(parseInt(heading[1], 10));
|
|
7264
|
-
const label = key.match(FOOTER_LABEL_RE);
|
|
7265
|
-
if (label) indices.add(parseInt(label[1], 10));
|
|
7266
|
-
}
|
|
7267
|
-
const order = parseFooterOrder(content);
|
|
7268
|
-
if (order) {
|
|
7269
|
-
for (const col of order) {
|
|
7270
|
-
for (const hrefKey of col) {
|
|
7271
|
-
const parsed = parseFooterHrefKey(hrefKey);
|
|
7272
|
-
if (parsed) indices.add(parsed.col);
|
|
7273
|
-
}
|
|
7274
|
-
}
|
|
7275
|
-
}
|
|
7276
|
-
return [...indices].sort((a, b) => a - b);
|
|
7277
|
-
}
|
|
7278
|
-
function collectFooterItemsForColumn(content, colIndex) {
|
|
7279
|
-
const itemIndices = /* @__PURE__ */ new Set();
|
|
7280
|
-
for (const key of Object.keys(content)) {
|
|
7281
|
-
const href = parseFooterHrefKey(key);
|
|
7282
|
-
if (href?.col === colIndex) itemIndices.add(href.item);
|
|
7283
|
-
const label = key.match(FOOTER_LABEL_RE);
|
|
7284
|
-
if (label && parseInt(label[1], 10) === colIndex) {
|
|
7285
|
-
itemIndices.add(parseInt(label[2], 10));
|
|
7286
|
-
}
|
|
7287
|
-
}
|
|
7288
|
-
const sorted = [...itemIndices].sort((a, b) => a - b);
|
|
7289
|
-
if (sorted.length === 0) {
|
|
7290
|
-
return [
|
|
7291
|
-
{
|
|
7292
|
-
href: content[`footer-${colIndex}-0-href`] ?? DEFAULT_FOOTER_COLUMN_LINK_HREF,
|
|
7293
|
-
label: content[`footer-${colIndex}-0-label`] ?? DEFAULT_FOOTER_COLUMN_LINK_LABEL
|
|
7294
|
-
}
|
|
7295
|
-
];
|
|
7296
|
-
}
|
|
7297
|
-
return sorted.map((itemIndex) => ({
|
|
7298
|
-
href: content[`footer-${colIndex}-${itemIndex}-href`] ?? DEFAULT_FOOTER_COLUMN_LINK_HREF,
|
|
7299
|
-
label: content[`footer-${colIndex}-${itemIndex}-label`] ?? DEFAULT_FOOTER_COLUMN_LINK_LABEL
|
|
7300
|
-
}));
|
|
7301
|
-
}
|
|
7302
|
-
function reconcileFooterColumnsFromContent(content) {
|
|
7303
|
-
const indices = collectFooterColumnIndicesFromContent(content);
|
|
7304
|
-
for (const colIndex of indices) {
|
|
7305
|
-
if (footerColumnExistsInDom(colIndex)) continue;
|
|
7306
|
-
const heading = content[`footer-${colIndex}-heading`] ?? DEFAULT_FOOTER_COLUMN_HEADING;
|
|
7307
|
-
const items = collectFooterItemsForColumn(content, colIndex);
|
|
7308
|
-
const hasPayload = Boolean(content[`footer-${colIndex}-heading`]) || items.some(
|
|
7309
|
-
(_, i) => content[`footer-${colIndex}-${i}-href`] !== void 0 || content[`footer-${colIndex}-${i}-label`] !== void 0
|
|
7310
|
-
) || (parseFooterOrder(content)?.some(
|
|
7311
|
-
(col) => col.some((k) => parseFooterHrefKey(k)?.col === colIndex)
|
|
7312
|
-
) ?? false);
|
|
7313
|
-
if (!hasPayload) continue;
|
|
7314
|
-
insertFooterColumnDom(colIndex, heading, items);
|
|
7315
|
-
}
|
|
7316
|
-
}
|
|
7317
7070
|
function reconcileFooterOrderFromContent(content) {
|
|
7318
|
-
reconcileFooterColumnsFromContent(content);
|
|
7319
7071
|
const order = parseFooterOrder(content);
|
|
7320
7072
|
if (!order?.length) return;
|
|
7321
7073
|
const current = getFooterOrderFromDom();
|
|
@@ -7325,26 +7077,6 @@ function reconcileFooterOrderFromContent(content) {
|
|
|
7325
7077
|
}
|
|
7326
7078
|
applyFooterOrder(order);
|
|
7327
7079
|
}
|
|
7328
|
-
function resolveFooterLinksContainerSelectionTarget(target, clientX, clientY, isPointOverItem) {
|
|
7329
|
-
const container = getFooterLinksContainer();
|
|
7330
|
-
if (!container) return null;
|
|
7331
|
-
const inContainer = target === container || container.contains(target) && Boolean(target.closest("[data-ohw-footer-links], .rb-footer-links"));
|
|
7332
|
-
if (!inContainer && target !== container) {
|
|
7333
|
-
const r2 = container.getBoundingClientRect();
|
|
7334
|
-
const over = clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
|
|
7335
|
-
if (!over) return null;
|
|
7336
|
-
}
|
|
7337
|
-
if (isPointOverItem(container, clientX, clientY)) return null;
|
|
7338
|
-
const column = target.closest("[data-ohw-footer-col], [data-ohw-footer-column]") ?? null;
|
|
7339
|
-
if (column && container.contains(column)) {
|
|
7340
|
-
if (target === column || column.contains(target)) return null;
|
|
7341
|
-
}
|
|
7342
|
-
if (target === container || container.contains(target) || inContainer) {
|
|
7343
|
-
if (target === container || isFooterLinksContainer(target)) return container;
|
|
7344
|
-
if (!column) return container;
|
|
7345
|
-
}
|
|
7346
|
-
return null;
|
|
7347
|
-
}
|
|
7348
7080
|
function isRowLayoutColumn(links) {
|
|
7349
7081
|
if (links.length < 2) return false;
|
|
7350
7082
|
const firstTop = links[0].getBoundingClientRect().top;
|
|
@@ -7500,30 +7232,6 @@ function hitTestColumnDropSlot(clientX, _clientY) {
|
|
|
7500
7232
|
return best?.slot ?? null;
|
|
7501
7233
|
}
|
|
7502
7234
|
|
|
7503
|
-
// src/lib/add-footer-column.ts
|
|
7504
|
-
function buildFooterColumnEditContentPatch(result) {
|
|
7505
|
-
return {
|
|
7506
|
-
[result.headingKey]: result.heading,
|
|
7507
|
-
[result.hrefKey]: result.href,
|
|
7508
|
-
[result.labelKey]: result.label,
|
|
7509
|
-
[FOOTER_ORDER_KEY]: JSON.stringify(result.order)
|
|
7510
|
-
};
|
|
7511
|
-
}
|
|
7512
|
-
function addFooterColumnWithPersist({
|
|
7513
|
-
postToParent: postToParent2
|
|
7514
|
-
}) {
|
|
7515
|
-
const result = insertFooterColumn();
|
|
7516
|
-
const patch = buildFooterColumnEditContentPatch(result);
|
|
7517
|
-
setStoredLinkHref(result.hrefKey, result.href);
|
|
7518
|
-
postToParent2({
|
|
7519
|
-
type: "ow:change",
|
|
7520
|
-
nodes: Object.entries(patch).map(([key, text]) => ({ key, text }))
|
|
7521
|
-
});
|
|
7522
|
-
postToParent2({ type: "ow:toast", title: "Item added", toastType: "success" });
|
|
7523
|
-
enforceLinkHrefs();
|
|
7524
|
-
return result;
|
|
7525
|
-
}
|
|
7526
|
-
|
|
7527
7235
|
// src/lib/item-drag-interaction.ts
|
|
7528
7236
|
function disableNativeHrefDrag(el) {
|
|
7529
7237
|
if (el.draggable) el.draggable = false;
|
|
@@ -8056,51 +7764,6 @@ function useNavItemDrag({
|
|
|
8056
7764
|
};
|
|
8057
7765
|
}
|
|
8058
7766
|
|
|
8059
|
-
// src/ui/footer-container-chrome.tsx
|
|
8060
|
-
var import_lucide_react11 = require("lucide-react");
|
|
8061
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
8062
|
-
function FooterContainerChrome({ rect, onAdd }) {
|
|
8063
|
-
const chromeGap = 6;
|
|
8064
|
-
const buttonMargin = 7;
|
|
8065
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8066
|
-
"div",
|
|
8067
|
-
{
|
|
8068
|
-
"data-ohw-footer-container-chrome": "",
|
|
8069
|
-
"data-ohw-bridge": "",
|
|
8070
|
-
className: "pointer-events-none fixed z-[2147483647]",
|
|
8071
|
-
style: {
|
|
8072
|
-
top: rect.top - chromeGap,
|
|
8073
|
-
left: rect.left - chromeGap,
|
|
8074
|
-
width: rect.width + chromeGap * 2,
|
|
8075
|
-
height: rect.height + chromeGap * 2
|
|
8076
|
-
},
|
|
8077
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
|
|
8078
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8079
|
-
"button",
|
|
8080
|
-
{
|
|
8081
|
-
type: "button",
|
|
8082
|
-
"data-ohw-footer-add-button": "",
|
|
8083
|
-
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",
|
|
8084
|
-
style: { top: chromeGap - buttonMargin },
|
|
8085
|
-
"aria-label": "Add item",
|
|
8086
|
-
onMouseDown: (e) => {
|
|
8087
|
-
e.preventDefault();
|
|
8088
|
-
e.stopPropagation();
|
|
8089
|
-
},
|
|
8090
|
-
onClick: (e) => {
|
|
8091
|
-
e.preventDefault();
|
|
8092
|
-
e.stopPropagation();
|
|
8093
|
-
onAdd();
|
|
8094
|
-
},
|
|
8095
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react11.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
8096
|
-
}
|
|
8097
|
-
) }),
|
|
8098
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: "Add item" })
|
|
8099
|
-
] })
|
|
8100
|
-
}
|
|
8101
|
-
) });
|
|
8102
|
-
}
|
|
8103
|
-
|
|
8104
7767
|
// src/lib/carousel.ts
|
|
8105
7768
|
var import_react9 = require("react");
|
|
8106
7769
|
var CAROUSEL_ATTR = "data-ohw-carousel";
|
|
@@ -8186,14 +7849,14 @@ function useOhwCarousel(key, initial) {
|
|
|
8186
7849
|
}
|
|
8187
7850
|
|
|
8188
7851
|
// src/ui/navbar-container-chrome.tsx
|
|
8189
|
-
var
|
|
8190
|
-
var
|
|
7852
|
+
var import_lucide_react11 = require("lucide-react");
|
|
7853
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
8191
7854
|
function NavbarContainerChrome({
|
|
8192
7855
|
rect,
|
|
8193
7856
|
onAdd
|
|
8194
7857
|
}) {
|
|
8195
7858
|
const chromeGap = 6;
|
|
8196
|
-
return /* @__PURE__ */ (0,
|
|
7859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8197
7860
|
"div",
|
|
8198
7861
|
{
|
|
8199
7862
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -8205,7 +7868,7 @@ function NavbarContainerChrome({
|
|
|
8205
7868
|
width: rect.width + chromeGap * 2,
|
|
8206
7869
|
height: rect.height + chromeGap * 2
|
|
8207
7870
|
},
|
|
8208
|
-
children: /* @__PURE__ */ (0,
|
|
7871
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
8209
7872
|
"button",
|
|
8210
7873
|
{
|
|
8211
7874
|
type: "button",
|
|
@@ -8222,7 +7885,7 @@ function NavbarContainerChrome({
|
|
|
8222
7885
|
e.stopPropagation();
|
|
8223
7886
|
onAdd();
|
|
8224
7887
|
},
|
|
8225
|
-
children: /* @__PURE__ */ (0,
|
|
7888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react11.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
8226
7889
|
}
|
|
8227
7890
|
)
|
|
8228
7891
|
}
|
|
@@ -8231,7 +7894,7 @@ function NavbarContainerChrome({
|
|
|
8231
7894
|
|
|
8232
7895
|
// src/ui/drop-indicator.tsx
|
|
8233
7896
|
var React10 = __toESM(require("react"), 1);
|
|
8234
|
-
var
|
|
7897
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8235
7898
|
var dropIndicatorVariants = cva(
|
|
8236
7899
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
8237
7900
|
{
|
|
@@ -8255,7 +7918,7 @@ var dropIndicatorVariants = cva(
|
|
|
8255
7918
|
);
|
|
8256
7919
|
var DropIndicator = React10.forwardRef(
|
|
8257
7920
|
({ className, direction, state, ...props }, ref) => {
|
|
8258
|
-
return /* @__PURE__ */ (0,
|
|
7921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8259
7922
|
"div",
|
|
8260
7923
|
{
|
|
8261
7924
|
ref,
|
|
@@ -8272,7 +7935,7 @@ var DropIndicator = React10.forwardRef(
|
|
|
8272
7935
|
DropIndicator.displayName = "DropIndicator";
|
|
8273
7936
|
|
|
8274
7937
|
// src/ui/badge.tsx
|
|
8275
|
-
var
|
|
7938
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8276
7939
|
var badgeVariants = cva(
|
|
8277
7940
|
"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",
|
|
8278
7941
|
{
|
|
@@ -8290,12 +7953,12 @@ var badgeVariants = cva(
|
|
|
8290
7953
|
}
|
|
8291
7954
|
);
|
|
8292
7955
|
function Badge({ className, variant, ...props }) {
|
|
8293
|
-
return /* @__PURE__ */ (0,
|
|
7956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
8294
7957
|
}
|
|
8295
7958
|
|
|
8296
7959
|
// src/OhhwellsBridge.tsx
|
|
8297
|
-
var
|
|
8298
|
-
var
|
|
7960
|
+
var import_lucide_react12 = require("lucide-react");
|
|
7961
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8299
7962
|
var PRIMARY2 = "#0885FE";
|
|
8300
7963
|
var IMAGE_FADE_MS = 300;
|
|
8301
7964
|
function runOpacityFade(el, onDone) {
|
|
@@ -8474,7 +8137,7 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
|
|
|
8474
8137
|
const root = (0, import_client.createRoot)(container);
|
|
8475
8138
|
(0, import_react_dom2.flushSync)(() => {
|
|
8476
8139
|
root.render(
|
|
8477
|
-
/* @__PURE__ */ (0,
|
|
8140
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8478
8141
|
SchedulingWidget,
|
|
8479
8142
|
{
|
|
8480
8143
|
notifyOnConnect,
|
|
@@ -8678,7 +8341,7 @@ function applyLinkByKey(key, val) {
|
|
|
8678
8341
|
}
|
|
8679
8342
|
function isInsideLinkEditor(target) {
|
|
8680
8343
|
return Boolean(
|
|
8681
|
-
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(
|
|
8344
|
+
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"]')
|
|
8682
8345
|
);
|
|
8683
8346
|
}
|
|
8684
8347
|
function getHrefKeyFromElement(el) {
|
|
@@ -8759,7 +8422,7 @@ function isInferredFooterGroup(el) {
|
|
|
8759
8422
|
return countFooterNavItems(el) >= 2;
|
|
8760
8423
|
}
|
|
8761
8424
|
function isNavigationContainer(el) {
|
|
8762
|
-
return el.hasAttribute("data-ohw-nav-container") ||
|
|
8425
|
+
return el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isNavigationRoot(el) || isInferredFooterGroup(el);
|
|
8763
8426
|
}
|
|
8764
8427
|
function isNavbarLinksContainer(el) {
|
|
8765
8428
|
return el.hasAttribute("data-ohw-nav-container");
|
|
@@ -8778,9 +8441,6 @@ function isPointOverNavigation(x, y) {
|
|
|
8778
8441
|
const roots = /* @__PURE__ */ new Set();
|
|
8779
8442
|
const navRoot = document.querySelector("[data-ohw-nav-root]") ?? document.querySelector("nav");
|
|
8780
8443
|
if (navRoot) roots.add(navRoot);
|
|
8781
|
-
document.querySelectorAll("[data-ohw-nav-drawer], [data-ohw-nav-container]").forEach((el) => {
|
|
8782
|
-
roots.add(el);
|
|
8783
|
-
});
|
|
8784
8444
|
const footer = document.querySelector("footer");
|
|
8785
8445
|
if (footer) roots.add(footer);
|
|
8786
8446
|
for (const root of roots) {
|
|
@@ -8809,12 +8469,6 @@ function isPointOverNavItem(container, x, y) {
|
|
|
8809
8469
|
return x >= itemRect.left && x <= itemRect.right && y >= itemRect.top && y <= itemRect.bottom;
|
|
8810
8470
|
});
|
|
8811
8471
|
}
|
|
8812
|
-
function isPointOverFooterColumn(x, y) {
|
|
8813
|
-
return listFooterColumns().some((col) => {
|
|
8814
|
-
const r2 = col.getBoundingClientRect();
|
|
8815
|
-
return x >= r2.left && x <= r2.right && y >= r2.top && y <= r2.bottom;
|
|
8816
|
-
});
|
|
8817
|
-
}
|
|
8818
8472
|
function resolveNavContainerSelectionTarget(target, clientX, clientY) {
|
|
8819
8473
|
if (getNavigationItemAnchor(target)) return null;
|
|
8820
8474
|
if (target.closest('[data-ohw-role="navbar-button"]')) return null;
|
|
@@ -8845,10 +8499,7 @@ function getNavigationSelectionParent(el) {
|
|
|
8845
8499
|
if (footerGroup) return footerGroup;
|
|
8846
8500
|
return getNavigationRoot(el);
|
|
8847
8501
|
}
|
|
8848
|
-
if (
|
|
8849
|
-
return getFooterLinksContainer();
|
|
8850
|
-
}
|
|
8851
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup(el)) {
|
|
8502
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup(el)) {
|
|
8852
8503
|
return getNavigationRoot(el);
|
|
8853
8504
|
}
|
|
8854
8505
|
return null;
|
|
@@ -9075,7 +8726,7 @@ function EditGlowChrome({
|
|
|
9075
8726
|
hideHandle = false
|
|
9076
8727
|
}) {
|
|
9077
8728
|
const GAP = SELECTION_CHROME_GAP2;
|
|
9078
|
-
return /* @__PURE__ */ (0,
|
|
8729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
9079
8730
|
"div",
|
|
9080
8731
|
{
|
|
9081
8732
|
ref: elRef,
|
|
@@ -9090,7 +8741,7 @@ function EditGlowChrome({
|
|
|
9090
8741
|
zIndex: 2147483646
|
|
9091
8742
|
},
|
|
9092
8743
|
children: [
|
|
9093
|
-
/* @__PURE__ */ (0,
|
|
8744
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9094
8745
|
"div",
|
|
9095
8746
|
{
|
|
9096
8747
|
style: {
|
|
@@ -9103,7 +8754,7 @@ function EditGlowChrome({
|
|
|
9103
8754
|
}
|
|
9104
8755
|
}
|
|
9105
8756
|
),
|
|
9106
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */ (0,
|
|
8757
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9107
8758
|
"div",
|
|
9108
8759
|
{
|
|
9109
8760
|
"data-ohw-drag-handle-container": "",
|
|
@@ -9115,7 +8766,7 @@ function EditGlowChrome({
|
|
|
9115
8766
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
9116
8767
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
9117
8768
|
},
|
|
9118
|
-
children: /* @__PURE__ */ (0,
|
|
8769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9119
8770
|
DragHandle,
|
|
9120
8771
|
{
|
|
9121
8772
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -9325,7 +8976,7 @@ function FloatingToolbar({
|
|
|
9325
8976
|
return () => ro.disconnect();
|
|
9326
8977
|
}, [showEditLink, activeCommands]);
|
|
9327
8978
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
9328
|
-
return /* @__PURE__ */ (0,
|
|
8979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9329
8980
|
"div",
|
|
9330
8981
|
{
|
|
9331
8982
|
ref: setRefs,
|
|
@@ -9337,12 +8988,12 @@ function FloatingToolbar({
|
|
|
9337
8988
|
zIndex: 2147483647,
|
|
9338
8989
|
pointerEvents: "auto"
|
|
9339
8990
|
},
|
|
9340
|
-
children: /* @__PURE__ */ (0,
|
|
9341
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0,
|
|
9342
|
-
gi > 0 && /* @__PURE__ */ (0,
|
|
8991
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CustomToolbar, { children: [
|
|
8992
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react10.default.Fragment, { children: [
|
|
8993
|
+
gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CustomToolbarDivider, {}),
|
|
9343
8994
|
btns.map((btn) => {
|
|
9344
8995
|
const isActive = activeCommands.has(btn.cmd);
|
|
9345
|
-
return /* @__PURE__ */ (0,
|
|
8996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9346
8997
|
CustomToolbarButton,
|
|
9347
8998
|
{
|
|
9348
8999
|
title: btn.title,
|
|
@@ -9351,7 +9002,7 @@ function FloatingToolbar({
|
|
|
9351
9002
|
e.preventDefault();
|
|
9352
9003
|
onCommand(btn.cmd);
|
|
9353
9004
|
},
|
|
9354
|
-
children: /* @__PURE__ */ (0,
|
|
9005
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9355
9006
|
"svg",
|
|
9356
9007
|
{
|
|
9357
9008
|
width: "16",
|
|
@@ -9372,7 +9023,7 @@ function FloatingToolbar({
|
|
|
9372
9023
|
);
|
|
9373
9024
|
})
|
|
9374
9025
|
] }, gi)),
|
|
9375
|
-
showEditLink ? /* @__PURE__ */ (0,
|
|
9026
|
+
showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9376
9027
|
CustomToolbarButton,
|
|
9377
9028
|
{
|
|
9378
9029
|
type: "button",
|
|
@@ -9386,7 +9037,7 @@ function FloatingToolbar({
|
|
|
9386
9037
|
e.preventDefault();
|
|
9387
9038
|
e.stopPropagation();
|
|
9388
9039
|
},
|
|
9389
|
-
children: /* @__PURE__ */ (0,
|
|
9040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Link, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
9390
9041
|
}
|
|
9391
9042
|
) : null
|
|
9392
9043
|
] })
|
|
@@ -9403,7 +9054,7 @@ function StateToggle({
|
|
|
9403
9054
|
states,
|
|
9404
9055
|
onStateChange
|
|
9405
9056
|
}) {
|
|
9406
|
-
return /* @__PURE__ */ (0,
|
|
9057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9407
9058
|
ToggleGroup,
|
|
9408
9059
|
{
|
|
9409
9060
|
"data-ohw-state-toggle": "",
|
|
@@ -9417,7 +9068,7 @@ function StateToggle({
|
|
|
9417
9068
|
left: rect.right - 8,
|
|
9418
9069
|
transform: "translateX(-100%)"
|
|
9419
9070
|
},
|
|
9420
|
-
children: states.map((state) => /* @__PURE__ */ (0,
|
|
9071
|
+
children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
9421
9072
|
}
|
|
9422
9073
|
);
|
|
9423
9074
|
}
|
|
@@ -9914,18 +9565,6 @@ function OhhwellsBridge() {
|
|
|
9914
9565
|
intent: "add-nav"
|
|
9915
9566
|
});
|
|
9916
9567
|
}, []);
|
|
9917
|
-
const handleAddFooterColumn = (0, import_react10.useCallback)(() => {
|
|
9918
|
-
deselectRef.current();
|
|
9919
|
-
deactivateRef.current();
|
|
9920
|
-
const result = addFooterColumnWithPersist({ postToParent: postToParent2 });
|
|
9921
|
-
editContentRef.current = {
|
|
9922
|
-
...editContentRef.current,
|
|
9923
|
-
...buildFooterColumnEditContentPatch(result)
|
|
9924
|
-
};
|
|
9925
|
-
requestAnimationFrame(() => {
|
|
9926
|
-
selectRef.current(result.firstLink);
|
|
9927
|
-
});
|
|
9928
|
-
}, [postToParent2]);
|
|
9929
9568
|
const clearFooterDragVisuals = (0, import_react10.useCallback)(() => {
|
|
9930
9569
|
footerDragRef.current = null;
|
|
9931
9570
|
setSiblingHintRects([]);
|
|
@@ -10250,7 +9889,7 @@ function OhhwellsBridge() {
|
|
|
10250
9889
|
const selectFrame = (0, import_react10.useCallback)((el) => {
|
|
10251
9890
|
if (!isNavigationContainer(el)) return;
|
|
10252
9891
|
if (activeElRef.current) deactivate();
|
|
10253
|
-
const isFooterColumn =
|
|
9892
|
+
const isFooterColumn = el.hasAttribute("data-ohw-footer-col") || Boolean(el.closest("footer") && isInferredFooterGroup(el));
|
|
10254
9893
|
selectedElRef.current = el;
|
|
10255
9894
|
selectedHrefKeyRef.current = null;
|
|
10256
9895
|
selectedFooterColAttrRef.current = isFooterColumn ? el.getAttribute("data-ohw-footer-col") ?? String(listFooterColumns().indexOf(el)) : null;
|
|
@@ -10808,7 +10447,7 @@ function OhhwellsBridge() {
|
|
|
10808
10447
|
}
|
|
10809
10448
|
e.preventDefault();
|
|
10810
10449
|
e.stopPropagation();
|
|
10811
|
-
activateRef.current(editable
|
|
10450
|
+
activateRef.current(editable);
|
|
10812
10451
|
return;
|
|
10813
10452
|
}
|
|
10814
10453
|
const hrefAnchor = getNavigationItemAnchor(target);
|
|
@@ -10835,18 +10474,6 @@ function OhhwellsBridge() {
|
|
|
10835
10474
|
selectFrameRef.current(footerColClick);
|
|
10836
10475
|
return;
|
|
10837
10476
|
}
|
|
10838
|
-
const footerLinksToSelect = resolveFooterLinksContainerSelectionTarget(
|
|
10839
|
-
target,
|
|
10840
|
-
e.clientX,
|
|
10841
|
-
e.clientY,
|
|
10842
|
-
isPointOverNavItem
|
|
10843
|
-
);
|
|
10844
|
-
if (footerLinksToSelect) {
|
|
10845
|
-
e.preventDefault();
|
|
10846
|
-
e.stopPropagation();
|
|
10847
|
-
selectFrameRef.current(footerLinksToSelect);
|
|
10848
|
-
return;
|
|
10849
|
-
}
|
|
10850
10477
|
const navContainerToSelect = resolveNavContainerSelectionTarget(target, e.clientX, e.clientY);
|
|
10851
10478
|
if (navContainerToSelect) {
|
|
10852
10479
|
e.preventDefault();
|
|
@@ -10905,8 +10532,8 @@ function OhhwellsBridge() {
|
|
|
10905
10532
|
return;
|
|
10906
10533
|
}
|
|
10907
10534
|
const navLabel = getNavigationLabelEditable(target);
|
|
10908
|
-
|
|
10909
|
-
|
|
10535
|
+
if (!navLabel) return;
|
|
10536
|
+
const { editable } = navLabel;
|
|
10910
10537
|
e.preventDefault();
|
|
10911
10538
|
e.stopPropagation();
|
|
10912
10539
|
if (activeElRef.current !== editable) {
|
|
@@ -10927,38 +10554,16 @@ function OhhwellsBridge() {
|
|
|
10927
10554
|
setHoveredNavContainerRect(null);
|
|
10928
10555
|
return;
|
|
10929
10556
|
}
|
|
10930
|
-
{
|
|
10931
|
-
const
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
hoveredNavContainerRef.current = navContainer;
|
|
10939
|
-
setHoveredNavContainerRect(navContainer.getBoundingClientRect());
|
|
10940
|
-
hoveredItemElRef.current = null;
|
|
10941
|
-
setHoveredItemRect(null);
|
|
10942
|
-
return;
|
|
10943
|
-
}
|
|
10557
|
+
if (toolbarVariantRef.current !== "select-frame") {
|
|
10558
|
+
const navContainer = target.closest("[data-ohw-nav-container]");
|
|
10559
|
+
if (navContainer && !getNavigationItemAnchor(target)) {
|
|
10560
|
+
hoveredNavContainerRef.current = navContainer;
|
|
10561
|
+
setHoveredNavContainerRect(navContainer.getBoundingClientRect());
|
|
10562
|
+
hoveredItemElRef.current = null;
|
|
10563
|
+
setHoveredItemRect(null);
|
|
10564
|
+
return;
|
|
10944
10565
|
}
|
|
10945
|
-
if (
|
|
10946
|
-
const navContainer = target.closest("[data-ohw-nav-container]");
|
|
10947
|
-
if (!navContainer) {
|
|
10948
|
-
const footerLinks = target.closest("[data-ohw-footer-links], .rb-footer-links") ?? null;
|
|
10949
|
-
if (footerLinks && selected2 !== footerLinks && !getNavigationItemAnchor(target) && !target.closest("[data-ohw-footer-col], [data-ohw-footer-column]")) {
|
|
10950
|
-
hoveredNavContainerRef.current = footerLinks;
|
|
10951
|
-
setHoveredNavContainerRect(footerLinks.getBoundingClientRect());
|
|
10952
|
-
hoveredItemElRef.current = null;
|
|
10953
|
-
setHoveredItemRect(null);
|
|
10954
|
-
return;
|
|
10955
|
-
}
|
|
10956
|
-
if (!footerLinks) {
|
|
10957
|
-
hoveredNavContainerRef.current = null;
|
|
10958
|
-
setHoveredNavContainerRect(null);
|
|
10959
|
-
}
|
|
10960
|
-
}
|
|
10961
|
-
} else if (toolbarVariantRef.current === "select-frame") {
|
|
10566
|
+
if (!target.closest("[data-ohw-nav-container]")) {
|
|
10962
10567
|
hoveredNavContainerRef.current = null;
|
|
10963
10568
|
setHoveredNavContainerRect(null);
|
|
10964
10569
|
}
|
|
@@ -11000,9 +10605,9 @@ function OhhwellsBridge() {
|
|
|
11000
10605
|
};
|
|
11001
10606
|
const handleMouseOut = (e) => {
|
|
11002
10607
|
const target = e.target;
|
|
11003
|
-
if (target.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column]
|
|
10608
|
+
if (target.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column]")) {
|
|
11004
10609
|
const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
|
|
11005
|
-
if (related2?.closest("[data-ohw-nav-container], [data-ohw-footer-col], [data-ohw-footer-column], [data-ohw-
|
|
10610
|
+
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]")) {
|
|
11006
10611
|
return;
|
|
11007
10612
|
}
|
|
11008
10613
|
hoveredNavContainerRef.current = null;
|
|
@@ -11097,15 +10702,6 @@ function OhhwellsBridge() {
|
|
|
11097
10702
|
if (track) track.setAttribute("data-ohw-hover-paused", "");
|
|
11098
10703
|
};
|
|
11099
10704
|
const clearImageHover = () => setMediaHover(null);
|
|
11100
|
-
const dismissImageHover = () => {
|
|
11101
|
-
if (hoveredImageRef.current) {
|
|
11102
|
-
hoveredImageRef.current = null;
|
|
11103
|
-
hoveredImageHasTextOverlapRef.current = false;
|
|
11104
|
-
resumeAnimTracks();
|
|
11105
|
-
postToParentRef.current({ type: "ow:image-unhover" });
|
|
11106
|
-
}
|
|
11107
|
-
clearImageHover();
|
|
11108
|
-
};
|
|
11109
10705
|
const findImageAtPoint = (clientX, clientY, fromParentViewport) => {
|
|
11110
10706
|
const { x, y } = toProbeCoords(clientX, clientY, fromParentViewport);
|
|
11111
10707
|
const images = Array.from(document.querySelectorAll(MEDIA_SELECTOR));
|
|
@@ -11149,13 +10745,16 @@ function OhhwellsBridge() {
|
|
|
11149
10745
|
}
|
|
11150
10746
|
return smallest;
|
|
11151
10747
|
};
|
|
10748
|
+
const dismissImageHover = () => {
|
|
10749
|
+
if (hoveredImageRef.current) {
|
|
10750
|
+
hoveredImageRef.current = null;
|
|
10751
|
+
hoveredImageHasTextOverlapRef.current = false;
|
|
10752
|
+
resumeAnimTracks();
|
|
10753
|
+
postToParentRef.current({ type: "ow:image-unhover" });
|
|
10754
|
+
}
|
|
10755
|
+
};
|
|
11152
10756
|
const probeNavigationHoverAt = (x, y) => {
|
|
11153
|
-
|
|
11154
|
-
const selectedIsFooterColumn = Boolean(selected) && !isFooterLinksContainer(selected) && (selected.hasAttribute("data-ohw-footer-col") || selected.hasAttribute("data-ohw-footer-column") || Boolean(selected.closest("footer") && isInferredFooterGroup(selected)));
|
|
11155
|
-
const selectedIsFooterLinks = Boolean(selected && isFooterLinksContainer(selected));
|
|
11156
|
-
const allowNavContainerHover = toolbarVariantRef.current !== "select-frame";
|
|
11157
|
-
const allowFooterLinksHover = (toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn) && !selectedIsFooterLinks;
|
|
11158
|
-
if (toolbarVariantRef.current === "select-frame" && !allowFooterLinksHover) {
|
|
10757
|
+
if (toolbarVariantRef.current === "select-frame") {
|
|
11159
10758
|
hoveredNavContainerRef.current = null;
|
|
11160
10759
|
setHoveredNavContainerRect(null);
|
|
11161
10760
|
}
|
|
@@ -11177,6 +10776,7 @@ function OhhwellsBridge() {
|
|
|
11177
10776
|
if (navItemHit) {
|
|
11178
10777
|
hoveredNavContainerRef.current = null;
|
|
11179
10778
|
setHoveredNavContainerRect(null);
|
|
10779
|
+
const selected = selectedElRef.current;
|
|
11180
10780
|
if (selected !== navItemHit) {
|
|
11181
10781
|
clearHrefKeyHover(navItemHit);
|
|
11182
10782
|
hoveredItemElRef.current = navItemHit;
|
|
@@ -11188,7 +10788,7 @@ function OhhwellsBridge() {
|
|
|
11188
10788
|
return;
|
|
11189
10789
|
}
|
|
11190
10790
|
}
|
|
11191
|
-
if (
|
|
10791
|
+
if (toolbarVariantRef.current !== "select-frame") {
|
|
11192
10792
|
for (const container of navContainers) {
|
|
11193
10793
|
const containerRect = container.getBoundingClientRect();
|
|
11194
10794
|
const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
|
|
@@ -11200,23 +10800,12 @@ function OhhwellsBridge() {
|
|
|
11200
10800
|
setHoveredItemRect(null);
|
|
11201
10801
|
return;
|
|
11202
10802
|
}
|
|
10803
|
+
hoveredNavContainerRef.current = null;
|
|
10804
|
+
setHoveredNavContainerRect(null);
|
|
10805
|
+
} else {
|
|
10806
|
+
hoveredNavContainerRef.current = null;
|
|
10807
|
+
setHoveredNavContainerRect(null);
|
|
11203
10808
|
}
|
|
11204
|
-
if (allowFooterLinksHover) {
|
|
11205
|
-
const footerLinks = getFooterLinksContainer();
|
|
11206
|
-
if (footerLinks) {
|
|
11207
|
-
const containerRect = footerLinks.getBoundingClientRect();
|
|
11208
|
-
const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
|
|
11209
|
-
if (overContainer && !isPointOverNavItem(footerLinks, x, y) && !isPointOverFooterColumn(x, y)) {
|
|
11210
|
-
hoveredNavContainerRef.current = footerLinks;
|
|
11211
|
-
setHoveredNavContainerRect(footerLinks.getBoundingClientRect());
|
|
11212
|
-
hoveredItemElRef.current = null;
|
|
11213
|
-
setHoveredItemRect(null);
|
|
11214
|
-
return;
|
|
11215
|
-
}
|
|
11216
|
-
}
|
|
11217
|
-
}
|
|
11218
|
-
hoveredNavContainerRef.current = null;
|
|
11219
|
-
setHoveredNavContainerRect(null);
|
|
11220
10809
|
for (const column of footerColumns) {
|
|
11221
10810
|
const containerRect = column.getBoundingClientRect();
|
|
11222
10811
|
const overContainer = x >= containerRect.left && x <= containerRect.right && y >= containerRect.top && y <= containerRect.bottom;
|
|
@@ -11725,7 +11314,6 @@ function OhhwellsBridge() {
|
|
|
11725
11314
|
}
|
|
11726
11315
|
editContentRef.current = { ...editContentRef.current, ...content };
|
|
11727
11316
|
reconcileNavbarItemsFromContent(editContentRef.current);
|
|
11728
|
-
reconcileFooterOrderFromContent(editContentRef.current);
|
|
11729
11317
|
syncNavigationDragCursorAttrs();
|
|
11730
11318
|
enforceLinkHrefs();
|
|
11731
11319
|
postToParentRef.current({ type: "ow:hydrate-done" });
|
|
@@ -11780,11 +11368,6 @@ function OhhwellsBridge() {
|
|
|
11780
11368
|
}
|
|
11781
11369
|
if (selectedElRef.current) {
|
|
11782
11370
|
if (toolbarVariantRef.current === "select-frame") {
|
|
11783
|
-
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
11784
|
-
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
11785
|
-
selectFrameRef.current(parent2);
|
|
11786
|
-
return;
|
|
11787
|
-
}
|
|
11788
11371
|
deselectRef.current();
|
|
11789
11372
|
return;
|
|
11790
11373
|
}
|
|
@@ -11800,10 +11383,13 @@ function OhhwellsBridge() {
|
|
|
11800
11383
|
const handleKeyDown = (e) => {
|
|
11801
11384
|
if (e.key === "Escape" && document.querySelector("[data-ohw-section-picker]")) return;
|
|
11802
11385
|
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a" && activeElRef.current) {
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11386
|
+
const navAnchor = getNavigationItemAnchor(activeElRef.current);
|
|
11387
|
+
if (navAnchor) {
|
|
11388
|
+
e.preventDefault();
|
|
11389
|
+
selectAllTextInEditable(activeElRef.current);
|
|
11390
|
+
refreshActiveCommandsRef.current();
|
|
11391
|
+
return;
|
|
11392
|
+
}
|
|
11807
11393
|
}
|
|
11808
11394
|
if (e.key === "Escape" && linkPopoverOpenRef.current) {
|
|
11809
11395
|
setLinkPopoverRef.current(null);
|
|
@@ -11811,12 +11397,6 @@ function OhhwellsBridge() {
|
|
|
11811
11397
|
}
|
|
11812
11398
|
if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
|
|
11813
11399
|
if (toolbarVariantRef.current === "select-frame") {
|
|
11814
|
-
const parent2 = getNavigationSelectionParent(selectedElRef.current);
|
|
11815
|
-
if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
|
|
11816
|
-
e.preventDefault();
|
|
11817
|
-
selectFrameRef.current(parent2);
|
|
11818
|
-
return;
|
|
11819
|
-
}
|
|
11820
11400
|
deselectRef.current();
|
|
11821
11401
|
return;
|
|
11822
11402
|
}
|
|
@@ -12656,9 +12236,9 @@ function OhhwellsBridge() {
|
|
|
12656
12236
|
[postToParent2]
|
|
12657
12237
|
);
|
|
12658
12238
|
return bridgeRoot ? (0, import_react_dom3.createPortal)(
|
|
12659
|
-
/* @__PURE__ */ (0,
|
|
12660
|
-
/* @__PURE__ */ (0,
|
|
12661
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0,
|
|
12239
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
12240
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
12241
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12662
12242
|
MediaOverlay,
|
|
12663
12243
|
{
|
|
12664
12244
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -12669,7 +12249,7 @@ function OhhwellsBridge() {
|
|
|
12669
12249
|
},
|
|
12670
12250
|
`uploading-${key}`
|
|
12671
12251
|
)),
|
|
12672
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0,
|
|
12252
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12673
12253
|
MediaOverlay,
|
|
12674
12254
|
{
|
|
12675
12255
|
hover: mediaHover,
|
|
@@ -12678,11 +12258,11 @@ function OhhwellsBridge() {
|
|
|
12678
12258
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
12679
12259
|
}
|
|
12680
12260
|
),
|
|
12681
|
-
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0,
|
|
12682
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0,
|
|
12683
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0,
|
|
12684
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0,
|
|
12685
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0,
|
|
12261
|
+
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
|
|
12262
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
12263
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
12264
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
12265
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12686
12266
|
"div",
|
|
12687
12267
|
{
|
|
12688
12268
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -12692,7 +12272,7 @@ function OhhwellsBridge() {
|
|
|
12692
12272
|
width: slot.width,
|
|
12693
12273
|
height: slot.height
|
|
12694
12274
|
},
|
|
12695
|
-
children: /* @__PURE__ */ (0,
|
|
12275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12696
12276
|
DropIndicator,
|
|
12697
12277
|
{
|
|
12698
12278
|
direction: slot.direction,
|
|
@@ -12703,7 +12283,7 @@ function OhhwellsBridge() {
|
|
|
12703
12283
|
},
|
|
12704
12284
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
12705
12285
|
)),
|
|
12706
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0,
|
|
12286
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12707
12287
|
"div",
|
|
12708
12288
|
{
|
|
12709
12289
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -12713,7 +12293,7 @@ function OhhwellsBridge() {
|
|
|
12713
12293
|
width: slot.width,
|
|
12714
12294
|
height: slot.height
|
|
12715
12295
|
},
|
|
12716
|
-
children: /* @__PURE__ */ (0,
|
|
12296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12717
12297
|
DropIndicator,
|
|
12718
12298
|
{
|
|
12719
12299
|
direction: slot.direction,
|
|
@@ -12724,11 +12304,10 @@ function OhhwellsBridge() {
|
|
|
12724
12304
|
},
|
|
12725
12305
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
12726
12306
|
)),
|
|
12727
|
-
hoveredNavContainerRect &&
|
|
12728
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0,
|
|
12729
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0,
|
|
12730
|
-
|
|
12731
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
12307
|
+
hoveredNavContainerRect && toolbarVariant !== "select-frame" && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
12308
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
12309
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
12310
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12732
12311
|
ItemInteractionLayer,
|
|
12733
12312
|
{
|
|
12734
12313
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -12742,7 +12321,7 @@ function OhhwellsBridge() {
|
|
|
12742
12321
|
onItemPointerDown: handleItemChromePointerDown,
|
|
12743
12322
|
onItemClick: handleItemChromeClick,
|
|
12744
12323
|
itemDragSurface: !isFooterFrameSelection,
|
|
12745
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */ (0,
|
|
12324
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12746
12325
|
ItemActionToolbar,
|
|
12747
12326
|
{
|
|
12748
12327
|
onEditLink: openLinkPopoverForSelected,
|
|
@@ -12755,8 +12334,8 @@ function OhhwellsBridge() {
|
|
|
12755
12334
|
) : void 0
|
|
12756
12335
|
}
|
|
12757
12336
|
),
|
|
12758
|
-
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0,
|
|
12759
|
-
/* @__PURE__ */ (0,
|
|
12337
|
+
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
12338
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12760
12339
|
EditGlowChrome,
|
|
12761
12340
|
{
|
|
12762
12341
|
rect: toolbarRect,
|
|
@@ -12766,7 +12345,7 @@ function OhhwellsBridge() {
|
|
|
12766
12345
|
hideHandle: isItemDragging
|
|
12767
12346
|
}
|
|
12768
12347
|
),
|
|
12769
|
-
/* @__PURE__ */ (0,
|
|
12348
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12770
12349
|
FloatingToolbar,
|
|
12771
12350
|
{
|
|
12772
12351
|
rect: toolbarRect,
|
|
@@ -12779,7 +12358,7 @@ function OhhwellsBridge() {
|
|
|
12779
12358
|
}
|
|
12780
12359
|
)
|
|
12781
12360
|
] }),
|
|
12782
|
-
maxBadge && /* @__PURE__ */ (0,
|
|
12361
|
+
maxBadge && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
12783
12362
|
"div",
|
|
12784
12363
|
{
|
|
12785
12364
|
"data-ohw-max-badge": "",
|
|
@@ -12805,7 +12384,7 @@ function OhhwellsBridge() {
|
|
|
12805
12384
|
]
|
|
12806
12385
|
}
|
|
12807
12386
|
),
|
|
12808
|
-
toggleState && !linkPopover && /* @__PURE__ */ (0,
|
|
12387
|
+
toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12809
12388
|
StateToggle,
|
|
12810
12389
|
{
|
|
12811
12390
|
rect: toggleState.rect,
|
|
@@ -12814,15 +12393,15 @@ function OhhwellsBridge() {
|
|
|
12814
12393
|
onStateChange: handleStateChange
|
|
12815
12394
|
}
|
|
12816
12395
|
),
|
|
12817
|
-
sectionGap && !linkPopover && /* @__PURE__ */ (0,
|
|
12396
|
+
sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
12818
12397
|
"div",
|
|
12819
12398
|
{
|
|
12820
12399
|
"data-ohw-section-insert-line": "",
|
|
12821
12400
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
12822
12401
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
12823
12402
|
children: [
|
|
12824
|
-
/* @__PURE__ */ (0,
|
|
12825
|
-
/* @__PURE__ */ (0,
|
|
12403
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
12404
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12826
12405
|
Badge,
|
|
12827
12406
|
{
|
|
12828
12407
|
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",
|
|
@@ -12839,11 +12418,11 @@ function OhhwellsBridge() {
|
|
|
12839
12418
|
children: "Add Section"
|
|
12840
12419
|
}
|
|
12841
12420
|
),
|
|
12842
|
-
/* @__PURE__ */ (0,
|
|
12421
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
12843
12422
|
]
|
|
12844
12423
|
}
|
|
12845
12424
|
),
|
|
12846
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0,
|
|
12425
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
12847
12426
|
LinkPopover,
|
|
12848
12427
|
{
|
|
12849
12428
|
panelRef: linkPopoverPanelRef,
|