@ohhwells/bridge 0.1.54-next.156 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -46,7 +46,6 @@ __export(index_exports, {
46
46
  DropdownMenuItem: () => DropdownMenuItem,
47
47
  DropdownMenuSeparator: () => DropdownMenuSeparator,
48
48
  DropdownMenuTrigger: () => DropdownMenuTrigger,
49
- EmptySection: () => EmptySection,
50
49
  ItemActionToolbar: () => ItemActionToolbar,
51
50
  ItemInteractionLayer: () => ItemInteractionLayer,
52
51
  LinkEditorPanel: () => LinkEditorPanel,
@@ -75,7 +74,7 @@ __export(index_exports, {
75
74
  module.exports = __toCommonJS(index_exports);
76
75
 
77
76
  // src/OhhwellsBridge.tsx
78
- var import_react16 = __toESM(require("react"), 1);
77
+ var import_react15 = __toESM(require("react"), 1);
79
78
  var import_client2 = require("react-dom/client");
80
79
  var import_react_dom3 = require("react-dom");
81
80
 
@@ -192,59 +191,6 @@ function deleteSectionFromState(state, sectionId) {
192
191
  return { ...state, v: 1, sections: state.sections, removed: [...removed, sectionId] };
193
192
  }
194
193
 
195
- // src/lib/brand-chrome.ts
196
- var BRAND_NAME_KEY = "__ohw_brand_name";
197
- var BRAND_TITLE_KEY = "__ohw_site_title";
198
- var BRAND_FAVICON_LETTER_KEY = "__ohw_favicon_letter";
199
- var BRAND_CHROME_KEYS = /* @__PURE__ */ new Set([
200
- BRAND_NAME_KEY,
201
- BRAND_TITLE_KEY,
202
- BRAND_FAVICON_LETTER_KEY
203
- ]);
204
- function upsertMeta(selector, attr, token, value) {
205
- let el = document.head.querySelector(selector);
206
- if (!el) {
207
- el = document.createElement("meta");
208
- el.setAttribute(attr, token);
209
- document.head.appendChild(el);
210
- }
211
- if (el.getAttribute("content") !== value) el.setAttribute("content", value);
212
- }
213
- function escapeXml(value) {
214
- return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
215
- }
216
- function applyLetterFavicon(letter) {
217
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="12" fill="#111827"/><text x="32" y="46" font-family="system-ui,-apple-system,Segoe UI,sans-serif" font-size="40" font-weight="700" text-anchor="middle" fill="#ffffff">${escapeXml(letter)}</text></svg>`;
218
- const href = `data:image/svg+xml,${encodeURIComponent(svg)}`;
219
- let link = document.head.querySelector('link[rel="icon"]');
220
- if (!link) {
221
- link = document.createElement("link");
222
- link.rel = "icon";
223
- document.head.appendChild(link);
224
- }
225
- link.type = "image/svg+xml";
226
- if (link.href !== href) link.href = href;
227
- }
228
- function applyBrandChrome(content) {
229
- const name = content[BRAND_NAME_KEY];
230
- if (typeof name === "string" && name.length > 0) {
231
- document.querySelectorAll("[data-ohw-wordmark]").forEach((el) => {
232
- if (el.textContent !== name) el.textContent = name;
233
- if (el.getAttribute("title") !== name) el.setAttribute("title", name);
234
- });
235
- }
236
- const title = content[BRAND_TITLE_KEY];
237
- if (typeof title === "string" && title.length > 0) {
238
- if (document.title !== title) document.title = title;
239
- upsertMeta('meta[property="og:title"]', "property", "og:title", title);
240
- upsertMeta('meta[name="twitter:title"]', "name", "twitter:title", title);
241
- }
242
- const letter = content[BRAND_FAVICON_LETTER_KEY];
243
- if (typeof letter === "string" && letter.length > 0) {
244
- applyLetterFavicon(letter);
245
- }
246
- }
247
-
248
194
  // src/ui/ai-tree/aiSectionsManager.tsx
249
195
  var import_react_dom = require("react-dom");
250
196
  var import_client = require("react-dom/client");
@@ -289,17 +235,13 @@ function MediaBox({
289
235
  const url = refValue ? ctx.resolveMedia(refValue) : null;
290
236
  const isIcon = /^(lucide|simple):/.test(refValue);
291
237
  const aspectRatio = aspect && /^\d+:\d+$/.test(aspect) ? aspect.replace(":", " / ") : void 0;
292
- const editAttrs = ctx.keyFor && editPath ? {
293
- "data-ohw-key": ctx.keyFor(editPath),
294
- "data-ohw-editable": isIcon ? "icon" : "image"
295
- } : {};
238
+ const editAttrs = ctx.keyFor && editPath && !isIcon ? { "data-ohw-key": ctx.keyFor(editPath), "data-ohw-editable": "image" } : {};
296
239
  if (isIcon) {
297
240
  const Icon = refValue.startsWith("lucide:") ? lucideByName(refValue.slice(7)) : null;
298
241
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
299
242
  "span",
300
243
  {
301
244
  "data-ai-icon": refValue,
302
- ...editAttrs,
303
245
  style: {
304
246
  display: "inline-flex",
305
247
  width: 48,
@@ -2084,7 +2026,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
2084
2026
  const autoId = (0, import_react5.useId)();
2085
2027
  const insertAfter = insertAfterProp ?? autoId;
2086
2028
  const [schedule, setSchedule] = (0, import_react5.useState)(null);
2087
- const [loading, setLoading] = (0, import_react5.useState)(initialScheduleId !== null);
2029
+ const [loading, setLoading] = (0, import_react5.useState)(true);
2088
2030
  const [inEditor, setInEditor] = (0, import_react5.useState)(false);
2089
2031
  const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
2090
2032
  const [modalState, setModalState] = (0, import_react5.useState)(null);
@@ -2258,10 +2200,8 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
2258
2200
  "*"
2259
2201
  );
2260
2202
  };
2203
+ if (!inEditor && !loading && !schedule) return null;
2261
2204
  const sectionId = `scheduling-${insertAfter}`;
2262
- if (!inEditor && !loading && !schedule) {
2263
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { "data-ohw-section": sectionId, "data-ohw-scheduling-anchor": insertAfter, style: { display: "none" } });
2264
- }
2265
2205
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2266
2206
  "section",
2267
2207
  {
@@ -5995,7 +5935,6 @@ function ToolbarActionTooltip({
5995
5935
  function ItemActionToolbar({
5996
5936
  onEditLink,
5997
5937
  onAddItem,
5998
- onStyle,
5999
5938
  onSelectParent,
6000
5939
  onDuplicate,
6001
5940
  onDelete,
@@ -6007,8 +5946,6 @@ function ItemActionToolbar({
6007
5946
  deleteDisabled = false,
6008
5947
  showEditLink = true,
6009
5948
  showAddItem = true,
6010
- showStyle = false,
6011
- styleActive = false,
6012
5949
  showMore = true,
6013
5950
  tooltipSide = "bottom",
6014
5951
  dropdownOpen = null,
@@ -6082,22 +6019,6 @@ function ItemActionToolbar({
6082
6019
  children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Link, { className: "size-4 shrink-0", "aria-hidden": true })
6083
6020
  }
6084
6021
  ) : null,
6085
- showStyle ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6086
- ToolbarActionTooltip,
6087
- {
6088
- label: "Style",
6089
- side: tooltipSide,
6090
- buttonProps: {
6091
- active: styleActive,
6092
- onMouseDown: (e) => {
6093
- e.preventDefault();
6094
- e.stopPropagation();
6095
- onStyle?.();
6096
- }
6097
- },
6098
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Brush, { className: "size-4 shrink-0", "aria-hidden": true })
6099
- }
6100
- ) : null,
6101
6022
  showAddItem ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6102
6023
  ToolbarActionTooltip,
6103
6024
  {
@@ -9604,445 +9525,6 @@ function deleteNavbarItem(sourceAnchor) {
9604
9525
  };
9605
9526
  }
9606
9527
 
9607
- // src/lib/icon-markup.ts
9608
- var GLYPH_SELECTOR = "svg, img";
9609
- function referenceBox(slot) {
9610
- const row = slot.closest("[data-ohw-socials-row]") ?? slot.closest("a")?.parentElement ?? null;
9611
- const neighbour = row ? Array.from(row.querySelectorAll('[data-ohw-editable="icon"]')).find((el) => el !== slot) : null;
9612
- const source = (neighbour ?? slot).querySelector(GLYPH_SELECTOR);
9613
- const box = source?.getBoundingClientRect() ?? null;
9614
- return box?.width && box.height ? box : null;
9615
- }
9616
- function iconMarkupSizedFor(slot, markup) {
9617
- const box = referenceBox(slot);
9618
- if (!box) return markup;
9619
- const holder = document.createElement("div");
9620
- holder.innerHTML = markup;
9621
- const glyph = holder.querySelector(GLYPH_SELECTOR);
9622
- if (!glyph) return markup;
9623
- glyph.style.width = `${Math.round(box.width)}px`;
9624
- glyph.style.height = `${Math.round(box.height)}px`;
9625
- return holder.innerHTML;
9626
- }
9627
- function applyIconMarkup(slot, markup) {
9628
- if (!markup) return;
9629
- const coloured = iconMarkupInheritingColour(markup);
9630
- const sized = iconMarkupSizedFor(slot, coloured);
9631
- if (slot.innerHTML !== sized) slot.innerHTML = sized;
9632
- if (sized === coloured) {
9633
- requestAnimationFrame(() => {
9634
- if (!slot.isConnected) return;
9635
- const resized = iconMarkupSizedFor(slot, coloured);
9636
- if (resized !== coloured && slot.innerHTML !== resized) slot.innerHTML = resized;
9637
- });
9638
- }
9639
- }
9640
- function detectIconStyle(el) {
9641
- const row = el.closest("[data-ohw-socials-row]");
9642
- const glyphs = Array.from((row ?? el).querySelectorAll("svg"));
9643
- const outlined = glyphs.some((svg) => {
9644
- return Array.from(svg.querySelectorAll("*")).some((node) => {
9645
- return node.getAttribute("stroke") !== null && node.getAttribute("stroke") !== "none";
9646
- });
9647
- });
9648
- return outlined ? "outline" : "fill";
9649
- }
9650
- function iconMarkupInheritingColour(markup) {
9651
- const holder = document.createElement("div");
9652
- holder.innerHTML = markup;
9653
- holder.querySelectorAll("svg *").forEach((node) => {
9654
- if (node.getAttribute("fill") && node.getAttribute("fill") !== "none") {
9655
- node.setAttribute("fill", "currentColor");
9656
- }
9657
- if (node.getAttribute("stroke") && node.getAttribute("stroke") !== "none") {
9658
- node.setAttribute("stroke", "currentColor");
9659
- }
9660
- });
9661
- return holder.innerHTML;
9662
- }
9663
-
9664
- // src/lib/socials-items.ts
9665
- var ICON_SELECTOR = '[data-ohw-editable="icon"]';
9666
- var SOCIAL_KEY_RE = /(^|-)social(s)?(-|$)/i;
9667
- var SOCIALS_ROW_ATTR = "data-ohw-socials-row";
9668
- var SOCIALS_ITEM_ATTR = "data-ohw-social-item";
9669
- function isSocialItem(el) {
9670
- if (!el) return false;
9671
- const anchor = el instanceof HTMLAnchorElement ? el : el.closest("a");
9672
- if (!anchor) return false;
9673
- if (SOCIAL_KEY_RE.test(anchor.getAttribute("data-ohw-href-key") ?? "")) return true;
9674
- return anchor.querySelectorAll(ICON_SELECTOR).length === 1;
9675
- }
9676
- function getSocialItem(el) {
9677
- const anchor = el.closest("a");
9678
- return isSocialItem(anchor) ? anchor : null;
9679
- }
9680
- function findSocialsRow(el) {
9681
- const item = getSocialItem(el);
9682
- if (!item) return null;
9683
- const wrapper = item.parentElement;
9684
- const row = wrapper && wrapper.querySelectorAll("a").length === 1 && wrapper.matches("li, div, span") ? wrapper.parentElement : wrapper;
9685
- if (!row) return null;
9686
- const anchors = Array.from(row.querySelectorAll("a"));
9687
- if (!anchors.length || !anchors.every((anchor) => isSocialItem(anchor))) return null;
9688
- return row;
9689
- }
9690
- function isSocialsRow(el) {
9691
- const anchors = Array.from(el.querySelectorAll("a"));
9692
- return anchors.length > 0 && anchors.every((anchor) => isSocialItem(anchor));
9693
- }
9694
- function listSocialItems(row) {
9695
- return Array.from(row.children).map((child) => {
9696
- if (!(child instanceof HTMLElement)) return null;
9697
- const anchor = child.matches("a") ? child : child.querySelector("a");
9698
- return isSocialItem(anchor) ? anchor : null;
9699
- }).filter((item) => item !== null);
9700
- }
9701
- function socialRowUnit(item) {
9702
- const row = findSocialsRow(item);
9703
- let node = item;
9704
- while (node.parentElement && node.parentElement !== row) {
9705
- node = node.parentElement;
9706
- }
9707
- return node;
9708
- }
9709
- function listSocialsRows(root = document) {
9710
- const rows = /* @__PURE__ */ new Set();
9711
- root.querySelectorAll(`${ICON_SELECTOR}, a[data-ohw-href-key]`).forEach((el) => {
9712
- const row = findSocialsRow(el);
9713
- if (row) rows.add(row);
9714
- });
9715
- root.querySelectorAll(`[${SOCIALS_ROW_ATTR}]`).forEach((row) => rows.add(row));
9716
- return Array.from(rows);
9717
- }
9718
- var rowTemplates = /* @__PURE__ */ new Map();
9719
- function markSocialsRows(root = document) {
9720
- root.querySelectorAll(`[${SOCIALS_ITEM_ATTR}]`).forEach((item) => {
9721
- item.removeAttribute(SOCIALS_ITEM_ATTR);
9722
- });
9723
- listSocialsRows(root).forEach((row) => {
9724
- row.setAttribute(SOCIALS_ROW_ATTR, "");
9725
- const items = listSocialItems(row);
9726
- if (items[0]) rowTemplates.set(rowKeyOf(row), socialRowUnit(items[0]).outerHTML);
9727
- items.forEach((item, index) => {
9728
- item.setAttribute(SOCIALS_ITEM_ATTR, String(index));
9729
- const iconKey = socialIconKey(item);
9730
- if (iconKey) ensureLabelSlot(item, iconKey);
9731
- });
9732
- });
9733
- }
9734
- var SOCIALS_LABEL_ATTR = "data-ohw-social-label";
9735
- function ensureLabelSlot(item, iconKey) {
9736
- if (socialLabelElement(item)) return;
9737
- const label = document.createElement("span");
9738
- label.setAttribute("data-ohw-key", `${iconKey}-label`);
9739
- label.setAttribute("data-ohw-editable", "text");
9740
- label.setAttribute(SOCIALS_LABEL_ATTR, "");
9741
- label.style.display = "none";
9742
- label.textContent = item.getAttribute("aria-label") ?? "";
9743
- item.appendChild(label);
9744
- }
9745
- function socialLabelElement(item) {
9746
- return item.querySelector(
9747
- `[${SOCIALS_LABEL_ATTR}], [data-ohw-editable="text"], [data-ohw-editable="plain"]`
9748
- );
9749
- }
9750
- function socialLabelKey(iconKey) {
9751
- return `${iconKey}-label`;
9752
- }
9753
- function applyStoredValues(item, content) {
9754
- const hrefKey = socialHrefKey(item);
9755
- const iconKey = socialIconKey(item);
9756
- if (hrefKey && content[hrefKey] !== void 0) item.setAttribute("href", content[hrefKey]);
9757
- if (iconKey) {
9758
- const glyph = item.querySelector(ICON_SELECTOR);
9759
- if (glyph && content[iconKey]) applyIconMarkup(glyph, content[iconKey]);
9760
- const label = item.querySelector(`[${SOCIALS_LABEL_ATTR}]`);
9761
- label?.setAttribute("data-ohw-key", socialLabelKey(iconKey));
9762
- const stored = content[socialLabelKey(iconKey)];
9763
- if (label && stored) label.textContent = stored;
9764
- }
9765
- }
9766
- function socialPlatformKey(iconKey) {
9767
- return `${iconKey}-platform`;
9768
- }
9769
- function socialHrefKey(item) {
9770
- return item.getAttribute("data-ohw-href-key");
9771
- }
9772
- function socialIconKey(item) {
9773
- return item.querySelector(ICON_SELECTOR)?.dataset.ohwKey ?? null;
9774
- }
9775
- var SOCIALS_ORDER_KEY = "__ohw_socials_order";
9776
- function fromMarkup(markup) {
9777
- const holder = document.createElement("div");
9778
- holder.innerHTML = markup;
9779
- return holder.firstElementChild instanceof HTMLElement ? holder.firstElementChild : null;
9780
- }
9781
- var rowKeys = /* @__PURE__ */ new WeakMap();
9782
- function rowKeyOf(row) {
9783
- const first = listSocialItems(row)[0];
9784
- const itemKey = first ? socialIconKey(first) ?? socialHrefKey(first)?.replace(/-href$/, "") : null;
9785
- const derived = itemKey?.replace(/-[^-]+$/, "") || null;
9786
- if (derived) rowKeys.set(row, derived);
9787
- return derived ?? rowKeys.get(row) ?? "social";
9788
- }
9789
- function getSocialsOrderFromDom(root = document) {
9790
- const order = {};
9791
- listSocialsRows(root).forEach((row) => {
9792
- order[rowKeyOf(row)] = listSocialItems(row).map((item) => socialHrefKey(item)).filter((key) => Boolean(key));
9793
- });
9794
- return order;
9795
- }
9796
- function hasStoredValue(content, hrefKey) {
9797
- const iconKey = hrefKey.replace(/-href$/, "");
9798
- return Boolean(content[hrefKey]) || Boolean(content[iconKey]);
9799
- }
9800
- function parseSocialsOrder(raw) {
9801
- if (!raw) return null;
9802
- try {
9803
- const parsed = JSON.parse(raw);
9804
- return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
9805
- } catch {
9806
- return null;
9807
- }
9808
- }
9809
- function nextSocialIndex(row, rowKey, content) {
9810
- const used = listSocialItems(row).map((item) => socialHrefKey(item)).concat(Object.keys(content)).map((key) => key?.match(new RegExp(`^${rowKey}-(\\d+)`))?.[1]).map((digits) => digits === void 0 ? -1 : Number(digits));
9811
- return Math.max(-1, ...used) + 1;
9812
- }
9813
- function insertSocialItem(row, after, content = {}) {
9814
- const rowKey = rowKeyOf(row);
9815
- const template = listSocialItems(row)[0];
9816
- const remembered = rowTemplates.get(rowKey);
9817
- if (!template && !remembered) return null;
9818
- const index = nextSocialIndex(row, rowKey, content);
9819
- const iconKey = `${rowKey}-${index}`;
9820
- const hrefKey = `${iconKey}-href`;
9821
- const templateUnit = template ? socialRowUnit(template) : null;
9822
- const unit = templateUnit ? templateUnit.cloneNode(true) : fromMarkup(remembered);
9823
- const item = unit && (unit.matches("a") ? unit : unit.querySelector("a"));
9824
- if (!unit || !item) return null;
9825
- item.setAttribute("data-ohw-href-key", hrefKey);
9826
- item.setAttribute("href", "");
9827
- item.removeAttribute("aria-label");
9828
- item.querySelectorAll("[data-ohw-hovered], [data-ohw-selected]").forEach((el) => {
9829
- el.removeAttribute("data-ohw-hovered");
9830
- el.removeAttribute("data-ohw-selected");
9831
- });
9832
- const icon = item.querySelector(ICON_SELECTOR);
9833
- icon?.setAttribute("data-ohw-key", iconKey);
9834
- item.querySelector(`[${SOCIALS_LABEL_ATTR}]`)?.remove();
9835
- const afterUnit = after ? socialRowUnit(after) : null;
9836
- if (afterUnit && afterUnit.parentElement === row) afterUnit.insertAdjacentElement("afterend", unit);
9837
- else row.appendChild(unit);
9838
- markSocialsRows(row.ownerDocument);
9839
- return { item, hrefKey, iconKey, order: getSocialsOrderFromDom(row.ownerDocument) };
9840
- }
9841
- function duplicateSocialItem(item, content) {
9842
- const row = findSocialsRow(item);
9843
- const created = row ? insertSocialItem(row, item, content) : null;
9844
- if (!created) return null;
9845
- const sourceHref = socialHrefKey(item);
9846
- const sourceIcon = socialIconKey(item);
9847
- const link = created.item;
9848
- if (sourceHref) link.setAttribute("href", item.getAttribute("href") ?? "");
9849
- const glyph = item.querySelector(ICON_SELECTOR)?.innerHTML;
9850
- if (glyph) {
9851
- const slot = link.querySelector(ICON_SELECTOR);
9852
- if (slot) slot.innerHTML = glyph;
9853
- }
9854
- return {
9855
- ...created,
9856
- copiedFrom: { href: sourceHref, icon: sourceIcon }
9857
- };
9858
- }
9859
- function removeSocialItem(item, content) {
9860
- const row = findSocialsRow(item);
9861
- if (!row) return null;
9862
- const hrefKey = socialHrefKey(item);
9863
- const iconKey = socialIconKey(item);
9864
- const removedKeys = [hrefKey, iconKey].filter((key) => Boolean(key));
9865
- if (!removedKeys.length) return null;
9866
- const previousOrder = getSocialsOrderFromDom(row.ownerDocument);
9867
- const previousContent = Object.fromEntries(
9868
- removedKeys.filter((key) => key in content).map((key) => [key, content[key]])
9869
- );
9870
- const unit = socialRowUnit(item);
9871
- const nextSibling = unit.nextElementSibling;
9872
- unit.remove();
9873
- markSocialsRows(row.ownerDocument);
9874
- return {
9875
- removedKeys,
9876
- previousContent,
9877
- order: getSocialsOrderFromDom(row.ownerDocument),
9878
- previousOrder,
9879
- undo: () => {
9880
- if (nextSibling) nextSibling.before(unit);
9881
- else row.appendChild(unit);
9882
- markSocialsRows(row.ownerDocument);
9883
- }
9884
- };
9885
- }
9886
- function applySocialsOrder(order, root = document) {
9887
- listSocialsRows(root).forEach((row) => {
9888
- const wanted = order[rowKeyOf(row)];
9889
- if (!wanted) return;
9890
- const byKey = new Map(listSocialItems(row).map((item) => [socialHrefKey(item), item]));
9891
- wanted.forEach((key) => {
9892
- const item = byKey.get(key);
9893
- if (item) row.appendChild(socialRowUnit(item));
9894
- });
9895
- });
9896
- markSocialsRows(root);
9897
- }
9898
- function reconcileSocialsFromContent(content, root = document) {
9899
- markSocialsRows(root);
9900
- const stored = parseSocialsOrder(content[SOCIALS_ORDER_KEY]);
9901
- if (!stored) return;
9902
- listSocialsRows(root).forEach((row) => {
9903
- const wanted = stored[rowKeyOf(row)];
9904
- if (!wanted) return;
9905
- if (!wanted.length) return;
9906
- wanted.forEach((key) => {
9907
- if (listSocialItems(row).some((item) => socialHrefKey(item) === key)) return;
9908
- if (!hasStoredValue(content, key)) return;
9909
- const created = insertSocialItem(row, null, content);
9910
- if (created) {
9911
- created.item.setAttribute("data-ohw-href-key", key);
9912
- created.item.querySelector(ICON_SELECTOR)?.setAttribute("data-ohw-key", key.replace(/-href$/, ""));
9913
- applyStoredValues(created.item, content);
9914
- }
9915
- });
9916
- const present = listSocialItems(row);
9917
- const surviving = present.filter((item) => {
9918
- const key = socialHrefKey(item);
9919
- return !key || wanted.includes(key);
9920
- });
9921
- if (surviving.length) {
9922
- present.forEach((item) => {
9923
- if (!surviving.includes(item)) socialRowUnit(item).remove();
9924
- });
9925
- }
9926
- });
9927
- applySocialsOrder(stored, root);
9928
- }
9929
- var DROP_BAR_THICKNESS = 3;
9930
- function buildSocialDropSlots(row) {
9931
- const items = listSocialItems(row);
9932
- if (!items.length) return [];
9933
- return items.concat(items[items.length - 1]).map((item, index) => {
9934
- const rect = item.getBoundingClientRect();
9935
- const left = (index === items.length ? rect.right : rect.left) - DROP_BAR_THICKNESS / 2;
9936
- return {
9937
- insertIndex: index,
9938
- columnIndex: -1,
9939
- left,
9940
- top: rect.top,
9941
- width: DROP_BAR_THICKNESS,
9942
- height: rect.height,
9943
- direction: "vertical"
9944
- };
9945
- });
9946
- }
9947
- function findSocialByHrefKey(hrefKey, root = document) {
9948
- const el = root.querySelector(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`);
9949
- return el ? getSocialItem(el) : null;
9950
- }
9951
- function buildSocialDropSlotsForKey(hrefKey, root = document) {
9952
- const item = findSocialByHrefKey(hrefKey, root);
9953
- const row = item ? findSocialsRow(item) : null;
9954
- return row ? buildSocialDropSlots(row) : [];
9955
- }
9956
- function hitTestSocialDropSlot(clientX, clientY, draggedHrefKey, root = document) {
9957
- const distanceTo = (slot) => {
9958
- const dx = clientX - (slot.left + slot.width / 2);
9959
- const dy = clientY < slot.top ? slot.top - clientY : Math.max(0, clientY - (slot.top + slot.height));
9960
- return Math.hypot(dx, dy);
9961
- };
9962
- const slots = buildSocialDropSlotsForKey(draggedHrefKey, root);
9963
- return slots.reduce((best, slot) => {
9964
- return !best || distanceTo(slot) < distanceTo(best) ? slot : best;
9965
- }, null);
9966
- }
9967
- function planSocialMove(hrefKey, insertIndex, root = document) {
9968
- const item = findSocialByHrefKey(hrefKey, root);
9969
- const row = item ? findSocialsRow(item) : null;
9970
- if (!row) return null;
9971
- const order = getSocialsOrderFromDom(root);
9972
- const key = rowKeyOf(row);
9973
- const current = order[key];
9974
- if (!current) return null;
9975
- const from = current.indexOf(hrefKey);
9976
- if (from < 0) return null;
9977
- const next = current.filter((_, index) => index !== from);
9978
- next.splice(insertIndex > from ? insertIndex - 1 : insertIndex, 0, hrefKey);
9979
- return { ...order, [key]: next };
9980
- }
9981
- var SOCIALS_DISPLAY_KEY = "__ohw_socials_display";
9982
- function readSocialsDisplay(row) {
9983
- const items = listSocialItems(row);
9984
- const visible = (el) => Boolean(el) && el.style.display !== "none" && el.getAttribute("data-ohw-hidden") === null;
9985
- return {
9986
- text: items.some((item) => visible(socialLabelElement(item))),
9987
- icon: items.some((item) => visible(item.querySelector(ICON_SELECTOR)))
9988
- };
9989
- }
9990
- function parseSocialsDisplay(raw) {
9991
- if (!raw) return null;
9992
- try {
9993
- const parsed = JSON.parse(raw);
9994
- return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
9995
- } catch {
9996
- return null;
9997
- }
9998
- }
9999
- function socialsDisplayFor(row, content) {
10000
- return parseSocialsDisplay(content[SOCIALS_DISPLAY_KEY])?.[rowKeyOf(row)] ?? readSocialsDisplay(row);
10001
- }
10002
- function socialsDisplayWith(row, display, content) {
10003
- return { ...parseSocialsDisplay(content[SOCIALS_DISPLAY_KEY]) ?? {}, [rowKeyOf(row)]: display };
10004
- }
10005
- function applySocialsDisplayToRow(row, display) {
10006
- listSocialItems(row).forEach((item) => {
10007
- const label = socialLabelElement(item);
10008
- const icon = item.querySelector(ICON_SELECTOR);
10009
- if (label) label.style.display = display.text ? "" : "none";
10010
- if (icon) icon.style.display = display.icon ? "" : "none";
10011
- });
10012
- }
10013
- function applySocialsDisplayFromContent(content, root = document) {
10014
- const stored = parseSocialsDisplay(content[SOCIALS_DISPLAY_KEY]);
10015
- if (!stored) return;
10016
- listSocialsRows(root).forEach((row) => {
10017
- const display = stored[rowKeyOf(row)];
10018
- if (!display) return;
10019
- if (display.icon) {
10020
- listSocialItems(row).forEach((item) => {
10021
- const iconKey = ensureIconSlot(item);
10022
- const slot = item.querySelector(ICON_SELECTOR);
10023
- if (iconKey && slot && content[iconKey]) applyIconMarkup(slot, content[iconKey]);
10024
- });
10025
- }
10026
- applySocialsDisplayToRow(row, display);
10027
- });
10028
- }
10029
- function socialsMissingIcons(row) {
10030
- return listSocialItems(row).filter((item) => !item.querySelector(ICON_SELECTOR)).map((item) => ({ hrefKey: socialHrefKey(item) ?? "", url: item.getAttribute("href") ?? "" })).filter((entry) => Boolean(entry.hrefKey));
10031
- }
10032
- function ensureIconSlot(item) {
10033
- const existing = item.querySelector(ICON_SELECTOR);
10034
- if (existing) return existing.dataset.ohwKey ?? null;
10035
- const hrefKey = socialHrefKey(item);
10036
- if (!hrefKey) return null;
10037
- const iconKey = hrefKey.replace(/-href$/, "");
10038
- const slot = document.createElement("span");
10039
- slot.setAttribute("data-ohw-key", iconKey);
10040
- slot.setAttribute("data-ohw-editable", "icon");
10041
- slot.style.display = "inline-flex";
10042
- item.prepend(slot);
10043
- return iconKey;
10044
- }
10045
-
10046
9528
  // src/lib/footer-items.ts
10047
9529
  var FOOTER_ORDER_KEY = "__ohw_footer_order";
10048
9530
  var MAX_FOOTER_COLUMNS = 18;
@@ -10887,329 +10369,6 @@ function deleteFooterColumn(column) {
10887
10369
  };
10888
10370
  }
10889
10371
 
10890
- // src/lib/logo-identity.ts
10891
- var LOGO_TEXT_KEYS = ["nav-logo-text", "footer-logo-text", "logo-text"];
10892
- var LOGO_IMAGE_KEYS = ["nav-logo-image", "footer-logo", "footer-logo-image"];
10893
- var LOGO_HREF_KEYS = ["nav-logo-href", "footer-logo-href", "logo-href"];
10894
- var LOGO_PLACEHOLDER_KEY = "logo-is-placeholder";
10895
- var LOGO_ALT_KEY = "logo-alt";
10896
- var LOGO_IMAGE_URL_KEY = "nav-logo-image";
10897
- var PLACEHOLDER_BUSINESS_NAME = "Business name";
10898
- function resolveLogoDisplayText(text) {
10899
- const trimmed = (text ?? "").trim();
10900
- return trimmed || PLACEHOLDER_BUSINESS_NAME;
10901
- }
10902
- function isFooterLogoRoot(root) {
10903
- return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
10904
- }
10905
- function imageKeyForRoot(root) {
10906
- return isFooterLogoRoot(root) ? "footer-logo" : "nav-logo-image";
10907
- }
10908
- function textKeyForRoot(root) {
10909
- return isFooterLogoRoot(root) ? "footer-logo-text" : "nav-logo-text";
10910
- }
10911
- function ensureLogoHrefKey(root) {
10912
- if (!(root instanceof HTMLAnchorElement)) return;
10913
- if (root.hasAttribute("data-ohw-href-key")) return;
10914
- root.setAttribute("data-ohw-href-key", isFooterLogoRoot(root) ? "footer-logo-href" : "nav-logo-href");
10915
- }
10916
- function applyLogoIdentity(text, isPlaceholder) {
10917
- const display = resolveLogoDisplayText(text);
10918
- const placeholder = isPlaceholder || !text.trim() || display === PLACEHOLDER_BUSINESS_NAME;
10919
- for (const key of LOGO_TEXT_KEYS) {
10920
- document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
10921
- if (el.textContent !== display) el.textContent = display;
10922
- });
10923
- }
10924
- for (const key of LOGO_IMAGE_KEYS) {
10925
- document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
10926
- const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
10927
- if (img) img.alt = display;
10928
- });
10929
- }
10930
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((el) => {
10931
- if (placeholder) el.setAttribute("data-ohw-placeholder", "");
10932
- else el.removeAttribute("data-ohw-placeholder");
10933
- });
10934
- return display;
10935
- }
10936
- function applyLogoImage(url, alt) {
10937
- const displayAlt = resolveLogoDisplayText(alt);
10938
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
10939
- ensureLogoHrefKey(root);
10940
- const imageKey = imageKeyForRoot(root);
10941
- const textKey = textKeyForRoot(root);
10942
- let img = root.querySelector(`img[data-ohw-key="${imageKey}"]`) ?? (root.querySelector(`[data-ohw-key="${imageKey}"]`) instanceof HTMLImageElement ? root.querySelector(`[data-ohw-key="${imageKey}"]`) : null) ?? root.querySelector("img");
10943
- let textEl = root.querySelector(`[data-ohw-key="${textKey}"]`) ?? root.querySelector('[data-ohw-key="logo-text"]');
10944
- if (url) {
10945
- if (!img) {
10946
- img = document.createElement("img");
10947
- img.setAttribute("data-ohw-editable", "image");
10948
- img.setAttribute("data-ohw-key", imageKey);
10949
- img.alt = displayAlt;
10950
- img.style.height = "";
10951
- img.style.maxHeight = "none";
10952
- img.style.width = "auto";
10953
- img.style.display = "block";
10954
- img.style.objectFit = "contain";
10955
- root.insertBefore(img, root.firstChild);
10956
- } else {
10957
- img.setAttribute("data-ohw-editable", "image");
10958
- img.setAttribute("data-ohw-key", imageKey);
10959
- }
10960
- img.removeAttribute("srcset");
10961
- img.removeAttribute("sizes");
10962
- img.src = url;
10963
- img.alt = displayAlt;
10964
- img.style.display = "block";
10965
- if (textEl) textEl.style.display = "none";
10966
- root.removeAttribute("data-ohw-placeholder");
10967
- return;
10968
- }
10969
- if (img) {
10970
- img.removeAttribute("src");
10971
- img.removeAttribute("srcset");
10972
- img.removeAttribute("sizes");
10973
- img.alt = displayAlt;
10974
- img.style.display = "none";
10975
- }
10976
- if (!textEl) {
10977
- textEl = document.createElement("span");
10978
- textEl.setAttribute("data-ohw-editable", "plain");
10979
- textEl.setAttribute("data-ohw-key", textKey);
10980
- root.appendChild(textEl);
10981
- }
10982
- textEl.style.display = "";
10983
- if (textEl.textContent !== displayAlt) textEl.textContent = displayAlt;
10984
- if (!displayAlt.trim() || displayAlt === PLACEHOLDER_BUSINESS_NAME) {
10985
- root.setAttribute("data-ohw-placeholder", "");
10986
- } else {
10987
- root.removeAttribute("data-ohw-placeholder");
10988
- }
10989
- });
10990
- }
10991
- function applyLogoHref(href) {
10992
- const target = href.trim() || "/";
10993
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
10994
- ensureLogoHrefKey(root);
10995
- if (root instanceof HTMLAnchorElement) {
10996
- root.setAttribute("href", target);
10997
- }
10998
- });
10999
- for (const key of LOGO_HREF_KEYS) setStoredLinkHref(key, target);
11000
- }
11001
- function readLogoIdentityFromDom() {
11002
- let imageUrl = null;
11003
- for (const key of LOGO_IMAGE_KEYS) {
11004
- const el = document.querySelector(`[data-ohw-key="${key}"]`);
11005
- const img = el instanceof HTMLImageElement ? el : el?.querySelector("img");
11006
- const attrSrc = img?.getAttribute("src")?.trim() ?? "";
11007
- if (attrSrc && !attrSrc.startsWith("data:") && img && img.style.display !== "none") {
11008
- imageUrl = img.currentSrc || img.src;
11009
- break;
11010
- }
11011
- }
11012
- let text = PLACEHOLDER_BUSINESS_NAME;
11013
- let isPlaceholder = true;
11014
- for (const key of LOGO_TEXT_KEYS) {
11015
- const el = document.querySelector(`[data-ohw-key="${key}"]`);
11016
- if (el?.textContent?.trim()) {
11017
- text = el.textContent.trim();
11018
- const logoRoot2 = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
11019
- isPlaceholder = logoRoot2?.hasAttribute("data-ohw-placeholder") === true || text === PLACEHOLDER_BUSINESS_NAME;
11020
- break;
11021
- }
11022
- }
11023
- if (imageUrl) {
11024
- const logoImg = document.querySelector(
11025
- '[data-ohw-key="nav-logo-image"], [data-ohw-key="footer-logo"]'
11026
- );
11027
- const alt = logoImg?.alt?.trim() || text;
11028
- isPlaceholder = false;
11029
- const hrefEl = document.querySelector(
11030
- 'a[data-ohw-role="logo"], a[data-ohw-logo], [data-ohw-role="logo"]'
11031
- );
11032
- const href2 = (hrefEl instanceof HTMLAnchorElement ? hrefEl.getAttribute("href") : null) || hrefEl?.closest("a")?.getAttribute("href") || "/";
11033
- return { text, isPlaceholder, imageUrl, href: href2, alt };
11034
- }
11035
- const logoRoot = document.querySelector('[data-ohw-role="logo"], [data-ohw-logo]');
11036
- const href = (logoRoot instanceof HTMLAnchorElement ? logoRoot.getAttribute("href") : null) || logoRoot?.closest("a")?.getAttribute("href") || "/";
11037
- return { text, isPlaceholder, imageUrl: null, href, alt: text };
11038
- }
11039
- function applyLogoFromContent(content) {
11040
- const hasLogoIdentity = LOGO_PLACEHOLDER_KEY in content || LOGO_TEXT_KEYS.some((key) => key in content) || LOGO_IMAGE_KEYS.some((key) => key in content) || LOGO_ALT_KEY in content || LOGO_HREF_KEYS.some((key) => key in content);
11041
- if (!hasLogoIdentity) return false;
11042
- const logoText = content[LOGO_TEXT_KEYS[0]] ?? content[LOGO_TEXT_KEYS[1]] ?? readLogoIdentityFromDom().text;
11043
- const logoAlt = content[LOGO_ALT_KEY] ?? logoText;
11044
- const rawLogoImage = content[LOGO_IMAGE_URL_KEY] ?? content["footer-logo"] ?? content["footer-logo-image"] ?? null;
11045
- const logoImageUrl = typeof rawLogoImage === "string" && rawLogoImage.trim() ? rawLogoImage.trim() : null;
11046
- const imageExplicitlyCleared = LOGO_IMAGE_KEYS.some((key) => key in content) && !logoImageUrl;
11047
- const logoIsPlaceholder = LOGO_PLACEHOLDER_KEY in content ? content[LOGO_PLACEHOLDER_KEY] !== "false" : !logoImageUrl && (!logoText.trim() || logoText === PLACEHOLDER_BUSINESS_NAME);
11048
- if (logoImageUrl) {
11049
- applyLogoImage(logoImageUrl, logoAlt);
11050
- } else {
11051
- if (imageExplicitlyCleared) applyLogoImage(null, logoAlt);
11052
- applyLogoIdentity(logoText, logoIsPlaceholder);
11053
- }
11054
- const logoHref = content["nav-logo-href"] ?? content["footer-logo-href"] ?? content["logo-href"];
11055
- if (typeof logoHref === "string" && logoHref.trim()) {
11056
- applyLogoHref(logoHref);
11057
- }
11058
- return true;
11059
- }
11060
-
11061
- // src/lib/logo-size.ts
11062
- var LOGO_SIZE_DEFAULTS = {
11063
- navbar: 28,
11064
- footer: 32
11065
- };
11066
- var LOGO_SIZE_MIN = 16;
11067
- var LOGO_SIZE_MAX = 80;
11068
- var LOGO_SIZE_DESKTOP_KEYS = {
11069
- navbar: "nav-logo-size",
11070
- footer: "footer-logo-size"
11071
- };
11072
- var LOGO_SIZE_MOBILE_KEYS = {
11073
- navbar: "nav-logo-size-mobile",
11074
- footer: "footer-logo-size-mobile"
11075
- };
11076
- var LOGO_SIZE_KEYS = [
11077
- LOGO_SIZE_DESKTOP_KEYS.navbar,
11078
- LOGO_SIZE_DESKTOP_KEYS.footer,
11079
- LOGO_SIZE_MOBILE_KEYS.navbar,
11080
- LOGO_SIZE_MOBILE_KEYS.footer
11081
- ];
11082
- function isFooterLogoRoot2(root) {
11083
- return Boolean(root.closest("footer") || root.closest('[data-ohw-section="footer"]'));
11084
- }
11085
- function getLogoPlacement(root) {
11086
- return isFooterLogoRoot2(root) ? "footer" : "navbar";
11087
- }
11088
- function parseLogoSizePx(raw, fallback) {
11089
- if (raw == null || raw === "") return fallback;
11090
- const n = Number.parseFloat(raw);
11091
- if (!Number.isFinite(n)) return fallback;
11092
- return Math.min(LOGO_SIZE_MAX, Math.max(LOGO_SIZE_MIN, Math.round(n)));
11093
- }
11094
- function isMobileLogoSizeFollowing(content, placement) {
11095
- const raw = content[LOGO_SIZE_MOBILE_KEYS[placement]];
11096
- return raw == null || raw.trim() === "";
11097
- }
11098
- function resolveDesktopLogoSize(content, placement) {
11099
- return parseLogoSizePx(content[LOGO_SIZE_DESKTOP_KEYS[placement]], LOGO_SIZE_DEFAULTS[placement]);
11100
- }
11101
- function resolveMobileLogoSize(content, placement) {
11102
- if (isMobileLogoSizeFollowing(content, placement)) {
11103
- return resolveDesktopLogoSize(content, placement);
11104
- }
11105
- return parseLogoSizePx(
11106
- content[LOGO_SIZE_MOBILE_KEYS[placement]],
11107
- resolveDesktopLogoSize(content, placement)
11108
- );
11109
- }
11110
- function setRootSizeVars(root, desktopPx, mobilePx, following) {
11111
- root.style.setProperty("--ohw-logo-size", `${desktopPx}px`);
11112
- if (following) {
11113
- root.style.removeProperty("--ohw-logo-size-mobile");
11114
- } else {
11115
- root.style.setProperty("--ohw-logo-size-mobile", `${mobilePx}px`);
11116
- }
11117
- root.querySelectorAll("img").forEach((img) => {
11118
- img.style.height = "";
11119
- img.style.maxHeight = "none";
11120
- img.style.width = "auto";
11121
- img.style.objectFit = "contain";
11122
- });
11123
- }
11124
- function applyLogoSizes(content) {
11125
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
11126
- const placement = getLogoPlacement(root);
11127
- const desktop = resolveDesktopLogoSize(content, placement);
11128
- const following = isMobileLogoSizeFollowing(content, placement);
11129
- const mobile = following ? desktop : resolveMobileLogoSize(content, placement);
11130
- setRootSizeVars(root, desktop, mobile, following);
11131
- });
11132
- }
11133
- function applyLogoSizeToPlacement(placement, desktopPx, mobilePx, following) {
11134
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]').forEach((root) => {
11135
- if (getLogoPlacement(root) !== placement) return;
11136
- setRootSizeVars(root, desktopPx, mobilePx, following);
11137
- });
11138
- }
11139
- function logoHasUploadedImage(logoEl) {
11140
- if (logoEl.hasAttribute("data-ohw-placeholder")) return false;
11141
- const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
11142
- if (!img) return false;
11143
- const src = img.getAttribute("src")?.trim() ?? "";
11144
- if (!src || src.startsWith("data:")) return false;
11145
- if (img.style.display === "none") return false;
11146
- return true;
11147
- }
11148
- function getLogoInteractionRect(logoEl) {
11149
- if (logoHasUploadedImage(logoEl)) {
11150
- const img = logoEl.querySelector('img[data-ohw-key="nav-logo-image"], img[data-ohw-key="footer-logo"], img[data-ohw-key="footer-logo-image"]') ?? logoEl.querySelector("img");
11151
- if (img) {
11152
- const r2 = img.getBoundingClientRect();
11153
- if (r2.width > 0 && r2.height > 0) return r2;
11154
- }
11155
- }
11156
- const text = logoEl.querySelector(
11157
- '[data-ohw-key="nav-logo-text"], [data-ohw-key="footer-logo-text"]'
11158
- );
11159
- if (text) {
11160
- const style = window.getComputedStyle(text);
11161
- if (style.display !== "none" && style.visibility !== "hidden") {
11162
- const r2 = text.getBoundingClientRect();
11163
- if (r2.width > 0 && r2.height > 0) return r2;
11164
- }
11165
- }
11166
- return logoEl.getBoundingClientRect();
11167
- }
11168
- function readLogoSizeState(content, placement) {
11169
- const desktopPx = resolveDesktopLogoSize(content, placement);
11170
- const mobileFollowing = isMobileLogoSizeFollowing(content, placement);
11171
- const mobilePx = mobileFollowing ? desktopPx : resolveMobileLogoSize(content, placement);
11172
- return { desktopPx, mobilePx, mobileFollowing };
11173
- }
11174
-
11175
- // src/lib/site-wide-scope.ts
11176
- function getLogoElement(el) {
11177
- const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
11178
- if (marked) return marked;
11179
- if (el.closest('[data-ohw-editable="icon"]')) return null;
11180
- const root = el.closest("nav, [data-ohw-nav-root], footer");
11181
- if (!root) return null;
11182
- const anchor = el.closest("a");
11183
- if (anchor && root.contains(anchor) && !anchor.hasAttribute("data-ohw-href-key") && !anchor.closest("[data-ohw-nav-container]") && Boolean(anchor.querySelector("img") || anchor.matches("img"))) {
11184
- return anchor;
11185
- }
11186
- const img = el.matches("img") ? el : null;
11187
- if (img && !img.closest("[data-ohw-href-key]") && !img.closest("[data-ohw-nav-container]") && (img.closest("footer") || img.closest("nav, [data-ohw-nav-root]"))) {
11188
- return img;
11189
- }
11190
- return null;
11191
- }
11192
- function isInFooter(el) {
11193
- if (!el) return false;
11194
- return Boolean(el.closest("footer") || el.closest('[data-ohw-section="footer"]'));
11195
- }
11196
- function isSiteWideElement(el) {
11197
- if (!el) return false;
11198
- if (getLogoElement(el)) return true;
11199
- if (isInFooter(el)) return true;
11200
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-root")) {
11201
- return true;
11202
- }
11203
- if (el.hasAttribute("data-ohw-href-key") && el.closest("nav, [data-ohw-nav-root], [data-ohw-nav-drawer], aside")) {
11204
- return true;
11205
- }
11206
- if (el.closest('[data-ohw-role="navbar-button"]')) return true;
11207
- return false;
11208
- }
11209
- function isSiteWideScopeActive(args) {
11210
- return isSiteWideElement(args.selected) || isSiteWideElement(args.hoveredItem) || isSiteWideElement(args.hoveredNavContainer) || isSiteWideElement(args.active);
11211
- }
11212
-
11213
10372
  // src/lib/add-footer-column.ts
