@ohhwells/bridge 0.1.166-next.442 → 0.1.167
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.167";
|
|
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.167" : "";
|
|
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
|
)
|
|
@@ -19244,7 +19056,7 @@ function AiSectionOverlay({
|
|
|
19244
19056
|
|
|
19245
19057
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19246
19058
|
var import_react13 = require("react");
|
|
19247
|
-
var
|
|
19059
|
+
var import_lucide_react8 = require("lucide-react");
|
|
19248
19060
|
|
|
19249
19061
|
// src/lib/ai-media-strip-tree.ts
|
|
19250
19062
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19358,6 +19170,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19358
19170
|
return true;
|
|
19359
19171
|
});
|
|
19360
19172
|
}
|
|
19173
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
19174
|
+
return withMediaStrip(tree, (block) => {
|
|
19175
|
+
const items = block.items;
|
|
19176
|
+
if (index < 0 || index >= items.length) return false;
|
|
19177
|
+
items[index] = { ...items[index], alt };
|
|
19178
|
+
return true;
|
|
19179
|
+
});
|
|
19180
|
+
}
|
|
19361
19181
|
function setMediaStripItemLink(tree, index, link) {
|
|
19362
19182
|
return withMediaStrip(tree, (block) => {
|
|
19363
19183
|
const items = block.items;
|
|
@@ -19375,117 +19195,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19375
19195
|
});
|
|
19376
19196
|
}
|
|
19377
19197
|
|
|
19378
|
-
// src/ui/dialog.tsx
|
|
19379
|
-
var React9 = __toESM(require("react"), 1);
|
|
19380
|
-
var import_radix_ui6 = require("radix-ui");
|
|
19381
|
-
var import_lucide_react8 = require("lucide-react");
|
|
19382
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
19383
|
-
function Dialog2({
|
|
19384
|
-
...props
|
|
19385
|
-
}) {
|
|
19386
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
19387
|
-
}
|
|
19388
|
-
function DialogPortal({
|
|
19389
|
-
...props
|
|
19390
|
-
}) {
|
|
19391
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
19392
|
-
}
|
|
19393
|
-
function DialogOverlay({
|
|
19394
|
-
className,
|
|
19395
|
-
...props
|
|
19396
|
-
}) {
|
|
19397
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19398
|
-
import_radix_ui6.Dialog.Overlay,
|
|
19399
|
-
{
|
|
19400
|
-
"data-slot": "dialog-overlay",
|
|
19401
|
-
"data-ohw-link-modal-root": "",
|
|
19402
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19403
|
-
...props
|
|
19404
|
-
}
|
|
19405
|
-
);
|
|
19406
|
-
}
|
|
19407
|
-
var DialogContent = React9.forwardRef(
|
|
19408
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19409
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
19410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
19411
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19412
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19413
|
-
import_radix_ui6.Dialog.Content,
|
|
19414
|
-
{
|
|
19415
|
-
ref,
|
|
19416
|
-
"data-slot": "dialog-content",
|
|
19417
|
-
className: cn(
|
|
19418
|
-
positionMode,
|
|
19419
|
-
"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",
|
|
19420
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19421
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19422
|
-
className
|
|
19423
|
-
),
|
|
19424
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
19425
|
-
...props,
|
|
19426
|
-
children: [
|
|
19427
|
-
children,
|
|
19428
|
-
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19429
|
-
import_radix_ui6.Dialog.Close,
|
|
19430
|
-
{
|
|
19431
|
-
type: "button",
|
|
19432
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19433
|
-
"aria-label": "Close",
|
|
19434
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
|
|
19435
|
-
}
|
|
19436
|
-
) : null
|
|
19437
|
-
]
|
|
19438
|
-
}
|
|
19439
|
-
)
|
|
19440
|
-
] });
|
|
19441
|
-
}
|
|
19442
|
-
);
|
|
19443
|
-
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
19444
|
-
function DialogHeader({
|
|
19445
|
-
className,
|
|
19446
|
-
...props
|
|
19447
|
-
}) {
|
|
19448
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19449
|
-
}
|
|
19450
|
-
function DialogFooter({
|
|
19451
|
-
className,
|
|
19452
|
-
...props
|
|
19453
|
-
}) {
|
|
19454
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19455
|
-
"div",
|
|
19456
|
-
{
|
|
19457
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
19458
|
-
...props
|
|
19459
|
-
}
|
|
19460
|
-
);
|
|
19461
|
-
}
|
|
19462
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19463
|
-
import_radix_ui6.Dialog.Title,
|
|
19464
|
-
{
|
|
19465
|
-
ref,
|
|
19466
|
-
className: cn(
|
|
19467
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19468
|
-
className
|
|
19469
|
-
),
|
|
19470
|
-
...props
|
|
19471
|
-
}
|
|
19472
|
-
));
|
|
19473
|
-
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
19474
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19475
|
-
import_radix_ui6.Dialog.Description,
|
|
19476
|
-
{
|
|
19477
|
-
ref,
|
|
19478
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
19479
|
-
...props
|
|
19480
|
-
}
|
|
19481
|
-
));
|
|
19482
|
-
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
19483
|
-
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
19484
|
-
|
|
19485
19198
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19486
|
-
var
|
|
19487
|
-
var PRIMARY3 = "
|
|
19488
|
-
var
|
|
19199
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
19200
|
+
var PRIMARY3 = "#0885FE";
|
|
19201
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
19202
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19489
19203
|
function findMediaStripItemElement(sectionId, index) {
|
|
19490
19204
|
const sectionEl = findByInstanceId(sectionId);
|
|
19491
19205
|
if (!sectionEl) return null;
|
|
@@ -19495,35 +19209,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
19495
19209
|
}
|
|
19496
19210
|
return null;
|
|
19497
19211
|
}
|
|
19498
|
-
function
|
|
19499
|
-
|
|
19500
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19501
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19502
|
-
if (!itemEl) return null;
|
|
19503
|
-
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19504
|
-
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19505
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19506
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19507
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
19508
|
-
return { sectionId, index };
|
|
19509
|
-
}
|
|
19510
|
-
function sameRef(a, b) {
|
|
19511
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19512
|
-
}
|
|
19513
|
-
function rectOf(el) {
|
|
19212
|
+
function readRect2(ref) {
|
|
19213
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19514
19214
|
if (!el) return null;
|
|
19515
19215
|
const r2 = el.getBoundingClientRect();
|
|
19516
19216
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19517
19217
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19518
19218
|
}
|
|
19519
|
-
function
|
|
19520
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19521
|
-
}
|
|
19522
|
-
function readStripRect(ref) {
|
|
19523
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19524
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19525
|
-
}
|
|
19526
|
-
function useLiveItemRect(ref, strip = false) {
|
|
19219
|
+
function useLiveItemRect(ref) {
|
|
19527
19220
|
const [rect, setRect] = (0, import_react13.useState)(null);
|
|
19528
19221
|
(0, import_react13.useEffect)(() => {
|
|
19529
19222
|
if (!ref) {
|
|
@@ -19531,7 +19224,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19531
19224
|
return;
|
|
19532
19225
|
}
|
|
19533
19226
|
const update = () => {
|
|
19534
|
-
const next =
|
|
19227
|
+
const next = readRect2(ref);
|
|
19535
19228
|
setRect(
|
|
19536
19229
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19537
19230
|
);
|
|
@@ -19546,49 +19239,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19546
19239
|
window.removeEventListener("resize", update);
|
|
19547
19240
|
clearInterval(interval);
|
|
19548
19241
|
};
|
|
19549
|
-
}, [ref?.sectionId, ref?.index
|
|
19242
|
+
}, [ref?.sectionId, ref?.index]);
|
|
19550
19243
|
return rect;
|
|
19551
19244
|
}
|
|
19552
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
19553
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19554
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19555
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
19556
|
-
const slotRef = (0, import_react13.useRef)(null);
|
|
19557
|
-
const [shift, setShift] = (0, import_react13.useState)(0);
|
|
19558
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
19559
|
-
(0, import_react13.useLayoutEffect)(() => {
|
|
19560
|
-
const slot = slotRef.current;
|
|
19561
|
-
if (!slot) return;
|
|
19562
|
-
const clamp = () => {
|
|
19563
|
-
const w = slot.offsetWidth;
|
|
19564
|
-
if (w <= 0) return;
|
|
19565
|
-
const half = w / 2;
|
|
19566
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19567
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19568
|
-
};
|
|
19569
|
-
clamp();
|
|
19570
|
-
const ro = new ResizeObserver(clamp);
|
|
19571
|
-
ro.observe(slot);
|
|
19572
|
-
return () => ro.disconnect();
|
|
19573
|
-
}, [centerX, children]);
|
|
19574
|
-
const mobile = window.innerWidth <= 480;
|
|
19575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19576
|
-
"div",
|
|
19577
|
-
{
|
|
19578
|
-
ref: slotRef,
|
|
19579
|
-
"data-ohw-bridge": "",
|
|
19580
|
-
"data-ohw-item-interaction": "",
|
|
19581
|
-
className: "pointer-events-auto fixed",
|
|
19582
|
-
style: {
|
|
19583
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19584
|
-
left: centerX + shift,
|
|
19585
|
-
transform: "translate(-50%, -100%)",
|
|
19586
|
-
zIndex: 2147483645
|
|
19587
|
-
},
|
|
19588
|
-
children
|
|
19589
|
-
}
|
|
19590
|
-
);
|
|
19591
|
-
}
|
|
19592
19245
|
function requestValidateTree(postToParent2, tree) {
|
|
19593
19246
|
return new Promise((resolve) => {
|
|
19594
19247
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19625,72 +19278,116 @@ function requestAssetPick(postToParent2) {
|
|
|
19625
19278
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19626
19279
|
});
|
|
19627
19280
|
}
|
|
19628
|
-
function
|
|
19281
|
+
function Pill({
|
|
19629
19282
|
label,
|
|
19630
19283
|
onClick,
|
|
19631
|
-
disabled
|
|
19632
|
-
active
|
|
19633
|
-
children
|
|
19634
|
-
}) {
|
|
19635
|
-
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
|
|
19636
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
19637
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
19638
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
19639
|
-
] });
|
|
19640
|
-
}
|
|
19641
|
-
function ToolbarSeparator() {
|
|
19642
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
19643
|
-
}
|
|
19644
|
-
function OptionMenu({
|
|
19645
|
-
label,
|
|
19646
|
-
value,
|
|
19647
|
-
options,
|
|
19648
|
-
onChange
|
|
19284
|
+
disabled,
|
|
19285
|
+
active
|
|
19649
19286
|
}) {
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19288
|
+
"button",
|
|
19289
|
+
{
|
|
19290
|
+
type: "button",
|
|
19291
|
+
onClick,
|
|
19292
|
+
disabled,
|
|
19293
|
+
style: {
|
|
19294
|
+
height: 28,
|
|
19295
|
+
padding: "0 10px",
|
|
19296
|
+
display: "inline-flex",
|
|
19297
|
+
alignItems: "center",
|
|
19298
|
+
gap: 4,
|
|
19299
|
+
borderRadius: 999,
|
|
19300
|
+
border: "none",
|
|
19301
|
+
cursor: disabled ? "default" : "pointer",
|
|
19302
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19303
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19304
|
+
opacity: disabled ? 0.4 : 1,
|
|
19305
|
+
fontSize: 12,
|
|
19306
|
+
lineHeight: "16px",
|
|
19307
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19308
|
+
whiteSpace: "nowrap",
|
|
19309
|
+
flex: "0 0 auto"
|
|
19310
|
+
},
|
|
19311
|
+
children: label
|
|
19312
|
+
}
|
|
19313
|
+
);
|
|
19314
|
+
}
|
|
19315
|
+
function AltInput({ value, onCommit }) {
|
|
19316
|
+
const [draft, setDraft] = (0, import_react13.useState)(value);
|
|
19317
|
+
(0, import_react13.useEffect)(() => setDraft(value), [value]);
|
|
19318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19319
|
+
"div",
|
|
19320
|
+
{
|
|
19321
|
+
style: {
|
|
19322
|
+
display: "flex",
|
|
19323
|
+
alignItems: "center",
|
|
19324
|
+
gap: 6,
|
|
19325
|
+
height: 28,
|
|
19326
|
+
padding: "0 12px",
|
|
19327
|
+
borderRadius: 999,
|
|
19328
|
+
background: "#ffffff",
|
|
19329
|
+
width: "100%",
|
|
19330
|
+
maxWidth: 260,
|
|
19331
|
+
boxSizing: "border-box"
|
|
19332
|
+
},
|
|
19333
|
+
children: [
|
|
19334
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19335
|
+
"span",
|
|
19670
19336
|
{
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
)
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19337
|
+
style: {
|
|
19338
|
+
flex: "0 0 auto",
|
|
19339
|
+
color: OHW_BLUE_DARK,
|
|
19340
|
+
fontSize: 10,
|
|
19341
|
+
fontWeight: 700,
|
|
19342
|
+
textTransform: "uppercase",
|
|
19343
|
+
letterSpacing: 0.4
|
|
19344
|
+
},
|
|
19345
|
+
children: "Alt"
|
|
19346
|
+
}
|
|
19347
|
+
),
|
|
19348
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19349
|
+
"input",
|
|
19350
|
+
{
|
|
19351
|
+
type: "text",
|
|
19352
|
+
value: draft,
|
|
19353
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19354
|
+
onBlur: () => {
|
|
19355
|
+
if (draft !== value) onCommit(draft);
|
|
19356
|
+
},
|
|
19357
|
+
onKeyDown: (e) => {
|
|
19358
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19359
|
+
if (e.key === "Escape") {
|
|
19360
|
+
setDraft(value);
|
|
19361
|
+
e.currentTarget.blur();
|
|
19362
|
+
}
|
|
19363
|
+
},
|
|
19364
|
+
placeholder: "Describe this image",
|
|
19365
|
+
"aria-label": "Image alt text",
|
|
19366
|
+
style: {
|
|
19367
|
+
flex: 1,
|
|
19368
|
+
minWidth: 0,
|
|
19369
|
+
border: "none",
|
|
19370
|
+
outline: "none",
|
|
19371
|
+
background: "transparent",
|
|
19372
|
+
fontSize: 12,
|
|
19373
|
+
lineHeight: "16px",
|
|
19374
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19375
|
+
color: "#1f2937"
|
|
19376
|
+
}
|
|
19377
|
+
}
|
|
19378
|
+
)
|
|
19379
|
+
]
|
|
19380
|
+
}
|
|
19381
|
+
);
|
|
19685
19382
|
}
|
|
19686
19383
|
var VARIANTS = [
|
|
19687
19384
|
{ value: "logos", label: "Logos" },
|
|
19688
19385
|
{ value: "reel", label: "Reel" }
|
|
19689
19386
|
];
|
|
19690
19387
|
var ALIGNS = [
|
|
19691
|
-
{ value: "left", label: "
|
|
19692
|
-
{ value: "center", label: "
|
|
19693
|
-
{ value: "right", label: "
|
|
19388
|
+
{ value: "left", label: "Left" },
|
|
19389
|
+
{ value: "center", label: "Center" },
|
|
19390
|
+
{ value: "right", label: "Right" }
|
|
19694
19391
|
];
|
|
19695
19392
|
var HOVERS = [
|
|
19696
19393
|
{ value: "none", label: "None" },
|
|
@@ -19698,104 +19395,104 @@ var HOVERS = [
|
|
|
19698
19395
|
{ value: "zoom", label: "Zoom" },
|
|
19699
19396
|
{ value: "fade", label: "Fade" }
|
|
19700
19397
|
];
|
|
19398
|
+
var TREATMENTS = [
|
|
19399
|
+
{ value: "color", label: "Color" },
|
|
19400
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
19401
|
+
];
|
|
19701
19402
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
19702
|
-
function
|
|
19703
|
-
|
|
19704
|
-
linkTarget,
|
|
19705
|
-
onClose,
|
|
19706
|
-
onSave
|
|
19707
|
-
}) {
|
|
19708
|
-
const [draft, setDraft] = (0, import_react13.useState)(href);
|
|
19709
|
-
const [newTab, setNewTab] = (0, import_react13.useState)(linkTarget !== "same-tab");
|
|
19403
|
+
function LinkInput({ value, onCommit }) {
|
|
19404
|
+
const [draft, setDraft] = (0, import_react13.useState)(value);
|
|
19710
19405
|
const [invalid, setInvalid] = (0, import_react13.useState)(false);
|
|
19711
|
-
|
|
19406
|
+
(0, import_react13.useEffect)(() => {
|
|
19407
|
+
setDraft(value);
|
|
19408
|
+
setInvalid(false);
|
|
19409
|
+
}, [value]);
|
|
19410
|
+
const commit2 = () => {
|
|
19712
19411
|
const next = draft.trim();
|
|
19713
|
-
if (next
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
19718
|
-
onClose();
|
|
19412
|
+
if (next === value) return setInvalid(false);
|
|
19413
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
19414
|
+
setInvalid(false);
|
|
19415
|
+
onCommit(next);
|
|
19719
19416
|
};
|
|
19720
|
-
return /* @__PURE__ */ (0,
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
"
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
"
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
|
|
19745
|
-
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
|
|
19752
|
-
|
|
19753
|
-
|
|
19754
|
-
|
|
19755
|
-
|
|
19756
|
-
|
|
19757
|
-
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19418
|
+
"div",
|
|
19419
|
+
{
|
|
19420
|
+
style: {
|
|
19421
|
+
display: "flex",
|
|
19422
|
+
alignItems: "center",
|
|
19423
|
+
gap: 6,
|
|
19424
|
+
height: 28,
|
|
19425
|
+
padding: "0 12px",
|
|
19426
|
+
borderRadius: 999,
|
|
19427
|
+
background: "#ffffff",
|
|
19428
|
+
width: "100%",
|
|
19429
|
+
maxWidth: 260,
|
|
19430
|
+
boxSizing: "border-box",
|
|
19431
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19432
|
+
},
|
|
19433
|
+
children: [
|
|
19434
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19435
|
+
"span",
|
|
19436
|
+
{
|
|
19437
|
+
style: {
|
|
19438
|
+
flex: "0 0 auto",
|
|
19439
|
+
color: OHW_BLUE_DARK,
|
|
19440
|
+
fontSize: 10,
|
|
19441
|
+
fontWeight: 700,
|
|
19442
|
+
textTransform: "uppercase",
|
|
19443
|
+
letterSpacing: 0.4
|
|
19444
|
+
},
|
|
19445
|
+
children: "Link"
|
|
19446
|
+
}
|
|
19447
|
+
),
|
|
19448
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19449
|
+
"input",
|
|
19450
|
+
{
|
|
19451
|
+
type: "text",
|
|
19452
|
+
inputMode: "url",
|
|
19453
|
+
value: draft,
|
|
19454
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19455
|
+
onBlur: commit2,
|
|
19456
|
+
onKeyDown: (e) => {
|
|
19457
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19458
|
+
if (e.key === "Escape") {
|
|
19459
|
+
setDraft(value);
|
|
19460
|
+
setInvalid(false);
|
|
19461
|
+
e.currentTarget.blur();
|
|
19462
|
+
}
|
|
19463
|
+
},
|
|
19464
|
+
placeholder: "https://example.com",
|
|
19465
|
+
"aria-label": "Image link URL",
|
|
19466
|
+
"aria-invalid": invalid,
|
|
19467
|
+
style: {
|
|
19468
|
+
flex: 1,
|
|
19469
|
+
minWidth: 0,
|
|
19470
|
+
border: "none",
|
|
19471
|
+
outline: "none",
|
|
19472
|
+
background: "transparent",
|
|
19473
|
+
fontSize: 12,
|
|
19474
|
+
lineHeight: "16px",
|
|
19475
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19476
|
+
color: "#1f2937"
|
|
19477
|
+
}
|
|
19478
|
+
}
|
|
19479
|
+
)
|
|
19480
|
+
]
|
|
19481
|
+
}
|
|
19482
|
+
);
|
|
19785
19483
|
}
|
|
19786
19484
|
function MediaStripToolbar({
|
|
19787
19485
|
entry,
|
|
19788
19486
|
index,
|
|
19789
19487
|
pending,
|
|
19790
19488
|
error,
|
|
19791
|
-
itemEditOn,
|
|
19792
|
-
onToggleItemEdit,
|
|
19793
19489
|
onSetVariant,
|
|
19794
19490
|
onSetAlign,
|
|
19795
19491
|
onSetHover,
|
|
19796
19492
|
onSetTreatment,
|
|
19797
19493
|
onResize,
|
|
19798
|
-
|
|
19494
|
+
onSetAlt,
|
|
19495
|
+
onSetLink,
|
|
19799
19496
|
onAddItem,
|
|
19800
19497
|
onRemoveItem,
|
|
19801
19498
|
onChangeImage,
|
|
@@ -19804,102 +19501,81 @@ function MediaStripToolbar({
|
|
|
19804
19501
|
}) {
|
|
19805
19502
|
const items = mediaStripItems(entry.tree);
|
|
19806
19503
|
const itemCount = items.length;
|
|
19504
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
19505
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
19506
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19807
19507
|
const slots = findMediaStripSlots(entry.tree);
|
|
19808
19508
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19809
19509
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
19810
19510
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
19811
19511
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
19812
19512
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19813
|
-
const
|
|
19814
|
-
const
|
|
19815
|
-
|
|
19513
|
+
const isMobile = window.innerWidth <= 480;
|
|
19514
|
+
const rowStyle = isMobile ? {
|
|
19515
|
+
display: "flex",
|
|
19516
|
+
gap: 6,
|
|
19517
|
+
flexWrap: "nowrap",
|
|
19518
|
+
justifyContent: "center",
|
|
19519
|
+
overflowX: "auto",
|
|
19520
|
+
WebkitOverflowScrolling: "touch",
|
|
19521
|
+
width: "100%",
|
|
19522
|
+
scrollbarWidth: "none"
|
|
19523
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
19816
19525
|
"div",
|
|
19817
19526
|
{
|
|
19818
19527
|
"data-ohw-bridge": "",
|
|
19819
19528
|
"data-ohw-toolbar": "",
|
|
19820
19529
|
onMouseDown: (e) => e.stopPropagation(),
|
|
19821
|
-
|
|
19822
|
-
|
|
19530
|
+
style: {
|
|
19531
|
+
display: "flex",
|
|
19532
|
+
flexDirection: "column",
|
|
19533
|
+
gap: 6,
|
|
19534
|
+
alignItems: "center",
|
|
19535
|
+
background: OHW_BLUE,
|
|
19536
|
+
padding: 8,
|
|
19537
|
+
borderRadius: 12,
|
|
19538
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19539
|
+
pointerEvents: pending ? "none" : "auto",
|
|
19540
|
+
opacity: pending ? 0.6 : 1,
|
|
19541
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19542
|
+
},
|
|
19823
19543
|
children: [
|
|
19824
|
-
/* @__PURE__ */ (0,
|
|
19825
|
-
|
|
19826
|
-
{
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
) }),
|
|
19857
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
19858
|
-
] }),
|
|
19859
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19860
|
-
/* @__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" } }) }),
|
|
19861
|
-
/* @__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" } }) }),
|
|
19862
|
-
/* @__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" } }) }),
|
|
19863
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19864
|
-
ToolbarAction,
|
|
19865
|
-
{
|
|
19866
|
-
label: gatedLabel("Move right"),
|
|
19867
|
-
onClick: onMoveRight,
|
|
19868
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
19869
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
|
|
19870
|
-
}
|
|
19871
|
-
),
|
|
19872
|
-
/* @__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" } }) }),
|
|
19873
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19874
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
19875
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
19876
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
19877
|
-
ToolbarAction,
|
|
19878
|
-
{
|
|
19879
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
19880
|
-
active: treatment === "grayscale",
|
|
19881
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
19882
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
19883
|
-
}
|
|
19884
|
-
),
|
|
19885
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19886
|
-
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)),
|
|
19887
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19888
|
-
/* @__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" } }) }),
|
|
19889
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
19890
|
-
sizeValue,
|
|
19891
|
-
"px"
|
|
19892
|
-
] }),
|
|
19893
|
-
/* @__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" } }) }),
|
|
19894
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
19895
|
-
/* @__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" } }) })
|
|
19896
|
-
]
|
|
19897
|
-
}
|
|
19898
|
-
),
|
|
19899
|
-
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 })
|
|
19544
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19545
|
+
VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
19546
|
+
ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
19547
|
+
] }),
|
|
19548
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19549
|
+
HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
19550
|
+
TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
19551
|
+
] }),
|
|
19552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
19553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
19554
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
19555
|
+
sizeValue,
|
|
19556
|
+
"px"
|
|
19557
|
+
] }),
|
|
19558
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
|
|
19559
|
+
] }),
|
|
19560
|
+
/* @__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 }) }),
|
|
19561
|
+
/* @__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) }) }),
|
|
19562
|
+
currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19563
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
19564
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
19565
|
+
] }),
|
|
19566
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19567
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
19568
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
19569
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
19570
|
+
] }),
|
|
19571
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
|
|
19572
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
19573
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
19574
|
+
] }),
|
|
19575
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
19900
19576
|
]
|
|
19901
19577
|
}
|
|
19902
|
-
)
|
|
19578
|
+
);
|
|
19903
19579
|
}
|
|
19904
19580
|
function findMediaStripSlots(tree) {
|
|
19905
19581
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -19918,23 +19594,31 @@ function AiMediaStripOverlay({
|
|
|
19918
19594
|
}) {
|
|
19919
19595
|
const [hover, setHover] = (0, import_react13.useState)(null);
|
|
19920
19596
|
const [active, setActive] = (0, import_react13.useState)(null);
|
|
19921
|
-
const [itemEditOn, setItemEditOn] = (0, import_react13.useState)(false);
|
|
19922
|
-
const [linkOpen, setLinkOpen] = (0, import_react13.useState)(false);
|
|
19923
19597
|
const [pending, setPending] = (0, import_react13.useState)(false);
|
|
19924
19598
|
const [error, setError] = (0, import_react13.useState)(null);
|
|
19925
19599
|
const activeRef = (0, import_react13.useRef)(null);
|
|
19926
19600
|
activeRef.current = active;
|
|
19927
|
-
const linkOpenRef = (0, import_react13.useRef)(false);
|
|
19928
|
-
linkOpenRef.current = linkOpen;
|
|
19929
19601
|
(0, import_react13.useEffect)(() => {
|
|
19930
19602
|
const onMove = (e) => {
|
|
19931
|
-
const ref = itemRefFromTarget(e.target);
|
|
19932
19603
|
const t = e.target;
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19604
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19605
|
+
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]")) {
|
|
19606
|
+
return;
|
|
19607
|
+
}
|
|
19608
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
19609
|
+
if (!itemEl) {
|
|
19610
|
+
setHover(null);
|
|
19611
|
+
return;
|
|
19612
|
+
}
|
|
19613
|
+
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19614
|
+
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19615
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19616
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19617
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
19618
|
+
setHover(null);
|
|
19619
|
+
return;
|
|
19620
|
+
}
|
|
19621
|
+
setHover({ sectionId, index });
|
|
19938
19622
|
};
|
|
19939
19623
|
const onLeave = () => setHover(null);
|
|
19940
19624
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -19946,25 +19630,23 @@ function AiMediaStripOverlay({
|
|
|
19946
19630
|
}, []);
|
|
19947
19631
|
(0, import_react13.useEffect)(() => {
|
|
19948
19632
|
const onClick = (e) => {
|
|
19633
|
+
const current = activeRef.current;
|
|
19634
|
+
if (!current) return;
|
|
19949
19635
|
const t = e.target;
|
|
19950
|
-
if (!(t instanceof
|
|
19951
|
-
if (t.closest(
|
|
19952
|
-
const
|
|
19953
|
-
if (
|
|
19954
|
-
|
|
19955
|
-
setItemEditOn(false);
|
|
19636
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19637
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
19638
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
19639
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
19640
|
+
setActive(null);
|
|
19956
19641
|
setError(null);
|
|
19957
|
-
setActive(ref);
|
|
19958
19642
|
};
|
|
19959
19643
|
document.addEventListener("click", onClick, true);
|
|
19960
19644
|
return () => document.removeEventListener("click", onClick, true);
|
|
19961
|
-
}, [
|
|
19645
|
+
}, []);
|
|
19962
19646
|
(0, import_react13.useEffect)(() => {
|
|
19963
19647
|
const onBlur = () => {
|
|
19964
19648
|
if (!activeRef.current) return;
|
|
19965
19649
|
setActive(null);
|
|
19966
|
-
setItemEditOn(false);
|
|
19967
|
-
setLinkOpen(false);
|
|
19968
19650
|
setError(null);
|
|
19969
19651
|
};
|
|
19970
19652
|
window.addEventListener("blur", onBlur);
|
|
@@ -19974,10 +19656,7 @@ function AiMediaStripOverlay({
|
|
|
19974
19656
|
const onKeyDown = (e) => {
|
|
19975
19657
|
if (e.key !== "Escape") return;
|
|
19976
19658
|
if (!activeRef.current) return;
|
|
19977
|
-
if (linkOpenRef.current) return;
|
|
19978
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
19979
19659
|
setActive(null);
|
|
19980
|
-
setItemEditOn(false);
|
|
19981
19660
|
setError(null);
|
|
19982
19661
|
};
|
|
19983
19662
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -20011,133 +19690,137 @@ function AiMediaStripOverlay({
|
|
|
20011
19690
|
tree: nextTree,
|
|
20012
19691
|
label: entry.label,
|
|
20013
19692
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
20014
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
20015
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
20016
|
-
// on every edit reads as the section jumping around.
|
|
20017
|
-
skipScrollIntoView: true
|
|
19693
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
20018
19694
|
});
|
|
20019
19695
|
return true;
|
|
20020
19696
|
},
|
|
20021
19697
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
20022
19698
|
);
|
|
20023
19699
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
19700
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
20024
19701
|
const activeItemRect = useLiveItemRect(active);
|
|
20025
|
-
const
|
|
20026
|
-
const
|
|
20027
|
-
|
|
20028
|
-
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
19702
|
+
const TOOLBAR_APPROX_H = 170;
|
|
19703
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
19704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
19705
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19706
|
+
"button",
|
|
19707
|
+
{
|
|
19708
|
+
type: "button",
|
|
19709
|
+
"data-ohw-toolbar": "",
|
|
19710
|
+
onClick: () => {
|
|
19711
|
+
clearInteractionChromeRef.current();
|
|
19712
|
+
setActive(hover);
|
|
19713
|
+
},
|
|
19714
|
+
"aria-label": "Configure media item",
|
|
19715
|
+
style: {
|
|
19716
|
+
position: "fixed",
|
|
19717
|
+
top: hoverHandleRect.top + 8,
|
|
19718
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
19719
|
+
width: 28,
|
|
19720
|
+
height: 28,
|
|
19721
|
+
borderRadius: 8,
|
|
19722
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
19723
|
+
background: "#ffffff",
|
|
19724
|
+
color: PRIMARY3,
|
|
19725
|
+
display: "flex",
|
|
19726
|
+
alignItems: "center",
|
|
19727
|
+
justifyContent: "center",
|
|
19728
|
+
cursor: "pointer",
|
|
19729
|
+
zIndex: 2147483643,
|
|
19730
|
+
fontSize: 14,
|
|
19731
|
+
fontWeight: 700
|
|
19732
|
+
},
|
|
19733
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
19734
|
+
}
|
|
19735
|
+
),
|
|
19736
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19737
|
+
ItemInteractionLayer,
|
|
19738
|
+
{
|
|
19739
|
+
rect: activeItemRect,
|
|
19740
|
+
state: toolbarState,
|
|
19741
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
19742
|
+
MediaStripToolbar,
|
|
19743
|
+
{
|
|
19744
|
+
entry: activeEntry,
|
|
19745
|
+
index: active.index,
|
|
19746
|
+
pending,
|
|
19747
|
+
error,
|
|
19748
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19749
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19750
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19751
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19752
|
+
onResize: (delta) => {
|
|
19753
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19754
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19755
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19756
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19757
|
+
},
|
|
19758
|
+
onSetAlt: (alt) => {
|
|
19759
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
19760
|
+
},
|
|
19761
|
+
onSetLink: (href, linkTarget) => {
|
|
20059
19762
|
void runMutation(
|
|
20060
19763
|
active.sectionId,
|
|
20061
|
-
(tree) =>
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
19764
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19765
|
+
);
|
|
19766
|
+
},
|
|
19767
|
+
onAddItem: () => {
|
|
19768
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19769
|
+
if (!picked) return;
|
|
19770
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19771
|
+
void runMutation(
|
|
19772
|
+
active.sectionId,
|
|
19773
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19774
|
+
{ [picked.assetId]: picked.url }
|
|
19775
|
+
).then((applied) => {
|
|
19776
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19777
|
+
});
|
|
20065
19778
|
});
|
|
20066
|
-
}
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
20074
|
-
|
|
19779
|
+
},
|
|
19780
|
+
onChangeImage: () => {
|
|
19781
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19782
|
+
if (!picked) return;
|
|
19783
|
+
void runMutation(
|
|
19784
|
+
active.sectionId,
|
|
19785
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
19786
|
+
{ [picked.assetId]: picked.url }
|
|
19787
|
+
);
|
|
19788
|
+
});
|
|
19789
|
+
},
|
|
19790
|
+
onRemoveItem: () => {
|
|
19791
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19792
|
+
(applied) => {
|
|
19793
|
+
if (applied) setActive(null);
|
|
19794
|
+
}
|
|
20075
19795
|
);
|
|
20076
|
-
}
|
|
20077
|
-
|
|
20078
|
-
|
|
20079
|
-
|
|
20080
|
-
|
|
20081
|
-
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
|
|
20088
|
-
|
|
20089
|
-
|
|
20090
|
-
|
|
20091
|
-
},
|
|
20092
|
-
onMoveRight: () => {
|
|
20093
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
20094
|
-
(applied) => {
|
|
20095
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20096
|
-
}
|
|
20097
|
-
);
|
|
20098
|
-
}
|
|
20099
|
-
}
|
|
20100
|
-
) }),
|
|
20101
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20102
|
-
"div",
|
|
20103
|
-
{
|
|
20104
|
-
"data-ohw-bridge": "",
|
|
20105
|
-
"data-ohw-item-interaction": "",
|
|
20106
|
-
"aria-hidden": true,
|
|
20107
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
20108
|
-
style: {
|
|
20109
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
20110
|
-
left: activeItemRect.left - 5,
|
|
20111
|
-
background: PRIMARY3,
|
|
20112
|
-
zIndex: 2147483644
|
|
20113
|
-
},
|
|
20114
|
-
children: "Media item"
|
|
20115
|
-
}
|
|
20116
|
-
),
|
|
20117
|
-
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20118
|
-
LinkModal,
|
|
20119
|
-
{
|
|
20120
|
-
href: activeHref,
|
|
20121
|
-
linkTarget: activeTarget,
|
|
20122
|
-
onClose: () => setLinkOpen(false),
|
|
20123
|
-
onSave: (href, linkTarget) => {
|
|
20124
|
-
void runMutation(
|
|
20125
|
-
active.sectionId,
|
|
20126
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
20127
|
-
);
|
|
19796
|
+
},
|
|
19797
|
+
onMoveLeft: () => {
|
|
19798
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
19799
|
+
(applied) => {
|
|
19800
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
19801
|
+
}
|
|
19802
|
+
);
|
|
19803
|
+
},
|
|
19804
|
+
onMoveRight: () => {
|
|
19805
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19806
|
+
(applied) => {
|
|
19807
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19808
|
+
}
|
|
19809
|
+
);
|
|
19810
|
+
}
|
|
20128
19811
|
}
|
|
20129
|
-
|
|
20130
|
-
|
|
20131
|
-
|
|
19812
|
+
)
|
|
19813
|
+
}
|
|
19814
|
+
)
|
|
20132
19815
|
] });
|
|
20133
19816
|
}
|
|
20134
19817
|
|
|
20135
19818
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
20136
19819
|
var import_react14 = require("react");
|
|
20137
|
-
var
|
|
20138
|
-
var
|
|
19820
|
+
var import_lucide_react9 = require("lucide-react");
|
|
19821
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
20139
19822
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
20140
|
-
var
|
|
19823
|
+
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]";
|
|
20141
19824
|
function findPricingCardElement(sectionId, index) {
|
|
20142
19825
|
const sectionEl = findByInstanceId(sectionId);
|
|
20143
19826
|
if (!sectionEl) return null;
|
|
@@ -20149,7 +19832,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
20149
19832
|
}
|
|
20150
19833
|
function cardRefFromTarget(target) {
|
|
20151
19834
|
if (!(target instanceof Element)) return null;
|
|
20152
|
-
if (target.closest(
|
|
19835
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
20153
19836
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
20154
19837
|
if (!cardEl) return null;
|
|
20155
19838
|
const sectionEl = cardEl.closest("[data-ohw-section]");
|
|
@@ -20159,21 +19842,21 @@ function cardRefFromTarget(target) {
|
|
|
20159
19842
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
20160
19843
|
return { sectionId, index };
|
|
20161
19844
|
}
|
|
20162
|
-
function
|
|
19845
|
+
function sameRef(a, b) {
|
|
20163
19846
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
20164
19847
|
}
|
|
20165
|
-
function
|
|
19848
|
+
function rectOf(el) {
|
|
20166
19849
|
if (!el) return null;
|
|
20167
19850
|
const r2 = el.getBoundingClientRect();
|
|
20168
19851
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
20169
19852
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
20170
19853
|
}
|
|
20171
19854
|
function readRect3(ref) {
|
|
20172
|
-
return
|
|
19855
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
20173
19856
|
}
|
|
20174
19857
|
function readGridRect(ref) {
|
|
20175
19858
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
20176
|
-
return
|
|
19859
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
20177
19860
|
}
|
|
20178
19861
|
function useLiveCardRect(ref, grid = false) {
|
|
20179
19862
|
const [rect, setRect] = (0, import_react14.useState)(null);
|
|
@@ -20203,7 +19886,7 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
20203
19886
|
}
|
|
20204
19887
|
var TOOLBAR_GRID_GAP = 52;
|
|
20205
19888
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
20206
|
-
var
|
|
19889
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
20207
19890
|
function GridToolbarSlot({ gridRect, children }) {
|
|
20208
19891
|
const slotRef = (0, import_react14.useRef)(null);
|
|
20209
19892
|
const [shift, setShift] = (0, import_react14.useState)(0);
|
|
@@ -20215,7 +19898,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20215
19898
|
const w = slot.offsetWidth;
|
|
20216
19899
|
if (w <= 0) return;
|
|
20217
19900
|
const half = w / 2;
|
|
20218
|
-
const clamped = Math.max(
|
|
19901
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
20219
19902
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
20220
19903
|
};
|
|
20221
19904
|
clamp();
|
|
@@ -20224,7 +19907,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20224
19907
|
return () => ro.disconnect();
|
|
20225
19908
|
}, [centerX, children]);
|
|
20226
19909
|
const mobile = window.innerWidth <= 480;
|
|
20227
|
-
return /* @__PURE__ */ (0,
|
|
19910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20228
19911
|
"div",
|
|
20229
19912
|
{
|
|
20230
19913
|
ref: slotRef,
|
|
@@ -20259,7 +19942,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
20259
19942
|
});
|
|
20260
19943
|
}
|
|
20261
19944
|
function StyleSwatch({ style }) {
|
|
20262
|
-
return /* @__PURE__ */ (0,
|
|
19945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20263
19946
|
"span",
|
|
20264
19947
|
{
|
|
20265
19948
|
"aria-hidden": true,
|
|
@@ -20273,35 +19956,35 @@ function StyleSwatch({ style }) {
|
|
|
20273
19956
|
);
|
|
20274
19957
|
}
|
|
20275
19958
|
function ButtonGlyph() {
|
|
20276
|
-
return /* @__PURE__ */ (0,
|
|
20277
|
-
/* @__PURE__ */ (0,
|
|
20278
|
-
/* @__PURE__ */ (0,
|
|
19959
|
+
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: [
|
|
19960
|
+
/* @__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" }),
|
|
19961
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20279
19962
|
] });
|
|
20280
19963
|
}
|
|
20281
19964
|
function FeatureGlyph({ mode }) {
|
|
20282
|
-
return /* @__PURE__ */ (0,
|
|
20283
|
-
/* @__PURE__ */ (0,
|
|
20284
|
-
/* @__PURE__ */ (0,
|
|
20285
|
-
/* @__PURE__ */ (0,
|
|
20286
|
-
/* @__PURE__ */ (0,
|
|
20287
|
-
/* @__PURE__ */ (0,
|
|
20288
|
-
mode === "add" && /* @__PURE__ */ (0,
|
|
19965
|
+
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: [
|
|
19966
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19967
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
19968
|
+
/* @__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" }),
|
|
19969
|
+
/* @__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" }),
|
|
19970
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
19971
|
+
mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20289
19972
|
] });
|
|
20290
19973
|
}
|
|
20291
|
-
function
|
|
19974
|
+
function ToolbarAction({
|
|
20292
19975
|
label,
|
|
20293
19976
|
onClick,
|
|
20294
19977
|
disabled = false,
|
|
20295
19978
|
children
|
|
20296
19979
|
}) {
|
|
20297
|
-
const button = /* @__PURE__ */ (0,
|
|
20298
|
-
return /* @__PURE__ */ (0,
|
|
20299
|
-
/* @__PURE__ */ (0,
|
|
20300
|
-
/* @__PURE__ */ (0,
|
|
19980
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
19981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
19982
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
|
|
19983
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
20301
19984
|
] });
|
|
20302
19985
|
}
|
|
20303
|
-
function
|
|
20304
|
-
return /* @__PURE__ */ (0,
|
|
19986
|
+
function ToolbarSeparator() {
|
|
19987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
20305
19988
|
}
|
|
20306
19989
|
function CardStyleMenu({
|
|
20307
19990
|
value,
|
|
@@ -20309,7 +19992,7 @@ function CardStyleMenu({
|
|
|
20309
19992
|
disabled = false
|
|
20310
19993
|
}) {
|
|
20311
19994
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
20312
|
-
const trigger = /* @__PURE__ */ (0,
|
|
19995
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20313
19996
|
"button",
|
|
20314
19997
|
{
|
|
20315
19998
|
type: "button",
|
|
@@ -20320,28 +20003,28 @@ function CardStyleMenu({
|
|
|
20320
20003
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
20321
20004
|
),
|
|
20322
20005
|
children: [
|
|
20323
|
-
/* @__PURE__ */ (0,
|
|
20324
|
-
/* @__PURE__ */ (0,
|
|
20325
|
-
/* @__PURE__ */ (0,
|
|
20006
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
|
|
20007
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
|
|
20008
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
|
|
20326
20009
|
]
|
|
20327
20010
|
}
|
|
20328
20011
|
);
|
|
20329
20012
|
if (disabled) {
|
|
20330
|
-
return /* @__PURE__ */ (0,
|
|
20331
|
-
/* @__PURE__ */ (0,
|
|
20332
|
-
/* @__PURE__ */ (0,
|
|
20333
|
-
/* @__PURE__ */ (0,
|
|
20334
|
-
/* @__PURE__ */ (0,
|
|
20013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20014
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
20015
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
20016
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
|
|
20017
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
20335
20018
|
] })
|
|
20336
20019
|
] });
|
|
20337
20020
|
}
|
|
20338
|
-
return /* @__PURE__ */ (0,
|
|
20339
|
-
/* @__PURE__ */ (0,
|
|
20340
|
-
/* @__PURE__ */ (0,
|
|
20341
|
-
/* @__PURE__ */ (0,
|
|
20342
|
-
/* @__PURE__ */ (0,
|
|
20021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20022
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
20023
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
|
|
20024
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
20025
|
+
/* @__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) => {
|
|
20343
20026
|
const selected = style.value === value;
|
|
20344
|
-
return /* @__PURE__ */ (0,
|
|
20027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20345
20028
|
DropdownMenuItem,
|
|
20346
20029
|
{
|
|
20347
20030
|
role: "menuitemradio",
|
|
@@ -20349,9 +20032,9 @@ function CardStyleMenu({
|
|
|
20349
20032
|
onSelect: () => onChange(style.value),
|
|
20350
20033
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
20351
20034
|
children: [
|
|
20352
|
-
/* @__PURE__ */ (0,
|
|
20353
|
-
/* @__PURE__ */ (0,
|
|
20354
|
-
selected && /* @__PURE__ */ (0,
|
|
20035
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
|
|
20036
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
|
|
20037
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
|
|
20355
20038
|
]
|
|
20356
20039
|
},
|
|
20357
20040
|
style.value
|
|
@@ -20381,7 +20064,7 @@ function PricingCardToolbar({
|
|
|
20381
20064
|
const style = pricingCardStyle(entry.tree, index);
|
|
20382
20065
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
20383
20066
|
const mobile = window.innerWidth <= 480;
|
|
20384
|
-
return /* @__PURE__ */ (0,
|
|
20067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20385
20068
|
"div",
|
|
20386
20069
|
{
|
|
20387
20070
|
"data-ohw-bridge": "",
|
|
@@ -20393,7 +20076,7 @@ function PricingCardToolbar({
|
|
|
20393
20076
|
),
|
|
20394
20077
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
20395
20078
|
children: [
|
|
20396
|
-
/* @__PURE__ */ (0,
|
|
20079
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
20397
20080
|
"div",
|
|
20398
20081
|
{
|
|
20399
20082
|
className: cn(
|
|
@@ -20402,8 +20085,8 @@ function PricingCardToolbar({
|
|
|
20402
20085
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
20403
20086
|
),
|
|
20404
20087
|
children: [
|
|
20405
|
-
/* @__PURE__ */ (0,
|
|
20406
|
-
/* @__PURE__ */ (0,
|
|
20088
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
20089
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20407
20090
|
CustomToolbarButton,
|
|
20408
20091
|
{
|
|
20409
20092
|
type: "button",
|
|
@@ -20411,8 +20094,8 @@ function PricingCardToolbar({
|
|
|
20411
20094
|
"aria-pressed": featuredTag,
|
|
20412
20095
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
20413
20096
|
className: "group size-8",
|
|
20414
|
-
children: /* @__PURE__ */ (0,
|
|
20415
|
-
|
|
20097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20098
|
+
import_lucide_react9.Star,
|
|
20416
20099
|
{
|
|
20417
20100
|
size: 16,
|
|
20418
20101
|
fill: "currentColor",
|
|
@@ -20426,25 +20109,25 @@ function PricingCardToolbar({
|
|
|
20426
20109
|
)
|
|
20427
20110
|
}
|
|
20428
20111
|
) }),
|
|
20429
|
-
/* @__PURE__ */ (0,
|
|
20112
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
20430
20113
|
] }),
|
|
20431
|
-
/* @__PURE__ */ (0,
|
|
20432
|
-
/* @__PURE__ */ (0,
|
|
20433
|
-
/* @__PURE__ */ (0,
|
|
20434
|
-
/* @__PURE__ */ (0,
|
|
20435
|
-
/* @__PURE__ */ (0,
|
|
20436
|
-
/* @__PURE__ */ (0,
|
|
20437
|
-
/* @__PURE__ */ (0,
|
|
20114
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20115
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
20116
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20117
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
|
|
20118
|
+
/* @__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: [
|
|
20119
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
|
|
20120
|
+
/* @__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" })
|
|
20438
20121
|
] }) }),
|
|
20439
|
-
/* @__PURE__ */ (0,
|
|
20440
|
-
/* @__PURE__ */ (0,
|
|
20441
|
-
/* @__PURE__ */ (0,
|
|
20442
|
-
/* @__PURE__ */ (0,
|
|
20443
|
-
/* @__PURE__ */ (0,
|
|
20122
|
+
/* @__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" }) }),
|
|
20123
|
+
/* @__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" }) }),
|
|
20124
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
|
|
20125
|
+
/* @__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" } }) }),
|
|
20126
|
+
/* @__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" } }) })
|
|
20444
20127
|
]
|
|
20445
20128
|
}
|
|
20446
20129
|
),
|
|
20447
|
-
error && /* @__PURE__ */ (0,
|
|
20130
|
+
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 })
|
|
20448
20131
|
]
|
|
20449
20132
|
}
|
|
20450
20133
|
) });
|
|
@@ -20478,7 +20161,7 @@ function AiPricingCardOverlay({
|
|
|
20478
20161
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20479
20162
|
setHover((prev) => {
|
|
20480
20163
|
const next = ref && !overEditable ? ref : null;
|
|
20481
|
-
return
|
|
20164
|
+
return sameRef(prev, next) ? prev : next;
|
|
20482
20165
|
});
|
|
20483
20166
|
};
|
|
20484
20167
|
const onLeave = () => setHover(null);
|
|
@@ -20493,10 +20176,10 @@ function AiPricingCardOverlay({
|
|
|
20493
20176
|
const onClick = (e) => {
|
|
20494
20177
|
const t = e.target;
|
|
20495
20178
|
if (!(t instanceof Element)) return;
|
|
20496
|
-
if (t.closest(
|
|
20179
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
20497
20180
|
const ref = cardRefFromTarget(t);
|
|
20498
|
-
setActive((prev) =>
|
|
20499
|
-
if (!ref || !
|
|
20181
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
20182
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
20500
20183
|
};
|
|
20501
20184
|
document.addEventListener("click", onClick, true);
|
|
20502
20185
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20561,12 +20244,12 @@ function AiPricingCardOverlay({
|
|
|
20561
20244
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20562
20245
|
const activeCardRect = useLiveCardRect(active);
|
|
20563
20246
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20564
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20565
|
-
return /* @__PURE__ */ (0,
|
|
20566
|
-
hoverRect && /* @__PURE__ */ (0,
|
|
20567
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
20568
|
-
/* @__PURE__ */ (0,
|
|
20569
|
-
/* @__PURE__ */ (0,
|
|
20247
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
20248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
20249
|
+
hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
20250
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
20251
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
20252
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20570
20253
|
PricingCardToolbar,
|
|
20571
20254
|
{
|
|
20572
20255
|
entry: activeEntry,
|
|
@@ -20594,7 +20277,7 @@ function AiPricingCardOverlay({
|
|
|
20594
20277
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20595
20278
|
}
|
|
20596
20279
|
) }),
|
|
20597
|
-
/* @__PURE__ */ (0,
|
|
20280
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
20598
20281
|
"div",
|
|
20599
20282
|
{
|
|
20600
20283
|
"data-ohw-bridge": "",
|
|
@@ -20616,7 +20299,7 @@ function AiPricingCardOverlay({
|
|
|
20616
20299
|
|
|
20617
20300
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20618
20301
|
var import_react15 = require("react");
|
|
20619
|
-
var
|
|
20302
|
+
var import_lucide_react10 = require("lucide-react");
|
|
20620
20303
|
|
|
20621
20304
|
// src/lib/ai-video-tree.ts
|
|
20622
20305
|
function resolveVideoBlock(tree, path) {
|
|
@@ -20658,11 +20341,39 @@ function clearVideo(tree, path) {
|
|
|
20658
20341
|
});
|
|
20659
20342
|
}
|
|
20660
20343
|
|
|
20344
|
+
// src/lib/youtube.ts
|
|
20345
|
+
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
20346
|
+
function extractYouTubeId(input) {
|
|
20347
|
+
const trimmed = input.trim();
|
|
20348
|
+
if (!trimmed) return null;
|
|
20349
|
+
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
20350
|
+
let url;
|
|
20351
|
+
try {
|
|
20352
|
+
url = new URL(trimmed);
|
|
20353
|
+
} catch {
|
|
20354
|
+
return null;
|
|
20355
|
+
}
|
|
20356
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
20357
|
+
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
20358
|
+
return null;
|
|
20359
|
+
}
|
|
20360
|
+
let candidate = null;
|
|
20361
|
+
if (host === "youtu.be") {
|
|
20362
|
+
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
20363
|
+
} else if (url.pathname === "/watch") {
|
|
20364
|
+
candidate = url.searchParams.get("v");
|
|
20365
|
+
} else {
|
|
20366
|
+
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
20367
|
+
candidate = match ? match[1] : null;
|
|
20368
|
+
}
|
|
20369
|
+
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
20370
|
+
}
|
|
20371
|
+
|
|
20661
20372
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20662
|
-
var
|
|
20373
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
20663
20374
|
var PRIMARY5 = "#0885FE";
|
|
20664
|
-
var
|
|
20665
|
-
var
|
|
20375
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20376
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
20666
20377
|
function findVideoBlockElement(sectionId, path) {
|
|
20667
20378
|
const sectionEl = findByInstanceId(sectionId);
|
|
20668
20379
|
if (!sectionEl) return null;
|
|
@@ -20722,12 +20433,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
20722
20433
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
20723
20434
|
});
|
|
20724
20435
|
}
|
|
20725
|
-
function
|
|
20436
|
+
function Pill2({
|
|
20726
20437
|
label,
|
|
20727
20438
|
onClick,
|
|
20728
20439
|
disabled
|
|
20729
20440
|
}) {
|
|
20730
|
-
return /* @__PURE__ */ (0,
|
|
20441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20731
20442
|
"button",
|
|
20732
20443
|
{
|
|
20733
20444
|
type: "button",
|
|
@@ -20743,7 +20454,7 @@ function Pill({
|
|
|
20743
20454
|
border: "none",
|
|
20744
20455
|
cursor: disabled ? "default" : "pointer",
|
|
20745
20456
|
background: "#ffffff",
|
|
20746
|
-
color:
|
|
20457
|
+
color: OHW_BLUE_DARK2,
|
|
20747
20458
|
opacity: disabled ? 0.4 : 1,
|
|
20748
20459
|
fontSize: 12,
|
|
20749
20460
|
lineHeight: "16px",
|
|
@@ -20786,8 +20497,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20786
20497
|
onCommit(id);
|
|
20787
20498
|
}
|
|
20788
20499
|
};
|
|
20789
|
-
return /* @__PURE__ */ (0,
|
|
20790
|
-
/* @__PURE__ */ (0,
|
|
20500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20501
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
20791
20502
|
"div",
|
|
20792
20503
|
{
|
|
20793
20504
|
style: {
|
|
@@ -20803,12 +20514,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20803
20514
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20804
20515
|
},
|
|
20805
20516
|
children: [
|
|
20806
|
-
/* @__PURE__ */ (0,
|
|
20517
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20807
20518
|
"span",
|
|
20808
20519
|
{
|
|
20809
20520
|
style: {
|
|
20810
20521
|
flex: "0 0 auto",
|
|
20811
|
-
color:
|
|
20522
|
+
color: OHW_BLUE_DARK2,
|
|
20812
20523
|
fontSize: 10,
|
|
20813
20524
|
lineHeight: "16px",
|
|
20814
20525
|
fontWeight: 700,
|
|
@@ -20818,7 +20529,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20818
20529
|
children: "Video"
|
|
20819
20530
|
}
|
|
20820
20531
|
),
|
|
20821
|
-
/* @__PURE__ */ (0,
|
|
20532
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
20822
20533
|
"input",
|
|
20823
20534
|
{
|
|
20824
20535
|
type: "text",
|
|
@@ -20855,7 +20566,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20855
20566
|
]
|
|
20856
20567
|
}
|
|
20857
20568
|
),
|
|
20858
|
-
invalid && /* @__PURE__ */ (0,
|
|
20569
|
+
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." })
|
|
20859
20570
|
] });
|
|
20860
20571
|
}
|
|
20861
20572
|
function VideoToolbar({
|
|
@@ -20865,7 +20576,7 @@ function VideoToolbar({
|
|
|
20865
20576
|
onSetVideoId,
|
|
20866
20577
|
onRemove
|
|
20867
20578
|
}) {
|
|
20868
|
-
return /* @__PURE__ */ (0,
|
|
20579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
20869
20580
|
"div",
|
|
20870
20581
|
{
|
|
20871
20582
|
"data-ohw-bridge": "",
|
|
@@ -20877,7 +20588,7 @@ function VideoToolbar({
|
|
|
20877
20588
|
gap: 6,
|
|
20878
20589
|
alignItems: "center",
|
|
20879
20590
|
width: 280,
|
|
20880
|
-
background:
|
|
20591
|
+
background: OHW_BLUE2,
|
|
20881
20592
|
padding: 8,
|
|
20882
20593
|
borderRadius: 12,
|
|
20883
20594
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20885,9 +20596,9 @@ function VideoToolbar({
|
|
|
20885
20596
|
opacity: pending ? 0.6 : 1
|
|
20886
20597
|
},
|
|
20887
20598
|
children: [
|
|
20888
|
-
/* @__PURE__ */ (0,
|
|
20889
|
-
/* @__PURE__ */ (0,
|
|
20890
|
-
error && /* @__PURE__ */ (0,
|
|
20599
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
20600
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
20601
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20891
20602
|
]
|
|
20892
20603
|
}
|
|
20893
20604
|
);
|
|
@@ -21007,8 +20718,8 @@ function AiVideoOverlay({
|
|
|
21007
20718
|
const activeBlockRect = useLiveBlockRect(active);
|
|
21008
20719
|
const TOOLBAR_APPROX_H = 90;
|
|
21009
20720
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21010
|
-
return /* @__PURE__ */ (0,
|
|
21011
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
20721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
20722
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21012
20723
|
"button",
|
|
21013
20724
|
{
|
|
21014
20725
|
type: "button",
|
|
@@ -21036,15 +20747,15 @@ function AiVideoOverlay({
|
|
|
21036
20747
|
fontSize: 14,
|
|
21037
20748
|
fontWeight: 700
|
|
21038
20749
|
},
|
|
21039
|
-
children: /* @__PURE__ */ (0,
|
|
20750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21040
20751
|
}
|
|
21041
20752
|
),
|
|
21042
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
20753
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21043
20754
|
ItemInteractionLayer,
|
|
21044
20755
|
{
|
|
21045
20756
|
rect: activeBlockRect,
|
|
21046
20757
|
state: toolbarState,
|
|
21047
|
-
toolbar: /* @__PURE__ */ (0,
|
|
20758
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
21048
20759
|
VideoToolbar,
|
|
21049
20760
|
{
|
|
21050
20761
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -21068,7 +20779,7 @@ function AiVideoOverlay({
|
|
|
21068
20779
|
|
|
21069
20780
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21070
20781
|
var import_react16 = require("react");
|
|
21071
|
-
var
|
|
20782
|
+
var import_lucide_react11 = require("lucide-react");
|
|
21072
20783
|
|
|
21073
20784
|
// src/lib/ai-carousel-tree.ts
|
|
21074
20785
|
function isCarouselBlock(node) {
|
|
@@ -21119,10 +20830,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
21119
20830
|
}
|
|
21120
20831
|
|
|
21121
20832
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
21122
|
-
var
|
|
20833
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
21123
20834
|
var PRIMARY6 = "#0885FE";
|
|
21124
|
-
var
|
|
21125
|
-
var
|
|
20835
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
20836
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
21126
20837
|
function findCarouselItemElement(sectionId, index) {
|
|
21127
20838
|
const sectionEl = findByInstanceId(sectionId);
|
|
21128
20839
|
if (!sectionEl) return null;
|
|
@@ -21201,8 +20912,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
21201
20912
|
postToParent2({ type: "ow:asset-pick", id });
|
|
21202
20913
|
});
|
|
21203
20914
|
}
|
|
21204
|
-
function
|
|
21205
|
-
return /* @__PURE__ */ (0,
|
|
20915
|
+
function Pill3({ label, onClick, disabled }) {
|
|
20916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21206
20917
|
"button",
|
|
21207
20918
|
{
|
|
21208
20919
|
type: "button",
|
|
@@ -21218,7 +20929,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
21218
20929
|
border: "none",
|
|
21219
20930
|
cursor: disabled ? "default" : "pointer",
|
|
21220
20931
|
background: "#ffffff",
|
|
21221
|
-
color:
|
|
20932
|
+
color: OHW_BLUE_DARK3,
|
|
21222
20933
|
opacity: disabled ? 0.4 : 1,
|
|
21223
20934
|
fontSize: 12,
|
|
21224
20935
|
lineHeight: "16px",
|
|
@@ -21236,7 +20947,7 @@ function TogglePill({
|
|
|
21236
20947
|
onToggle,
|
|
21237
20948
|
disabled
|
|
21238
20949
|
}) {
|
|
21239
|
-
return /* @__PURE__ */ (0,
|
|
20950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
21240
20951
|
"button",
|
|
21241
20952
|
{
|
|
21242
20953
|
type: "button",
|
|
@@ -21255,7 +20966,7 @@ function TogglePill({
|
|
|
21255
20966
|
border: "none",
|
|
21256
20967
|
cursor: disabled ? "default" : "pointer",
|
|
21257
20968
|
background: "#ffffff",
|
|
21258
|
-
color:
|
|
20969
|
+
color: OHW_BLUE_DARK3,
|
|
21259
20970
|
opacity: disabled ? 0.4 : 1,
|
|
21260
20971
|
fontSize: 12,
|
|
21261
20972
|
lineHeight: "16px",
|
|
@@ -21265,7 +20976,7 @@ function TogglePill({
|
|
|
21265
20976
|
},
|
|
21266
20977
|
children: [
|
|
21267
20978
|
label,
|
|
21268
|
-
/* @__PURE__ */ (0,
|
|
20979
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21269
20980
|
"span",
|
|
21270
20981
|
{
|
|
21271
20982
|
"aria-hidden": true,
|
|
@@ -21278,10 +20989,10 @@ function TogglePill({
|
|
|
21278
20989
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
21279
20990
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
21280
20991
|
// "disabled control" rather than "switch that is off".
|
|
21281
|
-
background: on ?
|
|
20992
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
21282
20993
|
transition: "background 120ms ease"
|
|
21283
20994
|
},
|
|
21284
|
-
children: /* @__PURE__ */ (0,
|
|
20995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21285
20996
|
"span",
|
|
21286
20997
|
{
|
|
21287
20998
|
style: {
|
|
@@ -21310,7 +21021,7 @@ function CarouselSlideToolbar({
|
|
|
21310
21021
|
onChangeImage,
|
|
21311
21022
|
onToggleAutoplay
|
|
21312
21023
|
}) {
|
|
21313
|
-
return /* @__PURE__ */ (0,
|
|
21024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
21314
21025
|
"div",
|
|
21315
21026
|
{
|
|
21316
21027
|
"data-ohw-bridge": "",
|
|
@@ -21321,7 +21032,7 @@ function CarouselSlideToolbar({
|
|
|
21321
21032
|
flexDirection: "column",
|
|
21322
21033
|
gap: 6,
|
|
21323
21034
|
alignItems: "center",
|
|
21324
|
-
background:
|
|
21035
|
+
background: OHW_BLUE3,
|
|
21325
21036
|
padding: 8,
|
|
21326
21037
|
borderRadius: 12,
|
|
21327
21038
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21333,11 +21044,11 @@ function CarouselSlideToolbar({
|
|
|
21333
21044
|
pointerEvents: pending ? "none" : "auto"
|
|
21334
21045
|
},
|
|
21335
21046
|
children: [
|
|
21336
|
-
/* @__PURE__ */ (0,
|
|
21337
|
-
/* @__PURE__ */ (0,
|
|
21338
|
-
/* @__PURE__ */ (0,
|
|
21047
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21048
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
21049
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
21339
21050
|
] }),
|
|
21340
|
-
error && /* @__PURE__ */ (0,
|
|
21051
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21341
21052
|
]
|
|
21342
21053
|
}
|
|
21343
21054
|
);
|
|
@@ -21477,8 +21188,8 @@ function AiFadeCarouselOverlay({
|
|
|
21477
21188
|
const activeItemRect = useLiveItemRect2(active);
|
|
21478
21189
|
const TOOLBAR_APPROX_H = 90;
|
|
21479
21190
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21480
|
-
return /* @__PURE__ */ (0,
|
|
21481
|
-
hoverHandleRect && hover && /* @__PURE__ */ (0,
|
|
21191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
21192
|
+
hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21482
21193
|
"button",
|
|
21483
21194
|
{
|
|
21484
21195
|
type: "button",
|
|
@@ -21507,10 +21218,10 @@ function AiFadeCarouselOverlay({
|
|
|
21507
21218
|
fontSize: 14,
|
|
21508
21219
|
fontWeight: 700
|
|
21509
21220
|
},
|
|
21510
|
-
children: /* @__PURE__ */ (0,
|
|
21221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
|
|
21511
21222
|
}
|
|
21512
21223
|
),
|
|
21513
|
-
swapping && /* @__PURE__ */ (0,
|
|
21224
|
+
swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21514
21225
|
"div",
|
|
21515
21226
|
{
|
|
21516
21227
|
ref: skeletonRef,
|
|
@@ -21528,15 +21239,15 @@ function AiFadeCarouselOverlay({
|
|
|
21528
21239
|
zIndex: 2147483646,
|
|
21529
21240
|
pointerEvents: "none"
|
|
21530
21241
|
},
|
|
21531
|
-
children: /* @__PURE__ */ (0,
|
|
21242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
|
|
21532
21243
|
}
|
|
21533
21244
|
),
|
|
21534
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */ (0,
|
|
21245
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21535
21246
|
ItemInteractionLayer,
|
|
21536
21247
|
{
|
|
21537
21248
|
rect: activeItemRect,
|
|
21538
21249
|
state: toolbarState,
|
|
21539
|
-
toolbar: /* @__PURE__ */ (0,
|
|
21250
|
+
toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
21540
21251
|
CarouselSlideToolbar,
|
|
21541
21252
|
{
|
|
21542
21253
|
pending,
|
|
@@ -21727,6 +21438,113 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
21727
21438
|
// src/ui/link-modal/LinkPopover.tsx
|
|
21728
21439
|
var import_react20 = require("react");
|
|
21729
21440
|
|
|
21441
|
+
// src/ui/dialog.tsx
|
|
21442
|
+
var React9 = __toESM(require("react"), 1);
|
|
21443
|
+
var import_radix_ui6 = require("radix-ui");
|
|
21444
|
+
var import_lucide_react12 = require("lucide-react");
|
|
21445
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
21446
|
+
function Dialog2({
|
|
21447
|
+
...props
|
|
21448
|
+
}) {
|
|
21449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
21450
|
+
}
|
|
21451
|
+
function DialogPortal({
|
|
21452
|
+
...props
|
|
21453
|
+
}) {
|
|
21454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
|
|
21455
|
+
}
|
|
21456
|
+
function DialogOverlay({
|
|
21457
|
+
className,
|
|
21458
|
+
...props
|
|
21459
|
+
}) {
|
|
21460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21461
|
+
import_radix_ui6.Dialog.Overlay,
|
|
21462
|
+
{
|
|
21463
|
+
"data-slot": "dialog-overlay",
|
|
21464
|
+
"data-ohw-link-modal-root": "",
|
|
21465
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21466
|
+
...props
|
|
21467
|
+
}
|
|
21468
|
+
);
|
|
21469
|
+
}
|
|
21470
|
+
var DialogContent = React9.forwardRef(
|
|
21471
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21472
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
21473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
|
|
21474
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21475
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
21476
|
+
import_radix_ui6.Dialog.Content,
|
|
21477
|
+
{
|
|
21478
|
+
ref,
|
|
21479
|
+
"data-slot": "dialog-content",
|
|
21480
|
+
className: cn(
|
|
21481
|
+
positionMode,
|
|
21482
|
+
"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",
|
|
21483
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21484
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21485
|
+
className
|
|
21486
|
+
),
|
|
21487
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
21488
|
+
...props,
|
|
21489
|
+
children: [
|
|
21490
|
+
children,
|
|
21491
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21492
|
+
import_radix_ui6.Dialog.Close,
|
|
21493
|
+
{
|
|
21494
|
+
type: "button",
|
|
21495
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21496
|
+
"aria-label": "Close",
|
|
21497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
|
|
21498
|
+
}
|
|
21499
|
+
) : null
|
|
21500
|
+
]
|
|
21501
|
+
}
|
|
21502
|
+
)
|
|
21503
|
+
] });
|
|
21504
|
+
}
|
|
21505
|
+
);
|
|
21506
|
+
DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
|
|
21507
|
+
function DialogHeader({
|
|
21508
|
+
className,
|
|
21509
|
+
...props
|
|
21510
|
+
}) {
|
|
21511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21512
|
+
}
|
|
21513
|
+
function DialogFooter({
|
|
21514
|
+
className,
|
|
21515
|
+
...props
|
|
21516
|
+
}) {
|
|
21517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21518
|
+
"div",
|
|
21519
|
+
{
|
|
21520
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
21521
|
+
...props
|
|
21522
|
+
}
|
|
21523
|
+
);
|
|
21524
|
+
}
|
|
21525
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21526
|
+
import_radix_ui6.Dialog.Title,
|
|
21527
|
+
{
|
|
21528
|
+
ref,
|
|
21529
|
+
className: cn(
|
|
21530
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21531
|
+
className
|
|
21532
|
+
),
|
|
21533
|
+
...props
|
|
21534
|
+
}
|
|
21535
|
+
));
|
|
21536
|
+
DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
|
|
21537
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
21538
|
+
import_radix_ui6.Dialog.Description,
|
|
21539
|
+
{
|
|
21540
|
+
ref,
|
|
21541
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
21542
|
+
...props
|
|
21543
|
+
}
|
|
21544
|
+
));
|
|
21545
|
+
DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
|
|
21546
|
+
var DialogClose = import_radix_ui6.Dialog.Close;
|
|
21547
|
+
|
|
21730
21548
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
21731
21549
|
var import_lucide_react16 = require("lucide-react");
|
|
21732
21550
|
|
|
@@ -22830,7 +22648,6 @@ function shouldUseDevFixtures() {
|
|
|
22830
22648
|
function getLogoElement(el) {
|
|
22831
22649
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
22832
22650
|
if (marked) return marked;
|
|
22833
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
22834
22651
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
22835
22652
|
if (!root) return null;
|
|
22836
22653
|
const anchor = el.closest("a");
|
|
@@ -25640,7 +25457,7 @@ function getNavigationSelectionParent(el) {
|
|
|
25640
25457
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
25641
25458
|
return resolveFooterLinksContainerFrom(el);
|
|
25642
25459
|
}
|
|
25643
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
25460
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
25644
25461
|
return getNavigationRoot(el);
|
|
25645
25462
|
}
|
|
25646
25463
|
return null;
|
|
@@ -25862,6 +25679,7 @@ var ICONS = {
|
|
|
25862
25679
|
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"/>',
|
|
25863
25680
|
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"/>'
|
|
25864
25681
|
};
|
|
25682
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
25865
25683
|
var SELECTION_CHROME_GAP2 = 4;
|
|
25866
25684
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
25867
25685
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -25959,7 +25777,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
25959
25777
|
el.style.top = `${top}px`;
|
|
25960
25778
|
el.style.height = `${height}px`;
|
|
25961
25779
|
}
|
|
25962
|
-
var
|
|
25780
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
25963
25781
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
25964
25782
|
const isAbove = transform.includes("translateY(-100%)");
|
|
25965
25783
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -25986,8 +25804,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
25986
25804
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
25987
25805
|
const half = toolbarWidth / 2;
|
|
25988
25806
|
return Math.max(
|
|
25989
|
-
|
|
25990
|
-
Math.min(centerX, window.innerWidth -
|
|
25807
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
25808
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
25991
25809
|
);
|
|
25992
25810
|
}
|
|
25993
25811
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26870,6 +26688,21 @@ function OhhwellsBridge() {
|
|
|
26870
26688
|
const [isItemDragging, setIsItemDragging] = (0, import_react25.useState)(false);
|
|
26871
26689
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react25.useState)(false);
|
|
26872
26690
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26691
|
+
const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
|
|
26692
|
+
const floatingPanelOpenRef = (0, import_react25.useRef)(false);
|
|
26693
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
26694
|
+
const floatingPanelRef = (0, import_react25.useRef)(null);
|
|
26695
|
+
floatingPanelRef.current = floatingPanel;
|
|
26696
|
+
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
|
|
26697
|
+
const buttonCollectionDragRef = (0, import_react25.useRef)(null);
|
|
26698
|
+
const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
|
|
26699
|
+
const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
|
|
26700
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
|
|
26701
|
+
const buttonPointerDragRef = (0, import_react25.useRef)(null);
|
|
26702
|
+
const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
|
|
26703
|
+
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
|
|
26704
|
+
const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
|
|
26705
|
+
const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
|
|
26873
26706
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react25.useState)(null);
|
|
26874
26707
|
const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react25.useState)(null);
|
|
26875
26708
|
const footerDragRef = (0, import_react25.useRef)(null);
|
|
@@ -26896,21 +26729,6 @@ function OhhwellsBridge() {
|
|
|
26896
26729
|
const stylesRef = (0, import_react25.useRef)("");
|
|
26897
26730
|
const appliedDrawerRef = (0, import_react25.useRef)(null);
|
|
26898
26731
|
const pendingDeleteUndoRef = (0, import_react25.useRef)(null);
|
|
26899
|
-
const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
|
|
26900
|
-
const floatingPanelOpenRef = (0, import_react25.useRef)(false);
|
|
26901
|
-
const floatingPanelRef = (0, import_react25.useRef)(null);
|
|
26902
|
-
floatingPanelRef.current = floatingPanel;
|
|
26903
|
-
const setFloatingPanelRef = (0, import_react25.useRef)(setFloatingPanel);
|
|
26904
|
-
const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
|
|
26905
|
-
const buttonCollectionDragRef = (0, import_react25.useRef)(null);
|
|
26906
|
-
const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
|
|
26907
|
-
const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
|
|
26908
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
|
|
26909
|
-
const buttonPointerDragRef = (0, import_react25.useRef)(null);
|
|
26910
|
-
const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
|
|
26911
|
-
const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
|
|
26912
|
-
const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
|
|
26913
|
-
const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
|
|
26914
26732
|
const [sitePages, setSitePages] = (0, import_react25.useState)([]);
|
|
26915
26733
|
const collectionItemsRef = (0, import_react25.useRef)(/* @__PURE__ */ new Map());
|
|
26916
26734
|
const [sectionsByPath, setSectionsByPath] = (0, import_react25.useState)({});
|
|
@@ -26920,18 +26738,7 @@ function OhhwellsBridge() {
|
|
|
26920
26738
|
const linkPopoverOpenRef = (0, import_react25.useRef)(false);
|
|
26921
26739
|
const linkPopoverGraceUntilRef = (0, import_react25.useRef)(0);
|
|
26922
26740
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26923
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
26924
26741
|
linkPopoverSessionRef.current = linkPopover;
|
|
26925
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
26926
|
-
(0, import_react25.useEffect)(() => {
|
|
26927
|
-
const syncViewport = () => {
|
|
26928
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26929
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
26930
|
-
};
|
|
26931
|
-
syncViewport();
|
|
26932
|
-
window.addEventListener("resize", syncViewport);
|
|
26933
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
26934
|
-
}, []);
|
|
26935
26742
|
(0, import_react25.useEffect)(() => {
|
|
26936
26743
|
setSectionOrderPersistHandler((entries) => {
|
|
26937
26744
|
const currentPath = window.location.pathname;
|
|
@@ -28665,7 +28472,6 @@ function OhhwellsBridge() {
|
|
|
28665
28472
|
applyAiFooterFromContent(content);
|
|
28666
28473
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28667
28474
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
28668
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28669
28475
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28670
28476
|
}
|
|
28671
28477
|
applyBrandChrome(content);
|
|
@@ -28676,16 +28482,15 @@ function OhhwellsBridge() {
|
|
|
28676
28482
|
if (key === "__ohw_sections") continue;
|
|
28677
28483
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28678
28484
|
if (key === AI_FOOTER_KEY) continue;
|
|
28679
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28680
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28681
28485
|
if (key === BRAND_KIT_KEY) continue;
|
|
28682
28486
|
if (key === STYLE_STORE_KEY) continue;
|
|
28683
28487
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28488
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28684
28489
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28490
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28685
28491
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28686
28492
|
continue;
|
|
28687
28493
|
}
|
|
28688
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28689
28494
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28690
28495
|
if (applyCarouselNode(key, val)) continue;
|
|
28691
28496
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28725,7 +28530,6 @@ function OhhwellsBridge() {
|
|
|
28725
28530
|
});
|
|
28726
28531
|
applyLinkByKey(key, val);
|
|
28727
28532
|
}
|
|
28728
|
-
applySectionEmbeds(content);
|
|
28729
28533
|
applyLogoFromContent(content);
|
|
28730
28534
|
applyLogoSizes(content);
|
|
28731
28535
|
reconcileNavbarItemsFromContent(content);
|
|
@@ -28914,22 +28718,20 @@ function OhhwellsBridge() {
|
|
|
28914
28718
|
}
|
|
28915
28719
|
applyAiFooterFromContent(content);
|
|
28916
28720
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28917
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28918
28721
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28919
28722
|
}
|
|
28920
28723
|
for (const [key, val] of Object.entries(content)) {
|
|
28921
28724
|
if (key === "__ohw_sections") continue;
|
|
28922
28725
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28923
28726
|
if (key === AI_FOOTER_KEY) continue;
|
|
28924
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28925
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28926
28727
|
if (key === BRAND_KIT_KEY) continue;
|
|
28927
28728
|
if (key === STYLE_STORE_KEY) continue;
|
|
28928
28729
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28730
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28731
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28929
28732
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28930
28733
|
continue;
|
|
28931
28734
|
}
|
|
28932
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28933
28735
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28934
28736
|
if (applyCarouselNode(key, val)) continue;
|
|
28935
28737
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28954,7 +28756,6 @@ function OhhwellsBridge() {
|
|
|
28954
28756
|
});
|
|
28955
28757
|
applyLinkByKey(key, val);
|
|
28956
28758
|
}
|
|
28957
|
-
applySectionEmbeds(content);
|
|
28958
28759
|
applyLogoFromContent(content);
|
|
28959
28760
|
reconcileNavbarItemsFromContent(content);
|
|
28960
28761
|
reconcileFooterOrderFromContent(content);
|
|
@@ -29194,11 +28995,26 @@ function OhhwellsBridge() {
|
|
|
29194
28995
|
const t2 = setTimeout(measure, 500);
|
|
29195
28996
|
const ro = new ResizeObserver(schedule);
|
|
29196
28997
|
ro.observe(document.body);
|
|
28998
|
+
let lastWidth = window.innerWidth;
|
|
28999
|
+
let resizeTimers = [];
|
|
29000
|
+
const clearResizeTimers = () => {
|
|
29001
|
+
resizeTimers.forEach(clearTimeout);
|
|
29002
|
+
resizeTimers = [];
|
|
29003
|
+
};
|
|
29004
|
+
const handleResize = () => {
|
|
29005
|
+
if (window.innerWidth === lastWidth) return;
|
|
29006
|
+
lastWidth = window.innerWidth;
|
|
29007
|
+
clearResizeTimers();
|
|
29008
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
29009
|
+
};
|
|
29010
|
+
window.addEventListener("resize", handleResize);
|
|
29197
29011
|
return () => {
|
|
29198
29012
|
clearTimeout(t1);
|
|
29199
29013
|
clearTimeout(t2);
|
|
29200
29014
|
if (raf != null) cancelAnimationFrame(raf);
|
|
29201
29015
|
ro.disconnect();
|
|
29016
|
+
clearResizeTimers();
|
|
29017
|
+
window.removeEventListener("resize", handleResize);
|
|
29202
29018
|
};
|
|
29203
29019
|
}, [pathname, isEditMode, postToParent2]);
|
|
29204
29020
|
(0, import_react25.useEffect)(() => {
|
|
@@ -29495,13 +29311,6 @@ function OhhwellsBridge() {
|
|
|
29495
29311
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29496
29312
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29497
29313
|
if (isInsideLinkEditor(target)) return;
|
|
29498
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29499
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29500
|
-
if (target.closest(
|
|
29501
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29502
|
-
)) {
|
|
29503
|
-
return;
|
|
29504
|
-
}
|
|
29505
29314
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29506
29315
|
clearMediaSelectionRef.current();
|
|
29507
29316
|
}
|
|
@@ -29525,6 +29334,8 @@ function OhhwellsBridge() {
|
|
|
29525
29334
|
return;
|
|
29526
29335
|
}
|
|
29527
29336
|
}
|
|
29337
|
+
if (isInsideFloatingPanel(target)) return;
|
|
29338
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29528
29339
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29529
29340
|
if (collectionItem) {
|
|
29530
29341
|
e.preventDefault();
|
|
@@ -29536,6 +29347,11 @@ function OhhwellsBridge() {
|
|
|
29536
29347
|
});
|
|
29537
29348
|
return;
|
|
29538
29349
|
}
|
|
29350
|
+
if (target.closest(
|
|
29351
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29352
|
+
)) {
|
|
29353
|
+
return;
|
|
29354
|
+
}
|
|
29539
29355
|
{
|
|
29540
29356
|
const formEl = getFormElement(target);
|
|
29541
29357
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -29689,13 +29505,9 @@ function OhhwellsBridge() {
|
|
|
29689
29505
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
29690
29506
|
e.preventDefault();
|
|
29691
29507
|
e.stopPropagation();
|
|
29508
|
+
selectIconElementRef.current(editable);
|
|
29692
29509
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
29693
29510
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
29694
|
-
if (aiIcon) {
|
|
29695
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
29696
|
-
} else {
|
|
29697
|
-
selectIconElementRef.current(editable);
|
|
29698
|
-
}
|
|
29699
29511
|
postToParentRef.current({
|
|
29700
29512
|
type: "ow:icon-pick",
|
|
29701
29513
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -29923,9 +29735,6 @@ function OhhwellsBridge() {
|
|
|
29923
29735
|
setHoveredItemRect(null);
|
|
29924
29736
|
hoveredNavContainerRef.current = null;
|
|
29925
29737
|
setHoveredNavContainerRect(null);
|
|
29926
|
-
siblingHintElRef.current = null;
|
|
29927
|
-
setSiblingHintRect(null);
|
|
29928
|
-
setSiblingHintRects([]);
|
|
29929
29738
|
return;
|
|
29930
29739
|
}
|
|
29931
29740
|
{
|
|
@@ -30046,6 +29855,7 @@ function OhhwellsBridge() {
|
|
|
30046
29855
|
hoveredNavContainerRef.current = null;
|
|
30047
29856
|
setHoveredNavContainerRect(null);
|
|
30048
29857
|
hoveredItemElRef.current = editable;
|
|
29858
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
30049
29859
|
}
|
|
30050
29860
|
}
|
|
30051
29861
|
}
|
|
@@ -30755,11 +30565,7 @@ function OhhwellsBridge() {
|
|
|
30755
30565
|
};
|
|
30756
30566
|
const handleMouseMove = (e) => {
|
|
30757
30567
|
const { clientX, clientY } = e;
|
|
30758
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30759
|
-
dismissImageHover();
|
|
30760
|
-
clearImageHover();
|
|
30761
|
-
return;
|
|
30762
|
-
}
|
|
30568
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30763
30569
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
30764
30570
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
30765
30571
|
formHoverElRef.current = null;
|
|
@@ -30788,12 +30594,7 @@ function OhhwellsBridge() {
|
|
|
30788
30594
|
setHoveredItemRect(null);
|
|
30789
30595
|
hoveredNavContainerRef.current = null;
|
|
30790
30596
|
setHoveredNavContainerRect(null);
|
|
30791
|
-
siblingHintElRef.current = null;
|
|
30792
|
-
setSiblingHintRect(null);
|
|
30793
|
-
setSiblingHintRects([]);
|
|
30794
30597
|
dismissImageHover();
|
|
30795
|
-
clearImageHover();
|
|
30796
|
-
setSectionGap(null);
|
|
30797
30598
|
return;
|
|
30798
30599
|
}
|
|
30799
30600
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -30805,11 +30606,7 @@ function OhhwellsBridge() {
|
|
|
30805
30606
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
30806
30607
|
const { clientX, clientY } = e.data;
|
|
30807
30608
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
30808
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30809
|
-
dismissImageHover();
|
|
30810
|
-
clearImageHover();
|
|
30811
|
-
return;
|
|
30812
|
-
}
|
|
30609
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30813
30610
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
30814
30611
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
30815
30612
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -31189,7 +30986,6 @@ function OhhwellsBridge() {
|
|
|
31189
30986
|
applyAiFooterFromContent(content);
|
|
31190
30987
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
31191
30988
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
31192
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
31193
30989
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
31194
30990
|
}
|
|
31195
30991
|
applyBrandChrome(content);
|
|
@@ -31204,16 +31000,15 @@ function OhhwellsBridge() {
|
|
|
31204
31000
|
}
|
|
31205
31001
|
if (key === AI_SECTIONS_KEY) continue;
|
|
31206
31002
|
if (key === AI_FOOTER_KEY) continue;
|
|
31207
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31208
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31209
31003
|
if (key === BRAND_KIT_KEY) continue;
|
|
31210
31004
|
if (key === STYLE_STORE_KEY) continue;
|
|
31211
31005
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
31006
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31212
31007
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
31008
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31213
31009
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
31214
31010
|
continue;
|
|
31215
31011
|
}
|
|
31216
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
31217
31012
|
if (applyVideoSettingNode(key, val)) continue;
|
|
31218
31013
|
if (applyCarouselNode(key, val)) continue;
|
|
31219
31014
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -31239,7 +31034,6 @@ function OhhwellsBridge() {
|
|
|
31239
31034
|
});
|
|
31240
31035
|
applyLinkByKey(key, val);
|
|
31241
31036
|
}
|
|
31242
|
-
applySectionEmbeds(content);
|
|
31243
31037
|
applyLogoFromContent(content);
|
|
31244
31038
|
applyLogoSizes(content);
|
|
31245
31039
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
@@ -31872,12 +31666,6 @@ function OhhwellsBridge() {
|
|
|
31872
31666
|
closeLinkPopoverRef.current();
|
|
31873
31667
|
return;
|
|
31874
31668
|
}
|
|
31875
|
-
if (floatingPanelOpenRef.current) {
|
|
31876
|
-
setFloatingPanelRef.current(null);
|
|
31877
|
-
deselectRef.current();
|
|
31878
|
-
deactivateRef.current();
|
|
31879
|
-
return;
|
|
31880
|
-
}
|
|
31881
31669
|
deselectRef.current();
|
|
31882
31670
|
deactivateRef.current();
|
|
31883
31671
|
clearMediaSelectionRef.current();
|
|
@@ -32714,10 +32502,10 @@ function OhhwellsBridge() {
|
|
|
32714
32502
|
window.removeEventListener("message", handleDuplicateSection);
|
|
32715
32503
|
window.removeEventListener("message", handleDeactivate);
|
|
32716
32504
|
window.removeEventListener("message", handleSelectNav);
|
|
32505
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32717
32506
|
window.removeEventListener("message", handleToastAction);
|
|
32718
32507
|
window.removeEventListener("message", handleFormCount);
|
|
32719
32508
|
window.removeEventListener("message", handleUiEscape);
|
|
32720
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32721
32509
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
32722
32510
|
autoSaveTimers.current.clear();
|
|
32723
32511
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -33011,7 +32799,7 @@ function OhhwellsBridge() {
|
|
|
33011
32799
|
postToParent2({
|
|
33012
32800
|
type: "ow:ready",
|
|
33013
32801
|
version: "1",
|
|
33014
|
-
bridgeVersion: "0.1.
|
|
32802
|
+
bridgeVersion: "0.1.167",
|
|
33015
32803
|
path: pathname,
|
|
33016
32804
|
nodes: collectEditableNodes(editContentRef.current),
|
|
33017
32805
|
sections
|