@ohhwells/bridge 0.1.54-next.153 → 0.1.54-next.154
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 +354 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +355 -107
- package/dist/index.js.map +1 -1
- package/dist/styles.css +18 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5942,6 +5942,7 @@ function ToolbarActionTooltip({
|
|
|
5942
5942
|
function ItemActionToolbar({
|
|
5943
5943
|
onEditLink,
|
|
5944
5944
|
onAddItem,
|
|
5945
|
+
onStyle,
|
|
5945
5946
|
onSelectParent,
|
|
5946
5947
|
onDuplicate,
|
|
5947
5948
|
onDelete,
|
|
@@ -5953,6 +5954,8 @@ function ItemActionToolbar({
|
|
|
5953
5954
|
deleteDisabled = false,
|
|
5954
5955
|
showEditLink = true,
|
|
5955
5956
|
showAddItem = true,
|
|
5957
|
+
showStyle = false,
|
|
5958
|
+
styleActive = false,
|
|
5956
5959
|
showMore = true,
|
|
5957
5960
|
tooltipSide = "bottom",
|
|
5958
5961
|
dropdownOpen = null,
|
|
@@ -6026,6 +6029,22 @@ function ItemActionToolbar({
|
|
|
6026
6029
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Link, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
6027
6030
|
}
|
|
6028
6031
|
) : null,
|
|
6032
|
+
showStyle ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
6033
|
+
ToolbarActionTooltip,
|
|
6034
|
+
{
|
|
6035
|
+
label: "Style",
|
|
6036
|
+
side: tooltipSide,
|
|
6037
|
+
buttonProps: {
|
|
6038
|
+
active: styleActive,
|
|
6039
|
+
onMouseDown: (e) => {
|
|
6040
|
+
e.preventDefault();
|
|
6041
|
+
e.stopPropagation();
|
|
6042
|
+
onStyle?.();
|
|
6043
|
+
}
|
|
6044
|
+
},
|
|
6045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react3.Brush, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
6046
|
+
}
|
|
6047
|
+
) : null,
|
|
6029
6048
|
showAddItem ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
6030
6049
|
ToolbarActionTooltip,
|
|
6031
6050
|
{
|
|
@@ -9591,12 +9610,14 @@ function iconMarkupInheritingColour(markup) {
|
|
|
9591
9610
|
|
|
9592
9611
|
// src/lib/socials-items.ts
|
|
9593
9612
|
var ICON_SELECTOR = '[data-ohw-editable="icon"]';
|
|
9613
|
+
var SOCIAL_KEY_RE = /(^|-)social(s)?(-|$)/i;
|
|
9594
9614
|
var SOCIALS_ROW_ATTR = "data-ohw-socials-row";
|
|
9595
9615
|
var SOCIALS_ITEM_ATTR = "data-ohw-social-item";
|
|
9596
9616
|
function isSocialItem(el) {
|
|
9597
9617
|
if (!el) return false;
|
|
9598
9618
|
const anchor = el instanceof HTMLAnchorElement ? el : el.closest("a");
|
|
9599
9619
|
if (!anchor) return false;
|
|
9620
|
+
if (SOCIAL_KEY_RE.test(anchor.getAttribute("data-ohw-href-key") ?? "")) return true;
|
|
9600
9621
|
return anchor.querySelectorAll(ICON_SELECTOR).length === 1;
|
|
9601
9622
|
}
|
|
9602
9623
|
function getSocialItem(el) {
|
|
@@ -9606,7 +9627,8 @@ function getSocialItem(el) {
|
|
|
9606
9627
|
function findSocialsRow(el) {
|
|
9607
9628
|
const item = getSocialItem(el);
|
|
9608
9629
|
if (!item) return null;
|
|
9609
|
-
const
|
|
9630
|
+
const wrapper = item.parentElement;
|
|
9631
|
+
const row = wrapper && wrapper.querySelectorAll("a").length === 1 && wrapper.matches("li, div, span") ? wrapper.parentElement : wrapper;
|
|
9610
9632
|
if (!row) return null;
|
|
9611
9633
|
const anchors = Array.from(row.querySelectorAll("a"));
|
|
9612
9634
|
if (!anchors.length || !anchors.every((anchor) => isSocialItem(anchor))) return null;
|
|
@@ -9617,14 +9639,24 @@ function isSocialsRow(el) {
|
|
|
9617
9639
|
return anchors.length > 0 && anchors.every((anchor) => isSocialItem(anchor));
|
|
9618
9640
|
}
|
|
9619
9641
|
function listSocialItems(row) {
|
|
9620
|
-
return Array.from(row.children).
|
|
9621
|
-
|
|
9622
|
-
|
|
9642
|
+
return Array.from(row.children).map((child) => {
|
|
9643
|
+
if (!(child instanceof HTMLElement)) return null;
|
|
9644
|
+
const anchor = child.matches("a") ? child : child.querySelector("a");
|
|
9645
|
+
return isSocialItem(anchor) ? anchor : null;
|
|
9646
|
+
}).filter((item) => item !== null);
|
|
9647
|
+
}
|
|
9648
|
+
function socialRowUnit(item) {
|
|
9649
|
+
const row = findSocialsRow(item);
|
|
9650
|
+
let node = item;
|
|
9651
|
+
while (node.parentElement && node.parentElement !== row) {
|
|
9652
|
+
node = node.parentElement;
|
|
9653
|
+
}
|
|
9654
|
+
return node;
|
|
9623
9655
|
}
|
|
9624
9656
|
function listSocialsRows(root = document) {
|
|
9625
9657
|
const rows = /* @__PURE__ */ new Set();
|
|
9626
|
-
root.querySelectorAll(ICON_SELECTOR).forEach((
|
|
9627
|
-
const row = findSocialsRow(
|
|
9658
|
+
root.querySelectorAll(`${ICON_SELECTOR}, a[data-ohw-href-key]`).forEach((el) => {
|
|
9659
|
+
const row = findSocialsRow(el);
|
|
9628
9660
|
if (row) rows.add(row);
|
|
9629
9661
|
});
|
|
9630
9662
|
root.querySelectorAll(`[${SOCIALS_ROW_ATTR}]`).forEach((row) => rows.add(row));
|
|
@@ -9638,7 +9670,7 @@ function markSocialsRows(root = document) {
|
|
|
9638
9670
|
listSocialsRows(root).forEach((row) => {
|
|
9639
9671
|
row.setAttribute(SOCIALS_ROW_ATTR, "");
|
|
9640
9672
|
const items = listSocialItems(row);
|
|
9641
|
-
if (items[0]) rowTemplates.set(rowKeyOf(row), items[0].outerHTML);
|
|
9673
|
+
if (items[0]) rowTemplates.set(rowKeyOf(row), socialRowUnit(items[0]).outerHTML);
|
|
9642
9674
|
items.forEach((item, index) => {
|
|
9643
9675
|
item.setAttribute(SOCIALS_ITEM_ATTR, String(index));
|
|
9644
9676
|
const iconKey = socialIconKey(item);
|
|
@@ -9648,7 +9680,7 @@ function markSocialsRows(root = document) {
|
|
|
9648
9680
|
}
|
|
9649
9681
|
var SOCIALS_LABEL_ATTR = "data-ohw-social-label";
|
|
9650
9682
|
function ensureLabelSlot(item, iconKey) {
|
|
9651
|
-
if (item
|
|
9683
|
+
if (socialLabelElement(item)) return;
|
|
9652
9684
|
const label = document.createElement("span");
|
|
9653
9685
|
label.setAttribute("data-ohw-key", `${iconKey}-label`);
|
|
9654
9686
|
label.setAttribute("data-ohw-editable", "text");
|
|
@@ -9657,6 +9689,11 @@ function ensureLabelSlot(item, iconKey) {
|
|
|
9657
9689
|
label.textContent = item.getAttribute("aria-label") ?? "";
|
|
9658
9690
|
item.appendChild(label);
|
|
9659
9691
|
}
|
|
9692
|
+
function socialLabelElement(item) {
|
|
9693
|
+
return item.querySelector(
|
|
9694
|
+
`[${SOCIALS_LABEL_ATTR}], [data-ohw-editable="text"], [data-ohw-editable="plain"]`
|
|
9695
|
+
);
|
|
9696
|
+
}
|
|
9660
9697
|
function socialLabelKey(iconKey) {
|
|
9661
9698
|
return `${iconKey}-label`;
|
|
9662
9699
|
}
|
|
@@ -9691,7 +9728,8 @@ function fromMarkup(markup) {
|
|
|
9691
9728
|
var rowKeys = /* @__PURE__ */ new WeakMap();
|
|
9692
9729
|
function rowKeyOf(row) {
|
|
9693
9730
|
const first = listSocialItems(row)[0];
|
|
9694
|
-
const
|
|
9731
|
+
const itemKey = first ? socialIconKey(first) ?? socialHrefKey(first)?.replace(/-href$/, "") : null;
|
|
9732
|
+
const derived = itemKey?.replace(/-[^-]+$/, "") || null;
|
|
9695
9733
|
if (derived) rowKeys.set(row, derived);
|
|
9696
9734
|
return derived ?? rowKeys.get(row) ?? "social";
|
|
9697
9735
|
}
|
|
@@ -9727,8 +9765,10 @@ function insertSocialItem(row, after, content = {}) {
|
|
|
9727
9765
|
const index = nextSocialIndex(row, rowKey, content);
|
|
9728
9766
|
const iconKey = `${rowKey}-${index}`;
|
|
9729
9767
|
const hrefKey = `${iconKey}-href`;
|
|
9730
|
-
const
|
|
9731
|
-
|
|
9768
|
+
const templateUnit = template ? socialRowUnit(template) : null;
|
|
9769
|
+
const unit = templateUnit ? templateUnit.cloneNode(true) : fromMarkup(remembered);
|
|
9770
|
+
const item = unit && (unit.matches("a") ? unit : unit.querySelector("a"));
|
|
9771
|
+
if (!unit || !item) return null;
|
|
9732
9772
|
item.setAttribute("data-ohw-href-key", hrefKey);
|
|
9733
9773
|
item.setAttribute("href", "");
|
|
9734
9774
|
item.removeAttribute("aria-label");
|
|
@@ -9739,8 +9779,9 @@ function insertSocialItem(row, after, content = {}) {
|
|
|
9739
9779
|
const icon = item.querySelector(ICON_SELECTOR);
|
|
9740
9780
|
icon?.setAttribute("data-ohw-key", iconKey);
|
|
9741
9781
|
item.querySelector(`[${SOCIALS_LABEL_ATTR}]`)?.remove();
|
|
9742
|
-
|
|
9743
|
-
|
|
9782
|
+
const afterUnit = after ? socialRowUnit(after) : null;
|
|
9783
|
+
if (afterUnit && afterUnit.parentElement === row) afterUnit.insertAdjacentElement("afterend", unit);
|
|
9784
|
+
else row.appendChild(unit);
|
|
9744
9785
|
markSocialsRows(row.ownerDocument);
|
|
9745
9786
|
return { item, hrefKey, iconKey, order: getSocialsOrderFromDom(row.ownerDocument) };
|
|
9746
9787
|
}
|
|
@@ -9773,8 +9814,9 @@ function removeSocialItem(item, content) {
|
|
|
9773
9814
|
const previousContent = Object.fromEntries(
|
|
9774
9815
|
removedKeys.filter((key) => key in content).map((key) => [key, content[key]])
|
|
9775
9816
|
);
|
|
9776
|
-
const
|
|
9777
|
-
|
|
9817
|
+
const unit = socialRowUnit(item);
|
|
9818
|
+
const nextSibling = unit.nextElementSibling;
|
|
9819
|
+
unit.remove();
|
|
9778
9820
|
markSocialsRows(row.ownerDocument);
|
|
9779
9821
|
return {
|
|
9780
9822
|
removedKeys,
|
|
@@ -9782,8 +9824,8 @@ function removeSocialItem(item, content) {
|
|
|
9782
9824
|
order: getSocialsOrderFromDom(row.ownerDocument),
|
|
9783
9825
|
previousOrder,
|
|
9784
9826
|
undo: () => {
|
|
9785
|
-
if (nextSibling) nextSibling.before(
|
|
9786
|
-
else row.appendChild(
|
|
9827
|
+
if (nextSibling) nextSibling.before(unit);
|
|
9828
|
+
else row.appendChild(unit);
|
|
9787
9829
|
markSocialsRows(row.ownerDocument);
|
|
9788
9830
|
}
|
|
9789
9831
|
};
|
|
@@ -9795,7 +9837,7 @@ function applySocialsOrder(order, root = document) {
|
|
|
9795
9837
|
const byKey = new Map(listSocialItems(row).map((item) => [socialHrefKey(item), item]));
|
|
9796
9838
|
wanted.forEach((key) => {
|
|
9797
9839
|
const item = byKey.get(key);
|
|
9798
|
-
if (item) row.appendChild(item);
|
|
9840
|
+
if (item) row.appendChild(socialRowUnit(item));
|
|
9799
9841
|
});
|
|
9800
9842
|
});
|
|
9801
9843
|
markSocialsRows(root);
|
|
@@ -9825,7 +9867,7 @@ function reconcileSocialsFromContent(content, root = document) {
|
|
|
9825
9867
|
});
|
|
9826
9868
|
if (surviving.length) {
|
|
9827
9869
|
present.forEach((item) => {
|
|
9828
|
-
if (!surviving.includes(item)) item.remove();
|
|
9870
|
+
if (!surviving.includes(item)) socialRowUnit(item).remove();
|
|
9829
9871
|
});
|
|
9830
9872
|
}
|
|
9831
9873
|
});
|
|
@@ -9883,6 +9925,70 @@ function planSocialMove(hrefKey, insertIndex, root = document) {
|
|
|
9883
9925
|
next.splice(insertIndex > from ? insertIndex - 1 : insertIndex, 0, hrefKey);
|
|
9884
9926
|
return { ...order, [key]: next };
|
|
9885
9927
|
}
|
|
9928
|
+
var SOCIALS_DISPLAY_KEY = "__ohw_socials_display";
|
|
9929
|
+
function readSocialsDisplay(row) {
|
|
9930
|
+
const items = listSocialItems(row);
|
|
9931
|
+
const visible = (el) => Boolean(el) && el.style.display !== "none" && el.getAttribute("data-ohw-hidden") === null;
|
|
9932
|
+
return {
|
|
9933
|
+
text: items.some((item) => visible(socialLabelElement(item))),
|
|
9934
|
+
icon: items.some((item) => visible(item.querySelector(ICON_SELECTOR)))
|
|
9935
|
+
};
|
|
9936
|
+
}
|
|
9937
|
+
function parseSocialsDisplay(raw) {
|
|
9938
|
+
if (!raw) return null;
|
|
9939
|
+
try {
|
|
9940
|
+
const parsed = JSON.parse(raw);
|
|
9941
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
9942
|
+
} catch {
|
|
9943
|
+
return null;
|
|
9944
|
+
}
|
|
9945
|
+
}
|
|
9946
|
+
function socialsDisplayFor(row, content) {
|
|
9947
|
+
return parseSocialsDisplay(content[SOCIALS_DISPLAY_KEY])?.[rowKeyOf(row)] ?? readSocialsDisplay(row);
|
|
9948
|
+
}
|
|
9949
|
+
function socialsDisplayWith(row, display, content) {
|
|
9950
|
+
return { ...parseSocialsDisplay(content[SOCIALS_DISPLAY_KEY]) ?? {}, [rowKeyOf(row)]: display };
|
|
9951
|
+
}
|
|
9952
|
+
function applySocialsDisplayToRow(row, display) {
|
|
9953
|
+
listSocialItems(row).forEach((item) => {
|
|
9954
|
+
const label = socialLabelElement(item);
|
|
9955
|
+
const icon = item.querySelector(ICON_SELECTOR);
|
|
9956
|
+
if (label) label.style.display = display.text ? "" : "none";
|
|
9957
|
+
if (icon) icon.style.display = display.icon ? "" : "none";
|
|
9958
|
+
});
|
|
9959
|
+
}
|
|
9960
|
+
function applySocialsDisplayFromContent(content, root = document) {
|
|
9961
|
+
const stored = parseSocialsDisplay(content[SOCIALS_DISPLAY_KEY]);
|
|
9962
|
+
if (!stored) return;
|
|
9963
|
+
listSocialsRows(root).forEach((row) => {
|
|
9964
|
+
const display = stored[rowKeyOf(row)];
|
|
9965
|
+
if (!display) return;
|
|
9966
|
+
if (display.icon) {
|
|
9967
|
+
listSocialItems(row).forEach((item) => {
|
|
9968
|
+
const iconKey = ensureIconSlot(item);
|
|
9969
|
+
const slot = item.querySelector(ICON_SELECTOR);
|
|
9970
|
+
if (iconKey && slot && content[iconKey]) applyIconMarkup(slot, content[iconKey]);
|
|
9971
|
+
});
|
|
9972
|
+
}
|
|
9973
|
+
applySocialsDisplayToRow(row, display);
|
|
9974
|
+
});
|
|
9975
|
+
}
|
|
9976
|
+
function socialsMissingIcons(row) {
|
|
9977
|
+
return listSocialItems(row).filter((item) => !item.querySelector(ICON_SELECTOR)).map((item) => ({ hrefKey: socialHrefKey(item) ?? "", url: item.getAttribute("href") ?? "" })).filter((entry) => Boolean(entry.hrefKey));
|
|
9978
|
+
}
|
|
9979
|
+
function ensureIconSlot(item) {
|
|
9980
|
+
const existing = item.querySelector(ICON_SELECTOR);
|
|
9981
|
+
if (existing) return existing.dataset.ohwKey ?? null;
|
|
9982
|
+
const hrefKey = socialHrefKey(item);
|
|
9983
|
+
if (!hrefKey) return null;
|
|
9984
|
+
const iconKey = hrefKey.replace(/-href$/, "");
|
|
9985
|
+
const slot = document.createElement("span");
|
|
9986
|
+
slot.setAttribute("data-ohw-key", iconKey);
|
|
9987
|
+
slot.setAttribute("data-ohw-editable", "icon");
|
|
9988
|
+
slot.style.display = "inline-flex";
|
|
9989
|
+
item.prepend(slot);
|
|
9990
|
+
return iconKey;
|
|
9991
|
+
}
|
|
9886
9992
|
|
|
9887
9993
|
// src/lib/footer-items.ts
|
|
9888
9994
|
var FOOTER_ORDER_KEY = "__ohw_footer_order";
|
|
@@ -11370,6 +11476,75 @@ function LogoSizePanel({
|
|
|
11370
11476
|
] });
|
|
11371
11477
|
}
|
|
11372
11478
|
|
|
11479
|
+
// src/ui/socials-display-panel.tsx
|
|
11480
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
11481
|
+
function DisplaySwitch({
|
|
11482
|
+
label,
|
|
11483
|
+
checked,
|
|
11484
|
+
disabled,
|
|
11485
|
+
onChange
|
|
11486
|
+
}) {
|
|
11487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex w-full items-center gap-2", children: [
|
|
11488
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11489
|
+
"span",
|
|
11490
|
+
{
|
|
11491
|
+
className: cn(
|
|
11492
|
+
"min-w-0 flex-1 text-sm font-medium leading-5",
|
|
11493
|
+
disabled ? "text-muted-foreground" : "text-foreground"
|
|
11494
|
+
),
|
|
11495
|
+
children: label
|
|
11496
|
+
}
|
|
11497
|
+
),
|
|
11498
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11499
|
+
"button",
|
|
11500
|
+
{
|
|
11501
|
+
type: "button",
|
|
11502
|
+
role: "switch",
|
|
11503
|
+
"aria-checked": checked,
|
|
11504
|
+
"aria-label": label,
|
|
11505
|
+
disabled,
|
|
11506
|
+
onClick: () => onChange(!checked),
|
|
11507
|
+
className: cn(
|
|
11508
|
+
"relative h-5 w-9 shrink-0 rounded-full transition-colors",
|
|
11509
|
+
checked ? "bg-primary" : "bg-primary-50",
|
|
11510
|
+
disabled ? "cursor-default opacity-50" : "cursor-pointer"
|
|
11511
|
+
),
|
|
11512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11513
|
+
"span",
|
|
11514
|
+
{
|
|
11515
|
+
className: cn(
|
|
11516
|
+
"absolute top-0.5 h-4 w-4 rounded-full bg-white transition-all",
|
|
11517
|
+
checked ? "left-[1.125rem]" : "left-0.5"
|
|
11518
|
+
)
|
|
11519
|
+
}
|
|
11520
|
+
)
|
|
11521
|
+
}
|
|
11522
|
+
)
|
|
11523
|
+
] });
|
|
11524
|
+
}
|
|
11525
|
+
function SocialsDisplayPanel({ display, onChange, className }) {
|
|
11526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("flex w-full flex-col gap-3", className), children: [
|
|
11527
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11528
|
+
DisplaySwitch,
|
|
11529
|
+
{
|
|
11530
|
+
label: "Text",
|
|
11531
|
+
checked: display.text,
|
|
11532
|
+
disabled: display.text && !display.icon,
|
|
11533
|
+
onChange: (text) => onChange({ ...display, text })
|
|
11534
|
+
}
|
|
11535
|
+
),
|
|
11536
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11537
|
+
DisplaySwitch,
|
|
11538
|
+
{
|
|
11539
|
+
label: "Icon",
|
|
11540
|
+
checked: display.icon,
|
|
11541
|
+
disabled: display.icon && !display.text,
|
|
11542
|
+
onChange: (icon) => onChange({ ...display, icon })
|
|
11543
|
+
}
|
|
11544
|
+
)
|
|
11545
|
+
] });
|
|
11546
|
+
}
|
|
11547
|
+
|
|
11373
11548
|
// src/lib/item-drag-interaction.ts
|
|
11374
11549
|
function disableNativeHrefDrag(el) {
|
|
11375
11550
|
if (el.draggable) el.draggable = false;
|
|
@@ -11919,7 +12094,7 @@ function useNavItemDrag({
|
|
|
11919
12094
|
|
|
11920
12095
|
// src/ui/footer-container-chrome.tsx
|
|
11921
12096
|
var import_lucide_react15 = require("lucide-react");
|
|
11922
|
-
var
|
|
12097
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
11923
12098
|
function FooterContainerChrome({
|
|
11924
12099
|
rect,
|
|
11925
12100
|
onAdd,
|
|
@@ -11927,7 +12102,7 @@ function FooterContainerChrome({
|
|
|
11927
12102
|
}) {
|
|
11928
12103
|
const chromeGap = 6;
|
|
11929
12104
|
const buttonMargin = 7;
|
|
11930
|
-
return /* @__PURE__ */ (0,
|
|
12105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11931
12106
|
"div",
|
|
11932
12107
|
{
|
|
11933
12108
|
"data-ohw-footer-container-chrome": "",
|
|
@@ -11939,8 +12114,8 @@ function FooterContainerChrome({
|
|
|
11939
12114
|
width: rect.width + chromeGap * 2,
|
|
11940
12115
|
height: rect.height + chromeGap * 2
|
|
11941
12116
|
},
|
|
11942
|
-
children: /* @__PURE__ */ (0,
|
|
11943
|
-
/* @__PURE__ */ (0,
|
|
12117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Tooltip, { children: [
|
|
12118
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11944
12119
|
"button",
|
|
11945
12120
|
{
|
|
11946
12121
|
type: "button",
|
|
@@ -11959,10 +12134,10 @@ function FooterContainerChrome({
|
|
|
11959
12134
|
if (addDisabled) return;
|
|
11960
12135
|
onAdd();
|
|
11961
12136
|
},
|
|
11962
|
-
children: /* @__PURE__ */ (0,
|
|
12137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
11963
12138
|
}
|
|
11964
12139
|
) }),
|
|
11965
|
-
/* @__PURE__ */ (0,
|
|
12140
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
11966
12141
|
] })
|
|
11967
12142
|
}
|
|
11968
12143
|
) });
|
|
@@ -12423,13 +12598,13 @@ function deleteSelectedNavFooterItem(deps) {
|
|
|
12423
12598
|
|
|
12424
12599
|
// src/ui/navbar-container-chrome.tsx
|
|
12425
12600
|
var import_lucide_react16 = require("lucide-react");
|
|
12426
|
-
var
|
|
12601
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
12427
12602
|
function NavbarContainerChrome({
|
|
12428
12603
|
rect,
|
|
12429
12604
|
onAdd
|
|
12430
12605
|
}) {
|
|
12431
12606
|
const chromeGap = 6;
|
|
12432
|
-
return /* @__PURE__ */ (0,
|
|
12607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
12433
12608
|
"div",
|
|
12434
12609
|
{
|
|
12435
12610
|
"data-ohw-navbar-container-chrome": "",
|
|
@@ -12441,7 +12616,7 @@ function NavbarContainerChrome({
|
|
|
12441
12616
|
width: rect.width + chromeGap * 2,
|
|
12442
12617
|
height: rect.height + chromeGap * 2
|
|
12443
12618
|
},
|
|
12444
|
-
children: /* @__PURE__ */ (0,
|
|
12619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
12445
12620
|
"button",
|
|
12446
12621
|
{
|
|
12447
12622
|
type: "button",
|
|
@@ -12458,7 +12633,7 @@ function NavbarContainerChrome({
|
|
|
12458
12633
|
e.stopPropagation();
|
|
12459
12634
|
onAdd();
|
|
12460
12635
|
},
|
|
12461
|
-
children: /* @__PURE__ */ (0,
|
|
12636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
12462
12637
|
}
|
|
12463
12638
|
)
|
|
12464
12639
|
}
|
|
@@ -12467,7 +12642,7 @@ function NavbarContainerChrome({
|
|
|
12467
12642
|
|
|
12468
12643
|
// src/ui/drop-indicator.tsx
|
|
12469
12644
|
var React10 = __toESM(require("react"), 1);
|
|
12470
|
-
var
|
|
12645
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
12471
12646
|
var dropIndicatorVariants = cva(
|
|
12472
12647
|
"ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
|
|
12473
12648
|
{
|
|
@@ -12491,7 +12666,7 @@ var dropIndicatorVariants = cva(
|
|
|
12491
12666
|
);
|
|
12492
12667
|
var DropIndicator = React10.forwardRef(
|
|
12493
12668
|
({ className, direction, state, ...props }, ref) => {
|
|
12494
|
-
return /* @__PURE__ */ (0,
|
|
12669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
12495
12670
|
"div",
|
|
12496
12671
|
{
|
|
12497
12672
|
ref,
|
|
@@ -12508,7 +12683,7 @@ var DropIndicator = React10.forwardRef(
|
|
|
12508
12683
|
DropIndicator.displayName = "DropIndicator";
|
|
12509
12684
|
|
|
12510
12685
|
// src/ui/badge.tsx
|
|
12511
|
-
var
|
|
12686
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
12512
12687
|
var badgeVariants = cva(
|
|
12513
12688
|
"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",
|
|
12514
12689
|
{
|
|
@@ -12526,12 +12701,12 @@ var badgeVariants = cva(
|
|
|
12526
12701
|
}
|
|
12527
12702
|
);
|
|
12528
12703
|
function Badge({ className, variant, ...props }) {
|
|
12529
|
-
return /* @__PURE__ */ (0,
|
|
12704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
12530
12705
|
}
|
|
12531
12706
|
|
|
12532
12707
|
// src/OhhwellsBridge.tsx
|
|
12533
12708
|
var import_lucide_react17 = require("lucide-react");
|
|
12534
|
-
var
|
|
12709
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
12535
12710
|
var PRIMARY3 = "#0885FE";
|
|
12536
12711
|
var IMAGE_FADE_MS = 300;
|
|
12537
12712
|
function runOpacityFade(el, onDone) {
|
|
@@ -12700,7 +12875,7 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
|
|
|
12700
12875
|
const root = (0, import_client2.createRoot)(container);
|
|
12701
12876
|
(0, import_react_dom3.flushSync)(() => {
|
|
12702
12877
|
root.render(
|
|
12703
|
-
/* @__PURE__ */ (0,
|
|
12878
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12704
12879
|
SchedulingWidget,
|
|
12705
12880
|
{
|
|
12706
12881
|
notifyOnConnect,
|
|
@@ -13368,7 +13543,7 @@ function EditGlowChrome({
|
|
|
13368
13543
|
hideHandle = false
|
|
13369
13544
|
}) {
|
|
13370
13545
|
const GAP = SELECTION_CHROME_GAP2;
|
|
13371
|
-
return /* @__PURE__ */ (0,
|
|
13546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
13372
13547
|
"div",
|
|
13373
13548
|
{
|
|
13374
13549
|
ref: elRef,
|
|
@@ -13383,7 +13558,7 @@ function EditGlowChrome({
|
|
|
13383
13558
|
zIndex: 2147483646
|
|
13384
13559
|
},
|
|
13385
13560
|
children: [
|
|
13386
|
-
/* @__PURE__ */ (0,
|
|
13561
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13387
13562
|
"div",
|
|
13388
13563
|
{
|
|
13389
13564
|
style: {
|
|
@@ -13396,7 +13571,7 @@ function EditGlowChrome({
|
|
|
13396
13571
|
}
|
|
13397
13572
|
}
|
|
13398
13573
|
),
|
|
13399
|
-
reorderHrefKey && !hideHandle && /* @__PURE__ */ (0,
|
|
13574
|
+
reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13400
13575
|
"div",
|
|
13401
13576
|
{
|
|
13402
13577
|
"data-ohw-drag-handle-container": "",
|
|
@@ -13408,7 +13583,7 @@ function EditGlowChrome({
|
|
|
13408
13583
|
transform: "translate(calc(-100% - 7px), -50%)",
|
|
13409
13584
|
pointerEvents: dragDisabled ? "none" : "auto"
|
|
13410
13585
|
},
|
|
13411
|
-
children: /* @__PURE__ */ (0,
|
|
13586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13412
13587
|
DragHandle,
|
|
13413
13588
|
{
|
|
13414
13589
|
"aria-label": `Reorder ${reorderHrefKey}`,
|
|
@@ -13618,7 +13793,7 @@ function FloatingToolbar({
|
|
|
13618
13793
|
return () => ro.disconnect();
|
|
13619
13794
|
}, [showEditLink, activeCommands]);
|
|
13620
13795
|
const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
|
|
13621
|
-
return /* @__PURE__ */ (0,
|
|
13796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13622
13797
|
"div",
|
|
13623
13798
|
{
|
|
13624
13799
|
ref: setRefs,
|
|
@@ -13630,12 +13805,12 @@ function FloatingToolbar({
|
|
|
13630
13805
|
zIndex: 2147483647,
|
|
13631
13806
|
pointerEvents: "auto"
|
|
13632
13807
|
},
|
|
13633
|
-
children: /* @__PURE__ */ (0,
|
|
13634
|
-
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0,
|
|
13635
|
-
gi > 0 && /* @__PURE__ */ (0,
|
|
13808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(CustomToolbar, { children: [
|
|
13809
|
+
TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react16.default.Fragment, { children: [
|
|
13810
|
+
gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CustomToolbarDivider, {}),
|
|
13636
13811
|
btns.map((btn) => {
|
|
13637
13812
|
const isActive = activeCommands.has(btn.cmd);
|
|
13638
|
-
return /* @__PURE__ */ (0,
|
|
13813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13639
13814
|
CustomToolbarButton,
|
|
13640
13815
|
{
|
|
13641
13816
|
title: btn.title,
|
|
@@ -13644,7 +13819,7 @@ function FloatingToolbar({
|
|
|
13644
13819
|
e.preventDefault();
|
|
13645
13820
|
onCommand(btn.cmd);
|
|
13646
13821
|
},
|
|
13647
|
-
children: /* @__PURE__ */ (0,
|
|
13822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13648
13823
|
"svg",
|
|
13649
13824
|
{
|
|
13650
13825
|
width: "16",
|
|
@@ -13665,7 +13840,7 @@ function FloatingToolbar({
|
|
|
13665
13840
|
);
|
|
13666
13841
|
})
|
|
13667
13842
|
] }, gi)),
|
|
13668
|
-
showEditLink ? /* @__PURE__ */ (0,
|
|
13843
|
+
showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13669
13844
|
CustomToolbarButton,
|
|
13670
13845
|
{
|
|
13671
13846
|
type: "button",
|
|
@@ -13679,7 +13854,7 @@ function FloatingToolbar({
|
|
|
13679
13854
|
e.preventDefault();
|
|
13680
13855
|
e.stopPropagation();
|
|
13681
13856
|
},
|
|
13682
|
-
children: /* @__PURE__ */ (0,
|
|
13857
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Link, { className: "size-4 shrink-0", "aria-hidden": true })
|
|
13683
13858
|
}
|
|
13684
13859
|
) : null
|
|
13685
13860
|
] })
|
|
@@ -13696,7 +13871,7 @@ function StateToggle({
|
|
|
13696
13871
|
states,
|
|
13697
13872
|
onStateChange
|
|
13698
13873
|
}) {
|
|
13699
|
-
return /* @__PURE__ */ (0,
|
|
13874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13700
13875
|
ToggleGroup,
|
|
13701
13876
|
{
|
|
13702
13877
|
"data-ohw-state-toggle": "",
|
|
@@ -13710,7 +13885,7 @@ function StateToggle({
|
|
|
13710
13885
|
left: rect.right - 8,
|
|
13711
13886
|
transform: "translateX(-100%)"
|
|
13712
13887
|
},
|
|
13713
|
-
children: states.map((state) => /* @__PURE__ */ (0,
|
|
13888
|
+
children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
|
|
13714
13889
|
}
|
|
13715
13890
|
);
|
|
13716
13891
|
}
|
|
@@ -14324,6 +14499,7 @@ function OhhwellsBridge() {
|
|
|
14324
14499
|
const result2 = insertSocialItem(socialsRow, after, editContentRef.current);
|
|
14325
14500
|
if (!result2) return;
|
|
14326
14501
|
const orderJson = JSON.stringify(result2.order);
|
|
14502
|
+
applySocialsDisplayToRow(socialsRow, socialsDisplayFor(socialsRow, editContentRef.current));
|
|
14327
14503
|
editContentRef.current = { ...editContentRef.current, [SOCIALS_ORDER_KEY]: orderJson };
|
|
14328
14504
|
postToParent2({ type: "ow:change", nodes: [{ key: SOCIALS_ORDER_KEY, text: orderJson }] });
|
|
14329
14505
|
postToParentRef.current({
|
|
@@ -14911,6 +15087,39 @@ function OhhwellsBridge() {
|
|
|
14911
15087
|
placement
|
|
14912
15088
|
});
|
|
14913
15089
|
}, []);
|
|
15090
|
+
const openSocialsDisplayPanel = (0, import_react16.useCallback)((row) => {
|
|
15091
|
+
setParentScrollSnap(parentScrollRef.current);
|
|
15092
|
+
setFloatingPanel({
|
|
15093
|
+
key: "socials-display",
|
|
15094
|
+
title: "Style",
|
|
15095
|
+
context: "Socials \xB7 Footer",
|
|
15096
|
+
kind: "socials-display",
|
|
15097
|
+
row
|
|
15098
|
+
});
|
|
15099
|
+
}, []);
|
|
15100
|
+
const changeSocialsDisplay = (0, import_react16.useCallback)(
|
|
15101
|
+
(row, next) => {
|
|
15102
|
+
if (next.icon) {
|
|
15103
|
+
const missing = socialsMissingIcons(row);
|
|
15104
|
+
listSocialItems(row).forEach((item) => ensureIconSlot(item));
|
|
15105
|
+
if (missing.length) {
|
|
15106
|
+
postToParentRef.current({ type: "ow:social-icons-needed", items: missing });
|
|
15107
|
+
}
|
|
15108
|
+
}
|
|
15109
|
+
applySocialsDisplayToRow(row, next);
|
|
15110
|
+
requestAnimationFrame(() => {
|
|
15111
|
+
if (selectedElRef.current === row && row.isConnected) setToolbarRect(row.getBoundingClientRect());
|
|
15112
|
+
});
|
|
15113
|
+
const displayJson = JSON.stringify(socialsDisplayWith(row, next, editContentRef.current));
|
|
15114
|
+
editContentRef.current = { ...editContentRef.current, [SOCIALS_DISPLAY_KEY]: displayJson };
|
|
15115
|
+
postToParentRef.current({
|
|
15116
|
+
type: "ow:change",
|
|
15117
|
+
nodes: [{ key: SOCIALS_DISPLAY_KEY, text: displayJson }],
|
|
15118
|
+
flush: true
|
|
15119
|
+
});
|
|
15120
|
+
},
|
|
15121
|
+
[]
|
|
15122
|
+
);
|
|
14914
15123
|
const closeFloatingPanelOnly = (0, import_react16.useCallback)(() => {
|
|
14915
15124
|
setFloatingPanel(null);
|
|
14916
15125
|
setLogoSizeDraft(null);
|
|
@@ -15126,6 +15335,7 @@ function OhhwellsBridge() {
|
|
|
15126
15335
|
reconcileNavbarItemsFromContent(content);
|
|
15127
15336
|
reconcileFooterOrderFromContent(content);
|
|
15128
15337
|
reconcileSocialsFromContent(content);
|
|
15338
|
+
applySocialsDisplayFromContent(content);
|
|
15129
15339
|
enforceLinkHrefs();
|
|
15130
15340
|
initSectionsFromContent(content, true);
|
|
15131
15341
|
sectionsLoadedRef.current = true;
|
|
@@ -15194,6 +15404,8 @@ function OhhwellsBridge() {
|
|
|
15194
15404
|
reconcileNavbarItemsFromContent(content);
|
|
15195
15405
|
reconcileFooterOrderFromContent(content);
|
|
15196
15406
|
reconcileSocialsFromContent(content);
|
|
15407
|
+
applySocialsDisplayFromContent(content);
|
|
15408
|
+
applySocialsDisplayFromContent(content);
|
|
15197
15409
|
} finally {
|
|
15198
15410
|
observer?.observe(document.body, { childList: true, subtree: true });
|
|
15199
15411
|
}
|
|
@@ -15272,6 +15484,8 @@ function OhhwellsBridge() {
|
|
|
15272
15484
|
reconcileNavbarItemsFromContent(content);
|
|
15273
15485
|
reconcileFooterOrderFromContent(content);
|
|
15274
15486
|
reconcileSocialsFromContent(content);
|
|
15487
|
+
applySocialsDisplayFromContent(content);
|
|
15488
|
+
applySocialsDisplayFromContent(content);
|
|
15275
15489
|
document.querySelectorAll("footer [data-ohw-href-key]").forEach((el) => {
|
|
15276
15490
|
if (isFooterHrefKey(el.getAttribute("data-ohw-href-key"))) {
|
|
15277
15491
|
disableNativeHrefDrag(el);
|
|
@@ -16549,32 +16763,34 @@ function OhhwellsBridge() {
|
|
|
16549
16763
|
};
|
|
16550
16764
|
const handleSocialUpdate = (e) => {
|
|
16551
16765
|
if (e.data?.type !== "ow:social-update") return;
|
|
16552
|
-
const
|
|
16766
|
+
const updates = Array.isArray(e.data.items) ? e.data.items : [e.data];
|
|
16553
16767
|
const nodes = [];
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16561
|
-
|
|
16562
|
-
|
|
16563
|
-
|
|
16564
|
-
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16570
|
-
|
|
16768
|
+
for (const { hrefKey, iconKey, url, iconMarkup, platformId, label } of updates) {
|
|
16769
|
+
if (hrefKey) {
|
|
16770
|
+
document.querySelectorAll(`[data-ohw-href-key="${hrefKey}"]`).forEach((el) => applyLinkHref(el, url));
|
|
16771
|
+
nodes.push({ key: hrefKey, text: url });
|
|
16772
|
+
}
|
|
16773
|
+
if (iconKey && typeof iconMarkup === "string" && iconMarkup) {
|
|
16774
|
+
document.querySelectorAll(`[data-ohw-key="${iconKey}"][data-ohw-editable="icon"]`).forEach((el) => {
|
|
16775
|
+
applyIconMarkup(el, iconMarkup);
|
|
16776
|
+
});
|
|
16777
|
+
nodes.push({ key: iconKey, text: iconMarkup });
|
|
16778
|
+
}
|
|
16779
|
+
if (iconKey && platformId) nodes.push({ key: socialPlatformKey(iconKey), text: platformId });
|
|
16780
|
+
if (iconKey && label) {
|
|
16781
|
+
const labelKey = socialLabelKey(iconKey);
|
|
16782
|
+
document.querySelectorAll(`[data-ohw-key="${labelKey}"]`).forEach((el) => {
|
|
16783
|
+
el.textContent = label;
|
|
16784
|
+
});
|
|
16785
|
+
nodes.push({ key: labelKey, text: label });
|
|
16786
|
+
}
|
|
16571
16787
|
}
|
|
16572
16788
|
if (!nodes.length) return;
|
|
16573
16789
|
editContentRef.current = {
|
|
16574
16790
|
...editContentRef.current,
|
|
16575
16791
|
...Object.fromEntries(nodes.map((node) => [node.key, node.text]))
|
|
16576
16792
|
};
|
|
16577
|
-
postToParentRef.current({ type: "ow:change", nodes });
|
|
16793
|
+
postToParentRef.current({ type: "ow:change", nodes, flush: true });
|
|
16578
16794
|
};
|
|
16579
16795
|
const handleIconMarkup = (e) => {
|
|
16580
16796
|
if (e.data?.type !== "ow:icon-markup") return;
|
|
@@ -16587,7 +16803,7 @@ function OhhwellsBridge() {
|
|
|
16587
16803
|
targets.forEach((el) => {
|
|
16588
16804
|
applyIconMarkup(el, markup);
|
|
16589
16805
|
});
|
|
16590
|
-
postToParentRef.current({ type: "ow:change", nodes: [{ key, text: markup }] });
|
|
16806
|
+
postToParentRef.current({ type: "ow:change", nodes: [{ key, text: markup }], flush: true });
|
|
16591
16807
|
};
|
|
16592
16808
|
const handleImageUrl = (e) => {
|
|
16593
16809
|
if (e.data?.type !== "ow:image-url") return;
|
|
@@ -17893,6 +18109,8 @@ function OhhwellsBridge() {
|
|
|
17893
18109
|
};
|
|
17894
18110
|
postToParent2({ type: "ow:change", nodes });
|
|
17895
18111
|
enforceLinkHrefs();
|
|
18112
|
+
const copyRow = findSocialsRow(result.item);
|
|
18113
|
+
if (copyRow) applySocialsDisplayToRow(copyRow, socialsDisplayFor(copyRow, editContentRef.current));
|
|
17896
18114
|
requestAnimationFrame(() => selectRef.current(result.item));
|
|
17897
18115
|
return;
|
|
17898
18116
|
}
|
|
@@ -18119,10 +18337,10 @@ function OhhwellsBridge() {
|
|
|
18119
18337
|
[postToParent2]
|
|
18120
18338
|
);
|
|
18121
18339
|
return bridgeRoot ? (0, import_react_dom4.createPortal)(
|
|
18122
|
-
/* @__PURE__ */ (0,
|
|
18123
|
-
/* @__PURE__ */ (0,
|
|
18124
|
-
isEditMode && /* @__PURE__ */ (0,
|
|
18125
|
-
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0,
|
|
18340
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
18341
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
18342
|
+
isEditMode && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AiSectionOverlay, { postToParent: postToParent2, apiRef: aiSectionApiRef }),
|
|
18343
|
+
Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18126
18344
|
MediaOverlay,
|
|
18127
18345
|
{
|
|
18128
18346
|
hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
|
|
@@ -18133,7 +18351,7 @@ function OhhwellsBridge() {
|
|
|
18133
18351
|
},
|
|
18134
18352
|
`uploading-${key}`
|
|
18135
18353
|
)),
|
|
18136
|
-
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0,
|
|
18354
|
+
mediaHover && !(mediaHover.key in uploadingRects) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18137
18355
|
MediaOverlay,
|
|
18138
18356
|
{
|
|
18139
18357
|
hover: mediaHover,
|
|
@@ -18142,11 +18360,11 @@ function OhhwellsBridge() {
|
|
|
18142
18360
|
onVideoSettingsChange: handleVideoSettingsChange
|
|
18143
18361
|
}
|
|
18144
18362
|
),
|
|
18145
|
-
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0,
|
|
18146
|
-
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0,
|
|
18147
|
-
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0,
|
|
18148
|
-
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0,
|
|
18149
|
-
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0,
|
|
18363
|
+
carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CarouselOverlay, { hover: carouselHover, onEdit: handleEditCarousel }),
|
|
18364
|
+
siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
|
|
18365
|
+
siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
|
|
18366
|
+
isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
|
|
18367
|
+
isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18150
18368
|
"div",
|
|
18151
18369
|
{
|
|
18152
18370
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -18156,7 +18374,7 @@ function OhhwellsBridge() {
|
|
|
18156
18374
|
width: slot.width,
|
|
18157
18375
|
height: slot.height
|
|
18158
18376
|
},
|
|
18159
|
-
children: /* @__PURE__ */ (0,
|
|
18377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18160
18378
|
DropIndicator,
|
|
18161
18379
|
{
|
|
18162
18380
|
direction: slot.direction,
|
|
@@ -18167,7 +18385,7 @@ function OhhwellsBridge() {
|
|
|
18167
18385
|
},
|
|
18168
18386
|
`footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
|
|
18169
18387
|
)),
|
|
18170
|
-
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0,
|
|
18388
|
+
isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18171
18389
|
"div",
|
|
18172
18390
|
{
|
|
18173
18391
|
className: "pointer-events-none fixed z-2147483646",
|
|
@@ -18177,7 +18395,7 @@ function OhhwellsBridge() {
|
|
|
18177
18395
|
width: slot.width,
|
|
18178
18396
|
height: slot.height
|
|
18179
18397
|
},
|
|
18180
|
-
children: /* @__PURE__ */ (0,
|
|
18398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18181
18399
|
DropIndicator,
|
|
18182
18400
|
{
|
|
18183
18401
|
direction: slot.direction,
|
|
@@ -18188,10 +18406,10 @@ function OhhwellsBridge() {
|
|
|
18188
18406
|
},
|
|
18189
18407
|
`nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
|
|
18190
18408
|
)),
|
|
18191
|
-
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0,
|
|
18192
|
-
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0,
|
|
18193
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0,
|
|
18194
|
-
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0,
|
|
18409
|
+
hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
|
|
18410
|
+
hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
|
|
18411
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
|
|
18412
|
+
toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18195
18413
|
FooterContainerChrome,
|
|
18196
18414
|
{
|
|
18197
18415
|
rect: toolbarRect,
|
|
@@ -18199,7 +18417,7 @@ function OhhwellsBridge() {
|
|
|
18199
18417
|
addDisabled: !canAddFooterColumn()
|
|
18200
18418
|
}
|
|
18201
18419
|
),
|
|
18202
|
-
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0,
|
|
18420
|
+
toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18203
18421
|
ItemInteractionLayer,
|
|
18204
18422
|
{
|
|
18205
18423
|
rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected) ? draggedItemRect : toolbarRect,
|
|
@@ -18214,10 +18432,18 @@ function OhhwellsBridge() {
|
|
|
18214
18432
|
onItemPointerDown: toolbarVariant === "logo" ? void 0 : handleItemChromePointerDown,
|
|
18215
18433
|
onItemClick: toolbarVariant === "logo" ? void 0 : handleItemChromeClick,
|
|
18216
18434
|
itemDragSurface: toolbarVariant !== "logo" && !isFooterFrameSelection,
|
|
18217
|
-
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */ (0,
|
|
18435
|
+
toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18218
18436
|
ItemActionToolbar,
|
|
18219
18437
|
{
|
|
18220
18438
|
onEditLink: openLinkPopoverForSelected,
|
|
18439
|
+
onStyle: () => {
|
|
18440
|
+
const row = selectedElRef.current;
|
|
18441
|
+
if (!row) return;
|
|
18442
|
+
if (floatingPanel?.kind === "socials-display") closeFloatingPanelOnly();
|
|
18443
|
+
else openSocialsDisplayPanel(row);
|
|
18444
|
+
},
|
|
18445
|
+
showStyle: selectedIsSocialsRow,
|
|
18446
|
+
styleActive: floatingPanel?.kind === "socials-display",
|
|
18221
18447
|
onAddItem: handleAddChildItem,
|
|
18222
18448
|
onSelectParent: handleSelectParent,
|
|
18223
18449
|
onDuplicate: handleDuplicateSelected,
|
|
@@ -18239,8 +18465,8 @@ function OhhwellsBridge() {
|
|
|
18239
18465
|
) : void 0
|
|
18240
18466
|
}
|
|
18241
18467
|
),
|
|
18242
|
-
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0,
|
|
18243
|
-
/* @__PURE__ */ (0,
|
|
18468
|
+
toolbarRect && toolbarVariant === "rich-text" && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
18469
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18244
18470
|
EditGlowChrome,
|
|
18245
18471
|
{
|
|
18246
18472
|
rect: toolbarRect,
|
|
@@ -18250,7 +18476,7 @@ function OhhwellsBridge() {
|
|
|
18250
18476
|
hideHandle: isItemDragging
|
|
18251
18477
|
}
|
|
18252
18478
|
),
|
|
18253
|
-
/* @__PURE__ */ (0,
|
|
18479
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18254
18480
|
FloatingToolbar,
|
|
18255
18481
|
{
|
|
18256
18482
|
rect: toolbarRect,
|
|
@@ -18263,7 +18489,7 @@ function OhhwellsBridge() {
|
|
|
18263
18489
|
}
|
|
18264
18490
|
)
|
|
18265
18491
|
] }),
|
|
18266
|
-
maxBadge && /* @__PURE__ */ (0,
|
|
18492
|
+
maxBadge && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
18267
18493
|
"div",
|
|
18268
18494
|
{
|
|
18269
18495
|
"data-ohw-max-badge": "",
|
|
@@ -18289,7 +18515,7 @@ function OhhwellsBridge() {
|
|
|
18289
18515
|
]
|
|
18290
18516
|
}
|
|
18291
18517
|
),
|
|
18292
|
-
toggleState && !linkPopover && /* @__PURE__ */ (0,
|
|
18518
|
+
toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18293
18519
|
StateToggle,
|
|
18294
18520
|
{
|
|
18295
18521
|
rect: toggleState.rect,
|
|
@@ -18298,15 +18524,15 @@ function OhhwellsBridge() {
|
|
|
18298
18524
|
onStateChange: handleStateChange
|
|
18299
18525
|
}
|
|
18300
18526
|
),
|
|
18301
|
-
sectionGap && !linkPopover && /* @__PURE__ */ (0,
|
|
18527
|
+
sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
18302
18528
|
"div",
|
|
18303
18529
|
{
|
|
18304
18530
|
"data-ohw-section-insert-line": "",
|
|
18305
18531
|
className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
|
|
18306
18532
|
style: { top: sectionGap.y, transform: "translateY(-50%)" },
|
|
18307
18533
|
children: [
|
|
18308
|
-
/* @__PURE__ */ (0,
|
|
18309
|
-
/* @__PURE__ */ (0,
|
|
18534
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } }),
|
|
18535
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18310
18536
|
Badge,
|
|
18311
18537
|
{
|
|
18312
18538
|
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",
|
|
@@ -18323,11 +18549,11 @@ function OhhwellsBridge() {
|
|
|
18323
18549
|
children: "Add Section"
|
|
18324
18550
|
}
|
|
18325
18551
|
),
|
|
18326
|
-
/* @__PURE__ */ (0,
|
|
18552
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1 bg-primary", style: { height: 3 } })
|
|
18327
18553
|
]
|
|
18328
18554
|
}
|
|
18329
18555
|
),
|
|
18330
|
-
linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0,
|
|
18556
|
+
linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18331
18557
|
LinkPopover,
|
|
18332
18558
|
{
|
|
18333
18559
|
panelRef: linkPopoverPanelRef,
|
|
@@ -18344,7 +18570,29 @@ function OhhwellsBridge() {
|
|
|
18344
18570
|
},
|
|
18345
18571
|
linkPopover.key
|
|
18346
18572
|
) : null,
|
|
18347
|
-
floatingPanel && floatingPanel.kind === "
|
|
18573
|
+
floatingPanel && floatingPanel.kind === "socials-display" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18574
|
+
FloatingPanel,
|
|
18575
|
+
{
|
|
18576
|
+
open: true,
|
|
18577
|
+
title: floatingPanel.title,
|
|
18578
|
+
context: floatingPanel.context,
|
|
18579
|
+
position: floatingPanelPos,
|
|
18580
|
+
onPositionChange: setFloatingPanelPos,
|
|
18581
|
+
parentScroll: parentScrollSnap ?? parentScrollRef.current,
|
|
18582
|
+
onClose: closeFloatingPanelOnly,
|
|
18583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18584
|
+
SocialsDisplayPanel,
|
|
18585
|
+
{
|
|
18586
|
+
display: socialsDisplayFor(floatingPanel.row, editContentRef.current),
|
|
18587
|
+
onChange: (next) => {
|
|
18588
|
+
changeSocialsDisplay(floatingPanel.row, next);
|
|
18589
|
+
setFloatingPanel({ ...floatingPanel });
|
|
18590
|
+
}
|
|
18591
|
+
}
|
|
18592
|
+
)
|
|
18593
|
+
}
|
|
18594
|
+
) : null,
|
|
18595
|
+
floatingPanel && floatingPanel.kind === "logo-size" && logoSizeDraft ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18348
18596
|
FloatingPanel,
|
|
18349
18597
|
{
|
|
18350
18598
|
open: true,
|
|
@@ -18354,7 +18602,7 @@ function OhhwellsBridge() {
|
|
|
18354
18602
|
onPositionChange: setFloatingPanelPos,
|
|
18355
18603
|
parentScroll: parentScrollSnap ?? parentScrollRef.current,
|
|
18356
18604
|
onClose: closeFloatingPanelAndDeselect,
|
|
18357
|
-
children: /* @__PURE__ */ (0,
|
|
18605
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18358
18606
|
LogoSizePanel,
|
|
18359
18607
|
{
|
|
18360
18608
|
viewport: editorViewport,
|
|
@@ -18402,10 +18650,10 @@ function OhhwellsBridge() {
|
|
|
18402
18650
|
|
|
18403
18651
|
// src/ui/EmptySection.tsx
|
|
18404
18652
|
var import_link = __toESM(require("next/link"), 1);
|
|
18405
|
-
var
|
|
18653
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
18406
18654
|
function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
|
|
18407
|
-
return /* @__PURE__ */ (0,
|
|
18408
|
-
/* @__PURE__ */ (0,
|
|
18655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
18656
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18409
18657
|
"p",
|
|
18410
18658
|
{
|
|
18411
18659
|
style: {
|
|
@@ -18417,10 +18665,10 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
|
|
|
18417
18665
|
color: "var(--brand-accent)",
|
|
18418
18666
|
marginBottom: "1.5rem"
|
|
18419
18667
|
},
|
|
18420
|
-
children: /* @__PURE__ */ (0,
|
|
18668
|
+
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" }) })
|
|
18421
18669
|
}
|
|
18422
18670
|
),
|
|
18423
|
-
/* @__PURE__ */ (0,
|
|
18671
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18424
18672
|
"h1",
|
|
18425
18673
|
{
|
|
18426
18674
|
style: {
|
|
@@ -18435,7 +18683,7 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
|
|
|
18435
18683
|
children: title
|
|
18436
18684
|
}
|
|
18437
18685
|
),
|
|
18438
|
-
/* @__PURE__ */ (0,
|
|
18686
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18439
18687
|
"p",
|
|
18440
18688
|
{
|
|
18441
18689
|
style: {
|