@ohhwells/bridge 0.1.168-next.447 → 0.1.169
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.169";
|
|
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.169" : "";
|
|
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
|
)
|
|
@@ -19257,7 +19069,7 @@ function AiSectionOverlay({
|
|
|
19257
19069
|
|
|
19258
19070
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19259
19071
|
var import_react13 = require("react");
|
|
19260
|
-
var
|
|
19072
|
+
var import_lucide_react8 = require("lucide-react");
|
|
19261
19073
|
|
|
19262
19074
|
// src/lib/ai-media-strip-tree.ts
|
|
19263
19075
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19371,6 +19183,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19371
19183
|
return true;
|
|
19372
19184
|
});
|
|
19373
19185
|
}
|
|
19186
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
19187
|
+
return withMediaStrip(tree, (block) => {
|
|
19188
|
+
const items = block.items;
|
|
19189
|
+
if (index < 0 || index >= items.length) return false;
|
|
19190
|
+
items[index] = { ...items[index], alt };
|
|
19191
|
+
return true;
|
|
19192
|
+
});
|
|
19193
|
+
}
|
|
19374
19194
|
function setMediaStripItemLink(tree, index, link) {
|
|
19375
19195
|
return withMediaStrip(tree, (block) => {
|
|
19376
19196
|
const items = block.items;
|
|
@@ -19388,117 +19208,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19388
19208
|
});
|
|
19389
19209
|
}
|
|
19390
19210
|
|
|
19391
|
-
// src/ui/dialog.tsx
|
|
19392
|
-
var React9 = __toESM(require("react"), 1);
|
|
19393
|
-
var import_radix_ui6 = require("radix-ui");
|
|
19394
|
-
var import_lucide_react8 = require("lucide-react");
|
|
19395
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
19396
|
-
function Dialog2({
|
|
19397
|
-
...props
|
|
19398
|
-
}) {
|
|
19399
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
19400
|
-
}
|
|
19401
|
-
function DialogPortal({
|
|
19402
|
-
...props
|
|
19403
|
-
}) {
|
|
19404
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
19405
|
-
}
|
|
19406
|
-
function DialogOverlay({
|
|
19407
|
-
className,
|
|
19408
|
-
...props
|
|
19409
|
-
}) {
|
|
19410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19411
|
-
import_radix_ui6.Dialog.Overlay,
|
|
19412
|
-
{
|
|
19413
|
-
"data-slot": "dialog-overlay",
|
|
19414
|
-
"data-ohw-link-modal-root": "",
|
|
19415
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19416
|
-
...props
|
|
19417
|
-
}
|
|
19418
|
-
);
|
|
19419
|
-
}
|
|
19420
|
-
var DialogContent = React9.forwardRef(
|
|
19421
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19422
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
19423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
19424
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19425
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19426
|
-
import_radix_ui6.Dialog.Content,
|
|
19427
|
-
{
|
|
19428
|
-
ref,
|
|
19429
|
-
"data-slot": "dialog-content",
|
|
19430
|
-
className: cn(
|
|
19431
|
-
positionMode,
|
|
19432
|
-
"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",
|
|
19433
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19434
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19435
|
-
className
|
|
19436
|
-
),
|
|
19437
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
19438
|
-
...props,
|
|
19439
|
-
children: [
|
|
19440
|
-
children,
|
|
19441
|
-
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19442
|
-
import_radix_ui6.Dialog.Close,
|
|
19443
|
-
{
|
|
19444
|
-
type: "button",
|
|
19445
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19446
|
-
"aria-label": "Close",
|
|
19447
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
|
|
19448
|
-
}
|
|
19449
|
-
) : null
|
|
19450
|
-
]
|
|
19451
|
-
}
|
|
19452
|
-
)
|
|
19453
|
-
] });
|
|
19454
|
-
}
|
|
19455
|
-
);
|
|
19456
|
-
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
19457
|
-
function DialogHeader({
|
|
19458
|
-
className,
|
|
19459
|
-
...props
|
|
19460
|
-
}) {
|
|
19461
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19462
|
-
}
|
|
19463
|
-
function DialogFooter({
|
|
19464
|
-
className,
|
|
19465
|
-
...props
|
|
19466
|
-
}) {
|
|
19467
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19468
|
-
"div",
|
|
19469
|
-
{
|
|
19470
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
19471
|
-
...props
|
|
19472
|
-
}
|
|
19473
|
-
);
|
|
19474
|
-
}
|
|
19475
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19476
|
-
import_radix_ui6.Dialog.Title,
|
|
19477
|
-
{
|
|
19478
|
-
ref,
|
|
19479
|
-
className: cn(
|
|
19480
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19481
|
-
className
|
|
19482
|
-
),
|
|
19483
|
-
...props
|
|
19484
|
-
}
|
|
19485
|
-
));
|
|
19486
|
-
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
19487
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19488
|
-
import_radix_ui6.Dialog.Description,
|
|
19489
|
-
{
|
|
19490
|
-
ref,
|
|
19491
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
19492
|
-
...props
|
|
19493
|
-
}
|
|
19494
|
-
));
|
|
19495
|
-
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
19496
|
-
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
19497
|
-
|
|
19498
19211
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19499
|
-
var
|
|
19500
|
-
var PRIMARY3 = "
|
|
19501
|
-
var
|
|
19212
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
19213
|
+
var PRIMARY3 = "#0885FE";
|
|
19214
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
19215
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19502
19216
|
function findMediaStripItemElement(sectionId, index) {
|
|
19503
19217
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
19504
19218
|
if (!sectionEl2) return null;
|
|
@@ -19508,35 +19222,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
19508
19222
|
}
|
|
19509
19223
|
return null;
|
|
19510
19224
|
}
|
|
19511
|
-
function
|
|
19512
|
-
|
|
19513
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19514
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19515
|
-
if (!itemEl) return null;
|
|
19516
|
-
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
19517
|
-
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19518
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19519
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19520
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
19521
|
-
return { sectionId, index };
|
|
19522
|
-
}
|
|
19523
|
-
function sameRef(a, b) {
|
|
19524
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19525
|
-
}
|
|
19526
|
-
function rectOf(el) {
|
|
19225
|
+
function readRect2(ref) {
|
|
19226
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19527
19227
|
if (!el) return null;
|
|
19528
19228
|
const r2 = el.getBoundingClientRect();
|
|
19529
19229
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19530
19230
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19531
19231
|
}
|
|
19532
|
-
function
|
|
19533
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19534
|
-
}
|
|
19535
|
-
function readStripRect(ref) {
|
|
19536
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19537
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19538
|
-
}
|
|
19539
|
-
function useLiveItemRect(ref, strip = false) {
|
|
19232
|
+
function useLiveItemRect(ref) {
|
|
19540
19233
|
const [rect, setRect] = (0, import_react13.useState)(null);
|
|
19541
19234
|
(0, import_react13.useEffect)(() => {
|
|
19542
19235
|
if (!ref) {
|
|
@@ -19544,7 +19237,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19544
19237
|
return;
|
|
19545
19238
|
}
|
|
19546
19239
|
const update = () => {
|
|
19547
|
-
const next =
|
|
19240
|
+
const next = readRect2(ref);
|
|
19548
19241
|
setRect(
|
|
19549
19242
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19550
19243
|
);
|
|
@@ -19559,49 +19252,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19559
19252
|
window.removeEventListener("resize", update);
|
|
19560
19253
|
clearInterval(interval);
|
|
19561
19254
|
};
|
|
19562
|
-
}, [ref?.sectionId, ref?.index
|
|
19255
|
+
}, [ref?.sectionId, ref?.index]);
|
|
19563
19256
|
return rect;
|
|
19564
19257
|
}
|
|
19565
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
19566
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19567
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19568
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
19569
|
-
const slotRef = (0, import_react13.useRef)(null);
|
|
19570
|
-
const [shift, setShift] = (0, import_react13.useState)(0);
|
|
19571
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
19572
|
-
(0, import_react13.useLayoutEffect)(() => {
|
|
19573
|
-
const slot = slotRef.current;
|
|
19574
|
-
if (!slot) return;
|
|
19575
|
-
const clamp = () => {
|
|
19576
|
-
const w = slot.offsetWidth;
|
|
19577
|
-
if (w <= 0) return;
|
|
19578
|
-
const half = w / 2;
|
|
19579
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19580
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19581
|
-
};
|
|
19582
|
-
clamp();
|
|
19583
|
-
const ro = new ResizeObserver(clamp);
|
|
19584
|
-
ro.observe(slot);
|
|
19585
|
-
return () => ro.disconnect();
|
|
19586
|
-
}, [centerX, children]);
|
|
19587
|
-
const mobile = window.innerWidth <= 480;
|
|
19588
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19589
|
-
"div",
|
|
19590
|
-
{
|
|
19591
|
-
ref: slotRef,
|
|
19592
|
-
"data-ohw-bridge": "",
|
|
19593
|
-
"data-ohw-item-interaction": "",
|
|
19594
|
-
className: "pointer-events-auto fixed",
|
|
19595
|
-
style: {
|
|
19596
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19597
|
-
left: centerX + shift,
|
|
19598
|
-
transform: "translate(-50%, -100%)",
|
|
19599
|
-
zIndex: 2147483645
|
|
19600
|
-
},
|
|
19601
|
-
children
|
|
19602
|
-
}
|
|
19603
|
-
);
|
|
19604
|
-
}
|
|
19605
19258
|
function requestValidateTree(postToParent2, tree) {
|
|
19606
19259
|
return new Promise((resolve) => {
|
|
19607
19260
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19638,72 +19291,116 @@ function requestAssetPick(postToParent2) {
|
|
|
19638
19291
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19639
19292
|
});
|
|
19640
19293
|
}
|
|
19641
|
-
function
|
|
19294
|
+
function Pill({
|
|
19642
19295
|
label,
|
|
19643
19296
|
onClick,
|
|
19644
|
-
disabled
|
|
19645
|
-
active
|
|
19646
|
-
children
|
|
19647
|
-
}) {
|
|
19648
|
-
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
|
|
19649
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
19650
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
19651
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
19652
|
-
] });
|
|
19653
|
-
}
|
|
19654
|
-
function ToolbarSeparator() {
|
|
19655
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
19656
|
-
}
|
|
19657
|
-
function OptionMenu({
|
|
19658
|
-
label,
|
|
19659
|
-
value,
|
|
19660
|
-
options,
|
|
19661
|
-
onChange
|
|
19297
|
+
disabled,
|
|
19298
|
+
active
|
|
19662
19299
|
}) {
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19301
|
+
"button",
|
|
19302
|
+
{
|
|
19303
|
+
type: "button",
|
|
19304
|
+
onClick,
|
|
19305
|
+
disabled,
|
|
19306
|
+
style: {
|
|
19307
|
+
height: 28,
|
|
19308
|
+
padding: "0 10px",
|
|
19309
|
+
display: "inline-flex",
|
|
19310
|
+
alignItems: "center",
|
|
19311
|
+
gap: 4,
|
|
19312
|
+
borderRadius: 999,
|
|
19313
|
+
border: "none",
|
|
19314
|
+
cursor: disabled ? "default" : "pointer",
|
|
19315
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19316
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19317
|
+
opacity: disabled ? 0.4 : 1,
|
|
19318
|
+
fontSize: 12,
|
|
19319
|
+
lineHeight: "16px",
|
|
19320
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19321
|
+
whiteSpace: "nowrap",
|
|
19322
|
+
flex: "0 0 auto"
|
|
19323
|
+
},
|
|
19324
|
+
children: label
|
|
19325
|
+
}
|
|
19326
|
+
);
|
|
19327
|
+
}
|
|
19328
|
+
function AltInput({ value, onCommit }) {
|
|
19329
|
+
const [draft, setDraft] = (0, import_react13.useState)(value);
|
|
19330
|
+
(0, import_react13.useEffect)(() => setDraft(value), [value]);
|
|
19331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19332
|
+
"div",
|
|
19333
|
+
{
|
|
19334
|
+
style: {
|
|
19335
|
+
display: "flex",
|
|
19336
|
+
alignItems: "center",
|
|
19337
|
+
gap: 6,
|
|
19338
|
+
height: 28,
|
|
19339
|
+
padding: "0 12px",
|
|
19340
|
+
borderRadius: 999,
|
|
19341
|
+
background: "#ffffff",
|
|
19342
|
+
width: "100%",
|
|
19343
|
+
maxWidth: 260,
|
|
19344
|
+
boxSizing: "border-box"
|
|
19345
|
+
},
|
|
19346
|
+
children: [
|
|
19347
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19348
|
+
"span",
|
|
19683
19349
|
{
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
|
|
19687
|
-
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
)
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
|
|
19350
|
+
style: {
|
|
19351
|
+
flex: "0 0 auto",
|
|
19352
|
+
color: OHW_BLUE_DARK,
|
|
19353
|
+
fontSize: 10,
|
|
19354
|
+
fontWeight: 700,
|
|
19355
|
+
textTransform: "uppercase",
|
|
19356
|
+
letterSpacing: 0.4
|
|
19357
|
+
},
|
|
19358
|
+
children: "Alt"
|
|
19359
|
+
}
|
|
19360
|
+
),
|
|
19361
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19362
|
+
"input",
|
|
19363
|
+
{
|
|
19364
|
+
type: "text",
|
|
19365
|
+
value: draft,
|
|
19366
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19367
|
+
onBlur: () => {
|
|
19368
|
+
if (draft !== value) onCommit(draft);
|
|
19369
|
+
},
|
|
19370
|
+
onKeyDown: (e) => {
|
|
19371
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19372
|
+
if (e.key === "Escape") {
|
|
19373
|
+
setDraft(value);
|
|
19374
|
+
e.currentTarget.blur();
|
|
19375
|
+
}
|
|
19376
|
+
},
|
|
19377
|
+
placeholder: "Describe this image",
|
|
19378
|
+
"aria-label": "Image alt text",
|
|
19379
|
+
style: {
|
|
19380
|
+
flex: 1,
|
|
19381
|
+
minWidth: 0,
|
|
19382
|
+
border: "none",
|
|
19383
|
+
outline: "none",
|
|
19384
|
+
background: "transparent",
|
|
19385
|
+
fontSize: 12,
|
|
19386
|
+
lineHeight: "16px",
|
|
19387
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19388
|
+
color: "#1f2937"
|
|
19389
|
+
}
|
|
19390
|
+
}
|
|
19391
|
+
)
|
|
19392
|
+
]
|
|
19393
|
+
}
|
|
19394
|
+
);
|
|
19698
19395
|
}
|
|
19699
19396
|
var VARIANTS = [
|
|
19700
19397
|
{ value: "logos", label: "Logos" },
|
|
19701
19398
|
{ value: "reel", label: "Reel" }
|
|
19702
19399
|
];
|
|
19703
19400
|
var ALIGNS = [
|
|
19704
|
-
{ value: "left", label: "
|
|
19705
|
-
{ value: "center", label: "
|
|
19706
|
-
{ value: "right", label: "
|
|
19401
|
+
{ value: "left", label: "Left" },
|
|
19402
|
+
{ value: "center", label: "Center" },
|
|
19403
|
+
{ value: "right", label: "Right" }
|
|
19707
19404
|
];
|
|
19708
19405
|
var HOVERS = [
|
|
19709
19406
|
{ value: "none", label: "None" },
|
|
@@ -19711,104 +19408,104 @@ var HOVERS = [
|
|
|
19711
19408
|
{ value: "zoom", label: "Zoom" },
|
|
19712
19409
|
{ value: "fade", label: "Fade" }
|
|
19713
19410
|
];
|
|
19411
|
+
var TREATMENTS = [
|
|
19412
|
+
{ value: "color", label: "Color" },
|
|
19413
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
19414
|
+
];
|
|
19714
19415
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
19715
|
-
function
|
|
19716
|
-
|
|
19717
|
-
linkTarget,
|
|
19718
|
-
onClose,
|
|
19719
|
-
onSave
|
|
19720
|
-
}) {
|
|
19721
|
-
const [draft, setDraft] = (0, import_react13.useState)(href);
|
|
19722
|
-
const [newTab, setNewTab] = (0, import_react13.useState)(linkTarget !== "same-tab");
|
|
19416
|
+
function LinkInput({ value, onCommit }) {
|
|
19417
|
+
const [draft, setDraft] = (0, import_react13.useState)(value);
|
|
19723
19418
|
const [invalid, setInvalid] = (0, import_react13.useState)(false);
|
|
19724
|
-
|
|
19419
|
+
(0, import_react13.useEffect)(() => {
|
|
19420
|
+
setDraft(value);
|
|
19421
|
+
setInvalid(false);
|
|
19422
|
+
}, [value]);
|
|
19423
|
+
const commit2 = () => {
|
|
19725
19424
|
const next = draft.trim();
|
|
19726
|
-
if (next
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
19731
|
-
onClose();
|
|
19425
|
+
if (next === value) return setInvalid(false);
|
|
19426
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
19427
|
+
setInvalid(false);
|
|
19428
|
+
onCommit(next);
|
|
19732
19429
|
};
|
|
19733
|
-
return /* @__PURE__ */ (0,
|
|
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
|
-
|
|
19791
|
-
|
|
19792
|
-
|
|
19793
|
-
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19431
|
+
"div",
|
|
19432
|
+
{
|
|
19433
|
+
style: {
|
|
19434
|
+
display: "flex",
|
|
19435
|
+
alignItems: "center",
|
|
19436
|
+
gap: 6,
|
|
19437
|
+
height: 28,
|
|
19438
|
+
padding: "0 12px",
|
|
19439
|
+
borderRadius: 999,
|
|
19440
|
+
background: "#ffffff",
|
|
19441
|
+
width: "100%",
|
|
19442
|
+
maxWidth: 260,
|
|
19443
|
+
boxSizing: "border-box",
|
|
19444
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19445
|
+
},
|
|
19446
|
+
children: [
|
|
19447
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19448
|
+
"span",
|
|
19449
|
+
{
|
|
19450
|
+
style: {
|
|
19451
|
+
flex: "0 0 auto",
|
|
19452
|
+
color: OHW_BLUE_DARK,
|
|
19453
|
+
fontSize: 10,
|
|
19454
|
+
fontWeight: 700,
|
|
19455
|
+
textTransform: "uppercase",
|
|
19456
|
+
letterSpacing: 0.4
|
|
19457
|
+
},
|
|
19458
|
+
children: "Link"
|
|
19459
|
+
}
|
|
19460
|
+
),
|
|
19461
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19462
|
+
"input",
|
|
19463
|
+
{
|
|
19464
|
+
type: "text",
|
|
19465
|
+
inputMode: "url",
|
|
19466
|
+
value: draft,
|
|
19467
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19468
|
+
onBlur: commit2,
|
|
19469
|
+
onKeyDown: (e) => {
|
|
19470
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19471
|
+
if (e.key === "Escape") {
|
|
19472
|
+
setDraft(value);
|
|
19473
|
+
setInvalid(false);
|
|
19474
|
+
e.currentTarget.blur();
|
|
19475
|
+
}
|
|
19476
|
+
},
|
|
19477
|
+
placeholder: "https://example.com",
|
|
19478
|
+
"aria-label": "Image link URL",
|
|
19479
|
+
"aria-invalid": invalid,
|
|
19480
|
+
style: {
|
|
19481
|
+
flex: 1,
|
|
19482
|
+
minWidth: 0,
|
|
19483
|
+
border: "none",
|
|
19484
|
+
outline: "none",
|
|
19485
|
+
background: "transparent",
|
|
19486
|
+
fontSize: 12,
|
|
19487
|
+
lineHeight: "16px",
|
|
19488
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19489
|
+
color: "#1f2937"
|
|
19490
|
+
}
|
|
19491
|
+
}
|
|
19492
|
+
)
|
|
19493
|
+
]
|
|
19494
|
+
}
|
|
19495
|
+
);
|
|
19798
19496
|
}
|
|
19799
19497
|
function MediaStripToolbar({
|
|
19800
19498
|
entry,
|
|
19801
19499
|
index,
|
|
19802
19500
|
pending,
|
|
19803
19501
|
error,
|
|
19804
|
-
itemEditOn,
|
|
19805
|
-
onToggleItemEdit,
|
|
19806
19502
|
onSetVariant,
|
|
19807
19503
|
onSetAlign,
|
|
19808
19504
|
onSetHover,
|
|
19809
19505
|
onSetTreatment,
|
|
19810
19506
|
onResize,
|
|
19811
|
-
|
|
19507
|
+
onSetAlt,
|
|
19508
|
+
onSetLink,
|
|
19812
19509
|
onAddItem,
|
|
19813
19510
|
onRemoveItem,
|
|
19814
19511
|
onChangeImage,
|
|
@@ -19817,102 +19514,81 @@ function MediaStripToolbar({
|
|
|
19817
19514
|
}) {
|
|
19818
19515
|
const items = mediaStripItems(entry.tree);
|
|
19819
19516
|
const itemCount = items.length;
|
|
19517
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
19518
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
19519
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19820
19520
|
const slots = findMediaStripSlots(entry.tree);
|
|
19821
19521
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19822
19522
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
19823
19523
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
19824
19524
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
19825
19525
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19826
|
-
const
|
|
19827
|
-
const
|
|
19828
|
-
|
|
19526
|
+
const isMobile = window.innerWidth <= 480;
|
|
19527
|
+
const rowStyle = isMobile ? {
|
|
19528
|
+
display: "flex",
|
|
19529
|
+
gap: 6,
|
|
19530
|
+
flexWrap: "nowrap",
|
|
19531
|
+
justifyContent: "center",
|
|
19532
|
+
overflowX: "auto",
|
|
19533
|
+
WebkitOverflowScrolling: "touch",
|
|
19534
|
+
width: "100%",
|
|
19535
|
+
scrollbarWidth: "none"
|
|
19536
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19829
19538
|
"div",
|
|
19830
19539
|
{
|
|
19831
19540
|
"data-ohw-bridge": "",
|
|
19832
19541
|
"data-ohw-toolbar": "",
|
|
19833
19542
|
onMouseDown: (e) => e.stopPropagation(),
|
|
19834
|
-
|
|
19835
|
-
|
|
19543
|
+
style: {
|
|
19544
|
+
display: "flex",
|
|
19545
|
+
flexDirection: "column",
|
|
19546
|
+
gap: 6,
|
|
19547
|
+
alignItems: "center",
|
|
19548
|
+
background: OHW_BLUE,
|
|
19549
|
+
padding: 8,
|
|
19550
|
+
borderRadius: 12,
|
|
19551
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19552
|
+
pointerEvents: pending ? "none" : "auto",
|
|
19553
|
+
opacity: pending ? 0.6 : 1,
|
|
19554
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19555
|
+
},
|
|
19836
19556
|
children: [
|
|
19837
|
-
/* @__PURE__ */ (0,
|
|
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
|
-
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
) }),
|
|
19870
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
19871
|
-
] }),
|
|
19872
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19873
|
-
/* @__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" } }) }),
|
|
19874
|
-
/* @__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" } }) }),
|
|
19875
|
-
/* @__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" } }) }),
|
|
19876
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19877
|
-
ToolbarAction,
|
|
19878
|
-
{
|
|
19879
|
-
label: gatedLabel("Move right"),
|
|
19880
|
-
onClick: onMoveRight,
|
|
19881
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
19882
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
|
|
19883
|
-
}
|
|
19884
|
-
),
|
|
19885
|
-
/* @__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" } }) }),
|
|
19886
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19887
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
19888
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
19889
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19890
|
-
ToolbarAction,
|
|
19891
|
-
{
|
|
19892
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
19893
|
-
active: treatment === "grayscale",
|
|
19894
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
19895
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
19896
|
-
}
|
|
19897
|
-
),
|
|
19898
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19899
|
-
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)),
|
|
19900
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19901
|
-
/* @__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" } }) }),
|
|
19902
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
19903
|
-
sizeValue,
|
|
19904
|
-
"px"
|
|
19905
|
-
] }),
|
|
19906
|
-
/* @__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" } }) }),
|
|
19907
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19908
|
-
/* @__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" } }) })
|
|
19909
|
-
]
|
|
19910
|
-
}
|
|
19911
|
-
),
|
|
19912
|
-
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 })
|
|
19557
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19558
|
+
VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
19559
|
+
ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
19560
|
+
] }),
|
|
19561
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19562
|
+
HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
19563
|
+
TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
19564
|
+
] }),
|
|
19565
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
19566
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
19567
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
19568
|
+
sizeValue,
|
|
19569
|
+
"px"
|
|
19570
|
+
] }),
|
|
19571
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
|
|
19572
|
+
] }),
|
|
19573
|
+
/* @__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 }) }),
|
|
19574
|
+
/* @__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) }) }),
|
|
19575
|
+
currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19576
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
19577
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
19578
|
+
] }),
|
|
19579
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19580
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
19581
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
19582
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
19583
|
+
] }),
|
|
19584
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19585
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
19586
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
19587
|
+
] }),
|
|
19588
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
19913
19589
|
]
|
|
19914
19590
|
}
|
|
19915
|
-
)
|
|
19591
|
+
);
|
|
19916
19592
|
}
|
|
19917
19593
|
function findMediaStripSlots(tree) {
|
|
19918
19594
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -19931,23 +19607,31 @@ function AiMediaStripOverlay({
|
|
|
19931
19607
|
}) {
|
|
19932
19608
|
const [hover, setHover] = (0, import_react13.useState)(null);
|
|
19933
19609
|
const [active, setActive] = (0, import_react13.useState)(null);
|
|
19934
|
-
const [itemEditOn, setItemEditOn] = (0, import_react13.useState)(false);
|
|
19935
|
-
const [linkOpen, setLinkOpen] = (0, import_react13.useState)(false);
|
|
19936
19610
|
const [pending, setPending] = (0, import_react13.useState)(false);
|
|
19937
19611
|
const [error, setError] = (0, import_react13.useState)(null);
|
|
19938
19612
|
const activeRef = (0, import_react13.useRef)(null);
|
|
19939
19613
|
activeRef.current = active;
|
|
19940
|
-
const linkOpenRef = (0, import_react13.useRef)(false);
|
|
19941
|
-
linkOpenRef.current = linkOpen;
|
|
19942
19614
|
(0, import_react13.useEffect)(() => {
|
|
19943
19615
|
const onMove = (e) => {
|
|
19944
|
-
const ref = itemRefFromTarget(e.target);
|
|
19945
19616
|
const t = e.target;
|
|
19946
|
-
|
|
19947
|
-
|
|
19948
|
-
|
|
19949
|
-
|
|
19950
|
-
|
|
19617
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19618
|
+
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]")) {
|
|
19619
|
+
return;
|
|
19620
|
+
}
|
|
19621
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
19622
|
+
if (!itemEl) {
|
|
19623
|
+
setHover(null);
|
|
19624
|
+
return;
|
|
19625
|
+
}
|
|
19626
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
19627
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19628
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19629
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19630
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
19631
|
+
setHover(null);
|
|
19632
|
+
return;
|
|
19633
|
+
}
|
|
19634
|
+
setHover({ sectionId, index });
|
|
19951
19635
|
};
|
|
19952
19636
|
const onLeave = () => setHover(null);
|
|
19953
19637
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -19959,25 +19643,23 @@ function AiMediaStripOverlay({
|
|
|
19959
19643
|
}, []);
|
|
19960
19644
|
(0, import_react13.useEffect)(() => {
|
|
19961
19645
|
const onClick = (e) => {
|
|
19646
|
+
const current = activeRef.current;
|
|
19647
|
+
if (!current) return;
|
|
19962
19648
|
const t = e.target;
|
|
19963
|
-
if (!(t instanceof
|
|
19964
|
-
if (t.closest(
|
|
19965
|
-
const
|
|
19966
|
-
if (
|
|
19967
|
-
|
|
19968
|
-
setItemEditOn(false);
|
|
19649
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19650
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
19651
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
19652
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
19653
|
+
setActive(null);
|
|
19969
19654
|
setError(null);
|
|
19970
|
-
setActive(ref);
|
|
19971
19655
|
};
|
|
19972
19656
|
document.addEventListener("click", onClick, true);
|
|
19973
19657
|
return () => document.removeEventListener("click", onClick, true);
|
|
19974
|
-
}, [
|
|
19658
|
+
}, []);
|
|
19975
19659
|
(0, import_react13.useEffect)(() => {
|
|
19976
19660
|
const onBlur = () => {
|
|
19977
19661
|
if (!activeRef.current) return;
|
|
19978
19662
|
setActive(null);
|
|
19979
|
-
setItemEditOn(false);
|
|
19980
|
-
setLinkOpen(false);
|
|
19981
19663
|
setError(null);
|
|
19982
19664
|
};
|
|
19983
19665
|
window.addEventListener("blur", onBlur);
|
|
@@ -19987,10 +19669,7 @@ function AiMediaStripOverlay({
|
|
|
19987
19669
|
const onKeyDown = (e) => {
|
|
19988
19670
|
if (e.key !== "Escape") return;
|
|
19989
19671
|
if (!activeRef.current) return;
|
|
19990
|
-
if (linkOpenRef.current) return;
|
|
19991
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
19992
19672
|
setActive(null);
|
|
19993
|
-
setItemEditOn(false);
|
|
19994
19673
|
setError(null);
|
|
19995
19674
|
};
|
|
19996
19675
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -20024,133 +19703,137 @@ function AiMediaStripOverlay({
|
|
|
20024
19703
|
tree: nextTree,
|
|
20025
19704
|
label: entry.label,
|
|
20026
19705
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
20027
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
20028
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
20029
|
-
// on every edit reads as the section jumping around.
|
|
20030
|
-
skipScrollIntoView: true
|
|
19706
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
20031
19707
|
});
|
|
20032
19708
|
return true;
|
|
20033
19709
|
},
|
|
20034
19710
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
20035
19711
|
);
|
|
20036
19712
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
19713
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
20037
19714
|
const activeItemRect = useLiveItemRect(active);
|
|
20038
|
-
const
|
|
20039
|
-
const
|
|
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
|
-
|
|
20065
|
-
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20071
|
-
|
|
19715
|
+
const TOOLBAR_APPROX_H = 170;
|
|
19716
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
19717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
19718
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19719
|
+
"button",
|
|
19720
|
+
{
|
|
19721
|
+
type: "button",
|
|
19722
|
+
"data-ohw-toolbar": "",
|
|
19723
|
+
onClick: () => {
|
|
19724
|
+
clearInteractionChromeRef.current();
|
|
19725
|
+
setActive(hover);
|
|
19726
|
+
},
|
|
19727
|
+
"aria-label": "Configure media item",
|
|
19728
|
+
style: {
|
|
19729
|
+
position: "fixed",
|
|
19730
|
+
top: hoverHandleRect.top + 8,
|
|
19731
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
19732
|
+
width: 28,
|
|
19733
|
+
height: 28,
|
|
19734
|
+
borderRadius: 8,
|
|
19735
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
19736
|
+
background: "#ffffff",
|
|
19737
|
+
color: PRIMARY3,
|
|
19738
|
+
display: "flex",
|
|
19739
|
+
alignItems: "center",
|
|
19740
|
+
justifyContent: "center",
|
|
19741
|
+
cursor: "pointer",
|
|
19742
|
+
zIndex: 2147483643,
|
|
19743
|
+
fontSize: 14,
|
|
19744
|
+
fontWeight: 700
|
|
19745
|
+
},
|
|
19746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
19747
|
+
}
|
|
19748
|
+
),
|
|
19749
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19750
|
+
ItemInteractionLayer,
|
|
19751
|
+
{
|
|
19752
|
+
rect: activeItemRect,
|
|
19753
|
+
state: toolbarState,
|
|
19754
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19755
|
+
MediaStripToolbar,
|
|
19756
|
+
{
|
|
19757
|
+
entry: activeEntry,
|
|
19758
|
+
index: active.index,
|
|
19759
|
+
pending,
|
|
19760
|
+
error,
|
|
19761
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19762
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19763
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19764
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19765
|
+
onResize: (delta) => {
|
|
19766
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19767
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19768
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19769
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19770
|
+
},
|
|
19771
|
+
onSetAlt: (alt) => {
|
|
19772
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
19773
|
+
},
|
|
19774
|
+
onSetLink: (href, linkTarget) => {
|
|
20072
19775
|
void runMutation(
|
|
20073
19776
|
active.sectionId,
|
|
20074
|
-
(tree) =>
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
19777
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19778
|
+
);
|
|
19779
|
+
},
|
|
19780
|
+
onAddItem: () => {
|
|
19781
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19782
|
+
if (!picked) return;
|
|
19783
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19784
|
+
void runMutation(
|
|
19785
|
+
active.sectionId,
|
|
19786
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19787
|
+
{ [picked.assetId]: picked.url }
|
|
19788
|
+
).then((applied) => {
|
|
19789
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19790
|
+
});
|
|
20078
19791
|
});
|
|
20079
|
-
}
|
|
20080
|
-
|
|
20081
|
-
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
|
|
19792
|
+
},
|
|
19793
|
+
onChangeImage: () => {
|
|
19794
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19795
|
+
if (!picked) return;
|
|
19796
|
+
void runMutation(
|
|
19797
|
+
active.sectionId,
|
|
19798
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
19799
|
+
{ [picked.assetId]: picked.url }
|
|
19800
|
+
);
|
|
19801
|
+
});
|
|
19802
|
+
},
|
|
19803
|
+
onRemoveItem: () => {
|
|
19804
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19805
|
+
(applied) => {
|
|
19806
|
+
if (applied) setActive(null);
|
|
19807
|
+
}
|
|
20088
19808
|
);
|
|
20089
|
-
}
|
|
20090
|
-
|
|
20091
|
-
|
|
20092
|
-
|
|
20093
|
-
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20097
|
-
|
|
20098
|
-
|
|
20099
|
-
|
|
20100
|
-
|
|
20101
|
-
|
|
20102
|
-
|
|
20103
|
-
|
|
20104
|
-
},
|
|
20105
|
-
onMoveRight: () => {
|
|
20106
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
20107
|
-
(applied) => {
|
|
20108
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20109
|
-
}
|
|
20110
|
-
);
|
|
20111
|
-
}
|
|
20112
|
-
}
|
|
20113
|
-
) }),
|
|
20114
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20115
|
-
"div",
|
|
20116
|
-
{
|
|
20117
|
-
"data-ohw-bridge": "",
|
|
20118
|
-
"data-ohw-item-interaction": "",
|
|
20119
|
-
"aria-hidden": true,
|
|
20120
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
20121
|
-
style: {
|
|
20122
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
20123
|
-
left: activeItemRect.left - 5,
|
|
20124
|
-
background: PRIMARY3,
|
|
20125
|
-
zIndex: 2147483644
|
|
20126
|
-
},
|
|
20127
|
-
children: "Media item"
|
|
20128
|
-
}
|
|
20129
|
-
),
|
|
20130
|
-
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20131
|
-
LinkModal,
|
|
20132
|
-
{
|
|
20133
|
-
href: activeHref,
|
|
20134
|
-
linkTarget: activeTarget,
|
|
20135
|
-
onClose: () => setLinkOpen(false),
|
|
20136
|
-
onSave: (href, linkTarget) => {
|
|
20137
|
-
void runMutation(
|
|
20138
|
-
active.sectionId,
|
|
20139
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
20140
|
-
);
|
|
19809
|
+
},
|
|
19810
|
+
onMoveLeft: () => {
|
|
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
|
+
},
|
|
19817
|
+
onMoveRight: () => {
|
|
19818
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19819
|
+
(applied) => {
|
|
19820
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19821
|
+
}
|
|
19822
|
+
);
|
|
19823
|
+
}
|
|
20141
19824
|
}
|
|
20142
|
-
|
|
20143
|
-
|
|
20144
|
-
|
|
19825
|
+
)
|
|
19826
|
+
}
|
|
19827
|
+
)
|
|
20145
19828
|
] });
|
|
20146
19829
|
}
|
|
20147
19830
|
|
|
20148
19831
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
20149
19832
|
var import_react14 = require("react");
|
|
20150
|
-
var
|
|
20151
|
-
var
|
|
19833
|
+
var import_lucide_react9 = require("lucide-react");
|
|
19834
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
20152
19835
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
20153
|
-
var
|
|
19836
|
+
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]";
|
|
20154
19837
|
function findPricingCardElement(sectionId, index) {
|
|
20155
19838
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
20156
19839
|
if (!sectionEl2) return null;
|
|
@@ -20162,7 +19845,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
20162
19845
|
}
|
|
20163
19846
|
function cardRefFromTarget(target) {
|
|
20164
19847
|
if (!(target instanceof Element)) return null;
|
|
20165
|
-
if (target.closest(
|
|
19848
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
20166
19849
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
20167
19850
|
if (!cardEl) return null;
|
|
20168
19851
|
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
@@ -20172,21 +19855,21 @@ function cardRefFromTarget(target) {
|
|
|
20172
19855
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
20173
19856
|
return { sectionId, index };
|
|
20174
19857
|
}
|
|
20175
|
-
function
|
|
19858
|
+
function sameRef(a, b) {
|
|
20176
19859
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
20177
19860
|
}
|
|
20178
|
-
function
|
|
19861
|
+
function rectOf(el) {
|
|
20179
19862
|
if (!el) return null;
|
|
20180
19863
|
const r2 = el.getBoundingClientRect();
|
|
20181
19864
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
20182
19865
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
20183
19866
|
}
|
|
20184
19867
|
function readRect3(ref) {
|
|
20185
|
-
return
|
|
19868
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
20186
19869
|
}
|
|
20187
19870
|
function readGridRect(ref) {
|
|
20188
19871
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
20189
|
-
return
|
|
19872
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
20190
19873
|
}
|
|
20191
19874
|
function useLiveCardRect(ref, grid = false) {
|
|
20192
19875
|
const [rect, setRect] = (0, import_react14.useState)(null);
|
|
@@ -20216,7 +19899,7 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
20216
19899
|
}
|
|
20217
19900
|
var TOOLBAR_GRID_GAP = 52;
|
|
20218
19901
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
20219
|
-
var
|
|
19902
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
20220
19903
|
function GridToolbarSlot({ gridRect, children }) {
|
|
20221
19904
|
const slotRef = (0, import_react14.useRef)(null);
|
|
20222
19905
|
const [shift, setShift] = (0, import_react14.useState)(0);
|
|
@@ -20228,7 +19911,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20228
19911
|
const w = slot.offsetWidth;
|
|
20229
19912
|
if (w <= 0) return;
|
|
20230
19913
|
const half = w / 2;
|
|
20231
|
-
const clamped = Math.max(
|
|
19914
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
20232
19915
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
20233
19916
|
};
|
|
20234
19917
|
clamp();
|
|
@@ -20237,7 +19920,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20237
19920
|
return () => ro.disconnect();
|
|
20238
19921
|
}, [centerX, children]);
|
|
20239
19922
|
const mobile = window.innerWidth <= 480;
|
|
20240
|
-
return /* @__PURE__ */ (0,
|
|
19923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20241
19924
|
"div",
|
|
20242
19925
|
{
|
|
20243
19926
|
ref: slotRef,
|
|
@@ -20272,7 +19955,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
20272
19955
|
});
|
|
20273
19956
|
}
|
|
20274
19957
|
function StyleSwatch({ style }) {
|
|
20275
|
-
return /* @__PURE__ */ (0,
|
|
19958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20276
19959
|
"span",
|
|
20277
19960
|
{
|
|
20278
19961
|
"aria-hidden": true,
|
|
@@ -20286,35 +19969,35 @@ function StyleSwatch({ style }) {
|
|
|
20286
19969
|
);
|
|
20287
19970
|
}
|
|
20288
19971
|
function ButtonGlyph() {
|
|
20289
|
-
return /* @__PURE__ */ (0,
|
|
20290
|
-
/* @__PURE__ */ (0,
|
|
20291
|
-
/* @__PURE__ */ (0,
|
|
19972
|
+
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: [
|
|
19973
|
+
/* @__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" }),
|
|
19974
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20292
19975
|
] });
|
|
20293
19976
|
}
|
|
20294
19977
|
function FeatureGlyph({ mode }) {
|
|
20295
|
-
return /* @__PURE__ */ (0,
|
|
20296
|
-
/* @__PURE__ */ (0,
|
|
20297
|
-
/* @__PURE__ */ (0,
|
|
20298
|
-
/* @__PURE__ */ (0,
|
|
20299
|
-
/* @__PURE__ */ (0,
|
|
20300
|
-
/* @__PURE__ */ (0,
|
|
20301
|
-
mode === "add" && /* @__PURE__ */ (0,
|
|
19978
|
+
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: [
|
|
19979
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19980
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
19981
|
+
/* @__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" }),
|
|
19982
|
+
/* @__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" }),
|
|
19983
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
19984
|
+
mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20302
19985
|
] });
|
|
20303
19986
|
}
|
|
20304
|
-
function
|
|
19987
|
+
function ToolbarAction({
|
|
20305
19988
|
label,
|
|
20306
19989
|
onClick,
|
|
20307
19990
|
disabled = false,
|
|
20308
19991
|
children
|
|
20309
19992
|
}) {
|
|
20310
|
-
const button = /* @__PURE__ */ (0,
|
|
20311
|
-
return /* @__PURE__ */ (0,
|
|
20312
|
-
/* @__PURE__ */ (0,
|
|
20313
|
-
/* @__PURE__ */ (0,
|
|
19993
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
19994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
19995
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
19996
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
20314
19997
|
] });
|
|
20315
19998
|
}
|
|
20316
|
-
function
|
|
20317
|
-
return /* @__PURE__ */ (0,
|
|
19999
|
+
function ToolbarSeparator() {
|
|
20000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
20318
20001
|
}
|
|
20319
20002
|
function CardStyleMenu({
|
|
20320
20003
|
value,
|
|
@@ -20322,7 +20005,7 @@ function CardStyleMenu({
|
|
|
20322
20005
|
disabled = false
|
|
20323
20006
|
}) {
|
|
20324
20007
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
20325
|
-
const trigger = /* @__PURE__ */ (0,
|
|
20008
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20326
20009
|
"button",
|
|
20327
20010
|
{
|
|
20328
20011
|
type: "button",
|
|
@@ -20333,28 +20016,28 @@ function CardStyleMenu({
|
|
|
20333
20016
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
20334
20017
|
),
|
|
20335
20018
|
children: [
|
|
20336
|
-
/* @__PURE__ */ (0,
|
|
20337
|
-
/* @__PURE__ */ (0,
|
|
20338
|
-
/* @__PURE__ */ (0,
|
|
20019
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
|
|
20020
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
|
|
20021
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
|
|
20339
20022
|
]
|
|
20340
20023
|
}
|
|
20341
20024
|
);
|
|
20342
20025
|
if (disabled) {
|
|
20343
|
-
return /* @__PURE__ */ (0,
|
|
20344
|
-
/* @__PURE__ */ (0,
|
|
20345
|
-
/* @__PURE__ */ (0,
|
|
20346
|
-
/* @__PURE__ */ (0,
|
|
20347
|
-
/* @__PURE__ */ (0,
|
|
20026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20027
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
20028
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
20029
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
|
|
20030
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
20348
20031
|
] })
|
|
20349
20032
|
] });
|
|
20350
20033
|
}
|
|
20351
|
-
return /* @__PURE__ */ (0,
|
|
20352
|
-
/* @__PURE__ */ (0,
|
|
20353
|
-
/* @__PURE__ */ (0,
|
|
20354
|
-
/* @__PURE__ */ (0,
|
|
20355
|
-
/* @__PURE__ */ (0,
|
|
20034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20035
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
20036
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
|
|
20037
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
20038
|
+
/* @__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) => {
|
|
20356
20039
|
const selected = style.value === value;
|
|
20357
|
-
return /* @__PURE__ */ (0,
|
|
20040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20358
20041
|
DropdownMenuItem,
|
|
20359
20042
|
{
|
|
20360
20043
|
role: "menuitemradio",
|
|
@@ -20362,9 +20045,9 @@ function CardStyleMenu({
|
|
|
20362
20045
|
onSelect: () => onChange(style.value),
|
|
20363
20046
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
20364
20047
|
children: [
|
|
20365
|
-
/* @__PURE__ */ (0,
|
|
20366
|
-
/* @__PURE__ */ (0,
|
|
20367
|
-
selected && /* @__PURE__ */ (0,
|
|
20048
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
|
|
20049
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
|
|
20050
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
|
|
20368
20051
|
]
|
|
20369
20052
|
},
|
|
20370
20053
|
style.value
|
|
@@ -20394,7 +20077,7 @@ function PricingCardToolbar({
|
|
|
20394
20077
|
const style = pricingCardStyle(entry.tree, index);
|
|
20395
20078
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
20396
20079
|
const mobile = window.innerWidth <= 480;
|
|
20397
|
-
return /* @__PURE__ */ (0,
|
|
20080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20398
20081
|
"div",
|
|
20399
20082
|
{
|
|
20400
20083
|
"data-ohw-bridge": "",
|
|
@@ -20406,7 +20089,7 @@ function PricingCardToolbar({
|
|
|
20406
20089
|
),
|
|
20407
20090
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
20408
20091
|
children: [
|
|
20409
|
-
/* @__PURE__ */ (0,
|
|
20092
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20410
20093
|
"div",
|
|
20411
20094
|
{
|
|
20412
20095
|
className: cn(
|
|
@@ -20415,8 +20098,8 @@ function PricingCardToolbar({
|
|
|
20415
20098
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
20416
20099
|
),
|
|
20417
20100
|
children: [
|
|
20418
|
-
/* @__PURE__ */ (0,
|
|
20419
|
-
/* @__PURE__ */ (0,
|
|
20101
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
20102
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20420
20103
|
CustomToolbarButton,
|
|
20421
20104
|
{
|
|
20422
20105
|
type: "button",
|
|
@@ -20424,8 +20107,8 @@ function PricingCardToolbar({
|
|
|
20424
20107
|
"aria-pressed": featuredTag,
|
|
20425
20108
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
20426
20109
|
className: "group size-8",
|
|
20427
|
-
children: /* @__PURE__ */ (0,
|
|
20428
|
-
|
|
20110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20111
|
+
import_lucide_react9.Star,
|
|
20429
20112
|
{
|
|
20430
20113
|
size: 16,
|
|
20431
20114
|
fill: "currentColor",
|
|
@@ -20439,25 +20122,25 @@ function PricingCardToolbar({
|
|
|
20439
20122
|
)
|
|
20440
20123
|
}
|
|
20441
20124
|
) }),
|
|
20442
|
-
/* @__PURE__ */ (0,
|
|
20125
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
20443
20126
|
] }),
|
|
20444
|
-
/* @__PURE__ */ (0,
|
|
20445
|
-
/* @__PURE__ */ (0,
|
|
20446
|
-
/* @__PURE__ */ (0,
|
|
20447
|
-
/* @__PURE__ */ (0,
|
|
20448
|
-
/* @__PURE__ */ (0,
|
|
20449
|
-
/* @__PURE__ */ (0,
|
|
20450
|
-
/* @__PURE__ */ (0,
|
|
20127
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20128
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
20129
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20130
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
|
|
20131
|
+
/* @__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: [
|
|
20132
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
|
|
20133
|
+
/* @__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" })
|
|
20451
20134
|
] }) }),
|
|
20452
|
-
/* @__PURE__ */ (0,
|
|
20453
|
-
/* @__PURE__ */ (0,
|
|
20454
|
-
/* @__PURE__ */ (0,
|
|
20455
|
-
/* @__PURE__ */ (0,
|
|
20456
|
-
/* @__PURE__ */ (0,
|
|
20135
|
+
/* @__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" }) }),
|
|
20136
|
+
/* @__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" }) }),
|
|
20137
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20138
|
+
/* @__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" } }) }),
|
|
20139
|
+
/* @__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" } }) })
|
|
20457
20140
|
]
|
|
20458
20141
|
}
|
|
20459
20142
|
),
|
|
20460
|
-
error && /* @__PURE__ */ (0,
|
|
20143
|
+
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 })
|
|
20461
20144
|
]
|
|
20462
20145
|
}
|
|
20463
20146
|
) });
|
|
@@ -20491,7 +20174,7 @@ function AiPricingCardOverlay({
|
|
|
20491
20174
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20492
20175
|
setHover((prev) => {
|
|
20493
20176
|
const next = ref && !overEditable ? ref : null;
|
|
20494
|
-
return
|
|
20177
|
+
return sameRef(prev, next) ? prev : next;
|
|
20495
20178
|
});
|
|
20496
20179
|
};
|
|
20497
20180
|
const onLeave = () => setHover(null);
|
|
@@ -20506,10 +20189,10 @@ function AiPricingCardOverlay({
|
|
|
20506
20189
|
const onClick = (e) => {
|
|
20507
20190
|
const t = e.target;
|
|
20508
20191
|
if (!(t instanceof Element)) return;
|
|
20509
|
-
if (t.closest(
|
|
20192
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
20510
20193
|
const ref = cardRefFromTarget(t);
|
|
20511
|
-
setActive((prev) =>
|
|
20512
|
-
if (!ref || !
|
|
20194
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
20195
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
20513
20196
|
};
|
|
20514
20197
|
document.addEventListener("click", onClick, true);
|
|
20515
20198
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20574,12 +20257,12 @@ function AiPricingCardOverlay({
|
|
|
20574
20257
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20575
20258
|
const activeCardRect = useLiveCardRect(active);
|
|
20576
20259
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20577
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20578
|
-
return /* @__PURE__ */ (0,
|
|
20579
|
-
hoverRect && /* @__PURE__ */ (0,
|
|
20580
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
20581
|
-
/* @__PURE__ */ (0,
|
|
20582
|
-
/* @__PURE__ */ (0,
|
|
20260
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
20261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
20262
|
+
hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
20263
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
20264
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
20265
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20583
20266
|
PricingCardToolbar,
|
|
20584
20267
|
{
|
|
20585
20268
|
entry: activeEntry,
|
|
@@ -20607,7 +20290,7 @@ function AiPricingCardOverlay({
|
|
|
20607
20290
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20608
20291
|
}
|
|
20609
20292
|
) }),
|
|
20610
|
-
/* @__PURE__ */ (0,
|
|
20293
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20611
20294
|
"div",
|
|
20612
20295
|
{
|
|
20613
20296
|
"data-ohw-bridge": "",
|
|
@@ -20629,7 +20312,7 @@ function AiPricingCardOverlay({
|
|
|
20629
20312
|
|
|
20630
20313
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20631
20314
|
var import_react15 = require("react");
|
|
20632
|
-
var
|
|
20315
|
+
var import_lucide_react10 = require("lucide-react");
|
|
20633
20316
|
|
|
20634
20317
|
// src/lib/ai-video-tree.ts
|
|
20635
20318
|
function resolveVideoBlock(tree, path) {
|
|
@@ -20671,11 +20354,39 @@ function clearVideo(tree, path) {
|
|
|
20671
20354
|
});
|
|
20672
20355
|
}
|
|
20673
20356
|
|
|
20357
|
+
// src/lib/youtube.ts
|
|
20358
|
+
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
20359
|
+
function extractYouTubeId(input) {
|
|
20360
|
+
const trimmed = input.trim();
|
|
20361
|
+
if (!trimmed) return null;
|
|
20362
|
+
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
20363
|
+
let url;
|
|
20364
|
+
try {
|
|
20365
|
+
url = new URL(trimmed);
|
|
20366
|
+
} catch {
|
|
20367
|
+
return null;
|
|
20368
|
+
}
|
|
20369
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
20370
|
+
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
20371
|
+
return null;
|
|
20372
|
+
}
|
|
20373
|
+
let candidate = null;
|
|
20374
|
+
if (host === "youtu.be") {
|
|
20375
|
+
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
20376
|
+
} else if (url.pathname === "/watch") {
|
|
20377
|
+
candidate = url.searchParams.get("v");
|
|
20378
|
+
} else {
|
|
20379
|
+
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
20380
|
+
candidate = match ? match[1] : null;
|
|
20381
|
+
}
|
|
20382
|
+
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
20383
|
+
}
|
|
20384
|
+
|
|
20674
20385
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20675
|
-
var
|
|
20386
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
20676
20387
|
var PRIMARY5 = "#0885FE";
|
|
20677
|
-
var
|
|
20678
|
-
var
|
|
20388
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20389
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
20679
20390
|
function findVideoBlockElement(sectionId, path) {
|
|
20680
20391
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
20681
20392
|
if (!sectionEl2) return null;
|
|
@@ -20735,12 +20446,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
20735
20446
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
20736
20447
|
});
|
|
20737
20448
|
}
|
|
20738
|
-
function
|
|
20449
|
+
function Pill2({
|
|
20739
20450
|
label,
|
|
20740
20451
|
onClick,
|
|
20741
20452
|
disabled
|
|
20742
20453
|
}) {
|
|
20743
|
-
return /* @__PURE__ */ (0,
|
|
20454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20744
20455
|
"button",
|
|
20745
20456
|
{
|
|
20746
20457
|
type: "button",
|
|
@@ -20756,7 +20467,7 @@ function Pill({
|
|
|
20756
20467
|
border: "none",
|
|
20757
20468
|
cursor: disabled ? "default" : "pointer",
|
|
20758
20469
|
background: "#ffffff",
|
|
20759
|
-
color:
|
|
20470
|
+
color: OHW_BLUE_DARK2,
|
|
20760
20471
|
opacity: disabled ? 0.4 : 1,
|
|
20761
20472
|
fontSize: 12,
|
|
20762
20473
|
lineHeight: "16px",
|
|
@@ -20799,8 +20510,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20799
20510
|
onCommit(id);
|
|
20800
20511
|
}
|
|
20801
20512
|
};
|
|
20802
|
-
return /* @__PURE__ */ (0,
|
|
20803
|
-
/* @__PURE__ */ (0,
|
|
20513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20514
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
20804
20515
|
"div",
|
|
20805
20516
|
{
|
|
20806
20517
|
style: {
|
|
@@ -20816,12 +20527,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20816
20527
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20817
20528
|
},
|
|
20818
20529
|
children: [
|
|
20819
|
-
/* @__PURE__ */ (0,
|
|
20530
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20820
20531
|
"span",
|
|
20821
20532
|
{
|
|
20822
20533
|
style: {
|
|
20823
20534
|
flex: "0 0 auto",
|
|
20824
|
-
color:
|
|
20535
|
+
color: OHW_BLUE_DARK2,
|
|
20825
20536
|
fontSize: 10,
|
|
20826
20537
|
lineHeight: "16px",
|
|
20827
20538
|
fontWeight: 700,
|
|
@@ -20831,7 +20542,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20831
20542
|
children: "Video"
|
|
20832
20543
|
}
|
|
20833
20544
|
),
|
|
20834
|
-
/* @__PURE__ */ (0,
|
|
20545
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20835
20546
|
"input",
|
|
20836
20547
|
{
|
|
20837
20548
|
type: "text",
|
|
@@ -20868,7 +20579,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20868
20579
|
]
|
|
20869
20580
|
}
|
|
20870
20581
|
),
|
|
20871
|
-
invalid && /* @__PURE__ */ (0,
|
|
20582
|
+
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." })
|
|
20872
20583
|
] });
|
|
20873
20584
|
}
|
|
20874
20585
|
function VideoToolbar({
|
|
@@ -20878,7 +20589,7 @@ function VideoToolbar({
|
|
|
20878
20589
|
onSetVideoId,
|
|
20879
20590
|
onRemove
|
|
20880
20591
|
}) {
|
|
20881
|
-
return /* @__PURE__ */ (0,
|
|
20592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
20882
20593
|
"div",
|
|
20883
20594
|
{
|
|
20884
20595
|
"data-ohw-bridge": "",
|
|
@@ -20890,7 +20601,7 @@ function VideoToolbar({
|
|
|
20890
20601
|
gap: 6,
|
|
20891
20602
|
alignItems: "center",
|
|
20892
20603
|
width: 280,
|
|
20893
|
-
background:
|
|
20604
|
+
background: OHW_BLUE2,
|
|
20894
20605
|
padding: 8,
|
|
20895
20606
|
borderRadius: 12,
|
|
20896
20607
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20898,9 +20609,9 @@ function VideoToolbar({
|
|
|
20898
20609
|
opacity: pending ? 0.6 : 1
|
|
20899
20610
|
},
|
|
20900
20611
|
children: [
|
|
20901
|
-
/* @__PURE__ */ (0,
|
|
20902
|
-
/* @__PURE__ */ (0,
|
|
20903
|
-
error && /* @__PURE__ */ (0,
|
|
20612
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
20613
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
20614
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20904
20615
|
]
|
|
20905
20616
|
}
|
|
20906
20617
|
);
|
|
@@ -21020,8 +20731,8 @@ function AiVideoOverlay({
|
|
|
21020
20731
|
const activeBlockRect = useLiveBlockRect(active);
|
|
21021
20732
|
const TOOLBAR_APPROX_H = 90;
|
|
21022
20733
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21023
|
-
return /* @__PURE__ */ (0,
|
|
21024
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
20734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
20735
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21025
20736
|
"button",
|
|
21026
20737
|
{
|
|
21027
20738
|
type: "button",
|
|
@@ -21049,15 +20760,15 @@ function AiVideoOverlay({
|
|
|
21049
20760
|
fontSize: 14,
|
|
21050
20761
|
fontWeight: 700
|
|
21051
20762
|
},
|
|
21052
|
-
children: /* @__PURE__ */ (0,
|
|
20763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21053
20764
|
}
|
|
21054
20765
|
),
|
|
21055
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
20766
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21056
20767
|
ItemInteractionLayer,
|
|
21057
20768
|
{
|
|
21058
20769
|
rect: activeBlockRect,
|
|
21059
20770
|
state: toolbarState,
|
|
21060
|
-
toolbar: /* @__PURE__ */ (0,
|
|
20771
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21061
20772
|
VideoToolbar,
|
|
21062
20773
|
{
|
|
21063
20774
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -21081,7 +20792,7 @@ function AiVideoOverlay({
|
|
|
21081
20792
|
|
|
21082
20793
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21083
20794
|
var import_react16 = require("react");
|
|
21084
|
-
var
|
|
20795
|
+
var import_lucide_react11 = require("lucide-react");
|
|
21085
20796
|
|
|
21086
20797
|
// src/lib/ai-carousel-tree.ts
|
|
21087
20798
|
function isCarouselBlock(node) {
|
|
@@ -21132,10 +20843,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
21132
20843
|
}
|
|
21133
20844
|
|
|
21134
20845
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21135
|
-
var
|
|
20846
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
21136
20847
|
var PRIMARY6 = "#0885FE";
|
|
21137
|
-
var
|
|
21138
|
-
var
|
|
20848
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
20849
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
21139
20850
|
function findCarouselItemElement(sectionId, index) {
|
|
21140
20851
|
const sectionEl2 = findByInstanceId(sectionId);
|
|
21141
20852
|
if (!sectionEl2) return null;
|
|
@@ -21214,8 +20925,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
21214
20925
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21215
20926
|
});
|
|
21216
20927
|
}
|
|
21217
|
-
function
|
|
21218
|
-
return /* @__PURE__ */ (0,
|
|
20928
|
+
function Pill3({ label, onClick, disabled }) {
|
|
20929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21219
20930
|
"button",
|
|
21220
20931
|
{
|
|
21221
20932
|
type: "button",
|
|
@@ -21231,7 +20942,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
21231
20942
|
border: "none",
|
|
21232
20943
|
cursor: disabled ? "default" : "pointer",
|
|
21233
20944
|
background: "#ffffff",
|
|
21234
|
-
color:
|
|
20945
|
+
color: OHW_BLUE_DARK3,
|
|
21235
20946
|
opacity: disabled ? 0.4 : 1,
|
|
21236
20947
|
fontSize: 12,
|
|
21237
20948
|
lineHeight: "16px",
|
|
@@ -21249,7 +20960,7 @@ function TogglePill({
|
|
|
21249
20960
|
onToggle,
|
|
21250
20961
|
disabled
|
|
21251
20962
|
}) {
|
|
21252
|
-
return /* @__PURE__ */ (0,
|
|
20963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
21253
20964
|
"button",
|
|
21254
20965
|
{
|
|
21255
20966
|
type: "button",
|
|
@@ -21268,7 +20979,7 @@ function TogglePill({
|
|
|
21268
20979
|
border: "none",
|
|
21269
20980
|
cursor: disabled ? "default" : "pointer",
|
|
21270
20981
|
background: "#ffffff",
|
|
21271
|
-
color:
|
|
20982
|
+
color: OHW_BLUE_DARK3,
|
|
21272
20983
|
opacity: disabled ? 0.4 : 1,
|
|
21273
20984
|
fontSize: 12,
|
|
21274
20985
|
lineHeight: "16px",
|
|
@@ -21278,7 +20989,7 @@ function TogglePill({
|
|
|
21278
20989
|
},
|
|
21279
20990
|
children: [
|
|
21280
20991
|
label,
|
|
21281
|
-
/* @__PURE__ */ (0,
|
|
20992
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21282
20993
|
"span",
|
|
21283
20994
|
{
|
|
21284
20995
|
"aria-hidden": true,
|
|
@@ -21291,10 +21002,10 @@ function TogglePill({
|
|
|
21291
21002
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
21292
21003
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
21293
21004
|
// "disabled control" rather than "switch that is off".
|
|
21294
|
-
background: on ?
|
|
21005
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
21295
21006
|
transition: "background 120ms ease"
|
|
21296
21007
|
},
|
|
21297
|
-
children: /* @__PURE__ */ (0,
|
|
21008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21298
21009
|
"span",
|
|
21299
21010
|
{
|
|
21300
21011
|
style: {
|
|
@@ -21323,7 +21034,7 @@ function CarouselSlideToolbar({
|
|
|
21323
21034
|
onChangeImage,
|
|
21324
21035
|
onToggleAutoplay
|
|
21325
21036
|
}) {
|
|
21326
|
-
return /* @__PURE__ */ (0,
|
|
21037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
21327
21038
|
"div",
|
|
21328
21039
|
{
|
|
21329
21040
|
"data-ohw-bridge": "",
|
|
@@ -21334,7 +21045,7 @@ function CarouselSlideToolbar({
|
|
|
21334
21045
|
flexDirection: "column",
|
|
21335
21046
|
gap: 6,
|
|
21336
21047
|
alignItems: "center",
|
|
21337
|
-
background:
|
|
21048
|
+
background: OHW_BLUE3,
|
|
21338
21049
|
padding: 8,
|
|
21339
21050
|
borderRadius: 12,
|
|
21340
21051
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21346,11 +21057,11 @@ function CarouselSlideToolbar({
|
|
|
21346
21057
|
pointerEvents: pending ? "none" : "auto"
|
|
21347
21058
|
},
|
|
21348
21059
|
children: [
|
|
21349
|
-
/* @__PURE__ */ (0,
|
|
21350
|
-
/* @__PURE__ */ (0,
|
|
21351
|
-
/* @__PURE__ */ (0,
|
|
21060
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21061
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
21062
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
21352
21063
|
] }),
|
|
21353
|
-
error && /* @__PURE__ */ (0,
|
|
21064
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21354
21065
|
]
|
|
21355
21066
|
}
|
|
21356
21067
|
);
|
|
@@ -21490,8 +21201,8 @@ function AiFadeCarouselOverlay({
|
|
|
21490
21201
|
const activeItemRect = useLiveItemRect2(active);
|
|
21491
21202
|
const TOOLBAR_APPROX_H = 90;
|
|
21492
21203
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21493
|
-
return /* @__PURE__ */ (0,
|
|
21494
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
21204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
21205
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21495
21206
|
"button",
|
|
21496
21207
|
{
|
|
21497
21208
|
type: "button",
|
|
@@ -21520,10 +21231,10 @@ function AiFadeCarouselOverlay({
|
|
|
21520
21231
|
fontSize: 14,
|
|
21521
21232
|
fontWeight: 700
|
|
21522
21233
|
},
|
|
21523
|
-
children: /* @__PURE__ */ (0,
|
|
21234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21524
21235
|
}
|
|
21525
21236
|
),
|
|
21526
|
-
swapping && /* @__PURE__ */ (0,
|
|
21237
|
+
swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21527
21238
|
"div",
|
|
21528
21239
|
{
|
|
21529
21240
|
ref: skeletonRef,
|
|
@@ -21541,15 +21252,15 @@ function AiFadeCarouselOverlay({
|
|
|
21541
21252
|
zIndex: 2147483646,
|
|
21542
21253
|
pointerEvents: "none"
|
|
21543
21254
|
},
|
|
21544
|
-
children: /* @__PURE__ */ (0,
|
|
21255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
|
|
21545
21256
|
}
|
|
21546
21257
|
),
|
|
21547
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
21258
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21548
21259
|
ItemInteractionLayer,
|
|
21549
21260
|
{
|
|
21550
21261
|
rect: activeItemRect,
|
|
21551
21262
|
state: toolbarState,
|
|
21552
|
-
toolbar: /* @__PURE__ */ (0,
|
|
21263
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21553
21264
|
CarouselSlideToolbar,
|
|
21554
21265
|
{
|
|
21555
21266
|
pending,
|
|
@@ -21740,6 +21451,113 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
21740
21451
|
// src/ui/link-modal/LinkPopover.tsx
|
|
21741
21452
|
var import_react20 = require("react");
|
|
21742
21453
|
|
|
21454
|
+
// src/ui/dialog.tsx
|
|
21455
|
+
var React9 = __toESM(require("react"), 1);
|
|
21456
|
+
var import_radix_ui6 = require("radix-ui");
|
|
21457
|
+
var import_lucide_react12 = require("lucide-react");
|
|
21458
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
21459
|
+
function Dialog2({
|
|
21460
|
+
...props
|
|
21461
|
+
}) {
|
|
21462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
21463
|
+
}
|
|
21464
|
+
function DialogPortal({
|
|
21465
|
+
...props
|
|
21466
|
+
}) {
|
|
21467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
21468
|
+
}
|
|
21469
|
+
function DialogOverlay({
|
|
21470
|
+
className,
|
|
21471
|
+
...props
|
|
21472
|
+
}) {
|
|
21473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21474
|
+
import_radix_ui6.Dialog.Overlay,
|
|
21475
|
+
{
|
|
21476
|
+
"data-slot": "dialog-overlay",
|
|
21477
|
+
"data-ohw-link-modal-root": "",
|
|
21478
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21479
|
+
...props
|
|
21480
|
+
}
|
|
21481
|
+
);
|
|
21482
|
+
}
|
|
21483
|
+
var DialogContent = React9.forwardRef(
|
|
21484
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21485
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
21486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
21487
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21488
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
21489
|
+
import_radix_ui6.Dialog.Content,
|
|
21490
|
+
{
|
|
21491
|
+
ref,
|
|
21492
|
+
"data-slot": "dialog-content",
|
|
21493
|
+
className: cn(
|
|
21494
|
+
positionMode,
|
|
21495
|
+
"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",
|
|
21496
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21497
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21498
|
+
className
|
|
21499
|
+
),
|
|
21500
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
21501
|
+
...props,
|
|
21502
|
+
children: [
|
|
21503
|
+
children,
|
|
21504
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21505
|
+
import_radix_ui6.Dialog.Close,
|
|
21506
|
+
{
|
|
21507
|
+
type: "button",
|
|
21508
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21509
|
+
"aria-label": "Close",
|
|
21510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
|
|
21511
|
+
}
|
|
21512
|
+
) : null
|
|
21513
|
+
]
|
|
21514
|
+
}
|
|
21515
|
+
)
|
|
21516
|
+
] });
|
|
21517
|
+
}
|
|
21518
|
+
);
|
|
21519
|
+
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
21520
|
+
function DialogHeader({
|
|
21521
|
+
className,
|
|
21522
|
+
...props
|
|
21523
|
+
}) {
|
|
21524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21525
|
+
}
|
|
21526
|
+
function DialogFooter({
|
|
21527
|
+
className,
|
|
21528
|
+
...props
|
|
21529
|
+
}) {
|
|
21530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21531
|
+
"div",
|
|
21532
|
+
{
|
|
21533
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
21534
|
+
...props
|
|
21535
|
+
}
|
|
21536
|
+
);
|
|
21537
|
+
}
|
|
21538
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21539
|
+
import_radix_ui6.Dialog.Title,
|
|
21540
|
+
{
|
|
21541
|
+
ref,
|
|
21542
|
+
className: cn(
|
|
21543
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21544
|
+
className
|
|
21545
|
+
),
|
|
21546
|
+
...props
|
|
21547
|
+
}
|
|
21548
|
+
));
|
|
21549
|
+
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
21550
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21551
|
+
import_radix_ui6.Dialog.Description,
|
|
21552
|
+
{
|
|
21553
|
+
ref,
|
|
21554
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
21555
|
+
...props
|
|
21556
|
+
}
|
|
21557
|
+
));
|
|
21558
|
+
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
21559
|
+
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
21560
|
+
|
|
21743
21561
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
21744
21562
|
var import_lucide_react16 = require("lucide-react");
|
|
21745
21563
|
|
|
@@ -22843,7 +22661,6 @@ function shouldUseDevFixtures() {
|
|
|
22843
22661
|
function getLogoElement(el) {
|
|
22844
22662
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
22845
22663
|
if (marked) return marked;
|
|
22846
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
22847
22664
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
22848
22665
|
if (!root) return null;
|
|
22849
22666
|
const anchor = el.closest("a");
|
|
@@ -25653,7 +25470,7 @@ function getNavigationSelectionParent(el) {
|
|
|
25653
25470
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
25654
25471
|
return resolveFooterLinksContainerFrom(el);
|
|
25655
25472
|
}
|
|
25656
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
25473
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
25657
25474
|
return getNavigationRoot(el);
|
|
25658
25475
|
}
|
|
25659
25476
|
return null;
|
|
@@ -25875,6 +25692,7 @@ var ICONS = {
|
|
|
25875
25692
|
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"/>',
|
|
25876
25693
|
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"/>'
|
|
25877
25694
|
};
|
|
25695
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
25878
25696
|
var SELECTION_CHROME_GAP2 = 4;
|
|
25879
25697
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
25880
25698
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -25972,7 +25790,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
25972
25790
|
el.style.top = `${top}px`;
|
|
25973
25791
|
el.style.height = `${height}px`;
|
|
25974
25792
|
}
|
|
25975
|
-
var
|
|
25793
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
25976
25794
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
25977
25795
|
const isAbove = transform.includes("translateY(-100%)");
|
|
25978
25796
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -25999,8 +25817,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
25999
25817
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
26000
25818
|
const half = toolbarWidth / 2;
|
|
26001
25819
|
return Math.max(
|
|
26002
|
-
|
|
26003
|
-
Math.min(centerX, window.innerWidth -
|
|
25820
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
25821
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
26004
25822
|
);
|
|
26005
25823
|
}
|
|
26006
25824
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26883,6 +26701,21 @@ function OhhwellsBridge() {
|
|
|
26883
26701
|
const [isItemDragging, setIsItemDragging] = (0, import_react25.useState)(false);
|
|
26884
26702
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react25.useState)(false);
|
|
26885
26703
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26704
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
|
|
26705
|
+
const floatingPanelOpenRef = (0, import_react25.useRef)(false);
|
|
26706
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
26707
|
+
const floatingPanelRef = (0, import_react25.useRef)(null);
|
|
26708
|
+
floatingPanelRef.current = floatingPanel;
|
|
26709
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
|
|
26710
|
+
const buttonCollectionDragRef = (0, import_react25.useRef)(null);
|
|
26711
|
+
const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
|
|
26712
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
|
|
26713
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
|
|
26714
|
+
const buttonPointerDragRef = (0, import_react25.useRef)(null);
|
|
26715
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
|
|
26716
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
|
|
26717
|
+
const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
|
|
26718
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
|
|
26886
26719
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react25.useState)(null);
|
|
26887
26720
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react25.useState)(null);
|
|
26888
26721
|
const footerDragRef = (0, import_react25.useRef)(null);
|
|
@@ -26909,21 +26742,6 @@ function OhhwellsBridge() {
|
|
|
26909
26742
|
const stylesRef = (0, import_react25.useRef)("");
|
|
26910
26743
|
const appliedDrawerRef = (0, import_react25.useRef)(null);
|
|
26911
26744
|
const pendingDeleteUndoRef = (0, import_react25.useRef)(null);
|
|
26912
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
|
|
26913
|
-
const floatingPanelOpenRef = (0, import_react25.useRef)(false);
|
|
26914
|
-
const floatingPanelRef = (0, import_react25.useRef)(null);
|
|
26915
|
-
floatingPanelRef.current = floatingPanel;
|
|
26916
|
-
const setFloatingPanelRef = (0, import_react25.useRef)(setFloatingPanel);
|
|
26917
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
|
|
26918
|
-
const buttonCollectionDragRef = (0, import_react25.useRef)(null);
|
|
26919
|
-
const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
|
|
26920
|
-
const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
|
|
26921
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
|
|
26922
|
-
const buttonPointerDragRef = (0, import_react25.useRef)(null);
|
|
26923
|
-
const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
|
|
26924
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
|
|
26925
|
-
const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
|
|
26926
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
|
|
26927
26745
|
const [sitePages, setSitePages] = (0, import_react25.useState)([]);
|
|
26928
26746
|
const collectionItemsRef = (0, import_react25.useRef)(/* @__PURE__ */ new Map());
|
|
26929
26747
|
const [sectionsByPath, setSectionsByPath] = (0, import_react25.useState)({});
|
|
@@ -26933,18 +26751,7 @@ function OhhwellsBridge() {
|
|
|
26933
26751
|
const linkPopoverOpenRef = (0, import_react25.useRef)(false);
|
|
26934
26752
|
const linkPopoverGraceUntilRef = (0, import_react25.useRef)(0);
|
|
26935
26753
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26936
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
26937
26754
|
linkPopoverSessionRef.current = linkPopover;
|
|
26938
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
26939
|
-
(0, import_react25.useEffect)(() => {
|
|
26940
|
-
const syncViewport = () => {
|
|
26941
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26942
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
26943
|
-
};
|
|
26944
|
-
syncViewport();
|
|
26945
|
-
window.addEventListener("resize", syncViewport);
|
|
26946
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
26947
|
-
}, []);
|
|
26948
26755
|
(0, import_react25.useEffect)(() => {
|
|
26949
26756
|
setSectionOrderPersistHandler((entries) => {
|
|
26950
26757
|
const currentPath = window.location.pathname;
|
|
@@ -28678,7 +28485,6 @@ function OhhwellsBridge() {
|
|
|
28678
28485
|
applyAiFooterFromContent(content);
|
|
28679
28486
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28680
28487
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
28681
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28682
28488
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28683
28489
|
}
|
|
28684
28490
|
applyBrandChrome(content);
|
|
@@ -28689,16 +28495,15 @@ function OhhwellsBridge() {
|
|
|
28689
28495
|
if (key === "__ohw_sections") continue;
|
|
28690
28496
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28691
28497
|
if (key === AI_FOOTER_KEY) continue;
|
|
28692
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28693
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28694
28498
|
if (key === BRAND_KIT_KEY) continue;
|
|
28695
28499
|
if (key === STYLE_STORE_KEY) continue;
|
|
28696
28500
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28501
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28697
28502
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28503
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28698
28504
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28699
28505
|
continue;
|
|
28700
28506
|
}
|
|
28701
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28702
28507
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28703
28508
|
if (applyCarouselNode(key, val)) continue;
|
|
28704
28509
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28738,7 +28543,6 @@ function OhhwellsBridge() {
|
|
|
28738
28543
|
});
|
|
28739
28544
|
applyLinkByKey(key, val);
|
|
28740
28545
|
}
|
|
28741
|
-
applySectionEmbeds(content);
|
|
28742
28546
|
applyLogoFromContent(content);
|
|
28743
28547
|
applyLogoSizes(content);
|
|
28744
28548
|
reconcileNavbarItemsFromContent(content);
|
|
@@ -28927,22 +28731,20 @@ function OhhwellsBridge() {
|
|
|
28927
28731
|
}
|
|
28928
28732
|
applyAiFooterFromContent(content);
|
|
28929
28733
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28930
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28931
28734
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28932
28735
|
}
|
|
28933
28736
|
for (const [key, val] of Object.entries(content)) {
|
|
28934
28737
|
if (key === "__ohw_sections") continue;
|
|
28935
28738
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28936
28739
|
if (key === AI_FOOTER_KEY) continue;
|
|
28937
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28938
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28939
28740
|
if (key === BRAND_KIT_KEY) continue;
|
|
28940
28741
|
if (key === STYLE_STORE_KEY) continue;
|
|
28941
28742
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28743
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28744
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28942
28745
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28943
28746
|
continue;
|
|
28944
28747
|
}
|
|
28945
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28946
28748
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28947
28749
|
if (applyCarouselNode(key, val)) continue;
|
|
28948
28750
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28967,7 +28769,6 @@ function OhhwellsBridge() {
|
|
|
28967
28769
|
});
|
|
28968
28770
|
applyLinkByKey(key, val);
|
|
28969
28771
|
}
|
|
28970
|
-
applySectionEmbeds(content);
|
|
28971
28772
|
applyLogoFromContent(content);
|
|
28972
28773
|
reconcileNavbarItemsFromContent(content);
|
|
28973
28774
|
reconcileFooterOrderFromContent(content);
|
|
@@ -29207,11 +29008,26 @@ function OhhwellsBridge() {
|
|
|
29207
29008
|
const t2 = setTimeout(measure, 500);
|
|
29208
29009
|
const ro = new ResizeObserver(schedule);
|
|
29209
29010
|
ro.observe(document.body);
|
|
29011
|
+
let lastWidth = window.innerWidth;
|
|
29012
|
+
let resizeTimers = [];
|
|
29013
|
+
const clearResizeTimers = () => {
|
|
29014
|
+
resizeTimers.forEach(clearTimeout);
|
|
29015
|
+
resizeTimers = [];
|
|
29016
|
+
};
|
|
29017
|
+
const handleResize = () => {
|
|
29018
|
+
if (window.innerWidth === lastWidth) return;
|
|
29019
|
+
lastWidth = window.innerWidth;
|
|
29020
|
+
clearResizeTimers();
|
|
29021
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
29022
|
+
};
|
|
29023
|
+
window.addEventListener("resize", handleResize);
|
|
29210
29024
|
return () => {
|
|
29211
29025
|
clearTimeout(t1);
|
|
29212
29026
|
clearTimeout(t2);
|
|
29213
29027
|
if (raf != null) cancelAnimationFrame(raf);
|
|
29214
29028
|
ro.disconnect();
|
|
29029
|
+
clearResizeTimers();
|
|
29030
|
+
window.removeEventListener("resize", handleResize);
|
|
29215
29031
|
};
|
|
29216
29032
|
}, [pathname, isEditMode, postToParent2]);
|
|
29217
29033
|
(0, import_react25.useEffect)(() => {
|
|
@@ -29508,13 +29324,6 @@ function OhhwellsBridge() {
|
|
|
29508
29324
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29509
29325
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29510
29326
|
if (isInsideLinkEditor(target)) return;
|
|
29511
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29512
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29513
|
-
if (target.closest(
|
|
29514
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29515
|
-
)) {
|
|
29516
|
-
return;
|
|
29517
|
-
}
|
|
29518
29327
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29519
29328
|
clearMediaSelectionRef.current();
|
|
29520
29329
|
}
|
|
@@ -29538,6 +29347,8 @@ function OhhwellsBridge() {
|
|
|
29538
29347
|
return;
|
|
29539
29348
|
}
|
|
29540
29349
|
}
|
|
29350
|
+
if (isInsideFloatingPanel(target)) return;
|
|
29351
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29541
29352
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29542
29353
|
if (collectionItem) {
|
|
29543
29354
|
e.preventDefault();
|
|
@@ -29549,6 +29360,11 @@ function OhhwellsBridge() {
|
|
|
29549
29360
|
});
|
|
29550
29361
|
return;
|
|
29551
29362
|
}
|
|
29363
|
+
if (target.closest(
|
|
29364
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29365
|
+
)) {
|
|
29366
|
+
return;
|
|
29367
|
+
}
|
|
29552
29368
|
{
|
|
29553
29369
|
const formEl = getFormElement(target);
|
|
29554
29370
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -29702,13 +29518,9 @@ function OhhwellsBridge() {
|
|
|
29702
29518
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
29703
29519
|
e.preventDefault();
|
|
29704
29520
|
e.stopPropagation();
|
|
29521
|
+
selectIconElementRef.current(editable);
|
|
29705
29522
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
29706
29523
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
29707
|
-
if (aiIcon) {
|
|
29708
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
29709
|
-
} else {
|
|
29710
|
-
selectIconElementRef.current(editable);
|
|
29711
|
-
}
|
|
29712
29524
|
postToParentRef.current({
|
|
29713
29525
|
type: "ow:icon-pick",
|
|
29714
29526
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -29936,9 +29748,6 @@ function OhhwellsBridge() {
|
|
|
29936
29748
|
setHoveredItemRect(null);
|
|
29937
29749
|
hoveredNavContainerRef.current = null;
|
|
29938
29750
|
setHoveredNavContainerRect(null);
|
|
29939
|
-
siblingHintElRef.current = null;
|
|
29940
|
-
setSiblingHintRect(null);
|
|
29941
|
-
setSiblingHintRects([]);
|
|
29942
29751
|
return;
|
|
29943
29752
|
}
|
|
29944
29753
|
{
|
|
@@ -30059,6 +29868,7 @@ function OhhwellsBridge() {
|
|
|
30059
29868
|
hoveredNavContainerRef.current = null;
|
|
30060
29869
|
setHoveredNavContainerRect(null);
|
|
30061
29870
|
hoveredItemElRef.current = editable;
|
|
29871
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
30062
29872
|
}
|
|
30063
29873
|
}
|
|
30064
29874
|
}
|
|
@@ -30768,11 +30578,7 @@ function OhhwellsBridge() {
|
|
|
30768
30578
|
};
|
|
30769
30579
|
const handleMouseMove = (e) => {
|
|
30770
30580
|
const { clientX, clientY } = e;
|
|
30771
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30772
|
-
dismissImageHover();
|
|
30773
|
-
clearImageHover();
|
|
30774
|
-
return;
|
|
30775
|
-
}
|
|
30581
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30776
30582
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
30777
30583
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
30778
30584
|
formHoverElRef.current = null;
|
|
@@ -30801,12 +30607,7 @@ function OhhwellsBridge() {
|
|
|
30801
30607
|
setHoveredItemRect(null);
|
|
30802
30608
|
hoveredNavContainerRef.current = null;
|
|
30803
30609
|
setHoveredNavContainerRect(null);
|
|
30804
|
-
siblingHintElRef.current = null;
|
|
30805
|
-
setSiblingHintRect(null);
|
|
30806
|
-
setSiblingHintRects([]);
|
|
30807
30610
|
dismissImageHover();
|
|
30808
|
-
clearImageHover();
|
|
30809
|
-
setSectionGap(null);
|
|
30810
30611
|
return;
|
|
30811
30612
|
}
|
|
30812
30613
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -30818,11 +30619,7 @@ function OhhwellsBridge() {
|
|
|
30818
30619
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
30819
30620
|
const { clientX, clientY } = e.data;
|
|
30820
30621
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
30821
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30822
|
-
dismissImageHover();
|
|
30823
|
-
clearImageHover();
|
|
30824
|
-
return;
|
|
30825
|
-
}
|
|
30622
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30826
30623
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
30827
30624
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
30828
30625
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -31202,7 +30999,6 @@ function OhhwellsBridge() {
|
|
|
31202
30999
|
applyAiFooterFromContent(content);
|
|
31203
31000
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
31204
31001
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
31205
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
31206
31002
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
31207
31003
|
}
|
|
31208
31004
|
applyBrandChrome(content);
|
|
@@ -31217,16 +31013,15 @@ function OhhwellsBridge() {
|
|
|
31217
31013
|
}
|
|
31218
31014
|
if (key === AI_SECTIONS_KEY) continue;
|
|
31219
31015
|
if (key === AI_FOOTER_KEY) continue;
|
|
31220
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31221
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31222
31016
|
if (key === BRAND_KIT_KEY) continue;
|
|
31223
31017
|
if (key === STYLE_STORE_KEY) continue;
|
|
31224
31018
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
31019
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31225
31020
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
31021
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31226
31022
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
31227
31023
|
continue;
|
|
31228
31024
|
}
|
|
31229
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
31230
31025
|
if (applyVideoSettingNode(key, val)) continue;
|
|
31231
31026
|
if (applyCarouselNode(key, val)) continue;
|
|
31232
31027
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -31252,7 +31047,6 @@ function OhhwellsBridge() {
|
|
|
31252
31047
|
});
|
|
31253
31048
|
applyLinkByKey(key, val);
|
|
31254
31049
|
}
|
|
31255
|
-
applySectionEmbeds(content);
|
|
31256
31050
|
applyLogoFromContent(content);
|
|
31257
31051
|
applyLogoSizes(content);
|
|
31258
31052
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
@@ -31885,12 +31679,6 @@ function OhhwellsBridge() {
|
|
|
31885
31679
|
closeLinkPopoverRef.current();
|
|
31886
31680
|
return;
|
|
31887
31681
|
}
|
|
31888
|
-
if (floatingPanelOpenRef.current) {
|
|
31889
|
-
setFloatingPanelRef.current(null);
|
|
31890
|
-
deselectRef.current();
|
|
31891
|
-
deactivateRef.current();
|
|
31892
|
-
return;
|
|
31893
|
-
}
|
|
31894
31682
|
deselectRef.current();
|
|
31895
31683
|
deactivateRef.current();
|
|
31896
31684
|
clearMediaSelectionRef.current();
|
|
@@ -32727,10 +32515,10 @@ function OhhwellsBridge() {
|
|
|
32727
32515
|
window.removeEventListener("message", handleDuplicateSection);
|
|
32728
32516
|
window.removeEventListener("message", handleDeactivate);
|
|
32729
32517
|
window.removeEventListener("message", handleSelectNav);
|
|
32518
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32730
32519
|
window.removeEventListener("message", handleToastAction);
|
|
32731
32520
|
window.removeEventListener("message", handleFormCount);
|
|
32732
32521
|
window.removeEventListener("message", handleUiEscape);
|
|
32733
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32734
32522
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
32735
32523
|
autoSaveTimers.current.clear();
|
|
32736
32524
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -33024,7 +32812,7 @@ function OhhwellsBridge() {
|
|
|
33024
32812
|
postToParent2({
|
|
33025
32813
|
type: "ow:ready",
|
|
33026
32814
|
version: "1",
|
|
33027
|
-
bridgeVersion: "0.1.
|
|
32815
|
+
bridgeVersion: "0.1.169",
|
|
33028
32816
|
path: pathname,
|
|
33029
32817
|
nodes: collectEditableNodes(editContentRef.current),
|
|
33030
32818
|
sections
|