@ohhwells/bridge 0.1.173-next.460 → 0.1.174
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 useEffect22, useLayoutEffect as
|
|
4
|
+
import React12, { useCallback as useCallback12, useEffect as useEffect22, 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
|
|
|
@@ -6879,21 +6879,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
6879
6879
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
6880
6880
|
return target ? pricingFeatureList(target).length : 0;
|
|
6881
6881
|
}
|
|
6882
|
-
function prevailingFeatureIcon(features) {
|
|
6883
|
-
const counts = /* @__PURE__ */ new Map();
|
|
6884
|
-
for (const row of features) {
|
|
6885
|
-
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
6886
|
-
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
6887
|
-
entry.count += 1;
|
|
6888
|
-
counts.set(key, entry);
|
|
6889
|
-
}
|
|
6890
|
-
let best = null;
|
|
6891
|
-
for (const entry of counts.values()) {
|
|
6892
|
-
if (!best || entry.count > best.count) best = entry;
|
|
6893
|
-
}
|
|
6894
|
-
if (!best) return {};
|
|
6895
|
-
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
6896
|
-
}
|
|
6897
6882
|
function addPricingCardFeature(tree, index, text) {
|
|
6898
6883
|
return withPricingCollection(tree, (collection) => {
|
|
6899
6884
|
const children = collection.children;
|
|
@@ -6902,7 +6887,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
6902
6887
|
const features = pricingFeatureList(target);
|
|
6903
6888
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
6904
6889
|
target.slots = target.slots ?? {};
|
|
6905
|
-
target.slots.features = [...features, { text
|
|
6890
|
+
target.slots.features = [...features, { text }];
|
|
6906
6891
|
return true;
|
|
6907
6892
|
});
|
|
6908
6893
|
}
|
|
@@ -8415,7 +8400,7 @@ var AI_MOBILE_CSS = [
|
|
|
8415
8400
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
8416
8401
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
8417
8402
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
8418
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
8403
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
8419
8404
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
8420
8405
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
8421
8406
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -8431,10 +8416,8 @@ var AI_MOBILE_CSS = [
|
|
|
8431
8416
|
"[data-ai-section]{overflow-x:hidden}",
|
|
8432
8417
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
8433
8418
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
8434
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
8435
|
-
|
|
8436
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8437
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
8419
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
8420
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8438
8421
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
8439
8422
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
8440
8423
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8639,31 +8622,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8639
8622
|
function textAttrs(ctx, path) {
|
|
8640
8623
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8641
8624
|
}
|
|
8642
|
-
var AI_RESPONSIVE_CSS = [
|
|
8643
|
-
"@media (max-width: 960px) {",
|
|
8644
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
8645
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
8646
|
-
"}",
|
|
8647
|
-
"@media (max-width: 640px) {",
|
|
8648
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
8649
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
8650
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
8651
|
-
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
8652
|
-
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
8653
|
-
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
8654
|
-
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
8655
|
-
// layered text used to be.
|
|
8656
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
8657
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
8658
|
-
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
8659
|
-
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
8660
|
-
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
8661
|
-
// other rule had already been taught to stand down.
|
|
8662
|
-
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
8663
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
8664
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
8665
|
-
"}"
|
|
8666
|
-
].join("\n");
|
|
8667
8625
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8668
8626
|
function MediaBox({
|
|
8669
8627
|
refValue,
|
|
@@ -8718,7 +8676,7 @@ function MediaBox({
|
|
|
8718
8676
|
position: fill ? "absolute" : void 0,
|
|
8719
8677
|
inset: fill ? 0 : void 0,
|
|
8720
8678
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8721
|
-
height: fill ? "100%" :
|
|
8679
|
+
height: fill ? "100%" : void 0,
|
|
8722
8680
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8723
8681
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8724
8682
|
borderRadius: radius,
|
|
@@ -10220,7 +10178,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
10220
10178
|
return /* @__PURE__ */ jsx(
|
|
10221
10179
|
"div",
|
|
10222
10180
|
{
|
|
10223
|
-
"data-ai-grid":
|
|
10181
|
+
"data-ai-grid": "",
|
|
10224
10182
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
10225
10183
|
style: {
|
|
10226
10184
|
display: "grid",
|
|
@@ -10522,7 +10480,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
10522
10480
|
},
|
|
10523
10481
|
children: [
|
|
10524
10482
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
10525
|
-
// The section's `data-ai-
|
|
10483
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
10526
10484
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
10527
10485
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
10528
10486
|
// the full section width instead of reading at the usual content width.
|
|
@@ -10936,7 +10894,6 @@ function AiTreeRenderer({
|
|
|
10936
10894
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
10937
10895
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
10938
10896
|
...bgAttrs,
|
|
10939
|
-
"data-ai-responsive": "",
|
|
10940
10897
|
style: {
|
|
10941
10898
|
position: "relative",
|
|
10942
10899
|
padding: `${padCss} 0`,
|
|
@@ -10950,13 +10907,12 @@ function AiTreeRenderer({
|
|
|
10950
10907
|
...fillHeight ? { display: "grid" } : {}
|
|
10951
10908
|
},
|
|
10952
10909
|
children: [
|
|
10953
|
-
/* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
|
|
10954
|
-
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10955
10910
|
isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
10911
|
+
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10956
10912
|
/* @__PURE__ */ jsx(
|
|
10957
10913
|
"div",
|
|
10958
10914
|
{
|
|
10959
|
-
"data-ai-
|
|
10915
|
+
"data-ai-container": "",
|
|
10960
10916
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
10961
10917
|
style: {
|
|
10962
10918
|
position: "relative",
|
|
@@ -10973,7 +10929,7 @@ function AiTreeRenderer({
|
|
|
10973
10929
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
|
|
10974
10930
|
"div",
|
|
10975
10931
|
{
|
|
10976
|
-
"data-ai-
|
|
10932
|
+
"data-ai-row": "",
|
|
10977
10933
|
style: {
|
|
10978
10934
|
display: "grid",
|
|
10979
10935
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11635,10 +11591,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11635
11591
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11636
11592
|
continue;
|
|
11637
11593
|
}
|
|
11594
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
11638
11595
|
let container = existing?.container;
|
|
11639
|
-
let isNewMount = false;
|
|
11640
11596
|
if (!container || !container.isConnected) {
|
|
11641
|
-
isNewMount = true;
|
|
11642
11597
|
existing?.root.unmount();
|
|
11643
11598
|
container?.remove();
|
|
11644
11599
|
container = document.createElement("div");
|
|
@@ -11976,34 +11931,6 @@ function minSpanForFooterBlock(type) {
|
|
|
11976
11931
|
return 3;
|
|
11977
11932
|
}
|
|
11978
11933
|
}
|
|
11979
|
-
function readLiveSocialItems() {
|
|
11980
|
-
const root = getFooterRoot();
|
|
11981
|
-
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
11982
|
-
if (!row) return [];
|
|
11983
|
-
const items = [];
|
|
11984
|
-
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
11985
|
-
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
11986
|
-
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
11987
|
-
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
11988
|
-
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
11989
|
-
items.push({ platform, href });
|
|
11990
|
-
}
|
|
11991
|
-
return items;
|
|
11992
|
-
}
|
|
11993
|
-
function syncSocialRowsFromDom(tree) {
|
|
11994
|
-
const root = getFooterRoot();
|
|
11995
|
-
if (!root) return;
|
|
11996
|
-
const row = root.querySelector("[data-ohw-socials-row]");
|
|
11997
|
-
const live = readLiveSocialItems();
|
|
11998
|
-
if (row && live.length === 0) return;
|
|
11999
|
-
for (const col of tree.columns) {
|
|
12000
|
-
col.blocks = col.blocks.flatMap((block) => {
|
|
12001
|
-
if (block.type !== "social-row") return [block];
|
|
12002
|
-
if (!row) return [];
|
|
12003
|
-
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
12004
|
-
});
|
|
12005
|
-
}
|
|
12006
|
-
}
|
|
12007
11934
|
function collectBrandBlocks(tree) {
|
|
12008
11935
|
const brand = [];
|
|
12009
11936
|
for (const col of tree.columns) {
|
|
@@ -12249,7 +12176,6 @@ function textOf2(el) {
|
|
|
12249
12176
|
}
|
|
12250
12177
|
function syncFooterTreeLinksFromDom(tree) {
|
|
12251
12178
|
const next = cloneTree2(tree);
|
|
12252
|
-
syncSocialRowsFromDom(next);
|
|
12253
12179
|
const domCols = listFooterColumns().map((col) => {
|
|
12254
12180
|
const heading = getFooterColumnHeadingEl(col);
|
|
12255
12181
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -19088,7 +19014,7 @@ function apiBase() {
|
|
|
19088
19014
|
function bridgeVersion() {
|
|
19089
19015
|
try {
|
|
19090
19016
|
if (true) {
|
|
19091
|
-
return "0.1.
|
|
19017
|
+
return "0.1.174";
|
|
19092
19018
|
}
|
|
19093
19019
|
} catch {
|
|
19094
19020
|
}
|
|
@@ -19102,7 +19028,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
19102
19028
|
return;
|
|
19103
19029
|
}
|
|
19104
19030
|
try {
|
|
19105
|
-
const v = true ? "0.1.
|
|
19031
|
+
const v = true ? "0.1.174" : "";
|
|
19106
19032
|
if (v) {
|
|
19107
19033
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
19108
19034
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -19783,7 +19709,6 @@ function MediaOverlay({
|
|
|
19783
19709
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
19784
19710
|
);
|
|
19785
19711
|
}, [isVideo]);
|
|
19786
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
19787
19712
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
19788
19713
|
const box = {
|
|
19789
19714
|
position: "fixed",
|
|
@@ -19882,10 +19807,11 @@ function MediaOverlay({
|
|
|
19882
19807
|
className: "flex items-center justify-center cursor-pointer",
|
|
19883
19808
|
style: {
|
|
19884
19809
|
...box,
|
|
19885
|
-
//
|
|
19886
|
-
//
|
|
19887
|
-
//
|
|
19888
|
-
|
|
19810
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
19811
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
19812
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
19813
|
+
// Replace still works.
|
|
19814
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
19889
19815
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
19890
19816
|
// than hovered. Hover keeps the existing tinted preview.
|
|
19891
19817
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -19912,18 +19838,15 @@ function MediaOverlay({
|
|
|
19912
19838
|
},
|
|
19913
19839
|
children: [
|
|
19914
19840
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
19915
|
-
|
|
19841
|
+
isVideo ? "Replace video" : "Replace image"
|
|
19916
19842
|
]
|
|
19917
19843
|
}
|
|
19918
19844
|
),
|
|
19919
|
-
|
|
19845
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ jsxs8(
|
|
19920
19846
|
"div",
|
|
19921
19847
|
{
|
|
19922
19848
|
className: "flex items-center gap-1.5",
|
|
19923
|
-
style: {
|
|
19924
|
-
// Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
|
|
19925
|
-
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
|
|
19926
|
-
},
|
|
19849
|
+
style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
|
|
19927
19850
|
onClick: (e) => e.stopPropagation(),
|
|
19928
19851
|
children: [
|
|
19929
19852
|
/* @__PURE__ */ jsxs8(
|
|
@@ -19932,7 +19855,7 @@ function MediaOverlay({
|
|
|
19932
19855
|
"data-ohw-media-overlay": "",
|
|
19933
19856
|
variant: "outline",
|
|
19934
19857
|
size: "sm",
|
|
19935
|
-
"aria-label":
|
|
19858
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
19936
19859
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
19937
19860
|
style: {
|
|
19938
19861
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -19953,7 +19876,7 @@ function MediaOverlay({
|
|
|
19953
19876
|
},
|
|
19954
19877
|
children: [
|
|
19955
19878
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
19956
|
-
replaceMode === "full" ?
|
|
19879
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
19957
19880
|
]
|
|
19958
19881
|
}
|
|
19959
19882
|
),
|
|
@@ -20610,24 +20533,8 @@ function AiSectionOverlay({
|
|
|
20610
20533
|
}
|
|
20611
20534
|
|
|
20612
20535
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
20613
|
-
import { useCallback as useCallback3, useEffect as useEffect10,
|
|
20614
|
-
import {
|
|
20615
|
-
AlignCenter,
|
|
20616
|
-
AlignLeft,
|
|
20617
|
-
AlignRight,
|
|
20618
|
-
ArrowLeft as ArrowLeft2,
|
|
20619
|
-
ArrowRight as ArrowRight2,
|
|
20620
|
-
Check as Check2,
|
|
20621
|
-
ChevronDown as ChevronDown3,
|
|
20622
|
-
Image as ImageIcon2,
|
|
20623
|
-
ImageMinus,
|
|
20624
|
-
ImagePlus,
|
|
20625
|
-
Link as LinkIcon,
|
|
20626
|
-
Minus,
|
|
20627
|
-
Palette,
|
|
20628
|
-
Plus as Plus2,
|
|
20629
|
-
Star
|
|
20630
|
-
} from "lucide-react";
|
|
20536
|
+
import { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef5, useState as useState8 } from "react";
|
|
20537
|
+
import { Star } from "lucide-react";
|
|
20631
20538
|
|
|
20632
20539
|
// src/lib/ai-media-strip-tree.ts
|
|
20633
20540
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -20741,6 +20648,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
20741
20648
|
return true;
|
|
20742
20649
|
});
|
|
20743
20650
|
}
|
|
20651
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
20652
|
+
return withMediaStrip(tree, (block) => {
|
|
20653
|
+
const items = block.items;
|
|
20654
|
+
if (index < 0 || index >= items.length) return false;
|
|
20655
|
+
items[index] = { ...items[index], alt };
|
|
20656
|
+
return true;
|
|
20657
|
+
});
|
|
20658
|
+
}
|
|
20744
20659
|
function setMediaStripItemLink(tree, index, link) {
|
|
20745
20660
|
return withMediaStrip(tree, (block) => {
|
|
20746
20661
|
const items = block.items;
|
|
@@ -20758,117 +20673,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
20758
20673
|
});
|
|
20759
20674
|
}
|
|
20760
20675
|
|
|
20761
|
-
// src/ui/dialog.tsx
|
|
20762
|
-
import * as React9 from "react";
|
|
20763
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
20764
|
-
import { X as X2 } from "lucide-react";
|
|
20765
|
-
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
20766
|
-
function Dialog2({
|
|
20767
|
-
...props
|
|
20768
|
-
}) {
|
|
20769
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
20770
|
-
}
|
|
20771
|
-
function DialogPortal({
|
|
20772
|
-
...props
|
|
20773
|
-
}) {
|
|
20774
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
|
|
20775
|
-
}
|
|
20776
|
-
function DialogOverlay({
|
|
20777
|
-
className,
|
|
20778
|
-
...props
|
|
20779
|
-
}) {
|
|
20780
|
-
return /* @__PURE__ */ jsx20(
|
|
20781
|
-
DialogPrimitive.Overlay,
|
|
20782
|
-
{
|
|
20783
|
-
"data-slot": "dialog-overlay",
|
|
20784
|
-
"data-ohw-link-modal-root": "",
|
|
20785
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
20786
|
-
...props
|
|
20787
|
-
}
|
|
20788
|
-
);
|
|
20789
|
-
}
|
|
20790
|
-
var DialogContent = React9.forwardRef(
|
|
20791
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
20792
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
20793
|
-
return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
|
|
20794
|
-
/* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
20795
|
-
/* @__PURE__ */ jsxs11(
|
|
20796
|
-
DialogPrimitive.Content,
|
|
20797
|
-
{
|
|
20798
|
-
ref,
|
|
20799
|
-
"data-slot": "dialog-content",
|
|
20800
|
-
className: cn(
|
|
20801
|
-
positionMode,
|
|
20802
|
-
"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",
|
|
20803
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
20804
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
20805
|
-
className
|
|
20806
|
-
),
|
|
20807
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
20808
|
-
...props,
|
|
20809
|
-
children: [
|
|
20810
|
-
children,
|
|
20811
|
-
showCloseButton ? /* @__PURE__ */ jsx20(
|
|
20812
|
-
DialogPrimitive.Close,
|
|
20813
|
-
{
|
|
20814
|
-
type: "button",
|
|
20815
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
20816
|
-
"aria-label": "Close",
|
|
20817
|
-
children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
|
|
20818
|
-
}
|
|
20819
|
-
) : null
|
|
20820
|
-
]
|
|
20821
|
-
}
|
|
20822
|
-
)
|
|
20823
|
-
] });
|
|
20824
|
-
}
|
|
20825
|
-
);
|
|
20826
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
20827
|
-
function DialogHeader({
|
|
20828
|
-
className,
|
|
20829
|
-
...props
|
|
20830
|
-
}) {
|
|
20831
|
-
return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
20832
|
-
}
|
|
20833
|
-
function DialogFooter({
|
|
20834
|
-
className,
|
|
20835
|
-
...props
|
|
20836
|
-
}) {
|
|
20837
|
-
return /* @__PURE__ */ jsx20(
|
|
20838
|
-
"div",
|
|
20839
|
-
{
|
|
20840
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
20841
|
-
...props
|
|
20842
|
-
}
|
|
20843
|
-
);
|
|
20844
|
-
}
|
|
20845
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
20846
|
-
DialogPrimitive.Title,
|
|
20847
|
-
{
|
|
20848
|
-
ref,
|
|
20849
|
-
className: cn(
|
|
20850
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
20851
|
-
className
|
|
20852
|
-
),
|
|
20853
|
-
...props
|
|
20854
|
-
}
|
|
20855
|
-
));
|
|
20856
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
20857
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
20858
|
-
DialogPrimitive.Description,
|
|
20859
|
-
{
|
|
20860
|
-
ref,
|
|
20861
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
20862
|
-
...props
|
|
20863
|
-
}
|
|
20864
|
-
));
|
|
20865
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
20866
|
-
var DialogClose = DialogPrimitive.Close;
|
|
20867
|
-
|
|
20868
20676
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
20869
|
-
import { Fragment as Fragment7, jsx as
|
|
20870
|
-
var PRIMARY3 = "
|
|
20871
|
-
var
|
|
20677
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
20678
|
+
var PRIMARY3 = "#0885FE";
|
|
20679
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
20680
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
20872
20681
|
function findMediaStripItemElement(sectionId, index) {
|
|
20873
20682
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
20874
20683
|
if (!sectionEl2) return null;
|
|
@@ -20878,35 +20687,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
20878
20687
|
}
|
|
20879
20688
|
return null;
|
|
20880
20689
|
}
|
|
20881
|
-
function
|
|
20882
|
-
|
|
20883
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
20884
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
20885
|
-
if (!itemEl) return null;
|
|
20886
|
-
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
20887
|
-
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
20888
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
20889
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
20890
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
20891
|
-
return { sectionId, index };
|
|
20892
|
-
}
|
|
20893
|
-
function sameRef(a, b) {
|
|
20894
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
20895
|
-
}
|
|
20896
|
-
function rectOf(el) {
|
|
20690
|
+
function readRect2(ref) {
|
|
20691
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
20897
20692
|
if (!el) return null;
|
|
20898
20693
|
const r2 = el.getBoundingClientRect();
|
|
20899
20694
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
20900
20695
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
20901
20696
|
}
|
|
20902
|
-
function
|
|
20903
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
20904
|
-
}
|
|
20905
|
-
function readStripRect(ref) {
|
|
20906
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
20907
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
20908
|
-
}
|
|
20909
|
-
function useLiveItemRect(ref, strip = false) {
|
|
20697
|
+
function useLiveItemRect(ref) {
|
|
20910
20698
|
const [rect, setRect] = useState8(null);
|
|
20911
20699
|
useEffect10(() => {
|
|
20912
20700
|
if (!ref) {
|
|
@@ -20914,7 +20702,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
20914
20702
|
return;
|
|
20915
20703
|
}
|
|
20916
20704
|
const update = () => {
|
|
20917
|
-
const next =
|
|
20705
|
+
const next = readRect2(ref);
|
|
20918
20706
|
setRect(
|
|
20919
20707
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
20920
20708
|
);
|
|
@@ -20929,49 +20717,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
20929
20717
|
window.removeEventListener("resize", update);
|
|
20930
20718
|
clearInterval(interval);
|
|
20931
20719
|
};
|
|
20932
|
-
}, [ref?.sectionId, ref?.index
|
|
20720
|
+
}, [ref?.sectionId, ref?.index]);
|
|
20933
20721
|
return rect;
|
|
20934
20722
|
}
|
|
20935
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
20936
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
20937
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
20938
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
20939
|
-
const slotRef = useRef5(null);
|
|
20940
|
-
const [shift, setShift] = useState8(0);
|
|
20941
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
20942
|
-
useLayoutEffect4(() => {
|
|
20943
|
-
const slot = slotRef.current;
|
|
20944
|
-
if (!slot) return;
|
|
20945
|
-
const clamp = () => {
|
|
20946
|
-
const w = slot.offsetWidth;
|
|
20947
|
-
if (w <= 0) return;
|
|
20948
|
-
const half = w / 2;
|
|
20949
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
20950
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
20951
|
-
};
|
|
20952
|
-
clamp();
|
|
20953
|
-
const ro = new ResizeObserver(clamp);
|
|
20954
|
-
ro.observe(slot);
|
|
20955
|
-
return () => ro.disconnect();
|
|
20956
|
-
}, [centerX, children]);
|
|
20957
|
-
const mobile = window.innerWidth <= 480;
|
|
20958
|
-
return /* @__PURE__ */ jsx21(
|
|
20959
|
-
"div",
|
|
20960
|
-
{
|
|
20961
|
-
ref: slotRef,
|
|
20962
|
-
"data-ohw-bridge": "",
|
|
20963
|
-
"data-ohw-item-interaction": "",
|
|
20964
|
-
className: "pointer-events-auto fixed",
|
|
20965
|
-
style: {
|
|
20966
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
20967
|
-
left: centerX + shift,
|
|
20968
|
-
transform: "translate(-50%, -100%)",
|
|
20969
|
-
zIndex: 2147483645
|
|
20970
|
-
},
|
|
20971
|
-
children
|
|
20972
|
-
}
|
|
20973
|
-
);
|
|
20974
|
-
}
|
|
20975
20723
|
function requestValidateTree(postToParent2, tree) {
|
|
20976
20724
|
return new Promise((resolve) => {
|
|
20977
20725
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -21008,72 +20756,116 @@ function requestAssetPick(postToParent2) {
|
|
|
21008
20756
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21009
20757
|
});
|
|
21010
20758
|
}
|
|
21011
|
-
function
|
|
20759
|
+
function Pill({
|
|
21012
20760
|
label,
|
|
21013
20761
|
onClick,
|
|
21014
|
-
disabled
|
|
21015
|
-
active
|
|
21016
|
-
children
|
|
20762
|
+
disabled,
|
|
20763
|
+
active
|
|
21017
20764
|
}) {
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
|
|
21021
|
-
|
|
21022
|
-
|
|
21023
|
-
|
|
21024
|
-
|
|
21025
|
-
|
|
20765
|
+
return /* @__PURE__ */ jsx20(
|
|
20766
|
+
"button",
|
|
20767
|
+
{
|
|
20768
|
+
type: "button",
|
|
20769
|
+
onClick,
|
|
20770
|
+
disabled,
|
|
20771
|
+
style: {
|
|
20772
|
+
height: 28,
|
|
20773
|
+
padding: "0 10px",
|
|
20774
|
+
display: "inline-flex",
|
|
20775
|
+
alignItems: "center",
|
|
20776
|
+
gap: 4,
|
|
20777
|
+
borderRadius: 999,
|
|
20778
|
+
border: "none",
|
|
20779
|
+
cursor: disabled ? "default" : "pointer",
|
|
20780
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
20781
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
20782
|
+
opacity: disabled ? 0.4 : 1,
|
|
20783
|
+
fontSize: 12,
|
|
20784
|
+
lineHeight: "16px",
|
|
20785
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
20786
|
+
whiteSpace: "nowrap",
|
|
20787
|
+
flex: "0 0 auto"
|
|
20788
|
+
},
|
|
20789
|
+
children: label
|
|
20790
|
+
}
|
|
20791
|
+
);
|
|
21026
20792
|
}
|
|
21027
|
-
function
|
|
21028
|
-
|
|
21029
|
-
value,
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
"
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
) }),
|
|
21049
|
-
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
21050
|
-
const selected = option.value === value;
|
|
21051
|
-
return /* @__PURE__ */ jsxs12(
|
|
21052
|
-
DropdownMenuItem,
|
|
20793
|
+
function AltInput({ value, onCommit }) {
|
|
20794
|
+
const [draft, setDraft] = useState8(value);
|
|
20795
|
+
useEffect10(() => setDraft(value), [value]);
|
|
20796
|
+
return /* @__PURE__ */ jsxs11(
|
|
20797
|
+
"div",
|
|
20798
|
+
{
|
|
20799
|
+
style: {
|
|
20800
|
+
display: "flex",
|
|
20801
|
+
alignItems: "center",
|
|
20802
|
+
gap: 6,
|
|
20803
|
+
height: 28,
|
|
20804
|
+
padding: "0 12px",
|
|
20805
|
+
borderRadius: 999,
|
|
20806
|
+
background: "#ffffff",
|
|
20807
|
+
width: "100%",
|
|
20808
|
+
maxWidth: 260,
|
|
20809
|
+
boxSizing: "border-box"
|
|
20810
|
+
},
|
|
20811
|
+
children: [
|
|
20812
|
+
/* @__PURE__ */ jsx20(
|
|
20813
|
+
"span",
|
|
21053
20814
|
{
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
)
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
20815
|
+
style: {
|
|
20816
|
+
flex: "0 0 auto",
|
|
20817
|
+
color: OHW_BLUE_DARK,
|
|
20818
|
+
fontSize: 10,
|
|
20819
|
+
fontWeight: 700,
|
|
20820
|
+
textTransform: "uppercase",
|
|
20821
|
+
letterSpacing: 0.4
|
|
20822
|
+
},
|
|
20823
|
+
children: "Alt"
|
|
20824
|
+
}
|
|
20825
|
+
),
|
|
20826
|
+
/* @__PURE__ */ jsx20(
|
|
20827
|
+
"input",
|
|
20828
|
+
{
|
|
20829
|
+
type: "text",
|
|
20830
|
+
value: draft,
|
|
20831
|
+
onChange: (e) => setDraft(e.target.value),
|
|
20832
|
+
onBlur: () => {
|
|
20833
|
+
if (draft !== value) onCommit(draft);
|
|
20834
|
+
},
|
|
20835
|
+
onKeyDown: (e) => {
|
|
20836
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
20837
|
+
if (e.key === "Escape") {
|
|
20838
|
+
setDraft(value);
|
|
20839
|
+
e.currentTarget.blur();
|
|
20840
|
+
}
|
|
20841
|
+
},
|
|
20842
|
+
placeholder: "Describe this image",
|
|
20843
|
+
"aria-label": "Image alt text",
|
|
20844
|
+
style: {
|
|
20845
|
+
flex: 1,
|
|
20846
|
+
minWidth: 0,
|
|
20847
|
+
border: "none",
|
|
20848
|
+
outline: "none",
|
|
20849
|
+
background: "transparent",
|
|
20850
|
+
fontSize: 12,
|
|
20851
|
+
lineHeight: "16px",
|
|
20852
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
20853
|
+
color: "#1f2937"
|
|
20854
|
+
}
|
|
20855
|
+
}
|
|
20856
|
+
)
|
|
20857
|
+
]
|
|
20858
|
+
}
|
|
20859
|
+
);
|
|
21068
20860
|
}
|
|
21069
20861
|
var VARIANTS = [
|
|
21070
20862
|
{ value: "logos", label: "Logos" },
|
|
21071
20863
|
{ value: "reel", label: "Reel" }
|
|
21072
20864
|
];
|
|
21073
20865
|
var ALIGNS = [
|
|
21074
|
-
{ value: "left", label: "
|
|
21075
|
-
{ value: "center", label: "
|
|
21076
|
-
{ value: "right", label: "
|
|
20866
|
+
{ value: "left", label: "Left" },
|
|
20867
|
+
{ value: "center", label: "Center" },
|
|
20868
|
+
{ value: "right", label: "Right" }
|
|
21077
20869
|
];
|
|
21078
20870
|
var HOVERS = [
|
|
21079
20871
|
{ value: "none", label: "None" },
|
|
@@ -21081,104 +20873,104 @@ var HOVERS = [
|
|
|
21081
20873
|
{ value: "zoom", label: "Zoom" },
|
|
21082
20874
|
{ value: "fade", label: "Fade" }
|
|
21083
20875
|
];
|
|
20876
|
+
var TREATMENTS = [
|
|
20877
|
+
{ value: "color", label: "Color" },
|
|
20878
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
20879
|
+
];
|
|
21084
20880
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
21085
|
-
function
|
|
21086
|
-
|
|
21087
|
-
linkTarget,
|
|
21088
|
-
onClose,
|
|
21089
|
-
onSave
|
|
21090
|
-
}) {
|
|
21091
|
-
const [draft, setDraft] = useState8(href);
|
|
21092
|
-
const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
|
|
20881
|
+
function LinkInput({ value, onCommit }) {
|
|
20882
|
+
const [draft, setDraft] = useState8(value);
|
|
21093
20883
|
const [invalid, setInvalid] = useState8(false);
|
|
21094
|
-
|
|
20884
|
+
useEffect10(() => {
|
|
20885
|
+
setDraft(value);
|
|
20886
|
+
setInvalid(false);
|
|
20887
|
+
}, [value]);
|
|
20888
|
+
const commit2 = () => {
|
|
21095
20889
|
const next = draft.trim();
|
|
21096
|
-
if (next
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
|
|
21100
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
21101
|
-
onClose();
|
|
20890
|
+
if (next === value) return setInvalid(false);
|
|
20891
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
20892
|
+
setInvalid(false);
|
|
20893
|
+
onCommit(next);
|
|
21102
20894
|
};
|
|
21103
|
-
return /* @__PURE__ */
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
"
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21114
|
-
|
|
21115
|
-
|
|
21116
|
-
|
|
21117
|
-
|
|
21118
|
-
|
|
21119
|
-
|
|
21120
|
-
|
|
21121
|
-
"
|
|
21122
|
-
|
|
21123
|
-
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
|
|
21130
|
-
|
|
21131
|
-
|
|
21132
|
-
|
|
21133
|
-
|
|
21134
|
-
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21141
|
-
|
|
21142
|
-
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
|
|
21154
|
-
|
|
21155
|
-
|
|
21156
|
-
|
|
21157
|
-
|
|
21158
|
-
|
|
21159
|
-
|
|
21160
|
-
|
|
21161
|
-
|
|
21162
|
-
|
|
21163
|
-
|
|
21164
|
-
|
|
21165
|
-
|
|
21166
|
-
|
|
21167
|
-
|
|
20895
|
+
return /* @__PURE__ */ jsxs11(
|
|
20896
|
+
"div",
|
|
20897
|
+
{
|
|
20898
|
+
style: {
|
|
20899
|
+
display: "flex",
|
|
20900
|
+
alignItems: "center",
|
|
20901
|
+
gap: 6,
|
|
20902
|
+
height: 28,
|
|
20903
|
+
padding: "0 12px",
|
|
20904
|
+
borderRadius: 999,
|
|
20905
|
+
background: "#ffffff",
|
|
20906
|
+
width: "100%",
|
|
20907
|
+
maxWidth: 260,
|
|
20908
|
+
boxSizing: "border-box",
|
|
20909
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20910
|
+
},
|
|
20911
|
+
children: [
|
|
20912
|
+
/* @__PURE__ */ jsx20(
|
|
20913
|
+
"span",
|
|
20914
|
+
{
|
|
20915
|
+
style: {
|
|
20916
|
+
flex: "0 0 auto",
|
|
20917
|
+
color: OHW_BLUE_DARK,
|
|
20918
|
+
fontSize: 10,
|
|
20919
|
+
fontWeight: 700,
|
|
20920
|
+
textTransform: "uppercase",
|
|
20921
|
+
letterSpacing: 0.4
|
|
20922
|
+
},
|
|
20923
|
+
children: "Link"
|
|
20924
|
+
}
|
|
20925
|
+
),
|
|
20926
|
+
/* @__PURE__ */ jsx20(
|
|
20927
|
+
"input",
|
|
20928
|
+
{
|
|
20929
|
+
type: "text",
|
|
20930
|
+
inputMode: "url",
|
|
20931
|
+
value: draft,
|
|
20932
|
+
onChange: (e) => setDraft(e.target.value),
|
|
20933
|
+
onBlur: commit2,
|
|
20934
|
+
onKeyDown: (e) => {
|
|
20935
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
20936
|
+
if (e.key === "Escape") {
|
|
20937
|
+
setDraft(value);
|
|
20938
|
+
setInvalid(false);
|
|
20939
|
+
e.currentTarget.blur();
|
|
20940
|
+
}
|
|
20941
|
+
},
|
|
20942
|
+
placeholder: "https://example.com",
|
|
20943
|
+
"aria-label": "Image link URL",
|
|
20944
|
+
"aria-invalid": invalid,
|
|
20945
|
+
style: {
|
|
20946
|
+
flex: 1,
|
|
20947
|
+
minWidth: 0,
|
|
20948
|
+
border: "none",
|
|
20949
|
+
outline: "none",
|
|
20950
|
+
background: "transparent",
|
|
20951
|
+
fontSize: 12,
|
|
20952
|
+
lineHeight: "16px",
|
|
20953
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
20954
|
+
color: "#1f2937"
|
|
20955
|
+
}
|
|
20956
|
+
}
|
|
20957
|
+
)
|
|
20958
|
+
]
|
|
20959
|
+
}
|
|
20960
|
+
);
|
|
21168
20961
|
}
|
|
21169
20962
|
function MediaStripToolbar({
|
|
21170
20963
|
entry,
|
|
21171
20964
|
index,
|
|
21172
20965
|
pending,
|
|
21173
20966
|
error,
|
|
21174
|
-
itemEditOn,
|
|
21175
|
-
onToggleItemEdit,
|
|
21176
20967
|
onSetVariant,
|
|
21177
20968
|
onSetAlign,
|
|
21178
20969
|
onSetHover,
|
|
21179
20970
|
onSetTreatment,
|
|
21180
20971
|
onResize,
|
|
21181
|
-
|
|
20972
|
+
onSetAlt,
|
|
20973
|
+
onSetLink,
|
|
21182
20974
|
onAddItem,
|
|
21183
20975
|
onRemoveItem,
|
|
21184
20976
|
onChangeImage,
|
|
@@ -21187,102 +20979,81 @@ function MediaStripToolbar({
|
|
|
21187
20979
|
}) {
|
|
21188
20980
|
const items = mediaStripItems(entry.tree);
|
|
21189
20981
|
const itemCount = items.length;
|
|
20982
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
20983
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
20984
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
21190
20985
|
const slots = findMediaStripSlots(entry.tree);
|
|
21191
20986
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
21192
20987
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
21193
20988
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
21194
20989
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
21195
20990
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
21196
|
-
const
|
|
21197
|
-
const
|
|
21198
|
-
|
|
20991
|
+
const isMobile = window.innerWidth <= 480;
|
|
20992
|
+
const rowStyle = isMobile ? {
|
|
20993
|
+
display: "flex",
|
|
20994
|
+
gap: 6,
|
|
20995
|
+
flexWrap: "nowrap",
|
|
20996
|
+
justifyContent: "center",
|
|
20997
|
+
overflowX: "auto",
|
|
20998
|
+
WebkitOverflowScrolling: "touch",
|
|
20999
|
+
width: "100%",
|
|
21000
|
+
scrollbarWidth: "none"
|
|
21001
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
21002
|
+
return /* @__PURE__ */ jsxs11(
|
|
21199
21003
|
"div",
|
|
21200
21004
|
{
|
|
21201
21005
|
"data-ohw-bridge": "",
|
|
21202
21006
|
"data-ohw-toolbar": "",
|
|
21203
21007
|
onMouseDown: (e) => e.stopPropagation(),
|
|
21204
|
-
|
|
21205
|
-
|
|
21008
|
+
style: {
|
|
21009
|
+
display: "flex",
|
|
21010
|
+
flexDirection: "column",
|
|
21011
|
+
gap: 6,
|
|
21012
|
+
alignItems: "center",
|
|
21013
|
+
background: OHW_BLUE,
|
|
21014
|
+
padding: 8,
|
|
21015
|
+
borderRadius: 12,
|
|
21016
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
21017
|
+
pointerEvents: pending ? "none" : "auto",
|
|
21018
|
+
opacity: pending ? 0.6 : 1,
|
|
21019
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
21020
|
+
},
|
|
21206
21021
|
children: [
|
|
21207
|
-
/* @__PURE__ */
|
|
21208
|
-
|
|
21209
|
-
{
|
|
21210
|
-
|
|
21211
|
-
|
|
21212
|
-
|
|
21213
|
-
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21217
|
-
|
|
21218
|
-
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21225
|
-
|
|
21226
|
-
|
|
21227
|
-
|
|
21228
|
-
|
|
21229
|
-
|
|
21230
|
-
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
) }),
|
|
21240
|
-
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
21241
|
-
] }),
|
|
21242
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21243
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21244
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21245
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21246
|
-
/* @__PURE__ */ jsx21(
|
|
21247
|
-
ToolbarAction,
|
|
21248
|
-
{
|
|
21249
|
-
label: gatedLabel("Move right"),
|
|
21250
|
-
onClick: onMoveRight,
|
|
21251
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
21252
|
-
children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
|
|
21253
|
-
}
|
|
21254
|
-
),
|
|
21255
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21256
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21257
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
21258
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
21259
|
-
/* @__PURE__ */ jsx21(
|
|
21260
|
-
ToolbarAction,
|
|
21261
|
-
{
|
|
21262
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
21263
|
-
active: treatment === "grayscale",
|
|
21264
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
21265
|
-
children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
21266
|
-
}
|
|
21267
|
-
),
|
|
21268
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21269
|
-
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)),
|
|
21270
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21271
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21272
|
-
/* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
21273
|
-
sizeValue,
|
|
21274
|
-
"px"
|
|
21275
|
-
] }),
|
|
21276
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21277
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21278
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
21279
|
-
]
|
|
21280
|
-
}
|
|
21281
|
-
),
|
|
21282
|
-
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 })
|
|
21022
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
21023
|
+
VARIANTS.map((v) => /* @__PURE__ */ jsx20(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
21024
|
+
ALIGNS.map((a) => /* @__PURE__ */ jsx20(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
21025
|
+
] }),
|
|
21026
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
21027
|
+
HOVERS.map((h) => /* @__PURE__ */ jsx20(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
21028
|
+
TREATMENTS.map((t) => /* @__PURE__ */ jsx20(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
21029
|
+
] }),
|
|
21030
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21031
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
21032
|
+
/* @__PURE__ */ jsxs11("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
21033
|
+
sizeValue,
|
|
21034
|
+
"px"
|
|
21035
|
+
] }),
|
|
21036
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+", onClick: () => onResize(8) })
|
|
21037
|
+
] }),
|
|
21038
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
|
|
21039
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
|
|
21040
|
+
currentHref2 && /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
21041
|
+
/* @__PURE__ */ jsx20(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
21042
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
21043
|
+
] }),
|
|
21044
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
21045
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
21046
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
21047
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
21048
|
+
] }),
|
|
21049
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
21050
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
21051
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
21052
|
+
] }),
|
|
21053
|
+
error && /* @__PURE__ */ jsx20("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21283
21054
|
]
|
|
21284
21055
|
}
|
|
21285
|
-
)
|
|
21056
|
+
);
|
|
21286
21057
|
}
|
|
21287
21058
|
function findMediaStripSlots(tree) {
|
|
21288
21059
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -21301,23 +21072,31 @@ function AiMediaStripOverlay({
|
|
|
21301
21072
|
}) {
|
|
21302
21073
|
const [hover, setHover] = useState8(null);
|
|
21303
21074
|
const [active, setActive] = useState8(null);
|
|
21304
|
-
const [itemEditOn, setItemEditOn] = useState8(false);
|
|
21305
|
-
const [linkOpen, setLinkOpen] = useState8(false);
|
|
21306
21075
|
const [pending, setPending] = useState8(false);
|
|
21307
21076
|
const [error, setError] = useState8(null);
|
|
21308
21077
|
const activeRef = useRef5(null);
|
|
21309
21078
|
activeRef.current = active;
|
|
21310
|
-
const linkOpenRef = useRef5(false);
|
|
21311
|
-
linkOpenRef.current = linkOpen;
|
|
21312
21079
|
useEffect10(() => {
|
|
21313
21080
|
const onMove = (e) => {
|
|
21314
|
-
const ref = itemRefFromTarget(e.target);
|
|
21315
21081
|
const t = e.target;
|
|
21316
|
-
|
|
21317
|
-
|
|
21318
|
-
|
|
21319
|
-
|
|
21320
|
-
|
|
21082
|
+
if (!(t instanceof HTMLElement)) return;
|
|
21083
|
+
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]")) {
|
|
21084
|
+
return;
|
|
21085
|
+
}
|
|
21086
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
21087
|
+
if (!itemEl) {
|
|
21088
|
+
setHover(null);
|
|
21089
|
+
return;
|
|
21090
|
+
}
|
|
21091
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
21092
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
21093
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
21094
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
21095
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
21096
|
+
setHover(null);
|
|
21097
|
+
return;
|
|
21098
|
+
}
|
|
21099
|
+
setHover({ sectionId, index });
|
|
21321
21100
|
};
|
|
21322
21101
|
const onLeave = () => setHover(null);
|
|
21323
21102
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -21329,25 +21108,23 @@ function AiMediaStripOverlay({
|
|
|
21329
21108
|
}, []);
|
|
21330
21109
|
useEffect10(() => {
|
|
21331
21110
|
const onClick = (e) => {
|
|
21111
|
+
const current = activeRef.current;
|
|
21112
|
+
if (!current) return;
|
|
21332
21113
|
const t = e.target;
|
|
21333
|
-
if (!(t instanceof
|
|
21334
|
-
if (t.closest(
|
|
21335
|
-
const
|
|
21336
|
-
if (
|
|
21337
|
-
|
|
21338
|
-
setItemEditOn(false);
|
|
21114
|
+
if (!(t instanceof HTMLElement)) return;
|
|
21115
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
21116
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
21117
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
21118
|
+
setActive(null);
|
|
21339
21119
|
setError(null);
|
|
21340
|
-
setActive(ref);
|
|
21341
21120
|
};
|
|
21342
21121
|
document.addEventListener("click", onClick, true);
|
|
21343
21122
|
return () => document.removeEventListener("click", onClick, true);
|
|
21344
|
-
}, [
|
|
21123
|
+
}, []);
|
|
21345
21124
|
useEffect10(() => {
|
|
21346
21125
|
const onBlur = () => {
|
|
21347
21126
|
if (!activeRef.current) return;
|
|
21348
21127
|
setActive(null);
|
|
21349
|
-
setItemEditOn(false);
|
|
21350
|
-
setLinkOpen(false);
|
|
21351
21128
|
setError(null);
|
|
21352
21129
|
};
|
|
21353
21130
|
window.addEventListener("blur", onBlur);
|
|
@@ -21357,10 +21134,7 @@ function AiMediaStripOverlay({
|
|
|
21357
21134
|
const onKeyDown = (e) => {
|
|
21358
21135
|
if (e.key !== "Escape") return;
|
|
21359
21136
|
if (!activeRef.current) return;
|
|
21360
|
-
if (linkOpenRef.current) return;
|
|
21361
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
21362
21137
|
setActive(null);
|
|
21363
|
-
setItemEditOn(false);
|
|
21364
21138
|
setError(null);
|
|
21365
21139
|
};
|
|
21366
21140
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -21394,133 +21168,137 @@ function AiMediaStripOverlay({
|
|
|
21394
21168
|
tree: nextTree,
|
|
21395
21169
|
label: entry.label,
|
|
21396
21170
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
21397
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
21398
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
21399
|
-
// on every edit reads as the section jumping around.
|
|
21400
|
-
skipScrollIntoView: true
|
|
21171
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
21401
21172
|
});
|
|
21402
21173
|
return true;
|
|
21403
21174
|
},
|
|
21404
21175
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
21405
21176
|
);
|
|
21406
21177
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
21178
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
21407
21179
|
const activeItemRect = useLiveItemRect(active);
|
|
21408
|
-
const
|
|
21409
|
-
const
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
|
|
21427
|
-
|
|
21428
|
-
|
|
21429
|
-
|
|
21430
|
-
|
|
21431
|
-
|
|
21432
|
-
|
|
21433
|
-
|
|
21434
|
-
|
|
21435
|
-
|
|
21436
|
-
|
|
21437
|
-
|
|
21438
|
-
|
|
21439
|
-
|
|
21440
|
-
|
|
21441
|
-
|
|
21180
|
+
const TOOLBAR_APPROX_H = 170;
|
|
21181
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21182
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
21183
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx20(
|
|
21184
|
+
"button",
|
|
21185
|
+
{
|
|
21186
|
+
type: "button",
|
|
21187
|
+
"data-ohw-toolbar": "",
|
|
21188
|
+
onClick: () => {
|
|
21189
|
+
clearInteractionChromeRef.current();
|
|
21190
|
+
setActive(hover);
|
|
21191
|
+
},
|
|
21192
|
+
"aria-label": "Configure media item",
|
|
21193
|
+
style: {
|
|
21194
|
+
position: "fixed",
|
|
21195
|
+
top: hoverHandleRect.top + 8,
|
|
21196
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
21197
|
+
width: 28,
|
|
21198
|
+
height: 28,
|
|
21199
|
+
borderRadius: 8,
|
|
21200
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
21201
|
+
background: "#ffffff",
|
|
21202
|
+
color: PRIMARY3,
|
|
21203
|
+
display: "flex",
|
|
21204
|
+
alignItems: "center",
|
|
21205
|
+
justifyContent: "center",
|
|
21206
|
+
cursor: "pointer",
|
|
21207
|
+
zIndex: 2147483643,
|
|
21208
|
+
fontSize: 14,
|
|
21209
|
+
fontWeight: 700
|
|
21210
|
+
},
|
|
21211
|
+
children: /* @__PURE__ */ jsx20(Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21212
|
+
}
|
|
21213
|
+
),
|
|
21214
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
|
|
21215
|
+
ItemInteractionLayer,
|
|
21216
|
+
{
|
|
21217
|
+
rect: activeItemRect,
|
|
21218
|
+
state: toolbarState,
|
|
21219
|
+
toolbar: /* @__PURE__ */ jsx20(
|
|
21220
|
+
MediaStripToolbar,
|
|
21221
|
+
{
|
|
21222
|
+
entry: activeEntry,
|
|
21223
|
+
index: active.index,
|
|
21224
|
+
pending,
|
|
21225
|
+
error,
|
|
21226
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
21227
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
21228
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
21229
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
21230
|
+
onResize: (delta) => {
|
|
21231
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
21232
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
21233
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
21234
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
21235
|
+
},
|
|
21236
|
+
onSetAlt: (alt) => {
|
|
21237
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
21238
|
+
},
|
|
21239
|
+
onSetLink: (href, linkTarget) => {
|
|
21442
21240
|
void runMutation(
|
|
21443
21241
|
active.sectionId,
|
|
21444
|
-
(tree) =>
|
|
21445
|
-
|
|
21446
|
-
|
|
21447
|
-
|
|
21242
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
21243
|
+
);
|
|
21244
|
+
},
|
|
21245
|
+
onAddItem: () => {
|
|
21246
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
21247
|
+
if (!picked) return;
|
|
21248
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
21249
|
+
void runMutation(
|
|
21250
|
+
active.sectionId,
|
|
21251
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
21252
|
+
{ [picked.assetId]: picked.url }
|
|
21253
|
+
).then((applied) => {
|
|
21254
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21255
|
+
});
|
|
21448
21256
|
});
|
|
21449
|
-
}
|
|
21450
|
-
|
|
21451
|
-
|
|
21452
|
-
|
|
21453
|
-
|
|
21454
|
-
|
|
21455
|
-
|
|
21456
|
-
|
|
21457
|
-
|
|
21257
|
+
},
|
|
21258
|
+
onChangeImage: () => {
|
|
21259
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
21260
|
+
if (!picked) return;
|
|
21261
|
+
void runMutation(
|
|
21262
|
+
active.sectionId,
|
|
21263
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
21264
|
+
{ [picked.assetId]: picked.url }
|
|
21265
|
+
);
|
|
21266
|
+
});
|
|
21267
|
+
},
|
|
21268
|
+
onRemoveItem: () => {
|
|
21269
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
21270
|
+
(applied) => {
|
|
21271
|
+
if (applied) setActive(null);
|
|
21272
|
+
}
|
|
21458
21273
|
);
|
|
21459
|
-
}
|
|
21460
|
-
|
|
21461
|
-
|
|
21462
|
-
|
|
21463
|
-
|
|
21464
|
-
|
|
21465
|
-
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
|
-
|
|
21469
|
-
|
|
21470
|
-
|
|
21471
|
-
|
|
21472
|
-
|
|
21473
|
-
|
|
21474
|
-
},
|
|
21475
|
-
onMoveRight: () => {
|
|
21476
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
21477
|
-
(applied) => {
|
|
21478
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21479
|
-
}
|
|
21480
|
-
);
|
|
21481
|
-
}
|
|
21482
|
-
}
|
|
21483
|
-
) }),
|
|
21484
|
-
/* @__PURE__ */ jsx21(
|
|
21485
|
-
"div",
|
|
21486
|
-
{
|
|
21487
|
-
"data-ohw-bridge": "",
|
|
21488
|
-
"data-ohw-item-interaction": "",
|
|
21489
|
-
"aria-hidden": true,
|
|
21490
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
21491
|
-
style: {
|
|
21492
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
21493
|
-
left: activeItemRect.left - 5,
|
|
21494
|
-
background: PRIMARY3,
|
|
21495
|
-
zIndex: 2147483644
|
|
21496
|
-
},
|
|
21497
|
-
children: "Media item"
|
|
21498
|
-
}
|
|
21499
|
-
),
|
|
21500
|
-
linkOpen && /* @__PURE__ */ jsx21(
|
|
21501
|
-
LinkModal,
|
|
21502
|
-
{
|
|
21503
|
-
href: activeHref,
|
|
21504
|
-
linkTarget: activeTarget,
|
|
21505
|
-
onClose: () => setLinkOpen(false),
|
|
21506
|
-
onSave: (href, linkTarget) => {
|
|
21507
|
-
void runMutation(
|
|
21508
|
-
active.sectionId,
|
|
21509
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
21510
|
-
);
|
|
21274
|
+
},
|
|
21275
|
+
onMoveLeft: () => {
|
|
21276
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
21277
|
+
(applied) => {
|
|
21278
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
21279
|
+
}
|
|
21280
|
+
);
|
|
21281
|
+
},
|
|
21282
|
+
onMoveRight: () => {
|
|
21283
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
21284
|
+
(applied) => {
|
|
21285
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21286
|
+
}
|
|
21287
|
+
);
|
|
21288
|
+
}
|
|
21511
21289
|
}
|
|
21512
|
-
|
|
21513
|
-
|
|
21514
|
-
|
|
21290
|
+
)
|
|
21291
|
+
}
|
|
21292
|
+
)
|
|
21515
21293
|
] });
|
|
21516
21294
|
}
|
|
21517
21295
|
|
|
21518
21296
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
21519
|
-
import { useCallback as useCallback4, useEffect as useEffect11, useLayoutEffect as
|
|
21520
|
-
import { Check as
|
|
21521
|
-
import { Fragment as Fragment8, jsx as
|
|
21297
|
+
import { useCallback as useCallback4, useEffect as useEffect11, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState9 } from "react";
|
|
21298
|
+
import { Check as Check2, ChevronDown as ChevronDown3, Minus, Plus as Plus2, Star as Star2 } from "lucide-react";
|
|
21299
|
+
import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
21522
21300
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
21523
|
-
var
|
|
21301
|
+
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]";
|
|
21524
21302
|
function findPricingCardElement(sectionId, index) {
|
|
21525
21303
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21526
21304
|
if (!sectionEl2) return null;
|
|
@@ -21532,7 +21310,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
21532
21310
|
}
|
|
21533
21311
|
function cardRefFromTarget(target) {
|
|
21534
21312
|
if (!(target instanceof Element)) return null;
|
|
21535
|
-
if (target.closest(
|
|
21313
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
21536
21314
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
21537
21315
|
if (!cardEl) return null;
|
|
21538
21316
|
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
@@ -21542,21 +21320,21 @@ function cardRefFromTarget(target) {
|
|
|
21542
21320
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
21543
21321
|
return { sectionId, index };
|
|
21544
21322
|
}
|
|
21545
|
-
function
|
|
21323
|
+
function sameRef(a, b) {
|
|
21546
21324
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
21547
21325
|
}
|
|
21548
|
-
function
|
|
21326
|
+
function rectOf(el) {
|
|
21549
21327
|
if (!el) return null;
|
|
21550
21328
|
const r2 = el.getBoundingClientRect();
|
|
21551
21329
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
21552
21330
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
21553
21331
|
}
|
|
21554
21332
|
function readRect3(ref) {
|
|
21555
|
-
return
|
|
21333
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
21556
21334
|
}
|
|
21557
21335
|
function readGridRect(ref) {
|
|
21558
21336
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
21559
|
-
return
|
|
21337
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
21560
21338
|
}
|
|
21561
21339
|
function useLiveCardRect(ref, grid = false) {
|
|
21562
21340
|
const [rect, setRect] = useState9(null);
|
|
@@ -21586,19 +21364,19 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
21586
21364
|
}
|
|
21587
21365
|
var TOOLBAR_GRID_GAP = 52;
|
|
21588
21366
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
21589
|
-
var
|
|
21367
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
21590
21368
|
function GridToolbarSlot({ gridRect, children }) {
|
|
21591
21369
|
const slotRef = useRef6(null);
|
|
21592
21370
|
const [shift, setShift] = useState9(0);
|
|
21593
21371
|
const centerX = gridRect.left + gridRect.width / 2;
|
|
21594
|
-
|
|
21372
|
+
useLayoutEffect4(() => {
|
|
21595
21373
|
const slot = slotRef.current;
|
|
21596
21374
|
if (!slot) return;
|
|
21597
21375
|
const clamp = () => {
|
|
21598
21376
|
const w = slot.offsetWidth;
|
|
21599
21377
|
if (w <= 0) return;
|
|
21600
21378
|
const half = w / 2;
|
|
21601
|
-
const clamped = Math.max(
|
|
21379
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
21602
21380
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
21603
21381
|
};
|
|
21604
21382
|
clamp();
|
|
@@ -21607,7 +21385,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
21607
21385
|
return () => ro.disconnect();
|
|
21608
21386
|
}, [centerX, children]);
|
|
21609
21387
|
const mobile = window.innerWidth <= 480;
|
|
21610
|
-
return /* @__PURE__ */
|
|
21388
|
+
return /* @__PURE__ */ jsx21(
|
|
21611
21389
|
"div",
|
|
21612
21390
|
{
|
|
21613
21391
|
ref: slotRef,
|
|
@@ -21642,7 +21420,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
21642
21420
|
});
|
|
21643
21421
|
}
|
|
21644
21422
|
function StyleSwatch({ style }) {
|
|
21645
|
-
return /* @__PURE__ */
|
|
21423
|
+
return /* @__PURE__ */ jsx21(
|
|
21646
21424
|
"span",
|
|
21647
21425
|
{
|
|
21648
21426
|
"aria-hidden": true,
|
|
@@ -21656,35 +21434,35 @@ function StyleSwatch({ style }) {
|
|
|
21656
21434
|
);
|
|
21657
21435
|
}
|
|
21658
21436
|
function ButtonGlyph() {
|
|
21659
|
-
return /* @__PURE__ */
|
|
21660
|
-
/* @__PURE__ */
|
|
21661
|
-
/* @__PURE__ */
|
|
21437
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
21438
|
+
/* @__PURE__ */ jsx21("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
21439
|
+
/* @__PURE__ */ jsx21("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
21662
21440
|
] });
|
|
21663
21441
|
}
|
|
21664
21442
|
function FeatureGlyph({ mode }) {
|
|
21665
|
-
return /* @__PURE__ */
|
|
21666
|
-
/* @__PURE__ */
|
|
21667
|
-
/* @__PURE__ */
|
|
21668
|
-
/* @__PURE__ */
|
|
21669
|
-
/* @__PURE__ */
|
|
21670
|
-
/* @__PURE__ */
|
|
21671
|
-
mode === "add" && /* @__PURE__ */
|
|
21443
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
21444
|
+
/* @__PURE__ */ jsx21("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
21445
|
+
/* @__PURE__ */ jsx21("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
21446
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
|
|
21447
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
|
|
21448
|
+
/* @__PURE__ */ jsx21("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
21449
|
+
mode === "add" && /* @__PURE__ */ jsx21("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
21672
21450
|
] });
|
|
21673
21451
|
}
|
|
21674
|
-
function
|
|
21452
|
+
function ToolbarAction({
|
|
21675
21453
|
label,
|
|
21676
21454
|
onClick,
|
|
21677
21455
|
disabled = false,
|
|
21678
21456
|
children
|
|
21679
21457
|
}) {
|
|
21680
|
-
const button = /* @__PURE__ */
|
|
21681
|
-
return /* @__PURE__ */
|
|
21682
|
-
/* @__PURE__ */
|
|
21683
|
-
/* @__PURE__ */
|
|
21458
|
+
const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
21459
|
+
return /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
21460
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
|
|
21461
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
21684
21462
|
] });
|
|
21685
21463
|
}
|
|
21686
|
-
function
|
|
21687
|
-
return /* @__PURE__ */
|
|
21464
|
+
function ToolbarSeparator() {
|
|
21465
|
+
return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
21688
21466
|
}
|
|
21689
21467
|
function CardStyleMenu({
|
|
21690
21468
|
value,
|
|
@@ -21692,7 +21470,7 @@ function CardStyleMenu({
|
|
|
21692
21470
|
disabled = false
|
|
21693
21471
|
}) {
|
|
21694
21472
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
21695
|
-
const trigger = /* @__PURE__ */
|
|
21473
|
+
const trigger = /* @__PURE__ */ jsxs12(
|
|
21696
21474
|
"button",
|
|
21697
21475
|
{
|
|
21698
21476
|
type: "button",
|
|
@@ -21703,28 +21481,28 @@ function CardStyleMenu({
|
|
|
21703
21481
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
21704
21482
|
),
|
|
21705
21483
|
children: [
|
|
21706
|
-
/* @__PURE__ */
|
|
21707
|
-
/* @__PURE__ */
|
|
21708
|
-
/* @__PURE__ */
|
|
21484
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: current.value }),
|
|
21485
|
+
/* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
|
|
21486
|
+
/* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
|
|
21709
21487
|
]
|
|
21710
21488
|
}
|
|
21711
21489
|
);
|
|
21712
21490
|
if (disabled) {
|
|
21713
|
-
return /* @__PURE__ */
|
|
21714
|
-
/* @__PURE__ */
|
|
21715
|
-
/* @__PURE__ */
|
|
21716
|
-
/* @__PURE__ */
|
|
21717
|
-
/* @__PURE__ */
|
|
21491
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
21492
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
21493
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
21494
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: trigger }) }),
|
|
21495
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
21718
21496
|
] })
|
|
21719
21497
|
] });
|
|
21720
21498
|
}
|
|
21721
|
-
return /* @__PURE__ */
|
|
21722
|
-
/* @__PURE__ */
|
|
21723
|
-
/* @__PURE__ */
|
|
21724
|
-
/* @__PURE__ */
|
|
21725
|
-
/* @__PURE__ */
|
|
21499
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
21500
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
21501
|
+
/* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
|
|
21502
|
+
/* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
21503
|
+
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
|
|
21726
21504
|
const selected = style.value === value;
|
|
21727
|
-
return /* @__PURE__ */
|
|
21505
|
+
return /* @__PURE__ */ jsxs12(
|
|
21728
21506
|
DropdownMenuItem,
|
|
21729
21507
|
{
|
|
21730
21508
|
role: "menuitemradio",
|
|
@@ -21732,9 +21510,9 @@ function CardStyleMenu({
|
|
|
21732
21510
|
onSelect: () => onChange(style.value),
|
|
21733
21511
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
21734
21512
|
children: [
|
|
21735
|
-
/* @__PURE__ */
|
|
21736
|
-
/* @__PURE__ */
|
|
21737
|
-
selected && /* @__PURE__ */
|
|
21513
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: style.value }),
|
|
21514
|
+
/* @__PURE__ */ jsx21("span", { children: style.label }),
|
|
21515
|
+
selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
|
|
21738
21516
|
]
|
|
21739
21517
|
},
|
|
21740
21518
|
style.value
|
|
@@ -21764,7 +21542,7 @@ function PricingCardToolbar({
|
|
|
21764
21542
|
const style = pricingCardStyle(entry.tree, index);
|
|
21765
21543
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
21766
21544
|
const mobile = window.innerWidth <= 480;
|
|
21767
|
-
return /* @__PURE__ */
|
|
21545
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
|
|
21768
21546
|
"div",
|
|
21769
21547
|
{
|
|
21770
21548
|
"data-ohw-bridge": "",
|
|
@@ -21776,7 +21554,7 @@ function PricingCardToolbar({
|
|
|
21776
21554
|
),
|
|
21777
21555
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
21778
21556
|
children: [
|
|
21779
|
-
/* @__PURE__ */
|
|
21557
|
+
/* @__PURE__ */ jsxs12(
|
|
21780
21558
|
"div",
|
|
21781
21559
|
{
|
|
21782
21560
|
className: cn(
|
|
@@ -21785,8 +21563,8 @@ function PricingCardToolbar({
|
|
|
21785
21563
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
21786
21564
|
),
|
|
21787
21565
|
children: [
|
|
21788
|
-
/* @__PURE__ */
|
|
21789
|
-
/* @__PURE__ */
|
|
21566
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
21567
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
21790
21568
|
CustomToolbarButton,
|
|
21791
21569
|
{
|
|
21792
21570
|
type: "button",
|
|
@@ -21794,7 +21572,7 @@ function PricingCardToolbar({
|
|
|
21794
21572
|
"aria-pressed": featuredTag,
|
|
21795
21573
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
21796
21574
|
className: "group size-8",
|
|
21797
|
-
children: /* @__PURE__ */
|
|
21575
|
+
children: /* @__PURE__ */ jsx21(
|
|
21798
21576
|
Star2,
|
|
21799
21577
|
{
|
|
21800
21578
|
size: 16,
|
|
@@ -21809,25 +21587,25 @@ function PricingCardToolbar({
|
|
|
21809
21587
|
)
|
|
21810
21588
|
}
|
|
21811
21589
|
) }),
|
|
21812
|
-
/* @__PURE__ */
|
|
21590
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
21813
21591
|
] }),
|
|
21814
|
-
/* @__PURE__ */
|
|
21815
|
-
/* @__PURE__ */
|
|
21816
|
-
/* @__PURE__ */
|
|
21817
|
-
/* @__PURE__ */
|
|
21818
|
-
/* @__PURE__ */
|
|
21819
|
-
/* @__PURE__ */
|
|
21820
|
-
/* @__PURE__ */
|
|
21592
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21593
|
+
/* @__PURE__ */ jsx21(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
21594
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21595
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx21(ButtonGlyph, {}) }),
|
|
21596
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
|
|
21597
|
+
/* @__PURE__ */ jsx21(ButtonGlyph, {}),
|
|
21598
|
+
/* @__PURE__ */ jsx21(Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
|
|
21821
21599
|
] }) }),
|
|
21822
|
-
/* @__PURE__ */
|
|
21823
|
-
/* @__PURE__ */
|
|
21824
|
-
/* @__PURE__ */
|
|
21825
|
-
/* @__PURE__ */
|
|
21826
|
-
/* @__PURE__ */
|
|
21600
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "add" }) }),
|
|
21601
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "remove" }) }),
|
|
21602
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
21603
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21604
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
21827
21605
|
]
|
|
21828
21606
|
}
|
|
21829
21607
|
),
|
|
21830
|
-
error && /* @__PURE__ */
|
|
21608
|
+
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 })
|
|
21831
21609
|
]
|
|
21832
21610
|
}
|
|
21833
21611
|
) });
|
|
@@ -21861,7 +21639,7 @@ function AiPricingCardOverlay({
|
|
|
21861
21639
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
21862
21640
|
setHover((prev) => {
|
|
21863
21641
|
const next = ref && !overEditable ? ref : null;
|
|
21864
|
-
return
|
|
21642
|
+
return sameRef(prev, next) ? prev : next;
|
|
21865
21643
|
});
|
|
21866
21644
|
};
|
|
21867
21645
|
const onLeave = () => setHover(null);
|
|
@@ -21876,10 +21654,10 @@ function AiPricingCardOverlay({
|
|
|
21876
21654
|
const onClick = (e) => {
|
|
21877
21655
|
const t = e.target;
|
|
21878
21656
|
if (!(t instanceof Element)) return;
|
|
21879
|
-
if (t.closest(
|
|
21657
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
21880
21658
|
const ref = cardRefFromTarget(t);
|
|
21881
|
-
setActive((prev) =>
|
|
21882
|
-
if (!ref || !
|
|
21659
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
21660
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
21883
21661
|
};
|
|
21884
21662
|
document.addEventListener("click", onClick, true);
|
|
21885
21663
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -21944,12 +21722,12 @@ function AiPricingCardOverlay({
|
|
|
21944
21722
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
21945
21723
|
const activeCardRect = useLiveCardRect(active);
|
|
21946
21724
|
const activeGridRect = useLiveCardRect(active, true);
|
|
21947
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
21948
|
-
return /* @__PURE__ */
|
|
21949
|
-
hoverRect && /* @__PURE__ */
|
|
21950
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */
|
|
21951
|
-
/* @__PURE__ */
|
|
21952
|
-
/* @__PURE__ */
|
|
21725
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
21726
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
21727
|
+
hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
21728
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
21729
|
+
/* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
21730
|
+
/* @__PURE__ */ jsx21(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx21(
|
|
21953
21731
|
PricingCardToolbar,
|
|
21954
21732
|
{
|
|
21955
21733
|
entry: activeEntry,
|
|
@@ -21977,7 +21755,7 @@ function AiPricingCardOverlay({
|
|
|
21977
21755
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
21978
21756
|
}
|
|
21979
21757
|
) }),
|
|
21980
|
-
/* @__PURE__ */
|
|
21758
|
+
/* @__PURE__ */ jsx21(
|
|
21981
21759
|
"div",
|
|
21982
21760
|
{
|
|
21983
21761
|
"data-ohw-bridge": "",
|
|
@@ -22042,10 +21820,10 @@ function clearVideo(tree, path) {
|
|
|
22042
21820
|
}
|
|
22043
21821
|
|
|
22044
21822
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
22045
|
-
import { Fragment as Fragment9, jsx as
|
|
21823
|
+
import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
22046
21824
|
var PRIMARY5 = "#0885FE";
|
|
22047
|
-
var
|
|
22048
|
-
var
|
|
21825
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
21826
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
22049
21827
|
function findVideoBlockElement(sectionId, path) {
|
|
22050
21828
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
22051
21829
|
if (!sectionEl2) return null;
|
|
@@ -22105,12 +21883,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
22105
21883
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
22106
21884
|
});
|
|
22107
21885
|
}
|
|
22108
|
-
function
|
|
21886
|
+
function Pill2({
|
|
22109
21887
|
label,
|
|
22110
21888
|
onClick,
|
|
22111
21889
|
disabled
|
|
22112
21890
|
}) {
|
|
22113
|
-
return /* @__PURE__ */
|
|
21891
|
+
return /* @__PURE__ */ jsx22(
|
|
22114
21892
|
"button",
|
|
22115
21893
|
{
|
|
22116
21894
|
type: "button",
|
|
@@ -22126,7 +21904,7 @@ function Pill({
|
|
|
22126
21904
|
border: "none",
|
|
22127
21905
|
cursor: disabled ? "default" : "pointer",
|
|
22128
21906
|
background: "#ffffff",
|
|
22129
|
-
color:
|
|
21907
|
+
color: OHW_BLUE_DARK2,
|
|
22130
21908
|
opacity: disabled ? 0.4 : 1,
|
|
22131
21909
|
fontSize: 12,
|
|
22132
21910
|
lineHeight: "16px",
|
|
@@ -22169,8 +21947,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22169
21947
|
onCommit(id);
|
|
22170
21948
|
}
|
|
22171
21949
|
};
|
|
22172
|
-
return /* @__PURE__ */
|
|
22173
|
-
/* @__PURE__ */
|
|
21950
|
+
return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
21951
|
+
/* @__PURE__ */ jsxs13(
|
|
22174
21952
|
"div",
|
|
22175
21953
|
{
|
|
22176
21954
|
style: {
|
|
@@ -22186,12 +21964,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22186
21964
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
22187
21965
|
},
|
|
22188
21966
|
children: [
|
|
22189
|
-
/* @__PURE__ */
|
|
21967
|
+
/* @__PURE__ */ jsx22(
|
|
22190
21968
|
"span",
|
|
22191
21969
|
{
|
|
22192
21970
|
style: {
|
|
22193
21971
|
flex: "0 0 auto",
|
|
22194
|
-
color:
|
|
21972
|
+
color: OHW_BLUE_DARK2,
|
|
22195
21973
|
fontSize: 10,
|
|
22196
21974
|
lineHeight: "16px",
|
|
22197
21975
|
fontWeight: 700,
|
|
@@ -22201,7 +21979,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22201
21979
|
children: "Video"
|
|
22202
21980
|
}
|
|
22203
21981
|
),
|
|
22204
|
-
/* @__PURE__ */
|
|
21982
|
+
/* @__PURE__ */ jsx22(
|
|
22205
21983
|
"input",
|
|
22206
21984
|
{
|
|
22207
21985
|
type: "text",
|
|
@@ -22238,7 +22016,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22238
22016
|
]
|
|
22239
22017
|
}
|
|
22240
22018
|
),
|
|
22241
|
-
invalid && /* @__PURE__ */
|
|
22019
|
+
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." })
|
|
22242
22020
|
] });
|
|
22243
22021
|
}
|
|
22244
22022
|
function VideoToolbar({
|
|
@@ -22248,7 +22026,7 @@ function VideoToolbar({
|
|
|
22248
22026
|
onSetVideoId,
|
|
22249
22027
|
onRemove
|
|
22250
22028
|
}) {
|
|
22251
|
-
return /* @__PURE__ */
|
|
22029
|
+
return /* @__PURE__ */ jsxs13(
|
|
22252
22030
|
"div",
|
|
22253
22031
|
{
|
|
22254
22032
|
"data-ohw-bridge": "",
|
|
@@ -22260,7 +22038,7 @@ function VideoToolbar({
|
|
|
22260
22038
|
gap: 6,
|
|
22261
22039
|
alignItems: "center",
|
|
22262
22040
|
width: 280,
|
|
22263
|
-
background:
|
|
22041
|
+
background: OHW_BLUE2,
|
|
22264
22042
|
padding: 8,
|
|
22265
22043
|
borderRadius: 12,
|
|
22266
22044
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -22268,9 +22046,9 @@ function VideoToolbar({
|
|
|
22268
22046
|
opacity: pending ? 0.6 : 1
|
|
22269
22047
|
},
|
|
22270
22048
|
children: [
|
|
22271
|
-
/* @__PURE__ */
|
|
22272
|
-
/* @__PURE__ */
|
|
22273
|
-
error && /* @__PURE__ */
|
|
22049
|
+
/* @__PURE__ */ jsx22(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
22050
|
+
/* @__PURE__ */ jsx22(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
22051
|
+
error && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
22274
22052
|
]
|
|
22275
22053
|
}
|
|
22276
22054
|
);
|
|
@@ -22390,8 +22168,8 @@ function AiVideoOverlay({
|
|
|
22390
22168
|
const activeBlockRect = useLiveBlockRect(active);
|
|
22391
22169
|
const TOOLBAR_APPROX_H = 90;
|
|
22392
22170
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
22393
|
-
return /* @__PURE__ */
|
|
22394
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
22171
|
+
return /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
22172
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx22(
|
|
22395
22173
|
"button",
|
|
22396
22174
|
{
|
|
22397
22175
|
type: "button",
|
|
@@ -22419,15 +22197,15 @@ function AiVideoOverlay({
|
|
|
22419
22197
|
fontSize: 14,
|
|
22420
22198
|
fontWeight: 700
|
|
22421
22199
|
},
|
|
22422
|
-
children: /* @__PURE__ */
|
|
22200
|
+
children: /* @__PURE__ */ jsx22(Star3, { size: 14, style: { pointerEvents: "none" } })
|
|
22423
22201
|
}
|
|
22424
22202
|
),
|
|
22425
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */
|
|
22203
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx22(
|
|
22426
22204
|
ItemInteractionLayer,
|
|
22427
22205
|
{
|
|
22428
22206
|
rect: activeBlockRect,
|
|
22429
22207
|
state: toolbarState,
|
|
22430
|
-
toolbar: /* @__PURE__ */
|
|
22208
|
+
toolbar: /* @__PURE__ */ jsx22(
|
|
22431
22209
|
VideoToolbar,
|
|
22432
22210
|
{
|
|
22433
22211
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -22502,10 +22280,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
22502
22280
|
}
|
|
22503
22281
|
|
|
22504
22282
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
22505
|
-
import { Fragment as Fragment10, jsx as
|
|
22283
|
+
import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
22506
22284
|
var PRIMARY6 = "#0885FE";
|
|
22507
|
-
var
|
|
22508
|
-
var
|
|
22285
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
22286
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
22509
22287
|
function findCarouselItemElement(sectionId, index) {
|
|
22510
22288
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
22511
22289
|
if (!sectionEl2) return null;
|
|
@@ -22584,8 +22362,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
22584
22362
|
postToParent2({ type: "ow:asset-pick", id });
|
|
22585
22363
|
});
|
|
22586
22364
|
}
|
|
22587
|
-
function
|
|
22588
|
-
return /* @__PURE__ */
|
|
22365
|
+
function Pill3({ label, onClick, disabled }) {
|
|
22366
|
+
return /* @__PURE__ */ jsx23(
|
|
22589
22367
|
"button",
|
|
22590
22368
|
{
|
|
22591
22369
|
type: "button",
|
|
@@ -22601,7 +22379,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
22601
22379
|
border: "none",
|
|
22602
22380
|
cursor: disabled ? "default" : "pointer",
|
|
22603
22381
|
background: "#ffffff",
|
|
22604
|
-
color:
|
|
22382
|
+
color: OHW_BLUE_DARK3,
|
|
22605
22383
|
opacity: disabled ? 0.4 : 1,
|
|
22606
22384
|
fontSize: 12,
|
|
22607
22385
|
lineHeight: "16px",
|
|
@@ -22619,7 +22397,7 @@ function TogglePill({
|
|
|
22619
22397
|
onToggle,
|
|
22620
22398
|
disabled
|
|
22621
22399
|
}) {
|
|
22622
|
-
return /* @__PURE__ */
|
|
22400
|
+
return /* @__PURE__ */ jsxs14(
|
|
22623
22401
|
"button",
|
|
22624
22402
|
{
|
|
22625
22403
|
type: "button",
|
|
@@ -22638,7 +22416,7 @@ function TogglePill({
|
|
|
22638
22416
|
border: "none",
|
|
22639
22417
|
cursor: disabled ? "default" : "pointer",
|
|
22640
22418
|
background: "#ffffff",
|
|
22641
|
-
color:
|
|
22419
|
+
color: OHW_BLUE_DARK3,
|
|
22642
22420
|
opacity: disabled ? 0.4 : 1,
|
|
22643
22421
|
fontSize: 12,
|
|
22644
22422
|
lineHeight: "16px",
|
|
@@ -22648,7 +22426,7 @@ function TogglePill({
|
|
|
22648
22426
|
},
|
|
22649
22427
|
children: [
|
|
22650
22428
|
label,
|
|
22651
|
-
/* @__PURE__ */
|
|
22429
|
+
/* @__PURE__ */ jsx23(
|
|
22652
22430
|
"span",
|
|
22653
22431
|
{
|
|
22654
22432
|
"aria-hidden": true,
|
|
@@ -22661,10 +22439,10 @@ function TogglePill({
|
|
|
22661
22439
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
22662
22440
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
22663
22441
|
// "disabled control" rather than "switch that is off".
|
|
22664
|
-
background: on ?
|
|
22442
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
22665
22443
|
transition: "background 120ms ease"
|
|
22666
22444
|
},
|
|
22667
|
-
children: /* @__PURE__ */
|
|
22445
|
+
children: /* @__PURE__ */ jsx23(
|
|
22668
22446
|
"span",
|
|
22669
22447
|
{
|
|
22670
22448
|
style: {
|
|
@@ -22693,7 +22471,7 @@ function CarouselSlideToolbar({
|
|
|
22693
22471
|
onChangeImage,
|
|
22694
22472
|
onToggleAutoplay
|
|
22695
22473
|
}) {
|
|
22696
|
-
return /* @__PURE__ */
|
|
22474
|
+
return /* @__PURE__ */ jsxs14(
|
|
22697
22475
|
"div",
|
|
22698
22476
|
{
|
|
22699
22477
|
"data-ohw-bridge": "",
|
|
@@ -22704,7 +22482,7 @@ function CarouselSlideToolbar({
|
|
|
22704
22482
|
flexDirection: "column",
|
|
22705
22483
|
gap: 6,
|
|
22706
22484
|
alignItems: "center",
|
|
22707
|
-
background:
|
|
22485
|
+
background: OHW_BLUE3,
|
|
22708
22486
|
padding: 8,
|
|
22709
22487
|
borderRadius: 12,
|
|
22710
22488
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -22716,11 +22494,11 @@ function CarouselSlideToolbar({
|
|
|
22716
22494
|
pointerEvents: pending ? "none" : "auto"
|
|
22717
22495
|
},
|
|
22718
22496
|
children: [
|
|
22719
|
-
/* @__PURE__ */
|
|
22720
|
-
/* @__PURE__ */
|
|
22721
|
-
/* @__PURE__ */
|
|
22497
|
+
/* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
22498
|
+
/* @__PURE__ */ jsx23(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
22499
|
+
/* @__PURE__ */ jsx23(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
22722
22500
|
] }),
|
|
22723
|
-
error && /* @__PURE__ */
|
|
22501
|
+
error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
22724
22502
|
]
|
|
22725
22503
|
}
|
|
22726
22504
|
);
|
|
@@ -22860,8 +22638,8 @@ function AiFadeCarouselOverlay({
|
|
|
22860
22638
|
const activeItemRect = useLiveItemRect2(active);
|
|
22861
22639
|
const TOOLBAR_APPROX_H = 90;
|
|
22862
22640
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
22863
|
-
return /* @__PURE__ */
|
|
22864
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
22641
|
+
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
22642
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx23(
|
|
22865
22643
|
"button",
|
|
22866
22644
|
{
|
|
22867
22645
|
type: "button",
|
|
@@ -22890,10 +22668,10 @@ function AiFadeCarouselOverlay({
|
|
|
22890
22668
|
fontSize: 14,
|
|
22891
22669
|
fontWeight: 700
|
|
22892
22670
|
},
|
|
22893
|
-
children: /* @__PURE__ */
|
|
22671
|
+
children: /* @__PURE__ */ jsx23(Star4, { size: 14, style: { pointerEvents: "none" } })
|
|
22894
22672
|
}
|
|
22895
22673
|
),
|
|
22896
|
-
swapping && /* @__PURE__ */
|
|
22674
|
+
swapping && /* @__PURE__ */ jsx23(
|
|
22897
22675
|
"div",
|
|
22898
22676
|
{
|
|
22899
22677
|
ref: skeletonRef,
|
|
@@ -22911,15 +22689,15 @@ function AiFadeCarouselOverlay({
|
|
|
22911
22689
|
zIndex: 2147483646,
|
|
22912
22690
|
pointerEvents: "none"
|
|
22913
22691
|
},
|
|
22914
|
-
children: /* @__PURE__ */
|
|
22692
|
+
children: /* @__PURE__ */ jsx23("style", { children: MEDIA_SKELETON_CSS })
|
|
22915
22693
|
}
|
|
22916
22694
|
),
|
|
22917
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */
|
|
22695
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx23(
|
|
22918
22696
|
ItemInteractionLayer,
|
|
22919
22697
|
{
|
|
22920
22698
|
rect: activeItemRect,
|
|
22921
22699
|
state: toolbarState,
|
|
22922
|
-
toolbar: /* @__PURE__ */
|
|
22700
|
+
toolbar: /* @__PURE__ */ jsx23(
|
|
22923
22701
|
CarouselSlideToolbar,
|
|
22924
22702
|
{
|
|
22925
22703
|
pending,
|
|
@@ -23157,11 +22935,118 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
23157
22935
|
// src/ui/link-modal/LinkPopover.tsx
|
|
23158
22936
|
import { useEffect as useEffect17 } from "react";
|
|
23159
22937
|
|
|
22938
|
+
// src/ui/dialog.tsx
|
|
22939
|
+
import * as React9 from "react";
|
|
22940
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
22941
|
+
import { X as X2 } from "lucide-react";
|
|
22942
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
22943
|
+
function Dialog2({
|
|
22944
|
+
...props
|
|
22945
|
+
}) {
|
|
22946
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
22947
|
+
}
|
|
22948
|
+
function DialogPortal({
|
|
22949
|
+
...props
|
|
22950
|
+
}) {
|
|
22951
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
|
|
22952
|
+
}
|
|
22953
|
+
function DialogOverlay({
|
|
22954
|
+
className,
|
|
22955
|
+
...props
|
|
22956
|
+
}) {
|
|
22957
|
+
return /* @__PURE__ */ jsx24(
|
|
22958
|
+
DialogPrimitive.Overlay,
|
|
22959
|
+
{
|
|
22960
|
+
"data-slot": "dialog-overlay",
|
|
22961
|
+
"data-ohw-link-modal-root": "",
|
|
22962
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
22963
|
+
...props
|
|
22964
|
+
}
|
|
22965
|
+
);
|
|
22966
|
+
}
|
|
22967
|
+
var DialogContent = React9.forwardRef(
|
|
22968
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
22969
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
22970
|
+
return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
|
|
22971
|
+
/* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
22972
|
+
/* @__PURE__ */ jsxs15(
|
|
22973
|
+
DialogPrimitive.Content,
|
|
22974
|
+
{
|
|
22975
|
+
ref,
|
|
22976
|
+
"data-slot": "dialog-content",
|
|
22977
|
+
className: cn(
|
|
22978
|
+
positionMode,
|
|
22979
|
+
"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",
|
|
22980
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
22981
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
22982
|
+
className
|
|
22983
|
+
),
|
|
22984
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
22985
|
+
...props,
|
|
22986
|
+
children: [
|
|
22987
|
+
children,
|
|
22988
|
+
showCloseButton ? /* @__PURE__ */ jsx24(
|
|
22989
|
+
DialogPrimitive.Close,
|
|
22990
|
+
{
|
|
22991
|
+
type: "button",
|
|
22992
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
22993
|
+
"aria-label": "Close",
|
|
22994
|
+
children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
|
|
22995
|
+
}
|
|
22996
|
+
) : null
|
|
22997
|
+
]
|
|
22998
|
+
}
|
|
22999
|
+
)
|
|
23000
|
+
] });
|
|
23001
|
+
}
|
|
23002
|
+
);
|
|
23003
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
23004
|
+
function DialogHeader({
|
|
23005
|
+
className,
|
|
23006
|
+
...props
|
|
23007
|
+
}) {
|
|
23008
|
+
return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
23009
|
+
}
|
|
23010
|
+
function DialogFooter({
|
|
23011
|
+
className,
|
|
23012
|
+
...props
|
|
23013
|
+
}) {
|
|
23014
|
+
return /* @__PURE__ */ jsx24(
|
|
23015
|
+
"div",
|
|
23016
|
+
{
|
|
23017
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
23018
|
+
...props
|
|
23019
|
+
}
|
|
23020
|
+
);
|
|
23021
|
+
}
|
|
23022
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
23023
|
+
DialogPrimitive.Title,
|
|
23024
|
+
{
|
|
23025
|
+
ref,
|
|
23026
|
+
className: cn(
|
|
23027
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
23028
|
+
className
|
|
23029
|
+
),
|
|
23030
|
+
...props
|
|
23031
|
+
}
|
|
23032
|
+
));
|
|
23033
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
23034
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
23035
|
+
DialogPrimitive.Description,
|
|
23036
|
+
{
|
|
23037
|
+
ref,
|
|
23038
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
23039
|
+
...props
|
|
23040
|
+
}
|
|
23041
|
+
));
|
|
23042
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
23043
|
+
var DialogClose = DialogPrimitive.Close;
|
|
23044
|
+
|
|
23160
23045
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
23161
23046
|
import { Info, X as X4 } from "lucide-react";
|
|
23162
23047
|
|
|
23163
23048
|
// src/ui/link-modal/DestinationBreadcrumb.tsx
|
|
23164
|
-
import { ArrowRight as
|
|
23049
|
+
import { ArrowRight as ArrowRight2, File, GalleryVertical } from "lucide-react";
|
|
23165
23050
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
23166
23051
|
function DestinationBreadcrumb({
|
|
23167
23052
|
pageTitle,
|
|
@@ -23175,7 +23060,7 @@ function DestinationBreadcrumb({
|
|
|
23175
23060
|
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
|
|
23176
23061
|
] }),
|
|
23177
23062
|
/* @__PURE__ */ jsx25(
|
|
23178
|
-
|
|
23063
|
+
ArrowRight2,
|
|
23179
23064
|
{
|
|
23180
23065
|
size: 16,
|
|
23181
23066
|
className: "shrink-0 text-muted-foreground",
|
|
@@ -23287,7 +23172,7 @@ function Label({ className, ...props }) {
|
|
|
23287
23172
|
}
|
|
23288
23173
|
|
|
23289
23174
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
23290
|
-
import { ChevronDown as
|
|
23175
|
+
import { ChevronDown as ChevronDown4, File as File2, X as X3 } from "lucide-react";
|
|
23291
23176
|
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
23292
23177
|
function FieldChevron({
|
|
23293
23178
|
onClick
|
|
@@ -23300,7 +23185,7 @@ function FieldChevron({
|
|
|
23300
23185
|
onClick,
|
|
23301
23186
|
"aria-label": "Open page list",
|
|
23302
23187
|
tabIndex: -1,
|
|
23303
|
-
children: /* @__PURE__ */ jsx29(
|
|
23188
|
+
children: /* @__PURE__ */ jsx29(ChevronDown4, { size: 16 })
|
|
23304
23189
|
}
|
|
23305
23190
|
);
|
|
23306
23191
|
}
|
|
@@ -23530,7 +23415,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
23530
23415
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
23531
23416
|
import { useCallback as useCallback7, useEffect as useEffect15, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
|
|
23532
23417
|
import { createPortal as createPortal2 } from "react-dom";
|
|
23533
|
-
import { ArrowLeft as
|
|
23418
|
+
import { ArrowLeft as ArrowLeft2, Check as Check3 } from "lucide-react";
|
|
23534
23419
|
import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
|
|
23535
23420
|
|
|
23536
23421
|
// src/lib/parent-scroll.ts
|
|
@@ -23807,7 +23692,7 @@ function SectionPickerOverlay({
|
|
|
23807
23692
|
className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
|
|
23808
23693
|
onClick: onBack,
|
|
23809
23694
|
children: [
|
|
23810
|
-
/* @__PURE__ */ jsx31(
|
|
23695
|
+
/* @__PURE__ */ jsx31(ArrowLeft2, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
23811
23696
|
"Back"
|
|
23812
23697
|
]
|
|
23813
23698
|
}
|
|
@@ -23876,7 +23761,7 @@ function SectionPickerOverlay({
|
|
|
23876
23761
|
className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
|
|
23877
23762
|
style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
|
|
23878
23763
|
"aria-hidden": true,
|
|
23879
|
-
children: /* @__PURE__ */ jsx31(
|
|
23764
|
+
children: /* @__PURE__ */ jsx31(Check3, { className: "size-5" })
|
|
23880
23765
|
}
|
|
23881
23766
|
) : null
|
|
23882
23767
|
]
|
|
@@ -24260,7 +24145,6 @@ function shouldUseDevFixtures() {
|
|
|
24260
24145
|
function getLogoElement(el) {
|
|
24261
24146
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
24262
24147
|
if (marked) return marked;
|
|
24263
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
24264
24148
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
24265
24149
|
if (!root) return null;
|
|
24266
24150
|
const anchor = el.closest("a");
|
|
@@ -24330,7 +24214,7 @@ function addFooterColumnWithPersist({
|
|
|
24330
24214
|
import {
|
|
24331
24215
|
useCallback as useCallback9,
|
|
24332
24216
|
useEffect as useEffect18,
|
|
24333
|
-
useLayoutEffect as
|
|
24217
|
+
useLayoutEffect as useLayoutEffect5,
|
|
24334
24218
|
useRef as useRef11,
|
|
24335
24219
|
useState as useState15
|
|
24336
24220
|
} from "react";
|
|
@@ -24427,7 +24311,7 @@ function FloatingPanel({
|
|
|
24427
24311
|
return () => window.removeEventListener("message", onParentScroll);
|
|
24428
24312
|
}, [open]);
|
|
24429
24313
|
const positionRef = useRef11(position);
|
|
24430
|
-
|
|
24314
|
+
useLayoutEffect5(() => {
|
|
24431
24315
|
if (!open) {
|
|
24432
24316
|
positionRef.current = position;
|
|
24433
24317
|
return;
|
|
@@ -24437,7 +24321,7 @@ function FloatingPanel({
|
|
|
24437
24321
|
}
|
|
24438
24322
|
positionRef.current = position;
|
|
24439
24323
|
}, [open, position, liveScroll, parentScroll]);
|
|
24440
|
-
|
|
24324
|
+
useLayoutEffect5(() => {
|
|
24441
24325
|
if (!open || !panelRef.current) return;
|
|
24442
24326
|
const el = panelRef.current;
|
|
24443
24327
|
const header = el.querySelector("[data-ohw-floating-panel-header]");
|
|
@@ -24646,7 +24530,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
|
|
|
24646
24530
|
}
|
|
24647
24531
|
|
|
24648
24532
|
// src/ui/button-style-panel.tsx
|
|
24649
|
-
import { Check as
|
|
24533
|
+
import { Check as Check4 } from "lucide-react";
|
|
24650
24534
|
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
24651
24535
|
var SIZE_LABEL = { s: "S", m: "M", l: "L" };
|
|
24652
24536
|
function ButtonStylePanel({
|
|
@@ -24717,7 +24601,7 @@ function ButtonStylePanel({
|
|
|
24717
24601
|
{
|
|
24718
24602
|
className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
|
|
24719
24603
|
"aria-hidden": true,
|
|
24720
|
-
children: /* @__PURE__ */ jsx35(
|
|
24604
|
+
children: /* @__PURE__ */ jsx35(Check4, { className: "size-3", strokeWidth: 3 })
|
|
24721
24605
|
}
|
|
24722
24606
|
) : null
|
|
24723
24607
|
]
|
|
@@ -25749,7 +25633,7 @@ function useSectionDrag({
|
|
|
25749
25633
|
}
|
|
25750
25634
|
|
|
25751
25635
|
// src/ui/footer-container-chrome.tsx
|
|
25752
|
-
import { Plus as
|
|
25636
|
+
import { Plus as Plus3 } from "lucide-react";
|
|
25753
25637
|
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
25754
25638
|
function FooterContainerChrome({
|
|
25755
25639
|
rect,
|
|
@@ -25790,7 +25674,7 @@ function FooterContainerChrome({
|
|
|
25790
25674
|
if (addDisabled) return;
|
|
25791
25675
|
onAdd();
|
|
25792
25676
|
},
|
|
25793
|
-
children: /* @__PURE__ */ jsx36(
|
|
25677
|
+
children: /* @__PURE__ */ jsx36(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
25794
25678
|
}
|
|
25795
25679
|
) }),
|
|
25796
25680
|
/* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
@@ -26197,7 +26081,7 @@ function retargetPageLinks(change, deps) {
|
|
|
26197
26081
|
}
|
|
26198
26082
|
|
|
26199
26083
|
// src/ui/navbar-container-chrome.tsx
|
|
26200
|
-
import { Plus as
|
|
26084
|
+
import { Plus as Plus4 } from "lucide-react";
|
|
26201
26085
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
26202
26086
|
function NavbarContainerChrome({
|
|
26203
26087
|
rect,
|
|
@@ -26233,7 +26117,7 @@ function NavbarContainerChrome({
|
|
|
26233
26117
|
e.stopPropagation();
|
|
26234
26118
|
onAdd();
|
|
26235
26119
|
},
|
|
26236
|
-
children: /* @__PURE__ */ jsx37(
|
|
26120
|
+
children: /* @__PURE__ */ jsx37(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
26237
26121
|
}
|
|
26238
26122
|
)
|
|
26239
26123
|
}
|
|
@@ -26305,7 +26189,7 @@ function Badge({ className, variant, ...props }) {
|
|
|
26305
26189
|
}
|
|
26306
26190
|
|
|
26307
26191
|
// src/OhhwellsBridge.tsx
|
|
26308
|
-
import { Brush as Brush2, Link as Link2, Plus as
|
|
26192
|
+
import { Brush as Brush2, Link as Link2, Plus as Plus5, Settings, Trash2 as Trash24 } from "lucide-react";
|
|
26309
26193
|
import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
26310
26194
|
var PRIMARY7 = "#0885FE";
|
|
26311
26195
|
var IMAGE_FADE_MS = 300;
|
|
@@ -27083,7 +26967,7 @@ function getNavigationSelectionParent(el) {
|
|
|
27083
26967
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
27084
26968
|
return resolveFooterLinksContainerFrom(el);
|
|
27085
26969
|
}
|
|
27086
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
26970
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
27087
26971
|
return getNavigationRoot(el);
|
|
27088
26972
|
}
|
|
27089
26973
|
return null;
|
|
@@ -27305,6 +27189,7 @@ var ICONS = {
|
|
|
27305
27189
|
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"/>',
|
|
27306
27190
|
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"/>'
|
|
27307
27191
|
};
|
|
27192
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
27308
27193
|
var SELECTION_CHROME_GAP2 = 4;
|
|
27309
27194
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
27310
27195
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -27402,7 +27287,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
27402
27287
|
el.style.top = `${top}px`;
|
|
27403
27288
|
el.style.height = `${height}px`;
|
|
27404
27289
|
}
|
|
27405
|
-
var
|
|
27290
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
27406
27291
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
27407
27292
|
const isAbove = transform.includes("translateY(-100%)");
|
|
27408
27293
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -27429,8 +27314,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
27429
27314
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
27430
27315
|
const half = toolbarWidth / 2;
|
|
27431
27316
|
return Math.max(
|
|
27432
|
-
|
|
27433
|
-
Math.min(centerX, window.innerWidth -
|
|
27317
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
27318
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
27434
27319
|
);
|
|
27435
27320
|
}
|
|
27436
27321
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -27855,7 +27740,7 @@ function OhhwellsBridge() {
|
|
|
27855
27740
|
}, []);
|
|
27856
27741
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
27857
27742
|
const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
|
|
27858
|
-
|
|
27743
|
+
useLayoutEffect6(() => {
|
|
27859
27744
|
const next = resolveSubdomain(subdomainFromQuery);
|
|
27860
27745
|
if (next !== subdomain) setSubdomain(next);
|
|
27861
27746
|
if (next) return;
|
|
@@ -28342,6 +28227,21 @@ function OhhwellsBridge() {
|
|
|
28342
28227
|
const [isItemDragging, setIsItemDragging] = useState18(false);
|
|
28343
28228
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
|
|
28344
28229
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
28230
|
+
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
28231
|
+
const floatingPanelOpenRef = useRef14(false);
|
|
28232
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
28233
|
+
const floatingPanelRef = useRef14(null);
|
|
28234
|
+
floatingPanelRef.current = floatingPanel;
|
|
28235
|
+
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
28236
|
+
const buttonCollectionDragRef = useRef14(null);
|
|
28237
|
+
const buttonDropInsertIndexRef = useRef14(null);
|
|
28238
|
+
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
28239
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
28240
|
+
const buttonPointerDragRef = useRef14(null);
|
|
28241
|
+
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
28242
|
+
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
28243
|
+
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
28244
|
+
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
28345
28245
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
|
|
28346
28246
|
const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
|
|
28347
28247
|
const footerDragRef = useRef14(null);
|
|
@@ -28368,21 +28268,6 @@ function OhhwellsBridge() {
|
|
|
28368
28268
|
const stylesRef = useRef14("");
|
|
28369
28269
|
const appliedDrawerRef = useRef14(null);
|
|
28370
28270
|
const pendingDeleteUndoRef = useRef14(null);
|
|
28371
|
-
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
28372
|
-
const floatingPanelOpenRef = useRef14(false);
|
|
28373
|
-
const floatingPanelRef = useRef14(null);
|
|
28374
|
-
floatingPanelRef.current = floatingPanel;
|
|
28375
|
-
const setFloatingPanelRef = useRef14(setFloatingPanel);
|
|
28376
|
-
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
28377
|
-
const buttonCollectionDragRef = useRef14(null);
|
|
28378
|
-
const buttonDropInsertIndexRef = useRef14(null);
|
|
28379
|
-
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
28380
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
28381
|
-
const buttonPointerDragRef = useRef14(null);
|
|
28382
|
-
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
28383
|
-
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
28384
|
-
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
28385
|
-
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
28386
28271
|
const [sitePages, setSitePages] = useState18([]);
|
|
28387
28272
|
const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
|
|
28388
28273
|
const [sectionsByPath, setSectionsByPath] = useState18({});
|
|
@@ -28392,18 +28277,7 @@ function OhhwellsBridge() {
|
|
|
28392
28277
|
const linkPopoverOpenRef = useRef14(false);
|
|
28393
28278
|
const linkPopoverGraceUntilRef = useRef14(0);
|
|
28394
28279
|
setLinkPopoverRef.current = setLinkPopover;
|
|
28395
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
28396
28280
|
linkPopoverSessionRef.current = linkPopover;
|
|
28397
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
28398
|
-
useEffect22(() => {
|
|
28399
|
-
const syncViewport = () => {
|
|
28400
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
28401
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
28402
|
-
};
|
|
28403
|
-
syncViewport();
|
|
28404
|
-
window.addEventListener("resize", syncViewport);
|
|
28405
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
28406
|
-
}, []);
|
|
28407
28281
|
useEffect22(() => {
|
|
28408
28282
|
setSectionOrderPersistHandler((entries) => {
|
|
28409
28283
|
const currentPath = window.location.pathname;
|
|
@@ -30119,7 +29993,7 @@ function OhhwellsBridge() {
|
|
|
30119
29993
|
isFooterFrameSelection,
|
|
30120
29994
|
postToParent2
|
|
30121
29995
|
]);
|
|
30122
|
-
|
|
29996
|
+
useLayoutEffect6(() => {
|
|
30123
29997
|
if (!subdomain || isEditMode) {
|
|
30124
29998
|
setFetchState("done");
|
|
30125
29999
|
return;
|
|
@@ -30146,7 +30020,6 @@ function OhhwellsBridge() {
|
|
|
30146
30020
|
applyAiFooterFromContent(content);
|
|
30147
30021
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30148
30022
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
30149
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30150
30023
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30151
30024
|
}
|
|
30152
30025
|
applyBrandChrome(content);
|
|
@@ -30157,12 +30030,12 @@ function OhhwellsBridge() {
|
|
|
30157
30030
|
if (key === "__ohw_sections") continue;
|
|
30158
30031
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30159
30032
|
if (key === AI_FOOTER_KEY) continue;
|
|
30160
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30161
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30162
30033
|
if (key === BRAND_KIT_KEY) continue;
|
|
30163
30034
|
if (key === STYLE_STORE_KEY) continue;
|
|
30164
30035
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30036
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30165
30037
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
30038
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30166
30039
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30167
30040
|
continue;
|
|
30168
30041
|
}
|
|
@@ -30397,18 +30270,17 @@ function OhhwellsBridge() {
|
|
|
30397
30270
|
}
|
|
30398
30271
|
applyAiFooterFromContent(content);
|
|
30399
30272
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30400
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30401
30273
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30402
30274
|
}
|
|
30403
30275
|
for (const [key, val] of Object.entries(content)) {
|
|
30404
30276
|
if (key === "__ohw_sections") continue;
|
|
30405
30277
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30406
30278
|
if (key === AI_FOOTER_KEY) continue;
|
|
30407
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30408
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30409
30279
|
if (key === BRAND_KIT_KEY) continue;
|
|
30410
30280
|
if (key === STYLE_STORE_KEY) continue;
|
|
30411
30281
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30282
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30283
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30412
30284
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30413
30285
|
continue;
|
|
30414
30286
|
}
|
|
@@ -30495,7 +30367,7 @@ function OhhwellsBridge() {
|
|
|
30495
30367
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
30496
30368
|
};
|
|
30497
30369
|
}, [subdomain, isEditMode, pathname]);
|
|
30498
|
-
|
|
30370
|
+
useLayoutEffect6(() => {
|
|
30499
30371
|
const el = document.getElementById("ohw-loader");
|
|
30500
30372
|
if (!el) return;
|
|
30501
30373
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
@@ -30680,11 +30552,26 @@ function OhhwellsBridge() {
|
|
|
30680
30552
|
const t2 = setTimeout(measure, 500);
|
|
30681
30553
|
const ro = new ResizeObserver(schedule);
|
|
30682
30554
|
ro.observe(document.body);
|
|
30555
|
+
let lastWidth = window.innerWidth;
|
|
30556
|
+
let resizeTimers = [];
|
|
30557
|
+
const clearResizeTimers = () => {
|
|
30558
|
+
resizeTimers.forEach(clearTimeout);
|
|
30559
|
+
resizeTimers = [];
|
|
30560
|
+
};
|
|
30561
|
+
const handleResize = () => {
|
|
30562
|
+
if (window.innerWidth === lastWidth) return;
|
|
30563
|
+
lastWidth = window.innerWidth;
|
|
30564
|
+
clearResizeTimers();
|
|
30565
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
30566
|
+
};
|
|
30567
|
+
window.addEventListener("resize", handleResize);
|
|
30683
30568
|
return () => {
|
|
30684
30569
|
clearTimeout(t1);
|
|
30685
30570
|
clearTimeout(t2);
|
|
30686
30571
|
if (raf != null) cancelAnimationFrame(raf);
|
|
30687
30572
|
ro.disconnect();
|
|
30573
|
+
clearResizeTimers();
|
|
30574
|
+
window.removeEventListener("resize", handleResize);
|
|
30688
30575
|
};
|
|
30689
30576
|
}, [pathname, isEditMode, postToParent2]);
|
|
30690
30577
|
useEffect22(() => {
|
|
@@ -30981,13 +30868,6 @@ function OhhwellsBridge() {
|
|
|
30981
30868
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
30982
30869
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
30983
30870
|
if (isInsideLinkEditor(target)) return;
|
|
30984
|
-
if (isInsideFloatingPanel(target)) return;
|
|
30985
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
30986
|
-
if (target.closest(
|
|
30987
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
30988
|
-
)) {
|
|
30989
|
-
return;
|
|
30990
|
-
}
|
|
30991
30871
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
30992
30872
|
clearMediaSelectionRef.current();
|
|
30993
30873
|
}
|
|
@@ -31011,6 +30891,8 @@ function OhhwellsBridge() {
|
|
|
31011
30891
|
return;
|
|
31012
30892
|
}
|
|
31013
30893
|
}
|
|
30894
|
+
if (isInsideFloatingPanel(target)) return;
|
|
30895
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
31014
30896
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
31015
30897
|
if (collectionItem) {
|
|
31016
30898
|
e.preventDefault();
|
|
@@ -31022,6 +30904,11 @@ function OhhwellsBridge() {
|
|
|
31022
30904
|
});
|
|
31023
30905
|
return;
|
|
31024
30906
|
}
|
|
30907
|
+
if (target.closest(
|
|
30908
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
30909
|
+
)) {
|
|
30910
|
+
return;
|
|
30911
|
+
}
|
|
31025
30912
|
{
|
|
31026
30913
|
const formEl = getFormElement(target);
|
|
31027
30914
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -31185,13 +31072,9 @@ function OhhwellsBridge() {
|
|
|
31185
31072
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
31186
31073
|
e.preventDefault();
|
|
31187
31074
|
e.stopPropagation();
|
|
31075
|
+
selectIconElementRef.current(editable);
|
|
31188
31076
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
31189
31077
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
31190
|
-
if (aiIcon) {
|
|
31191
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
31192
|
-
} else {
|
|
31193
|
-
selectIconElementRef.current(editable);
|
|
31194
|
-
}
|
|
31195
31078
|
postToParentRef.current({
|
|
31196
31079
|
type: "ow:icon-pick",
|
|
31197
31080
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -31419,9 +31302,6 @@ function OhhwellsBridge() {
|
|
|
31419
31302
|
setHoveredItemRect(null);
|
|
31420
31303
|
hoveredNavContainerRef.current = null;
|
|
31421
31304
|
setHoveredNavContainerRect(null);
|
|
31422
|
-
siblingHintElRef.current = null;
|
|
31423
|
-
setSiblingHintRect(null);
|
|
31424
|
-
setSiblingHintRects([]);
|
|
31425
31305
|
return;
|
|
31426
31306
|
}
|
|
31427
31307
|
{
|
|
@@ -31544,6 +31424,7 @@ function OhhwellsBridge() {
|
|
|
31544
31424
|
hoveredNavContainerRef.current = null;
|
|
31545
31425
|
setHoveredNavContainerRect(null);
|
|
31546
31426
|
hoveredItemElRef.current = editable;
|
|
31427
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
31547
31428
|
}
|
|
31548
31429
|
}
|
|
31549
31430
|
}
|
|
@@ -32250,11 +32131,7 @@ function OhhwellsBridge() {
|
|
|
32250
32131
|
};
|
|
32251
32132
|
const handleMouseMove = (e) => {
|
|
32252
32133
|
const { clientX, clientY } = e;
|
|
32253
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
32254
|
-
dismissImageHover();
|
|
32255
|
-
clearImageHover();
|
|
32256
|
-
return;
|
|
32257
|
-
}
|
|
32134
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
32258
32135
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
32259
32136
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
32260
32137
|
formHoverElRef.current = null;
|
|
@@ -32283,12 +32160,7 @@ function OhhwellsBridge() {
|
|
|
32283
32160
|
setHoveredItemRect(null);
|
|
32284
32161
|
hoveredNavContainerRef.current = null;
|
|
32285
32162
|
setHoveredNavContainerRect(null);
|
|
32286
|
-
siblingHintElRef.current = null;
|
|
32287
|
-
setSiblingHintRect(null);
|
|
32288
|
-
setSiblingHintRects([]);
|
|
32289
32163
|
dismissImageHover();
|
|
32290
|
-
clearImageHover();
|
|
32291
|
-
setSectionGap(null);
|
|
32292
32164
|
return;
|
|
32293
32165
|
}
|
|
32294
32166
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -32300,11 +32172,7 @@ function OhhwellsBridge() {
|
|
|
32300
32172
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
32301
32173
|
const { clientX, clientY } = e.data;
|
|
32302
32174
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
32303
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
32304
|
-
dismissImageHover();
|
|
32305
|
-
clearImageHover();
|
|
32306
|
-
return;
|
|
32307
|
-
}
|
|
32175
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
32308
32176
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
32309
32177
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
32310
32178
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -32684,7 +32552,6 @@ function OhhwellsBridge() {
|
|
|
32684
32552
|
applyAiFooterFromContent(content);
|
|
32685
32553
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
32686
32554
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
32687
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
32688
32555
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
32689
32556
|
}
|
|
32690
32557
|
applyBrandChrome(content);
|
|
@@ -32699,12 +32566,12 @@ function OhhwellsBridge() {
|
|
|
32699
32566
|
}
|
|
32700
32567
|
if (key === AI_SECTIONS_KEY) continue;
|
|
32701
32568
|
if (key === AI_FOOTER_KEY) continue;
|
|
32702
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
32703
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
32704
32569
|
if (key === BRAND_KIT_KEY) continue;
|
|
32705
32570
|
if (key === STYLE_STORE_KEY) continue;
|
|
32706
32571
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
32572
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
32707
32573
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
32574
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
32708
32575
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
32709
32576
|
continue;
|
|
32710
32577
|
}
|
|
@@ -33376,12 +33243,6 @@ function OhhwellsBridge() {
|
|
|
33376
33243
|
closeLinkPopoverRef.current();
|
|
33377
33244
|
return;
|
|
33378
33245
|
}
|
|
33379
|
-
if (floatingPanelOpenRef.current) {
|
|
33380
|
-
setFloatingPanelRef.current(null);
|
|
33381
|
-
deselectRef.current();
|
|
33382
|
-
deactivateRef.current();
|
|
33383
|
-
return;
|
|
33384
|
-
}
|
|
33385
33246
|
deselectRef.current();
|
|
33386
33247
|
deactivateRef.current();
|
|
33387
33248
|
clearMediaSelectionRef.current();
|
|
@@ -34211,10 +34072,10 @@ function OhhwellsBridge() {
|
|
|
34211
34072
|
window.removeEventListener("message", handleDuplicateSection);
|
|
34212
34073
|
window.removeEventListener("message", handleDeactivate);
|
|
34213
34074
|
window.removeEventListener("message", handleSelectNav);
|
|
34075
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
34214
34076
|
window.removeEventListener("message", handleToastAction);
|
|
34215
34077
|
window.removeEventListener("message", handleFormCount);
|
|
34216
34078
|
window.removeEventListener("message", handleUiEscape);
|
|
34217
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
34218
34079
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
34219
34080
|
autoSaveTimers.current.clear();
|
|
34220
34081
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -34508,7 +34369,7 @@ function OhhwellsBridge() {
|
|
|
34508
34369
|
postToParent2({
|
|
34509
34370
|
type: "ow:ready",
|
|
34510
34371
|
version: "1",
|
|
34511
|
-
bridgeVersion: "0.1.
|
|
34372
|
+
bridgeVersion: "0.1.174",
|
|
34512
34373
|
path: pathname,
|
|
34513
34374
|
nodes: collectEditableNodes(editContentRef.current),
|
|
34514
34375
|
sections
|
|
@@ -35399,7 +35260,7 @@ function OhhwellsBridge() {
|
|
|
35399
35260
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
|
|
35400
35261
|
onClick: () => setFieldTypePickerOpen((open) => !open),
|
|
35401
35262
|
"data-ohw-add-field": "",
|
|
35402
|
-
children: /* @__PURE__ */ jsx40(
|
|
35263
|
+
children: /* @__PURE__ */ jsx40(Plus5, { size: 15, "aria-hidden": true })
|
|
35403
35264
|
}
|
|
35404
35265
|
),
|
|
35405
35266
|
/* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),
|