@ohhwells/bridge 0.1.167 → 0.1.168-next.447
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 +1051 -826
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1089 -848
- 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 +116 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/OhhwellsBridge.tsx
|
|
4
|
-
import React12, { useCallback as useCallback12, useEffect as useEffect21, useLayoutEffect as
|
|
4
|
+
import React12, { useCallback as useCallback12, useEffect as useEffect21, useLayoutEffect as useLayoutEffect7, useRef as useRef14, useState as useState18 } from "react";
|
|
5
5
|
import { createRoot as createRoot3 } from "react-dom/client";
|
|
6
6
|
import { flushSync as flushSync3 } from "react-dom";
|
|
7
7
|
|
|
@@ -1098,21 +1098,21 @@ function chromeFrom(sample) {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
function filledPrimary(seed) {
|
|
1101
|
-
const
|
|
1102
|
-
const luminance = relativeLuminance(
|
|
1101
|
+
const paint2 = parseColor(paintColor(seed)) ?? { r: 15, g: 15, b: 15, a: 1 };
|
|
1102
|
+
const luminance = relativeLuminance(paint2);
|
|
1103
1103
|
return {
|
|
1104
|
-
background: toCss({ ...
|
|
1104
|
+
background: toCss({ ...paint2, a: 1 }),
|
|
1105
1105
|
color: luminance > 0.55 ? "rgb(15, 15, 15)" : "rgb(255, 255, 255)",
|
|
1106
1106
|
borderColor: TRANSPARENT,
|
|
1107
1107
|
borderWidth: "0px"
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
1110
|
function generatedSecondary(primary) {
|
|
1111
|
-
const
|
|
1111
|
+
const paint2 = accentColor(primary);
|
|
1112
1112
|
return {
|
|
1113
1113
|
background: TRANSPARENT,
|
|
1114
|
-
color:
|
|
1115
|
-
borderColor:
|
|
1114
|
+
color: paint2,
|
|
1115
|
+
borderColor: paint2,
|
|
1116
1116
|
borderWidth: "1px"
|
|
1117
1117
|
};
|
|
1118
1118
|
}
|
|
@@ -1125,9 +1125,9 @@ function generatedGhost(primary) {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
function normalizeOutlineChrome(outline, primary) {
|
|
1128
|
-
const
|
|
1128
|
+
const paint2 = accentColor(primary);
|
|
1129
1129
|
const text = parseColor(outline.color);
|
|
1130
|
-
const paintRgb = parseColor(
|
|
1130
|
+
const paintRgb = parseColor(paint2);
|
|
1131
1131
|
const primaryLabel = parseColor(primary.color);
|
|
1132
1132
|
const matchesOnPrimary = Boolean(text && primaryLabel) && colorKey(outline.color) === colorKey(primary.color);
|
|
1133
1133
|
const textTooLight = text ? relativeLuminance(text) > 0.7 : false;
|
|
@@ -1136,8 +1136,8 @@ function normalizeOutlineChrome(outline, primary) {
|
|
|
1136
1136
|
const hasBorder = parseFloat(outline.borderWidth) > 0;
|
|
1137
1137
|
return {
|
|
1138
1138
|
...outline,
|
|
1139
|
-
color:
|
|
1140
|
-
borderColor: hasBorder ?
|
|
1139
|
+
color: paint2,
|
|
1140
|
+
borderColor: hasBorder ? paint2 : outline.borderColor
|
|
1141
1141
|
};
|
|
1142
1142
|
}
|
|
1143
1143
|
function generateButtonVariants(samples) {
|
|
@@ -5431,14 +5431,14 @@ function singleIndexSegment(key) {
|
|
|
5431
5431
|
function indexFromKey(key, position) {
|
|
5432
5432
|
return parseInt(baseKey(key).split("-")[position] ?? "", 10);
|
|
5433
5433
|
}
|
|
5434
|
-
function detectItemGroups(
|
|
5435
|
-
if (isGeneratedSection(
|
|
5434
|
+
function detectItemGroups(sectionEl2) {
|
|
5435
|
+
if (isGeneratedSection(sectionEl2)) return detectGeneratedCards(sectionEl2);
|
|
5436
5436
|
const groups = [];
|
|
5437
5437
|
const seenParents = /* @__PURE__ */ new Set();
|
|
5438
5438
|
const parents = /* @__PURE__ */ new Set();
|
|
5439
|
-
|
|
5439
|
+
sectionEl2.querySelectorAll("[data-ohw-key], [data-ohw-href-key]").forEach((keyedEl) => {
|
|
5440
5440
|
let el = keyedEl;
|
|
5441
|
-
while (el && el !==
|
|
5441
|
+
while (el && el !== sectionEl2) {
|
|
5442
5442
|
if (el.parentElement) parents.add(el.parentElement);
|
|
5443
5443
|
el = el.parentElement;
|
|
5444
5444
|
}
|
|
@@ -5528,8 +5528,8 @@ function detectItemGroups(sectionEl) {
|
|
|
5528
5528
|
}
|
|
5529
5529
|
return groups.sort((a, b) => a.nested === b.nested ? 0 : a.nested ? 1 : -1);
|
|
5530
5530
|
}
|
|
5531
|
-
function detectGeneratedCards(
|
|
5532
|
-
const cards = Array.from(
|
|
5531
|
+
function detectGeneratedCards(sectionEl2) {
|
|
5532
|
+
const cards = Array.from(sectionEl2.querySelectorAll("[data-ohw-card]")).filter(
|
|
5533
5533
|
(el) => !el.parentElement?.closest("[data-ohw-card]")
|
|
5534
5534
|
);
|
|
5535
5535
|
if (cards.length === 0) return [];
|
|
@@ -5538,7 +5538,7 @@ function detectGeneratedCards(sectionEl) {
|
|
|
5538
5538
|
item.el.setAttribute(ITEM_ATTR, `card:${item.index}`);
|
|
5539
5539
|
item.el.setAttribute(ITEM_SURFACE_ATTR, "");
|
|
5540
5540
|
}
|
|
5541
|
-
return [{ group: "card", parent: cards[0].parentElement ??
|
|
5541
|
+
return [{ group: "card", parent: cards[0].parentElement ?? sectionEl2, nested: false, items, generated: true }];
|
|
5542
5542
|
}
|
|
5543
5543
|
function firstTextLabel(item) {
|
|
5544
5544
|
for (const k of item.keyed) {
|
|
@@ -5554,13 +5554,13 @@ function findItemSection(sectionId) {
|
|
|
5554
5554
|
const escaped = CSS.escape(sectionId);
|
|
5555
5555
|
return document.querySelector(`[data-ohw-instance="${escaped}"]`) ?? document.querySelector(`[data-ohw-section="${escaped}"]`);
|
|
5556
5556
|
}
|
|
5557
|
-
function isGeneratedSection(
|
|
5558
|
-
return !!
|
|
5557
|
+
function isGeneratedSection(sectionEl2) {
|
|
5558
|
+
return !!sectionEl2.closest("[data-ohw-ai-generated]") || sectionEl2.hasAttribute("data-ai-section");
|
|
5559
5559
|
}
|
|
5560
|
-
function collectItemGroups(
|
|
5561
|
-
if (isChromeSection(
|
|
5562
|
-
const sectionId = instanceIdOf(
|
|
5563
|
-
return detectItemGroups(
|
|
5560
|
+
function collectItemGroups(sectionEl2) {
|
|
5561
|
+
if (isChromeSection(sectionEl2)) return [];
|
|
5562
|
+
const sectionId = instanceIdOf(sectionEl2);
|
|
5563
|
+
return detectItemGroups(sectionEl2).map((g) => ({
|
|
5564
5564
|
sectionId,
|
|
5565
5565
|
group: g.group,
|
|
5566
5566
|
nested: g.nested,
|
|
@@ -5729,11 +5729,11 @@ function initItemInstancesFromContent(content) {
|
|
|
5729
5729
|
document.querySelectorAll(`[${ITEM_REMOVED_ATTR}]`).forEach((el) => setRemoved(el, false));
|
|
5730
5730
|
if (!store) return;
|
|
5731
5731
|
for (const [sectionId, groups] of Object.entries(store.sections)) {
|
|
5732
|
-
const
|
|
5733
|
-
if (!
|
|
5732
|
+
const sectionEl2 = findItemSection(sectionId);
|
|
5733
|
+
if (!sectionEl2) continue;
|
|
5734
5734
|
const ordered = Object.entries(groups).sort(([a], [b]) => a.length - b.length);
|
|
5735
5735
|
for (const [group, state] of ordered) {
|
|
5736
|
-
const found = detectItemGroups(
|
|
5736
|
+
const found = detectItemGroups(sectionEl2).find((g) => g.group === group);
|
|
5737
5737
|
if (!found || found.generated) continue;
|
|
5738
5738
|
syncGroup(found, state);
|
|
5739
5739
|
}
|
|
@@ -5773,9 +5773,9 @@ function writeValue(el, attr, value) {
|
|
|
5773
5773
|
}
|
|
5774
5774
|
}
|
|
5775
5775
|
function applyItemOps(store, ops, currentContent) {
|
|
5776
|
-
const
|
|
5777
|
-
if (!
|
|
5778
|
-
const detected = detectItemGroups(
|
|
5776
|
+
const sectionEl2 = findItemSection(ops.sectionId);
|
|
5777
|
+
if (!sectionEl2) return null;
|
|
5778
|
+
const detected = detectItemGroups(sectionEl2).find((g) => g.group === ops.group);
|
|
5779
5779
|
if (!detected || detected.generated) return null;
|
|
5780
5780
|
const next = { v: 1, sections: { ...store?.sections ?? {} } };
|
|
5781
5781
|
const groups = { ...next.sections[ops.sectionId] ?? {} };
|
|
@@ -6185,10 +6185,10 @@ function applyStylesToDom(store) {
|
|
|
6185
6185
|
if (bar === -1) continue;
|
|
6186
6186
|
const sectionId = key.slice(0, bar);
|
|
6187
6187
|
const stamp = key.slice(bar + 1);
|
|
6188
|
-
const
|
|
6189
|
-
if (!
|
|
6190
|
-
detectItemGroups(
|
|
6191
|
-
const item =
|
|
6188
|
+
const sectionEl2 = findItemSection(sectionId);
|
|
6189
|
+
if (!sectionEl2) continue;
|
|
6190
|
+
detectItemGroups(sectionEl2);
|
|
6191
|
+
const item = sectionEl2.querySelector(`[data-ohw-item="${CSS.escape(stamp)}"]`);
|
|
6192
6192
|
if (!item) continue;
|
|
6193
6193
|
saveInline(item, "background");
|
|
6194
6194
|
item.style.setProperty("background", override.backgroundColor, "important");
|
|
@@ -6678,6 +6678,21 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
6678
6678
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
6679
6679
|
return target ? pricingFeatureList(target).length : 0;
|
|
6680
6680
|
}
|
|
6681
|
+
function prevailingFeatureIcon(features) {
|
|
6682
|
+
const counts = /* @__PURE__ */ new Map();
|
|
6683
|
+
for (const row of features) {
|
|
6684
|
+
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
6685
|
+
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
6686
|
+
entry.count += 1;
|
|
6687
|
+
counts.set(key, entry);
|
|
6688
|
+
}
|
|
6689
|
+
let best = null;
|
|
6690
|
+
for (const entry of counts.values()) {
|
|
6691
|
+
if (!best || entry.count > best.count) best = entry;
|
|
6692
|
+
}
|
|
6693
|
+
if (!best) return {};
|
|
6694
|
+
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
6695
|
+
}
|
|
6681
6696
|
function addPricingCardFeature(tree, index, text) {
|
|
6682
6697
|
return withPricingCollection(tree, (collection) => {
|
|
6683
6698
|
const children = collection.children;
|
|
@@ -6686,7 +6701,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
6686
6701
|
const features = pricingFeatureList(target);
|
|
6687
6702
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
6688
6703
|
target.slots = target.slots ?? {};
|
|
6689
|
-
target.slots.features = [...features, { text }];
|
|
6704
|
+
target.slots.features = [...features, { text, ...prevailingFeatureIcon(features) }];
|
|
6690
6705
|
return true;
|
|
6691
6706
|
});
|
|
6692
6707
|
}
|
|
@@ -7330,6 +7345,120 @@ function findSelectableNavContainer(doc = document) {
|
|
|
7330
7345
|
);
|
|
7331
7346
|
}
|
|
7332
7347
|
|
|
7348
|
+
// src/lib/youtube.ts
|
|
7349
|
+
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
7350
|
+
function extractYouTubeId(input) {
|
|
7351
|
+
const trimmed = input.trim();
|
|
7352
|
+
if (!trimmed) return null;
|
|
7353
|
+
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
7354
|
+
let url;
|
|
7355
|
+
try {
|
|
7356
|
+
url = new URL(trimmed);
|
|
7357
|
+
} catch {
|
|
7358
|
+
return null;
|
|
7359
|
+
}
|
|
7360
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
7361
|
+
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
7362
|
+
return null;
|
|
7363
|
+
}
|
|
7364
|
+
let candidate = null;
|
|
7365
|
+
if (host === "youtu.be") {
|
|
7366
|
+
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
7367
|
+
} else if (url.pathname === "/watch") {
|
|
7368
|
+
candidate = url.searchParams.get("v");
|
|
7369
|
+
} else {
|
|
7370
|
+
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
7371
|
+
candidate = match ? match[1] : null;
|
|
7372
|
+
}
|
|
7373
|
+
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
7374
|
+
}
|
|
7375
|
+
|
|
7376
|
+
// src/lib/section-embed.ts
|
|
7377
|
+
var SECTION_EMBED_SUFFIX = "__ohw_embed";
|
|
7378
|
+
function readStoredEmbed(value) {
|
|
7379
|
+
if (value.startsWith("start\n")) {
|
|
7380
|
+
return { raw: value.slice("start\n".length), at: "start" };
|
|
7381
|
+
}
|
|
7382
|
+
return { raw: value, at: "end" };
|
|
7383
|
+
}
|
|
7384
|
+
function embedFrameSrc(value) {
|
|
7385
|
+
const videoId = extractYouTubeId(value);
|
|
7386
|
+
if (videoId) {
|
|
7387
|
+
return { src: `https://www.youtube-nocookie.com/embed/${videoId}?rel=0`, title: "YouTube video" };
|
|
7388
|
+
}
|
|
7389
|
+
let url;
|
|
7390
|
+
try {
|
|
7391
|
+
url = new URL(value);
|
|
7392
|
+
} catch {
|
|
7393
|
+
return null;
|
|
7394
|
+
}
|
|
7395
|
+
const host = url.hostname.replace(/^www\./, "").toLowerCase();
|
|
7396
|
+
if (host === "google.com" && url.pathname.startsWith("/maps") || host === "maps.google.com") {
|
|
7397
|
+
const query = url.searchParams.get("q") || url.searchParams.get("query") || "";
|
|
7398
|
+
const src = query ? `https://maps.google.com/maps?q=${encodeURIComponent(query)}&output=embed` : `https://maps.google.com/maps?output=embed`;
|
|
7399
|
+
return { src, title: "Map" };
|
|
7400
|
+
}
|
|
7401
|
+
if (host === "maps.app.goo.gl") {
|
|
7402
|
+
return { src: value, title: "Map" };
|
|
7403
|
+
}
|
|
7404
|
+
if (host === "calendly.com" || host.endsWith(".calendly.com") || host === "calendar.google.com") {
|
|
7405
|
+
return { src: value, title: "Calendar" };
|
|
7406
|
+
}
|
|
7407
|
+
if (host === "docs.google.com" && url.pathname.includes("/forms/")) {
|
|
7408
|
+
return { src: value.replace(/\/edit(?:\?.*)?$/i, "/viewform"), title: "Form" };
|
|
7409
|
+
}
|
|
7410
|
+
if (host === "forms.gle") {
|
|
7411
|
+
return { src: value, title: "Form" };
|
|
7412
|
+
}
|
|
7413
|
+
return null;
|
|
7414
|
+
}
|
|
7415
|
+
function place(section, box, at) {
|
|
7416
|
+
if (at === "start") {
|
|
7417
|
+
section.insertBefore(box, section.firstChild);
|
|
7418
|
+
return;
|
|
7419
|
+
}
|
|
7420
|
+
section.appendChild(box);
|
|
7421
|
+
}
|
|
7422
|
+
function paint(section, key, src, title, at) {
|
|
7423
|
+
const existing = section.querySelector(`[data-ohw-section-embed="${CSS.escape(key)}"]`);
|
|
7424
|
+
const frame = existing?.querySelector("iframe");
|
|
7425
|
+
if (existing && frame) {
|
|
7426
|
+
if (frame.getAttribute("src") !== src) frame.setAttribute("src", src);
|
|
7427
|
+
frame.title = title;
|
|
7428
|
+
place(section, existing, at);
|
|
7429
|
+
return;
|
|
7430
|
+
}
|
|
7431
|
+
existing?.remove();
|
|
7432
|
+
const box = document.createElement("div");
|
|
7433
|
+
box.setAttribute("data-ohw-section-embed", key);
|
|
7434
|
+
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;";
|
|
7435
|
+
const frameWrap = document.createElement("div");
|
|
7436
|
+
frameWrap.style.cssText = "position:relative;width:100%;aspect-ratio:16/9;min-height:250px;border-radius:12px;overflow:hidden;background:#0f172a;";
|
|
7437
|
+
const iframe = document.createElement("iframe");
|
|
7438
|
+
iframe.src = src;
|
|
7439
|
+
iframe.title = title;
|
|
7440
|
+
iframe.style.cssText = "position:absolute;inset:0;width:100%;height:100%;border:0;";
|
|
7441
|
+
iframe.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture";
|
|
7442
|
+
iframe.setAttribute("allowfullscreen", "");
|
|
7443
|
+
frameWrap.appendChild(iframe);
|
|
7444
|
+
box.appendChild(frameWrap);
|
|
7445
|
+
place(section, box, at);
|
|
7446
|
+
}
|
|
7447
|
+
function applySectionEmbeds(content) {
|
|
7448
|
+
for (const [key, val] of Object.entries(content)) {
|
|
7449
|
+
if (!key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
7450
|
+
const sectionId = key.slice(0, -SECTION_EMBED_SUFFIX.length);
|
|
7451
|
+
const section = document.querySelector(`[data-ohw-section="${CSS.escape(sectionId)}"]`);
|
|
7452
|
+
const stored = typeof val === "string" ? readStoredEmbed(val) : null;
|
|
7453
|
+
const frame = stored ? embedFrameSrc(stored.raw) : null;
|
|
7454
|
+
if (!section || !stored || !frame) {
|
|
7455
|
+
section?.querySelector(`[data-ohw-section-embed="${CSS.escape(key)}"]`)?.remove();
|
|
7456
|
+
continue;
|
|
7457
|
+
}
|
|
7458
|
+
paint(section, key, frame.src, frame.title, stored.at);
|
|
7459
|
+
}
|
|
7460
|
+
}
|
|
7461
|
+
|
|
7333
7462
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
7334
7463
|
import { flushSync } from "react-dom";
|
|
7335
7464
|
import { createRoot } from "react-dom/client";
|
|
@@ -7903,7 +8032,7 @@ var AI_MOBILE_CSS = [
|
|
|
7903
8032
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
7904
8033
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
7905
8034
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
7906
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
8035
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-section-inner`.
|
|
7907
8036
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
7908
8037
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
7909
8038
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -7919,8 +8048,10 @@ var AI_MOBILE_CSS = [
|
|
|
7919
8048
|
"[data-ai-section]{overflow-x:hidden}",
|
|
7920
8049
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
7921
8050
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
7922
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
7923
|
-
|
|
8051
|
+
// still got a 20px band of section background down both sides on a phone. The footer's own
|
|
8052
|
+
// container keeps the unguarded rule below — `data-ai-full-bleed` can never appear on it.
|
|
8053
|
+
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8054
|
+
"[data-ai-container]{padding:0 20px !important}",
|
|
7924
8055
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
7925
8056
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
7926
8057
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8125,6 +8256,31 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8125
8256
|
function textAttrs(ctx, path) {
|
|
8126
8257
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8127
8258
|
}
|
|
8259
|
+
var AI_RESPONSIVE_CSS = [
|
|
8260
|
+
"@media (max-width: 960px) {",
|
|
8261
|
+
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
8262
|
+
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
8263
|
+
"}",
|
|
8264
|
+
"@media (max-width: 640px) {",
|
|
8265
|
+
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
8266
|
+
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
8267
|
+
// Group containers flatten to a column on phones; span placements come along for free.
|
|
8268
|
+
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
8269
|
+
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
8270
|
+
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
8271
|
+
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
8272
|
+
// layered text used to be.
|
|
8273
|
+
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
8274
|
+
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
8275
|
+
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
8276
|
+
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
8277
|
+
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
8278
|
+
// other rule had already been taught to stand down.
|
|
8279
|
+
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
8280
|
+
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
8281
|
+
" [data-ai-responsive] img { max-width: 100%; }",
|
|
8282
|
+
"}"
|
|
8283
|
+
].join("\n");
|
|
8128
8284
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8129
8285
|
function MediaBox({
|
|
8130
8286
|
refValue,
|
|
@@ -8179,7 +8335,7 @@ function MediaBox({
|
|
|
8179
8335
|
position: fill ? "absolute" : void 0,
|
|
8180
8336
|
inset: fill ? 0 : void 0,
|
|
8181
8337
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8182
|
-
height: fill ? "100%" : void 0,
|
|
8338
|
+
height: fill ? "100%" : fixedSize ? height : void 0,
|
|
8183
8339
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8184
8340
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8185
8341
|
borderRadius: radius,
|
|
@@ -9675,7 +9831,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
9675
9831
|
return /* @__PURE__ */ jsx(
|
|
9676
9832
|
"div",
|
|
9677
9833
|
{
|
|
9678
|
-
"data-ai-grid":
|
|
9834
|
+
"data-ai-grid": String(itemsPerRow),
|
|
9679
9835
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
9680
9836
|
style: {
|
|
9681
9837
|
display: "grid",
|
|
@@ -9977,7 +10133,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
9977
10133
|
},
|
|
9978
10134
|
children: [
|
|
9979
10135
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
9980
|
-
// The section's `data-ai-
|
|
10136
|
+
// The section's `data-ai-section-inner` gave up its max-width/gutter so the base
|
|
9981
10137
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
9982
10138
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
9983
10139
|
// the full section width instead of reading at the usual content width.
|
|
@@ -10396,6 +10552,7 @@ function AiTreeRenderer({
|
|
|
10396
10552
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
10397
10553
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
10398
10554
|
...bgAttrs,
|
|
10555
|
+
"data-ai-responsive": "",
|
|
10399
10556
|
style: {
|
|
10400
10557
|
position: "relative",
|
|
10401
10558
|
padding: `${padCss} 0`,
|
|
@@ -10409,12 +10566,13 @@ function AiTreeRenderer({
|
|
|
10409
10566
|
...fillHeight ? { display: "grid" } : {}
|
|
10410
10567
|
},
|
|
10411
10568
|
children: [
|
|
10412
|
-
|
|
10569
|
+
/* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
|
|
10413
10570
|
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10571
|
+
isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
10414
10572
|
/* @__PURE__ */ jsx(
|
|
10415
10573
|
"div",
|
|
10416
10574
|
{
|
|
10417
|
-
"data-ai-
|
|
10575
|
+
"data-ai-section-inner": "",
|
|
10418
10576
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
10419
10577
|
style: {
|
|
10420
10578
|
position: "relative",
|
|
@@ -10431,7 +10589,7 @@ function AiTreeRenderer({
|
|
|
10431
10589
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
|
|
10432
10590
|
"div",
|
|
10433
10591
|
{
|
|
10434
|
-
"data-ai-
|
|
10592
|
+
"data-ai-columns": "",
|
|
10435
10593
|
style: {
|
|
10436
10594
|
display: "grid",
|
|
10437
10595
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11093,9 +11251,10 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11093
11251
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11094
11252
|
continue;
|
|
11095
11253
|
}
|
|
11096
|
-
const isNewMount = !existing || !existing.container.isConnected;
|
|
11097
11254
|
let container = existing?.container;
|
|
11255
|
+
let isNewMount = false;
|
|
11098
11256
|
if (!container || !container.isConnected) {
|
|
11257
|
+
isNewMount = true;
|
|
11099
11258
|
existing?.root.unmount();
|
|
11100
11259
|
container?.remove();
|
|
11101
11260
|
container = document.createElement("div");
|
|
@@ -11433,6 +11592,34 @@ function minSpanForFooterBlock(type) {
|
|
|
11433
11592
|
return 3;
|
|
11434
11593
|
}
|
|
11435
11594
|
}
|
|
11595
|
+
function readLiveSocialItems() {
|
|
11596
|
+
const root = getFooterRoot();
|
|
11597
|
+
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
11598
|
+
if (!row) return [];
|
|
11599
|
+
const items = [];
|
|
11600
|
+
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
11601
|
+
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
11602
|
+
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
11603
|
+
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
11604
|
+
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
11605
|
+
items.push({ platform, href });
|
|
11606
|
+
}
|
|
11607
|
+
return items;
|
|
11608
|
+
}
|
|
11609
|
+
function syncSocialRowsFromDom(tree) {
|
|
11610
|
+
const root = getFooterRoot();
|
|
11611
|
+
if (!root) return;
|
|
11612
|
+
const row = root.querySelector("[data-ohw-socials-row]");
|
|
11613
|
+
const live = readLiveSocialItems();
|
|
11614
|
+
if (row && live.length === 0) return;
|
|
11615
|
+
for (const col of tree.columns) {
|
|
11616
|
+
col.blocks = col.blocks.flatMap((block) => {
|
|
11617
|
+
if (block.type !== "social-row") return [block];
|
|
11618
|
+
if (!row) return [];
|
|
11619
|
+
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
11620
|
+
});
|
|
11621
|
+
}
|
|
11622
|
+
}
|
|
11436
11623
|
function collectBrandBlocks(tree) {
|
|
11437
11624
|
const brand = [];
|
|
11438
11625
|
for (const col of tree.columns) {
|
|
@@ -11678,6 +11865,7 @@ function textOf2(el) {
|
|
|
11678
11865
|
}
|
|
11679
11866
|
function syncFooterTreeLinksFromDom(tree) {
|
|
11680
11867
|
const next = cloneTree(tree);
|
|
11868
|
+
syncSocialRowsFromDom(next);
|
|
11681
11869
|
const domCols = listFooterColumns().map((col) => {
|
|
11682
11870
|
const heading = getFooterColumnHeadingEl(col);
|
|
11683
11871
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -17490,7 +17678,7 @@ function apiBase() {
|
|
|
17490
17678
|
function bridgeVersion() {
|
|
17491
17679
|
try {
|
|
17492
17680
|
if (true) {
|
|
17493
|
-
return "0.1.
|
|
17681
|
+
return "0.1.168-next.447";
|
|
17494
17682
|
}
|
|
17495
17683
|
} catch {
|
|
17496
17684
|
}
|
|
@@ -17504,7 +17692,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17504
17692
|
return;
|
|
17505
17693
|
}
|
|
17506
17694
|
try {
|
|
17507
|
-
const v = true ? "0.1.
|
|
17695
|
+
const v = true ? "0.1.168-next.447" : "";
|
|
17508
17696
|
if (v) {
|
|
17509
17697
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17510
17698
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -18182,6 +18370,7 @@ function MediaOverlay({
|
|
|
18182
18370
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
18183
18371
|
);
|
|
18184
18372
|
}, [isVideo]);
|
|
18373
|
+
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
18185
18374
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
18186
18375
|
const box = {
|
|
18187
18376
|
position: "fixed",
|
|
@@ -18280,11 +18469,10 @@ function MediaOverlay({
|
|
|
18280
18469
|
className: "flex items-center justify-center cursor-pointer",
|
|
18281
18470
|
style: {
|
|
18282
18471
|
...box,
|
|
18283
|
-
//
|
|
18284
|
-
//
|
|
18285
|
-
//
|
|
18286
|
-
|
|
18287
|
-
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
18472
|
+
// Visual only. `pointer-events: auto` on this full-bleed rect covered the navbar
|
|
18473
|
+
// (hero bg includes the absolute TopNav) and swallowed CTA press-drag. Text overlay
|
|
18474
|
+
// and cueOnly also need clicks to fall through — Replace / video controls opt back in.
|
|
18475
|
+
pointerEvents: "none",
|
|
18288
18476
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
18289
18477
|
// than hovered. Hover keeps the existing tinted preview.
|
|
18290
18478
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -18311,17 +18499,17 @@ function MediaOverlay({
|
|
|
18311
18499
|
},
|
|
18312
18500
|
children: [
|
|
18313
18501
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18314
|
-
|
|
18502
|
+
replaceLabel
|
|
18315
18503
|
]
|
|
18316
18504
|
}
|
|
18317
18505
|
),
|
|
18318
|
-
replaceMode
|
|
18506
|
+
showChrome && replaceMode !== "none" && /* @__PURE__ */ jsxs8(
|
|
18319
18507
|
Button,
|
|
18320
18508
|
{
|
|
18321
18509
|
"data-ohw-media-overlay": "",
|
|
18322
18510
|
variant: "outline",
|
|
18323
18511
|
size: "sm",
|
|
18324
|
-
"aria-label":
|
|
18512
|
+
"aria-label": replaceLabel,
|
|
18325
18513
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
18326
18514
|
style: {
|
|
18327
18515
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -18344,7 +18532,7 @@ function MediaOverlay({
|
|
|
18344
18532
|
},
|
|
18345
18533
|
children: [
|
|
18346
18534
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18347
|
-
replaceMode === "full" ?
|
|
18535
|
+
replaceMode === "full" ? replaceLabel : null
|
|
18348
18536
|
]
|
|
18349
18537
|
}
|
|
18350
18538
|
)
|
|
@@ -18440,7 +18628,8 @@ function ensureStyleSheet2() {
|
|
|
18440
18628
|
el.textContent = HIGHLIGHT_CSS;
|
|
18441
18629
|
document.head.appendChild(el);
|
|
18442
18630
|
}
|
|
18443
|
-
|
|
18631
|
+
var sectionEl = (id) => document.querySelector(`[data-ohw-instance="${CSS.escape(id)}"]`) ?? document.querySelector(`[data-ohw-section="${CSS.escape(id)}"]`);
|
|
18632
|
+
function targetsFor(keys, item, sectionId) {
|
|
18444
18633
|
const out = /* @__PURE__ */ new Set();
|
|
18445
18634
|
for (const key of keys) {
|
|
18446
18635
|
if (!key) continue;
|
|
@@ -18451,11 +18640,15 @@ function targetsFor(keys, item) {
|
|
|
18451
18640
|
}
|
|
18452
18641
|
}
|
|
18453
18642
|
if (item) {
|
|
18454
|
-
const section =
|
|
18643
|
+
const section = sectionEl(item.sectionId);
|
|
18455
18644
|
const stamp = `${item.group}:${item.index}`;
|
|
18456
18645
|
const el = section?.querySelector(`[data-ohw-item="${CSS.escape(stamp)}"]`);
|
|
18457
18646
|
if (el) out.add(el);
|
|
18458
18647
|
}
|
|
18648
|
+
if (out.size === 0 && sectionId) {
|
|
18649
|
+
const section = sectionEl(sectionId);
|
|
18650
|
+
if (section) out.add(section);
|
|
18651
|
+
}
|
|
18459
18652
|
return [...out];
|
|
18460
18653
|
}
|
|
18461
18654
|
var clearTimer = null;
|
|
@@ -18468,9 +18661,9 @@ function clearChangeHighlight() {
|
|
|
18468
18661
|
el.removeAttribute(MARK_ATTR);
|
|
18469
18662
|
}
|
|
18470
18663
|
}
|
|
18471
|
-
function highlightChangedElements(keys, item) {
|
|
18664
|
+
function highlightChangedElements(keys, item, sectionId) {
|
|
18472
18665
|
clearChangeHighlight();
|
|
18473
|
-
const targets = targetsFor(keys, item);
|
|
18666
|
+
const targets = targetsFor(keys, item, sectionId);
|
|
18474
18667
|
if (targets.length === 0) return 0;
|
|
18475
18668
|
ensureStyleSheet2();
|
|
18476
18669
|
for (const el of targets) el.setAttribute(MARK_ATTR, "");
|
|
@@ -18481,6 +18674,12 @@ function highlightChangedElements(keys, item) {
|
|
|
18481
18674
|
clearTimer = setTimeout(clearChangeHighlight, HIGHLIGHT_MS);
|
|
18482
18675
|
return targets.length;
|
|
18483
18676
|
}
|
|
18677
|
+
function highlightedRect() {
|
|
18678
|
+
const first = document.querySelector(`[${MARK_ATTR}]`);
|
|
18679
|
+
if (!first) return null;
|
|
18680
|
+
const rect = first.getBoundingClientRect();
|
|
18681
|
+
return { top: rect.top + window.scrollY, bottom: rect.bottom + window.scrollY };
|
|
18682
|
+
}
|
|
18484
18683
|
function installAiChangeHighlight() {
|
|
18485
18684
|
const onMessage = (e) => {
|
|
18486
18685
|
const data = e.data;
|
|
@@ -18488,8 +18687,10 @@ function installAiChangeHighlight() {
|
|
|
18488
18687
|
const keys = Array.isArray(data.keys) ? data.keys.filter((k) => typeof k === "string") : [];
|
|
18489
18688
|
const raw = data.item;
|
|
18490
18689
|
const item = raw && typeof raw.sectionId === "string" && typeof raw.group === "string" && typeof raw.index === "number" ? { sectionId: raw.sectionId, group: raw.group, index: raw.index } : void 0;
|
|
18491
|
-
const
|
|
18492
|
-
|
|
18690
|
+
const sectionId = typeof data.sectionId === "string" ? data.sectionId : void 0;
|
|
18691
|
+
const found = highlightChangedElements(keys, item, sectionId);
|
|
18692
|
+
const rect = data.reveal === true && found > 0 ? highlightedRect() : null;
|
|
18693
|
+
window.parent?.postMessage({ type: "ow:ai-highlight-done", found, ...rect ? { rect } : {} }, "*");
|
|
18493
18694
|
};
|
|
18494
18695
|
window.addEventListener("message", onMessage);
|
|
18495
18696
|
return () => window.removeEventListener("message", onMessage);
|
|
@@ -18688,12 +18889,12 @@ function AiSectionOverlay({
|
|
|
18688
18889
|
const selectFromElement = useCallback2(
|
|
18689
18890
|
(el, options) => {
|
|
18690
18891
|
const inner = el?.closest("[data-ohw-section]") ?? null;
|
|
18691
|
-
const
|
|
18692
|
-
const id =
|
|
18892
|
+
const sectionEl2 = inner ? movableUnit(inner) : null;
|
|
18893
|
+
const id = sectionEl2 ? instanceIdOf(sectionEl2) || null : null;
|
|
18693
18894
|
if (id === selectedIdRef.current) return;
|
|
18694
18895
|
selectedIdRef.current = id;
|
|
18695
18896
|
setSelectedId(id);
|
|
18696
|
-
if (options?.report !== false) report(
|
|
18897
|
+
if (options?.report !== false) report(sectionEl2);
|
|
18697
18898
|
},
|
|
18698
18899
|
[report]
|
|
18699
18900
|
);
|
|
@@ -18701,15 +18902,15 @@ function AiSectionOverlay({
|
|
|
18701
18902
|
apiRef.current = {
|
|
18702
18903
|
selectFromElement,
|
|
18703
18904
|
handleBackgroundClick: (target, clientX, clientY) => {
|
|
18704
|
-
let
|
|
18705
|
-
if (!
|
|
18905
|
+
let sectionEl2 = target?.closest("[data-ohw-section]") ?? null;
|
|
18906
|
+
if (!sectionEl2 && clientX !== void 0 && clientY !== void 0) {
|
|
18706
18907
|
const beneath = document.elementsFromPoint(clientX, clientY).find(
|
|
18707
18908
|
(el) => el instanceof HTMLElement && !el.closest("[data-ohw-bridge-root]") && el.closest("[data-ohw-section]") != null
|
|
18708
18909
|
);
|
|
18709
|
-
|
|
18910
|
+
sectionEl2 = beneath?.closest("[data-ohw-section]") ?? null;
|
|
18710
18911
|
}
|
|
18711
|
-
selectFromElement(
|
|
18712
|
-
return
|
|
18912
|
+
selectFromElement(sectionEl2);
|
|
18913
|
+
return sectionEl2 != null;
|
|
18713
18914
|
},
|
|
18714
18915
|
clear: () => {
|
|
18715
18916
|
selectedIdRef.current = null;
|
|
@@ -18937,8 +19138,24 @@ function AiSectionOverlay({
|
|
|
18937
19138
|
}
|
|
18938
19139
|
|
|
18939
19140
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
18940
|
-
import { useCallback as useCallback3, useEffect as useEffect9, useRef as useRef5, useState as useState8 } from "react";
|
|
18941
|
-
import {
|
|
19141
|
+
import { useCallback as useCallback3, useEffect as useEffect9, useLayoutEffect as useLayoutEffect4, useRef as useRef5, useState as useState8 } from "react";
|
|
19142
|
+
import {
|
|
19143
|
+
AlignCenter,
|
|
19144
|
+
AlignLeft,
|
|
19145
|
+
AlignRight,
|
|
19146
|
+
ArrowLeft as ArrowLeft2,
|
|
19147
|
+
ArrowRight as ArrowRight2,
|
|
19148
|
+
Check as Check2,
|
|
19149
|
+
ChevronDown as ChevronDown3,
|
|
19150
|
+
Image as ImageIcon2,
|
|
19151
|
+
ImageMinus,
|
|
19152
|
+
ImagePlus,
|
|
19153
|
+
Link as LinkIcon,
|
|
19154
|
+
Minus,
|
|
19155
|
+
Palette,
|
|
19156
|
+
Plus as Plus2,
|
|
19157
|
+
Star
|
|
19158
|
+
} from "lucide-react";
|
|
18942
19159
|
|
|
18943
19160
|
// src/lib/ai-media-strip-tree.ts
|
|
18944
19161
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19052,14 +19269,6 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19052
19269
|
return true;
|
|
19053
19270
|
});
|
|
19054
19271
|
}
|
|
19055
|
-
function setMediaStripItemAlt(tree, index, alt) {
|
|
19056
|
-
return withMediaStrip(tree, (block) => {
|
|
19057
|
-
const items = block.items;
|
|
19058
|
-
if (index < 0 || index >= items.length) return false;
|
|
19059
|
-
items[index] = { ...items[index], alt };
|
|
19060
|
-
return true;
|
|
19061
|
-
});
|
|
19062
|
-
}
|
|
19063
19272
|
function setMediaStripItemLink(tree, index, link) {
|
|
19064
19273
|
return withMediaStrip(tree, (block) => {
|
|
19065
19274
|
const items = block.items;
|
|
@@ -19077,28 +19286,155 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19077
19286
|
});
|
|
19078
19287
|
}
|
|
19079
19288
|
|
|
19289
|
+
// src/ui/dialog.tsx
|
|
19290
|
+
import * as React9 from "react";
|
|
19291
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
19292
|
+
import { X as X2 } from "lucide-react";
|
|
19293
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
19294
|
+
function Dialog2({
|
|
19295
|
+
...props
|
|
19296
|
+
}) {
|
|
19297
|
+
return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
19298
|
+
}
|
|
19299
|
+
function DialogPortal({
|
|
19300
|
+
...props
|
|
19301
|
+
}) {
|
|
19302
|
+
return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
|
|
19303
|
+
}
|
|
19304
|
+
function DialogOverlay({
|
|
19305
|
+
className,
|
|
19306
|
+
...props
|
|
19307
|
+
}) {
|
|
19308
|
+
return /* @__PURE__ */ jsx20(
|
|
19309
|
+
DialogPrimitive.Overlay,
|
|
19310
|
+
{
|
|
19311
|
+
"data-slot": "dialog-overlay",
|
|
19312
|
+
"data-ohw-link-modal-root": "",
|
|
19313
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19314
|
+
...props
|
|
19315
|
+
}
|
|
19316
|
+
);
|
|
19317
|
+
}
|
|
19318
|
+
var DialogContent = React9.forwardRef(
|
|
19319
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19320
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
19321
|
+
return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
|
|
19322
|
+
/* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19323
|
+
/* @__PURE__ */ jsxs11(
|
|
19324
|
+
DialogPrimitive.Content,
|
|
19325
|
+
{
|
|
19326
|
+
ref,
|
|
19327
|
+
"data-slot": "dialog-content",
|
|
19328
|
+
className: cn(
|
|
19329
|
+
positionMode,
|
|
19330
|
+
"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",
|
|
19331
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19332
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19333
|
+
className
|
|
19334
|
+
),
|
|
19335
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
19336
|
+
...props,
|
|
19337
|
+
children: [
|
|
19338
|
+
children,
|
|
19339
|
+
showCloseButton ? /* @__PURE__ */ jsx20(
|
|
19340
|
+
DialogPrimitive.Close,
|
|
19341
|
+
{
|
|
19342
|
+
type: "button",
|
|
19343
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19344
|
+
"aria-label": "Close",
|
|
19345
|
+
children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
|
|
19346
|
+
}
|
|
19347
|
+
) : null
|
|
19348
|
+
]
|
|
19349
|
+
}
|
|
19350
|
+
)
|
|
19351
|
+
] });
|
|
19352
|
+
}
|
|
19353
|
+
);
|
|
19354
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
19355
|
+
function DialogHeader({
|
|
19356
|
+
className,
|
|
19357
|
+
...props
|
|
19358
|
+
}) {
|
|
19359
|
+
return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19360
|
+
}
|
|
19361
|
+
function DialogFooter({
|
|
19362
|
+
className,
|
|
19363
|
+
...props
|
|
19364
|
+
}) {
|
|
19365
|
+
return /* @__PURE__ */ jsx20(
|
|
19366
|
+
"div",
|
|
19367
|
+
{
|
|
19368
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
19369
|
+
...props
|
|
19370
|
+
}
|
|
19371
|
+
);
|
|
19372
|
+
}
|
|
19373
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19374
|
+
DialogPrimitive.Title,
|
|
19375
|
+
{
|
|
19376
|
+
ref,
|
|
19377
|
+
className: cn(
|
|
19378
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19379
|
+
className
|
|
19380
|
+
),
|
|
19381
|
+
...props
|
|
19382
|
+
}
|
|
19383
|
+
));
|
|
19384
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
19385
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19386
|
+
DialogPrimitive.Description,
|
|
19387
|
+
{
|
|
19388
|
+
ref,
|
|
19389
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
19390
|
+
...props
|
|
19391
|
+
}
|
|
19392
|
+
));
|
|
19393
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
19394
|
+
var DialogClose = DialogPrimitive.Close;
|
|
19395
|
+
|
|
19080
19396
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19081
|
-
import { Fragment as Fragment7, jsx as
|
|
19082
|
-
var PRIMARY3 = "#0885FE";
|
|
19083
|
-
var
|
|
19084
|
-
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19397
|
+
import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
19398
|
+
var PRIMARY3 = "var(--ohw-primary, #0885FE)";
|
|
19399
|
+
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]";
|
|
19085
19400
|
function findMediaStripItemElement(sectionId, index) {
|
|
19086
|
-
const
|
|
19087
|
-
if (!
|
|
19088
|
-
const items =
|
|
19401
|
+
const sectionEl2 = findByInstanceId(sectionId);
|
|
19402
|
+
if (!sectionEl2) return null;
|
|
19403
|
+
const items = sectionEl2.querySelectorAll("[data-ohw-media-strip-item]");
|
|
19089
19404
|
for (const el of Array.from(items)) {
|
|
19090
19405
|
if (Number(el.dataset.ohwMediaStripIndex) === index) return el;
|
|
19091
19406
|
}
|
|
19092
19407
|
return null;
|
|
19093
19408
|
}
|
|
19094
|
-
function
|
|
19095
|
-
|
|
19409
|
+
function itemRefFromTarget(target) {
|
|
19410
|
+
if (!(target instanceof Element)) return null;
|
|
19411
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19412
|
+
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19413
|
+
if (!itemEl) return null;
|
|
19414
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
19415
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19416
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19417
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19418
|
+
if (!sectionId || Number.isNaN(index)) return null;
|
|
19419
|
+
return { sectionId, index };
|
|
19420
|
+
}
|
|
19421
|
+
function sameRef(a, b) {
|
|
19422
|
+
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19423
|
+
}
|
|
19424
|
+
function rectOf(el) {
|
|
19096
19425
|
if (!el) return null;
|
|
19097
19426
|
const r2 = el.getBoundingClientRect();
|
|
19098
19427
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19099
19428
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19100
19429
|
}
|
|
19101
|
-
function
|
|
19430
|
+
function readRect2(ref) {
|
|
19431
|
+
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19432
|
+
}
|
|
19433
|
+
function readStripRect(ref) {
|
|
19434
|
+
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19435
|
+
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19436
|
+
}
|
|
19437
|
+
function useLiveItemRect(ref, strip = false) {
|
|
19102
19438
|
const [rect, setRect] = useState8(null);
|
|
19103
19439
|
useEffect9(() => {
|
|
19104
19440
|
if (!ref) {
|
|
@@ -19106,7 +19442,7 @@ function useLiveItemRect(ref) {
|
|
|
19106
19442
|
return;
|
|
19107
19443
|
}
|
|
19108
19444
|
const update = () => {
|
|
19109
|
-
const next = readRect2(ref);
|
|
19445
|
+
const next = strip ? readStripRect(ref) : readRect2(ref);
|
|
19110
19446
|
setRect(
|
|
19111
19447
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19112
19448
|
);
|
|
@@ -19121,9 +19457,49 @@ function useLiveItemRect(ref) {
|
|
|
19121
19457
|
window.removeEventListener("resize", update);
|
|
19122
19458
|
clearInterval(interval);
|
|
19123
19459
|
};
|
|
19124
|
-
}, [ref?.sectionId, ref?.index]);
|
|
19460
|
+
}, [ref?.sectionId, ref?.index, strip]);
|
|
19125
19461
|
return rect;
|
|
19126
19462
|
}
|
|
19463
|
+
var TOOLBAR_STRIP_GAP = 52;
|
|
19464
|
+
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19465
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19466
|
+
function StripToolbarSlot({ stripRect, children }) {
|
|
19467
|
+
const slotRef = useRef5(null);
|
|
19468
|
+
const [shift, setShift] = useState8(0);
|
|
19469
|
+
const centerX = stripRect.left + stripRect.width / 2;
|
|
19470
|
+
useLayoutEffect4(() => {
|
|
19471
|
+
const slot = slotRef.current;
|
|
19472
|
+
if (!slot) return;
|
|
19473
|
+
const clamp = () => {
|
|
19474
|
+
const w = slot.offsetWidth;
|
|
19475
|
+
if (w <= 0) return;
|
|
19476
|
+
const half = w / 2;
|
|
19477
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19478
|
+
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19479
|
+
};
|
|
19480
|
+
clamp();
|
|
19481
|
+
const ro = new ResizeObserver(clamp);
|
|
19482
|
+
ro.observe(slot);
|
|
19483
|
+
return () => ro.disconnect();
|
|
19484
|
+
}, [centerX, children]);
|
|
19485
|
+
const mobile = window.innerWidth <= 480;
|
|
19486
|
+
return /* @__PURE__ */ jsx21(
|
|
19487
|
+
"div",
|
|
19488
|
+
{
|
|
19489
|
+
ref: slotRef,
|
|
19490
|
+
"data-ohw-bridge": "",
|
|
19491
|
+
"data-ohw-item-interaction": "",
|
|
19492
|
+
className: "pointer-events-auto fixed",
|
|
19493
|
+
style: {
|
|
19494
|
+
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19495
|
+
left: centerX + shift,
|
|
19496
|
+
transform: "translate(-50%, -100%)",
|
|
19497
|
+
zIndex: 2147483645
|
|
19498
|
+
},
|
|
19499
|
+
children
|
|
19500
|
+
}
|
|
19501
|
+
);
|
|
19502
|
+
}
|
|
19127
19503
|
function requestValidateTree(postToParent2, tree) {
|
|
19128
19504
|
return new Promise((resolve) => {
|
|
19129
19505
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19160,116 +19536,72 @@ function requestAssetPick(postToParent2) {
|
|
|
19160
19536
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19161
19537
|
});
|
|
19162
19538
|
}
|
|
19163
|
-
function
|
|
19539
|
+
function ToolbarAction({
|
|
19164
19540
|
label,
|
|
19165
19541
|
onClick,
|
|
19166
|
-
disabled,
|
|
19167
|
-
active
|
|
19542
|
+
disabled = false,
|
|
19543
|
+
active = false,
|
|
19544
|
+
children
|
|
19168
19545
|
}) {
|
|
19169
|
-
|
|
19170
|
-
|
|
19171
|
-
{
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
disabled,
|
|
19175
|
-
style: {
|
|
19176
|
-
height: 28,
|
|
19177
|
-
padding: "0 10px",
|
|
19178
|
-
display: "inline-flex",
|
|
19179
|
-
alignItems: "center",
|
|
19180
|
-
gap: 4,
|
|
19181
|
-
borderRadius: 999,
|
|
19182
|
-
border: "none",
|
|
19183
|
-
cursor: disabled ? "default" : "pointer",
|
|
19184
|
-
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19185
|
-
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19186
|
-
opacity: disabled ? 0.4 : 1,
|
|
19187
|
-
fontSize: 12,
|
|
19188
|
-
lineHeight: "16px",
|
|
19189
|
-
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19190
|
-
whiteSpace: "nowrap",
|
|
19191
|
-
flex: "0 0 auto"
|
|
19192
|
-
},
|
|
19193
|
-
children: label
|
|
19194
|
-
}
|
|
19195
|
-
);
|
|
19546
|
+
const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
|
|
19547
|
+
return /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19548
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
|
|
19549
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
19550
|
+
] });
|
|
19196
19551
|
}
|
|
19197
|
-
function
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
|
|
19201
|
-
|
|
19202
|
-
|
|
19203
|
-
|
|
19204
|
-
|
|
19205
|
-
|
|
19206
|
-
|
|
19207
|
-
|
|
19208
|
-
|
|
19209
|
-
|
|
19210
|
-
|
|
19211
|
-
|
|
19212
|
-
|
|
19213
|
-
|
|
19214
|
-
|
|
19215
|
-
|
|
19216
|
-
|
|
19217
|
-
|
|
19218
|
-
|
|
19219
|
-
|
|
19220
|
-
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
},
|
|
19227
|
-
children: "Alt"
|
|
19228
|
-
}
|
|
19229
|
-
),
|
|
19230
|
-
/* @__PURE__ */ jsx20(
|
|
19231
|
-
"input",
|
|
19552
|
+
function ToolbarSeparator() {
|
|
19553
|
+
return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
19554
|
+
}
|
|
19555
|
+
function OptionMenu({
|
|
19556
|
+
label,
|
|
19557
|
+
value,
|
|
19558
|
+
options,
|
|
19559
|
+
onChange
|
|
19560
|
+
}) {
|
|
19561
|
+
const current = options.find((o) => o.value === value) ?? options[0];
|
|
19562
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
19563
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: label }),
|
|
19564
|
+
/* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
|
|
19565
|
+
/* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
19566
|
+
"button",
|
|
19567
|
+
{
|
|
19568
|
+
type: "button",
|
|
19569
|
+
"aria-label": label,
|
|
19570
|
+
className: "inline-flex h-8 min-w-[76px] items-center gap-[7px] rounded-[6px] bg-transparent px-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted data-[state=open]:bg-muted",
|
|
19571
|
+
children: [
|
|
19572
|
+
/* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
|
|
19573
|
+
/* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
|
|
19574
|
+
]
|
|
19575
|
+
}
|
|
19576
|
+
) }),
|
|
19577
|
+
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
19578
|
+
const selected = option.value === value;
|
|
19579
|
+
return /* @__PURE__ */ jsxs12(
|
|
19580
|
+
DropdownMenuItem,
|
|
19232
19581
|
{
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
"aria-label": "Image alt text",
|
|
19248
|
-
style: {
|
|
19249
|
-
flex: 1,
|
|
19250
|
-
minWidth: 0,
|
|
19251
|
-
border: "none",
|
|
19252
|
-
outline: "none",
|
|
19253
|
-
background: "transparent",
|
|
19254
|
-
fontSize: 12,
|
|
19255
|
-
lineHeight: "16px",
|
|
19256
|
-
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19257
|
-
color: "#1f2937"
|
|
19258
|
-
}
|
|
19259
|
-
}
|
|
19260
|
-
)
|
|
19261
|
-
]
|
|
19262
|
-
}
|
|
19263
|
-
);
|
|
19582
|
+
role: "menuitemradio",
|
|
19583
|
+
"aria-checked": selected,
|
|
19584
|
+
onSelect: () => onChange(option.value),
|
|
19585
|
+
className: cn("grid grid-cols-[1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
19586
|
+
children: [
|
|
19587
|
+
/* @__PURE__ */ jsx21("span", { children: option.label }),
|
|
19588
|
+
selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
|
|
19589
|
+
]
|
|
19590
|
+
},
|
|
19591
|
+
option.value
|
|
19592
|
+
);
|
|
19593
|
+
}) })
|
|
19594
|
+
] })
|
|
19595
|
+
] });
|
|
19264
19596
|
}
|
|
19265
19597
|
var VARIANTS = [
|
|
19266
19598
|
{ value: "logos", label: "Logos" },
|
|
19267
19599
|
{ value: "reel", label: "Reel" }
|
|
19268
19600
|
];
|
|
19269
19601
|
var ALIGNS = [
|
|
19270
|
-
{ value: "left", label: "
|
|
19271
|
-
{ value: "center", label: "
|
|
19272
|
-
{ value: "right", label: "
|
|
19602
|
+
{ value: "left", label: "Align left", Icon: AlignLeft },
|
|
19603
|
+
{ value: "center", label: "Align center", Icon: AlignCenter },
|
|
19604
|
+
{ value: "right", label: "Align right", Icon: AlignRight }
|
|
19273
19605
|
];
|
|
19274
19606
|
var HOVERS = [
|
|
19275
19607
|
{ value: "none", label: "None" },
|
|
@@ -19277,104 +19609,104 @@ var HOVERS = [
|
|
|
19277
19609
|
{ value: "zoom", label: "Zoom" },
|
|
19278
19610
|
{ value: "fade", label: "Fade" }
|
|
19279
19611
|
];
|
|
19280
|
-
var TREATMENTS = [
|
|
19281
|
-
{ value: "color", label: "Color" },
|
|
19282
|
-
{ value: "grayscale", label: "Grayscale" }
|
|
19283
|
-
];
|
|
19284
19612
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
19285
|
-
function
|
|
19286
|
-
|
|
19613
|
+
function LinkModal({
|
|
19614
|
+
href,
|
|
19615
|
+
linkTarget,
|
|
19616
|
+
onClose,
|
|
19617
|
+
onSave
|
|
19618
|
+
}) {
|
|
19619
|
+
const [draft, setDraft] = useState8(href);
|
|
19620
|
+
const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
|
|
19287
19621
|
const [invalid, setInvalid] = useState8(false);
|
|
19288
|
-
|
|
19289
|
-
setDraft(value);
|
|
19290
|
-
setInvalid(false);
|
|
19291
|
-
}, [value]);
|
|
19292
|
-
const commit2 = () => {
|
|
19622
|
+
const save = () => {
|
|
19293
19623
|
const next = draft.trim();
|
|
19294
|
-
if (next
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
onCommit(next);
|
|
19298
|
-
};
|
|
19299
|
-
return /* @__PURE__ */ jsxs11(
|
|
19300
|
-
"div",
|
|
19301
|
-
{
|
|
19302
|
-
style: {
|
|
19303
|
-
display: "flex",
|
|
19304
|
-
alignItems: "center",
|
|
19305
|
-
gap: 6,
|
|
19306
|
-
height: 28,
|
|
19307
|
-
padding: "0 12px",
|
|
19308
|
-
borderRadius: 999,
|
|
19309
|
-
background: "#ffffff",
|
|
19310
|
-
width: "100%",
|
|
19311
|
-
maxWidth: 260,
|
|
19312
|
-
boxSizing: "border-box",
|
|
19313
|
-
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19314
|
-
},
|
|
19315
|
-
children: [
|
|
19316
|
-
/* @__PURE__ */ jsx20(
|
|
19317
|
-
"span",
|
|
19318
|
-
{
|
|
19319
|
-
style: {
|
|
19320
|
-
flex: "0 0 auto",
|
|
19321
|
-
color: OHW_BLUE_DARK,
|
|
19322
|
-
fontSize: 10,
|
|
19323
|
-
fontWeight: 700,
|
|
19324
|
-
textTransform: "uppercase",
|
|
19325
|
-
letterSpacing: 0.4
|
|
19326
|
-
},
|
|
19327
|
-
children: "Link"
|
|
19328
|
-
}
|
|
19329
|
-
),
|
|
19330
|
-
/* @__PURE__ */ jsx20(
|
|
19331
|
-
"input",
|
|
19332
|
-
{
|
|
19333
|
-
type: "text",
|
|
19334
|
-
inputMode: "url",
|
|
19335
|
-
value: draft,
|
|
19336
|
-
onChange: (e) => setDraft(e.target.value),
|
|
19337
|
-
onBlur: commit2,
|
|
19338
|
-
onKeyDown: (e) => {
|
|
19339
|
-
if (e.key === "Enter") e.currentTarget.blur();
|
|
19340
|
-
if (e.key === "Escape") {
|
|
19341
|
-
setDraft(value);
|
|
19342
|
-
setInvalid(false);
|
|
19343
|
-
e.currentTarget.blur();
|
|
19344
|
-
}
|
|
19345
|
-
},
|
|
19346
|
-
placeholder: "https://example.com",
|
|
19347
|
-
"aria-label": "Image link URL",
|
|
19348
|
-
"aria-invalid": invalid,
|
|
19349
|
-
style: {
|
|
19350
|
-
flex: 1,
|
|
19351
|
-
minWidth: 0,
|
|
19352
|
-
border: "none",
|
|
19353
|
-
outline: "none",
|
|
19354
|
-
background: "transparent",
|
|
19355
|
-
fontSize: 12,
|
|
19356
|
-
lineHeight: "16px",
|
|
19357
|
-
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19358
|
-
color: "#1f2937"
|
|
19359
|
-
}
|
|
19360
|
-
}
|
|
19361
|
-
)
|
|
19362
|
-
]
|
|
19624
|
+
if (next && !HTTP_URL_RE.test(next)) {
|
|
19625
|
+
setInvalid(true);
|
|
19626
|
+
return;
|
|
19363
19627
|
}
|
|
19364
|
-
|
|
19628
|
+
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
19629
|
+
onClose();
|
|
19630
|
+
};
|
|
19631
|
+
return /* @__PURE__ */ jsx21(Dialog2, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs12(DialogContent, { "data-ohw-link-modal-root": "", className: "max-w-[400px] gap-4 p-5", children: [
|
|
19632
|
+
/* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { className: "text-base", children: "Image link" }) }),
|
|
19633
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-3", children: [
|
|
19634
|
+
/* @__PURE__ */ jsx21(
|
|
19635
|
+
"input",
|
|
19636
|
+
{
|
|
19637
|
+
autoFocus: true,
|
|
19638
|
+
type: "text",
|
|
19639
|
+
inputMode: "url",
|
|
19640
|
+
value: draft,
|
|
19641
|
+
onChange: (e) => {
|
|
19642
|
+
setDraft(e.target.value);
|
|
19643
|
+
setInvalid(false);
|
|
19644
|
+
},
|
|
19645
|
+
onKeyDown: (e) => {
|
|
19646
|
+
if (e.key === "Enter") save();
|
|
19647
|
+
},
|
|
19648
|
+
placeholder: "https://example.com",
|
|
19649
|
+
"aria-label": "Image link URL",
|
|
19650
|
+
"aria-invalid": invalid,
|
|
19651
|
+
className: cn(
|
|
19652
|
+
"h-9 w-full rounded-[6px] border border-border bg-background px-3 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-bridge-primary",
|
|
19653
|
+
invalid && "border-destructive focus:border-destructive"
|
|
19654
|
+
)
|
|
19655
|
+
}
|
|
19656
|
+
),
|
|
19657
|
+
invalid && /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: "Enter a full URL starting with http:// or https://" }),
|
|
19658
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-2 text-[13px] text-foreground", children: [
|
|
19659
|
+
/* @__PURE__ */ jsx21("input", { type: "checkbox", checked: newTab, onChange: (e) => setNewTab(e.target.checked) }),
|
|
19660
|
+
"Open in new tab"
|
|
19661
|
+
] })
|
|
19662
|
+
] }),
|
|
19663
|
+
/* @__PURE__ */ jsxs12(DialogFooter, { children: [
|
|
19664
|
+
href && /* @__PURE__ */ jsx21(
|
|
19665
|
+
"button",
|
|
19666
|
+
{
|
|
19667
|
+
type: "button",
|
|
19668
|
+
onClick: () => {
|
|
19669
|
+
onSave("", "new-tab");
|
|
19670
|
+
onClose();
|
|
19671
|
+
},
|
|
19672
|
+
className: "mr-auto rounded-[6px] px-3 py-2 text-[13px] font-medium text-destructive transition-colors hover:bg-muted",
|
|
19673
|
+
children: "Remove link"
|
|
19674
|
+
}
|
|
19675
|
+
),
|
|
19676
|
+
/* @__PURE__ */ jsx21(
|
|
19677
|
+
"button",
|
|
19678
|
+
{
|
|
19679
|
+
type: "button",
|
|
19680
|
+
onClick: onClose,
|
|
19681
|
+
className: "rounded-[6px] px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted",
|
|
19682
|
+
children: "Cancel"
|
|
19683
|
+
}
|
|
19684
|
+
),
|
|
19685
|
+
/* @__PURE__ */ jsx21(
|
|
19686
|
+
"button",
|
|
19687
|
+
{
|
|
19688
|
+
type: "button",
|
|
19689
|
+
onClick: save,
|
|
19690
|
+
className: "rounded-[6px] bg-bridge-primary px-3 py-2 text-[13px] font-medium text-primary-foreground transition-opacity hover:opacity-90",
|
|
19691
|
+
children: "Save"
|
|
19692
|
+
}
|
|
19693
|
+
)
|
|
19694
|
+
] })
|
|
19695
|
+
] }) });
|
|
19365
19696
|
}
|
|
19366
19697
|
function MediaStripToolbar({
|
|
19367
19698
|
entry,
|
|
19368
19699
|
index,
|
|
19369
19700
|
pending,
|
|
19370
19701
|
error,
|
|
19702
|
+
itemEditOn,
|
|
19703
|
+
onToggleItemEdit,
|
|
19371
19704
|
onSetVariant,
|
|
19372
19705
|
onSetAlign,
|
|
19373
19706
|
onSetHover,
|
|
19374
19707
|
onSetTreatment,
|
|
19375
19708
|
onResize,
|
|
19376
|
-
|
|
19377
|
-
onSetLink,
|
|
19709
|
+
onOpenLink,
|
|
19378
19710
|
onAddItem,
|
|
19379
19711
|
onRemoveItem,
|
|
19380
19712
|
onChangeImage,
|
|
@@ -19383,81 +19715,102 @@ function MediaStripToolbar({
|
|
|
19383
19715
|
}) {
|
|
19384
19716
|
const items = mediaStripItems(entry.tree);
|
|
19385
19717
|
const itemCount = items.length;
|
|
19386
|
-
const currentAlt = items[index]?.alt ?? "";
|
|
19387
|
-
const currentHref2 = items[index]?.href ?? "";
|
|
19388
|
-
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19389
19718
|
const slots = findMediaStripSlots(entry.tree);
|
|
19390
19719
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19391
19720
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
19392
19721
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
19393
19722
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
19394
19723
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19395
|
-
const
|
|
19396
|
-
const
|
|
19397
|
-
|
|
19398
|
-
gap: 6,
|
|
19399
|
-
flexWrap: "nowrap",
|
|
19400
|
-
justifyContent: "center",
|
|
19401
|
-
overflowX: "auto",
|
|
19402
|
-
WebkitOverflowScrolling: "touch",
|
|
19403
|
-
width: "100%",
|
|
19404
|
-
scrollbarWidth: "none"
|
|
19405
|
-
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19406
|
-
return /* @__PURE__ */ jsxs11(
|
|
19724
|
+
const mobile = window.innerWidth <= 480;
|
|
19725
|
+
const gatedLabel = (label) => itemEditOn ? label : "Turn on the star to edit this image";
|
|
19726
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
|
|
19407
19727
|
"div",
|
|
19408
19728
|
{
|
|
19409
19729
|
"data-ohw-bridge": "",
|
|
19410
19730
|
"data-ohw-toolbar": "",
|
|
19411
19731
|
onMouseDown: (e) => e.stopPropagation(),
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
flexDirection: "column",
|
|
19415
|
-
gap: 6,
|
|
19416
|
-
alignItems: "center",
|
|
19417
|
-
background: OHW_BLUE,
|
|
19418
|
-
padding: 8,
|
|
19419
|
-
borderRadius: 12,
|
|
19420
|
-
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19421
|
-
pointerEvents: pending ? "none" : "auto",
|
|
19422
|
-
opacity: pending ? 0.6 : 1,
|
|
19423
|
-
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19424
|
-
},
|
|
19732
|
+
className: cn("flex flex-col items-center gap-1.5 font-sans", pending && "pointer-events-none opacity-60"),
|
|
19733
|
+
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
19425
19734
|
children: [
|
|
19426
|
-
/* @__PURE__ */
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19735
|
+
/* @__PURE__ */ jsxs12(
|
|
19736
|
+
"div",
|
|
19737
|
+
{
|
|
19738
|
+
className: cn(
|
|
19739
|
+
"flex items-center gap-1 rounded-[10px] border border-border bg-background p-1 whitespace-nowrap",
|
|
19740
|
+
"shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.1),0px_4px_6px_-4px_rgba(0,0,0,0.1)]",
|
|
19741
|
+
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
19742
|
+
),
|
|
19743
|
+
children: [
|
|
19744
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19745
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
19746
|
+
CustomToolbarButton,
|
|
19747
|
+
{
|
|
19748
|
+
type: "button",
|
|
19749
|
+
"aria-label": itemEditOn ? "Done editing this image" : "Edit this image",
|
|
19750
|
+
"aria-pressed": itemEditOn,
|
|
19751
|
+
onClick: onToggleItemEdit,
|
|
19752
|
+
className: "group size-8",
|
|
19753
|
+
children: /* @__PURE__ */ jsx21(
|
|
19754
|
+
Star,
|
|
19755
|
+
{
|
|
19756
|
+
size: 16,
|
|
19757
|
+
fill: "currentColor",
|
|
19758
|
+
strokeWidth: 0,
|
|
19759
|
+
className: cn(
|
|
19760
|
+
"transition-colors",
|
|
19761
|
+
itemEditOn ? "text-[#f59e0b] group-hover:text-[#d97706]" : "text-[#d6d3d1] group-hover:text-[#fbbf24]"
|
|
19762
|
+
),
|
|
19763
|
+
style: { pointerEvents: "none" }
|
|
19764
|
+
}
|
|
19765
|
+
)
|
|
19766
|
+
}
|
|
19767
|
+
) }),
|
|
19768
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
19769
|
+
] }),
|
|
19770
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19771
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19772
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19773
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19774
|
+
/* @__PURE__ */ jsx21(
|
|
19775
|
+
ToolbarAction,
|
|
19776
|
+
{
|
|
19777
|
+
label: gatedLabel("Move right"),
|
|
19778
|
+
onClick: onMoveRight,
|
|
19779
|
+
disabled: !itemEditOn || index >= itemCount - 1,
|
|
19780
|
+
children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
|
|
19781
|
+
}
|
|
19782
|
+
),
|
|
19783
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19784
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19785
|
+
/* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
19786
|
+
/* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
19787
|
+
/* @__PURE__ */ jsx21(
|
|
19788
|
+
ToolbarAction,
|
|
19789
|
+
{
|
|
19790
|
+
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
19791
|
+
active: treatment === "grayscale",
|
|
19792
|
+
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
19793
|
+
children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
19794
|
+
}
|
|
19795
|
+
),
|
|
19796
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19797
|
+
ALIGNS.map(({ value, label, Icon }) => /* @__PURE__ */ jsx21(ToolbarAction, { label, active: align === value, onClick: () => onSetAlign(value), children: /* @__PURE__ */ jsx21(Icon, { size: 16, style: { pointerEvents: "none" } }) }, value)),
|
|
19798
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19799
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19800
|
+
/* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
19801
|
+
sizeValue,
|
|
19802
|
+
"px"
|
|
19803
|
+
] }),
|
|
19804
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19805
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19806
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
19807
|
+
]
|
|
19808
|
+
}
|
|
19809
|
+
),
|
|
19810
|
+
error && /* @__PURE__ */ jsx21("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
|
|
19458
19811
|
]
|
|
19459
19812
|
}
|
|
19460
|
-
);
|
|
19813
|
+
) });
|
|
19461
19814
|
}
|
|
19462
19815
|
function findMediaStripSlots(tree) {
|
|
19463
19816
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -19476,31 +19829,23 @@ function AiMediaStripOverlay({
|
|
|
19476
19829
|
}) {
|
|
19477
19830
|
const [hover, setHover] = useState8(null);
|
|
19478
19831
|
const [active, setActive] = useState8(null);
|
|
19832
|
+
const [itemEditOn, setItemEditOn] = useState8(false);
|
|
19833
|
+
const [linkOpen, setLinkOpen] = useState8(false);
|
|
19479
19834
|
const [pending, setPending] = useState8(false);
|
|
19480
19835
|
const [error, setError] = useState8(null);
|
|
19481
19836
|
const activeRef = useRef5(null);
|
|
19482
19837
|
activeRef.current = active;
|
|
19838
|
+
const linkOpenRef = useRef5(false);
|
|
19839
|
+
linkOpenRef.current = linkOpen;
|
|
19483
19840
|
useEffect9(() => {
|
|
19484
19841
|
const onMove = (e) => {
|
|
19842
|
+
const ref = itemRefFromTarget(e.target);
|
|
19485
19843
|
const t = e.target;
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
if (!itemEl) {
|
|
19492
|
-
setHover(null);
|
|
19493
|
-
return;
|
|
19494
|
-
}
|
|
19495
|
-
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19496
|
-
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19497
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19498
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19499
|
-
if (!sectionId || Number.isNaN(index)) {
|
|
19500
|
-
setHover(null);
|
|
19501
|
-
return;
|
|
19502
|
-
}
|
|
19503
|
-
setHover({ sectionId, index });
|
|
19844
|
+
const overEditable = Boolean(t?.closest?.("[data-ohw-editable]"));
|
|
19845
|
+
setHover((prev) => {
|
|
19846
|
+
const next = ref && !overEditable ? ref : null;
|
|
19847
|
+
return sameRef(prev, next) ? prev : next;
|
|
19848
|
+
});
|
|
19504
19849
|
};
|
|
19505
19850
|
const onLeave = () => setHover(null);
|
|
19506
19851
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -19512,23 +19857,25 @@ function AiMediaStripOverlay({
|
|
|
19512
19857
|
}, []);
|
|
19513
19858
|
useEffect9(() => {
|
|
19514
19859
|
const onClick = (e) => {
|
|
19515
|
-
const current = activeRef.current;
|
|
19516
|
-
if (!current) return;
|
|
19517
19860
|
const t = e.target;
|
|
19518
|
-
if (!(t instanceof
|
|
19519
|
-
if (t.closest(
|
|
19520
|
-
const
|
|
19521
|
-
if (
|
|
19522
|
-
|
|
19861
|
+
if (!(t instanceof Element)) return;
|
|
19862
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
19863
|
+
const ref = itemRefFromTarget(t);
|
|
19864
|
+
if (sameRef(activeRef.current, ref)) return;
|
|
19865
|
+
if (ref) clearInteractionChromeRef.current();
|
|
19866
|
+
setItemEditOn(false);
|
|
19523
19867
|
setError(null);
|
|
19868
|
+
setActive(ref);
|
|
19524
19869
|
};
|
|
19525
19870
|
document.addEventListener("click", onClick, true);
|
|
19526
19871
|
return () => document.removeEventListener("click", onClick, true);
|
|
19527
|
-
}, []);
|
|
19872
|
+
}, [clearInteractionChromeRef]);
|
|
19528
19873
|
useEffect9(() => {
|
|
19529
19874
|
const onBlur = () => {
|
|
19530
19875
|
if (!activeRef.current) return;
|
|
19531
19876
|
setActive(null);
|
|
19877
|
+
setItemEditOn(false);
|
|
19878
|
+
setLinkOpen(false);
|
|
19532
19879
|
setError(null);
|
|
19533
19880
|
};
|
|
19534
19881
|
window.addEventListener("blur", onBlur);
|
|
@@ -19538,7 +19885,10 @@ function AiMediaStripOverlay({
|
|
|
19538
19885
|
const onKeyDown = (e) => {
|
|
19539
19886
|
if (e.key !== "Escape") return;
|
|
19540
19887
|
if (!activeRef.current) return;
|
|
19888
|
+
if (linkOpenRef.current) return;
|
|
19889
|
+
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
19541
19890
|
setActive(null);
|
|
19891
|
+
setItemEditOn(false);
|
|
19542
19892
|
setError(null);
|
|
19543
19893
|
};
|
|
19544
19894
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -19572,141 +19922,137 @@ function AiMediaStripOverlay({
|
|
|
19572
19922
|
tree: nextTree,
|
|
19573
19923
|
label: entry.label,
|
|
19574
19924
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
19575
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
19925
|
+
...entry.brand ? { brand: entry.brand } : {},
|
|
19926
|
+
// The user is already looking at the strip they just edited — recentering the viewport
|
|
19927
|
+
// on every edit reads as the section jumping around.
|
|
19928
|
+
skipScrollIntoView: true
|
|
19576
19929
|
});
|
|
19577
19930
|
return true;
|
|
19578
19931
|
},
|
|
19579
19932
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
19580
19933
|
);
|
|
19581
19934
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
19582
|
-
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
19583
19935
|
const activeItemRect = useLiveItemRect(active);
|
|
19584
|
-
const
|
|
19585
|
-
const
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
|
|
19619
|
-
ItemInteractionLayer,
|
|
19620
|
-
{
|
|
19621
|
-
rect: activeItemRect,
|
|
19622
|
-
state: toolbarState,
|
|
19623
|
-
toolbar: /* @__PURE__ */ jsx20(
|
|
19624
|
-
MediaStripToolbar,
|
|
19625
|
-
{
|
|
19626
|
-
entry: activeEntry,
|
|
19627
|
-
index: active.index,
|
|
19628
|
-
pending,
|
|
19629
|
-
error,
|
|
19630
|
-
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19631
|
-
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19632
|
-
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19633
|
-
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19634
|
-
onResize: (delta) => {
|
|
19635
|
-
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19636
|
-
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19637
|
-
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19638
|
-
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19639
|
-
},
|
|
19640
|
-
onSetAlt: (alt) => {
|
|
19641
|
-
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
19642
|
-
},
|
|
19643
|
-
onSetLink: (href, linkTarget) => {
|
|
19936
|
+
const activeStripRect = useLiveItemRect(active, true);
|
|
19937
|
+
const hoverRect = useLiveItemRect(hover && !sameRef(hover, active) ? hover : null);
|
|
19938
|
+
const activeItems = activeEntry ? mediaStripItems(activeEntry.tree) : [];
|
|
19939
|
+
const activeItem = active ? activeItems[active.index] : void 0;
|
|
19940
|
+
const activeHref = activeItem?.href ?? "";
|
|
19941
|
+
const activeTarget = activeItem?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19942
|
+
return /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
19943
|
+
hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
19944
|
+
activeItemRect && activeStripRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
19945
|
+
/* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeItemRect, state: "active-top" }),
|
|
19946
|
+
/* @__PURE__ */ jsx21(StripToolbarSlot, { stripRect: activeStripRect, children: /* @__PURE__ */ jsx21(
|
|
19947
|
+
MediaStripToolbar,
|
|
19948
|
+
{
|
|
19949
|
+
entry: activeEntry,
|
|
19950
|
+
index: active.index,
|
|
19951
|
+
pending,
|
|
19952
|
+
error,
|
|
19953
|
+
itemEditOn,
|
|
19954
|
+
onToggleItemEdit: () => setItemEditOn((on) => !on),
|
|
19955
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19956
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19957
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19958
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19959
|
+
onResize: (delta) => {
|
|
19960
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19961
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19962
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19963
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19964
|
+
},
|
|
19965
|
+
onOpenLink: () => setLinkOpen(true),
|
|
19966
|
+
onAddItem: () => {
|
|
19967
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19968
|
+
if (!picked) return;
|
|
19969
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19644
19970
|
void runMutation(
|
|
19645
19971
|
active.sectionId,
|
|
19646
|
-
(tree) =>
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
void requestAssetPick(postToParent2).then((picked) => {
|
|
19651
|
-
if (!picked) return;
|
|
19652
|
-
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19653
|
-
void runMutation(
|
|
19654
|
-
active.sectionId,
|
|
19655
|
-
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19656
|
-
{ [picked.assetId]: picked.url }
|
|
19657
|
-
).then((applied) => {
|
|
19658
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19659
|
-
});
|
|
19972
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19973
|
+
{ [picked.assetId]: picked.url }
|
|
19974
|
+
).then((applied) => {
|
|
19975
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19660
19976
|
});
|
|
19661
|
-
}
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
});
|
|
19671
|
-
},
|
|
19672
|
-
onRemoveItem: () => {
|
|
19673
|
-
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19674
|
-
(applied) => {
|
|
19675
|
-
if (applied) setActive(null);
|
|
19676
|
-
}
|
|
19677
|
-
);
|
|
19678
|
-
},
|
|
19679
|
-
onMoveLeft: () => {
|
|
19680
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
19681
|
-
(applied) => {
|
|
19682
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
19683
|
-
}
|
|
19684
|
-
);
|
|
19685
|
-
},
|
|
19686
|
-
onMoveRight: () => {
|
|
19687
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19688
|
-
(applied) => {
|
|
19689
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19690
|
-
}
|
|
19977
|
+
});
|
|
19978
|
+
},
|
|
19979
|
+
onChangeImage: () => {
|
|
19980
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19981
|
+
if (!picked) return;
|
|
19982
|
+
void runMutation(
|
|
19983
|
+
active.sectionId,
|
|
19984
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
19985
|
+
{ [picked.assetId]: picked.url }
|
|
19691
19986
|
);
|
|
19692
|
-
}
|
|
19987
|
+
});
|
|
19988
|
+
},
|
|
19989
|
+
onRemoveItem: () => {
|
|
19990
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19991
|
+
(applied) => {
|
|
19992
|
+
if (applied) setActive(null);
|
|
19993
|
+
}
|
|
19994
|
+
);
|
|
19995
|
+
},
|
|
19996
|
+
onMoveLeft: () => {
|
|
19997
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
19998
|
+
(applied) => {
|
|
19999
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
20000
|
+
}
|
|
20001
|
+
);
|
|
20002
|
+
},
|
|
20003
|
+
onMoveRight: () => {
|
|
20004
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
20005
|
+
(applied) => {
|
|
20006
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
20007
|
+
}
|
|
20008
|
+
);
|
|
19693
20009
|
}
|
|
19694
|
-
|
|
19695
|
-
}
|
|
19696
|
-
|
|
20010
|
+
}
|
|
20011
|
+
) }),
|
|
20012
|
+
/* @__PURE__ */ jsx21(
|
|
20013
|
+
"div",
|
|
20014
|
+
{
|
|
20015
|
+
"data-ohw-bridge": "",
|
|
20016
|
+
"data-ohw-item-interaction": "",
|
|
20017
|
+
"aria-hidden": true,
|
|
20018
|
+
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
20019
|
+
style: {
|
|
20020
|
+
top: activeItemRect.top + activeItemRect.height + 10,
|
|
20021
|
+
left: activeItemRect.left - 5,
|
|
20022
|
+
background: PRIMARY3,
|
|
20023
|
+
zIndex: 2147483644
|
|
20024
|
+
},
|
|
20025
|
+
children: "Media item"
|
|
20026
|
+
}
|
|
20027
|
+
),
|
|
20028
|
+
linkOpen && /* @__PURE__ */ jsx21(
|
|
20029
|
+
LinkModal,
|
|
20030
|
+
{
|
|
20031
|
+
href: activeHref,
|
|
20032
|
+
linkTarget: activeTarget,
|
|
20033
|
+
onClose: () => setLinkOpen(false),
|
|
20034
|
+
onSave: (href, linkTarget) => {
|
|
20035
|
+
void runMutation(
|
|
20036
|
+
active.sectionId,
|
|
20037
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
20038
|
+
);
|
|
20039
|
+
}
|
|
20040
|
+
}
|
|
20041
|
+
)
|
|
20042
|
+
] })
|
|
19697
20043
|
] });
|
|
19698
20044
|
}
|
|
19699
20045
|
|
|
19700
20046
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
19701
|
-
import { useCallback as useCallback4, useEffect as useEffect10, useLayoutEffect as
|
|
19702
|
-
import { Check as
|
|
19703
|
-
import { Fragment as Fragment8, jsx as
|
|
20047
|
+
import { useCallback as useCallback4, useEffect as useEffect10, useLayoutEffect as useLayoutEffect5, useRef as useRef6, useState as useState9 } from "react";
|
|
20048
|
+
import { Check as Check3, ChevronDown as ChevronDown4, Minus as Minus2, Plus as Plus3, Star as Star2 } from "lucide-react";
|
|
20049
|
+
import { Fragment as Fragment8, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
19704
20050
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
19705
|
-
var
|
|
20051
|
+
var CHROME_SELECTOR2 = "[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]";
|
|
19706
20052
|
function findPricingCardElement(sectionId, index) {
|
|
19707
|
-
const
|
|
19708
|
-
if (!
|
|
19709
|
-
const cards =
|
|
20053
|
+
const sectionEl2 = findByInstanceId(sectionId);
|
|
20054
|
+
if (!sectionEl2) return null;
|
|
20055
|
+
const cards = sectionEl2.querySelectorAll("[data-ohw-pricing-card]");
|
|
19710
20056
|
for (const el of Array.from(cards)) {
|
|
19711
20057
|
if (Number(el.dataset.ohwPricingIndex) === index) return el;
|
|
19712
20058
|
}
|
|
@@ -19714,31 +20060,31 @@ function findPricingCardElement(sectionId, index) {
|
|
|
19714
20060
|
}
|
|
19715
20061
|
function cardRefFromTarget(target) {
|
|
19716
20062
|
if (!(target instanceof Element)) return null;
|
|
19717
|
-
if (target.closest(
|
|
20063
|
+
if (target.closest(CHROME_SELECTOR2)) return null;
|
|
19718
20064
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
19719
20065
|
if (!cardEl) return null;
|
|
19720
|
-
const
|
|
19721
|
-
const unit =
|
|
20066
|
+
const sectionEl2 = cardEl.closest("[data-ohw-section]");
|
|
20067
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
19722
20068
|
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19723
20069
|
const index = Number(cardEl.dataset.ohwPricingIndex);
|
|
19724
20070
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
19725
20071
|
return { sectionId, index };
|
|
19726
20072
|
}
|
|
19727
|
-
function
|
|
20073
|
+
function sameRef2(a, b) {
|
|
19728
20074
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19729
20075
|
}
|
|
19730
|
-
function
|
|
20076
|
+
function rectOf2(el) {
|
|
19731
20077
|
if (!el) return null;
|
|
19732
20078
|
const r2 = el.getBoundingClientRect();
|
|
19733
20079
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19734
20080
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19735
20081
|
}
|
|
19736
20082
|
function readRect3(ref) {
|
|
19737
|
-
return
|
|
20083
|
+
return rectOf2(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
19738
20084
|
}
|
|
19739
20085
|
function readGridRect(ref) {
|
|
19740
20086
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
19741
|
-
return
|
|
20087
|
+
return rectOf2(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
19742
20088
|
}
|
|
19743
20089
|
function useLiveCardRect(ref, grid = false) {
|
|
19744
20090
|
const [rect, setRect] = useState9(null);
|
|
@@ -19768,19 +20114,19 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
19768
20114
|
}
|
|
19769
20115
|
var TOOLBAR_GRID_GAP = 52;
|
|
19770
20116
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
19771
|
-
var
|
|
20117
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
19772
20118
|
function GridToolbarSlot({ gridRect, children }) {
|
|
19773
20119
|
const slotRef = useRef6(null);
|
|
19774
20120
|
const [shift, setShift] = useState9(0);
|
|
19775
20121
|
const centerX = gridRect.left + gridRect.width / 2;
|
|
19776
|
-
|
|
20122
|
+
useLayoutEffect5(() => {
|
|
19777
20123
|
const slot = slotRef.current;
|
|
19778
20124
|
if (!slot) return;
|
|
19779
20125
|
const clamp = () => {
|
|
19780
20126
|
const w = slot.offsetWidth;
|
|
19781
20127
|
if (w <= 0) return;
|
|
19782
20128
|
const half = w / 2;
|
|
19783
|
-
const clamped = Math.max(
|
|
20129
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN3 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half));
|
|
19784
20130
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19785
20131
|
};
|
|
19786
20132
|
clamp();
|
|
@@ -19789,7 +20135,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
19789
20135
|
return () => ro.disconnect();
|
|
19790
20136
|
}, [centerX, children]);
|
|
19791
20137
|
const mobile = window.innerWidth <= 480;
|
|
19792
|
-
return /* @__PURE__ */
|
|
20138
|
+
return /* @__PURE__ */ jsx22(
|
|
19793
20139
|
"div",
|
|
19794
20140
|
{
|
|
19795
20141
|
ref: slotRef,
|
|
@@ -19824,7 +20170,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
19824
20170
|
});
|
|
19825
20171
|
}
|
|
19826
20172
|
function StyleSwatch({ style }) {
|
|
19827
|
-
return /* @__PURE__ */
|
|
20173
|
+
return /* @__PURE__ */ jsx22(
|
|
19828
20174
|
"span",
|
|
19829
20175
|
{
|
|
19830
20176
|
"aria-hidden": true,
|
|
@@ -19838,35 +20184,35 @@ function StyleSwatch({ style }) {
|
|
|
19838
20184
|
);
|
|
19839
20185
|
}
|
|
19840
20186
|
function ButtonGlyph() {
|
|
19841
|
-
return /* @__PURE__ */
|
|
19842
|
-
/* @__PURE__ */
|
|
19843
|
-
/* @__PURE__ */
|
|
20187
|
+
return /* @__PURE__ */ jsxs13("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
20188
|
+
/* @__PURE__ */ jsx22("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
20189
|
+
/* @__PURE__ */ jsx22("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
19844
20190
|
] });
|
|
19845
20191
|
}
|
|
19846
20192
|
function FeatureGlyph({ mode }) {
|
|
19847
|
-
return /* @__PURE__ */
|
|
19848
|
-
/* @__PURE__ */
|
|
19849
|
-
/* @__PURE__ */
|
|
19850
|
-
/* @__PURE__ */
|
|
19851
|
-
/* @__PURE__ */
|
|
19852
|
-
/* @__PURE__ */
|
|
19853
|
-
mode === "add" && /* @__PURE__ */
|
|
20193
|
+
return /* @__PURE__ */ jsxs13("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
20194
|
+
/* @__PURE__ */ jsx22("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
20195
|
+
/* @__PURE__ */ jsx22("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
20196
|
+
/* @__PURE__ */ jsx22("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
|
|
20197
|
+
/* @__PURE__ */ jsx22("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
|
|
20198
|
+
/* @__PURE__ */ jsx22("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
20199
|
+
mode === "add" && /* @__PURE__ */ jsx22("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
19854
20200
|
] });
|
|
19855
20201
|
}
|
|
19856
|
-
function
|
|
20202
|
+
function ToolbarAction2({
|
|
19857
20203
|
label,
|
|
19858
20204
|
onClick,
|
|
19859
20205
|
disabled = false,
|
|
19860
20206
|
children
|
|
19861
20207
|
}) {
|
|
19862
|
-
const button = /* @__PURE__ */
|
|
19863
|
-
return /* @__PURE__ */
|
|
19864
|
-
/* @__PURE__ */
|
|
19865
|
-
/* @__PURE__ */
|
|
20208
|
+
const button = /* @__PURE__ */ jsx22(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
20209
|
+
return /* @__PURE__ */ jsxs13(Tooltip, { children: [
|
|
20210
|
+
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx22("span", { className: "inline-flex", children: button }) : button }),
|
|
20211
|
+
/* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
19866
20212
|
] });
|
|
19867
20213
|
}
|
|
19868
|
-
function
|
|
19869
|
-
return /* @__PURE__ */
|
|
20214
|
+
function ToolbarSeparator2() {
|
|
20215
|
+
return /* @__PURE__ */ jsx22("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
19870
20216
|
}
|
|
19871
20217
|
function CardStyleMenu({
|
|
19872
20218
|
value,
|
|
@@ -19874,7 +20220,7 @@ function CardStyleMenu({
|
|
|
19874
20220
|
disabled = false
|
|
19875
20221
|
}) {
|
|
19876
20222
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
19877
|
-
const trigger = /* @__PURE__ */
|
|
20223
|
+
const trigger = /* @__PURE__ */ jsxs13(
|
|
19878
20224
|
"button",
|
|
19879
20225
|
{
|
|
19880
20226
|
type: "button",
|
|
@@ -19885,28 +20231,28 @@ function CardStyleMenu({
|
|
|
19885
20231
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
19886
20232
|
),
|
|
19887
20233
|
children: [
|
|
19888
|
-
/* @__PURE__ */
|
|
19889
|
-
/* @__PURE__ */
|
|
19890
|
-
/* @__PURE__ */
|
|
20234
|
+
/* @__PURE__ */ jsx22(StyleSwatch, { style: current.value }),
|
|
20235
|
+
/* @__PURE__ */ jsx22("span", { className: "flex-1 text-left", children: current.label }),
|
|
20236
|
+
/* @__PURE__ */ jsx22(ChevronDown4, { size: 16, style: { pointerEvents: "none" } })
|
|
19891
20237
|
]
|
|
19892
20238
|
}
|
|
19893
20239
|
);
|
|
19894
20240
|
if (disabled) {
|
|
19895
|
-
return /* @__PURE__ */
|
|
19896
|
-
/* @__PURE__ */
|
|
19897
|
-
/* @__PURE__ */
|
|
19898
|
-
/* @__PURE__ */
|
|
19899
|
-
/* @__PURE__ */
|
|
20241
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20242
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
20243
|
+
/* @__PURE__ */ jsxs13(Tooltip, { children: [
|
|
20244
|
+
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22("span", { className: "inline-flex", children: trigger }) }),
|
|
20245
|
+
/* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
19900
20246
|
] })
|
|
19901
20247
|
] });
|
|
19902
20248
|
}
|
|
19903
|
-
return /* @__PURE__ */
|
|
19904
|
-
/* @__PURE__ */
|
|
19905
|
-
/* @__PURE__ */
|
|
19906
|
-
/* @__PURE__ */
|
|
19907
|
-
/* @__PURE__ */
|
|
20249
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
20250
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
20251
|
+
/* @__PURE__ */ jsxs13(DropdownMenu, { modal: false, children: [
|
|
20252
|
+
/* @__PURE__ */ jsx22(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
20253
|
+
/* @__PURE__ */ jsx22(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
|
|
19908
20254
|
const selected = style.value === value;
|
|
19909
|
-
return /* @__PURE__ */
|
|
20255
|
+
return /* @__PURE__ */ jsxs13(
|
|
19910
20256
|
DropdownMenuItem,
|
|
19911
20257
|
{
|
|
19912
20258
|
role: "menuitemradio",
|
|
@@ -19914,9 +20260,9 @@ function CardStyleMenu({
|
|
|
19914
20260
|
onSelect: () => onChange(style.value),
|
|
19915
20261
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
19916
20262
|
children: [
|
|
19917
|
-
/* @__PURE__ */
|
|
19918
|
-
/* @__PURE__ */
|
|
19919
|
-
selected && /* @__PURE__ */
|
|
20263
|
+
/* @__PURE__ */ jsx22(StyleSwatch, { style: style.value }),
|
|
20264
|
+
/* @__PURE__ */ jsx22("span", { children: style.label }),
|
|
20265
|
+
selected && /* @__PURE__ */ jsx22(Check3, { size: 16, className: "text-bridge-primary" })
|
|
19920
20266
|
]
|
|
19921
20267
|
},
|
|
19922
20268
|
style.value
|
|
@@ -19946,7 +20292,7 @@ function PricingCardToolbar({
|
|
|
19946
20292
|
const style = pricingCardStyle(entry.tree, index);
|
|
19947
20293
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
19948
20294
|
const mobile = window.innerWidth <= 480;
|
|
19949
|
-
return /* @__PURE__ */
|
|
20295
|
+
return /* @__PURE__ */ jsx22(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs13(
|
|
19950
20296
|
"div",
|
|
19951
20297
|
{
|
|
19952
20298
|
"data-ohw-bridge": "",
|
|
@@ -19958,7 +20304,7 @@ function PricingCardToolbar({
|
|
|
19958
20304
|
),
|
|
19959
20305
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
19960
20306
|
children: [
|
|
19961
|
-
/* @__PURE__ */
|
|
20307
|
+
/* @__PURE__ */ jsxs13(
|
|
19962
20308
|
"div",
|
|
19963
20309
|
{
|
|
19964
20310
|
className: cn(
|
|
@@ -19967,8 +20313,8 @@ function PricingCardToolbar({
|
|
|
19967
20313
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
19968
20314
|
),
|
|
19969
20315
|
children: [
|
|
19970
|
-
/* @__PURE__ */
|
|
19971
|
-
/* @__PURE__ */
|
|
20316
|
+
/* @__PURE__ */ jsxs13(Tooltip, { children: [
|
|
20317
|
+
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
|
|
19972
20318
|
CustomToolbarButton,
|
|
19973
20319
|
{
|
|
19974
20320
|
type: "button",
|
|
@@ -19976,7 +20322,7 @@ function PricingCardToolbar({
|
|
|
19976
20322
|
"aria-pressed": featuredTag,
|
|
19977
20323
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
19978
20324
|
className: "group size-8",
|
|
19979
|
-
children: /* @__PURE__ */
|
|
20325
|
+
children: /* @__PURE__ */ jsx22(
|
|
19980
20326
|
Star2,
|
|
19981
20327
|
{
|
|
19982
20328
|
size: 16,
|
|
@@ -19991,25 +20337,25 @@ function PricingCardToolbar({
|
|
|
19991
20337
|
)
|
|
19992
20338
|
}
|
|
19993
20339
|
) }),
|
|
19994
|
-
/* @__PURE__ */
|
|
20340
|
+
/* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
19995
20341
|
] }),
|
|
19996
|
-
/* @__PURE__ */
|
|
19997
|
-
/* @__PURE__ */
|
|
19998
|
-
/* @__PURE__ */
|
|
19999
|
-
/* @__PURE__ */
|
|
20000
|
-
/* @__PURE__ */
|
|
20001
|
-
/* @__PURE__ */
|
|
20002
|
-
/* @__PURE__ */
|
|
20342
|
+
/* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
|
|
20343
|
+
/* @__PURE__ */ jsx22(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
20344
|
+
/* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
|
|
20345
|
+
/* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx22(ButtonGlyph, {}) }),
|
|
20346
|
+
/* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs13("span", { className: "relative inline-flex", children: [
|
|
20347
|
+
/* @__PURE__ */ jsx22(ButtonGlyph, {}),
|
|
20348
|
+
/* @__PURE__ */ jsx22(Minus2, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
|
|
20003
20349
|
] }) }),
|
|
20004
|
-
/* @__PURE__ */
|
|
20005
|
-
/* @__PURE__ */
|
|
20006
|
-
/* @__PURE__ */
|
|
20007
|
-
/* @__PURE__ */
|
|
20008
|
-
/* @__PURE__ */
|
|
20350
|
+
/* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx22(FeatureGlyph, { mode: "add" }) }),
|
|
20351
|
+
/* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx22(FeatureGlyph, { mode: "remove" }) }),
|
|
20352
|
+
/* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
|
|
20353
|
+
/* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx22(Plus3, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
20354
|
+
/* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx22(Minus2, { size: 16, style: { pointerEvents: "none" } }) })
|
|
20009
20355
|
]
|
|
20010
20356
|
}
|
|
20011
20357
|
),
|
|
20012
|
-
error && /* @__PURE__ */
|
|
20358
|
+
error && /* @__PURE__ */ jsx22("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
|
|
20013
20359
|
]
|
|
20014
20360
|
}
|
|
20015
20361
|
) });
|
|
@@ -20043,7 +20389,7 @@ function AiPricingCardOverlay({
|
|
|
20043
20389
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20044
20390
|
setHover((prev) => {
|
|
20045
20391
|
const next = ref && !overEditable ? ref : null;
|
|
20046
|
-
return
|
|
20392
|
+
return sameRef2(prev, next) ? prev : next;
|
|
20047
20393
|
});
|
|
20048
20394
|
};
|
|
20049
20395
|
const onLeave = () => setHover(null);
|
|
@@ -20058,10 +20404,10 @@ function AiPricingCardOverlay({
|
|
|
20058
20404
|
const onClick = (e) => {
|
|
20059
20405
|
const t = e.target;
|
|
20060
20406
|
if (!(t instanceof Element)) return;
|
|
20061
|
-
if (t.closest(
|
|
20407
|
+
if (t.closest(CHROME_SELECTOR2)) return;
|
|
20062
20408
|
const ref = cardRefFromTarget(t);
|
|
20063
|
-
setActive((prev) =>
|
|
20064
|
-
if (!ref || !
|
|
20409
|
+
setActive((prev) => sameRef2(prev, ref) ? prev : ref);
|
|
20410
|
+
if (!ref || !sameRef2(activeRef.current, ref)) setError(null);
|
|
20065
20411
|
};
|
|
20066
20412
|
document.addEventListener("click", onClick, true);
|
|
20067
20413
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20126,12 +20472,12 @@ function AiPricingCardOverlay({
|
|
|
20126
20472
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20127
20473
|
const activeCardRect = useLiveCardRect(active);
|
|
20128
20474
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20129
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20130
|
-
return /* @__PURE__ */
|
|
20131
|
-
hoverRect && /* @__PURE__ */
|
|
20132
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */
|
|
20133
|
-
/* @__PURE__ */
|
|
20134
|
-
/* @__PURE__ */
|
|
20475
|
+
const hoverRect = useLiveCardRect(hover && !sameRef2(hover, active) ? hover : null);
|
|
20476
|
+
return /* @__PURE__ */ jsxs13(Fragment8, { children: [
|
|
20477
|
+
hoverRect && /* @__PURE__ */ jsx22(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
20478
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs13(Fragment8, { children: [
|
|
20479
|
+
/* @__PURE__ */ jsx22(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
20480
|
+
/* @__PURE__ */ jsx22(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx22(
|
|
20135
20481
|
PricingCardToolbar,
|
|
20136
20482
|
{
|
|
20137
20483
|
entry: activeEntry,
|
|
@@ -20159,7 +20505,7 @@ function AiPricingCardOverlay({
|
|
|
20159
20505
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20160
20506
|
}
|
|
20161
20507
|
) }),
|
|
20162
|
-
/* @__PURE__ */
|
|
20508
|
+
/* @__PURE__ */ jsx22(
|
|
20163
20509
|
"div",
|
|
20164
20510
|
{
|
|
20165
20511
|
"data-ohw-bridge": "",
|
|
@@ -20223,43 +20569,15 @@ function clearVideo(tree, path) {
|
|
|
20223
20569
|
});
|
|
20224
20570
|
}
|
|
20225
20571
|
|
|
20226
|
-
// src/lib/youtube.ts
|
|
20227
|
-
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
20228
|
-
function extractYouTubeId(input) {
|
|
20229
|
-
const trimmed = input.trim();
|
|
20230
|
-
if (!trimmed) return null;
|
|
20231
|
-
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
20232
|
-
let url;
|
|
20233
|
-
try {
|
|
20234
|
-
url = new URL(trimmed);
|
|
20235
|
-
} catch {
|
|
20236
|
-
return null;
|
|
20237
|
-
}
|
|
20238
|
-
const host = url.hostname.replace(/^www\./, "");
|
|
20239
|
-
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
20240
|
-
return null;
|
|
20241
|
-
}
|
|
20242
|
-
let candidate = null;
|
|
20243
|
-
if (host === "youtu.be") {
|
|
20244
|
-
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
20245
|
-
} else if (url.pathname === "/watch") {
|
|
20246
|
-
candidate = url.searchParams.get("v");
|
|
20247
|
-
} else {
|
|
20248
|
-
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
20249
|
-
candidate = match ? match[1] : null;
|
|
20250
|
-
}
|
|
20251
|
-
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
20252
|
-
}
|
|
20253
|
-
|
|
20254
20572
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20255
|
-
import { Fragment as Fragment9, jsx as
|
|
20573
|
+
import { Fragment as Fragment9, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
20256
20574
|
var PRIMARY5 = "#0885FE";
|
|
20257
|
-
var
|
|
20258
|
-
var
|
|
20575
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20576
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
20259
20577
|
function findVideoBlockElement(sectionId, path) {
|
|
20260
|
-
const
|
|
20261
|
-
if (!
|
|
20262
|
-
const items =
|
|
20578
|
+
const sectionEl2 = findByInstanceId(sectionId);
|
|
20579
|
+
if (!sectionEl2) return null;
|
|
20580
|
+
const items = sectionEl2.querySelectorAll("[data-ohw-video-block]");
|
|
20263
20581
|
for (const el of Array.from(items)) {
|
|
20264
20582
|
if (el.dataset.ohwVideoPath === path) return el;
|
|
20265
20583
|
}
|
|
@@ -20315,12 +20633,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
20315
20633
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
20316
20634
|
});
|
|
20317
20635
|
}
|
|
20318
|
-
function
|
|
20636
|
+
function Pill({
|
|
20319
20637
|
label,
|
|
20320
20638
|
onClick,
|
|
20321
20639
|
disabled
|
|
20322
20640
|
}) {
|
|
20323
|
-
return /* @__PURE__ */
|
|
20641
|
+
return /* @__PURE__ */ jsx23(
|
|
20324
20642
|
"button",
|
|
20325
20643
|
{
|
|
20326
20644
|
type: "button",
|
|
@@ -20336,7 +20654,7 @@ function Pill2({
|
|
|
20336
20654
|
border: "none",
|
|
20337
20655
|
cursor: disabled ? "default" : "pointer",
|
|
20338
20656
|
background: "#ffffff",
|
|
20339
|
-
color:
|
|
20657
|
+
color: OHW_BLUE_DARK,
|
|
20340
20658
|
opacity: disabled ? 0.4 : 1,
|
|
20341
20659
|
fontSize: 12,
|
|
20342
20660
|
lineHeight: "16px",
|
|
@@ -20379,8 +20697,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20379
20697
|
onCommit(id);
|
|
20380
20698
|
}
|
|
20381
20699
|
};
|
|
20382
|
-
return /* @__PURE__ */
|
|
20383
|
-
/* @__PURE__ */
|
|
20700
|
+
return /* @__PURE__ */ jsxs14("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20701
|
+
/* @__PURE__ */ jsxs14(
|
|
20384
20702
|
"div",
|
|
20385
20703
|
{
|
|
20386
20704
|
style: {
|
|
@@ -20396,12 +20714,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20396
20714
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20397
20715
|
},
|
|
20398
20716
|
children: [
|
|
20399
|
-
/* @__PURE__ */
|
|
20717
|
+
/* @__PURE__ */ jsx23(
|
|
20400
20718
|
"span",
|
|
20401
20719
|
{
|
|
20402
20720
|
style: {
|
|
20403
20721
|
flex: "0 0 auto",
|
|
20404
|
-
color:
|
|
20722
|
+
color: OHW_BLUE_DARK,
|
|
20405
20723
|
fontSize: 10,
|
|
20406
20724
|
lineHeight: "16px",
|
|
20407
20725
|
fontWeight: 700,
|
|
@@ -20411,7 +20729,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20411
20729
|
children: "Video"
|
|
20412
20730
|
}
|
|
20413
20731
|
),
|
|
20414
|
-
/* @__PURE__ */
|
|
20732
|
+
/* @__PURE__ */ jsx23(
|
|
20415
20733
|
"input",
|
|
20416
20734
|
{
|
|
20417
20735
|
type: "text",
|
|
@@ -20448,7 +20766,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20448
20766
|
]
|
|
20449
20767
|
}
|
|
20450
20768
|
),
|
|
20451
|
-
invalid && /* @__PURE__ */
|
|
20769
|
+
invalid && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
|
|
20452
20770
|
] });
|
|
20453
20771
|
}
|
|
20454
20772
|
function VideoToolbar({
|
|
@@ -20458,7 +20776,7 @@ function VideoToolbar({
|
|
|
20458
20776
|
onSetVideoId,
|
|
20459
20777
|
onRemove
|
|
20460
20778
|
}) {
|
|
20461
|
-
return /* @__PURE__ */
|
|
20779
|
+
return /* @__PURE__ */ jsxs14(
|
|
20462
20780
|
"div",
|
|
20463
20781
|
{
|
|
20464
20782
|
"data-ohw-bridge": "",
|
|
@@ -20470,7 +20788,7 @@ function VideoToolbar({
|
|
|
20470
20788
|
gap: 6,
|
|
20471
20789
|
alignItems: "center",
|
|
20472
20790
|
width: 280,
|
|
20473
|
-
background:
|
|
20791
|
+
background: OHW_BLUE,
|
|
20474
20792
|
padding: 8,
|
|
20475
20793
|
borderRadius: 12,
|
|
20476
20794
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20478,9 +20796,9 @@ function VideoToolbar({
|
|
|
20478
20796
|
opacity: pending ? 0.6 : 1
|
|
20479
20797
|
},
|
|
20480
20798
|
children: [
|
|
20481
|
-
/* @__PURE__ */
|
|
20482
|
-
/* @__PURE__ */
|
|
20483
|
-
error && /* @__PURE__ */
|
|
20799
|
+
/* @__PURE__ */ jsx23(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
20800
|
+
/* @__PURE__ */ jsx23(Pill, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
20801
|
+
error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20484
20802
|
]
|
|
20485
20803
|
}
|
|
20486
20804
|
);
|
|
@@ -20509,8 +20827,8 @@ function AiVideoOverlay({
|
|
|
20509
20827
|
setHover(null);
|
|
20510
20828
|
return;
|
|
20511
20829
|
}
|
|
20512
|
-
const
|
|
20513
|
-
const unit =
|
|
20830
|
+
const sectionEl2 = blockEl.closest("[data-ohw-section]");
|
|
20831
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
20514
20832
|
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
20515
20833
|
const path = blockEl.dataset.ohwVideoPath;
|
|
20516
20834
|
if (!sectionId || !path) {
|
|
@@ -20600,8 +20918,8 @@ function AiVideoOverlay({
|
|
|
20600
20918
|
const activeBlockRect = useLiveBlockRect(active);
|
|
20601
20919
|
const TOOLBAR_APPROX_H = 90;
|
|
20602
20920
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
20603
|
-
return /* @__PURE__ */
|
|
20604
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
20921
|
+
return /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
20922
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx23(
|
|
20605
20923
|
"button",
|
|
20606
20924
|
{
|
|
20607
20925
|
type: "button",
|
|
@@ -20629,15 +20947,15 @@ function AiVideoOverlay({
|
|
|
20629
20947
|
fontSize: 14,
|
|
20630
20948
|
fontWeight: 700
|
|
20631
20949
|
},
|
|
20632
|
-
children: /* @__PURE__ */
|
|
20950
|
+
children: /* @__PURE__ */ jsx23(Star3, { size: 14, style: { pointerEvents: "none" } })
|
|
20633
20951
|
}
|
|
20634
20952
|
),
|
|
20635
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */
|
|
20953
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx23(
|
|
20636
20954
|
ItemInteractionLayer,
|
|
20637
20955
|
{
|
|
20638
20956
|
rect: activeBlockRect,
|
|
20639
20957
|
state: toolbarState,
|
|
20640
|
-
toolbar: /* @__PURE__ */
|
|
20958
|
+
toolbar: /* @__PURE__ */ jsx23(
|
|
20641
20959
|
VideoToolbar,
|
|
20642
20960
|
{
|
|
20643
20961
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -20712,14 +21030,14 @@ function setCarouselAutoplay(tree, on) {
|
|
|
20712
21030
|
}
|
|
20713
21031
|
|
|
20714
21032
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
20715
|
-
import { Fragment as Fragment10, jsx as
|
|
21033
|
+
import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
20716
21034
|
var PRIMARY6 = "#0885FE";
|
|
20717
|
-
var
|
|
20718
|
-
var
|
|
21035
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
21036
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
20719
21037
|
function findCarouselItemElement(sectionId, index) {
|
|
20720
|
-
const
|
|
20721
|
-
if (!
|
|
20722
|
-
const items =
|
|
21038
|
+
const sectionEl2 = findByInstanceId(sectionId);
|
|
21039
|
+
if (!sectionEl2) return null;
|
|
21040
|
+
const items = sectionEl2.querySelectorAll("[data-ohw-fade-carousel-item]");
|
|
20723
21041
|
for (const el of Array.from(items)) {
|
|
20724
21042
|
if (Number(el.dataset.ohwFadeCarouselIndex) === index) return el;
|
|
20725
21043
|
}
|
|
@@ -20794,8 +21112,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
20794
21112
|
postToParent2({ type: "ow:asset-pick", id });
|
|
20795
21113
|
});
|
|
20796
21114
|
}
|
|
20797
|
-
function
|
|
20798
|
-
return /* @__PURE__ */
|
|
21115
|
+
function Pill2({ label, onClick, disabled }) {
|
|
21116
|
+
return /* @__PURE__ */ jsx24(
|
|
20799
21117
|
"button",
|
|
20800
21118
|
{
|
|
20801
21119
|
type: "button",
|
|
@@ -20811,7 +21129,7 @@ function Pill3({ label, onClick, disabled }) {
|
|
|
20811
21129
|
border: "none",
|
|
20812
21130
|
cursor: disabled ? "default" : "pointer",
|
|
20813
21131
|
background: "#ffffff",
|
|
20814
|
-
color:
|
|
21132
|
+
color: OHW_BLUE_DARK2,
|
|
20815
21133
|
opacity: disabled ? 0.4 : 1,
|
|
20816
21134
|
fontSize: 12,
|
|
20817
21135
|
lineHeight: "16px",
|
|
@@ -20829,7 +21147,7 @@ function TogglePill({
|
|
|
20829
21147
|
onToggle,
|
|
20830
21148
|
disabled
|
|
20831
21149
|
}) {
|
|
20832
|
-
return /* @__PURE__ */
|
|
21150
|
+
return /* @__PURE__ */ jsxs15(
|
|
20833
21151
|
"button",
|
|
20834
21152
|
{
|
|
20835
21153
|
type: "button",
|
|
@@ -20848,7 +21166,7 @@ function TogglePill({
|
|
|
20848
21166
|
border: "none",
|
|
20849
21167
|
cursor: disabled ? "default" : "pointer",
|
|
20850
21168
|
background: "#ffffff",
|
|
20851
|
-
color:
|
|
21169
|
+
color: OHW_BLUE_DARK2,
|
|
20852
21170
|
opacity: disabled ? 0.4 : 1,
|
|
20853
21171
|
fontSize: 12,
|
|
20854
21172
|
lineHeight: "16px",
|
|
@@ -20858,7 +21176,7 @@ function TogglePill({
|
|
|
20858
21176
|
},
|
|
20859
21177
|
children: [
|
|
20860
21178
|
label,
|
|
20861
|
-
/* @__PURE__ */
|
|
21179
|
+
/* @__PURE__ */ jsx24(
|
|
20862
21180
|
"span",
|
|
20863
21181
|
{
|
|
20864
21182
|
"aria-hidden": true,
|
|
@@ -20871,10 +21189,10 @@ function TogglePill({
|
|
|
20871
21189
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
20872
21190
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
20873
21191
|
// "disabled control" rather than "switch that is off".
|
|
20874
|
-
background: on ?
|
|
21192
|
+
background: on ? OHW_BLUE_DARK2 : "#CBD5E1",
|
|
20875
21193
|
transition: "background 120ms ease"
|
|
20876
21194
|
},
|
|
20877
|
-
children: /* @__PURE__ */
|
|
21195
|
+
children: /* @__PURE__ */ jsx24(
|
|
20878
21196
|
"span",
|
|
20879
21197
|
{
|
|
20880
21198
|
style: {
|
|
@@ -20903,7 +21221,7 @@ function CarouselSlideToolbar({
|
|
|
20903
21221
|
onChangeImage,
|
|
20904
21222
|
onToggleAutoplay
|
|
20905
21223
|
}) {
|
|
20906
|
-
return /* @__PURE__ */
|
|
21224
|
+
return /* @__PURE__ */ jsxs15(
|
|
20907
21225
|
"div",
|
|
20908
21226
|
{
|
|
20909
21227
|
"data-ohw-bridge": "",
|
|
@@ -20914,7 +21232,7 @@ function CarouselSlideToolbar({
|
|
|
20914
21232
|
flexDirection: "column",
|
|
20915
21233
|
gap: 6,
|
|
20916
21234
|
alignItems: "center",
|
|
20917
|
-
background:
|
|
21235
|
+
background: OHW_BLUE2,
|
|
20918
21236
|
padding: 8,
|
|
20919
21237
|
borderRadius: 12,
|
|
20920
21238
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20926,11 +21244,11 @@ function CarouselSlideToolbar({
|
|
|
20926
21244
|
pointerEvents: pending ? "none" : "auto"
|
|
20927
21245
|
},
|
|
20928
21246
|
children: [
|
|
20929
|
-
/* @__PURE__ */
|
|
20930
|
-
/* @__PURE__ */
|
|
20931
|
-
/* @__PURE__ */
|
|
21247
|
+
/* @__PURE__ */ jsxs15("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
21248
|
+
/* @__PURE__ */ jsx24(Pill2, { label: "Change Image", onClick: onChangeImage }),
|
|
21249
|
+
/* @__PURE__ */ jsx24(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
20932
21250
|
] }),
|
|
20933
|
-
error && /* @__PURE__ */
|
|
21251
|
+
error && /* @__PURE__ */ jsx24("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20934
21252
|
]
|
|
20935
21253
|
}
|
|
20936
21254
|
);
|
|
@@ -20979,8 +21297,8 @@ function AiFadeCarouselOverlay({
|
|
|
20979
21297
|
setHover(null);
|
|
20980
21298
|
return;
|
|
20981
21299
|
}
|
|
20982
|
-
const
|
|
20983
|
-
const unit =
|
|
21300
|
+
const sectionEl2 = itemEl.closest("[data-ohw-section]");
|
|
21301
|
+
const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
|
|
20984
21302
|
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
20985
21303
|
const index = Number(itemEl.dataset.ohwFadeCarouselIndex);
|
|
20986
21304
|
if (!sectionId || Number.isNaN(index)) {
|
|
@@ -21070,8 +21388,8 @@ function AiFadeCarouselOverlay({
|
|
|
21070
21388
|
const activeItemRect = useLiveItemRect2(active);
|
|
21071
21389
|
const TOOLBAR_APPROX_H = 90;
|
|
21072
21390
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21073
|
-
return /* @__PURE__ */
|
|
21074
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
21391
|
+
return /* @__PURE__ */ jsxs15(Fragment10, { children: [
|
|
21392
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx24(
|
|
21075
21393
|
"button",
|
|
21076
21394
|
{
|
|
21077
21395
|
type: "button",
|
|
@@ -21100,10 +21418,10 @@ function AiFadeCarouselOverlay({
|
|
|
21100
21418
|
fontSize: 14,
|
|
21101
21419
|
fontWeight: 700
|
|
21102
21420
|
},
|
|
21103
|
-
children: /* @__PURE__ */
|
|
21421
|
+
children: /* @__PURE__ */ jsx24(Star4, { size: 14, style: { pointerEvents: "none" } })
|
|
21104
21422
|
}
|
|
21105
21423
|
),
|
|
21106
|
-
swapping && /* @__PURE__ */
|
|
21424
|
+
swapping && /* @__PURE__ */ jsx24(
|
|
21107
21425
|
"div",
|
|
21108
21426
|
{
|
|
21109
21427
|
ref: skeletonRef,
|
|
@@ -21121,15 +21439,15 @@ function AiFadeCarouselOverlay({
|
|
|
21121
21439
|
zIndex: 2147483646,
|
|
21122
21440
|
pointerEvents: "none"
|
|
21123
21441
|
},
|
|
21124
|
-
children: /* @__PURE__ */
|
|
21442
|
+
children: /* @__PURE__ */ jsx24("style", { children: MEDIA_SKELETON_CSS })
|
|
21125
21443
|
}
|
|
21126
21444
|
),
|
|
21127
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */
|
|
21445
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx24(
|
|
21128
21446
|
ItemInteractionLayer,
|
|
21129
21447
|
{
|
|
21130
21448
|
rect: activeItemRect,
|
|
21131
21449
|
state: toolbarState,
|
|
21132
|
-
toolbar: /* @__PURE__ */
|
|
21450
|
+
toolbar: /* @__PURE__ */ jsx24(
|
|
21133
21451
|
CarouselSlideToolbar,
|
|
21134
21452
|
{
|
|
21135
21453
|
pending,
|
|
@@ -21320,118 +21638,11 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
21320
21638
|
// src/ui/link-modal/LinkPopover.tsx
|
|
21321
21639
|
import { useEffect as useEffect16 } from "react";
|
|
21322
21640
|
|
|
21323
|
-
// src/ui/dialog.tsx
|
|
21324
|
-
import * as React9 from "react";
|
|
21325
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
21326
|
-
import { X as X2 } from "lucide-react";
|
|
21327
|
-
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
21328
|
-
function Dialog2({
|
|
21329
|
-
...props
|
|
21330
|
-
}) {
|
|
21331
|
-
return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
21332
|
-
}
|
|
21333
|
-
function DialogPortal({
|
|
21334
|
-
...props
|
|
21335
|
-
}) {
|
|
21336
|
-
return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
|
|
21337
|
-
}
|
|
21338
|
-
function DialogOverlay({
|
|
21339
|
-
className,
|
|
21340
|
-
...props
|
|
21341
|
-
}) {
|
|
21342
|
-
return /* @__PURE__ */ jsx24(
|
|
21343
|
-
DialogPrimitive.Overlay,
|
|
21344
|
-
{
|
|
21345
|
-
"data-slot": "dialog-overlay",
|
|
21346
|
-
"data-ohw-link-modal-root": "",
|
|
21347
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21348
|
-
...props
|
|
21349
|
-
}
|
|
21350
|
-
);
|
|
21351
|
-
}
|
|
21352
|
-
var DialogContent = React9.forwardRef(
|
|
21353
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21354
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
21355
|
-
return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
|
|
21356
|
-
/* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21357
|
-
/* @__PURE__ */ jsxs15(
|
|
21358
|
-
DialogPrimitive.Content,
|
|
21359
|
-
{
|
|
21360
|
-
ref,
|
|
21361
|
-
"data-slot": "dialog-content",
|
|
21362
|
-
className: cn(
|
|
21363
|
-
positionMode,
|
|
21364
|
-
"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",
|
|
21365
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21366
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21367
|
-
className
|
|
21368
|
-
),
|
|
21369
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
21370
|
-
...props,
|
|
21371
|
-
children: [
|
|
21372
|
-
children,
|
|
21373
|
-
showCloseButton ? /* @__PURE__ */ jsx24(
|
|
21374
|
-
DialogPrimitive.Close,
|
|
21375
|
-
{
|
|
21376
|
-
type: "button",
|
|
21377
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21378
|
-
"aria-label": "Close",
|
|
21379
|
-
children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
|
|
21380
|
-
}
|
|
21381
|
-
) : null
|
|
21382
|
-
]
|
|
21383
|
-
}
|
|
21384
|
-
)
|
|
21385
|
-
] });
|
|
21386
|
-
}
|
|
21387
|
-
);
|
|
21388
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
21389
|
-
function DialogHeader({
|
|
21390
|
-
className,
|
|
21391
|
-
...props
|
|
21392
|
-
}) {
|
|
21393
|
-
return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21394
|
-
}
|
|
21395
|
-
function DialogFooter({
|
|
21396
|
-
className,
|
|
21397
|
-
...props
|
|
21398
|
-
}) {
|
|
21399
|
-
return /* @__PURE__ */ jsx24(
|
|
21400
|
-
"div",
|
|
21401
|
-
{
|
|
21402
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
21403
|
-
...props
|
|
21404
|
-
}
|
|
21405
|
-
);
|
|
21406
|
-
}
|
|
21407
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21408
|
-
DialogPrimitive.Title,
|
|
21409
|
-
{
|
|
21410
|
-
ref,
|
|
21411
|
-
className: cn(
|
|
21412
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21413
|
-
className
|
|
21414
|
-
),
|
|
21415
|
-
...props
|
|
21416
|
-
}
|
|
21417
|
-
));
|
|
21418
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
21419
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21420
|
-
DialogPrimitive.Description,
|
|
21421
|
-
{
|
|
21422
|
-
ref,
|
|
21423
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
21424
|
-
...props
|
|
21425
|
-
}
|
|
21426
|
-
));
|
|
21427
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
21428
|
-
var DialogClose = DialogPrimitive.Close;
|
|
21429
|
-
|
|
21430
21641
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
21431
21642
|
import { Info, X as X4 } from "lucide-react";
|
|
21432
21643
|
|
|
21433
21644
|
// src/ui/link-modal/DestinationBreadcrumb.tsx
|
|
21434
|
-
import { ArrowRight as
|
|
21645
|
+
import { ArrowRight as ArrowRight3, File, GalleryVertical } from "lucide-react";
|
|
21435
21646
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
21436
21647
|
function DestinationBreadcrumb({
|
|
21437
21648
|
pageTitle,
|
|
@@ -21445,7 +21656,7 @@ function DestinationBreadcrumb({
|
|
|
21445
21656
|
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
|
|
21446
21657
|
] }),
|
|
21447
21658
|
/* @__PURE__ */ jsx25(
|
|
21448
|
-
|
|
21659
|
+
ArrowRight3,
|
|
21449
21660
|
{
|
|
21450
21661
|
size: 16,
|
|
21451
21662
|
className: "shrink-0 text-muted-foreground",
|
|
@@ -21557,7 +21768,7 @@ function Label({ className, ...props }) {
|
|
|
21557
21768
|
}
|
|
21558
21769
|
|
|
21559
21770
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
21560
|
-
import { ChevronDown as
|
|
21771
|
+
import { ChevronDown as ChevronDown5, File as File2, X as X3 } from "lucide-react";
|
|
21561
21772
|
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
21562
21773
|
function FieldChevron({
|
|
21563
21774
|
onClick
|
|
@@ -21570,7 +21781,7 @@ function FieldChevron({
|
|
|
21570
21781
|
onClick,
|
|
21571
21782
|
"aria-label": "Open page list",
|
|
21572
21783
|
tabIndex: -1,
|
|
21573
|
-
children: /* @__PURE__ */ jsx29(
|
|
21784
|
+
children: /* @__PURE__ */ jsx29(ChevronDown5, { size: 16 })
|
|
21574
21785
|
}
|
|
21575
21786
|
);
|
|
21576
21787
|
}
|
|
@@ -21800,7 +22011,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
21800
22011
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
21801
22012
|
import { useCallback as useCallback7, useEffect as useEffect14, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
|
|
21802
22013
|
import { createPortal as createPortal2 } from "react-dom";
|
|
21803
|
-
import { ArrowLeft as
|
|
22014
|
+
import { ArrowLeft as ArrowLeft3, Check as Check4 } from "lucide-react";
|
|
21804
22015
|
import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
|
|
21805
22016
|
|
|
21806
22017
|
// src/lib/parent-scroll.ts
|
|
@@ -22077,7 +22288,7 @@ function SectionPickerOverlay({
|
|
|
22077
22288
|
className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
|
|
22078
22289
|
onClick: onBack,
|
|
22079
22290
|
children: [
|
|
22080
|
-
/* @__PURE__ */ jsx31(
|
|
22291
|
+
/* @__PURE__ */ jsx31(ArrowLeft3, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
22081
22292
|
"Back"
|
|
22082
22293
|
]
|
|
22083
22294
|
}
|
|
@@ -22146,7 +22357,7 @@ function SectionPickerOverlay({
|
|
|
22146
22357
|
className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
|
|
22147
22358
|
style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
|
|
22148
22359
|
"aria-hidden": true,
|
|
22149
|
-
children: /* @__PURE__ */ jsx31(
|
|
22360
|
+
children: /* @__PURE__ */ jsx31(Check4, { className: "size-5" })
|
|
22150
22361
|
}
|
|
22151
22362
|
) : null
|
|
22152
22363
|
]
|
|
@@ -22530,6 +22741,7 @@ function shouldUseDevFixtures() {
|
|
|
22530
22741
|
function getLogoElement(el) {
|
|
22531
22742
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
22532
22743
|
if (marked) return marked;
|
|
22744
|
+
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
22533
22745
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
22534
22746
|
if (!root) return null;
|
|
22535
22747
|
const anchor = el.closest("a");
|
|
@@ -22599,7 +22811,7 @@ function addFooterColumnWithPersist({
|
|
|
22599
22811
|
import {
|
|
22600
22812
|
useCallback as useCallback9,
|
|
22601
22813
|
useEffect as useEffect17,
|
|
22602
|
-
useLayoutEffect as
|
|
22814
|
+
useLayoutEffect as useLayoutEffect6,
|
|
22603
22815
|
useRef as useRef11,
|
|
22604
22816
|
useState as useState15
|
|
22605
22817
|
} from "react";
|
|
@@ -22696,7 +22908,7 @@ function FloatingPanel({
|
|
|
22696
22908
|
return () => window.removeEventListener("message", onParentScroll);
|
|
22697
22909
|
}, [open]);
|
|
22698
22910
|
const positionRef = useRef11(position);
|
|
22699
|
-
|
|
22911
|
+
useLayoutEffect6(() => {
|
|
22700
22912
|
if (!open) {
|
|
22701
22913
|
positionRef.current = position;
|
|
22702
22914
|
return;
|
|
@@ -22706,7 +22918,7 @@ function FloatingPanel({
|
|
|
22706
22918
|
}
|
|
22707
22919
|
positionRef.current = position;
|
|
22708
22920
|
}, [open, position, liveScroll, parentScroll]);
|
|
22709
|
-
|
|
22921
|
+
useLayoutEffect6(() => {
|
|
22710
22922
|
if (!open || !panelRef.current) return;
|
|
22711
22923
|
const el = panelRef.current;
|
|
22712
22924
|
const header = el.querySelector("[data-ohw-floating-panel-header]");
|
|
@@ -22915,7 +23127,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
|
|
|
22915
23127
|
}
|
|
22916
23128
|
|
|
22917
23129
|
// src/ui/button-style-panel.tsx
|
|
22918
|
-
import { Check as
|
|
23130
|
+
import { Check as Check5 } from "lucide-react";
|
|
22919
23131
|
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
22920
23132
|
var SIZE_LABEL = { s: "S", m: "M", l: "L" };
|
|
22921
23133
|
function ButtonStylePanel({
|
|
@@ -22986,7 +23198,7 @@ function ButtonStylePanel({
|
|
|
22986
23198
|
{
|
|
22987
23199
|
className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
|
|
22988
23200
|
"aria-hidden": true,
|
|
22989
|
-
children: /* @__PURE__ */ jsx35(
|
|
23201
|
+
children: /* @__PURE__ */ jsx35(Check5, { className: "size-3", strokeWidth: 3 })
|
|
22990
23202
|
}
|
|
22991
23203
|
) : null
|
|
22992
23204
|
]
|
|
@@ -23917,9 +24129,9 @@ function useSectionDrag({
|
|
|
23917
24129
|
if (target.closest(SECTION_DRAG_EXCLUDED_SELECTOR)) return;
|
|
23918
24130
|
const inner = target.closest("[data-ohw-section]");
|
|
23919
24131
|
if (!inner || isChromeSection(inner) || inner.dataset.ohwSection === "footer") return;
|
|
23920
|
-
const
|
|
23921
|
-
if (!topLevelSections().includes(
|
|
23922
|
-
startSectionPressDrag(
|
|
24132
|
+
const sectionEl2 = movableUnit(inner);
|
|
24133
|
+
if (!topLevelSections().includes(sectionEl2)) return;
|
|
24134
|
+
startSectionPressDrag(sectionEl2, e.clientX, e.clientY, e.pointerId);
|
|
23923
24135
|
};
|
|
23924
24136
|
const onPointerMove = (e) => {
|
|
23925
24137
|
const pending = sectionPointerDragRef.current;
|
|
@@ -24011,7 +24223,7 @@ function useSectionDrag({
|
|
|
24011
24223
|
}
|
|
24012
24224
|
|
|
24013
24225
|
// src/ui/footer-container-chrome.tsx
|
|
24014
|
-
import { Plus as
|
|
24226
|
+
import { Plus as Plus4 } from "lucide-react";
|
|
24015
24227
|
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
24016
24228
|
function FooterContainerChrome({
|
|
24017
24229
|
rect,
|
|
@@ -24052,7 +24264,7 @@ function FooterContainerChrome({
|
|
|
24052
24264
|
if (addDisabled) return;
|
|
24053
24265
|
onAdd();
|
|
24054
24266
|
},
|
|
24055
|
-
children: /* @__PURE__ */ jsx36(
|
|
24267
|
+
children: /* @__PURE__ */ jsx36(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24056
24268
|
}
|
|
24057
24269
|
) }),
|
|
24058
24270
|
/* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
@@ -24459,7 +24671,7 @@ function retargetPageLinks(change, deps) {
|
|
|
24459
24671
|
}
|
|
24460
24672
|
|
|
24461
24673
|
// src/ui/navbar-container-chrome.tsx
|
|
24462
|
-
import { Plus as
|
|
24674
|
+
import { Plus as Plus5 } from "lucide-react";
|
|
24463
24675
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
24464
24676
|
function NavbarContainerChrome({
|
|
24465
24677
|
rect,
|
|
@@ -24495,7 +24707,7 @@ function NavbarContainerChrome({
|
|
|
24495
24707
|
e.stopPropagation();
|
|
24496
24708
|
onAdd();
|
|
24497
24709
|
},
|
|
24498
|
-
children: /* @__PURE__ */ jsx37(
|
|
24710
|
+
children: /* @__PURE__ */ jsx37(Plus5, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24499
24711
|
}
|
|
24500
24712
|
)
|
|
24501
24713
|
}
|
|
@@ -24567,7 +24779,7 @@ function Badge({ className, variant, ...props }) {
|
|
|
24567
24779
|
}
|
|
24568
24780
|
|
|
24569
24781
|
// src/OhhwellsBridge.tsx
|
|
24570
|
-
import { Brush as Brush2, Link as Link2, Plus as
|
|
24782
|
+
import { Brush as Brush2, Link as Link2, Plus as Plus6, Settings } from "lucide-react";
|
|
24571
24783
|
import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
24572
24784
|
var PRIMARY7 = "#0885FE";
|
|
24573
24785
|
var IMAGE_FADE_MS = 300;
|
|
@@ -25345,7 +25557,7 @@ function getNavigationSelectionParent(el) {
|
|
|
25345
25557
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
25346
25558
|
return resolveFooterLinksContainerFrom(el);
|
|
25347
25559
|
}
|
|
25348
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
25560
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup2(el)) {
|
|
25349
25561
|
return getNavigationRoot(el);
|
|
25350
25562
|
}
|
|
25351
25563
|
return null;
|
|
@@ -25567,7 +25779,6 @@ var ICONS = {
|
|
|
25567
25779
|
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"/>',
|
|
25568
25780
|
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"/>'
|
|
25569
25781
|
};
|
|
25570
|
-
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
25571
25782
|
var SELECTION_CHROME_GAP2 = 4;
|
|
25572
25783
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
25573
25784
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -25665,7 +25876,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
25665
25876
|
el.style.top = `${top}px`;
|
|
25666
25877
|
el.style.height = `${height}px`;
|
|
25667
25878
|
}
|
|
25668
|
-
var
|
|
25879
|
+
var TOOLBAR_EDGE_MARGIN4 = 4;
|
|
25669
25880
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
25670
25881
|
const isAbove = transform.includes("translateY(-100%)");
|
|
25671
25882
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -25692,8 +25903,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
25692
25903
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
25693
25904
|
const half = toolbarWidth / 2;
|
|
25694
25905
|
return Math.max(
|
|
25695
|
-
|
|
25696
|
-
Math.min(centerX, window.innerWidth -
|
|
25906
|
+
TOOLBAR_EDGE_MARGIN4 + half,
|
|
25907
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN4 - half)
|
|
25697
25908
|
);
|
|
25698
25909
|
}
|
|
25699
25910
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26094,7 +26305,7 @@ function OhhwellsBridge() {
|
|
|
26094
26305
|
}, []);
|
|
26095
26306
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
26096
26307
|
const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
|
|
26097
|
-
|
|
26308
|
+
useLayoutEffect7(() => {
|
|
26098
26309
|
const next = resolveSubdomain(subdomainFromQuery);
|
|
26099
26310
|
if (next !== subdomain) setSubdomain(next);
|
|
26100
26311
|
if (next) return;
|
|
@@ -26189,9 +26400,9 @@ function OhhwellsBridge() {
|
|
|
26189
26400
|
const selectedIconElRef = useRef14(null);
|
|
26190
26401
|
const selectedSocialElRef = useRef14(null);
|
|
26191
26402
|
const queueSectionKeyDrop = useCallback12((prev) => {
|
|
26192
|
-
const
|
|
26193
|
-
if (!
|
|
26194
|
-
const sectionInstanceId = instanceIdOf(movableUnit(
|
|
26403
|
+
const sectionEl2 = prev?.closest("[data-ohw-section]") ?? null;
|
|
26404
|
+
if (!sectionEl2) return;
|
|
26405
|
+
const sectionInstanceId = instanceIdOf(movableUnit(sectionEl2)) || null;
|
|
26195
26406
|
if (!sectionInstanceId) return;
|
|
26196
26407
|
const token = ++mediaKeyDropTokenRef.current;
|
|
26197
26408
|
const onQueueDrained = (e) => {
|
|
@@ -26201,8 +26412,8 @@ function OhhwellsBridge() {
|
|
|
26201
26412
|
if (selectedMediaElRef.current || selectedIconElRef.current || selectedSocialElRef.current) return;
|
|
26202
26413
|
postToParentRef.current({
|
|
26203
26414
|
type: "ow:section-selected",
|
|
26204
|
-
sectionId:
|
|
26205
|
-
sectionLabel:
|
|
26415
|
+
sectionId: sectionEl2.dataset.ohwSection ?? null,
|
|
26416
|
+
sectionLabel: sectionEl2.dataset.ohwSectionLabel ?? titleCaseSectionId(sectionEl2.dataset.ohwSection ?? ""),
|
|
26206
26417
|
key: null
|
|
26207
26418
|
});
|
|
26208
26419
|
};
|
|
@@ -26236,12 +26447,12 @@ function OhhwellsBridge() {
|
|
|
26236
26447
|
const selectIconElement = useCallback12((el) => {
|
|
26237
26448
|
if (selectedMediaElRef.current) clearMediaSelectionRef.current();
|
|
26238
26449
|
selectedIconElRef.current = el;
|
|
26239
|
-
const
|
|
26450
|
+
const sectionEl2 = el.closest("[data-ohw-section]");
|
|
26240
26451
|
aiSectionApiRef.current?.selectFromElement(el, { report: false });
|
|
26241
26452
|
postToParentRef.current({
|
|
26242
26453
|
type: "ow:section-selected",
|
|
26243
|
-
sectionId:
|
|
26244
|
-
sectionLabel:
|
|
26454
|
+
sectionId: sectionEl2?.dataset.ohwSection ?? null,
|
|
26455
|
+
sectionLabel: sectionEl2 ? sectionEl2.dataset.ohwSectionLabel ?? titleCaseSectionId(sectionEl2.dataset.ohwSection ?? "") : null,
|
|
26245
26456
|
key: el.dataset.ohwKey ?? null,
|
|
26246
26457
|
keyLabel: "Icon"
|
|
26247
26458
|
});
|
|
@@ -26261,12 +26472,12 @@ function OhhwellsBridge() {
|
|
|
26261
26472
|
isDragOver: false,
|
|
26262
26473
|
...video ? { videoAutoplay: video.autoplay, videoMuted: video.muted } : {}
|
|
26263
26474
|
});
|
|
26264
|
-
const
|
|
26475
|
+
const sectionEl2 = el.closest("[data-ohw-section]");
|
|
26265
26476
|
aiSectionApiRef.current?.selectFromElement(el, { report: false });
|
|
26266
26477
|
postToParentRef.current({
|
|
26267
26478
|
type: "ow:section-selected",
|
|
26268
|
-
sectionId:
|
|
26269
|
-
sectionLabel:
|
|
26479
|
+
sectionId: sectionEl2?.dataset.ohwSection ?? null,
|
|
26480
|
+
sectionLabel: sectionEl2 ? sectionEl2.dataset.ohwSectionLabel ?? titleCaseSectionId(sectionEl2.dataset.ohwSection ?? "") : null,
|
|
26270
26481
|
key: el.dataset.ohwKey ?? null,
|
|
26271
26482
|
// Display name for the pill — the raw key prettifies into fragments ("Img"); the
|
|
26272
26483
|
// bridge knows what the node IS, so it names it.
|
|
@@ -26576,21 +26787,6 @@ function OhhwellsBridge() {
|
|
|
26576
26787
|
const [isItemDragging, setIsItemDragging] = useState18(false);
|
|
26577
26788
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
|
|
26578
26789
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26579
|
-
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
26580
|
-
const floatingPanelOpenRef = useRef14(false);
|
|
26581
|
-
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
26582
|
-
const floatingPanelRef = useRef14(null);
|
|
26583
|
-
floatingPanelRef.current = floatingPanel;
|
|
26584
|
-
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
26585
|
-
const buttonCollectionDragRef = useRef14(null);
|
|
26586
|
-
const buttonDropInsertIndexRef = useRef14(null);
|
|
26587
|
-
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
26588
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
26589
|
-
const buttonPointerDragRef = useRef14(null);
|
|
26590
|
-
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
26591
|
-
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
26592
|
-
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
26593
|
-
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
26594
26790
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
|
|
26595
26791
|
const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
|
|
26596
26792
|
const footerDragRef = useRef14(null);
|
|
@@ -26617,6 +26813,21 @@ function OhhwellsBridge() {
|
|
|
26617
26813
|
const stylesRef = useRef14("");
|
|
26618
26814
|
const appliedDrawerRef = useRef14(null);
|
|
26619
26815
|
const pendingDeleteUndoRef = useRef14(null);
|
|
26816
|
+
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
26817
|
+
const floatingPanelOpenRef = useRef14(false);
|
|
26818
|
+
const floatingPanelRef = useRef14(null);
|
|
26819
|
+
floatingPanelRef.current = floatingPanel;
|
|
26820
|
+
const setFloatingPanelRef = useRef14(setFloatingPanel);
|
|
26821
|
+
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
26822
|
+
const buttonCollectionDragRef = useRef14(null);
|
|
26823
|
+
const buttonDropInsertIndexRef = useRef14(null);
|
|
26824
|
+
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
26825
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
26826
|
+
const buttonPointerDragRef = useRef14(null);
|
|
26827
|
+
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
26828
|
+
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
26829
|
+
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
26830
|
+
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
26620
26831
|
const [sitePages, setSitePages] = useState18([]);
|
|
26621
26832
|
const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
|
|
26622
26833
|
const [sectionsByPath, setSectionsByPath] = useState18({});
|
|
@@ -26626,7 +26837,18 @@ function OhhwellsBridge() {
|
|
|
26626
26837
|
const linkPopoverOpenRef = useRef14(false);
|
|
26627
26838
|
const linkPopoverGraceUntilRef = useRef14(0);
|
|
26628
26839
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26840
|
+
setFloatingPanelRef.current = setFloatingPanel;
|
|
26629
26841
|
linkPopoverSessionRef.current = linkPopover;
|
|
26842
|
+
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
26843
|
+
useEffect21(() => {
|
|
26844
|
+
const syncViewport = () => {
|
|
26845
|
+
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26846
|
+
setEditorViewport((prev) => prev === next ? prev : next);
|
|
26847
|
+
};
|
|
26848
|
+
syncViewport();
|
|
26849
|
+
window.addEventListener("resize", syncViewport);
|
|
26850
|
+
return () => window.removeEventListener("resize", syncViewport);
|
|
26851
|
+
}, []);
|
|
26630
26852
|
useEffect21(() => {
|
|
26631
26853
|
setSectionOrderPersistHandler((entries) => {
|
|
26632
26854
|
const currentPath = window.location.pathname;
|
|
@@ -27852,12 +28074,12 @@ function OhhwellsBridge() {
|
|
|
27852
28074
|
const socialItem = getSocialItem(anchor);
|
|
27853
28075
|
if (socialItem) {
|
|
27854
28076
|
selectedSocialElRef.current = socialItem;
|
|
27855
|
-
const
|
|
28077
|
+
const sectionEl2 = socialItem.closest("[data-ohw-section]");
|
|
27856
28078
|
aiSectionApiRef.current?.selectFromElement(anchor, { report: false });
|
|
27857
28079
|
postToParentRef.current({
|
|
27858
28080
|
type: "ow:section-selected",
|
|
27859
|
-
sectionId:
|
|
27860
|
-
sectionLabel:
|
|
28081
|
+
sectionId: sectionEl2?.dataset.ohwSection ?? null,
|
|
28082
|
+
sectionLabel: sectionEl2 ? sectionEl2.dataset.ohwSectionLabel ?? titleCaseSectionId(sectionEl2.dataset.ohwSection ?? "") : null,
|
|
27861
28083
|
key: socialIconKey(socialItem) ?? socialItem.getAttribute("data-ohw-href-key"),
|
|
27862
28084
|
keyLabel: socialPlatformLabel(socialItem, editContentRef.current)
|
|
27863
28085
|
});
|
|
@@ -28287,13 +28509,13 @@ function OhhwellsBridge() {
|
|
|
28287
28509
|
setReorderDragDisabled(reorderDisabled);
|
|
28288
28510
|
}
|
|
28289
28511
|
setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
28290
|
-
const
|
|
28512
|
+
const sectionEl2 = el.closest("[data-ohw-section]");
|
|
28291
28513
|
postToParent2({
|
|
28292
28514
|
type: "ow:enter-edit",
|
|
28293
28515
|
key: el.dataset.ohwKey,
|
|
28294
28516
|
// Section the edited element belongs to, so the editor can scope AI prompts to it.
|
|
28295
|
-
sectionId:
|
|
28296
|
-
sectionLabel:
|
|
28517
|
+
sectionId: sectionEl2?.dataset.ohwSection ?? null,
|
|
28518
|
+
sectionLabel: sectionEl2?.dataset.ohwSectionLabel ?? null
|
|
28297
28519
|
});
|
|
28298
28520
|
aiSectionApiRef.current?.selectFromElement(el, { report: false });
|
|
28299
28521
|
requestAnimationFrame(() => refreshActiveCommandsRef.current());
|
|
@@ -28333,7 +28555,7 @@ function OhhwellsBridge() {
|
|
|
28333
28555
|
isFooterFrameSelection,
|
|
28334
28556
|
postToParent2
|
|
28335
28557
|
]);
|
|
28336
|
-
|
|
28558
|
+
useLayoutEffect7(() => {
|
|
28337
28559
|
if (!subdomain || isEditMode) {
|
|
28338
28560
|
setFetchState("done");
|
|
28339
28561
|
return;
|
|
@@ -28360,6 +28582,7 @@ function OhhwellsBridge() {
|
|
|
28360
28582
|
applyAiFooterFromContent(content);
|
|
28361
28583
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28362
28584
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
28585
|
+
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28363
28586
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28364
28587
|
}
|
|
28365
28588
|
applyBrandChrome(content);
|
|
@@ -28370,15 +28593,16 @@ function OhhwellsBridge() {
|
|
|
28370
28593
|
if (key === "__ohw_sections") continue;
|
|
28371
28594
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28372
28595
|
if (key === AI_FOOTER_KEY) continue;
|
|
28596
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28597
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28373
28598
|
if (key === BRAND_KIT_KEY) continue;
|
|
28374
28599
|
if (key === STYLE_STORE_KEY) continue;
|
|
28375
28600
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28376
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28377
28601
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28378
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28379
28602
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28380
28603
|
continue;
|
|
28381
28604
|
}
|
|
28605
|
+
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28382
28606
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28383
28607
|
if (applyCarouselNode(key, val)) continue;
|
|
28384
28608
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28418,6 +28642,7 @@ function OhhwellsBridge() {
|
|
|
28418
28642
|
});
|
|
28419
28643
|
applyLinkByKey(key, val);
|
|
28420
28644
|
}
|
|
28645
|
+
applySectionEmbeds(content);
|
|
28421
28646
|
applyLogoFromContent(content);
|
|
28422
28647
|
applyLogoSizes(content);
|
|
28423
28648
|
reconcileNavbarItemsFromContent(content);
|
|
@@ -28606,20 +28831,22 @@ function OhhwellsBridge() {
|
|
|
28606
28831
|
}
|
|
28607
28832
|
applyAiFooterFromContent(content);
|
|
28608
28833
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28834
|
+
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28609
28835
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28610
28836
|
}
|
|
28611
28837
|
for (const [key, val] of Object.entries(content)) {
|
|
28612
28838
|
if (key === "__ohw_sections") continue;
|
|
28613
28839
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28614
28840
|
if (key === AI_FOOTER_KEY) continue;
|
|
28841
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28842
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28615
28843
|
if (key === BRAND_KIT_KEY) continue;
|
|
28616
28844
|
if (key === STYLE_STORE_KEY) continue;
|
|
28617
28845
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28618
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28619
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28620
28846
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28621
28847
|
continue;
|
|
28622
28848
|
}
|
|
28849
|
+
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28623
28850
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28624
28851
|
if (applyCarouselNode(key, val)) continue;
|
|
28625
28852
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28644,6 +28871,7 @@ function OhhwellsBridge() {
|
|
|
28644
28871
|
});
|
|
28645
28872
|
applyLinkByKey(key, val);
|
|
28646
28873
|
}
|
|
28874
|
+
applySectionEmbeds(content);
|
|
28647
28875
|
applyLogoFromContent(content);
|
|
28648
28876
|
reconcileNavbarItemsFromContent(content);
|
|
28649
28877
|
reconcileFooterOrderFromContent(content);
|
|
@@ -28699,7 +28927,7 @@ function OhhwellsBridge() {
|
|
|
28699
28927
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
28700
28928
|
};
|
|
28701
28929
|
}, [subdomain, isEditMode, pathname]);
|
|
28702
|
-
|
|
28930
|
+
useLayoutEffect7(() => {
|
|
28703
28931
|
const el = document.getElementById("ohw-loader");
|
|
28704
28932
|
if (!el) return;
|
|
28705
28933
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
@@ -28883,26 +29111,11 @@ function OhhwellsBridge() {
|
|
|
28883
29111
|
const t2 = setTimeout(measure, 500);
|
|
28884
29112
|
const ro = new ResizeObserver(schedule);
|
|
28885
29113
|
ro.observe(document.body);
|
|
28886
|
-
let lastWidth = window.innerWidth;
|
|
28887
|
-
let resizeTimers = [];
|
|
28888
|
-
const clearResizeTimers = () => {
|
|
28889
|
-
resizeTimers.forEach(clearTimeout);
|
|
28890
|
-
resizeTimers = [];
|
|
28891
|
-
};
|
|
28892
|
-
const handleResize = () => {
|
|
28893
|
-
if (window.innerWidth === lastWidth) return;
|
|
28894
|
-
lastWidth = window.innerWidth;
|
|
28895
|
-
clearResizeTimers();
|
|
28896
|
-
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
28897
|
-
};
|
|
28898
|
-
window.addEventListener("resize", handleResize);
|
|
28899
29114
|
return () => {
|
|
28900
29115
|
clearTimeout(t1);
|
|
28901
29116
|
clearTimeout(t2);
|
|
28902
29117
|
if (raf != null) cancelAnimationFrame(raf);
|
|
28903
29118
|
ro.disconnect();
|
|
28904
|
-
clearResizeTimers();
|
|
28905
|
-
window.removeEventListener("resize", handleResize);
|
|
28906
29119
|
};
|
|
28907
29120
|
}, [pathname, isEditMode, postToParent2]);
|
|
28908
29121
|
useEffect21(() => {
|
|
@@ -29199,6 +29412,13 @@ function OhhwellsBridge() {
|
|
|
29199
29412
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29200
29413
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29201
29414
|
if (isInsideLinkEditor(target)) return;
|
|
29415
|
+
if (isInsideFloatingPanel(target)) return;
|
|
29416
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29417
|
+
if (target.closest(
|
|
29418
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29419
|
+
)) {
|
|
29420
|
+
return;
|
|
29421
|
+
}
|
|
29202
29422
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29203
29423
|
clearMediaSelectionRef.current();
|
|
29204
29424
|
}
|
|
@@ -29222,8 +29442,6 @@ function OhhwellsBridge() {
|
|
|
29222
29442
|
return;
|
|
29223
29443
|
}
|
|
29224
29444
|
}
|
|
29225
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29226
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29227
29445
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29228
29446
|
if (collectionItem) {
|
|
29229
29447
|
e.preventDefault();
|
|
@@ -29235,11 +29453,6 @@ function OhhwellsBridge() {
|
|
|
29235
29453
|
});
|
|
29236
29454
|
return;
|
|
29237
29455
|
}
|
|
29238
|
-
if (target.closest(
|
|
29239
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29240
|
-
)) {
|
|
29241
|
-
return;
|
|
29242
|
-
}
|
|
29243
29456
|
{
|
|
29244
29457
|
const formEl = getFormElement(target);
|
|
29245
29458
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -29393,9 +29606,13 @@ function OhhwellsBridge() {
|
|
|
29393
29606
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
29394
29607
|
e.preventDefault();
|
|
29395
29608
|
e.stopPropagation();
|
|
29396
|
-
selectIconElementRef.current(editable);
|
|
29397
29609
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
29398
29610
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
29611
|
+
if (aiIcon) {
|
|
29612
|
+
aiSectionApiRef.current?.selectFromElement(editable);
|
|
29613
|
+
} else {
|
|
29614
|
+
selectIconElementRef.current(editable);
|
|
29615
|
+
}
|
|
29399
29616
|
postToParentRef.current({
|
|
29400
29617
|
type: "ow:icon-pick",
|
|
29401
29618
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -29623,6 +29840,9 @@ function OhhwellsBridge() {
|
|
|
29623
29840
|
setHoveredItemRect(null);
|
|
29624
29841
|
hoveredNavContainerRef.current = null;
|
|
29625
29842
|
setHoveredNavContainerRect(null);
|
|
29843
|
+
siblingHintElRef.current = null;
|
|
29844
|
+
setSiblingHintRect(null);
|
|
29845
|
+
setSiblingHintRects([]);
|
|
29626
29846
|
return;
|
|
29627
29847
|
}
|
|
29628
29848
|
{
|
|
@@ -29743,7 +29963,6 @@ function OhhwellsBridge() {
|
|
|
29743
29963
|
hoveredNavContainerRef.current = null;
|
|
29744
29964
|
setHoveredNavContainerRect(null);
|
|
29745
29965
|
hoveredItemElRef.current = editable;
|
|
29746
|
-
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
29747
29966
|
}
|
|
29748
29967
|
}
|
|
29749
29968
|
}
|
|
@@ -30453,7 +30672,11 @@ function OhhwellsBridge() {
|
|
|
30453
30672
|
};
|
|
30454
30673
|
const handleMouseMove = (e) => {
|
|
30455
30674
|
const { clientX, clientY } = e;
|
|
30456
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30675
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) {
|
|
30676
|
+
dismissImageHover();
|
|
30677
|
+
clearImageHover();
|
|
30678
|
+
return;
|
|
30679
|
+
}
|
|
30457
30680
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
30458
30681
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
30459
30682
|
formHoverElRef.current = null;
|
|
@@ -30482,7 +30705,12 @@ function OhhwellsBridge() {
|
|
|
30482
30705
|
setHoveredItemRect(null);
|
|
30483
30706
|
hoveredNavContainerRef.current = null;
|
|
30484
30707
|
setHoveredNavContainerRect(null);
|
|
30708
|
+
siblingHintElRef.current = null;
|
|
30709
|
+
setSiblingHintRect(null);
|
|
30710
|
+
setSiblingHintRects([]);
|
|
30485
30711
|
dismissImageHover();
|
|
30712
|
+
clearImageHover();
|
|
30713
|
+
setSectionGap(null);
|
|
30486
30714
|
return;
|
|
30487
30715
|
}
|
|
30488
30716
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -30494,7 +30722,11 @@ function OhhwellsBridge() {
|
|
|
30494
30722
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
30495
30723
|
const { clientX, clientY } = e.data;
|
|
30496
30724
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
30497
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30725
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) {
|
|
30726
|
+
dismissImageHover();
|
|
30727
|
+
clearImageHover();
|
|
30728
|
+
return;
|
|
30729
|
+
}
|
|
30498
30730
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
30499
30731
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
30500
30732
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -30874,6 +31106,7 @@ function OhhwellsBridge() {
|
|
|
30874
31106
|
applyAiFooterFromContent(content);
|
|
30875
31107
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30876
31108
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
31109
|
+
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30877
31110
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30878
31111
|
}
|
|
30879
31112
|
applyBrandChrome(content);
|
|
@@ -30888,15 +31121,16 @@ function OhhwellsBridge() {
|
|
|
30888
31121
|
}
|
|
30889
31122
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30890
31123
|
if (key === AI_FOOTER_KEY) continue;
|
|
31124
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31125
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
30891
31126
|
if (key === BRAND_KIT_KEY) continue;
|
|
30892
31127
|
if (key === STYLE_STORE_KEY) continue;
|
|
30893
31128
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30894
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30895
31129
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
30896
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
30897
31130
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30898
31131
|
continue;
|
|
30899
31132
|
}
|
|
31133
|
+
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
30900
31134
|
if (applyVideoSettingNode(key, val)) continue;
|
|
30901
31135
|
if (applyCarouselNode(key, val)) continue;
|
|
30902
31136
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -30922,6 +31156,7 @@ function OhhwellsBridge() {
|
|
|
30922
31156
|
});
|
|
30923
31157
|
applyLinkByKey(key, val);
|
|
30924
31158
|
}
|
|
31159
|
+
applySectionEmbeds(content);
|
|
30925
31160
|
applyLogoFromContent(content);
|
|
30926
31161
|
applyLogoSizes(content);
|
|
30927
31162
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
@@ -31554,6 +31789,12 @@ function OhhwellsBridge() {
|
|
|
31554
31789
|
closeLinkPopoverRef.current();
|
|
31555
31790
|
return;
|
|
31556
31791
|
}
|
|
31792
|
+
if (floatingPanelOpenRef.current) {
|
|
31793
|
+
setFloatingPanelRef.current(null);
|
|
31794
|
+
deselectRef.current();
|
|
31795
|
+
deactivateRef.current();
|
|
31796
|
+
return;
|
|
31797
|
+
}
|
|
31557
31798
|
deselectRef.current();
|
|
31558
31799
|
deactivateRef.current();
|
|
31559
31800
|
clearMediaSelectionRef.current();
|
|
@@ -31939,12 +32180,12 @@ function OhhwellsBridge() {
|
|
|
31939
32180
|
`[data-ohw-instance="${escapedSectionId}"]`
|
|
31940
32181
|
);
|
|
31941
32182
|
const foundEl = instanceEl ? sectionElementOf(instanceEl) : document.querySelector(`[data-ohw-section="${escapedSectionId}"]`);
|
|
31942
|
-
const
|
|
31943
|
-
const nodes =
|
|
32183
|
+
const sectionEl2 = foundEl && !foundEl.hasAttribute("data-ohw-ai-template-hidden") && !foundEl.hasAttribute("data-ohw-ai-removed") && !foundEl.hasAttribute("data-ohw-ai-replaced-by") ? foundEl : null;
|
|
32184
|
+
const nodes = sectionEl2 ? collectEditableNodes(void 0, sectionEl2).filter(
|
|
31944
32185
|
(n) => n.key && !n.key.startsWith("__ohw_") && !["meta", "sections", "video-setting"].includes(n.type)
|
|
31945
|
-
).map((n) => ({ ...n, text: n.text ?? "", type: normalizeAiNodeType(n.type) })).map((n) => withNodeFontSize(n,
|
|
31946
|
-
const items =
|
|
31947
|
-
const box =
|
|
32186
|
+
).map((n) => ({ ...n, text: n.text ?? "", type: normalizeAiNodeType(n.type) })).map((n) => withNodeFontSize(n, sectionEl2)) : [];
|
|
32187
|
+
const items = sectionEl2 ? collectItemGroups(sectionEl2) : [];
|
|
32188
|
+
const box = sectionEl2?.getBoundingClientRect();
|
|
31948
32189
|
const rect = box ? {
|
|
31949
32190
|
top: box.top + window.scrollY,
|
|
31950
32191
|
left: box.left + window.scrollX,
|
|
@@ -31960,7 +32201,7 @@ function OhhwellsBridge() {
|
|
|
31960
32201
|
postToParentRef.current({
|
|
31961
32202
|
type: "ow:section-nodes",
|
|
31962
32203
|
sectionId,
|
|
31963
|
-
found: !!
|
|
32204
|
+
found: !!sectionEl2,
|
|
31964
32205
|
nodes,
|
|
31965
32206
|
rect,
|
|
31966
32207
|
...settings ? { settings } : {},
|
|
@@ -31968,7 +32209,7 @@ function OhhwellsBridge() {
|
|
|
31968
32209
|
// The section's repeated-item groups (cards, rows, FAQ entries) — what lets a prompt add
|
|
31969
32210
|
// or remove items on a template section without regenerating it. Empty for generated
|
|
31970
32211
|
// sections, whose items live in the tree.
|
|
31971
|
-
...
|
|
32212
|
+
...sectionEl2 && items.length ? { items } : {}
|
|
31972
32213
|
});
|
|
31973
32214
|
};
|
|
31974
32215
|
const handleCollectItems = (e) => {
|
|
@@ -32390,10 +32631,10 @@ function OhhwellsBridge() {
|
|
|
32390
32631
|
window.removeEventListener("message", handleDuplicateSection);
|
|
32391
32632
|
window.removeEventListener("message", handleDeactivate);
|
|
32392
32633
|
window.removeEventListener("message", handleSelectNav);
|
|
32393
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32394
32634
|
window.removeEventListener("message", handleToastAction);
|
|
32395
32635
|
window.removeEventListener("message", handleFormCount);
|
|
32396
32636
|
window.removeEventListener("message", handleUiEscape);
|
|
32637
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32397
32638
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
32398
32639
|
autoSaveTimers.current.clear();
|
|
32399
32640
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -32687,7 +32928,7 @@ function OhhwellsBridge() {
|
|
|
32687
32928
|
postToParent2({
|
|
32688
32929
|
type: "ow:ready",
|
|
32689
32930
|
version: "1",
|
|
32690
|
-
bridgeVersion: "0.1.
|
|
32931
|
+
bridgeVersion: "0.1.168-next.447",
|
|
32691
32932
|
path: pathname,
|
|
32692
32933
|
nodes: collectEditableNodes(editContentRef.current),
|
|
32693
32934
|
sections
|
|
@@ -33422,7 +33663,7 @@ function OhhwellsBridge() {
|
|
|
33422
33663
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
|
|
33423
33664
|
onClick: () => setFieldTypePickerOpen((open) => !open),
|
|
33424
33665
|
"data-ohw-add-field": "",
|
|
33425
|
-
children: /* @__PURE__ */ jsx40(
|
|
33666
|
+
children: /* @__PURE__ */ jsx40(Plus6, { size: 15, "aria-hidden": true })
|
|
33426
33667
|
}
|
|
33427
33668
|
),
|
|
33428
33669
|
/* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),
|