@ohhwells/bridge 0.1.164-next.439 → 0.1.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +745 -1001
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +766 -1038
- package/dist/index.js.map +1 -1
- package/dist/pages.cjs.map +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/styles.css +0 -116
- package/package.json +3 -3
package/dist/index.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 useEffect20, useLayoutEffect as
|
|
4
|
+
import React12, { useCallback as useCallback12, useEffect as useEffect20, useLayoutEffect as useLayoutEffect6, 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 paint = parseColor(paintColor(seed)) ?? { r: 15, g: 15, b: 15, a: 1 };
|
|
1102
|
+
const luminance = relativeLuminance(paint);
|
|
1103
1103
|
return {
|
|
1104
|
-
background: toCss({ ...
|
|
1104
|
+
background: toCss({ ...paint, 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 paint = accentColor(primary);
|
|
1112
1112
|
return {
|
|
1113
1113
|
background: TRANSPARENT,
|
|
1114
|
-
color:
|
|
1115
|
-
borderColor:
|
|
1114
|
+
color: paint,
|
|
1115
|
+
borderColor: paint,
|
|
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 paint = accentColor(primary);
|
|
1129
1129
|
const text = parseColor(outline.color);
|
|
1130
|
-
const paintRgb = parseColor(
|
|
1130
|
+
const paintRgb = parseColor(paint);
|
|
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: paint,
|
|
1140
|
+
borderColor: hasBorder ? paint : outline.borderColor
|
|
1141
1141
|
};
|
|
1142
1142
|
}
|
|
1143
1143
|
function generateButtonVariants(samples) {
|
|
@@ -6432,24 +6432,6 @@ function deleteSectionFromState(state, sectionId) {
|
|
|
6432
6432
|
if (removed.includes(sectionId)) return state;
|
|
6433
6433
|
return { ...state, v: 1, sections: state.sections, removed: [...removed, sectionId] };
|
|
6434
6434
|
}
|
|
6435
|
-
function moveSectionInState(state, sectionId, targetPath) {
|
|
6436
|
-
const entry = state.sections.find((section) => section.id === sectionId);
|
|
6437
|
-
if (!entry) return null;
|
|
6438
|
-
const moved = {
|
|
6439
|
-
id: entry.id,
|
|
6440
|
-
label: entry.label,
|
|
6441
|
-
path: targetPath,
|
|
6442
|
-
afterSection: null,
|
|
6443
|
-
tree: entry.tree,
|
|
6444
|
-
media: entry.media,
|
|
6445
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
6446
|
-
};
|
|
6447
|
-
return {
|
|
6448
|
-
...state,
|
|
6449
|
-
v: 1,
|
|
6450
|
-
sections: state.sections.map((section) => section.id === sectionId ? moved : section)
|
|
6451
|
-
};
|
|
6452
|
-
}
|
|
6453
6435
|
function reapRemovedAiSections(state, store, removedIds, excludeIds = /* @__PURE__ */ new Set()) {
|
|
6454
6436
|
const generated = new Set(state.sections.map((entry) => entry.id));
|
|
6455
6437
|
const reapedIds = [...new Set(removedIds)].filter((id) => generated.has(id) && !excludeIds.has(id));
|
|
@@ -6678,21 +6660,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
6678
6660
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
6679
6661
|
return target ? pricingFeatureList(target).length : 0;
|
|
6680
6662
|
}
|
|
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
|
-
}
|
|
6696
6663
|
function addPricingCardFeature(tree, index, text) {
|
|
6697
6664
|
return withPricingCollection(tree, (collection) => {
|
|
6698
6665
|
const children = collection.children;
|
|
@@ -6701,7 +6668,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
6701
6668
|
const features = pricingFeatureList(target);
|
|
6702
6669
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
6703
6670
|
target.slots = target.slots ?? {};
|
|
6704
|
-
target.slots.features = [...features, { text
|
|
6671
|
+
target.slots.features = [...features, { text }];
|
|
6705
6672
|
return true;
|
|
6706
6673
|
});
|
|
6707
6674
|
}
|
|
@@ -7345,120 +7312,6 @@ function findSelectableNavContainer(doc = document) {
|
|
|
7345
7312
|
);
|
|
7346
7313
|
}
|
|
7347
7314
|
|
|
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
|
-
|
|
7462
7315
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
7463
7316
|
import { flushSync } from "react-dom";
|
|
7464
7317
|
import { createRoot } from "react-dom/client";
|
|
@@ -8032,7 +7885,7 @@ var AI_MOBILE_CSS = [
|
|
|
8032
7885
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
8033
7886
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
8034
7887
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
8035
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
7888
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
8036
7889
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
8037
7890
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
8038
7891
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -8048,10 +7901,8 @@ var AI_MOBILE_CSS = [
|
|
|
8048
7901
|
"[data-ai-section]{overflow-x:hidden}",
|
|
8049
7902
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
8050
7903
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
8051
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
8052
|
-
|
|
8053
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8054
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
7904
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
7905
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8055
7906
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
8056
7907
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
8057
7908
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8256,31 +8107,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8256
8107
|
function textAttrs(ctx, path) {
|
|
8257
8108
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8258
8109
|
}
|
|
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");
|
|
8284
8110
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8285
8111
|
function MediaBox({
|
|
8286
8112
|
refValue,
|
|
@@ -8335,7 +8161,7 @@ function MediaBox({
|
|
|
8335
8161
|
position: fill ? "absolute" : void 0,
|
|
8336
8162
|
inset: fill ? 0 : void 0,
|
|
8337
8163
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8338
|
-
height: fill ? "100%" :
|
|
8164
|
+
height: fill ? "100%" : void 0,
|
|
8339
8165
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8340
8166
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8341
8167
|
borderRadius: radius,
|
|
@@ -9831,7 +9657,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
9831
9657
|
return /* @__PURE__ */ jsx(
|
|
9832
9658
|
"div",
|
|
9833
9659
|
{
|
|
9834
|
-
"data-ai-grid":
|
|
9660
|
+
"data-ai-grid": "",
|
|
9835
9661
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
9836
9662
|
style: {
|
|
9837
9663
|
display: "grid",
|
|
@@ -10133,7 +9959,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
10133
9959
|
},
|
|
10134
9960
|
children: [
|
|
10135
9961
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
10136
|
-
// The section's `data-ai-
|
|
9962
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
10137
9963
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
10138
9964
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
10139
9965
|
// the full section width instead of reading at the usual content width.
|
|
@@ -10552,7 +10378,6 @@ function AiTreeRenderer({
|
|
|
10552
10378
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
10553
10379
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
10554
10380
|
...bgAttrs,
|
|
10555
|
-
"data-ai-responsive": "",
|
|
10556
10381
|
style: {
|
|
10557
10382
|
position: "relative",
|
|
10558
10383
|
padding: `${padCss} 0`,
|
|
@@ -10566,13 +10391,12 @@ function AiTreeRenderer({
|
|
|
10566
10391
|
...fillHeight ? { display: "grid" } : {}
|
|
10567
10392
|
},
|
|
10568
10393
|
children: [
|
|
10569
|
-
/* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
|
|
10570
|
-
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10571
10394
|
isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
10395
|
+
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10572
10396
|
/* @__PURE__ */ jsx(
|
|
10573
10397
|
"div",
|
|
10574
10398
|
{
|
|
10575
|
-
"data-ai-
|
|
10399
|
+
"data-ai-container": "",
|
|
10576
10400
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
10577
10401
|
style: {
|
|
10578
10402
|
position: "relative",
|
|
@@ -10589,7 +10413,7 @@ function AiTreeRenderer({
|
|
|
10589
10413
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
|
|
10590
10414
|
"div",
|
|
10591
10415
|
{
|
|
10592
|
-
"data-ai-
|
|
10416
|
+
"data-ai-row": "",
|
|
10593
10417
|
style: {
|
|
10594
10418
|
display: "grid",
|
|
10595
10419
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11251,10 +11075,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11251
11075
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11252
11076
|
continue;
|
|
11253
11077
|
}
|
|
11078
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
11254
11079
|
let container = existing?.container;
|
|
11255
|
-
let isNewMount = false;
|
|
11256
11080
|
if (!container || !container.isConnected) {
|
|
11257
|
-
isNewMount = true;
|
|
11258
11081
|
existing?.root.unmount();
|
|
11259
11082
|
container?.remove();
|
|
11260
11083
|
container = document.createElement("div");
|
|
@@ -11592,34 +11415,6 @@ function minSpanForFooterBlock(type) {
|
|
|
11592
11415
|
return 3;
|
|
11593
11416
|
}
|
|
11594
11417
|
}
|
|
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
|
-
}
|
|
11623
11418
|
function collectBrandBlocks(tree) {
|
|
11624
11419
|
const brand = [];
|
|
11625
11420
|
for (const col of tree.columns) {
|
|
@@ -11865,7 +11660,6 @@ function textOf2(el) {
|
|
|
11865
11660
|
}
|
|
11866
11661
|
function syncFooterTreeLinksFromDom(tree) {
|
|
11867
11662
|
const next = cloneTree(tree);
|
|
11868
|
-
syncSocialRowsFromDom(next);
|
|
11869
11663
|
const domCols = listFooterColumns().map((col) => {
|
|
11870
11664
|
const heading = getFooterColumnHeadingEl(col);
|
|
11871
11665
|
const title = heading ? textOf2(heading) : void 0;
|
|
@@ -17570,7 +17364,7 @@ function apiBase() {
|
|
|
17570
17364
|
function bridgeVersion() {
|
|
17571
17365
|
try {
|
|
17572
17366
|
if (true) {
|
|
17573
|
-
return "0.1.
|
|
17367
|
+
return "0.1.165";
|
|
17574
17368
|
}
|
|
17575
17369
|
} catch {
|
|
17576
17370
|
}
|
|
@@ -17584,7 +17378,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17584
17378
|
return;
|
|
17585
17379
|
}
|
|
17586
17380
|
try {
|
|
17587
|
-
const v = true ? "0.1.
|
|
17381
|
+
const v = true ? "0.1.165" : "";
|
|
17588
17382
|
if (v) {
|
|
17589
17383
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17590
17384
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -18262,7 +18056,6 @@ function MediaOverlay({
|
|
|
18262
18056
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
18263
18057
|
);
|
|
18264
18058
|
}, [isVideo]);
|
|
18265
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
18266
18059
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
18267
18060
|
const box = {
|
|
18268
18061
|
position: "fixed",
|
|
@@ -18361,10 +18154,11 @@ function MediaOverlay({
|
|
|
18361
18154
|
className: "flex items-center justify-center cursor-pointer",
|
|
18362
18155
|
style: {
|
|
18363
18156
|
...box,
|
|
18364
|
-
//
|
|
18365
|
-
//
|
|
18366
|
-
//
|
|
18367
|
-
|
|
18157
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
18158
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
18159
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
18160
|
+
// Replace still works.
|
|
18161
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
18368
18162
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
18369
18163
|
// than hovered. Hover keeps the existing tinted preview.
|
|
18370
18164
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -18391,17 +18185,17 @@ function MediaOverlay({
|
|
|
18391
18185
|
},
|
|
18392
18186
|
children: [
|
|
18393
18187
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18394
|
-
|
|
18188
|
+
isVideo ? "Replace video" : "Replace image"
|
|
18395
18189
|
]
|
|
18396
18190
|
}
|
|
18397
18191
|
),
|
|
18398
|
-
|
|
18192
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ jsxs8(
|
|
18399
18193
|
Button,
|
|
18400
18194
|
{
|
|
18401
18195
|
"data-ohw-media-overlay": "",
|
|
18402
18196
|
variant: "outline",
|
|
18403
18197
|
size: "sm",
|
|
18404
|
-
"aria-label":
|
|
18198
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
18405
18199
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
18406
18200
|
style: {
|
|
18407
18201
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -18424,7 +18218,7 @@ function MediaOverlay({
|
|
|
18424
18218
|
},
|
|
18425
18219
|
children: [
|
|
18426
18220
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18427
|
-
replaceMode === "full" ?
|
|
18221
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
18428
18222
|
]
|
|
18429
18223
|
}
|
|
18430
18224
|
)
|
|
@@ -19017,24 +18811,8 @@ function AiSectionOverlay({
|
|
|
19017
18811
|
}
|
|
19018
18812
|
|
|
19019
18813
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19020
|
-
import { useCallback as useCallback3, useEffect as useEffect8,
|
|
19021
|
-
import {
|
|
19022
|
-
AlignCenter,
|
|
19023
|
-
AlignLeft,
|
|
19024
|
-
AlignRight,
|
|
19025
|
-
ArrowLeft as ArrowLeft2,
|
|
19026
|
-
ArrowRight as ArrowRight2,
|
|
19027
|
-
Check as Check2,
|
|
19028
|
-
ChevronDown as ChevronDown3,
|
|
19029
|
-
Image as ImageIcon2,
|
|
19030
|
-
ImageMinus,
|
|
19031
|
-
ImagePlus,
|
|
19032
|
-
Link as LinkIcon,
|
|
19033
|
-
Minus,
|
|
19034
|
-
Palette,
|
|
19035
|
-
Plus as Plus2,
|
|
19036
|
-
Star
|
|
19037
|
-
} from "lucide-react";
|
|
18814
|
+
import { useCallback as useCallback3, useEffect as useEffect8, useRef as useRef5, useState as useState8 } from "react";
|
|
18815
|
+
import { Star } from "lucide-react";
|
|
19038
18816
|
|
|
19039
18817
|
// src/lib/ai-media-strip-tree.ts
|
|
19040
18818
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19148,6 +18926,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19148
18926
|
return true;
|
|
19149
18927
|
});
|
|
19150
18928
|
}
|
|
18929
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
18930
|
+
return withMediaStrip(tree, (block) => {
|
|
18931
|
+
const items = block.items;
|
|
18932
|
+
if (index < 0 || index >= items.length) return false;
|
|
18933
|
+
items[index] = { ...items[index], alt };
|
|
18934
|
+
return true;
|
|
18935
|
+
});
|
|
18936
|
+
}
|
|
19151
18937
|
function setMediaStripItemLink(tree, index, link) {
|
|
19152
18938
|
return withMediaStrip(tree, (block) => {
|
|
19153
18939
|
const items = block.items;
|
|
@@ -19165,117 +18951,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19165
18951
|
});
|
|
19166
18952
|
}
|
|
19167
18953
|
|
|
19168
|
-
// src/ui/dialog.tsx
|
|
19169
|
-
import * as React9 from "react";
|
|
19170
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
19171
|
-
import { X as X2 } from "lucide-react";
|
|
19172
|
-
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
19173
|
-
function Dialog2({
|
|
19174
|
-
...props
|
|
19175
|
-
}) {
|
|
19176
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
19177
|
-
}
|
|
19178
|
-
function DialogPortal({
|
|
19179
|
-
...props
|
|
19180
|
-
}) {
|
|
19181
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
|
|
19182
|
-
}
|
|
19183
|
-
function DialogOverlay({
|
|
19184
|
-
className,
|
|
19185
|
-
...props
|
|
19186
|
-
}) {
|
|
19187
|
-
return /* @__PURE__ */ jsx20(
|
|
19188
|
-
DialogPrimitive.Overlay,
|
|
19189
|
-
{
|
|
19190
|
-
"data-slot": "dialog-overlay",
|
|
19191
|
-
"data-ohw-link-modal-root": "",
|
|
19192
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19193
|
-
...props
|
|
19194
|
-
}
|
|
19195
|
-
);
|
|
19196
|
-
}
|
|
19197
|
-
var DialogContent = React9.forwardRef(
|
|
19198
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19199
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
19200
|
-
return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
|
|
19201
|
-
/* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19202
|
-
/* @__PURE__ */ jsxs11(
|
|
19203
|
-
DialogPrimitive.Content,
|
|
19204
|
-
{
|
|
19205
|
-
ref,
|
|
19206
|
-
"data-slot": "dialog-content",
|
|
19207
|
-
className: cn(
|
|
19208
|
-
positionMode,
|
|
19209
|
-
"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",
|
|
19210
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19211
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19212
|
-
className
|
|
19213
|
-
),
|
|
19214
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
19215
|
-
...props,
|
|
19216
|
-
children: [
|
|
19217
|
-
children,
|
|
19218
|
-
showCloseButton ? /* @__PURE__ */ jsx20(
|
|
19219
|
-
DialogPrimitive.Close,
|
|
19220
|
-
{
|
|
19221
|
-
type: "button",
|
|
19222
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19223
|
-
"aria-label": "Close",
|
|
19224
|
-
children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
|
|
19225
|
-
}
|
|
19226
|
-
) : null
|
|
19227
|
-
]
|
|
19228
|
-
}
|
|
19229
|
-
)
|
|
19230
|
-
] });
|
|
19231
|
-
}
|
|
19232
|
-
);
|
|
19233
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
19234
|
-
function DialogHeader({
|
|
19235
|
-
className,
|
|
19236
|
-
...props
|
|
19237
|
-
}) {
|
|
19238
|
-
return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19239
|
-
}
|
|
19240
|
-
function DialogFooter({
|
|
19241
|
-
className,
|
|
19242
|
-
...props
|
|
19243
|
-
}) {
|
|
19244
|
-
return /* @__PURE__ */ jsx20(
|
|
19245
|
-
"div",
|
|
19246
|
-
{
|
|
19247
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
19248
|
-
...props
|
|
19249
|
-
}
|
|
19250
|
-
);
|
|
19251
|
-
}
|
|
19252
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19253
|
-
DialogPrimitive.Title,
|
|
19254
|
-
{
|
|
19255
|
-
ref,
|
|
19256
|
-
className: cn(
|
|
19257
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19258
|
-
className
|
|
19259
|
-
),
|
|
19260
|
-
...props
|
|
19261
|
-
}
|
|
19262
|
-
));
|
|
19263
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
19264
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19265
|
-
DialogPrimitive.Description,
|
|
19266
|
-
{
|
|
19267
|
-
ref,
|
|
19268
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
19269
|
-
...props
|
|
19270
|
-
}
|
|
19271
|
-
));
|
|
19272
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
19273
|
-
var DialogClose = DialogPrimitive.Close;
|
|
19274
|
-
|
|
19275
18954
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19276
|
-
import { Fragment as Fragment7, jsx as
|
|
19277
|
-
var PRIMARY3 = "
|
|
19278
|
-
var
|
|
18955
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
18956
|
+
var PRIMARY3 = "#0885FE";
|
|
18957
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
18958
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19279
18959
|
function findMediaStripItemElement(sectionId, index) {
|
|
19280
18960
|
const sectionEl = findByInstanceId(sectionId);
|
|
19281
18961
|
if (!sectionEl) return null;
|
|
@@ -19285,35 +18965,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
19285
18965
|
}
|
|
19286
18966
|
return null;
|
|
19287
18967
|
}
|
|
19288
|
-
function
|
|
19289
|
-
|
|
19290
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19291
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19292
|
-
if (!itemEl) return null;
|
|
19293
|
-
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19294
|
-
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19295
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19296
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19297
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
19298
|
-
return { sectionId, index };
|
|
19299
|
-
}
|
|
19300
|
-
function sameRef(a, b) {
|
|
19301
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19302
|
-
}
|
|
19303
|
-
function rectOf(el) {
|
|
18968
|
+
function readRect2(ref) {
|
|
18969
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19304
18970
|
if (!el) return null;
|
|
19305
18971
|
const r2 = el.getBoundingClientRect();
|
|
19306
18972
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19307
18973
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19308
18974
|
}
|
|
19309
|
-
function
|
|
19310
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19311
|
-
}
|
|
19312
|
-
function readStripRect(ref) {
|
|
19313
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19314
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19315
|
-
}
|
|
19316
|
-
function useLiveItemRect(ref, strip = false) {
|
|
18975
|
+
function useLiveItemRect(ref) {
|
|
19317
18976
|
const [rect, setRect] = useState8(null);
|
|
19318
18977
|
useEffect8(() => {
|
|
19319
18978
|
if (!ref) {
|
|
@@ -19321,7 +18980,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19321
18980
|
return;
|
|
19322
18981
|
}
|
|
19323
18982
|
const update = () => {
|
|
19324
|
-
const next =
|
|
18983
|
+
const next = readRect2(ref);
|
|
19325
18984
|
setRect(
|
|
19326
18985
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19327
18986
|
);
|
|
@@ -19336,49 +18995,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19336
18995
|
window.removeEventListener("resize", update);
|
|
19337
18996
|
clearInterval(interval);
|
|
19338
18997
|
};
|
|
19339
|
-
}, [ref?.sectionId, ref?.index
|
|
18998
|
+
}, [ref?.sectionId, ref?.index]);
|
|
19340
18999
|
return rect;
|
|
19341
19000
|
}
|
|
19342
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
19343
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19344
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19345
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
19346
|
-
const slotRef = useRef5(null);
|
|
19347
|
-
const [shift, setShift] = useState8(0);
|
|
19348
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
19349
|
-
useLayoutEffect4(() => {
|
|
19350
|
-
const slot = slotRef.current;
|
|
19351
|
-
if (!slot) return;
|
|
19352
|
-
const clamp = () => {
|
|
19353
|
-
const w = slot.offsetWidth;
|
|
19354
|
-
if (w <= 0) return;
|
|
19355
|
-
const half = w / 2;
|
|
19356
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19357
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19358
|
-
};
|
|
19359
|
-
clamp();
|
|
19360
|
-
const ro = new ResizeObserver(clamp);
|
|
19361
|
-
ro.observe(slot);
|
|
19362
|
-
return () => ro.disconnect();
|
|
19363
|
-
}, [centerX, children]);
|
|
19364
|
-
const mobile = window.innerWidth <= 480;
|
|
19365
|
-
return /* @__PURE__ */ jsx21(
|
|
19366
|
-
"div",
|
|
19367
|
-
{
|
|
19368
|
-
ref: slotRef,
|
|
19369
|
-
"data-ohw-bridge": "",
|
|
19370
|
-
"data-ohw-item-interaction": "",
|
|
19371
|
-
className: "pointer-events-auto fixed",
|
|
19372
|
-
style: {
|
|
19373
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19374
|
-
left: centerX + shift,
|
|
19375
|
-
transform: "translate(-50%, -100%)",
|
|
19376
|
-
zIndex: 2147483645
|
|
19377
|
-
},
|
|
19378
|
-
children
|
|
19379
|
-
}
|
|
19380
|
-
);
|
|
19381
|
-
}
|
|
19382
19001
|
function requestValidateTree(postToParent2, tree) {
|
|
19383
19002
|
return new Promise((resolve) => {
|
|
19384
19003
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19415,72 +19034,116 @@ function requestAssetPick(postToParent2) {
|
|
|
19415
19034
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19416
19035
|
});
|
|
19417
19036
|
}
|
|
19418
|
-
function
|
|
19037
|
+
function Pill({
|
|
19419
19038
|
label,
|
|
19420
19039
|
onClick,
|
|
19421
|
-
disabled
|
|
19422
|
-
active
|
|
19423
|
-
children
|
|
19040
|
+
disabled,
|
|
19041
|
+
active
|
|
19424
19042
|
}) {
|
|
19425
|
-
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19043
|
+
return /* @__PURE__ */ jsx20(
|
|
19044
|
+
"button",
|
|
19045
|
+
{
|
|
19046
|
+
type: "button",
|
|
19047
|
+
onClick,
|
|
19048
|
+
disabled,
|
|
19049
|
+
style: {
|
|
19050
|
+
height: 28,
|
|
19051
|
+
padding: "0 10px",
|
|
19052
|
+
display: "inline-flex",
|
|
19053
|
+
alignItems: "center",
|
|
19054
|
+
gap: 4,
|
|
19055
|
+
borderRadius: 999,
|
|
19056
|
+
border: "none",
|
|
19057
|
+
cursor: disabled ? "default" : "pointer",
|
|
19058
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19059
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19060
|
+
opacity: disabled ? 0.4 : 1,
|
|
19061
|
+
fontSize: 12,
|
|
19062
|
+
lineHeight: "16px",
|
|
19063
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19064
|
+
whiteSpace: "nowrap",
|
|
19065
|
+
flex: "0 0 auto"
|
|
19066
|
+
},
|
|
19067
|
+
children: label
|
|
19068
|
+
}
|
|
19069
|
+
);
|
|
19433
19070
|
}
|
|
19434
|
-
function
|
|
19435
|
-
|
|
19436
|
-
value,
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
"
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
) }),
|
|
19456
|
-
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
19457
|
-
const selected = option.value === value;
|
|
19458
|
-
return /* @__PURE__ */ jsxs12(
|
|
19459
|
-
DropdownMenuItem,
|
|
19071
|
+
function AltInput({ value, onCommit }) {
|
|
19072
|
+
const [draft, setDraft] = useState8(value);
|
|
19073
|
+
useEffect8(() => setDraft(value), [value]);
|
|
19074
|
+
return /* @__PURE__ */ jsxs11(
|
|
19075
|
+
"div",
|
|
19076
|
+
{
|
|
19077
|
+
style: {
|
|
19078
|
+
display: "flex",
|
|
19079
|
+
alignItems: "center",
|
|
19080
|
+
gap: 6,
|
|
19081
|
+
height: 28,
|
|
19082
|
+
padding: "0 12px",
|
|
19083
|
+
borderRadius: 999,
|
|
19084
|
+
background: "#ffffff",
|
|
19085
|
+
width: "100%",
|
|
19086
|
+
maxWidth: 260,
|
|
19087
|
+
boxSizing: "border-box"
|
|
19088
|
+
},
|
|
19089
|
+
children: [
|
|
19090
|
+
/* @__PURE__ */ jsx20(
|
|
19091
|
+
"span",
|
|
19460
19092
|
{
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
)
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19093
|
+
style: {
|
|
19094
|
+
flex: "0 0 auto",
|
|
19095
|
+
color: OHW_BLUE_DARK,
|
|
19096
|
+
fontSize: 10,
|
|
19097
|
+
fontWeight: 700,
|
|
19098
|
+
textTransform: "uppercase",
|
|
19099
|
+
letterSpacing: 0.4
|
|
19100
|
+
},
|
|
19101
|
+
children: "Alt"
|
|
19102
|
+
}
|
|
19103
|
+
),
|
|
19104
|
+
/* @__PURE__ */ jsx20(
|
|
19105
|
+
"input",
|
|
19106
|
+
{
|
|
19107
|
+
type: "text",
|
|
19108
|
+
value: draft,
|
|
19109
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19110
|
+
onBlur: () => {
|
|
19111
|
+
if (draft !== value) onCommit(draft);
|
|
19112
|
+
},
|
|
19113
|
+
onKeyDown: (e) => {
|
|
19114
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19115
|
+
if (e.key === "Escape") {
|
|
19116
|
+
setDraft(value);
|
|
19117
|
+
e.currentTarget.blur();
|
|
19118
|
+
}
|
|
19119
|
+
},
|
|
19120
|
+
placeholder: "Describe this image",
|
|
19121
|
+
"aria-label": "Image alt text",
|
|
19122
|
+
style: {
|
|
19123
|
+
flex: 1,
|
|
19124
|
+
minWidth: 0,
|
|
19125
|
+
border: "none",
|
|
19126
|
+
outline: "none",
|
|
19127
|
+
background: "transparent",
|
|
19128
|
+
fontSize: 12,
|
|
19129
|
+
lineHeight: "16px",
|
|
19130
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19131
|
+
color: "#1f2937"
|
|
19132
|
+
}
|
|
19133
|
+
}
|
|
19134
|
+
)
|
|
19135
|
+
]
|
|
19136
|
+
}
|
|
19137
|
+
);
|
|
19475
19138
|
}
|
|
19476
19139
|
var VARIANTS = [
|
|
19477
19140
|
{ value: "logos", label: "Logos" },
|
|
19478
19141
|
{ value: "reel", label: "Reel" }
|
|
19479
19142
|
];
|
|
19480
19143
|
var ALIGNS = [
|
|
19481
|
-
{ value: "left", label: "
|
|
19482
|
-
{ value: "center", label: "
|
|
19483
|
-
{ value: "right", label: "
|
|
19144
|
+
{ value: "left", label: "Left" },
|
|
19145
|
+
{ value: "center", label: "Center" },
|
|
19146
|
+
{ value: "right", label: "Right" }
|
|
19484
19147
|
];
|
|
19485
19148
|
var HOVERS = [
|
|
19486
19149
|
{ value: "none", label: "None" },
|
|
@@ -19488,104 +19151,104 @@ var HOVERS = [
|
|
|
19488
19151
|
{ value: "zoom", label: "Zoom" },
|
|
19489
19152
|
{ value: "fade", label: "Fade" }
|
|
19490
19153
|
];
|
|
19154
|
+
var TREATMENTS = [
|
|
19155
|
+
{ value: "color", label: "Color" },
|
|
19156
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
19157
|
+
];
|
|
19491
19158
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
19492
|
-
function
|
|
19493
|
-
|
|
19494
|
-
linkTarget,
|
|
19495
|
-
onClose,
|
|
19496
|
-
onSave
|
|
19497
|
-
}) {
|
|
19498
|
-
const [draft, setDraft] = useState8(href);
|
|
19499
|
-
const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
|
|
19159
|
+
function LinkInput({ value, onCommit }) {
|
|
19160
|
+
const [draft, setDraft] = useState8(value);
|
|
19500
19161
|
const [invalid, setInvalid] = useState8(false);
|
|
19501
|
-
|
|
19162
|
+
useEffect8(() => {
|
|
19163
|
+
setDraft(value);
|
|
19164
|
+
setInvalid(false);
|
|
19165
|
+
}, [value]);
|
|
19166
|
+
const commit2 = () => {
|
|
19502
19167
|
const next = draft.trim();
|
|
19503
|
-
if (next
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
19508
|
-
onClose();
|
|
19168
|
+
if (next === value) return setInvalid(false);
|
|
19169
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
19170
|
+
setInvalid(false);
|
|
19171
|
+
onCommit(next);
|
|
19509
19172
|
};
|
|
19510
|
-
return /* @__PURE__ */
|
|
19511
|
-
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
"
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
"
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
|
|
19544
|
-
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19553
|
-
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19173
|
+
return /* @__PURE__ */ jsxs11(
|
|
19174
|
+
"div",
|
|
19175
|
+
{
|
|
19176
|
+
style: {
|
|
19177
|
+
display: "flex",
|
|
19178
|
+
alignItems: "center",
|
|
19179
|
+
gap: 6,
|
|
19180
|
+
height: 28,
|
|
19181
|
+
padding: "0 12px",
|
|
19182
|
+
borderRadius: 999,
|
|
19183
|
+
background: "#ffffff",
|
|
19184
|
+
width: "100%",
|
|
19185
|
+
maxWidth: 260,
|
|
19186
|
+
boxSizing: "border-box",
|
|
19187
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19188
|
+
},
|
|
19189
|
+
children: [
|
|
19190
|
+
/* @__PURE__ */ jsx20(
|
|
19191
|
+
"span",
|
|
19192
|
+
{
|
|
19193
|
+
style: {
|
|
19194
|
+
flex: "0 0 auto",
|
|
19195
|
+
color: OHW_BLUE_DARK,
|
|
19196
|
+
fontSize: 10,
|
|
19197
|
+
fontWeight: 700,
|
|
19198
|
+
textTransform: "uppercase",
|
|
19199
|
+
letterSpacing: 0.4
|
|
19200
|
+
},
|
|
19201
|
+
children: "Link"
|
|
19202
|
+
}
|
|
19203
|
+
),
|
|
19204
|
+
/* @__PURE__ */ jsx20(
|
|
19205
|
+
"input",
|
|
19206
|
+
{
|
|
19207
|
+
type: "text",
|
|
19208
|
+
inputMode: "url",
|
|
19209
|
+
value: draft,
|
|
19210
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19211
|
+
onBlur: commit2,
|
|
19212
|
+
onKeyDown: (e) => {
|
|
19213
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19214
|
+
if (e.key === "Escape") {
|
|
19215
|
+
setDraft(value);
|
|
19216
|
+
setInvalid(false);
|
|
19217
|
+
e.currentTarget.blur();
|
|
19218
|
+
}
|
|
19219
|
+
},
|
|
19220
|
+
placeholder: "https://example.com",
|
|
19221
|
+
"aria-label": "Image link URL",
|
|
19222
|
+
"aria-invalid": invalid,
|
|
19223
|
+
style: {
|
|
19224
|
+
flex: 1,
|
|
19225
|
+
minWidth: 0,
|
|
19226
|
+
border: "none",
|
|
19227
|
+
outline: "none",
|
|
19228
|
+
background: "transparent",
|
|
19229
|
+
fontSize: 12,
|
|
19230
|
+
lineHeight: "16px",
|
|
19231
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19232
|
+
color: "#1f2937"
|
|
19233
|
+
}
|
|
19234
|
+
}
|
|
19235
|
+
)
|
|
19236
|
+
]
|
|
19237
|
+
}
|
|
19238
|
+
);
|
|
19575
19239
|
}
|
|
19576
19240
|
function MediaStripToolbar({
|
|
19577
19241
|
entry,
|
|
19578
19242
|
index,
|
|
19579
19243
|
pending,
|
|
19580
19244
|
error,
|
|
19581
|
-
itemEditOn,
|
|
19582
|
-
onToggleItemEdit,
|
|
19583
19245
|
onSetVariant,
|
|
19584
19246
|
onSetAlign,
|
|
19585
19247
|
onSetHover,
|
|
19586
19248
|
onSetTreatment,
|
|
19587
19249
|
onResize,
|
|
19588
|
-
|
|
19250
|
+
onSetAlt,
|
|
19251
|
+
onSetLink,
|
|
19589
19252
|
onAddItem,
|
|
19590
19253
|
onRemoveItem,
|
|
19591
19254
|
onChangeImage,
|
|
@@ -19594,102 +19257,81 @@ function MediaStripToolbar({
|
|
|
19594
19257
|
}) {
|
|
19595
19258
|
const items = mediaStripItems(entry.tree);
|
|
19596
19259
|
const itemCount = items.length;
|
|
19260
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
19261
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
19262
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19597
19263
|
const slots = findMediaStripSlots(entry.tree);
|
|
19598
19264
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19599
19265
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
19600
19266
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
19601
19267
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
19602
19268
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19603
|
-
const
|
|
19604
|
-
const
|
|
19605
|
-
|
|
19269
|
+
const isMobile = window.innerWidth <= 480;
|
|
19270
|
+
const rowStyle = isMobile ? {
|
|
19271
|
+
display: "flex",
|
|
19272
|
+
gap: 6,
|
|
19273
|
+
flexWrap: "nowrap",
|
|
19274
|
+
justifyContent: "center",
|
|
19275
|
+
overflowX: "auto",
|
|
19276
|
+
WebkitOverflowScrolling: "touch",
|
|
19277
|
+
width: "100%",
|
|
19278
|
+
scrollbarWidth: "none"
|
|
19279
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19280
|
+
return /* @__PURE__ */ jsxs11(
|
|
19606
19281
|
"div",
|
|
19607
19282
|
{
|
|
19608
19283
|
"data-ohw-bridge": "",
|
|
19609
19284
|
"data-ohw-toolbar": "",
|
|
19610
19285
|
onMouseDown: (e) => e.stopPropagation(),
|
|
19611
|
-
|
|
19612
|
-
|
|
19286
|
+
style: {
|
|
19287
|
+
display: "flex",
|
|
19288
|
+
flexDirection: "column",
|
|
19289
|
+
gap: 6,
|
|
19290
|
+
alignItems: "center",
|
|
19291
|
+
background: OHW_BLUE,
|
|
19292
|
+
padding: 8,
|
|
19293
|
+
borderRadius: 12,
|
|
19294
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19295
|
+
pointerEvents: pending ? "none" : "auto",
|
|
19296
|
+
opacity: pending ? 0.6 : 1,
|
|
19297
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19298
|
+
},
|
|
19613
19299
|
children: [
|
|
19614
|
-
/* @__PURE__ */
|
|
19615
|
-
|
|
19616
|
-
{
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
|
|
19634
|
-
|
|
19635
|
-
|
|
19636
|
-
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
) }),
|
|
19647
|
-
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
19648
|
-
] }),
|
|
19649
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19650
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19651
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19652
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19653
|
-
/* @__PURE__ */ jsx21(
|
|
19654
|
-
ToolbarAction,
|
|
19655
|
-
{
|
|
19656
|
-
label: gatedLabel("Move right"),
|
|
19657
|
-
onClick: onMoveRight,
|
|
19658
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
19659
|
-
children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
|
|
19660
|
-
}
|
|
19661
|
-
),
|
|
19662
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19663
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19664
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
19665
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
19666
|
-
/* @__PURE__ */ jsx21(
|
|
19667
|
-
ToolbarAction,
|
|
19668
|
-
{
|
|
19669
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
19670
|
-
active: treatment === "grayscale",
|
|
19671
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
19672
|
-
children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
19673
|
-
}
|
|
19674
|
-
),
|
|
19675
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19676
|
-
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)),
|
|
19677
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19678
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19679
|
-
/* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
19680
|
-
sizeValue,
|
|
19681
|
-
"px"
|
|
19682
|
-
] }),
|
|
19683
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19684
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19685
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
19686
|
-
]
|
|
19687
|
-
}
|
|
19688
|
-
),
|
|
19689
|
-
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 })
|
|
19300
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19301
|
+
VARIANTS.map((v) => /* @__PURE__ */ jsx20(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
19302
|
+
ALIGNS.map((a) => /* @__PURE__ */ jsx20(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
19303
|
+
] }),
|
|
19304
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19305
|
+
HOVERS.map((h) => /* @__PURE__ */ jsx20(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
19306
|
+
TREATMENTS.map((t) => /* @__PURE__ */ jsx20(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
19307
|
+
] }),
|
|
19308
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
19309
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
19310
|
+
/* @__PURE__ */ jsxs11("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
19311
|
+
sizeValue,
|
|
19312
|
+
"px"
|
|
19313
|
+
] }),
|
|
19314
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+", onClick: () => onResize(8) })
|
|
19315
|
+
] }),
|
|
19316
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
|
|
19317
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
|
|
19318
|
+
currentHref2 && /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19319
|
+
/* @__PURE__ */ jsx20(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
19320
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
19321
|
+
] }),
|
|
19322
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19323
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
19324
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
19325
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
19326
|
+
] }),
|
|
19327
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19328
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
19329
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
19330
|
+
] }),
|
|
19331
|
+
error && /* @__PURE__ */ jsx20("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
19690
19332
|
]
|
|
19691
19333
|
}
|
|
19692
|
-
)
|
|
19334
|
+
);
|
|
19693
19335
|
}
|
|
19694
19336
|
function findMediaStripSlots(tree) {
|
|
19695
19337
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -19708,23 +19350,31 @@ function AiMediaStripOverlay({
|
|
|
19708
19350
|
}) {
|
|
19709
19351
|
const [hover, setHover] = useState8(null);
|
|
19710
19352
|
const [active, setActive] = useState8(null);
|
|
19711
|
-
const [itemEditOn, setItemEditOn] = useState8(false);
|
|
19712
|
-
const [linkOpen, setLinkOpen] = useState8(false);
|
|
19713
19353
|
const [pending, setPending] = useState8(false);
|
|
19714
19354
|
const [error, setError] = useState8(null);
|
|
19715
19355
|
const activeRef = useRef5(null);
|
|
19716
19356
|
activeRef.current = active;
|
|
19717
|
-
const linkOpenRef = useRef5(false);
|
|
19718
|
-
linkOpenRef.current = linkOpen;
|
|
19719
19357
|
useEffect8(() => {
|
|
19720
19358
|
const onMove = (e) => {
|
|
19721
|
-
const ref = itemRefFromTarget(e.target);
|
|
19722
19359
|
const t = e.target;
|
|
19723
|
-
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19360
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19361
|
+
if (t.closest("[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review]")) {
|
|
19362
|
+
return;
|
|
19363
|
+
}
|
|
19364
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
19365
|
+
if (!itemEl) {
|
|
19366
|
+
setHover(null);
|
|
19367
|
+
return;
|
|
19368
|
+
}
|
|
19369
|
+
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19370
|
+
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19371
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19372
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19373
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
19374
|
+
setHover(null);
|
|
19375
|
+
return;
|
|
19376
|
+
}
|
|
19377
|
+
setHover({ sectionId, index });
|
|
19728
19378
|
};
|
|
19729
19379
|
const onLeave = () => setHover(null);
|
|
19730
19380
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -19736,25 +19386,23 @@ function AiMediaStripOverlay({
|
|
|
19736
19386
|
}, []);
|
|
19737
19387
|
useEffect8(() => {
|
|
19738
19388
|
const onClick = (e) => {
|
|
19389
|
+
const current = activeRef.current;
|
|
19390
|
+
if (!current) return;
|
|
19739
19391
|
const t = e.target;
|
|
19740
|
-
if (!(t instanceof
|
|
19741
|
-
if (t.closest(
|
|
19742
|
-
const
|
|
19743
|
-
if (
|
|
19744
|
-
|
|
19745
|
-
setItemEditOn(false);
|
|
19392
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19393
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
19394
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
19395
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
19396
|
+
setActive(null);
|
|
19746
19397
|
setError(null);
|
|
19747
|
-
setActive(ref);
|
|
19748
19398
|
};
|
|
19749
19399
|
document.addEventListener("click", onClick, true);
|
|
19750
19400
|
return () => document.removeEventListener("click", onClick, true);
|
|
19751
|
-
}, [
|
|
19401
|
+
}, []);
|
|
19752
19402
|
useEffect8(() => {
|
|
19753
19403
|
const onBlur = () => {
|
|
19754
19404
|
if (!activeRef.current) return;
|
|
19755
19405
|
setActive(null);
|
|
19756
|
-
setItemEditOn(false);
|
|
19757
|
-
setLinkOpen(false);
|
|
19758
19406
|
setError(null);
|
|
19759
19407
|
};
|
|
19760
19408
|
window.addEventListener("blur", onBlur);
|
|
@@ -19764,10 +19412,7 @@ function AiMediaStripOverlay({
|
|
|
19764
19412
|
const onKeyDown = (e) => {
|
|
19765
19413
|
if (e.key !== "Escape") return;
|
|
19766
19414
|
if (!activeRef.current) return;
|
|
19767
|
-
if (linkOpenRef.current) return;
|
|
19768
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
19769
19415
|
setActive(null);
|
|
19770
|
-
setItemEditOn(false);
|
|
19771
19416
|
setError(null);
|
|
19772
19417
|
};
|
|
19773
19418
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -19801,133 +19446,137 @@ function AiMediaStripOverlay({
|
|
|
19801
19446
|
tree: nextTree,
|
|
19802
19447
|
label: entry.label,
|
|
19803
19448
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
19804
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
19805
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
19806
|
-
// on every edit reads as the section jumping around.
|
|
19807
|
-
skipScrollIntoView: true
|
|
19449
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
19808
19450
|
});
|
|
19809
19451
|
return true;
|
|
19810
19452
|
},
|
|
19811
19453
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
19812
19454
|
);
|
|
19813
19455
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
19456
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
19814
19457
|
const activeItemRect = useLiveItemRect(active);
|
|
19815
|
-
const
|
|
19816
|
-
const
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19458
|
+
const TOOLBAR_APPROX_H = 170;
|
|
19459
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
19460
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
19461
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx20(
|
|
19462
|
+
"button",
|
|
19463
|
+
{
|
|
19464
|
+
type: "button",
|
|
19465
|
+
"data-ohw-toolbar": "",
|
|
19466
|
+
onClick: () => {
|
|
19467
|
+
clearInteractionChromeRef.current();
|
|
19468
|
+
setActive(hover);
|
|
19469
|
+
},
|
|
19470
|
+
"aria-label": "Configure media item",
|
|
19471
|
+
style: {
|
|
19472
|
+
position: "fixed",
|
|
19473
|
+
top: hoverHandleRect.top + 8,
|
|
19474
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
19475
|
+
width: 28,
|
|
19476
|
+
height: 28,
|
|
19477
|
+
borderRadius: 8,
|
|
19478
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
19479
|
+
background: "#ffffff",
|
|
19480
|
+
color: PRIMARY3,
|
|
19481
|
+
display: "flex",
|
|
19482
|
+
alignItems: "center",
|
|
19483
|
+
justifyContent: "center",
|
|
19484
|
+
cursor: "pointer",
|
|
19485
|
+
zIndex: 2147483643,
|
|
19486
|
+
fontSize: 14,
|
|
19487
|
+
fontWeight: 700
|
|
19488
|
+
},
|
|
19489
|
+
children: /* @__PURE__ */ jsx20(Star, { size: 14, style: { pointerEvents: "none" } })
|
|
19490
|
+
}
|
|
19491
|
+
),
|
|
19492
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
|
|
19493
|
+
ItemInteractionLayer,
|
|
19494
|
+
{
|
|
19495
|
+
rect: activeItemRect,
|
|
19496
|
+
state: toolbarState,
|
|
19497
|
+
toolbar: /* @__PURE__ */ jsx20(
|
|
19498
|
+
MediaStripToolbar,
|
|
19499
|
+
{
|
|
19500
|
+
entry: activeEntry,
|
|
19501
|
+
index: active.index,
|
|
19502
|
+
pending,
|
|
19503
|
+
error,
|
|
19504
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19505
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19506
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19507
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19508
|
+
onResize: (delta) => {
|
|
19509
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19510
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19511
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19512
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19513
|
+
},
|
|
19514
|
+
onSetAlt: (alt) => {
|
|
19515
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
19516
|
+
},
|
|
19517
|
+
onSetLink: (href, linkTarget) => {
|
|
19849
19518
|
void runMutation(
|
|
19850
19519
|
active.sectionId,
|
|
19851
|
-
(tree) =>
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19520
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19521
|
+
);
|
|
19522
|
+
},
|
|
19523
|
+
onAddItem: () => {
|
|
19524
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19525
|
+
if (!picked) return;
|
|
19526
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19527
|
+
void runMutation(
|
|
19528
|
+
active.sectionId,
|
|
19529
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19530
|
+
{ [picked.assetId]: picked.url }
|
|
19531
|
+
).then((applied) => {
|
|
19532
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19533
|
+
});
|
|
19855
19534
|
});
|
|
19856
|
-
}
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
19535
|
+
},
|
|
19536
|
+
onChangeImage: () => {
|
|
19537
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19538
|
+
if (!picked) return;
|
|
19539
|
+
void runMutation(
|
|
19540
|
+
active.sectionId,
|
|
19541
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
19542
|
+
{ [picked.assetId]: picked.url }
|
|
19543
|
+
);
|
|
19544
|
+
});
|
|
19545
|
+
},
|
|
19546
|
+
onRemoveItem: () => {
|
|
19547
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19548
|
+
(applied) => {
|
|
19549
|
+
if (applied) setActive(null);
|
|
19550
|
+
}
|
|
19865
19551
|
);
|
|
19866
|
-
}
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
},
|
|
19882
|
-
onMoveRight: () => {
|
|
19883
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19884
|
-
(applied) => {
|
|
19885
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19886
|
-
}
|
|
19887
|
-
);
|
|
19888
|
-
}
|
|
19889
|
-
}
|
|
19890
|
-
) }),
|
|
19891
|
-
/* @__PURE__ */ jsx21(
|
|
19892
|
-
"div",
|
|
19893
|
-
{
|
|
19894
|
-
"data-ohw-bridge": "",
|
|
19895
|
-
"data-ohw-item-interaction": "",
|
|
19896
|
-
"aria-hidden": true,
|
|
19897
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
19898
|
-
style: {
|
|
19899
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
19900
|
-
left: activeItemRect.left - 5,
|
|
19901
|
-
background: PRIMARY3,
|
|
19902
|
-
zIndex: 2147483644
|
|
19903
|
-
},
|
|
19904
|
-
children: "Media item"
|
|
19905
|
-
}
|
|
19906
|
-
),
|
|
19907
|
-
linkOpen && /* @__PURE__ */ jsx21(
|
|
19908
|
-
LinkModal,
|
|
19909
|
-
{
|
|
19910
|
-
href: activeHref,
|
|
19911
|
-
linkTarget: activeTarget,
|
|
19912
|
-
onClose: () => setLinkOpen(false),
|
|
19913
|
-
onSave: (href, linkTarget) => {
|
|
19914
|
-
void runMutation(
|
|
19915
|
-
active.sectionId,
|
|
19916
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19917
|
-
);
|
|
19552
|
+
},
|
|
19553
|
+
onMoveLeft: () => {
|
|
19554
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
19555
|
+
(applied) => {
|
|
19556
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
19557
|
+
}
|
|
19558
|
+
);
|
|
19559
|
+
},
|
|
19560
|
+
onMoveRight: () => {
|
|
19561
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19562
|
+
(applied) => {
|
|
19563
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19564
|
+
}
|
|
19565
|
+
);
|
|
19566
|
+
}
|
|
19918
19567
|
}
|
|
19919
|
-
|
|
19920
|
-
|
|
19921
|
-
|
|
19568
|
+
)
|
|
19569
|
+
}
|
|
19570
|
+
)
|
|
19922
19571
|
] });
|
|
19923
19572
|
}
|
|
19924
19573
|
|
|
19925
19574
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
19926
|
-
import { useCallback as useCallback4, useEffect as useEffect9, useLayoutEffect as
|
|
19927
|
-
import { Check as
|
|
19928
|
-
import { Fragment as Fragment8, jsx as
|
|
19575
|
+
import { useCallback as useCallback4, useEffect as useEffect9, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState9 } from "react";
|
|
19576
|
+
import { Check as Check2, ChevronDown as ChevronDown3, Minus, Plus as Plus2, Star as Star2 } from "lucide-react";
|
|
19577
|
+
import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
19929
19578
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
19930
|
-
var
|
|
19579
|
+
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]";
|
|
19931
19580
|
function findPricingCardElement(sectionId, index) {
|
|
19932
19581
|
const sectionEl = findByInstanceId(sectionId);
|
|
19933
19582
|
if (!sectionEl) return null;
|
|
@@ -19939,7 +19588,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
19939
19588
|
}
|
|
19940
19589
|
function cardRefFromTarget(target) {
|
|
19941
19590
|
if (!(target instanceof Element)) return null;
|
|
19942
|
-
if (target.closest(
|
|
19591
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19943
19592
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
19944
19593
|
if (!cardEl) return null;
|
|
19945
19594
|
const sectionEl = cardEl.closest("[data-ohw-section]");
|
|
@@ -19949,21 +19598,21 @@ function cardRefFromTarget(target) {
|
|
|
19949
19598
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
19950
19599
|
return { sectionId, index };
|
|
19951
19600
|
}
|
|
19952
|
-
function
|
|
19601
|
+
function sameRef(a, b) {
|
|
19953
19602
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19954
19603
|
}
|
|
19955
|
-
function
|
|
19604
|
+
function rectOf(el) {
|
|
19956
19605
|
if (!el) return null;
|
|
19957
19606
|
const r2 = el.getBoundingClientRect();
|
|
19958
19607
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19959
19608
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19960
19609
|
}
|
|
19961
19610
|
function readRect3(ref) {
|
|
19962
|
-
return
|
|
19611
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
19963
19612
|
}
|
|
19964
19613
|
function readGridRect(ref) {
|
|
19965
19614
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
19966
|
-
return
|
|
19615
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
19967
19616
|
}
|
|
19968
19617
|
function useLiveCardRect(ref, grid = false) {
|
|
19969
19618
|
const [rect, setRect] = useState9(null);
|
|
@@ -19993,19 +19642,19 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
19993
19642
|
}
|
|
19994
19643
|
var TOOLBAR_GRID_GAP = 52;
|
|
19995
19644
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
19996
|
-
var
|
|
19645
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19997
19646
|
function GridToolbarSlot({ gridRect, children }) {
|
|
19998
19647
|
const slotRef = useRef6(null);
|
|
19999
19648
|
const [shift, setShift] = useState9(0);
|
|
20000
19649
|
const centerX = gridRect.left + gridRect.width / 2;
|
|
20001
|
-
|
|
19650
|
+
useLayoutEffect4(() => {
|
|
20002
19651
|
const slot = slotRef.current;
|
|
20003
19652
|
if (!slot) return;
|
|
20004
19653
|
const clamp = () => {
|
|
20005
19654
|
const w = slot.offsetWidth;
|
|
20006
19655
|
if (w <= 0) return;
|
|
20007
19656
|
const half = w / 2;
|
|
20008
|
-
const clamped = Math.max(
|
|
19657
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
20009
19658
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
20010
19659
|
};
|
|
20011
19660
|
clamp();
|
|
@@ -20014,7 +19663,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
20014
19663
|
return () => ro.disconnect();
|
|
20015
19664
|
}, [centerX, children]);
|
|
20016
19665
|
const mobile = window.innerWidth <= 480;
|
|
20017
|
-
return /* @__PURE__ */
|
|
19666
|
+
return /* @__PURE__ */ jsx21(
|
|
20018
19667
|
"div",
|
|
20019
19668
|
{
|
|
20020
19669
|
ref: slotRef,
|
|
@@ -20049,7 +19698,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
20049
19698
|
});
|
|
20050
19699
|
}
|
|
20051
19700
|
function StyleSwatch({ style }) {
|
|
20052
|
-
return /* @__PURE__ */
|
|
19701
|
+
return /* @__PURE__ */ jsx21(
|
|
20053
19702
|
"span",
|
|
20054
19703
|
{
|
|
20055
19704
|
"aria-hidden": true,
|
|
@@ -20063,35 +19712,35 @@ function StyleSwatch({ style }) {
|
|
|
20063
19712
|
);
|
|
20064
19713
|
}
|
|
20065
19714
|
function ButtonGlyph() {
|
|
20066
|
-
return /* @__PURE__ */
|
|
20067
|
-
/* @__PURE__ */
|
|
20068
|
-
/* @__PURE__ */
|
|
19715
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
19716
|
+
/* @__PURE__ */ jsx21("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19717
|
+
/* @__PURE__ */ jsx21("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20069
19718
|
] });
|
|
20070
19719
|
}
|
|
20071
19720
|
function FeatureGlyph({ mode }) {
|
|
20072
|
-
return /* @__PURE__ */
|
|
20073
|
-
/* @__PURE__ */
|
|
20074
|
-
/* @__PURE__ */
|
|
20075
|
-
/* @__PURE__ */
|
|
20076
|
-
/* @__PURE__ */
|
|
20077
|
-
/* @__PURE__ */
|
|
20078
|
-
mode === "add" && /* @__PURE__ */
|
|
19721
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
19722
|
+
/* @__PURE__ */ jsx21("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19723
|
+
/* @__PURE__ */ jsx21("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
19724
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
|
|
19725
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
|
|
19726
|
+
/* @__PURE__ */ jsx21("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
19727
|
+
mode === "add" && /* @__PURE__ */ jsx21("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20079
19728
|
] });
|
|
20080
19729
|
}
|
|
20081
|
-
function
|
|
19730
|
+
function ToolbarAction({
|
|
20082
19731
|
label,
|
|
20083
19732
|
onClick,
|
|
20084
19733
|
disabled = false,
|
|
20085
19734
|
children
|
|
20086
19735
|
}) {
|
|
20087
|
-
const button = /* @__PURE__ */
|
|
20088
|
-
return /* @__PURE__ */
|
|
20089
|
-
/* @__PURE__ */
|
|
20090
|
-
/* @__PURE__ */
|
|
19736
|
+
const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
19737
|
+
return /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19738
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
|
|
19739
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
20091
19740
|
] });
|
|
20092
19741
|
}
|
|
20093
|
-
function
|
|
20094
|
-
return /* @__PURE__ */
|
|
19742
|
+
function ToolbarSeparator() {
|
|
19743
|
+
return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
20095
19744
|
}
|
|
20096
19745
|
function CardStyleMenu({
|
|
20097
19746
|
value,
|
|
@@ -20099,7 +19748,7 @@ function CardStyleMenu({
|
|
|
20099
19748
|
disabled = false
|
|
20100
19749
|
}) {
|
|
20101
19750
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
20102
|
-
const trigger = /* @__PURE__ */
|
|
19751
|
+
const trigger = /* @__PURE__ */ jsxs12(
|
|
20103
19752
|
"button",
|
|
20104
19753
|
{
|
|
20105
19754
|
type: "button",
|
|
@@ -20110,28 +19759,28 @@ function CardStyleMenu({
|
|
|
20110
19759
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
20111
19760
|
),
|
|
20112
19761
|
children: [
|
|
20113
|
-
/* @__PURE__ */
|
|
20114
|
-
/* @__PURE__ */
|
|
20115
|
-
/* @__PURE__ */
|
|
19762
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: current.value }),
|
|
19763
|
+
/* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
|
|
19764
|
+
/* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
|
|
20116
19765
|
]
|
|
20117
19766
|
}
|
|
20118
19767
|
);
|
|
20119
19768
|
if (disabled) {
|
|
20120
|
-
return /* @__PURE__ */
|
|
20121
|
-
/* @__PURE__ */
|
|
20122
|
-
/* @__PURE__ */
|
|
20123
|
-
/* @__PURE__ */
|
|
20124
|
-
/* @__PURE__ */
|
|
19769
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
19770
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
19771
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19772
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: trigger }) }),
|
|
19773
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
20125
19774
|
] })
|
|
20126
19775
|
] });
|
|
20127
19776
|
}
|
|
20128
|
-
return /* @__PURE__ */
|
|
20129
|
-
/* @__PURE__ */
|
|
20130
|
-
/* @__PURE__ */
|
|
20131
|
-
/* @__PURE__ */
|
|
20132
|
-
/* @__PURE__ */
|
|
19777
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
19778
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
19779
|
+
/* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
|
|
19780
|
+
/* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
19781
|
+
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
|
|
20133
19782
|
const selected = style.value === value;
|
|
20134
|
-
return /* @__PURE__ */
|
|
19783
|
+
return /* @__PURE__ */ jsxs12(
|
|
20135
19784
|
DropdownMenuItem,
|
|
20136
19785
|
{
|
|
20137
19786
|
role: "menuitemradio",
|
|
@@ -20139,9 +19788,9 @@ function CardStyleMenu({
|
|
|
20139
19788
|
onSelect: () => onChange(style.value),
|
|
20140
19789
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
20141
19790
|
children: [
|
|
20142
|
-
/* @__PURE__ */
|
|
20143
|
-
/* @__PURE__ */
|
|
20144
|
-
selected && /* @__PURE__ */
|
|
19791
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: style.value }),
|
|
19792
|
+
/* @__PURE__ */ jsx21("span", { children: style.label }),
|
|
19793
|
+
selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
|
|
20145
19794
|
]
|
|
20146
19795
|
},
|
|
20147
19796
|
style.value
|
|
@@ -20171,7 +19820,7 @@ function PricingCardToolbar({
|
|
|
20171
19820
|
const style = pricingCardStyle(entry.tree, index);
|
|
20172
19821
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
20173
19822
|
const mobile = window.innerWidth <= 480;
|
|
20174
|
-
return /* @__PURE__ */
|
|
19823
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
|
|
20175
19824
|
"div",
|
|
20176
19825
|
{
|
|
20177
19826
|
"data-ohw-bridge": "",
|
|
@@ -20183,7 +19832,7 @@ function PricingCardToolbar({
|
|
|
20183
19832
|
),
|
|
20184
19833
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
20185
19834
|
children: [
|
|
20186
|
-
/* @__PURE__ */
|
|
19835
|
+
/* @__PURE__ */ jsxs12(
|
|
20187
19836
|
"div",
|
|
20188
19837
|
{
|
|
20189
19838
|
className: cn(
|
|
@@ -20192,8 +19841,8 @@ function PricingCardToolbar({
|
|
|
20192
19841
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
20193
19842
|
),
|
|
20194
19843
|
children: [
|
|
20195
|
-
/* @__PURE__ */
|
|
20196
|
-
/* @__PURE__ */
|
|
19844
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19845
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
20197
19846
|
CustomToolbarButton,
|
|
20198
19847
|
{
|
|
20199
19848
|
type: "button",
|
|
@@ -20201,7 +19850,7 @@ function PricingCardToolbar({
|
|
|
20201
19850
|
"aria-pressed": featuredTag,
|
|
20202
19851
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
20203
19852
|
className: "group size-8",
|
|
20204
|
-
children: /* @__PURE__ */
|
|
19853
|
+
children: /* @__PURE__ */ jsx21(
|
|
20205
19854
|
Star2,
|
|
20206
19855
|
{
|
|
20207
19856
|
size: 16,
|
|
@@ -20216,25 +19865,25 @@ function PricingCardToolbar({
|
|
|
20216
19865
|
)
|
|
20217
19866
|
}
|
|
20218
19867
|
) }),
|
|
20219
|
-
/* @__PURE__ */
|
|
19868
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
20220
19869
|
] }),
|
|
20221
|
-
/* @__PURE__ */
|
|
20222
|
-
/* @__PURE__ */
|
|
20223
|
-
/* @__PURE__ */
|
|
20224
|
-
/* @__PURE__ */
|
|
20225
|
-
/* @__PURE__ */
|
|
20226
|
-
/* @__PURE__ */
|
|
20227
|
-
/* @__PURE__ */
|
|
19870
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19871
|
+
/* @__PURE__ */ jsx21(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
19872
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19873
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx21(ButtonGlyph, {}) }),
|
|
19874
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
|
|
19875
|
+
/* @__PURE__ */ jsx21(ButtonGlyph, {}),
|
|
19876
|
+
/* @__PURE__ */ jsx21(Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
|
|
20228
19877
|
] }) }),
|
|
20229
|
-
/* @__PURE__ */
|
|
20230
|
-
/* @__PURE__ */
|
|
20231
|
-
/* @__PURE__ */
|
|
20232
|
-
/* @__PURE__ */
|
|
20233
|
-
/* @__PURE__ */
|
|
19878
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "add" }) }),
|
|
19879
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "remove" }) }),
|
|
19880
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19881
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19882
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
20234
19883
|
]
|
|
20235
19884
|
}
|
|
20236
19885
|
),
|
|
20237
|
-
error && /* @__PURE__ */
|
|
19886
|
+
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 })
|
|
20238
19887
|
]
|
|
20239
19888
|
}
|
|
20240
19889
|
) });
|
|
@@ -20268,7 +19917,7 @@ function AiPricingCardOverlay({
|
|
|
20268
19917
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20269
19918
|
setHover((prev) => {
|
|
20270
19919
|
const next = ref && !overEditable ? ref : null;
|
|
20271
|
-
return
|
|
19920
|
+
return sameRef(prev, next) ? prev : next;
|
|
20272
19921
|
});
|
|
20273
19922
|
};
|
|
20274
19923
|
const onLeave = () => setHover(null);
|
|
@@ -20283,10 +19932,10 @@ function AiPricingCardOverlay({
|
|
|
20283
19932
|
const onClick = (e) => {
|
|
20284
19933
|
const t = e.target;
|
|
20285
19934
|
if (!(t instanceof Element)) return;
|
|
20286
|
-
if (t.closest(
|
|
19935
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
20287
19936
|
const ref = cardRefFromTarget(t);
|
|
20288
|
-
setActive((prev) =>
|
|
20289
|
-
if (!ref || !
|
|
19937
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
19938
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
20290
19939
|
};
|
|
20291
19940
|
document.addEventListener("click", onClick, true);
|
|
20292
19941
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20351,12 +20000,12 @@ function AiPricingCardOverlay({
|
|
|
20351
20000
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20352
20001
|
const activeCardRect = useLiveCardRect(active);
|
|
20353
20002
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20354
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20355
|
-
return /* @__PURE__ */
|
|
20356
|
-
hoverRect && /* @__PURE__ */
|
|
20357
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */
|
|
20358
|
-
/* @__PURE__ */
|
|
20359
|
-
/* @__PURE__ */
|
|
20003
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
20004
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
20005
|
+
hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
20006
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
20007
|
+
/* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
20008
|
+
/* @__PURE__ */ jsx21(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx21(
|
|
20360
20009
|
PricingCardToolbar,
|
|
20361
20010
|
{
|
|
20362
20011
|
entry: activeEntry,
|
|
@@ -20384,7 +20033,7 @@ function AiPricingCardOverlay({
|
|
|
20384
20033
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20385
20034
|
}
|
|
20386
20035
|
) }),
|
|
20387
|
-
/* @__PURE__ */
|
|
20036
|
+
/* @__PURE__ */ jsx21(
|
|
20388
20037
|
"div",
|
|
20389
20038
|
{
|
|
20390
20039
|
"data-ohw-bridge": "",
|
|
@@ -20448,11 +20097,39 @@ function clearVideo(tree, path) {
|
|
|
20448
20097
|
});
|
|
20449
20098
|
}
|
|
20450
20099
|
|
|
20100
|
+
// src/lib/youtube.ts
|
|
20101
|
+
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
20102
|
+
function extractYouTubeId(input) {
|
|
20103
|
+
const trimmed = input.trim();
|
|
20104
|
+
if (!trimmed) return null;
|
|
20105
|
+
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
20106
|
+
let url;
|
|
20107
|
+
try {
|
|
20108
|
+
url = new URL(trimmed);
|
|
20109
|
+
} catch {
|
|
20110
|
+
return null;
|
|
20111
|
+
}
|
|
20112
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
20113
|
+
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
20114
|
+
return null;
|
|
20115
|
+
}
|
|
20116
|
+
let candidate = null;
|
|
20117
|
+
if (host === "youtu.be") {
|
|
20118
|
+
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
20119
|
+
} else if (url.pathname === "/watch") {
|
|
20120
|
+
candidate = url.searchParams.get("v");
|
|
20121
|
+
} else {
|
|
20122
|
+
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
20123
|
+
candidate = match ? match[1] : null;
|
|
20124
|
+
}
|
|
20125
|
+
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
20126
|
+
}
|
|
20127
|
+
|
|
20451
20128
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20452
|
-
import { Fragment as Fragment9, jsx as
|
|
20129
|
+
import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
20453
20130
|
var PRIMARY5 = "#0885FE";
|
|
20454
|
-
var
|
|
20455
|
-
var
|
|
20131
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20132
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
20456
20133
|
function findVideoBlockElement(sectionId, path) {
|
|
20457
20134
|
const sectionEl = findByInstanceId(sectionId);
|
|
20458
20135
|
if (!sectionEl) return null;
|
|
@@ -20512,12 +20189,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
20512
20189
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
20513
20190
|
});
|
|
20514
20191
|
}
|
|
20515
|
-
function
|
|
20192
|
+
function Pill2({
|
|
20516
20193
|
label,
|
|
20517
20194
|
onClick,
|
|
20518
20195
|
disabled
|
|
20519
20196
|
}) {
|
|
20520
|
-
return /* @__PURE__ */
|
|
20197
|
+
return /* @__PURE__ */ jsx22(
|
|
20521
20198
|
"button",
|
|
20522
20199
|
{
|
|
20523
20200
|
type: "button",
|
|
@@ -20533,7 +20210,7 @@ function Pill({
|
|
|
20533
20210
|
border: "none",
|
|
20534
20211
|
cursor: disabled ? "default" : "pointer",
|
|
20535
20212
|
background: "#ffffff",
|
|
20536
|
-
color:
|
|
20213
|
+
color: OHW_BLUE_DARK2,
|
|
20537
20214
|
opacity: disabled ? 0.4 : 1,
|
|
20538
20215
|
fontSize: 12,
|
|
20539
20216
|
lineHeight: "16px",
|
|
@@ -20576,8 +20253,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20576
20253
|
onCommit(id);
|
|
20577
20254
|
}
|
|
20578
20255
|
};
|
|
20579
|
-
return /* @__PURE__ */
|
|
20580
|
-
/* @__PURE__ */
|
|
20256
|
+
return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20257
|
+
/* @__PURE__ */ jsxs13(
|
|
20581
20258
|
"div",
|
|
20582
20259
|
{
|
|
20583
20260
|
style: {
|
|
@@ -20593,12 +20270,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20593
20270
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20594
20271
|
},
|
|
20595
20272
|
children: [
|
|
20596
|
-
/* @__PURE__ */
|
|
20273
|
+
/* @__PURE__ */ jsx22(
|
|
20597
20274
|
"span",
|
|
20598
20275
|
{
|
|
20599
20276
|
style: {
|
|
20600
20277
|
flex: "0 0 auto",
|
|
20601
|
-
color:
|
|
20278
|
+
color: OHW_BLUE_DARK2,
|
|
20602
20279
|
fontSize: 10,
|
|
20603
20280
|
lineHeight: "16px",
|
|
20604
20281
|
fontWeight: 700,
|
|
@@ -20608,7 +20285,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20608
20285
|
children: "Video"
|
|
20609
20286
|
}
|
|
20610
20287
|
),
|
|
20611
|
-
/* @__PURE__ */
|
|
20288
|
+
/* @__PURE__ */ jsx22(
|
|
20612
20289
|
"input",
|
|
20613
20290
|
{
|
|
20614
20291
|
type: "text",
|
|
@@ -20645,7 +20322,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20645
20322
|
]
|
|
20646
20323
|
}
|
|
20647
20324
|
),
|
|
20648
|
-
invalid && /* @__PURE__ */
|
|
20325
|
+
invalid && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
|
|
20649
20326
|
] });
|
|
20650
20327
|
}
|
|
20651
20328
|
function VideoToolbar({
|
|
@@ -20655,7 +20332,7 @@ function VideoToolbar({
|
|
|
20655
20332
|
onSetVideoId,
|
|
20656
20333
|
onRemove
|
|
20657
20334
|
}) {
|
|
20658
|
-
return /* @__PURE__ */
|
|
20335
|
+
return /* @__PURE__ */ jsxs13(
|
|
20659
20336
|
"div",
|
|
20660
20337
|
{
|
|
20661
20338
|
"data-ohw-bridge": "",
|
|
@@ -20667,7 +20344,7 @@ function VideoToolbar({
|
|
|
20667
20344
|
gap: 6,
|
|
20668
20345
|
alignItems: "center",
|
|
20669
20346
|
width: 280,
|
|
20670
|
-
background:
|
|
20347
|
+
background: OHW_BLUE2,
|
|
20671
20348
|
padding: 8,
|
|
20672
20349
|
borderRadius: 12,
|
|
20673
20350
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20675,9 +20352,9 @@ function VideoToolbar({
|
|
|
20675
20352
|
opacity: pending ? 0.6 : 1
|
|
20676
20353
|
},
|
|
20677
20354
|
children: [
|
|
20678
|
-
/* @__PURE__ */
|
|
20679
|
-
/* @__PURE__ */
|
|
20680
|
-
error && /* @__PURE__ */
|
|
20355
|
+
/* @__PURE__ */ jsx22(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
20356
|
+
/* @__PURE__ */ jsx22(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
20357
|
+
error && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20681
20358
|
]
|
|
20682
20359
|
}
|
|
20683
20360
|
);
|
|
@@ -20797,8 +20474,8 @@ function AiVideoOverlay({
|
|
|
20797
20474
|
const activeBlockRect = useLiveBlockRect(active);
|
|
20798
20475
|
const TOOLBAR_APPROX_H = 90;
|
|
20799
20476
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
20800
|
-
return /* @__PURE__ */
|
|
20801
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
20477
|
+
return /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
20478
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx22(
|
|
20802
20479
|
"button",
|
|
20803
20480
|
{
|
|
20804
20481
|
type: "button",
|
|
@@ -20826,15 +20503,15 @@ function AiVideoOverlay({
|
|
|
20826
20503
|
fontSize: 14,
|
|
20827
20504
|
fontWeight: 700
|
|
20828
20505
|
},
|
|
20829
|
-
children: /* @__PURE__ */
|
|
20506
|
+
children: /* @__PURE__ */ jsx22(Star3, { size: 14, style: { pointerEvents: "none" } })
|
|
20830
20507
|
}
|
|
20831
20508
|
),
|
|
20832
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */
|
|
20509
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx22(
|
|
20833
20510
|
ItemInteractionLayer,
|
|
20834
20511
|
{
|
|
20835
20512
|
rect: activeBlockRect,
|
|
20836
20513
|
state: toolbarState,
|
|
20837
|
-
toolbar: /* @__PURE__ */
|
|
20514
|
+
toolbar: /* @__PURE__ */ jsx22(
|
|
20838
20515
|
VideoToolbar,
|
|
20839
20516
|
{
|
|
20840
20517
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -20909,10 +20586,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
20909
20586
|
}
|
|
20910
20587
|
|
|
20911
20588
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
20912
|
-
import { Fragment as Fragment10, jsx as
|
|
20589
|
+
import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
20913
20590
|
var PRIMARY6 = "#0885FE";
|
|
20914
|
-
var
|
|
20915
|
-
var
|
|
20591
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
20592
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
20916
20593
|
function findCarouselItemElement(sectionId, index) {
|
|
20917
20594
|
const sectionEl = findByInstanceId(sectionId);
|
|
20918
20595
|
if (!sectionEl) return null;
|
|
@@ -20991,8 +20668,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
20991
20668
|
postToParent2({ type: "ow:asset-pick", id });
|
|
20992
20669
|
});
|
|
20993
20670
|
}
|
|
20994
|
-
function
|
|
20995
|
-
return /* @__PURE__ */
|
|
20671
|
+
function Pill3({ label, onClick, disabled }) {
|
|
20672
|
+
return /* @__PURE__ */ jsx23(
|
|
20996
20673
|
"button",
|
|
20997
20674
|
{
|
|
20998
20675
|
type: "button",
|
|
@@ -21008,7 +20685,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
21008
20685
|
border: "none",
|
|
21009
20686
|
cursor: disabled ? "default" : "pointer",
|
|
21010
20687
|
background: "#ffffff",
|
|
21011
|
-
color:
|
|
20688
|
+
color: OHW_BLUE_DARK3,
|
|
21012
20689
|
opacity: disabled ? 0.4 : 1,
|
|
21013
20690
|
fontSize: 12,
|
|
21014
20691
|
lineHeight: "16px",
|
|
@@ -21026,7 +20703,7 @@ function TogglePill({
|
|
|
21026
20703
|
onToggle,
|
|
21027
20704
|
disabled
|
|
21028
20705
|
}) {
|
|
21029
|
-
return /* @__PURE__ */
|
|
20706
|
+
return /* @__PURE__ */ jsxs14(
|
|
21030
20707
|
"button",
|
|
21031
20708
|
{
|
|
21032
20709
|
type: "button",
|
|
@@ -21045,7 +20722,7 @@ function TogglePill({
|
|
|
21045
20722
|
border: "none",
|
|
21046
20723
|
cursor: disabled ? "default" : "pointer",
|
|
21047
20724
|
background: "#ffffff",
|
|
21048
|
-
color:
|
|
20725
|
+
color: OHW_BLUE_DARK3,
|
|
21049
20726
|
opacity: disabled ? 0.4 : 1,
|
|
21050
20727
|
fontSize: 12,
|
|
21051
20728
|
lineHeight: "16px",
|
|
@@ -21055,7 +20732,7 @@ function TogglePill({
|
|
|
21055
20732
|
},
|
|
21056
20733
|
children: [
|
|
21057
20734
|
label,
|
|
21058
|
-
/* @__PURE__ */
|
|
20735
|
+
/* @__PURE__ */ jsx23(
|
|
21059
20736
|
"span",
|
|
21060
20737
|
{
|
|
21061
20738
|
"aria-hidden": true,
|
|
@@ -21068,10 +20745,10 @@ function TogglePill({
|
|
|
21068
20745
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
21069
20746
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
21070
20747
|
// "disabled control" rather than "switch that is off".
|
|
21071
|
-
background: on ?
|
|
20748
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
21072
20749
|
transition: "background 120ms ease"
|
|
21073
20750
|
},
|
|
21074
|
-
children: /* @__PURE__ */
|
|
20751
|
+
children: /* @__PURE__ */ jsx23(
|
|
21075
20752
|
"span",
|
|
21076
20753
|
{
|
|
21077
20754
|
style: {
|
|
@@ -21100,7 +20777,7 @@ function CarouselSlideToolbar({
|
|
|
21100
20777
|
onChangeImage,
|
|
21101
20778
|
onToggleAutoplay
|
|
21102
20779
|
}) {
|
|
21103
|
-
return /* @__PURE__ */
|
|
20780
|
+
return /* @__PURE__ */ jsxs14(
|
|
21104
20781
|
"div",
|
|
21105
20782
|
{
|
|
21106
20783
|
"data-ohw-bridge": "",
|
|
@@ -21111,7 +20788,7 @@ function CarouselSlideToolbar({
|
|
|
21111
20788
|
flexDirection: "column",
|
|
21112
20789
|
gap: 6,
|
|
21113
20790
|
alignItems: "center",
|
|
21114
|
-
background:
|
|
20791
|
+
background: OHW_BLUE3,
|
|
21115
20792
|
padding: 8,
|
|
21116
20793
|
borderRadius: 12,
|
|
21117
20794
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21123,11 +20800,11 @@ function CarouselSlideToolbar({
|
|
|
21123
20800
|
pointerEvents: pending ? "none" : "auto"
|
|
21124
20801
|
},
|
|
21125
20802
|
children: [
|
|
21126
|
-
/* @__PURE__ */
|
|
21127
|
-
/* @__PURE__ */
|
|
21128
|
-
/* @__PURE__ */
|
|
20803
|
+
/* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
20804
|
+
/* @__PURE__ */ jsx23(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
20805
|
+
/* @__PURE__ */ jsx23(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
21129
20806
|
] }),
|
|
21130
|
-
error && /* @__PURE__ */
|
|
20807
|
+
error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21131
20808
|
]
|
|
21132
20809
|
}
|
|
21133
20810
|
);
|
|
@@ -21267,8 +20944,8 @@ function AiFadeCarouselOverlay({
|
|
|
21267
20944
|
const activeItemRect = useLiveItemRect2(active);
|
|
21268
20945
|
const TOOLBAR_APPROX_H = 90;
|
|
21269
20946
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21270
|
-
return /* @__PURE__ */
|
|
21271
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
20947
|
+
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
20948
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx23(
|
|
21272
20949
|
"button",
|
|
21273
20950
|
{
|
|
21274
20951
|
type: "button",
|
|
@@ -21297,10 +20974,10 @@ function AiFadeCarouselOverlay({
|
|
|
21297
20974
|
fontSize: 14,
|
|
21298
20975
|
fontWeight: 700
|
|
21299
20976
|
},
|
|
21300
|
-
children: /* @__PURE__ */
|
|
20977
|
+
children: /* @__PURE__ */ jsx23(Star4, { size: 14, style: { pointerEvents: "none" } })
|
|
21301
20978
|
}
|
|
21302
20979
|
),
|
|
21303
|
-
swapping && /* @__PURE__ */
|
|
20980
|
+
swapping && /* @__PURE__ */ jsx23(
|
|
21304
20981
|
"div",
|
|
21305
20982
|
{
|
|
21306
20983
|
ref: skeletonRef,
|
|
@@ -21318,15 +20995,15 @@ function AiFadeCarouselOverlay({
|
|
|
21318
20995
|
zIndex: 2147483646,
|
|
21319
20996
|
pointerEvents: "none"
|
|
21320
20997
|
},
|
|
21321
|
-
children: /* @__PURE__ */
|
|
20998
|
+
children: /* @__PURE__ */ jsx23("style", { children: MEDIA_SKELETON_CSS })
|
|
21322
20999
|
}
|
|
21323
21000
|
),
|
|
21324
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */
|
|
21001
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx23(
|
|
21325
21002
|
ItemInteractionLayer,
|
|
21326
21003
|
{
|
|
21327
21004
|
rect: activeItemRect,
|
|
21328
21005
|
state: toolbarState,
|
|
21329
|
-
toolbar: /* @__PURE__ */
|
|
21006
|
+
toolbar: /* @__PURE__ */ jsx23(
|
|
21330
21007
|
CarouselSlideToolbar,
|
|
21331
21008
|
{
|
|
21332
21009
|
pending,
|
|
@@ -21517,11 +21194,118 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
21517
21194
|
// src/ui/link-modal/LinkPopover.tsx
|
|
21518
21195
|
import { useEffect as useEffect15 } from "react";
|
|
21519
21196
|
|
|
21197
|
+
// src/ui/dialog.tsx
|
|
21198
|
+
import * as React9 from "react";
|
|
21199
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
21200
|
+
import { X as X2 } from "lucide-react";
|
|
21201
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
21202
|
+
function Dialog2({
|
|
21203
|
+
...props
|
|
21204
|
+
}) {
|
|
21205
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
21206
|
+
}
|
|
21207
|
+
function DialogPortal({
|
|
21208
|
+
...props
|
|
21209
|
+
}) {
|
|
21210
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
|
|
21211
|
+
}
|
|
21212
|
+
function DialogOverlay({
|
|
21213
|
+
className,
|
|
21214
|
+
...props
|
|
21215
|
+
}) {
|
|
21216
|
+
return /* @__PURE__ */ jsx24(
|
|
21217
|
+
DialogPrimitive.Overlay,
|
|
21218
|
+
{
|
|
21219
|
+
"data-slot": "dialog-overlay",
|
|
21220
|
+
"data-ohw-link-modal-root": "",
|
|
21221
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21222
|
+
...props
|
|
21223
|
+
}
|
|
21224
|
+
);
|
|
21225
|
+
}
|
|
21226
|
+
var DialogContent = React9.forwardRef(
|
|
21227
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21228
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
21229
|
+
return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
|
|
21230
|
+
/* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21231
|
+
/* @__PURE__ */ jsxs15(
|
|
21232
|
+
DialogPrimitive.Content,
|
|
21233
|
+
{
|
|
21234
|
+
ref,
|
|
21235
|
+
"data-slot": "dialog-content",
|
|
21236
|
+
className: cn(
|
|
21237
|
+
positionMode,
|
|
21238
|
+
"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",
|
|
21239
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21240
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21241
|
+
className
|
|
21242
|
+
),
|
|
21243
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
21244
|
+
...props,
|
|
21245
|
+
children: [
|
|
21246
|
+
children,
|
|
21247
|
+
showCloseButton ? /* @__PURE__ */ jsx24(
|
|
21248
|
+
DialogPrimitive.Close,
|
|
21249
|
+
{
|
|
21250
|
+
type: "button",
|
|
21251
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21252
|
+
"aria-label": "Close",
|
|
21253
|
+
children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
|
|
21254
|
+
}
|
|
21255
|
+
) : null
|
|
21256
|
+
]
|
|
21257
|
+
}
|
|
21258
|
+
)
|
|
21259
|
+
] });
|
|
21260
|
+
}
|
|
21261
|
+
);
|
|
21262
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
21263
|
+
function DialogHeader({
|
|
21264
|
+
className,
|
|
21265
|
+
...props
|
|
21266
|
+
}) {
|
|
21267
|
+
return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21268
|
+
}
|
|
21269
|
+
function DialogFooter({
|
|
21270
|
+
className,
|
|
21271
|
+
...props
|
|
21272
|
+
}) {
|
|
21273
|
+
return /* @__PURE__ */ jsx24(
|
|
21274
|
+
"div",
|
|
21275
|
+
{
|
|
21276
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
21277
|
+
...props
|
|
21278
|
+
}
|
|
21279
|
+
);
|
|
21280
|
+
}
|
|
21281
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21282
|
+
DialogPrimitive.Title,
|
|
21283
|
+
{
|
|
21284
|
+
ref,
|
|
21285
|
+
className: cn(
|
|
21286
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21287
|
+
className
|
|
21288
|
+
),
|
|
21289
|
+
...props
|
|
21290
|
+
}
|
|
21291
|
+
));
|
|
21292
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
21293
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21294
|
+
DialogPrimitive.Description,
|
|
21295
|
+
{
|
|
21296
|
+
ref,
|
|
21297
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
21298
|
+
...props
|
|
21299
|
+
}
|
|
21300
|
+
));
|
|
21301
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
21302
|
+
var DialogClose = DialogPrimitive.Close;
|
|
21303
|
+
|
|
21520
21304
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
21521
21305
|
import { Info, X as X4 } from "lucide-react";
|
|
21522
21306
|
|
|
21523
21307
|
// src/ui/link-modal/DestinationBreadcrumb.tsx
|
|
21524
|
-
import { ArrowRight as
|
|
21308
|
+
import { ArrowRight as ArrowRight2, File, GalleryVertical } from "lucide-react";
|
|
21525
21309
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
21526
21310
|
function DestinationBreadcrumb({
|
|
21527
21311
|
pageTitle,
|
|
@@ -21535,7 +21319,7 @@ function DestinationBreadcrumb({
|
|
|
21535
21319
|
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
|
|
21536
21320
|
] }),
|
|
21537
21321
|
/* @__PURE__ */ jsx25(
|
|
21538
|
-
|
|
21322
|
+
ArrowRight2,
|
|
21539
21323
|
{
|
|
21540
21324
|
size: 16,
|
|
21541
21325
|
className: "shrink-0 text-muted-foreground",
|
|
@@ -21647,7 +21431,7 @@ function Label({ className, ...props }) {
|
|
|
21647
21431
|
}
|
|
21648
21432
|
|
|
21649
21433
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
21650
|
-
import { ChevronDown as
|
|
21434
|
+
import { ChevronDown as ChevronDown4, File as File2, X as X3 } from "lucide-react";
|
|
21651
21435
|
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
21652
21436
|
function FieldChevron({
|
|
21653
21437
|
onClick
|
|
@@ -21660,7 +21444,7 @@ function FieldChevron({
|
|
|
21660
21444
|
onClick,
|
|
21661
21445
|
"aria-label": "Open page list",
|
|
21662
21446
|
tabIndex: -1,
|
|
21663
|
-
children: /* @__PURE__ */ jsx29(
|
|
21447
|
+
children: /* @__PURE__ */ jsx29(ChevronDown4, { size: 16 })
|
|
21664
21448
|
}
|
|
21665
21449
|
);
|
|
21666
21450
|
}
|
|
@@ -21890,7 +21674,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
21890
21674
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
21891
21675
|
import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
|
|
21892
21676
|
import { createPortal as createPortal2 } from "react-dom";
|
|
21893
|
-
import { ArrowLeft as
|
|
21677
|
+
import { ArrowLeft as ArrowLeft2, Check as Check3 } from "lucide-react";
|
|
21894
21678
|
import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
|
|
21895
21679
|
|
|
21896
21680
|
// src/lib/parent-scroll.ts
|
|
@@ -22167,7 +21951,7 @@ function SectionPickerOverlay({
|
|
|
22167
21951
|
className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
|
|
22168
21952
|
onClick: onBack,
|
|
22169
21953
|
children: [
|
|
22170
|
-
/* @__PURE__ */ jsx31(
|
|
21954
|
+
/* @__PURE__ */ jsx31(ArrowLeft2, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
22171
21955
|
"Back"
|
|
22172
21956
|
]
|
|
22173
21957
|
}
|
|
@@ -22236,7 +22020,7 @@ function SectionPickerOverlay({
|
|
|
22236
22020
|
className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
|
|
22237
22021
|
style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
|
|
22238
22022
|
"aria-hidden": true,
|
|
22239
|
-
children: /* @__PURE__ */ jsx31(
|
|
22023
|
+
children: /* @__PURE__ */ jsx31(Check3, { className: "size-5" })
|
|
22240
22024
|
}
|
|
22241
22025
|
) : null
|
|
22242
22026
|
]
|
|
@@ -22620,7 +22404,6 @@ function shouldUseDevFixtures() {
|
|
|
22620
22404
|
function getLogoElement(el) {
|
|
22621
22405
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
22622
22406
|
if (marked) return marked;
|
|
22623
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
22624
22407
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
22625
22408
|
if (!root) return null;
|
|
22626
22409
|
const anchor = el.closest("a");
|
|
@@ -22690,7 +22473,7 @@ function addFooterColumnWithPersist({
|
|
|
22690
22473
|
import {
|
|
22691
22474
|
useCallback as useCallback9,
|
|
22692
22475
|
useEffect as useEffect16,
|
|
22693
|
-
useLayoutEffect as
|
|
22476
|
+
useLayoutEffect as useLayoutEffect5,
|
|
22694
22477
|
useRef as useRef11,
|
|
22695
22478
|
useState as useState15
|
|
22696
22479
|
} from "react";
|
|
@@ -22787,7 +22570,7 @@ function FloatingPanel({
|
|
|
22787
22570
|
return () => window.removeEventListener("message", onParentScroll);
|
|
22788
22571
|
}, [open]);
|
|
22789
22572
|
const positionRef = useRef11(position);
|
|
22790
|
-
|
|
22573
|
+
useLayoutEffect5(() => {
|
|
22791
22574
|
if (!open) {
|
|
22792
22575
|
positionRef.current = position;
|
|
22793
22576
|
return;
|
|
@@ -22797,7 +22580,7 @@ function FloatingPanel({
|
|
|
22797
22580
|
}
|
|
22798
22581
|
positionRef.current = position;
|
|
22799
22582
|
}, [open, position, liveScroll, parentScroll]);
|
|
22800
|
-
|
|
22583
|
+
useLayoutEffect5(() => {
|
|
22801
22584
|
if (!open || !panelRef.current) return;
|
|
22802
22585
|
const el = panelRef.current;
|
|
22803
22586
|
const header = el.querySelector("[data-ohw-floating-panel-header]");
|
|
@@ -23006,7 +22789,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
|
|
|
23006
22789
|
}
|
|
23007
22790
|
|
|
23008
22791
|
// src/ui/button-style-panel.tsx
|
|
23009
|
-
import { Check as
|
|
22792
|
+
import { Check as Check4 } from "lucide-react";
|
|
23010
22793
|
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
23011
22794
|
var SIZE_LABEL = { s: "S", m: "M", l: "L" };
|
|
23012
22795
|
function ButtonStylePanel({
|
|
@@ -23077,7 +22860,7 @@ function ButtonStylePanel({
|
|
|
23077
22860
|
{
|
|
23078
22861
|
className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
|
|
23079
22862
|
"aria-hidden": true,
|
|
23080
|
-
children: /* @__PURE__ */ jsx35(
|
|
22863
|
+
children: /* @__PURE__ */ jsx35(Check4, { className: "size-3", strokeWidth: 3 })
|
|
23081
22864
|
}
|
|
23082
22865
|
) : null
|
|
23083
22866
|
]
|
|
@@ -24102,7 +23885,7 @@ function useSectionDrag({
|
|
|
24102
23885
|
}
|
|
24103
23886
|
|
|
24104
23887
|
// src/ui/footer-container-chrome.tsx
|
|
24105
|
-
import { Plus as
|
|
23888
|
+
import { Plus as Plus3 } from "lucide-react";
|
|
24106
23889
|
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
24107
23890
|
function FooterContainerChrome({
|
|
24108
23891
|
rect,
|
|
@@ -24143,7 +23926,7 @@ function FooterContainerChrome({
|
|
|
24143
23926
|
if (addDisabled) return;
|
|
24144
23927
|
onAdd();
|
|
24145
23928
|
},
|
|
24146
|
-
children: /* @__PURE__ */ jsx36(
|
|
23929
|
+
children: /* @__PURE__ */ jsx36(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24147
23930
|
}
|
|
24148
23931
|
) }),
|
|
24149
23932
|
/* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
@@ -24550,7 +24333,7 @@ function retargetPageLinks(change, deps) {
|
|
|
24550
24333
|
}
|
|
24551
24334
|
|
|
24552
24335
|
// src/ui/navbar-container-chrome.tsx
|
|
24553
|
-
import { Plus as
|
|
24336
|
+
import { Plus as Plus4 } from "lucide-react";
|
|
24554
24337
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
24555
24338
|
function NavbarContainerChrome({
|
|
24556
24339
|
rect,
|
|
@@ -24586,7 +24369,7 @@ function NavbarContainerChrome({
|
|
|
24586
24369
|
e.stopPropagation();
|
|
24587
24370
|
onAdd();
|
|
24588
24371
|
},
|
|
24589
|
-
children: /* @__PURE__ */ jsx37(
|
|
24372
|
+
children: /* @__PURE__ */ jsx37(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24590
24373
|
}
|
|
24591
24374
|
)
|
|
24592
24375
|
}
|
|
@@ -24658,7 +24441,7 @@ function Badge({ className, variant, ...props }) {
|
|
|
24658
24441
|
}
|
|
24659
24442
|
|
|
24660
24443
|
// src/OhhwellsBridge.tsx
|
|
24661
|
-
import { Brush as Brush2, Link as Link2, Plus as
|
|
24444
|
+
import { Brush as Brush2, Link as Link2, Plus as Plus5, Settings } from "lucide-react";
|
|
24662
24445
|
import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
24663
24446
|
var PRIMARY7 = "#0885FE";
|
|
24664
24447
|
var IMAGE_FADE_MS = 300;
|
|
@@ -25436,7 +25219,7 @@ function getNavigationSelectionParent(el) {
|
|
|
25436
25219
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
25437
25220
|
return resolveFooterLinksContainerFrom(el);
|
|
25438
25221
|
}
|
|
25439
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
25222
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
25440
25223
|
return getNavigationRoot(el);
|
|
25441
25224
|
}
|
|
25442
25225
|
return null;
|
|
@@ -25658,6 +25441,7 @@ var ICONS = {
|
|
|
25658
25441
|
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"/>',
|
|
25659
25442
|
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"/>'
|
|
25660
25443
|
};
|
|
25444
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
25661
25445
|
var SELECTION_CHROME_GAP2 = 4;
|
|
25662
25446
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
25663
25447
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -25755,7 +25539,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
25755
25539
|
el.style.top = `${top}px`;
|
|
25756
25540
|
el.style.height = `${height}px`;
|
|
25757
25541
|
}
|
|
25758
|
-
var
|
|
25542
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
25759
25543
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
25760
25544
|
const isAbove = transform.includes("translateY(-100%)");
|
|
25761
25545
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -25782,8 +25566,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
25782
25566
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
25783
25567
|
const half = toolbarWidth / 2;
|
|
25784
25568
|
return Math.max(
|
|
25785
|
-
|
|
25786
|
-
Math.min(centerX, window.innerWidth -
|
|
25569
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
25570
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
25787
25571
|
);
|
|
25788
25572
|
}
|
|
25789
25573
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26184,7 +25968,7 @@ function OhhwellsBridge() {
|
|
|
26184
25968
|
}, []);
|
|
26185
25969
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
26186
25970
|
const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
|
|
26187
|
-
|
|
25971
|
+
useLayoutEffect6(() => {
|
|
26188
25972
|
const next = resolveSubdomain(subdomainFromQuery);
|
|
26189
25973
|
if (next !== subdomain) setSubdomain(next);
|
|
26190
25974
|
if (next) return;
|
|
@@ -26665,6 +26449,21 @@ function OhhwellsBridge() {
|
|
|
26665
26449
|
const [isItemDragging, setIsItemDragging] = useState18(false);
|
|
26666
26450
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
|
|
26667
26451
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26452
|
+
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
26453
|
+
const floatingPanelOpenRef = useRef14(false);
|
|
26454
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
26455
|
+
const floatingPanelRef = useRef14(null);
|
|
26456
|
+
floatingPanelRef.current = floatingPanel;
|
|
26457
|
+
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
26458
|
+
const buttonCollectionDragRef = useRef14(null);
|
|
26459
|
+
const buttonDropInsertIndexRef = useRef14(null);
|
|
26460
|
+
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
26461
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
26462
|
+
const buttonPointerDragRef = useRef14(null);
|
|
26463
|
+
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
26464
|
+
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
26465
|
+
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
26466
|
+
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
26668
26467
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
|
|
26669
26468
|
const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
|
|
26670
26469
|
const footerDragRef = useRef14(null);
|
|
@@ -26691,21 +26490,6 @@ function OhhwellsBridge() {
|
|
|
26691
26490
|
const stylesRef = useRef14("");
|
|
26692
26491
|
const appliedDrawerRef = useRef14(null);
|
|
26693
26492
|
const pendingDeleteUndoRef = useRef14(null);
|
|
26694
|
-
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
26695
|
-
const floatingPanelOpenRef = useRef14(false);
|
|
26696
|
-
const floatingPanelRef = useRef14(null);
|
|
26697
|
-
floatingPanelRef.current = floatingPanel;
|
|
26698
|
-
const setFloatingPanelRef = useRef14(setFloatingPanel);
|
|
26699
|
-
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
26700
|
-
const buttonCollectionDragRef = useRef14(null);
|
|
26701
|
-
const buttonDropInsertIndexRef = useRef14(null);
|
|
26702
|
-
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
26703
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
26704
|
-
const buttonPointerDragRef = useRef14(null);
|
|
26705
|
-
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
26706
|
-
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
26707
|
-
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
26708
|
-
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
26709
26493
|
const [sitePages, setSitePages] = useState18([]);
|
|
26710
26494
|
const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
|
|
26711
26495
|
const [sectionsByPath, setSectionsByPath] = useState18({});
|
|
@@ -26715,18 +26499,7 @@ function OhhwellsBridge() {
|
|
|
26715
26499
|
const linkPopoverOpenRef = useRef14(false);
|
|
26716
26500
|
const linkPopoverGraceUntilRef = useRef14(0);
|
|
26717
26501
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26718
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
26719
26502
|
linkPopoverSessionRef.current = linkPopover;
|
|
26720
|
-
floatingPanelOpenRef.current = Boolean(floatingPanel);
|
|
26721
|
-
useEffect20(() => {
|
|
26722
|
-
const syncViewport = () => {
|
|
26723
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26724
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
26725
|
-
};
|
|
26726
|
-
syncViewport();
|
|
26727
|
-
window.addEventListener("resize", syncViewport);
|
|
26728
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
26729
|
-
}, []);
|
|
26730
26503
|
useEffect20(() => {
|
|
26731
26504
|
setSectionOrderPersistHandler((entries) => {
|
|
26732
26505
|
const currentPath = window.location.pathname;
|
|
@@ -28433,7 +28206,7 @@ function OhhwellsBridge() {
|
|
|
28433
28206
|
isFooterFrameSelection,
|
|
28434
28207
|
postToParent2
|
|
28435
28208
|
]);
|
|
28436
|
-
|
|
28209
|
+
useLayoutEffect6(() => {
|
|
28437
28210
|
if (!subdomain || isEditMode) {
|
|
28438
28211
|
setFetchState("done");
|
|
28439
28212
|
return;
|
|
@@ -28460,7 +28233,6 @@ function OhhwellsBridge() {
|
|
|
28460
28233
|
applyAiFooterFromContent(content);
|
|
28461
28234
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28462
28235
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
28463
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28464
28236
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28465
28237
|
}
|
|
28466
28238
|
applyBrandChrome(content);
|
|
@@ -28471,16 +28243,15 @@ function OhhwellsBridge() {
|
|
|
28471
28243
|
if (key === "__ohw_sections") continue;
|
|
28472
28244
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28473
28245
|
if (key === AI_FOOTER_KEY) continue;
|
|
28474
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28475
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28476
28246
|
if (key === BRAND_KIT_KEY) continue;
|
|
28477
28247
|
if (key === STYLE_STORE_KEY) continue;
|
|
28478
28248
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28249
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28479
28250
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28251
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28480
28252
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28481
28253
|
continue;
|
|
28482
28254
|
}
|
|
28483
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28484
28255
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28485
28256
|
if (applyCarouselNode(key, val)) continue;
|
|
28486
28257
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28520,7 +28291,6 @@ function OhhwellsBridge() {
|
|
|
28520
28291
|
});
|
|
28521
28292
|
applyLinkByKey(key, val);
|
|
28522
28293
|
}
|
|
28523
|
-
applySectionEmbeds(content);
|
|
28524
28294
|
applyLogoFromContent(content);
|
|
28525
28295
|
applyLogoSizes(content);
|
|
28526
28296
|
reconcileNavbarItemsFromContent(content);
|
|
@@ -28709,22 +28479,20 @@ function OhhwellsBridge() {
|
|
|
28709
28479
|
}
|
|
28710
28480
|
applyAiFooterFromContent(content);
|
|
28711
28481
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28712
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28713
28482
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28714
28483
|
}
|
|
28715
28484
|
for (const [key, val] of Object.entries(content)) {
|
|
28716
28485
|
if (key === "__ohw_sections") continue;
|
|
28717
28486
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28718
28487
|
if (key === AI_FOOTER_KEY) continue;
|
|
28719
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28720
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28721
28488
|
if (key === BRAND_KIT_KEY) continue;
|
|
28722
28489
|
if (key === STYLE_STORE_KEY) continue;
|
|
28723
28490
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28491
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28492
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28724
28493
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28725
28494
|
continue;
|
|
28726
28495
|
}
|
|
28727
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28728
28496
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28729
28497
|
if (applyCarouselNode(key, val)) continue;
|
|
28730
28498
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28749,7 +28517,6 @@ function OhhwellsBridge() {
|
|
|
28749
28517
|
});
|
|
28750
28518
|
applyLinkByKey(key, val);
|
|
28751
28519
|
}
|
|
28752
|
-
applySectionEmbeds(content);
|
|
28753
28520
|
applyLogoFromContent(content);
|
|
28754
28521
|
reconcileNavbarItemsFromContent(content);
|
|
28755
28522
|
reconcileFooterOrderFromContent(content);
|
|
@@ -28805,7 +28572,7 @@ function OhhwellsBridge() {
|
|
|
28805
28572
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
28806
28573
|
};
|
|
28807
28574
|
}, [subdomain, isEditMode, pathname]);
|
|
28808
|
-
|
|
28575
|
+
useLayoutEffect6(() => {
|
|
28809
28576
|
const el = document.getElementById("ohw-loader");
|
|
28810
28577
|
if (!el) return;
|
|
28811
28578
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
@@ -28989,11 +28756,26 @@ function OhhwellsBridge() {
|
|
|
28989
28756
|
const t2 = setTimeout(measure, 500);
|
|
28990
28757
|
const ro = new ResizeObserver(schedule);
|
|
28991
28758
|
ro.observe(document.body);
|
|
28759
|
+
let lastWidth = window.innerWidth;
|
|
28760
|
+
let resizeTimers = [];
|
|
28761
|
+
const clearResizeTimers = () => {
|
|
28762
|
+
resizeTimers.forEach(clearTimeout);
|
|
28763
|
+
resizeTimers = [];
|
|
28764
|
+
};
|
|
28765
|
+
const handleResize = () => {
|
|
28766
|
+
if (window.innerWidth === lastWidth) return;
|
|
28767
|
+
lastWidth = window.innerWidth;
|
|
28768
|
+
clearResizeTimers();
|
|
28769
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
28770
|
+
};
|
|
28771
|
+
window.addEventListener("resize", handleResize);
|
|
28992
28772
|
return () => {
|
|
28993
28773
|
clearTimeout(t1);
|
|
28994
28774
|
clearTimeout(t2);
|
|
28995
28775
|
if (raf != null) cancelAnimationFrame(raf);
|
|
28996
28776
|
ro.disconnect();
|
|
28777
|
+
clearResizeTimers();
|
|
28778
|
+
window.removeEventListener("resize", handleResize);
|
|
28997
28779
|
};
|
|
28998
28780
|
}, [pathname, isEditMode, postToParent2]);
|
|
28999
28781
|
useEffect20(() => {
|
|
@@ -29290,13 +29072,6 @@ function OhhwellsBridge() {
|
|
|
29290
29072
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29291
29073
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29292
29074
|
if (isInsideLinkEditor(target)) return;
|
|
29293
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29294
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29295
|
-
if (target.closest(
|
|
29296
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29297
|
-
)) {
|
|
29298
|
-
return;
|
|
29299
|
-
}
|
|
29300
29075
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29301
29076
|
clearMediaSelectionRef.current();
|
|
29302
29077
|
}
|
|
@@ -29320,6 +29095,8 @@ function OhhwellsBridge() {
|
|
|
29320
29095
|
return;
|
|
29321
29096
|
}
|
|
29322
29097
|
}
|
|
29098
|
+
if (isInsideFloatingPanel(target)) return;
|
|
29099
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29323
29100
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29324
29101
|
if (collectionItem) {
|
|
29325
29102
|
e.preventDefault();
|
|
@@ -29331,6 +29108,11 @@ function OhhwellsBridge() {
|
|
|
29331
29108
|
});
|
|
29332
29109
|
return;
|
|
29333
29110
|
}
|
|
29111
|
+
if (target.closest(
|
|
29112
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29113
|
+
)) {
|
|
29114
|
+
return;
|
|
29115
|
+
}
|
|
29334
29116
|
{
|
|
29335
29117
|
const formEl = getFormElement(target);
|
|
29336
29118
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -29484,13 +29266,9 @@ function OhhwellsBridge() {
|
|
|
29484
29266
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
29485
29267
|
e.preventDefault();
|
|
29486
29268
|
e.stopPropagation();
|
|
29269
|
+
selectIconElementRef.current(editable);
|
|
29487
29270
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
29488
29271
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
29489
|
-
if (aiIcon) {
|
|
29490
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
29491
|
-
} else {
|
|
29492
|
-
selectIconElementRef.current(editable);
|
|
29493
|
-
}
|
|
29494
29272
|
postToParentRef.current({
|
|
29495
29273
|
type: "ow:icon-pick",
|
|
29496
29274
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -29718,9 +29496,6 @@ function OhhwellsBridge() {
|
|
|
29718
29496
|
setHoveredItemRect(null);
|
|
29719
29497
|
hoveredNavContainerRef.current = null;
|
|
29720
29498
|
setHoveredNavContainerRect(null);
|
|
29721
|
-
siblingHintElRef.current = null;
|
|
29722
|
-
setSiblingHintRect(null);
|
|
29723
|
-
setSiblingHintRects([]);
|
|
29724
29499
|
return;
|
|
29725
29500
|
}
|
|
29726
29501
|
{
|
|
@@ -29841,6 +29616,7 @@ function OhhwellsBridge() {
|
|
|
29841
29616
|
hoveredNavContainerRef.current = null;
|
|
29842
29617
|
setHoveredNavContainerRect(null);
|
|
29843
29618
|
hoveredItemElRef.current = editable;
|
|
29619
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
29844
29620
|
}
|
|
29845
29621
|
}
|
|
29846
29622
|
}
|
|
@@ -30550,11 +30326,7 @@ function OhhwellsBridge() {
|
|
|
30550
30326
|
};
|
|
30551
30327
|
const handleMouseMove = (e) => {
|
|
30552
30328
|
const { clientX, clientY } = e;
|
|
30553
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30554
|
-
dismissImageHover();
|
|
30555
|
-
clearImageHover();
|
|
30556
|
-
return;
|
|
30557
|
-
}
|
|
30329
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30558
30330
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
30559
30331
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
30560
30332
|
formHoverElRef.current = null;
|
|
@@ -30583,12 +30355,7 @@ function OhhwellsBridge() {
|
|
|
30583
30355
|
setHoveredItemRect(null);
|
|
30584
30356
|
hoveredNavContainerRef.current = null;
|
|
30585
30357
|
setHoveredNavContainerRect(null);
|
|
30586
|
-
siblingHintElRef.current = null;
|
|
30587
|
-
setSiblingHintRect(null);
|
|
30588
|
-
setSiblingHintRects([]);
|
|
30589
30358
|
dismissImageHover();
|
|
30590
|
-
clearImageHover();
|
|
30591
|
-
setSectionGap(null);
|
|
30592
30359
|
return;
|
|
30593
30360
|
}
|
|
30594
30361
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -30600,11 +30367,7 @@ function OhhwellsBridge() {
|
|
|
30600
30367
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
30601
30368
|
const { clientX, clientY } = e.data;
|
|
30602
30369
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
30603
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30604
|
-
dismissImageHover();
|
|
30605
|
-
clearImageHover();
|
|
30606
|
-
return;
|
|
30607
|
-
}
|
|
30370
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30608
30371
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
30609
30372
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
30610
30373
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -30984,7 +30747,6 @@ function OhhwellsBridge() {
|
|
|
30984
30747
|
applyAiFooterFromContent(content);
|
|
30985
30748
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30986
30749
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
30987
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30988
30750
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30989
30751
|
}
|
|
30990
30752
|
applyBrandChrome(content);
|
|
@@ -30999,16 +30761,15 @@ function OhhwellsBridge() {
|
|
|
30999
30761
|
}
|
|
31000
30762
|
if (key === AI_SECTIONS_KEY) continue;
|
|
31001
30763
|
if (key === AI_FOOTER_KEY) continue;
|
|
31002
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31003
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31004
30764
|
if (key === BRAND_KIT_KEY) continue;
|
|
31005
30765
|
if (key === STYLE_STORE_KEY) continue;
|
|
31006
30766
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30767
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
31007
30768
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
30769
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
31008
30770
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
31009
30771
|
continue;
|
|
31010
30772
|
}
|
|
31011
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
31012
30773
|
if (applyVideoSettingNode(key, val)) continue;
|
|
31013
30774
|
if (applyCarouselNode(key, val)) continue;
|
|
31014
30775
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -31034,7 +30795,6 @@ function OhhwellsBridge() {
|
|
|
31034
30795
|
});
|
|
31035
30796
|
applyLinkByKey(key, val);
|
|
31036
30797
|
}
|
|
31037
|
-
applySectionEmbeds(content);
|
|
31038
30798
|
applyLogoFromContent(content);
|
|
31039
30799
|
applyLogoSizes(content);
|
|
31040
30800
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
@@ -31262,31 +31022,6 @@ function OhhwellsBridge() {
|
|
|
31262
31022
|
postAiSectionsChanged();
|
|
31263
31023
|
};
|
|
31264
31024
|
window.addEventListener("message", handleAiDeleteSection);
|
|
31265
|
-
const handleAiMoveSection = (e) => {
|
|
31266
|
-
if (e.data?.type !== "ow:ai-move-section") return;
|
|
31267
|
-
const sectionId = typeof e.data.sectionId === "string" ? e.data.sectionId : "";
|
|
31268
|
-
const targetPage = typeof e.data.targetPage === "string" ? e.data.targetPage : "";
|
|
31269
|
-
if (!sectionId || !targetPage) return;
|
|
31270
|
-
const previous = aiSectionsRef.current;
|
|
31271
|
-
const nextState = moveSectionInState(parseAiSectionsState(previous), sectionId, targetPage);
|
|
31272
|
-
if (!nextState) return;
|
|
31273
|
-
clearInteractionChrome();
|
|
31274
|
-
const nextValue = serializeAiSectionsState(nextState);
|
|
31275
|
-
aiSectionsRef.current = nextValue;
|
|
31276
|
-
applyAiSectionsToDom(nextState);
|
|
31277
|
-
const newHeight = document.body.scrollHeight;
|
|
31278
|
-
if (newHeight > 50) postToParentRef.current({ type: "ow:height", height: newHeight });
|
|
31279
|
-
postToParentRef.current({ type: "ow:change", nodes: [{ key: AI_SECTIONS_KEY, text: nextValue }] });
|
|
31280
|
-
postToParentRef.current({
|
|
31281
|
-
type: "ow:ai-section-moved",
|
|
31282
|
-
sectionId,
|
|
31283
|
-
targetPage,
|
|
31284
|
-
previous,
|
|
31285
|
-
value: nextValue
|
|
31286
|
-
});
|
|
31287
|
-
postAiSectionsChanged();
|
|
31288
|
-
};
|
|
31289
|
-
window.addEventListener("message", handleAiMoveSection);
|
|
31290
31025
|
const handleAiSetSections = (e) => {
|
|
31291
31026
|
if (e.data?.type !== "ow:ai-set-sections") return;
|
|
31292
31027
|
const value = typeof e.data.value === "string" ? e.data.value : "";
|
|
@@ -31667,12 +31402,6 @@ function OhhwellsBridge() {
|
|
|
31667
31402
|
closeLinkPopoverRef.current();
|
|
31668
31403
|
return;
|
|
31669
31404
|
}
|
|
31670
|
-
if (floatingPanelOpenRef.current) {
|
|
31671
|
-
setFloatingPanelRef.current(null);
|
|
31672
|
-
deselectRef.current();
|
|
31673
|
-
deactivateRef.current();
|
|
31674
|
-
return;
|
|
31675
|
-
}
|
|
31676
31405
|
deselectRef.current();
|
|
31677
31406
|
deactivateRef.current();
|
|
31678
31407
|
clearMediaSelectionRef.current();
|
|
@@ -32492,7 +32221,6 @@ function OhhwellsBridge() {
|
|
|
32492
32221
|
window.removeEventListener("message", handleAiApplyTree);
|
|
32493
32222
|
window.removeEventListener("message", handleAiApplyFooter);
|
|
32494
32223
|
window.removeEventListener("message", handleAiDeleteSection);
|
|
32495
|
-
window.removeEventListener("message", handleAiMoveSection);
|
|
32496
32224
|
window.removeEventListener("message", handleAiSetSections);
|
|
32497
32225
|
window.removeEventListener("message", handleAiSetBrand);
|
|
32498
32226
|
window.removeEventListener("message", handleAiSetStyles);
|
|
@@ -32509,10 +32237,10 @@ function OhhwellsBridge() {
|
|
|
32509
32237
|
window.removeEventListener("message", handleDuplicateSection);
|
|
32510
32238
|
window.removeEventListener("message", handleDeactivate);
|
|
32511
32239
|
window.removeEventListener("message", handleSelectNav);
|
|
32240
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32512
32241
|
window.removeEventListener("message", handleToastAction);
|
|
32513
32242
|
window.removeEventListener("message", handleFormCount);
|
|
32514
32243
|
window.removeEventListener("message", handleUiEscape);
|
|
32515
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32516
32244
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
32517
32245
|
autoSaveTimers.current.clear();
|
|
32518
32246
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
@@ -32806,7 +32534,7 @@ function OhhwellsBridge() {
|
|
|
32806
32534
|
postToParent2({
|
|
32807
32535
|
type: "ow:ready",
|
|
32808
32536
|
version: "1",
|
|
32809
|
-
bridgeVersion: "0.1.
|
|
32537
|
+
bridgeVersion: "0.1.165",
|
|
32810
32538
|
path: pathname,
|
|
32811
32539
|
nodes: collectEditableNodes(editContentRef.current),
|
|
32812
32540
|
sections
|
|
@@ -33541,7 +33269,7 @@ function OhhwellsBridge() {
|
|
|
33541
33269
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
|
|
33542
33270
|
onClick: () => setFieldTypePickerOpen((open) => !open),
|
|
33543
33271
|
"data-ohw-add-field": "",
|
|
33544
|
-
children: /* @__PURE__ */ jsx40(
|
|
33272
|
+
children: /* @__PURE__ */ jsx40(Plus5, { size: 15, "aria-hidden": true })
|
|
33545
33273
|
}
|
|
33546
33274
|
),
|
|
33547
33275
|
/* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),
|