@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.cjs
CHANGED
|
@@ -7031,21 +7031,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
7031
7031
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
7032
7032
|
return target ? pricingFeatureList(target).length : 0;
|
|
7033
7033
|
}
|
|
7034
|
-
function prevailingFeatureIcon(features) {
|
|
7035
|
-
const counts = /* @__PURE__ */ new Map();
|
|
7036
|
-
for (const row of features) {
|
|
7037
|
-
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
7038
|
-
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
7039
|
-
entry.count += 1;
|
|
7040
|
-
counts.set(key, entry);
|
|
7041
|
-
}
|
|
7042
|
-
let best = null;
|
|
7043
|
-
for (const entry of counts.values()) {
|
|
7044
|
-
if (!best || entry.count > best.count) best = entry;
|
|
7045
|
-
}
|
|
7046
|
-
if (!best) return {};
|
|
7047
|
-
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
7048
|
-
}
|
|
7049
7034
|
function addPricingCardFeature(tree, index, text) {
|
|
7050
7035
|
return withPricingCollection(tree, (collection) => {
|
|
7051
7036
|
const children = collection.children;
|
|
@@ -7054,7 +7039,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
7054
7039
|
const features = pricingFeatureList(target);
|
|
7055
7040
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
7056
7041
|
target.slots = target.slots ?? {};
|
|
7057
|
-
target.slots.features = [...features, { text
|
|
7042
|
+
target.slots.features = [...features, { text }];
|
|
7058
7043
|
return true;
|
|
7059
7044
|
});
|
|
7060
7045
|
}
|
|
@@ -8567,7 +8552,7 @@ var AI_MOBILE_CSS = [
|
|
|
8567
8552
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
8568
8553
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
8569
8554
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
8570
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
8555
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
8571
8556
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
8572
8557
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
8573
8558
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -8583,10 +8568,8 @@ var AI_MOBILE_CSS = [
|
|
|
8583
8568
|
"[data-ai-section]{overflow-x:hidden}",
|
|
8584
8569
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
8585
8570
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
8586
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
8587
|
-
|
|
8588
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8589
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
8571
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
8572
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8590
8573
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
8591
8574
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
8592
8575
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8791,31 +8774,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8791
8774
|
function textAttrs(ctx, path) {
|
|
8792
8775
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8793
8776
|
}
|
|
8794
|
-
var AI_RESPONSIVE_CSS = [
|
|
8795
|
-
"@media (max-width: 960px) {",
|
|
8796
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
8797
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
8798
|
-
"}",
|
|
8799
|
-
"@media (max-width: 640px) {",
|
|
8800
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
8801
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
8802
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
8803
|
-
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
8804
|
-
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
8805
|
-
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
8806
|
-
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
8807
|
-
// layered text used to be.
|
|
8808
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
8809
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
8810
|
-
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
8811
|
-
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
8812
|
-
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
8813
|
-
// other rule had already been taught to stand down.
|
|
8814
|
-
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
8815
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
8816
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
8817
|
-
"}"
|
|
8818
|
-
].join("\n");
|
|
8819
8777
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8820
8778
|
function MediaBox({
|
|
8821
8779
|
refValue,
|
|
@@ -8870,7 +8828,7 @@ function MediaBox({
|
|
|
8870
8828
|
position: fill ? "absolute" : void 0,
|
|
8871
8829
|
inset: fill ? 0 : void 0,
|
|
8872
8830
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8873
|
-
height: fill ? "100%" :
|
|
8831
|
+
height: fill ? "100%" : void 0,
|
|
8874
8832
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8875
8833
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8876
8834
|
borderRadius: radius,
|
|
@@ -10372,7 +10330,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
10372
10330
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
10373
10331
|
"div",
|
|
10374
10332
|
{
|
|
10375
|
-
"data-ai-grid":
|
|
10333
|
+
"data-ai-grid": "",
|
|
10376
10334
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
10377
10335
|
style: {
|
|
10378
10336
|
display: "grid",
|
|
@@ -10674,7 +10632,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
10674
10632
|
},
|
|
10675
10633
|
children: [
|
|
10676
10634
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
10677
|
-
// The section's `data-ai-
|
|
10635
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
10678
10636
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
10679
10637
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
10680
10638
|
// the full section width instead of reading at the usual content width.
|
|
@@ -11088,7 +11046,6 @@ function AiTreeRenderer({
|
|
|
11088
11046
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
11089
11047
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
11090
11048
|
...bgAttrs,
|
|
11091
|
-
"data-ai-responsive": "",
|
|
11092
11049
|
style: {
|
|
11093
11050
|
position: "relative",
|
|
11094
11051
|
padding: `${padCss} 0`,
|
|
@@ -11102,13 +11059,12 @@ function AiTreeRenderer({
|
|
|
11102
11059
|
...fillHeight ? { display: "grid" } : {}
|
|
11103
11060
|
},
|
|
11104
11061
|
children: [
|
|
11105
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
|
|
11106
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
11107
11062
|
isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
11063
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
11108
11064
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
11109
11065
|
"div",
|
|
11110
11066
|
{
|
|
11111
|
-
"data-ai-
|
|
11067
|
+
"data-ai-container": "",
|
|
11112
11068
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
11113
11069
|
style: {
|
|
11114
11070
|
position: "relative",
|
|
@@ -11125,7 +11081,7 @@ function AiTreeRenderer({
|
|
|
11125
11081
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
11126
11082
|
"div",
|
|
11127
11083
|
{
|
|
11128
|
-
"data-ai-
|
|
11084
|
+
"data-ai-row": "",
|
|
11129
11085
|
style: {
|
|
11130
11086
|
display: "grid",
|
|
11131
11087
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11787,10 +11743,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11787
11743
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11788
11744
|
continue;
|
|
11789
11745
|
}
|
|
11746
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
11790
11747
|
let container = existing?.container;
|
|
11791
|
-
let isNewMount = false;
|
|
11792
11748
|
if (!container || !container.isConnected) {
|
|
11793
|
-
isNewMount = true;
|
|
11794
11749
|
existing?.root.unmount();
|
|
11795
11750
|
container?.remove();
|
|
11796
11751
|
container = document.createElement("div");
|
|
@@ -12128,34 +12083,6 @@ function minSpanForFooterBlock(type) {
|
|
|
12128
12083
|
return 3;
|
|
12129
12084
|
}
|
|
12130
12085
|
}
|
|
12131
|
-
function readLiveSocialItems() {
|
|
12132
|
-
const root = getFooterRoot();
|
|
12133
|
-
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
12134
|
-
if (!row) return [];
|
|
12135
|
-
const items = [];
|
|
12136
|
-
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
12137
|
-
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
12138
|
-
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
12139
|
-
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
12140
|
-
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
12141
|
-
items.push({ platform, href });
|
|
12142
|
-
}
|
|
12143
|
-
return items;
|
|
12144
|
-
}
|
|
12145
|
-
function syncSocialRowsFromDom(tree) {
|
|
12146
|
-
const root = getFooterRoot();
|
|
12147
|
-
if (!root) return;
|
|
12148
|
-
const row = root.querySelector("[data-ohw-socials-row]");
|
|
12149
|
-
const live = readLiveSocialItems();
|
|
12150
|
-
if (row && live.length === 0) return;
|
|
12151
|
-
for (const col of tree.columns) {
|
|
12152
|
-
col.blocks = col.blocks.flatMap((block) => {
|
|
12153
|
-
if (block.type !== "social-row") return [block];
|
|
12154
|
-
if (!row) return [];
|
|
12155
|
-
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
12156
|
-
});
|
|
12157
|
-
}
|
|
12158
|
-
}
|
|
12159
12086
|
function collectBrandBlocks(tree) {
|
|
12160
12087
|
const brand = [];
|
|
12161
12088
|
for (const col of tree.columns) {
|
|
@@ -12401,7 +12328,6 @@ function textOf2(el) {
|
|
|
12401
12328
|
}
|
|
12402
12329
|
function syncFooterTreeLinksFromDom(tree) {
|
|
12403
12330
|
const next = cloneTree2(tree);
|
|
12404
|
-
syncSocialRowsFromDom(next);
|
|
12405
12331
|
const domCols = listFooterColumns().map((col) => {
|
|
12406
12332
|
const heading = getFooterColumnHeadingEl(col);
|
|
12407
12333
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -19240,7 +19166,7 @@ function apiBase() {
|
|
|
19240
19166
|
function bridgeVersion() {
|
|
19241
19167
|
try {
|
|
19242
19168
|
if (true) {
|
|
19243
|
-
return "0.1.
|
|
19169
|
+
return "0.1.174";
|
|
19244
19170
|
}
|
|
19245
19171
|
} catch {
|
|
19246
19172
|
}
|
|
@@ -19254,7 +19180,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
19254
19180
|
return;
|
|
19255
19181
|
}
|
|
19256
19182
|
try {
|
|
19257
|
-
const v = true ? "0.1.
|
|
19183
|
+
const v = true ? "0.1.174" : "";
|
|
19258
19184
|
if (v) {
|
|
19259
19185
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
19260
19186
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -19935,7 +19861,6 @@ function MediaOverlay({
|
|
|
19935
19861
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
19936
19862
|
);
|
|
19937
19863
|
}, [isVideo]);
|
|
19938
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
19939
19864
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
19940
19865
|
const box = {
|
|
19941
19866
|
position: "fixed",
|
|
@@ -20034,10 +19959,11 @@ function MediaOverlay({
|
|
|
20034
19959
|
className: "flex items-center justify-center cursor-pointer",
|
|
20035
19960
|
style: {
|
|
20036
19961
|
...box,
|
|
20037
|
-
//
|
|
20038
|
-
//
|
|
20039
|
-
//
|
|
20040
|
-
|
|
19962
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
19963
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
19964
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
19965
|
+
// Replace still works.
|
|
19966
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
20041
19967
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
20042
19968
|
// than hovered. Hover keeps the existing tinted preview.
|
|
20043
19969
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -20064,18 +19990,15 @@ function MediaOverlay({
|
|
|
20064
19990
|
},
|
|
20065
19991
|
children: [
|
|
20066
19992
|
isVideo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
|
|
20067
|
-
|
|
19993
|
+
isVideo ? "Replace video" : "Replace image"
|
|
20068
19994
|
]
|
|
20069
19995
|
}
|
|
20070
19996
|
),
|
|
20071
|
-
|
|
19997
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
20072
19998
|
"div",
|
|
20073
19999
|
{
|
|
20074
20000
|
className: "flex items-center gap-1.5",
|
|
20075
|
-
style: {
|
|
20076
|
-
// Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
|
|
20077
|
-
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
|
|
20078
|
-
},
|
|
20001
|
+
style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
|
|
20079
20002
|
onClick: (e) => e.stopPropagation(),
|
|
20080
20003
|
children: [
|
|
20081
20004
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
@@ -20084,7 +20007,7 @@ function MediaOverlay({
|
|
|
20084
20007
|
"data-ohw-media-overlay": "",
|
|
20085
20008
|
variant: "outline",
|
|
20086
20009
|
size: "sm",
|
|
20087
|
-
"aria-label":
|
|
20010
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
20088
20011
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
20089
20012
|
style: {
|
|
20090
20013
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -20105,7 +20028,7 @@ function MediaOverlay({
|
|
|
20105
20028
|
},
|
|
20106
20029
|
children: [
|
|
20107
20030
|
isVideo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
|
|
20108
|
-
replaceMode === "full" ?
|
|
20031
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
20109
20032
|
]
|
|
20110
20033
|
}
|
|
20111
20034
|
),
|
|
@@ -20763,7 +20686,7 @@ function AiSectionOverlay({
|
|
|
20763
20686
|
|
|
20764
20687
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
20765
20688
|
var import_react14 = require("react");
|
|
20766
|
-
var
|
|
20689
|
+
var import_lucide_react8 = require("lucide-react");
|
|
20767
20690
|
|
|
20768
20691
|
// src/lib/ai-media-strip-tree.ts
|
|
20769
20692
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -20877,6 +20800,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
20877
20800
|
return true;
|
|
20878
20801
|
});
|
|
20879
20802
|
}
|
|
20803
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
20804
|
+
return withMediaStrip(tree, (block) => {
|
|
20805
|
+
const items = block.items;
|
|
20806
|
+
if (index < 0 || index >= items.length) return false;
|
|
20807
|
+
items[index] = { ...items[index], alt };
|
|
20808
|
+
return true;
|
|
20809
|
+
});
|
|
20810
|
+
}
|
|
20880
20811
|
function setMediaStripItemLink(tree, index, link) {
|
|
20881
20812
|
return withMediaStrip(tree, (block) => {
|
|
20882
20813
|
const items = block.items;
|
|
@@ -20894,117 +20825,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
20894
20825
|
});
|
|
20895
20826
|
}
|
|
20896
20827
|
|
|
20897
|
-
// src/ui/dialog.tsx
|
|
20898
|
-
var React9 = __toESM(require("react"), 1);
|
|
20899
|
-
var import_radix_ui6 = require("radix-ui");
|
|
20900
|
-
var import_lucide_react8 = require("lucide-react");
|
|
20901
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
20902
|
-
function Dialog2({
|
|
20903
|
-
...props
|
|
20904
|
-
}) {
|
|
20905
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
20906
|
-
}
|
|
20907
|
-
function DialogPortal({
|
|
20908
|
-
...props
|
|
20909
|
-
}) {
|
|
20910
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
20911
|
-
}
|
|
20912
|
-
function DialogOverlay({
|
|
20913
|
-
className,
|
|
20914
|
-
...props
|
|
20915
|
-
}) {
|
|
20916
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20917
|
-
import_radix_ui6.Dialog.Overlay,
|
|
20918
|
-
{
|
|
20919
|
-
"data-slot": "dialog-overlay",
|
|
20920
|
-
"data-ohw-link-modal-root": "",
|
|
20921
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
20922
|
-
...props
|
|
20923
|
-
}
|
|
20924
|
-
);
|
|
20925
|
-
}
|
|
20926
|
-
var DialogContent = React9.forwardRef(
|
|
20927
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
20928
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
20929
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
20930
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
20931
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
20932
|
-
import_radix_ui6.Dialog.Content,
|
|
20933
|
-
{
|
|
20934
|
-
ref,
|
|
20935
|
-
"data-slot": "dialog-content",
|
|
20936
|
-
className: cn(
|
|
20937
|
-
positionMode,
|
|
20938
|
-
"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",
|
|
20939
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
20940
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
20941
|
-
className
|
|
20942
|
-
),
|
|
20943
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
20944
|
-
...props,
|
|
20945
|
-
children: [
|
|
20946
|
-
children,
|
|
20947
|
-
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20948
|
-
import_radix_ui6.Dialog.Close,
|
|
20949
|
-
{
|
|
20950
|
-
type: "button",
|
|
20951
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
20952
|
-
"aria-label": "Close",
|
|
20953
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
|
|
20954
|
-
}
|
|
20955
|
-
) : null
|
|
20956
|
-
]
|
|
20957
|
-
}
|
|
20958
|
-
)
|
|
20959
|
-
] });
|
|
20960
|
-
}
|
|
20961
|
-
);
|
|
20962
|
-
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
20963
|
-
function DialogHeader({
|
|
20964
|
-
className,
|
|
20965
|
-
...props
|
|
20966
|
-
}) {
|
|
20967
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
20968
|
-
}
|
|
20969
|
-
function DialogFooter({
|
|
20970
|
-
className,
|
|
20971
|
-
...props
|
|
20972
|
-
}) {
|
|
20973
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20974
|
-
"div",
|
|
20975
|
-
{
|
|
20976
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
20977
|
-
...props
|
|
20978
|
-
}
|
|
20979
|
-
);
|
|
20980
|
-
}
|
|
20981
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20982
|
-
import_radix_ui6.Dialog.Title,
|
|
20983
|
-
{
|
|
20984
|
-
ref,
|
|
20985
|
-
className: cn(
|
|
20986
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
20987
|
-
className
|
|
20988
|
-
),
|
|
20989
|
-
...props
|
|
20990
|
-
}
|
|
20991
|
-
));
|
|
20992
|
-
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
20993
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20994
|
-
import_radix_ui6.Dialog.Description,
|
|
20995
|
-
{
|
|
20996
|
-
ref,
|
|
20997
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
20998
|
-
...props
|
|
20999
|
-
}
|
|
21000
|
-
));
|
|
21001
|
-
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
21002
|
-
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
21003
|
-
|
|
21004
20828
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
21005
|
-
var
|
|
21006
|
-
var PRIMARY3 = "
|
|
21007
|
-
var
|
|
20829
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
20830
|
+
var PRIMARY3 = "#0885FE";
|
|
20831
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
20832
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
21008
20833
|
function findMediaStripItemElement(sectionId, index) {
|
|
21009
20834
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21010
20835
|
if (!sectionEl2) return null;
|
|
@@ -21014,35 +20839,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
21014
20839
|
}
|
|
21015
20840
|
return null;
|
|
21016
20841
|
}
|
|
21017
|
-
function
|
|
21018
|
-
|
|
21019
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
21020
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
21021
|
-
if (!itemEl) return null;
|
|
21022
|
-
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
21023
|
-
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
21024
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
21025
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
21026
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
21027
|
-
return { sectionId, index };
|
|
21028
|
-
}
|
|
21029
|
-
function sameRef(a, b) {
|
|
21030
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
21031
|
-
}
|
|
21032
|
-
function rectOf(el) {
|
|
20842
|
+
function readRect2(ref) {
|
|
20843
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
21033
20844
|
if (!el) return null;
|
|
21034
20845
|
const r2 = el.getBoundingClientRect();
|
|
21035
20846
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
21036
20847
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
21037
20848
|
}
|
|
21038
|
-
function
|
|
21039
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
21040
|
-
}
|
|
21041
|
-
function readStripRect(ref) {
|
|
21042
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
21043
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
21044
|
-
}
|
|
21045
|
-
function useLiveItemRect(ref, strip = false) {
|
|
20849
|
+
function useLiveItemRect(ref) {
|
|
21046
20850
|
const [rect, setRect] = (0, import_react14.useState)(null);
|
|
21047
20851
|
(0, import_react14.useEffect)(() => {
|
|
21048
20852
|
if (!ref) {
|
|
@@ -21050,7 +20854,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
21050
20854
|
return;
|
|
21051
20855
|
}
|
|
21052
20856
|
const update = () => {
|
|
21053
|
-
const next =
|
|
20857
|
+
const next = readRect2(ref);
|
|
21054
20858
|
setRect(
|
|
21055
20859
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
21056
20860
|
);
|
|
@@ -21065,49 +20869,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
21065
20869
|
window.removeEventListener("resize", update);
|
|
21066
20870
|
clearInterval(interval);
|
|
21067
20871
|
};
|
|
21068
|
-
}, [ref?.sectionId, ref?.index
|
|
20872
|
+
}, [ref?.sectionId, ref?.index]);
|
|
21069
20873
|
return rect;
|
|
21070
20874
|
}
|
|
21071
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
21072
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
21073
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
21074
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
21075
|
-
const slotRef = (0, import_react14.useRef)(null);
|
|
21076
|
-
const [shift, setShift] = (0, import_react14.useState)(0);
|
|
21077
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
21078
|
-
(0, import_react14.useLayoutEffect)(() => {
|
|
21079
|
-
const slot = slotRef.current;
|
|
21080
|
-
if (!slot) return;
|
|
21081
|
-
const clamp = () => {
|
|
21082
|
-
const w = slot.offsetWidth;
|
|
21083
|
-
if (w <= 0) return;
|
|
21084
|
-
const half = w / 2;
|
|
21085
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
21086
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
21087
|
-
};
|
|
21088
|
-
clamp();
|
|
21089
|
-
const ro = new ResizeObserver(clamp);
|
|
21090
|
-
ro.observe(slot);
|
|
21091
|
-
return () => ro.disconnect();
|
|
21092
|
-
}, [centerX, children]);
|
|
21093
|
-
const mobile = window.innerWidth <= 480;
|
|
21094
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21095
|
-
"div",
|
|
21096
|
-
{
|
|
21097
|
-
ref: slotRef,
|
|
21098
|
-
"data-ohw-bridge": "",
|
|
21099
|
-
"data-ohw-item-interaction": "",
|
|
21100
|
-
className: "pointer-events-auto fixed",
|
|
21101
|
-
style: {
|
|
21102
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
21103
|
-
left: centerX + shift,
|
|
21104
|
-
transform: "translate(-50%, -100%)",
|
|
21105
|
-
zIndex: 2147483645
|
|
21106
|
-
},
|
|
21107
|
-
children
|
|
21108
|
-
}
|
|
21109
|
-
);
|
|
21110
|
-
}
|
|
21111
20875
|
function requestValidateTree(postToParent2, tree) {
|
|
21112
20876
|
return new Promise((resolve) => {
|
|
21113
20877
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -21144,72 +20908,116 @@ function requestAssetPick(postToParent2) {
|
|
|
21144
20908
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21145
20909
|
});
|
|
21146
20910
|
}
|
|
21147
|
-
function
|
|
20911
|
+
function Pill({
|
|
21148
20912
|
label,
|
|
21149
20913
|
onClick,
|
|
21150
|
-
disabled
|
|
21151
|
-
active
|
|
21152
|
-
children
|
|
20914
|
+
disabled,
|
|
20915
|
+
active
|
|
21153
20916
|
}) {
|
|
21154
|
-
|
|
21155
|
-
|
|
21156
|
-
|
|
21157
|
-
|
|
21158
|
-
|
|
21159
|
-
|
|
21160
|
-
|
|
21161
|
-
|
|
20917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20918
|
+
"button",
|
|
20919
|
+
{
|
|
20920
|
+
type: "button",
|
|
20921
|
+
onClick,
|
|
20922
|
+
disabled,
|
|
20923
|
+
style: {
|
|
20924
|
+
height: 28,
|
|
20925
|
+
padding: "0 10px",
|
|
20926
|
+
display: "inline-flex",
|
|
20927
|
+
alignItems: "center",
|
|
20928
|
+
gap: 4,
|
|
20929
|
+
borderRadius: 999,
|
|
20930
|
+
border: "none",
|
|
20931
|
+
cursor: disabled ? "default" : "pointer",
|
|
20932
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
20933
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
20934
|
+
opacity: disabled ? 0.4 : 1,
|
|
20935
|
+
fontSize: 12,
|
|
20936
|
+
lineHeight: "16px",
|
|
20937
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
20938
|
+
whiteSpace: "nowrap",
|
|
20939
|
+
flex: "0 0 auto"
|
|
20940
|
+
},
|
|
20941
|
+
children: label
|
|
20942
|
+
}
|
|
20943
|
+
);
|
|
21162
20944
|
}
|
|
21163
|
-
function
|
|
21164
|
-
|
|
21165
|
-
value,
|
|
21166
|
-
|
|
21167
|
-
|
|
21168
|
-
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21172
|
-
|
|
21173
|
-
|
|
21174
|
-
"
|
|
21175
|
-
|
|
21176
|
-
|
|
21177
|
-
|
|
21178
|
-
|
|
21179
|
-
|
|
21180
|
-
|
|
21181
|
-
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
) }),
|
|
21185
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
21186
|
-
const selected = option.value === value;
|
|
21187
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
21188
|
-
DropdownMenuItem,
|
|
20945
|
+
function AltInput({ value, onCommit }) {
|
|
20946
|
+
const [draft, setDraft] = (0, import_react14.useState)(value);
|
|
20947
|
+
(0, import_react14.useEffect)(() => setDraft(value), [value]);
|
|
20948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
20949
|
+
"div",
|
|
20950
|
+
{
|
|
20951
|
+
style: {
|
|
20952
|
+
display: "flex",
|
|
20953
|
+
alignItems: "center",
|
|
20954
|
+
gap: 6,
|
|
20955
|
+
height: 28,
|
|
20956
|
+
padding: "0 12px",
|
|
20957
|
+
borderRadius: 999,
|
|
20958
|
+
background: "#ffffff",
|
|
20959
|
+
width: "100%",
|
|
20960
|
+
maxWidth: 260,
|
|
20961
|
+
boxSizing: "border-box"
|
|
20962
|
+
},
|
|
20963
|
+
children: [
|
|
20964
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20965
|
+
"span",
|
|
21189
20966
|
{
|
|
21190
|
-
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
|
|
21194
|
-
|
|
21195
|
-
|
|
21196
|
-
|
|
21197
|
-
|
|
21198
|
-
|
|
21199
|
-
|
|
21200
|
-
)
|
|
21201
|
-
|
|
21202
|
-
|
|
21203
|
-
|
|
21204
|
-
|
|
20967
|
+
style: {
|
|
20968
|
+
flex: "0 0 auto",
|
|
20969
|
+
color: OHW_BLUE_DARK,
|
|
20970
|
+
fontSize: 10,
|
|
20971
|
+
fontWeight: 700,
|
|
20972
|
+
textTransform: "uppercase",
|
|
20973
|
+
letterSpacing: 0.4
|
|
20974
|
+
},
|
|
20975
|
+
children: "Alt"
|
|
20976
|
+
}
|
|
20977
|
+
),
|
|
20978
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
20979
|
+
"input",
|
|
20980
|
+
{
|
|
20981
|
+
type: "text",
|
|
20982
|
+
value: draft,
|
|
20983
|
+
onChange: (e) => setDraft(e.target.value),
|
|
20984
|
+
onBlur: () => {
|
|
20985
|
+
if (draft !== value) onCommit(draft);
|
|
20986
|
+
},
|
|
20987
|
+
onKeyDown: (e) => {
|
|
20988
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
20989
|
+
if (e.key === "Escape") {
|
|
20990
|
+
setDraft(value);
|
|
20991
|
+
e.currentTarget.blur();
|
|
20992
|
+
}
|
|
20993
|
+
},
|
|
20994
|
+
placeholder: "Describe this image",
|
|
20995
|
+
"aria-label": "Image alt text",
|
|
20996
|
+
style: {
|
|
20997
|
+
flex: 1,
|
|
20998
|
+
minWidth: 0,
|
|
20999
|
+
border: "none",
|
|
21000
|
+
outline: "none",
|
|
21001
|
+
background: "transparent",
|
|
21002
|
+
fontSize: 12,
|
|
21003
|
+
lineHeight: "16px",
|
|
21004
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
21005
|
+
color: "#1f2937"
|
|
21006
|
+
}
|
|
21007
|
+
}
|
|
21008
|
+
)
|
|
21009
|
+
]
|
|
21010
|
+
}
|
|
21011
|
+
);
|
|
21012
|
+
}
|
|
21205
21013
|
var VARIANTS = [
|
|
21206
21014
|
{ value: "logos", label: "Logos" },
|
|
21207
21015
|
{ value: "reel", label: "Reel" }
|
|
21208
21016
|
];
|
|
21209
21017
|
var ALIGNS = [
|
|
21210
|
-
{ value: "left", label: "
|
|
21211
|
-
{ value: "center", label: "
|
|
21212
|
-
{ value: "right", label: "
|
|
21018
|
+
{ value: "left", label: "Left" },
|
|
21019
|
+
{ value: "center", label: "Center" },
|
|
21020
|
+
{ value: "right", label: "Right" }
|
|
21213
21021
|
];
|
|
21214
21022
|
var HOVERS = [
|
|
21215
21023
|
{ value: "none", label: "None" },
|
|
@@ -21217,104 +21025,104 @@ var HOVERS = [
|
|
|
21217
21025
|
{ value: "zoom", label: "Zoom" },
|
|
21218
21026
|
{ value: "fade", label: "Fade" }
|
|
21219
21027
|
];
|
|
21028
|
+
var TREATMENTS = [
|
|
21029
|
+
{ value: "color", label: "Color" },
|
|
21030
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
21031
|
+
];
|
|
21220
21032
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
21221
|
-
function
|
|
21222
|
-
|
|
21223
|
-
linkTarget,
|
|
21224
|
-
onClose,
|
|
21225
|
-
onSave
|
|
21226
|
-
}) {
|
|
21227
|
-
const [draft, setDraft] = (0, import_react14.useState)(href);
|
|
21228
|
-
const [newTab, setNewTab] = (0, import_react14.useState)(linkTarget !== "same-tab");
|
|
21033
|
+
function LinkInput({ value, onCommit }) {
|
|
21034
|
+
const [draft, setDraft] = (0, import_react14.useState)(value);
|
|
21229
21035
|
const [invalid, setInvalid] = (0, import_react14.useState)(false);
|
|
21230
|
-
|
|
21036
|
+
(0, import_react14.useEffect)(() => {
|
|
21037
|
+
setDraft(value);
|
|
21038
|
+
setInvalid(false);
|
|
21039
|
+
}, [value]);
|
|
21040
|
+
const commit2 = () => {
|
|
21231
21041
|
const next = draft.trim();
|
|
21232
|
-
if (next
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
21237
|
-
onClose();
|
|
21042
|
+
if (next === value) return setInvalid(false);
|
|
21043
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
21044
|
+
setInvalid(false);
|
|
21045
|
+
onCommit(next);
|
|
21238
21046
|
};
|
|
21239
|
-
return /* @__PURE__ */ (0,
|
|
21240
|
-
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
"
|
|
21244
|
-
|
|
21245
|
-
|
|
21246
|
-
|
|
21247
|
-
|
|
21248
|
-
|
|
21249
|
-
|
|
21250
|
-
|
|
21251
|
-
|
|
21252
|
-
|
|
21253
|
-
|
|
21254
|
-
|
|
21255
|
-
|
|
21256
|
-
|
|
21257
|
-
"
|
|
21258
|
-
|
|
21259
|
-
|
|
21260
|
-
|
|
21261
|
-
|
|
21262
|
-
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
|
|
21273
|
-
|
|
21274
|
-
|
|
21275
|
-
|
|
21276
|
-
|
|
21277
|
-
|
|
21278
|
-
|
|
21279
|
-
|
|
21280
|
-
|
|
21281
|
-
|
|
21282
|
-
|
|
21283
|
-
|
|
21284
|
-
|
|
21285
|
-
|
|
21286
|
-
|
|
21287
|
-
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
21292
|
-
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21298
|
-
|
|
21299
|
-
|
|
21300
|
-
|
|
21301
|
-
|
|
21302
|
-
|
|
21303
|
-
|
|
21047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
21048
|
+
"div",
|
|
21049
|
+
{
|
|
21050
|
+
style: {
|
|
21051
|
+
display: "flex",
|
|
21052
|
+
alignItems: "center",
|
|
21053
|
+
gap: 6,
|
|
21054
|
+
height: 28,
|
|
21055
|
+
padding: "0 12px",
|
|
21056
|
+
borderRadius: 999,
|
|
21057
|
+
background: "#ffffff",
|
|
21058
|
+
width: "100%",
|
|
21059
|
+
maxWidth: 260,
|
|
21060
|
+
boxSizing: "border-box",
|
|
21061
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
21062
|
+
},
|
|
21063
|
+
children: [
|
|
21064
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21065
|
+
"span",
|
|
21066
|
+
{
|
|
21067
|
+
style: {
|
|
21068
|
+
flex: "0 0 auto",
|
|
21069
|
+
color: OHW_BLUE_DARK,
|
|
21070
|
+
fontSize: 10,
|
|
21071
|
+
fontWeight: 700,
|
|
21072
|
+
textTransform: "uppercase",
|
|
21073
|
+
letterSpacing: 0.4
|
|
21074
|
+
},
|
|
21075
|
+
children: "Link"
|
|
21076
|
+
}
|
|
21077
|
+
),
|
|
21078
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21079
|
+
"input",
|
|
21080
|
+
{
|
|
21081
|
+
type: "text",
|
|
21082
|
+
inputMode: "url",
|
|
21083
|
+
value: draft,
|
|
21084
|
+
onChange: (e) => setDraft(e.target.value),
|
|
21085
|
+
onBlur: commit2,
|
|
21086
|
+
onKeyDown: (e) => {
|
|
21087
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
21088
|
+
if (e.key === "Escape") {
|
|
21089
|
+
setDraft(value);
|
|
21090
|
+
setInvalid(false);
|
|
21091
|
+
e.currentTarget.blur();
|
|
21092
|
+
}
|
|
21093
|
+
},
|
|
21094
|
+
placeholder: "https://example.com",
|
|
21095
|
+
"aria-label": "Image link URL",
|
|
21096
|
+
"aria-invalid": invalid,
|
|
21097
|
+
style: {
|
|
21098
|
+
flex: 1,
|
|
21099
|
+
minWidth: 0,
|
|
21100
|
+
border: "none",
|
|
21101
|
+
outline: "none",
|
|
21102
|
+
background: "transparent",
|
|
21103
|
+
fontSize: 12,
|
|
21104
|
+
lineHeight: "16px",
|
|
21105
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
21106
|
+
color: "#1f2937"
|
|
21107
|
+
}
|
|
21108
|
+
}
|
|
21109
|
+
)
|
|
21110
|
+
]
|
|
21111
|
+
}
|
|
21112
|
+
);
|
|
21304
21113
|
}
|
|
21305
21114
|
function MediaStripToolbar({
|
|
21306
21115
|
entry,
|
|
21307
21116
|
index,
|
|
21308
21117
|
pending,
|
|
21309
21118
|
error,
|
|
21310
|
-
itemEditOn,
|
|
21311
|
-
onToggleItemEdit,
|
|
21312
21119
|
onSetVariant,
|
|
21313
21120
|
onSetAlign,
|
|
21314
21121
|
onSetHover,
|
|
21315
21122
|
onSetTreatment,
|
|
21316
21123
|
onResize,
|
|
21317
|
-
|
|
21124
|
+
onSetAlt,
|
|
21125
|
+
onSetLink,
|
|
21318
21126
|
onAddItem,
|
|
21319
21127
|
onRemoveItem,
|
|
21320
21128
|
onChangeImage,
|
|
@@ -21323,102 +21131,81 @@ function MediaStripToolbar({
|
|
|
21323
21131
|
}) {
|
|
21324
21132
|
const items = mediaStripItems(entry.tree);
|
|
21325
21133
|
const itemCount = items.length;
|
|
21134
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
21135
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
21136
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
21326
21137
|
const slots = findMediaStripSlots(entry.tree);
|
|
21327
21138
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
21328
21139
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
21329
21140
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
21330
21141
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
21331
21142
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
21332
|
-
const
|
|
21333
|
-
const
|
|
21334
|
-
|
|
21143
|
+
const isMobile = window.innerWidth <= 480;
|
|
21144
|
+
const rowStyle = isMobile ? {
|
|
21145
|
+
display: "flex",
|
|
21146
|
+
gap: 6,
|
|
21147
|
+
flexWrap: "nowrap",
|
|
21148
|
+
justifyContent: "center",
|
|
21149
|
+
overflowX: "auto",
|
|
21150
|
+
WebkitOverflowScrolling: "touch",
|
|
21151
|
+
width: "100%",
|
|
21152
|
+
scrollbarWidth: "none"
|
|
21153
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
21154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
21335
21155
|
"div",
|
|
21336
21156
|
{
|
|
21337
21157
|
"data-ohw-bridge": "",
|
|
21338
21158
|
"data-ohw-toolbar": "",
|
|
21339
21159
|
onMouseDown: (e) => e.stopPropagation(),
|
|
21340
|
-
|
|
21341
|
-
|
|
21160
|
+
style: {
|
|
21161
|
+
display: "flex",
|
|
21162
|
+
flexDirection: "column",
|
|
21163
|
+
gap: 6,
|
|
21164
|
+
alignItems: "center",
|
|
21165
|
+
background: OHW_BLUE,
|
|
21166
|
+
padding: 8,
|
|
21167
|
+
borderRadius: 12,
|
|
21168
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
21169
|
+
pointerEvents: pending ? "none" : "auto",
|
|
21170
|
+
opacity: pending ? 0.6 : 1,
|
|
21171
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
21172
|
+
},
|
|
21342
21173
|
children: [
|
|
21343
|
-
/* @__PURE__ */ (0,
|
|
21344
|
-
|
|
21345
|
-
{
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21349
|
-
|
|
21350
|
-
|
|
21351
|
-
|
|
21352
|
-
|
|
21353
|
-
|
|
21354
|
-
|
|
21355
|
-
|
|
21356
|
-
|
|
21357
|
-
|
|
21358
|
-
|
|
21359
|
-
|
|
21360
|
-
|
|
21361
|
-
|
|
21362
|
-
|
|
21363
|
-
|
|
21364
|
-
|
|
21365
|
-
|
|
21366
|
-
|
|
21367
|
-
|
|
21368
|
-
|
|
21369
|
-
|
|
21370
|
-
|
|
21371
|
-
|
|
21372
|
-
|
|
21373
|
-
|
|
21374
|
-
|
|
21375
|
-
) }),
|
|
21376
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
21377
|
-
] }),
|
|
21378
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21379
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Image, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21380
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Link, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21381
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowLeft, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21382
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21383
|
-
ToolbarAction,
|
|
21384
|
-
{
|
|
21385
|
-
label: gatedLabel("Move right"),
|
|
21386
|
-
onClick: onMoveRight,
|
|
21387
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
21388
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
|
|
21389
|
-
}
|
|
21390
|
-
),
|
|
21391
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21392
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21393
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
21394
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
21395
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21396
|
-
ToolbarAction,
|
|
21397
|
-
{
|
|
21398
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
21399
|
-
active: treatment === "grayscale",
|
|
21400
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
21401
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
21402
|
-
}
|
|
21403
|
-
),
|
|
21404
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21405
|
-
ALIGNS.map(({ value, label, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label, active: align === value, onClick: () => onSetAlign(value), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { size: 16, style: { pointerEvents: "none" } }) }, value)),
|
|
21406
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21407
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21408
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
21409
|
-
sizeValue,
|
|
21410
|
-
"px"
|
|
21411
|
-
] }),
|
|
21412
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21413
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21414
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
21415
|
-
]
|
|
21416
|
-
}
|
|
21417
|
-
),
|
|
21418
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
|
|
21174
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21175
|
+
VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
21176
|
+
ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
21177
|
+
] }),
|
|
21178
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21179
|
+
HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
21180
|
+
TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
21181
|
+
] }),
|
|
21182
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21183
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
21184
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
21185
|
+
sizeValue,
|
|
21186
|
+
"px"
|
|
21187
|
+
] }),
|
|
21188
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
|
|
21189
|
+
] }),
|
|
21190
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
|
|
21191
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
|
|
21192
|
+
currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21193
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
21194
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
21195
|
+
] }),
|
|
21196
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21197
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
21198
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
21199
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
21200
|
+
] }),
|
|
21201
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21202
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
21203
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
21204
|
+
] }),
|
|
21205
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21419
21206
|
]
|
|
21420
21207
|
}
|
|
21421
|
-
)
|
|
21208
|
+
);
|
|
21422
21209
|
}
|
|
21423
21210
|
function findMediaStripSlots(tree) {
|
|
21424
21211
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -21437,23 +21224,31 @@ function AiMediaStripOverlay({
|
|
|
21437
21224
|
}) {
|
|
21438
21225
|
const [hover, setHover] = (0, import_react14.useState)(null);
|
|
21439
21226
|
const [active, setActive] = (0, import_react14.useState)(null);
|
|
21440
|
-
const [itemEditOn, setItemEditOn] = (0, import_react14.useState)(false);
|
|
21441
|
-
const [linkOpen, setLinkOpen] = (0, import_react14.useState)(false);
|
|
21442
21227
|
const [pending, setPending] = (0, import_react14.useState)(false);
|
|
21443
21228
|
const [error, setError] = (0, import_react14.useState)(null);
|
|
21444
21229
|
const activeRef = (0, import_react14.useRef)(null);
|
|
21445
21230
|
activeRef.current = active;
|
|
21446
|
-
const linkOpenRef = (0, import_react14.useRef)(false);
|
|
21447
|
-
linkOpenRef.current = linkOpen;
|
|
21448
21231
|
(0, import_react14.useEffect)(() => {
|
|
21449
21232
|
const onMove = (e) => {
|
|
21450
|
-
const ref = itemRefFromTarget(e.target);
|
|
21451
21233
|
const t = e.target;
|
|
21452
|
-
|
|
21453
|
-
|
|
21454
|
-
|
|
21455
|
-
|
|
21456
|
-
|
|
21234
|
+
if (!(t instanceof HTMLElement)) return;
|
|
21235
|
+
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]")) {
|
|
21236
|
+
return;
|
|
21237
|
+
}
|
|
21238
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
21239
|
+
if (!itemEl) {
|
|
21240
|
+
setHover(null);
|
|
21241
|
+
return;
|
|
21242
|
+
}
|
|
21243
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
21244
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
21245
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
21246
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
21247
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
21248
|
+
setHover(null);
|
|
21249
|
+
return;
|
|
21250
|
+
}
|
|
21251
|
+
setHover({ sectionId, index });
|
|
21457
21252
|
};
|
|
21458
21253
|
const onLeave = () => setHover(null);
|
|
21459
21254
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -21465,25 +21260,23 @@ function AiMediaStripOverlay({
|
|
|
21465
21260
|
}, []);
|
|
21466
21261
|
(0, import_react14.useEffect)(() => {
|
|
21467
21262
|
const onClick = (e) => {
|
|
21263
|
+
const current = activeRef.current;
|
|
21264
|
+
if (!current) return;
|
|
21468
21265
|
const t = e.target;
|
|
21469
|
-
if (!(t instanceof
|
|
21470
|
-
if (t.closest(
|
|
21471
|
-
const
|
|
21472
|
-
if (
|
|
21473
|
-
|
|
21474
|
-
setItemEditOn(false);
|
|
21266
|
+
if (!(t instanceof HTMLElement)) return;
|
|
21267
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
21268
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
21269
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
21270
|
+
setActive(null);
|
|
21475
21271
|
setError(null);
|
|
21476
|
-
setActive(ref);
|
|
21477
21272
|
};
|
|
21478
21273
|
document.addEventListener("click", onClick, true);
|
|
21479
21274
|
return () => document.removeEventListener("click", onClick, true);
|
|
21480
|
-
}, [
|
|
21275
|
+
}, []);
|
|
21481
21276
|
(0, import_react14.useEffect)(() => {
|
|
21482
21277
|
const onBlur = () => {
|
|
21483
21278
|
if (!activeRef.current) return;
|
|
21484
21279
|
setActive(null);
|
|
21485
|
-
setItemEditOn(false);
|
|
21486
|
-
setLinkOpen(false);
|
|
21487
21280
|
setError(null);
|
|
21488
21281
|
};
|
|
21489
21282
|
window.addEventListener("blur", onBlur);
|
|
@@ -21493,10 +21286,7 @@ function AiMediaStripOverlay({
|
|
|
21493
21286
|
const onKeyDown = (e) => {
|
|
21494
21287
|
if (e.key !== "Escape") return;
|
|
21495
21288
|
if (!activeRef.current) return;
|
|
21496
|
-
if (linkOpenRef.current) return;
|
|
21497
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
21498
21289
|
setActive(null);
|
|
21499
|
-
setItemEditOn(false);
|
|
21500
21290
|
setError(null);
|
|
21501
21291
|
};
|
|
21502
21292
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -21530,133 +21320,137 @@ function AiMediaStripOverlay({
|
|
|
21530
21320
|
tree: nextTree,
|
|
21531
21321
|
label: entry.label,
|
|
21532
21322
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
21533
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
21534
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
21535
|
-
// on every edit reads as the section jumping around.
|
|
21536
|
-
skipScrollIntoView: true
|
|
21323
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
21537
21324
|
});
|
|
21538
21325
|
return true;
|
|
21539
21326
|
},
|
|
21540
21327
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
21541
21328
|
);
|
|
21542
21329
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
21330
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
21543
21331
|
const activeItemRect = useLiveItemRect(active);
|
|
21544
|
-
const
|
|
21545
|
-
const
|
|
21546
|
-
|
|
21547
|
-
|
|
21548
|
-
|
|
21549
|
-
|
|
21550
|
-
|
|
21551
|
-
|
|
21552
|
-
|
|
21553
|
-
|
|
21554
|
-
|
|
21555
|
-
|
|
21556
|
-
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21561
|
-
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21332
|
+
const TOOLBAR_APPROX_H = 170;
|
|
21333
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
21335
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21336
|
+
"button",
|
|
21337
|
+
{
|
|
21338
|
+
type: "button",
|
|
21339
|
+
"data-ohw-toolbar": "",
|
|
21340
|
+
onClick: () => {
|
|
21341
|
+
clearInteractionChromeRef.current();
|
|
21342
|
+
setActive(hover);
|
|
21343
|
+
},
|
|
21344
|
+
"aria-label": "Configure media item",
|
|
21345
|
+
style: {
|
|
21346
|
+
position: "fixed",
|
|
21347
|
+
top: hoverHandleRect.top + 8,
|
|
21348
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
21349
|
+
width: 28,
|
|
21350
|
+
height: 28,
|
|
21351
|
+
borderRadius: 8,
|
|
21352
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
21353
|
+
background: "#ffffff",
|
|
21354
|
+
color: PRIMARY3,
|
|
21355
|
+
display: "flex",
|
|
21356
|
+
alignItems: "center",
|
|
21357
|
+
justifyContent: "center",
|
|
21358
|
+
cursor: "pointer",
|
|
21359
|
+
zIndex: 2147483643,
|
|
21360
|
+
fontSize: 14,
|
|
21361
|
+
fontWeight: 700
|
|
21362
|
+
},
|
|
21363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21364
|
+
}
|
|
21365
|
+
),
|
|
21366
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21367
|
+
ItemInteractionLayer,
|
|
21368
|
+
{
|
|
21369
|
+
rect: activeItemRect,
|
|
21370
|
+
state: toolbarState,
|
|
21371
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21372
|
+
MediaStripToolbar,
|
|
21373
|
+
{
|
|
21374
|
+
entry: activeEntry,
|
|
21375
|
+
index: active.index,
|
|
21376
|
+
pending,
|
|
21377
|
+
error,
|
|
21378
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
21379
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
21380
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
21381
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
21382
|
+
onResize: (delta) => {
|
|
21383
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
21384
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
21385
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
21386
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
21387
|
+
},
|
|
21388
|
+
onSetAlt: (alt) => {
|
|
21389
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
21390
|
+
},
|
|
21391
|
+
onSetLink: (href, linkTarget) => {
|
|
21578
21392
|
void runMutation(
|
|
21579
21393
|
active.sectionId,
|
|
21580
|
-
(tree) =>
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21394
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
21395
|
+
);
|
|
21396
|
+
},
|
|
21397
|
+
onAddItem: () => {
|
|
21398
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
21399
|
+
if (!picked) return;
|
|
21400
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
21401
|
+
void runMutation(
|
|
21402
|
+
active.sectionId,
|
|
21403
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
21404
|
+
{ [picked.assetId]: picked.url }
|
|
21405
|
+
).then((applied) => {
|
|
21406
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21407
|
+
});
|
|
21584
21408
|
});
|
|
21585
|
-
}
|
|
21586
|
-
|
|
21587
|
-
|
|
21588
|
-
|
|
21589
|
-
|
|
21590
|
-
|
|
21591
|
-
|
|
21592
|
-
|
|
21593
|
-
|
|
21409
|
+
},
|
|
21410
|
+
onChangeImage: () => {
|
|
21411
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
21412
|
+
if (!picked) return;
|
|
21413
|
+
void runMutation(
|
|
21414
|
+
active.sectionId,
|
|
21415
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
21416
|
+
{ [picked.assetId]: picked.url }
|
|
21417
|
+
);
|
|
21418
|
+
});
|
|
21419
|
+
},
|
|
21420
|
+
onRemoveItem: () => {
|
|
21421
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
21422
|
+
(applied) => {
|
|
21423
|
+
if (applied) setActive(null);
|
|
21424
|
+
}
|
|
21594
21425
|
);
|
|
21595
|
-
}
|
|
21596
|
-
|
|
21597
|
-
|
|
21598
|
-
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
|
|
21602
|
-
|
|
21603
|
-
|
|
21604
|
-
|
|
21605
|
-
|
|
21606
|
-
|
|
21607
|
-
|
|
21608
|
-
|
|
21609
|
-
|
|
21610
|
-
}
|
|
21611
|
-
|
|
21612
|
-
|
|
21613
|
-
|
|
21614
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21615
|
-
}
|
|
21616
|
-
);
|
|
21617
|
-
}
|
|
21618
|
-
}
|
|
21619
|
-
) }),
|
|
21620
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21621
|
-
"div",
|
|
21622
|
-
{
|
|
21623
|
-
"data-ohw-bridge": "",
|
|
21624
|
-
"data-ohw-item-interaction": "",
|
|
21625
|
-
"aria-hidden": true,
|
|
21626
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
21627
|
-
style: {
|
|
21628
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
21629
|
-
left: activeItemRect.left - 5,
|
|
21630
|
-
background: PRIMARY3,
|
|
21631
|
-
zIndex: 2147483644
|
|
21632
|
-
},
|
|
21633
|
-
children: "Media item"
|
|
21634
|
-
}
|
|
21635
|
-
),
|
|
21636
|
-
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21637
|
-
LinkModal,
|
|
21638
|
-
{
|
|
21639
|
-
href: activeHref,
|
|
21640
|
-
linkTarget: activeTarget,
|
|
21641
|
-
onClose: () => setLinkOpen(false),
|
|
21642
|
-
onSave: (href, linkTarget) => {
|
|
21643
|
-
void runMutation(
|
|
21644
|
-
active.sectionId,
|
|
21645
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
21646
|
-
);
|
|
21647
|
-
}
|
|
21648
|
-
}
|
|
21649
|
-
)
|
|
21650
|
-
] })
|
|
21426
|
+
},
|
|
21427
|
+
onMoveLeft: () => {
|
|
21428
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
21429
|
+
(applied) => {
|
|
21430
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
21431
|
+
}
|
|
21432
|
+
);
|
|
21433
|
+
},
|
|
21434
|
+
onMoveRight: () => {
|
|
21435
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
21436
|
+
(applied) => {
|
|
21437
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21438
|
+
}
|
|
21439
|
+
);
|
|
21440
|
+
}
|
|
21441
|
+
}
|
|
21442
|
+
)
|
|
21443
|
+
}
|
|
21444
|
+
)
|
|
21651
21445
|
] });
|
|
21652
21446
|
}
|
|
21653
21447
|
|
|
21654
21448
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
21655
21449
|
var import_react15 = require("react");
|
|
21656
|
-
var
|
|
21657
|
-
var
|
|
21450
|
+
var import_lucide_react9 = require("lucide-react");
|
|
21451
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
21658
21452
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
21659
|
-
var
|
|
21453
|
+
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]";
|
|
21660
21454
|
function findPricingCardElement(sectionId, index) {
|
|
21661
21455
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21662
21456
|
if (!sectionEl2) return null;
|
|
@@ -21668,7 +21462,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
21668
21462
|
}
|
|
21669
21463
|
function cardRefFromTarget(target) {
|
|
21670
21464
|
if (!(target instanceof Element)) return null;
|
|
21671
|
-
if (target.closest(
|
|
21465
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
21672
21466
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
21673
21467
|
if (!cardEl) return null;
|
|
21674
21468
|
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
@@ -21678,21 +21472,21 @@ function cardRefFromTarget(target) {
|
|
|
21678
21472
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
21679
21473
|
return { sectionId, index };
|
|
21680
21474
|
}
|
|
21681
|
-
function
|
|
21475
|
+
function sameRef(a, b) {
|
|
21682
21476
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
21683
21477
|
}
|
|
21684
|
-
function
|
|
21478
|
+
function rectOf(el) {
|
|
21685
21479
|
if (!el) return null;
|
|
21686
21480
|
const r2 = el.getBoundingClientRect();
|
|
21687
21481
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
21688
21482
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
21689
21483
|
}
|
|
21690
21484
|
function readRect3(ref) {
|
|
21691
|
-
return
|
|
21485
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
21692
21486
|
}
|
|
21693
21487
|
function readGridRect(ref) {
|
|
21694
21488
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
21695
|
-
return
|
|
21489
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
21696
21490
|
}
|
|
21697
21491
|
function useLiveCardRect(ref, grid = false) {
|
|
21698
21492
|
const [rect, setRect] = (0, import_react15.useState)(null);
|
|
@@ -21722,7 +21516,7 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
21722
21516
|
}
|
|
21723
21517
|
var TOOLBAR_GRID_GAP = 52;
|
|
21724
21518
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
21725
|
-
var
|
|
21519
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
21726
21520
|
function GridToolbarSlot({ gridRect, children }) {
|
|
21727
21521
|
const slotRef = (0, import_react15.useRef)(null);
|
|
21728
21522
|
const [shift, setShift] = (0, import_react15.useState)(0);
|
|
@@ -21734,7 +21528,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
21734
21528
|
const w = slot.offsetWidth;
|
|
21735
21529
|
if (w <= 0) return;
|
|
21736
21530
|
const half = w / 2;
|
|
21737
|
-
const clamped = Math.max(
|
|
21531
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
21738
21532
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
21739
21533
|
};
|
|
21740
21534
|
clamp();
|
|
@@ -21743,7 +21537,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
21743
21537
|
return () => ro.disconnect();
|
|
21744
21538
|
}, [centerX, children]);
|
|
21745
21539
|
const mobile = window.innerWidth <= 480;
|
|
21746
|
-
return /* @__PURE__ */ (0,
|
|
21540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21747
21541
|
"div",
|
|
21748
21542
|
{
|
|
21749
21543
|
ref: slotRef,
|
|
@@ -21778,7 +21572,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
21778
21572
|
});
|
|
21779
21573
|
}
|
|
21780
21574
|
function StyleSwatch({ style }) {
|
|
21781
|
-
return /* @__PURE__ */ (0,
|
|
21575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21782
21576
|
"span",
|
|
21783
21577
|
{
|
|
21784
21578
|
"aria-hidden": true,
|
|
@@ -21792,35 +21586,35 @@ function StyleSwatch({ style }) {
|
|
|
21792
21586
|
);
|
|
21793
21587
|
}
|
|
21794
21588
|
function ButtonGlyph() {
|
|
21795
|
-
return /* @__PURE__ */ (0,
|
|
21796
|
-
/* @__PURE__ */ (0,
|
|
21797
|
-
/* @__PURE__ */ (0,
|
|
21589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
21590
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
21591
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
21798
21592
|
] });
|
|
21799
21593
|
}
|
|
21800
21594
|
function FeatureGlyph({ mode }) {
|
|
21801
|
-
return /* @__PURE__ */ (0,
|
|
21802
|
-
/* @__PURE__ */ (0,
|
|
21803
|
-
/* @__PURE__ */ (0,
|
|
21804
|
-
/* @__PURE__ */ (0,
|
|
21805
|
-
/* @__PURE__ */ (0,
|
|
21806
|
-
/* @__PURE__ */ (0,
|
|
21807
|
-
mode === "add" && /* @__PURE__ */ (0,
|
|
21595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
21596
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
21597
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
21598
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
|
|
21599
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
|
|
21600
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
21601
|
+
mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
21808
21602
|
] });
|
|
21809
21603
|
}
|
|
21810
|
-
function
|
|
21604
|
+
function ToolbarAction({
|
|
21811
21605
|
label,
|
|
21812
21606
|
onClick,
|
|
21813
21607
|
disabled = false,
|
|
21814
21608
|
children
|
|
21815
21609
|
}) {
|
|
21816
|
-
const button = /* @__PURE__ */ (0,
|
|
21817
|
-
return /* @__PURE__ */ (0,
|
|
21818
|
-
/* @__PURE__ */ (0,
|
|
21819
|
-
/* @__PURE__ */ (0,
|
|
21610
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
21611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
21612
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
21613
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
21820
21614
|
] });
|
|
21821
21615
|
}
|
|
21822
|
-
function
|
|
21823
|
-
return /* @__PURE__ */ (0,
|
|
21616
|
+
function ToolbarSeparator() {
|
|
21617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
21824
21618
|
}
|
|
21825
21619
|
function CardStyleMenu({
|
|
21826
21620
|
value,
|
|
@@ -21828,7 +21622,7 @@ function CardStyleMenu({
|
|
|
21828
21622
|
disabled = false
|
|
21829
21623
|
}) {
|
|
21830
21624
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
21831
|
-
const trigger = /* @__PURE__ */ (0,
|
|
21625
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
21832
21626
|
"button",
|
|
21833
21627
|
{
|
|
21834
21628
|
type: "button",
|
|
@@ -21839,28 +21633,28 @@ function CardStyleMenu({
|
|
|
21839
21633
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
21840
21634
|
),
|
|
21841
21635
|
children: [
|
|
21842
|
-
/* @__PURE__ */ (0,
|
|
21843
|
-
/* @__PURE__ */ (0,
|
|
21844
|
-
/* @__PURE__ */ (0,
|
|
21636
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
|
|
21637
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
|
|
21638
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
|
|
21845
21639
|
]
|
|
21846
21640
|
}
|
|
21847
21641
|
);
|
|
21848
21642
|
if (disabled) {
|
|
21849
|
-
return /* @__PURE__ */ (0,
|
|
21850
|
-
/* @__PURE__ */ (0,
|
|
21851
|
-
/* @__PURE__ */ (0,
|
|
21852
|
-
/* @__PURE__ */ (0,
|
|
21853
|
-
/* @__PURE__ */ (0,
|
|
21643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
21644
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
21645
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
21646
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
|
|
21647
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
21854
21648
|
] })
|
|
21855
21649
|
] });
|
|
21856
21650
|
}
|
|
21857
|
-
return /* @__PURE__ */ (0,
|
|
21858
|
-
/* @__PURE__ */ (0,
|
|
21859
|
-
/* @__PURE__ */ (0,
|
|
21860
|
-
/* @__PURE__ */ (0,
|
|
21861
|
-
/* @__PURE__ */ (0,
|
|
21651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
21652
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
21653
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
|
|
21654
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
21655
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
|
|
21862
21656
|
const selected = style.value === value;
|
|
21863
|
-
return /* @__PURE__ */ (0,
|
|
21657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
21864
21658
|
DropdownMenuItem,
|
|
21865
21659
|
{
|
|
21866
21660
|
role: "menuitemradio",
|
|
@@ -21868,9 +21662,9 @@ function CardStyleMenu({
|
|
|
21868
21662
|
onSelect: () => onChange(style.value),
|
|
21869
21663
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
21870
21664
|
children: [
|
|
21871
|
-
/* @__PURE__ */ (0,
|
|
21872
|
-
/* @__PURE__ */ (0,
|
|
21873
|
-
selected && /* @__PURE__ */ (0,
|
|
21665
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
|
|
21666
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
|
|
21667
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
|
|
21874
21668
|
]
|
|
21875
21669
|
},
|
|
21876
21670
|
style.value
|
|
@@ -21900,7 +21694,7 @@ function PricingCardToolbar({
|
|
|
21900
21694
|
const style = pricingCardStyle(entry.tree, index);
|
|
21901
21695
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
21902
21696
|
const mobile = window.innerWidth <= 480;
|
|
21903
|
-
return /* @__PURE__ */ (0,
|
|
21697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
21904
21698
|
"div",
|
|
21905
21699
|
{
|
|
21906
21700
|
"data-ohw-bridge": "",
|
|
@@ -21912,7 +21706,7 @@ function PricingCardToolbar({
|
|
|
21912
21706
|
),
|
|
21913
21707
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
21914
21708
|
children: [
|
|
21915
|
-
/* @__PURE__ */ (0,
|
|
21709
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
21916
21710
|
"div",
|
|
21917
21711
|
{
|
|
21918
21712
|
className: cn(
|
|
@@ -21921,8 +21715,8 @@ function PricingCardToolbar({
|
|
|
21921
21715
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
21922
21716
|
),
|
|
21923
21717
|
children: [
|
|
21924
|
-
/* @__PURE__ */ (0,
|
|
21925
|
-
/* @__PURE__ */ (0,
|
|
21718
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
21719
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21926
21720
|
CustomToolbarButton,
|
|
21927
21721
|
{
|
|
21928
21722
|
type: "button",
|
|
@@ -21930,8 +21724,8 @@ function PricingCardToolbar({
|
|
|
21930
21724
|
"aria-pressed": featuredTag,
|
|
21931
21725
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
21932
21726
|
className: "group size-8",
|
|
21933
|
-
children: /* @__PURE__ */ (0,
|
|
21934
|
-
|
|
21727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21728
|
+
import_lucide_react9.Star,
|
|
21935
21729
|
{
|
|
21936
21730
|
size: 16,
|
|
21937
21731
|
fill: "currentColor",
|
|
@@ -21945,25 +21739,25 @@ function PricingCardToolbar({
|
|
|
21945
21739
|
)
|
|
21946
21740
|
}
|
|
21947
21741
|
) }),
|
|
21948
|
-
/* @__PURE__ */ (0,
|
|
21742
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
21949
21743
|
] }),
|
|
21950
|
-
/* @__PURE__ */ (0,
|
|
21951
|
-
/* @__PURE__ */ (0,
|
|
21952
|
-
/* @__PURE__ */ (0,
|
|
21953
|
-
/* @__PURE__ */ (0,
|
|
21954
|
-
/* @__PURE__ */ (0,
|
|
21955
|
-
/* @__PURE__ */ (0,
|
|
21956
|
-
/* @__PURE__ */ (0,
|
|
21744
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21745
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
21746
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21747
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
|
|
21748
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "relative inline-flex", children: [
|
|
21749
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
|
|
21750
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
|
|
21957
21751
|
] }) }),
|
|
21958
|
-
/* @__PURE__ */ (0,
|
|
21959
|
-
/* @__PURE__ */ (0,
|
|
21960
|
-
/* @__PURE__ */ (0,
|
|
21961
|
-
/* @__PURE__ */ (0,
|
|
21962
|
-
/* @__PURE__ */ (0,
|
|
21752
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeatureGlyph, { mode: "add" }) }),
|
|
21753
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeatureGlyph, { mode: "remove" }) }),
|
|
21754
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21755
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
21756
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
21963
21757
|
]
|
|
21964
21758
|
}
|
|
21965
21759
|
),
|
|
21966
|
-
error && /* @__PURE__ */ (0,
|
|
21760
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
|
|
21967
21761
|
]
|
|
21968
21762
|
}
|
|
21969
21763
|
) });
|
|
@@ -21997,7 +21791,7 @@ function AiPricingCardOverlay({
|
|
|
21997
21791
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
21998
21792
|
setHover((prev) => {
|
|
21999
21793
|
const next = ref && !overEditable ? ref : null;
|
|
22000
|
-
return
|
|
21794
|
+
return sameRef(prev, next) ? prev : next;
|
|
22001
21795
|
});
|
|
22002
21796
|
};
|
|
22003
21797
|
const onLeave = () => setHover(null);
|
|
@@ -22012,10 +21806,10 @@ function AiPricingCardOverlay({
|
|
|
22012
21806
|
const onClick = (e) => {
|
|
22013
21807
|
const t = e.target;
|
|
22014
21808
|
if (!(t instanceof Element)) return;
|
|
22015
|
-
if (t.closest(
|
|
21809
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
22016
21810
|
const ref = cardRefFromTarget(t);
|
|
22017
|
-
setActive((prev) =>
|
|
22018
|
-
if (!ref || !
|
|
21811
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
21812
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
22019
21813
|
};
|
|
22020
21814
|
document.addEventListener("click", onClick, true);
|
|
22021
21815
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -22080,12 +21874,12 @@ function AiPricingCardOverlay({
|
|
|
22080
21874
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
22081
21875
|
const activeCardRect = useLiveCardRect(active);
|
|
22082
21876
|
const activeGridRect = useLiveCardRect(active, true);
|
|
22083
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
22084
|
-
return /* @__PURE__ */ (0,
|
|
22085
|
-
hoverRect && /* @__PURE__ */ (0,
|
|
22086
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
22087
|
-
/* @__PURE__ */ (0,
|
|
22088
|
-
/* @__PURE__ */ (0,
|
|
21877
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
21878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
21879
|
+
hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
21880
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
21881
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
21882
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
22089
21883
|
PricingCardToolbar,
|
|
22090
21884
|
{
|
|
22091
21885
|
entry: activeEntry,
|
|
@@ -22113,7 +21907,7 @@ function AiPricingCardOverlay({
|
|
|
22113
21907
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
22114
21908
|
}
|
|
22115
21909
|
) }),
|
|
22116
|
-
/* @__PURE__ */ (0,
|
|
21910
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
22117
21911
|
"div",
|
|
22118
21912
|
{
|
|
22119
21913
|
"data-ohw-bridge": "",
|
|
@@ -22135,7 +21929,7 @@ function AiPricingCardOverlay({
|
|
|
22135
21929
|
|
|
22136
21930
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
22137
21931
|
var import_react16 = require("react");
|
|
22138
|
-
var
|
|
21932
|
+
var import_lucide_react10 = require("lucide-react");
|
|
22139
21933
|
|
|
22140
21934
|
// src/lib/ai-video-tree.ts
|
|
22141
21935
|
function resolveVideoBlock(tree, path) {
|
|
@@ -22178,10 +21972,10 @@ function clearVideo(tree, path) {
|
|
|
22178
21972
|
}
|
|
22179
21973
|
|
|
22180
21974
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
22181
|
-
var
|
|
21975
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
22182
21976
|
var PRIMARY5 = "#0885FE";
|
|
22183
|
-
var
|
|
22184
|
-
var
|
|
21977
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
21978
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
22185
21979
|
function findVideoBlockElement(sectionId, path) {
|
|
22186
21980
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
22187
21981
|
if (!sectionEl2) return null;
|
|
@@ -22241,12 +22035,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
22241
22035
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
22242
22036
|
});
|
|
22243
22037
|
}
|
|
22244
|
-
function
|
|
22038
|
+
function Pill2({
|
|
22245
22039
|
label,
|
|
22246
22040
|
onClick,
|
|
22247
22041
|
disabled
|
|
22248
22042
|
}) {
|
|
22249
|
-
return /* @__PURE__ */ (0,
|
|
22043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22250
22044
|
"button",
|
|
22251
22045
|
{
|
|
22252
22046
|
type: "button",
|
|
@@ -22262,7 +22056,7 @@ function Pill({
|
|
|
22262
22056
|
border: "none",
|
|
22263
22057
|
cursor: disabled ? "default" : "pointer",
|
|
22264
22058
|
background: "#ffffff",
|
|
22265
|
-
color:
|
|
22059
|
+
color: OHW_BLUE_DARK2,
|
|
22266
22060
|
opacity: disabled ? 0.4 : 1,
|
|
22267
22061
|
fontSize: 12,
|
|
22268
22062
|
lineHeight: "16px",
|
|
@@ -22305,8 +22099,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22305
22099
|
onCommit(id);
|
|
22306
22100
|
}
|
|
22307
22101
|
};
|
|
22308
|
-
return /* @__PURE__ */ (0,
|
|
22309
|
-
/* @__PURE__ */ (0,
|
|
22102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
22103
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
22310
22104
|
"div",
|
|
22311
22105
|
{
|
|
22312
22106
|
style: {
|
|
@@ -22322,12 +22116,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22322
22116
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
22323
22117
|
},
|
|
22324
22118
|
children: [
|
|
22325
|
-
/* @__PURE__ */ (0,
|
|
22119
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22326
22120
|
"span",
|
|
22327
22121
|
{
|
|
22328
22122
|
style: {
|
|
22329
22123
|
flex: "0 0 auto",
|
|
22330
|
-
color:
|
|
22124
|
+
color: OHW_BLUE_DARK2,
|
|
22331
22125
|
fontSize: 10,
|
|
22332
22126
|
lineHeight: "16px",
|
|
22333
22127
|
fontWeight: 700,
|
|
@@ -22337,7 +22131,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22337
22131
|
children: "Video"
|
|
22338
22132
|
}
|
|
22339
22133
|
),
|
|
22340
|
-
/* @__PURE__ */ (0,
|
|
22134
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22341
22135
|
"input",
|
|
22342
22136
|
{
|
|
22343
22137
|
type: "text",
|
|
@@ -22374,7 +22168,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22374
22168
|
]
|
|
22375
22169
|
}
|
|
22376
22170
|
),
|
|
22377
|
-
invalid && /* @__PURE__ */ (0,
|
|
22171
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
|
|
22378
22172
|
] });
|
|
22379
22173
|
}
|
|
22380
22174
|
function VideoToolbar({
|
|
@@ -22384,7 +22178,7 @@ function VideoToolbar({
|
|
|
22384
22178
|
onSetVideoId,
|
|
22385
22179
|
onRemove
|
|
22386
22180
|
}) {
|
|
22387
|
-
return /* @__PURE__ */ (0,
|
|
22181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
22388
22182
|
"div",
|
|
22389
22183
|
{
|
|
22390
22184
|
"data-ohw-bridge": "",
|
|
@@ -22396,7 +22190,7 @@ function VideoToolbar({
|
|
|
22396
22190
|
gap: 6,
|
|
22397
22191
|
alignItems: "center",
|
|
22398
22192
|
width: 280,
|
|
22399
|
-
background:
|
|
22193
|
+
background: OHW_BLUE2,
|
|
22400
22194
|
padding: 8,
|
|
22401
22195
|
borderRadius: 12,
|
|
22402
22196
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -22404,9 +22198,9 @@ function VideoToolbar({
|
|
|
22404
22198
|
opacity: pending ? 0.6 : 1
|
|
22405
22199
|
},
|
|
22406
22200
|
children: [
|
|
22407
|
-
/* @__PURE__ */ (0,
|
|
22408
|
-
/* @__PURE__ */ (0,
|
|
22409
|
-
error && /* @__PURE__ */ (0,
|
|
22201
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
22202
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
22203
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
22410
22204
|
]
|
|
22411
22205
|
}
|
|
22412
22206
|
);
|
|
@@ -22526,8 +22320,8 @@ function AiVideoOverlay({
|
|
|
22526
22320
|
const activeBlockRect = useLiveBlockRect(active);
|
|
22527
22321
|
const TOOLBAR_APPROX_H = 90;
|
|
22528
22322
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
22529
|
-
return /* @__PURE__ */ (0,
|
|
22530
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
22323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
22324
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22531
22325
|
"button",
|
|
22532
22326
|
{
|
|
22533
22327
|
type: "button",
|
|
@@ -22555,15 +22349,15 @@ function AiVideoOverlay({
|
|
|
22555
22349
|
fontSize: 14,
|
|
22556
22350
|
fontWeight: 700
|
|
22557
22351
|
},
|
|
22558
|
-
children: /* @__PURE__ */ (0,
|
|
22352
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
22559
22353
|
}
|
|
22560
22354
|
),
|
|
22561
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
22355
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22562
22356
|
ItemInteractionLayer,
|
|
22563
22357
|
{
|
|
22564
22358
|
rect: activeBlockRect,
|
|
22565
22359
|
state: toolbarState,
|
|
22566
|
-
toolbar: /* @__PURE__ */ (0,
|
|
22360
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22567
22361
|
VideoToolbar,
|
|
22568
22362
|
{
|
|
22569
22363
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -22587,7 +22381,7 @@ function AiVideoOverlay({
|
|
|
22587
22381
|
|
|
22588
22382
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
22589
22383
|
var import_react17 = require("react");
|
|
22590
|
-
var
|
|
22384
|
+
var import_lucide_react11 = require("lucide-react");
|
|
22591
22385
|
|
|
22592
22386
|
// src/lib/ai-carousel-tree.ts
|
|
22593
22387
|
function isCarouselBlock(node) {
|
|
@@ -22638,10 +22432,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
22638
22432
|
}
|
|
22639
22433
|
|
|
22640
22434
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
22641
|
-
var
|
|
22435
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
22642
22436
|
var PRIMARY6 = "#0885FE";
|
|
22643
|
-
var
|
|
22644
|
-
var
|
|
22437
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
22438
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
22645
22439
|
function findCarouselItemElement(sectionId, index) {
|
|
22646
22440
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
22647
22441
|
if (!sectionEl2) return null;
|
|
@@ -22720,8 +22514,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
22720
22514
|
postToParent2({ type: "ow:asset-pick", id });
|
|
22721
22515
|
});
|
|
22722
22516
|
}
|
|
22723
|
-
function
|
|
22724
|
-
return /* @__PURE__ */ (0,
|
|
22517
|
+
function Pill3({ label, onClick, disabled }) {
|
|
22518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
22725
22519
|
"button",
|
|
22726
22520
|
{
|
|
22727
22521
|
type: "button",
|
|
@@ -22737,7 +22531,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
22737
22531
|
border: "none",
|
|
22738
22532
|
cursor: disabled ? "default" : "pointer",
|
|
22739
22533
|
background: "#ffffff",
|
|
22740
|
-
color:
|
|
22534
|
+
color: OHW_BLUE_DARK3,
|
|
22741
22535
|
opacity: disabled ? 0.4 : 1,
|
|
22742
22536
|
fontSize: 12,
|
|
22743
22537
|
lineHeight: "16px",
|
|
@@ -22755,7 +22549,7 @@ function TogglePill({
|
|
|
22755
22549
|
onToggle,
|
|
22756
22550
|
disabled
|
|
22757
22551
|
}) {
|
|
22758
|
-
return /* @__PURE__ */ (0,
|
|
22552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
22759
22553
|
"button",
|
|
22760
22554
|
{
|
|
22761
22555
|
type: "button",
|
|
@@ -22774,7 +22568,7 @@ function TogglePill({
|
|
|
22774
22568
|
border: "none",
|
|
22775
22569
|
cursor: disabled ? "default" : "pointer",
|
|
22776
22570
|
background: "#ffffff",
|
|
22777
|
-
color:
|
|
22571
|
+
color: OHW_BLUE_DARK3,
|
|
22778
22572
|
opacity: disabled ? 0.4 : 1,
|
|
22779
22573
|
fontSize: 12,
|
|
22780
22574
|
lineHeight: "16px",
|
|
@@ -22784,7 +22578,7 @@ function TogglePill({
|
|
|
22784
22578
|
},
|
|
22785
22579
|
children: [
|
|
22786
22580
|
label,
|
|
22787
|
-
/* @__PURE__ */ (0,
|
|
22581
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
22788
22582
|
"span",
|
|
22789
22583
|
{
|
|
22790
22584
|
"aria-hidden": true,
|
|
@@ -22797,10 +22591,10 @@ function TogglePill({
|
|
|
22797
22591
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
22798
22592
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
22799
22593
|
// "disabled control" rather than "switch that is off".
|
|
22800
|
-
background: on ?
|
|
22594
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
22801
22595
|
transition: "background 120ms ease"
|
|
22802
22596
|
},
|
|
22803
|
-
children: /* @__PURE__ */ (0,
|
|
22597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
22804
22598
|
"span",
|
|
22805
22599
|
{
|
|
22806
22600
|
style: {
|
|
@@ -22829,7 +22623,7 @@ function CarouselSlideToolbar({
|
|
|
22829
22623
|
onChangeImage,
|
|
22830
22624
|
onToggleAutoplay
|
|
22831
22625
|
}) {
|
|
22832
|
-
return /* @__PURE__ */ (0,
|
|
22626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
22833
22627
|
"div",
|
|
22834
22628
|
{
|
|
22835
22629
|
"data-ohw-bridge": "",
|
|
@@ -22840,7 +22634,7 @@ function CarouselSlideToolbar({
|
|
|
22840
22634
|
flexDirection: "column",
|
|
22841
22635
|
gap: 6,
|
|
22842
22636
|
alignItems: "center",
|
|
22843
|
-
background:
|
|
22637
|
+
background: OHW_BLUE3,
|
|
22844
22638
|
padding: 8,
|
|
22845
22639
|
borderRadius: 12,
|
|
22846
22640
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -22852,11 +22646,11 @@ function CarouselSlideToolbar({
|
|
|
22852
22646
|
pointerEvents: pending ? "none" : "auto"
|
|
22853
22647
|
},
|
|
22854
22648
|
children: [
|
|
22855
|
-
/* @__PURE__ */ (0,
|
|
22856
|
-
/* @__PURE__ */ (0,
|
|
22857
|
-
/* @__PURE__ */ (0,
|
|
22649
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
22650
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
22651
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
22858
22652
|
] }),
|
|
22859
|
-
error && /* @__PURE__ */ (0,
|
|
22653
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
22860
22654
|
]
|
|
22861
22655
|
}
|
|
22862
22656
|
);
|
|
@@ -22996,8 +22790,8 @@ function AiFadeCarouselOverlay({
|
|
|
22996
22790
|
const activeItemRect = useLiveItemRect2(active);
|
|
22997
22791
|
const TOOLBAR_APPROX_H = 90;
|
|
22998
22792
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
22999
|
-
return /* @__PURE__ */ (0,
|
|
23000
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
22793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
22794
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23001
22795
|
"button",
|
|
23002
22796
|
{
|
|
23003
22797
|
type: "button",
|
|
@@ -23026,10 +22820,10 @@ function AiFadeCarouselOverlay({
|
|
|
23026
22820
|
fontSize: 14,
|
|
23027
22821
|
fontWeight: 700
|
|
23028
22822
|
},
|
|
23029
|
-
children: /* @__PURE__ */ (0,
|
|
22823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
23030
22824
|
}
|
|
23031
22825
|
),
|
|
23032
|
-
swapping && /* @__PURE__ */ (0,
|
|
22826
|
+
swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23033
22827
|
"div",
|
|
23034
22828
|
{
|
|
23035
22829
|
ref: skeletonRef,
|
|
@@ -23047,15 +22841,15 @@ function AiFadeCarouselOverlay({
|
|
|
23047
22841
|
zIndex: 2147483646,
|
|
23048
22842
|
pointerEvents: "none"
|
|
23049
22843
|
},
|
|
23050
|
-
children: /* @__PURE__ */ (0,
|
|
22844
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
|
|
23051
22845
|
}
|
|
23052
22846
|
),
|
|
23053
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
22847
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23054
22848
|
ItemInteractionLayer,
|
|
23055
22849
|
{
|
|
23056
22850
|
rect: activeItemRect,
|
|
23057
22851
|
state: toolbarState,
|
|
23058
|
-
toolbar: /* @__PURE__ */ (0,
|
|
22852
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23059
22853
|
CarouselSlideToolbar,
|
|
23060
22854
|
{
|
|
23061
22855
|
pending,
|
|
@@ -23293,6 +23087,113 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
23293
23087
|
// src/ui/link-modal/LinkPopover.tsx
|
|
23294
23088
|
var import_react21 = require("react");
|
|
23295
23089
|
|
|
23090
|
+
// src/ui/dialog.tsx
|
|
23091
|
+
var React9 = __toESM(require("react"), 1);
|
|
23092
|
+
var import_radix_ui6 = require("radix-ui");
|
|
23093
|
+
var import_lucide_react12 = require("lucide-react");
|
|
23094
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
23095
|
+
function Dialog2({
|
|
23096
|
+
...props
|
|
23097
|
+
}) {
|
|
23098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
23099
|
+
}
|
|
23100
|
+
function DialogPortal({
|
|
23101
|
+
...props
|
|
23102
|
+
}) {
|
|
23103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
23104
|
+
}
|
|
23105
|
+
function DialogOverlay({
|
|
23106
|
+
className,
|
|
23107
|
+
...props
|
|
23108
|
+
}) {
|
|
23109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23110
|
+
import_radix_ui6.Dialog.Overlay,
|
|
23111
|
+
{
|
|
23112
|
+
"data-slot": "dialog-overlay",
|
|
23113
|
+
"data-ohw-link-modal-root": "",
|
|
23114
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
23115
|
+
...props
|
|
23116
|
+
}
|
|
23117
|
+
);
|
|
23118
|
+
}
|
|
23119
|
+
var DialogContent = React9.forwardRef(
|
|
23120
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
23121
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
23122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
23123
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
23124
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
23125
|
+
import_radix_ui6.Dialog.Content,
|
|
23126
|
+
{
|
|
23127
|
+
ref,
|
|
23128
|
+
"data-slot": "dialog-content",
|
|
23129
|
+
className: cn(
|
|
23130
|
+
positionMode,
|
|
23131
|
+
"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",
|
|
23132
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
23133
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
23134
|
+
className
|
|
23135
|
+
),
|
|
23136
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
23137
|
+
...props,
|
|
23138
|
+
children: [
|
|
23139
|
+
children,
|
|
23140
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23141
|
+
import_radix_ui6.Dialog.Close,
|
|
23142
|
+
{
|
|
23143
|
+
type: "button",
|
|
23144
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
23145
|
+
"aria-label": "Close",
|
|
23146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
|
|
23147
|
+
}
|
|
23148
|
+
) : null
|
|
23149
|
+
]
|
|
23150
|
+
}
|
|
23151
|
+
)
|
|
23152
|
+
] });
|
|
23153
|
+
}
|
|
23154
|
+
);
|
|
23155
|
+
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
23156
|
+
function DialogHeader({
|
|
23157
|
+
className,
|
|
23158
|
+
...props
|
|
23159
|
+
}) {
|
|
23160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
23161
|
+
}
|
|
23162
|
+
function DialogFooter({
|
|
23163
|
+
className,
|
|
23164
|
+
...props
|
|
23165
|
+
}) {
|
|
23166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23167
|
+
"div",
|
|
23168
|
+
{
|
|
23169
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
23170
|
+
...props
|
|
23171
|
+
}
|
|
23172
|
+
);
|
|
23173
|
+
}
|
|
23174
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23175
|
+
import_radix_ui6.Dialog.Title,
|
|
23176
|
+
{
|
|
23177
|
+
ref,
|
|
23178
|
+
className: cn(
|
|
23179
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
23180
|
+
className
|
|
23181
|
+
),
|
|
23182
|
+
...props
|
|
23183
|
+
}
|
|
23184
|
+
));
|
|
23185
|
+
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
23186
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23187
|
+
import_radix_ui6.Dialog.Description,
|
|
23188
|
+
{
|
|
23189
|
+
ref,
|
|
23190
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
23191
|
+
...props
|
|
23192
|
+
}
|
|
23193
|
+
));
|
|
23194
|
+
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
23195
|
+
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
23196
|
+
|
|
23296
23197
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
23297
23198
|
var import_lucide_react16 = require("lucide-react");
|
|
23298
23199
|
|
|
@@ -24396,7 +24297,6 @@ function shouldUseDevFixtures() {
|
|
|
24396
24297
|
function getLogoElement(el) {
|
|
24397
24298
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
24398
24299
|
if (marked) return marked;
|
|
24399
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
24400
24300
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
24401
24301
|
if (!root) return null;
|
|
24402
24302
|
const anchor = el.closest("a");
|
|
@@ -27213,7 +27113,7 @@ function getNavigationSelectionParent(el) {
|
|
|
27213
27113
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
27214
27114
|
return resolveFooterLinksContainerFrom(el);
|
|
27215
27115
|
}
|
|
27216
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
27116
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
27217
27117
|
return getNavigationRoot(el);
|
|
27218
27118
|
}
|
|
27219
27119
|
return null;
|
|
@@ -27435,6 +27335,7 @@ var ICONS = {
|
|
|
27435
27335
|
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"/>',
|
|
27436
27336
|
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"/>'
|
|
27437
27337
|
};
|
|
27338
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
27438
27339
|
var SELECTION_CHROME_GAP2 = 4;
|
|
27439
27340
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
27440
27341
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -27532,7 +27433,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
27532
27433
|
el.style.top = `${top}px`;
|
|
27533
27434
|
el.style.height = `${height}px`;
|
|
27534
27435
|
}
|
|
27535
|
-
var
|
|
27436
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
27536
27437
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
27537
27438
|
const isAbove = transform.includes("translateY(-100%)");
|
|
27538
27439
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -27559,8 +27460,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
27559
27460
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
27560
27461
|
const half = toolbarWidth / 2;
|
|
27561
27462
|
return Math.max(
|
|
27562
|
-
|
|
27563
|
-
Math.min(centerX, window.innerWidth -
|
|
27463
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
27464
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
27564
27465
|
);
|
|
27565
27466
|
}
|
|
27566
27467
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -28472,6 +28373,21 @@ function OhhwellsBridge() {
|
|
|
28472
28373
|
const [isItemDragging, setIsItemDragging] = (0, import_react26.useState)(false);
|
|
28473
28374
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react26.useState)(false);
|
|
28474
28375
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
28376
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react26.useState)(null);
|
|
28377
|
+
const floatingPanelOpenRef = (0, import_react26.useRef)(false);
|
|
28378
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
28379
|
+
const floatingPanelRef = (0, import_react26.useRef)(null);
|
|
28380
|
+
floatingPanelRef.current = floatingPanel;
|
|
28381
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react26.useState)(null);
|
|
28382
|
+
const buttonCollectionDragRef = (0, import_react26.useRef)(null);
|
|
28383
|
+
const buttonDropInsertIndexRef = (0, import_react26.useRef)(null);
|
|
28384
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react26.useState)([]);
|
|
28385
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react26.useState)(null);
|
|
28386
|
+
const buttonPointerDragRef = (0, import_react26.useRef)(null);
|
|
28387
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react26.useState)(0);
|
|
28388
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react26.useState)(null);
|
|
28389
|
+
const [editorViewport, setEditorViewport] = (0, import_react26.useState)("desktop");
|
|
28390
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react26.useState)(null);
|
|
28475
28391
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react26.useState)(null);
|
|
28476
28392
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react26.useState)(null);
|
|
28477
28393
|
const footerDragRef = (0, import_react26.useRef)(null);
|
|
@@ -28498,21 +28414,6 @@ function OhhwellsBridge() {
|
|
|
28498
28414
|
const stylesRef = (0, import_react26.useRef)("");
|
|
28499
28415
|
const appliedDrawerRef = (0, import_react26.useRef)(null);
|
|
28500
28416
|
const pendingDeleteUndoRef = (0, import_react26.useRef)(null);
|
|
28501
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react26.useState)(null);
|
|
28502
|
-
const floatingPanelOpenRef = (0, import_react26.useRef)(false);
|
|
28503
|
-
const floatingPanelRef = (0, import_react26.useRef)(null);
|
|
28504
|
-
floatingPanelRef.current = floatingPanel;
|
|
28505
|
-
const setFloatingPanelRef = (0, import_react26.useRef)(setFloatingPanel);
|
|
28506
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react26.useState)(null);
|
|
28507
|
-
const buttonCollectionDragRef = (0, import_react26.useRef)(null);
|
|
28508
|
-
const buttonDropInsertIndexRef = (0, import_react26.useRef)(null);
|
|
28509
|
-
const [buttonDropSlots, setButtonDropSlots] = (0, import_react26.useState)([]);
|
|
28510
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react26.useState)(null);
|
|
28511
|
-
const buttonPointerDragRef = (0, import_react26.useRef)(null);
|
|
28512
|
-
const [buttonStyleTick, setButtonStyleTick] = (0, import_react26.useState)(0);
|
|
28513
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react26.useState)(null);
|
|
28514
|
-
const [editorViewport, setEditorViewport] = (0, import_react26.useState)("desktop");
|
|
28515
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react26.useState)(null);
|
|
28516
28417
|
const [sitePages, setSitePages] = (0, import_react26.useState)([]);
|
|
28517
28418
|
const collectionItemsRef = (0, import_react26.useRef)(/* @__PURE__ */ new Map());
|
|
28518
28419
|
const [sectionsByPath, setSectionsByPath] = (0, import_react26.useState)({});
|
|
@@ -28522,18 +28423,7 @@ function OhhwellsBridge() {
|
|
|
28522
28423
|
const linkPopoverOpenRef = (0, import_react26.useRef)(false);
|
|
28523
28424
|
const linkPopoverGraceUntilRef = (0, import_react26.useRef)(0);
|
|
28524
28425
|
setLinkPopoverRef.current = setLinkPopover;
|
|
28525
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
28526
28426
|
linkPopoverSessionRef.current = linkPopover;
|
|
28527
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
28528
|
-
(0, import_react26.useEffect)(() => {
|
|
28529
|
-
const syncViewport = () => {
|
|
28530
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
28531
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
28532
|
-
};
|
|
28533
|
-
syncViewport();
|
|
28534
|
-
window.addEventListener("resize", syncViewport);
|
|
28535
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
28536
|
-
}, []);
|
|
28537
28427
|
(0, import_react26.useEffect)(() => {
|
|
28538
28428
|
setSectionOrderPersistHandler((entries) => {
|
|
28539
28429
|
const currentPath = window.location.pathname;
|
|
@@ -30276,7 +30166,6 @@ function OhhwellsBridge() {
|
|
|
30276
30166
|
applyAiFooterFromContent(content);
|
|
30277
30167
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30278
30168
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
30279
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30280
30169
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30281
30170
|
}
|
|
30282
30171
|
applyBrandChrome(content);
|
|
@@ -30287,12 +30176,12 @@ function OhhwellsBridge() {
|
|
|
30287
30176
|
if (key === "__ohw_sections") continue;
|
|
30288
30177
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30289
30178
|
if (key === AI_FOOTER_KEY) continue;
|
|
30290
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30291
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30292
30179
|
if (key === BRAND_KIT_KEY) continue;
|
|
30293
30180
|
if (key === STYLE_STORE_KEY) continue;
|
|
30294
30181
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30182
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30295
30183
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
30184
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30296
30185
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30297
30186
|
continue;
|
|
30298
30187
|
}
|
|
@@ -30527,18 +30416,17 @@ function OhhwellsBridge() {
|
|
|
30527
30416
|
}
|
|
30528
30417
|
applyAiFooterFromContent(content);
|
|
30529
30418
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30530
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30531
30419
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30532
30420
|
}
|
|
30533
30421
|
for (const [key, val] of Object.entries(content)) {
|
|
30534
30422
|
if (key === "__ohw_sections") continue;
|
|
30535
30423
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30536
30424
|
if (key === AI_FOOTER_KEY) continue;
|
|
30537
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30538
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30539
30425
|
if (key === BRAND_KIT_KEY) continue;
|
|
30540
30426
|
if (key === STYLE_STORE_KEY) continue;
|
|
30541
30427
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30428
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30429
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30542
30430
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30543
30431
|
continue;
|
|
30544
30432
|
}
|
|
@@ -30810,11 +30698,26 @@ function OhhwellsBridge() {
|
|
|
30810
30698
|
const t2 = setTimeout(measure, 500);
|
|
30811
30699
|
const ro = new ResizeObserver(schedule);
|
|
30812
30700
|
ro.observe(document.body);
|
|
30701
|
+
let lastWidth = window.innerWidth;
|
|
30702
|
+
let resizeTimers = [];
|
|
30703
|
+
const clearResizeTimers = () => {
|
|
30704
|
+
resizeTimers.forEach(clearTimeout);
|
|
30705
|
+
resizeTimers = [];
|
|
30706
|
+
};
|
|
30707
|
+
const handleResize = () => {
|
|
30708
|
+
if (window.innerWidth === lastWidth) return;
|
|
30709
|
+
lastWidth = window.innerWidth;
|
|
30710
|
+
clearResizeTimers();
|
|
30711
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
30712
|
+
};
|
|
30713
|
+
window.addEventListener("resize", handleResize);
|
|
30813
30714
|
return () => {
|
|
30814
30715
|
clearTimeout(t1);
|
|
30815
30716
|
clearTimeout(t2);
|
|
30816
30717
|
if (raf != null) cancelAnimationFrame(raf);
|
|
30817
30718
|
ro.disconnect();
|
|
30719
|
+
clearResizeTimers();
|
|
30720
|
+
window.removeEventListener("resize", handleResize);
|
|
30818
30721
|
};
|
|
30819
30722
|
}, [pathname, isEditMode, postToParent2]);
|
|
30820
30723
|
(0, import_react26.useEffect)(() => {
|
|
@@ -31111,13 +31014,6 @@ function OhhwellsBridge() {
|
|
|
31111
31014
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
31112
31015
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
31113
31016
|
if (isInsideLinkEditor(target)) return;
|
|
31114
|
-
if (isInsideFloatingPanel(target)) return;
|
|
31115
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
31116
|
-
if (target.closest(
|
|
31117
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
31118
|
-
)) {
|
|
31119
|
-
return;
|
|
31120
|
-
}
|
|
31121
31017
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
31122
31018
|
clearMediaSelectionRef.current();
|
|
31123
31019
|
}
|
|
@@ -31141,6 +31037,8 @@ function OhhwellsBridge() {
|
|
|
31141
31037
|
return;
|
|
31142
31038
|
}
|
|
31143
31039
|
}
|
|
31040
|
+
if (isInsideFloatingPanel(target)) return;
|
|
31041
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
31144
31042
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
31145
31043
|
if (collectionItem) {
|
|
31146
31044
|
e.preventDefault();
|
|
@@ -31152,6 +31050,11 @@ function OhhwellsBridge() {
|
|
|
31152
31050
|
});
|
|
31153
31051
|
return;
|
|
31154
31052
|
}
|
|
31053
|
+
if (target.closest(
|
|
31054
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
31055
|
+
)) {
|
|
31056
|
+
return;
|
|
31057
|
+
}
|
|
31155
31058
|
{
|
|
31156
31059
|
const formEl = getFormElement(target);
|
|
31157
31060
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -31315,13 +31218,9 @@ function OhhwellsBridge() {
|
|
|
31315
31218
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
31316
31219
|
e.preventDefault();
|
|
31317
31220
|
e.stopPropagation();
|
|
31221
|
+
selectIconElementRef.current(editable);
|
|
31318
31222
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
31319
31223
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
31320
|
-
if (aiIcon) {
|
|
31321
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
31322
|
-
} else {
|
|
31323
|
-
selectIconElementRef.current(editable);
|
|
31324
|
-
}
|
|
31325
31224
|
postToParentRef.current({
|
|
31326
31225
|
type: "ow:icon-pick",
|
|
31327
31226
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -31549,9 +31448,6 @@ function OhhwellsBridge() {
|
|
|
31549
31448
|
setHoveredItemRect(null);
|
|
31550
31449
|
hoveredNavContainerRef.current = null;
|
|
31551
31450
|
setHoveredNavContainerRect(null);
|
|
31552
|
-
siblingHintElRef.current = null;
|
|
31553
|
-
setSiblingHintRect(null);
|
|
31554
|
-
setSiblingHintRects([]);
|
|
31555
31451
|
return;
|
|
31556
31452
|
}
|
|
31557
31453
|
{
|
|
@@ -31674,6 +31570,7 @@ function OhhwellsBridge() {
|
|
|
31674
31570
|
hoveredNavContainerRef.current = null;
|
|
31675
31571
|
setHoveredNavContainerRect(null);
|
|
31676
31572
|
hoveredItemElRef.current = editable;
|
|
31573
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
31677
31574
|
}
|
|
31678
31575
|
}
|
|
31679
31576
|
}
|
|
@@ -32380,11 +32277,7 @@ function OhhwellsBridge() {
|
|
|
32380
32277
|
};
|
|
32381
32278
|
const handleMouseMove = (e) => {
|
|
32382
32279
|
const { clientX, clientY } = e;
|
|
32383
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
32384
|
-
dismissImageHover();
|
|
32385
|
-
clearImageHover();
|
|
32386
|
-
return;
|
|
32387
|
-
}
|
|
32280
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
32388
32281
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
32389
32282
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
32390
32283
|
formHoverElRef.current = null;
|
|
@@ -32413,12 +32306,7 @@ function OhhwellsBridge() {
|
|
|
32413
32306
|
setHoveredItemRect(null);
|
|
32414
32307
|
hoveredNavContainerRef.current = null;
|
|
32415
32308
|
setHoveredNavContainerRect(null);
|
|
32416
|
-
siblingHintElRef.current = null;
|
|
32417
|
-
setSiblingHintRect(null);
|
|
32418
|
-
setSiblingHintRects([]);
|
|
32419
32309
|
dismissImageHover();
|
|
32420
|
-
clearImageHover();
|
|
32421
|
-
setSectionGap(null);
|
|
32422
32310
|
return;
|
|
32423
32311
|
}
|
|
32424
32312
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -32430,11 +32318,7 @@ function OhhwellsBridge() {
|
|
|
32430
32318
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
32431
32319
|
const { clientX, clientY } = e.data;
|
|
32432
32320
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
32433
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
32434
|
-
dismissImageHover();
|
|
32435
|
-
clearImageHover();
|
|
32436
|
-
return;
|
|
32437
|
-
}
|
|
32321
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
32438
32322
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
32439
32323
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
32440
32324
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -32814,7 +32698,6 @@ function OhhwellsBridge() {
|
|
|
32814
32698
|
applyAiFooterFromContent(content);
|
|
32815
32699
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
32816
32700
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
32817
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
32818
32701
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
32819
32702
|
}
|
|
32820
32703
|
applyBrandChrome(content);
|
|
@@ -32829,12 +32712,12 @@ function OhhwellsBridge() {
|
|
|
32829
32712
|
}
|
|
32830
32713
|
if (key === AI_SECTIONS_KEY) continue;
|
|
32831
32714
|
if (key === AI_FOOTER_KEY) continue;
|
|
32832
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
32833
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
32834
32715
|
if (key === BRAND_KIT_KEY) continue;
|
|
32835
32716
|
if (key === STYLE_STORE_KEY) continue;
|
|
32836
32717
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
32718
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
32837
32719
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
32720
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
32838
32721
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
32839
32722
|
continue;
|
|
32840
32723
|
}
|
|
@@ -33506,12 +33389,6 @@ function OhhwellsBridge() {
|
|
|
33506
33389
|
closeLinkPopoverRef.current();
|
|
33507
33390
|
return;
|
|
33508
33391
|
}
|
|
33509
|
-
if (floatingPanelOpenRef.current) {
|
|
33510
|
-
setFloatingPanelRef.current(null);
|
|
33511
|
-
deselectRef.current();
|
|
33512
|
-
deactivateRef.current();
|
|
33513
|
-
return;
|
|
33514
|
-
}
|
|
33515
33392
|
deselectRef.current();
|
|
33516
33393
|
deactivateRef.current();
|
|
33517
33394
|
clearMediaSelectionRef.current();
|
|
@@ -34341,10 +34218,10 @@ function OhhwellsBridge() {
|
|
|
34341
34218
|
window.removeEventListener("message", handleDuplicateSection);
|
|
34342
34219
|
window.removeEventListener("message", handleDeactivate);
|
|
34343
34220
|
window.removeEventListener("message", handleSelectNav);
|
|
34221
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
34344
34222
|
window.removeEventListener("message", handleToastAction);
|
|
34345
34223
|
window.removeEventListener("message", handleFormCount);
|
|
34346
34224
|
window.removeEventListener("message", handleUiEscape);
|
|
34347
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
34348
34225
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
34349
34226
|
autoSaveTimers.current.clear();
|
|
34350
34227
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -34638,7 +34515,7 @@ function OhhwellsBridge() {
|
|
|
34638
34515
|
postToParent2({
|
|
34639
34516
|
type: "ow:ready",
|
|
34640
34517
|
version: "1",
|
|
34641
|
-
bridgeVersion: "0.1.
|
|
34518
|
+
bridgeVersion: "0.1.174",
|
|
34642
34519
|
path: pathname,
|
|
34643
34520
|
nodes: collectEditableNodes(editContentRef.current),
|
|
34644
34521
|
sections
|