@ohhwells/bridge 0.1.179-next.473 → 0.1.179
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 +728 -867
- 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
|
@@ -8234,21 +8234,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
8234
8234
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
8235
8235
|
return target ? pricingFeatureList(target).length : 0;
|
|
8236
8236
|
}
|
|
8237
|
-
function prevailingFeatureIcon(features) {
|
|
8238
|
-
const counts = /* @__PURE__ */ new Map();
|
|
8239
|
-
for (const row of features) {
|
|
8240
|
-
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
8241
|
-
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
8242
|
-
entry.count += 1;
|
|
8243
|
-
counts.set(key, entry);
|
|
8244
|
-
}
|
|
8245
|
-
let best = null;
|
|
8246
|
-
for (const entry of counts.values()) {
|
|
8247
|
-
if (!best || entry.count > best.count) best = entry;
|
|
8248
|
-
}
|
|
8249
|
-
if (!best) return {};
|
|
8250
|
-
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
8251
|
-
}
|
|
8252
8237
|
function addPricingCardFeature(tree, index, text) {
|
|
8253
8238
|
return withPricingCollection(tree, (collection) => {
|
|
8254
8239
|
const children = collection.children;
|
|
@@ -8257,7 +8242,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
8257
8242
|
const features = pricingFeatureList(target);
|
|
8258
8243
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
8259
8244
|
target.slots = target.slots ?? {};
|
|
8260
|
-
target.slots.features = [...features, { text
|
|
8245
|
+
target.slots.features = [...features, { text }];
|
|
8261
8246
|
return true;
|
|
8262
8247
|
});
|
|
8263
8248
|
}
|
|
@@ -9792,7 +9777,7 @@ var AI_MOBILE_CSS = [
|
|
|
9792
9777
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
9793
9778
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
9794
9779
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
9795
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
9780
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
9796
9781
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
9797
9782
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
9798
9783
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -9808,10 +9793,8 @@ var AI_MOBILE_CSS = [
|
|
|
9808
9793
|
"[data-ai-section]{overflow-x:hidden}",
|
|
9809
9794
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
9810
9795
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
9811
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
9812
|
-
|
|
9813
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
9814
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
9796
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
9797
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
9815
9798
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
9816
9799
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
9817
9800
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -10016,31 +9999,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
10016
9999
|
function textAttrs(ctx, path) {
|
|
10017
10000
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
10018
10001
|
}
|
|
10019
|
-
var AI_RESPONSIVE_CSS = [
|
|
10020
|
-
"@media (max-width: 960px) {",
|
|
10021
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
10022
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
10023
|
-
"}",
|
|
10024
|
-
"@media (max-width: 640px) {",
|
|
10025
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
10026
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
10027
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
10028
|
-
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
10029
|
-
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
10030
|
-
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
10031
|
-
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
10032
|
-
// layered text used to be.
|
|
10033
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
10034
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
10035
|
-
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
10036
|
-
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
10037
|
-
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
10038
|
-
// other rule had already been taught to stand down.
|
|
10039
|
-
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
10040
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
10041
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
10042
|
-
"}"
|
|
10043
|
-
].join("\n");
|
|
10044
10002
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
10045
10003
|
function MediaBox({
|
|
10046
10004
|
refValue,
|
|
@@ -10095,7 +10053,7 @@ function MediaBox({
|
|
|
10095
10053
|
position: fill ? "absolute" : void 0,
|
|
10096
10054
|
inset: fill ? 0 : void 0,
|
|
10097
10055
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
10098
|
-
height: fill ? "100%" :
|
|
10056
|
+
height: fill ? "100%" : void 0,
|
|
10099
10057
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
10100
10058
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
10101
10059
|
borderRadius: radius,
|
|
@@ -11597,7 +11555,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
11597
11555
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
11598
11556
|
"div",
|
|
11599
11557
|
{
|
|
11600
|
-
"data-ai-grid":
|
|
11558
|
+
"data-ai-grid": "",
|
|
11601
11559
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
11602
11560
|
style: {
|
|
11603
11561
|
display: "grid",
|
|
@@ -11899,7 +11857,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
11899
11857
|
},
|
|
11900
11858
|
children: [
|
|
11901
11859
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
11902
|
-
// The section's `data-ai-
|
|
11860
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
11903
11861
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
11904
11862
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
11905
11863
|
// the full section width instead of reading at the usual content width.
|
|
@@ -12313,7 +12271,6 @@ function AiTreeRenderer({
|
|
|
12313
12271
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
12314
12272
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
12315
12273
|
...bgAttrs,
|
|
12316
|
-
"data-ai-responsive": "",
|
|
12317
12274
|
style: {
|
|
12318
12275
|
position: "relative",
|
|
12319
12276
|
padding: `${padCss} 0`,
|
|
@@ -12327,13 +12284,12 @@ function AiTreeRenderer({
|
|
|
12327
12284
|
...fillHeight ? { display: "grid" } : {}
|
|
12328
12285
|
},
|
|
12329
12286
|
children: [
|
|
12330
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
|
|
12331
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
12332
12287
|
isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
12288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
12333
12289
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
12334
12290
|
"div",
|
|
12335
12291
|
{
|
|
12336
|
-
"data-ai-
|
|
12292
|
+
"data-ai-container": "",
|
|
12337
12293
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
12338
12294
|
style: {
|
|
12339
12295
|
position: "relative",
|
|
@@ -12350,7 +12306,7 @@ function AiTreeRenderer({
|
|
|
12350
12306
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
12351
12307
|
"div",
|
|
12352
12308
|
{
|
|
12353
|
-
"data-ai-
|
|
12309
|
+
"data-ai-row": "",
|
|
12354
12310
|
style: {
|
|
12355
12311
|
display: "grid",
|
|
12356
12312
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -13012,10 +12968,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
13012
12968
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
13013
12969
|
continue;
|
|
13014
12970
|
}
|
|
12971
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
13015
12972
|
let container = existing?.container;
|
|
13016
|
-
let isNewMount = false;
|
|
13017
12973
|
if (!container || !container.isConnected) {
|
|
13018
|
-
isNewMount = true;
|
|
13019
12974
|
existing?.root.unmount();
|
|
13020
12975
|
container?.remove();
|
|
13021
12976
|
container = document.createElement("div");
|
|
@@ -13353,34 +13308,6 @@ function minSpanForFooterBlock(type) {
|
|
|
13353
13308
|
return 3;
|
|
13354
13309
|
}
|
|
13355
13310
|
}
|
|
13356
|
-
function readLiveSocialItems() {
|
|
13357
|
-
const root = getFooterRoot();
|
|
13358
|
-
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
13359
|
-
if (!row) return [];
|
|
13360
|
-
const items = [];
|
|
13361
|
-
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
13362
|
-
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
13363
|
-
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
13364
|
-
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
13365
|
-
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
13366
|
-
items.push({ platform, href });
|
|
13367
|
-
}
|
|
13368
|
-
return items;
|
|
13369
|
-
}
|
|
13370
|
-
function syncSocialRowsFromDom(tree) {
|
|
13371
|
-
const root = getFooterRoot();
|
|
13372
|
-
if (!root) return;
|
|
13373
|
-
const row = root.querySelector("[data-ohw-socials-row]");
|
|
13374
|
-
const live = readLiveSocialItems();
|
|
13375
|
-
if (row && live.length === 0) return;
|
|
13376
|
-
for (const col of tree.columns) {
|
|
13377
|
-
col.blocks = col.blocks.flatMap((block) => {
|
|
13378
|
-
if (block.type !== "social-row") return [block];
|
|
13379
|
-
if (!row) return [];
|
|
13380
|
-
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
13381
|
-
});
|
|
13382
|
-
}
|
|
13383
|
-
}
|
|
13384
13311
|
function collectBrandBlocks(tree) {
|
|
13385
13312
|
const brand = [];
|
|
13386
13313
|
for (const col of tree.columns) {
|
|
@@ -13626,7 +13553,6 @@ function textOf2(el) {
|
|
|
13626
13553
|
}
|
|
13627
13554
|
function syncFooterTreeLinksFromDom(tree) {
|
|
13628
13555
|
const next = cloneTree2(tree);
|
|
13629
|
-
syncSocialRowsFromDom(next);
|
|
13630
13556
|
const domCols = listFooterColumns().map((col) => {
|
|
13631
13557
|
const heading = getFooterColumnHeadingEl(col);
|
|
13632
13558
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -19452,7 +19378,7 @@ function apiBase() {
|
|
|
19452
19378
|
function bridgeVersion() {
|
|
19453
19379
|
try {
|
|
19454
19380
|
if (true) {
|
|
19455
|
-
return "0.1.179
|
|
19381
|
+
return "0.1.179";
|
|
19456
19382
|
}
|
|
19457
19383
|
} catch {
|
|
19458
19384
|
}
|
|
@@ -19466,7 +19392,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
19466
19392
|
return;
|
|
19467
19393
|
}
|
|
19468
19394
|
try {
|
|
19469
|
-
const v = true ? "0.1.179
|
|
19395
|
+
const v = true ? "0.1.179" : "";
|
|
19470
19396
|
if (v) {
|
|
19471
19397
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
19472
19398
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -20147,7 +20073,6 @@ function MediaOverlay({
|
|
|
20147
20073
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
20148
20074
|
);
|
|
20149
20075
|
}, [isVideo]);
|
|
20150
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
20151
20076
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
20152
20077
|
const box = {
|
|
20153
20078
|
position: "fixed",
|
|
@@ -20246,9 +20171,10 @@ function MediaOverlay({
|
|
|
20246
20171
|
className: "flex items-center justify-center cursor-pointer",
|
|
20247
20172
|
style: {
|
|
20248
20173
|
...box,
|
|
20249
|
-
//
|
|
20250
|
-
//
|
|
20251
|
-
//
|
|
20174
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
20175
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
20176
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
20177
|
+
// Replace still works.
|
|
20252
20178
|
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
20253
20179
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
20254
20180
|
// than hovered. Hover keeps the existing tinted preview.
|
|
@@ -20276,18 +20202,15 @@ function MediaOverlay({
|
|
|
20276
20202
|
},
|
|
20277
20203
|
children: [
|
|
20278
20204
|
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 }),
|
|
20279
|
-
|
|
20205
|
+
isVideo ? "Replace video" : "Replace image"
|
|
20280
20206
|
]
|
|
20281
20207
|
}
|
|
20282
20208
|
),
|
|
20283
|
-
|
|
20209
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
20284
20210
|
"div",
|
|
20285
20211
|
{
|
|
20286
20212
|
className: "flex items-center gap-1.5",
|
|
20287
|
-
style: {
|
|
20288
|
-
// Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
|
|
20289
|
-
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
|
|
20290
|
-
},
|
|
20213
|
+
style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
|
|
20291
20214
|
onClick: (e) => e.stopPropagation(),
|
|
20292
20215
|
children: [
|
|
20293
20216
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
@@ -20296,7 +20219,7 @@ function MediaOverlay({
|
|
|
20296
20219
|
"data-ohw-media-overlay": "",
|
|
20297
20220
|
variant: "outline",
|
|
20298
20221
|
size: "sm",
|
|
20299
|
-
"aria-label":
|
|
20222
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
20300
20223
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
20301
20224
|
style: {
|
|
20302
20225
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -20317,7 +20240,7 @@ function MediaOverlay({
|
|
|
20317
20240
|
},
|
|
20318
20241
|
children: [
|
|
20319
20242
|
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 }),
|
|
20320
|
-
replaceMode === "full" ?
|
|
20243
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
20321
20244
|
]
|
|
20322
20245
|
}
|
|
20323
20246
|
),
|
|
@@ -20975,7 +20898,7 @@ function AiSectionOverlay({
|
|
|
20975
20898
|
|
|
20976
20899
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
20977
20900
|
var import_react14 = require("react");
|
|
20978
|
-
var
|
|
20901
|
+
var import_lucide_react8 = require("lucide-react");
|
|
20979
20902
|
|
|
20980
20903
|
// src/lib/ai-media-strip-tree.ts
|
|
20981
20904
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -21089,6 +21012,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
21089
21012
|
return true;
|
|
21090
21013
|
});
|
|
21091
21014
|
}
|
|
21015
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
21016
|
+
return withMediaStrip(tree, (block) => {
|
|
21017
|
+
const items = block.items;
|
|
21018
|
+
if (index < 0 || index >= items.length) return false;
|
|
21019
|
+
items[index] = { ...items[index], alt };
|
|
21020
|
+
return true;
|
|
21021
|
+
});
|
|
21022
|
+
}
|
|
21092
21023
|
function setMediaStripItemLink(tree, index, link) {
|
|
21093
21024
|
return withMediaStrip(tree, (block) => {
|
|
21094
21025
|
const items = block.items;
|
|
@@ -21106,117 +21037,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
21106
21037
|
});
|
|
21107
21038
|
}
|
|
21108
21039
|
|
|
21109
|
-
// src/ui/dialog.tsx
|
|
21110
|
-
var React9 = __toESM(require("react"), 1);
|
|
21111
|
-
var import_radix_ui6 = require("radix-ui");
|
|
21112
|
-
var import_lucide_react8 = require("lucide-react");
|
|
21113
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
21114
|
-
function Dialog2({
|
|
21115
|
-
...props
|
|
21116
|
-
}) {
|
|
21117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
21118
|
-
}
|
|
21119
|
-
function DialogPortal({
|
|
21120
|
-
...props
|
|
21121
|
-
}) {
|
|
21122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
21123
|
-
}
|
|
21124
|
-
function DialogOverlay({
|
|
21125
|
-
className,
|
|
21126
|
-
...props
|
|
21127
|
-
}) {
|
|
21128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21129
|
-
import_radix_ui6.Dialog.Overlay,
|
|
21130
|
-
{
|
|
21131
|
-
"data-slot": "dialog-overlay",
|
|
21132
|
-
"data-ohw-link-modal-root": "",
|
|
21133
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21134
|
-
...props
|
|
21135
|
-
}
|
|
21136
|
-
);
|
|
21137
|
-
}
|
|
21138
|
-
var DialogContent = React9.forwardRef(
|
|
21139
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21140
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
21141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
21142
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21143
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
21144
|
-
import_radix_ui6.Dialog.Content,
|
|
21145
|
-
{
|
|
21146
|
-
ref,
|
|
21147
|
-
"data-slot": "dialog-content",
|
|
21148
|
-
className: cn(
|
|
21149
|
-
positionMode,
|
|
21150
|
-
"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",
|
|
21151
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21152
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21153
|
-
className
|
|
21154
|
-
),
|
|
21155
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
21156
|
-
...props,
|
|
21157
|
-
children: [
|
|
21158
|
-
children,
|
|
21159
|
-
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21160
|
-
import_radix_ui6.Dialog.Close,
|
|
21161
|
-
{
|
|
21162
|
-
type: "button",
|
|
21163
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21164
|
-
"aria-label": "Close",
|
|
21165
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
|
|
21166
|
-
}
|
|
21167
|
-
) : null
|
|
21168
|
-
]
|
|
21169
|
-
}
|
|
21170
|
-
)
|
|
21171
|
-
] });
|
|
21172
|
-
}
|
|
21173
|
-
);
|
|
21174
|
-
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
21175
|
-
function DialogHeader({
|
|
21176
|
-
className,
|
|
21177
|
-
...props
|
|
21178
|
-
}) {
|
|
21179
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21180
|
-
}
|
|
21181
|
-
function DialogFooter({
|
|
21182
|
-
className,
|
|
21183
|
-
...props
|
|
21184
|
-
}) {
|
|
21185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21186
|
-
"div",
|
|
21187
|
-
{
|
|
21188
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
21189
|
-
...props
|
|
21190
|
-
}
|
|
21191
|
-
);
|
|
21192
|
-
}
|
|
21193
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21194
|
-
import_radix_ui6.Dialog.Title,
|
|
21195
|
-
{
|
|
21196
|
-
ref,
|
|
21197
|
-
className: cn(
|
|
21198
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21199
|
-
className
|
|
21200
|
-
),
|
|
21201
|
-
...props
|
|
21202
|
-
}
|
|
21203
|
-
));
|
|
21204
|
-
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
21205
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21206
|
-
import_radix_ui6.Dialog.Description,
|
|
21207
|
-
{
|
|
21208
|
-
ref,
|
|
21209
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
21210
|
-
...props
|
|
21211
|
-
}
|
|
21212
|
-
));
|
|
21213
|
-
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
21214
|
-
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
21215
|
-
|
|
21216
21040
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
21217
|
-
var
|
|
21218
|
-
var PRIMARY3 = "
|
|
21219
|
-
var
|
|
21041
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
21042
|
+
var PRIMARY3 = "#0885FE";
|
|
21043
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
21044
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
21220
21045
|
function findMediaStripItemElement(sectionId, index) {
|
|
21221
21046
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21222
21047
|
if (!sectionEl2) return null;
|
|
@@ -21226,35 +21051,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
21226
21051
|
}
|
|
21227
21052
|
return null;
|
|
21228
21053
|
}
|
|
21229
|
-
function
|
|
21230
|
-
|
|
21231
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
21232
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
21233
|
-
if (!itemEl) return null;
|
|
21234
|
-
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
21235
|
-
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
21236
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
21237
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
21238
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
21239
|
-
return { sectionId, index };
|
|
21240
|
-
}
|
|
21241
|
-
function sameRef(a, b) {
|
|
21242
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
21243
|
-
}
|
|
21244
|
-
function rectOf(el) {
|
|
21054
|
+
function readRect2(ref) {
|
|
21055
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
21245
21056
|
if (!el) return null;
|
|
21246
21057
|
const r2 = el.getBoundingClientRect();
|
|
21247
21058
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
21248
21059
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
21249
21060
|
}
|
|
21250
|
-
function
|
|
21251
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
21252
|
-
}
|
|
21253
|
-
function readStripRect(ref) {
|
|
21254
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
21255
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
21256
|
-
}
|
|
21257
|
-
function useLiveItemRect(ref, strip = false) {
|
|
21061
|
+
function useLiveItemRect(ref) {
|
|
21258
21062
|
const [rect, setRect] = (0, import_react14.useState)(null);
|
|
21259
21063
|
(0, import_react14.useEffect)(() => {
|
|
21260
21064
|
if (!ref) {
|
|
@@ -21262,7 +21066,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
21262
21066
|
return;
|
|
21263
21067
|
}
|
|
21264
21068
|
const update = () => {
|
|
21265
|
-
const next =
|
|
21069
|
+
const next = readRect2(ref);
|
|
21266
21070
|
setRect(
|
|
21267
21071
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
21268
21072
|
);
|
|
@@ -21277,49 +21081,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
21277
21081
|
window.removeEventListener("resize", update);
|
|
21278
21082
|
clearInterval(interval);
|
|
21279
21083
|
};
|
|
21280
|
-
}, [ref?.sectionId, ref?.index
|
|
21084
|
+
}, [ref?.sectionId, ref?.index]);
|
|
21281
21085
|
return rect;
|
|
21282
21086
|
}
|
|
21283
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
21284
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
21285
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
21286
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
21287
|
-
const slotRef = (0, import_react14.useRef)(null);
|
|
21288
|
-
const [shift, setShift] = (0, import_react14.useState)(0);
|
|
21289
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
21290
|
-
(0, import_react14.useLayoutEffect)(() => {
|
|
21291
|
-
const slot = slotRef.current;
|
|
21292
|
-
if (!slot) return;
|
|
21293
|
-
const clamp = () => {
|
|
21294
|
-
const w = slot.offsetWidth;
|
|
21295
|
-
if (w <= 0) return;
|
|
21296
|
-
const half = w / 2;
|
|
21297
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
21298
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
21299
|
-
};
|
|
21300
|
-
clamp();
|
|
21301
|
-
const ro = new ResizeObserver(clamp);
|
|
21302
|
-
ro.observe(slot);
|
|
21303
|
-
return () => ro.disconnect();
|
|
21304
|
-
}, [centerX, children]);
|
|
21305
|
-
const mobile = window.innerWidth <= 480;
|
|
21306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21307
|
-
"div",
|
|
21308
|
-
{
|
|
21309
|
-
ref: slotRef,
|
|
21310
|
-
"data-ohw-bridge": "",
|
|
21311
|
-
"data-ohw-item-interaction": "",
|
|
21312
|
-
className: "pointer-events-auto fixed",
|
|
21313
|
-
style: {
|
|
21314
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
21315
|
-
left: centerX + shift,
|
|
21316
|
-
transform: "translate(-50%, -100%)",
|
|
21317
|
-
zIndex: 2147483645
|
|
21318
|
-
},
|
|
21319
|
-
children
|
|
21320
|
-
}
|
|
21321
|
-
);
|
|
21322
|
-
}
|
|
21323
21087
|
function requestValidateTree(postToParent2, tree) {
|
|
21324
21088
|
return new Promise((resolve) => {
|
|
21325
21089
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -21356,72 +21120,116 @@ function requestAssetPick(postToParent2) {
|
|
|
21356
21120
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21357
21121
|
});
|
|
21358
21122
|
}
|
|
21359
|
-
function
|
|
21123
|
+
function Pill({
|
|
21360
21124
|
label,
|
|
21361
21125
|
onClick,
|
|
21362
|
-
disabled
|
|
21363
|
-
active
|
|
21364
|
-
children
|
|
21126
|
+
disabled,
|
|
21127
|
+
active
|
|
21365
21128
|
}) {
|
|
21366
|
-
|
|
21367
|
-
|
|
21368
|
-
|
|
21369
|
-
|
|
21370
|
-
|
|
21371
|
-
|
|
21372
|
-
|
|
21373
|
-
|
|
21129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21130
|
+
"button",
|
|
21131
|
+
{
|
|
21132
|
+
type: "button",
|
|
21133
|
+
onClick,
|
|
21134
|
+
disabled,
|
|
21135
|
+
style: {
|
|
21136
|
+
height: 28,
|
|
21137
|
+
padding: "0 10px",
|
|
21138
|
+
display: "inline-flex",
|
|
21139
|
+
alignItems: "center",
|
|
21140
|
+
gap: 4,
|
|
21141
|
+
borderRadius: 999,
|
|
21142
|
+
border: "none",
|
|
21143
|
+
cursor: disabled ? "default" : "pointer",
|
|
21144
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
21145
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
21146
|
+
opacity: disabled ? 0.4 : 1,
|
|
21147
|
+
fontSize: 12,
|
|
21148
|
+
lineHeight: "16px",
|
|
21149
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
21150
|
+
whiteSpace: "nowrap",
|
|
21151
|
+
flex: "0 0 auto"
|
|
21152
|
+
},
|
|
21153
|
+
children: label
|
|
21154
|
+
}
|
|
21155
|
+
);
|
|
21374
21156
|
}
|
|
21375
|
-
function
|
|
21376
|
-
|
|
21377
|
-
value,
|
|
21378
|
-
|
|
21379
|
-
|
|
21380
|
-
|
|
21381
|
-
|
|
21382
|
-
|
|
21383
|
-
|
|
21384
|
-
|
|
21385
|
-
|
|
21386
|
-
"
|
|
21387
|
-
|
|
21388
|
-
|
|
21389
|
-
|
|
21390
|
-
|
|
21391
|
-
|
|
21392
|
-
|
|
21393
|
-
|
|
21394
|
-
|
|
21395
|
-
|
|
21396
|
-
) }),
|
|
21397
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
21398
|
-
const selected = option.value === value;
|
|
21399
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
21400
|
-
DropdownMenuItem,
|
|
21157
|
+
function AltInput({ value, onCommit }) {
|
|
21158
|
+
const [draft, setDraft] = (0, import_react14.useState)(value);
|
|
21159
|
+
(0, import_react14.useEffect)(() => setDraft(value), [value]);
|
|
21160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
21161
|
+
"div",
|
|
21162
|
+
{
|
|
21163
|
+
style: {
|
|
21164
|
+
display: "flex",
|
|
21165
|
+
alignItems: "center",
|
|
21166
|
+
gap: 6,
|
|
21167
|
+
height: 28,
|
|
21168
|
+
padding: "0 12px",
|
|
21169
|
+
borderRadius: 999,
|
|
21170
|
+
background: "#ffffff",
|
|
21171
|
+
width: "100%",
|
|
21172
|
+
maxWidth: 260,
|
|
21173
|
+
boxSizing: "border-box"
|
|
21174
|
+
},
|
|
21175
|
+
children: [
|
|
21176
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21177
|
+
"span",
|
|
21401
21178
|
{
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
)
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21179
|
+
style: {
|
|
21180
|
+
flex: "0 0 auto",
|
|
21181
|
+
color: OHW_BLUE_DARK,
|
|
21182
|
+
fontSize: 10,
|
|
21183
|
+
fontWeight: 700,
|
|
21184
|
+
textTransform: "uppercase",
|
|
21185
|
+
letterSpacing: 0.4
|
|
21186
|
+
},
|
|
21187
|
+
children: "Alt"
|
|
21188
|
+
}
|
|
21189
|
+
),
|
|
21190
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21191
|
+
"input",
|
|
21192
|
+
{
|
|
21193
|
+
type: "text",
|
|
21194
|
+
value: draft,
|
|
21195
|
+
onChange: (e) => setDraft(e.target.value),
|
|
21196
|
+
onBlur: () => {
|
|
21197
|
+
if (draft !== value) onCommit(draft);
|
|
21198
|
+
},
|
|
21199
|
+
onKeyDown: (e) => {
|
|
21200
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
21201
|
+
if (e.key === "Escape") {
|
|
21202
|
+
setDraft(value);
|
|
21203
|
+
e.currentTarget.blur();
|
|
21204
|
+
}
|
|
21205
|
+
},
|
|
21206
|
+
placeholder: "Describe this image",
|
|
21207
|
+
"aria-label": "Image alt text",
|
|
21208
|
+
style: {
|
|
21209
|
+
flex: 1,
|
|
21210
|
+
minWidth: 0,
|
|
21211
|
+
border: "none",
|
|
21212
|
+
outline: "none",
|
|
21213
|
+
background: "transparent",
|
|
21214
|
+
fontSize: 12,
|
|
21215
|
+
lineHeight: "16px",
|
|
21216
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
21217
|
+
color: "#1f2937"
|
|
21218
|
+
}
|
|
21219
|
+
}
|
|
21220
|
+
)
|
|
21221
|
+
]
|
|
21222
|
+
}
|
|
21223
|
+
);
|
|
21224
|
+
}
|
|
21225
|
+
var VARIANTS = [
|
|
21418
21226
|
{ value: "logos", label: "Logos" },
|
|
21419
21227
|
{ value: "reel", label: "Reel" }
|
|
21420
21228
|
];
|
|
21421
21229
|
var ALIGNS = [
|
|
21422
|
-
{ value: "left", label: "
|
|
21423
|
-
{ value: "center", label: "
|
|
21424
|
-
{ value: "right", label: "
|
|
21230
|
+
{ value: "left", label: "Left" },
|
|
21231
|
+
{ value: "center", label: "Center" },
|
|
21232
|
+
{ value: "right", label: "Right" }
|
|
21425
21233
|
];
|
|
21426
21234
|
var HOVERS = [
|
|
21427
21235
|
{ value: "none", label: "None" },
|
|
@@ -21429,104 +21237,104 @@ var HOVERS = [
|
|
|
21429
21237
|
{ value: "zoom", label: "Zoom" },
|
|
21430
21238
|
{ value: "fade", label: "Fade" }
|
|
21431
21239
|
];
|
|
21240
|
+
var TREATMENTS = [
|
|
21241
|
+
{ value: "color", label: "Color" },
|
|
21242
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
21243
|
+
];
|
|
21432
21244
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
21433
|
-
function
|
|
21434
|
-
|
|
21435
|
-
linkTarget,
|
|
21436
|
-
onClose,
|
|
21437
|
-
onSave
|
|
21438
|
-
}) {
|
|
21439
|
-
const [draft, setDraft] = (0, import_react14.useState)(href);
|
|
21440
|
-
const [newTab, setNewTab] = (0, import_react14.useState)(linkTarget !== "same-tab");
|
|
21245
|
+
function LinkInput({ value, onCommit }) {
|
|
21246
|
+
const [draft, setDraft] = (0, import_react14.useState)(value);
|
|
21441
21247
|
const [invalid, setInvalid] = (0, import_react14.useState)(false);
|
|
21442
|
-
|
|
21248
|
+
(0, import_react14.useEffect)(() => {
|
|
21249
|
+
setDraft(value);
|
|
21250
|
+
setInvalid(false);
|
|
21251
|
+
}, [value]);
|
|
21252
|
+
const commit2 = () => {
|
|
21443
21253
|
const next = draft.trim();
|
|
21444
|
-
if (next
|
|
21445
|
-
|
|
21446
|
-
|
|
21447
|
-
|
|
21448
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
21449
|
-
onClose();
|
|
21254
|
+
if (next === value) return setInvalid(false);
|
|
21255
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
21256
|
+
setInvalid(false);
|
|
21257
|
+
onCommit(next);
|
|
21450
21258
|
};
|
|
21451
|
-
return /* @__PURE__ */ (0,
|
|
21452
|
-
|
|
21453
|
-
|
|
21454
|
-
|
|
21455
|
-
"
|
|
21456
|
-
|
|
21457
|
-
|
|
21458
|
-
|
|
21459
|
-
|
|
21460
|
-
|
|
21461
|
-
|
|
21462
|
-
|
|
21463
|
-
|
|
21464
|
-
|
|
21465
|
-
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
|
-
|
|
21469
|
-
"
|
|
21470
|
-
|
|
21471
|
-
|
|
21472
|
-
|
|
21473
|
-
|
|
21474
|
-
|
|
21475
|
-
|
|
21476
|
-
|
|
21477
|
-
|
|
21478
|
-
|
|
21479
|
-
|
|
21480
|
-
|
|
21481
|
-
|
|
21482
|
-
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
|
|
21487
|
-
|
|
21488
|
-
|
|
21489
|
-
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21494
|
-
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
|
|
21511
|
-
|
|
21512
|
-
|
|
21513
|
-
|
|
21514
|
-
|
|
21515
|
-
|
|
21259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
21260
|
+
"div",
|
|
21261
|
+
{
|
|
21262
|
+
style: {
|
|
21263
|
+
display: "flex",
|
|
21264
|
+
alignItems: "center",
|
|
21265
|
+
gap: 6,
|
|
21266
|
+
height: 28,
|
|
21267
|
+
padding: "0 12px",
|
|
21268
|
+
borderRadius: 999,
|
|
21269
|
+
background: "#ffffff",
|
|
21270
|
+
width: "100%",
|
|
21271
|
+
maxWidth: 260,
|
|
21272
|
+
boxSizing: "border-box",
|
|
21273
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
21274
|
+
},
|
|
21275
|
+
children: [
|
|
21276
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21277
|
+
"span",
|
|
21278
|
+
{
|
|
21279
|
+
style: {
|
|
21280
|
+
flex: "0 0 auto",
|
|
21281
|
+
color: OHW_BLUE_DARK,
|
|
21282
|
+
fontSize: 10,
|
|
21283
|
+
fontWeight: 700,
|
|
21284
|
+
textTransform: "uppercase",
|
|
21285
|
+
letterSpacing: 0.4
|
|
21286
|
+
},
|
|
21287
|
+
children: "Link"
|
|
21288
|
+
}
|
|
21289
|
+
),
|
|
21290
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21291
|
+
"input",
|
|
21292
|
+
{
|
|
21293
|
+
type: "text",
|
|
21294
|
+
inputMode: "url",
|
|
21295
|
+
value: draft,
|
|
21296
|
+
onChange: (e) => setDraft(e.target.value),
|
|
21297
|
+
onBlur: commit2,
|
|
21298
|
+
onKeyDown: (e) => {
|
|
21299
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
21300
|
+
if (e.key === "Escape") {
|
|
21301
|
+
setDraft(value);
|
|
21302
|
+
setInvalid(false);
|
|
21303
|
+
e.currentTarget.blur();
|
|
21304
|
+
}
|
|
21305
|
+
},
|
|
21306
|
+
placeholder: "https://example.com",
|
|
21307
|
+
"aria-label": "Image link URL",
|
|
21308
|
+
"aria-invalid": invalid,
|
|
21309
|
+
style: {
|
|
21310
|
+
flex: 1,
|
|
21311
|
+
minWidth: 0,
|
|
21312
|
+
border: "none",
|
|
21313
|
+
outline: "none",
|
|
21314
|
+
background: "transparent",
|
|
21315
|
+
fontSize: 12,
|
|
21316
|
+
lineHeight: "16px",
|
|
21317
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
21318
|
+
color: "#1f2937"
|
|
21319
|
+
}
|
|
21320
|
+
}
|
|
21321
|
+
)
|
|
21322
|
+
]
|
|
21323
|
+
}
|
|
21324
|
+
);
|
|
21516
21325
|
}
|
|
21517
21326
|
function MediaStripToolbar({
|
|
21518
21327
|
entry,
|
|
21519
21328
|
index,
|
|
21520
21329
|
pending,
|
|
21521
21330
|
error,
|
|
21522
|
-
itemEditOn,
|
|
21523
|
-
onToggleItemEdit,
|
|
21524
21331
|
onSetVariant,
|
|
21525
21332
|
onSetAlign,
|
|
21526
21333
|
onSetHover,
|
|
21527
21334
|
onSetTreatment,
|
|
21528
21335
|
onResize,
|
|
21529
|
-
|
|
21336
|
+
onSetAlt,
|
|
21337
|
+
onSetLink,
|
|
21530
21338
|
onAddItem,
|
|
21531
21339
|
onRemoveItem,
|
|
21532
21340
|
onChangeImage,
|
|
@@ -21535,102 +21343,81 @@ function MediaStripToolbar({
|
|
|
21535
21343
|
}) {
|
|
21536
21344
|
const items = mediaStripItems(entry.tree);
|
|
21537
21345
|
const itemCount = items.length;
|
|
21346
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
21347
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
21348
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
21538
21349
|
const slots = findMediaStripSlots(entry.tree);
|
|
21539
21350
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
21540
21351
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
21541
21352
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
21542
21353
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
21543
21354
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
21544
|
-
const
|
|
21545
|
-
const
|
|
21546
|
-
|
|
21355
|
+
const isMobile = window.innerWidth <= 480;
|
|
21356
|
+
const rowStyle = isMobile ? {
|
|
21357
|
+
display: "flex",
|
|
21358
|
+
gap: 6,
|
|
21359
|
+
flexWrap: "nowrap",
|
|
21360
|
+
justifyContent: "center",
|
|
21361
|
+
overflowX: "auto",
|
|
21362
|
+
WebkitOverflowScrolling: "touch",
|
|
21363
|
+
width: "100%",
|
|
21364
|
+
scrollbarWidth: "none"
|
|
21365
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
21366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
21547
21367
|
"div",
|
|
21548
21368
|
{
|
|
21549
21369
|
"data-ohw-bridge": "",
|
|
21550
21370
|
"data-ohw-toolbar": "",
|
|
21551
21371
|
onMouseDown: (e) => e.stopPropagation(),
|
|
21552
|
-
|
|
21553
|
-
|
|
21372
|
+
style: {
|
|
21373
|
+
display: "flex",
|
|
21374
|
+
flexDirection: "column",
|
|
21375
|
+
gap: 6,
|
|
21376
|
+
alignItems: "center",
|
|
21377
|
+
background: OHW_BLUE,
|
|
21378
|
+
padding: 8,
|
|
21379
|
+
borderRadius: 12,
|
|
21380
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
21381
|
+
pointerEvents: pending ? "none" : "auto",
|
|
21382
|
+
opacity: pending ? 0.6 : 1,
|
|
21383
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
21384
|
+
},
|
|
21554
21385
|
children: [
|
|
21555
|
-
/* @__PURE__ */ (0,
|
|
21556
|
-
|
|
21557
|
-
{
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21561
|
-
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21584
|
-
|
|
21585
|
-
|
|
21586
|
-
|
|
21587
|
-
) }),
|
|
21588
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
21589
|
-
] }),
|
|
21590
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21591
|
-
/* @__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" } }) }),
|
|
21592
|
-
/* @__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" } }) }),
|
|
21593
|
-
/* @__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" } }) }),
|
|
21594
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21595
|
-
ToolbarAction,
|
|
21596
|
-
{
|
|
21597
|
-
label: gatedLabel("Move right"),
|
|
21598
|
-
onClick: onMoveRight,
|
|
21599
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
21600
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
|
|
21601
|
-
}
|
|
21602
|
-
),
|
|
21603
|
-
/* @__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" } }) }),
|
|
21604
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21605
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
21606
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
21607
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21608
|
-
ToolbarAction,
|
|
21609
|
-
{
|
|
21610
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
21611
|
-
active: treatment === "grayscale",
|
|
21612
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
21613
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
21614
|
-
}
|
|
21615
|
-
),
|
|
21616
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21617
|
-
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)),
|
|
21618
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21619
|
-
/* @__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" } }) }),
|
|
21620
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
21621
|
-
sizeValue,
|
|
21622
|
-
"px"
|
|
21623
|
-
] }),
|
|
21624
|
-
/* @__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" } }) }),
|
|
21625
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21626
|
-
/* @__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" } }) })
|
|
21627
|
-
]
|
|
21628
|
-
}
|
|
21629
|
-
),
|
|
21630
|
-
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 })
|
|
21386
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21387
|
+
VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
21388
|
+
ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
21389
|
+
] }),
|
|
21390
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21391
|
+
HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
21392
|
+
TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
21393
|
+
] }),
|
|
21394
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21395
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
21396
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
21397
|
+
sizeValue,
|
|
21398
|
+
"px"
|
|
21399
|
+
] }),
|
|
21400
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
|
|
21401
|
+
] }),
|
|
21402
|
+
/* @__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 }) }),
|
|
21403
|
+
/* @__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) }) }),
|
|
21404
|
+
currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21405
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
21406
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
21407
|
+
] }),
|
|
21408
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21409
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
21410
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
21411
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
21412
|
+
] }),
|
|
21413
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
21414
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
21415
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
21416
|
+
] }),
|
|
21417
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21631
21418
|
]
|
|
21632
21419
|
}
|
|
21633
|
-
)
|
|
21420
|
+
);
|
|
21634
21421
|
}
|
|
21635
21422
|
function findMediaStripSlots(tree) {
|
|
21636
21423
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -21649,23 +21436,31 @@ function AiMediaStripOverlay({
|
|
|
21649
21436
|
}) {
|
|
21650
21437
|
const [hover, setHover] = (0, import_react14.useState)(null);
|
|
21651
21438
|
const [active, setActive] = (0, import_react14.useState)(null);
|
|
21652
|
-
const [itemEditOn, setItemEditOn] = (0, import_react14.useState)(false);
|
|
21653
|
-
const [linkOpen, setLinkOpen] = (0, import_react14.useState)(false);
|
|
21654
21439
|
const [pending, setPending] = (0, import_react14.useState)(false);
|
|
21655
21440
|
const [error, setError] = (0, import_react14.useState)(null);
|
|
21656
21441
|
const activeRef = (0, import_react14.useRef)(null);
|
|
21657
21442
|
activeRef.current = active;
|
|
21658
|
-
const linkOpenRef = (0, import_react14.useRef)(false);
|
|
21659
|
-
linkOpenRef.current = linkOpen;
|
|
21660
21443
|
(0, import_react14.useEffect)(() => {
|
|
21661
21444
|
const onMove = (e) => {
|
|
21662
|
-
const ref = itemRefFromTarget(e.target);
|
|
21663
21445
|
const t = e.target;
|
|
21664
|
-
|
|
21665
|
-
|
|
21666
|
-
|
|
21667
|
-
|
|
21668
|
-
|
|
21446
|
+
if (!(t instanceof HTMLElement)) return;
|
|
21447
|
+
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]")) {
|
|
21448
|
+
return;
|
|
21449
|
+
}
|
|
21450
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
21451
|
+
if (!itemEl) {
|
|
21452
|
+
setHover(null);
|
|
21453
|
+
return;
|
|
21454
|
+
}
|
|
21455
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
21456
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
21457
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
21458
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
21459
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
21460
|
+
setHover(null);
|
|
21461
|
+
return;
|
|
21462
|
+
}
|
|
21463
|
+
setHover({ sectionId, index });
|
|
21669
21464
|
};
|
|
21670
21465
|
const onLeave = () => setHover(null);
|
|
21671
21466
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -21677,25 +21472,23 @@ function AiMediaStripOverlay({
|
|
|
21677
21472
|
}, []);
|
|
21678
21473
|
(0, import_react14.useEffect)(() => {
|
|
21679
21474
|
const onClick = (e) => {
|
|
21475
|
+
const current = activeRef.current;
|
|
21476
|
+
if (!current) return;
|
|
21680
21477
|
const t = e.target;
|
|
21681
|
-
if (!(t instanceof
|
|
21682
|
-
if (t.closest(
|
|
21683
|
-
const
|
|
21684
|
-
if (
|
|
21685
|
-
|
|
21686
|
-
setItemEditOn(false);
|
|
21478
|
+
if (!(t instanceof HTMLElement)) return;
|
|
21479
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
21480
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
21481
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
21482
|
+
setActive(null);
|
|
21687
21483
|
setError(null);
|
|
21688
|
-
setActive(ref);
|
|
21689
21484
|
};
|
|
21690
21485
|
document.addEventListener("click", onClick, true);
|
|
21691
21486
|
return () => document.removeEventListener("click", onClick, true);
|
|
21692
|
-
}, [
|
|
21487
|
+
}, []);
|
|
21693
21488
|
(0, import_react14.useEffect)(() => {
|
|
21694
21489
|
const onBlur = () => {
|
|
21695
21490
|
if (!activeRef.current) return;
|
|
21696
21491
|
setActive(null);
|
|
21697
|
-
setItemEditOn(false);
|
|
21698
|
-
setLinkOpen(false);
|
|
21699
21492
|
setError(null);
|
|
21700
21493
|
};
|
|
21701
21494
|
window.addEventListener("blur", onBlur);
|
|
@@ -21705,10 +21498,7 @@ function AiMediaStripOverlay({
|
|
|
21705
21498
|
const onKeyDown = (e) => {
|
|
21706
21499
|
if (e.key !== "Escape") return;
|
|
21707
21500
|
if (!activeRef.current) return;
|
|
21708
|
-
if (linkOpenRef.current) return;
|
|
21709
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
21710
21501
|
setActive(null);
|
|
21711
|
-
setItemEditOn(false);
|
|
21712
21502
|
setError(null);
|
|
21713
21503
|
};
|
|
21714
21504
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -21742,133 +21532,137 @@ function AiMediaStripOverlay({
|
|
|
21742
21532
|
tree: nextTree,
|
|
21743
21533
|
label: entry.label,
|
|
21744
21534
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
21745
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
21746
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
21747
|
-
// on every edit reads as the section jumping around.
|
|
21748
|
-
skipScrollIntoView: true
|
|
21535
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
21749
21536
|
});
|
|
21750
21537
|
return true;
|
|
21751
21538
|
},
|
|
21752
21539
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
21753
21540
|
);
|
|
21754
21541
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
21542
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
21755
21543
|
const activeItemRect = useLiveItemRect(active);
|
|
21756
|
-
const
|
|
21757
|
-
const
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
|
|
21779
|
-
|
|
21780
|
-
|
|
21781
|
-
|
|
21782
|
-
|
|
21783
|
-
|
|
21784
|
-
|
|
21785
|
-
|
|
21786
|
-
|
|
21787
|
-
|
|
21788
|
-
|
|
21789
|
-
|
|
21544
|
+
const TOOLBAR_APPROX_H = 170;
|
|
21545
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
21547
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21548
|
+
"button",
|
|
21549
|
+
{
|
|
21550
|
+
type: "button",
|
|
21551
|
+
"data-ohw-toolbar": "",
|
|
21552
|
+
onClick: () => {
|
|
21553
|
+
clearInteractionChromeRef.current();
|
|
21554
|
+
setActive(hover);
|
|
21555
|
+
},
|
|
21556
|
+
"aria-label": "Configure media item",
|
|
21557
|
+
style: {
|
|
21558
|
+
position: "fixed",
|
|
21559
|
+
top: hoverHandleRect.top + 8,
|
|
21560
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
21561
|
+
width: 28,
|
|
21562
|
+
height: 28,
|
|
21563
|
+
borderRadius: 8,
|
|
21564
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
21565
|
+
background: "#ffffff",
|
|
21566
|
+
color: PRIMARY3,
|
|
21567
|
+
display: "flex",
|
|
21568
|
+
alignItems: "center",
|
|
21569
|
+
justifyContent: "center",
|
|
21570
|
+
cursor: "pointer",
|
|
21571
|
+
zIndex: 2147483643,
|
|
21572
|
+
fontSize: 14,
|
|
21573
|
+
fontWeight: 700
|
|
21574
|
+
},
|
|
21575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21576
|
+
}
|
|
21577
|
+
),
|
|
21578
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21579
|
+
ItemInteractionLayer,
|
|
21580
|
+
{
|
|
21581
|
+
rect: activeItemRect,
|
|
21582
|
+
state: toolbarState,
|
|
21583
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
21584
|
+
MediaStripToolbar,
|
|
21585
|
+
{
|
|
21586
|
+
entry: activeEntry,
|
|
21587
|
+
index: active.index,
|
|
21588
|
+
pending,
|
|
21589
|
+
error,
|
|
21590
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
21591
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
21592
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
21593
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
21594
|
+
onResize: (delta) => {
|
|
21595
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
21596
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
21597
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
21598
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
21599
|
+
},
|
|
21600
|
+
onSetAlt: (alt) => {
|
|
21601
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
21602
|
+
},
|
|
21603
|
+
onSetLink: (href, linkTarget) => {
|
|
21790
21604
|
void runMutation(
|
|
21791
21605
|
active.sectionId,
|
|
21792
|
-
(tree) =>
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21606
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
21607
|
+
);
|
|
21608
|
+
},
|
|
21609
|
+
onAddItem: () => {
|
|
21610
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
21611
|
+
if (!picked) return;
|
|
21612
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
21613
|
+
void runMutation(
|
|
21614
|
+
active.sectionId,
|
|
21615
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
21616
|
+
{ [picked.assetId]: picked.url }
|
|
21617
|
+
).then((applied) => {
|
|
21618
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21619
|
+
});
|
|
21796
21620
|
});
|
|
21797
|
-
}
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
|
|
21805
|
-
|
|
21621
|
+
},
|
|
21622
|
+
onChangeImage: () => {
|
|
21623
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
21624
|
+
if (!picked) return;
|
|
21625
|
+
void runMutation(
|
|
21626
|
+
active.sectionId,
|
|
21627
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
21628
|
+
{ [picked.assetId]: picked.url }
|
|
21629
|
+
);
|
|
21630
|
+
});
|
|
21631
|
+
},
|
|
21632
|
+
onRemoveItem: () => {
|
|
21633
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
21634
|
+
(applied) => {
|
|
21635
|
+
if (applied) setActive(null);
|
|
21636
|
+
}
|
|
21806
21637
|
);
|
|
21807
|
-
}
|
|
21808
|
-
|
|
21809
|
-
|
|
21810
|
-
|
|
21811
|
-
|
|
21812
|
-
|
|
21813
|
-
|
|
21814
|
-
|
|
21815
|
-
|
|
21816
|
-
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
}
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21827
|
-
}
|
|
21828
|
-
);
|
|
21829
|
-
}
|
|
21830
|
-
}
|
|
21831
|
-
) }),
|
|
21832
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21833
|
-
"div",
|
|
21834
|
-
{
|
|
21835
|
-
"data-ohw-bridge": "",
|
|
21836
|
-
"data-ohw-item-interaction": "",
|
|
21837
|
-
"aria-hidden": true,
|
|
21838
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
21839
|
-
style: {
|
|
21840
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
21841
|
-
left: activeItemRect.left - 5,
|
|
21842
|
-
background: PRIMARY3,
|
|
21843
|
-
zIndex: 2147483644
|
|
21844
|
-
},
|
|
21845
|
-
children: "Media item"
|
|
21846
|
-
}
|
|
21847
|
-
),
|
|
21848
|
-
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21849
|
-
LinkModal,
|
|
21850
|
-
{
|
|
21851
|
-
href: activeHref,
|
|
21852
|
-
linkTarget: activeTarget,
|
|
21853
|
-
onClose: () => setLinkOpen(false),
|
|
21854
|
-
onSave: (href, linkTarget) => {
|
|
21855
|
-
void runMutation(
|
|
21856
|
-
active.sectionId,
|
|
21857
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
21858
|
-
);
|
|
21859
|
-
}
|
|
21860
|
-
}
|
|
21861
|
-
)
|
|
21862
|
-
] })
|
|
21638
|
+
},
|
|
21639
|
+
onMoveLeft: () => {
|
|
21640
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
21641
|
+
(applied) => {
|
|
21642
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
21643
|
+
}
|
|
21644
|
+
);
|
|
21645
|
+
},
|
|
21646
|
+
onMoveRight: () => {
|
|
21647
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
21648
|
+
(applied) => {
|
|
21649
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
21650
|
+
}
|
|
21651
|
+
);
|
|
21652
|
+
}
|
|
21653
|
+
}
|
|
21654
|
+
)
|
|
21655
|
+
}
|
|
21656
|
+
)
|
|
21863
21657
|
] });
|
|
21864
21658
|
}
|
|
21865
21659
|
|
|
21866
21660
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
21867
21661
|
var import_react15 = require("react");
|
|
21868
|
-
var
|
|
21869
|
-
var
|
|
21662
|
+
var import_lucide_react9 = require("lucide-react");
|
|
21663
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
21870
21664
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
21871
|
-
var
|
|
21665
|
+
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]";
|
|
21872
21666
|
function findPricingCardElement(sectionId, index) {
|
|
21873
21667
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21874
21668
|
if (!sectionEl2) return null;
|
|
@@ -21880,7 +21674,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
21880
21674
|
}
|
|
21881
21675
|
function cardRefFromTarget(target) {
|
|
21882
21676
|
if (!(target instanceof Element)) return null;
|
|
21883
|
-
if (target.closest(
|
|
21677
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
21884
21678
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
21885
21679
|
if (!cardEl) return null;
|
|
21886
21680
|
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
@@ -21890,21 +21684,21 @@ function cardRefFromTarget(target) {
|
|
|
21890
21684
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
21891
21685
|
return { sectionId, index };
|
|
21892
21686
|
}
|
|
21893
|
-
function
|
|
21687
|
+
function sameRef(a, b) {
|
|
21894
21688
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
21895
21689
|
}
|
|
21896
|
-
function
|
|
21690
|
+
function rectOf(el) {
|
|
21897
21691
|
if (!el) return null;
|
|
21898
21692
|
const r2 = el.getBoundingClientRect();
|
|
21899
21693
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
21900
21694
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
21901
21695
|
}
|
|
21902
21696
|
function readRect3(ref) {
|
|
21903
|
-
return
|
|
21697
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
21904
21698
|
}
|
|
21905
21699
|
function readGridRect(ref) {
|
|
21906
21700
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
21907
|
-
return
|
|
21701
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
21908
21702
|
}
|
|
21909
21703
|
function useLiveCardRect(ref, grid = false) {
|
|
21910
21704
|
const [rect, setRect] = (0, import_react15.useState)(null);
|
|
@@ -21934,7 +21728,7 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
21934
21728
|
}
|
|
21935
21729
|
var TOOLBAR_GRID_GAP = 52;
|
|
21936
21730
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
21937
|
-
var
|
|
21731
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
21938
21732
|
function GridToolbarSlot({ gridRect, children }) {
|
|
21939
21733
|
const slotRef = (0, import_react15.useRef)(null);
|
|
21940
21734
|
const [shift, setShift] = (0, import_react15.useState)(0);
|
|
@@ -21946,7 +21740,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
21946
21740
|
const w = slot.offsetWidth;
|
|
21947
21741
|
if (w <= 0) return;
|
|
21948
21742
|
const half = w / 2;
|
|
21949
|
-
const clamped = Math.max(
|
|
21743
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
21950
21744
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
21951
21745
|
};
|
|
21952
21746
|
clamp();
|
|
@@ -21955,7 +21749,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
21955
21749
|
return () => ro.disconnect();
|
|
21956
21750
|
}, [centerX, children]);
|
|
21957
21751
|
const mobile = window.innerWidth <= 480;
|
|
21958
|
-
return /* @__PURE__ */ (0,
|
|
21752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21959
21753
|
"div",
|
|
21960
21754
|
{
|
|
21961
21755
|
ref: slotRef,
|
|
@@ -21990,7 +21784,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
21990
21784
|
});
|
|
21991
21785
|
}
|
|
21992
21786
|
function StyleSwatch({ style }) {
|
|
21993
|
-
return /* @__PURE__ */ (0,
|
|
21787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21994
21788
|
"span",
|
|
21995
21789
|
{
|
|
21996
21790
|
"aria-hidden": true,
|
|
@@ -22004,35 +21798,35 @@ function StyleSwatch({ style }) {
|
|
|
22004
21798
|
);
|
|
22005
21799
|
}
|
|
22006
21800
|
function ButtonGlyph() {
|
|
22007
|
-
return /* @__PURE__ */ (0,
|
|
22008
|
-
/* @__PURE__ */ (0,
|
|
22009
|
-
/* @__PURE__ */ (0,
|
|
21801
|
+
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: [
|
|
21802
|
+
/* @__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" }),
|
|
21803
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
22010
21804
|
] });
|
|
22011
21805
|
}
|
|
22012
21806
|
function FeatureGlyph({ mode }) {
|
|
22013
|
-
return /* @__PURE__ */ (0,
|
|
22014
|
-
/* @__PURE__ */ (0,
|
|
22015
|
-
/* @__PURE__ */ (0,
|
|
22016
|
-
/* @__PURE__ */ (0,
|
|
22017
|
-
/* @__PURE__ */ (0,
|
|
22018
|
-
/* @__PURE__ */ (0,
|
|
22019
|
-
mode === "add" && /* @__PURE__ */ (0,
|
|
21807
|
+
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: [
|
|
21808
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
21809
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
21810
|
+
/* @__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" }),
|
|
21811
|
+
/* @__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" }),
|
|
21812
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
21813
|
+
mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
22020
21814
|
] });
|
|
22021
21815
|
}
|
|
22022
|
-
function
|
|
21816
|
+
function ToolbarAction({
|
|
22023
21817
|
label,
|
|
22024
21818
|
onClick,
|
|
22025
21819
|
disabled = false,
|
|
22026
21820
|
children
|
|
22027
21821
|
}) {
|
|
22028
|
-
const button = /* @__PURE__ */ (0,
|
|
22029
|
-
return /* @__PURE__ */ (0,
|
|
22030
|
-
/* @__PURE__ */ (0,
|
|
22031
|
-
/* @__PURE__ */ (0,
|
|
21822
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
21823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
21824
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
21825
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
22032
21826
|
] });
|
|
22033
21827
|
}
|
|
22034
|
-
function
|
|
22035
|
-
return /* @__PURE__ */ (0,
|
|
21828
|
+
function ToolbarSeparator() {
|
|
21829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
22036
21830
|
}
|
|
22037
21831
|
function CardStyleMenu({
|
|
22038
21832
|
value,
|
|
@@ -22040,7 +21834,7 @@ function CardStyleMenu({
|
|
|
22040
21834
|
disabled = false
|
|
22041
21835
|
}) {
|
|
22042
21836
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
22043
|
-
const trigger = /* @__PURE__ */ (0,
|
|
21837
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
22044
21838
|
"button",
|
|
22045
21839
|
{
|
|
22046
21840
|
type: "button",
|
|
@@ -22051,28 +21845,28 @@ function CardStyleMenu({
|
|
|
22051
21845
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
22052
21846
|
),
|
|
22053
21847
|
children: [
|
|
22054
|
-
/* @__PURE__ */ (0,
|
|
22055
|
-
/* @__PURE__ */ (0,
|
|
22056
|
-
/* @__PURE__ */ (0,
|
|
21848
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
|
|
21849
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
|
|
21850
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
|
|
22057
21851
|
]
|
|
22058
21852
|
}
|
|
22059
21853
|
);
|
|
22060
21854
|
if (disabled) {
|
|
22061
|
-
return /* @__PURE__ */ (0,
|
|
22062
|
-
/* @__PURE__ */ (0,
|
|
22063
|
-
/* @__PURE__ */ (0,
|
|
22064
|
-
/* @__PURE__ */ (0,
|
|
22065
|
-
/* @__PURE__ */ (0,
|
|
21855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
21856
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
21857
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
21858
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
|
|
21859
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
22066
21860
|
] })
|
|
22067
21861
|
] });
|
|
22068
21862
|
}
|
|
22069
|
-
return /* @__PURE__ */ (0,
|
|
22070
|
-
/* @__PURE__ */ (0,
|
|
22071
|
-
/* @__PURE__ */ (0,
|
|
22072
|
-
/* @__PURE__ */ (0,
|
|
22073
|
-
/* @__PURE__ */ (0,
|
|
21863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
21864
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
21865
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
|
|
21866
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
21867
|
+
/* @__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) => {
|
|
22074
21868
|
const selected = style.value === value;
|
|
22075
|
-
return /* @__PURE__ */ (0,
|
|
21869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
22076
21870
|
DropdownMenuItem,
|
|
22077
21871
|
{
|
|
22078
21872
|
role: "menuitemradio",
|
|
@@ -22080,9 +21874,9 @@ function CardStyleMenu({
|
|
|
22080
21874
|
onSelect: () => onChange(style.value),
|
|
22081
21875
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
22082
21876
|
children: [
|
|
22083
|
-
/* @__PURE__ */ (0,
|
|
22084
|
-
/* @__PURE__ */ (0,
|
|
22085
|
-
selected && /* @__PURE__ */ (0,
|
|
21877
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
|
|
21878
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
|
|
21879
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
|
|
22086
21880
|
]
|
|
22087
21881
|
},
|
|
22088
21882
|
style.value
|
|
@@ -22112,7 +21906,7 @@ function PricingCardToolbar({
|
|
|
22112
21906
|
const style = pricingCardStyle(entry.tree, index);
|
|
22113
21907
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
22114
21908
|
const mobile = window.innerWidth <= 480;
|
|
22115
|
-
return /* @__PURE__ */ (0,
|
|
21909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
22116
21910
|
"div",
|
|
22117
21911
|
{
|
|
22118
21912
|
"data-ohw-bridge": "",
|
|
@@ -22124,7 +21918,7 @@ function PricingCardToolbar({
|
|
|
22124
21918
|
),
|
|
22125
21919
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
22126
21920
|
children: [
|
|
22127
|
-
/* @__PURE__ */ (0,
|
|
21921
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
22128
21922
|
"div",
|
|
22129
21923
|
{
|
|
22130
21924
|
className: cn(
|
|
@@ -22133,8 +21927,8 @@ function PricingCardToolbar({
|
|
|
22133
21927
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
22134
21928
|
),
|
|
22135
21929
|
children: [
|
|
22136
|
-
/* @__PURE__ */ (0,
|
|
22137
|
-
/* @__PURE__ */ (0,
|
|
21930
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
21931
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
22138
21932
|
CustomToolbarButton,
|
|
22139
21933
|
{
|
|
22140
21934
|
type: "button",
|
|
@@ -22142,8 +21936,8 @@ function PricingCardToolbar({
|
|
|
22142
21936
|
"aria-pressed": featuredTag,
|
|
22143
21937
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
22144
21938
|
className: "group size-8",
|
|
22145
|
-
children: /* @__PURE__ */ (0,
|
|
22146
|
-
|
|
21939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
21940
|
+
import_lucide_react9.Star,
|
|
22147
21941
|
{
|
|
22148
21942
|
size: 16,
|
|
22149
21943
|
fill: "currentColor",
|
|
@@ -22157,25 +21951,25 @@ function PricingCardToolbar({
|
|
|
22157
21951
|
)
|
|
22158
21952
|
}
|
|
22159
21953
|
) }),
|
|
22160
|
-
/* @__PURE__ */ (0,
|
|
21954
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
22161
21955
|
] }),
|
|
22162
|
-
/* @__PURE__ */ (0,
|
|
22163
|
-
/* @__PURE__ */ (0,
|
|
22164
|
-
/* @__PURE__ */ (0,
|
|
22165
|
-
/* @__PURE__ */ (0,
|
|
22166
|
-
/* @__PURE__ */ (0,
|
|
22167
|
-
/* @__PURE__ */ (0,
|
|
22168
|
-
/* @__PURE__ */ (0,
|
|
21956
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21957
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
21958
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21959
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
|
|
21960
|
+
/* @__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: [
|
|
21961
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
|
|
21962
|
+
/* @__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" })
|
|
22169
21963
|
] }) }),
|
|
22170
|
-
/* @__PURE__ */ (0,
|
|
22171
|
-
/* @__PURE__ */ (0,
|
|
22172
|
-
/* @__PURE__ */ (0,
|
|
22173
|
-
/* @__PURE__ */ (0,
|
|
22174
|
-
/* @__PURE__ */ (0,
|
|
21964
|
+
/* @__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" }) }),
|
|
21965
|
+
/* @__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" }) }),
|
|
21966
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
21967
|
+
/* @__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" } }) }),
|
|
21968
|
+
/* @__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" } }) })
|
|
22175
21969
|
]
|
|
22176
21970
|
}
|
|
22177
21971
|
),
|
|
22178
|
-
error && /* @__PURE__ */ (0,
|
|
21972
|
+
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 })
|
|
22179
21973
|
]
|
|
22180
21974
|
}
|
|
22181
21975
|
) });
|
|
@@ -22209,7 +22003,7 @@ function AiPricingCardOverlay({
|
|
|
22209
22003
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
22210
22004
|
setHover((prev) => {
|
|
22211
22005
|
const next = ref && !overEditable ? ref : null;
|
|
22212
|
-
return
|
|
22006
|
+
return sameRef(prev, next) ? prev : next;
|
|
22213
22007
|
});
|
|
22214
22008
|
};
|
|
22215
22009
|
const onLeave = () => setHover(null);
|
|
@@ -22224,10 +22018,10 @@ function AiPricingCardOverlay({
|
|
|
22224
22018
|
const onClick = (e) => {
|
|
22225
22019
|
const t = e.target;
|
|
22226
22020
|
if (!(t instanceof Element)) return;
|
|
22227
|
-
if (t.closest(
|
|
22021
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
22228
22022
|
const ref = cardRefFromTarget(t);
|
|
22229
|
-
setActive((prev) =>
|
|
22230
|
-
if (!ref || !
|
|
22023
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
22024
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
22231
22025
|
};
|
|
22232
22026
|
document.addEventListener("click", onClick, true);
|
|
22233
22027
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -22292,12 +22086,12 @@ function AiPricingCardOverlay({
|
|
|
22292
22086
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
22293
22087
|
const activeCardRect = useLiveCardRect(active);
|
|
22294
22088
|
const activeGridRect = useLiveCardRect(active, true);
|
|
22295
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
22296
|
-
return /* @__PURE__ */ (0,
|
|
22297
|
-
hoverRect && /* @__PURE__ */ (0,
|
|
22298
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
22299
|
-
/* @__PURE__ */ (0,
|
|
22300
|
-
/* @__PURE__ */ (0,
|
|
22089
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
22090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
22091
|
+
hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
22092
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
22093
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
22094
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
22301
22095
|
PricingCardToolbar,
|
|
22302
22096
|
{
|
|
22303
22097
|
entry: activeEntry,
|
|
@@ -22325,7 +22119,7 @@ function AiPricingCardOverlay({
|
|
|
22325
22119
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
22326
22120
|
}
|
|
22327
22121
|
) }),
|
|
22328
|
-
/* @__PURE__ */ (0,
|
|
22122
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
22329
22123
|
"div",
|
|
22330
22124
|
{
|
|
22331
22125
|
"data-ohw-bridge": "",
|
|
@@ -22347,7 +22141,7 @@ function AiPricingCardOverlay({
|
|
|
22347
22141
|
|
|
22348
22142
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
22349
22143
|
var import_react16 = require("react");
|
|
22350
|
-
var
|
|
22144
|
+
var import_lucide_react10 = require("lucide-react");
|
|
22351
22145
|
|
|
22352
22146
|
// src/lib/ai-video-tree.ts
|
|
22353
22147
|
function resolveVideoBlock(tree, path) {
|
|
@@ -22390,10 +22184,10 @@ function clearVideo(tree, path) {
|
|
|
22390
22184
|
}
|
|
22391
22185
|
|
|
22392
22186
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
22393
|
-
var
|
|
22187
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
22394
22188
|
var PRIMARY5 = "#0885FE";
|
|
22395
|
-
var
|
|
22396
|
-
var
|
|
22189
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
22190
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
22397
22191
|
function findVideoBlockElement(sectionId, path) {
|
|
22398
22192
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
22399
22193
|
if (!sectionEl2) return null;
|
|
@@ -22453,12 +22247,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
22453
22247
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
22454
22248
|
});
|
|
22455
22249
|
}
|
|
22456
|
-
function
|
|
22250
|
+
function Pill2({
|
|
22457
22251
|
label,
|
|
22458
22252
|
onClick,
|
|
22459
22253
|
disabled
|
|
22460
22254
|
}) {
|
|
22461
|
-
return /* @__PURE__ */ (0,
|
|
22255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22462
22256
|
"button",
|
|
22463
22257
|
{
|
|
22464
22258
|
type: "button",
|
|
@@ -22474,7 +22268,7 @@ function Pill({
|
|
|
22474
22268
|
border: "none",
|
|
22475
22269
|
cursor: disabled ? "default" : "pointer",
|
|
22476
22270
|
background: "#ffffff",
|
|
22477
|
-
color:
|
|
22271
|
+
color: OHW_BLUE_DARK2,
|
|
22478
22272
|
opacity: disabled ? 0.4 : 1,
|
|
22479
22273
|
fontSize: 12,
|
|
22480
22274
|
lineHeight: "16px",
|
|
@@ -22517,8 +22311,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22517
22311
|
onCommit(id);
|
|
22518
22312
|
}
|
|
22519
22313
|
};
|
|
22520
|
-
return /* @__PURE__ */ (0,
|
|
22521
|
-
/* @__PURE__ */ (0,
|
|
22314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
22315
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
22522
22316
|
"div",
|
|
22523
22317
|
{
|
|
22524
22318
|
style: {
|
|
@@ -22534,12 +22328,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22534
22328
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
22535
22329
|
},
|
|
22536
22330
|
children: [
|
|
22537
|
-
/* @__PURE__ */ (0,
|
|
22331
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22538
22332
|
"span",
|
|
22539
22333
|
{
|
|
22540
22334
|
style: {
|
|
22541
22335
|
flex: "0 0 auto",
|
|
22542
|
-
color:
|
|
22336
|
+
color: OHW_BLUE_DARK2,
|
|
22543
22337
|
fontSize: 10,
|
|
22544
22338
|
lineHeight: "16px",
|
|
22545
22339
|
fontWeight: 700,
|
|
@@ -22549,7 +22343,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22549
22343
|
children: "Video"
|
|
22550
22344
|
}
|
|
22551
22345
|
),
|
|
22552
|
-
/* @__PURE__ */ (0,
|
|
22346
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22553
22347
|
"input",
|
|
22554
22348
|
{
|
|
22555
22349
|
type: "text",
|
|
@@ -22586,7 +22380,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
22586
22380
|
]
|
|
22587
22381
|
}
|
|
22588
22382
|
),
|
|
22589
|
-
invalid && /* @__PURE__ */ (0,
|
|
22383
|
+
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." })
|
|
22590
22384
|
] });
|
|
22591
22385
|
}
|
|
22592
22386
|
function VideoToolbar({
|
|
@@ -22596,7 +22390,7 @@ function VideoToolbar({
|
|
|
22596
22390
|
onSetVideoId,
|
|
22597
22391
|
onRemove
|
|
22598
22392
|
}) {
|
|
22599
|
-
return /* @__PURE__ */ (0,
|
|
22393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
22600
22394
|
"div",
|
|
22601
22395
|
{
|
|
22602
22396
|
"data-ohw-bridge": "",
|
|
@@ -22608,7 +22402,7 @@ function VideoToolbar({
|
|
|
22608
22402
|
gap: 6,
|
|
22609
22403
|
alignItems: "center",
|
|
22610
22404
|
width: 280,
|
|
22611
|
-
background:
|
|
22405
|
+
background: OHW_BLUE2,
|
|
22612
22406
|
padding: 8,
|
|
22613
22407
|
borderRadius: 12,
|
|
22614
22408
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -22616,9 +22410,9 @@ function VideoToolbar({
|
|
|
22616
22410
|
opacity: pending ? 0.6 : 1
|
|
22617
22411
|
},
|
|
22618
22412
|
children: [
|
|
22619
|
-
/* @__PURE__ */ (0,
|
|
22620
|
-
/* @__PURE__ */ (0,
|
|
22621
|
-
error && /* @__PURE__ */ (0,
|
|
22413
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
22414
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
22415
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
22622
22416
|
]
|
|
22623
22417
|
}
|
|
22624
22418
|
);
|
|
@@ -22738,8 +22532,8 @@ function AiVideoOverlay({
|
|
|
22738
22532
|
const activeBlockRect = useLiveBlockRect(active);
|
|
22739
22533
|
const TOOLBAR_APPROX_H = 90;
|
|
22740
22534
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
22741
|
-
return /* @__PURE__ */ (0,
|
|
22742
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
22535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
22536
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22743
22537
|
"button",
|
|
22744
22538
|
{
|
|
22745
22539
|
type: "button",
|
|
@@ -22767,15 +22561,15 @@ function AiVideoOverlay({
|
|
|
22767
22561
|
fontSize: 14,
|
|
22768
22562
|
fontWeight: 700
|
|
22769
22563
|
},
|
|
22770
|
-
children: /* @__PURE__ */ (0,
|
|
22564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
22771
22565
|
}
|
|
22772
22566
|
),
|
|
22773
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
22567
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22774
22568
|
ItemInteractionLayer,
|
|
22775
22569
|
{
|
|
22776
22570
|
rect: activeBlockRect,
|
|
22777
22571
|
state: toolbarState,
|
|
22778
|
-
toolbar: /* @__PURE__ */ (0,
|
|
22572
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
22779
22573
|
VideoToolbar,
|
|
22780
22574
|
{
|
|
22781
22575
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -22799,7 +22593,7 @@ function AiVideoOverlay({
|
|
|
22799
22593
|
|
|
22800
22594
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
22801
22595
|
var import_react17 = require("react");
|
|
22802
|
-
var
|
|
22596
|
+
var import_lucide_react11 = require("lucide-react");
|
|
22803
22597
|
|
|
22804
22598
|
// src/lib/ai-carousel-tree.ts
|
|
22805
22599
|
function isCarouselBlock(node) {
|
|
@@ -22850,10 +22644,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
22850
22644
|
}
|
|
22851
22645
|
|
|
22852
22646
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
22853
|
-
var
|
|
22647
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
22854
22648
|
var PRIMARY6 = "#0885FE";
|
|
22855
|
-
var
|
|
22856
|
-
var
|
|
22649
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
22650
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
22857
22651
|
function findCarouselItemElement(sectionId, index) {
|
|
22858
22652
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
22859
22653
|
if (!sectionEl2) return null;
|
|
@@ -22932,8 +22726,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
22932
22726
|
postToParent2({ type: "ow:asset-pick", id });
|
|
22933
22727
|
});
|
|
22934
22728
|
}
|
|
22935
|
-
function
|
|
22936
|
-
return /* @__PURE__ */ (0,
|
|
22729
|
+
function Pill3({ label, onClick, disabled }) {
|
|
22730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
22937
22731
|
"button",
|
|
22938
22732
|
{
|
|
22939
22733
|
type: "button",
|
|
@@ -22949,7 +22743,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
22949
22743
|
border: "none",
|
|
22950
22744
|
cursor: disabled ? "default" : "pointer",
|
|
22951
22745
|
background: "#ffffff",
|
|
22952
|
-
color:
|
|
22746
|
+
color: OHW_BLUE_DARK3,
|
|
22953
22747
|
opacity: disabled ? 0.4 : 1,
|
|
22954
22748
|
fontSize: 12,
|
|
22955
22749
|
lineHeight: "16px",
|
|
@@ -22967,7 +22761,7 @@ function TogglePill({
|
|
|
22967
22761
|
onToggle,
|
|
22968
22762
|
disabled
|
|
22969
22763
|
}) {
|
|
22970
|
-
return /* @__PURE__ */ (0,
|
|
22764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
22971
22765
|
"button",
|
|
22972
22766
|
{
|
|
22973
22767
|
type: "button",
|
|
@@ -22986,7 +22780,7 @@ function TogglePill({
|
|
|
22986
22780
|
border: "none",
|
|
22987
22781
|
cursor: disabled ? "default" : "pointer",
|
|
22988
22782
|
background: "#ffffff",
|
|
22989
|
-
color:
|
|
22783
|
+
color: OHW_BLUE_DARK3,
|
|
22990
22784
|
opacity: disabled ? 0.4 : 1,
|
|
22991
22785
|
fontSize: 12,
|
|
22992
22786
|
lineHeight: "16px",
|
|
@@ -22996,7 +22790,7 @@ function TogglePill({
|
|
|
22996
22790
|
},
|
|
22997
22791
|
children: [
|
|
22998
22792
|
label,
|
|
22999
|
-
/* @__PURE__ */ (0,
|
|
22793
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23000
22794
|
"span",
|
|
23001
22795
|
{
|
|
23002
22796
|
"aria-hidden": true,
|
|
@@ -23009,10 +22803,10 @@ function TogglePill({
|
|
|
23009
22803
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
23010
22804
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
23011
22805
|
// "disabled control" rather than "switch that is off".
|
|
23012
|
-
background: on ?
|
|
22806
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
23013
22807
|
transition: "background 120ms ease"
|
|
23014
22808
|
},
|
|
23015
|
-
children: /* @__PURE__ */ (0,
|
|
22809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23016
22810
|
"span",
|
|
23017
22811
|
{
|
|
23018
22812
|
style: {
|
|
@@ -23041,7 +22835,7 @@ function CarouselSlideToolbar({
|
|
|
23041
22835
|
onChangeImage,
|
|
23042
22836
|
onToggleAutoplay
|
|
23043
22837
|
}) {
|
|
23044
|
-
return /* @__PURE__ */ (0,
|
|
22838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
23045
22839
|
"div",
|
|
23046
22840
|
{
|
|
23047
22841
|
"data-ohw-bridge": "",
|
|
@@ -23052,7 +22846,7 @@ function CarouselSlideToolbar({
|
|
|
23052
22846
|
flexDirection: "column",
|
|
23053
22847
|
gap: 6,
|
|
23054
22848
|
alignItems: "center",
|
|
23055
|
-
background:
|
|
22849
|
+
background: OHW_BLUE3,
|
|
23056
22850
|
padding: 8,
|
|
23057
22851
|
borderRadius: 12,
|
|
23058
22852
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -23064,11 +22858,11 @@ function CarouselSlideToolbar({
|
|
|
23064
22858
|
pointerEvents: pending ? "none" : "auto"
|
|
23065
22859
|
},
|
|
23066
22860
|
children: [
|
|
23067
|
-
/* @__PURE__ */ (0,
|
|
23068
|
-
/* @__PURE__ */ (0,
|
|
23069
|
-
/* @__PURE__ */ (0,
|
|
22861
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
22862
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
22863
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
23070
22864
|
] }),
|
|
23071
|
-
error && /* @__PURE__ */ (0,
|
|
22865
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
23072
22866
|
]
|
|
23073
22867
|
}
|
|
23074
22868
|
);
|
|
@@ -23208,8 +23002,8 @@ function AiFadeCarouselOverlay({
|
|
|
23208
23002
|
const activeItemRect = useLiveItemRect2(active);
|
|
23209
23003
|
const TOOLBAR_APPROX_H = 90;
|
|
23210
23004
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
23211
|
-
return /* @__PURE__ */ (0,
|
|
23212
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
23005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
23006
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23213
23007
|
"button",
|
|
23214
23008
|
{
|
|
23215
23009
|
type: "button",
|
|
@@ -23238,10 +23032,10 @@ function AiFadeCarouselOverlay({
|
|
|
23238
23032
|
fontSize: 14,
|
|
23239
23033
|
fontWeight: 700
|
|
23240
23034
|
},
|
|
23241
|
-
children: /* @__PURE__ */ (0,
|
|
23035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
23242
23036
|
}
|
|
23243
23037
|
),
|
|
23244
|
-
swapping && /* @__PURE__ */ (0,
|
|
23038
|
+
swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23245
23039
|
"div",
|
|
23246
23040
|
{
|
|
23247
23041
|
ref: skeletonRef,
|
|
@@ -23259,15 +23053,15 @@ function AiFadeCarouselOverlay({
|
|
|
23259
23053
|
zIndex: 2147483646,
|
|
23260
23054
|
pointerEvents: "none"
|
|
23261
23055
|
},
|
|
23262
|
-
children: /* @__PURE__ */ (0,
|
|
23056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
|
|
23263
23057
|
}
|
|
23264
23058
|
),
|
|
23265
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
23059
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23266
23060
|
ItemInteractionLayer,
|
|
23267
23061
|
{
|
|
23268
23062
|
rect: activeItemRect,
|
|
23269
23063
|
state: toolbarState,
|
|
23270
|
-
toolbar: /* @__PURE__ */ (0,
|
|
23064
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
23271
23065
|
CarouselSlideToolbar,
|
|
23272
23066
|
{
|
|
23273
23067
|
pending,
|
|
@@ -23505,6 +23299,113 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
23505
23299
|
// src/ui/link-modal/LinkPopover.tsx
|
|
23506
23300
|
var import_react21 = require("react");
|
|
23507
23301
|
|
|
23302
|
+
// src/ui/dialog.tsx
|
|
23303
|
+
var React9 = __toESM(require("react"), 1);
|
|
23304
|
+
var import_radix_ui6 = require("radix-ui");
|
|
23305
|
+
var import_lucide_react12 = require("lucide-react");
|
|
23306
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
23307
|
+
function Dialog2({
|
|
23308
|
+
...props
|
|
23309
|
+
}) {
|
|
23310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
23311
|
+
}
|
|
23312
|
+
function DialogPortal({
|
|
23313
|
+
...props
|
|
23314
|
+
}) {
|
|
23315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
23316
|
+
}
|
|
23317
|
+
function DialogOverlay({
|
|
23318
|
+
className,
|
|
23319
|
+
...props
|
|
23320
|
+
}) {
|
|
23321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23322
|
+
import_radix_ui6.Dialog.Overlay,
|
|
23323
|
+
{
|
|
23324
|
+
"data-slot": "dialog-overlay",
|
|
23325
|
+
"data-ohw-link-modal-root": "",
|
|
23326
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
23327
|
+
...props
|
|
23328
|
+
}
|
|
23329
|
+
);
|
|
23330
|
+
}
|
|
23331
|
+
var DialogContent = React9.forwardRef(
|
|
23332
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
23333
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
23334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
23335
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
23336
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
23337
|
+
import_radix_ui6.Dialog.Content,
|
|
23338
|
+
{
|
|
23339
|
+
ref,
|
|
23340
|
+
"data-slot": "dialog-content",
|
|
23341
|
+
className: cn(
|
|
23342
|
+
positionMode,
|
|
23343
|
+
"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",
|
|
23344
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
23345
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
23346
|
+
className
|
|
23347
|
+
),
|
|
23348
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
23349
|
+
...props,
|
|
23350
|
+
children: [
|
|
23351
|
+
children,
|
|
23352
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23353
|
+
import_radix_ui6.Dialog.Close,
|
|
23354
|
+
{
|
|
23355
|
+
type: "button",
|
|
23356
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
23357
|
+
"aria-label": "Close",
|
|
23358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
|
|
23359
|
+
}
|
|
23360
|
+
) : null
|
|
23361
|
+
]
|
|
23362
|
+
}
|
|
23363
|
+
)
|
|
23364
|
+
] });
|
|
23365
|
+
}
|
|
23366
|
+
);
|
|
23367
|
+
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
23368
|
+
function DialogHeader({
|
|
23369
|
+
className,
|
|
23370
|
+
...props
|
|
23371
|
+
}) {
|
|
23372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
23373
|
+
}
|
|
23374
|
+
function DialogFooter({
|
|
23375
|
+
className,
|
|
23376
|
+
...props
|
|
23377
|
+
}) {
|
|
23378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23379
|
+
"div",
|
|
23380
|
+
{
|
|
23381
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
23382
|
+
...props
|
|
23383
|
+
}
|
|
23384
|
+
);
|
|
23385
|
+
}
|
|
23386
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23387
|
+
import_radix_ui6.Dialog.Title,
|
|
23388
|
+
{
|
|
23389
|
+
ref,
|
|
23390
|
+
className: cn(
|
|
23391
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
23392
|
+
className
|
|
23393
|
+
),
|
|
23394
|
+
...props
|
|
23395
|
+
}
|
|
23396
|
+
));
|
|
23397
|
+
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
23398
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23399
|
+
import_radix_ui6.Dialog.Description,
|
|
23400
|
+
{
|
|
23401
|
+
ref,
|
|
23402
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
23403
|
+
...props
|
|
23404
|
+
}
|
|
23405
|
+
));
|
|
23406
|
+
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
23407
|
+
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
23408
|
+
|
|
23508
23409
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
23509
23410
|
var import_lucide_react16 = require("lucide-react");
|
|
23510
23411
|
|
|
@@ -24608,7 +24509,6 @@ function shouldUseDevFixtures() {
|
|
|
24608
24509
|
function getLogoElement(el) {
|
|
24609
24510
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
24610
24511
|
if (marked) return marked;
|
|
24611
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
24612
24512
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
24613
24513
|
if (!root) return null;
|
|
24614
24514
|
const anchor = el.closest("a");
|
|
@@ -27425,7 +27325,7 @@ function getNavigationSelectionParent(el) {
|
|
|
27425
27325
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
27426
27326
|
return resolveFooterLinksContainerFrom(el);
|
|
27427
27327
|
}
|
|
27428
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
27328
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
27429
27329
|
return getNavigationRoot(el);
|
|
27430
27330
|
}
|
|
27431
27331
|
return null;
|
|
@@ -27647,6 +27547,7 @@ var ICONS = {
|
|
|
27647
27547
|
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"/>',
|
|
27648
27548
|
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"/>'
|
|
27649
27549
|
};
|
|
27550
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
27650
27551
|
var SELECTION_CHROME_GAP2 = 4;
|
|
27651
27552
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
27652
27553
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -27744,7 +27645,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
27744
27645
|
el.style.top = `${top}px`;
|
|
27745
27646
|
el.style.height = `${height}px`;
|
|
27746
27647
|
}
|
|
27747
|
-
var
|
|
27648
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
27748
27649
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
27749
27650
|
const isAbove = transform.includes("translateY(-100%)");
|
|
27750
27651
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -27771,8 +27672,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
27771
27672
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
27772
27673
|
const half = toolbarWidth / 2;
|
|
27773
27674
|
return Math.max(
|
|
27774
|
-
|
|
27775
|
-
Math.min(centerX, window.innerWidth -
|
|
27675
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
27676
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
27776
27677
|
);
|
|
27777
27678
|
}
|
|
27778
27679
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -28684,6 +28585,21 @@ function OhhwellsBridge() {
|
|
|
28684
28585
|
const [isItemDragging, setIsItemDragging] = (0, import_react26.useState)(false);
|
|
28685
28586
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react26.useState)(false);
|
|
28686
28587
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
28588
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react26.useState)(null);
|
|
28589
|
+
const floatingPanelOpenRef = (0, import_react26.useRef)(false);
|
|
28590
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
28591
|
+
const floatingPanelRef = (0, import_react26.useRef)(null);
|
|
28592
|
+
floatingPanelRef.current = floatingPanel;
|
|
28593
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react26.useState)(null);
|
|
28594
|
+
const buttonCollectionDragRef = (0, import_react26.useRef)(null);
|
|
28595
|
+
const buttonDropInsertIndexRef = (0, import_react26.useRef)(null);
|
|
28596
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react26.useState)([]);
|
|
28597
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react26.useState)(null);
|
|
28598
|
+
const buttonPointerDragRef = (0, import_react26.useRef)(null);
|
|
28599
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react26.useState)(0);
|
|
28600
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react26.useState)(null);
|
|
28601
|
+
const [editorViewport, setEditorViewport] = (0, import_react26.useState)("desktop");
|
|
28602
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react26.useState)(null);
|
|
28687
28603
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react26.useState)(null);
|
|
28688
28604
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react26.useState)(null);
|
|
28689
28605
|
const footerDragRef = (0, import_react26.useRef)(null);
|
|
@@ -28710,21 +28626,6 @@ function OhhwellsBridge() {
|
|
|
28710
28626
|
const stylesRef = (0, import_react26.useRef)("");
|
|
28711
28627
|
const appliedDrawerRef = (0, import_react26.useRef)(null);
|
|
28712
28628
|
const pendingDeleteUndoRef = (0, import_react26.useRef)(null);
|
|
28713
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react26.useState)(null);
|
|
28714
|
-
const floatingPanelOpenRef = (0, import_react26.useRef)(false);
|
|
28715
|
-
const floatingPanelRef = (0, import_react26.useRef)(null);
|
|
28716
|
-
floatingPanelRef.current = floatingPanel;
|
|
28717
|
-
const setFloatingPanelRef = (0, import_react26.useRef)(setFloatingPanel);
|
|
28718
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react26.useState)(null);
|
|
28719
|
-
const buttonCollectionDragRef = (0, import_react26.useRef)(null);
|
|
28720
|
-
const buttonDropInsertIndexRef = (0, import_react26.useRef)(null);
|
|
28721
|
-
const [buttonDropSlots, setButtonDropSlots] = (0, import_react26.useState)([]);
|
|
28722
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react26.useState)(null);
|
|
28723
|
-
const buttonPointerDragRef = (0, import_react26.useRef)(null);
|
|
28724
|
-
const [buttonStyleTick, setButtonStyleTick] = (0, import_react26.useState)(0);
|
|
28725
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react26.useState)(null);
|
|
28726
|
-
const [editorViewport, setEditorViewport] = (0, import_react26.useState)("desktop");
|
|
28727
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react26.useState)(null);
|
|
28728
28629
|
const [sitePages, setSitePages] = (0, import_react26.useState)([]);
|
|
28729
28630
|
const collectionItemsRef = (0, import_react26.useRef)(/* @__PURE__ */ new Map());
|
|
28730
28631
|
const [sectionsByPath, setSectionsByPath] = (0, import_react26.useState)({});
|
|
@@ -28734,18 +28635,7 @@ function OhhwellsBridge() {
|
|
|
28734
28635
|
const linkPopoverOpenRef = (0, import_react26.useRef)(false);
|
|
28735
28636
|
const linkPopoverGraceUntilRef = (0, import_react26.useRef)(0);
|
|
28736
28637
|
setLinkPopoverRef.current = setLinkPopover;
|
|
28737
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
28738
28638
|
linkPopoverSessionRef.current = linkPopover;
|
|
28739
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
28740
|
-
(0, import_react26.useEffect)(() => {
|
|
28741
|
-
const syncViewport = () => {
|
|
28742
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
28743
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
28744
|
-
};
|
|
28745
|
-
syncViewport();
|
|
28746
|
-
window.addEventListener("resize", syncViewport);
|
|
28747
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
28748
|
-
}, []);
|
|
28749
28639
|
(0, import_react26.useEffect)(() => {
|
|
28750
28640
|
setSectionOrderPersistHandler((entries) => {
|
|
28751
28641
|
const currentPath = window.location.pathname;
|
|
@@ -30488,7 +30378,6 @@ function OhhwellsBridge() {
|
|
|
30488
30378
|
applyAiFooterFromContent(content);
|
|
30489
30379
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30490
30380
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
30491
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30492
30381
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30493
30382
|
}
|
|
30494
30383
|
applyBrandChrome(content);
|
|
@@ -30499,12 +30388,12 @@ function OhhwellsBridge() {
|
|
|
30499
30388
|
if (key === "__ohw_sections") continue;
|
|
30500
30389
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30501
30390
|
if (key === AI_FOOTER_KEY) continue;
|
|
30502
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30503
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30504
30391
|
if (key === BRAND_KIT_KEY) continue;
|
|
30505
30392
|
if (key === STYLE_STORE_KEY) continue;
|
|
30506
30393
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30394
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30507
30395
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
30396
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30508
30397
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30509
30398
|
continue;
|
|
30510
30399
|
}
|
|
@@ -30739,18 +30628,17 @@ function OhhwellsBridge() {
|
|
|
30739
30628
|
}
|
|
30740
30629
|
applyAiFooterFromContent(content);
|
|
30741
30630
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30742
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30743
30631
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30744
30632
|
}
|
|
30745
30633
|
for (const [key, val] of Object.entries(content)) {
|
|
30746
30634
|
if (key === "__ohw_sections") continue;
|
|
30747
30635
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30748
30636
|
if (key === AI_FOOTER_KEY) continue;
|
|
30749
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30750
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30751
30637
|
if (key === BRAND_KIT_KEY) continue;
|
|
30752
30638
|
if (key === STYLE_STORE_KEY) continue;
|
|
30753
30639
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30640
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30641
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
30754
30642
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30755
30643
|
continue;
|
|
30756
30644
|
}
|
|
@@ -31022,11 +30910,26 @@ function OhhwellsBridge() {
|
|
|
31022
30910
|
const t2 = setTimeout(measure, 500);
|
|
31023
30911
|
const ro = new ResizeObserver(schedule);
|
|
31024
30912
|
ro.observe(document.body);
|
|
30913
|
+
let lastWidth = window.innerWidth;
|
|
30914
|
+
let resizeTimers = [];
|
|
30915
|
+
const clearResizeTimers = () => {
|
|
30916
|
+
resizeTimers.forEach(clearTimeout);
|
|
30917
|
+
resizeTimers = [];
|
|
30918
|
+
};
|
|
30919
|
+
const handleResize = () => {
|
|
30920
|
+
if (window.innerWidth === lastWidth) return;
|
|
30921
|
+
lastWidth = window.innerWidth;
|
|
30922
|
+
clearResizeTimers();
|
|
30923
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
30924
|
+
};
|
|
30925
|
+
window.addEventListener("resize", handleResize);
|
|
31025
30926
|
return () => {
|
|
31026
30927
|
clearTimeout(t1);
|
|
31027
30928
|
clearTimeout(t2);
|
|
31028
30929
|
if (raf != null) cancelAnimationFrame(raf);
|
|
31029
30930
|
ro.disconnect();
|
|
30931
|
+
clearResizeTimers();
|
|
30932
|
+
window.removeEventListener("resize", handleResize);
|
|
31030
30933
|
};
|
|
31031
30934
|
}, [pathname, isEditMode, postToParent2]);
|
|
31032
30935
|
(0, import_react26.useEffect)(() => {
|
|
@@ -31323,13 +31226,6 @@ function OhhwellsBridge() {
|
|
|
31323
31226
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
31324
31227
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
31325
31228
|
if (isInsideLinkEditor(target)) return;
|
|
31326
|
-
if (isInsideFloatingPanel(target)) return;
|
|
31327
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
31328
|
-
if (target.closest(
|
|
31329
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
31330
|
-
)) {
|
|
31331
|
-
return;
|
|
31332
|
-
}
|
|
31333
31229
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
31334
31230
|
clearMediaSelectionRef.current();
|
|
31335
31231
|
}
|
|
@@ -31353,6 +31249,8 @@ function OhhwellsBridge() {
|
|
|
31353
31249
|
return;
|
|
31354
31250
|
}
|
|
31355
31251
|
}
|
|
31252
|
+
if (isInsideFloatingPanel(target)) return;
|
|
31253
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
31356
31254
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
31357
31255
|
if (collectionItem) {
|
|
31358
31256
|
e.preventDefault();
|
|
@@ -31364,6 +31262,11 @@ function OhhwellsBridge() {
|
|
|
31364
31262
|
});
|
|
31365
31263
|
return;
|
|
31366
31264
|
}
|
|
31265
|
+
if (target.closest(
|
|
31266
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
31267
|
+
)) {
|
|
31268
|
+
return;
|
|
31269
|
+
}
|
|
31367
31270
|
{
|
|
31368
31271
|
const formEl = getFormElement(target);
|
|
31369
31272
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -31527,13 +31430,9 @@ function OhhwellsBridge() {
|
|
|
31527
31430
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
31528
31431
|
e.preventDefault();
|
|
31529
31432
|
e.stopPropagation();
|
|
31433
|
+
selectIconElementRef.current(editable);
|
|
31530
31434
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
31531
31435
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
31532
|
-
if (aiIcon) {
|
|
31533
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
31534
|
-
} else {
|
|
31535
|
-
selectIconElementRef.current(editable);
|
|
31536
|
-
}
|
|
31537
31436
|
postToParentRef.current({
|
|
31538
31437
|
type: "ow:icon-pick",
|
|
31539
31438
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -31761,9 +31660,6 @@ function OhhwellsBridge() {
|
|
|
31761
31660
|
setHoveredItemRect(null);
|
|
31762
31661
|
hoveredNavContainerRef.current = null;
|
|
31763
31662
|
setHoveredNavContainerRect(null);
|
|
31764
|
-
siblingHintElRef.current = null;
|
|
31765
|
-
setSiblingHintRect(null);
|
|
31766
|
-
setSiblingHintRects([]);
|
|
31767
31663
|
return;
|
|
31768
31664
|
}
|
|
31769
31665
|
{
|
|
@@ -31886,6 +31782,7 @@ function OhhwellsBridge() {
|
|
|
31886
31782
|
hoveredNavContainerRef.current = null;
|
|
31887
31783
|
setHoveredNavContainerRect(null);
|
|
31888
31784
|
hoveredItemElRef.current = editable;
|
|
31785
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
31889
31786
|
}
|
|
31890
31787
|
}
|
|
31891
31788
|
}
|
|
@@ -32592,11 +32489,7 @@ function OhhwellsBridge() {
|
|
|
32592
32489
|
};
|
|
32593
32490
|
const handleMouseMove = (e) => {
|
|
32594
32491
|
const { clientX, clientY } = e;
|
|
32595
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
32596
|
-
dismissImageHover();
|
|
32597
|
-
clearImageHover();
|
|
32598
|
-
return;
|
|
32599
|
-
}
|
|
32492
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
32600
32493
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
32601
32494
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
32602
32495
|
formHoverElRef.current = null;
|
|
@@ -32625,12 +32518,7 @@ function OhhwellsBridge() {
|
|
|
32625
32518
|
setHoveredItemRect(null);
|
|
32626
32519
|
hoveredNavContainerRef.current = null;
|
|
32627
32520
|
setHoveredNavContainerRect(null);
|
|
32628
|
-
siblingHintElRef.current = null;
|
|
32629
|
-
setSiblingHintRect(null);
|
|
32630
|
-
setSiblingHintRects([]);
|
|
32631
32521
|
dismissImageHover();
|
|
32632
|
-
clearImageHover();
|
|
32633
|
-
setSectionGap(null);
|
|
32634
32522
|
return;
|
|
32635
32523
|
}
|
|
32636
32524
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -32642,11 +32530,7 @@ function OhhwellsBridge() {
|
|
|
32642
32530
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
32643
32531
|
const { clientX, clientY } = e.data;
|
|
32644
32532
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
32645
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
32646
|
-
dismissImageHover();
|
|
32647
|
-
clearImageHover();
|
|
32648
|
-
return;
|
|
32649
|
-
}
|
|
32533
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
32650
32534
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
32651
32535
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
32652
32536
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -33026,7 +32910,6 @@ function OhhwellsBridge() {
|
|
|
33026
32910
|
applyAiFooterFromContent(content);
|
|
33027
32911
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
33028
32912
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
33029
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
33030
32913
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
33031
32914
|
}
|
|
33032
32915
|
applyBrandChrome(content);
|
|
@@ -33041,12 +32924,12 @@ function OhhwellsBridge() {
|
|
|
33041
32924
|
}
|
|
33042
32925
|
if (key === AI_SECTIONS_KEY) continue;
|
|
33043
32926
|
if (key === AI_FOOTER_KEY) continue;
|
|
33044
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
33045
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
33046
32927
|
if (key === BRAND_KIT_KEY) continue;
|
|
33047
32928
|
if (key === STYLE_STORE_KEY) continue;
|
|
33048
32929
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
32930
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
33049
32931
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
32932
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
33050
32933
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
33051
32934
|
continue;
|
|
33052
32935
|
}
|
|
@@ -33719,12 +33602,6 @@ function OhhwellsBridge() {
|
|
|
33719
33602
|
closeLinkPopoverRef.current();
|
|
33720
33603
|
return;
|
|
33721
33604
|
}
|
|
33722
|
-
if (floatingPanelOpenRef.current) {
|
|
33723
|
-
setFloatingPanelRef.current(null);
|
|
33724
|
-
deselectRef.current();
|
|
33725
|
-
deactivateRef.current();
|
|
33726
|
-
return;
|
|
33727
|
-
}
|
|
33728
33605
|
deselectRef.current();
|
|
33729
33606
|
deactivateRef.current();
|
|
33730
33607
|
clearMediaSelectionRef.current();
|
|
@@ -34554,10 +34431,10 @@ function OhhwellsBridge() {
|
|
|
34554
34431
|
window.removeEventListener("message", handleDuplicateSection);
|
|
34555
34432
|
window.removeEventListener("message", handleDeactivate);
|
|
34556
34433
|
window.removeEventListener("message", handleSelectNav);
|
|
34434
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
34557
34435
|
window.removeEventListener("message", handleToastAction);
|
|
34558
34436
|
window.removeEventListener("message", handleFormCount);
|
|
34559
34437
|
window.removeEventListener("message", handleUiEscape);
|
|
34560
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
34561
34438
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
34562
34439
|
autoSaveTimers.current.clear();
|
|
34563
34440
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -34851,7 +34728,7 @@ function OhhwellsBridge() {
|
|
|
34851
34728
|
postToParent2({
|
|
34852
34729
|
type: "ow:ready",
|
|
34853
34730
|
version: "1",
|
|
34854
|
-
bridgeVersion: "0.1.179
|
|
34731
|
+
bridgeVersion: "0.1.179",
|
|
34855
34732
|
path: pathname,
|
|
34856
34733
|
nodes: collectEditableNodes(editContentRef.current),
|
|
34857
34734
|
sections
|