@ohhwells/bridge 0.1.79 → 0.1.80-next.244
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 +564 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +563 -216
- package/dist/index.js.map +1 -1
- package/dist/pages.cjs +141 -0
- package/dist/pages.cjs.map +1 -0
- package/dist/pages.d.cts +45 -0
- package/dist/pages.d.ts +45 -0
- package/dist/pages.js +107 -0
- package/dist/pages.js.map +1 -0
- package/dist/styles.css +508 -453
- package/package.json +8 -3
package/dist/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ __export(index_exports, {
|
|
|
46
46
|
DropdownMenuItem: () => DropdownMenuItem,
|
|
47
47
|
DropdownMenuSeparator: () => DropdownMenuSeparator,
|
|
48
48
|
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
49
|
+
EmptySection: () => EmptySection,
|
|
49
50
|
ItemActionToolbar: () => ItemActionToolbar,
|
|
50
51
|
ItemInteractionLayer: () => ItemInteractionLayer,
|
|
51
52
|
LinkEditorPanel: () => LinkEditorPanel,
|
|
@@ -142,6 +143,7 @@ function isRenderableTree(value) {
|
|
|
142
143
|
|
|
143
144
|
// src/lib/ai-sections-store.ts
|
|
144
145
|
var AI_SECTIONS_KEY = "__ohw_ai_sections";
|
|
146
|
+
var AI_SLOT_KEY_PREFIX = "ai.";
|
|
145
147
|
var EMPTY_AI_SECTIONS = { v: 1, sections: [] };
|
|
146
148
|
function parseAiSectionsState(raw) {
|
|
147
149
|
if (!raw) return EMPTY_AI_SECTIONS;
|
|
@@ -185,6 +187,63 @@ function applyTreeToState(state, payload) {
|
|
|
185
187
|
const others = state.sections.filter((existing) => existing.id !== entry.id);
|
|
186
188
|
return { ...state, v: 1, sections: [...others, entry] };
|
|
187
189
|
}
|
|
190
|
+
function foldAlignIntoTrees(state, store) {
|
|
191
|
+
const byId = new Map(state.sections.map((entry) => [entry.id, entry]));
|
|
192
|
+
const nextTrees = /* @__PURE__ */ new Map();
|
|
193
|
+
const treeFor = (id) => {
|
|
194
|
+
const cloned = nextTrees.get(id);
|
|
195
|
+
if (cloned) return cloned;
|
|
196
|
+
const entry = byId.get(id);
|
|
197
|
+
if (!entry) return void 0;
|
|
198
|
+
const fresh = {
|
|
199
|
+
...entry.tree,
|
|
200
|
+
rows: entry.tree.rows.map((row) => ({ ...row, blocks: row.blocks.map((block) => ({ ...block })) }))
|
|
201
|
+
};
|
|
202
|
+
nextTrees.set(id, fresh);
|
|
203
|
+
return fresh;
|
|
204
|
+
};
|
|
205
|
+
const nodes = {};
|
|
206
|
+
for (const [key, override] of Object.entries(store.nodes)) {
|
|
207
|
+
const match = override.align !== void 0 && key.startsWith(AI_SLOT_KEY_PREFIX) ? key.match(/^ai\.(.+?)\.r(\d+)\.b(\d+)(?:\.|$)/) : null;
|
|
208
|
+
const tree = match ? treeFor(match[1]) : void 0;
|
|
209
|
+
const block = match && tree ? tree.rows[Number(match[2])]?.blocks[Number(match[3])] : void 0;
|
|
210
|
+
if (!block) {
|
|
211
|
+
nodes[key] = override;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
block.align = override.align;
|
|
215
|
+
const rest = { ...override };
|
|
216
|
+
delete rest.align;
|
|
217
|
+
if (Object.keys(rest).length > 0) nodes[key] = rest;
|
|
218
|
+
}
|
|
219
|
+
const sections = {};
|
|
220
|
+
for (const [sectionId, override] of Object.entries(store.sections)) {
|
|
221
|
+
const tree = override.align !== void 0 ? treeFor(sectionId) : void 0;
|
|
222
|
+
if (!tree) {
|
|
223
|
+
sections[sectionId] = override;
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
for (const row of tree.rows) {
|
|
227
|
+
for (const block of row.blocks) block.align = override.align;
|
|
228
|
+
}
|
|
229
|
+
const rest = { ...override };
|
|
230
|
+
delete rest.align;
|
|
231
|
+
if (Object.keys(rest).length > 0) sections[sectionId] = rest;
|
|
232
|
+
}
|
|
233
|
+
if (nextTrees.size === 0) return { state, store, changed: false };
|
|
234
|
+
return {
|
|
235
|
+
state: {
|
|
236
|
+
...state,
|
|
237
|
+
v: 1,
|
|
238
|
+
sections: state.sections.map((entry) => {
|
|
239
|
+
const tree = nextTrees.get(entry.id);
|
|
240
|
+
return tree ? { ...entry, tree } : entry;
|
|
241
|
+
})
|
|
242
|
+
},
|
|
243
|
+
store: { v: 1, sections, nodes },
|
|
244
|
+
changed: true
|
|
245
|
+
};
|
|
246
|
+
}
|
|
188
247
|
function removeFromState(state, id) {
|
|
189
248
|
return { ...state, v: 1, sections: state.sections.filter((entry) => entry.id !== id) };
|
|
190
249
|
}
|
|
@@ -377,6 +436,9 @@ function styleSheetCss() {
|
|
|
377
436
|
`[data-ohw-style-spacing="${spacing}"] { padding-top: ${px}px !important; padding-bottom: ${px}px !important; }`
|
|
378
437
|
);
|
|
379
438
|
}
|
|
439
|
+
for (const align of ["left", "center", "right"]) {
|
|
440
|
+
rules.push(`[data-ohw-style-align="${align}"] { text-align: ${align} !important; }`);
|
|
441
|
+
}
|
|
380
442
|
return rules.join("\n");
|
|
381
443
|
}
|
|
382
444
|
var STYLE_FONT_LINK_ID = "ohw-style-fonts";
|
|
@@ -403,13 +465,29 @@ var SECTION_ATTRS = {
|
|
|
403
465
|
textDistribution: "data-ohw-style-distribution",
|
|
404
466
|
headlineScale: "data-ohw-style-headline",
|
|
405
467
|
imageAspect: "data-ohw-style-aspect",
|
|
406
|
-
spacing: "data-ohw-style-spacing"
|
|
468
|
+
spacing: "data-ohw-style-spacing",
|
|
469
|
+
align: "data-ohw-style-align"
|
|
407
470
|
};
|
|
408
471
|
var NODE_WROTE_ATTR = "data-ohw-style-node";
|
|
409
|
-
var NODE_PROPS = [
|
|
472
|
+
var NODE_PROPS = [
|
|
473
|
+
"color",
|
|
474
|
+
"font-family",
|
|
475
|
+
"font-size",
|
|
476
|
+
"background",
|
|
477
|
+
"text-align",
|
|
478
|
+
"justify-content",
|
|
479
|
+
"align-items"
|
|
480
|
+
];
|
|
481
|
+
var ALIGN_JUSTIFY = {
|
|
482
|
+
left: "flex-start",
|
|
483
|
+
center: "center",
|
|
484
|
+
right: "flex-end"
|
|
485
|
+
};
|
|
410
486
|
function saveInline(el, prop) {
|
|
411
487
|
const attr = `data-ohw-style-prev-${prop}`;
|
|
412
|
-
if (
|
|
488
|
+
if (el.hasAttribute(attr)) return;
|
|
489
|
+
const value = el.style.getPropertyValue(prop) || (prop === "background" ? el.style.getPropertyValue("background-color") : "");
|
|
490
|
+
el.setAttribute(attr, value);
|
|
413
491
|
}
|
|
414
492
|
function restoreInline(el, prop) {
|
|
415
493
|
const attr = `data-ohw-style-prev-${prop}`;
|
|
@@ -448,6 +526,13 @@ function clearNodeProps(root) {
|
|
|
448
526
|
function buttonSurfaceOf(el) {
|
|
449
527
|
return el.closest("a, button") ?? el;
|
|
450
528
|
}
|
|
529
|
+
function alignSubjectOf(el) {
|
|
530
|
+
const button = el.closest('[data-ohw-role="button"]');
|
|
531
|
+
return button?.parentElement ?? el;
|
|
532
|
+
}
|
|
533
|
+
function horizontalFlexProp(el) {
|
|
534
|
+
return getComputedStyle(el).flexDirection.startsWith("column") ? "align-items" : "justify-content";
|
|
535
|
+
}
|
|
451
536
|
function applyStylesToDom(store) {
|
|
452
537
|
ensureStyleSheet();
|
|
453
538
|
clearSectionAttrs(document);
|
|
@@ -460,7 +545,8 @@ function applyStylesToDom(store) {
|
|
|
460
545
|
const sections = document.querySelectorAll(
|
|
461
546
|
`[data-ohw-section="${CSS.escape(sectionId)}"]`
|
|
462
547
|
);
|
|
463
|
-
for (const
|
|
548
|
+
for (const marker of Array.from(sections)) {
|
|
549
|
+
const section = marker.querySelector(":scope > [data-ai-section]") ?? marker;
|
|
464
550
|
for (const [prop, attr] of Object.entries(SECTION_ATTRS)) {
|
|
465
551
|
const value = override[prop];
|
|
466
552
|
if (value === void 0) continue;
|
|
@@ -492,6 +578,15 @@ function applyStylesToDom(store) {
|
|
|
492
578
|
el.style.setProperty("font-size", `${override.fontSize}px`, "important");
|
|
493
579
|
el.setAttribute(NODE_WROTE_ATTR, "");
|
|
494
580
|
}
|
|
581
|
+
if (override.align !== void 0) {
|
|
582
|
+
const subject = alignSubjectOf(el);
|
|
583
|
+
const flexProp = horizontalFlexProp(subject);
|
|
584
|
+
saveInline(subject, "text-align");
|
|
585
|
+
saveInline(subject, flexProp);
|
|
586
|
+
subject.style.setProperty("text-align", override.align, "important");
|
|
587
|
+
subject.style.setProperty(flexProp, ALIGN_JUSTIFY[override.align] ?? "flex-start", "important");
|
|
588
|
+
subject.setAttribute(NODE_WROTE_ATTR, "");
|
|
589
|
+
}
|
|
495
590
|
if (override.buttonBackground !== void 0 || override.buttonText !== void 0) {
|
|
496
591
|
const surface = buttonSurfaceOf(el);
|
|
497
592
|
if (override.buttonBackground !== void 0) {
|
|
@@ -542,8 +637,6 @@ var AI_MOBILE_CSS = [
|
|
|
542
637
|
// Group containers flatten to a column on phones; span placements come along for free.
|
|
543
638
|
"[data-ai-group]{display:flex !important;flex-direction:column !important}",
|
|
544
639
|
"[data-ai-group] > *{grid-column:auto !important}",
|
|
545
|
-
// The 50:50 form collapses to a single stacked column on phones.
|
|
546
|
-
"[data-ai-form]{grid-template-columns:1fr !important}",
|
|
547
640
|
"[data-ai-section] img{max-width:100%}",
|
|
548
641
|
"}",
|
|
549
642
|
"@media (min-width: 769px) and (max-width: 1024px){",
|
|
@@ -589,6 +682,22 @@ function accentBandContext(brand) {
|
|
|
589
682
|
function textAttrs(ctx, path) {
|
|
590
683
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
591
684
|
}
|
|
685
|
+
var AI_RESPONSIVE_CSS = [
|
|
686
|
+
"@media (max-width: 960px) {",
|
|
687
|
+
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
688
|
+
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
689
|
+
"}",
|
|
690
|
+
"@media (max-width: 640px) {",
|
|
691
|
+
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
692
|
+
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
693
|
+
// Group containers flatten to a column on phones; span placements come along for free.
|
|
694
|
+
" [data-ai-responsive] [data-ai-group] { display: flex !important; flex-direction: column !important; }",
|
|
695
|
+
" [data-ai-responsive] [data-ai-group] > * { grid-column: auto !important; }",
|
|
696
|
+
" [data-ai-responsive] [data-ai-section-inner] { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
697
|
+
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
698
|
+
" [data-ai-responsive] img { max-width: 100%; }",
|
|
699
|
+
"}"
|
|
700
|
+
].join("\n");
|
|
592
701
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
593
702
|
function MediaBox({
|
|
594
703
|
refValue,
|
|
@@ -601,13 +710,17 @@ function MediaBox({
|
|
|
601
710
|
const url = refValue ? ctx.resolveMedia(refValue) : null;
|
|
602
711
|
const isIcon = /^(lucide|simple):/.test(refValue);
|
|
603
712
|
const aspectRatio = aspect && /^\d+:\d+$/.test(aspect) ? aspect.replace(":", " / ") : void 0;
|
|
604
|
-
const editAttrs = ctx.keyFor && editPath
|
|
713
|
+
const editAttrs = ctx.keyFor && editPath ? {
|
|
714
|
+
"data-ohw-key": ctx.keyFor(editPath),
|
|
715
|
+
"data-ohw-editable": isIcon ? "icon" : "image"
|
|
716
|
+
} : {};
|
|
605
717
|
if (isIcon) {
|
|
606
718
|
const Icon = refValue.startsWith("lucide:") ? lucideByName(refValue.slice(7)) : null;
|
|
607
719
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
608
720
|
"span",
|
|
609
721
|
{
|
|
610
722
|
"data-ai-icon": refValue,
|
|
723
|
+
...editAttrs,
|
|
611
724
|
style: {
|
|
612
725
|
display: "inline-flex",
|
|
613
726
|
width: 48,
|
|
@@ -702,7 +815,7 @@ function TextBlock({ slots, ctx, path }) {
|
|
|
702
815
|
}
|
|
703
816
|
function SectionHeaderBlock({ node, ctx, path }) {
|
|
704
817
|
const slots = node.slots ?? {};
|
|
705
|
-
const align = slots.alignment === "center" ? "center" : "left";
|
|
818
|
+
const align = node.align ?? (slots.alignment === "center" ? "center" : "left");
|
|
706
819
|
const children = node.children ?? [];
|
|
707
820
|
const buttonRowIdx = children.findIndex((c) => c.type === "button-row");
|
|
708
821
|
const buttonRow = buttonRowIdx >= 0 ? children[buttonRowIdx] : void 0;
|
|
@@ -746,7 +859,7 @@ function SectionHeaderBlock({ node, ctx, path }) {
|
|
|
746
859
|
display: "flex",
|
|
747
860
|
gap: AI_TREE_TOKENS.spacing6,
|
|
748
861
|
marginTop: AI_TREE_TOKENS.spacing8,
|
|
749
|
-
justifyContent: align === "center" ? "center" : "flex-start"
|
|
862
|
+
justifyContent: align === "center" ? "center" : align === "right" ? "flex-end" : "flex-start"
|
|
750
863
|
},
|
|
751
864
|
children: (buttonRow.children ?? []).map((button, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
752
865
|
ButtonEl,
|
|
@@ -1079,7 +1192,7 @@ function CardBlock({ node, ctx, path }) {
|
|
|
1079
1192
|
editPath: `${path}.media`
|
|
1080
1193
|
}
|
|
1081
1194
|
) : null;
|
|
1082
|
-
const centered = slots.alignment === "center";
|
|
1195
|
+
const centered = (node.align ?? slots.alignment) === "center";
|
|
1083
1196
|
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1084
1197
|
"div",
|
|
1085
1198
|
{
|
|
@@ -1493,7 +1606,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
1493
1606
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1494
1607
|
"div",
|
|
1495
1608
|
{
|
|
1496
|
-
"data-ai-grid":
|
|
1609
|
+
"data-ai-grid": String(itemsPerRow),
|
|
1497
1610
|
style: {
|
|
1498
1611
|
display: "grid",
|
|
1499
1612
|
gridTemplateColumns: `repeat(${itemsPerRow}, 1fr)`,
|
|
@@ -1640,9 +1753,9 @@ function renderNode(node, ctx, path) {
|
|
|
1640
1753
|
const fieldStyle = {
|
|
1641
1754
|
width: "100%",
|
|
1642
1755
|
boxSizing: "border-box",
|
|
1643
|
-
border: `1px solid ${ctx.brand.palette.
|
|
1644
|
-
borderRadius:
|
|
1645
|
-
padding:
|
|
1756
|
+
border: `1px solid color-mix(in srgb, ${ctx.brand.palette.dark} 45%, #ffffff)`,
|
|
1757
|
+
borderRadius: 0,
|
|
1758
|
+
padding: 12,
|
|
1646
1759
|
background: "#fff",
|
|
1647
1760
|
color: ctx.brand.palette.dark,
|
|
1648
1761
|
outline: "none",
|
|
@@ -1650,81 +1763,90 @@ function renderNode(node, ctx, path) {
|
|
|
1650
1763
|
};
|
|
1651
1764
|
const labelStyle = {
|
|
1652
1765
|
...typeStyle(AI_TREE_TOKENS.type.bodyMBold, ctx.brand.fonts.body),
|
|
1653
|
-
color: ctx.brand.palette.dark
|
|
1766
|
+
color: ctx.brand.palette.dark,
|
|
1767
|
+
textAlign: "left",
|
|
1768
|
+
width: "100%"
|
|
1654
1769
|
};
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1770
|
+
const centered = ctx.sectionAlignment === "center";
|
|
1771
|
+
const submitAlign = centered ? "center" : "flex-start";
|
|
1772
|
+
const children = node.children ?? [];
|
|
1773
|
+
return (
|
|
1774
|
+
// 32px between the field group and the submit. In a stacked (centered) section the form is
|
|
1775
|
+
// capped at 780px and centered — the section's 12-col grid would otherwise leave it hugging
|
|
1776
|
+
// the left edge; a split section lets it fill its own column.
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1778
|
+
"form",
|
|
1779
|
+
{
|
|
1780
|
+
...formAttrs,
|
|
1781
|
+
"data-ai-form": "",
|
|
1782
|
+
style: {
|
|
1783
|
+
display: "flex",
|
|
1784
|
+
flexDirection: "column",
|
|
1785
|
+
gap: 32,
|
|
1786
|
+
width: "100%",
|
|
1787
|
+
...centered ? { maxWidth: 780, marginLeft: "auto", marginRight: "auto" } : {}
|
|
1788
|
+
},
|
|
1789
|
+
children: [
|
|
1790
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 24, width: "100%", alignItems: "flex-start" }, children: children.map((child, i) => {
|
|
1791
|
+
if (child.type !== "input") return null;
|
|
1792
|
+
const cs = child.slots ?? {};
|
|
1793
|
+
const kind = str(cs.kind);
|
|
1794
|
+
const label = str(cs.label);
|
|
1795
|
+
const placeholder = str(cs.placeholder);
|
|
1796
|
+
const required = cs.required === true;
|
|
1797
|
+
const name = label.toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") || `field-${i}`;
|
|
1798
|
+
const isTextarea = kind === "textarea";
|
|
1799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8, width: "100%" }, children: [
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...textAttrs(ctx, `${path}.c${i}.label`), style: labelStyle, children: label }),
|
|
1801
|
+
isTextarea ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1802
|
+
"textarea",
|
|
1803
|
+
{
|
|
1804
|
+
name,
|
|
1805
|
+
placeholder,
|
|
1806
|
+
required,
|
|
1807
|
+
style: { ...fieldStyle, height: 180, resize: "vertical" }
|
|
1808
|
+
}
|
|
1809
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1810
|
+
"input",
|
|
1811
|
+
{
|
|
1812
|
+
name,
|
|
1813
|
+
type: kind === "email" ? "email" : "text",
|
|
1814
|
+
placeholder,
|
|
1815
|
+
required,
|
|
1816
|
+
style: { ...fieldStyle, height: 48 }
|
|
1817
|
+
}
|
|
1818
|
+
)
|
|
1819
|
+
] }, i);
|
|
1820
|
+
}) }),
|
|
1821
|
+
children.map((child, i) => {
|
|
1822
|
+
if (child.type === "input") return null;
|
|
1823
|
+
const cs = child.slots ?? {};
|
|
1824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1825
|
+
"button",
|
|
1826
|
+
{
|
|
1827
|
+
type: "submit",
|
|
1828
|
+
style: {
|
|
1829
|
+
alignSelf: submitAlign,
|
|
1830
|
+
border: "none",
|
|
1831
|
+
cursor: "pointer",
|
|
1832
|
+
padding: "12px 24px",
|
|
1833
|
+
// Corner radius follows the host template's own buttons (measured from a template
|
|
1834
|
+
// CTA); 8px only when the page has no template button to match.
|
|
1835
|
+
borderRadius: ctx.buttonRadius ?? 8,
|
|
1836
|
+
// Brand-styled: primary fill, brand-derived label colour (not a fixed token) so it
|
|
1837
|
+
// reads correctly on custom palettes.
|
|
1838
|
+
background: ctx.brand.palette.primary,
|
|
1839
|
+
color: ctx.buttonLabel ?? ctx.brand.palette.light,
|
|
1840
|
+
...typeStyle(AI_TREE_TOKENS.type.button, ctx.brand.fonts.body)
|
|
1841
|
+
},
|
|
1842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...textAttrs(ctx, `${path}.c${i}.label`), children: str(cs.label) })
|
|
1682
1843
|
},
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
placeholder,
|
|
1690
|
-
style: { ...fieldStyle, height: 140, resize: "vertical" }
|
|
1691
|
-
}
|
|
1692
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1693
|
-
"input",
|
|
1694
|
-
{
|
|
1695
|
-
name,
|
|
1696
|
-
type: kind === "email" ? "email" : "text",
|
|
1697
|
-
placeholder,
|
|
1698
|
-
style: { ...fieldStyle, height: 48 }
|
|
1699
|
-
}
|
|
1700
|
-
)
|
|
1701
|
-
]
|
|
1702
|
-
},
|
|
1703
|
-
i
|
|
1704
|
-
);
|
|
1705
|
-
}
|
|
1706
|
-
const cs = child.slots ?? {};
|
|
1707
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1708
|
-
"button",
|
|
1709
|
-
{
|
|
1710
|
-
type: "submit",
|
|
1711
|
-
style: {
|
|
1712
|
-
gridColumn: "1 / -1",
|
|
1713
|
-
justifySelf: "start",
|
|
1714
|
-
border: "none",
|
|
1715
|
-
cursor: "pointer",
|
|
1716
|
-
padding: `${AI_TREE_TOKENS.spacing3}px ${AI_TREE_TOKENS.spacing6}px`,
|
|
1717
|
-
borderRadius: AI_TREE_TOKENS.radiusButton,
|
|
1718
|
-
background: ctx.brand.palette.primary,
|
|
1719
|
-
color: AI_TREE_TOKENS.textPrimaryForeground,
|
|
1720
|
-
...typeStyle(AI_TREE_TOKENS.type.button, ctx.brand.fonts.body)
|
|
1721
|
-
},
|
|
1722
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...textAttrs(ctx, `${path}.c${i}.label`), children: str(cs.label) })
|
|
1723
|
-
},
|
|
1724
|
-
i
|
|
1725
|
-
);
|
|
1726
|
-
})
|
|
1727
|
-
}
|
|
1844
|
+
i
|
|
1845
|
+
);
|
|
1846
|
+
})
|
|
1847
|
+
]
|
|
1848
|
+
}
|
|
1849
|
+
)
|
|
1728
1850
|
);
|
|
1729
1851
|
}
|
|
1730
1852
|
case "schedule-widget":
|
|
@@ -1747,7 +1869,13 @@ function renderNode(node, ctx, path) {
|
|
|
1747
1869
|
return null;
|
|
1748
1870
|
}
|
|
1749
1871
|
}
|
|
1750
|
-
function AiTreeRenderer({
|
|
1872
|
+
function AiTreeRenderer({
|
|
1873
|
+
tree,
|
|
1874
|
+
brand,
|
|
1875
|
+
buttonRadius,
|
|
1876
|
+
resolveMedia,
|
|
1877
|
+
editKeyPrefix
|
|
1878
|
+
}) {
|
|
1751
1879
|
if (!isRenderableTree(tree)) {
|
|
1752
1880
|
return null;
|
|
1753
1881
|
}
|
|
@@ -1759,6 +1887,8 @@ function AiTreeRenderer({ tree, brand, resolveMedia, editKeyPrefix }) {
|
|
|
1759
1887
|
resolveMedia: resolveMedia ?? (() => null),
|
|
1760
1888
|
cardSurface: blockBrand.palette.light.toUpperCase() === AI_DEFAULT_BRAND.palette.light.toUpperCase() ? "#ECECEB" : `color-mix(in srgb, ${blockBrand.palette.light} 90%, ${blockBrand.palette.dark})`,
|
|
1761
1889
|
keyFor: editKeyPrefix ? (path) => `${editKeyPrefix}.${path}` : null,
|
|
1890
|
+
sectionAlignment: (tree.settings ?? {}).alignment === "center" ? "center" : "left",
|
|
1891
|
+
buttonRadius,
|
|
1762
1892
|
...band ? { buttonLabel: band.buttonLabel } : {}
|
|
1763
1893
|
};
|
|
1764
1894
|
const settings = tree.settings ?? {};
|
|
@@ -1781,11 +1911,25 @@ function AiTreeRenderer({ tree, brand, resolveMedia, editKeyPrefix }) {
|
|
|
1781
1911
|
}
|
|
1782
1912
|
})();
|
|
1783
1913
|
const distributed = !isOverlay && settings.textDistribution;
|
|
1914
|
+
const rowAlignItems = (rowAlign) => {
|
|
1915
|
+
if (rowAlign === "top") return "start";
|
|
1916
|
+
if (rowAlign === "bottom") return "end";
|
|
1917
|
+
if (rowAlign === "center" || rowAlign === "stretch") return rowAlign;
|
|
1918
|
+
if (distributed === "space-between") return "stretch";
|
|
1919
|
+
return (distributed ?? settings.verticalPosition) === "top" ? "start" : "center";
|
|
1920
|
+
};
|
|
1921
|
+
const cellAlignStyle = (blockAlign) => blockAlign ? {
|
|
1922
|
+
display: "flex",
|
|
1923
|
+
flexDirection: "column",
|
|
1924
|
+
alignItems: blockAlign === "left" ? "flex-start" : blockAlign === "right" ? "flex-end" : "center",
|
|
1925
|
+
textAlign: blockAlign
|
|
1926
|
+
} : {};
|
|
1784
1927
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1785
1928
|
"section",
|
|
1786
1929
|
{
|
|
1787
1930
|
"data-ai-section": tree.tag ?? "",
|
|
1788
1931
|
...bgAttrs,
|
|
1932
|
+
"data-ai-responsive": "",
|
|
1789
1933
|
style: {
|
|
1790
1934
|
position: "relative",
|
|
1791
1935
|
padding: `${pad}px 0`,
|
|
@@ -1796,12 +1940,13 @@ function AiTreeRenderer({ tree, brand, resolveMedia, editKeyPrefix }) {
|
|
|
1796
1940
|
color: settings.sectionBackground === "accent" ? blockBrand.palette.dark : void 0
|
|
1797
1941
|
},
|
|
1798
1942
|
children: [
|
|
1799
|
-
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
|
|
1800
1944
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
1945
|
+
isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
1801
1946
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1802
1947
|
"div",
|
|
1803
1948
|
{
|
|
1804
|
-
"data-ai-
|
|
1949
|
+
"data-ai-section-inner": "",
|
|
1805
1950
|
style: {
|
|
1806
1951
|
position: "relative",
|
|
1807
1952
|
maxWidth: AI_TREE_TOKENS.sectionMaxWidth,
|
|
@@ -1812,12 +1957,12 @@ function AiTreeRenderer({ tree, brand, resolveMedia, editKeyPrefix }) {
|
|
|
1812
1957
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1813
1958
|
"div",
|
|
1814
1959
|
{
|
|
1815
|
-
"data-ai-
|
|
1960
|
+
"data-ai-columns": "",
|
|
1816
1961
|
style: {
|
|
1817
1962
|
display: "grid",
|
|
1818
1963
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
1819
1964
|
gap: AI_TREE_TOKENS.spacing6,
|
|
1820
|
-
alignItems:
|
|
1965
|
+
alignItems: rowAlignItems(row.align),
|
|
1821
1966
|
marginTop: r2 > 0 ? AI_TREE_TOKENS.spacing8 : 0
|
|
1822
1967
|
},
|
|
1823
1968
|
children: (row.blocks ?? []).map((block, b) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1827,6 +1972,8 @@ function AiTreeRenderer({ tree, brand, resolveMedia, editKeyPrefix }) {
|
|
|
1827
1972
|
style: {
|
|
1828
1973
|
gridColumn: `span ${Math.min(12, Math.max(1, block.span))}`,
|
|
1829
1974
|
minWidth: 0,
|
|
1975
|
+
// Horizontal placement of the block's content within its column.
|
|
1976
|
+
...cellAlignStyle(block.align),
|
|
1830
1977
|
// space-between: each column becomes a flex column whose content spreads over
|
|
1831
1978
|
// the full row height instead of clumping at the top.
|
|
1832
1979
|
...distributed === "space-between" ? { display: "flex", flexDirection: "column", justifyContent: "space-between" } : {}
|
|
@@ -1888,6 +2035,13 @@ function deriveTemplateBrand() {
|
|
|
1888
2035
|
}
|
|
1889
2036
|
};
|
|
1890
2037
|
}
|
|
2038
|
+
function deriveTemplateButtonRadius() {
|
|
2039
|
+
if (typeof document === "undefined") return null;
|
|
2040
|
+
const btn = document.querySelector('[data-ohw-role="button"]');
|
|
2041
|
+
if (!btn) return null;
|
|
2042
|
+
const radius = getComputedStyle(btn).borderTopLeftRadius;
|
|
2043
|
+
return radius || null;
|
|
2044
|
+
}
|
|
1891
2045
|
var mounted = /* @__PURE__ */ new Map();
|
|
1892
2046
|
function findTemplateSection(id) {
|
|
1893
2047
|
for (const el of document.querySelectorAll(`[data-ohw-section="${CSS.escape(id)}"]`)) {
|
|
@@ -2039,6 +2193,7 @@ function applyAiSectionsToDom(state, options) {
|
|
|
2039
2193
|
if (typeof document === "undefined") return;
|
|
2040
2194
|
const brandOverride = deriveBrandOverride();
|
|
2041
2195
|
const templateBrand = deriveTemplateBrand();
|
|
2196
|
+
const templateButtonRadius = deriveTemplateButtonRadius();
|
|
2042
2197
|
const brandKey = brandOverride ? JSON.stringify(brandOverride) : "";
|
|
2043
2198
|
const pagePath = window.location.pathname;
|
|
2044
2199
|
const pageSections = state.sections.filter((entry) => (entry.path ?? "/") === pagePath);
|
|
@@ -2078,6 +2233,7 @@ function applyAiSectionsToDom(state, options) {
|
|
|
2078
2233
|
{
|
|
2079
2234
|
tree: entry.tree,
|
|
2080
2235
|
brand: brandOverride ?? entry.brand ?? options?.brand ?? templateBrand ?? void 0,
|
|
2236
|
+
buttonRadius: templateButtonRadius,
|
|
2081
2237
|
resolveMedia,
|
|
2082
2238
|
editKeyPrefix: `ai.${entry.id}`
|
|
2083
2239
|
}
|
|
@@ -2226,6 +2382,7 @@ function EmailCaptureModal({ title, subtitle, onSubmit, onClose }) {
|
|
|
2226
2382
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2227
2383
|
import_radix_ui.Dialog.Overlay,
|
|
2228
2384
|
{
|
|
2385
|
+
"data-ohw-scheduling-modal": "",
|
|
2229
2386
|
className: "fixed inset-0 z-50",
|
|
2230
2387
|
style: { background: "rgba(0,0,0,0.45)" }
|
|
2231
2388
|
}
|
|
@@ -2233,6 +2390,7 @@ function EmailCaptureModal({ title, subtitle, onSubmit, onClose }) {
|
|
|
2233
2390
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
2234
2391
|
import_radix_ui.Dialog.Content,
|
|
2235
2392
|
{
|
|
2393
|
+
"data-ohw-scheduling-modal": "",
|
|
2236
2394
|
className: "fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 bg-white rounded-xl shadow-xl outline-none font-body box-border overflow-hidden",
|
|
2237
2395
|
style: { maxWidth: 400 },
|
|
2238
2396
|
children: [
|
|
@@ -2706,7 +2864,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
2706
2864
|
const autoId = (0, import_react5.useId)();
|
|
2707
2865
|
const insertAfter = insertAfterProp ?? autoId;
|
|
2708
2866
|
const [schedule, setSchedule] = (0, import_react5.useState)(null);
|
|
2709
|
-
const [loading, setLoading] = (0, import_react5.useState)(
|
|
2867
|
+
const [loading, setLoading] = (0, import_react5.useState)(initialScheduleId !== null);
|
|
2710
2868
|
const [inEditor, setInEditor] = (0, import_react5.useState)(false);
|
|
2711
2869
|
const [isHovered, setIsHovered] = (0, import_react5.useState)(false);
|
|
2712
2870
|
const [modalState, setModalState] = (0, import_react5.useState)(null);
|
|
@@ -2880,8 +3038,10 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
|
|
|
2880
3038
|
"*"
|
|
2881
3039
|
);
|
|
2882
3040
|
};
|
|
2883
|
-
if (!inEditor && !loading && !schedule) return null;
|
|
2884
3041
|
const sectionId = `scheduling-${insertAfter}`;
|
|
3042
|
+
if (!inEditor && !loading && !schedule) {
|
|
3043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { "data-ohw-section": sectionId, "data-ohw-scheduling-anchor": insertAfter, style: { display: "none" } });
|
|
3044
|
+
}
|
|
2885
3045
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
2886
3046
|
"section",
|
|
2887
3047
|
{
|
|
@@ -7822,6 +7982,7 @@ function MediaOverlay({
|
|
|
7822
7982
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
7823
7983
|
);
|
|
7824
7984
|
}, [isVideo]);
|
|
7985
|
+
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
7825
7986
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
7826
7987
|
const box = {
|
|
7827
7988
|
position: "fixed",
|
|
@@ -7951,17 +8112,17 @@ function MediaOverlay({
|
|
|
7951
8112
|
},
|
|
7952
8113
|
children: [
|
|
7953
8114
|
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 }),
|
|
7954
|
-
|
|
8115
|
+
replaceLabel
|
|
7955
8116
|
]
|
|
7956
8117
|
}
|
|
7957
8118
|
),
|
|
7958
|
-
replaceMode
|
|
8119
|
+
showChrome && replaceMode !== "none" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
7959
8120
|
Button,
|
|
7960
8121
|
{
|
|
7961
8122
|
"data-ohw-media-overlay": "",
|
|
7962
8123
|
variant: "outline",
|
|
7963
8124
|
size: "sm",
|
|
7964
|
-
"aria-label":
|
|
8125
|
+
"aria-label": replaceLabel,
|
|
7965
8126
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
7966
8127
|
style: {
|
|
7967
8128
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -7984,7 +8145,7 @@ function MediaOverlay({
|
|
|
7984
8145
|
},
|
|
7985
8146
|
children: [
|
|
7986
8147
|
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 }),
|
|
7987
|
-
replaceMode === "full" ?
|
|
8148
|
+
replaceMode === "full" ? replaceLabel : null
|
|
7988
8149
|
]
|
|
7989
8150
|
}
|
|
7990
8151
|
)
|
|
@@ -12928,6 +13089,7 @@ function readLogoSizeState(content, placement) {
|
|
|
12928
13089
|
function getLogoElement(el) {
|
|
12929
13090
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
12930
13091
|
if (marked) return marked;
|
|
13092
|
+
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
12931
13093
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
12932
13094
|
if (!root) return null;
|
|
12933
13095
|
const anchor = el.closest("a");
|
|
@@ -14856,21 +15018,10 @@ function parseSchedulingInsertAfter(insertAfter) {
|
|
|
14856
15018
|
insertBefore: insertAfter.slice(idx + INSERT_BEFORE_MARKER.length)
|
|
14857
15019
|
};
|
|
14858
15020
|
}
|
|
14859
|
-
function
|
|
14860
|
-
|
|
14861
|
-
const
|
|
14862
|
-
|
|
14863
|
-
return { effectiveInsertAfter, insertBefore };
|
|
14864
|
-
}
|
|
14865
|
-
function getSchedulingMountPoint(insertAfter) {
|
|
14866
|
-
const { anchor } = parseSchedulingInsertAfter(insertAfter);
|
|
14867
|
-
let anchorEl = document.querySelector(`[data-ohw-section="${anchor}"]`);
|
|
14868
|
-
if (!anchorEl && anchor === "scheduling") {
|
|
14869
|
-
const widgets = Array.from(document.querySelectorAll('[data-ohw-section^="scheduling-"]'));
|
|
14870
|
-
anchorEl = widgets.at(-1) ?? null;
|
|
14871
|
-
}
|
|
14872
|
-
if (!anchorEl) return null;
|
|
14873
|
-
return anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
|
|
15021
|
+
function resolveEntryAnchor(entry) {
|
|
15022
|
+
if (entry.anchorId !== void 0) return { anchorId: entry.anchorId, beforeId: entry.beforeId ?? null };
|
|
15023
|
+
const parsed = parseSchedulingInsertAfter(entry.insertAfter);
|
|
15024
|
+
return { anchorId: parsed.anchor, beforeId: parsed.insertBefore };
|
|
14874
15025
|
}
|
|
14875
15026
|
function schedulingMountDepth(insertAfter) {
|
|
14876
15027
|
if (!insertAfter.includes(INSERT_BEFORE_MARKER)) return 0;
|
|
@@ -14887,8 +15038,7 @@ function getPageSchedulingEntries(raw) {
|
|
|
14887
15038
|
}
|
|
14888
15039
|
}
|
|
14889
15040
|
function isSchedulingWidgetMissing(entry) {
|
|
14890
|
-
|
|
14891
|
-
return !document.querySelector(`[data-ohw-section="${schedulingSectionId(effectiveInsertAfter)}"]`);
|
|
15041
|
+
return !document.querySelector(`[data-ohw-section="${schedulingSectionId(entry.insertAfter)}"]`);
|
|
14892
15042
|
}
|
|
14893
15043
|
function hasMissingSchedulingWidgets(entries) {
|
|
14894
15044
|
return entries.some(isSchedulingWidgetMissing);
|
|
@@ -14918,16 +15068,17 @@ function initSectionsFromContent(content, removeExisting = false) {
|
|
|
14918
15068
|
} catch {
|
|
14919
15069
|
}
|
|
14920
15070
|
}
|
|
14921
|
-
function mountSchedulingWidget(
|
|
14922
|
-
const
|
|
14923
|
-
const sectionId = schedulingSectionId(
|
|
15071
|
+
function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, beforeId, existingWidgetId) {
|
|
15072
|
+
const widgetId = existingWidgetId ?? (beforeId ? `${anchorId}${INSERT_BEFORE_MARKER}${beforeId}` : anchorId);
|
|
15073
|
+
const sectionId = schedulingSectionId(widgetId);
|
|
14924
15074
|
if (document.querySelector(`[data-ohw-section="${sectionId}"]`)) return false;
|
|
14925
|
-
const
|
|
14926
|
-
if (!
|
|
15075
|
+
const anchorEl = document.querySelector(`[data-ohw-section="${anchorId}"]`);
|
|
15076
|
+
if (!anchorEl) return false;
|
|
15077
|
+
const mountPoint = anchorEl.closest('[data-ohw-section-container="scheduling"]') ?? anchorEl;
|
|
14927
15078
|
const container = document.createElement("div");
|
|
14928
15079
|
container.dataset.ohwSectionContainer = "scheduling";
|
|
14929
|
-
if (
|
|
14930
|
-
const beforeAnchor = document.querySelector(`[data-ohw-section="${
|
|
15080
|
+
if (beforeId) {
|
|
15081
|
+
const beforeAnchor = document.querySelector(`[data-ohw-section="${beforeId}"]`);
|
|
14931
15082
|
const beforePoint = beforeAnchor?.closest('[data-ohw-section-container="scheduling"]') ?? beforeAnchor;
|
|
14932
15083
|
if (!beforePoint) return false;
|
|
14933
15084
|
beforePoint.insertAdjacentElement("beforebegin", container);
|
|
@@ -14938,19 +15089,25 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
|
|
|
14938
15089
|
}
|
|
14939
15090
|
tail.insertAdjacentElement("afterend", container);
|
|
14940
15091
|
}
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
15092
|
+
try {
|
|
15093
|
+
const root = (0, import_client2.createRoot)(container);
|
|
15094
|
+
(0, import_react_dom3.flushSync)(() => {
|
|
15095
|
+
root.render(
|
|
15096
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
15097
|
+
SchedulingWidget,
|
|
15098
|
+
{
|
|
15099
|
+
notifyOnConnect,
|
|
15100
|
+
initialScheduleId: scheduleId,
|
|
15101
|
+
insertAfter: widgetId
|
|
15102
|
+
}
|
|
15103
|
+
)
|
|
15104
|
+
);
|
|
15105
|
+
});
|
|
15106
|
+
} catch (err) {
|
|
15107
|
+
console.error("[ow:scheduling] render threw", err);
|
|
15108
|
+
container.remove();
|
|
15109
|
+
return false;
|
|
15110
|
+
}
|
|
14954
15111
|
const tracker = getSectionsTracker();
|
|
14955
15112
|
let sections = [];
|
|
14956
15113
|
try {
|
|
@@ -14958,10 +15115,12 @@ function mountSchedulingWidget(insertAfter, notifyOnConnect = false, scheduleId,
|
|
|
14958
15115
|
} catch {
|
|
14959
15116
|
}
|
|
14960
15117
|
const inEditor = typeof window !== "undefined" && window.self !== window.top;
|
|
14961
|
-
if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter ===
|
|
15118
|
+
if (inEditor && !sections.find((s) => s.type === "scheduling" && s.insertAfter === widgetId)) {
|
|
14962
15119
|
sections.push({
|
|
14963
15120
|
type: "scheduling",
|
|
14964
|
-
insertAfter:
|
|
15121
|
+
insertAfter: widgetId,
|
|
15122
|
+
anchorId,
|
|
15123
|
+
beforeId: beforeId ?? null,
|
|
14965
15124
|
pagePath: window.location.pathname,
|
|
14966
15125
|
...scheduleId ? { scheduleId } : {}
|
|
14967
15126
|
});
|
|
@@ -14975,7 +15134,8 @@ function mountSchedulingEntries(entries, notifyOnConnect = false) {
|
|
|
14975
15134
|
for (let i = pending.length - 1; i >= 0; i--) {
|
|
14976
15135
|
const entry = pending[i];
|
|
14977
15136
|
const shouldNotify = typeof notifyOnConnect === "function" ? notifyOnConnect(entry) : notifyOnConnect;
|
|
14978
|
-
|
|
15137
|
+
const { anchorId, beforeId } = resolveEntryAnchor(entry);
|
|
15138
|
+
if (mountSchedulingWidget(anchorId, shouldNotify, entry.scheduleId ?? null, beforeId, entry.insertAfter)) {
|
|
14979
15139
|
pending.splice(i, 1);
|
|
14980
15140
|
}
|
|
14981
15141
|
}
|
|
@@ -15133,6 +15293,11 @@ function applyLinkByKey(key, val) {
|
|
|
15133
15293
|
hrefAnchors.forEach((el) => applyLinkHref(el, val));
|
|
15134
15294
|
}
|
|
15135
15295
|
}
|
|
15296
|
+
function isInsideLinkEditor(target) {
|
|
15297
|
+
return Boolean(
|
|
15298
|
+
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"]')
|
|
15299
|
+
);
|
|
15300
|
+
}
|
|
15136
15301
|
function isInsideFloatingPanel(target) {
|
|
15137
15302
|
return Boolean(target.closest("[data-ohw-floating-panel]"));
|
|
15138
15303
|
}
|
|
@@ -15140,11 +15305,6 @@ function isPointOverFloatingPanel(clientX, clientY) {
|
|
|
15140
15305
|
const el = document.elementFromPoint(clientX, clientY);
|
|
15141
15306
|
return Boolean(el instanceof Element && el.closest("[data-ohw-floating-panel]"));
|
|
15142
15307
|
}
|
|
15143
|
-
function isInsideLinkEditor(target) {
|
|
15144
|
-
return Boolean(
|
|
15145
|
-
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"]')
|
|
15146
|
-
);
|
|
15147
|
-
}
|
|
15148
15308
|
function getHrefKeyFromElement(el) {
|
|
15149
15309
|
if (!el) return null;
|
|
15150
15310
|
const anchor = el.closest("[data-ohw-href-key]");
|
|
@@ -15403,7 +15563,7 @@ function getNavigationSelectionParent(el) {
|
|
|
15403
15563
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
15404
15564
|
return getFooterLinksContainer();
|
|
15405
15565
|
}
|
|
15406
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
15566
|
+
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)) {
|
|
15407
15567
|
return getNavigationRoot(el);
|
|
15408
15568
|
}
|
|
15409
15569
|
return null;
|
|
@@ -15618,7 +15778,6 @@ var ICONS = {
|
|
|
15618
15778
|
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"/>',
|
|
15619
15779
|
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"/>'
|
|
15620
15780
|
};
|
|
15621
|
-
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
15622
15781
|
var SELECTION_CHROME_GAP2 = 4;
|
|
15623
15782
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
15624
15783
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -15998,6 +16157,8 @@ function StateToggle({
|
|
|
15998
16157
|
);
|
|
15999
16158
|
}
|
|
16000
16159
|
var contentCache = /* @__PURE__ */ new Map();
|
|
16160
|
+
var fetchedContentPaths = /* @__PURE__ */ new Set();
|
|
16161
|
+
var brandingCache = /* @__PURE__ */ new Map();
|
|
16001
16162
|
var OHW_LOADER_STYLE = {
|
|
16002
16163
|
position: "fixed",
|
|
16003
16164
|
inset: 0,
|
|
@@ -16035,6 +16196,89 @@ function OhwLoaderSpinner() {
|
|
|
16035
16196
|
)
|
|
16036
16197
|
] });
|
|
16037
16198
|
}
|
|
16199
|
+
function OhwBrandMark() {
|
|
16200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
16201
|
+
"svg",
|
|
16202
|
+
{
|
|
16203
|
+
width: "16",
|
|
16204
|
+
height: "16",
|
|
16205
|
+
viewBox: "0 0 48 48",
|
|
16206
|
+
fill: "none",
|
|
16207
|
+
"aria-hidden": true,
|
|
16208
|
+
style: { display: "block", flexShrink: 0 },
|
|
16209
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16210
|
+
children: [
|
|
16211
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16212
|
+
"mask",
|
|
16213
|
+
{
|
|
16214
|
+
id: "ohw-badge-mark",
|
|
16215
|
+
style: { maskType: "luminance" },
|
|
16216
|
+
maskUnits: "userSpaceOnUse",
|
|
16217
|
+
x: "0",
|
|
16218
|
+
y: "0",
|
|
16219
|
+
width: "48",
|
|
16220
|
+
height: "48",
|
|
16221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M23.8741 48C37.0594 48 47.7481 37.2548 47.7481 24C47.7481 10.7452 37.0594 0 23.8741 0C10.6888 0 0 10.7452 0 24C0 37.2548 10.6888 48 23.8741 48Z", fill: "white" })
|
|
16222
|
+
}
|
|
16223
|
+
),
|
|
16224
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("g", { mask: "url(#ohw-badge-mark)", children: [
|
|
16225
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M23.8731 48.0497C37.0584 48.0497 47.7472 37.3046 47.7472 24.0497C47.7472 10.7949 37.0584 0.0497208 23.8731 0.0497208C10.6878 0.0497208 -0.000976562 10.7949 -0.000976562 24.0497C-0.000976562 37.3046 10.6878 48.0497 23.8731 48.0497Z", fill: "#0078E5" }),
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M17.1307 14.7172C13.1687 14.7172 9.38102 18.1154 8.65114 22.34C8.38885 23.8488 8.5598 25.2581 9.06929 26.4451C6.20005 29.1677 1.77216 27.8721 -1.40212 26.1536C-2.73618 25.4317 -3.92695 27.4745 -2.59037 28.1981C1.33389 30.3226 6.86037 31.6621 10.4402 28.4188C11.4718 29.3859 12.867 29.9621 14.4894 29.9621C18.4161 29.9621 22.2038 26.5318 22.9337 22.34C23.6636 18.1162 21.0566 14.7172 17.1298 14.7172H17.1307ZM19.9798 22.34C19.5281 25.0399 17.2689 27.231 14.9754 27.231C12.6466 27.231 11.1877 25.0399 11.6394 22.34C12.1262 19.6401 14.3151 17.4482 16.6438 17.4482C18.9374 17.4482 20.4667 19.6401 19.9798 22.34Z", fill: "white" }),
|
|
16227
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M40.0017 27.0262C39.1797 27.081 38.2721 26.995 37.4668 26.7415C37.3344 26.6993 37.28 26.5401 37.3529 26.4205C37.5959 26.0212 37.8255 25.6152 38.009 25.1889C38.1071 24.9918 38.2018 24.793 38.2897 24.5908C38.3274 24.5041 38.4163 24.451 38.5101 24.4619C38.63 24.4754 38.7054 24.4821 38.8881 24.4821L39.1529 24.4796L39.8283 24.4543C45.9229 24.0492 50.4765 20.4319 54.8466 16.9014C56.0172 15.9554 57.6932 17.6208 56.5116 18.5752C51.7687 22.4065 47.1966 26.5081 40.9319 26.9689", fill: "white" }),
|
|
16228
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M37.9687 24.27C38.4472 23.1319 38.7656 21.9045 38.9609 20.6991C39.5927 16.76 38.5058 14.2193 36.1553 14.2193C34.1835 14.2193 33.1469 17.2427 32.9199 18.8694C32.743 19.9872 32.5914 22.1219 33.6028 23.9524C33.7553 24.259 34.15 24.7712 34.471 25.1259C34.5447 25.2067 34.6746 25.2 34.7349 25.1082C34.9528 24.7788 35.1615 24.4039 35.3584 24.0257C35.5444 23.6677 35.5888 23.6138 35.8587 23.0207C35.8838 22.966 35.8813 22.9002 35.8478 22.8505C35.5888 22.4597 35.2168 21.9787 35.1204 21.4614C34.9184 20.4455 34.9436 19.2257 35.2218 18.1078C35.4413 17.3118 35.7195 16.7844 35.9039 16.5106C35.9466 16.4466 36.0279 16.4129 36.0975 16.4449C36.369 16.5671 36.5827 16.8838 36.7385 17.396C37.0167 18.2089 37.0167 19.3782 36.814 20.6999C36.6991 21.5271 36.4771 22.3729 36.1746 23.1673C36.1293 23.308 36.0757 23.4461 36.0187 23.5826C36.0187 23.5868 36.0187 23.591 36.0187 23.5961C35.9911 23.6946 35.9207 23.8067 35.8846 23.901C35.5536 24.5497 35.2344 25.1697 34.8439 25.7838C34.8388 25.7863 34.8346 25.7914 34.8296 25.7931C34.6528 26.0525 34.4718 26.2901 34.2866 26.4965C34.2774 26.5099 34.2682 26.5234 34.2589 26.5369C34.2405 26.5638 34.2179 26.5815 34.1944 26.595C33.5064 27.3212 32.7665 27.6893 32.0123 27.6893C31.8606 27.6893 31.6838 27.664 31.507 27.4349C31.3042 27.1299 30.85 26.0879 31.2539 22.9112C31.4785 21.3949 31.8011 20.0268 31.931 19.5408C31.9579 19.4413 31.8908 19.3419 31.7886 19.3293L30.0062 19.1162C29.9241 19.1061 29.8478 19.1566 29.8252 19.2366C29.2704 21.1615 27.0305 27.6885 24.9599 27.6885C24.328 27.6885 24.1512 26.6211 24.1001 26.2909C23.775 23.6264 25.528 18.5492 29.5302 16.2267C29.6048 16.1838 29.635 16.0928 29.5998 16.0136L28.9042 14.467C28.8632 14.3752 28.7501 14.3389 28.6638 14.3886C25.8079 16.0414 24.1847 18.5231 23.2915 20.3436C22.2046 22.5793 21.6993 25.0189 21.9515 26.8738C22.1795 28.7794 23.1398 29.872 24.6054 29.872C26.0543 29.872 27.4369 28.9066 28.7098 27.0187C28.7953 26.8915 28.9889 26.9311 29.0149 27.0819C29.2646 28.5283 29.9811 29.872 31.6579 29.872C33.5282 29.872 35.3232 28.7288 36.7134 26.6447C36.7712 26.5874 36.7972 26.5411 36.8181 26.4906C36.8232 26.4931 36.8282 26.4948 36.8332 26.4973C37.01 26.2025 37.181 25.9051 37.3444 25.6027C37.4508 25.4005 37.5572 25.1992 37.6586 24.9945C37.7181 24.874 37.7743 24.7527 37.8262 24.6289C37.838 24.6002 37.8547 24.5665 37.8706 24.5337", fill: "white" }),
|
|
16229
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("path", { d: "M30.5839 31.6397C25.7546 34.8577 19.4773 34.7853 14.6907 31.5243C13.5368 30.7384 12.5044 32.6498 13.6474 33.4281C19.034 37.0985 26.3077 37.096 31.7218 33.488C32.8791 32.7172 31.7478 30.8639 30.5839 31.6397Z", fill: "white" })
|
|
16230
|
+
] })
|
|
16231
|
+
]
|
|
16232
|
+
}
|
|
16233
|
+
);
|
|
16234
|
+
}
|
|
16235
|
+
var OHW_BADGE_STYLE = {
|
|
16236
|
+
position: "fixed",
|
|
16237
|
+
left: 20,
|
|
16238
|
+
bottom: 20,
|
|
16239
|
+
zIndex: 2147483e3,
|
|
16240
|
+
boxSizing: "border-box",
|
|
16241
|
+
display: "inline-flex",
|
|
16242
|
+
alignItems: "center",
|
|
16243
|
+
gap: 0,
|
|
16244
|
+
padding: "6px 8px",
|
|
16245
|
+
margin: 0,
|
|
16246
|
+
background: "#ffffff",
|
|
16247
|
+
border: "1px solid #e7e5e4",
|
|
16248
|
+
borderRadius: 9999,
|
|
16249
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
16250
|
+
color: "#0c0a09",
|
|
16251
|
+
textDecoration: "none",
|
|
16252
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"
|
|
16253
|
+
};
|
|
16254
|
+
var OHW_BADGE_LABEL_STYLE = {
|
|
16255
|
+
padding: "0 4px",
|
|
16256
|
+
fontSize: 14,
|
|
16257
|
+
lineHeight: "24px",
|
|
16258
|
+
fontWeight: 500,
|
|
16259
|
+
fontStyle: "normal",
|
|
16260
|
+
letterSpacing: "normal",
|
|
16261
|
+
textTransform: "none",
|
|
16262
|
+
color: "#0c0a09",
|
|
16263
|
+
whiteSpace: "nowrap"
|
|
16264
|
+
};
|
|
16265
|
+
function MadeWithOhhWells() {
|
|
16266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
16267
|
+
"a",
|
|
16268
|
+
{
|
|
16269
|
+
href: "https://ohhwells.com",
|
|
16270
|
+
target: "_blank",
|
|
16271
|
+
rel: "noopener noreferrer",
|
|
16272
|
+
"aria-label": "Made with OhhWells",
|
|
16273
|
+
"data-ohw-badge": "",
|
|
16274
|
+
style: OHW_BADGE_STYLE,
|
|
16275
|
+
children: [
|
|
16276
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OhwBrandMark, {}),
|
|
16277
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: OHW_BADGE_LABEL_STYLE, children: "Made with OhhWells" })
|
|
16278
|
+
]
|
|
16279
|
+
}
|
|
16280
|
+
);
|
|
16281
|
+
}
|
|
16038
16282
|
var OHW_LOADER_PREHYDRATE_SCRIPT = `(function(){try{var p=location.hostname.split(".");var fromHost=p.length>=3&&p[0]!=="www"?p[0]:"";var fromQuery=new URLSearchParams(location.search).get("subdomain")||"";if(!fromHost&&!fromQuery)return;var e=document.getElementById("ohw-loader");if(e)e.style.display="flex"}catch(e){}})();`;
|
|
16039
16283
|
function resolveSubdomain(subdomainFromQuery) {
|
|
16040
16284
|
if (subdomainFromQuery) return subdomainFromQuery;
|
|
@@ -16094,6 +16338,7 @@ function OhhwellsBridge() {
|
|
|
16094
16338
|
}
|
|
16095
16339
|
}, []);
|
|
16096
16340
|
const [fetchState, setFetchState] = (0, import_react17.useState)("idle");
|
|
16341
|
+
const [showBranding, setShowBranding] = (0, import_react17.useState)(false);
|
|
16097
16342
|
const autoSaveTimers = (0, import_react17.useRef)(/* @__PURE__ */ new Map());
|
|
16098
16343
|
const activeElRef = (0, import_react17.useRef)(null);
|
|
16099
16344
|
const pointerHeldRef = (0, import_react17.useRef)(false);
|
|
@@ -16442,13 +16687,6 @@ function OhhwellsBridge() {
|
|
|
16442
16687
|
const [isItemDragging, setIsItemDragging] = (0, import_react17.useState)(false);
|
|
16443
16688
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react17.useState)(false);
|
|
16444
16689
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
16445
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react17.useState)(null);
|
|
16446
|
-
const floatingPanelOpenRef = (0, import_react17.useRef)(false);
|
|
16447
|
-
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
16448
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react17.useState)(null);
|
|
16449
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react17.useState)(null);
|
|
16450
|
-
const [editorViewport, setEditorViewport] = (0, import_react17.useState)("desktop");
|
|
16451
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react17.useState)(null);
|
|
16452
16690
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react17.useState)(null);
|
|
16453
16691
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react17.useState)(null);
|
|
16454
16692
|
const footerDragRef = (0, import_react17.useRef)(null);
|
|
@@ -16466,6 +16704,13 @@ function OhhwellsBridge() {
|
|
|
16466
16704
|
const brandKitRef = (0, import_react17.useRef)("");
|
|
16467
16705
|
const stylesRef = (0, import_react17.useRef)("");
|
|
16468
16706
|
const pendingDeleteUndoRef = (0, import_react17.useRef)(null);
|
|
16707
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react17.useState)(null);
|
|
16708
|
+
const floatingPanelOpenRef = (0, import_react17.useRef)(false);
|
|
16709
|
+
const setFloatingPanelRef = (0, import_react17.useRef)(setFloatingPanel);
|
|
16710
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react17.useState)(null);
|
|
16711
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react17.useState)(null);
|
|
16712
|
+
const [editorViewport, setEditorViewport] = (0, import_react17.useState)("desktop");
|
|
16713
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react17.useState)(null);
|
|
16469
16714
|
const [sitePages, setSitePages] = (0, import_react17.useState)([]);
|
|
16470
16715
|
const [sectionsByPath, setSectionsByPath] = (0, import_react17.useState)({});
|
|
16471
16716
|
const sectionsPrefetchGenRef = (0, import_react17.useRef)(0);
|
|
@@ -16474,7 +16719,18 @@ function OhhwellsBridge() {
|
|
|
16474
16719
|
const linkPopoverOpenRef = (0, import_react17.useRef)(false);
|
|
16475
16720
|
const linkPopoverGraceUntilRef = (0, import_react17.useRef)(0);
|
|
16476
16721
|
setLinkPopoverRef.current = setLinkPopover;
|
|
16722
|
+
setFloatingPanelRef.current = setFloatingPanel;
|
|
16477
16723
|
linkPopoverSessionRef.current = linkPopover;
|
|
16724
|
+
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
16725
|
+
(0, import_react17.useEffect)(() => {
|
|
16726
|
+
const syncViewport = () => {
|
|
16727
|
+
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
16728
|
+
setEditorViewport((prev) => prev === next ? prev : next);
|
|
16729
|
+
};
|
|
16730
|
+
syncViewport();
|
|
16731
|
+
window.addEventListener("resize", syncViewport);
|
|
16732
|
+
return () => window.removeEventListener("resize", syncViewport);
|
|
16733
|
+
}, []);
|
|
16478
16734
|
const {
|
|
16479
16735
|
navDragRef,
|
|
16480
16736
|
navDropSlots,
|
|
@@ -17805,11 +18061,11 @@ function OhhwellsBridge() {
|
|
|
17805
18061
|
for (const [key, val] of Object.entries(content)) {
|
|
17806
18062
|
if (key === "__ohw_sections") continue;
|
|
17807
18063
|
if (key === AI_SECTIONS_KEY) continue;
|
|
18064
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
18065
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
17808
18066
|
if (key === BRAND_KIT_KEY) continue;
|
|
17809
18067
|
if (key === STYLE_STORE_KEY) continue;
|
|
17810
18068
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
17811
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
17812
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
17813
18069
|
if (applyVideoSettingNode(key, val)) continue;
|
|
17814
18070
|
if (applyCarouselNode(key, val)) continue;
|
|
17815
18071
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -17869,16 +18125,22 @@ function OhhwellsBridge() {
|
|
|
17869
18125
|
};
|
|
17870
18126
|
const cached = contentCache.get(subdomain);
|
|
17871
18127
|
if (cached) {
|
|
18128
|
+
setShowBranding(brandingCache.get(subdomain) ?? false);
|
|
17872
18129
|
applyContent(cached).finally(() => setFetchState("done"));
|
|
17873
18130
|
return;
|
|
17874
18131
|
}
|
|
17875
18132
|
let cancelled = false;
|
|
17876
18133
|
setFetchState("loading");
|
|
17877
18134
|
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
17878
|
-
|
|
18135
|
+
const initialPath = pathname;
|
|
18136
|
+
fetchedContentPaths.add(`${subdomain}::${initialPath}`);
|
|
18137
|
+
fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(initialPath)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
17879
18138
|
if (cancelled) return;
|
|
17880
18139
|
const content = data?.content ?? {};
|
|
18140
|
+
const branding = Boolean(data?.showBranding);
|
|
17881
18141
|
contentCache.set(subdomain, content);
|
|
18142
|
+
brandingCache.set(subdomain, branding);
|
|
18143
|
+
setShowBranding(branding);
|
|
17882
18144
|
return applyContent(content);
|
|
17883
18145
|
}).catch(() => {
|
|
17884
18146
|
}).finally(() => {
|
|
@@ -18011,11 +18273,12 @@ function OhhwellsBridge() {
|
|
|
18011
18273
|
for (const [key, val] of Object.entries(content)) {
|
|
18012
18274
|
if (key === "__ohw_sections") continue;
|
|
18013
18275
|
if (key === AI_SECTIONS_KEY) continue;
|
|
18276
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
18277
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
18014
18278
|
if (key === BRAND_KIT_KEY) continue;
|
|
18015
18279
|
if (key === STYLE_STORE_KEY) continue;
|
|
18280
|
+
if (key === STYLE_STORE_KEY) continue;
|
|
18016
18281
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
18017
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
18018
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
18019
18282
|
if (applyVideoSettingNode(key, val)) continue;
|
|
18020
18283
|
if (applyCarouselNode(key, val)) continue;
|
|
18021
18284
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -18061,6 +18324,17 @@ function OhhwellsBridge() {
|
|
|
18061
18324
|
debounceTimer = setTimeout(applyFromCache, 150);
|
|
18062
18325
|
};
|
|
18063
18326
|
applyFromCache();
|
|
18327
|
+
const pathCacheKey = `${subdomain}::${pathname}`;
|
|
18328
|
+
if (!fetchedContentPaths.has(pathCacheKey)) {
|
|
18329
|
+
fetchedContentPaths.add(pathCacheKey);
|
|
18330
|
+
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
18331
|
+
fetch(`${apiUrl}/api/public/sites/${subdomain}/content?path=${encodeURIComponent(pathname)}`, { cache: "no-store" }).then((r2) => r2.ok ? r2.json() : null).then((data) => {
|
|
18332
|
+
if (!data?.content) return;
|
|
18333
|
+
contentCache.set(subdomain, data.content);
|
|
18334
|
+
applyFromCache();
|
|
18335
|
+
}).catch(() => {
|
|
18336
|
+
});
|
|
18337
|
+
}
|
|
18064
18338
|
observer = new MutationObserver(scheduleApply);
|
|
18065
18339
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
18066
18340
|
return () => {
|
|
@@ -18174,25 +18448,13 @@ function OhhwellsBridge() {
|
|
|
18174
18448
|
};
|
|
18175
18449
|
const t1 = setTimeout(measure, 50);
|
|
18176
18450
|
const t2 = setTimeout(measure, 500);
|
|
18177
|
-
|
|
18178
|
-
|
|
18179
|
-
const clearResizeTimers = () => {
|
|
18180
|
-
resizeTimers.forEach(clearTimeout);
|
|
18181
|
-
resizeTimers = [];
|
|
18182
|
-
};
|
|
18183
|
-
const handleResize = () => {
|
|
18184
|
-
if (window.innerWidth === lastWidth) return;
|
|
18185
|
-
lastWidth = window.innerWidth;
|
|
18186
|
-
clearResizeTimers();
|
|
18187
|
-
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
18188
|
-
};
|
|
18189
|
-
window.addEventListener("resize", handleResize);
|
|
18451
|
+
const ro = new ResizeObserver(schedule);
|
|
18452
|
+
ro.observe(document.body);
|
|
18190
18453
|
return () => {
|
|
18191
18454
|
clearTimeout(t1);
|
|
18192
18455
|
clearTimeout(t2);
|
|
18193
18456
|
if (raf != null) cancelAnimationFrame(raf);
|
|
18194
|
-
|
|
18195
|
-
window.removeEventListener("resize", handleResize);
|
|
18457
|
+
ro.disconnect();
|
|
18196
18458
|
};
|
|
18197
18459
|
}, [pathname, isEditMode, postToParent2]);
|
|
18198
18460
|
(0, import_react17.useEffect)(() => {
|
|
@@ -18438,9 +18700,6 @@ function OhhwellsBridge() {
|
|
|
18438
18700
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
18439
18701
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
18440
18702
|
if (isInsideLinkEditor(target)) return;
|
|
18441
|
-
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
18442
|
-
clearMediaSelectionRef.current();
|
|
18443
|
-
}
|
|
18444
18703
|
if (isInsideFloatingPanel(target)) return;
|
|
18445
18704
|
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
18446
18705
|
if (target.closest(
|
|
@@ -18448,6 +18707,9 @@ function OhhwellsBridge() {
|
|
|
18448
18707
|
)) {
|
|
18449
18708
|
return;
|
|
18450
18709
|
}
|
|
18710
|
+
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
18711
|
+
clearMediaSelectionRef.current();
|
|
18712
|
+
}
|
|
18451
18713
|
{
|
|
18452
18714
|
const formEl = getFormElement(target);
|
|
18453
18715
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -18599,14 +18861,6 @@ function OhhwellsBridge() {
|
|
|
18599
18861
|
}
|
|
18600
18862
|
const clickedButton = findClosestButtonLike(target);
|
|
18601
18863
|
const buttonOnMedia = Boolean(clickedButton && isMediaEditable(editable) && editable.contains(clickedButton));
|
|
18602
|
-
console.log("[click-debug]", {
|
|
18603
|
-
editableType: editable.dataset.ohwEditable,
|
|
18604
|
-
editableTag: editable.tagName,
|
|
18605
|
-
targetTag: target.tagName,
|
|
18606
|
-
clickedButtonTag: clickedButton?.tagName ?? null,
|
|
18607
|
-
buttonOnMedia,
|
|
18608
|
-
isMediaEditableEditable: isMediaEditable(editable)
|
|
18609
|
-
});
|
|
18610
18864
|
if (isMediaEditable(editable) && !buttonOnMedia) {
|
|
18611
18865
|
e.preventDefault();
|
|
18612
18866
|
e.stopPropagation();
|
|
@@ -18633,11 +18887,6 @@ function OhhwellsBridge() {
|
|
|
18633
18887
|
const hrefLookupTarget = buttonOnMedia ? clickedButton : editable;
|
|
18634
18888
|
const hrefCtx = getHrefKeyFromElement(hrefLookupTarget);
|
|
18635
18889
|
const navAnchor = hrefCtx ? getNavigationItemAnchor(hrefCtx.anchor) : null;
|
|
18636
|
-
console.log("[click-debug 2]", {
|
|
18637
|
-
hrefLookupTargetTag: hrefLookupTarget.tagName,
|
|
18638
|
-
hrefCtx: hrefCtx ? { key: hrefCtx.key } : null,
|
|
18639
|
-
navAnchorTag: navAnchor?.tagName ?? null
|
|
18640
|
-
});
|
|
18641
18890
|
if (navAnchor) {
|
|
18642
18891
|
e.preventDefault();
|
|
18643
18892
|
e.stopPropagation();
|
|
@@ -18807,6 +19056,9 @@ function OhhwellsBridge() {
|
|
|
18807
19056
|
setHoveredItemRect(null);
|
|
18808
19057
|
hoveredNavContainerRef.current = null;
|
|
18809
19058
|
setHoveredNavContainerRect(null);
|
|
19059
|
+
siblingHintElRef.current = null;
|
|
19060
|
+
setSiblingHintRect(null);
|
|
19061
|
+
setSiblingHintRects([]);
|
|
18810
19062
|
return;
|
|
18811
19063
|
}
|
|
18812
19064
|
{
|
|
@@ -18925,7 +19177,6 @@ function OhhwellsBridge() {
|
|
|
18925
19177
|
hoveredNavContainerRef.current = null;
|
|
18926
19178
|
setHoveredNavContainerRect(null);
|
|
18927
19179
|
hoveredItemElRef.current = editable;
|
|
18928
|
-
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
18929
19180
|
}
|
|
18930
19181
|
}
|
|
18931
19182
|
}
|
|
@@ -19222,7 +19473,7 @@ function OhhwellsBridge() {
|
|
|
19222
19473
|
}
|
|
19223
19474
|
};
|
|
19224
19475
|
const probeImageAt = (clientX, clientY, isDragOver = false, fromParentViewport = false) => {
|
|
19225
|
-
if (linkPopoverOpenRef.current) {
|
|
19476
|
+
if (linkPopoverOpenRef.current || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
|
|
19226
19477
|
if (hoveredImageRef.current) {
|
|
19227
19478
|
hoveredImageRef.current = null;
|
|
19228
19479
|
hoveredImageHasTextOverlapRef.current = false;
|
|
@@ -19587,8 +19838,7 @@ function OhhwellsBridge() {
|
|
|
19587
19838
|
};
|
|
19588
19839
|
const handleMouseMove = (e) => {
|
|
19589
19840
|
const { clientX, clientY } = e;
|
|
19590
|
-
if (
|
|
19591
|
-
if (isOverEditorChrome(clientX, clientY)) {
|
|
19841
|
+
if (document.documentElement.hasAttribute("data-ohw-panel-dragging") || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY) || isOverEditorChrome(clientX, clientY)) {
|
|
19592
19842
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
19593
19843
|
formHoverElRef.current = null;
|
|
19594
19844
|
setFormHoverRect(null);
|
|
@@ -19596,6 +19846,12 @@ function OhhwellsBridge() {
|
|
|
19596
19846
|
setHoveredItemRect(null);
|
|
19597
19847
|
hoveredNavContainerRef.current = null;
|
|
19598
19848
|
setHoveredNavContainerRect(null);
|
|
19849
|
+
siblingHintElRef.current = null;
|
|
19850
|
+
setSiblingHintRect(null);
|
|
19851
|
+
setSiblingHintRects([]);
|
|
19852
|
+
dismissImageHover();
|
|
19853
|
+
clearImageHover();
|
|
19854
|
+
setSectionGap(null);
|
|
19599
19855
|
return;
|
|
19600
19856
|
}
|
|
19601
19857
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -19607,7 +19863,11 @@ function OhhwellsBridge() {
|
|
|
19607
19863
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
19608
19864
|
const { clientX, clientY } = e.data;
|
|
19609
19865
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
19610
|
-
if (
|
|
19866
|
+
if (document.documentElement.hasAttribute("data-ohw-panel-dragging") || floatingPanelOpenRef.current && isPointOverFloatingPanel(clientX, clientY)) {
|
|
19867
|
+
dismissImageHover();
|
|
19868
|
+
clearImageHover();
|
|
19869
|
+
return;
|
|
19870
|
+
}
|
|
19611
19871
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
19612
19872
|
probeSectionGapAt(clientX, clientY);
|
|
19613
19873
|
probeImageAt(clientX, clientY);
|
|
@@ -19914,11 +20174,11 @@ function OhhwellsBridge() {
|
|
|
19914
20174
|
continue;
|
|
19915
20175
|
}
|
|
19916
20176
|
if (key === AI_SECTIONS_KEY) continue;
|
|
20177
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
20178
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
19917
20179
|
if (key === BRAND_KIT_KEY) continue;
|
|
19918
20180
|
if (key === STYLE_STORE_KEY) continue;
|
|
19919
20181
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
19920
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
19921
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
19922
20182
|
if (applyVideoSettingNode(key, val)) continue;
|
|
19923
20183
|
if (applyCarouselNode(key, val)) continue;
|
|
19924
20184
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -20079,6 +20339,20 @@ function OhhwellsBridge() {
|
|
|
20079
20339
|
postAiSectionsChanged();
|
|
20080
20340
|
};
|
|
20081
20341
|
window.addEventListener("message", handleAiSetSections);
|
|
20342
|
+
const handleMoveSection = (e) => {
|
|
20343
|
+
if (e.data?.type !== "ow:move-section") return;
|
|
20344
|
+
const instanceId = typeof e.data.instanceId === "string" ? e.data.instanceId : "";
|
|
20345
|
+
const direction = e.data.direction === "up" || e.data.direction === "down" ? e.data.direction : null;
|
|
20346
|
+
if (!instanceId || !direction) return;
|
|
20347
|
+
const entries = moveSectionInstance(instanceId, direction, window.location.pathname);
|
|
20348
|
+
if (!entries) return;
|
|
20349
|
+
const orderJson = JSON.stringify(entries);
|
|
20350
|
+
editContentRef.current = { ...editContentRef.current, [SECTION_ORDER_KEY]: orderJson };
|
|
20351
|
+
setAiSectionOrder(orderJson, window.location.pathname);
|
|
20352
|
+
postToParentRef.current({ type: "ow:change", nodes: [{ key: SECTION_ORDER_KEY, text: orderJson }] });
|
|
20353
|
+
window.dispatchEvent(new Event("resize"));
|
|
20354
|
+
};
|
|
20355
|
+
window.addEventListener("message", handleMoveSection);
|
|
20082
20356
|
const handleAiSetBrand = (e) => {
|
|
20083
20357
|
if (e.data?.type !== "ow:ai-set-brand") return;
|
|
20084
20358
|
const value = typeof e.data.value === "string" ? e.data.value : "";
|
|
@@ -20093,12 +20367,35 @@ function OhhwellsBridge() {
|
|
|
20093
20367
|
window.addEventListener("message", handleAiSetBrand);
|
|
20094
20368
|
const handleAiSetStyles = (e) => {
|
|
20095
20369
|
if (e.data?.type !== "ow:ai-set-styles") return;
|
|
20096
|
-
|
|
20370
|
+
let value = typeof e.data.value === "string" ? e.data.value : "";
|
|
20097
20371
|
const previous = stylesRef.current;
|
|
20372
|
+
let previousSections;
|
|
20373
|
+
const store = parseStyleStore(value);
|
|
20374
|
+
if (store) {
|
|
20375
|
+
const folded = foldAlignIntoTrees(parseAiSectionsState(aiSectionsRef.current), store);
|
|
20376
|
+
if (folded.changed) {
|
|
20377
|
+
const nextSections = serializeAiSectionsState(folded.state);
|
|
20378
|
+
if (nextSections !== aiSectionsRef.current) {
|
|
20379
|
+
previousSections = aiSectionsRef.current;
|
|
20380
|
+
aiSectionsRef.current = nextSections;
|
|
20381
|
+
applyAiSectionsToDom(folded.state);
|
|
20382
|
+
postToParentRef.current({
|
|
20383
|
+
type: "ow:change",
|
|
20384
|
+
nodes: [{ key: AI_SECTIONS_KEY, text: nextSections }]
|
|
20385
|
+
});
|
|
20386
|
+
}
|
|
20387
|
+
value = JSON.stringify(folded.store);
|
|
20388
|
+
}
|
|
20389
|
+
}
|
|
20098
20390
|
stylesRef.current = value;
|
|
20099
20391
|
applyStylesToDom(parseStyleStore(value));
|
|
20100
20392
|
postToParentRef.current({ type: "ow:change", nodes: [{ key: STYLE_STORE_KEY, text: value }] });
|
|
20101
|
-
postToParentRef.current({
|
|
20393
|
+
postToParentRef.current({
|
|
20394
|
+
type: "ow:ai-styles-applied",
|
|
20395
|
+
previous,
|
|
20396
|
+
value,
|
|
20397
|
+
...previousSections !== void 0 ? { previousSections } : {}
|
|
20398
|
+
});
|
|
20102
20399
|
};
|
|
20103
20400
|
window.addEventListener("message", handleAiSetStyles);
|
|
20104
20401
|
const handleGetBrand = (e) => {
|
|
@@ -20108,20 +20405,6 @@ function OhhwellsBridge() {
|
|
|
20108
20405
|
postToParentRef.current({ type: "ow:brand-value", value });
|
|
20109
20406
|
};
|
|
20110
20407
|
window.addEventListener("message", handleGetBrand);
|
|
20111
|
-
const handleMoveSection = (e) => {
|
|
20112
|
-
if (e.data?.type !== "ow:move-section") return;
|
|
20113
|
-
const instanceId = typeof e.data.instanceId === "string" ? e.data.instanceId : "";
|
|
20114
|
-
const direction = e.data.direction === "up" || e.data.direction === "down" ? e.data.direction : null;
|
|
20115
|
-
if (!instanceId || !direction) return;
|
|
20116
|
-
const entries = moveSectionInstance(instanceId, direction, window.location.pathname);
|
|
20117
|
-
if (!entries) return;
|
|
20118
|
-
const orderJson = JSON.stringify(entries);
|
|
20119
|
-
editContentRef.current = { ...editContentRef.current, [SECTION_ORDER_KEY]: orderJson };
|
|
20120
|
-
setAiSectionOrder(orderJson, window.location.pathname);
|
|
20121
|
-
postToParentRef.current({ type: "ow:change", nodes: [{ key: SECTION_ORDER_KEY, text: orderJson }] });
|
|
20122
|
-
window.dispatchEvent(new Event("resize"));
|
|
20123
|
-
};
|
|
20124
|
-
window.addEventListener("message", handleMoveSection);
|
|
20125
20408
|
const handlePanelDragging = (e) => {
|
|
20126
20409
|
if (e.data?.type !== "ow:panel-dragging") return;
|
|
20127
20410
|
if (e.data.dragging) document.documentElement.setAttribute("data-ohw-panel-dragging", "");
|
|
@@ -20179,6 +20462,12 @@ function OhhwellsBridge() {
|
|
|
20179
20462
|
closeLinkPopoverRef.current();
|
|
20180
20463
|
return;
|
|
20181
20464
|
}
|
|
20465
|
+
if (floatingPanelOpenRef.current) {
|
|
20466
|
+
setFloatingPanelRef.current(null);
|
|
20467
|
+
deselectRef.current();
|
|
20468
|
+
deactivateRef.current();
|
|
20469
|
+
return;
|
|
20470
|
+
}
|
|
20182
20471
|
deselectRef.current();
|
|
20183
20472
|
deactivateRef.current();
|
|
20184
20473
|
clearMediaSelectionRef.current();
|
|
@@ -20453,8 +20742,12 @@ function OhhwellsBridge() {
|
|
|
20453
20742
|
if (inserted) {
|
|
20454
20743
|
const tracker = getSectionsTracker();
|
|
20455
20744
|
postToParentRef.current({ type: "ow:change", nodes: [{ key: "__ohw_sections", text: tracker.textContent ?? "[]" }] });
|
|
20456
|
-
const
|
|
20457
|
-
|
|
20745
|
+
const reportHeight = () => {
|
|
20746
|
+
const h = document.body.scrollHeight;
|
|
20747
|
+
if (h > 50) postToParentRef.current({ type: "ow:height", height: h });
|
|
20748
|
+
};
|
|
20749
|
+
reportHeight();
|
|
20750
|
+
setTimeout(reportHeight, 500);
|
|
20458
20751
|
}
|
|
20459
20752
|
};
|
|
20460
20753
|
const handleSwitchSchedule = (e) => {
|
|
@@ -20850,17 +21143,17 @@ function OhhwellsBridge() {
|
|
|
20850
21143
|
window.removeEventListener("message", handleAiApplyTree);
|
|
20851
21144
|
window.removeEventListener("message", handleAiDeleteSection);
|
|
20852
21145
|
window.removeEventListener("message", handleAiSetSections);
|
|
21146
|
+
window.removeEventListener("message", handleMoveSection);
|
|
20853
21147
|
window.removeEventListener("message", handleAiSetBrand);
|
|
20854
21148
|
window.removeEventListener("message", handleAiSetStyles);
|
|
20855
21149
|
window.removeEventListener("message", handleGetBrand);
|
|
20856
|
-
window.removeEventListener("message", handleMoveSection);
|
|
20857
21150
|
window.removeEventListener("message", handlePanelDragging);
|
|
20858
21151
|
window.removeEventListener("message", handleDeleteSection);
|
|
20859
21152
|
window.removeEventListener("message", handleDeactivate);
|
|
20860
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
20861
21153
|
window.removeEventListener("message", handleToastAction);
|
|
20862
21154
|
window.removeEventListener("message", handleFormCount);
|
|
20863
21155
|
window.removeEventListener("message", handleUiEscape);
|
|
21156
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
20864
21157
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
20865
21158
|
autoSaveTimers.current.clear();
|
|
20866
21159
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -21063,7 +21356,7 @@ function OhhwellsBridge() {
|
|
|
21063
21356
|
postToParent2({
|
|
21064
21357
|
type: "ow:ready",
|
|
21065
21358
|
version: "1",
|
|
21066
|
-
bridgeVersion: "0.1.
|
|
21359
|
+
bridgeVersion: "0.1.80",
|
|
21067
21360
|
path: pathname,
|
|
21068
21361
|
nodes: collectEditableNodes(editContentRef.current),
|
|
21069
21362
|
sections
|
|
@@ -21526,6 +21819,7 @@ function OhhwellsBridge() {
|
|
|
21526
21819
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
21527
21820
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: "ohw-loader", suppressHydrationWarning: true, style: { ...OHW_LOADER_STYLE, display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OhwLoaderSpinner, {}) }),
|
|
21528
21821
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: OHW_LOADER_PREHYDRATE_SCRIPT } }),
|
|
21822
|
+
subdomain && !isEditMode && showBranding && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MadeWithOhhWells, {}),
|
|
21529
21823
|
bridgeRoot ? (0, import_react_dom4.createPortal)(
|
|
21530
21824
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
21531
21825
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
|
|
@@ -21981,6 +22275,59 @@ function OhhwellsBridge() {
|
|
|
21981
22275
|
) : null
|
|
21982
22276
|
] });
|
|
21983
22277
|
}
|
|
22278
|
+
|
|
22279
|
+
// src/ui/EmptySection.tsx
|
|
22280
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
22281
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
22282
|
+
function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
|
|
22283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
22284
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
22285
|
+
"p",
|
|
22286
|
+
{
|
|
22287
|
+
style: {
|
|
22288
|
+
fontFamily: "var(--brand-font-body)",
|
|
22289
|
+
fontSize: "0.75rem",
|
|
22290
|
+
fontWeight: 500,
|
|
22291
|
+
letterSpacing: "0.15em",
|
|
22292
|
+
textTransform: "uppercase",
|
|
22293
|
+
color: "var(--brand-accent)",
|
|
22294
|
+
marginBottom: "1.5rem"
|
|
22295
|
+
},
|
|
22296
|
+
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" }) })
|
|
22297
|
+
}
|
|
22298
|
+
),
|
|
22299
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
22300
|
+
"h1",
|
|
22301
|
+
{
|
|
22302
|
+
style: {
|
|
22303
|
+
fontFamily: "var(--brand-font-heading)",
|
|
22304
|
+
fontSize: "clamp(2rem, 3.5vw, 2.75rem)",
|
|
22305
|
+
lineHeight: 1.1,
|
|
22306
|
+
letterSpacing: "-0.025em",
|
|
22307
|
+
color: "var(--brand-text)",
|
|
22308
|
+
marginBottom: "1rem"
|
|
22309
|
+
},
|
|
22310
|
+
...titleKey ? { "data-ohw-editable": "text", "data-ohw-key": titleKey, "data-ohw-max-length": 80 } : {},
|
|
22311
|
+
children: title
|
|
22312
|
+
}
|
|
22313
|
+
),
|
|
22314
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
22315
|
+
"p",
|
|
22316
|
+
{
|
|
22317
|
+
style: {
|
|
22318
|
+
fontFamily: "var(--brand-font-body)",
|
|
22319
|
+
fontSize: "1rem",
|
|
22320
|
+
lineHeight: 1.7,
|
|
22321
|
+
fontWeight: 300,
|
|
22322
|
+
color: "var(--brand-text-muted)",
|
|
22323
|
+
maxWidth: "340px"
|
|
22324
|
+
},
|
|
22325
|
+
...subtitleKey ? { "data-ohw-editable": "text", "data-ohw-key": subtitleKey, "data-ohw-max-length": 160 } : {},
|
|
22326
|
+
children: "This page doesn't have any content yet."
|
|
22327
|
+
}
|
|
22328
|
+
)
|
|
22329
|
+
] });
|
|
22330
|
+
}
|
|
21984
22331
|
// Annotate the CommonJS export names for ESM import in node:
|
|
21985
22332
|
0 && (module.exports = {
|
|
21986
22333
|
AI_DEFAULT_BRAND,
|
|
@@ -21998,6 +22345,7 @@ function OhhwellsBridge() {
|
|
|
21998
22345
|
DropdownMenuItem,
|
|
21999
22346
|
DropdownMenuSeparator,
|
|
22000
22347
|
DropdownMenuTrigger,
|
|
22348
|
+
EmptySection,
|
|
22001
22349
|
ItemActionToolbar,
|
|
22002
22350
|
ItemInteractionLayer,
|
|
22003
22351
|
LinkEditorPanel,
|