@ohhwells/bridge 0.1.172-next.457 → 0.1.173
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 +709 -832
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +729 -868
- package/dist/index.js.map +1 -1
- package/dist/pages.cjs.map +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/styles.css +0 -116
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/OhhwellsBridge.tsx
|
|
4
|
-
import React12, { useCallback as useCallback12, useEffect as useEffect21, useLayoutEffect as
|
|
4
|
+
import React12, { useCallback as useCallback12, useEffect as useEffect21, useLayoutEffect as useLayoutEffect6, useRef as useRef14, useState as useState18 } from "react";
|
|
5
5
|
import { createRoot as createRoot3 } from "react-dom/client";
|
|
6
6
|
import { flushSync as flushSync3 } from "react-dom";
|
|
7
7
|
|
|
@@ -6876,21 +6876,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
6876
6876
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
6877
6877
|
return target ? pricingFeatureList(target).length : 0;
|
|
6878
6878
|
}
|
|
6879
|
-
function prevailingFeatureIcon(features) {
|
|
6880
|
-
const counts = /* @__PURE__ */ new Map();
|
|
6881
|
-
for (const row of features) {
|
|
6882
|
-
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
6883
|
-
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
6884
|
-
entry.count += 1;
|
|
6885
|
-
counts.set(key, entry);
|
|
6886
|
-
}
|
|
6887
|
-
let best = null;
|
|
6888
|
-
for (const entry of counts.values()) {
|
|
6889
|
-
if (!best || entry.count > best.count) best = entry;
|
|
6890
|
-
}
|
|
6891
|
-
if (!best) return {};
|
|
6892
|
-
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
6893
|
-
}
|
|
6894
6879
|
function addPricingCardFeature(tree, index, text) {
|
|
6895
6880
|
return withPricingCollection(tree, (collection) => {
|
|
6896
6881
|
const children = collection.children;
|
|
@@ -6899,7 +6884,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
6899
6884
|
const features = pricingFeatureList(target);
|
|
6900
6885
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
6901
6886
|
target.slots = target.slots ?? {};
|
|
6902
|
-
target.slots.features = [...features, { text
|
|
6887
|
+
target.slots.features = [...features, { text }];
|
|
6903
6888
|
return true;
|
|
6904
6889
|
});
|
|
6905
6890
|
}
|
|
@@ -8412,7 +8397,7 @@ var AI_MOBILE_CSS = [
|
|
|
8412
8397
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
8413
8398
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
8414
8399
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
8415
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
8400
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
8416
8401
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
8417
8402
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
8418
8403
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -8428,10 +8413,8 @@ var AI_MOBILE_CSS = [
|
|
|
8428
8413
|
"[data-ai-section]{overflow-x:hidden}",
|
|
8429
8414
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
8430
8415
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
8431
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
8432
|
-
|
|
8433
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8434
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
8416
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
8417
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8435
8418
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
8436
8419
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
8437
8420
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8636,31 +8619,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8636
8619
|
function textAttrs(ctx, path) {
|
|
8637
8620
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8638
8621
|
}
|
|
8639
|
-
var AI_RESPONSIVE_CSS = [
|
|
8640
|
-
"@media (max-width: 960px) {",
|
|
8641
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
8642
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
8643
|
-
"}",
|
|
8644
|
-
"@media (max-width: 640px) {",
|
|
8645
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
8646
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
8647
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
8648
|
-
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
8649
|
-
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
8650
|
-
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
8651
|
-
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
8652
|
-
// layered text used to be.
|
|
8653
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
8654
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
8655
|
-
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
8656
|
-
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
8657
|
-
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
8658
|
-
// other rule had already been taught to stand down.
|
|
8659
|
-
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
8660
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
8661
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
8662
|
-
"}"
|
|
8663
|
-
].join("\n");
|
|
8664
8622
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8665
8623
|
function MediaBox({
|
|
8666
8624
|
refValue,
|
|
@@ -8715,7 +8673,7 @@ function MediaBox({
|
|
|
8715
8673
|
position: fill ? "absolute" : void 0,
|
|
8716
8674
|
inset: fill ? 0 : void 0,
|
|
8717
8675
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8718
|
-
height: fill ? "100%" :
|
|
8676
|
+
height: fill ? "100%" : void 0,
|
|
8719
8677
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8720
8678
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8721
8679
|
borderRadius: radius,
|
|
@@ -10217,7 +10175,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
10217
10175
|
return /* @__PURE__ */ jsx(
|
|
10218
10176
|
"div",
|
|
10219
10177
|
{
|
|
10220
|
-
"data-ai-grid":
|
|
10178
|
+
"data-ai-grid": "",
|
|
10221
10179
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
10222
10180
|
style: {
|
|
10223
10181
|
display: "grid",
|
|
@@ -10519,7 +10477,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
10519
10477
|
},
|
|
10520
10478
|
children: [
|
|
10521
10479
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
10522
|
-
// The section's `data-ai-
|
|
10480
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
10523
10481
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
10524
10482
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
10525
10483
|
// the full section width instead of reading at the usual content width.
|
|
@@ -10933,7 +10891,6 @@ function AiTreeRenderer({
|
|
|
10933
10891
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
10934
10892
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
10935
10893
|
...bgAttrs,
|
|
10936
|
-
"data-ai-responsive": "",
|
|
10937
10894
|
style: {
|
|
10938
10895
|
position: "relative",
|
|
10939
10896
|
padding: `${padCss} 0`,
|
|
@@ -10947,13 +10904,12 @@ function AiTreeRenderer({
|
|
|
10947
10904
|
...fillHeight ? { display: "grid" } : {}
|
|
10948
10905
|
},
|
|
10949
10906
|
children: [
|
|
10950
|
-
/* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
|
|
10951
|
-
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10952
10907
|
isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
10908
|
+
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10953
10909
|
/* @__PURE__ */ jsx(
|
|
10954
10910
|
"div",
|
|
10955
10911
|
{
|
|
10956
|
-
"data-ai-
|
|
10912
|
+
"data-ai-container": "",
|
|
10957
10913
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
10958
10914
|
style: {
|
|
10959
10915
|
position: "relative",
|
|
@@ -10970,7 +10926,7 @@ function AiTreeRenderer({
|
|
|
10970
10926
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
|
|
10971
10927
|
"div",
|
|
10972
10928
|
{
|
|
10973
|
-
"data-ai-
|
|
10929
|
+
"data-ai-row": "",
|
|
10974
10930
|
style: {
|
|
10975
10931
|
display: "grid",
|
|
10976
10932
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11632,10 +11588,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11632
11588
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11633
11589
|
continue;
|
|
11634
11590
|
}
|
|
11591
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
11635
11592
|
let container = existing?.container;
|
|
11636
|
-
let isNewMount = false;
|
|
11637
11593
|
if (!container || !container.isConnected) {
|
|
11638
|
-
isNewMount = true;
|
|
11639
11594
|
existing?.root.unmount();
|
|
11640
11595
|
container?.remove();
|
|
11641
11596
|
container = document.createElement("div");
|
|
@@ -11973,34 +11928,6 @@ function minSpanForFooterBlock(type) {
|
|
|
11973
11928
|
return 3;
|
|
11974
11929
|
}
|
|
11975
11930
|
}
|
|
11976
|
-
function readLiveSocialItems() {
|
|
11977
|
-
const root = getFooterRoot();
|
|
11978
|
-
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
11979
|
-
if (!row) return [];
|
|
11980
|
-
const items = [];
|
|
11981
|
-
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
11982
|
-
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
11983
|
-
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
11984
|
-
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
11985
|
-
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
11986
|
-
items.push({ platform, href });
|
|
11987
|
-
}
|
|
11988
|
-
return items;
|
|
11989
|
-
}
|
|
11990
|
-
function syncSocialRowsFromDom(tree) {
|
|
11991
|
-
const root = getFooterRoot();
|
|
11992
|
-
if (!root) return;
|
|
11993
|
-
const row = root.querySelector("[data-ohw-socials-row]");
|
|
11994
|
-
const live = readLiveSocialItems();
|
|
11995
|
-
if (row && live.length === 0) return;
|
|
11996
|
-
for (const col of tree.columns) {
|
|
11997
|
-
col.blocks = col.blocks.flatMap((block) => {
|
|
11998
|
-
if (block.type !== "social-row") return [block];
|
|
11999
|
-
if (!row) return [];
|
|
12000
|
-
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
12001
|
-
});
|
|
12002
|
-
}
|
|
12003
|
-
}
|
|
12004
11931
|
function collectBrandBlocks(tree) {
|
|
12005
11932
|
const brand = [];
|
|
12006
11933
|
for (const col of tree.columns) {
|
|
@@ -12246,7 +12173,6 @@ function textOf2(el) {
|
|
|
12246
12173
|
}
|
|
12247
12174
|
function syncFooterTreeLinksFromDom(tree) {
|
|
12248
12175
|
const next = cloneTree2(tree);
|
|
12249
|
-
syncSocialRowsFromDom(next);
|
|
12250
12176
|
const domCols = listFooterColumns().map((col) => {
|
|
12251
12177
|
const heading = getFooterColumnHeadingEl(col);
|
|
12252
12178
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -18059,7 +17985,7 @@ function apiBase() {
|
|
|
18059
17985
|
function bridgeVersion() {
|
|
18060
17986
|
try {
|
|
18061
17987
|
if (true) {
|
|
18062
|
-
return "0.1.
|
|
17988
|
+
return "0.1.173";
|
|
18063
17989
|
}
|
|
18064
17990
|
} catch {
|
|
18065
17991
|
}
|
|
@@ -18073,7 +17999,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
18073
17999
|
return;
|
|
18074
18000
|
}
|
|
18075
18001
|
try {
|
|
18076
|
-
const v = true ? "0.1.
|
|
18002
|
+
const v = true ? "0.1.173" : "";
|
|
18077
18003
|
if (v) {
|
|
18078
18004
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
18079
18005
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -18754,7 +18680,6 @@ function MediaOverlay({
|
|
|
18754
18680
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
18755
18681
|
);
|
|
18756
18682
|
}, [isVideo]);
|
|
18757
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
18758
18683
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
18759
18684
|
const box = {
|
|
18760
18685
|
position: "fixed",
|
|
@@ -18853,10 +18778,11 @@ function MediaOverlay({
|
|
|
18853
18778
|
className: "flex items-center justify-center cursor-pointer",
|
|
18854
18779
|
style: {
|
|
18855
18780
|
...box,
|
|
18856
|
-
//
|
|
18857
|
-
//
|
|
18858
|
-
//
|
|
18859
|
-
|
|
18781
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
18782
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
18783
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
18784
|
+
// Replace still works.
|
|
18785
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
18860
18786
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
18861
18787
|
// than hovered. Hover keeps the existing tinted preview.
|
|
18862
18788
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -18883,18 +18809,15 @@ function MediaOverlay({
|
|
|
18883
18809
|
},
|
|
18884
18810
|
children: [
|
|
18885
18811
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18886
|
-
|
|
18812
|
+
isVideo ? "Replace video" : "Replace image"
|
|
18887
18813
|
]
|
|
18888
18814
|
}
|
|
18889
18815
|
),
|
|
18890
|
-
|
|
18816
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ jsxs8(
|
|
18891
18817
|
"div",
|
|
18892
18818
|
{
|
|
18893
18819
|
className: "flex items-center gap-1.5",
|
|
18894
|
-
style: {
|
|
18895
|
-
// Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
|
|
18896
|
-
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
|
|
18897
|
-
},
|
|
18820
|
+
style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
|
|
18898
18821
|
onClick: (e) => e.stopPropagation(),
|
|
18899
18822
|
children: [
|
|
18900
18823
|
/* @__PURE__ */ jsxs8(
|
|
@@ -18903,7 +18826,7 @@ function MediaOverlay({
|
|
|
18903
18826
|
"data-ohw-media-overlay": "",
|
|
18904
18827
|
variant: "outline",
|
|
18905
18828
|
size: "sm",
|
|
18906
|
-
"aria-label":
|
|
18829
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
18907
18830
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
18908
18831
|
style: {
|
|
18909
18832
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -18924,7 +18847,7 @@ function MediaOverlay({
|
|
|
18924
18847
|
},
|
|
18925
18848
|
children: [
|
|
18926
18849
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18927
|
-
replaceMode === "full" ?
|
|
18850
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
18928
18851
|
]
|
|
18929
18852
|
}
|
|
18930
18853
|
),
|
|
@@ -19581,24 +19504,8 @@ function AiSectionOverlay({
|
|
|
19581
19504
|
}
|
|
19582
19505
|
|
|
19583
19506
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19584
|
-
import { useCallback as useCallback3, useEffect as useEffect9,
|
|
19585
|
-
import {
|
|
19586
|
-
AlignCenter,
|
|
19587
|
-
AlignLeft,
|
|
19588
|
-
AlignRight,
|
|
19589
|
-
ArrowLeft as ArrowLeft2,
|
|
19590
|
-
ArrowRight as ArrowRight2,
|
|
19591
|
-
Check as Check2,
|
|
19592
|
-
ChevronDown as ChevronDown3,
|
|
19593
|
-
Image as ImageIcon2,
|
|
19594
|
-
ImageMinus,
|
|
19595
|
-
ImagePlus,
|
|
19596
|
-
Link as LinkIcon,
|
|
19597
|
-
Minus,
|
|
19598
|
-
Palette,
|
|
19599
|
-
Plus as Plus2,
|
|
19600
|
-
Star
|
|
19601
|
-
} from "lucide-react";
|
|
19507
|
+
import { useCallback as useCallback3, useEffect as useEffect9, useRef as useRef5, useState as useState8 } from "react";
|
|
19508
|
+
import { Star } from "lucide-react";
|
|
19602
19509
|
|
|
19603
19510
|
// src/lib/ai-media-strip-tree.ts
|
|
19604
19511
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19712,6 +19619,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19712
19619
|
return true;
|
|
19713
19620
|
});
|
|
19714
19621
|
}
|
|
19622
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
19623
|
+
return withMediaStrip(tree, (block) => {
|
|
19624
|
+
const items = block.items;
|
|
19625
|
+
if (index < 0 || index >= items.length) return false;
|
|
19626
|
+
items[index] = { ...items[index], alt };
|
|
19627
|
+
return true;
|
|
19628
|
+
});
|
|
19629
|
+
}
|
|
19715
19630
|
function setMediaStripItemLink(tree, index, link) {
|
|
19716
19631
|
return withMediaStrip(tree, (block) => {
|
|
19717
19632
|
const items = block.items;
|
|
@@ -19729,117 +19644,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19729
19644
|
});
|
|
19730
19645
|
}
|
|
19731
19646
|
|
|
19732
|
-
// src/ui/dialog.tsx
|
|
19733
|
-
import * as React9 from "react";
|
|
19734
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
19735
|
-
import { X as X2 } from "lucide-react";
|
|
19736
|
-
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
19737
|
-
function Dialog2({
|
|
19738
|
-
...props
|
|
19739
|
-
}) {
|
|
19740
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
19741
|
-
}
|
|
19742
|
-
function DialogPortal({
|
|
19743
|
-
...props
|
|
19744
|
-
}) {
|
|
19745
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
|
|
19746
|
-
}
|
|
19747
|
-
function DialogOverlay({
|
|
19748
|
-
className,
|
|
19749
|
-
...props
|
|
19750
|
-
}) {
|
|
19751
|
-
return /* @__PURE__ */ jsx20(
|
|
19752
|
-
DialogPrimitive.Overlay,
|
|
19753
|
-
{
|
|
19754
|
-
"data-slot": "dialog-overlay",
|
|
19755
|
-
"data-ohw-link-modal-root": "",
|
|
19756
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19757
|
-
...props
|
|
19758
|
-
}
|
|
19759
|
-
);
|
|
19760
|
-
}
|
|
19761
|
-
var DialogContent = React9.forwardRef(
|
|
19762
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19763
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
19764
|
-
return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
|
|
19765
|
-
/* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19766
|
-
/* @__PURE__ */ jsxs11(
|
|
19767
|
-
DialogPrimitive.Content,
|
|
19768
|
-
{
|
|
19769
|
-
ref,
|
|
19770
|
-
"data-slot": "dialog-content",
|
|
19771
|
-
className: cn(
|
|
19772
|
-
positionMode,
|
|
19773
|
-
"left-1/2 top-1/2 z-[2147483647] flex w-full max-w-[448px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-visible",
|
|
19774
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19775
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19776
|
-
className
|
|
19777
|
-
),
|
|
19778
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
19779
|
-
...props,
|
|
19780
|
-
children: [
|
|
19781
|
-
children,
|
|
19782
|
-
showCloseButton ? /* @__PURE__ */ jsx20(
|
|
19783
|
-
DialogPrimitive.Close,
|
|
19784
|
-
{
|
|
19785
|
-
type: "button",
|
|
19786
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19787
|
-
"aria-label": "Close",
|
|
19788
|
-
children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
|
|
19789
|
-
}
|
|
19790
|
-
) : null
|
|
19791
|
-
]
|
|
19792
|
-
}
|
|
19793
|
-
)
|
|
19794
|
-
] });
|
|
19795
|
-
}
|
|
19796
|
-
);
|
|
19797
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
19798
|
-
function DialogHeader({
|
|
19799
|
-
className,
|
|
19800
|
-
...props
|
|
19801
|
-
}) {
|
|
19802
|
-
return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19803
|
-
}
|
|
19804
|
-
function DialogFooter({
|
|
19805
|
-
className,
|
|
19806
|
-
...props
|
|
19807
|
-
}) {
|
|
19808
|
-
return /* @__PURE__ */ jsx20(
|
|
19809
|
-
"div",
|
|
19810
|
-
{
|
|
19811
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
19812
|
-
...props
|
|
19813
|
-
}
|
|
19814
|
-
);
|
|
19815
|
-
}
|
|
19816
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19817
|
-
DialogPrimitive.Title,
|
|
19818
|
-
{
|
|
19819
|
-
ref,
|
|
19820
|
-
className: cn(
|
|
19821
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19822
|
-
className
|
|
19823
|
-
),
|
|
19824
|
-
...props
|
|
19825
|
-
}
|
|
19826
|
-
));
|
|
19827
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
19828
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19829
|
-
DialogPrimitive.Description,
|
|
19830
|
-
{
|
|
19831
|
-
ref,
|
|
19832
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
19833
|
-
...props
|
|
19834
|
-
}
|
|
19835
|
-
));
|
|
19836
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
19837
|
-
var DialogClose = DialogPrimitive.Close;
|
|
19838
|
-
|
|
19839
19647
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19840
|
-
import { Fragment as Fragment7, jsx as
|
|
19841
|
-
var PRIMARY3 = "
|
|
19842
|
-
var
|
|
19648
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
19649
|
+
var PRIMARY3 = "#0885FE";
|
|
19650
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
19651
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19843
19652
|
function findMediaStripItemElement(sectionId, index) {
|
|
19844
19653
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
19845
19654
|
if (!sectionEl2) return null;
|
|
@@ -19849,35 +19658,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
19849
19658
|
}
|
|
19850
19659
|
return null;
|
|
19851
19660
|
}
|
|
19852
|
-
function
|
|
19853
|
-
|
|
19854
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19855
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19856
|
-
if (!itemEl) return null;
|
|
19857
|
-
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
19858
|
-
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19859
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19860
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19861
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
19862
|
-
return { sectionId, index };
|
|
19863
|
-
}
|
|
19864
|
-
function sameRef(a, b) {
|
|
19865
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19866
|
-
}
|
|
19867
|
-
function rectOf(el) {
|
|
19661
|
+
function readRect2(ref) {
|
|
19662
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19868
19663
|
if (!el) return null;
|
|
19869
19664
|
const r2 = el.getBoundingClientRect();
|
|
19870
19665
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19871
19666
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19872
19667
|
}
|
|
19873
|
-
function
|
|
19874
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19875
|
-
}
|
|
19876
|
-
function readStripRect(ref) {
|
|
19877
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19878
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19879
|
-
}
|
|
19880
|
-
function useLiveItemRect(ref, strip = false) {
|
|
19668
|
+
function useLiveItemRect(ref) {
|
|
19881
19669
|
const [rect, setRect] = useState8(null);
|
|
19882
19670
|
useEffect9(() => {
|
|
19883
19671
|
if (!ref) {
|
|
@@ -19885,7 +19673,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19885
19673
|
return;
|
|
19886
19674
|
}
|
|
19887
19675
|
const update = () => {
|
|
19888
|
-
const next =
|
|
19676
|
+
const next = readRect2(ref);
|
|
19889
19677
|
setRect(
|
|
19890
19678
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19891
19679
|
);
|
|
@@ -19900,49 +19688,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19900
19688
|
window.removeEventListener("resize", update);
|
|
19901
19689
|
clearInterval(interval);
|
|
19902
19690
|
};
|
|
19903
|
-
}, [ref?.sectionId, ref?.index
|
|
19691
|
+
}, [ref?.sectionId, ref?.index]);
|
|
19904
19692
|
return rect;
|
|
19905
19693
|
}
|
|
19906
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
19907
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19908
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19909
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
19910
|
-
const slotRef = useRef5(null);
|
|
19911
|
-
const [shift, setShift] = useState8(0);
|
|
19912
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
19913
|
-
useLayoutEffect4(() => {
|
|
19914
|
-
const slot = slotRef.current;
|
|
19915
|
-
if (!slot) return;
|
|
19916
|
-
const clamp = () => {
|
|
19917
|
-
const w = slot.offsetWidth;
|
|
19918
|
-
if (w <= 0) return;
|
|
19919
|
-
const half = w / 2;
|
|
19920
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19921
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19922
|
-
};
|
|
19923
|
-
clamp();
|
|
19924
|
-
const ro = new ResizeObserver(clamp);
|
|
19925
|
-
ro.observe(slot);
|
|
19926
|
-
return () => ro.disconnect();
|
|
19927
|
-
}, [centerX, children]);
|
|
19928
|
-
const mobile = window.innerWidth <= 480;
|
|
19929
|
-
return /* @__PURE__ */ jsx21(
|
|
19930
|
-
"div",
|
|
19931
|
-
{
|
|
19932
|
-
ref: slotRef,
|
|
19933
|
-
"data-ohw-bridge": "",
|
|
19934
|
-
"data-ohw-item-interaction": "",
|
|
19935
|
-
className: "pointer-events-auto fixed",
|
|
19936
|
-
style: {
|
|
19937
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19938
|
-
left: centerX + shift,
|
|
19939
|
-
transform: "translate(-50%, -100%)",
|
|
19940
|
-
zIndex: 2147483645
|
|
19941
|
-
},
|
|
19942
|
-
children
|
|
19943
|
-
}
|
|
19944
|
-
);
|
|
19945
|
-
}
|
|
19946
19694
|
function requestValidateTree(postToParent2, tree) {
|
|
19947
19695
|
return new Promise((resolve) => {
|
|
19948
19696
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19979,72 +19727,116 @@ function requestAssetPick(postToParent2) {
|
|
|
19979
19727
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19980
19728
|
});
|
|
19981
19729
|
}
|
|
19982
|
-
function
|
|
19730
|
+
function Pill({
|
|
19983
19731
|
label,
|
|
19984
19732
|
onClick,
|
|
19985
|
-
disabled
|
|
19986
|
-
active
|
|
19987
|
-
children
|
|
19733
|
+
disabled,
|
|
19734
|
+
active
|
|
19988
19735
|
}) {
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
|
|
19993
|
-
|
|
19994
|
-
|
|
19995
|
-
|
|
19996
|
-
|
|
19736
|
+
return /* @__PURE__ */ jsx20(
|
|
19737
|
+
"button",
|
|
19738
|
+
{
|
|
19739
|
+
type: "button",
|
|
19740
|
+
onClick,
|
|
19741
|
+
disabled,
|
|
19742
|
+
style: {
|
|
19743
|
+
height: 28,
|
|
19744
|
+
padding: "0 10px",
|
|
19745
|
+
display: "inline-flex",
|
|
19746
|
+
alignItems: "center",
|
|
19747
|
+
gap: 4,
|
|
19748
|
+
borderRadius: 999,
|
|
19749
|
+
border: "none",
|
|
19750
|
+
cursor: disabled ? "default" : "pointer",
|
|
19751
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19752
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19753
|
+
opacity: disabled ? 0.4 : 1,
|
|
19754
|
+
fontSize: 12,
|
|
19755
|
+
lineHeight: "16px",
|
|
19756
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19757
|
+
whiteSpace: "nowrap",
|
|
19758
|
+
flex: "0 0 auto"
|
|
19759
|
+
},
|
|
19760
|
+
children: label
|
|
19761
|
+
}
|
|
19762
|
+
);
|
|
19997
19763
|
}
|
|
19998
|
-
function
|
|
19999
|
-
|
|
20000
|
-
value,
|
|
20001
|
-
|
|
20002
|
-
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20009
|
-
"
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20017
|
-
|
|
20018
|
-
|
|
20019
|
-
) }),
|
|
20020
|
-
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
20021
|
-
const selected = option.value === value;
|
|
20022
|
-
return /* @__PURE__ */ jsxs12(
|
|
20023
|
-
DropdownMenuItem,
|
|
19764
|
+
function AltInput({ value, onCommit }) {
|
|
19765
|
+
const [draft, setDraft] = useState8(value);
|
|
19766
|
+
useEffect9(() => setDraft(value), [value]);
|
|
19767
|
+
return /* @__PURE__ */ jsxs11(
|
|
19768
|
+
"div",
|
|
19769
|
+
{
|
|
19770
|
+
style: {
|
|
19771
|
+
display: "flex",
|
|
19772
|
+
alignItems: "center",
|
|
19773
|
+
gap: 6,
|
|
19774
|
+
height: 28,
|
|
19775
|
+
padding: "0 12px",
|
|
19776
|
+
borderRadius: 999,
|
|
19777
|
+
background: "#ffffff",
|
|
19778
|
+
width: "100%",
|
|
19779
|
+
maxWidth: 260,
|
|
19780
|
+
boxSizing: "border-box"
|
|
19781
|
+
},
|
|
19782
|
+
children: [
|
|
19783
|
+
/* @__PURE__ */ jsx20(
|
|
19784
|
+
"span",
|
|
20024
19785
|
{
|
|
20025
|
-
|
|
20026
|
-
|
|
20027
|
-
|
|
20028
|
-
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
)
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
19786
|
+
style: {
|
|
19787
|
+
flex: "0 0 auto",
|
|
19788
|
+
color: OHW_BLUE_DARK,
|
|
19789
|
+
fontSize: 10,
|
|
19790
|
+
fontWeight: 700,
|
|
19791
|
+
textTransform: "uppercase",
|
|
19792
|
+
letterSpacing: 0.4
|
|
19793
|
+
},
|
|
19794
|
+
children: "Alt"
|
|
19795
|
+
}
|
|
19796
|
+
),
|
|
19797
|
+
/* @__PURE__ */ jsx20(
|
|
19798
|
+
"input",
|
|
19799
|
+
{
|
|
19800
|
+
type: "text",
|
|
19801
|
+
value: draft,
|
|
19802
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19803
|
+
onBlur: () => {
|
|
19804
|
+
if (draft !== value) onCommit(draft);
|
|
19805
|
+
},
|
|
19806
|
+
onKeyDown: (e) => {
|
|
19807
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19808
|
+
if (e.key === "Escape") {
|
|
19809
|
+
setDraft(value);
|
|
19810
|
+
e.currentTarget.blur();
|
|
19811
|
+
}
|
|
19812
|
+
},
|
|
19813
|
+
placeholder: "Describe this image",
|
|
19814
|
+
"aria-label": "Image alt text",
|
|
19815
|
+
style: {
|
|
19816
|
+
flex: 1,
|
|
19817
|
+
minWidth: 0,
|
|
19818
|
+
border: "none",
|
|
19819
|
+
outline: "none",
|
|
19820
|
+
background: "transparent",
|
|
19821
|
+
fontSize: 12,
|
|
19822
|
+
lineHeight: "16px",
|
|
19823
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19824
|
+
color: "#1f2937"
|
|
19825
|
+
}
|
|
19826
|
+
}
|
|
19827
|
+
)
|
|
19828
|
+
]
|
|
19829
|
+
}
|
|
19830
|
+
);
|
|
20039
19831
|
}
|
|
20040
19832
|
var VARIANTS = [
|
|
20041
19833
|
{ value: "logos", label: "Logos" },
|
|
20042
19834
|
{ value: "reel", label: "Reel" }
|
|
20043
19835
|
];
|
|
20044
19836
|
var ALIGNS = [
|
|
20045
|
-
{ value: "left", label: "
|
|
20046
|
-
{ value: "center", label: "
|
|
20047
|
-
{ value: "right", label: "
|
|
19837
|
+
{ value: "left", label: "Left" },
|
|
19838
|
+
{ value: "center", label: "Center" },
|
|
19839
|
+
{ value: "right", label: "Right" }
|
|
20048
19840
|
];
|
|
20049
19841
|
var HOVERS = [
|
|
20050
19842
|
{ value: "none", label: "None" },
|
|
@@ -20052,104 +19844,104 @@ var HOVERS = [
|
|
|
20052
19844
|
{ value: "zoom", label: "Zoom" },
|
|
20053
19845
|
{ value: "fade", label: "Fade" }
|
|
20054
19846
|
];
|
|
19847
|
+
var TREATMENTS = [
|
|
19848
|
+
{ value: "color", label: "Color" },
|
|
19849
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
19850
|
+
];
|
|
20055
19851
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
20056
|
-
function
|
|
20057
|
-
|
|
20058
|
-
linkTarget,
|
|
20059
|
-
onClose,
|
|
20060
|
-
onSave
|
|
20061
|
-
}) {
|
|
20062
|
-
const [draft, setDraft] = useState8(href);
|
|
20063
|
-
const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
|
|
19852
|
+
function LinkInput({ value, onCommit }) {
|
|
19853
|
+
const [draft, setDraft] = useState8(value);
|
|
20064
19854
|
const [invalid, setInvalid] = useState8(false);
|
|
20065
|
-
|
|
19855
|
+
useEffect9(() => {
|
|
19856
|
+
setDraft(value);
|
|
19857
|
+
setInvalid(false);
|
|
19858
|
+
}, [value]);
|
|
19859
|
+
const commit2 = () => {
|
|
20066
19860
|
const next = draft.trim();
|
|
20067
|
-
if (next
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20071
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
20072
|
-
onClose();
|
|
19861
|
+
if (next === value) return setInvalid(false);
|
|
19862
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
19863
|
+
setInvalid(false);
|
|
19864
|
+
onCommit(next);
|
|
20073
19865
|
};
|
|
20074
|
-
return /* @__PURE__ */
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
20078
|
-
"
|
|
20079
|
-
|
|
20080
|
-
|
|
20081
|
-
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
|
|
20088
|
-
|
|
20089
|
-
|
|
20090
|
-
|
|
20091
|
-
|
|
20092
|
-
"
|
|
20093
|
-
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20097
|
-
|
|
20098
|
-
|
|
20099
|
-
|
|
20100
|
-
|
|
20101
|
-
|
|
20102
|
-
|
|
20103
|
-
|
|
20104
|
-
|
|
20105
|
-
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
|
|
20131
|
-
|
|
20132
|
-
|
|
20133
|
-
|
|
20134
|
-
|
|
20135
|
-
|
|
20136
|
-
|
|
20137
|
-
|
|
20138
|
-
|
|
19866
|
+
return /* @__PURE__ */ jsxs11(
|
|
19867
|
+
"div",
|
|
19868
|
+
{
|
|
19869
|
+
style: {
|
|
19870
|
+
display: "flex",
|
|
19871
|
+
alignItems: "center",
|
|
19872
|
+
gap: 6,
|
|
19873
|
+
height: 28,
|
|
19874
|
+
padding: "0 12px",
|
|
19875
|
+
borderRadius: 999,
|
|
19876
|
+
background: "#ffffff",
|
|
19877
|
+
width: "100%",
|
|
19878
|
+
maxWidth: 260,
|
|
19879
|
+
boxSizing: "border-box",
|
|
19880
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19881
|
+
},
|
|
19882
|
+
children: [
|
|
19883
|
+
/* @__PURE__ */ jsx20(
|
|
19884
|
+
"span",
|
|
19885
|
+
{
|
|
19886
|
+
style: {
|
|
19887
|
+
flex: "0 0 auto",
|
|
19888
|
+
color: OHW_BLUE_DARK,
|
|
19889
|
+
fontSize: 10,
|
|
19890
|
+
fontWeight: 700,
|
|
19891
|
+
textTransform: "uppercase",
|
|
19892
|
+
letterSpacing: 0.4
|
|
19893
|
+
},
|
|
19894
|
+
children: "Link"
|
|
19895
|
+
}
|
|
19896
|
+
),
|
|
19897
|
+
/* @__PURE__ */ jsx20(
|
|
19898
|
+
"input",
|
|
19899
|
+
{
|
|
19900
|
+
type: "text",
|
|
19901
|
+
inputMode: "url",
|
|
19902
|
+
value: draft,
|
|
19903
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19904
|
+
onBlur: commit2,
|
|
19905
|
+
onKeyDown: (e) => {
|
|
19906
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19907
|
+
if (e.key === "Escape") {
|
|
19908
|
+
setDraft(value);
|
|
19909
|
+
setInvalid(false);
|
|
19910
|
+
e.currentTarget.blur();
|
|
19911
|
+
}
|
|
19912
|
+
},
|
|
19913
|
+
placeholder: "https://example.com",
|
|
19914
|
+
"aria-label": "Image link URL",
|
|
19915
|
+
"aria-invalid": invalid,
|
|
19916
|
+
style: {
|
|
19917
|
+
flex: 1,
|
|
19918
|
+
minWidth: 0,
|
|
19919
|
+
border: "none",
|
|
19920
|
+
outline: "none",
|
|
19921
|
+
background: "transparent",
|
|
19922
|
+
fontSize: 12,
|
|
19923
|
+
lineHeight: "16px",
|
|
19924
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19925
|
+
color: "#1f2937"
|
|
19926
|
+
}
|
|
19927
|
+
}
|
|
19928
|
+
)
|
|
19929
|
+
]
|
|
19930
|
+
}
|
|
19931
|
+
);
|
|
20139
19932
|
}
|
|
20140
19933
|
function MediaStripToolbar({
|
|
20141
19934
|
entry,
|
|
20142
19935
|
index,
|
|
20143
19936
|
pending,
|
|
20144
19937
|
error,
|
|
20145
|
-
itemEditOn,
|
|
20146
|
-
onToggleItemEdit,
|
|
20147
19938
|
onSetVariant,
|
|
20148
19939
|
onSetAlign,
|
|
20149
19940
|
onSetHover,
|
|
20150
19941
|
onSetTreatment,
|
|
20151
19942
|
onResize,
|
|
20152
|
-
|
|
19943
|
+
onSetAlt,
|
|
19944
|
+
onSetLink,
|
|
20153
19945
|
onAddItem,
|
|
20154
19946
|
onRemoveItem,
|
|
20155
19947
|
onChangeImage,
|
|
@@ -20158,102 +19950,81 @@ function MediaStripToolbar({
|
|
|
20158
19950
|
}) {
|
|
20159
19951
|
const items = mediaStripItems(entry.tree);
|
|
20160
19952
|
const itemCount = items.length;
|
|
19953
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
19954
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
19955
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
20161
19956
|
const slots = findMediaStripSlots(entry.tree);
|
|
20162
19957
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
20163
19958
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
20164
19959
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
20165
19960
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
20166
19961
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
20167
|
-
const
|
|
20168
|
-
const
|
|
20169
|
-
|
|
19962
|
+
const isMobile = window.innerWidth <= 480;
|
|
19963
|
+
const rowStyle = isMobile ? {
|
|
19964
|
+
display: "flex",
|
|
19965
|
+
gap: 6,
|
|
19966
|
+
flexWrap: "nowrap",
|
|
19967
|
+
justifyContent: "center",
|
|
19968
|
+
overflowX: "auto",
|
|
19969
|
+
WebkitOverflowScrolling: "touch",
|
|
19970
|
+
width: "100%",
|
|
19971
|
+
scrollbarWidth: "none"
|
|
19972
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19973
|
+
return /* @__PURE__ */ jsxs11(
|
|
20170
19974
|
"div",
|
|
20171
19975
|
{
|
|
20172
19976
|
"data-ohw-bridge": "",
|
|
20173
19977
|
"data-ohw-toolbar": "",
|
|
20174
19978
|
onMouseDown: (e) => e.stopPropagation(),
|
|
20175
|
-
|
|
20176
|
-
|
|
19979
|
+
style: {
|
|
19980
|
+
display: "flex",
|
|
19981
|
+
flexDirection: "column",
|
|
19982
|
+
gap: 6,
|
|
19983
|
+
alignItems: "center",
|
|
19984
|
+
background: OHW_BLUE,
|
|
19985
|
+
padding: 8,
|
|
19986
|
+
borderRadius: 12,
|
|
19987
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19988
|
+
pointerEvents: pending ? "none" : "auto",
|
|
19989
|
+
opacity: pending ? 0.6 : 1,
|
|
19990
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19991
|
+
},
|
|
20177
19992
|
children: [
|
|
20178
|
-
/* @__PURE__ */
|
|
20179
|
-
|
|
20180
|
-
{
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
) }),
|
|
20211
|
-
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
20212
|
-
] }),
|
|
20213
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20214
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20215
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20216
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20217
|
-
/* @__PURE__ */ jsx21(
|
|
20218
|
-
ToolbarAction,
|
|
20219
|
-
{
|
|
20220
|
-
label: gatedLabel("Move right"),
|
|
20221
|
-
onClick: onMoveRight,
|
|
20222
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
20223
|
-
children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
|
|
20224
|
-
}
|
|
20225
|
-
),
|
|
20226
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20227
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20228
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
20229
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
20230
|
-
/* @__PURE__ */ jsx21(
|
|
20231
|
-
ToolbarAction,
|
|
20232
|
-
{
|
|
20233
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
20234
|
-
active: treatment === "grayscale",
|
|
20235
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
20236
|
-
children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
20237
|
-
}
|
|
20238
|
-
),
|
|
20239
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20240
|
-
ALIGNS.map(({ value, label, Icon }) => /* @__PURE__ */ jsx21(ToolbarAction, { label, active: align === value, onClick: () => onSetAlign(value), children: /* @__PURE__ */ jsx21(Icon, { size: 16, style: { pointerEvents: "none" } }) }, value)),
|
|
20241
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20242
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20243
|
-
/* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
20244
|
-
sizeValue,
|
|
20245
|
-
"px"
|
|
20246
|
-
] }),
|
|
20247
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20248
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20249
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
20250
|
-
]
|
|
20251
|
-
}
|
|
20252
|
-
),
|
|
20253
|
-
error && /* @__PURE__ */ jsx21("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
|
|
19993
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19994
|
+
VARIANTS.map((v) => /* @__PURE__ */ jsx20(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
19995
|
+
ALIGNS.map((a) => /* @__PURE__ */ jsx20(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
19996
|
+
] }),
|
|
19997
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19998
|
+
HOVERS.map((h) => /* @__PURE__ */ jsx20(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
19999
|
+
TREATMENTS.map((t) => /* @__PURE__ */ jsx20(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
20000
|
+
] }),
|
|
20001
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
20002
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
20003
|
+
/* @__PURE__ */ jsxs11("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
20004
|
+
sizeValue,
|
|
20005
|
+
"px"
|
|
20006
|
+
] }),
|
|
20007
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+", onClick: () => onResize(8) })
|
|
20008
|
+
] }),
|
|
20009
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
|
|
20010
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
|
|
20011
|
+
currentHref2 && /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
20012
|
+
/* @__PURE__ */ jsx20(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
20013
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
20014
|
+
] }),
|
|
20015
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
20016
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
20017
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
20018
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
20019
|
+
] }),
|
|
20020
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
20021
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
20022
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
20023
|
+
] }),
|
|
20024
|
+
error && /* @__PURE__ */ jsx20("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20254
20025
|
]
|
|
20255
20026
|
}
|
|
20256
|
-
)
|
|
20027
|
+
);
|
|
20257
20028
|
}
|
|
20258
20029
|
function findMediaStripSlots(tree) {
|
|
20259
20030
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -20272,23 +20043,31 @@ function AiMediaStripOverlay({
|
|
|
20272
20043
|
}) {
|
|
20273
20044
|
const [hover, setHover] = useState8(null);
|
|
20274
20045
|
const [active, setActive] = useState8(null);
|
|
20275
|
-
const [itemEditOn, setItemEditOn] = useState8(false);
|
|
20276
|
-
const [linkOpen, setLinkOpen] = useState8(false);
|
|
20277
20046
|
const [pending, setPending] = useState8(false);
|
|
20278
20047
|
const [error, setError] = useState8(null);
|
|
20279
20048
|
const activeRef = useRef5(null);
|
|
20280
20049
|
activeRef.current = active;
|
|
20281
|
-
const linkOpenRef = useRef5(false);
|
|
20282
|
-
linkOpenRef.current = linkOpen;
|
|
20283
20050
|
useEffect9(() => {
|
|
20284
20051
|
const onMove = (e) => {
|
|
20285
|
-
const ref = itemRefFromTarget(e.target);
|
|
20286
20052
|
const t = e.target;
|
|
20287
|
-
|
|
20288
|
-
|
|
20289
|
-
|
|
20290
|
-
|
|
20291
|
-
|
|
20053
|
+
if (!(t instanceof HTMLElement)) return;
|
|
20054
|
+
if (t.closest("[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review]")) {
|
|
20055
|
+
return;
|
|
20056
|
+
}
|
|
20057
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
20058
|
+
if (!itemEl) {
|
|
20059
|
+
setHover(null);
|
|
20060
|
+
return;
|
|
20061
|
+
}
|
|
20062
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
20063
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
20064
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
20065
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
20066
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
20067
|
+
setHover(null);
|
|
20068
|
+
return;
|
|
20069
|
+
}
|
|
20070
|
+
setHover({ sectionId, index });
|
|
20292
20071
|
};
|
|
20293
20072
|
const onLeave = () => setHover(null);
|
|
20294
20073
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -20300,25 +20079,23 @@ function AiMediaStripOverlay({
|
|
|
20300
20079
|
}, []);
|
|
20301
20080
|
useEffect9(() => {
|
|
20302
20081
|
const onClick = (e) => {
|
|
20082
|
+
const current = activeRef.current;
|
|
20083
|
+
if (!current) return;
|
|
20303
20084
|
const t = e.target;
|
|
20304
|
-
if (!(t instanceof
|
|
20305
|
-
if (t.closest(
|
|
20306
|
-
const
|
|
20307
|
-
if (
|
|
20308
|
-
|
|
20309
|
-
setItemEditOn(false);
|
|
20085
|
+
if (!(t instanceof HTMLElement)) return;
|
|
20086
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
20087
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
20088
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
20089
|
+
setActive(null);
|
|
20310
20090
|
setError(null);
|
|
20311
|
-
setActive(ref);
|
|
20312
20091
|
};
|
|
20313
20092
|
document.addEventListener("click", onClick, true);
|
|
20314
20093
|
return () => document.removeEventListener("click", onClick, true);
|
|
20315
|
-
}, [
|
|
20094
|
+
}, []);
|
|
20316
20095
|
useEffect9(() => {
|
|
20317
20096
|
const onBlur = () => {
|
|
20318
20097
|
if (!activeRef.current) return;
|
|
20319
20098
|
setActive(null);
|
|
20320
|
-
setItemEditOn(false);
|
|
20321
|
-
setLinkOpen(false);
|
|
20322
20099
|
setError(null);
|
|
20323
20100
|
};
|
|
20324
20101
|
window.addEventListener("blur", onBlur);
|
|
@@ -20328,10 +20105,7 @@ function AiMediaStripOverlay({
|
|
|
20328
20105
|
const onKeyDown = (e) => {
|
|
20329
20106
|
if (e.key !== "Escape") return;
|
|
20330
20107
|
if (!activeRef.current) return;
|
|
20331
|
-
if (linkOpenRef.current) return;
|
|
20332
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
20333
20108
|
setActive(null);
|
|
20334
|
-
setItemEditOn(false);
|
|
20335
20109
|
setError(null);
|
|
20336
20110
|
};
|
|
20337
20111
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -20365,133 +20139,137 @@ function AiMediaStripOverlay({
|
|
|
20365
20139
|
tree: nextTree,
|
|
20366
20140
|
label: entry.label,
|
|
20367
20141
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
20368
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
20369
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
20370
|
-
// on every edit reads as the section jumping around.
|
|
20371
|
-
skipScrollIntoView: true
|
|
20142
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
20372
20143
|
});
|
|
20373
20144
|
return true;
|
|
20374
20145
|
},
|
|
20375
20146
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
20376
20147
|
);
|
|
20377
20148
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20149
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
20378
20150
|
const activeItemRect = useLiveItemRect(active);
|
|
20379
|
-
const
|
|
20380
|
-
const
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20388
|
-
|
|
20389
|
-
|
|
20390
|
-
|
|
20391
|
-
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
|
|
20401
|
-
|
|
20402
|
-
|
|
20403
|
-
|
|
20404
|
-
|
|
20405
|
-
|
|
20406
|
-
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
|
|
20411
|
-
|
|
20412
|
-
|
|
20151
|
+
const TOOLBAR_APPROX_H = 170;
|
|
20152
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
20153
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
20154
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx20(
|
|
20155
|
+
"button",
|
|
20156
|
+
{
|
|
20157
|
+
type: "button",
|
|
20158
|
+
"data-ohw-toolbar": "",
|
|
20159
|
+
onClick: () => {
|
|
20160
|
+
clearInteractionChromeRef.current();
|
|
20161
|
+
setActive(hover);
|
|
20162
|
+
},
|
|
20163
|
+
"aria-label": "Configure media item",
|
|
20164
|
+
style: {
|
|
20165
|
+
position: "fixed",
|
|
20166
|
+
top: hoverHandleRect.top + 8,
|
|
20167
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
20168
|
+
width: 28,
|
|
20169
|
+
height: 28,
|
|
20170
|
+
borderRadius: 8,
|
|
20171
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
20172
|
+
background: "#ffffff",
|
|
20173
|
+
color: PRIMARY3,
|
|
20174
|
+
display: "flex",
|
|
20175
|
+
alignItems: "center",
|
|
20176
|
+
justifyContent: "center",
|
|
20177
|
+
cursor: "pointer",
|
|
20178
|
+
zIndex: 2147483643,
|
|
20179
|
+
fontSize: 14,
|
|
20180
|
+
fontWeight: 700
|
|
20181
|
+
},
|
|
20182
|
+
children: /* @__PURE__ */ jsx20(Star, { size: 14, style: { pointerEvents: "none" } })
|
|
20183
|
+
}
|
|
20184
|
+
),
|
|
20185
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
|
|
20186
|
+
ItemInteractionLayer,
|
|
20187
|
+
{
|
|
20188
|
+
rect: activeItemRect,
|
|
20189
|
+
state: toolbarState,
|
|
20190
|
+
toolbar: /* @__PURE__ */ jsx20(
|
|
20191
|
+
MediaStripToolbar,
|
|
20192
|
+
{
|
|
20193
|
+
entry: activeEntry,
|
|
20194
|
+
index: active.index,
|
|
20195
|
+
pending,
|
|
20196
|
+
error,
|
|
20197
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
20198
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
20199
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
20200
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
20201
|
+
onResize: (delta) => {
|
|
20202
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
20203
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
20204
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
20205
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
20206
|
+
},
|
|
20207
|
+
onSetAlt: (alt) => {
|
|
20208
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
20209
|
+
},
|
|
20210
|
+
onSetLink: (href, linkTarget) => {
|
|
20413
20211
|
void runMutation(
|
|
20414
20212
|
active.sectionId,
|
|
20415
|
-
(tree) =>
|
|
20416
|
-
|
|
20417
|
-
|
|
20418
|
-
|
|
20213
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
20214
|
+
);
|
|
20215
|
+
},
|
|
20216
|
+
onAddItem: () => {
|
|
20217
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
20218
|
+
if (!picked) return;
|
|
20219
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
20220
|
+
void runMutation(
|
|
20221
|
+
active.sectionId,
|
|
20222
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
20223
|
+
{ [picked.assetId]: picked.url }
|
|
20224
|
+
).then((applied) => {
|
|
20225
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20226
|
+
});
|
|
20419
20227
|
});
|
|
20420
|
-
}
|
|
20421
|
-
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20228
|
+
},
|
|
20229
|
+
onChangeImage: () => {
|
|
20230
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
20231
|
+
if (!picked) return;
|
|
20232
|
+
void runMutation(
|
|
20233
|
+
active.sectionId,
|
|
20234
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
20235
|
+
{ [picked.assetId]: picked.url }
|
|
20236
|
+
);
|
|
20237
|
+
});
|
|
20238
|
+
},
|
|
20239
|
+
onRemoveItem: () => {
|
|
20240
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
20241
|
+
(applied) => {
|
|
20242
|
+
if (applied) setActive(null);
|
|
20243
|
+
}
|
|
20429
20244
|
);
|
|
20430
|
-
}
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
},
|
|
20446
|
-
onMoveRight: () => {
|
|
20447
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
20448
|
-
(applied) => {
|
|
20449
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20450
|
-
}
|
|
20451
|
-
);
|
|
20452
|
-
}
|
|
20453
|
-
}
|
|
20454
|
-
) }),
|
|
20455
|
-
/* @__PURE__ */ jsx21(
|
|
20456
|
-
"div",
|
|
20457
|
-
{
|
|
20458
|
-
"data-ohw-bridge": "",
|
|
20459
|
-
"data-ohw-item-interaction": "",
|
|
20460
|
-
"aria-hidden": true,
|
|
20461
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
20462
|
-
style: {
|
|
20463
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
20464
|
-
left: activeItemRect.left - 5,
|
|
20465
|
-
background: PRIMARY3,
|
|
20466
|
-
zIndex: 2147483644
|
|
20467
|
-
},
|
|
20468
|
-
children: "Media item"
|
|
20469
|
-
}
|
|
20470
|
-
),
|
|
20471
|
-
linkOpen && /* @__PURE__ */ jsx21(
|
|
20472
|
-
LinkModal,
|
|
20473
|
-
{
|
|
20474
|
-
href: activeHref,
|
|
20475
|
-
linkTarget: activeTarget,
|
|
20476
|
-
onClose: () => setLinkOpen(false),
|
|
20477
|
-
onSave: (href, linkTarget) => {
|
|
20478
|
-
void runMutation(
|
|
20479
|
-
active.sectionId,
|
|
20480
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
20481
|
-
);
|
|
20245
|
+
},
|
|
20246
|
+
onMoveLeft: () => {
|
|
20247
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
20248
|
+
(applied) => {
|
|
20249
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
20250
|
+
}
|
|
20251
|
+
);
|
|
20252
|
+
},
|
|
20253
|
+
onMoveRight: () => {
|
|
20254
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
20255
|
+
(applied) => {
|
|
20256
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20257
|
+
}
|
|
20258
|
+
);
|
|
20259
|
+
}
|
|
20482
20260
|
}
|
|
20483
|
-
|
|
20484
|
-
|
|
20485
|
-
|
|
20261
|
+
)
|
|
20262
|
+
}
|
|
20263
|
+
)
|
|
20486
20264
|
] });
|
|
20487
20265
|
}
|
|
20488
20266
|
|
|
20489
20267
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
20490
|
-
import { useCallback as useCallback4, useEffect as useEffect10, useLayoutEffect as
|
|
20491
|
-
import { Check as
|
|
20492
|
-
import { Fragment as Fragment8, jsx as
|
|
20268
|
+
import { useCallback as useCallback4, useEffect as useEffect10, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState9 } from "react";
|
|
20269
|
+
import { Check as Check2, ChevronDown as ChevronDown3, Minus, Plus as Plus2, Star as Star2 } from "lucide-react";
|
|
20270
|
+
import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
20493
20271
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
20494
|
-
var
|
|
20272
|
+
var CHROME_SELECTOR = "[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review], [data-ohw-more-menu]";
|
|
20495
20273
|
function findPricingCardElement(sectionId, index) {
|
|
20496
20274
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
20497
20275
|
if (!sectionEl2) return null;
|
|
@@ -20503,7 +20281,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
20503
20281
|
}
|
|
20504
20282
|
function cardRefFromTarget(target) {
|
|
20505
20283
|
if (!(target instanceof Element)) return null;
|
|
20506
|
-
if (target.closest(
|
|
20284
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
20507
20285
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
20508
20286
|
if (!cardEl) return null;
|
|
20509
20287
|
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
@@ -20513,21 +20291,21 @@ function cardRefFromTarget(target) {
|
|
|
20513
20291
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
20514
20292
|
return { sectionId, index };
|
|
20515
20293
|
}
|
|
20516
|
-
function
|
|
20294
|
+
function sameRef(a, b) {
|
|
20517
20295
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
20518
20296
|
}
|
|
20519
|
-
function
|
|
20297
|
+
function rectOf(el) {
|
|
20520
20298
|
if (!el) return null;
|
|
20521
20299
|
const r2 = el.getBoundingClientRect();
|
|
20522
20300
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
20523
20301
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
20524
20302
|
}
|
|
20525
20303
|
function readRect3(ref) {
|
|
20526
|
-
return
|
|
20304
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
20527
20305
|
}
|
|
20528
20306
|
function readGridRect(ref) {
|
|
20529
20307
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
20530
|
-
return
|
|
20308
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
20531
20309
|
}
|
|
20532
20310
|
function useLiveCardRect(ref, grid = false) {
|
|
20533
20311
|
const [rect, setRect] = useState9(null);
|
|
@@ -20557,19 +20335,19 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
20557
20335
|
}
|
|
20558
20336
|
var TOOLBAR_GRID_GAP = 52;
|
|
20559
20337
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
20560
|
-
var
|
|
20338
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
20561
20339
|
function GridToolbarSlot({ gridRect, children }) {
|
|
20562
20340
|
const slotRef = useRef6(null);
|
|
20563
20341
|
const [shift, setShift] = useState9(0);
|
|
20564
20342
|
const centerX = gridRect.left + gridRect.width / 2;
|
|
20565
|
-
|
|
20343
|
+
useLayoutEffect4(() => {
|
|
20566
20344
|
const slot = slotRef.current;
|
|
20567
20345
|
if (!slot) return;
|
|
20568
20346
|
const clamp = () => {
|
|
20569
20347
|
const w = slot.offsetWidth;
|
|
20570
20348
|
if (w <= 0) return;
|
|
20571
20349
|
const half = w / 2;
|
|
20572
|
-
const clamped = Math.max(
|
|
20350
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
20573
20351
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
20574
20352
|
};
|
|
20575
20353
|
clamp();
|
|
@@ -20578,7 +20356,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20578
20356
|
return () => ro.disconnect();
|
|
20579
20357
|
}, [centerX, children]);
|
|
20580
20358
|
const mobile = window.innerWidth <= 480;
|
|
20581
|
-
return /* @__PURE__ */
|
|
20359
|
+
return /* @__PURE__ */ jsx21(
|
|
20582
20360
|
"div",
|
|
20583
20361
|
{
|
|
20584
20362
|
ref: slotRef,
|
|
@@ -20613,7 +20391,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
20613
20391
|
});
|
|
20614
20392
|
}
|
|
20615
20393
|
function StyleSwatch({ style }) {
|
|
20616
|
-
return /* @__PURE__ */
|
|
20394
|
+
return /* @__PURE__ */ jsx21(
|
|
20617
20395
|
"span",
|
|
20618
20396
|
{
|
|
20619
20397
|
"aria-hidden": true,
|
|
@@ -20627,35 +20405,35 @@ function StyleSwatch({ style }) {
|
|
|
20627
20405
|
);
|
|
20628
20406
|
}
|
|
20629
20407
|
function ButtonGlyph() {
|
|
20630
|
-
return /* @__PURE__ */
|
|
20631
|
-
/* @__PURE__ */
|
|
20632
|
-
/* @__PURE__ */
|
|
20408
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
20409
|
+
/* @__PURE__ */ jsx21("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
20410
|
+
/* @__PURE__ */ jsx21("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20633
20411
|
] });
|
|
20634
20412
|
}
|
|
20635
20413
|
function FeatureGlyph({ mode }) {
|
|
20636
|
-
return /* @__PURE__ */
|
|
20637
|
-
/* @__PURE__ */
|
|
20638
|
-
/* @__PURE__ */
|
|
20639
|
-
/* @__PURE__ */
|
|
20640
|
-
/* @__PURE__ */
|
|
20641
|
-
/* @__PURE__ */
|
|
20642
|
-
mode === "add" && /* @__PURE__ */
|
|
20414
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
20415
|
+
/* @__PURE__ */ jsx21("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
20416
|
+
/* @__PURE__ */ jsx21("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
20417
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
|
|
20418
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
|
|
20419
|
+
/* @__PURE__ */ jsx21("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
20420
|
+
mode === "add" && /* @__PURE__ */ jsx21("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20643
20421
|
] });
|
|
20644
20422
|
}
|
|
20645
|
-
function
|
|
20423
|
+
function ToolbarAction({
|
|
20646
20424
|
label,
|
|
20647
20425
|
onClick,
|
|
20648
20426
|
disabled = false,
|
|
20649
20427
|
children
|
|
20650
20428
|
}) {
|
|
20651
|
-
const button = /* @__PURE__ */
|
|
20652
|
-
return /* @__PURE__ */
|
|
20653
|
-
/* @__PURE__ */
|
|
20654
|
-
/* @__PURE__ */
|
|
20429
|
+
const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
20430
|
+
return /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
20431
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
|
|
20432
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
20655
20433
|
] });
|
|
20656
20434
|
}
|
|
20657
|
-
function
|
|
20658
|
-
return /* @__PURE__ */
|
|
20435
|
+
function ToolbarSeparator() {
|
|
20436
|
+
return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
20659
20437
|
}
|
|
20660
20438
|
function CardStyleMenu({
|
|
20661
20439
|
value,
|
|
@@ -20663,7 +20441,7 @@ function CardStyleMenu({
|
|
|
20663
20441
|
disabled = false
|
|
20664
20442
|
}) {
|
|
20665
20443
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
20666
|
-
const trigger = /* @__PURE__ */
|
|
20444
|
+
const trigger = /* @__PURE__ */ jsxs12(
|
|
20667
20445
|
"button",
|
|
20668
20446
|
{
|
|
20669
20447
|
type: "button",
|
|
@@ -20674,28 +20452,28 @@ function CardStyleMenu({
|
|
|
20674
20452
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
20675
20453
|
),
|
|
20676
20454
|
children: [
|
|
20677
|
-
/* @__PURE__ */
|
|
20678
|
-
/* @__PURE__ */
|
|
20679
|
-
/* @__PURE__ */
|
|
20455
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: current.value }),
|
|
20456
|
+
/* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
|
|
20457
|
+
/* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
|
|
20680
20458
|
]
|
|
20681
20459
|
}
|
|
20682
20460
|
);
|
|
20683
20461
|
if (disabled) {
|
|
20684
|
-
return /* @__PURE__ */
|
|
20685
|
-
/* @__PURE__ */
|
|
20686
|
-
/* @__PURE__ */
|
|
20687
|
-
/* @__PURE__ */
|
|
20688
|
-
/* @__PURE__ */
|
|
20462
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20463
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
20464
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
20465
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: trigger }) }),
|
|
20466
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
20689
20467
|
] })
|
|
20690
20468
|
] });
|
|
20691
20469
|
}
|
|
20692
|
-
return /* @__PURE__ */
|
|
20693
|
-
/* @__PURE__ */
|
|
20694
|
-
/* @__PURE__ */
|
|
20695
|
-
/* @__PURE__ */
|
|
20696
|
-
/* @__PURE__ */
|
|
20470
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20471
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
20472
|
+
/* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
|
|
20473
|
+
/* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
20474
|
+
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
|
|
20697
20475
|
const selected = style.value === value;
|
|
20698
|
-
return /* @__PURE__ */
|
|
20476
|
+
return /* @__PURE__ */ jsxs12(
|
|
20699
20477
|
DropdownMenuItem,
|
|
20700
20478
|
{
|
|
20701
20479
|
role: "menuitemradio",
|
|
@@ -20703,9 +20481,9 @@ function CardStyleMenu({
|
|
|
20703
20481
|
onSelect: () => onChange(style.value),
|
|
20704
20482
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
20705
20483
|
children: [
|
|
20706
|
-
/* @__PURE__ */
|
|
20707
|
-
/* @__PURE__ */
|
|
20708
|
-
selected && /* @__PURE__ */
|
|
20484
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: style.value }),
|
|
20485
|
+
/* @__PURE__ */ jsx21("span", { children: style.label }),
|
|
20486
|
+
selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
|
|
20709
20487
|
]
|
|
20710
20488
|
},
|
|
20711
20489
|
style.value
|
|
@@ -20735,7 +20513,7 @@ function PricingCardToolbar({
|
|
|
20735
20513
|
const style = pricingCardStyle(entry.tree, index);
|
|
20736
20514
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
20737
20515
|
const mobile = window.innerWidth <= 480;
|
|
20738
|
-
return /* @__PURE__ */
|
|
20516
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
|
|
20739
20517
|
"div",
|
|
20740
20518
|
{
|
|
20741
20519
|
"data-ohw-bridge": "",
|
|
@@ -20747,7 +20525,7 @@ function PricingCardToolbar({
|
|
|
20747
20525
|
),
|
|
20748
20526
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
20749
20527
|
children: [
|
|
20750
|
-
/* @__PURE__ */
|
|
20528
|
+
/* @__PURE__ */ jsxs12(
|
|
20751
20529
|
"div",
|
|
20752
20530
|
{
|
|
20753
20531
|
className: cn(
|
|
@@ -20756,8 +20534,8 @@ function PricingCardToolbar({
|
|
|
20756
20534
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
20757
20535
|
),
|
|
20758
20536
|
children: [
|
|
20759
|
-
/* @__PURE__ */
|
|
20760
|
-
/* @__PURE__ */
|
|
20537
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
20538
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
20761
20539
|
CustomToolbarButton,
|
|
20762
20540
|
{
|
|
20763
20541
|
type: "button",
|
|
@@ -20765,7 +20543,7 @@ function PricingCardToolbar({
|
|
|
20765
20543
|
"aria-pressed": featuredTag,
|
|
20766
20544
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
20767
20545
|
className: "group size-8",
|
|
20768
|
-
children: /* @__PURE__ */
|
|
20546
|
+
children: /* @__PURE__ */ jsx21(
|
|
20769
20547
|
Star2,
|
|
20770
20548
|
{
|
|
20771
20549
|
size: 16,
|
|
@@ -20780,25 +20558,25 @@ function PricingCardToolbar({
|
|
|
20780
20558
|
)
|
|
20781
20559
|
}
|
|
20782
20560
|
) }),
|
|
20783
|
-
/* @__PURE__ */
|
|
20561
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
20784
20562
|
] }),
|
|
20785
|
-
/* @__PURE__ */
|
|
20786
|
-
/* @__PURE__ */
|
|
20787
|
-
/* @__PURE__ */
|
|
20788
|
-
/* @__PURE__ */
|
|
20789
|
-
/* @__PURE__ */
|
|
20790
|
-
/* @__PURE__ */
|
|
20791
|
-
/* @__PURE__ */
|
|
20563
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20564
|
+
/* @__PURE__ */ jsx21(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
20565
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20566
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx21(ButtonGlyph, {}) }),
|
|
20567
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
|
|
20568
|
+
/* @__PURE__ */ jsx21(ButtonGlyph, {}),
|
|
20569
|
+
/* @__PURE__ */ jsx21(Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
|
|
20792
20570
|
] }) }),
|
|
20793
|
-
/* @__PURE__ */
|
|
20794
|
-
/* @__PURE__ */
|
|
20795
|
-
/* @__PURE__ */
|
|
20796
|
-
/* @__PURE__ */
|
|
20797
|
-
/* @__PURE__ */
|
|
20571
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "add" }) }),
|
|
20572
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "remove" }) }),
|
|
20573
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
20574
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20575
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
20798
20576
|
]
|
|
20799
20577
|
}
|
|
20800
20578
|
),
|
|
20801
|
-
error && /* @__PURE__ */
|
|
20579
|
+
error && /* @__PURE__ */ jsx21("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
|
|
20802
20580
|
]
|
|
20803
20581
|
}
|
|
20804
20582
|
) });
|
|
@@ -20832,7 +20610,7 @@ function AiPricingCardOverlay({
|
|
|
20832
20610
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20833
20611
|
setHover((prev) => {
|
|
20834
20612
|
const next = ref && !overEditable ? ref : null;
|
|
20835
|
-
return
|
|
20613
|
+
return sameRef(prev, next) ? prev : next;
|
|
20836
20614
|
});
|
|
20837
20615
|
};
|
|
20838
20616
|
const onLeave = () => setHover(null);
|
|
@@ -20847,10 +20625,10 @@ function AiPricingCardOverlay({
|
|
|
20847
20625
|
const onClick = (e) => {
|
|
20848
20626
|
const t = e.target;
|
|
20849
20627
|
if (!(t instanceof Element)) return;
|
|
20850
|
-
if (t.closest(
|
|
20628
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
20851
20629
|
const ref = cardRefFromTarget(t);
|
|
20852
|
-
setActive((prev) =>
|
|
20853
|
-
if (!ref || !
|
|
20630
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
20631
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
20854
20632
|
};
|
|
20855
20633
|
document.addEventListener("click", onClick, true);
|
|
20856
20634
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20915,12 +20693,12 @@ function AiPricingCardOverlay({
|
|
|
20915
20693
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20916
20694
|
const activeCardRect = useLiveCardRect(active);
|
|
20917
20695
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20918
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20919
|
-
return /* @__PURE__ */
|
|
20920
|
-
hoverRect && /* @__PURE__ */
|
|
20921
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */
|
|
20922
|
-
/* @__PURE__ */
|
|
20923
|
-
/* @__PURE__ */
|
|
20696
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
20697
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
20698
|
+
hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
20699
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
20700
|
+
/* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
20701
|
+
/* @__PURE__ */ jsx21(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx21(
|
|
20924
20702
|
PricingCardToolbar,
|
|
20925
20703
|
{
|
|
20926
20704
|
entry: activeEntry,
|
|
@@ -20948,7 +20726,7 @@ function AiPricingCardOverlay({
|
|
|
20948
20726
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20949
20727
|
}
|
|
20950
20728
|
) }),
|
|
20951
|
-
/* @__PURE__ */
|
|
20729
|
+
/* @__PURE__ */ jsx21(
|
|
20952
20730
|
"div",
|
|
20953
20731
|
{
|
|
20954
20732
|
"data-ohw-bridge": "",
|
|
@@ -21013,10 +20791,10 @@ function clearVideo(tree, path) {
|
|
|
21013
20791
|
}
|
|
21014
20792
|
|
|
21015
20793
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
21016
|
-
import { Fragment as Fragment9, jsx as
|
|
20794
|
+
import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
21017
20795
|
var PRIMARY5 = "#0885FE";
|
|
21018
|
-
var
|
|
21019
|
-
var
|
|
20796
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20797
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
21020
20798
|
function findVideoBlockElement(sectionId, path) {
|
|
21021
20799
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21022
20800
|
if (!sectionEl2) return null;
|
|
@@ -21076,12 +20854,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
21076
20854
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
21077
20855
|
});
|
|
21078
20856
|
}
|
|
21079
|
-
function
|
|
20857
|
+
function Pill2({
|
|
21080
20858
|
label,
|
|
21081
20859
|
onClick,
|
|
21082
20860
|
disabled
|
|
21083
20861
|
}) {
|
|
21084
|
-
return /* @__PURE__ */
|
|
20862
|
+
return /* @__PURE__ */ jsx22(
|
|
21085
20863
|
"button",
|
|
21086
20864
|
{
|
|
21087
20865
|
type: "button",
|
|
@@ -21097,7 +20875,7 @@ function Pill({
|
|
|
21097
20875
|
border: "none",
|
|
21098
20876
|
cursor: disabled ? "default" : "pointer",
|
|
21099
20877
|
background: "#ffffff",
|
|
21100
|
-
color:
|
|
20878
|
+
color: OHW_BLUE_DARK2,
|
|
21101
20879
|
opacity: disabled ? 0.4 : 1,
|
|
21102
20880
|
fontSize: 12,
|
|
21103
20881
|
lineHeight: "16px",
|
|
@@ -21140,8 +20918,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
21140
20918
|
onCommit(id);
|
|
21141
20919
|
}
|
|
21142
20920
|
};
|
|
21143
|
-
return /* @__PURE__ */
|
|
21144
|
-
/* @__PURE__ */
|
|
20921
|
+
return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20922
|
+
/* @__PURE__ */ jsxs13(
|
|
21145
20923
|
"div",
|
|
21146
20924
|
{
|
|
21147
20925
|
style: {
|
|
@@ -21157,12 +20935,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
21157
20935
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
21158
20936
|
},
|
|
21159
20937
|
children: [
|
|
21160
|
-
/* @__PURE__ */
|
|
20938
|
+
/* @__PURE__ */ jsx22(
|
|
21161
20939
|
"span",
|
|
21162
20940
|
{
|
|
21163
20941
|
style: {
|
|
21164
20942
|
flex: "0 0 auto",
|
|
21165
|
-
color:
|
|
20943
|
+
color: OHW_BLUE_DARK2,
|
|
21166
20944
|
fontSize: 10,
|
|
21167
20945
|
lineHeight: "16px",
|
|
21168
20946
|
fontWeight: 700,
|
|
@@ -21172,7 +20950,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
21172
20950
|
children: "Video"
|
|
21173
20951
|
}
|
|
21174
20952
|
),
|
|
21175
|
-
/* @__PURE__ */
|
|
20953
|
+
/* @__PURE__ */ jsx22(
|
|
21176
20954
|
"input",
|
|
21177
20955
|
{
|
|
21178
20956
|
type: "text",
|
|
@@ -21209,7 +20987,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
21209
20987
|
]
|
|
21210
20988
|
}
|
|
21211
20989
|
),
|
|
21212
|
-
invalid && /* @__PURE__ */
|
|
20990
|
+
invalid && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
|
|
21213
20991
|
] });
|
|
21214
20992
|
}
|
|
21215
20993
|
function VideoToolbar({
|
|
@@ -21219,7 +20997,7 @@ function VideoToolbar({
|
|
|
21219
20997
|
onSetVideoId,
|
|
21220
20998
|
onRemove
|
|
21221
20999
|
}) {
|
|
21222
|
-
return /* @__PURE__ */
|
|
21000
|
+
return /* @__PURE__ */ jsxs13(
|
|
21223
21001
|
"div",
|
|
21224
21002
|
{
|
|
21225
21003
|
"data-ohw-bridge": "",
|
|
@@ -21231,7 +21009,7 @@ function VideoToolbar({
|
|
|
21231
21009
|
gap: 6,
|
|
21232
21010
|
alignItems: "center",
|
|
21233
21011
|
width: 280,
|
|
21234
|
-
background:
|
|
21012
|
+
background: OHW_BLUE2,
|
|
21235
21013
|
padding: 8,
|
|
21236
21014
|
borderRadius: 12,
|
|
21237
21015
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21239,9 +21017,9 @@ function VideoToolbar({
|
|
|
21239
21017
|
opacity: pending ? 0.6 : 1
|
|
21240
21018
|
},
|
|
21241
21019
|
children: [
|
|
21242
|
-
/* @__PURE__ */
|
|
21243
|
-
/* @__PURE__ */
|
|
21244
|
-
error && /* @__PURE__ */
|
|
21020
|
+
/* @__PURE__ */ jsx22(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
21021
|
+
/* @__PURE__ */ jsx22(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
21022
|
+
error && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21245
21023
|
]
|
|
21246
21024
|
}
|
|
21247
21025
|
);
|
|
@@ -21361,8 +21139,8 @@ function AiVideoOverlay({
|
|
|
21361
21139
|
const activeBlockRect = useLiveBlockRect(active);
|
|
21362
21140
|
const TOOLBAR_APPROX_H = 90;
|
|
21363
21141
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21364
|
-
return /* @__PURE__ */
|
|
21365
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
21142
|
+
return /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
21143
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx22(
|
|
21366
21144
|
"button",
|
|
21367
21145
|
{
|
|
21368
21146
|
type: "button",
|
|
@@ -21390,15 +21168,15 @@ function AiVideoOverlay({
|
|
|
21390
21168
|
fontSize: 14,
|
|
21391
21169
|
fontWeight: 700
|
|
21392
21170
|
},
|
|
21393
|
-
children: /* @__PURE__ */
|
|
21171
|
+
children: /* @__PURE__ */ jsx22(Star3, { size: 14, style: { pointerEvents: "none" } })
|
|
21394
21172
|
}
|
|
21395
21173
|
),
|
|
21396
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */
|
|
21174
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx22(
|
|
21397
21175
|
ItemInteractionLayer,
|
|
21398
21176
|
{
|
|
21399
21177
|
rect: activeBlockRect,
|
|
21400
21178
|
state: toolbarState,
|
|
21401
|
-
toolbar: /* @__PURE__ */
|
|
21179
|
+
toolbar: /* @__PURE__ */ jsx22(
|
|
21402
21180
|
VideoToolbar,
|
|
21403
21181
|
{
|
|
21404
21182
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -21473,10 +21251,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
21473
21251
|
}
|
|
21474
21252
|
|
|
21475
21253
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21476
|
-
import { Fragment as Fragment10, jsx as
|
|
21254
|
+
import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
21477
21255
|
var PRIMARY6 = "#0885FE";
|
|
21478
|
-
var
|
|
21479
|
-
var
|
|
21256
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
21257
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
21480
21258
|
function findCarouselItemElement(sectionId, index) {
|
|
21481
21259
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21482
21260
|
if (!sectionEl2) return null;
|
|
@@ -21555,8 +21333,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
21555
21333
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21556
21334
|
});
|
|
21557
21335
|
}
|
|
21558
|
-
function
|
|
21559
|
-
return /* @__PURE__ */
|
|
21336
|
+
function Pill3({ label, onClick, disabled }) {
|
|
21337
|
+
return /* @__PURE__ */ jsx23(
|
|
21560
21338
|
"button",
|
|
21561
21339
|
{
|
|
21562
21340
|
type: "button",
|
|
@@ -21572,7 +21350,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
21572
21350
|
border: "none",
|
|
21573
21351
|
cursor: disabled ? "default" : "pointer",
|
|
21574
21352
|
background: "#ffffff",
|
|
21575
|
-
color:
|
|
21353
|
+
color: OHW_BLUE_DARK3,
|
|
21576
21354
|
opacity: disabled ? 0.4 : 1,
|
|
21577
21355
|
fontSize: 12,
|
|
21578
21356
|
lineHeight: "16px",
|
|
@@ -21590,7 +21368,7 @@ function TogglePill({
|
|
|
21590
21368
|
onToggle,
|
|
21591
21369
|
disabled
|
|
21592
21370
|
}) {
|
|
21593
|
-
return /* @__PURE__ */
|
|
21371
|
+
return /* @__PURE__ */ jsxs14(
|
|
21594
21372
|
"button",
|
|
21595
21373
|
{
|
|
21596
21374
|
type: "button",
|
|
@@ -21609,7 +21387,7 @@ function TogglePill({
|
|
|
21609
21387
|
border: "none",
|
|
21610
21388
|
cursor: disabled ? "default" : "pointer",
|
|
21611
21389
|
background: "#ffffff",
|
|
21612
|
-
color:
|
|
21390
|
+
color: OHW_BLUE_DARK3,
|
|
21613
21391
|
opacity: disabled ? 0.4 : 1,
|
|
21614
21392
|
fontSize: 12,
|
|
21615
21393
|
lineHeight: "16px",
|
|
@@ -21619,7 +21397,7 @@ function TogglePill({
|
|
|
21619
21397
|
},
|
|
21620
21398
|
children: [
|
|
21621
21399
|
label,
|
|
21622
|
-
/* @__PURE__ */
|
|
21400
|
+
/* @__PURE__ */ jsx23(
|
|
21623
21401
|
"span",
|
|
21624
21402
|
{
|
|
21625
21403
|
"aria-hidden": true,
|
|
@@ -21632,10 +21410,10 @@ function TogglePill({
|
|
|
21632
21410
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
21633
21411
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
21634
21412
|
// "disabled control" rather than "switch that is off".
|
|
21635
|
-
background: on ?
|
|
21413
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
21636
21414
|
transition: "background 120ms ease"
|
|
21637
21415
|
},
|
|
21638
|
-
children: /* @__PURE__ */
|
|
21416
|
+
children: /* @__PURE__ */ jsx23(
|
|
21639
21417
|
"span",
|
|
21640
21418
|
{
|
|
21641
21419
|
style: {
|
|
@@ -21664,7 +21442,7 @@ function CarouselSlideToolbar({
|
|
|
21664
21442
|
onChangeImage,
|
|
21665
21443
|
onToggleAutoplay
|
|
21666
21444
|
}) {
|
|
21667
|
-
return /* @__PURE__ */
|
|
21445
|
+
return /* @__PURE__ */ jsxs14(
|
|
21668
21446
|
"div",
|
|
21669
21447
|
{
|
|
21670
21448
|
"data-ohw-bridge": "",
|
|
@@ -21675,7 +21453,7 @@ function CarouselSlideToolbar({
|
|
|
21675
21453
|
flexDirection: "column",
|
|
21676
21454
|
gap: 6,
|
|
21677
21455
|
alignItems: "center",
|
|
21678
|
-
background:
|
|
21456
|
+
background: OHW_BLUE3,
|
|
21679
21457
|
padding: 8,
|
|
21680
21458
|
borderRadius: 12,
|
|
21681
21459
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21687,11 +21465,11 @@ function CarouselSlideToolbar({
|
|
|
21687
21465
|
pointerEvents: pending ? "none" : "auto"
|
|
21688
21466
|
},
|
|
21689
21467
|
children: [
|
|
21690
|
-
/* @__PURE__ */
|
|
21691
|
-
/* @__PURE__ */
|
|
21692
|
-
/* @__PURE__ */
|
|
21468
|
+
/* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21469
|
+
/* @__PURE__ */ jsx23(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
21470
|
+
/* @__PURE__ */ jsx23(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
21693
21471
|
] }),
|
|
21694
|
-
error && /* @__PURE__ */
|
|
21472
|
+
error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21695
21473
|
]
|
|
21696
21474
|
}
|
|
21697
21475
|
);
|
|
@@ -21831,8 +21609,8 @@ function AiFadeCarouselOverlay({
|
|
|
21831
21609
|
const activeItemRect = useLiveItemRect2(active);
|
|
21832
21610
|
const TOOLBAR_APPROX_H = 90;
|
|
21833
21611
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21834
|
-
return /* @__PURE__ */
|
|
21835
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
21612
|
+
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
21613
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx23(
|
|
21836
21614
|
"button",
|
|
21837
21615
|
{
|
|
21838
21616
|
type: "button",
|
|
@@ -21861,10 +21639,10 @@ function AiFadeCarouselOverlay({
|
|
|
21861
21639
|
fontSize: 14,
|
|
21862
21640
|
fontWeight: 700
|
|
21863
21641
|
},
|
|
21864
|
-
children: /* @__PURE__ */
|
|
21642
|
+
children: /* @__PURE__ */ jsx23(Star4, { size: 14, style: { pointerEvents: "none" } })
|
|
21865
21643
|
}
|
|
21866
21644
|
),
|
|
21867
|
-
swapping && /* @__PURE__ */
|
|
21645
|
+
swapping && /* @__PURE__ */ jsx23(
|
|
21868
21646
|
"div",
|
|
21869
21647
|
{
|
|
21870
21648
|
ref: skeletonRef,
|
|
@@ -21882,15 +21660,15 @@ function AiFadeCarouselOverlay({
|
|
|
21882
21660
|
zIndex: 2147483646,
|
|
21883
21661
|
pointerEvents: "none"
|
|
21884
21662
|
},
|
|
21885
|
-
children: /* @__PURE__ */
|
|
21663
|
+
children: /* @__PURE__ */ jsx23("style", { children: MEDIA_SKELETON_CSS })
|
|
21886
21664
|
}
|
|
21887
21665
|
),
|
|
21888
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */
|
|
21666
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx23(
|
|
21889
21667
|
ItemInteractionLayer,
|
|
21890
21668
|
{
|
|
21891
21669
|
rect: activeItemRect,
|
|
21892
21670
|
state: toolbarState,
|
|
21893
|
-
toolbar: /* @__PURE__ */
|
|
21671
|
+
toolbar: /* @__PURE__ */ jsx23(
|
|
21894
21672
|
CarouselSlideToolbar,
|
|
21895
21673
|
{
|
|
21896
21674
|
pending,
|
|
@@ -22081,11 +21859,118 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
22081
21859
|
// src/ui/link-modal/LinkPopover.tsx
|
|
22082
21860
|
import { useEffect as useEffect16 } from "react";
|
|
22083
21861
|
|
|
21862
|
+
// src/ui/dialog.tsx
|
|
21863
|
+
import * as React9 from "react";
|
|
21864
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
21865
|
+
import { X as X2 } from "lucide-react";
|
|
21866
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
21867
|
+
function Dialog2({
|
|
21868
|
+
...props
|
|
21869
|
+
}) {
|
|
21870
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
21871
|
+
}
|
|
21872
|
+
function DialogPortal({
|
|
21873
|
+
...props
|
|
21874
|
+
}) {
|
|
21875
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
|
|
21876
|
+
}
|
|
21877
|
+
function DialogOverlay({
|
|
21878
|
+
className,
|
|
21879
|
+
...props
|
|
21880
|
+
}) {
|
|
21881
|
+
return /* @__PURE__ */ jsx24(
|
|
21882
|
+
DialogPrimitive.Overlay,
|
|
21883
|
+
{
|
|
21884
|
+
"data-slot": "dialog-overlay",
|
|
21885
|
+
"data-ohw-link-modal-root": "",
|
|
21886
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21887
|
+
...props
|
|
21888
|
+
}
|
|
21889
|
+
);
|
|
21890
|
+
}
|
|
21891
|
+
var DialogContent = React9.forwardRef(
|
|
21892
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21893
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
21894
|
+
return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
|
|
21895
|
+
/* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21896
|
+
/* @__PURE__ */ jsxs15(
|
|
21897
|
+
DialogPrimitive.Content,
|
|
21898
|
+
{
|
|
21899
|
+
ref,
|
|
21900
|
+
"data-slot": "dialog-content",
|
|
21901
|
+
className: cn(
|
|
21902
|
+
positionMode,
|
|
21903
|
+
"left-1/2 top-1/2 z-[2147483647] flex w-full max-w-[448px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-visible",
|
|
21904
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21905
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21906
|
+
className
|
|
21907
|
+
),
|
|
21908
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
21909
|
+
...props,
|
|
21910
|
+
children: [
|
|
21911
|
+
children,
|
|
21912
|
+
showCloseButton ? /* @__PURE__ */ jsx24(
|
|
21913
|
+
DialogPrimitive.Close,
|
|
21914
|
+
{
|
|
21915
|
+
type: "button",
|
|
21916
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21917
|
+
"aria-label": "Close",
|
|
21918
|
+
children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
|
|
21919
|
+
}
|
|
21920
|
+
) : null
|
|
21921
|
+
]
|
|
21922
|
+
}
|
|
21923
|
+
)
|
|
21924
|
+
] });
|
|
21925
|
+
}
|
|
21926
|
+
);
|
|
21927
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
21928
|
+
function DialogHeader({
|
|
21929
|
+
className,
|
|
21930
|
+
...props
|
|
21931
|
+
}) {
|
|
21932
|
+
return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21933
|
+
}
|
|
21934
|
+
function DialogFooter({
|
|
21935
|
+
className,
|
|
21936
|
+
...props
|
|
21937
|
+
}) {
|
|
21938
|
+
return /* @__PURE__ */ jsx24(
|
|
21939
|
+
"div",
|
|
21940
|
+
{
|
|
21941
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
21942
|
+
...props
|
|
21943
|
+
}
|
|
21944
|
+
);
|
|
21945
|
+
}
|
|
21946
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21947
|
+
DialogPrimitive.Title,
|
|
21948
|
+
{
|
|
21949
|
+
ref,
|
|
21950
|
+
className: cn(
|
|
21951
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21952
|
+
className
|
|
21953
|
+
),
|
|
21954
|
+
...props
|
|
21955
|
+
}
|
|
21956
|
+
));
|
|
21957
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
21958
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21959
|
+
DialogPrimitive.Description,
|
|
21960
|
+
{
|
|
21961
|
+
ref,
|
|
21962
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
21963
|
+
...props
|
|
21964
|
+
}
|
|
21965
|
+
));
|
|
21966
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
21967
|
+
var DialogClose = DialogPrimitive.Close;
|
|
21968
|
+
|
|
22084
21969
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
22085
21970
|
import { Info, X as X4 } from "lucide-react";
|
|
22086
21971
|
|
|
22087
21972
|
// src/ui/link-modal/DestinationBreadcrumb.tsx
|
|
22088
|
-
import { ArrowRight as
|
|
21973
|
+
import { ArrowRight as ArrowRight2, File, GalleryVertical } from "lucide-react";
|
|
22089
21974
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
22090
21975
|
function DestinationBreadcrumb({
|
|
22091
21976
|
pageTitle,
|
|
@@ -22099,7 +21984,7 @@ function DestinationBreadcrumb({
|
|
|
22099
21984
|
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
|
|
22100
21985
|
] }),
|
|
22101
21986
|
/* @__PURE__ */ jsx25(
|
|
22102
|
-
|
|
21987
|
+
ArrowRight2,
|
|
22103
21988
|
{
|
|
22104
21989
|
size: 16,
|
|
22105
21990
|
className: "shrink-0 text-muted-foreground",
|
|
@@ -22211,7 +22096,7 @@ function Label({ className, ...props }) {
|
|
|
22211
22096
|
}
|
|
22212
22097
|
|
|
22213
22098
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
22214
|
-
import { ChevronDown as
|
|
22099
|
+
import { ChevronDown as ChevronDown4, File as File2, X as X3 } from "lucide-react";
|
|
22215
22100
|
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
22216
22101
|
function FieldChevron({
|
|
22217
22102
|
onClick
|
|
@@ -22224,7 +22109,7 @@ function FieldChevron({
|
|
|
22224
22109
|
onClick,
|
|
22225
22110
|
"aria-label": "Open page list",
|
|
22226
22111
|
tabIndex: -1,
|
|
22227
|
-
children: /* @__PURE__ */ jsx29(
|
|
22112
|
+
children: /* @__PURE__ */ jsx29(ChevronDown4, { size: 16 })
|
|
22228
22113
|
}
|
|
22229
22114
|
);
|
|
22230
22115
|
}
|
|
@@ -22454,7 +22339,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
22454
22339
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
22455
22340
|
import { useCallback as useCallback7, useEffect as useEffect14, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
|
|
22456
22341
|
import { createPortal as createPortal2 } from "react-dom";
|
|
22457
|
-
import { ArrowLeft as
|
|
22342
|
+
import { ArrowLeft as ArrowLeft2, Check as Check3 } from "lucide-react";
|
|
22458
22343
|
import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
|
|
22459
22344
|
|
|
22460
22345
|
// src/lib/parent-scroll.ts
|
|
@@ -22731,7 +22616,7 @@ function SectionPickerOverlay({
|
|
|
22731
22616
|
className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
|
|
22732
22617
|
onClick: onBack,
|
|
22733
22618
|
children: [
|
|
22734
|
-
/* @__PURE__ */ jsx31(
|
|
22619
|
+
/* @__PURE__ */ jsx31(ArrowLeft2, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
22735
22620
|
"Back"
|
|
22736
22621
|
]
|
|
22737
22622
|
}
|
|
@@ -22800,7 +22685,7 @@ function SectionPickerOverlay({
|
|
|
22800
22685
|
className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
|
|
22801
22686
|
style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
|
|
22802
22687
|
"aria-hidden": true,
|
|
22803
|
-
children: /* @__PURE__ */ jsx31(
|
|
22688
|
+
children: /* @__PURE__ */ jsx31(Check3, { className: "size-5" })
|
|
22804
22689
|
}
|
|
22805
22690
|
) : null
|
|
22806
22691
|
]
|
|
@@ -23184,7 +23069,6 @@ function shouldUseDevFixtures() {
|
|
|
23184
23069
|
function getLogoElement(el) {
|
|
23185
23070
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
23186
23071
|
if (marked) return marked;
|
|
23187
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
23188
23072
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
23189
23073
|
if (!root) return null;
|
|
23190
23074
|
const anchor = el.closest("a");
|
|
@@ -23254,7 +23138,7 @@ function addFooterColumnWithPersist({
|
|
|
23254
23138
|
import {
|
|
23255
23139
|
useCallback as useCallback9,
|
|
23256
23140
|
useEffect as useEffect17,
|
|
23257
|
-
useLayoutEffect as
|
|
23141
|
+
useLayoutEffect as useLayoutEffect5,
|
|
23258
23142
|
useRef as useRef11,
|
|
23259
23143
|
useState as useState15
|
|
23260
23144
|
} from "react";
|
|
@@ -23351,7 +23235,7 @@ function FloatingPanel({
|
|
|
23351
23235
|
return () => window.removeEventListener("message", onParentScroll);
|
|
23352
23236
|
}, [open]);
|
|
23353
23237
|
const positionRef = useRef11(position);
|
|
23354
|
-
|
|
23238
|
+
useLayoutEffect5(() => {
|
|
23355
23239
|
if (!open) {
|
|
23356
23240
|
positionRef.current = position;
|
|
23357
23241
|
return;
|
|
@@ -23361,7 +23245,7 @@ function FloatingPanel({
|
|
|
23361
23245
|
}
|
|
23362
23246
|
positionRef.current = position;
|
|
23363
23247
|
}, [open, position, liveScroll, parentScroll]);
|
|
23364
|
-
|
|
23248
|
+
useLayoutEffect5(() => {
|
|
23365
23249
|
if (!open || !panelRef.current) return;
|
|
23366
23250
|
const el = panelRef.current;
|
|
23367
23251
|
const header = el.querySelector("[data-ohw-floating-panel-header]");
|
|
@@ -23570,7 +23454,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
|
|
|
23570
23454
|
}
|
|
23571
23455
|
|
|
23572
23456
|
// src/ui/button-style-panel.tsx
|
|
23573
|
-
import { Check as
|
|
23457
|
+
import { Check as Check4 } from "lucide-react";
|
|
23574
23458
|
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
23575
23459
|
var SIZE_LABEL = { s: "S", m: "M", l: "L" };
|
|
23576
23460
|
function ButtonStylePanel({
|
|
@@ -23641,7 +23525,7 @@ function ButtonStylePanel({
|
|
|
23641
23525
|
{
|
|
23642
23526
|
className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
|
|
23643
23527
|
"aria-hidden": true,
|
|
23644
|
-
children: /* @__PURE__ */ jsx35(
|
|
23528
|
+
children: /* @__PURE__ */ jsx35(Check4, { className: "size-3", strokeWidth: 3 })
|
|
23645
23529
|
}
|
|
23646
23530
|
) : null
|
|
23647
23531
|
]
|
|
@@ -24673,7 +24557,7 @@ function useSectionDrag({
|
|
|
24673
24557
|
}
|
|
24674
24558
|
|
|
24675
24559
|
// src/ui/footer-container-chrome.tsx
|
|
24676
|
-
import { Plus as
|
|
24560
|
+
import { Plus as Plus3 } from "lucide-react";
|
|
24677
24561
|
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
24678
24562
|
function FooterContainerChrome({
|
|
24679
24563
|
rect,
|
|
@@ -24714,7 +24598,7 @@ function FooterContainerChrome({
|
|
|
24714
24598
|
if (addDisabled) return;
|
|
24715
24599
|
onAdd();
|
|
24716
24600
|
},
|
|
24717
|
-
children: /* @__PURE__ */ jsx36(
|
|
24601
|
+
children: /* @__PURE__ */ jsx36(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24718
24602
|
}
|
|
24719
24603
|
) }),
|
|
24720
24604
|
/* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
@@ -25121,7 +25005,7 @@ function retargetPageLinks(change, deps) {
|
|
|
25121
25005
|
}
|
|
25122
25006
|
|
|
25123
25007
|
// src/ui/navbar-container-chrome.tsx
|
|
25124
|
-
import { Plus as
|
|
25008
|
+
import { Plus as Plus4 } from "lucide-react";
|
|
25125
25009
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
25126
25010
|
function NavbarContainerChrome({
|
|
25127
25011
|
rect,
|
|
@@ -25157,7 +25041,7 @@ function NavbarContainerChrome({
|
|
|
25157
25041
|
e.stopPropagation();
|
|
25158
25042
|
onAdd();
|
|
25159
25043
|
},
|
|
25160
|
-
children: /* @__PURE__ */ jsx37(
|
|
25044
|
+
children: /* @__PURE__ */ jsx37(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
25161
25045
|
}
|
|
25162
25046
|
)
|
|
25163
25047
|
}
|
|
@@ -25229,7 +25113,7 @@ function Badge({ className, variant, ...props }) {
|
|
|
25229
25113
|
}
|
|
25230
25114
|
|
|
25231
25115
|
// src/OhhwellsBridge.tsx
|
|
25232
|
-
import { Brush as Brush2, Link as Link2, Plus as
|
|
25116
|
+
import { Brush as Brush2, Link as Link2, Plus as Plus5, Settings, Trash2 as Trash24 } from "lucide-react";
|
|
25233
25117
|
import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
25234
25118
|
var PRIMARY7 = "#0885FE";
|
|
25235
25119
|
var IMAGE_FADE_MS = 300;
|
|
@@ -26007,7 +25891,7 @@ function getNavigationSelectionParent(el) {
|
|
|
26007
25891
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
26008
25892
|
return resolveFooterLinksContainerFrom(el);
|
|
26009
25893
|
}
|
|
26010
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
25894
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
26011
25895
|
return getNavigationRoot(el);
|
|
26012
25896
|
}
|
|
26013
25897
|
return null;
|
|
@@ -26229,6 +26113,7 @@ var ICONS = {
|
|
|
26229
26113
|
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"/>',
|
|
26230
26114
|
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"/>'
|
|
26231
26115
|
};
|
|
26116
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
26232
26117
|
var SELECTION_CHROME_GAP2 = 4;
|
|
26233
26118
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
26234
26119
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -26326,7 +26211,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
26326
26211
|
el.style.top = `${top}px`;
|
|
26327
26212
|
el.style.height = `${height}px`;
|
|
26328
26213
|
}
|
|
26329
|
-
var
|
|
26214
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
26330
26215
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
26331
26216
|
const isAbove = transform.includes("translateY(-100%)");
|
|
26332
26217
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -26353,8 +26238,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
26353
26238
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
26354
26239
|
const half = toolbarWidth / 2;
|
|
26355
26240
|
return Math.max(
|
|
26356
|
-
|
|
26357
|
-
Math.min(centerX, window.innerWidth -
|
|
26241
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
26242
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
26358
26243
|
);
|
|
26359
26244
|
}
|
|
26360
26245
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26779,7 +26664,7 @@ function OhhwellsBridge() {
|
|
|
26779
26664
|
}, []);
|
|
26780
26665
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
26781
26666
|
const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
|
|
26782
|
-
|
|
26667
|
+
useLayoutEffect6(() => {
|
|
26783
26668
|
const next = resolveSubdomain(subdomainFromQuery);
|
|
26784
26669
|
if (next !== subdomain) setSubdomain(next);
|
|
26785
26670
|
if (next) return;
|
|
@@ -27263,6 +27148,21 @@ function OhhwellsBridge() {
|
|
|
27263
27148
|
const [isItemDragging, setIsItemDragging] = useState18(false);
|
|
27264
27149
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
|
|
27265
27150
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
27151
|
+
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
27152
|
+
const floatingPanelOpenRef = useRef14(false);
|
|
27153
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
27154
|
+
const floatingPanelRef = useRef14(null);
|
|
27155
|
+
floatingPanelRef.current = floatingPanel;
|
|
27156
|
+
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
27157
|
+
const buttonCollectionDragRef = useRef14(null);
|
|
27158
|
+
const buttonDropInsertIndexRef = useRef14(null);
|
|
27159
|
+
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
27160
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
27161
|
+
const buttonPointerDragRef = useRef14(null);
|
|
27162
|
+
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
27163
|
+
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
27164
|
+
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
27165
|
+
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
27266
27166
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
|
|
27267
27167
|
const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
|
|
27268
27168
|
const footerDragRef = useRef14(null);
|
|
@@ -27289,21 +27189,6 @@ function OhhwellsBridge() {
|
|
|
27289
27189
|
const stylesRef = useRef14("");
|
|
27290
27190
|
const appliedDrawerRef = useRef14(null);
|
|
27291
27191
|
const pendingDeleteUndoRef = useRef14(null);
|
|
27292
|
-
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
27293
|
-
const floatingPanelOpenRef = useRef14(false);
|
|
27294
|
-
const floatingPanelRef = useRef14(null);
|
|
27295
|
-
floatingPanelRef.current = floatingPanel;
|
|
27296
|
-
const setFloatingPanelRef = useRef14(setFloatingPanel);
|
|
27297
|
-
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
27298
|
-
const buttonCollectionDragRef = useRef14(null);
|
|
27299
|
-
const buttonDropInsertIndexRef = useRef14(null);
|
|
27300
|
-
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
27301
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
27302
|
-
const buttonPointerDragRef = useRef14(null);
|
|
27303
|
-
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
27304
|
-
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
27305
|
-
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
27306
|
-
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
27307
27192
|
const [sitePages, setSitePages] = useState18([]);
|
|
27308
27193
|
const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
|
|
27309
27194
|
const [sectionsByPath, setSectionsByPath] = useState18({});
|
|
@@ -27313,18 +27198,7 @@ function OhhwellsBridge() {
|
|
|
27313
27198
|
const linkPopoverOpenRef = useRef14(false);
|
|
27314
27199
|
const linkPopoverGraceUntilRef = useRef14(0);
|
|
27315
27200
|
setLinkPopoverRef.current = setLinkPopover;
|
|
27316
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
27317
27201
|
linkPopoverSessionRef.current = linkPopover;
|
|
27318
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
27319
|
-
useEffect21(() => {
|
|
27320
|
-
const syncViewport = () => {
|
|
27321
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
27322
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
27323
|
-
};
|
|
27324
|
-
syncViewport();
|
|
27325
|
-
window.addEventListener("resize", syncViewport);
|
|
27326
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
27327
|
-
}, []);
|
|
27328
27202
|
useEffect21(() => {
|
|
27329
27203
|
setSectionOrderPersistHandler((entries) => {
|
|
27330
27204
|
const currentPath = window.location.pathname;
|
|
@@ -29040,7 +28914,7 @@ function OhhwellsBridge() {
|
|
|
29040
28914
|
isFooterFrameSelection,
|
|
29041
28915
|
postToParent2
|
|
29042
28916
|
]);
|
|
29043
|
-
|
|
28917
|
+
useLayoutEffect6(() => {
|
|
29044
28918
|
if (!subdomain || isEditMode) {
|
|
29045
28919
|
setFetchState("done");
|
|
29046
28920
|
return;
|
|
@@ -29067,7 +28941,6 @@ function OhhwellsBridge() {
|
|
|
29067
28941
|
applyAiFooterFromContent(content);
|
|
29068
28942
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
29069
28943
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
29070
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
29071
28944
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
29072
28945
|
}
|
|
29073
28946
|
applyBrandChrome(content);
|
|
@@ -29078,12 +28951,12 @@ function OhhwellsBridge() {
|
|
|
29078
28951
|
if (key === "__ohw_sections") continue;
|
|
29079
28952
|
if (key === AI_SECTIONS_KEY) continue;
|
|
29080
28953
|
if (key === AI_FOOTER_KEY) continue;
|
|
29081
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
29082
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
29083
28954
|
if (key === BRAND_KIT_KEY) continue;
|
|
29084
28955
|
if (key === STYLE_STORE_KEY) continue;
|
|
29085
28956
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28957
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
29086
28958
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28959
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
29087
28960
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
29088
28961
|
continue;
|
|
29089
28962
|
}
|
|
@@ -29318,18 +29191,17 @@ function OhhwellsBridge() {
|
|
|
29318
29191
|
}
|
|
29319
29192
|
applyAiFooterFromContent(content);
|
|
29320
29193
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
29321
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
29322
29194
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
29323
29195
|
}
|
|
29324
29196
|
for (const [key, val] of Object.entries(content)) {
|
|
29325
29197
|
if (key === "__ohw_sections") continue;
|
|
29326
29198
|
if (key === AI_SECTIONS_KEY) continue;
|
|
29327
29199
|
if (key === AI_FOOTER_KEY) continue;
|
|
29328
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
29329
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
29330
29200
|
if (key === BRAND_KIT_KEY) continue;
|
|
29331
29201
|
if (key === STYLE_STORE_KEY) continue;
|
|
29332
29202
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
29203
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
29204
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
29333
29205
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
29334
29206
|
continue;
|
|
29335
29207
|
}
|
|
@@ -29416,7 +29288,7 @@ function OhhwellsBridge() {
|
|
|
29416
29288
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
29417
29289
|
};
|
|
29418
29290
|
}, [subdomain, isEditMode, pathname]);
|
|
29419
|
-
|
|
29291
|
+
useLayoutEffect6(() => {
|
|
29420
29292
|
const el = document.getElementById("ohw-loader");
|
|
29421
29293
|
if (!el) return;
|
|
29422
29294
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
@@ -29601,11 +29473,26 @@ function OhhwellsBridge() {
|
|
|
29601
29473
|
const t2 = setTimeout(measure, 500);
|
|
29602
29474
|
const ro = new ResizeObserver(schedule);
|
|
29603
29475
|
ro.observe(document.body);
|
|
29476
|
+
let lastWidth = window.innerWidth;
|
|
29477
|
+
let resizeTimers = [];
|
|
29478
|
+
const clearResizeTimers = () => {
|
|
29479
|
+
resizeTimers.forEach(clearTimeout);
|
|
29480
|
+
resizeTimers = [];
|
|
29481
|
+
};
|
|
29482
|
+
const handleResize = () => {
|
|
29483
|
+
if (window.innerWidth === lastWidth) return;
|
|
29484
|
+
lastWidth = window.innerWidth;
|
|
29485
|
+
clearResizeTimers();
|
|
29486
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
29487
|
+
};
|
|
29488
|
+
window.addEventListener("resize", handleResize);
|
|
29604
29489
|
return () => {
|
|
29605
29490
|
clearTimeout(t1);
|
|
29606
29491
|
clearTimeout(t2);
|
|
29607
29492
|
if (raf != null) cancelAnimationFrame(raf);
|
|
29608
29493
|
ro.disconnect();
|
|
29494
|
+
clearResizeTimers();
|
|
29495
|
+
window.removeEventListener("resize", handleResize);
|
|
29609
29496
|
};
|
|
29610
29497
|
}, [pathname, isEditMode, postToParent2]);
|
|
29611
29498
|
useEffect21(() => {
|
|
@@ -29902,13 +29789,6 @@ function OhhwellsBridge() {
|
|
|
29902
29789
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29903
29790
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29904
29791
|
if (isInsideLinkEditor(target)) return;
|
|
29905
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29906
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29907
|
-
if (target.closest(
|
|
29908
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29909
|
-
)) {
|
|
29910
|
-
return;
|
|
29911
|
-
}
|
|
29912
29792
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29913
29793
|
clearMediaSelectionRef.current();
|
|
29914
29794
|
}
|
|
@@ -29932,6 +29812,8 @@ function OhhwellsBridge() {
|
|
|
29932
29812
|
return;
|
|
29933
29813
|
}
|
|
29934
29814
|
}
|
|
29815
|
+
if (isInsideFloatingPanel(target)) return;
|
|
29816
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29935
29817
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29936
29818
|
if (collectionItem) {
|
|
29937
29819
|
e.preventDefault();
|
|
@@ -29943,6 +29825,11 @@ function OhhwellsBridge() {
|
|
|
29943
29825
|
});
|
|
29944
29826
|
return;
|
|
29945
29827
|
}
|
|
29828
|
+
if (target.closest(
|
|
29829
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29830
|
+
)) {
|
|
29831
|
+
return;
|
|
29832
|
+
}
|
|
29946
29833
|
{
|
|
29947
29834
|
const formEl = getFormElement(target);
|
|
29948
29835
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -30096,13 +29983,9 @@ function OhhwellsBridge() {
|
|
|
30096
29983
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
30097
29984
|
e.preventDefault();
|
|
30098
29985
|
e.stopPropagation();
|
|
29986
|
+
selectIconElementRef.current(editable);
|
|
30099
29987
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
30100
29988
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
30101
|
-
if (aiIcon) {
|
|
30102
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
30103
|
-
} else {
|
|
30104
|
-
selectIconElementRef.current(editable);
|
|
30105
|
-
}
|
|
30106
29989
|
postToParentRef.current({
|
|
30107
29990
|
type: "ow:icon-pick",
|
|
30108
29991
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -30330,9 +30213,6 @@ function OhhwellsBridge() {
|
|
|
30330
30213
|
setHoveredItemRect(null);
|
|
30331
30214
|
hoveredNavContainerRef.current = null;
|
|
30332
30215
|
setHoveredNavContainerRect(null);
|
|
30333
|
-
siblingHintElRef.current = null;
|
|
30334
|
-
setSiblingHintRect(null);
|
|
30335
|
-
setSiblingHintRects([]);
|
|
30336
30216
|
return;
|
|
30337
30217
|
}
|
|
30338
30218
|
{
|
|
@@ -30453,6 +30333,7 @@ function OhhwellsBridge() {
|
|
|
30453
30333
|
hoveredNavContainerRef.current = null;
|
|
30454
30334
|
setHoveredNavContainerRect(null);
|
|
30455
30335
|
hoveredItemElRef.current = editable;
|
|
30336
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
30456
30337
|
}
|
|
30457
30338
|
}
|
|
30458
30339
|
}
|
|
@@ -31162,11 +31043,7 @@ function OhhwellsBridge() {
|
|
|
31162
31043
|
};
|
|
31163
31044
|
const handleMouseMove = (e) => {
|
|
31164
31045
|
const { clientX, clientY } = e;
|
|
31165
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
31166
|
-
dismissImageHover();
|
|
31167
|
-
clearImageHover();
|
|
31168
|
-
return;
|
|
31169
|
-
}
|
|
31046
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
31170
31047
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
31171
31048
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
31172
31049
|
formHoverElRef.current = null;
|
|
@@ -31195,12 +31072,7 @@ function OhhwellsBridge() {
|
|
|
31195
31072
|
setHoveredItemRect(null);
|
|
31196
31073
|
hoveredNavContainerRef.current = null;
|
|
31197
31074
|
setHoveredNavContainerRect(null);
|
|
31198
|
-
siblingHintElRef.current = null;
|
|
31199
|
-
setSiblingHintRect(null);
|
|
31200
|
-
setSiblingHintRects([]);
|
|
31201
31075
|
dismissImageHover();
|
|
31202
|
-
clearImageHover();
|
|
31203
|
-
setSectionGap(null);
|
|
31204
31076
|
return;
|
|
31205
31077
|
}
|
|
31206
31078
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -31212,11 +31084,7 @@ function OhhwellsBridge() {
|
|
|
31212
31084
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
31213
31085
|
const { clientX, clientY } = e.data;
|
|
31214
31086
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
31215
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
31216
|
-
dismissImageHover();
|
|
31217
|
-
clearImageHover();
|
|
31218
|
-
return;
|
|
31219
|
-
}
|
|
31087
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
31220
31088
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
31221
31089
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
31222
31090
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -31596,7 +31464,6 @@ function OhhwellsBridge() {
|
|
|
31596
31464
|
applyAiFooterFromContent(content);
|
|
31597
31465
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
31598
31466
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
31599
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
31600
31467
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
31601
31468
|
}
|
|
31602
31469
|
applyBrandChrome(content);
|
|
@@ -31611,12 +31478,12 @@ function OhhwellsBridge() {
|
|
|
31611
31478
|
}
|
|
31612
31479
|
if (key === AI_SECTIONS_KEY) continue;
|
|
31613
31480
|
if (key === AI_FOOTER_KEY) continue;
|
|
31614
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31615
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31616
31481
|
if (key === BRAND_KIT_KEY) continue;
|
|
31617
31482
|
if (key === STYLE_STORE_KEY) continue;
|
|
31618
31483
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
31484
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31619
31485
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
31486
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31620
31487
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
31621
31488
|
continue;
|
|
31622
31489
|
}
|
|
@@ -32288,12 +32155,6 @@ function OhhwellsBridge() {
|
|
|
32288
32155
|
closeLinkPopoverRef.current();
|
|
32289
32156
|
return;
|
|
32290
32157
|
}
|
|
32291
|
-
if (floatingPanelOpenRef.current) {
|
|
32292
|
-
setFloatingPanelRef.current(null);
|
|
32293
|
-
deselectRef.current();
|
|
32294
|
-
deactivateRef.current();
|
|
32295
|
-
return;
|
|
32296
|
-
}
|
|
32297
32158
|
deselectRef.current();
|
|
32298
32159
|
deactivateRef.current();
|
|
32299
32160
|
clearMediaSelectionRef.current();
|
|
@@ -33124,10 +32985,10 @@ function OhhwellsBridge() {
|
|
|
33124
32985
|
window.removeEventListener("message", handleDuplicateSection);
|
|
33125
32986
|
window.removeEventListener("message", handleDeactivate);
|
|
33126
32987
|
window.removeEventListener("message", handleSelectNav);
|
|
32988
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
33127
32989
|
window.removeEventListener("message", handleToastAction);
|
|
33128
32990
|
window.removeEventListener("message", handleFormCount);
|
|
33129
32991
|
window.removeEventListener("message", handleUiEscape);
|
|
33130
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
33131
32992
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
33132
32993
|
autoSaveTimers.current.clear();
|
|
33133
32994
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -33421,7 +33282,7 @@ function OhhwellsBridge() {
|
|
|
33421
33282
|
postToParent2({
|
|
33422
33283
|
type: "ow:ready",
|
|
33423
33284
|
version: "1",
|
|
33424
|
-
bridgeVersion: "0.1.
|
|
33285
|
+
bridgeVersion: "0.1.173",
|
|
33425
33286
|
path: pathname,
|
|
33426
33287
|
nodes: collectEditableNodes(editContentRef.current),
|
|
33427
33288
|
sections
|
|
@@ -34311,7 +34172,7 @@ function OhhwellsBridge() {
|
|
|
34311
34172
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
|
|
34312
34173
|
onClick: () => setFieldTypePickerOpen((open) => !open),
|
|
34313
34174
|
"data-ohw-add-field": "",
|
|
34314
|
-
children: /* @__PURE__ */ jsx40(
|
|
34175
|
+
children: /* @__PURE__ */ jsx40(Plus5, { size: 15, "aria-hidden": true })
|
|
34315
34176
|
}
|
|
34316
34177
|
),
|
|
34317
34178
|
/* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),
|