11214
10373
  function buildFooterColumnEditContentPatch(result) {
11215
10374
  return {
@@ -11242,375 +10401,19 @@ function addFooterColumnWithPersist({
11242
10401
  return result;
11243
10402
  }
11244
10403
 
11245
- // src/ui/FloatingPanel.tsx
11246
- var import_react13 = require("react");
11247
- var import_lucide_react13 = require("lucide-react");
11248
- var import_jsx_runtime26 = require("react/jsx-runtime");
11249
- var PANEL_WIDTH = 256;
11250
- var EDGE_MARGIN = 16;
11251
- function getVisibleClip(parentScroll) {
11252
- const left = 0;
11253
- const right = window.innerWidth;
11254
- if (!parentScroll) {
11255
- return { top: 0, bottom: window.innerHeight, left, right };
10404
+ // src/lib/item-drag-interaction.ts
10405
+ function disableNativeHrefDrag(el) {
10406
+ if (el.draggable) el.draggable = false;
10407
+ if (el.getAttribute("draggable") !== "false") {
10408
+ el.setAttribute("draggable", "false");
11256
10409
  }
11257
- const { iframeOffsetTop, headerH: visibleCanvasTop, canvasH } = parentScroll;
11258
- const top = Math.max(0, visibleCanvasTop - iframeOffsetTop);
11259
- const bottom = Math.min(window.innerHeight, visibleCanvasTop + canvasH - iframeOffsetTop);
11260
- return { top, bottom: Math.max(top, bottom), left, right };
11261
10410
  }
11262
- function defaultFloatingPanelPosition(parentScroll, panelHeight = 280) {
11263
- const clip = getVisibleClip(parentScroll);
11264
- return {
11265
- x: Math.max(EDGE_MARGIN, clip.right - PANEL_WIDTH - EDGE_MARGIN),
11266
- y: Math.min(
11267
- Math.max(clip.top + EDGE_MARGIN, EDGE_MARGIN),
11268
- Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelHeight - EDGE_MARGIN)
11269
- )
11270
- };
10411
+ function clearTextSelection() {
10412
+ const sel = window.getSelection();
10413
+ if (sel && !sel.isCollapsed) sel.removeAllRanges();
11271
10414
  }
11272
- function clampPosition(pos, parentScroll, panelW, panelH) {
11273
- const clip = getVisibleClip(parentScroll);
11274
- const maxX = Math.max(clip.left + EDGE_MARGIN, clip.right - panelW - EDGE_MARGIN);
11275
- const maxY = Math.max(clip.top + EDGE_MARGIN, clip.bottom - panelH - EDGE_MARGIN);
11276
- return {
11277
- x: Math.min(Math.max(pos.x, clip.left + EDGE_MARGIN), maxX),
11278
- y: Math.min(Math.max(pos.y, clip.top + EDGE_MARGIN), maxY)
11279
- };
11280
- }
11281
- function FloatingPanel({
11282
- open,
11283
- title,
11284
- context,
11285
- icon,
11286
- onClose,
11287
- children,
11288
- position,
11289
- onPositionChange,
11290
- parentScroll = null,
11291
- className,
11292
- bodyClassName
11293
- }) {
11294
- const panelRef = (0, import_react13.useRef)(null);
11295
- const [measured, setMeasured] = (0, import_react13.useState)({ w: PANEL_WIDTH, h: 280 });
11296
- const dragRef = (0, import_react13.useRef)(null);
11297
- const resolved = position ?? defaultFloatingPanelPosition(parentScroll, measured.h);
11298
- const clamped = clampPosition(resolved, parentScroll, measured.w, measured.h);
11299
- (0, import_react13.useLayoutEffect)(() => {
11300
- if (!open || !panelRef.current) return;
11301
- const el = panelRef.current;
11302
- const next = { w: el.offsetWidth || PANEL_WIDTH, h: el.offsetHeight || 280 };
11303
- setMeasured((prev) => prev.w === next.w && prev.h === next.h ? prev : next);
11304
- }, [open, children, title, context]);
11305
- (0, import_react13.useEffect)(() => {
11306
- if (!open || !position || !onPositionChange) return;
11307
- const next = clampPosition(position, parentScroll, measured.w, measured.h);
11308
- if (next.x !== position.x || next.y !== position.y) onPositionChange(next);
11309
- }, [open, parentScroll, measured.w, measured.h, position, onPositionChange]);
11310
- const onHeaderPointerDown = (0, import_react13.useCallback)(
11311
- (e) => {
11312
- if (e.button !== 0) return;
11313
- if (e.target.closest("[data-ohw-floating-panel-close]")) return;
11314
- e.preventDefault();
11315
- e.stopPropagation();
11316
- const el = e.currentTarget;
11317
- el.setPointerCapture(e.pointerId);
11318
- dragRef.current = {
11319
- pointerId: e.pointerId,
11320
- startX: e.clientX,
11321
- startY: e.clientY,
11322
- originX: clamped.x,
11323
- originY: clamped.y
11324
- };
11325
- },
11326
- [clamped.x, clamped.y]
11327
- );
11328
- const onHeaderPointerMove = (0, import_react13.useCallback)(
11329
- (e) => {
11330
- const drag = dragRef.current;
11331
- if (!drag || drag.pointerId !== e.pointerId) return;
11332
- e.preventDefault();
11333
- const next = clampPosition(
11334
- {
11335
- x: drag.originX + (e.clientX - drag.startX),
11336
- y: drag.originY + (e.clientY - drag.startY)
11337
- },
11338
- parentScroll,
11339
- measured.w,
11340
- measured.h
11341
- );
11342
- onPositionChange?.(next);
11343
- },
11344
- [measured.h, measured.w, onPositionChange, parentScroll]
11345
- );
11346
- const endDrag = (0, import_react13.useCallback)((e) => {
11347
- const drag = dragRef.current;
11348
- if (!drag || drag.pointerId !== e.pointerId) return;
11349
- dragRef.current = null;
11350
- try {
11351
- e.currentTarget.releasePointerCapture(e.pointerId);
11352
- } catch {
11353
- }
11354
- }, []);
11355
- if (!open) return null;
11356
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
11357
- "div",
11358
- {
11359
- ref: panelRef,
11360
- "data-ohw-floating-panel": "",
11361
- role: "dialog",
11362
- "aria-label": title,
11363
- className: cn(
11364
- // Above MediaOverlay / item chrome (2147483646); link-modal content shares this tier.
11365
- "fixed z-[2147483647] flex w-64 flex-col overflow-hidden rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
11366
- className
11367
- ),
11368
- style: { left: clamped.x, top: clamped.y },
11369
- onMouseDown: (e) => e.stopPropagation(),
11370
- onPointerDown: (e) => e.stopPropagation(),
11371
- onClick: (e) => e.stopPropagation(),
11372
- children: [
11373
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
11374
- "div",
11375
- {
11376
- "data-ohw-floating-panel-header": "",
11377
- className: "relative flex cursor-grab items-start gap-2 border-b border-border py-5 pl-5 pr-11 active:cursor-grabbing",
11378
- onPointerDown: onHeaderPointerDown,
11379
- onPointerMove: onHeaderPointerMove,
11380
- onPointerUp: endDrag,
11381
- onPointerCancel: endDrag,
11382
- children: [
11383
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
11384
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
11385
- icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "shrink-0 text-foreground", children: icon }) : null,
11386
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "min-w-0 flex-1 text-lg font-semibold leading-7 text-foreground", children: title })
11387
- ] }),
11388
- context ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "w-full text-sm leading-5 text-muted-foreground", children: context }) : null
11389
- ] }),
11390
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11391
- "button",
11392
- {
11393
- type: "button",
11394
- "data-ohw-floating-panel-close": "",
11395
- "aria-label": "Close",
11396
- className: "absolute right-2.5 top-2.5 rounded-sm p-1.5 text-foreground hover:bg-muted/50",
11397
- onClick: (e) => {
11398
- e.stopPropagation();
11399
- onClose();
11400
- },
11401
- onPointerDown: (e) => e.stopPropagation(),
11402
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.X, { size: 16, "aria-hidden": true })
11403
- }
11404
- )
11405
- ]
11406
- }
11407
- ),
11408
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
11409
- "div",
11410
- {
11411
- "data-ohw-floating-panel-body": "",
11412
- className: cn("flex w-full flex-col gap-4 p-5", bodyClassName),
11413
- children
11414
- }
11415
- )
11416
- ]
11417
- }
11418
- );
11419
- }
11420
-
11421
- // src/ui/logo-size-panel.tsx
11422
- var import_lucide_react14 = require("lucide-react");
11423
- var import_jsx_runtime27 = require("react/jsx-runtime");
11424
- function SizeSlider({
11425
- value,
11426
- onChange
11427
- }) {
11428
- const pct = (value - LOGO_SIZE_MIN) / (LOGO_SIZE_MAX - LOGO_SIZE_MIN) * 100;
11429
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
11430
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full items-center gap-2 text-sm font-medium leading-5", children: [
11431
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "min-w-0 flex-1 text-foreground", children: "Size" }),
11432
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "shrink-0 whitespace-nowrap text-muted-foreground", children: [
11433
- value,
11434
- " px"
11435
- ] })
11436
- ] }),
11437
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative h-2 w-full rounded-full bg-primary-50", children: [
11438
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11439
- "div",
11440
- {
11441
- className: "absolute inset-y-0 left-0 rounded-full bg-primary",
11442
- style: { width: `${pct}%` }
11443
- }
11444
- ),
11445
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11446
- "input",
11447
- {
11448
- type: "range",
11449
- min: LOGO_SIZE_MIN,
11450
- max: LOGO_SIZE_MAX,
11451
- step: 1,
11452
- value,
11453
- "aria-label": "Logo size",
11454
- className: cn(
11455
- "absolute inset-0 h-full w-full cursor-pointer appearance-none bg-transparent",
11456
- "[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:size-5",
11457
- "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2",
11458
- "[&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background",
11459
- "[&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:rounded-full",
11460
- "[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary",
11461
- "[&::-moz-range-thumb]:bg-background"
11462
- ),
11463
- onChange: (e) => onChange(Number(e.target.value))
11464
- }
11465
- )
11466
- ] })
11467
- ] });
11468
- }
11469
- function LogoSizePanel({
11470
- viewport,
11471
- sizePx,
11472
- mobileFollowing = true,
11473
- onSizeChange,
11474
- onCustomizeMobile,
11475
- onResetMobile,
11476
- onUpdateEverywhere,
11477
- className
11478
- }) {
11479
- const showFollowing = viewport === "mobile" && mobileFollowing;
11480
- const showMobileSlider = viewport === "mobile" && !mobileFollowing;
11481
- const showDesktopSlider = viewport === "desktop";
11482
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex w-full flex-col gap-4", className), children: [
11483
- showFollowing ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full flex-col gap-2", children: [
11484
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-1", children: [
11485
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.Link, { size: 16, className: "mt-0.5 shrink-0 text-foreground", "aria-hidden": true }),
11486
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm font-semibold leading-5 text-foreground", children: "Following desktop size" })
11487
- ] }),
11488
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", children: "Mobile uses the desktop size until you customize it. Change the desktop size and it follows automatically." }),
11489
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11490
- Button,
11491
- {
11492
- type: "button",
11493
- variant: "outline",
11494
- size: "sm",
11495
- className: "h-9 w-full min-w-0 cursor-pointer",
11496
- onClick: onCustomizeMobile,
11497
- children: "Customize for mobile"
11498
- }
11499
- )
11500
- ] }) : null,
11501
- showDesktopSlider || showMobileSlider ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SizeSlider, { value: sizePx, onChange: onSizeChange }) : null,
11502
- showMobileSlider ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11503
- Button,
11504
- {
11505
- type: "button",
11506
- variant: "outline",
11507
- size: "sm",
11508
- className: "h-9 w-full min-w-0 cursor-pointer",
11509
- onClick: onResetMobile,
11510
- children: "Reset to desktop size"
11511
- }
11512
- ) : null,
11513
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "h-px w-full bg-border", role: "separator" }),
11514
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
11515
- Button,
11516
- {
11517
- type: "button",
11518
- variant: "outline",
11519
- size: "sm",
11520
- className: "h-9 w-full min-w-0 cursor-pointer gap-1",
11521
- onClick: onUpdateEverywhere,
11522
- children: [
11523
- "Update logo everywhere",
11524
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.ArrowUpRight, { size: 16, "aria-hidden": true })
11525
- ]
11526
- }
11527
- ),
11528
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", children: "Matches the right version to your background." })
11529
- ] });
11530
- }
11531
-
11532
- // src/ui/socials-display-panel.tsx
11533
- var import_jsx_runtime28 = require("react/jsx-runtime");
11534
- function DisplaySwitch({
11535
- label,
11536
- checked,
11537
- disabled,
11538
- onChange
11539
- }) {
11540
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex w-full items-center gap-2", children: [
11541
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11542
- "span",
11543
- {
11544
- className: cn(
11545
- "min-w-0 flex-1 text-sm font-medium leading-5",
11546
- disabled ? "text-muted-foreground" : "text-foreground"
11547
- ),
11548
- children: label
11549
- }
11550
- ),
11551
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11552
- "button",
11553
- {
11554
- type: "button",
11555
- role: "switch",
11556
- "aria-checked": checked,
11557
- "aria-label": label,
11558
- disabled,
11559
- onClick: () => onChange(!checked),
11560
- className: cn(
11561
- "relative h-5 w-9 shrink-0 rounded-full transition-colors",
11562
- checked ? "bg-primary" : "bg-primary-50",
11563
- disabled ? "cursor-default opacity-50" : "cursor-pointer"
11564
- ),
11565
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11566
- "span",
11567
- {
11568
- className: cn(
11569
- "absolute top-0.5 h-4 w-4 rounded-full bg-white transition-all",
11570
- checked ? "left-[1.125rem]" : "left-0.5"
11571
- )
11572
- }
11573
- )
11574
- }
11575
- )
11576
- ] });
11577
- }
11578
- function SocialsDisplayPanel({ display, onChange, className }) {
11579
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("flex w-full flex-col gap-3", className), children: [
11580
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11581
- DisplaySwitch,
11582
- {
11583
- label: "Text",
11584
- checked: display.text,
11585
- disabled: display.text && !display.icon,
11586
- onChange: (text) => onChange({ ...display, text })
11587
- }
11588
- ),
11589
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11590
- DisplaySwitch,
11591
- {
11592
- label: "Icon",
11593
- checked: display.icon,
11594
- disabled: display.icon && !display.text,
11595
- onChange: (icon) => onChange({ ...display, icon })
11596
- }
11597
- )
11598
- ] });
11599
- }
11600
-
11601
- // src/lib/item-drag-interaction.ts
11602
- function disableNativeHrefDrag(el) {
11603
- if (el.draggable) el.draggable = false;
11604
- if (el.getAttribute("draggable") !== "false") {
11605
- el.setAttribute("draggable", "false");
11606
- }
11607
- }
11608
- function clearTextSelection() {
11609
- const sel = window.getSelection();
11610
- if (sel && !sel.isCollapsed) sel.removeAllRanges();
11611
- }
11612
- function armItemPressDrag() {
11613
- document.documentElement.setAttribute("data-ohw-footer-press-drag", "");
10415
+ function armItemPressDrag() {
10416
+ document.documentElement.setAttribute("data-ohw-footer-press-drag", "");
11614
10417
  }
11615
10418
  function lockItemDuringDrag() {
11616
10419
  document.documentElement.removeAttribute("data-ohw-footer-press-drag");
@@ -11796,7 +10599,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey) {
11796
10599
  }
11797
10600
 
11798
10601
  // src/useNavItemDrag.ts
11799
- var import_react14 = require("react");
10602
+ var import_react13 = require("react");
11800
10603
  function useNavItemDrag({
11801
10604
  isEditMode,
11802
10605
  editContentRef,
@@ -11820,11 +10623,11 @@ function useNavItemDrag({
11820
10623
  getNavigationItemAnchor: getNavigationItemAnchor2,
11821
10624
  isDragHandleDisabled: isDragHandleDisabled2
11822
10625
  }) {
11823
- const navDragRef = (0, import_react14.useRef)(null);
11824
- const [navDropSlots, setNavDropSlots] = (0, import_react14.useState)([]);
11825
- const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react14.useState)(null);
11826
- const navPointerDragRef = (0, import_react14.useRef)(null);
11827
- const clearNavDragVisuals = (0, import_react14.useCallback)(() => {
10626
+ const navDragRef = (0, import_react13.useRef)(null);
10627
+ const [navDropSlots, setNavDropSlots] = (0, import_react13.useState)([]);
10628
+ const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react13.useState)(null);
10629
+ const navPointerDragRef = (0, import_react13.useRef)(null);
10630
+ const clearNavDragVisuals = (0, import_react13.useCallback)(() => {
11828
10631
  const session = navDragRef.current;
11829
10632
  const keepOpenEl = session?.draggedEl?.closest("[data-ohw-nav-children]") != null ? session.draggedEl : null;
11830
10633
  navDragRef.current = null;
@@ -11841,7 +10644,7 @@ function useNavItemDrag({
11841
10644
  document.documentElement.removeAttribute("data-ohw-nav-dragging-root");
11842
10645
  unlockItemDragInteraction();
11843
10646
  }, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
11844
- const refreshNavDragVisuals = (0, import_react14.useCallback)(
10647
+ const refreshNavDragVisuals = (0, import_react13.useCallback)(
11845
10648
  (session, activeSlot, clientX, clientY) => {
11846
10649
  setDraggedItemRect(session.draggedEl.getBoundingClientRect());
11847
10650
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -11859,13 +10662,13 @@ function useNavItemDrag({
11859
10662
  },
11860
10663
  [setDraggedItemRect, setSiblingHintRects]
11861
10664
  );
11862
- const refreshNavDragVisualsRef = (0, import_react14.useRef)(refreshNavDragVisuals);
10665
+ const refreshNavDragVisualsRef = (0, import_react13.useRef)(refreshNavDragVisuals);
11863
10666
  refreshNavDragVisualsRef.current = refreshNavDragVisuals;
11864
- const commitNavDragRef = (0, import_react14.useRef)(() => {
10667
+ const commitNavDragRef = (0, import_react13.useRef)(() => {
11865
10668
  });
11866
- const beginNavDragRef = (0, import_react14.useRef)(() => {
10669
+ const beginNavDragRef = (0, import_react13.useRef)(() => {
11867
10670
  });
11868
- const beginNavDrag = (0, import_react14.useCallback)(
10671
+ const beginNavDrag = (0, import_react13.useCallback)(
11869
10672
  (session) => {
11870
10673
  const rect = session.draggedEl.getBoundingClientRect();
11871
10674
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -11899,7 +10702,7 @@ function useNavItemDrag({
11899
10702
  ]
11900
10703
  );
11901
10704
  beginNavDragRef.current = beginNavDrag;
11902
- const commitNavDrag = (0, import_react14.useCallback)(
10705
+ const commitNavDrag = (0, import_react13.useCallback)(
11903
10706
  (clientX, clientY) => {
11904
10707
  const session = navDragRef.current;
11905
10708
  if (!session) {
@@ -11960,7 +10763,7 @@ function useNavItemDrag({
11960
10763
  [clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
11961
10764
  );
11962
10765
  commitNavDragRef.current = commitNavDrag;
11963
- const startNavLinkDrag = (0, import_react14.useCallback)(
10766
+ const startNavLinkDrag = (0, import_react13.useCallback)(
11964
10767
  (anchor, clientX, clientY, wasSelected) => {
11965
10768
  if (footerDragRef.current) return false;
11966
10769
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
@@ -11978,7 +10781,7 @@ function useNavItemDrag({
11978
10781
  },
11979
10782
  [beginNavDrag, footerDragRef, isDragHandleDisabled2, isCtaButton]
11980
10783
  );
11981
- const onNavDragOver = (0, import_react14.useCallback)(
10784
+ const onNavDragOver = (0, import_react13.useCallback)(
11982
10785
  (e) => {
11983
10786
  const session = navDragRef.current;
11984
10787
  if (!session) return false;
@@ -11990,7 +10793,7 @@ function useNavItemDrag({
11990
10793
  },
11991
10794
  []
11992
10795
  );
11993
- (0, import_react14.useEffect)(() => {
10796
+ (0, import_react13.useEffect)(() => {
11994
10797
  if (!isEditMode) return;
11995
10798
  const THRESHOLD = 10;
11996
10799
  const resolveWasSelected = (el) => {
@@ -12115,7 +10918,7 @@ function useNavItemDrag({
12115
10918
  setLinkPopover,
12116
10919
  suppressNextClickRef
12117
10920
  ]);
12118
- const armNavPressFromChrome = (0, import_react14.useCallback)(
10921
+ const armNavPressFromChrome = (0, import_react13.useCallback)(
12119
10922
  (selected, clientX, clientY, pointerId) => {
12120
10923
  const hrefKey = selected.getAttribute("data-ohw-href-key");
12121
10924
  if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
@@ -12146,8 +10949,8 @@ function useNavItemDrag({
12146
10949
  }
12147
10950
 
12148
10951
  // src/ui/footer-container-chrome.tsx
12149
- var import_lucide_react15 = require("lucide-react");
12150
- var import_jsx_runtime29 = require("react/jsx-runtime");
10952
+ var import_lucide_react13 = require("lucide-react");
10953
+ var import_jsx_runtime26 = require("react/jsx-runtime");
12151
10954
  function FooterContainerChrome({
12152
10955
  rect,
12153
10956
  onAdd,
@@ -12155,7 +10958,7 @@ function FooterContainerChrome({
12155
10958
  }) {
12156
10959
  const chromeGap = 6;
12157
10960
  const buttonMargin = 7;
12158
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10961
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12159
10962
  "div",
12160
10963
  {
12161
10964
  "data-ohw-footer-container-chrome": "",
@@ -12167,8 +10970,8 @@ function FooterContainerChrome({
12167
10970
  width: rect.width + chromeGap * 2,
12168
10971
  height: rect.height + chromeGap * 2
12169
10972
  },
12170
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip, { children: [
12171
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10973
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
10974
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12172
10975
  "button",
12173
10976
  {
12174
10977
  type: "button",
@@ -12187,17 +10990,17 @@ function FooterContainerChrome({
12187
10990
  if (addDisabled) return;
12188
10991
  onAdd();
12189
10992
  },
12190
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
10993
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
12191
10994
  }
12192
10995
  ) }),
12193
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
10996
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
12194
10997
  ] })
12195
10998
  }
12196
10999
  ) });
12197
11000
  }
12198
11001
 
12199
11002
  // src/lib/carousel.ts
12200
- var import_react15 = require("react");
11003
+ var import_react14 = require("react");
12201
11004
  var CAROUSEL_ATTR = "data-ohw-carousel";
12202
11005
  var CAROUSEL_VALUE_ATTR = "data-ohw-carousel-value";
12203
11006
  var CAROUSEL_SLIDE_ATTR = "data-ohw-carousel-slide";
@@ -12259,8 +11062,8 @@ function applyCarouselNode(key, val) {
12259
11062
  return true;
12260
11063
  }
12261
11064
  function useOhwCarousel(key, initial) {
12262
- const [images, setImages] = (0, import_react15.useState)(initial);
12263
- (0, import_react15.useEffect)(() => {
11065
+ const [images, setImages] = (0, import_react14.useState)(initial);
11066
+ (0, import_react14.useEffect)(() => {
12264
11067
  const el = document.querySelector(
12265
11068
  `[${CAROUSEL_ATTR}][data-ohw-key="${CSS.escape(key)}"]`
12266
11069
  );
@@ -12373,18 +11176,6 @@ function collectEditableNodes(extraContent, root = document) {
12373
11176
  }
12374
11177
  if (extraContent && !isScoped) {
12375
11178
  applyNavFooterDeleteOverrides(byKey, extraContent);
12376
- for (const key of LOGO_IMAGE_KEYS) {
12377
- if (!(key in extraContent)) continue;
12378
- byKey.set(key, { key, type: "image", text: extraContent[key] ?? "" });
12379
- }
12380
- for (const key of [LOGO_PLACEHOLDER_KEY, LOGO_ALT_KEY]) {
12381
- if (!(key in extraContent)) continue;
12382
- byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
12383
- }
12384
- for (const key of LOGO_SIZE_KEYS) {
12385
- if (!(key in extraContent)) continue;
12386
- byKey.set(key, { key, type: "meta", text: extraContent[key] ?? "" });
12387
- }
12388
11179
  }
12389
11180
  return Array.from(byKey.values());
12390
11181
  }
@@ -12487,7 +11278,7 @@ function isNavbarLinksContainer(el) {
12487
11278
  function isNavigationItem(el) {
12488
11279
  const anchor = el.matches("[data-ohw-href-key]") ? el : el.closest("[data-ohw-href-key]");
12489
11280
  if (!anchor) return false;
12490
- return Boolean(anchor.querySelector('[data-ohw-editable="text"]')) || Boolean(getSocialItem(anchor));
11281
+ return Boolean(anchor.querySelector('[data-ohw-editable="text"]'));
12491
11282
  }
12492
11283
  function findFooterItemGroup(item) {
12493
11284
  const explicit = item.closest("[data-ohw-footer-col], [data-ohw-footer-column]");
@@ -12508,9 +11299,8 @@ function isInferredFooterGroup(el) {
12508
11299
  const footer = el.closest("footer");
12509
11300
  if (!footer || el === footer) return false;
12510
11301
  if (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column")) return true;
12511
- if (isSocialsRow(el)) return false;
12512
11302
  const count = Array.from(el.querySelectorAll("[data-ohw-href-key]")).filter(
12513
- (item) => isNavigationItem(item) && !getSocialItem(item)
11303
+ isNavigationItem
12514
11304
  ).length;
12515
11305
  return count >= 2;
12516
11306
  }
@@ -12554,8 +11344,7 @@ function deleteSelectedNavFooterItem(deps) {
12554
11344
  if (key.endsWith("-href")) applyLinkByKey2(key, text);
12555
11345
  else {
12556
11346
  document.querySelectorAll(`[data-ohw-key="${CSS.escape(key)}"]`).forEach((el) => {
12557
- if (el.getAttribute("data-ohw-editable") === "icon") applyIconMarkup(el, text);
12558
- else el.textContent = text;
11347
+ el.textContent = text;
12559
11348
  });
12560
11349
  }
12561
11350
  }
@@ -12617,21 +11406,6 @@ function deleteSelectedNavFooterItem(deps) {
12617
11406
  });
12618
11407
  return true;
12619
11408
  }
12620
- const social = getSocialItem(selected);
12621
- if (social) {
12622
- const result = removeSocialItem(social, getEditContent());
12623
- if (!result) return false;
12624
- finishDelete({
12625
- toastTitle: "Social deleted",
12626
- removedKeys: result.removedKeys,
12627
- previousContent: result.previousContent,
12628
- orderKey: SOCIALS_ORDER_KEY,
12629
- orderJson: JSON.stringify(result.order),
12630
- previousOrderJson: JSON.stringify(result.previousOrder),
12631
- undoDom: result.undo
12632
- });
12633
- return true;
12634
- }
12635
11409
  if (isFooterHrefKey(hrefKey)) {
12636
11410
  const result = deleteFooterItem(selected);
12637
11411
  if (!result) return false;
@@ -12650,14 +11424,14 @@ function deleteSelectedNavFooterItem(deps) {
12650
11424
  }
12651
11425
 
12652
11426
  // src/ui/navbar-container-chrome.tsx
12653
- var import_lucide_react16 = require("lucide-react");
12654
- var import_jsx_runtime30 = require("react/jsx-runtime");
11427
+ var import_lucide_react14 = require("lucide-react");
11428
+ var import_jsx_runtime27 = require("react/jsx-runtime");
12655
11429
  function NavbarContainerChrome({
12656
11430
  rect,
12657
11431
  onAdd
12658
11432
  }) {
12659
11433
  const chromeGap = 6;
12660
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11434
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12661
11435
  "div",
12662
11436
  {
12663
11437
  "data-ohw-navbar-container-chrome": "",
@@ -12669,7 +11443,7 @@ function NavbarContainerChrome({
12669
11443
  width: rect.width + chromeGap * 2,
12670
11444
  height: rect.height + chromeGap * 2
12671
11445
  },
12672
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11446
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12673
11447
  "button",
12674
11448
  {
12675
11449
  type: "button",
@@ -12686,7 +11460,7 @@ function NavbarContainerChrome({
12686
11460
  e.stopPropagation();
12687
11461
  onAdd();
12688
11462
  },
12689
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
11463
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react14.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
12690
11464
  }
12691
11465
  )
12692
11466
  }
@@ -12695,7 +11469,7 @@ function NavbarContainerChrome({
12695
11469
 
12696
11470
  // src/ui/drop-indicator.tsx
12697
11471
  var React10 = __toESM(require("react"), 1);
12698
- var import_jsx_runtime31 = require("react/jsx-runtime");
11472
+ var import_jsx_runtime28 = require("react/jsx-runtime");
12699
11473
  var dropIndicatorVariants = cva(
12700
11474
  "ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
12701
11475
  {
@@ -12719,7 +11493,7 @@ var dropIndicatorVariants = cva(
12719
11493
  );
12720
11494
  var DropIndicator = React10.forwardRef(
12721
11495
  ({ className, direction, state, ...props }, ref) => {
12722
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
11496
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12723
11497
  "div",
12724
11498
  {
12725
11499
  ref,
@@ -12736,7 +11510,7 @@ var DropIndicator = React10.forwardRef(
12736
11510
  DropIndicator.displayName = "DropIndicator";
12737
11511
 
12738
11512
  // src/ui/badge.tsx
12739
- var import_jsx_runtime32 = require("react/jsx-runtime");
11513
+ var import_jsx_runtime29 = require("react/jsx-runtime");
12740
11514
  var badgeVariants = cva(
12741
11515
  "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",
12742
11516
  {
@@ -12754,12 +11528,12 @@ var badgeVariants = cva(
12754
11528
  }
12755
11529
  );
12756
11530
  function Badge({ className, variant, ...props }) {
12757
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
11531
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
12758
11532
  }
12759
11533
 
12760
11534
  // src/OhhwellsBridge.tsx
12761
- var import_lucide_react17 = require("lucide-react");
12762
- var import_jsx_runtime33 = require("react/jsx-runtime");
11535
+ var import_lucide_react15 = require("lucide-react");
11536
+ var import_jsx_runtime30 = require("react/jsx-runtime");
12763
11537
  var PRIMARY3 = "#0885FE";
12764
11538
  var IMAGE_FADE_MS = 300;
12765
11539
  function runOpacityFade(el, onDone) {
@@ -12853,10 +11627,21 @@ function parseSchedulingInsertAfter(insertAfter) {
12853
11627
  insertBefore: insertAfter.slice(idx + INSERT_BEFORE_MARKER.length)
12854
11628
  };
12855
11629
  }
12856
- function resolveEntryAnchor(entry) {
12857
- if (entry.anchorId !== void 0) return { anchorId: entry.anchorId, beforeId: entry.beforeId ?? null };
12858
- const parsed = parseSchedulingInsertAfter(entry.insertAfter);
12859
- return { anchorId: parsed.anchor, beforeId: parsed.insertBefore };
11630
+ function resolveSchedulingInsert(insertAfter, explicitInsertBefore) {
11631
+ const parsed = parseSchedulingInsertAfter(insertAfter);
11632
+ const insertBefore = explicitInsertBefore ?? parsed.insertBefore;
11633
+ const effectiveInsertAfter = insertBefore && parsed.insertBefore === null ? `${insertAfter}${INSERT_BEFORE_MARKER}${insertBefore}` : insertAfter;
11634
+ return { effectiveInsertAfter, insertBefore };
11635
+ }
11636
+ function getSchedulingMountPoint(insertAfter) {
11637
+ const { anchor } = parseSchedulingInsertAfter(insertAfter);
11638
+ let anchorEl = document.querySelector(`[data-ohw-section="${anchor}"]`);
11639
+ if (!anchorEl && anchor === "scheduling") {
11640
+ const widgets = Array.from(document.querySelectorAll('[data-ohw-section^="scheduling-"]'));
11641
+ anchorEl = widgets.at(-1) ?? null;
11642
+ }
11643
+ if (!anchorEl) return null;
11644
+ return anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
12860
11645
  }
12861
11646
  function schedulingMountDepth(insertAfter) {
12862
11647
  if (!insertAfter.includes(INSERT_BEFORE_MARKER)) return 0;
@@ -12873,7 +11658,8 @@ function getPageSchedulingEntries(raw) {
12873
11658
  }
12874
11659
  }
12875
11660
  function isSchedulingWidgetMissing(entry) {
12876
- return !document.querySelector(`[data-ohw-section="${schedulingSectionId(entry.insertAfter)}"]`);
11661
+ const { effectiveInsertAfter } = resolveSchedulingInsert(entry.insertAfter);
11662
+ return !document.querySelector(`[data-ohw-section="${schedulingSectionId(effectiveInsertAfter)}"]`);
12877
11663
  }
12878
11664
  function hasMissingSchedulingWidgets(entries) {
12879
11665
  return entries.some(isSchedulingWidgetMissing);
@@ -12903,17 +11689,16 @@ function initSectionsFromContent(content, removeExisting = false) {
12903
11689
  } catch {
12904
11690
  }
12905
11691
  }
12906
- function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, beforeId, existingWidgetId) {
12907
- const widgetId = existingWidgetId ?? (beforeId ? `${anchorId}${INSERT_BEFORE_MARKER}${beforeId}` : anchorId);
12908
- const sectionId = schedulingSectionId(widgetId);
11692
+ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId, explicitInsertBefore) {
11693
+ const { effectiveInsertAfter, insertBefore } = resolveSchedulingInsert(insertAfter, explicitInsertBefore);
11694
+ const sectionId = schedulingSectionId(effectiveInsertAfter);
12909
11695
  if (document.querySelector(`[data-ohw-section="${sectionId}"]`)) return false;
12910
- const anchorEl = document.querySelector(`[data-ohw-section="${anchorId}"]`);
12911
- if (!anchorEl) return false;
12912
- const mountPoint = anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
11696
+ const mountPoint = getSchedulingMountPoint(effectiveInsertAfter);
11697
+ if (!mountPoint) return false;
12913
11698
  const container = document.createElement("div");
12914
11699
  container.dataset.ohwSectionContainer = "scheduling";
12915
- if (beforeId) {
12916
- const beforeAnchor = document.querySelector(`[data-ohw-section="${beforeId}"]`);
11700
+ if (insertBefore) {
11701
+ const beforeAnchor = document.querySelector(`[data-ohw-section="${insertBefore}"]`);
12917
11702
  const beforePoint = beforeAnchor?.closest('[data-ohw-section-container="scheduling"]') ?? beforeAnchor;
12918
11703
  if (!beforePoint) return false;
12919
11704
  beforePoint.insertAdjacentElement("beforebegin", container);
@@ -12924,25 +11709,19 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
12924
11709
  }
12925
11710
  tail.insertAdjacentElement("afterend", container);
12926
11711
  }
12927
- try {
12928
- const root = (0, import_client2.createRoot)(container);
12929
- (0, import_react_dom3.flushSync)(() => {
12930
- root.render(
12931
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12932
- SchedulingWidget,
12933
- {
12934
- notifyOnConnect,
12935
- initialScheduleId: scheduleId,
12936
- insertAfter: widgetId
12937
- }
12938
- )
12939
- );
12940
- });
12941
- } catch (err) {
12942
- console.error("[ow:scheduling] render threw", err);
12943
- container.remove();
12944
- return false;
12945
- }
11712
+ const root = (0, import_client2.createRoot)(container);
11713
+ (0, import_react_dom3.flushSync)(() => {
11714
+ root.render(
11715
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
11716
+ SchedulingWidget,
11717
+ {
11718
+ notifyOnConnect,
11719
+ initialScheduleId: scheduleId,
11720
+ insertAfter: effectiveInsertAfter
11721
+ }
11722
+ )
11723
+ );
11724
+ });
12946
11725
  const tracker = getSectionsTracker();
12947
11726
  let sections = [];
12948
11727
  try {
@@ -12950,12 +11729,10 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
12950
11729
  } catch {
12951
11730
  }
12952
11731
  const inEditor = typeof window !== "undefined" && window.self !== window.top;
12953
- if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === widgetId)) {
11732
+ if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === effectiveInsertAfter)) {
12954
11733
  sections.push({
12955
11734
  type: "scheduling",
12956
- insertAfter: widgetId,
12957
- anchorId,
12958
- beforeId: beforeId ?? null,
11735
+ insertAfter: effectiveInsertAfter,
12959
11736
  pagePath: window.location.pathname,
12960
11737
  ...scheduleId ? { scheduleId } : {}
12961
11738
  });
@@ -12969,8 +11746,7 @@ function mountSchedulingEntries(entries, notifyOnConnect = false) {
12969
11746
  for (let i = pending.length - 1; i >= 0; i--) {
12970
11747
  const entry = pending[i];
12971
11748
  const shouldNotify = typeof notifyOnConnect === "function" ? notifyOnConnect(entry) : notifyOnConnect;
12972
- const { anchorId, beforeId } = resolveEntryAnchor(entry);
12973
- if (mountSchedulingWidget(anchorId, shouldNotify, entry.scheduleId ?? null, beforeId, entry.insertAfter)) {
11749
+ if (mountSchedulingWidget(entry.insertAfter, shouldNotify, entry.scheduleId)) {
12974
11750
  pending.splice(i, 1);
12975
11751
  }
12976
11752
  }
@@ -12984,17 +11760,6 @@ function applyLinkHref(el, val) {
12984
11760
  const anchor = el instanceof HTMLAnchorElement ? el : el.querySelector("a");
12985
11761
  if (anchor) anchor.setAttribute("href", val);
12986
11762
  }
12987
- function currentIconRef(el) {
12988
- const uploaded = el instanceof HTMLImageElement ? el : el.querySelector("img");
12989
- if (uploaded?.getAttribute("src")) {
12990
- return uploaded.getAttribute("src") ?? "";
12991
- }
12992
- const svg = el instanceof SVGElement ? el : el.querySelector("svg");
12993
- const named = Array.from(svg?.classList ?? []).find(
12994
- (c) => c.startsWith("lucide-") && c !== "lucide-icon"
12995
- );
12996
- return named ? `lucide:${named.slice("lucide-".length)}` : "";
12997
- }
12998
11763
  function getEditMeasureEl(editable) {
12999
11764
  return editable.closest("[data-ohw-href-key]") ?? editable;
13000
11765
  }
@@ -13039,11 +11804,8 @@ function isMediaEditable(el) {
13039
11804
  const t = el.dataset.ohwEditable;
13040
11805
  return t === "image" || t === "bg-image" || t === "video";
13041
11806
  }
13042
- function isIconEditable(el) {
13043
- return el.dataset.ohwEditable === "icon";
13044
- }
13045
11807
  var MEDIA_SELECTOR = '[data-ohw-editable="image"], [data-ohw-editable="bg-image"], [data-ohw-editable="video"]';
13046
- var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"]):not([data-ohw-editable="icon"])';
11808
+ var NON_MEDIA_SELECTOR = '[data-ohw-editable]:not([data-ohw-editable="image"]):not([data-ohw-editable="bg-image"]):not([data-ohw-editable="video"])';
13047
11809
  function getVideoEl2(el) {
13048
11810
  return el instanceof HTMLVideoElement ? el : el.querySelector("video");
13049
11811
  }
@@ -13114,13 +11876,6 @@ function isInsideLinkEditor(target) {
13114
11876
  target.closest("[data-ohw-link-popover-root]") || target.closest("[data-ohw-link-modal-root]") || target.closest("[data-ohw-link-page-dropdown]") || target.closest("[data-ohw-section-picker]") || target.closest("[data-ohw-navbar-container-chrome]") || target.closest("[data-ohw-navbar-add-button]") || target.closest("[data-ohw-footer-container-chrome]") || target.closest("[data-ohw-footer-add-button]") || target.closest("[data-ohw-more-menu]") || target.closest('[data-slot="dropdown-menu-content"]') || target.closest('[data-slot="popover-content"]') || target.closest('[data-slot="dialog-content"]') || target.closest('[data-slot="dialog-overlay"]')
13115
11877
  );
13116
11878
  }
13117
- function isInsideFloatingPanel(target) {
13118
- return Boolean(target.closest("[data-ohw-floating-panel]"));
13119
- }
13120
- function isPointOverFloatingPanel(clientX, clientY) {
13121
- const el = document.elementFromPoint(clientX, clientY);
13122
- return Boolean(el instanceof Element && el.closest("[data-ohw-floating-panel]"));
13123
- }
13124
11879
  function getHrefKeyFromElement(el) {
13125
11880
  if (!el) return null;
13126
11881
  const anchor = el.closest("[data-ohw-href-key]");
@@ -13168,29 +11923,13 @@ function isNavItemPointerTarget(el) {
13168
11923
  function getNavigationItemAnchor(el) {
13169
11924
  const anchor = el.matches("[data-ohw-href-key]") ? el : el.closest("[data-ohw-href-key]");
13170
11925
  if (!anchor) return null;
13171
- if (!anchor.querySelector('[data-ohw-editable="text"]') && !getSocialItem(anchor)) return null;
11926
+ if (!anchor.querySelector('[data-ohw-editable="text"]')) return null;
13172
11927
  if (!isNavItemPointerTarget(anchor)) return null;
13173
11928
  return anchor;
13174
11929
  }
13175
11930
  function isNavigationItem2(el) {
13176
11931
  return getNavigationItemAnchor(el) !== null;
13177
11932
  }
13178
- function requestSocialDialog(anchor, post, content) {
13179
- const item = getSocialItem(anchor);
13180
- if (!item) return false;
13181
- const iconKey = item.querySelector('[data-ohw-editable="icon"]')?.dataset.ohwKey ?? "";
13182
- post({
13183
- type: "ow:social-pick",
13184
- hrefKey: item.getAttribute("data-ohw-href-key") ?? "",
13185
- iconKey,
13186
- url: getLinkHref4(item),
13187
- iconStyle: detectIconStyle(item),
13188
- // What was chosen last time. Guessing from the address instead reads as "Website" for anything
13189
- // unrecognised, and for an item with no address at all — so a deliberate choice looked lost.
13190
- platformId: content[socialPlatformKey(iconKey)] ?? ""
13191
- });
13192
- return true;
13193
- }
13194
11933
  function listNavigationItems() {
13195
11934
  return Array.from(
13196
11935
  document.querySelectorAll("nav [data-ohw-href-key], footer [data-ohw-href-key]")
@@ -13225,7 +11964,7 @@ function getNavigationRoot(el) {
13225
11964
  return el.closest("nav, footer, aside");
13226
11965
  }
13227
11966
  function countFooterNavItems(el) {
13228
- return Array.from(el.querySelectorAll("[data-ohw-href-key]")).filter((item) => isNavigationItem2(item) && !getSocialItem(item)).length;
11967
+ return Array.from(el.querySelectorAll("[data-ohw-href-key]")).filter(isNavigationItem2).length;
13229
11968
  }
13230
11969
  function findFooterItemGroup2(item) {
13231
11970
  const explicit = item.closest("[data-ohw-footer-col], [data-ohw-footer-column]");
@@ -13246,11 +11985,10 @@ function isInferredFooterGroup2(el) {
13246
11985
  const footer = el.closest("footer");
13247
11986
  if (!footer || el === footer) return false;
13248
11987
  if (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column")) return true;
13249
- if (isSocialsRow(el)) return false;
13250
11988
  return countFooterNavItems(el) >= 2;
13251
11989
  }
13252
11990
  function isNavigationContainer(el) {
13253
- return el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el) || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isNavigationRoot(el) || isSocialsRow(el) || isInferredFooterGroup2(el);
11991
+ return el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el) || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isNavigationRoot(el) || isInferredFooterGroup2(el);
13254
11992
  }
13255
11993
  function isNavbarLinksContainer2(el) {
13256
11994
  return el.hasAttribute("data-ohw-nav-container");
@@ -13333,8 +12071,6 @@ function resolveNavContainerSelectionTarget(target, clientX, clientY) {
13333
12071
  return null;
13334
12072
  }
13335
12073
  function getNavigationSelectionParent(el) {
13336
- const socialsRow = findSocialsRow(el);
13337
- if (socialsRow) return socialsRow;
13338
12074
  if (isNavigationItem2(el)) {
13339
12075
  const childrenRoot = el.closest("[data-ohw-nav-children]");
13340
12076
  if (childrenRoot) {
@@ -13353,17 +12089,13 @@ function getNavigationSelectionParent(el) {
13353
12089
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
13354
12090
  return getFooterLinksContainer();
13355
12091
  }
13356
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup2(el)) {
12092
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
13357
12093
  return getNavigationRoot(el);
13358
12094
  }
13359
12095
  return null;
13360
12096
  }
13361
12097
  function collectNavigationItemSiblingHintRects(selected) {
13362
12098
  if (!isNavigationItem2(selected)) return [];
13363
- const socialsRow = findSocialsRow(selected);
13364
- if (socialsRow) {
13365
- return listSocialItems(socialsRow).filter((item) => item !== selected).map((item) => item.getBoundingClientRect());
13366
- }
13367
12099
  const footerColumn = getFooterColumn(selected);
13368
12100
  if (footerColumn) {
13369
12101
  return listFooterLinksInColumn(footerColumn).filter((link) => link !== selected).map((link) => link.getBoundingClientRect());
@@ -13596,7 +12328,7 @@ function EditGlowChrome({
13596
12328
  hideHandle = false
13597
12329
  }) {
13598
12330
  const GAP = SELECTION_CHROME_GAP2;
13599
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
12331
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
13600
12332
  "div",
13601
12333
  {
13602
12334
  ref: elRef,
@@ -13611,7 +12343,7 @@ function EditGlowChrome({
13611
12343
  zIndex: 2147483646
13612
12344
  },
13613
12345
  children: [
13614
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12346
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13615
12347
  "div",
13616
12348
  {
13617
12349
  style: {
@@ -13624,7 +12356,7 @@ function EditGlowChrome({
13624
12356
  }
13625
12357
  }
13626
12358
  ),
13627
- reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12359
+ reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13628
12360
  "div",
13629
12361
  {
13630
12362
  "data-ohw-drag-handle-container": "",
@@ -13636,7 +12368,7 @@ function EditGlowChrome({
13636
12368
  transform: "translate(calc(-100% - 7px), -50%)",
13637
12369
  pointerEvents: dragDisabled ? "none" : "auto"
13638
12370
  },
13639
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12371
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13640
12372
  DragHandle,
13641
12373
  {
13642
12374
  "aria-label": `Reorder ${reorderHrefKey}`,
@@ -13819,9 +12551,9 @@ function FloatingToolbar({
13819
12551
  showEditLink,
13820
12552
  onEditLink
13821
12553
  }) {
13822
- const localRef = import_react16.default.useRef(null);
13823
- const [measuredW, setMeasuredW] = import_react16.default.useState(330);
13824
- const setRefs = import_react16.default.useCallback(
12554
+ const localRef = import_react15.default.useRef(null);
12555
+ const [measuredW, setMeasuredW] = import_react15.default.useState(330);
12556
+ const setRefs = import_react15.default.useCallback(
13825
12557
  (node) => {
13826
12558
  localRef.current = node;
13827
12559
  if (typeof elRef === "function") elRef(node);
@@ -13833,7 +12565,7 @@ function FloatingToolbar({
13833
12565
  },
13834
12566
  [elRef]
13835
12567
  );
13836
- import_react16.default.useLayoutEffect(() => {
12568
+ import_react15.default.useLayoutEffect(() => {
13837
12569
  const node = localRef.current;
13838
12570
  if (!node) return;
13839
12571
  const update = () => {
@@ -13846,7 +12578,7 @@ function FloatingToolbar({
13846
12578
  return () => ro.disconnect();
13847
12579
  }, [showEditLink, activeCommands]);
13848
12580
  const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
13849
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12581
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13850
12582
  "div",
13851
12583
  {
13852
12584
  ref: setRefs,
@@ -13858,12 +12590,12 @@ function FloatingToolbar({
13858
12590
  zIndex: 2147483647,
13859
12591
  pointerEvents: "auto"
13860
12592
  },
13861
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(CustomToolbar, { children: [
13862
- TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react16.default.Fragment, { children: [
13863
- gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CustomToolbarDivider, {}),
12593
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CustomToolbar, { children: [
12594
+ TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react15.default.Fragment, { children: [
12595
+ gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CustomToolbarDivider, {}),
13864
12596
  btns.map((btn) => {
13865
12597
  const isActive = activeCommands.has(btn.cmd);
13866
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12598
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13867
12599
  CustomToolbarButton,
13868
12600
  {
13869
12601
  title: btn.title,
@@ -13872,7 +12604,7 @@ function FloatingToolbar({
13872
12604
  e.preventDefault();
13873
12605
  onCommand(btn.cmd);
13874
12606
  },
13875
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12607
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13876
12608
  "svg",
13877
12609
  {
13878
12610
  width: "16",
@@ -13893,7 +12625,7 @@ function FloatingToolbar({
13893
12625
  );
13894
12626
  })
13895
12627
  ] }, gi)),
13896
- showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12628
+ showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13897
12629
  CustomToolbarButton,
13898
12630
  {
13899
12631
  type: "button",
@@ -13907,7 +12639,7 @@ function FloatingToolbar({
13907
12639
  e.preventDefault();
13908
12640
  e.stopPropagation();
13909
12641
  },
13910
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Link, { className: "size-4 shrink-0", "aria-hidden": true })
12642
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.Link, { className: "size-4 shrink-0", "aria-hidden": true })
13911
12643
  }
13912
12644
  ) : null
13913
12645
  ] })
@@ -13924,7 +12656,7 @@ function StateToggle({
13924
12656
  states,
13925
12657
  onStateChange
13926
12658
  }) {
13927
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
12659
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
13928
12660
  ToggleGroup,
13929
12661
  {
13930
12662
  "data-ohw-state-toggle": "",
@@ -13938,12 +12670,11 @@ function StateToggle({
13938
12670
  left: rect.right - 8,
13939
12671
  transform: "translateX(-100%)"
13940
12672
  },
13941
- children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
12673
+ children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
13942
12674
  }
13943
12675
  );
13944
12676
  }
13945
12677
  var contentCache = /* @__PURE__ */ new Map();
13946
- var fetchedContentPaths = /* @__PURE__ */ new Set();
13947
12678
  function resolveSubdomain(subdomainFromQuery) {
13948
12679
  if (subdomainFromQuery) return subdomainFromQuery;
13949
12680
  if (typeof window !== "undefined") {
@@ -13966,8 +12697,8 @@ function OhhwellsBridge() {
13966
12697
  const router = (0, import_navigation3.useRouter)();
13967
12698
  const searchParams = (0, import_navigation3.useSearchParams)();
13968
12699
  const isEditMode = isEditSessionActive();
13969
- const [bridgeRoot, setBridgeRoot] = (0, import_react16.useState)(null);
13970
- (0, import_react16.useEffect)(() => {
12700
+ const [bridgeRoot, setBridgeRoot] = (0, import_react15.useState)(null);
12701
+ (0, import_react15.useEffect)(() => {
13971
12702
  const figtreeFontId = "ohw-figtree-font";
13972
12703
  if (!document.getElementById(figtreeFontId)) {
13973
12704
  const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
@@ -13996,136 +12727,110 @@ function OhhwellsBridge() {
13996
12727
  const subdomain = resolveSubdomain(subdomainFromQuery);
13997
12728
  useLinkHrefGuardian(pathname, subdomain, isEditMode);
13998
12729
  useSavedLinkNavigation(isEditMode);
13999
- const postToParent2 = (0, import_react16.useCallback)((data) => {
12730
+ const postToParent2 = (0, import_react15.useCallback)((data) => {
14000
12731
  if (typeof window !== "undefined" && window.parent !== window) {
14001
12732
  window.parent.postMessage(data, "*");
14002
12733
  }
14003
12734
  }, []);
14004
- const [fetchState, setFetchState] = (0, import_react16.useState)("idle");
14005
- const autoSaveTimers = (0, import_react16.useRef)(/* @__PURE__ */ new Map());
14006
- const activeElRef = (0, import_react16.useRef)(null);
14007
- const pointerHeldRef = (0, import_react16.useRef)(false);
14008
- const selectedElRef = (0, import_react16.useRef)(null);
14009
- const selectedHrefKeyRef = (0, import_react16.useRef)(null);
14010
- const selectedFooterColAttrRef = (0, import_react16.useRef)(null);
14011
- const originalContentRef = (0, import_react16.useRef)(null);
14012
- const activeStateElRef = (0, import_react16.useRef)(null);
14013
- const parentScrollRef = (0, import_react16.useRef)(null);
14014
- const visibleViewportRef = (0, import_react16.useRef)(null);
14015
- const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react16.useState)(null);
14016
- const attachVisibleViewport = (0, import_react16.useCallback)((node) => {
12735
+ const [fetchState, setFetchState] = (0, import_react15.useState)("idle");
12736
+ const autoSaveTimers = (0, import_react15.useRef)(/* @__PURE__ */ new Map());
12737
+ const activeElRef = (0, import_react15.useRef)(null);
12738
+ const pointerHeldRef = (0, import_react15.useRef)(false);
12739
+ const selectedElRef = (0, import_react15.useRef)(null);
12740
+ const selectedHrefKeyRef = (0, import_react15.useRef)(null);
12741
+ const selectedFooterColAttrRef = (0, import_react15.useRef)(null);
12742
+ const originalContentRef = (0, import_react15.useRef)(null);
12743
+ const activeStateElRef = (0, import_react15.useRef)(null);
12744
+ const parentScrollRef = (0, import_react15.useRef)(null);
12745
+ const visibleViewportRef = (0, import_react15.useRef)(null);
12746
+ const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react15.useState)(null);
12747
+ const attachVisibleViewport = (0, import_react15.useCallback)((node) => {
14017
12748
  visibleViewportRef.current = node;
14018
12749
  setDialogPortalContainer(node);
14019
12750
  if (node) applyVisibleViewport(node, parentScrollRef.current);
14020
12751
  }, []);
14021
- const toolbarElRef = (0, import_react16.useRef)(null);
14022
- const glowElRef = (0, import_react16.useRef)(null);
14023
- const hoveredImageRef = (0, import_react16.useRef)(null);
14024
- const hoveredImageHasTextOverlapRef = (0, import_react16.useRef)(false);
14025
- const dragOverElRef = (0, import_react16.useRef)(null);
14026
- const [mediaHover, setMediaHover] = (0, import_react16.useState)(null);
14027
- const [carouselHover, setCarouselHover] = (0, import_react16.useState)(null);
14028
- const [uploadingRects, setUploadingRects] = (0, import_react16.useState)({});
14029
- const hoveredGapRef = (0, import_react16.useRef)(null);
14030
- const imageUnhoverTimerRef = (0, import_react16.useRef)(null);
14031
- const imageShowTimerRef = (0, import_react16.useRef)(null);
14032
- const editStylesRef = (0, import_react16.useRef)(null);
14033
- const activateRef = (0, import_react16.useRef)(() => {
14034
- });
14035
- const deactivateRef = (0, import_react16.useRef)(() => {
12752
+ const toolbarElRef = (0, import_react15.useRef)(null);
12753
+ const glowElRef = (0, import_react15.useRef)(null);
12754
+ const hoveredImageRef = (0, import_react15.useRef)(null);
12755
+ const hoveredImageHasTextOverlapRef = (0, import_react15.useRef)(false);
12756
+ const dragOverElRef = (0, import_react15.useRef)(null);
12757
+ const [mediaHover, setMediaHover] = (0, import_react15.useState)(null);
12758
+ const [carouselHover, setCarouselHover] = (0, import_react15.useState)(null);
12759
+ const [uploadingRects, setUploadingRects] = (0, import_react15.useState)({});
12760
+ const hoveredGapRef = (0, import_react15.useRef)(null);
12761
+ const imageUnhoverTimerRef = (0, import_react15.useRef)(null);
12762
+ const imageShowTimerRef = (0, import_react15.useRef)(null);
12763
+ const editStylesRef = (0, import_react15.useRef)(null);
12764
+ const activateRef = (0, import_react15.useRef)(() => {
14036
12765
  });
14037
- const selectRef = (0, import_react16.useRef)(() => {
12766
+ const deactivateRef = (0, import_react15.useRef)(() => {
14038
12767
  });
14039
- const selectFrameRef = (0, import_react16.useRef)(() => {
12768
+ const selectRef = (0, import_react15.useRef)(() => {
14040
12769
  });
14041
- const selectLogoRef = (0, import_react16.useRef)(() => {
12770
+ const selectFrameRef = (0, import_react15.useRef)(() => {
14042
12771
  });
14043
- const openLogoSizePanelRef = (0, import_react16.useRef)(() => {
12772
+ const deselectRef = (0, import_react15.useRef)(() => {
14044
12773
  });
14045
- const deselectRef = (0, import_react16.useRef)(() => {
12774
+ const reselectNavigationItemRef = (0, import_react15.useRef)(() => {
14046
12775
  });
14047
- const closeFloatingPanelOnlyRef = (0, import_react16.useRef)(() => {
12776
+ const commitNavigationTextEditRef = (0, import_react15.useRef)(() => {
14048
12777
  });
14049
- const reselectNavigationItemRef = (0, import_react16.useRef)(() => {
12778
+ const handleDeleteSelectedRef = (0, import_react15.useRef)(() => false);
12779
+ const runPendingDeleteUndoRef = (0, import_react15.useRef)(() => false);
12780
+ const isFooterFrameSelectionRef = (0, import_react15.useRef)(false);
12781
+ const refreshActiveCommandsRef = (0, import_react15.useRef)(() => {
14050
12782
  });
14051
- const commitNavigationTextEditRef = (0, import_react16.useRef)(() => {
14052
- });
14053
- const handleDeleteSelectedRef = (0, import_react16.useRef)(() => false);
14054
- const runPendingDeleteUndoRef = (0, import_react16.useRef)(() => false);
14055
- const isFooterFrameSelectionRef = (0, import_react16.useRef)(false);
14056
- const refreshActiveCommandsRef = (0, import_react16.useRef)(() => {
14057
- });
14058
- const postToParentRef = (0, import_react16.useRef)(postToParent2);
12783
+ const postToParentRef = (0, import_react15.useRef)(postToParent2);
14059
12784
  postToParentRef.current = postToParent2;
14060
- const aiSectionApiRef = (0, import_react16.useRef)(null);
14061
- const sectionsLoadedRef = (0, import_react16.useRef)(false);
14062
- const pendingScheduleConfigRequests = (0, import_react16.useRef)([]);
14063
- const [toolbarRect, setToolbarRect] = (0, import_react16.useState)(null);
14064
- const [toolbarVariant, setToolbarVariant] = (0, import_react16.useState)("none");
14065
- const toolbarVariantRef = (0, import_react16.useRef)("none");
12785
+ const aiSectionApiRef = (0, import_react15.useRef)(null);
12786
+ const sectionsLoadedRef = (0, import_react15.useRef)(false);
12787
+ const pendingScheduleConfigRequests = (0, import_react15.useRef)([]);
12788
+ const [toolbarRect, setToolbarRect] = (0, import_react15.useState)(null);
12789
+ const [toolbarVariant, setToolbarVariant] = (0, import_react15.useState)("none");
12790
+ const toolbarVariantRef = (0, import_react15.useRef)("none");
14066
12791
  toolbarVariantRef.current = toolbarVariant;
14067
- const [selectedIsCta, setSelectedIsCta] = (0, import_react16.useState)(false);
14068
- const [selectedIsSocial, setSelectedIsSocial] = (0, import_react16.useState)(false);
14069
- const [selectedIsSocialsRow, setSelectedIsSocialsRow] = (0, import_react16.useState)(false);
14070
- const [reorderHrefKey, setReorderHrefKey] = (0, import_react16.useState)(null);
14071
- const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react16.useState)(false);
14072
- const [toggleState, setToggleState] = (0, import_react16.useState)(null);
14073
- const [maxBadge, setMaxBadge] = (0, import_react16.useState)(null);
14074
- const [activeCommands, setActiveCommands] = (0, import_react16.useState)(/* @__PURE__ */ new Set());
14075
- const [sectionGap, setSectionGap] = (0, import_react16.useState)(null);
14076
- const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react16.useState)(false);
14077
- const hoveredNavContainerRef = (0, import_react16.useRef)(null);
14078
- const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react16.useState)(null);
14079
- const hoveredItemElRef = (0, import_react16.useRef)(null);
14080
- const [hoveredItemRect, setHoveredItemRect] = (0, import_react16.useState)(null);
14081
- const siblingHintElRef = (0, import_react16.useRef)(null);
14082
- const [siblingHintRect, setSiblingHintRect] = (0, import_react16.useState)(null);
14083
- const [siblingHintRects, setSiblingHintRects] = (0, import_react16.useState)([]);
14084
- const [isItemDragging, setIsItemDragging] = (0, import_react16.useState)(false);
14085
- const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react16.useState)(false);
12792
+ const [selectedIsCta, setSelectedIsCta] = (0, import_react15.useState)(false);
12793
+ const [reorderHrefKey, setReorderHrefKey] = (0, import_react15.useState)(null);
12794
+ const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react15.useState)(false);
12795
+ const [toggleState, setToggleState] = (0, import_react15.useState)(null);
12796
+ const [maxBadge, setMaxBadge] = (0, import_react15.useState)(null);
12797
+ const [activeCommands, setActiveCommands] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
12798
+ const [sectionGap, setSectionGap] = (0, import_react15.useState)(null);
12799
+ const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react15.useState)(false);
12800
+ const hoveredNavContainerRef = (0, import_react15.useRef)(null);
12801
+ const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react15.useState)(null);
12802
+ const hoveredItemElRef = (0, import_react15.useRef)(null);
12803
+ const [hoveredItemRect, setHoveredItemRect] = (0, import_react15.useState)(null);
12804
+ const siblingHintElRef = (0, import_react15.useRef)(null);
12805
+ const [siblingHintRect, setSiblingHintRect] = (0, import_react15.useState)(null);
12806
+ const [siblingHintRects, setSiblingHintRects] = (0, import_react15.useState)([]);
12807
+ const [isItemDragging, setIsItemDragging] = (0, import_react15.useState)(false);
12808
+ const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react15.useState)(false);
14086
12809
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
14087
- const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react16.useState)(null);
14088
- const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react16.useState)(null);
14089
- const footerDragRef = (0, import_react16.useRef)(null);
14090
- const [footerDropSlots, setFooterDropSlots] = (0, import_react16.useState)([]);
14091
- const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react16.useState)(null);
14092
- const [draggedItemRect, setDraggedItemRect] = (0, import_react16.useState)(null);
14093
- const footerPointerDragRef = (0, import_react16.useRef)(null);
14094
- const suppressNextClickRef = (0, import_react16.useRef)(false);
14095
- const suppressClickUntilRef = (0, import_react16.useRef)(0);
14096
- const [linkPopover, setLinkPopover] = (0, import_react16.useState)(null);
14097
- const linkPopoverSessionRef = (0, import_react16.useRef)(null);
14098
- const addNavAfterAnchorRef = (0, import_react16.useRef)(null);
14099
- const editContentRef = (0, import_react16.useRef)({});
14100
- const aiSectionsRef = (0, import_react16.useRef)("");
14101
- const pendingDeleteUndoRef = (0, import_react16.useRef)(null);
14102
- const [floatingPanel, setFloatingPanel] = (0, import_react16.useState)(null);
14103
- const floatingPanelOpenRef = (0, import_react16.useRef)(false);
14104
- const setFloatingPanelRef = (0, import_react16.useRef)(setFloatingPanel);
14105
- const [floatingPanelPos, setFloatingPanelPos] = (0, import_react16.useState)(null);
14106
- const [logoSizeDraft, setLogoSizeDraft] = (0, import_react16.useState)(null);
14107
- const [editorViewport, setEditorViewport] = (0, import_react16.useState)("desktop");
14108
- const [parentScrollSnap, setParentScrollSnap] = (0, import_react16.useState)(null);
14109
- const [sitePages, setSitePages] = (0, import_react16.useState)([]);
14110
- const [sectionsByPath, setSectionsByPath] = (0, import_react16.useState)({});
14111
- const sectionsPrefetchGenRef = (0, import_react16.useRef)(0);
14112
- const setLinkPopoverRef = (0, import_react16.useRef)(setLinkPopover);
14113
- const linkPopoverPanelRef = (0, import_react16.useRef)(null);
14114
- const linkPopoverOpenRef = (0, import_react16.useRef)(false);
14115
- const linkPopoverGraceUntilRef = (0, import_react16.useRef)(0);
12810
+ const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react15.useState)(null);
12811
+ const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react15.useState)(null);
12812
+ const footerDragRef = (0, import_react15.useRef)(null);
12813
+ const [footerDropSlots, setFooterDropSlots] = (0, import_react15.useState)([]);
12814
+ const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react15.useState)(null);
12815
+ const [draggedItemRect, setDraggedItemRect] = (0, import_react15.useState)(null);
12816
+ const footerPointerDragRef = (0, import_react15.useRef)(null);
12817
+ const suppressNextClickRef = (0, import_react15.useRef)(false);
12818
+ const suppressClickUntilRef = (0, import_react15.useRef)(0);
12819
+ const [linkPopover, setLinkPopover] = (0, import_react15.useState)(null);
12820
+ const linkPopoverSessionRef = (0, import_react15.useRef)(null);
12821
+ const addNavAfterAnchorRef = (0, import_react15.useRef)(null);
12822
+ const editContentRef = (0, import_react15.useRef)({});
12823
+ const aiSectionsRef = (0, import_react15.useRef)("");
12824
+ const pendingDeleteUndoRef = (0, import_react15.useRef)(null);
12825
+ const [sitePages, setSitePages] = (0, import_react15.useState)([]);
12826
+ const [sectionsByPath, setSectionsByPath] = (0, import_react15.useState)({});
12827
+ const sectionsPrefetchGenRef = (0, import_react15.useRef)(0);
12828
+ const setLinkPopoverRef = (0, import_react15.useRef)(setLinkPopover);
12829
+ const linkPopoverPanelRef = (0, import_react15.useRef)(null);
12830
+ const linkPopoverOpenRef = (0, import_react15.useRef)(false);
12831
+ const linkPopoverGraceUntilRef = (0, import_react15.useRef)(0);
14116
12832
  setLinkPopoverRef.current = setLinkPopover;
14117
- setFloatingPanelRef.current = setFloatingPanel;
14118
12833
  linkPopoverSessionRef.current = linkPopover;
14119
- floatingPanelOpenRef.current = Boolean(floatingPanel);
14120
- (0, import_react16.useEffect)(() => {
14121
- const syncViewport = () => {
14122
- const next = window.innerWidth <= 480 ? "mobile" : "desktop";
14123
- setEditorViewport((prev) => prev === next ? prev : next);
14124
- };
14125
- syncViewport();
14126
- window.addEventListener("resize", syncViewport);
14127
- return () => window.removeEventListener("resize", syncViewport);
14128
- }, []);
14129
12834
  const {
14130
12835
  navDragRef,
14131
12836
  navDropSlots,
@@ -14161,7 +12866,7 @@ function OhhwellsBridge() {
14161
12866
  const bumpLinkPopoverGrace = () => {
14162
12867
  linkPopoverGraceUntilRef.current = Date.now() + 350;
14163
12868
  };
14164
- const runSectionsPrefetch = (0, import_react16.useCallback)((pages) => {
12869
+ const runSectionsPrefetch = (0, import_react15.useCallback)((pages) => {
14165
12870
  if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
14166
12871
  const gen = ++sectionsPrefetchGenRef.current;
14167
12872
  const paths = pages.map((p) => p.path);
@@ -14180,9 +12885,9 @@ function OhhwellsBridge() {
14180
12885
  );
14181
12886
  });
14182
12887
  }, [isEditMode, pathname]);
14183
- const runSectionsPrefetchRef = (0, import_react16.useRef)(runSectionsPrefetch);
12888
+ const runSectionsPrefetchRef = (0, import_react15.useRef)(runSectionsPrefetch);
14184
12889
  runSectionsPrefetchRef.current = runSectionsPrefetch;
14185
- (0, import_react16.useEffect)(() => {
12890
+ (0, import_react15.useEffect)(() => {
14186
12891
  if (!linkPopover) {
14187
12892
  document.documentElement.removeAttribute("data-ohw-link-popover-open");
14188
12893
  return;
@@ -14210,7 +12915,7 @@ function OhhwellsBridge() {
14210
12915
  document.documentElement.removeAttribute("data-ohw-link-popover-open");
14211
12916
  };
14212
12917
  }, [linkPopover, postToParent2]);
14213
- (0, import_react16.useEffect)(() => {
12918
+ (0, import_react15.useEffect)(() => {
14214
12919
  if (!isEditMode) return;
14215
12920
  const useFixtures = shouldUseDevFixtures();
14216
12921
  if (useFixtures) {
@@ -14234,14 +12939,14 @@ function OhhwellsBridge() {
14234
12939
  if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
14235
12940
  return () => window.removeEventListener("message", onSitePages);
14236
12941
  }, [isEditMode, postToParent2]);
14237
- (0, import_react16.useEffect)(() => {
12942
+ (0, import_react15.useEffect)(() => {
14238
12943
  if (!isEditMode || shouldUseDevFixtures()) return;
14239
12944
  void loadAllSectionsManifest().then((manifest) => {
14240
12945
  if (Object.keys(manifest).length === 0) return;
14241
12946
  setSectionsByPath((prev) => ({ ...manifest, ...prev }));
14242
12947
  });
14243
12948
  }, [isEditMode]);
14244
- (0, import_react16.useEffect)(() => {
12949
+ (0, import_react15.useEffect)(() => {
14245
12950
  const update = () => {
14246
12951
  const el = activeElRef.current ?? selectedElRef.current;
14247
12952
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
@@ -14265,10 +12970,10 @@ function OhhwellsBridge() {
14265
12970
  vvp.removeEventListener("resize", update);
14266
12971
  };
14267
12972
  }, []);
14268
- const refreshStateRules = (0, import_react16.useCallback)(() => {
12973
+ const refreshStateRules = (0, import_react15.useCallback)(() => {
14269
12974
  editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
14270
12975
  }, []);
14271
- const processConfigRequest = (0, import_react16.useCallback)((insertAfterVal) => {
12976
+ const processConfigRequest = (0, import_react15.useCallback)((insertAfterVal) => {
14272
12977
  const tracker = getSectionsTracker();
14273
12978
  let entries = [];
14274
12979
  try {
@@ -14291,7 +12996,7 @@ function OhhwellsBridge() {
14291
12996
  }
14292
12997
  window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
14293
12998
  }, [isEditMode]);
14294
- const deactivate = (0, import_react16.useCallback)(() => {
12999
+ const deactivate = (0, import_react15.useCallback)(() => {
14295
13000
  const el = activeElRef.current;
14296
13001
  if (!el) return;
14297
13002
  const key = el.dataset.ohwKey;
@@ -14324,19 +13029,17 @@ function OhhwellsBridge() {
14324
13029
  setToolbarShowEditLink(false);
14325
13030
  postToParent2({ type: "ow:exit-edit" });
14326
13031
  }, [postToParent2]);
14327
- const clearSelectedAttr = (0, import_react16.useCallback)(() => {
13032
+ const clearSelectedAttr = (0, import_react15.useCallback)(() => {
14328
13033
  document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
14329
13034
  el.removeAttribute("data-ohw-selected");
14330
13035
  });
14331
13036
  }, []);
14332
- const deselect = (0, import_react16.useCallback)(() => {
13037
+ const deselect = (0, import_react15.useCallback)(() => {
14333
13038
  clearSelectedAttr();
14334
13039
  selectedElRef.current = null;
14335
13040
  selectedHrefKeyRef.current = null;
14336
13041
  selectedFooterColAttrRef.current = null;
14337
13042
  setSelectedIsCta(false);
14338
- setSelectedIsSocial(false);
14339
- setSelectedIsSocialsRow(false);
14340
13043
  setReorderHrefKey(null);
14341
13044
  setReorderDragDisabled(false);
14342
13045
  setIsFooterFrameSelection(false);
@@ -14348,21 +13051,17 @@ function OhhwellsBridge() {
14348
13051
  setIsItemDragging(false);
14349
13052
  hoveredNavContainerRef.current = null;
14350
13053
  setHoveredNavContainerRect(null);
14351
- hoveredItemElRef.current = null;
14352
- setHoveredItemRect(null);
14353
- setFloatingPanel(null);
14354
- setLogoSizeDraft(null);
14355
13054
  if (!activeElRef.current) {
14356
13055
  setNavGroupForceOpen(null, false);
14357
13056
  setToolbarRect(null);
14358
13057
  setToolbarVariant("none");
14359
13058
  }
14360
13059
  }, [clearSelectedAttr]);
14361
- const markSelected = (0, import_react16.useCallback)((el) => {
13060
+ const markSelected = (0, import_react15.useCallback)((el) => {
14362
13061
  clearSelectedAttr();
14363
13062
  el.setAttribute("data-ohw-selected", "");
14364
13063
  }, [clearSelectedAttr]);
14365
- const resolveHrefKeyElement = (0, import_react16.useCallback)((hrefKey) => {
13064
+ const resolveHrefKeyElement = (0, import_react15.useCallback)((hrefKey) => {
14366
13065
  if (isFooterHrefKey(hrefKey)) {
14367
13066
  return document.querySelector(
14368
13067
  `footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
@@ -14377,7 +13076,7 @@ function OhhwellsBridge() {
14377
13076
  `[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
14378
13077
  );
14379
13078
  }, []);
14380
- const resyncSelectedNavigationItem = (0, import_react16.useCallback)(() => {
13079
+ const resyncSelectedNavigationItem = (0, import_react15.useCallback)(() => {
14381
13080
  const hrefKey = selectedHrefKeyRef.current;
14382
13081
  if (hrefKey) {
14383
13082
  const link = resolveHrefKeyElement(hrefKey);
@@ -14415,14 +13114,12 @@ function OhhwellsBridge() {
14415
13114
  );
14416
13115
  }
14417
13116
  }, [resolveHrefKeyElement]);
14418
- const reselectNavigationItem = (0, import_react16.useCallback)((navAnchor) => {
13117
+ const reselectNavigationItem = (0, import_react15.useCallback)((navAnchor) => {
14419
13118
  selectedElRef.current = navAnchor;
14420
13119
  selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
14421
13120
  selectedFooterColAttrRef.current = null;
14422
13121
  markSelected(navAnchor);
14423
13122
  setSelectedIsCta(isCtaButton(navAnchor));
14424
- setSelectedIsSocial(Boolean(getSocialItem(navAnchor)));
14425
- setSelectedIsSocialsRow(false);
14426
13123
  const isDropdownTrigger = !isNestedNavChild(navAnchor) && (navItemHasDropdownChildren(navAnchor) || navItemOwnsDropdownPanel(navAnchor));
14427
13124
  if (isNestedNavChild(navAnchor)) {
14428
13125
  setNavGroupForceOpen(navAnchor, true);
@@ -14446,7 +13143,7 @@ function OhhwellsBridge() {
14446
13143
  setToolbarShowEditLink(false);
14447
13144
  setActiveCommands(/* @__PURE__ */ new Set());
14448
13145
  }, [markSelected]);
14449
- const commitNavigationTextEdit = (0, import_react16.useCallback)((navAnchor) => {
13146
+ const commitNavigationTextEdit = (0, import_react15.useCallback)((navAnchor) => {
14450
13147
  const el = activeElRef.current;
14451
13148
  if (!el) return;
14452
13149
  const key = el.dataset.ohwKey;
@@ -14473,7 +13170,7 @@ function OhhwellsBridge() {
14473
13170
  postToParent2({ type: "ow:exit-edit" });
14474
13171
  reselectNavigationItem(navAnchor);
14475
13172
  }, [postToParent2, reselectNavigationItem]);
14476
- const handleAddTopLevelNavItem = (0, import_react16.useCallback)(() => {
13173
+ const handleAddTopLevelNavItem = (0, import_react15.useCallback)(() => {
14477
13174
  const items = listNavbarRootItems();
14478
13175
  addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
14479
13176
  deselectRef.current();
@@ -14485,7 +13182,7 @@ function OhhwellsBridge() {
14485
13182
  intent: "add-nav"
14486
13183
  });
14487
13184
  }, []);
14488
- const maybeWarnNavLinkDropdownConflict = (0, import_react16.useCallback)(
13185
+ const maybeWarnNavLinkDropdownConflict = (0, import_react15.useCallback)(
14489
13186
  (anchor) => {
14490
13187
  if (!isNavbarHrefKey(anchor.getAttribute("data-ohw-href-key"))) return;
14491
13188
  if (!navDropdownsOpenOnClick()) return;
@@ -14498,7 +13195,7 @@ function OhhwellsBridge() {
14498
13195
  },
14499
13196
  [postToParent2]
14500
13197
  );
14501
- const handleNavDropdownOpenChange = (0, import_react16.useCallback)((open) => {
13198
+ const handleNavDropdownOpenChange = (0, import_react15.useCallback)((open) => {
14502
13199
  const selected = selectedElRef.current;
14503
13200
  if (!selected || !isNavigationItem2(selected)) return;
14504
13201
  setNavGroupForceOpen(selected, open);
@@ -14510,7 +13207,7 @@ function OhhwellsBridge() {
14510
13207
  }
14511
13208
  });
14512
13209
  }, []);
14513
- const handleFooterHeadingVisibleChange = (0, import_react16.useCallback)(
13210
+ const handleFooterHeadingVisibleChange = (0, import_react15.useCallback)(
14514
13211
  (visible) => {
14515
13212
  const selected = selectedElRef.current;
14516
13213
  if (!selected || !isFooterFrameSelectionRef.current) return;
@@ -14534,7 +13231,7 @@ function OhhwellsBridge() {
14534
13231
  },
14535
13232
  [postToParent2]
14536
13233
  );
14537
- const enterEditOnNewItem = (0, import_react16.useCallback)((anchor) => {
13234
+ const enterEditOnNewItem = (0, import_react15.useCallback)((anchor) => {
14538
13235
  const label = anchor.querySelector('[data-ohw-editable="text"]');
14539
13236
  if (!label) {
14540
13237
  selectRef.current(anchor);
@@ -14543,31 +13240,9 @@ function OhhwellsBridge() {
14543
13240
  setNavGroupForceOpen(anchor, true);
14544
13241
  activateRef.current(label);
14545
13242
  }, []);
14546
- const handleAddChildItem = (0, import_react16.useCallback)(() => {
13243
+ const handleAddChildItem = (0, import_react15.useCallback)(() => {
14547
13244
  const selected = selectedElRef.current;
14548
13245
  if (!selected) return;
14549
- const socialsRow = isSocialsRow(selected) ? selected : findSocialsRow(selected);
14550
- if (socialsRow) {
14551
- const after = getSocialItem(selected);
14552
- const result2 = insertSocialItem(socialsRow, after, editContentRef.current);
14553
- if (!result2) return;
14554
- const orderJson = JSON.stringify(result2.order);
14555
- applySocialsDisplayToRow(socialsRow, socialsDisplayFor(socialsRow, editContentRef.current));
14556
- editContentRef.current = { ...editContentRef.current, [SOCIALS_ORDER_KEY]: orderJson };
14557
- postToParent2({ type: "ow:change", nodes: [{ key: SOCIALS_ORDER_KEY, text: orderJson }] });
14558
- postToParentRef.current({
14559
- type: "ow:social-pick",
14560
- hrefKey: result2.hrefKey,
14561
- iconKey: result2.iconKey,
14562
- url: "",
14563
- iconStyle: detectIconStyle(result2.item),
14564
- platformId: "",
14565
- // Lets the editor undo the insert if the dialog is dismissed: an item that was never given
14566
- // an address should not survive a Cancel.
14567
- isNew: true
14568
- });
14569
- return;
14570
- }
14571
13246
  if (toolbarVariantRef.current === "select-frame" && isFooterFrameSelection) {
14572
13247
  if (!selected.hasAttribute("data-ohw-footer-col") && !selected.closest("[data-ohw-footer-col]")) {
14573
13248
  }
@@ -14641,7 +13316,7 @@ function OhhwellsBridge() {
14641
13316
  enterEditOnNewItem(result.anchor);
14642
13317
  });
14643
13318
  }, [enterEditOnNewItem, isFooterFrameSelection, maybeWarnNavLinkDropdownConflict, postToParent2]);
14644
- const handleAddFooterColumn = (0, import_react16.useCallback)(() => {
13319
+ const handleAddFooterColumn = (0, import_react15.useCallback)(() => {
14645
13320
  if (!canAddFooterColumn()) {
14646
13321
  postToParent2({
14647
13322
  type: "ow:toast",
@@ -14662,7 +13337,7 @@ function OhhwellsBridge() {
14662
13337
  selectRef.current(result.firstLink);
14663
13338
  });
14664
13339
  }, [postToParent2]);
14665
- const clearFooterDragVisuals = (0, import_react16.useCallback)(() => {
13340
+ const clearFooterDragVisuals = (0, import_react15.useCallback)(() => {
14666
13341
  footerDragRef.current = null;
14667
13342
  setSiblingHintRects([]);
14668
13343
  setFooterDropSlots([]);
@@ -14671,7 +13346,7 @@ function OhhwellsBridge() {
14671
13346
  setIsItemDragging(false);
14672
13347
  unlockFooterDragInteraction();
14673
13348
  }, []);
14674
- const refreshFooterDragVisuals = (0, import_react16.useCallback)((session, activeSlot, clientX, clientY) => {
13349
+ const refreshFooterDragVisuals = (0, import_react15.useCallback)((session, activeSlot, clientX, clientY) => {
14675
13350
  const dragged = session.draggedEl;
14676
13351
  setDraggedItemRect(dragged.getBoundingClientRect());
14677
13352
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -14680,13 +13355,6 @@ function OhhwellsBridge() {
14680
13355
  }
14681
13356
  session.activeSlot = activeSlot;
14682
13357
  setSiblingHintRects([]);
14683
- if (session.kind === "social") {
14684
- const slots2 = session.hrefKey ? buildSocialDropSlotsForKey(session.hrefKey) : [];
14685
- setFooterDropSlots(slots2);
14686
- const activeIdx2 = activeSlot ? slots2.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
14687
- setActiveFooterDropIndex(activeIdx2 >= 0 ? activeIdx2 : null);
14688
- return;
14689
- }
14690
13358
  if (session.kind === "link") {
14691
13359
  const columns = listFooterColumns();
14692
13360
  const slots2 = [];
@@ -14703,13 +13371,13 @@ function OhhwellsBridge() {
14703
13371
  const activeIdx = activeSlot ? slots.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
14704
13372
  setActiveFooterDropIndex(activeIdx >= 0 ? activeIdx : null);
14705
13373
  }, []);
14706
- const refreshFooterDragVisualsRef = (0, import_react16.useRef)(refreshFooterDragVisuals);
13374
+ const refreshFooterDragVisualsRef = (0, import_react15.useRef)(refreshFooterDragVisuals);
14707
13375
  refreshFooterDragVisualsRef.current = refreshFooterDragVisuals;
14708
- const commitFooterDragRef = (0, import_react16.useRef)(() => {
13376
+ const commitFooterDragRef = (0, import_react15.useRef)(() => {
14709
13377
  });
14710
- const beginFooterDragRef = (0, import_react16.useRef)(() => {
13378
+ const beginFooterDragRef = (0, import_react15.useRef)(() => {
14711
13379
  });
14712
- const beginFooterDrag = (0, import_react16.useCallback)(
13380
+ const beginFooterDrag = (0, import_react15.useCallback)(
14713
13381
  (session) => {
14714
13382
  const rect = session.draggedEl.getBoundingClientRect();
14715
13383
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -14723,13 +13391,13 @@ function OhhwellsBridge() {
14723
13391
  if (session.wasSelected && selectedElRef.current === session.draggedEl) {
14724
13392
  setToolbarRect(rect);
14725
13393
  }
14726
- const initialSlot = session.kind === "social" && session.hrefKey ? hitTestSocialDropSlot(session.lastClientX, session.lastClientY, session.hrefKey) : session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(session.lastClientX, session.lastClientY, session.hrefKey) : hitTestColumnDropSlot(session.lastClientX, session.lastClientY);
13394
+ const initialSlot = session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(session.lastClientX, session.lastClientY, session.hrefKey) : hitTestColumnDropSlot(session.lastClientX, session.lastClientY);
14727
13395
  refreshFooterDragVisuals(session, initialSlot, session.lastClientX, session.lastClientY);
14728
13396
  },
14729
13397
  [refreshFooterDragVisuals]
14730
13398
  );
14731
13399
  beginFooterDragRef.current = beginFooterDrag;
14732
- const commitFooterDrag = (0, import_react16.useCallback)(
13400
+ const commitFooterDrag = (0, import_react15.useCallback)(
14733
13401
  (clientX, clientY) => {
14734
13402
  const session = footerDragRef.current;
14735
13403
  if (!session) {
@@ -14739,11 +13407,8 @@ function OhhwellsBridge() {
14739
13407
  const x = typeof clientX === "number" && (clientX !== 0 || clientY !== 0) ? clientX : session.lastClientX;
14740
13408
  const y = typeof clientY === "number" && (clientX !== 0 || clientY !== 0) ? clientY : session.lastClientY;
14741
13409
  let nextOrder = null;
14742
- let nextSocialsOrder = null;
14743
- const slot = session.activeSlot ?? (session.kind === "social" && session.hrefKey ? hitTestSocialDropSlot(x, y, session.hrefKey) : session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(x, y, session.hrefKey) : session.kind === "column" ? hitTestColumnDropSlot(x, y) : null);
14744
- if (session.kind === "social" && session.hrefKey && slot) {
14745
- nextSocialsOrder = planSocialMove(session.hrefKey, slot.insertIndex);
14746
- } else if (session.kind === "link" && session.hrefKey && slot) {
13410
+ const slot = session.activeSlot ?? (session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(x, y, session.hrefKey) : session.kind === "column" ? hitTestColumnDropSlot(x, y) : null);
13411
+ if (session.kind === "link" && session.hrefKey && slot) {
14747
13412
  nextOrder = planFooterLinkMove(session.hrefKey, slot.columnIndex, slot.insertIndex);
14748
13413
  } else if (session.kind === "column" && slot) {
14749
13414
  nextOrder = planFooterColumnMove(session.sourceColumnIndex, slot.insertIndex);
@@ -14801,27 +13466,6 @@ function OhhwellsBridge() {
14801
13466
  }
14802
13467
  deselectRef.current();
14803
13468
  };
14804
- if (nextSocialsOrder) {
14805
- const orderJson = JSON.stringify(nextSocialsOrder);
14806
- editContentRef.current = { ...editContentRef.current, [SOCIALS_ORDER_KEY]: orderJson };
14807
- applySocialsOrder(nextSocialsOrder);
14808
- postToParentRef.current({
14809
- type: "ow:change",
14810
- nodes: [{ key: SOCIALS_ORDER_KEY, text: orderJson }]
14811
- });
14812
- applySelectionAfterDrop();
14813
- clearFooterDragVisuals();
14814
- const reapply = nextSocialsOrder;
14815
- requestAnimationFrame(() => {
14816
- if (editContentRef.current[SOCIALS_ORDER_KEY] === orderJson) applySocialsOrder(reapply);
14817
- applySelectionAfterDrop();
14818
- requestAnimationFrame(() => {
14819
- if (editContentRef.current[SOCIALS_ORDER_KEY] === orderJson) applySocialsOrder(reapply);
14820
- resyncSelectedNavigationItem();
14821
- });
14822
- });
14823
- return;
14824
- }
14825
13469
  if (nextOrder) {
14826
13470
  const orderJson = JSON.stringify(nextOrder);
14827
13471
  editContentRef.current = {
@@ -14857,25 +13501,10 @@ function OhhwellsBridge() {
14857
13501
  [clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
14858
13502
  );
14859
13503
  commitFooterDragRef.current = commitFooterDrag;
14860
- const startFooterLinkDrag = (0, import_react16.useCallback)(
13504
+ const startFooterLinkDrag = (0, import_react15.useCallback)(
14861
13505
  (anchor, clientX, clientY, wasSelected) => {
14862
13506
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
14863
- if (!hrefKey) return false;
14864
- if (getSocialItem(anchor)) {
14865
- beginFooterDrag({
14866
- kind: "social",
14867
- hrefKey,
14868
- columnEl: null,
14869
- sourceColumnIndex: 0,
14870
- wasSelected,
14871
- draggedEl: anchor,
14872
- lastClientX: clientX,
14873
- lastClientY: clientY,
14874
- activeSlot: null
14875
- });
14876
- return true;
14877
- }
14878
- if (!isFooterHrefKey(hrefKey)) return false;
13507
+ if (!hrefKey || !isFooterHrefKey(hrefKey)) return false;
14879
13508
  const column = findFooterColumnForLink(anchor);
14880
13509
  const columns = listFooterColumns();
14881
13510
  beginFooterDrag({
@@ -14893,7 +13522,7 @@ function OhhwellsBridge() {
14893
13522
  },
14894
13523
  [beginFooterDrag]
14895
13524
  );
14896
- const startFooterColumnDrag = (0, import_react16.useCallback)(
13525
+ const startFooterColumnDrag = (0, import_react15.useCallback)(
14897
13526
  (columnEl, clientX, clientY, wasSelected) => {
14898
13527
  const columns = listFooterColumns();
14899
13528
  const idx = columns.indexOf(columnEl);
@@ -14913,7 +13542,7 @@ function OhhwellsBridge() {
14913
13542
  },
14914
13543
  [beginFooterDrag]
14915
13544
  );
14916
- const handleItemDragStart = (0, import_react16.useCallback)(
13545
+ const handleItemDragStart = (0, import_react15.useCallback)(
14917
13546
  (e) => {
14918
13547
  const selected = selectedElRef.current;
14919
13548
  if (!selected) {
@@ -14933,7 +13562,7 @@ function OhhwellsBridge() {
14933
13562
  },
14934
13563
  [startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag]
14935
13564
  );
14936
- const handleItemDragEnd = (0, import_react16.useCallback)(
13565
+ const handleItemDragEnd = (0, import_react15.useCallback)(
14937
13566
  (e) => {
14938
13567
  if (footerDragRef.current) {
14939
13568
  const x = e?.clientX;
@@ -14959,7 +13588,7 @@ function OhhwellsBridge() {
14959
13588
  },
14960
13589
  [commitFooterDrag, commitNavDrag, navDragRef]
14961
13590
  );
14962
- const handleItemChromePointerDown = (0, import_react16.useCallback)((e) => {
13591
+ const handleItemChromePointerDown = (0, import_react15.useCallback)((e) => {
14963
13592
  if (e.button !== 0) return;
14964
13593
  const selected = selectedElRef.current;
14965
13594
  if (!selected) return;
@@ -14990,7 +13619,7 @@ function OhhwellsBridge() {
14990
13619
  }
14991
13620
  if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
14992
13621
  }, [armNavPressFromChrome]);
14993
- const handleItemChromeClick = (0, import_react16.useCallback)((clientX, clientY) => {
13622
+ const handleItemChromeClick = (0, import_react15.useCallback)((clientX, clientY) => {
14994
13623
  if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
14995
13624
  suppressNextClickRef.current = false;
14996
13625
  return;
@@ -15003,7 +13632,7 @@ function OhhwellsBridge() {
15003
13632
  }, []);
15004
13633
  reselectNavigationItemRef.current = reselectNavigationItem;
15005
13634
  commitNavigationTextEditRef.current = commitNavigationTextEdit;
15006
- const select = (0, import_react16.useCallback)((anchor) => {
13635
+ const select = (0, import_react15.useCallback)((anchor) => {
15007
13636
  if (!isNavigationItem2(anchor)) return;
15008
13637
  if (activeElRef.current) deactivate();
15009
13638
  aiSectionApiRef.current?.selectFromElement(anchor);
@@ -15012,8 +13641,6 @@ function OhhwellsBridge() {
15012
13641
  selectedFooterColAttrRef.current = null;
15013
13642
  markSelected(anchor);
15014
13643
  setSelectedIsCta(isCtaButton(anchor));
15015
- setSelectedIsSocial(Boolean(getSocialItem(anchor)));
15016
- setSelectedIsSocialsRow(false);
15017
13644
  clearHrefKeyHover(anchor);
15018
13645
  const isDropdownTrigger = !isNestedNavChild(anchor) && (navItemHasDropdownChildren(anchor) || navItemOwnsDropdownPanel(anchor));
15019
13646
  if (isNestedNavChild(anchor)) {
@@ -15043,10 +13670,8 @@ function OhhwellsBridge() {
15043
13670
  setToolbarRect(anchor.getBoundingClientRect());
15044
13671
  setToolbarShowEditLink(false);
15045
13672
  setActiveCommands(/* @__PURE__ */ new Set());
15046
- setFloatingPanel(null);
15047
- setLogoSizeDraft(null);
15048
13673
  }, [deactivate, markSelected]);
15049
- const selectFrame = (0, import_react16.useCallback)((el) => {
13674
+ const selectFrame = (0, import_react15.useCallback)((el) => {
15050
13675
  if (!isNavigationContainer(el)) return;
15051
13676
  if (activeElRef.current) deactivate();
15052
13677
  aiSectionApiRef.current?.selectFromElement(el);
@@ -15056,8 +13681,6 @@ function OhhwellsBridge() {
15056
13681
  selectedFooterColAttrRef.current = isFooterColumn ? el.getAttribute("data-ohw-footer-col") ?? String(listFooterColumns().indexOf(el)) : null;
15057
13682
  markSelected(el);
15058
13683
  setSelectedIsCta(false);
15059
- setSelectedIsSocial(false);
15060
- setSelectedIsSocialsRow(isSocialsRow(el));
15061
13684
  clearHrefKeyHover(el);
15062
13685
  setNavGroupForceOpen(null, false);
15063
13686
  hoveredNavContainerRef.current = null;
@@ -15094,145 +13717,14 @@ function OhhwellsBridge() {
15094
13717
  setToolbarRect(el.getBoundingClientRect());
15095
13718
  setToolbarShowEditLink(false);
15096
13719
  setActiveCommands(/* @__PURE__ */ new Set());
15097
- setFloatingPanel(null);
15098
- setLogoSizeDraft(null);
15099
13720
  }, [deactivate, markSelected, postToParent2]);
15100
- const selectLogo = (0, import_react16.useCallback)(
15101
- (logoEl) => {
15102
- if (activeElRef.current) deactivate();
15103
- selectedElRef.current = logoEl;
15104
- selectedHrefKeyRef.current = null;
15105
- selectedFooterColAttrRef.current = null;
15106
- markSelected(logoEl);
15107
- setSelectedIsCta(false);
15108
- setSelectedIsSocial(false);
15109
- setSelectedIsSocialsRow(false);
15110
- setSelectedIsSocialsRow(false);
15111
- clearHrefKeyHover(logoEl);
15112
- hoveredNavContainerRef.current = null;
15113
- setHoveredNavContainerRect(null);
15114
- setHoveredItemRect(null);
15115
- hoveredItemElRef.current = null;
15116
- siblingHintElRef.current = null;
15117
- setSiblingHintRect(null);
15118
- setSiblingHintRects([]);
15119
- setIsItemDragging(false);
15120
- setReorderHrefKey(null);
15121
- setReorderDragDisabled(false);
15122
- setIsFooterFrameSelection(false);
15123
- setToolbarVariant("logo");
15124
- setToolbarRect(getLogoInteractionRect(logoEl));
15125
- setToolbarShowEditLink(false);
15126
- setActiveCommands(/* @__PURE__ */ new Set());
15127
- },
15128
- [deactivate, markSelected]
15129
- );
15130
- const openLogoSizePanel = (0, import_react16.useCallback)((logoEl) => {
15131
- const placement = getLogoPlacement(logoEl);
15132
- const draft = readLogoSizeState(editContentRef.current, placement);
15133
- setLogoSizeDraft(draft);
15134
- setParentScrollSnap(parentScrollRef.current);
15135
- setFloatingPanel({
15136
- key: `logo-size:${placement}`,
15137
- title: "Logo",
15138
- context: placement === "navbar" ? "Navbar" : "Footer",
15139
- kind: "logo-size",
15140
- placement
15141
- });
15142
- }, []);
15143
- const openSocialsDisplayPanel = (0, import_react16.useCallback)((row) => {
15144
- setParentScrollSnap(parentScrollRef.current);
15145
- setFloatingPanel({
15146
- key: "socials-display",
15147
- title: "Style",
15148
- context: "Socials \xB7 Footer",
15149
- kind: "socials-display",
15150
- row
15151
- });
15152
- }, []);
15153
- const changeSocialsDisplay = (0, import_react16.useCallback)(
15154
- (row, next) => {
15155
- if (next.icon) {
15156
- const missing = socialsMissingIcons(row);
15157
- listSocialItems(row).forEach((item) => ensureIconSlot(item));
15158
- if (missing.length) {
15159
- postToParentRef.current({ type: "ow:social-icons-needed", items: missing });
15160
- }
15161
- }
15162
- applySocialsDisplayToRow(row, next);
15163
- requestAnimationFrame(() => {
15164
- if (selectedElRef.current === row && row.isConnected) setToolbarRect(row.getBoundingClientRect());
15165
- });
15166
- const displayJson = JSON.stringify(socialsDisplayWith(row, next, editContentRef.current));
15167
- editContentRef.current = { ...editContentRef.current, [SOCIALS_DISPLAY_KEY]: displayJson };
15168
- postToParentRef.current({
15169
- type: "ow:change",
15170
- nodes: [{ key: SOCIALS_DISPLAY_KEY, text: displayJson }],
15171
- flush: true
15172
- });
15173
- },
15174
- []
15175
- );
15176
- const closeFloatingPanelOnly = (0, import_react16.useCallback)(() => {
15177
- setFloatingPanel(null);
15178
- setLogoSizeDraft(null);
15179
- }, []);
15180
- const closeFloatingPanelAndDeselect = (0, import_react16.useCallback)(() => {
15181
- setFloatingPanel(null);
15182
- setLogoSizeDraft(null);
15183
- deselectRef.current();
15184
- }, []);
15185
- const persistLogoSizeDraft = (0, import_react16.useCallback)(
15186
- (placement, draft) => {
15187
- const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
15188
- const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
15189
- const nodes = [
15190
- { key: desktopKey, text: String(draft.desktopPx) }
15191
- ];
15192
- if (draft.mobileFollowing) {
15193
- nodes.push({ key: mobileKey, text: "" });
15194
- } else {
15195
- nodes.push({ key: mobileKey, text: String(draft.mobilePx) });
15196
- }
15197
- editContentRef.current = {
15198
- ...editContentRef.current,
15199
- [desktopKey]: String(draft.desktopPx),
15200
- [mobileKey]: draft.mobileFollowing ? "" : String(draft.mobilePx)
15201
- };
15202
- applyLogoSizeToPlacement(
15203
- placement,
15204
- draft.desktopPx,
15205
- draft.mobileFollowing ? draft.desktopPx : draft.mobilePx,
15206
- draft.mobileFollowing
15207
- );
15208
- postToParent2({ type: "ow:change", nodes });
15209
- requestAnimationFrame(() => {
15210
- const selected = selectedElRef.current;
15211
- if (!selected || toolbarVariantRef.current !== "logo") return;
15212
- const rect = getLogoInteractionRect(selected);
15213
- setToolbarRect(rect);
15214
- if (glowElRef.current) {
15215
- const GAP = SELECTION_CHROME_GAP2;
15216
- glowElRef.current.style.top = `${rect.top - GAP}px`;
15217
- glowElRef.current.style.left = `${rect.left - GAP}px`;
15218
- glowElRef.current.style.width = `${rect.width + GAP * 2}px`;
15219
- glowElRef.current.style.height = `${rect.height + GAP * 2}px`;
15220
- }
15221
- });
15222
- },
15223
- [postToParent2]
15224
- );
15225
- const activate = (0, import_react16.useCallback)((el, options) => {
13721
+ const activate = (0, import_react15.useCallback)((el, options) => {
15226
13722
  if (activeElRef.current === el) return;
15227
- if (isIconEditable(el)) return;
15228
- if (el.hasAttribute("data-ohw-social-label")) return;
15229
13723
  clearSelectedAttr();
15230
13724
  selectedElRef.current = null;
15231
13725
  selectedHrefKeyRef.current = null;
15232
13726
  selectedFooterColAttrRef.current = null;
15233
13727
  setSelectedIsCta(false);
15234
- setSelectedIsSocial(false);
15235
- setSelectedIsSocialsRow(false);
15236
13728
  deactivate();
15237
13729
  if (hoveredImageRef.current) {
15238
13730
  hoveredImageRef.current = null;
@@ -15302,38 +13794,8 @@ function OhhwellsBridge() {
15302
13794
  deactivateRef.current = deactivate;
15303
13795
  selectRef.current = select;
15304
13796
  selectFrameRef.current = selectFrame;
15305
- selectLogoRef.current = selectLogo;
15306
- openLogoSizePanelRef.current = openLogoSizePanel;
15307
13797
  deselectRef.current = deselect;
15308
- closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
15309
- const lastSiteWideScopeRef = (0, import_react16.useRef)(null);
15310
- (0, import_react16.useEffect)(() => {
15311
- if (!isEditMode) {
15312
- if (lastSiteWideScopeRef.current !== false) {
15313
- lastSiteWideScopeRef.current = false;
15314
- postToParent2({ type: "ow:site-wide-scope", active: false });
15315
- }
15316
- return;
15317
- }
15318
- const active = isSiteWideScopeActive({
15319
- selected: selectedElRef.current,
15320
- hoveredItem: hoveredItemElRef.current,
15321
- hoveredNavContainer: hoveredNavContainerRef.current,
15322
- active: activeElRef.current
15323
- });
15324
- if (lastSiteWideScopeRef.current === active) return;
15325
- lastSiteWideScopeRef.current = active;
15326
- postToParent2({ type: "ow:site-wide-scope", active });
15327
- }, [
15328
- isEditMode,
15329
- hoveredItemRect,
15330
- hoveredNavContainerRect,
15331
- toolbarVariant,
15332
- toolbarRect,
15333
- isFooterFrameSelection,
15334
- postToParent2
15335
- ]);
15336
- (0, import_react16.useLayoutEffect)(() => {
13798
+ (0, import_react15.useLayoutEffect)(() => {
15337
13799
  if (!subdomain || isEditMode) {
15338
13800
  setFetchState("done");
15339
13801
  return;
@@ -15344,13 +13806,9 @@ function OhhwellsBridge() {
15344
13806
  aiSectionsRef.current = content[AI_SECTIONS_KEY];
15345
13807
  applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
15346
13808
  }
15347
- applyBrandChrome(content);
15348
13809
  for (const [key, val] of Object.entries(content)) {
15349
13810
  if (key === "__ohw_sections") continue;
15350
13811
  if (key === AI_SECTIONS_KEY) continue;
15351
- if (key === LOGO_PLACEHOLDER_KEY) continue;
15352
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
15353
- if (BRAND_CHROME_KEYS.has(key)) continue;
15354
13812
  if (applyVideoSettingNode(key, val)) continue;
15355
13813
  if (applyCarouselNode(key, val)) continue;
15356
13814
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -15377,20 +13835,14 @@ function OhhwellsBridge() {
15377
13835
  }
15378
13836
  } else if (el.dataset.ohwEditable === "link") {
15379
13837
  applyLinkHref(el, val);
15380
- } else if (el.dataset.ohwEditable === "icon") {
15381
- applyIconMarkup(el, val);
15382
13838
  } else if (el.innerHTML !== val) {
15383
13839
  el.innerHTML = val;
15384
13840
  }
15385
13841
  });
15386
13842
  applyLinkByKey(key, val);
15387
13843
  }
15388
- applyLogoFromContent(content);
15389
- applyLogoSizes(content);
15390
13844
  reconcileNavbarItemsFromContent(content);
15391
13845
  reconcileFooterOrderFromContent(content);
15392
- reconcileSocialsFromContent(content);
15393
- applySocialsDisplayFromContent(content);
15394
13846
  enforceLinkHrefs();
15395
13847
  initSectionsFromContent(content, true);
15396
13848
  sectionsLoadedRef.current = true;
@@ -15406,9 +13858,7 @@ function OhhwellsBridge() {
15406
13858
  let cancelled = false;
15407
13859
  setFetchState("loading");
15408
13860
  const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
15409
- const initialPath = pathname;
15410
- fetchedContentPaths.add(`${subdomain}::${initialPath}`);
15411
- fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(initialPath)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
13861
+ fetch(`${apiUrl}/api/public/sites/${subdomain}/content`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
15412
13862
  if (cancelled) return;
15413
13863
  const content = data?.content ?? {};
15414
13864
  contentCache.set(subdomain, content);
@@ -15421,7 +13871,7 @@ function OhhwellsBridge() {
15421
13871
  cancelled = true;
15422
13872
  };
15423
13873
  }, [subdomain, isEditMode]);
15424
- (0, import_react16.useEffect)(() => {
13874
+ (0, import_react15.useEffect)(() => {
15425
13875
  if (!subdomain || isEditMode) return;
15426
13876
  let debounceTimer = null;
15427
13877
  let observer = null;
@@ -15431,12 +13881,8 @@ function OhhwellsBridge() {
15431
13881
  retryMissingSchedulingMounts(getPageSchedulingEntries(content["__ohw_sections"]), false);
15432
13882
  observer?.disconnect();
15433
13883
  try {
15434
- applyBrandChrome(content);
15435
13884
  for (const [key, val] of Object.entries(content)) {
15436
13885
  if (key === "__ohw_sections") continue;
15437
- if (key === LOGO_PLACEHOLDER_KEY) continue;
15438
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
15439
- if (BRAND_CHROME_KEYS.has(key)) continue;
15440
13886
  if (applyVideoSettingNode(key, val)) continue;
15441
13887
  if (applyCarouselNode(key, val)) continue;
15442
13888
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -15457,12 +13903,8 @@ function OhhwellsBridge() {
15457
13903
  });
15458
13904
  applyLinkByKey(key, val);
15459
13905
  }
15460
- applyLogoFromContent(content);
15461
13906
  reconcileNavbarItemsFromContent(content);
15462
13907
  reconcileFooterOrderFromContent(content);
15463
- reconcileSocialsFromContent(content);
15464
- applySocialsDisplayFromContent(content);
15465
- applySocialsDisplayFromContent(content);
15466
13908
  } finally {
15467
13909
  observer?.observe(document.body, { childList: true, subtree: true });
15468
13910
  }
@@ -15473,17 +13915,6 @@ function OhhwellsBridge() {
15473
13915
  debounceTimer = setTimeout(applyFromCache, 150);
15474
13916
  };
15475
13917
  applyFromCache();
15476
- const pathCacheKey = `${subdomain}::${pathname}`;
15477
- if (!fetchedContentPaths.has(pathCacheKey)) {
15478
- fetchedContentPaths.add(pathCacheKey);
15479
- const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
15480
- fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(pathname)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
15481
- if (!data?.content) return;
15482
- contentCache.set(subdomain, data.content);
15483
- applyFromCache();
15484
- }).catch(() => {
15485
- });
15486
- }
15487
13918
  observer = new MutationObserver(scheduleApply);
15488
13919
  observer.observe(document.body, { childList: true, subtree: true });
15489
13920
  return () => {
@@ -15491,16 +13922,16 @@ function OhhwellsBridge() {
15491
13922
  if (debounceTimer) clearTimeout(debounceTimer);
15492
13923
  };
15493
13924
  }, [subdomain, isEditMode, pathname]);
15494
- (0, import_react16.useLayoutEffect)(() => {
13925
+ (0, import_react15.useLayoutEffect)(() => {
15495
13926
  const el = document.getElementById("ohw-loader");
15496
13927
  if (!el) return;
15497
13928
  const visible = Boolean(subdomain) && fetchState !== "done";
15498
13929
  el.style.display = visible ? "flex" : "none";
15499
13930
  }, [subdomain, fetchState]);
15500
- (0, import_react16.useEffect)(() => {
13931
+ (0, import_react15.useEffect)(() => {
15501
13932
  postToParent2({ type: "ow:navigation", path: pathname });
15502
13933
  }, [pathname, postToParent2]);
15503
- (0, import_react16.useEffect)(() => {
13934
+ (0, import_react15.useEffect)(() => {
15504
13935
  if (!isEditMode) return;
15505
13936
  if (linkPopoverSessionRef.current?.intent === "add-nav") return;
15506
13937
  if (document.querySelector("[data-ohw-section-picker]")) return;
@@ -15508,7 +13939,7 @@ function OhhwellsBridge() {
15508
13939
  deselectRef.current();
15509
13940
  deactivateRef.current();
15510
13941
  }, [pathname, isEditMode]);
15511
- (0, import_react16.useEffect)(() => {
13942
+ (0, import_react15.useEffect)(() => {
15512
13943
  const contentForNav = () => {
15513
13944
  if (isEditMode) return editContentRef.current;
15514
13945
  if (!subdomain) return {};
@@ -15540,9 +13971,6 @@ function OhhwellsBridge() {
15540
13971
  const content = contentForNav();
15541
13972
  reconcileNavbarItemsFromContent(content);
15542
13973
  reconcileFooterOrderFromContent(content);
15543
- reconcileSocialsFromContent(content);
15544
- applySocialsDisplayFromContent(content);
15545
- applySocialsDisplayFromContent(content);
15546
13974
  document.querySelectorAll("footer [data-ohw-href-key]").forEach((el) => {
15547
13975
  if (isFooterHrefKey(el.getAttribute("data-ohw-href-key"))) {
15548
13976
  disableNativeHrefDrag(el);
@@ -15576,7 +14004,7 @@ function OhhwellsBridge() {
15576
14004
  observer?.disconnect();
15577
14005
  };
15578
14006
  }, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
15579
- (0, import_react16.useEffect)(() => {
14007
+ (0, import_react15.useEffect)(() => {
15580
14008
  if (!isEditMode) return;
15581
14009
  const measure = () => {
15582
14010
  const h = document.body.scrollHeight;
@@ -15600,7 +14028,7 @@ function OhhwellsBridge() {
15600
14028
  window.removeEventListener("resize", handleResize);
15601
14029
  };
15602
14030
  }, [pathname, isEditMode, postToParent2]);
15603
- (0, import_react16.useEffect)(() => {
14031
+ (0, import_react15.useEffect)(() => {
15604
14032
  if (!subdomainFromQuery || isEditMode) return;
15605
14033
  const handleClick = (e) => {
15606
14034
  const anchor = e.target.closest("a");
@@ -15616,7 +14044,7 @@ function OhhwellsBridge() {
15616
14044
  document.addEventListener("click", handleClick, true);
15617
14045
  return () => document.removeEventListener("click", handleClick, true);
15618
14046
  }, [subdomainFromQuery, isEditMode, router]);
15619
- (0, import_react16.useEffect)(() => {
14047
+ (0, import_react15.useEffect)(() => {
15620
14048
  if (!isEditMode) {
15621
14049
  editStylesRef.current?.base.remove();
15622
14050
  editStylesRef.current?.forceHover.remove();
@@ -15745,7 +14173,6 @@ function OhhwellsBridge() {
15745
14173
  if (target.closest("[data-ohw-state-toggle]")) return;
15746
14174
  if (target.closest("[data-ohw-max-badge]")) return;
15747
14175
  if (isInsideLinkEditor(target)) return;
15748
- if (isInsideFloatingPanel(target)) return;
15749
14176
  if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
15750
14177
  const beneath = document.elementsFromPoint(e.clientX, e.clientY).find(
15751
14178
  (el) => el instanceof HTMLElement && !el.closest("[data-ohw-bridge-root]") && el.closest("[data-ohw-section]") != null
@@ -15809,21 +14236,6 @@ function OhhwellsBridge() {
15809
14236
  return;
15810
14237
  }
15811
14238
  }
15812
- const logoEl = getLogoElement(target);
15813
- if (logoEl) {
15814
- e.preventDefault();
15815
- e.stopPropagation();
15816
- if (!logoHasUploadedImage(logoEl)) {
15817
- deselectRef.current();
15818
- deactivateRef.current();
15819
- const identity = readLogoIdentityFromDom();
15820
- postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
15821
- return;
15822
- }
15823
- selectLogoRef.current(logoEl);
15824
- openLogoSizePanelRef.current(logoEl);
15825
- return;
15826
- }
15827
14239
  const editable = target.closest("[data-ohw-editable]");
15828
14240
  if (editable) {
15829
14241
  if (editable.dataset.ohwEditable === "link") {
@@ -15840,17 +14252,6 @@ function OhhwellsBridge() {
15840
14252
  });
15841
14253
  return;
15842
14254
  }
15843
- if (isIconEditable(editable) && !getSocialItem(editable)) {
15844
- e.preventDefault();
15845
- e.stopPropagation();
15846
- aiSectionApiRef.current?.selectFromElement(editable);
15847
- postToParentRef.current({
15848
- type: "ow:icon-pick",
15849
- key: editable.dataset.ohwKey ?? "",
15850
- current: currentIconRef(editable)
15851
- });
15852
- return;
15853
- }
15854
14255
  if (isMediaEditable(editable)) {
15855
14256
  e.preventDefault();
15856
14257
  e.stopPropagation();
@@ -15865,7 +14266,6 @@ function OhhwellsBridge() {
15865
14266
  e.stopPropagation();
15866
14267
  if (selectedElRef.current === navAnchor) {
15867
14268
  if (e.detail >= 2) return;
15868
- if (requestSocialDialog(navAnchor, postToParentRef.current, editContentRef.current)) return;
15869
14269
  activateRef.current(editable, { caretX: e.clientX, caretY: e.clientY });
15870
14270
  return;
15871
14271
  }
@@ -15882,7 +14282,6 @@ function OhhwellsBridge() {
15882
14282
  e.preventDefault();
15883
14283
  e.stopPropagation();
15884
14284
  if (selectedElRef.current === hrefAnchor) {
15885
- if (requestSocialDialog(hrefAnchor, postToParentRef.current, editContentRef.current)) return;
15886
14285
  const textEditable = hrefAnchor.querySelector('[data-ohw-editable="text"]') ?? hrefAnchor.querySelector("[data-ohw-editable]");
15887
14286
  if (textEditable) {
15888
14287
  activateRef.current(textEditable, {
@@ -15921,13 +14320,6 @@ function OhhwellsBridge() {
15921
14320
  selectFrameRef.current(navContainerToSelect);
15922
14321
  return;
15923
14322
  }
15924
- const socialsRowToSelect = isSocialsRow(target) ? target : null;
15925
- if (socialsRowToSelect && !getSocialItem(target)) {
15926
- e.preventDefault();
15927
- e.stopPropagation();
15928
- selectFrameRef.current(socialsRowToSelect);
15929
- return;
15930
- }
15931
14323
  const footerColumnToSelect = resolveFooterColumnSelectionTarget(target, e.clientX, e.clientY);
15932
14324
  if (footerColumnToSelect) {
15933
14325
  e.preventDefault();
@@ -15976,11 +14368,9 @@ function OhhwellsBridge() {
15976
14368
  if (target.closest("[data-ohw-state-toggle]")) return;
15977
14369
  if (target.closest("[data-ohw-max-badge]")) return;
15978
14370
  if (isInsideLinkEditor(target)) return;
15979
- if (isInsideFloatingPanel(target)) return;
15980
14371
  if (target.closest('[data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-drag-handle-container], [data-slot="drag-handle"]')) {
15981
14372
  return;
15982
14373
  }
15983
- if (getSocialItem(target)) return;
15984
14374
  const navLabel = getNavigationLabelEditable(target);
15985
14375
  const editable = navLabel?.editable ?? target.closest('[data-ohw-editable="text"], [data-ohw-editable="plain"]');
15986
14376
  if (!editable || isMediaEditable(editable) || editable.dataset.ohwEditable === "link") return;
@@ -16004,16 +14394,6 @@ function OhhwellsBridge() {
16004
14394
  setHoveredNavContainerRect(null);
16005
14395
  return;
16006
14396
  }
16007
- if (isInsideFloatingPanel(target) || isPointOverFloatingPanel(e.clientX, e.clientY)) {
16008
- hoveredItemElRef.current = null;
16009
- setHoveredItemRect(null);
16010
- hoveredNavContainerRef.current = null;
16011
- setHoveredNavContainerRect(null);
16012
- siblingHintElRef.current = null;
16013
- setSiblingHintRect(null);
16014
- setSiblingHintRects([]);
16015
- return;
16016
- }
16017
14397
  {
16018
14398
  const selected2 = selectedElRef.current;
16019
14399
  const selectedIsFooterColumn = Boolean(selected2) && !isFooterLinksContainer(selected2) && (selected2.hasAttribute("data-ohw-footer-col") || selected2.hasAttribute("data-ohw-footer-column") || Boolean(selected2.closest("footer") && isInferredFooterGroup2(selected2)));
@@ -16021,7 +14401,7 @@ function OhhwellsBridge() {
16021
14401
  const allowFooterLinksHover = toolbarVariantRef.current !== "select-frame" || selectedIsFooterColumn;
16022
14402
  if (allowNavContainerHover) {
16023
14403
  const navContainer = target.closest("[data-ohw-nav-container]");
16024
- if (navContainer && !getNavigationItemAnchor(target) && !getLogoElement(target)) {
14404
+ if (navContainer && !getNavigationItemAnchor(target)) {
16025
14405
  hoveredNavContainerRef.current = navContainer;
16026
14406
  setHoveredNavContainerRect(navContainer.getBoundingClientRect());
16027
14407
  hoveredItemElRef.current = null;
@@ -16050,15 +14430,6 @@ function OhhwellsBridge() {
16050
14430
  setHoveredNavContainerRect(null);
16051
14431
  }
16052
14432
  }
16053
- const logoEl = getLogoElement(target);
16054
- if (logoEl) {
16055
- hoveredNavContainerRef.current = null;
16056
- setHoveredNavContainerRect(null);
16057
- if (selectedElRef.current === logoEl) return;
16058
- hoveredItemElRef.current = logoEl;
16059
- setHoveredItemRect(getLogoInteractionRect(logoEl));
16060
- return;
16061
- }
16062
14433
  const navAnchor = getNavigationItemAnchor(target);
16063
14434
  if (navAnchor) {
16064
14435
  hoveredNavContainerRef.current = null;
@@ -16084,11 +14455,6 @@ function OhhwellsBridge() {
16084
14455
  const selected = selectedElRef.current;
16085
14456
  if (selected && (selected === editable || selected.contains(editable))) return;
16086
14457
  if (!isMediaEditable(editable) && !editable.hasAttribute("contenteditable")) {
16087
- if (isIconEditable(editable)) {
16088
- hoveredItemElRef.current = editable;
16089
- setHoveredItemRect(editable.getBoundingClientRect());
16090
- return;
16091
- }
16092
14458
  const hoverTarget = editable.closest("[data-ohw-href-key]") ?? editable;
16093
14459
  if (hoverTarget.hasAttribute("data-ohw-href-key")) {
16094
14460
  clearHrefKeyHover(hoverTarget);
@@ -16096,12 +14462,6 @@ function OhhwellsBridge() {
16096
14462
  setHoveredItemRect(hoverTarget.getBoundingClientRect());
16097
14463
  } else if (!isInsideNavigationItem(editable)) {
16098
14464
  hoverTarget.setAttribute("data-ohw-hovered", "");
16099
- if (editable.closest("footer") || editable.closest('[data-ohw-section="footer"]')) {
16100
- hoveredNavContainerRef.current = null;
16101
- setHoveredNavContainerRect(null);
16102
- hoveredItemElRef.current = editable;
16103
- setHoveredItemRect(editable.getBoundingClientRect());
16104
- }
16105
14465
  }
16106
14466
  }
16107
14467
  };
@@ -16137,30 +14497,11 @@ function OhhwellsBridge() {
16137
14497
  }
16138
14498
  return;
16139
14499
  }
16140
- const logoEl = getLogoElement(target);
16141
- if (logoEl) {
16142
- const related2 = e.relatedTarget instanceof Element ? e.relatedTarget : null;
16143
- if (related2 && (logoEl === related2 || logoEl.contains(related2) || related2.closest?.('[data-ohw-role="logo"], [data-ohw-logo]'))) {
16144
- return;
16145
- }
16146
- if (hoveredItemElRef.current === logoEl) {
16147
- hoveredItemElRef.current = null;
16148
- setHoveredItemRect(null);
16149
- }
16150
- return;
16151
- }
16152
14500
  const editable = target.closest("[data-ohw-editable]");
16153
14501
  if (!editable) return;
16154
14502
  const related = e.relatedTarget instanceof Element ? e.relatedTarget : null;
16155
14503
  if (related?.closest("[data-ohw-drag-handle-container], [data-ohw-item-interaction]")) return;
16156
14504
  if (!isMediaEditable(editable)) {
16157
- if (isIconEditable(editable) && hoveredItemElRef.current === editable) {
16158
- if (!related?.closest("[data-ohw-item-interaction]")) {
16159
- hoveredItemElRef.current = null;
16160
- setHoveredItemRect(null);
16161
- }
16162
- return;
16163
- }
16164
14505
  const hoverTarget = editable.closest("[data-ohw-href-key]") ?? editable;
16165
14506
  if (hoverTarget.hasAttribute("data-ohw-href-key")) {
16166
14507
  if (!related?.closest("[data-ohw-href-key]")) {
@@ -16169,13 +14510,6 @@ function OhhwellsBridge() {
16169
14510
  }
16170
14511
  } else {
16171
14512
  hoverTarget.removeAttribute("data-ohw-hovered");
16172
- if (hoveredItemElRef.current === editable) {
16173
- const stillOnEditable = related instanceof Element && related.closest("[data-ohw-editable]") === editable;
16174
- if (!stillOnEditable) {
16175
- hoveredItemElRef.current = null;
16176
- setHoveredItemRect(null);
16177
- }
16178
- }
16179
14513
  }
16180
14514
  }
16181
14515
  };
@@ -16292,26 +14626,6 @@ function OhhwellsBridge() {
16292
14626
  hoveredNavContainerRef.current = null;
16293
14627
  setHoveredNavContainerRect(null);
16294
14628
  }
16295
- const logoCandidates = [
16296
- ...document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]'),
16297
- ...document.querySelectorAll("nav a:not([data-ohw-href-key]), [data-ohw-nav-root] a:not([data-ohw-href-key])"),
16298
- ...document.querySelectorAll("footer img")
16299
- ];
16300
- const seenLogos = /* @__PURE__ */ new Set();
16301
- for (const candidate of logoCandidates) {
16302
- const logo = getLogoElement(candidate);
16303
- if (!logo || seenLogos.has(logo)) continue;
16304
- seenLogos.add(logo);
16305
- const r2 = logo.getBoundingClientRect();
16306
- if (x < r2.left || x > r2.right || y < r2.top || y > r2.bottom) continue;
16307
- hoveredNavContainerRef.current = null;
16308
- setHoveredNavContainerRect(null);
16309
- if (selectedElRef.current !== logo) {
16310
- hoveredItemElRef.current = logo;
16311
- setHoveredItemRect(getLogoInteractionRect(logo));
16312
- }
16313
- return;
16314
- }
16315
14629
  const navContainers = Array.from(
16316
14630
  document.querySelectorAll("[data-ohw-nav-container]")
16317
14631
  );
@@ -16397,7 +14711,7 @@ function OhhwellsBridge() {
16397
14711
  }
16398
14712
  };
16399
14713
  const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false) => {
16400
- if (linkPopoverOpenRef.current || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
14714
+ if (linkPopoverOpenRef.current) {
16401
14715
  if (hoveredImageRef.current) {
16402
14716
  hoveredImageRef.current = null;
16403
14717
  hoveredImageHasTextOverlapRef.current = false;
@@ -16651,7 +14965,7 @@ function OhhwellsBridge() {
16651
14965
  }
16652
14966
  };
16653
14967
  const probeHoverCardsAt = (clientX, clientY, fromParentViewport = false) => {
16654
- if (linkPopoverOpenRef.current || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY) || document.documentElement.hasAttribute("data-ohw-section-picking")) {
14968
+ if (linkPopoverOpenRef.current || document.documentElement.hasAttribute("data-ohw-section-picking")) {
16655
14969
  if (activeStateElRef.current) {
16656
14970
  activeStateElRef.current.removeAttribute("data-ohw-state-hovered");
16657
14971
  activeStateElRef.current = null;
@@ -16719,19 +15033,6 @@ function OhhwellsBridge() {
16719
15033
  };
16720
15034
  const handleMouseMove = (e) => {
16721
15035
  const { clientX, clientY } = e;
16722
- if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
16723
- hoveredItemElRef.current = null;
16724
- setHoveredItemRect(null);
16725
- hoveredNavContainerRef.current = null;
16726
- setHoveredNavContainerRect(null);
16727
- siblingHintElRef.current = null;
16728
- setSiblingHintRect(null);
16729
- setSiblingHintRects([]);
16730
- dismissImageHover();
16731
- clearImageHover();
16732
- setSectionGap(null);
16733
- return;
16734
- }
16735
15036
  probeSectionGapAt(clientX, clientY);
16736
15037
  probeImageAt(clientX, clientY);
16737
15038
  probeHoverCardsAt(clientX, clientY);
@@ -16740,11 +15041,6 @@ function OhhwellsBridge() {
16740
15041
  if (e.data?.type !== "ow:pointer-sync") return;
16741
15042
  const { clientX, clientY } = e.data;
16742
15043
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
16743
- if (floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
16744
- dismissImageHover();
16745
- clearImageHover();
16746
- return;
16747
- }
16748
15044
  probeSectionGapAt(clientX, clientY);
16749
15045
  probeImageAt(clientX, clientY);
16750
15046
  probeHoverCardsAt(clientX, clientY);
@@ -16754,7 +15050,7 @@ function OhhwellsBridge() {
16754
15050
  if (footerSession) {
16755
15051
  e.preventDefault();
16756
15052
  if (e.dataTransfer) e.dataTransfer.dropEffect = "move";
16757
- const slot = footerSession.kind === "social" && footerSession.hrefKey ? hitTestSocialDropSlot(e.clientX, e.clientY, footerSession.hrefKey) : footerSession.kind === "link" && footerSession.hrefKey ? hitTestLinkDropSlot(e.clientX, e.clientY, footerSession.hrefKey) : hitTestColumnDropSlot(e.clientX, e.clientY);
15053
+ const slot = footerSession.kind === "link" && footerSession.hrefKey ? hitTestLinkDropSlot(e.clientX, e.clientY, footerSession.hrefKey) : hitTestColumnDropSlot(e.clientX, e.clientY);
16758
15054
  refreshFooterDragVisualsRef.current(footerSession, slot, e.clientX, e.clientY);
16759
15055
  return;
16760
15056
  }
@@ -16806,62 +15102,6 @@ function OhhwellsBridge() {
16806
15102
  resumeAnimTracks();
16807
15103
  clearImageHover();
16808
15104
  };
16809
- const handleSocialCancel = (e) => {
16810
- if (e.data?.type !== "ow:social-cancel") return;
16811
- const { hrefKey } = e.data;
16812
- const item = hrefKey ? findSocialByHrefKey(hrefKey) : null;
16813
- if (!item) return;
16814
- const removed = removeSocialItem(item, editContentRef.current);
16815
- if (!removed) return;
16816
- const orderJson = JSON.stringify(removed.order);
16817
- editContentRef.current = { ...editContentRef.current, [SOCIALS_ORDER_KEY]: orderJson };
16818
- postToParentRef.current({ type: "ow:change", nodes: [{ key: SOCIALS_ORDER_KEY, text: orderJson }] });
16819
- deselectRef.current();
16820
- };
16821
- const handleSocialUpdate = (e) => {
16822
- if (e.data?.type !== "ow:social-update") return;
16823
- const updates = Array.isArray(e.data.items) ? e.data.items : [e.data];
16824
- const nodes = [];
16825
- for (const { hrefKey, iconKey, url, iconMarkup, platformId, label } of updates) {
16826
- if (hrefKey) {
16827
- document.querySelectorAll(`[data-ohw-href-key="${hrefKey}"]`).forEach((el) => applyLinkHref(el, url));
16828
- nodes.push({ key: hrefKey, text: url });
16829
- }
16830
- if (iconKey && typeof iconMarkup === "string" && iconMarkup) {
16831
- document.querySelectorAll(`[data-ohw-key="${iconKey}"][data-ohw-editable="icon"]`).forEach((el) => {
16832
- applyIconMarkup(el, iconMarkup);
16833
- });
16834
- nodes.push({ key: iconKey, text: iconMarkup });
16835
- }
16836
- if (iconKey && platformId) nodes.push({ key: socialPlatformKey(iconKey), text: platformId });
16837
- if (iconKey && label) {
16838
- const labelKey = socialLabelKey(iconKey);
16839
- document.querySelectorAll(`[data-ohw-key="${labelKey}"]`).forEach((el) => {
16840
- el.textContent = label;
16841
- });
16842
- nodes.push({ key: labelKey, text: label });
16843
- }
16844
- }
16845
- if (!nodes.length) return;
16846
- editContentRef.current = {
16847
- ...editContentRef.current,
16848
- ...Object.fromEntries(nodes.map((node) => [node.key, node.text]))
16849
- };
16850
- postToParentRef.current({ type: "ow:change", nodes, flush: true });
16851
- };
16852
- const handleIconMarkup = (e) => {
16853
- if (e.data?.type !== "ow:icon-markup") return;
16854
- const { key, markup } = e.data;
16855
- if (!key || typeof markup !== "string") return;
16856
- const targets = document.querySelectorAll(
16857
- `[data-ohw-key="${key}"][data-ohw-editable="icon"]`
16858
- );
16859
- if (!targets.length) return;
16860
- targets.forEach((el) => {
16861
- applyIconMarkup(el, markup);
16862
- });
16863
- postToParentRef.current({ type: "ow:change", nodes: [{ key, text: markup }], flush: true });
16864
- };
16865
15105
  const handleImageUrl = (e) => {
16866
15106
  if (e.data?.type !== "ow:image-url") return;
16867
15107
  const { key, url } = e.data;
@@ -16994,7 +15234,6 @@ function OhhwellsBridge() {
16994
15234
  aiSectionsRef.current = content[AI_SECTIONS_KEY];
16995
15235
  applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
16996
15236
  }
16997
- applyBrandChrome(content);
16998
15237
  let sectionsJson = null;
16999
15238
  for (const [key, val] of Object.entries(content)) {
17000
15239
  if (key === "__ohw_sections") {
@@ -17002,9 +15241,6 @@ function OhhwellsBridge() {
17002
15241
  continue;
17003
15242
  }
17004
15243
  if (key === AI_SECTIONS_KEY) continue;
17005
- if (key === LOGO_PLACEHOLDER_KEY) continue;
17006
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
17007
- if (BRAND_CHROME_KEYS.has(key)) continue;
17008
15244
  if (applyVideoSettingNode(key, val)) continue;
17009
15245
  if (applyCarouselNode(key, val)) continue;
17010
15246
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -17024,8 +15260,6 @@ function OhhwellsBridge() {
17024
15260
  });
17025
15261
  applyLinkByKey(key, val);
17026
15262
  }
17027
- applyLogoFromContent(content);
17028
- applyLogoSizes(content);
17029
15263
  if (sectionsJson) {
17030
15264
  initSectionsFromContent({ __ohw_sections: sectionsJson }, true);
17031
15265
  sectionsLoadedRef.current = true;
@@ -17040,58 +15274,6 @@ function OhhwellsBridge() {
17040
15274
  if (hydratedHeight > 50) postToParentRef.current({ type: "ow:height", height: hydratedHeight });
17041
15275
  postToParentRef.current({ type: "ow:hydrate-done" });
17042
15276
  };
17043
- const handleUpdateLogoIdentity = (e) => {
17044
- if (e.data?.type !== "ow:update-logo-identity") return;
17045
- const rawText = typeof e.data.text === "string" ? e.data.text : "";
17046
- const alt = typeof e.data.alt === "string" ? e.data.alt : rawText;
17047
- const href = typeof e.data.href === "string" ? e.data.href : void 0;
17048
- const imageProvided = "image" in e.data;
17049
- const imageUrl = imageProvided && typeof e.data.image === "string" && e.data.image.trim() ? e.data.image.trim() : imageProvided ? null : void 0;
17050
- let isPlaceholder = e.data.isPlaceholder !== false;
17051
- if (imageUrl) isPlaceholder = false;
17052
- else if (imageProvided && imageUrl === null) {
17053
- isPlaceholder = e.data.isPlaceholder === true || !rawText.trim() || resolveLogoDisplayText(rawText) === PLACEHOLDER_BUSINESS_NAME;
17054
- }
17055
- const display = applyLogoIdentity(rawText, isPlaceholder);
17056
- const displayAlt = resolveLogoDisplayText(alt || display);
17057
- if (imageUrl !== void 0) {
17058
- applyLogoImage(imageUrl, displayAlt);
17059
- } else {
17060
- for (const key of LOGO_IMAGE_KEYS) {
17061
- document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
17062
- const img = el instanceof HTMLImageElement ? el : el.querySelector("img");
17063
- if (img) img.alt = displayAlt;
17064
- });
17065
- }
17066
- }
17067
- if (href !== void 0) {
17068
- applyLogoHref(href);
17069
- applyLinkByKey("nav-logo-href", href);
17070
- applyLinkByKey("footer-logo-href", href);
17071
- applyLinkByKey("logo-href", href);
17072
- }
17073
- const nodes = [
17074
- ...LOGO_TEXT_KEYS.map((key) => ({ key, text: display })),
17075
- { key: LOGO_PLACEHOLDER_KEY, text: isPlaceholder ? "true" : "false" },
17076
- { key: LOGO_ALT_KEY, text: displayAlt }
17077
- ];
17078
- if (imageUrl !== void 0) {
17079
- if (imageUrl) {
17080
- for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: imageUrl });
17081
- } else {
17082
- for (const key of LOGO_IMAGE_KEYS) nodes.push({ key, text: "" });
17083
- }
17084
- }
17085
- if (href !== void 0) {
17086
- for (const key of LOGO_HREF_KEYS) nodes.push({ key, text: href.trim() || "/" });
17087
- }
17088
- editContentRef.current = {
17089
- ...editContentRef.current,
17090
- ...Object.fromEntries(nodes.map(({ key, text }) => [key, text]))
17091
- };
17092
- applyLogoSizes(editContentRef.current);
17093
- postToParentRef.current({ type: "ow:change", nodes });
17094
- };
17095
15277
  window.addEventListener("message", handleHydrate);
17096
15278
  const postAiSectionsChanged = () => {
17097
15279
  postToParentRef.current({
@@ -17156,12 +15338,6 @@ function OhhwellsBridge() {
17156
15338
  closeLinkPopoverRef.current();
17157
15339
  return;
17158
15340
  }
17159
- if (floatingPanelOpenRef.current) {
17160
- setFloatingPanelRef.current(null);
17161
- deselectRef.current();
17162
- deactivateRef.current();
17163
- return;
17164
- }
17165
15341
  deselectRef.current();
17166
15342
  deactivateRef.current();
17167
15343
  };
@@ -17181,10 +15357,6 @@ function OhhwellsBridge() {
17181
15357
  closeLinkPopoverRef.current();
17182
15358
  return;
17183
15359
  }
17184
- if (floatingPanelOpenRef.current) {
17185
- closeFloatingPanelOnlyRef.current();
17186
- return;
17187
- }
17188
15360
  if (activeElRef.current) {
17189
15361
  const hrefCtx = getHrefKeyFromElement(activeElRef.current);
17190
15362
  const navAnchor = hrefCtx ? getNavigationItemAnchor(hrefCtx.anchor) : null;
@@ -17215,10 +15387,6 @@ function OhhwellsBridge() {
17215
15387
  return;
17216
15388
  }
17217
15389
  if (selectedElRef.current) {
17218
- if (toolbarVariantRef.current === "logo") {
17219
- deselectRef.current();
17220
- return;
17221
- }
17222
15390
  if (toolbarVariantRef.current === "select-frame") {
17223
15391
  const parent2 = getNavigationSelectionParent(selectedElRef.current);
17224
15392
  if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
@@ -17252,16 +15420,7 @@ function OhhwellsBridge() {
17252
15420
  closeLinkPopoverRef.current();
17253
15421
  return;
17254
15422
  }
17255
- if (e.key === "Escape" && floatingPanelOpenRef.current) {
17256
- e.preventDefault();
17257
- closeFloatingPanelOnlyRef.current();
17258
- return;
17259
- }
17260
15423
  if (e.key === "Escape" && selectedElRef.current && !activeElRef.current) {
17261
- if (toolbarVariantRef.current === "logo") {
17262
- deselectRef.current();
17263
- return;
17264
- }
17265
15424
  if (toolbarVariantRef.current === "select-frame") {
17266
15425
  const parent2 = getNavigationSelectionParent(selectedElRef.current);
17267
15426
  if (parent2 && isNavigationContainer(parent2) && isFooterLinksContainer(parent2) && !isFooterLinksContainer(selectedElRef.current)) {
@@ -17339,8 +15498,7 @@ function OhhwellsBridge() {
17339
15498
  const handleScroll = () => {
17340
15499
  const focusEl = activeElRef.current ?? selectedElRef.current;
17341
15500
  if (focusEl) {
17342
- const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : toolbarVariantRef.current === "logo" ? null : focusEl;
17343
- const r2 = measureEl ? measureEl.getBoundingClientRect() : toolbarVariantRef.current === "logo" ? getLogoInteractionRect(focusEl) : focusEl.getBoundingClientRect();
15501
+ const r2 = activeElRef.current ? getEditMeasureEl(activeElRef.current).getBoundingClientRect() : focusEl.getBoundingClientRect();
17344
15502
  applyToolbarPos(r2);
17345
15503
  setToolbarRect(r2);
17346
15504
  setMaxBadge((prev) => prev && activeElRef.current ? { ...prev, rect: r2 } : prev);
@@ -17350,9 +15508,7 @@ function OhhwellsBridge() {
17350
15508
  setToggleState((prev) => prev ? { ...prev, rect } : null);
17351
15509
  }
17352
15510
  if (hoveredItemElRef.current) {
17353
- const hoverEl = hoveredItemElRef.current;
17354
- const logo = getLogoElement(hoverEl);
17355
- setHoveredItemRect(logo ? getLogoInteractionRect(logo) : hoverEl.getBoundingClientRect());
15511
+ setHoveredItemRect(hoveredItemElRef.current.getBoundingClientRect());
17356
15512
  }
17357
15513
  if (hoveredNavContainerRef.current) {
17358
15514
  setHoveredNavContainerRect(hoveredNavContainerRef.current.getBoundingClientRect());
@@ -17372,7 +15528,7 @@ function OhhwellsBridge() {
17372
15528
  }
17373
15529
  if (footerDragRef.current) {
17374
15530
  const session = footerDragRef.current;
17375
- const slot = session.kind === "social" && session.hrefKey ? hitTestSocialDropSlot(session.lastClientX, session.lastClientY, session.hrefKey) : session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(session.lastClientX, session.lastClientY, session.hrefKey) : hitTestColumnDropSlot(session.lastClientX, session.lastClientY);
15531
+ const slot = session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(session.lastClientX, session.lastClientY, session.hrefKey) : hitTestColumnDropSlot(session.lastClientX, session.lastClientY);
17376
15532
  refreshFooterDragVisualsRef.current(session, slot, session.lastClientX, session.lastClientY);
17377
15533
  }
17378
15534
  if (navDragRef.current) {
@@ -17406,12 +15562,8 @@ function OhhwellsBridge() {
17406
15562
  if (inserted) {
17407
15563
  const tracker = getSectionsTracker();
17408
15564
  postToParentRef.current({ type: "ow:change", nodes: [{ key: "__ohw_sections", text: tracker.textContent ?? "[]" }] });
17409
- const reportHeight = () => {
17410
- const h = document.body.scrollHeight;
17411
- if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
17412
- };
17413
- reportHeight();
17414
- setTimeout(reportHeight, 500);
15565
+ const h = document.documentElement.scrollHeight;
15566
+ if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
17415
15567
  }
17416
15568
  };
17417
15569
  const handleSwitchSchedule = (e) => {
@@ -17604,17 +15756,13 @@ function OhhwellsBridge() {
17604
15756
  if (e.data?.type !== "ow:parent-scroll") return;
17605
15757
  const { iframeOffsetTop, headerH, canvasH } = e.data;
17606
15758
  parentScrollRef.current = { iframeOffsetTop, headerH, canvasH };
17607
- if (floatingPanelOpenRef.current) {
17608
- setParentScrollSnap({ iframeOffsetTop, headerH, canvasH });
17609
- }
17610
15759
  if (visibleViewportRef.current) {
17611
15760
  applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
17612
15761
  }
17613
15762
  const focusEl = activeElRef.current ?? selectedElRef.current;
17614
15763
  if (focusEl) {
17615
- const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : toolbarVariantRef.current === "logo" ? null : focusEl;
17616
- const r2 = measureEl ? measureEl.getBoundingClientRect() : toolbarVariantRef.current === "logo" ? getLogoInteractionRect(focusEl) : focusEl.getBoundingClientRect();
17617
- applyToolbarPos(r2);
15764
+ const measureEl = activeElRef.current ? getEditMeasureEl(activeElRef.current) : focusEl;
15765
+ applyToolbarPos(measureEl.getBoundingClientRect());
17618
15766
  }
17619
15767
  };
17620
15768
  const handleClickAt = (e) => {
@@ -17639,25 +15787,6 @@ function OhhwellsBridge() {
17639
15787
  postToParentRef.current({ type: "ow:image-pick", key: stateCardImage.dataset.ohwKey ?? "", elementType: stateCardImage.dataset.ohwEditable ?? "image" });
17640
15788
  return;
17641
15789
  }
17642
- const logoAtPoint = Array.from(
17643
- document.querySelectorAll('[data-ohw-role="logo"], [data-ohw-logo]')
17644
- ).map((el) => getLogoElement(el)).find((logo) => {
17645
- if (!logo) return false;
17646
- const r2 = logo.getBoundingClientRect();
17647
- return clientX >= r2.left && clientX <= r2.right && clientY >= r2.top && clientY <= r2.bottom;
17648
- });
17649
- if (logoAtPoint) {
17650
- if (!logoHasUploadedImage(logoAtPoint)) {
17651
- deselectRef.current();
17652
- deactivateRef.current();
17653
- const identity = readLogoIdentityFromDom();
17654
- postToParentRef.current({ type: "ow:open-logo-settings", ...identity });
17655
- return;
17656
- }
17657
- selectLogoRef.current(logoAtPoint);
17658
- openLogoSizePanelRef.current(logoAtPoint);
17659
- return;
17660
- }
17661
15790
  const textEditable = Array.from(
17662
15791
  document.querySelectorAll(NON_MEDIA_SELECTOR)
17663
15792
  ).find((el) => {
@@ -17719,9 +15848,6 @@ function OhhwellsBridge() {
17719
15848
  window.addEventListener("message", handleClearSchedulingWidget);
17720
15849
  window.addEventListener("message", handleRemoveSchedulingSection);
17721
15850
  window.addEventListener("message", handleCollectSection);
17722
- window.addEventListener("message", handleSocialCancel);
17723
- window.addEventListener("message", handleSocialUpdate);
17724
- window.addEventListener("message", handleIconMarkup);
17725
15851
  window.addEventListener("message", handleImageUrl);
17726
15852
  window.addEventListener("message", handleImageUploading);
17727
15853
  window.addEventListener("message", handleCarouselChange);
@@ -17729,14 +15855,6 @@ function OhhwellsBridge() {
17729
15855
  window.addEventListener("message", handleParentScroll);
17730
15856
  window.addEventListener("message", handlePointerSync);
17731
15857
  window.addEventListener("message", handleClickAt);
17732
- window.addEventListener("message", handleUpdateLogoIdentity);
17733
- const handleViewMode = (e) => {
17734
- if (e.data?.type !== "ow:view-mode") return;
17735
- const mode = e.data.mode === "Mobile" || e.data.mode === "mobile" ? "mobile" : "desktop";
17736
- setEditorViewport(mode);
17737
- applyLogoSizes(editContentRef.current);
17738
- };
17739
- window.addEventListener("message", handleViewMode);
17740
15858
  const handleViewportResize = () => {
17741
15859
  if (visibleViewportRef.current) {
17742
15860
  applyVisibleViewport(visibleViewportRef.current, parentScrollRef.current);
@@ -17781,9 +15899,6 @@ function OhhwellsBridge() {
17781
15899
  window.removeEventListener("message", handleClearSchedulingWidget);
17782
15900
  window.removeEventListener("message", handleRemoveSchedulingSection);
17783
15901
  window.removeEventListener("message", handleCollectSection);
17784
- window.removeEventListener("message", handleSocialCancel);
17785
- window.removeEventListener("message", handleSocialUpdate);
17786
- window.removeEventListener("message", handleIconMarkup);
17787
15902
  window.removeEventListener("message", handleImageUrl);
17788
15903
  window.removeEventListener("message", handleImageUploading);
17789
15904
  window.removeEventListener("message", handleCarouselChange);
@@ -17792,8 +15907,6 @@ function OhhwellsBridge() {
17792
15907
  window.removeEventListener("resize", handleViewportResize);
17793
15908
  window.removeEventListener("message", handlePointerSync);
17794
15909
  window.removeEventListener("message", handleClickAt);
17795
- window.removeEventListener("message", handleUpdateLogoIdentity);
17796
- window.removeEventListener("message", handleViewMode);
17797
15910
  window.removeEventListener("message", handleHydrate);
17798
15911
  window.removeEventListener("message", handleAiApplyTree);
17799
15912
  window.removeEventListener("message", handleAiDeleteSection);
@@ -17807,7 +15920,7 @@ function OhhwellsBridge() {
17807
15920
  if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
17808
15921
  };
17809
15922
  }, [isEditMode, refreshStateRules]);
17810
- (0, import_react16.useEffect)(() => {
15923
+ (0, import_react15.useEffect)(() => {
17811
15924
  if (!isEditMode) return;
17812
15925
  const THRESHOLD = 10;
17813
15926
  const resolveWasSelected = (el) => {
@@ -17862,7 +15975,7 @@ function OhhwellsBridge() {
17862
15975
  clearTextSelection();
17863
15976
  const session = footerDragRef.current;
17864
15977
  if (!session) return;
17865
- const slot = session.kind === "social" && session.hrefKey ? hitTestSocialDropSlot(e.clientX, e.clientY, session.hrefKey) : session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(e.clientX, e.clientY, session.hrefKey) : hitTestColumnDropSlot(e.clientX, e.clientY);
15978
+ const slot = session.kind === "link" && session.hrefKey ? hitTestLinkDropSlot(e.clientX, e.clientY, session.hrefKey) : hitTestColumnDropSlot(e.clientX, e.clientY);
17866
15979
  refreshFooterDragVisualsRef.current(session, slot, e.clientX, e.clientY);
17867
15980
  return;
17868
15981
  }
@@ -17961,7 +16074,7 @@ function OhhwellsBridge() {
17961
16074
  unlockFooterDragInteraction();
17962
16075
  };
17963
16076
  }, [isEditMode]);
17964
- (0, import_react16.useEffect)(() => {
16077
+ (0, import_react15.useEffect)(() => {
17965
16078
  const handler = (e) => {
17966
16079
  if (e.data?.type !== "ow:request-schedule-config") return;
17967
16080
  const insertAfterVal = e.data.insertAfter;
@@ -17977,7 +16090,7 @@ function OhhwellsBridge() {
17977
16090
  window.addEventListener("message", handler);
17978
16091
  return () => window.removeEventListener("message", handler);
17979
16092
  }, [processConfigRequest]);
17980
- (0, import_react16.useEffect)(() => {
16093
+ (0, import_react15.useEffect)(() => {
17981
16094
  if (!isEditMode) return;
17982
16095
  document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
17983
16096
  el.removeAttribute("data-ohw-active-state");
@@ -18013,13 +16126,13 @@ function OhhwellsBridge() {
18013
16126
  clearTimeout(timer);
18014
16127
  };
18015
16128
  }, [pathname, isEditMode, refreshStateRules, postToParent2]);
18016
- (0, import_react16.useEffect)(() => {
16129
+ (0, import_react15.useEffect)(() => {
18017
16130
  scrollToHashSectionWhenReady();
18018
16131
  const onHashChange = () => scrollToHashSectionWhenReady();
18019
16132
  window.addEventListener("hashchange", onHashChange);
18020
16133
  return () => window.removeEventListener("hashchange", onHashChange);
18021
16134
  }, [pathname]);
18022
- const handleCommand = (0, import_react16.useCallback)((cmd) => {
16135
+ const handleCommand = (0, import_react15.useCallback)((cmd) => {
18023
16136
  const el = activeElRef.current;
18024
16137
  const selBefore = window.getSelection();
18025
16138
  let savedOffsets = null;
@@ -18055,7 +16168,7 @@ function OhhwellsBridge() {
18055
16168
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
18056
16169
  refreshActiveCommandsRef.current();
18057
16170
  }, []);
18058
- const handleStateChange = (0, import_react16.useCallback)((state) => {
16171
+ const handleStateChange = (0, import_react15.useCallback)((state) => {
18059
16172
  if (!activeStateElRef.current) return;
18060
16173
  const el = activeStateElRef.current;
18061
16174
  if (state === "Default") {
@@ -18068,7 +16181,7 @@ function OhhwellsBridge() {
18068
16181
  }
18069
16182
  setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
18070
16183
  }, [deactivate]);
18071
- const reselectAfterLinkPopover = (0, import_react16.useCallback)(
16184
+ const reselectAfterLinkPopover = (0, import_react15.useCallback)(
18072
16185
  (hrefKey) => {
18073
16186
  requestAnimationFrame(() => {
18074
16187
  const el = resolveHrefKeyElement(hrefKey);
@@ -18077,7 +16190,7 @@ function OhhwellsBridge() {
18077
16190
  },
18078
16191
  [resolveHrefKeyElement]
18079
16192
  );
18080
- const closeLinkPopover = (0, import_react16.useCallback)(() => {
16193
+ const closeLinkPopover = (0, import_react15.useCallback)(() => {
18081
16194
  const session = linkPopoverSessionRef.current;
18082
16195
  addNavAfterAnchorRef.current = null;
18083
16196
  setLinkPopover(null);
@@ -18085,9 +16198,9 @@ function OhhwellsBridge() {
18085
16198
  reselectAfterLinkPopover(session.key);
18086
16199
  }
18087
16200
  }, [reselectAfterLinkPopover]);
18088
- const closeLinkPopoverRef = (0, import_react16.useRef)(closeLinkPopover);
16201
+ const closeLinkPopoverRef = (0, import_react15.useRef)(closeLinkPopover);
18089
16202
  closeLinkPopoverRef.current = closeLinkPopover;
18090
- const openLinkPopoverForActive = (0, import_react16.useCallback)(() => {
16203
+ const openLinkPopoverForActive = (0, import_react15.useCallback)(() => {
18091
16204
  const hrefCtx = getHrefKeyFromElement(activeElRef.current);
18092
16205
  if (!hrefCtx) return;
18093
16206
  bumpLinkPopoverGrace();
@@ -18098,15 +16211,11 @@ function OhhwellsBridge() {
18098
16211
  });
18099
16212
  deactivate();
18100
16213
  }, [deactivate]);
18101
- const openLinkPopoverForSelected = (0, import_react16.useCallback)(() => {
16214
+ const openLinkPopoverForSelected = (0, import_react15.useCallback)(() => {
18102
16215
  const anchor = selectedElRef.current;
18103
16216
  if (!anchor) return;
18104
16217
  const key = anchor.getAttribute("data-ohw-href-key");
18105
16218
  if (!key) return;
18106
- if (requestSocialDialog(anchor, postToParentRef.current, editContentRef.current)) {
18107
- deselect();
18108
- return;
18109
- }
18110
16219
  bumpLinkPopoverGrace();
18111
16220
  setLinkPopover({
18112
16221
  key,
@@ -18115,7 +16224,7 @@ function OhhwellsBridge() {
18115
16224
  });
18116
16225
  deselect();
18117
16226
  }, [deselect]);
18118
- const handleSelectParent = (0, import_react16.useCallback)(() => {
16227
+ const handleSelectParent = (0, import_react15.useCallback)(() => {
18119
16228
  const selected = selectedElRef.current;
18120
16229
  if (!selected) return;
18121
16230
  if (toolbarVariantRef.current === "select-frame") {
@@ -18142,37 +16251,11 @@ function OhhwellsBridge() {
18142
16251
  }
18143
16252
  deselectRef.current();
18144
16253
  }, []);
18145
- const handleDuplicateSelected = (0, import_react16.useCallback)(() => {
16254
+ const handleDuplicateSelected = (0, import_react15.useCallback)(() => {
18146
16255
  const selected = selectedElRef.current;
18147
16256
  if (!selected || !isNavigationItem2(selected)) return;
18148
16257
  const hrefKey = selected.getAttribute("data-ohw-href-key");
18149
16258
  if (!hrefKey) return;
18150
- const social = getSocialItem(selected);
18151
- if (social) {
18152
- const result = duplicateSocialItem(social, editContentRef.current);
18153
- if (!result) return;
18154
- const orderJson = JSON.stringify(result.order);
18155
- const carried = [
18156
- { from: result.copiedFrom?.href, to: result.hrefKey },
18157
- { from: result.copiedFrom?.icon, to: result.iconKey },
18158
- { from: result.copiedFrom?.icon ? socialPlatformKey(result.copiedFrom.icon) : null, to: socialPlatformKey(result.iconKey) }
18159
- ];
18160
- const nodes = [{ key: SOCIALS_ORDER_KEY, text: orderJson }];
18161
- for (const { from, to } of carried) {
18162
- const value = from ? editContentRef.current[from] : void 0;
18163
- if (value) nodes.push({ key: to, text: value });
18164
- }
18165
- editContentRef.current = {
18166
- ...editContentRef.current,
18167
- ...Object.fromEntries(nodes.map((node) => [node.key, node.text]))
18168
- };
18169
- postToParent2({ type: "ow:change", nodes });
18170
- enforceLinkHrefs();
18171
- const copyRow = findSocialsRow(result.item);
18172
- if (copyRow) applySocialsDisplayToRow(copyRow, socialsDisplayFor(copyRow, editContentRef.current));
18173
- requestAnimationFrame(() => selectRef.current(result.item));
18174
- return;
18175
- }
18176
16259
  if (isNavbarHrefKey(hrefKey)) {
18177
16260
  const result = duplicateNavbarItem(selected);
18178
16261
  if (!result) return;
@@ -18258,7 +16341,7 @@ function OhhwellsBridge() {
18258
16341
  });
18259
16342
  }
18260
16343
  }, [postToParent2]);
18261
- const runPendingDeleteUndo = (0, import_react16.useCallback)(() => {
16344
+ const runPendingDeleteUndo = (0, import_react15.useCallback)(() => {
18262
16345
  const pending = pendingDeleteUndoRef.current;
18263
16346
  if (!pending) return false;
18264
16347
  pendingDeleteUndoRef.current = null;
@@ -18266,7 +16349,7 @@ function OhhwellsBridge() {
18266
16349
  enforceLinkHrefs();
18267
16350
  return true;
18268
16351
  }, []);
18269
- const handleDeleteSelected = (0, import_react16.useCallback)(() => {
16352
+ const handleDeleteSelected = (0, import_react15.useCallback)(() => {
18270
16353
  const selected = selectedElRef.current;
18271
16354
  if (!selected) return false;
18272
16355
  return deleteSelectedNavFooterItem({
@@ -18287,7 +16370,7 @@ function OhhwellsBridge() {
18287
16370
  }, [postToParent2]);
18288
16371
  handleDeleteSelectedRef.current = handleDeleteSelected;
18289
16372
  runPendingDeleteUndoRef.current = runPendingDeleteUndo;
18290
- const handleLinkPopoverSubmit = (0, import_react16.useCallback)(
16373
+ const handleLinkPopoverSubmit = (0, import_react15.useCallback)(
18291
16374
  (target) => {
18292
16375
  const session = linkPopoverSessionRef.current;
18293
16376
  if (!session) return;
@@ -18353,19 +16436,19 @@ function OhhwellsBridge() {
18353
16436
  const showEditLink = toolbarShowEditLink;
18354
16437
  const currentSections = sectionsByPath[pathname] ?? [];
18355
16438
  linkPopoverOpenRef.current = linkPopover !== null;
18356
- const handleMediaReplace = (0, import_react16.useCallback)(
16439
+ const handleMediaReplace = (0, import_react15.useCallback)(
18357
16440
  (key) => {
18358
16441
  postToParent2({ type: "ow:image-pick", key, elementType: mediaHover?.elementType ?? "image" });
18359
16442
  },
18360
16443
  [postToParent2, mediaHover?.elementType]
18361
16444
  );
18362
- const handleEditCarousel = (0, import_react16.useCallback)(
16445
+ const handleEditCarousel = (0, import_react15.useCallback)(
18363
16446
  (key) => {
18364
16447
  postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
18365
16448
  },
18366
16449
  [postToParent2]
18367
16450
  );
18368
- const handleMediaFadeOutComplete = (0, import_react16.useCallback)((key) => {
16451
+ const handleMediaFadeOutComplete = (0, import_react15.useCallback)((key) => {
18369
16452
  setUploadingRects((prev) => {
18370
16453
  if (!(key in prev)) return prev;
18371
16454
  const next = { ...prev };
@@ -18373,7 +16456,7 @@ function OhhwellsBridge() {
18373
16456
  return next;
18374
16457
  });
18375
16458
  }, []);
18376
- const handleVideoSettingsChange = (0, import_react16.useCallback)(
16459
+ const handleVideoSettingsChange = (0, import_react15.useCallback)(
18377
16460
  (key, settings) => {
18378
16461
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
18379
16462
  const video = getVideoEl2(el);
@@ -18396,10 +16479,10 @@ function OhhwellsBridge() {
18396
16479
  [postToParent2]
18397
16480
  );
18398
16481
  return bridgeRoot ? (0, import_react_dom4.createPortal)(
18399
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
18400
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
18401
- isEditMode && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
18402
- Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16482
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
16483
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
16484
+ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
16485
+ Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18403
16486
  MediaOverlay,
18404
16487
  {
18405
16488
  hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
@@ -18410,7 +16493,7 @@ function OhhwellsBridge() {
18410
16493
  },
18411
16494
  `uploading-${key}`
18412
16495
  )),
18413
- mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16496
+ mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18414
16497
  MediaOverlay,
18415
16498
  {
18416
16499
  hover: mediaHover,
@@ -18419,11 +16502,11 @@ function OhhwellsBridge() {
18419
16502
  onVideoSettingsChange: handleVideoSettingsChange
18420
16503
  }
18421
16504
  ),
18422
- carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
18423
- siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
18424
- siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
18425
- isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
18426
- isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16505
+ carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
16506
+ siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
16507
+ siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
16508
+ isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
16509
+ isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18427
16510
  "div",
18428
16511
  {
18429
16512
  className: "pointer-events-none fixed z-2147483646",
@@ -18433,7 +16516,7 @@ function OhhwellsBridge() {
18433
16516
  width: slot.width,
18434
16517
  height: slot.height
18435
16518
  },
18436
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16519
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18437
16520
  DropIndicator,
18438
16521
  {
18439
16522
  direction: slot.direction,
@@ -18444,7 +16527,7 @@ function OhhwellsBridge() {
18444
16527
  },
18445
16528
  `footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
18446
16529
  )),
18447
- isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16530
+ isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18448
16531
  "div",
18449
16532
  {
18450
16533
  className: "pointer-events-none fixed z-2147483646",
@@ -18454,7 +16537,7 @@ function OhhwellsBridge() {
18454
16537
  width: slot.width,
18455
16538
  height: slot.height
18456
16539
  },
18457
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16540
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18458
16541
  DropIndicator,
18459
16542
  {
18460
16543
  direction: slot.direction,
@@ -18465,10 +16548,10 @@ function OhhwellsBridge() {
18465
16548
  },
18466
16549
  `nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
18467
16550
  )),
18468
- hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
18469
- hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
18470
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
18471
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16551
+ hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
16552
+ hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
16553
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
16554
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18472
16555
  FooterContainerChrome,
18473
16556
  {
18474
16557
  rect: toolbarRect,
@@ -18476,7 +16559,7 @@ function OhhwellsBridge() {
18476
16559
  addDisabled: !canAddFooterColumn()
18477
16560
  }
18478
16561
  ),
18479
- toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16562
+ toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame") && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18480
16563
  ItemInteractionLayer,
18481
16564
  {
18482
16565
  rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
@@ -18488,21 +16571,13 @@ function OhhwellsBridge() {
18488
16571
  dragHandleLabel: reorderHrefKey ? `Reorder ${reorderHrefKey}` : "Reorder item",
18489
16572
  onDragHandleDragStart: handleItemDragStart,
18490
16573
  onDragHandleDragEnd: handleItemDragEnd,
18491
- onItemPointerDown: toolbarVariant === "logo" ? void 0 : handleItemChromePointerDown,
18492
- onItemClick: toolbarVariant === "logo" ? void 0 : handleItemChromeClick,
18493
- itemDragSurface: toolbarVariant !== "logo" && !isFooterFrameSelection,
18494
- toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16574
+ onItemPointerDown: handleItemChromePointerDown,
16575
+ onItemClick: handleItemChromeClick,
16576
+ itemDragSurface: !isFooterFrameSelection,
16577
+ toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && isFooterFrameSelection && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18495
16578
  ItemActionToolbar,
18496
16579
  {
18497
16580
  onEditLink: openLinkPopoverForSelected,
18498
- onStyle: () => {
18499
- const row = selectedElRef.current;
18500
- if (!row) return;
18501
- if (floatingPanel?.kind === "socials-display") closeFloatingPanelOnly();
18502
- else openSocialsDisplayPanel(row);
18503
- },
18504
- showStyle: selectedIsSocialsRow,
18505
- styleActive: floatingPanel?.kind === "socials-display",
18506
16581
  onAddItem: handleAddChildItem,
18507
16582
  onSelectParent: handleSelectParent,
18508
16583
  onDuplicate: handleDuplicateSelected,
@@ -18510,12 +16585,12 @@ function OhhwellsBridge() {
18510
16585
  addItemDisabled: false,
18511
16586
  editLinkDisabled: false,
18512
16587
  moreDisabled: false,
18513
- duplicateDisabled: isFooterFrameSelection || selectedIsSocialsRow,
18514
- showEditLink: !isFooterFrameSelection && !selectedIsSocialsRow && navDropdownPreviewOpen === null,
18515
- showAddItem: isFooterFrameSelection || selectedIsSocialsRow || !selectedIsCta && Boolean(
16588
+ duplicateDisabled: isFooterFrameSelection,
16589
+ showEditLink: !isFooterFrameSelection && navDropdownPreviewOpen === null,
16590
+ showAddItem: isFooterFrameSelection || !selectedIsCta && Boolean(
18516
16591
  selectedElRef.current && isNavbarHrefKey(selectedElRef.current.getAttribute("data-ohw-href-key")) && !isNestedNavChild(selectedElRef.current)
18517
16592
  ),
18518
- showMore: (!selectedIsCta || isFooterFrameSelection) && !selectedIsSocialsRow,
16593
+ showMore: !selectedIsCta || isFooterFrameSelection,
18519
16594
  dropdownOpen: navDropdownPreviewOpen,
18520
16595
  onDropdownOpenChange: handleNavDropdownOpenChange,
18521
16596
  headingVisible: footerHeadingVisible,
@@ -18524,8 +16599,8 @@ function OhhwellsBridge() {
18524
16599
  ) : void 0
18525
16600
  }
18526
16601
  ),
18527
- toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
18528
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16602
+ toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
16603
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18529
16604
  EditGlowChrome,
18530
16605
  {
18531
16606
  rect: toolbarRect,
@@ -18535,7 +16610,7 @@ function OhhwellsBridge() {
18535
16610
  hideHandle: isItemDragging
18536
16611
  }
18537
16612
  ),
18538
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16613
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18539
16614
  FloatingToolbar,
18540
16615
  {
18541
16616
  rect: toolbarRect,
@@ -18548,7 +16623,7 @@ function OhhwellsBridge() {
18548
16623
  }
18549
16624
  )
18550
16625
  ] }),
18551
- maxBadge && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16626
+ maxBadge && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
18552
16627
  "div",
18553
16628
  {
18554
16629
  "data-ohw-max-badge": "",
@@ -18574,7 +16649,7 @@ function OhhwellsBridge() {
18574
16649
  ]
18575
16650
  }
18576
16651
  ),
18577
- toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16652
+ toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18578
16653
  StateToggle,
18579
16654
  {
18580
16655
  rect: toggleState.rect,
@@ -18583,15 +16658,15 @@ function OhhwellsBridge() {
18583
16658
  onStateChange: handleStateChange
18584
16659
  }
18585
16660
  ),
18586
- sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
16661
+ sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
18587
16662
  "div",
18588
16663
  {
18589
16664
  "data-ohw-section-insert-line": "",
18590
16665
  className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
18591
16666
  style: { top: sectionGap.y, transform: "translateY(-50%)" },
18592
16667
  children: [
18593
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
18594
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16668
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
16669
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18595
16670
  Badge,
18596
16671
  {
18597
16672
  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",
@@ -18608,11 +16683,11 @@ function OhhwellsBridge() {
18608
16683
  children: "Add Section"
18609
16684
  }
18610
16685
  ),
18611
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
16686
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
18612
16687
  ]
18613
16688
  }
18614
16689
  ),
18615
- linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
16690
+ linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
18616
16691
  LinkPopover,
18617
16692
  {
18618
16693
  panelRef: linkPopoverPanelRef,
@@ -18628,137 +16703,11 @@ function OhhwellsBridge() {
18628
16703
  onSubmit: handleLinkPopoverSubmit
18629
16704
  },
18630
16705
  linkPopover.key
18631
- ) : null,
18632
- floatingPanel && floatingPanel.kind === "socials-display" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18633
- FloatingPanel,
18634
- {
18635
- open: true,
18636
- title: floatingPanel.title,
18637
- context: floatingPanel.context,
18638
- position: floatingPanelPos,
18639
- onPositionChange: setFloatingPanelPos,
18640
- parentScroll: parentScrollSnap ?? parentScrollRef.current,
18641
- onClose: closeFloatingPanelOnly,
18642
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18643
- SocialsDisplayPanel,
18644
- {
18645
- display: socialsDisplayFor(floatingPanel.row, editContentRef.current),
18646
- onChange: (next) => {
18647
- changeSocialsDisplay(floatingPanel.row, next);
18648
- setFloatingPanel({ ...floatingPanel });
18649
- }
18650
- }
18651
- )
18652
- }
18653
- ) : null,
18654
- floatingPanel && floatingPanel.kind === "logo-size" && logoSizeDraft ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18655
- FloatingPanel,
18656
- {
18657
- open: true,
18658
- title: floatingPanel.title,
18659
- context: floatingPanel.context,
18660
- position: floatingPanelPos,
18661
- onPositionChange: setFloatingPanelPos,
18662
- parentScroll: parentScrollSnap ?? parentScrollRef.current,
18663
- onClose: closeFloatingPanelAndDeselect,
18664
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18665
- LogoSizePanel,
18666
- {
18667
- viewport: editorViewport,
18668
- sizePx: editorViewport === "mobile" && !logoSizeDraft.mobileFollowing ? logoSizeDraft.mobilePx : logoSizeDraft.desktopPx,
18669
- mobileFollowing: logoSizeDraft.mobileFollowing,
18670
- onSizeChange: (px) => {
18671
- const next = editorViewport === "mobile" ? { ...logoSizeDraft, mobilePx: px, mobileFollowing: false } : {
18672
- ...logoSizeDraft,
18673
- desktopPx: px,
18674
- mobilePx: logoSizeDraft.mobileFollowing ? px : logoSizeDraft.mobilePx
18675
- };
18676
- setLogoSizeDraft(next);
18677
- persistLogoSizeDraft(floatingPanel.placement, next);
18678
- },
18679
- onCustomizeMobile: () => {
18680
- const next = {
18681
- ...logoSizeDraft,
18682
- mobileFollowing: false,
18683
- mobilePx: logoSizeDraft.desktopPx
18684
- };
18685
- setLogoSizeDraft(next);
18686
- persistLogoSizeDraft(floatingPanel.placement, next);
18687
- },
18688
- onResetMobile: () => {
18689
- const next = {
18690
- ...logoSizeDraft,
18691
- mobileFollowing: true,
18692
- mobilePx: logoSizeDraft.desktopPx
18693
- };
18694
- setLogoSizeDraft(next);
18695
- persistLogoSizeDraft(floatingPanel.placement, next);
18696
- },
18697
- onUpdateEverywhere: () => {
18698
- const identity = readLogoIdentityFromDom();
18699
- postToParent2({ type: "ow:open-logo-settings", ...identity });
18700
- }
18701
- }
18702
- )
18703
- }
18704
16706
  ) : null
18705
16707
  ] }),
18706
16708
  bridgeRoot
18707
16709
  ) : null;
18708
16710
  }
18709
-
18710
- // src/ui/EmptySection.tsx
18711
- var import_link = __toESM(require("next/link"), 1);
18712
- var import_jsx_runtime34 = require("react/jsx-runtime");
18713
- function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
18714
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
18715
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
18716
- "p",
18717
- {
18718
- style: {
18719
- fontFamily: "var(--brand-font-body)",
18720
- fontSize: "0.75rem",
18721
- fontWeight: 500,
18722
- letterSpacing: "0.15em",
18723
- textTransform: "uppercase",
18724
- color: "var(--brand-accent)",
18725
- marginBottom: "1.5rem"
18726
- },
18727
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link.default, { href: homeHref, style: { color: "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { ...eyebrowKey ? { "data-ohw-editable": "text", "data-ohw-key": eyebrowKey } : {}, children: "Home" }) })
18728
- }
18729
- ),
18730
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
18731
- "h1",
18732
- {
18733
- style: {
18734
- fontFamily: "var(--brand-font-heading)",
18735
- fontSize: "clamp(2rem, 3.5vw, 2.75rem)",
18736
- lineHeight: 1.1,
18737
- letterSpacing: "-0.025em",
18738
- color: "var(--brand-text)",
18739
- marginBottom: "1rem"
18740
- },
18741
- ...titleKey ? { "data-ohw-editable": "text", "data-ohw-key": titleKey, "data-ohw-max-length": 80 } : {},
18742
- children: title
18743
- }
18744
- ),
18745
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
18746
- "p",
18747
- {
18748
- style: {
18749
- fontFamily: "var(--brand-font-body)",
18750
- fontSize: "1rem",
18751
- lineHeight: 1.7,
18752
- fontWeight: 300,
18753
- color: "var(--brand-text-muted)",
18754
- maxWidth: "340px"
18755
- },
18756
- ...subtitleKey ? { "data-ohw-editable": "text", "data-ohw-key": subtitleKey, "data-ohw-max-length": 160 } : {},
18757
- children: "This page doesn't have any content yet."
18758
- }
18759
- )
18760
- ] });
18761
- }
18762
16711
  // Annotate the CommonJS export names for ESM import in node:
18763
16712
  0 && (module.exports = {
18764
16713
  AI_DEFAULT_BRAND,
@@ -18776,7 +16725,6 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
18776
16725
  DropdownMenuItem,
18777
16726
  DropdownMenuSeparator,
18778
16727
  DropdownMenuTrigger,
18779
- EmptySection,
18780
16728
  ItemActionToolbar,
18781
16729
  ItemInteractionLayer,
18782
16730
  LinkEditorPanel,