@ohhwells/bridge 0.1.126-next.347 → 0.1.127
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 +65 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +65 -105
- package/dist/index.js.map +1 -1
- package/dist/pages.cjs +1 -1
- package/dist/pages.cjs.map +1 -1
- package/dist/pages.js +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/styles.css +0 -43
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1783,22 +1783,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
1783
1783
|
function textAttrs(ctx, path) {
|
|
1784
1784
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
1785
1785
|
}
|
|
1786
|
-
var AI_RESPONSIVE_CSS = [
|
|
1787
|
-
"@media (max-width: 960px) {",
|
|
1788
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
1789
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
1790
|
-
"}",
|
|
1791
|
-
"@media (max-width: 640px) {",
|
|
1792
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
1793
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
1794
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
1795
|
-
" [data-ai-responsive] [data-ai-group] { display: flex !important; flex-direction: column !important; }",
|
|
1796
|
-
" [data-ai-responsive] [data-ai-group] > * { grid-column: auto !important; }",
|
|
1797
|
-
" [data-ai-responsive] [data-ai-section-inner] { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
1798
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
1799
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
1800
|
-
"}"
|
|
1801
|
-
].join("\n");
|
|
1802
1786
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
1803
1787
|
function MediaBox({
|
|
1804
1788
|
refValue,
|
|
@@ -1816,9 +1800,9 @@ function MediaBox({
|
|
|
1816
1800
|
const url = refValue ? ctx.resolveMedia(refValue) : null;
|
|
1817
1801
|
const isIcon = /^(lucide|simple):/.test(refValue);
|
|
1818
1802
|
const aspectRatio = aspect && /^\d+:\d+$/.test(aspect) ? aspect.replace(":", " / ") : void 0;
|
|
1819
|
-
const editAttrs = ctx.keyFor && editPath ? {
|
|
1803
|
+
const editAttrs = ctx.keyFor && editPath && !isIcon ? {
|
|
1820
1804
|
"data-ohw-key": ctx.keyFor(editPath),
|
|
1821
|
-
...
|
|
1805
|
+
...genericImageEdit ? { "data-ohw-editable": "image" } : {}
|
|
1822
1806
|
} : {};
|
|
1823
1807
|
if (isIcon) {
|
|
1824
1808
|
const Icon = refValue.startsWith("lucide:") ? lucideByName(refValue.slice(7)) : null;
|
|
@@ -1826,7 +1810,6 @@ function MediaBox({
|
|
|
1826
1810
|
"span",
|
|
1827
1811
|
{
|
|
1828
1812
|
"data-ai-icon": refValue,
|
|
1829
|
-
...editAttrs,
|
|
1830
1813
|
style: {
|
|
1831
1814
|
display: "inline-flex",
|
|
1832
1815
|
width: 48,
|
|
@@ -2996,7 +2979,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
2996
2979
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2997
2980
|
"div",
|
|
2998
2981
|
{
|
|
2999
|
-
"data-ai-grid":
|
|
2982
|
+
"data-ai-grid": "",
|
|
3000
2983
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
3001
2984
|
style: {
|
|
3002
2985
|
display: "grid",
|
|
@@ -3357,7 +3340,6 @@ function AiTreeRenderer({
|
|
|
3357
3340
|
{
|
|
3358
3341
|
"data-ai-section": tree.tag ?? "",
|
|
3359
3342
|
...bgAttrs,
|
|
3360
|
-
"data-ai-responsive": "",
|
|
3361
3343
|
style: {
|
|
3362
3344
|
position: "relative",
|
|
3363
3345
|
padding: `${pad}px 0`,
|
|
@@ -3368,13 +3350,12 @@ function AiTreeRenderer({
|
|
|
3368
3350
|
color: settings.sectionBackground === "accent" ? blockBrand.palette.dark : void 0
|
|
3369
3351
|
},
|
|
3370
3352
|
children: [
|
|
3371
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
|
|
3372
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
3373
3353
|
isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
3354
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
3374
3355
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3375
3356
|
"div",
|
|
3376
3357
|
{
|
|
3377
|
-
"data-ai-
|
|
3358
|
+
"data-ai-container": "",
|
|
3378
3359
|
style: {
|
|
3379
3360
|
position: "relative",
|
|
3380
3361
|
maxWidth: AI_TREE_TOKENS.sectionMaxWidth,
|
|
@@ -3385,7 +3366,7 @@ function AiTreeRenderer({
|
|
|
3385
3366
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3386
3367
|
"div",
|
|
3387
3368
|
{
|
|
3388
|
-
"data-ai-
|
|
3369
|
+
"data-ai-row": "",
|
|
3389
3370
|
style: {
|
|
3390
3371
|
display: "grid",
|
|
3391
3372
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -3789,10 +3770,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
3789
3770
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
3790
3771
|
continue;
|
|
3791
3772
|
}
|
|
3773
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
3792
3774
|
let container = existing?.container;
|
|
3793
|
-
let isNewMount = false;
|
|
3794
3775
|
if (!container || !container.isConnected) {
|
|
3795
|
-
isNewMount = true;
|
|
3796
3776
|
existing?.root.unmount();
|
|
3797
3777
|
container?.remove();
|
|
3798
3778
|
container = document.createElement("div");
|
|
@@ -9687,7 +9667,6 @@ function MediaOverlay({
|
|
|
9687
9667
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
9688
9668
|
);
|
|
9689
9669
|
}, [isVideo]);
|
|
9690
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
9691
9670
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
9692
9671
|
const box = {
|
|
9693
9672
|
position: "fixed",
|
|
@@ -9786,10 +9765,11 @@ function MediaOverlay({
|
|
|
9786
9765
|
className: "flex items-center justify-center cursor-pointer",
|
|
9787
9766
|
style: {
|
|
9788
9767
|
...box,
|
|
9789
|
-
//
|
|
9790
|
-
//
|
|
9791
|
-
//
|
|
9792
|
-
|
|
9768
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
9769
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
9770
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
9771
|
+
// Replace still works.
|
|
9772
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
9793
9773
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
9794
9774
|
// than hovered. Hover keeps the existing tinted preview.
|
|
9795
9775
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -9816,17 +9796,17 @@ function MediaOverlay({
|
|
|
9816
9796
|
},
|
|
9817
9797
|
children: [
|
|
9818
9798
|
isVideo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
|
|
9819
|
-
|
|
9799
|
+
isVideo ? "Replace video" : "Replace image"
|
|
9820
9800
|
]
|
|
9821
9801
|
}
|
|
9822
9802
|
),
|
|
9823
|
-
|
|
9803
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9824
9804
|
Button,
|
|
9825
9805
|
{
|
|
9826
9806
|
"data-ohw-media-overlay": "",
|
|
9827
9807
|
variant: "outline",
|
|
9828
9808
|
size: "sm",
|
|
9829
|
-
"aria-label":
|
|
9809
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
9830
9810
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
9831
9811
|
style: {
|
|
9832
9812
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -9849,7 +9829,7 @@ function MediaOverlay({
|
|
|
9849
9829
|
},
|
|
9850
9830
|
children: [
|
|
9851
9831
|
isVideo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
|
|
9852
|
-
replaceMode === "full" ?
|
|
9832
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
9853
9833
|
]
|
|
9854
9834
|
}
|
|
9855
9835
|
)
|
|
@@ -16663,7 +16643,6 @@ function readLogoSizeState(content, placement) {
|
|
|
16663
16643
|
function getLogoElement(el) {
|
|
16664
16644
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
16665
16645
|
if (marked) return marked;
|
|
16666
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
16667
16646
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
16668
16647
|
if (!root) return null;
|
|
16669
16648
|
const anchor = el.closest("a");
|
|
@@ -20857,7 +20836,7 @@ function getNavigationSelectionParent(el) {
|
|
|
20857
20836
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
20858
20837
|
return getFooterLinksContainer();
|
|
20859
20838
|
}
|
|
20860
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
20839
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
20861
20840
|
return getNavigationRoot(el);
|
|
20862
20841
|
}
|
|
20863
20842
|
return null;
|
|
@@ -21079,6 +21058,7 @@ var ICONS = {
|
|
|
21079
21058
|
insertUnorderedList: '<line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/>',
|
|
21080
21059
|
insertOrderedList: '<line x1="10" y1="6" x2="21" y2="6"/><line x1="10" y1="12" x2="21" y2="12"/><line x1="10" y1="18" x2="21" y2="18"/><path d="M4 6h1v4"/><path d="M4 10h2"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/>'
|
|
21081
21060
|
};
|
|
21061
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
21082
21062
|
var SELECTION_CHROME_GAP2 = 4;
|
|
21083
21063
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
21084
21064
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -22057,6 +22037,21 @@ function OhhwellsBridge() {
|
|
|
22057
22037
|
const [isItemDragging, setIsItemDragging] = (0, import_react20.useState)(false);
|
|
22058
22038
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react20.useState)(false);
|
|
22059
22039
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
22040
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react20.useState)(null);
|
|
22041
|
+
const floatingPanelOpenRef = (0, import_react20.useRef)(false);
|
|
22042
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
22043
|
+
const floatingPanelRef = (0, import_react20.useRef)(null);
|
|
22044
|
+
floatingPanelRef.current = floatingPanel;
|
|
22045
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react20.useState)(null);
|
|
22046
|
+
const buttonCollectionDragRef = (0, import_react20.useRef)(null);
|
|
22047
|
+
const buttonDropInsertIndexRef = (0, import_react20.useRef)(null);
|
|
22048
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react20.useState)([]);
|
|
22049
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react20.useState)(null);
|
|
22050
|
+
const buttonPointerDragRef = (0, import_react20.useRef)(null);
|
|
22051
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react20.useState)(0);
|
|
22052
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react20.useState)(null);
|
|
22053
|
+
const [editorViewport, setEditorViewport] = (0, import_react20.useState)("desktop");
|
|
22054
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react20.useState)(null);
|
|
22060
22055
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react20.useState)(null);
|
|
22061
22056
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react20.useState)(null);
|
|
22062
22057
|
const footerDragRef = (0, import_react20.useRef)(null);
|
|
@@ -22080,21 +22075,6 @@ function OhhwellsBridge() {
|
|
|
22080
22075
|
const stylesRef = (0, import_react20.useRef)("");
|
|
22081
22076
|
const appliedDrawerRef = (0, import_react20.useRef)(null);
|
|
22082
22077
|
const pendingDeleteUndoRef = (0, import_react20.useRef)(null);
|
|
22083
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react20.useState)(null);
|
|
22084
|
-
const floatingPanelOpenRef = (0, import_react20.useRef)(false);
|
|
22085
|
-
const floatingPanelRef = (0, import_react20.useRef)(null);
|
|
22086
|
-
floatingPanelRef.current = floatingPanel;
|
|
22087
|
-
const setFloatingPanelRef = (0, import_react20.useRef)(setFloatingPanel);
|
|
22088
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react20.useState)(null);
|
|
22089
|
-
const buttonCollectionDragRef = (0, import_react20.useRef)(null);
|
|
22090
|
-
const buttonDropInsertIndexRef = (0, import_react20.useRef)(null);
|
|
22091
|
-
const [buttonDropSlots, setButtonDropSlots] = (0, import_react20.useState)([]);
|
|
22092
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react20.useState)(null);
|
|
22093
|
-
const buttonPointerDragRef = (0, import_react20.useRef)(null);
|
|
22094
|
-
const [buttonStyleTick, setButtonStyleTick] = (0, import_react20.useState)(0);
|
|
22095
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react20.useState)(null);
|
|
22096
|
-
const [editorViewport, setEditorViewport] = (0, import_react20.useState)("desktop");
|
|
22097
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react20.useState)(null);
|
|
22098
22078
|
const [sitePages, setSitePages] = (0, import_react20.useState)([]);
|
|
22099
22079
|
const [sectionsByPath, setSectionsByPath] = (0, import_react20.useState)({});
|
|
22100
22080
|
const sectionsPrefetchGenRef = (0, import_react20.useRef)(0);
|
|
@@ -22103,18 +22083,7 @@ function OhhwellsBridge() {
|
|
|
22103
22083
|
const linkPopoverOpenRef = (0, import_react20.useRef)(false);
|
|
22104
22084
|
const linkPopoverGraceUntilRef = (0, import_react20.useRef)(0);
|
|
22105
22085
|
setLinkPopoverRef.current = setLinkPopover;
|
|
22106
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
22107
22086
|
linkPopoverSessionRef.current = linkPopover;
|
|
22108
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
22109
|
-
(0, import_react20.useEffect)(() => {
|
|
22110
|
-
const syncViewport = () => {
|
|
22111
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
22112
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
22113
|
-
};
|
|
22114
|
-
syncViewport();
|
|
22115
|
-
window.addEventListener("resize", syncViewport);
|
|
22116
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
22117
|
-
}, []);
|
|
22118
22087
|
(0, import_react20.useEffect)(() => {
|
|
22119
22088
|
setSectionOrderPersistHandler((entries) => {
|
|
22120
22089
|
const currentPath = window.location.pathname;
|
|
@@ -23632,7 +23601,6 @@ function OhhwellsBridge() {
|
|
|
23632
23601
|
}
|
|
23633
23602
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
23634
23603
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
23635
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
23636
23604
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
23637
23605
|
}
|
|
23638
23606
|
applyBrandChrome(content);
|
|
@@ -23641,12 +23609,12 @@ function OhhwellsBridge() {
|
|
|
23641
23609
|
for (const [key, val] of Object.entries(content)) {
|
|
23642
23610
|
if (key === "__ohw_sections") continue;
|
|
23643
23611
|
if (key === AI_SECTIONS_KEY) continue;
|
|
23644
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
23645
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
23646
23612
|
if (key === BRAND_KIT_KEY) continue;
|
|
23647
23613
|
if (key === STYLE_STORE_KEY) continue;
|
|
23648
23614
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
23615
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
23649
23616
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
23617
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
23650
23618
|
if (applyVideoSettingNode(key, val)) continue;
|
|
23651
23619
|
if (applyCarouselNode(key, val)) continue;
|
|
23652
23620
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -23856,17 +23824,16 @@ function OhhwellsBridge() {
|
|
|
23856
23824
|
applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
|
|
23857
23825
|
}
|
|
23858
23826
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
23859
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
23860
23827
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
23861
23828
|
}
|
|
23862
23829
|
for (const [key, val] of Object.entries(content)) {
|
|
23863
23830
|
if (key === "__ohw_sections") continue;
|
|
23864
23831
|
if (key === AI_SECTIONS_KEY) continue;
|
|
23865
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
23866
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
23867
23832
|
if (key === BRAND_KIT_KEY) continue;
|
|
23868
23833
|
if (key === STYLE_STORE_KEY) continue;
|
|
23869
23834
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
23835
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
23836
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
23870
23837
|
if (applyVideoSettingNode(key, val)) continue;
|
|
23871
23838
|
if (applyCarouselNode(key, val)) continue;
|
|
23872
23839
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -24117,11 +24084,26 @@ function OhhwellsBridge() {
|
|
|
24117
24084
|
const t2 = setTimeout(measure, 500);
|
|
24118
24085
|
const ro = new ResizeObserver(schedule);
|
|
24119
24086
|
ro.observe(document.body);
|
|
24087
|
+
let lastWidth = window.innerWidth;
|
|
24088
|
+
let resizeTimers = [];
|
|
24089
|
+
const clearResizeTimers = () => {
|
|
24090
|
+
resizeTimers.forEach(clearTimeout);
|
|
24091
|
+
resizeTimers = [];
|
|
24092
|
+
};
|
|
24093
|
+
const handleResize = () => {
|
|
24094
|
+
if (window.innerWidth === lastWidth) return;
|
|
24095
|
+
lastWidth = window.innerWidth;
|
|
24096
|
+
clearResizeTimers();
|
|
24097
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
24098
|
+
};
|
|
24099
|
+
window.addEventListener("resize", handleResize);
|
|
24120
24100
|
return () => {
|
|
24121
24101
|
clearTimeout(t1);
|
|
24122
24102
|
clearTimeout(t2);
|
|
24123
24103
|
if (raf != null) cancelAnimationFrame(raf);
|
|
24124
24104
|
ro.disconnect();
|
|
24105
|
+
clearResizeTimers();
|
|
24106
|
+
window.removeEventListener("resize", handleResize);
|
|
24125
24107
|
};
|
|
24126
24108
|
}, [pathname, isEditMode, postToParent2]);
|
|
24127
24109
|
(0, import_react20.useEffect)(() => {
|
|
@@ -24416,13 +24398,6 @@ function OhhwellsBridge() {
|
|
|
24416
24398
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
24417
24399
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
24418
24400
|
if (isInsideLinkEditor(target)) return;
|
|
24419
|
-
if (isInsideFloatingPanel(target)) return;
|
|
24420
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
24421
|
-
if (target.closest(
|
|
24422
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
24423
|
-
)) {
|
|
24424
|
-
return;
|
|
24425
|
-
}
|
|
24426
24401
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
24427
24402
|
clearMediaSelectionRef.current();
|
|
24428
24403
|
}
|
|
@@ -24443,6 +24418,13 @@ function OhhwellsBridge() {
|
|
|
24443
24418
|
return;
|
|
24444
24419
|
}
|
|
24445
24420
|
}
|
|
24421
|
+
if (isInsideFloatingPanel(target)) return;
|
|
24422
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
24423
|
+
if (target.closest(
|
|
24424
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
24425
|
+
)) {
|
|
24426
|
+
return;
|
|
24427
|
+
}
|
|
24446
24428
|
{
|
|
24447
24429
|
const formEl = getFormElement(target);
|
|
24448
24430
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -24822,9 +24804,6 @@ function OhhwellsBridge() {
|
|
|
24822
24804
|
setHoveredItemRect(null);
|
|
24823
24805
|
hoveredNavContainerRef.current = null;
|
|
24824
24806
|
setHoveredNavContainerRect(null);
|
|
24825
|
-
siblingHintElRef.current = null;
|
|
24826
|
-
setSiblingHintRect(null);
|
|
24827
|
-
setSiblingHintRects([]);
|
|
24828
24807
|
return;
|
|
24829
24808
|
}
|
|
24830
24809
|
{
|
|
@@ -24945,6 +24924,7 @@ function OhhwellsBridge() {
|
|
|
24945
24924
|
hoveredNavContainerRef.current = null;
|
|
24946
24925
|
setHoveredNavContainerRect(null);
|
|
24947
24926
|
hoveredItemElRef.current = editable;
|
|
24927
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
24948
24928
|
}
|
|
24949
24929
|
}
|
|
24950
24930
|
}
|
|
@@ -25654,11 +25634,7 @@ function OhhwellsBridge() {
|
|
|
25654
25634
|
};
|
|
25655
25635
|
const handleMouseMove = (e) => {
|
|
25656
25636
|
const { clientX, clientY } = e;
|
|
25657
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
25658
|
-
dismissImageHover();
|
|
25659
|
-
clearImageHover();
|
|
25660
|
-
return;
|
|
25661
|
-
}
|
|
25637
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
25662
25638
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
25663
25639
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
25664
25640
|
formHoverElRef.current = null;
|
|
@@ -25687,12 +25663,7 @@ function OhhwellsBridge() {
|
|
|
25687
25663
|
setHoveredItemRect(null);
|
|
25688
25664
|
hoveredNavContainerRef.current = null;
|
|
25689
25665
|
setHoveredNavContainerRect(null);
|
|
25690
|
-
siblingHintElRef.current = null;
|
|
25691
|
-
setSiblingHintRect(null);
|
|
25692
|
-
setSiblingHintRects([]);
|
|
25693
25666
|
dismissImageHover();
|
|
25694
|
-
clearImageHover();
|
|
25695
|
-
setSectionGap(null);
|
|
25696
25667
|
return;
|
|
25697
25668
|
}
|
|
25698
25669
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -25704,11 +25675,7 @@ function OhhwellsBridge() {
|
|
|
25704
25675
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
25705
25676
|
const { clientX, clientY } = e.data;
|
|
25706
25677
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
25707
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
25708
|
-
dismissImageHover();
|
|
25709
|
-
clearImageHover();
|
|
25710
|
-
return;
|
|
25711
|
-
}
|
|
25678
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
25712
25679
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
25713
25680
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
25714
25681
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -26054,7 +26021,6 @@ function OhhwellsBridge() {
|
|
|
26054
26021
|
}
|
|
26055
26022
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
26056
26023
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
26057
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
26058
26024
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
26059
26025
|
}
|
|
26060
26026
|
applyBrandChrome(content);
|
|
@@ -26067,12 +26033,12 @@ function OhhwellsBridge() {
|
|
|
26067
26033
|
continue;
|
|
26068
26034
|
}
|
|
26069
26035
|
if (key === AI_SECTIONS_KEY) continue;
|
|
26070
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
26071
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
26072
26036
|
if (key === BRAND_KIT_KEY) continue;
|
|
26073
26037
|
if (key === STYLE_STORE_KEY) continue;
|
|
26074
26038
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
26039
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
26075
26040
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
26041
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
26076
26042
|
if (applyVideoSettingNode(key, val)) continue;
|
|
26077
26043
|
if (applyCarouselNode(key, val)) continue;
|
|
26078
26044
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -26518,12 +26484,6 @@ function OhhwellsBridge() {
|
|
|
26518
26484
|
closeLinkPopoverRef.current();
|
|
26519
26485
|
return;
|
|
26520
26486
|
}
|
|
26521
|
-
if (floatingPanelOpenRef.current) {
|
|
26522
|
-
setFloatingPanelRef.current(null);
|
|
26523
|
-
deselectRef.current();
|
|
26524
|
-
deactivateRef.current();
|
|
26525
|
-
return;
|
|
26526
|
-
}
|
|
26527
26487
|
deselectRef.current();
|
|
26528
26488
|
deactivateRef.current();
|
|
26529
26489
|
clearMediaSelectionRef.current();
|
|
@@ -27271,10 +27231,10 @@ function OhhwellsBridge() {
|
|
|
27271
27231
|
window.removeEventListener("message", handleDeleteSection);
|
|
27272
27232
|
window.removeEventListener("message", handleDuplicateSection);
|
|
27273
27233
|
window.removeEventListener("message", handleDeactivate);
|
|
27234
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
27274
27235
|
window.removeEventListener("message", handleToastAction);
|
|
27275
27236
|
window.removeEventListener("message", handleFormCount);
|
|
27276
27237
|
window.removeEventListener("message", handleUiEscape);
|
|
27277
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
27278
27238
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
27279
27239
|
autoSaveTimers.current.clear();
|
|
27280
27240
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|