@ohhwells/bridge 0.1.167-next.444 → 0.1.168
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 +745 -957
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +766 -994
- 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
|
@@ -1216,21 +1216,21 @@ function chromeFrom(sample) {
|
|
|
1216
1216
|
};
|
|
1217
1217
|
}
|
|
1218
1218
|
function filledPrimary(seed) {
|
|
1219
|
-
const
|
|
1220
|
-
const luminance = relativeLuminance(
|
|
1219
|
+
const paint = parseColor(paintColor(seed)) ?? { r: 15, g: 15, b: 15, a: 1 };
|
|
1220
|
+
const luminance = relativeLuminance(paint);
|
|
1221
1221
|
return {
|
|
1222
|
-
background: toCss({ ...
|
|
1222
|
+
background: toCss({ ...paint, a: 1 }),
|
|
1223
1223
|
color: luminance > 0.55 ? "rgb(15, 15, 15)" : "rgb(255, 255, 255)",
|
|
1224
1224
|
borderColor: TRANSPARENT,
|
|
1225
1225
|
borderWidth: "0px"
|
|
1226
1226
|
};
|
|
1227
1227
|
}
|
|
1228
1228
|
function generatedSecondary(primary) {
|
|
1229
|
-
const
|
|
1229
|
+
const paint = accentColor(primary);
|
|
1230
1230
|
return {
|
|
1231
1231
|
background: TRANSPARENT,
|
|
1232
|
-
color:
|
|
1233
|
-
borderColor:
|
|
1232
|
+
color: paint,
|
|
1233
|
+
borderColor: paint,
|
|
1234
1234
|
borderWidth: "1px"
|
|
1235
1235
|
};
|
|
1236
1236
|
}
|
|
@@ -1243,9 +1243,9 @@ function generatedGhost(primary) {
|
|
|
1243
1243
|
};
|
|
1244
1244
|
}
|
|
1245
1245
|
function normalizeOutlineChrome(outline, primary) {
|
|
1246
|
-
const
|
|
1246
|
+
const paint = accentColor(primary);
|
|
1247
1247
|
const text = parseColor(outline.color);
|
|
1248
|
-
const paintRgb = parseColor(
|
|
1248
|
+
const paintRgb = parseColor(paint);
|
|
1249
1249
|
const primaryLabel = parseColor(primary.color);
|
|
1250
1250
|
const matchesOnPrimary = Boolean(text && primaryLabel) && colorKey(outline.color) === colorKey(primary.color);
|
|
1251
1251
|
const textTooLight = text ? relativeLuminance(text) > 0.7 : false;
|
|
@@ -1254,8 +1254,8 @@ function normalizeOutlineChrome(outline, primary) {
|
|
|
1254
1254
|
const hasBorder = parseFloat(outline.borderWidth) > 0;
|
|
1255
1255
|
return {
|
|
1256
1256
|
...outline,
|
|
1257
|
-
color:
|
|
1258
|
-
borderColor: hasBorder ?
|
|
1257
|
+
color: paint,
|
|
1258
|
+
borderColor: hasBorder ? paint : outline.borderColor
|
|
1259
1259
|
};
|
|
1260
1260
|
}
|
|
1261
1261
|
function generateButtonVariants(samples) {
|
|
@@ -6796,21 +6796,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
6796
6796
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
6797
6797
|
return target ? pricingFeatureList(target).length : 0;
|
|
6798
6798
|
}
|
|
6799
|
-
function prevailingFeatureIcon(features) {
|
|
6800
|
-
const counts = /* @__PURE__ */ new Map();
|
|
6801
|
-
for (const row of features) {
|
|
6802
|
-
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
6803
|
-
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
6804
|
-
entry.count += 1;
|
|
6805
|
-
counts.set(key, entry);
|
|
6806
|
-
}
|
|
6807
|
-
let best = null;
|
|
6808
|
-
for (const entry of counts.values()) {
|
|
6809
|
-
if (!best || entry.count > best.count) best = entry;
|
|
6810
|
-
}
|
|
6811
|
-
if (!best) return {};
|
|
6812
|
-
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
6813
|
-
}
|
|
6814
6799
|
function addPricingCardFeature(tree, index, text) {
|
|
6815
6800
|
return withPricingCollection(tree, (collection) => {
|
|
6816
6801
|
const children = collection.children;
|
|
@@ -6819,7 +6804,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
6819
6804
|
const features = pricingFeatureList(target);
|
|
6820
6805
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
6821
6806
|
target.slots = target.slots ?? {};
|
|
6822
|
-
target.slots.features = [...features, { text
|
|
6807
|
+
target.slots.features = [...features, { text }];
|
|
6823
6808
|
return true;
|
|
6824
6809
|
});
|
|
6825
6810
|
}
|
|
@@ -7463,120 +7448,6 @@ function findSelectableNavContainer(doc = document) {
|
|
|
7463
7448
|
);
|
|
7464
7449
|
}
|
|
7465
7450
|
|
|
7466
|
-
// src/lib/youtube.ts
|
|
7467
|
-
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
7468
|
-
function extractYouTubeId(input) {
|
|
7469
|
-
const trimmed = input.trim();
|
|
7470
|
-
if (!trimmed) return null;
|
|
7471
|
-
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
7472
|
-
let url;
|
|
7473
|
-
try {
|
|
7474
|
-
url = new URL(trimmed);
|
|
7475
|
-
} catch {
|
|
7476
|
-
return null;
|
|
7477
|
-
}
|
|
7478
|
-
const host = url.hostname.replace(/^www\./, "");
|
|
7479
|
-
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
7480
|
-
return null;
|
|
7481
|
-
}
|
|
7482
|
-
let candidate = null;
|
|
7483
|
-
if (host === "youtu.be") {
|
|
7484
|
-
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
7485
|
-
} else if (url.pathname === "/watch") {
|
|
7486
|
-
candidate = url.searchParams.get("v");
|
|
7487
|
-
} else {
|
|
7488
|
-
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
7489
|
-
candidate = match ? match[1] : null;
|
|
7490
|
-
}
|
|
7491
|
-
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
7492
|
-
}
|
|
7493
|
-
|
|
7494
|
-
// src/lib/section-embed.ts
|
|
7495
|
-
var SECTION_EMBED_SUFFIX = "__ohw_embed";
|
|
7496
|
-
function readStoredEmbed(value) {
|
|
7497
|
-
if (value.startsWith("start\n")) {
|
|
7498
|
-
return { raw: value.slice("start\n".length), at: "start" };
|
|
7499
|
-
}
|
|
7500
|
-
return { raw: value, at: "end" };
|
|
7501
|
-
}
|
|
7502
|
-
function embedFrameSrc(value) {
|
|
7503
|
-
const videoId = extractYouTubeId(value);
|
|
7504
|
-
if (videoId) {
|
|
7505
|
-
return { src: `https://www.youtube-nocookie.com/embed/${videoId}?rel=0`, title: "YouTube video" };
|
|
7506
|
-
}
|
|
7507
|
-
let url;
|
|
7508
|
-
try {
|
|
7509
|
-
url = new URL(value);
|
|
7510
|
-
} catch {
|
|
7511
|
-
return null;
|
|
7512
|
-
}
|
|
7513
|
-
const host = url.hostname.replace(/^www\./, "").toLowerCase();
|
|
7514
|
-
if (host === "google.com" && url.pathname.startsWith("/maps") || host === "maps.google.com") {
|
|
7515
|
-
const query = url.searchParams.get("q") || url.searchParams.get("query") || "";
|
|
7516
|
-
const src = query ? `https://maps.google.com/maps?q=${encodeURIComponent(query)}&output=embed` : `https://maps.google.com/maps?output=embed`;
|
|
7517
|
-
return { src, title: "Map" };
|
|
7518
|
-
}
|
|
7519
|
-
if (host === "maps.app.goo.gl") {
|
|
7520
|
-
return { src: value, title: "Map" };
|
|
7521
|
-
}
|
|
7522
|
-
if (host === "calendly.com" || host.endsWith(".calendly.com") || host === "calendar.google.com") {
|
|
7523
|
-
return { src: value, title: "Calendar" };
|
|
7524
|
-
}
|
|
7525
|
-
if (host === "docs.google.com" && url.pathname.includes("/forms/")) {
|
|
7526
|
-
return { src: value.replace(/\/edit(?:\?.*)?$/i, "/viewform"), title: "Form" };
|
|
7527
|
-
}
|
|
7528
|
-
if (host === "forms.gle") {
|
|
7529
|
-
return { src: value, title: "Form" };
|
|
7530
|
-
}
|
|
7531
|
-
return null;
|
|
7532
|
-
}
|
|
7533
|
-
function place(section, box, at) {
|
|
7534
|
-
if (at === "start") {
|
|
7535
|
-
section.insertBefore(box, section.firstChild);
|
|
7536
|
-
return;
|
|
7537
|
-
}
|
|
7538
|
-
section.appendChild(box);
|
|
7539
|
-
}
|
|
7540
|
-
function paint(section, key, src, title, at) {
|
|
7541
|
-
const existing = section.querySelector(`[data-ohw-section-embed="${CSS.escape(key)}"]`);
|
|
7542
|
-
const frame = existing?.querySelector("iframe");
|
|
7543
|
-
if (existing && frame) {
|
|
7544
|
-
if (frame.getAttribute("src") !== src) frame.setAttribute("src", src);
|
|
7545
|
-
frame.title = title;
|
|
7546
|
-
place(section, existing, at);
|
|
7547
|
-
return;
|
|
7548
|
-
}
|
|
7549
|
-
existing?.remove();
|
|
7550
|
-
const box = document.createElement("div");
|
|
7551
|
-
box.setAttribute("data-ohw-section-embed", key);
|
|
7552
|
-
box.style.cssText = at === "start" ? "width:100%;max-width:960px;margin:0 auto 32px;padding:32px 24px 0;box-sizing:border-box;" : "width:100%;max-width:960px;margin:32px auto 0;padding:0 24px 32px;box-sizing:border-box;";
|
|
7553
|
-
const frameWrap = document.createElement("div");
|
|
7554
|
-
frameWrap.style.cssText = "position:relative;width:100%;aspect-ratio:16/9;min-height:250px;border-radius:12px;overflow:hidden;background:#0f172a;";
|
|
7555
|
-
const iframe = document.createElement("iframe");
|
|
7556
|
-
iframe.src = src;
|
|
7557
|
-
iframe.title = title;
|
|
7558
|
-
iframe.style.cssText = "position:absolute;inset:0;width:100%;height:100%;border:0;";
|
|
7559
|
-
iframe.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture";
|
|
7560
|
-
iframe.setAttribute("allowfullscreen", "");
|
|
7561
|
-
frameWrap.appendChild(iframe);
|
|
7562
|
-
box.appendChild(frameWrap);
|
|
7563
|
-
place(section, box, at);
|
|
7564
|
-
}
|
|
7565
|
-
function applySectionEmbeds(content) {
|
|
7566
|
-
for (const [key, val] of Object.entries(content)) {
|
|
7567
|
-
if (!key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
7568
|
-
const sectionId = key.slice(0, -SECTION_EMBED_SUFFIX.length);
|
|
7569
|
-
const section = document.querySelector(`[data-ohw-section="${CSS.escape(sectionId)}"]`);
|
|
7570
|
-
const stored = typeof val === "string" ? readStoredEmbed(val) : null;
|
|
7571
|
-
const frame = stored ? embedFrameSrc(stored.raw) : null;
|
|
7572
|
-
if (!section || !stored || !frame) {
|
|
7573
|
-
section?.querySelector(`[data-ohw-section-embed="${CSS.escape(key)}"]`)?.remove();
|
|
7574
|
-
continue;
|
|
7575
|
-
}
|
|
7576
|
-
paint(section, key, frame.src, frame.title, stored.at);
|
|
7577
|
-
}
|
|
7578
|
-
}
|
|
7579
|
-
|
|
7580
7451
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
7581
7452
|
var import_react_dom = require("react-dom");
|
|
7582
7453
|
var import_client = require("react-dom/client");
|
|
@@ -8150,7 +8021,7 @@ var AI_MOBILE_CSS = [
|
|
|
8150
8021
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
8151
8022
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
8152
8023
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
8153
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
8024
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
8154
8025
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
8155
8026
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
8156
8027
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -8166,10 +8037,8 @@ var AI_MOBILE_CSS = [
|
|
|
8166
8037
|
"[data-ai-section]{overflow-x:hidden}",
|
|
8167
8038
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
8168
8039
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
8169
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
8170
|
-
|
|
8171
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8172
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
8040
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
8041
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8173
8042
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
8174
8043
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
8175
8044
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8374,31 +8243,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8374
8243
|
function textAttrs(ctx, path) {
|
|
8375
8244
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8376
8245
|
}
|
|
8377
|
-
var AI_RESPONSIVE_CSS = [
|
|
8378
|
-
"@media (max-width: 960px) {",
|
|
8379
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
8380
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
8381
|
-
"}",
|
|
8382
|
-
"@media (max-width: 640px) {",
|
|
8383
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
8384
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
8385
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
8386
|
-
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
8387
|
-
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
8388
|
-
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
8389
|
-
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
8390
|
-
// layered text used to be.
|
|
8391
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
8392
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
8393
|
-
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
8394
|
-
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
8395
|
-
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
8396
|
-
// other rule had already been taught to stand down.
|
|
8397
|
-
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
8398
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
8399
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
8400
|
-
"}"
|
|
8401
|
-
].join("\n");
|
|
8402
8246
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8403
8247
|
function MediaBox({
|
|
8404
8248
|
refValue,
|
|
@@ -8453,7 +8297,7 @@ function MediaBox({
|
|
|
8453
8297
|
position: fill ? "absolute" : void 0,
|
|
8454
8298
|
inset: fill ? 0 : void 0,
|
|
8455
8299
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8456
|
-
height: fill ? "100%" :
|
|
8300
|
+
height: fill ? "100%" : void 0,
|
|
8457
8301
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8458
8302
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8459
8303
|
borderRadius: radius,
|
|
@@ -9949,7 +9793,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
9949
9793
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
9950
9794
|
"div",
|
|
9951
9795
|
{
|
|
9952
|
-
"data-ai-grid":
|
|
9796
|
+
"data-ai-grid": "",
|
|
9953
9797
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
9954
9798
|
style: {
|
|
9955
9799
|
display: "grid",
|
|
@@ -10251,7 +10095,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
10251
10095
|
},
|
|
10252
10096
|
children: [
|
|
10253
10097
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
10254
|
-
// The section's `data-ai-
|
|
10098
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
10255
10099
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
10256
10100
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
10257
10101
|
// the full section width instead of reading at the usual content width.
|
|
@@ -10670,7 +10514,6 @@ function AiTreeRenderer({
|
|
|
10670
10514
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
10671
10515
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
10672
10516
|
...bgAttrs,
|
|
10673
|
-
"data-ai-responsive": "",
|
|
10674
10517
|
style: {
|
|
10675
10518
|
position: "relative",
|
|
10676
10519
|
padding: `${padCss} 0`,
|
|
@@ -10684,13 +10527,12 @@ function AiTreeRenderer({
|
|
|
10684
10527
|
...fillHeight ? { display: "grid" } : {}
|
|
10685
10528
|
},
|
|
10686
10529
|
children: [
|
|
10687
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
|
|
10688
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
10689
10530
|
isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
10531
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
|
|
10690
10532
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
10691
10533
|
"div",
|
|
10692
10534
|
{
|
|
10693
|
-
"data-ai-
|
|
10535
|
+
"data-ai-container": "",
|
|
10694
10536
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
10695
10537
|
style: {
|
|
10696
10538
|
position: "relative",
|
|
@@ -10707,7 +10549,7 @@ function AiTreeRenderer({
|
|
|
10707
10549
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
10708
10550
|
"div",
|
|
10709
10551
|
{
|
|
10710
|
-
"data-ai-
|
|
10552
|
+
"data-ai-row": "",
|
|
10711
10553
|
style: {
|
|
10712
10554
|
display: "grid",
|
|
10713
10555
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11369,10 +11211,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11369
11211
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11370
11212
|
continue;
|
|
11371
11213
|
}
|
|
11214
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
11372
11215
|
let container = existing?.container;
|
|
11373
|
-
let isNewMount = false;
|
|
11374
11216
|
if (!container || !container.isConnected) {
|
|
11375
|
-
isNewMount = true;
|
|
11376
11217
|
existing?.root.unmount();
|
|
11377
11218
|
container?.remove();
|
|
11378
11219
|
container = document.createElement("div");
|
|
@@ -11710,34 +11551,6 @@ function minSpanForFooterBlock(type) {
|
|
|
11710
11551
|
return 3;
|
|
11711
11552
|
}
|
|
11712
11553
|
}
|
|
11713
|
-
function readLiveSocialItems() {
|
|
11714
|
-
const root = getFooterRoot();
|
|
11715
|
-
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
11716
|
-
if (!row) return [];
|
|
11717
|
-
const items = [];
|
|
11718
|
-
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
11719
|
-
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
11720
|
-
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
11721
|
-
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
11722
|
-
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
11723
|
-
items.push({ platform, href });
|
|
11724
|
-
}
|
|
11725
|
-
return items;
|
|
11726
|
-
}
|
|
11727
|
-
function syncSocialRowsFromDom(tree) {
|
|
11728
|
-
const root = getFooterRoot();
|
|
11729
|
-
if (!root) return;
|
|
11730
|
-
const row = root.querySelector("[data-ohw-socials-row]");
|
|
11731
|
-
const live = readLiveSocialItems();
|
|
11732
|
-
if (row && live.length === 0) return;
|
|
11733
|
-
for (const col of tree.columns) {
|
|
11734
|
-
col.blocks = col.blocks.flatMap((block) => {
|
|
11735
|
-
if (block.type !== "social-row") return [block];
|
|
11736
|
-
if (!row) return [];
|
|
11737
|
-
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
11738
|
-
});
|
|
11739
|
-
}
|
|
11740
|
-
}
|
|
11741
11554
|
function collectBrandBlocks(tree) {
|
|
11742
11555
|
const brand = [];
|
|
11743
11556
|
for (const col of tree.columns) {
|
|
@@ -11983,7 +11796,6 @@ function textOf2(el) {
|
|
|
11983
11796
|
}
|
|
11984
11797
|
function syncFooterTreeLinksFromDom(tree) {
|
|
11985
11798
|
const next = cloneTree(tree);
|
|
11986
|
-
syncSocialRowsFromDom(next);
|
|
11987
11799
|
const domCols = listFooterColumns().map((col) => {
|
|
11988
11800
|
const heading = getFooterColumnHeadingEl(col);
|
|
11989
11801
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -17796,7 +17608,7 @@ function apiBase() {
|
|
|
17796
17608
|
function bridgeVersion() {
|
|
17797
17609
|
try {
|
|
17798
17610
|
if (true) {
|
|
17799
|
-
return "0.1.
|
|
17611
|
+
return "0.1.168";
|
|
17800
17612
|
}
|
|
17801
17613
|
} catch {
|
|
17802
17614
|
}
|
|
@@ -17810,7 +17622,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17810
17622
|
return;
|
|
17811
17623
|
}
|
|
17812
17624
|
try {
|
|
17813
|
-
const v = true ? "0.1.
|
|
17625
|
+
const v = true ? "0.1.168" : "";
|
|
17814
17626
|
if (v) {
|
|
17815
17627
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17816
17628
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -18488,7 +18300,6 @@ function MediaOverlay({
|
|
|
18488
18300
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
18489
18301
|
);
|
|
18490
18302
|
}, [isVideo]);
|
|
18491
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
18492
18303
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
18493
18304
|
const box = {
|
|
18494
18305
|
position: "fixed",
|
|
@@ -18587,10 +18398,11 @@ function MediaOverlay({
|
|
|
18587
18398
|
className: "flex items-center justify-center cursor-pointer",
|
|
18588
18399
|
style: {
|
|
18589
18400
|
...box,
|
|
18590
|
-
//
|
|
18591
|
-
//
|
|
18592
|
-
//
|
|
18593
|
-
|
|
18401
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
18402
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
18403
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
18404
|
+
// Replace still works.
|
|
18405
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
18594
18406
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
18595
18407
|
// than hovered. Hover keeps the existing tinted preview.
|
|
18596
18408
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -18617,17 +18429,17 @@ function MediaOverlay({
|
|
|
18617
18429
|
},
|
|
18618
18430
|
children: [
|
|
18619
18431
|
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 }),
|
|
18620
|
-
|
|
18432
|
+
isVideo ? "Replace video" : "Replace image"
|
|
18621
18433
|
]
|
|
18622
18434
|
}
|
|
18623
18435
|
),
|
|
18624
|
-
|
|
18436
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
18625
18437
|
Button,
|
|
18626
18438
|
{
|
|
18627
18439
|
"data-ohw-media-overlay": "",
|
|
18628
18440
|
variant: "outline",
|
|
18629
18441
|
size: "sm",
|
|
18630
|
-
"aria-label":
|
|
18442
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
18631
18443
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
18632
18444
|
style: {
|
|
18633
18445
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -18650,7 +18462,7 @@ function MediaOverlay({
|
|
|
18650
18462
|
},
|
|
18651
18463
|
children: [
|
|
18652
18464
|
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 }),
|
|
18653
|
-
replaceMode === "full" ?
|
|
18465
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
18654
18466
|
]
|
|
18655
18467
|
}
|
|
18656
18468
|
)
|
|
@@ -19250,7 +19062,7 @@ function AiSectionOverlay({
|
|
|
19250
19062
|
|
|
19251
19063
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19252
19064
|
var import_react13 = require("react");
|
|
19253
|
-
var
|
|
19065
|
+
var import_lucide_react8 = require("lucide-react");
|
|
19254
19066
|
|
|
19255
19067
|
// src/lib/ai-media-strip-tree.ts
|
|
19256
19068
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19364,6 +19176,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19364
19176
|
return true;
|
|
19365
19177
|
});
|
|
19366
19178
|
}
|
|
19179
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
19180
|
+
return withMediaStrip(tree, (block) => {
|
|
19181
|
+
const items = block.items;
|
|
19182
|
+
if (index < 0 || index >= items.length) return false;
|
|
19183
|
+
items[index] = { ...items[index], alt };
|
|
19184
|
+
return true;
|
|
19185
|
+
});
|
|
19186
|
+
}
|
|
19367
19187
|
function setMediaStripItemLink(tree, index, link) {
|
|
19368
19188
|
return withMediaStrip(tree, (block) => {
|
|
19369
19189
|
const items = block.items;
|
|
@@ -19381,117 +19201,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19381
19201
|
});
|
|
19382
19202
|
}
|
|
19383
19203
|
|
|
19384
|
-
// src/ui/dialog.tsx
|
|
19385
|
-
var React9 = __toESM(require("react"), 1);
|
|
19386
|
-
var import_radix_ui6 = require("radix-ui");
|
|
19387
|
-
var import_lucide_react8 = require("lucide-react");
|
|
19388
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
19389
|
-
function Dialog2({
|
|
19390
|
-
...props
|
|
19391
|
-
}) {
|
|
19392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
19393
|
-
}
|
|
19394
|
-
function DialogPortal({
|
|
19395
|
-
...props
|
|
19396
|
-
}) {
|
|
19397
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
19398
|
-
}
|
|
19399
|
-
function DialogOverlay({
|
|
19400
|
-
className,
|
|
19401
|
-
...props
|
|
19402
|
-
}) {
|
|
19403
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19404
|
-
import_radix_ui6.Dialog.Overlay,
|
|
19405
|
-
{
|
|
19406
|
-
"data-slot": "dialog-overlay",
|
|
19407
|
-
"data-ohw-link-modal-root": "",
|
|
19408
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19409
|
-
...props
|
|
19410
|
-
}
|
|
19411
|
-
);
|
|
19412
|
-
}
|
|
19413
|
-
var DialogContent = React9.forwardRef(
|
|
19414
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19415
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
19416
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
19417
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19418
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19419
|
-
import_radix_ui6.Dialog.Content,
|
|
19420
|
-
{
|
|
19421
|
-
ref,
|
|
19422
|
-
"data-slot": "dialog-content",
|
|
19423
|
-
className: cn(
|
|
19424
|
-
positionMode,
|
|
19425
|
-
"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",
|
|
19426
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19427
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19428
|
-
className
|
|
19429
|
-
),
|
|
19430
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
19431
|
-
...props,
|
|
19432
|
-
children: [
|
|
19433
|
-
children,
|
|
19434
|
-
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19435
|
-
import_radix_ui6.Dialog.Close,
|
|
19436
|
-
{
|
|
19437
|
-
type: "button",
|
|
19438
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19439
|
-
"aria-label": "Close",
|
|
19440
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
|
|
19441
|
-
}
|
|
19442
|
-
) : null
|
|
19443
|
-
]
|
|
19444
|
-
}
|
|
19445
|
-
)
|
|
19446
|
-
] });
|
|
19447
|
-
}
|
|
19448
|
-
);
|
|
19449
|
-
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
19450
|
-
function DialogHeader({
|
|
19451
|
-
className,
|
|
19452
|
-
...props
|
|
19453
|
-
}) {
|
|
19454
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19455
|
-
}
|
|
19456
|
-
function DialogFooter({
|
|
19457
|
-
className,
|
|
19458
|
-
...props
|
|
19459
|
-
}) {
|
|
19460
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19461
|
-
"div",
|
|
19462
|
-
{
|
|
19463
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
19464
|
-
...props
|
|
19465
|
-
}
|
|
19466
|
-
);
|
|
19467
|
-
}
|
|
19468
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19469
|
-
import_radix_ui6.Dialog.Title,
|
|
19470
|
-
{
|
|
19471
|
-
ref,
|
|
19472
|
-
className: cn(
|
|
19473
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19474
|
-
className
|
|
19475
|
-
),
|
|
19476
|
-
...props
|
|
19477
|
-
}
|
|
19478
|
-
));
|
|
19479
|
-
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
19480
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19481
|
-
import_radix_ui6.Dialog.Description,
|
|
19482
|
-
{
|
|
19483
|
-
ref,
|
|
19484
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
19485
|
-
...props
|
|
19486
|
-
}
|
|
19487
|
-
));
|
|
19488
|
-
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
19489
|
-
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
19490
|
-
|
|
19491
19204
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19492
|
-
var
|
|
19493
|
-
var PRIMARY3 = "
|
|
19494
|
-
var
|
|
19205
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
19206
|
+
var PRIMARY3 = "#0885FE";
|
|
19207
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
19208
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19495
19209
|
function findMediaStripItemElement(sectionId, index) {
|
|
19496
19210
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
19497
19211
|
if (!sectionEl2) return null;
|
|
@@ -19501,35 +19215,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
19501
19215
|
}
|
|
19502
19216
|
return null;
|
|
19503
19217
|
}
|
|
19504
|
-
function
|
|
19505
|
-
|
|
19506
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19507
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19508
|
-
if (!itemEl) return null;
|
|
19509
|
-
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
19510
|
-
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19511
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19512
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19513
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
19514
|
-
return { sectionId, index };
|
|
19515
|
-
}
|
|
19516
|
-
function sameRef(a, b) {
|
|
19517
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19518
|
-
}
|
|
19519
|
-
function rectOf(el) {
|
|
19218
|
+
function readRect2(ref) {
|
|
19219
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19520
19220
|
if (!el) return null;
|
|
19521
19221
|
const r2 = el.getBoundingClientRect();
|
|
19522
19222
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19523
19223
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19524
19224
|
}
|
|
19525
|
-
function
|
|
19526
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19527
|
-
}
|
|
19528
|
-
function readStripRect(ref) {
|
|
19529
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19530
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19531
|
-
}
|
|
19532
|
-
function useLiveItemRect(ref, strip = false) {
|
|
19225
|
+
function useLiveItemRect(ref) {
|
|
19533
19226
|
const [rect, setRect] = (0, import_react13.useState)(null);
|
|
19534
19227
|
(0, import_react13.useEffect)(() => {
|
|
19535
19228
|
if (!ref) {
|
|
@@ -19537,7 +19230,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19537
19230
|
return;
|
|
19538
19231
|
}
|
|
19539
19232
|
const update = () => {
|
|
19540
|
-
const next =
|
|
19233
|
+
const next = readRect2(ref);
|
|
19541
19234
|
setRect(
|
|
19542
19235
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19543
19236
|
);
|
|
@@ -19552,49 +19245,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19552
19245
|
window.removeEventListener("resize", update);
|
|
19553
19246
|
clearInterval(interval);
|
|
19554
19247
|
};
|
|
19555
|
-
}, [ref?.sectionId, ref?.index
|
|
19248
|
+
}, [ref?.sectionId, ref?.index]);
|
|
19556
19249
|
return rect;
|
|
19557
19250
|
}
|
|
19558
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
19559
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19560
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19561
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
19562
|
-
const slotRef = (0, import_react13.useRef)(null);
|
|
19563
|
-
const [shift, setShift] = (0, import_react13.useState)(0);
|
|
19564
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
19565
|
-
(0, import_react13.useLayoutEffect)(() => {
|
|
19566
|
-
const slot = slotRef.current;
|
|
19567
|
-
if (!slot) return;
|
|
19568
|
-
const clamp = () => {
|
|
19569
|
-
const w = slot.offsetWidth;
|
|
19570
|
-
if (w <= 0) return;
|
|
19571
|
-
const half = w / 2;
|
|
19572
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19573
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19574
|
-
};
|
|
19575
|
-
clamp();
|
|
19576
|
-
const ro = new ResizeObserver(clamp);
|
|
19577
|
-
ro.observe(slot);
|
|
19578
|
-
return () => ro.disconnect();
|
|
19579
|
-
}, [centerX, children]);
|
|
19580
|
-
const mobile = window.innerWidth <= 480;
|
|
19581
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19582
|
-
"div",
|
|
19583
|
-
{
|
|
19584
|
-
ref: slotRef,
|
|
19585
|
-
"data-ohw-bridge": "",
|
|
19586
|
-
"data-ohw-item-interaction": "",
|
|
19587
|
-
className: "pointer-events-auto fixed",
|
|
19588
|
-
style: {
|
|
19589
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19590
|
-
left: centerX + shift,
|
|
19591
|
-
transform: "translate(-50%, -100%)",
|
|
19592
|
-
zIndex: 2147483645
|
|
19593
|
-
},
|
|
19594
|
-
children
|
|
19595
|
-
}
|
|
19596
|
-
);
|
|
19597
|
-
}
|
|
19598
19251
|
function requestValidateTree(postToParent2, tree) {
|
|
19599
19252
|
return new Promise((resolve) => {
|
|
19600
19253
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19631,72 +19284,116 @@ function requestAssetPick(postToParent2) {
|
|
|
19631
19284
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19632
19285
|
});
|
|
19633
19286
|
}
|
|
19634
|
-
function
|
|
19287
|
+
function Pill({
|
|
19635
19288
|
label,
|
|
19636
19289
|
onClick,
|
|
19637
|
-
disabled
|
|
19638
|
-
active
|
|
19639
|
-
children
|
|
19640
|
-
}) {
|
|
19641
|
-
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
|
|
19642
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
19643
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
19644
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
19645
|
-
] });
|
|
19646
|
-
}
|
|
19647
|
-
function ToolbarSeparator() {
|
|
19648
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
19649
|
-
}
|
|
19650
|
-
function OptionMenu({
|
|
19651
|
-
label,
|
|
19652
|
-
value,
|
|
19653
|
-
options,
|
|
19654
|
-
onChange
|
|
19290
|
+
disabled,
|
|
19291
|
+
active
|
|
19655
19292
|
}) {
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19294
|
+
"button",
|
|
19295
|
+
{
|
|
19296
|
+
type: "button",
|
|
19297
|
+
onClick,
|
|
19298
|
+
disabled,
|
|
19299
|
+
style: {
|
|
19300
|
+
height: 28,
|
|
19301
|
+
padding: "0 10px",
|
|
19302
|
+
display: "inline-flex",
|
|
19303
|
+
alignItems: "center",
|
|
19304
|
+
gap: 4,
|
|
19305
|
+
borderRadius: 999,
|
|
19306
|
+
border: "none",
|
|
19307
|
+
cursor: disabled ? "default" : "pointer",
|
|
19308
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19309
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19310
|
+
opacity: disabled ? 0.4 : 1,
|
|
19311
|
+
fontSize: 12,
|
|
19312
|
+
lineHeight: "16px",
|
|
19313
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19314
|
+
whiteSpace: "nowrap",
|
|
19315
|
+
flex: "0 0 auto"
|
|
19316
|
+
},
|
|
19317
|
+
children: label
|
|
19318
|
+
}
|
|
19319
|
+
);
|
|
19320
|
+
}
|
|
19321
|
+
function AltInput({ value, onCommit }) {
|
|
19322
|
+
const [draft, setDraft] = (0, import_react13.useState)(value);
|
|
19323
|
+
(0, import_react13.useEffect)(() => setDraft(value), [value]);
|
|
19324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19325
|
+
"div",
|
|
19326
|
+
{
|
|
19327
|
+
style: {
|
|
19328
|
+
display: "flex",
|
|
19329
|
+
alignItems: "center",
|
|
19330
|
+
gap: 6,
|
|
19331
|
+
height: 28,
|
|
19332
|
+
padding: "0 12px",
|
|
19333
|
+
borderRadius: 999,
|
|
19334
|
+
background: "#ffffff",
|
|
19335
|
+
width: "100%",
|
|
19336
|
+
maxWidth: 260,
|
|
19337
|
+
boxSizing: "border-box"
|
|
19338
|
+
},
|
|
19339
|
+
children: [
|
|
19340
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19341
|
+
"span",
|
|
19676
19342
|
{
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
)
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19343
|
+
style: {
|
|
19344
|
+
flex: "0 0 auto",
|
|
19345
|
+
color: OHW_BLUE_DARK,
|
|
19346
|
+
fontSize: 10,
|
|
19347
|
+
fontWeight: 700,
|
|
19348
|
+
textTransform: "uppercase",
|
|
19349
|
+
letterSpacing: 0.4
|
|
19350
|
+
},
|
|
19351
|
+
children: "Alt"
|
|
19352
|
+
}
|
|
19353
|
+
),
|
|
19354
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19355
|
+
"input",
|
|
19356
|
+
{
|
|
19357
|
+
type: "text",
|
|
19358
|
+
value: draft,
|
|
19359
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19360
|
+
onBlur: () => {
|
|
19361
|
+
if (draft !== value) onCommit(draft);
|
|
19362
|
+
},
|
|
19363
|
+
onKeyDown: (e) => {
|
|
19364
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19365
|
+
if (e.key === "Escape") {
|
|
19366
|
+
setDraft(value);
|
|
19367
|
+
e.currentTarget.blur();
|
|
19368
|
+
}
|
|
19369
|
+
},
|
|
19370
|
+
placeholder: "Describe this image",
|
|
19371
|
+
"aria-label": "Image alt text",
|
|
19372
|
+
style: {
|
|
19373
|
+
flex: 1,
|
|
19374
|
+
minWidth: 0,
|
|
19375
|
+
border: "none",
|
|
19376
|
+
outline: "none",
|
|
19377
|
+
background: "transparent",
|
|
19378
|
+
fontSize: 12,
|
|
19379
|
+
lineHeight: "16px",
|
|
19380
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19381
|
+
color: "#1f2937"
|
|
19382
|
+
}
|
|
19383
|
+
}
|
|
19384
|
+
)
|
|
19385
|
+
]
|
|
19386
|
+
}
|
|
19387
|
+
);
|
|
19691
19388
|
}
|
|
19692
19389
|
var VARIANTS = [
|
|
19693
19390
|
{ value: "logos", label: "Logos" },
|
|
19694
19391
|
{ value: "reel", label: "Reel" }
|
|
19695
19392
|
];
|
|
19696
19393
|
var ALIGNS = [
|
|
19697
|
-
{ value: "left", label: "
|
|
19698
|
-
{ value: "center", label: "
|
|
19699
|
-
{ value: "right", label: "
|
|
19394
|
+
{ value: "left", label: "Left" },
|
|
19395
|
+
{ value: "center", label: "Center" },
|
|
19396
|
+
{ value: "right", label: "Right" }
|
|
19700
19397
|
];
|
|
19701
19398
|
var HOVERS = [
|
|
19702
19399
|
{ value: "none", label: "None" },
|
|
@@ -19704,104 +19401,104 @@ var HOVERS = [
|
|
|
19704
19401
|
{ value: "zoom", label: "Zoom" },
|
|
19705
19402
|
{ value: "fade", label: "Fade" }
|
|
19706
19403
|
];
|
|
19404
|
+
var TREATMENTS = [
|
|
19405
|
+
{ value: "color", label: "Color" },
|
|
19406
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
19407
|
+
];
|
|
19707
19408
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
19708
|
-
function
|
|
19709
|
-
|
|
19710
|
-
linkTarget,
|
|
19711
|
-
onClose,
|
|
19712
|
-
onSave
|
|
19713
|
-
}) {
|
|
19714
|
-
const [draft, setDraft] = (0, import_react13.useState)(href);
|
|
19715
|
-
const [newTab, setNewTab] = (0, import_react13.useState)(linkTarget !== "same-tab");
|
|
19409
|
+
function LinkInput({ value, onCommit }) {
|
|
19410
|
+
const [draft, setDraft] = (0, import_react13.useState)(value);
|
|
19716
19411
|
const [invalid, setInvalid] = (0, import_react13.useState)(false);
|
|
19717
|
-
|
|
19412
|
+
(0, import_react13.useEffect)(() => {
|
|
19413
|
+
setDraft(value);
|
|
19414
|
+
setInvalid(false);
|
|
19415
|
+
}, [value]);
|
|
19416
|
+
const commit2 = () => {
|
|
19718
19417
|
const next = draft.trim();
|
|
19719
|
-
if (next
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
19724
|
-
onClose();
|
|
19418
|
+
if (next === value) return setInvalid(false);
|
|
19419
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
19420
|
+
setInvalid(false);
|
|
19421
|
+
onCommit(next);
|
|
19725
19422
|
};
|
|
19726
|
-
return /* @__PURE__ */ (0,
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
"
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
"
|
|
19745
|
-
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
|
|
19752
|
-
|
|
19753
|
-
|
|
19754
|
-
|
|
19755
|
-
|
|
19756
|
-
|
|
19757
|
-
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19785
|
-
|
|
19786
|
-
|
|
19787
|
-
|
|
19788
|
-
|
|
19789
|
-
|
|
19790
|
-
|
|
19423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19424
|
+
"div",
|
|
19425
|
+
{
|
|
19426
|
+
style: {
|
|
19427
|
+
display: "flex",
|
|
19428
|
+
alignItems: "center",
|
|
19429
|
+
gap: 6,
|
|
19430
|
+
height: 28,
|
|
19431
|
+
padding: "0 12px",
|
|
19432
|
+
borderRadius: 999,
|
|
19433
|
+
background: "#ffffff",
|
|
19434
|
+
width: "100%",
|
|
19435
|
+
maxWidth: 260,
|
|
19436
|
+
boxSizing: "border-box",
|
|
19437
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19438
|
+
},
|
|
19439
|
+
children: [
|
|
19440
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19441
|
+
"span",
|
|
19442
|
+
{
|
|
19443
|
+
style: {
|
|
19444
|
+
flex: "0 0 auto",
|
|
19445
|
+
color: OHW_BLUE_DARK,
|
|
19446
|
+
fontSize: 10,
|
|
19447
|
+
fontWeight: 700,
|
|
19448
|
+
textTransform: "uppercase",
|
|
19449
|
+
letterSpacing: 0.4
|
|
19450
|
+
},
|
|
19451
|
+
children: "Link"
|
|
19452
|
+
}
|
|
19453
|
+
),
|
|
19454
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19455
|
+
"input",
|
|
19456
|
+
{
|
|
19457
|
+
type: "text",
|
|
19458
|
+
inputMode: "url",
|
|
19459
|
+
value: draft,
|
|
19460
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19461
|
+
onBlur: commit2,
|
|
19462
|
+
onKeyDown: (e) => {
|
|
19463
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19464
|
+
if (e.key === "Escape") {
|
|
19465
|
+
setDraft(value);
|
|
19466
|
+
setInvalid(false);
|
|
19467
|
+
e.currentTarget.blur();
|
|
19468
|
+
}
|
|
19469
|
+
},
|
|
19470
|
+
placeholder: "https://example.com",
|
|
19471
|
+
"aria-label": "Image link URL",
|
|
19472
|
+
"aria-invalid": invalid,
|
|
19473
|
+
style: {
|
|
19474
|
+
flex: 1,
|
|
19475
|
+
minWidth: 0,
|
|
19476
|
+
border: "none",
|
|
19477
|
+
outline: "none",
|
|
19478
|
+
background: "transparent",
|
|
19479
|
+
fontSize: 12,
|
|
19480
|
+
lineHeight: "16px",
|
|
19481
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19482
|
+
color: "#1f2937"
|
|
19483
|
+
}
|
|
19484
|
+
}
|
|
19485
|
+
)
|
|
19486
|
+
]
|
|
19487
|
+
}
|
|
19488
|
+
);
|
|
19791
19489
|
}
|
|
19792
19490
|
function MediaStripToolbar({
|
|
19793
19491
|
entry,
|
|
19794
19492
|
index,
|
|
19795
19493
|
pending,
|
|
19796
19494
|
error,
|
|
19797
|
-
itemEditOn,
|
|
19798
|
-
onToggleItemEdit,
|
|
19799
19495
|
onSetVariant,
|
|
19800
19496
|
onSetAlign,
|
|
19801
19497
|
onSetHover,
|
|
19802
19498
|
onSetTreatment,
|
|
19803
19499
|
onResize,
|
|
19804
|
-
|
|
19500
|
+
onSetAlt,
|
|
19501
|
+
onSetLink,
|
|
19805
19502
|
onAddItem,
|
|
19806
19503
|
onRemoveItem,
|
|
19807
19504
|
onChangeImage,
|
|
@@ -19810,102 +19507,81 @@ function MediaStripToolbar({
|
|
|
19810
19507
|
}) {
|
|
19811
19508
|
const items = mediaStripItems(entry.tree);
|
|
19812
19509
|
const itemCount = items.length;
|
|
19510
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
19511
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
19512
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19813
19513
|
const slots = findMediaStripSlots(entry.tree);
|
|
19814
19514
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19815
19515
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
19816
19516
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
19817
19517
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
19818
19518
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19819
|
-
const
|
|
19820
|
-
const
|
|
19821
|
-
|
|
19519
|
+
const isMobile = window.innerWidth <= 480;
|
|
19520
|
+
const rowStyle = isMobile ? {
|
|
19521
|
+
display: "flex",
|
|
19522
|
+
gap: 6,
|
|
19523
|
+
flexWrap: "nowrap",
|
|
19524
|
+
justifyContent: "center",
|
|
19525
|
+
overflowX: "auto",
|
|
19526
|
+
WebkitOverflowScrolling: "touch",
|
|
19527
|
+
width: "100%",
|
|
19528
|
+
scrollbarWidth: "none"
|
|
19529
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19822
19531
|
"div",
|
|
19823
19532
|
{
|
|
19824
19533
|
"data-ohw-bridge": "",
|
|
19825
19534
|
"data-ohw-toolbar": "",
|
|
19826
19535
|
onMouseDown: (e) => e.stopPropagation(),
|
|
19827
|
-
|
|
19828
|
-
|
|
19536
|
+
style: {
|
|
19537
|
+
display: "flex",
|
|
19538
|
+
flexDirection: "column",
|
|
19539
|
+
gap: 6,
|
|
19540
|
+
alignItems: "center",
|
|
19541
|
+
background: OHW_BLUE,
|
|
19542
|
+
padding: 8,
|
|
19543
|
+
borderRadius: 12,
|
|
19544
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19545
|
+
pointerEvents: pending ? "none" : "auto",
|
|
19546
|
+
opacity: pending ? 0.6 : 1,
|
|
19547
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19548
|
+
},
|
|
19829
19549
|
children: [
|
|
19830
|
-
/* @__PURE__ */ (0,
|
|
19831
|
-
|
|
19832
|
-
{
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
) }),
|
|
19863
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
19864
|
-
] }),
|
|
19865
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19866
|
-
/* @__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" } }) }),
|
|
19867
|
-
/* @__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" } }) }),
|
|
19868
|
-
/* @__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" } }) }),
|
|
19869
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19870
|
-
ToolbarAction,
|
|
19871
|
-
{
|
|
19872
|
-
label: gatedLabel("Move right"),
|
|
19873
|
-
onClick: onMoveRight,
|
|
19874
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
19875
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
|
|
19876
|
-
}
|
|
19877
|
-
),
|
|
19878
|
-
/* @__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" } }) }),
|
|
19879
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19880
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
19881
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
19882
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19883
|
-
ToolbarAction,
|
|
19884
|
-
{
|
|
19885
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
19886
|
-
active: treatment === "grayscale",
|
|
19887
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
19888
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
19889
|
-
}
|
|
19890
|
-
),
|
|
19891
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19892
|
-
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)),
|
|
19893
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19894
|
-
/* @__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" } }) }),
|
|
19895
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
19896
|
-
sizeValue,
|
|
19897
|
-
"px"
|
|
19898
|
-
] }),
|
|
19899
|
-
/* @__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" } }) }),
|
|
19900
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19901
|
-
/* @__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" } }) })
|
|
19902
|
-
]
|
|
19903
|
-
}
|
|
19904
|
-
),
|
|
19905
|
-
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 })
|
|
19550
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19551
|
+
VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
19552
|
+
ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
19553
|
+
] }),
|
|
19554
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19555
|
+
HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
19556
|
+
TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
19557
|
+
] }),
|
|
19558
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
19559
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
19560
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
19561
|
+
sizeValue,
|
|
19562
|
+
"px"
|
|
19563
|
+
] }),
|
|
19564
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
|
|
19565
|
+
] }),
|
|
19566
|
+
/* @__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 }) }),
|
|
19567
|
+
/* @__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) }) }),
|
|
19568
|
+
currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19569
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
19570
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
19571
|
+
] }),
|
|
19572
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19573
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
19574
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
19575
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
19576
|
+
] }),
|
|
19577
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19578
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
19579
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
19580
|
+
] }),
|
|
19581
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
19906
19582
|
]
|
|
19907
19583
|
}
|
|
19908
|
-
)
|
|
19584
|
+
);
|
|
19909
19585
|
}
|
|
19910
19586
|
function findMediaStripSlots(tree) {
|
|
19911
19587
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -19924,23 +19600,31 @@ function AiMediaStripOverlay({
|
|
|
19924
19600
|
}) {
|
|
19925
19601
|
const [hover, setHover] = (0, import_react13.useState)(null);
|
|
19926
19602
|
const [active, setActive] = (0, import_react13.useState)(null);
|
|
19927
|
-
const [itemEditOn, setItemEditOn] = (0, import_react13.useState)(false);
|
|
19928
|
-
const [linkOpen, setLinkOpen] = (0, import_react13.useState)(false);
|
|
19929
19603
|
const [pending, setPending] = (0, import_react13.useState)(false);
|
|
19930
19604
|
const [error, setError] = (0, import_react13.useState)(null);
|
|
19931
19605
|
const activeRef = (0, import_react13.useRef)(null);
|
|
19932
19606
|
activeRef.current = active;
|
|
19933
|
-
const linkOpenRef = (0, import_react13.useRef)(false);
|
|
19934
|
-
linkOpenRef.current = linkOpen;
|
|
19935
19607
|
(0, import_react13.useEffect)(() => {
|
|
19936
19608
|
const onMove = (e) => {
|
|
19937
|
-
const ref = itemRefFromTarget(e.target);
|
|
19938
19609
|
const t = e.target;
|
|
19939
|
-
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
|
|
19610
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19611
|
+
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]")) {
|
|
19612
|
+
return;
|
|
19613
|
+
}
|
|
19614
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
19615
|
+
if (!itemEl) {
|
|
19616
|
+
setHover(null);
|
|
19617
|
+
return;
|
|
19618
|
+
}
|
|
19619
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
19620
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19621
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19622
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19623
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
19624
|
+
setHover(null);
|
|
19625
|
+
return;
|
|
19626
|
+
}
|
|
19627
|
+
setHover({ sectionId, index });
|
|
19944
19628
|
};
|
|
19945
19629
|
const onLeave = () => setHover(null);
|
|
19946
19630
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -19952,25 +19636,23 @@ function AiMediaStripOverlay({
|
|
|
19952
19636
|
}, []);
|
|
19953
19637
|
(0, import_react13.useEffect)(() => {
|
|
19954
19638
|
const onClick = (e) => {
|
|
19639
|
+
const current = activeRef.current;
|
|
19640
|
+
if (!current) return;
|
|
19955
19641
|
const t = e.target;
|
|
19956
|
-
if (!(t instanceof
|
|
19957
|
-
if (t.closest(
|
|
19958
|
-
const
|
|
19959
|
-
if (
|
|
19960
|
-
|
|
19961
|
-
setItemEditOn(false);
|
|
19642
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19643
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
19644
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
19645
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
19646
|
+
setActive(null);
|
|
19962
19647
|
setError(null);
|
|
19963
|
-
setActive(ref);
|
|
19964
19648
|
};
|
|
19965
19649
|
document.addEventListener("click", onClick, true);
|
|
19966
19650
|
return () => document.removeEventListener("click", onClick, true);
|
|
19967
|
-
}, [
|
|
19651
|
+
}, []);
|
|
19968
19652
|
(0, import_react13.useEffect)(() => {
|
|
19969
19653
|
const onBlur = () => {
|
|
19970
19654
|
if (!activeRef.current) return;
|
|
19971
19655
|
setActive(null);
|
|
19972
|
-
setItemEditOn(false);
|
|
19973
|
-
setLinkOpen(false);
|
|
19974
19656
|
setError(null);
|
|
19975
19657
|
};
|
|
19976
19658
|
window.addEventListener("blur", onBlur);
|
|
@@ -19980,10 +19662,7 @@ function AiMediaStripOverlay({
|
|
|
19980
19662
|
const onKeyDown = (e) => {
|
|
19981
19663
|
if (e.key !== "Escape") return;
|
|
19982
19664
|
if (!activeRef.current) return;
|
|
19983
|
-
if (linkOpenRef.current) return;
|
|
19984
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
19985
19665
|
setActive(null);
|
|
19986
|
-
setItemEditOn(false);
|
|
19987
19666
|
setError(null);
|
|
19988
19667
|
};
|
|
19989
19668
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -20017,133 +19696,137 @@ function AiMediaStripOverlay({
|
|
|
20017
19696
|
tree: nextTree,
|
|
20018
19697
|
label: entry.label,
|
|
20019
19698
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
20020
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
20021
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
20022
|
-
// on every edit reads as the section jumping around.
|
|
20023
|
-
skipScrollIntoView: true
|
|
19699
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
20024
19700
|
});
|
|
20025
19701
|
return true;
|
|
20026
19702
|
},
|
|
20027
19703
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
20028
19704
|
);
|
|
20029
19705
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
19706
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
20030
19707
|
const activeItemRect = useLiveItemRect(active);
|
|
20031
|
-
const
|
|
20032
|
-
const
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
19708
|
+
const TOOLBAR_APPROX_H = 170;
|
|
19709
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
19710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
19711
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19712
|
+
"button",
|
|
19713
|
+
{
|
|
19714
|
+
type: "button",
|
|
19715
|
+
"data-ohw-toolbar": "",
|
|
19716
|
+
onClick: () => {
|
|
19717
|
+
clearInteractionChromeRef.current();
|
|
19718
|
+
setActive(hover);
|
|
19719
|
+
},
|
|
19720
|
+
"aria-label": "Configure media item",
|
|
19721
|
+
style: {
|
|
19722
|
+
position: "fixed",
|
|
19723
|
+
top: hoverHandleRect.top + 8,
|
|
19724
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
19725
|
+
width: 28,
|
|
19726
|
+
height: 28,
|
|
19727
|
+
borderRadius: 8,
|
|
19728
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
19729
|
+
background: "#ffffff",
|
|
19730
|
+
color: PRIMARY3,
|
|
19731
|
+
display: "flex",
|
|
19732
|
+
alignItems: "center",
|
|
19733
|
+
justifyContent: "center",
|
|
19734
|
+
cursor: "pointer",
|
|
19735
|
+
zIndex: 2147483643,
|
|
19736
|
+
fontSize: 14,
|
|
19737
|
+
fontWeight: 700
|
|
19738
|
+
},
|
|
19739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
19740
|
+
}
|
|
19741
|
+
),
|
|
19742
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19743
|
+
ItemInteractionLayer,
|
|
19744
|
+
{
|
|
19745
|
+
rect: activeItemRect,
|
|
19746
|
+
state: toolbarState,
|
|
19747
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19748
|
+
MediaStripToolbar,
|
|
19749
|
+
{
|
|
19750
|
+
entry: activeEntry,
|
|
19751
|
+
index: active.index,
|
|
19752
|
+
pending,
|
|
19753
|
+
error,
|
|
19754
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19755
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19756
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19757
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19758
|
+
onResize: (delta) => {
|
|
19759
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19760
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19761
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19762
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19763
|
+
},
|
|
19764
|
+
onSetAlt: (alt) => {
|
|
19765
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
19766
|
+
},
|
|
19767
|
+
onSetLink: (href, linkTarget) => {
|
|
20065
19768
|
void runMutation(
|
|
20066
19769
|
active.sectionId,
|
|
20067
|
-
(tree) =>
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
19770
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19771
|
+
);
|
|
19772
|
+
},
|
|
19773
|
+
onAddItem: () => {
|
|
19774
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19775
|
+
if (!picked) return;
|
|
19776
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19777
|
+
void runMutation(
|
|
19778
|
+
active.sectionId,
|
|
19779
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19780
|
+
{ [picked.assetId]: picked.url }
|
|
19781
|
+
).then((applied) => {
|
|
19782
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19783
|
+
});
|
|
20071
19784
|
});
|
|
20072
|
-
}
|
|
20073
|
-
|
|
20074
|
-
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
20078
|
-
|
|
20079
|
-
|
|
20080
|
-
|
|
19785
|
+
},
|
|
19786
|
+
onChangeImage: () => {
|
|
19787
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19788
|
+
if (!picked) return;
|
|
19789
|
+
void runMutation(
|
|
19790
|
+
active.sectionId,
|
|
19791
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
19792
|
+
{ [picked.assetId]: picked.url }
|
|
19793
|
+
);
|
|
19794
|
+
});
|
|
19795
|
+
},
|
|
19796
|
+
onRemoveItem: () => {
|
|
19797
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19798
|
+
(applied) => {
|
|
19799
|
+
if (applied) setActive(null);
|
|
19800
|
+
}
|
|
20081
19801
|
);
|
|
20082
|
-
}
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
|
|
20088
|
-
|
|
20089
|
-
|
|
20090
|
-
|
|
20091
|
-
|
|
20092
|
-
|
|
20093
|
-
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20097
|
-
},
|
|
20098
|
-
onMoveRight: () => {
|
|
20099
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
20100
|
-
(applied) => {
|
|
20101
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20102
|
-
}
|
|
20103
|
-
);
|
|
20104
|
-
}
|
|
20105
|
-
}
|
|
20106
|
-
) }),
|
|
20107
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20108
|
-
"div",
|
|
20109
|
-
{
|
|
20110
|
-
"data-ohw-bridge": "",
|
|
20111
|
-
"data-ohw-item-interaction": "",
|
|
20112
|
-
"aria-hidden": true,
|
|
20113
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
20114
|
-
style: {
|
|
20115
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
20116
|
-
left: activeItemRect.left - 5,
|
|
20117
|
-
background: PRIMARY3,
|
|
20118
|
-
zIndex: 2147483644
|
|
20119
|
-
},
|
|
20120
|
-
children: "Media item"
|
|
20121
|
-
}
|
|
20122
|
-
),
|
|
20123
|
-
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20124
|
-
LinkModal,
|
|
20125
|
-
{
|
|
20126
|
-
href: activeHref,
|
|
20127
|
-
linkTarget: activeTarget,
|
|
20128
|
-
onClose: () => setLinkOpen(false),
|
|
20129
|
-
onSave: (href, linkTarget) => {
|
|
20130
|
-
void runMutation(
|
|
20131
|
-
active.sectionId,
|
|
20132
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
20133
|
-
);
|
|
19802
|
+
},
|
|
19803
|
+
onMoveLeft: () => {
|
|
19804
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
19805
|
+
(applied) => {
|
|
19806
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
19807
|
+
}
|
|
19808
|
+
);
|
|
19809
|
+
},
|
|
19810
|
+
onMoveRight: () => {
|
|
19811
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19812
|
+
(applied) => {
|
|
19813
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19814
|
+
}
|
|
19815
|
+
);
|
|
19816
|
+
}
|
|
20134
19817
|
}
|
|
20135
|
-
|
|
20136
|
-
|
|
20137
|
-
|
|
19818
|
+
)
|
|
19819
|
+
}
|
|
19820
|
+
)
|
|
20138
19821
|
] });
|
|
20139
19822
|
}
|
|
20140
19823
|
|
|
20141
19824
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
20142
19825
|
var import_react14 = require("react");
|
|
20143
|
-
var
|
|
20144
|
-
var
|
|
19826
|
+
var import_lucide_react9 = require("lucide-react");
|
|
19827
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
20145
19828
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
20146
|
-
var
|
|
19829
|
+
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]";
|
|
20147
19830
|
function findPricingCardElement(sectionId, index) {
|
|
20148
19831
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
20149
19832
|
if (!sectionEl2) return null;
|
|
@@ -20155,7 +19838,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
20155
19838
|
}
|
|
20156
19839
|
function cardRefFromTarget(target) {
|
|
20157
19840
|
if (!(target instanceof Element)) return null;
|
|
20158
|
-
if (target.closest(
|
|
19841
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
20159
19842
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
20160
19843
|
if (!cardEl) return null;
|
|
20161
19844
|
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
@@ -20165,21 +19848,21 @@ function cardRefFromTarget(target) {
|
|
|
20165
19848
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
20166
19849
|
return { sectionId, index };
|
|
20167
19850
|
}
|
|
20168
|
-
function
|
|
19851
|
+
function sameRef(a, b) {
|
|
20169
19852
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
20170
19853
|
}
|
|
20171
|
-
function
|
|
19854
|
+
function rectOf(el) {
|
|
20172
19855
|
if (!el) return null;
|
|
20173
19856
|
const r2 = el.getBoundingClientRect();
|
|
20174
19857
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
20175
19858
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
20176
19859
|
}
|
|
20177
19860
|
function readRect3(ref) {
|
|
20178
|
-
return
|
|
19861
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
20179
19862
|
}
|
|
20180
19863
|
function readGridRect(ref) {
|
|
20181
19864
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
20182
|
-
return
|
|
19865
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
20183
19866
|
}
|
|
20184
19867
|
function useLiveCardRect(ref, grid = false) {
|
|
20185
19868
|
const [rect, setRect] = (0, import_react14.useState)(null);
|
|
@@ -20209,7 +19892,7 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
20209
19892
|
}
|
|
20210
19893
|
var TOOLBAR_GRID_GAP = 52;
|
|
20211
19894
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
20212
|
-
var
|
|
19895
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
20213
19896
|
function GridToolbarSlot({ gridRect, children }) {
|
|
20214
19897
|
const slotRef = (0, import_react14.useRef)(null);
|
|
20215
19898
|
const [shift, setShift] = (0, import_react14.useState)(0);
|
|
@@ -20221,7 +19904,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20221
19904
|
const w = slot.offsetWidth;
|
|
20222
19905
|
if (w <= 0) return;
|
|
20223
19906
|
const half = w / 2;
|
|
20224
|
-
const clamped = Math.max(
|
|
19907
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
20225
19908
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
20226
19909
|
};
|
|
20227
19910
|
clamp();
|
|
@@ -20230,7 +19913,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20230
19913
|
return () => ro.disconnect();
|
|
20231
19914
|
}, [centerX, children]);
|
|
20232
19915
|
const mobile = window.innerWidth <= 480;
|
|
20233
|
-
return /* @__PURE__ */ (0,
|
|
19916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20234
19917
|
"div",
|
|
20235
19918
|
{
|
|
20236
19919
|
ref: slotRef,
|
|
@@ -20265,7 +19948,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
20265
19948
|
});
|
|
20266
19949
|
}
|
|
20267
19950
|
function StyleSwatch({ style }) {
|
|
20268
|
-
return /* @__PURE__ */ (0,
|
|
19951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20269
19952
|
"span",
|
|
20270
19953
|
{
|
|
20271
19954
|
"aria-hidden": true,
|
|
@@ -20279,35 +19962,35 @@ function StyleSwatch({ style }) {
|
|
|
20279
19962
|
);
|
|
20280
19963
|
}
|
|
20281
19964
|
function ButtonGlyph() {
|
|
20282
|
-
return /* @__PURE__ */ (0,
|
|
20283
|
-
/* @__PURE__ */ (0,
|
|
20284
|
-
/* @__PURE__ */ (0,
|
|
19965
|
+
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: [
|
|
19966
|
+
/* @__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" }),
|
|
19967
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20285
19968
|
] });
|
|
20286
19969
|
}
|
|
20287
19970
|
function FeatureGlyph({ mode }) {
|
|
20288
|
-
return /* @__PURE__ */ (0,
|
|
20289
|
-
/* @__PURE__ */ (0,
|
|
20290
|
-
/* @__PURE__ */ (0,
|
|
20291
|
-
/* @__PURE__ */ (0,
|
|
20292
|
-
/* @__PURE__ */ (0,
|
|
20293
|
-
/* @__PURE__ */ (0,
|
|
20294
|
-
mode === "add" && /* @__PURE__ */ (0,
|
|
19971
|
+
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: [
|
|
19972
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19973
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
19974
|
+
/* @__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" }),
|
|
19975
|
+
/* @__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" }),
|
|
19976
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
19977
|
+
mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20295
19978
|
] });
|
|
20296
19979
|
}
|
|
20297
|
-
function
|
|
19980
|
+
function ToolbarAction({
|
|
20298
19981
|
label,
|
|
20299
19982
|
onClick,
|
|
20300
19983
|
disabled = false,
|
|
20301
19984
|
children
|
|
20302
19985
|
}) {
|
|
20303
|
-
const button = /* @__PURE__ */ (0,
|
|
20304
|
-
return /* @__PURE__ */ (0,
|
|
20305
|
-
/* @__PURE__ */ (0,
|
|
20306
|
-
/* @__PURE__ */ (0,
|
|
19986
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
19987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
19988
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
19989
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
20307
19990
|
] });
|
|
20308
19991
|
}
|
|
20309
|
-
function
|
|
20310
|
-
return /* @__PURE__ */ (0,
|
|
19992
|
+
function ToolbarSeparator() {
|
|
19993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
20311
19994
|
}
|
|
20312
19995
|
function CardStyleMenu({
|
|
20313
19996
|
value,
|
|
@@ -20315,7 +19998,7 @@ function CardStyleMenu({
|
|
|
20315
19998
|
disabled = false
|
|
20316
19999
|
}) {
|
|
20317
20000
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
20318
|
-
const trigger = /* @__PURE__ */ (0,
|
|
20001
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20319
20002
|
"button",
|
|
20320
20003
|
{
|
|
20321
20004
|
type: "button",
|
|
@@ -20326,28 +20009,28 @@ function CardStyleMenu({
|
|
|
20326
20009
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
20327
20010
|
),
|
|
20328
20011
|
children: [
|
|
20329
|
-
/* @__PURE__ */ (0,
|
|
20330
|
-
/* @__PURE__ */ (0,
|
|
20331
|
-
/* @__PURE__ */ (0,
|
|
20012
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
|
|
20013
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
|
|
20014
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
|
|
20332
20015
|
]
|
|
20333
20016
|
}
|
|
20334
20017
|
);
|
|
20335
20018
|
if (disabled) {
|
|
20336
|
-
return /* @__PURE__ */ (0,
|
|
20337
|
-
/* @__PURE__ */ (0,
|
|
20338
|
-
/* @__PURE__ */ (0,
|
|
20339
|
-
/* @__PURE__ */ (0,
|
|
20340
|
-
/* @__PURE__ */ (0,
|
|
20019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20020
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
20021
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
20022
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
|
|
20023
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
20341
20024
|
] })
|
|
20342
20025
|
] });
|
|
20343
20026
|
}
|
|
20344
|
-
return /* @__PURE__ */ (0,
|
|
20345
|
-
/* @__PURE__ */ (0,
|
|
20346
|
-
/* @__PURE__ */ (0,
|
|
20347
|
-
/* @__PURE__ */ (0,
|
|
20348
|
-
/* @__PURE__ */ (0,
|
|
20027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20028
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
20029
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
|
|
20030
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
20031
|
+
/* @__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) => {
|
|
20349
20032
|
const selected = style.value === value;
|
|
20350
|
-
return /* @__PURE__ */ (0,
|
|
20033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20351
20034
|
DropdownMenuItem,
|
|
20352
20035
|
{
|
|
20353
20036
|
role: "menuitemradio",
|
|
@@ -20355,9 +20038,9 @@ function CardStyleMenu({
|
|
|
20355
20038
|
onSelect: () => onChange(style.value),
|
|
20356
20039
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
20357
20040
|
children: [
|
|
20358
|
-
/* @__PURE__ */ (0,
|
|
20359
|
-
/* @__PURE__ */ (0,
|
|
20360
|
-
selected && /* @__PURE__ */ (0,
|
|
20041
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
|
|
20042
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
|
|
20043
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
|
|
20361
20044
|
]
|
|
20362
20045
|
},
|
|
20363
20046
|
style.value
|
|
@@ -20387,7 +20070,7 @@ function PricingCardToolbar({
|
|
|
20387
20070
|
const style = pricingCardStyle(entry.tree, index);
|
|
20388
20071
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
20389
20072
|
const mobile = window.innerWidth <= 480;
|
|
20390
|
-
return /* @__PURE__ */ (0,
|
|
20073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20391
20074
|
"div",
|
|
20392
20075
|
{
|
|
20393
20076
|
"data-ohw-bridge": "",
|
|
@@ -20399,7 +20082,7 @@ function PricingCardToolbar({
|
|
|
20399
20082
|
),
|
|
20400
20083
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
20401
20084
|
children: [
|
|
20402
|
-
/* @__PURE__ */ (0,
|
|
20085
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20403
20086
|
"div",
|
|
20404
20087
|
{
|
|
20405
20088
|
className: cn(
|
|
@@ -20408,8 +20091,8 @@ function PricingCardToolbar({
|
|
|
20408
20091
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
20409
20092
|
),
|
|
20410
20093
|
children: [
|
|
20411
|
-
/* @__PURE__ */ (0,
|
|
20412
|
-
/* @__PURE__ */ (0,
|
|
20094
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
20095
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20413
20096
|
CustomToolbarButton,
|
|
20414
20097
|
{
|
|
20415
20098
|
type: "button",
|
|
@@ -20417,8 +20100,8 @@ function PricingCardToolbar({
|
|
|
20417
20100
|
"aria-pressed": featuredTag,
|
|
20418
20101
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
20419
20102
|
className: "group size-8",
|
|
20420
|
-
children: /* @__PURE__ */ (0,
|
|
20421
|
-
|
|
20103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20104
|
+
import_lucide_react9.Star,
|
|
20422
20105
|
{
|
|
20423
20106
|
size: 16,
|
|
20424
20107
|
fill: "currentColor",
|
|
@@ -20432,25 +20115,25 @@ function PricingCardToolbar({
|
|
|
20432
20115
|
)
|
|
20433
20116
|
}
|
|
20434
20117
|
) }),
|
|
20435
|
-
/* @__PURE__ */ (0,
|
|
20118
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
20436
20119
|
] }),
|
|
20437
|
-
/* @__PURE__ */ (0,
|
|
20438
|
-
/* @__PURE__ */ (0,
|
|
20439
|
-
/* @__PURE__ */ (0,
|
|
20440
|
-
/* @__PURE__ */ (0,
|
|
20441
|
-
/* @__PURE__ */ (0,
|
|
20442
|
-
/* @__PURE__ */ (0,
|
|
20443
|
-
/* @__PURE__ */ (0,
|
|
20120
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20121
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
20122
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20123
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
|
|
20124
|
+
/* @__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: [
|
|
20125
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
|
|
20126
|
+
/* @__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" })
|
|
20444
20127
|
] }) }),
|
|
20445
|
-
/* @__PURE__ */ (0,
|
|
20446
|
-
/* @__PURE__ */ (0,
|
|
20447
|
-
/* @__PURE__ */ (0,
|
|
20448
|
-
/* @__PURE__ */ (0,
|
|
20449
|
-
/* @__PURE__ */ (0,
|
|
20128
|
+
/* @__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" }) }),
|
|
20129
|
+
/* @__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" }) }),
|
|
20130
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20131
|
+
/* @__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" } }) }),
|
|
20132
|
+
/* @__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" } }) })
|
|
20450
20133
|
]
|
|
20451
20134
|
}
|
|
20452
20135
|
),
|
|
20453
|
-
error && /* @__PURE__ */ (0,
|
|
20136
|
+
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 })
|
|
20454
20137
|
]
|
|
20455
20138
|
}
|
|
20456
20139
|
) });
|
|
@@ -20484,7 +20167,7 @@ function AiPricingCardOverlay({
|
|
|
20484
20167
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20485
20168
|
setHover((prev) => {
|
|
20486
20169
|
const next = ref && !overEditable ? ref : null;
|
|
20487
|
-
return
|
|
20170
|
+
return sameRef(prev, next) ? prev : next;
|
|
20488
20171
|
});
|
|
20489
20172
|
};
|
|
20490
20173
|
const onLeave = () => setHover(null);
|
|
@@ -20499,10 +20182,10 @@ function AiPricingCardOverlay({
|
|
|
20499
20182
|
const onClick = (e) => {
|
|
20500
20183
|
const t = e.target;
|
|
20501
20184
|
if (!(t instanceof Element)) return;
|
|
20502
|
-
if (t.closest(
|
|
20185
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
20503
20186
|
const ref = cardRefFromTarget(t);
|
|
20504
|
-
setActive((prev) =>
|
|
20505
|
-
if (!ref || !
|
|
20187
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
20188
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
20506
20189
|
};
|
|
20507
20190
|
document.addEventListener("click", onClick, true);
|
|
20508
20191
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20567,12 +20250,12 @@ function AiPricingCardOverlay({
|
|
|
20567
20250
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20568
20251
|
const activeCardRect = useLiveCardRect(active);
|
|
20569
20252
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20570
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20571
|
-
return /* @__PURE__ */ (0,
|
|
20572
|
-
hoverRect && /* @__PURE__ */ (0,
|
|
20573
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
20574
|
-
/* @__PURE__ */ (0,
|
|
20575
|
-
/* @__PURE__ */ (0,
|
|
20253
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
20254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
20255
|
+
hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
20256
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
20257
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
20258
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20576
20259
|
PricingCardToolbar,
|
|
20577
20260
|
{
|
|
20578
20261
|
entry: activeEntry,
|
|
@@ -20600,7 +20283,7 @@ function AiPricingCardOverlay({
|
|
|
20600
20283
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20601
20284
|
}
|
|
20602
20285
|
) }),
|
|
20603
|
-
/* @__PURE__ */ (0,
|
|
20286
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20604
20287
|
"div",
|
|
20605
20288
|
{
|
|
20606
20289
|
"data-ohw-bridge": "",
|
|
@@ -20622,7 +20305,7 @@ function AiPricingCardOverlay({
|
|
|
20622
20305
|
|
|
20623
20306
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20624
20307
|
var import_react15 = require("react");
|
|
20625
|
-
var
|
|
20308
|
+
var import_lucide_react10 = require("lucide-react");
|
|
20626
20309
|
|
|
20627
20310
|
// src/lib/ai-video-tree.ts
|
|
20628
20311
|
function resolveVideoBlock(tree, path) {
|
|
@@ -20664,11 +20347,39 @@ function clearVideo(tree, path) {
|
|
|
20664
20347
|
});
|
|
20665
20348
|
}
|
|
20666
20349
|
|
|
20350
|
+
// src/lib/youtube.ts
|
|
20351
|
+
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
20352
|
+
function extractYouTubeId(input) {
|
|
20353
|
+
const trimmed = input.trim();
|
|
20354
|
+
if (!trimmed) return null;
|
|
20355
|
+
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
20356
|
+
let url;
|
|
20357
|
+
try {
|
|
20358
|
+
url = new URL(trimmed);
|
|
20359
|
+
} catch {
|
|
20360
|
+
return null;
|
|
20361
|
+
}
|
|
20362
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
20363
|
+
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
20364
|
+
return null;
|
|
20365
|
+
}
|
|
20366
|
+
let candidate = null;
|
|
20367
|
+
if (host === "youtu.be") {
|
|
20368
|
+
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
20369
|
+
} else if (url.pathname === "/watch") {
|
|
20370
|
+
candidate = url.searchParams.get("v");
|
|
20371
|
+
} else {
|
|
20372
|
+
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
20373
|
+
candidate = match ? match[1] : null;
|
|
20374
|
+
}
|
|
20375
|
+
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
20376
|
+
}
|
|
20377
|
+
|
|
20667
20378
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20668
|
-
var
|
|
20379
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
20669
20380
|
var PRIMARY5 = "#0885FE";
|
|
20670
|
-
var
|
|
20671
|
-
var
|
|
20381
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20382
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
20672
20383
|
function findVideoBlockElement(sectionId, path) {
|
|
20673
20384
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
20674
20385
|
if (!sectionEl2) return null;
|
|
@@ -20728,12 +20439,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
20728
20439
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
20729
20440
|
});
|
|
20730
20441
|
}
|
|
20731
|
-
function
|
|
20442
|
+
function Pill2({
|
|
20732
20443
|
label,
|
|
20733
20444
|
onClick,
|
|
20734
20445
|
disabled
|
|
20735
20446
|
}) {
|
|
20736
|
-
return /* @__PURE__ */ (0,
|
|
20447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20737
20448
|
"button",
|
|
20738
20449
|
{
|
|
20739
20450
|
type: "button",
|
|
@@ -20749,7 +20460,7 @@ function Pill({
|
|
|
20749
20460
|
border: "none",
|
|
20750
20461
|
cursor: disabled ? "default" : "pointer",
|
|
20751
20462
|
background: "#ffffff",
|
|
20752
|
-
color:
|
|
20463
|
+
color: OHW_BLUE_DARK2,
|
|
20753
20464
|
opacity: disabled ? 0.4 : 1,
|
|
20754
20465
|
fontSize: 12,
|
|
20755
20466
|
lineHeight: "16px",
|
|
@@ -20792,8 +20503,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20792
20503
|
onCommit(id);
|
|
20793
20504
|
}
|
|
20794
20505
|
};
|
|
20795
|
-
return /* @__PURE__ */ (0,
|
|
20796
|
-
/* @__PURE__ */ (0,
|
|
20506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20507
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
20797
20508
|
"div",
|
|
20798
20509
|
{
|
|
20799
20510
|
style: {
|
|
@@ -20809,12 +20520,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20809
20520
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20810
20521
|
},
|
|
20811
20522
|
children: [
|
|
20812
|
-
/* @__PURE__ */ (0,
|
|
20523
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20813
20524
|
"span",
|
|
20814
20525
|
{
|
|
20815
20526
|
style: {
|
|
20816
20527
|
flex: "0 0 auto",
|
|
20817
|
-
color:
|
|
20528
|
+
color: OHW_BLUE_DARK2,
|
|
20818
20529
|
fontSize: 10,
|
|
20819
20530
|
lineHeight: "16px",
|
|
20820
20531
|
fontWeight: 700,
|
|
@@ -20824,7 +20535,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20824
20535
|
children: "Video"
|
|
20825
20536
|
}
|
|
20826
20537
|
),
|
|
20827
|
-
/* @__PURE__ */ (0,
|
|
20538
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20828
20539
|
"input",
|
|
20829
20540
|
{
|
|
20830
20541
|
type: "text",
|
|
@@ -20861,7 +20572,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20861
20572
|
]
|
|
20862
20573
|
}
|
|
20863
20574
|
),
|
|
20864
|
-
invalid && /* @__PURE__ */ (0,
|
|
20575
|
+
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." })
|
|
20865
20576
|
] });
|
|
20866
20577
|
}
|
|
20867
20578
|
function VideoToolbar({
|
|
@@ -20871,7 +20582,7 @@ function VideoToolbar({
|
|
|
20871
20582
|
onSetVideoId,
|
|
20872
20583
|
onRemove
|
|
20873
20584
|
}) {
|
|
20874
|
-
return /* @__PURE__ */ (0,
|
|
20585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
20875
20586
|
"div",
|
|
20876
20587
|
{
|
|
20877
20588
|
"data-ohw-bridge": "",
|
|
@@ -20883,7 +20594,7 @@ function VideoToolbar({
|
|
|
20883
20594
|
gap: 6,
|
|
20884
20595
|
alignItems: "center",
|
|
20885
20596
|
width: 280,
|
|
20886
|
-
background:
|
|
20597
|
+
background: OHW_BLUE2,
|
|
20887
20598
|
padding: 8,
|
|
20888
20599
|
borderRadius: 12,
|
|
20889
20600
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20891,9 +20602,9 @@ function VideoToolbar({
|
|
|
20891
20602
|
opacity: pending ? 0.6 : 1
|
|
20892
20603
|
},
|
|
20893
20604
|
children: [
|
|
20894
|
-
/* @__PURE__ */ (0,
|
|
20895
|
-
/* @__PURE__ */ (0,
|
|
20896
|
-
error && /* @__PURE__ */ (0,
|
|
20605
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
20606
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
20607
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20897
20608
|
]
|
|
20898
20609
|
}
|
|
20899
20610
|
);
|
|
@@ -21013,8 +20724,8 @@ function AiVideoOverlay({
|
|
|
21013
20724
|
const activeBlockRect = useLiveBlockRect(active);
|
|
21014
20725
|
const TOOLBAR_APPROX_H = 90;
|
|
21015
20726
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21016
|
-
return /* @__PURE__ */ (0,
|
|
21017
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
20727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
20728
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21018
20729
|
"button",
|
|
21019
20730
|
{
|
|
21020
20731
|
type: "button",
|
|
@@ -21042,15 +20753,15 @@ function AiVideoOverlay({
|
|
|
21042
20753
|
fontSize: 14,
|
|
21043
20754
|
fontWeight: 700
|
|
21044
20755
|
},
|
|
21045
|
-
children: /* @__PURE__ */ (0,
|
|
20756
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21046
20757
|
}
|
|
21047
20758
|
),
|
|
21048
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
20759
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21049
20760
|
ItemInteractionLayer,
|
|
21050
20761
|
{
|
|
21051
20762
|
rect: activeBlockRect,
|
|
21052
20763
|
state: toolbarState,
|
|
21053
|
-
toolbar: /* @__PURE__ */ (0,
|
|
20764
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21054
20765
|
VideoToolbar,
|
|
21055
20766
|
{
|
|
21056
20767
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -21074,7 +20785,7 @@ function AiVideoOverlay({
|
|
|
21074
20785
|
|
|
21075
20786
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21076
20787
|
var import_react16 = require("react");
|
|
21077
|
-
var
|
|
20788
|
+
var import_lucide_react11 = require("lucide-react");
|
|
21078
20789
|
|
|
21079
20790
|
// src/lib/ai-carousel-tree.ts
|
|
21080
20791
|
function isCarouselBlock(node) {
|
|
@@ -21125,10 +20836,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
21125
20836
|
}
|
|
21126
20837
|
|
|
21127
20838
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21128
|
-
var
|
|
20839
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
21129
20840
|
var PRIMARY6 = "#0885FE";
|
|
21130
|
-
var
|
|
21131
|
-
var
|
|
20841
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
20842
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
21132
20843
|
function findCarouselItemElement(sectionId, index) {
|
|
21133
20844
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21134
20845
|
if (!sectionEl2) return null;
|
|
@@ -21207,8 +20918,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
21207
20918
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21208
20919
|
});
|
|
21209
20920
|
}
|
|
21210
|
-
function
|
|
21211
|
-
return /* @__PURE__ */ (0,
|
|
20921
|
+
function Pill3({ label, onClick, disabled }) {
|
|
20922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21212
20923
|
"button",
|
|
21213
20924
|
{
|
|
21214
20925
|
type: "button",
|
|
@@ -21224,7 +20935,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
21224
20935
|
border: "none",
|
|
21225
20936
|
cursor: disabled ? "default" : "pointer",
|
|
21226
20937
|
background: "#ffffff",
|
|
21227
|
-
color:
|
|
20938
|
+
color: OHW_BLUE_DARK3,
|
|
21228
20939
|
opacity: disabled ? 0.4 : 1,
|
|
21229
20940
|
fontSize: 12,
|
|
21230
20941
|
lineHeight: "16px",
|
|
@@ -21242,7 +20953,7 @@ function TogglePill({
|
|
|
21242
20953
|
onToggle,
|
|
21243
20954
|
disabled
|
|
21244
20955
|
}) {
|
|
21245
|
-
return /* @__PURE__ */ (0,
|
|
20956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
21246
20957
|
"button",
|
|
21247
20958
|
{
|
|
21248
20959
|
type: "button",
|
|
@@ -21261,7 +20972,7 @@ function TogglePill({
|
|
|
21261
20972
|
border: "none",
|
|
21262
20973
|
cursor: disabled ? "default" : "pointer",
|
|
21263
20974
|
background: "#ffffff",
|
|
21264
|
-
color:
|
|
20975
|
+
color: OHW_BLUE_DARK3,
|
|
21265
20976
|
opacity: disabled ? 0.4 : 1,
|
|
21266
20977
|
fontSize: 12,
|
|
21267
20978
|
lineHeight: "16px",
|
|
@@ -21271,7 +20982,7 @@ function TogglePill({
|
|
|
21271
20982
|
},
|
|
21272
20983
|
children: [
|
|
21273
20984
|
label,
|
|
21274
|
-
/* @__PURE__ */ (0,
|
|
20985
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21275
20986
|
"span",
|
|
21276
20987
|
{
|
|
21277
20988
|
"aria-hidden": true,
|
|
@@ -21284,10 +20995,10 @@ function TogglePill({
|
|
|
21284
20995
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
21285
20996
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
21286
20997
|
// "disabled control" rather than "switch that is off".
|
|
21287
|
-
background: on ?
|
|
20998
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
21288
20999
|
transition: "background 120ms ease"
|
|
21289
21000
|
},
|
|
21290
|
-
children: /* @__PURE__ */ (0,
|
|
21001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21291
21002
|
"span",
|
|
21292
21003
|
{
|
|
21293
21004
|
style: {
|
|
@@ -21316,7 +21027,7 @@ function CarouselSlideToolbar({
|
|
|
21316
21027
|
onChangeImage,
|
|
21317
21028
|
onToggleAutoplay
|
|
21318
21029
|
}) {
|
|
21319
|
-
return /* @__PURE__ */ (0,
|
|
21030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
21320
21031
|
"div",
|
|
21321
21032
|
{
|
|
21322
21033
|
"data-ohw-bridge": "",
|
|
@@ -21327,7 +21038,7 @@ function CarouselSlideToolbar({
|
|
|
21327
21038
|
flexDirection: "column",
|
|
21328
21039
|
gap: 6,
|
|
21329
21040
|
alignItems: "center",
|
|
21330
|
-
background:
|
|
21041
|
+
background: OHW_BLUE3,
|
|
21331
21042
|
padding: 8,
|
|
21332
21043
|
borderRadius: 12,
|
|
21333
21044
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21339,11 +21050,11 @@ function CarouselSlideToolbar({
|
|
|
21339
21050
|
pointerEvents: pending ? "none" : "auto"
|
|
21340
21051
|
},
|
|
21341
21052
|
children: [
|
|
21342
|
-
/* @__PURE__ */ (0,
|
|
21343
|
-
/* @__PURE__ */ (0,
|
|
21344
|
-
/* @__PURE__ */ (0,
|
|
21053
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21054
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
21055
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
21345
21056
|
] }),
|
|
21346
|
-
error && /* @__PURE__ */ (0,
|
|
21057
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21347
21058
|
]
|
|
21348
21059
|
}
|
|
21349
21060
|
);
|
|
@@ -21483,8 +21194,8 @@ function AiFadeCarouselOverlay({
|
|
|
21483
21194
|
const activeItemRect = useLiveItemRect2(active);
|
|
21484
21195
|
const TOOLBAR_APPROX_H = 90;
|
|
21485
21196
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21486
|
-
return /* @__PURE__ */ (0,
|
|
21487
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
21197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
21198
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21488
21199
|
"button",
|
|
21489
21200
|
{
|
|
21490
21201
|
type: "button",
|
|
@@ -21513,10 +21224,10 @@ function AiFadeCarouselOverlay({
|
|
|
21513
21224
|
fontSize: 14,
|
|
21514
21225
|
fontWeight: 700
|
|
21515
21226
|
},
|
|
21516
|
-
children: /* @__PURE__ */ (0,
|
|
21227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21517
21228
|
}
|
|
21518
21229
|
),
|
|
21519
|
-
swapping && /* @__PURE__ */ (0,
|
|
21230
|
+
swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21520
21231
|
"div",
|
|
21521
21232
|
{
|
|
21522
21233
|
ref: skeletonRef,
|
|
@@ -21534,15 +21245,15 @@ function AiFadeCarouselOverlay({
|
|
|
21534
21245
|
zIndex: 2147483646,
|
|
21535
21246
|
pointerEvents: "none"
|
|
21536
21247
|
},
|
|
21537
|
-
children: /* @__PURE__ */ (0,
|
|
21248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
|
|
21538
21249
|
}
|
|
21539
21250
|
),
|
|
21540
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
21251
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21541
21252
|
ItemInteractionLayer,
|
|
21542
21253
|
{
|
|
21543
21254
|
rect: activeItemRect,
|
|
21544
21255
|
state: toolbarState,
|
|
21545
|
-
toolbar: /* @__PURE__ */ (0,
|
|
21256
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21546
21257
|
CarouselSlideToolbar,
|
|
21547
21258
|
{
|
|
21548
21259
|
pending,
|
|
@@ -21733,6 +21444,113 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
21733
21444
|
// src/ui/link-modal/LinkPopover.tsx
|
|
21734
21445
|
var import_react20 = require("react");
|
|
21735
21446
|
|
|
21447
|
+
// src/ui/dialog.tsx
|
|
21448
|
+
var React9 = __toESM(require("react"), 1);
|
|
21449
|
+
var import_radix_ui6 = require("radix-ui");
|
|
21450
|
+
var import_lucide_react12 = require("lucide-react");
|
|
21451
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
21452
|
+
function Dialog2({
|
|
21453
|
+
...props
|
|
21454
|
+
}) {
|
|
21455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
21456
|
+
}
|
|
21457
|
+
function DialogPortal({
|
|
21458
|
+
...props
|
|
21459
|
+
}) {
|
|
21460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
21461
|
+
}
|
|
21462
|
+
function DialogOverlay({
|
|
21463
|
+
className,
|
|
21464
|
+
...props
|
|
21465
|
+
}) {
|
|
21466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21467
|
+
import_radix_ui6.Dialog.Overlay,
|
|
21468
|
+
{
|
|
21469
|
+
"data-slot": "dialog-overlay",
|
|
21470
|
+
"data-ohw-link-modal-root": "",
|
|
21471
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21472
|
+
...props
|
|
21473
|
+
}
|
|
21474
|
+
);
|
|
21475
|
+
}
|
|
21476
|
+
var DialogContent = React9.forwardRef(
|
|
21477
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21478
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
21479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
21480
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21481
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
21482
|
+
import_radix_ui6.Dialog.Content,
|
|
21483
|
+
{
|
|
21484
|
+
ref,
|
|
21485
|
+
"data-slot": "dialog-content",
|
|
21486
|
+
className: cn(
|
|
21487
|
+
positionMode,
|
|
21488
|
+
"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",
|
|
21489
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21490
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21491
|
+
className
|
|
21492
|
+
),
|
|
21493
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
21494
|
+
...props,
|
|
21495
|
+
children: [
|
|
21496
|
+
children,
|
|
21497
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21498
|
+
import_radix_ui6.Dialog.Close,
|
|
21499
|
+
{
|
|
21500
|
+
type: "button",
|
|
21501
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21502
|
+
"aria-label": "Close",
|
|
21503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
|
|
21504
|
+
}
|
|
21505
|
+
) : null
|
|
21506
|
+
]
|
|
21507
|
+
}
|
|
21508
|
+
)
|
|
21509
|
+
] });
|
|
21510
|
+
}
|
|
21511
|
+
);
|
|
21512
|
+
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
21513
|
+
function DialogHeader({
|
|
21514
|
+
className,
|
|
21515
|
+
...props
|
|
21516
|
+
}) {
|
|
21517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21518
|
+
}
|
|
21519
|
+
function DialogFooter({
|
|
21520
|
+
className,
|
|
21521
|
+
...props
|
|
21522
|
+
}) {
|
|
21523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21524
|
+
"div",
|
|
21525
|
+
{
|
|
21526
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
21527
|
+
...props
|
|
21528
|
+
}
|
|
21529
|
+
);
|
|
21530
|
+
}
|
|
21531
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21532
|
+
import_radix_ui6.Dialog.Title,
|
|
21533
|
+
{
|
|
21534
|
+
ref,
|
|
21535
|
+
className: cn(
|
|
21536
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21537
|
+
className
|
|
21538
|
+
),
|
|
21539
|
+
...props
|
|
21540
|
+
}
|
|
21541
|
+
));
|
|
21542
|
+
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
21543
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21544
|
+
import_radix_ui6.Dialog.Description,
|
|
21545
|
+
{
|
|
21546
|
+
ref,
|
|
21547
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
21548
|
+
...props
|
|
21549
|
+
}
|
|
21550
|
+
));
|
|
21551
|
+
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
21552
|
+
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
21553
|
+
|
|
21736
21554
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
21737
21555
|
var import_lucide_react16 = require("lucide-react");
|
|
21738
21556
|
|
|
@@ -22836,7 +22654,6 @@ function shouldUseDevFixtures() {
|
|
|
22836
22654
|
function getLogoElement(el) {
|
|
22837
22655
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
22838
22656
|
if (marked) return marked;
|
|
22839
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
22840
22657
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
22841
22658
|
if (!root) return null;
|
|
22842
22659
|
const anchor = el.closest("a");
|
|
@@ -25646,7 +25463,7 @@ function getNavigationSelectionParent(el) {
|
|
|
25646
25463
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
25647
25464
|
return resolveFooterLinksContainerFrom(el);
|
|
25648
25465
|
}
|
|
25649
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
25466
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
25650
25467
|
return getNavigationRoot(el);
|
|
25651
25468
|
}
|
|
25652
25469
|
return null;
|
|
@@ -25868,6 +25685,7 @@ var ICONS = {
|
|
|
25868
25685
|
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"/>',
|
|
25869
25686
|
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"/>'
|
|
25870
25687
|
};
|
|
25688
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
25871
25689
|
var SELECTION_CHROME_GAP2 = 4;
|
|
25872
25690
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
25873
25691
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -25965,7 +25783,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
25965
25783
|
el.style.top = `${top}px`;
|
|
25966
25784
|
el.style.height = `${height}px`;
|
|
25967
25785
|
}
|
|
25968
|
-
var
|
|
25786
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
25969
25787
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
25970
25788
|
const isAbove = transform.includes("translateY(-100%)");
|
|
25971
25789
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -25992,8 +25810,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
25992
25810
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
25993
25811
|
const half = toolbarWidth / 2;
|
|
25994
25812
|
return Math.max(
|
|
25995
|
-
|
|
25996
|
-
Math.min(centerX, window.innerWidth -
|
|
25813
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
25814
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
25997
25815
|
);
|
|
25998
25816
|
}
|
|
25999
25817
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26876,6 +26694,21 @@ function OhhwellsBridge() {
|
|
|
26876
26694
|
const [isItemDragging, setIsItemDragging] = (0, import_react25.useState)(false);
|
|
26877
26695
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react25.useState)(false);
|
|
26878
26696
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26697
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
|
|
26698
|
+
const floatingPanelOpenRef = (0, import_react25.useRef)(false);
|
|
26699
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
26700
|
+
const floatingPanelRef = (0, import_react25.useRef)(null);
|
|
26701
|
+
floatingPanelRef.current = floatingPanel;
|
|
26702
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
|
|
26703
|
+
const buttonCollectionDragRef = (0, import_react25.useRef)(null);
|
|
26704
|
+
const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
|
|
26705
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
|
|
26706
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
|
|
26707
|
+
const buttonPointerDragRef = (0, import_react25.useRef)(null);
|
|
26708
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
|
|
26709
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
|
|
26710
|
+
const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
|
|
26711
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
|
|
26879
26712
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react25.useState)(null);
|
|
26880
26713
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react25.useState)(null);
|
|
26881
26714
|
const footerDragRef = (0, import_react25.useRef)(null);
|
|
@@ -26902,21 +26735,6 @@ function OhhwellsBridge() {
|
|
|
26902
26735
|
const stylesRef = (0, import_react25.useRef)("");
|
|
26903
26736
|
const appliedDrawerRef = (0, import_react25.useRef)(null);
|
|
26904
26737
|
const pendingDeleteUndoRef = (0, import_react25.useRef)(null);
|
|
26905
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
|
|
26906
|
-
const floatingPanelOpenRef = (0, import_react25.useRef)(false);
|
|
26907
|
-
const floatingPanelRef = (0, import_react25.useRef)(null);
|
|
26908
|
-
floatingPanelRef.current = floatingPanel;
|
|
26909
|
-
const setFloatingPanelRef = (0, import_react25.useRef)(setFloatingPanel);
|
|
26910
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
|
|
26911
|
-
const buttonCollectionDragRef = (0, import_react25.useRef)(null);
|
|
26912
|
-
const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
|
|
26913
|
-
const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
|
|
26914
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
|
|
26915
|
-
const buttonPointerDragRef = (0, import_react25.useRef)(null);
|
|
26916
|
-
const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
|
|
26917
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
|
|
26918
|
-
const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
|
|
26919
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
|
|
26920
26738
|
const [sitePages, setSitePages] = (0, import_react25.useState)([]);
|
|
26921
26739
|
const collectionItemsRef = (0, import_react25.useRef)(/* @__PURE__ */ new Map());
|
|
26922
26740
|
const [sectionsByPath, setSectionsByPath] = (0, import_react25.useState)({});
|
|
@@ -26926,18 +26744,7 @@ function OhhwellsBridge() {
|
|
|
26926
26744
|
const linkPopoverOpenRef = (0, import_react25.useRef)(false);
|
|
26927
26745
|
const linkPopoverGraceUntilRef = (0, import_react25.useRef)(0);
|
|
26928
26746
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26929
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
26930
26747
|
linkPopoverSessionRef.current = linkPopover;
|
|
26931
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
26932
|
-
(0, import_react25.useEffect)(() => {
|
|
26933
|
-
const syncViewport = () => {
|
|
26934
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26935
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
26936
|
-
};
|
|
26937
|
-
syncViewport();
|
|
26938
|
-
window.addEventListener("resize", syncViewport);
|
|
26939
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
26940
|
-
}, []);
|
|
26941
26748
|
(0, import_react25.useEffect)(() => {
|
|
26942
26749
|
setSectionOrderPersistHandler((entries) => {
|
|
26943
26750
|
const currentPath = window.location.pathname;
|
|
@@ -28671,7 +28478,6 @@ function OhhwellsBridge() {
|
|
|
28671
28478
|
applyAiFooterFromContent(content);
|
|
28672
28479
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28673
28480
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
28674
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28675
28481
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28676
28482
|
}
|
|
28677
28483
|
applyBrandChrome(content);
|
|
@@ -28682,16 +28488,15 @@ function OhhwellsBridge() {
|
|
|
28682
28488
|
if (key === "__ohw_sections") continue;
|
|
28683
28489
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28684
28490
|
if (key === AI_FOOTER_KEY) continue;
|
|
28685
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28686
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28687
28491
|
if (key === BRAND_KIT_KEY) continue;
|
|
28688
28492
|
if (key === STYLE_STORE_KEY) continue;
|
|
28689
28493
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28494
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28690
28495
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28496
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28691
28497
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28692
28498
|
continue;
|
|
28693
28499
|
}
|
|
28694
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28695
28500
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28696
28501
|
if (applyCarouselNode(key, val)) continue;
|
|
28697
28502
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28731,7 +28536,6 @@ function OhhwellsBridge() {
|
|
|
28731
28536
|
});
|
|
28732
28537
|
applyLinkByKey(key, val);
|
|
28733
28538
|
}
|
|
28734
|
-
applySectionEmbeds(content);
|
|
28735
28539
|
applyLogoFromContent(content);
|
|
28736
28540
|
applyLogoSizes(content);
|
|
28737
28541
|
reconcileNavbarItemsFromContent(content);
|
|
@@ -28920,22 +28724,20 @@ function OhhwellsBridge() {
|
|
|
28920
28724
|
}
|
|
28921
28725
|
applyAiFooterFromContent(content);
|
|
28922
28726
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28923
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28924
28727
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28925
28728
|
}
|
|
28926
28729
|
for (const [key, val] of Object.entries(content)) {
|
|
28927
28730
|
if (key === "__ohw_sections") continue;
|
|
28928
28731
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28929
28732
|
if (key === AI_FOOTER_KEY) continue;
|
|
28930
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28931
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28932
28733
|
if (key === BRAND_KIT_KEY) continue;
|
|
28933
28734
|
if (key === STYLE_STORE_KEY) continue;
|
|
28934
28735
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28736
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28737
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28935
28738
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28936
28739
|
continue;
|
|
28937
28740
|
}
|
|
28938
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28939
28741
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28940
28742
|
if (applyCarouselNode(key, val)) continue;
|
|
28941
28743
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28960,7 +28762,6 @@ function OhhwellsBridge() {
|
|
|
28960
28762
|
});
|
|
28961
28763
|
applyLinkByKey(key, val);
|
|
28962
28764
|
}
|
|
28963
|
-
applySectionEmbeds(content);
|
|
28964
28765
|
applyLogoFromContent(content);
|
|
28965
28766
|
reconcileNavbarItemsFromContent(content);
|
|
28966
28767
|
reconcileFooterOrderFromContent(content);
|
|
@@ -29200,11 +29001,26 @@ function OhhwellsBridge() {
|
|
|
29200
29001
|
const t2 = setTimeout(measure, 500);
|
|
29201
29002
|
const ro = new ResizeObserver(schedule);
|
|
29202
29003
|
ro.observe(document.body);
|
|
29004
|
+
let lastWidth = window.innerWidth;
|
|
29005
|
+
let resizeTimers = [];
|
|
29006
|
+
const clearResizeTimers = () => {
|
|
29007
|
+
resizeTimers.forEach(clearTimeout);
|
|
29008
|
+
resizeTimers = [];
|
|
29009
|
+
};
|
|
29010
|
+
const handleResize = () => {
|
|
29011
|
+
if (window.innerWidth === lastWidth) return;
|
|
29012
|
+
lastWidth = window.innerWidth;
|
|
29013
|
+
clearResizeTimers();
|
|
29014
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
29015
|
+
};
|
|
29016
|
+
window.addEventListener("resize", handleResize);
|
|
29203
29017
|
return () => {
|
|
29204
29018
|
clearTimeout(t1);
|
|
29205
29019
|
clearTimeout(t2);
|
|
29206
29020
|
if (raf != null) cancelAnimationFrame(raf);
|
|
29207
29021
|
ro.disconnect();
|
|
29022
|
+
clearResizeTimers();
|
|
29023
|
+
window.removeEventListener("resize", handleResize);
|
|
29208
29024
|
};
|
|
29209
29025
|
}, [pathname, isEditMode, postToParent2]);
|
|
29210
29026
|
(0, import_react25.useEffect)(() => {
|
|
@@ -29501,13 +29317,6 @@ function OhhwellsBridge() {
|
|
|
29501
29317
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29502
29318
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29503
29319
|
if (isInsideLinkEditor(target)) return;
|
|
29504
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29505
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29506
|
-
if (target.closest(
|
|
29507
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29508
|
-
)) {
|
|
29509
|
-
return;
|
|
29510
|
-
}
|
|
29511
29320
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29512
29321
|
clearMediaSelectionRef.current();
|
|
29513
29322
|
}
|
|
@@ -29531,6 +29340,8 @@ function OhhwellsBridge() {
|
|
|
29531
29340
|
return;
|
|
29532
29341
|
}
|
|
29533
29342
|
}
|
|
29343
|
+
if (isInsideFloatingPanel(target)) return;
|
|
29344
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29534
29345
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29535
29346
|
if (collectionItem) {
|
|
29536
29347
|
e.preventDefault();
|
|
@@ -29542,6 +29353,11 @@ function OhhwellsBridge() {
|
|
|
29542
29353
|
});
|
|
29543
29354
|
return;
|
|
29544
29355
|
}
|
|
29356
|
+
if (target.closest(
|
|
29357
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29358
|
+
)) {
|
|
29359
|
+
return;
|
|
29360
|
+
}
|
|
29545
29361
|
{
|
|
29546
29362
|
const formEl = getFormElement(target);
|
|
29547
29363
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -29695,13 +29511,9 @@ function OhhwellsBridge() {
|
|
|
29695
29511
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
29696
29512
|
e.preventDefault();
|
|
29697
29513
|
e.stopPropagation();
|
|
29514
|
+
selectIconElementRef.current(editable);
|
|
29698
29515
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
29699
29516
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
29700
|
-
if (aiIcon) {
|
|
29701
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
29702
|
-
} else {
|
|
29703
|
-
selectIconElementRef.current(editable);
|
|
29704
|
-
}
|
|
29705
29517
|
postToParentRef.current({
|
|
29706
29518
|
type: "ow:icon-pick",
|
|
29707
29519
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -29929,9 +29741,6 @@ function OhhwellsBridge() {
|
|
|
29929
29741
|
setHoveredItemRect(null);
|
|
29930
29742
|
hoveredNavContainerRef.current = null;
|
|
29931
29743
|
setHoveredNavContainerRect(null);
|
|
29932
|
-
siblingHintElRef.current = null;
|
|
29933
|
-
setSiblingHintRect(null);
|
|
29934
|
-
setSiblingHintRects([]);
|
|
29935
29744
|
return;
|
|
29936
29745
|
}
|
|
29937
29746
|
{
|
|
@@ -30052,6 +29861,7 @@ function OhhwellsBridge() {
|
|
|
30052
29861
|
hoveredNavContainerRef.current = null;
|
|
30053
29862
|
setHoveredNavContainerRect(null);
|
|
30054
29863
|
hoveredItemElRef.current = editable;
|
|
29864
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
30055
29865
|
}
|
|
30056
29866
|
}
|
|
30057
29867
|
}
|
|
@@ -30761,11 +30571,7 @@ function OhhwellsBridge() {
|
|
|
30761
30571
|
};
|
|
30762
30572
|
const handleMouseMove = (e) => {
|
|
30763
30573
|
const { clientX, clientY } = e;
|
|
30764
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30765
|
-
dismissImageHover();
|
|
30766
|
-
clearImageHover();
|
|
30767
|
-
return;
|
|
30768
|
-
}
|
|
30574
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30769
30575
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
30770
30576
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
30771
30577
|
formHoverElRef.current = null;
|
|
@@ -30794,12 +30600,7 @@ function OhhwellsBridge() {
|
|
|
30794
30600
|
setHoveredItemRect(null);
|
|
30795
30601
|
hoveredNavContainerRef.current = null;
|
|
30796
30602
|
setHoveredNavContainerRect(null);
|
|
30797
|
-
siblingHintElRef.current = null;
|
|
30798
|
-
setSiblingHintRect(null);
|
|
30799
|
-
setSiblingHintRects([]);
|
|
30800
30603
|
dismissImageHover();
|
|
30801
|
-
clearImageHover();
|
|
30802
|
-
setSectionGap(null);
|
|
30803
30604
|
return;
|
|
30804
30605
|
}
|
|
30805
30606
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -30811,11 +30612,7 @@ function OhhwellsBridge() {
|
|
|
30811
30612
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
30812
30613
|
const { clientX, clientY } = e.data;
|
|
30813
30614
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
30814
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30815
|
-
dismissImageHover();
|
|
30816
|
-
clearImageHover();
|
|
30817
|
-
return;
|
|
30818
|
-
}
|
|
30615
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30819
30616
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
30820
30617
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
30821
30618
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -31195,7 +30992,6 @@ function OhhwellsBridge() {
|
|
|
31195
30992
|
applyAiFooterFromContent(content);
|
|
31196
30993
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
31197
30994
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
31198
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
31199
30995
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
31200
30996
|
}
|
|
31201
30997
|
applyBrandChrome(content);
|
|
@@ -31210,16 +31006,15 @@ function OhhwellsBridge() {
|
|
|
31210
31006
|
}
|
|
31211
31007
|
if (key === AI_SECTIONS_KEY) continue;
|
|
31212
31008
|
if (key === AI_FOOTER_KEY) continue;
|
|
31213
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31214
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31215
31009
|
if (key === BRAND_KIT_KEY) continue;
|
|
31216
31010
|
if (key === STYLE_STORE_KEY) continue;
|
|
31217
31011
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
31012
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31218
31013
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
31014
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31219
31015
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
31220
31016
|
continue;
|
|
31221
31017
|
}
|
|
31222
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
31223
31018
|
if (applyVideoSettingNode(key, val)) continue;
|
|
31224
31019
|
if (applyCarouselNode(key, val)) continue;
|
|
31225
31020
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -31245,7 +31040,6 @@ function OhhwellsBridge() {
|
|
|
31245
31040
|
});
|
|
31246
31041
|
applyLinkByKey(key, val);
|
|
31247
31042
|
}
|
|
31248
|
-
applySectionEmbeds(content);
|
|
31249
31043
|
applyLogoFromContent(content);
|
|
31250
31044
|
applyLogoSizes(content);
|
|
31251
31045
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
@@ -31878,12 +31672,6 @@ function OhhwellsBridge() {
|
|
|
31878
31672
|
closeLinkPopoverRef.current();
|
|
31879
31673
|
return;
|
|
31880
31674
|
}
|
|
31881
|
-
if (floatingPanelOpenRef.current) {
|
|
31882
|
-
setFloatingPanelRef.current(null);
|
|
31883
|
-
deselectRef.current();
|
|
31884
|
-
deactivateRef.current();
|
|
31885
|
-
return;
|
|
31886
|
-
}
|
|
31887
31675
|
deselectRef.current();
|
|
31888
31676
|
deactivateRef.current();
|
|
31889
31677
|
clearMediaSelectionRef.current();
|
|
@@ -32720,10 +32508,10 @@ function OhhwellsBridge() {
|
|
|
32720
32508
|
window.removeEventListener("message", handleDuplicateSection);
|
|
32721
32509
|
window.removeEventListener("message", handleDeactivate);
|
|
32722
32510
|
window.removeEventListener("message", handleSelectNav);
|
|
32511
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32723
32512
|
window.removeEventListener("message", handleToastAction);
|
|
32724
32513
|
window.removeEventListener("message", handleFormCount);
|
|
32725
32514
|
window.removeEventListener("message", handleUiEscape);
|
|
32726
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32727
32515
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
32728
32516
|
autoSaveTimers.current.clear();
|
|
32729
32517
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -33017,7 +32805,7 @@ function OhhwellsBridge() {
|
|
|
33017
32805
|
postToParent2({
|
|
33018
32806
|
type: "ow:ready",
|
|
33019
32807
|
version: "1",
|
|
33020
|
-
bridgeVersion: "0.1.
|
|
32808
|
+
bridgeVersion: "0.1.168",
|
|
33021
32809
|
path: pathname,
|
|
33022
32810
|
nodes: collectEditableNodes(editContentRef.current),
|
|
33023
32811
|
sections
|