@ohhwells/bridge 0.1.164-next.438 → 0.1.164
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 +1035 -1395
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -60
- package/dist/index.d.ts +1 -60
- package/dist/index.js +826 -1200
- 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
|
|
4
|
+
import React12, { useCallback as useCallback12, useEffect as useEffect19, 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
|
|
|
@@ -840,10 +840,6 @@ function useOhwCarousel(key, initial) {
|
|
|
840
840
|
if (Array.isArray(detail?.images)) setImages(detail.images);
|
|
841
841
|
};
|
|
842
842
|
el.addEventListener(CAROUSEL_EVENT, onChange);
|
|
843
|
-
const pending = parseSlides(el.getAttribute(CAROUSEL_VALUE_ATTR));
|
|
844
|
-
if (pending.length > 0) {
|
|
845
|
-
setImages((prev) => JSON.stringify(prev) === JSON.stringify(pending) ? prev : pending);
|
|
846
|
-
}
|
|
847
843
|
return () => el.removeEventListener(CAROUSEL_EVENT, onChange);
|
|
848
844
|
}, [key]);
|
|
849
845
|
const bind = {
|
|
@@ -1098,21 +1094,21 @@ function chromeFrom(sample) {
|
|
|
1098
1094
|
};
|
|
1099
1095
|
}
|
|
1100
1096
|
function filledPrimary(seed) {
|
|
1101
|
-
const
|
|
1102
|
-
const luminance = relativeLuminance(
|
|
1097
|
+
const paint = parseColor(paintColor(seed)) ?? { r: 15, g: 15, b: 15, a: 1 };
|
|
1098
|
+
const luminance = relativeLuminance(paint);
|
|
1103
1099
|
return {
|
|
1104
|
-
background: toCss({ ...
|
|
1100
|
+
background: toCss({ ...paint, a: 1 }),
|
|
1105
1101
|
color: luminance > 0.55 ? "rgb(15, 15, 15)" : "rgb(255, 255, 255)",
|
|
1106
1102
|
borderColor: TRANSPARENT,
|
|
1107
1103
|
borderWidth: "0px"
|
|
1108
1104
|
};
|
|
1109
1105
|
}
|
|
1110
1106
|
function generatedSecondary(primary) {
|
|
1111
|
-
const
|
|
1107
|
+
const paint = accentColor(primary);
|
|
1112
1108
|
return {
|
|
1113
1109
|
background: TRANSPARENT,
|
|
1114
|
-
color:
|
|
1115
|
-
borderColor:
|
|
1110
|
+
color: paint,
|
|
1111
|
+
borderColor: paint,
|
|
1116
1112
|
borderWidth: "1px"
|
|
1117
1113
|
};
|
|
1118
1114
|
}
|
|
@@ -1125,9 +1121,9 @@ function generatedGhost(primary) {
|
|
|
1125
1121
|
};
|
|
1126
1122
|
}
|
|
1127
1123
|
function normalizeOutlineChrome(outline, primary) {
|
|
1128
|
-
const
|
|
1124
|
+
const paint = accentColor(primary);
|
|
1129
1125
|
const text = parseColor(outline.color);
|
|
1130
|
-
const paintRgb = parseColor(
|
|
1126
|
+
const paintRgb = parseColor(paint);
|
|
1131
1127
|
const primaryLabel = parseColor(primary.color);
|
|
1132
1128
|
const matchesOnPrimary = Boolean(text && primaryLabel) && colorKey(outline.color) === colorKey(primary.color);
|
|
1133
1129
|
const textTooLight = text ? relativeLuminance(text) > 0.7 : false;
|
|
@@ -1136,8 +1132,8 @@ function normalizeOutlineChrome(outline, primary) {
|
|
|
1136
1132
|
const hasBorder = parseFloat(outline.borderWidth) > 0;
|
|
1137
1133
|
return {
|
|
1138
1134
|
...outline,
|
|
1139
|
-
color:
|
|
1140
|
-
borderColor: hasBorder ?
|
|
1135
|
+
color: paint,
|
|
1136
|
+
borderColor: hasBorder ? paint : outline.borderColor
|
|
1141
1137
|
};
|
|
1142
1138
|
}
|
|
1143
1139
|
function generateButtonVariants(samples) {
|
|
@@ -2528,14 +2524,6 @@ function socialHrefKey(item) {
|
|
|
2528
2524
|
function socialIconKey(item) {
|
|
2529
2525
|
return item.querySelector(ICON_SELECTOR)?.dataset.ohwKey ?? null;
|
|
2530
2526
|
}
|
|
2531
|
-
function pendingIconKey(item) {
|
|
2532
|
-
const existing = socialIconKey(item);
|
|
2533
|
-
if (existing) return existing;
|
|
2534
|
-
const base = socialHrefKey(item)?.replace(/-href$/, "");
|
|
2535
|
-
if (!base) return null;
|
|
2536
|
-
const taken = item.ownerDocument.querySelector(`[data-ohw-key="${base}"]`);
|
|
2537
|
-
return taken && taken !== item ? `${base}-icon` : base;
|
|
2538
|
-
}
|
|
2539
2527
|
var SOCIAL_PLATFORM_LABELS = {
|
|
2540
2528
|
instagram: "Instagram",
|
|
2541
2529
|
facebook: "Facebook",
|
|
@@ -2733,9 +2721,9 @@ function reconcileSocialsFromContent(content, root = document) {
|
|
|
2733
2721
|
listSocialsRows(root).forEach((row) => {
|
|
2734
2722
|
const rowDisplay = socialsDisplayFor(row, content);
|
|
2735
2723
|
listSocialItems(row).forEach((item) => {
|
|
2736
|
-
const key =
|
|
2724
|
+
const key = socialIconKey(item) ?? socialHrefKey(item)?.replace(/-href$/, "");
|
|
2737
2725
|
const stored2 = key ? content[key] : void 0;
|
|
2738
|
-
if (!stored2?.trim()
|
|
2726
|
+
if (!stored2?.trim()) return;
|
|
2739
2727
|
const existing = item.querySelector(ICON_SELECTOR);
|
|
2740
2728
|
if (existing && existing.innerHTML.trim() && !existing.hasAttribute(SOCIALS_ICON_PLACEHOLDER_ATTR)) return;
|
|
2741
2729
|
ensureIconSlot(item);
|
|
@@ -2995,7 +2983,8 @@ function ensureIconSlot(item) {
|
|
|
2995
2983
|
const adopted = adoptAsIconSlot(drawn, base);
|
|
2996
2984
|
if (adopted) return adopted;
|
|
2997
2985
|
}
|
|
2998
|
-
const
|
|
2986
|
+
const taken = document.querySelector(`[data-ohw-key="${base}"]`);
|
|
2987
|
+
const iconKey = taken && taken !== item ? `${base}-icon` : base;
|
|
2999
2988
|
const slot = document.createElement("span");
|
|
3000
2989
|
slot.setAttribute("data-ohw-key", iconKey);
|
|
3001
2990
|
slot.setAttribute("data-ohw-editable", "icon");
|
|
@@ -3507,11 +3496,11 @@ function insertFooterColumnDom(colIndex, heading, items) {
|
|
|
3507
3496
|
container.appendChild(column);
|
|
3508
3497
|
return { column, firstLink };
|
|
3509
3498
|
}
|
|
3510
|
-
function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL,
|
|
3499
|
+
function insertFooterColumn(heading = DEFAULT_FOOTER_COLUMN_HEADING, linkLabel = DEFAULT_FOOTER_COLUMN_LINK_LABEL, linkHref = DEFAULT_FOOTER_COLUMN_LINK_HREF) {
|
|
3511
3500
|
if (!canAddFooterColumn()) {
|
|
3512
3501
|
throw new Error(`Footer column limit reached (${MAX_FOOTER_COLUMNS})`);
|
|
3513
3502
|
}
|
|
3514
|
-
const resolvedHref =
|
|
3503
|
+
const resolvedHref = linkHref || (document.querySelector("[data-ai-footer], [data-ohw-ai-footer]") ? "/" : DEFAULT_FOOTER_COLUMN_LINK_HREF);
|
|
3515
3504
|
const colIndex = getNextFooterColumnIndex();
|
|
3516
3505
|
const inserted = insertFooterColumnDom(colIndex, heading, [{ href: resolvedHref, label: linkLabel }]);
|
|
3517
3506
|
if (!inserted?.firstLink) throw new Error("Failed to insert footer column");
|
|
@@ -3890,8 +3879,8 @@ function duplicateFooterItem(sourceAnchor) {
|
|
|
3890
3879
|
const column = findFooterColumnForLink(sourceAnchor);
|
|
3891
3880
|
if (!column) return null;
|
|
3892
3881
|
const href = getLinkHref(sourceAnchor);
|
|
3893
|
-
const
|
|
3894
|
-
const label = (
|
|
3882
|
+
const labelEl = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
3883
|
+
const label = (labelEl?.textContent ?? "").trim() || "Untitled";
|
|
3895
3884
|
return insertFooterItem(column, href || "/", label, sourceAnchor);
|
|
3896
3885
|
}
|
|
3897
3886
|
function footerLabelKeyFromHrefKey(hrefKey) {
|
|
@@ -3901,8 +3890,8 @@ function deleteFooterItem(sourceAnchor) {
|
|
|
3901
3890
|
if (!isFooterLinkAnchor(sourceAnchor)) return null;
|
|
3902
3891
|
const hrefKey = sourceAnchor.getAttribute("data-ohw-href-key");
|
|
3903
3892
|
if (!hrefKey || !isFooterHrefKey(hrefKey)) return null;
|
|
3904
|
-
const
|
|
3905
|
-
const label = (
|
|
3893
|
+
const labelEl = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
3894
|
+
const label = (labelEl?.textContent ?? "").trim() || "Untitled";
|
|
3906
3895
|
const labelKey = footerLabelKeyFromHrefKey(hrefKey);
|
|
3907
3896
|
const previousOrder = getFooterOrderFromDom();
|
|
3908
3897
|
const previousOrderJson = JSON.stringify(previousOrder);
|
|
@@ -4870,8 +4859,8 @@ function remapNavKeysInSubtree(root, keyMap) {
|
|
|
4870
4859
|
const mapped = keyMap.get(oldHrefKey);
|
|
4871
4860
|
if (!mapped) return;
|
|
4872
4861
|
el.setAttribute("data-ohw-href-key", mapped.hrefKey);
|
|
4873
|
-
const
|
|
4874
|
-
if (
|
|
4862
|
+
const labelEl = el.querySelector(':scope > [data-ohw-editable="text"][data-ohw-key]') ?? el.querySelector('[data-ohw-editable="text"][data-ohw-key]');
|
|
4863
|
+
if (labelEl) labelEl.setAttribute("data-ohw-key", mapped.labelKey);
|
|
4875
4864
|
};
|
|
4876
4865
|
if (root.matches("[data-ohw-href-key]")) remapAnchor(root);
|
|
4877
4866
|
root.querySelectorAll("[data-ohw-href-key]").forEach(remapAnchor);
|
|
@@ -4879,10 +4868,10 @@ function remapNavKeysInSubtree(root, keyMap) {
|
|
|
4879
4868
|
function readNavLinkSnapshot(hrefKey) {
|
|
4880
4869
|
const el = findCounterpartByHrefKey(hrefKey, document) ?? document.querySelector(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`);
|
|
4881
4870
|
if (!el) return { href: "/", label: "Untitled" };
|
|
4882
|
-
const
|
|
4871
|
+
const labelEl = el.querySelector('[data-ohw-editable="text"]');
|
|
4883
4872
|
return {
|
|
4884
4873
|
href: getLinkHref2(el),
|
|
4885
|
-
label: (
|
|
4874
|
+
label: (labelEl?.textContent ?? "").trim() || "Untitled"
|
|
4886
4875
|
};
|
|
4887
4876
|
}
|
|
4888
4877
|
function findClonedNavAnchor(unit, hrefKey) {
|
|
@@ -5056,8 +5045,8 @@ function deleteNavbarItem(sourceAnchor) {
|
|
|
5056
5045
|
if (!isNavbarLinkItem(sourceAnchor)) return null;
|
|
5057
5046
|
const sourceHrefKey = sourceAnchor.getAttribute("data-ohw-href-key");
|
|
5058
5047
|
if (!sourceHrefKey || !isNavbarHrefKey(sourceHrefKey)) return null;
|
|
5059
|
-
const
|
|
5060
|
-
const label = (
|
|
5048
|
+
const labelEl = sourceAnchor.querySelector('[data-ohw-editable="text"]');
|
|
5049
|
+
const label = (labelEl?.textContent ?? "").trim() || "Untitled";
|
|
5061
5050
|
const previousForest = getNavForestFromDom();
|
|
5062
5051
|
const previousOrderJson = serializeNavOrder(previousForest);
|
|
5063
5052
|
const parentHrefKey = previousForest.find((n) => n.children.some((c) => c.id === sourceHrefKey))?.id ?? null;
|
|
@@ -6660,21 +6649,6 @@ function pricingCardFeatureCount(tree, index) {
|
|
|
6660
6649
|
const target = findPricingCollection(tree)?.children?.[index];
|
|
6661
6650
|
return target ? pricingFeatureList(target).length : 0;
|
|
6662
6651
|
}
|
|
6663
|
-
function prevailingFeatureIcon(features) {
|
|
6664
|
-
const counts = /* @__PURE__ */ new Map();
|
|
6665
|
-
for (const row of features) {
|
|
6666
|
-
const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
|
|
6667
|
-
const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
|
|
6668
|
-
entry.count += 1;
|
|
6669
|
-
counts.set(key, entry);
|
|
6670
|
-
}
|
|
6671
|
-
let best = null;
|
|
6672
|
-
for (const entry of counts.values()) {
|
|
6673
|
-
if (!best || entry.count > best.count) best = entry;
|
|
6674
|
-
}
|
|
6675
|
-
if (!best) return {};
|
|
6676
|
-
return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
|
|
6677
|
-
}
|
|
6678
6652
|
function addPricingCardFeature(tree, index, text) {
|
|
6679
6653
|
return withPricingCollection(tree, (collection) => {
|
|
6680
6654
|
const children = collection.children;
|
|
@@ -6683,7 +6657,7 @@ function addPricingCardFeature(tree, index, text) {
|
|
|
6683
6657
|
const features = pricingFeatureList(target);
|
|
6684
6658
|
if (features.length >= PRICING_FEATURES_MAX) return false;
|
|
6685
6659
|
target.slots = target.slots ?? {};
|
|
6686
|
-
target.slots.features = [...features, { text
|
|
6660
|
+
target.slots.features = [...features, { text }];
|
|
6687
6661
|
return true;
|
|
6688
6662
|
});
|
|
6689
6663
|
}
|
|
@@ -7327,120 +7301,6 @@ function findSelectableNavContainer(doc = document) {
|
|
|
7327
7301
|
);
|
|
7328
7302
|
}
|
|
7329
7303
|
|
|
7330
|
-
// src/lib/youtube.ts
|
|
7331
|
-
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
7332
|
-
function extractYouTubeId(input) {
|
|
7333
|
-
const trimmed = input.trim();
|
|
7334
|
-
if (!trimmed) return null;
|
|
7335
|
-
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
7336
|
-
let url;
|
|
7337
|
-
try {
|
|
7338
|
-
url = new URL(trimmed);
|
|
7339
|
-
} catch {
|
|
7340
|
-
return null;
|
|
7341
|
-
}
|
|
7342
|
-
const host = url.hostname.replace(/^www\./, "");
|
|
7343
|
-
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
7344
|
-
return null;
|
|
7345
|
-
}
|
|
7346
|
-
let candidate = null;
|
|
7347
|
-
if (host === "youtu.be") {
|
|
7348
|
-
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
7349
|
-
} else if (url.pathname === "/watch") {
|
|
7350
|
-
candidate = url.searchParams.get("v");
|
|
7351
|
-
} else {
|
|
7352
|
-
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
7353
|
-
candidate = match ? match[1] : null;
|
|
7354
|
-
}
|
|
7355
|
-
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
7356
|
-
}
|
|
7357
|
-
|
|
7358
|
-
// src/lib/section-embed.ts
|
|
7359
|
-
var SECTION_EMBED_SUFFIX = "__ohw_embed";
|
|
7360
|
-
function readStoredEmbed(value) {
|
|
7361
|
-
if (value.startsWith("start\n")) {
|
|
7362
|
-
return { raw: value.slice("start\n".length), at: "start" };
|
|
7363
|
-
}
|
|
7364
|
-
return { raw: value, at: "end" };
|
|
7365
|
-
}
|
|
7366
|
-
function embedFrameSrc(value) {
|
|
7367
|
-
const videoId = extractYouTubeId(value);
|
|
7368
|
-
if (videoId) {
|
|
7369
|
-
return { src: `https://www.youtube-nocookie.com/embed/${videoId}?rel=0`, title: "YouTube video" };
|
|
7370
|
-
}
|
|
7371
|
-
let url;
|
|
7372
|
-
try {
|
|
7373
|
-
url = new URL(value);
|
|
7374
|
-
} catch {
|
|
7375
|
-
return null;
|
|
7376
|
-
}
|
|
7377
|
-
const host = url.hostname.replace(/^www\./, "").toLowerCase();
|
|
7378
|
-
if (host === "google.com" && url.pathname.startsWith("/maps") || host === "maps.google.com") {
|
|
7379
|
-
const query = url.searchParams.get("q") || url.searchParams.get("query") || "";
|
|
7380
|
-
const src = query ? `https://maps.google.com/maps?q=${encodeURIComponent(query)}&output=embed` : `https://maps.google.com/maps?output=embed`;
|
|
7381
|
-
return { src, title: "Map" };
|
|
7382
|
-
}
|
|
7383
|
-
if (host === "maps.app.goo.gl") {
|
|
7384
|
-
return { src: value, title: "Map" };
|
|
7385
|
-
}
|
|
7386
|
-
if (host === "calendly.com" || host.endsWith(".calendly.com") || host === "calendar.google.com") {
|
|
7387
|
-
return { src: value, title: "Calendar" };
|
|
7388
|
-
}
|
|
7389
|
-
if (host === "docs.google.com" && url.pathname.includes("/forms/")) {
|
|
7390
|
-
return { src: value.replace(/\/edit(?:\?.*)?$/i, "/viewform"), title: "Form" };
|
|
7391
|
-
}
|
|
7392
|
-
if (host === "forms.gle") {
|
|
7393
|
-
return { src: value, title: "Form" };
|
|
7394
|
-
}
|
|
7395
|
-
return null;
|
|
7396
|
-
}
|
|
7397
|
-
function place(section, box, at) {
|
|
7398
|
-
if (at === "start") {
|
|
7399
|
-
section.insertBefore(box, section.firstChild);
|
|
7400
|
-
return;
|
|
7401
|
-
}
|
|
7402
|
-
section.appendChild(box);
|
|
7403
|
-
}
|
|
7404
|
-
function paint(section, key, src, title, at) {
|
|
7405
|
-
const existing = section.querySelector(`[data-ohw-section-embed="${CSS.escape(key)}"]`);
|
|
7406
|
-
const frame = existing?.querySelector("iframe");
|
|
7407
|
-
if (existing && frame) {
|
|
7408
|
-
if (frame.getAttribute("src") !== src) frame.setAttribute("src", src);
|
|
7409
|
-
frame.title = title;
|
|
7410
|
-
place(section, existing, at);
|
|
7411
|
-
return;
|
|
7412
|
-
}
|
|
7413
|
-
existing?.remove();
|
|
7414
|
-
const box = document.createElement("div");
|
|
7415
|
-
box.setAttribute("data-ohw-section-embed", key);
|
|
7416
|
-
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;";
|
|
7417
|
-
const frameWrap = document.createElement("div");
|
|
7418
|
-
frameWrap.style.cssText = "position:relative;width:100%;aspect-ratio:16/9;min-height:250px;border-radius:12px;overflow:hidden;background:#0f172a;";
|
|
7419
|
-
const iframe = document.createElement("iframe");
|
|
7420
|
-
iframe.src = src;
|
|
7421
|
-
iframe.title = title;
|
|
7422
|
-
iframe.style.cssText = "position:absolute;inset:0;width:100%;height:100%;border:0;";
|
|
7423
|
-
iframe.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture";
|
|
7424
|
-
iframe.setAttribute("allowfullscreen", "");
|
|
7425
|
-
frameWrap.appendChild(iframe);
|
|
7426
|
-
box.appendChild(frameWrap);
|
|
7427
|
-
place(section, box, at);
|
|
7428
|
-
}
|
|
7429
|
-
function applySectionEmbeds(content) {
|
|
7430
|
-
for (const [key, val] of Object.entries(content)) {
|
|
7431
|
-
if (!key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
7432
|
-
const sectionId = key.slice(0, -SECTION_EMBED_SUFFIX.length);
|
|
7433
|
-
const section = document.querySelector(`[data-ohw-section="${CSS.escape(sectionId)}"]`);
|
|
7434
|
-
const stored = typeof val === "string" ? readStoredEmbed(val) : null;
|
|
7435
|
-
const frame = stored ? embedFrameSrc(stored.raw) : null;
|
|
7436
|
-
if (!section || !stored || !frame) {
|
|
7437
|
-
section?.querySelector(`[data-ohw-section-embed="${CSS.escape(key)}"]`)?.remove();
|
|
7438
|
-
continue;
|
|
7439
|
-
}
|
|
7440
|
-
paint(section, key, frame.src, frame.title, stored.at);
|
|
7441
|
-
}
|
|
7442
|
-
}
|
|
7443
|
-
|
|
7444
7304
|
// src/ui/ai-tree/aiSectionsManager.tsx
|
|
7445
7305
|
import { flushSync } from "react-dom";
|
|
7446
7306
|
import { createRoot } from "react-dom/client";
|
|
@@ -8014,7 +7874,7 @@ var AI_MOBILE_CSS = [
|
|
|
8014
7874
|
// page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
|
|
8015
7875
|
// template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
|
|
8016
7876
|
// an exact figure from (no live measurement exists), so this is a safe approximation, not a
|
|
8017
|
-
// pixel-exact fit. Horizontal spacing already comes from `data-ai-
|
|
7877
|
+
// pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
|
|
8018
7878
|
'[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
|
|
8019
7879
|
// A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
|
|
8020
7880
|
// window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
|
|
@@ -8030,10 +7890,8 @@ var AI_MOBILE_CSS = [
|
|
|
8030
7890
|
"[data-ai-section]{overflow-x:hidden}",
|
|
8031
7891
|
// `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
|
|
8032
7892
|
// full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
|
|
8033
|
-
// still got a 20px band of section background down both sides on a phone.
|
|
8034
|
-
|
|
8035
|
-
"[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8036
|
-
"[data-ai-container]{padding:0 20px !important}",
|
|
7893
|
+
// still got a 20px band of section background down both sides on a phone.
|
|
7894
|
+
"[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
|
|
8037
7895
|
"[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
|
|
8038
7896
|
"[data-ai-cell]{width:100%;min-width:0}",
|
|
8039
7897
|
// The rule above turns every row into a COLUMN flex container on phones, which silently breaks
|
|
@@ -8238,31 +8096,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
|
|
|
8238
8096
|
function textAttrs(ctx, path) {
|
|
8239
8097
|
return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
|
|
8240
8098
|
}
|
|
8241
|
-
var AI_RESPONSIVE_CSS = [
|
|
8242
|
-
"@media (max-width: 960px) {",
|
|
8243
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
|
|
8244
|
-
' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
|
|
8245
|
-
"}",
|
|
8246
|
-
"@media (max-width: 640px) {",
|
|
8247
|
-
" [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
|
|
8248
|
-
" [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
|
|
8249
|
-
// Group containers flatten to a column on phones; span placements come along for free.
|
|
8250
|
-
// `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
|
|
8251
|
-
// the comment there. This sheet's copy is the narrower selector, so without the exemption it
|
|
8252
|
-
// flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
|
|
8253
|
-
// viewport with the heading/CTA in flow *under* the image, 219px of section background where the
|
|
8254
|
-
// layered text used to be.
|
|
8255
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
|
|
8256
|
-
' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
|
|
8257
|
-
// `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
|
|
8258
|
-
// is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
|
|
8259
|
-
// a full-bleed hero gets its 20px side band back below 640px only — the one width where the
|
|
8260
|
-
// other rule had already been taught to stand down.
|
|
8261
|
-
" [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
|
|
8262
|
-
" [data-ai-responsive] { overflow-x: hidden; }",
|
|
8263
|
-
" [data-ai-responsive] img { max-width: 100%; }",
|
|
8264
|
-
"}"
|
|
8265
|
-
].join("\n");
|
|
8266
8099
|
var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
8267
8100
|
function MediaBox({
|
|
8268
8101
|
refValue,
|
|
@@ -8317,7 +8150,7 @@ function MediaBox({
|
|
|
8317
8150
|
position: fill ? "absolute" : void 0,
|
|
8318
8151
|
inset: fill ? 0 : void 0,
|
|
8319
8152
|
width: fill ? "100%" : fixedSize ? "auto" : "100%",
|
|
8320
|
-
height: fill ? "100%" :
|
|
8153
|
+
height: fill ? "100%" : void 0,
|
|
8321
8154
|
aspectRatio: fill ? void 0 : aspectRatio,
|
|
8322
8155
|
minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
|
|
8323
8156
|
borderRadius: radius,
|
|
@@ -9813,7 +9646,7 @@ function CollectionBlock({ node, ctx, path }) {
|
|
|
9813
9646
|
return /* @__PURE__ */ jsx(
|
|
9814
9647
|
"div",
|
|
9815
9648
|
{
|
|
9816
|
-
"data-ai-grid":
|
|
9649
|
+
"data-ai-grid": "",
|
|
9817
9650
|
"data-ohw-pricing-collection": isPricing ? "" : void 0,
|
|
9818
9651
|
style: {
|
|
9819
9652
|
display: "grid",
|
|
@@ -10115,7 +9948,7 @@ function renderNode(node, ctx, path, ambientAlign) {
|
|
|
10115
9948
|
},
|
|
10116
9949
|
children: [
|
|
10117
9950
|
i > 0 && ctx.heroOverlapFullBleed ? (
|
|
10118
|
-
// The section's `data-ai-
|
|
9951
|
+
// The section's `data-ai-container` gave up its max-width/gutter so the base
|
|
10119
9952
|
// layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
|
|
10120
9953
|
// scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
|
|
10121
9954
|
// the full section width instead of reading at the usual content width.
|
|
@@ -10534,7 +10367,6 @@ function AiTreeRenderer({
|
|
|
10534
10367
|
...fillHeight ? { "data-ai-fill-height": "" } : {},
|
|
10535
10368
|
...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
|
|
10536
10369
|
...bgAttrs,
|
|
10537
|
-
"data-ai-responsive": "",
|
|
10538
10370
|
style: {
|
|
10539
10371
|
position: "relative",
|
|
10540
10372
|
padding: `${padCss} 0`,
|
|
@@ -10548,13 +10380,12 @@ function AiTreeRenderer({
|
|
|
10548
10380
|
...fillHeight ? { display: "grid" } : {}
|
|
10549
10381
|
},
|
|
10550
10382
|
children: [
|
|
10551
|
-
/* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
|
|
10552
|
-
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10553
10383
|
isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
|
|
10384
|
+
/* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
|
|
10554
10385
|
/* @__PURE__ */ jsx(
|
|
10555
10386
|
"div",
|
|
10556
10387
|
{
|
|
10557
|
-
"data-ai-
|
|
10388
|
+
"data-ai-container": "",
|
|
10558
10389
|
...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
|
|
10559
10390
|
style: {
|
|
10560
10391
|
position: "relative",
|
|
@@ -10571,7 +10402,7 @@ function AiTreeRenderer({
|
|
|
10571
10402
|
children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
|
|
10572
10403
|
"div",
|
|
10573
10404
|
{
|
|
10574
|
-
"data-ai-
|
|
10405
|
+
"data-ai-row": "",
|
|
10575
10406
|
style: {
|
|
10576
10407
|
display: "grid",
|
|
10577
10408
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
@@ -11233,10 +11064,9 @@ function applyAiSectionsToDom(state, options) {
|
|
|
11233
11064
|
if (existing && existing.serialized === serialized && existing.container.isConnected) {
|
|
11234
11065
|
continue;
|
|
11235
11066
|
}
|
|
11067
|
+
const isNewMount = !existing || !existing.container.isConnected;
|
|
11236
11068
|
let container = existing?.container;
|
|
11237
|
-
let isNewMount = false;
|
|
11238
11069
|
if (!container || !container.isConnected) {
|
|
11239
|
-
isNewMount = true;
|
|
11240
11070
|
existing?.root.unmount();
|
|
11241
11071
|
container?.remove();
|
|
11242
11072
|
container = document.createElement("div");
|
|
@@ -11574,34 +11404,6 @@ function minSpanForFooterBlock(type) {
|
|
|
11574
11404
|
return 3;
|
|
11575
11405
|
}
|
|
11576
11406
|
}
|
|
11577
|
-
function readLiveSocialItems() {
|
|
11578
|
-
const root = getFooterRoot();
|
|
11579
|
-
const row = root?.querySelector("[data-ohw-socials-row]");
|
|
11580
|
-
if (!row) return [];
|
|
11581
|
-
const items = [];
|
|
11582
|
-
for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
|
|
11583
|
-
const href = anchor.getAttribute("href")?.trim() ?? "";
|
|
11584
|
-
const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
|
|
11585
|
-
const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
|
|
11586
|
-
if (!platform || !/^https?:\/\//i.test(href)) continue;
|
|
11587
|
-
items.push({ platform, href });
|
|
11588
|
-
}
|
|
11589
|
-
return items;
|
|
11590
|
-
}
|
|
11591
|
-
function syncSocialRowsFromDom(tree) {
|
|
11592
|
-
const root = getFooterRoot();
|
|
11593
|
-
if (!root) return;
|
|
11594
|
-
const row = root.querySelector("[data-ohw-socials-row]");
|
|
11595
|
-
const live = readLiveSocialItems();
|
|
11596
|
-
if (row && live.length === 0) return;
|
|
11597
|
-
for (const col of tree.columns) {
|
|
11598
|
-
col.blocks = col.blocks.flatMap((block) => {
|
|
11599
|
-
if (block.type !== "social-row") return [block];
|
|
11600
|
-
if (!row) return [];
|
|
11601
|
-
return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
|
|
11602
|
-
});
|
|
11603
|
-
}
|
|
11604
|
-
}
|
|
11605
11407
|
function collectBrandBlocks(tree) {
|
|
11606
11408
|
const brand = [];
|
|
11607
11409
|
for (const col of tree.columns) {
|
|
@@ -11847,13 +11649,12 @@ function textOf2(el) {
|
|
|
11847
11649
|
}
|
|
11848
11650
|
function syncFooterTreeLinksFromDom(tree) {
|
|
11849
11651
|
const next = cloneTree(tree);
|
|
11850
|
-
syncSocialRowsFromDom(next);
|
|
11851
11652
|
const domCols = listFooterColumns().map((col) => {
|
|
11852
11653
|
const heading = getFooterColumnHeadingEl(col);
|
|
11853
11654
|
const title = heading ? textOf2(heading) : void 0;
|
|
11854
11655
|
const items = listFooterLinksInColumn(col).map((anchor) => {
|
|
11855
|
-
const
|
|
11856
|
-
const label = textOf2(
|
|
11656
|
+
const labelEl = anchor.querySelector('[data-ohw-editable="text"]');
|
|
11657
|
+
const label = textOf2(labelEl) || textOf2(anchor);
|
|
11857
11658
|
const href = hrefToFooterTreeRef(anchor.getAttribute("href"));
|
|
11858
11659
|
return label ? { label, href: href || "home" } : null;
|
|
11859
11660
|
}).filter((x) => Boolean(x));
|
|
@@ -17552,7 +17353,7 @@ function apiBase() {
|
|
|
17552
17353
|
function bridgeVersion() {
|
|
17553
17354
|
try {
|
|
17554
17355
|
if (true) {
|
|
17555
|
-
return "0.1.164
|
|
17356
|
+
return "0.1.164";
|
|
17556
17357
|
}
|
|
17557
17358
|
} catch {
|
|
17558
17359
|
}
|
|
@@ -17566,7 +17367,7 @@ function stampBridgeVersionOnDocument() {
|
|
|
17566
17367
|
return;
|
|
17567
17368
|
}
|
|
17568
17369
|
try {
|
|
17569
|
-
const v = true ? "0.1.164
|
|
17370
|
+
const v = true ? "0.1.164" : "";
|
|
17570
17371
|
if (v) {
|
|
17571
17372
|
document.documentElement.setAttribute("data-ohw-bridge-version", v);
|
|
17572
17373
|
window.__OHW_BRIDGE_VERSION__ = v;
|
|
@@ -18244,7 +18045,6 @@ function MediaOverlay({
|
|
|
18244
18045
|
(prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
|
|
18245
18046
|
);
|
|
18246
18047
|
}, [isVideo]);
|
|
18247
|
-
const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
|
|
18248
18048
|
const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
|
|
18249
18049
|
const box = {
|
|
18250
18050
|
position: "fixed",
|
|
@@ -18343,10 +18143,11 @@ function MediaOverlay({
|
|
|
18343
18143
|
className: "flex items-center justify-center cursor-pointer",
|
|
18344
18144
|
style: {
|
|
18345
18145
|
...box,
|
|
18346
|
-
//
|
|
18347
|
-
//
|
|
18348
|
-
//
|
|
18349
|
-
|
|
18146
|
+
// When text overlays this media, let clicks fall THROUGH to the text underneath. In the
|
|
18147
|
+
// parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
|
|
18148
|
+
// in-document, pointer-events does it natively. The button below opts back in, so
|
|
18149
|
+
// Replace still works.
|
|
18150
|
+
pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
|
|
18350
18151
|
// Selected: a firm component ring with no wash, so the image reads as chosen rather
|
|
18351
18152
|
// than hovered. Hover keeps the existing tinted preview.
|
|
18352
18153
|
boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
|
|
@@ -18373,17 +18174,17 @@ function MediaOverlay({
|
|
|
18373
18174
|
},
|
|
18374
18175
|
children: [
|
|
18375
18176
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18376
|
-
|
|
18177
|
+
isVideo ? "Replace video" : "Replace image"
|
|
18377
18178
|
]
|
|
18378
18179
|
}
|
|
18379
18180
|
),
|
|
18380
|
-
|
|
18181
|
+
replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ jsxs8(
|
|
18381
18182
|
Button,
|
|
18382
18183
|
{
|
|
18383
18184
|
"data-ohw-media-overlay": "",
|
|
18384
18185
|
variant: "outline",
|
|
18385
18186
|
size: "sm",
|
|
18386
|
-
"aria-label":
|
|
18187
|
+
"aria-label": isVideo ? "Replace video" : "Replace image",
|
|
18387
18188
|
className: "gap-1.5 cursor-pointer hover:bg-background",
|
|
18388
18189
|
style: {
|
|
18389
18190
|
...OVERLAY_BUTTON_STYLE,
|
|
@@ -18406,7 +18207,7 @@ function MediaOverlay({
|
|
|
18406
18207
|
},
|
|
18407
18208
|
children: [
|
|
18408
18209
|
isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
|
|
18409
|
-
replaceMode === "full" ?
|
|
18210
|
+
replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
|
|
18410
18211
|
]
|
|
18411
18212
|
}
|
|
18412
18213
|
)
|
|
@@ -18999,24 +18800,8 @@ function AiSectionOverlay({
|
|
|
18999
18800
|
}
|
|
19000
18801
|
|
|
19001
18802
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19002
|
-
import { useCallback as useCallback3, useEffect as useEffect8,
|
|
19003
|
-
import {
|
|
19004
|
-
AlignCenter,
|
|
19005
|
-
AlignLeft,
|
|
19006
|
-
AlignRight,
|
|
19007
|
-
ArrowLeft as ArrowLeft2,
|
|
19008
|
-
ArrowRight as ArrowRight2,
|
|
19009
|
-
Check as Check2,
|
|
19010
|
-
ChevronDown as ChevronDown3,
|
|
19011
|
-
Image as ImageIcon2,
|
|
19012
|
-
ImageMinus,
|
|
19013
|
-
ImagePlus,
|
|
19014
|
-
Link as LinkIcon,
|
|
19015
|
-
Minus,
|
|
19016
|
-
Palette,
|
|
19017
|
-
Plus as Plus2,
|
|
19018
|
-
Star
|
|
19019
|
-
} from "lucide-react";
|
|
18803
|
+
import { useCallback as useCallback3, useEffect as useEffect8, useRef as useRef5, useState as useState8 } from "react";
|
|
18804
|
+
import { Star } from "lucide-react";
|
|
19020
18805
|
|
|
19021
18806
|
// src/lib/ai-media-strip-tree.ts
|
|
19022
18807
|
var MEDIA_STRIP_ITEM_MIN = 1;
|
|
@@ -19130,6 +18915,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
|
|
|
19130
18915
|
return true;
|
|
19131
18916
|
});
|
|
19132
18917
|
}
|
|
18918
|
+
function setMediaStripItemAlt(tree, index, alt) {
|
|
18919
|
+
return withMediaStrip(tree, (block) => {
|
|
18920
|
+
const items = block.items;
|
|
18921
|
+
if (index < 0 || index >= items.length) return false;
|
|
18922
|
+
items[index] = { ...items[index], alt };
|
|
18923
|
+
return true;
|
|
18924
|
+
});
|
|
18925
|
+
}
|
|
19133
18926
|
function setMediaStripItemLink(tree, index, link) {
|
|
19134
18927
|
return withMediaStrip(tree, (block) => {
|
|
19135
18928
|
const items = block.items;
|
|
@@ -19147,117 +18940,11 @@ function setMediaStripItemLink(tree, index, link) {
|
|
|
19147
18940
|
});
|
|
19148
18941
|
}
|
|
19149
18942
|
|
|
19150
|
-
// src/ui/dialog.tsx
|
|
19151
|
-
import * as React9 from "react";
|
|
19152
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
19153
|
-
import { X as X2 } from "lucide-react";
|
|
19154
|
-
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
19155
|
-
function Dialog2({
|
|
19156
|
-
...props
|
|
19157
|
-
}) {
|
|
19158
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
19159
|
-
}
|
|
19160
|
-
function DialogPortal({
|
|
19161
|
-
...props
|
|
19162
|
-
}) {
|
|
19163
|
-
return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
|
|
19164
|
-
}
|
|
19165
|
-
function DialogOverlay({
|
|
19166
|
-
className,
|
|
19167
|
-
...props
|
|
19168
|
-
}) {
|
|
19169
|
-
return /* @__PURE__ */ jsx20(
|
|
19170
|
-
DialogPrimitive.Overlay,
|
|
19171
|
-
{
|
|
19172
|
-
"data-slot": "dialog-overlay",
|
|
19173
|
-
"data-ohw-link-modal-root": "",
|
|
19174
|
-
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
19175
|
-
...props
|
|
19176
|
-
}
|
|
19177
|
-
);
|
|
19178
|
-
}
|
|
19179
|
-
var DialogContent = React9.forwardRef(
|
|
19180
|
-
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
19181
|
-
const positionMode = container ? "absolute" : "fixed";
|
|
19182
|
-
return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
|
|
19183
|
-
/* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
19184
|
-
/* @__PURE__ */ jsxs11(
|
|
19185
|
-
DialogPrimitive.Content,
|
|
19186
|
-
{
|
|
19187
|
-
ref,
|
|
19188
|
-
"data-slot": "dialog-content",
|
|
19189
|
-
className: cn(
|
|
19190
|
-
positionMode,
|
|
19191
|
-
"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",
|
|
19192
|
-
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
19193
|
-
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
19194
|
-
className
|
|
19195
|
-
),
|
|
19196
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
19197
|
-
...props,
|
|
19198
|
-
children: [
|
|
19199
|
-
children,
|
|
19200
|
-
showCloseButton ? /* @__PURE__ */ jsx20(
|
|
19201
|
-
DialogPrimitive.Close,
|
|
19202
|
-
{
|
|
19203
|
-
type: "button",
|
|
19204
|
-
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
19205
|
-
"aria-label": "Close",
|
|
19206
|
-
children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
|
|
19207
|
-
}
|
|
19208
|
-
) : null
|
|
19209
|
-
]
|
|
19210
|
-
}
|
|
19211
|
-
)
|
|
19212
|
-
] });
|
|
19213
|
-
}
|
|
19214
|
-
);
|
|
19215
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
19216
|
-
function DialogHeader({
|
|
19217
|
-
className,
|
|
19218
|
-
...props
|
|
19219
|
-
}) {
|
|
19220
|
-
return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
19221
|
-
}
|
|
19222
|
-
function DialogFooter({
|
|
19223
|
-
className,
|
|
19224
|
-
...props
|
|
19225
|
-
}) {
|
|
19226
|
-
return /* @__PURE__ */ jsx20(
|
|
19227
|
-
"div",
|
|
19228
|
-
{
|
|
19229
|
-
className: cn("flex items-center justify-end gap-2", className),
|
|
19230
|
-
...props
|
|
19231
|
-
}
|
|
19232
|
-
);
|
|
19233
|
-
}
|
|
19234
|
-
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19235
|
-
DialogPrimitive.Title,
|
|
19236
|
-
{
|
|
19237
|
-
ref,
|
|
19238
|
-
className: cn(
|
|
19239
|
-
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
19240
|
-
className
|
|
19241
|
-
),
|
|
19242
|
-
...props
|
|
19243
|
-
}
|
|
19244
|
-
));
|
|
19245
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
19246
|
-
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
19247
|
-
DialogPrimitive.Description,
|
|
19248
|
-
{
|
|
19249
|
-
ref,
|
|
19250
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
19251
|
-
...props
|
|
19252
|
-
}
|
|
19253
|
-
));
|
|
19254
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
19255
|
-
var DialogClose = DialogPrimitive.Close;
|
|
19256
|
-
|
|
19257
18943
|
// src/ui/ai-section/AiMediaStripOverlay.tsx
|
|
19258
|
-
import { Fragment as Fragment7, jsx as
|
|
19259
|
-
var PRIMARY3 = "
|
|
19260
|
-
var
|
|
18944
|
+
import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
18945
|
+
var PRIMARY3 = "#0885FE";
|
|
18946
|
+
var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
|
|
18947
|
+
var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
|
|
19261
18948
|
function findMediaStripItemElement(sectionId, index) {
|
|
19262
18949
|
const sectionEl = findByInstanceId(sectionId);
|
|
19263
18950
|
if (!sectionEl) return null;
|
|
@@ -19267,35 +18954,14 @@ function findMediaStripItemElement(sectionId, index) {
|
|
|
19267
18954
|
}
|
|
19268
18955
|
return null;
|
|
19269
18956
|
}
|
|
19270
|
-
function
|
|
19271
|
-
|
|
19272
|
-
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19273
|
-
const itemEl = target.closest("[data-ohw-media-strip-item]");
|
|
19274
|
-
if (!itemEl) return null;
|
|
19275
|
-
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19276
|
-
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19277
|
-
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19278
|
-
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19279
|
-
if (!sectionId || Number.isNaN(index)) return null;
|
|
19280
|
-
return { sectionId, index };
|
|
19281
|
-
}
|
|
19282
|
-
function sameRef(a, b) {
|
|
19283
|
-
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19284
|
-
}
|
|
19285
|
-
function rectOf(el) {
|
|
18957
|
+
function readRect2(ref) {
|
|
18958
|
+
const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19286
18959
|
if (!el) return null;
|
|
19287
18960
|
const r2 = el.getBoundingClientRect();
|
|
19288
18961
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19289
18962
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19290
18963
|
}
|
|
19291
|
-
function
|
|
19292
|
-
return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
|
|
19293
|
-
}
|
|
19294
|
-
function readStripRect(ref) {
|
|
19295
|
-
const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
|
|
19296
|
-
return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
|
|
19297
|
-
}
|
|
19298
|
-
function useLiveItemRect(ref, strip = false) {
|
|
18964
|
+
function useLiveItemRect(ref) {
|
|
19299
18965
|
const [rect, setRect] = useState8(null);
|
|
19300
18966
|
useEffect8(() => {
|
|
19301
18967
|
if (!ref) {
|
|
@@ -19303,7 +18969,7 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19303
18969
|
return;
|
|
19304
18970
|
}
|
|
19305
18971
|
const update = () => {
|
|
19306
|
-
const next =
|
|
18972
|
+
const next = readRect2(ref);
|
|
19307
18973
|
setRect(
|
|
19308
18974
|
(prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
|
|
19309
18975
|
);
|
|
@@ -19318,49 +18984,9 @@ function useLiveItemRect(ref, strip = false) {
|
|
|
19318
18984
|
window.removeEventListener("resize", update);
|
|
19319
18985
|
clearInterval(interval);
|
|
19320
18986
|
};
|
|
19321
|
-
}, [ref?.sectionId, ref?.index
|
|
18987
|
+
}, [ref?.sectionId, ref?.index]);
|
|
19322
18988
|
return rect;
|
|
19323
18989
|
}
|
|
19324
|
-
var TOOLBAR_STRIP_GAP = 52;
|
|
19325
|
-
var TOOLBAR_STRIP_GAP_MOBILE = 42;
|
|
19326
|
-
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19327
|
-
function StripToolbarSlot({ stripRect, children }) {
|
|
19328
|
-
const slotRef = useRef5(null);
|
|
19329
|
-
const [shift, setShift] = useState8(0);
|
|
19330
|
-
const centerX = stripRect.left + stripRect.width / 2;
|
|
19331
|
-
useLayoutEffect4(() => {
|
|
19332
|
-
const slot = slotRef.current;
|
|
19333
|
-
if (!slot) return;
|
|
19334
|
-
const clamp = () => {
|
|
19335
|
-
const w = slot.offsetWidth;
|
|
19336
|
-
if (w <= 0) return;
|
|
19337
|
-
const half = w / 2;
|
|
19338
|
-
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19339
|
-
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19340
|
-
};
|
|
19341
|
-
clamp();
|
|
19342
|
-
const ro = new ResizeObserver(clamp);
|
|
19343
|
-
ro.observe(slot);
|
|
19344
|
-
return () => ro.disconnect();
|
|
19345
|
-
}, [centerX, children]);
|
|
19346
|
-
const mobile = window.innerWidth <= 480;
|
|
19347
|
-
return /* @__PURE__ */ jsx21(
|
|
19348
|
-
"div",
|
|
19349
|
-
{
|
|
19350
|
-
ref: slotRef,
|
|
19351
|
-
"data-ohw-bridge": "",
|
|
19352
|
-
"data-ohw-item-interaction": "",
|
|
19353
|
-
className: "pointer-events-auto fixed",
|
|
19354
|
-
style: {
|
|
19355
|
-
top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
|
|
19356
|
-
left: centerX + shift,
|
|
19357
|
-
transform: "translate(-50%, -100%)",
|
|
19358
|
-
zIndex: 2147483645
|
|
19359
|
-
},
|
|
19360
|
-
children
|
|
19361
|
-
}
|
|
19362
|
-
);
|
|
19363
|
-
}
|
|
19364
18990
|
function requestValidateTree(postToParent2, tree) {
|
|
19365
18991
|
return new Promise((resolve) => {
|
|
19366
18992
|
const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
@@ -19397,72 +19023,116 @@ function requestAssetPick(postToParent2) {
|
|
|
19397
19023
|
postToParent2({ type: "ow:asset-pick", id });
|
|
19398
19024
|
});
|
|
19399
19025
|
}
|
|
19400
|
-
function
|
|
19026
|
+
function Pill({
|
|
19401
19027
|
label,
|
|
19402
19028
|
onClick,
|
|
19403
|
-
disabled
|
|
19404
|
-
active
|
|
19405
|
-
children
|
|
19029
|
+
disabled,
|
|
19030
|
+
active
|
|
19406
19031
|
}) {
|
|
19407
|
-
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
|
|
19412
|
-
|
|
19413
|
-
|
|
19414
|
-
|
|
19032
|
+
return /* @__PURE__ */ jsx20(
|
|
19033
|
+
"button",
|
|
19034
|
+
{
|
|
19035
|
+
type: "button",
|
|
19036
|
+
onClick,
|
|
19037
|
+
disabled,
|
|
19038
|
+
style: {
|
|
19039
|
+
height: 28,
|
|
19040
|
+
padding: "0 10px",
|
|
19041
|
+
display: "inline-flex",
|
|
19042
|
+
alignItems: "center",
|
|
19043
|
+
gap: 4,
|
|
19044
|
+
borderRadius: 999,
|
|
19045
|
+
border: "none",
|
|
19046
|
+
cursor: disabled ? "default" : "pointer",
|
|
19047
|
+
background: active ? OHW_BLUE_DARK : "#ffffff",
|
|
19048
|
+
color: active ? "#ffffff" : OHW_BLUE_DARK,
|
|
19049
|
+
opacity: disabled ? 0.4 : 1,
|
|
19050
|
+
fontSize: 12,
|
|
19051
|
+
lineHeight: "16px",
|
|
19052
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19053
|
+
whiteSpace: "nowrap",
|
|
19054
|
+
flex: "0 0 auto"
|
|
19055
|
+
},
|
|
19056
|
+
children: label
|
|
19057
|
+
}
|
|
19058
|
+
);
|
|
19415
19059
|
}
|
|
19416
|
-
function
|
|
19417
|
-
|
|
19418
|
-
value,
|
|
19419
|
-
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19423
|
-
|
|
19424
|
-
|
|
19425
|
-
|
|
19426
|
-
|
|
19427
|
-
"
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
) }),
|
|
19438
|
-
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
|
|
19439
|
-
const selected = option.value === value;
|
|
19440
|
-
return /* @__PURE__ */ jsxs12(
|
|
19441
|
-
DropdownMenuItem,
|
|
19060
|
+
function AltInput({ value, onCommit }) {
|
|
19061
|
+
const [draft, setDraft] = useState8(value);
|
|
19062
|
+
useEffect8(() => setDraft(value), [value]);
|
|
19063
|
+
return /* @__PURE__ */ jsxs11(
|
|
19064
|
+
"div",
|
|
19065
|
+
{
|
|
19066
|
+
style: {
|
|
19067
|
+
display: "flex",
|
|
19068
|
+
alignItems: "center",
|
|
19069
|
+
gap: 6,
|
|
19070
|
+
height: 28,
|
|
19071
|
+
padding: "0 12px",
|
|
19072
|
+
borderRadius: 999,
|
|
19073
|
+
background: "#ffffff",
|
|
19074
|
+
width: "100%",
|
|
19075
|
+
maxWidth: 260,
|
|
19076
|
+
boxSizing: "border-box"
|
|
19077
|
+
},
|
|
19078
|
+
children: [
|
|
19079
|
+
/* @__PURE__ */ jsx20(
|
|
19080
|
+
"span",
|
|
19442
19081
|
{
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
)
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19082
|
+
style: {
|
|
19083
|
+
flex: "0 0 auto",
|
|
19084
|
+
color: OHW_BLUE_DARK,
|
|
19085
|
+
fontSize: 10,
|
|
19086
|
+
fontWeight: 700,
|
|
19087
|
+
textTransform: "uppercase",
|
|
19088
|
+
letterSpacing: 0.4
|
|
19089
|
+
},
|
|
19090
|
+
children: "Alt"
|
|
19091
|
+
}
|
|
19092
|
+
),
|
|
19093
|
+
/* @__PURE__ */ jsx20(
|
|
19094
|
+
"input",
|
|
19095
|
+
{
|
|
19096
|
+
type: "text",
|
|
19097
|
+
value: draft,
|
|
19098
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19099
|
+
onBlur: () => {
|
|
19100
|
+
if (draft !== value) onCommit(draft);
|
|
19101
|
+
},
|
|
19102
|
+
onKeyDown: (e) => {
|
|
19103
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19104
|
+
if (e.key === "Escape") {
|
|
19105
|
+
setDraft(value);
|
|
19106
|
+
e.currentTarget.blur();
|
|
19107
|
+
}
|
|
19108
|
+
},
|
|
19109
|
+
placeholder: "Describe this image",
|
|
19110
|
+
"aria-label": "Image alt text",
|
|
19111
|
+
style: {
|
|
19112
|
+
flex: 1,
|
|
19113
|
+
minWidth: 0,
|
|
19114
|
+
border: "none",
|
|
19115
|
+
outline: "none",
|
|
19116
|
+
background: "transparent",
|
|
19117
|
+
fontSize: 12,
|
|
19118
|
+
lineHeight: "16px",
|
|
19119
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19120
|
+
color: "#1f2937"
|
|
19121
|
+
}
|
|
19122
|
+
}
|
|
19123
|
+
)
|
|
19124
|
+
]
|
|
19125
|
+
}
|
|
19126
|
+
);
|
|
19457
19127
|
}
|
|
19458
19128
|
var VARIANTS = [
|
|
19459
19129
|
{ value: "logos", label: "Logos" },
|
|
19460
19130
|
{ value: "reel", label: "Reel" }
|
|
19461
19131
|
];
|
|
19462
19132
|
var ALIGNS = [
|
|
19463
|
-
{ value: "left", label: "
|
|
19464
|
-
{ value: "center", label: "
|
|
19465
|
-
{ value: "right", label: "
|
|
19133
|
+
{ value: "left", label: "Left" },
|
|
19134
|
+
{ value: "center", label: "Center" },
|
|
19135
|
+
{ value: "right", label: "Right" }
|
|
19466
19136
|
];
|
|
19467
19137
|
var HOVERS = [
|
|
19468
19138
|
{ value: "none", label: "None" },
|
|
@@ -19470,104 +19140,104 @@ var HOVERS = [
|
|
|
19470
19140
|
{ value: "zoom", label: "Zoom" },
|
|
19471
19141
|
{ value: "fade", label: "Fade" }
|
|
19472
19142
|
];
|
|
19143
|
+
var TREATMENTS = [
|
|
19144
|
+
{ value: "color", label: "Color" },
|
|
19145
|
+
{ value: "grayscale", label: "Grayscale" }
|
|
19146
|
+
];
|
|
19473
19147
|
var HTTP_URL_RE = /^https?:\/\/\S+$/i;
|
|
19474
|
-
function
|
|
19475
|
-
|
|
19476
|
-
linkTarget,
|
|
19477
|
-
onClose,
|
|
19478
|
-
onSave
|
|
19479
|
-
}) {
|
|
19480
|
-
const [draft, setDraft] = useState8(href);
|
|
19481
|
-
const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
|
|
19148
|
+
function LinkInput({ value, onCommit }) {
|
|
19149
|
+
const [draft, setDraft] = useState8(value);
|
|
19482
19150
|
const [invalid, setInvalid] = useState8(false);
|
|
19483
|
-
|
|
19151
|
+
useEffect8(() => {
|
|
19152
|
+
setDraft(value);
|
|
19153
|
+
setInvalid(false);
|
|
19154
|
+
}, [value]);
|
|
19155
|
+
const commit2 = () => {
|
|
19484
19156
|
const next = draft.trim();
|
|
19485
|
-
if (next
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
onSave(next, newTab ? "new-tab" : "same-tab");
|
|
19490
|
-
onClose();
|
|
19157
|
+
if (next === value) return setInvalid(false);
|
|
19158
|
+
if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
|
|
19159
|
+
setInvalid(false);
|
|
19160
|
+
onCommit(next);
|
|
19491
19161
|
};
|
|
19492
|
-
return /* @__PURE__ */
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
"
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
"
|
|
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
|
-
|
|
19162
|
+
return /* @__PURE__ */ jsxs11(
|
|
19163
|
+
"div",
|
|
19164
|
+
{
|
|
19165
|
+
style: {
|
|
19166
|
+
display: "flex",
|
|
19167
|
+
alignItems: "center",
|
|
19168
|
+
gap: 6,
|
|
19169
|
+
height: 28,
|
|
19170
|
+
padding: "0 12px",
|
|
19171
|
+
borderRadius: 999,
|
|
19172
|
+
background: "#ffffff",
|
|
19173
|
+
width: "100%",
|
|
19174
|
+
maxWidth: 260,
|
|
19175
|
+
boxSizing: "border-box",
|
|
19176
|
+
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
19177
|
+
},
|
|
19178
|
+
children: [
|
|
19179
|
+
/* @__PURE__ */ jsx20(
|
|
19180
|
+
"span",
|
|
19181
|
+
{
|
|
19182
|
+
style: {
|
|
19183
|
+
flex: "0 0 auto",
|
|
19184
|
+
color: OHW_BLUE_DARK,
|
|
19185
|
+
fontSize: 10,
|
|
19186
|
+
fontWeight: 700,
|
|
19187
|
+
textTransform: "uppercase",
|
|
19188
|
+
letterSpacing: 0.4
|
|
19189
|
+
},
|
|
19190
|
+
children: "Link"
|
|
19191
|
+
}
|
|
19192
|
+
),
|
|
19193
|
+
/* @__PURE__ */ jsx20(
|
|
19194
|
+
"input",
|
|
19195
|
+
{
|
|
19196
|
+
type: "text",
|
|
19197
|
+
inputMode: "url",
|
|
19198
|
+
value: draft,
|
|
19199
|
+
onChange: (e) => setDraft(e.target.value),
|
|
19200
|
+
onBlur: commit2,
|
|
19201
|
+
onKeyDown: (e) => {
|
|
19202
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
19203
|
+
if (e.key === "Escape") {
|
|
19204
|
+
setDraft(value);
|
|
19205
|
+
setInvalid(false);
|
|
19206
|
+
e.currentTarget.blur();
|
|
19207
|
+
}
|
|
19208
|
+
},
|
|
19209
|
+
placeholder: "https://example.com",
|
|
19210
|
+
"aria-label": "Image link URL",
|
|
19211
|
+
"aria-invalid": invalid,
|
|
19212
|
+
style: {
|
|
19213
|
+
flex: 1,
|
|
19214
|
+
minWidth: 0,
|
|
19215
|
+
border: "none",
|
|
19216
|
+
outline: "none",
|
|
19217
|
+
background: "transparent",
|
|
19218
|
+
fontSize: 12,
|
|
19219
|
+
lineHeight: "16px",
|
|
19220
|
+
fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
|
|
19221
|
+
color: "#1f2937"
|
|
19222
|
+
}
|
|
19223
|
+
}
|
|
19224
|
+
)
|
|
19225
|
+
]
|
|
19226
|
+
}
|
|
19227
|
+
);
|
|
19557
19228
|
}
|
|
19558
19229
|
function MediaStripToolbar({
|
|
19559
19230
|
entry,
|
|
19560
19231
|
index,
|
|
19561
19232
|
pending,
|
|
19562
19233
|
error,
|
|
19563
|
-
itemEditOn,
|
|
19564
|
-
onToggleItemEdit,
|
|
19565
19234
|
onSetVariant,
|
|
19566
19235
|
onSetAlign,
|
|
19567
19236
|
onSetHover,
|
|
19568
19237
|
onSetTreatment,
|
|
19569
19238
|
onResize,
|
|
19570
|
-
|
|
19239
|
+
onSetAlt,
|
|
19240
|
+
onSetLink,
|
|
19571
19241
|
onAddItem,
|
|
19572
19242
|
onRemoveItem,
|
|
19573
19243
|
onChangeImage,
|
|
@@ -19576,102 +19246,81 @@ function MediaStripToolbar({
|
|
|
19576
19246
|
}) {
|
|
19577
19247
|
const items = mediaStripItems(entry.tree);
|
|
19578
19248
|
const itemCount = items.length;
|
|
19249
|
+
const currentAlt = items[index]?.alt ?? "";
|
|
19250
|
+
const currentHref2 = items[index]?.href ?? "";
|
|
19251
|
+
const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
|
|
19579
19252
|
const slots = findMediaStripSlots(entry.tree);
|
|
19580
19253
|
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19581
19254
|
const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
|
|
19582
19255
|
const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
|
|
19583
19256
|
const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
|
|
19584
19257
|
const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19585
|
-
const
|
|
19586
|
-
const
|
|
19587
|
-
|
|
19258
|
+
const isMobile = window.innerWidth <= 480;
|
|
19259
|
+
const rowStyle = isMobile ? {
|
|
19260
|
+
display: "flex",
|
|
19261
|
+
gap: 6,
|
|
19262
|
+
flexWrap: "nowrap",
|
|
19263
|
+
justifyContent: "center",
|
|
19264
|
+
overflowX: "auto",
|
|
19265
|
+
WebkitOverflowScrolling: "touch",
|
|
19266
|
+
width: "100%",
|
|
19267
|
+
scrollbarWidth: "none"
|
|
19268
|
+
} : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
|
|
19269
|
+
return /* @__PURE__ */ jsxs11(
|
|
19588
19270
|
"div",
|
|
19589
19271
|
{
|
|
19590
19272
|
"data-ohw-bridge": "",
|
|
19591
19273
|
"data-ohw-toolbar": "",
|
|
19592
19274
|
onMouseDown: (e) => e.stopPropagation(),
|
|
19593
|
-
|
|
19594
|
-
|
|
19275
|
+
style: {
|
|
19276
|
+
display: "flex",
|
|
19277
|
+
flexDirection: "column",
|
|
19278
|
+
gap: 6,
|
|
19279
|
+
alignItems: "center",
|
|
19280
|
+
background: OHW_BLUE,
|
|
19281
|
+
padding: 8,
|
|
19282
|
+
borderRadius: 12,
|
|
19283
|
+
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
19284
|
+
pointerEvents: pending ? "none" : "auto",
|
|
19285
|
+
opacity: pending ? 0.6 : 1,
|
|
19286
|
+
maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
|
|
19287
|
+
},
|
|
19595
19288
|
children: [
|
|
19596
|
-
/* @__PURE__ */
|
|
19597
|
-
|
|
19598
|
-
{
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
) }),
|
|
19629
|
-
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
|
|
19630
|
-
] }),
|
|
19631
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19632
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19633
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19634
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19635
|
-
/* @__PURE__ */ jsx21(
|
|
19636
|
-
ToolbarAction,
|
|
19637
|
-
{
|
|
19638
|
-
label: gatedLabel("Move right"),
|
|
19639
|
-
onClick: onMoveRight,
|
|
19640
|
-
disabled: !itemEditOn || index >= itemCount - 1,
|
|
19641
|
-
children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
|
|
19642
|
-
}
|
|
19643
|
-
),
|
|
19644
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19645
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19646
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
|
|
19647
|
-
/* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
|
|
19648
|
-
/* @__PURE__ */ jsx21(
|
|
19649
|
-
ToolbarAction,
|
|
19650
|
-
{
|
|
19651
|
-
label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
|
|
19652
|
-
active: treatment === "grayscale",
|
|
19653
|
-
onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
|
|
19654
|
-
children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
|
|
19655
|
-
}
|
|
19656
|
-
),
|
|
19657
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19658
|
-
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)),
|
|
19659
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19660
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19661
|
-
/* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
|
|
19662
|
-
sizeValue,
|
|
19663
|
-
"px"
|
|
19664
|
-
] }),
|
|
19665
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19666
|
-
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19667
|
-
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
19668
|
-
]
|
|
19669
|
-
}
|
|
19670
|
-
),
|
|
19671
|
-
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 })
|
|
19289
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19290
|
+
VARIANTS.map((v) => /* @__PURE__ */ jsx20(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
|
|
19291
|
+
ALIGNS.map((a) => /* @__PURE__ */ jsx20(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
|
|
19292
|
+
] }),
|
|
19293
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19294
|
+
HOVERS.map((h) => /* @__PURE__ */ jsx20(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
|
|
19295
|
+
TREATMENTS.map((t) => /* @__PURE__ */ jsx20(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
|
|
19296
|
+
] }),
|
|
19297
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
19298
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
|
|
19299
|
+
/* @__PURE__ */ jsxs11("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
|
|
19300
|
+
sizeValue,
|
|
19301
|
+
"px"
|
|
19302
|
+
] }),
|
|
19303
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+", onClick: () => onResize(8) })
|
|
19304
|
+
] }),
|
|
19305
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
|
|
19306
|
+
/* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
|
|
19307
|
+
currentHref2 && /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19308
|
+
/* @__PURE__ */ jsx20(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
|
|
19309
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
|
|
19310
|
+
] }),
|
|
19311
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19312
|
+
/* @__PURE__ */ jsx20(Pill, { label: "Change Image", onClick: onChangeImage }),
|
|
19313
|
+
/* @__PURE__ */ jsx20(Pill, { label: "+ Item", onClick: onAddItem }),
|
|
19314
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
|
|
19315
|
+
] }),
|
|
19316
|
+
/* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
|
|
19317
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
|
|
19318
|
+
/* @__PURE__ */ jsx20(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
|
|
19319
|
+
] }),
|
|
19320
|
+
error && /* @__PURE__ */ jsx20("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
19672
19321
|
]
|
|
19673
19322
|
}
|
|
19674
|
-
)
|
|
19323
|
+
);
|
|
19675
19324
|
}
|
|
19676
19325
|
function findMediaStripSlots(tree) {
|
|
19677
19326
|
const stack = tree.rows.flatMap((row) => row.blocks);
|
|
@@ -19690,23 +19339,31 @@ function AiMediaStripOverlay({
|
|
|
19690
19339
|
}) {
|
|
19691
19340
|
const [hover, setHover] = useState8(null);
|
|
19692
19341
|
const [active, setActive] = useState8(null);
|
|
19693
|
-
const [itemEditOn, setItemEditOn] = useState8(false);
|
|
19694
|
-
const [linkOpen, setLinkOpen] = useState8(false);
|
|
19695
19342
|
const [pending, setPending] = useState8(false);
|
|
19696
19343
|
const [error, setError] = useState8(null);
|
|
19697
19344
|
const activeRef = useRef5(null);
|
|
19698
19345
|
activeRef.current = active;
|
|
19699
|
-
const linkOpenRef = useRef5(false);
|
|
19700
|
-
linkOpenRef.current = linkOpen;
|
|
19701
19346
|
useEffect8(() => {
|
|
19702
19347
|
const onMove = (e) => {
|
|
19703
|
-
const ref = itemRefFromTarget(e.target);
|
|
19704
19348
|
const t = e.target;
|
|
19705
|
-
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19349
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19350
|
+
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]")) {
|
|
19351
|
+
return;
|
|
19352
|
+
}
|
|
19353
|
+
const itemEl = t.closest("[data-ohw-media-strip-item]");
|
|
19354
|
+
if (!itemEl) {
|
|
19355
|
+
setHover(null);
|
|
19356
|
+
return;
|
|
19357
|
+
}
|
|
19358
|
+
const sectionEl = itemEl.closest("[data-ohw-section]");
|
|
19359
|
+
const unit = sectionEl ? movableUnit(sectionEl) : null;
|
|
19360
|
+
const sectionId = unit ? instanceIdOf(unit) || null : null;
|
|
19361
|
+
const index = Number(itemEl.dataset.ohwMediaStripIndex);
|
|
19362
|
+
if (!sectionId || Number.isNaN(index)) {
|
|
19363
|
+
setHover(null);
|
|
19364
|
+
return;
|
|
19365
|
+
}
|
|
19366
|
+
setHover({ sectionId, index });
|
|
19710
19367
|
};
|
|
19711
19368
|
const onLeave = () => setHover(null);
|
|
19712
19369
|
document.addEventListener("mousemove", onMove, { passive: true });
|
|
@@ -19718,25 +19375,23 @@ function AiMediaStripOverlay({
|
|
|
19718
19375
|
}, []);
|
|
19719
19376
|
useEffect8(() => {
|
|
19720
19377
|
const onClick = (e) => {
|
|
19378
|
+
const current = activeRef.current;
|
|
19379
|
+
if (!current) return;
|
|
19721
19380
|
const t = e.target;
|
|
19722
|
-
if (!(t instanceof
|
|
19723
|
-
if (t.closest(
|
|
19724
|
-
const
|
|
19725
|
-
if (
|
|
19726
|
-
|
|
19727
|
-
setItemEditOn(false);
|
|
19381
|
+
if (!(t instanceof HTMLElement)) return;
|
|
19382
|
+
if (t.closest("[data-ohw-item-interaction]")) return;
|
|
19383
|
+
const itemEl = findMediaStripItemElement(current.sectionId, current.index);
|
|
19384
|
+
if (itemEl && itemEl.contains(t)) return;
|
|
19385
|
+
setActive(null);
|
|
19728
19386
|
setError(null);
|
|
19729
|
-
setActive(ref);
|
|
19730
19387
|
};
|
|
19731
19388
|
document.addEventListener("click", onClick, true);
|
|
19732
19389
|
return () => document.removeEventListener("click", onClick, true);
|
|
19733
|
-
}, [
|
|
19390
|
+
}, []);
|
|
19734
19391
|
useEffect8(() => {
|
|
19735
19392
|
const onBlur = () => {
|
|
19736
19393
|
if (!activeRef.current) return;
|
|
19737
19394
|
setActive(null);
|
|
19738
|
-
setItemEditOn(false);
|
|
19739
|
-
setLinkOpen(false);
|
|
19740
19395
|
setError(null);
|
|
19741
19396
|
};
|
|
19742
19397
|
window.addEventListener("blur", onBlur);
|
|
@@ -19746,10 +19401,7 @@ function AiMediaStripOverlay({
|
|
|
19746
19401
|
const onKeyDown = (e) => {
|
|
19747
19402
|
if (e.key !== "Escape") return;
|
|
19748
19403
|
if (!activeRef.current) return;
|
|
19749
|
-
if (linkOpenRef.current) return;
|
|
19750
|
-
if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
|
|
19751
19404
|
setActive(null);
|
|
19752
|
-
setItemEditOn(false);
|
|
19753
19405
|
setError(null);
|
|
19754
19406
|
};
|
|
19755
19407
|
document.addEventListener("keydown", onKeyDown);
|
|
@@ -19783,133 +19435,137 @@ function AiMediaStripOverlay({
|
|
|
19783
19435
|
tree: nextTree,
|
|
19784
19436
|
label: entry.label,
|
|
19785
19437
|
media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
|
|
19786
|
-
...entry.brand ? { brand: entry.brand } : {}
|
|
19787
|
-
// The user is already looking at the strip they just edited — recentering the viewport
|
|
19788
|
-
// on every edit reads as the section jumping around.
|
|
19789
|
-
skipScrollIntoView: true
|
|
19438
|
+
...entry.brand ? { brand: entry.brand } : {}
|
|
19790
19439
|
});
|
|
19791
19440
|
return true;
|
|
19792
19441
|
},
|
|
19793
19442
|
[findEntry, postToParent2, applyTreeLocalRef]
|
|
19794
19443
|
);
|
|
19795
19444
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
19445
|
+
const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
|
|
19796
19446
|
const activeItemRect = useLiveItemRect(active);
|
|
19797
|
-
const
|
|
19798
|
-
const
|
|
19799
|
-
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
|
|
19803
|
-
|
|
19804
|
-
|
|
19805
|
-
|
|
19806
|
-
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
|
|
19810
|
-
|
|
19811
|
-
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
|
|
19821
|
-
|
|
19822
|
-
|
|
19823
|
-
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19447
|
+
const TOOLBAR_APPROX_H = 170;
|
|
19448
|
+
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
19449
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
19450
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx20(
|
|
19451
|
+
"button",
|
|
19452
|
+
{
|
|
19453
|
+
type: "button",
|
|
19454
|
+
"data-ohw-toolbar": "",
|
|
19455
|
+
onClick: () => {
|
|
19456
|
+
clearInteractionChromeRef.current();
|
|
19457
|
+
setActive(hover);
|
|
19458
|
+
},
|
|
19459
|
+
"aria-label": "Configure media item",
|
|
19460
|
+
style: {
|
|
19461
|
+
position: "fixed",
|
|
19462
|
+
top: hoverHandleRect.top + 8,
|
|
19463
|
+
left: hoverHandleRect.left + hoverHandleRect.width - 36,
|
|
19464
|
+
width: 28,
|
|
19465
|
+
height: 28,
|
|
19466
|
+
borderRadius: 8,
|
|
19467
|
+
border: `1.5px dashed ${PRIMARY3}`,
|
|
19468
|
+
background: "#ffffff",
|
|
19469
|
+
color: PRIMARY3,
|
|
19470
|
+
display: "flex",
|
|
19471
|
+
alignItems: "center",
|
|
19472
|
+
justifyContent: "center",
|
|
19473
|
+
cursor: "pointer",
|
|
19474
|
+
zIndex: 2147483643,
|
|
19475
|
+
fontSize: 14,
|
|
19476
|
+
fontWeight: 700
|
|
19477
|
+
},
|
|
19478
|
+
children: /* @__PURE__ */ jsx20(Star, { size: 14, style: { pointerEvents: "none" } })
|
|
19479
|
+
}
|
|
19480
|
+
),
|
|
19481
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
|
|
19482
|
+
ItemInteractionLayer,
|
|
19483
|
+
{
|
|
19484
|
+
rect: activeItemRect,
|
|
19485
|
+
state: toolbarState,
|
|
19486
|
+
toolbar: /* @__PURE__ */ jsx20(
|
|
19487
|
+
MediaStripToolbar,
|
|
19488
|
+
{
|
|
19489
|
+
entry: activeEntry,
|
|
19490
|
+
index: active.index,
|
|
19491
|
+
pending,
|
|
19492
|
+
error,
|
|
19493
|
+
onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
|
|
19494
|
+
onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
|
|
19495
|
+
onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
|
|
19496
|
+
onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
|
|
19497
|
+
onResize: (delta) => {
|
|
19498
|
+
const slots = findMediaStripSlots(activeEntry.tree);
|
|
19499
|
+
const variant = slots?.variant === "reel" ? "reel" : "logos";
|
|
19500
|
+
const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
|
|
19501
|
+
void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
|
|
19502
|
+
},
|
|
19503
|
+
onSetAlt: (alt) => {
|
|
19504
|
+
void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
|
|
19505
|
+
},
|
|
19506
|
+
onSetLink: (href, linkTarget) => {
|
|
19831
19507
|
void runMutation(
|
|
19832
19508
|
active.sectionId,
|
|
19833
|
-
(tree) =>
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19509
|
+
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19510
|
+
);
|
|
19511
|
+
},
|
|
19512
|
+
onAddItem: () => {
|
|
19513
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19514
|
+
if (!picked) return;
|
|
19515
|
+
const item = { assetId: picked.assetId, alt: "Logo" };
|
|
19516
|
+
void runMutation(
|
|
19517
|
+
active.sectionId,
|
|
19518
|
+
(tree) => addMediaStripItem(tree, item, active.index),
|
|
19519
|
+
{ [picked.assetId]: picked.url }
|
|
19520
|
+
).then((applied) => {
|
|
19521
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19522
|
+
});
|
|
19837
19523
|
});
|
|
19838
|
-
}
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19524
|
+
},
|
|
19525
|
+
onChangeImage: () => {
|
|
19526
|
+
void requestAssetPick(postToParent2).then((picked) => {
|
|
19527
|
+
if (!picked) return;
|
|
19528
|
+
void runMutation(
|
|
19529
|
+
active.sectionId,
|
|
19530
|
+
(tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
|
|
19531
|
+
{ [picked.assetId]: picked.url }
|
|
19532
|
+
);
|
|
19533
|
+
});
|
|
19534
|
+
},
|
|
19535
|
+
onRemoveItem: () => {
|
|
19536
|
+
void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
|
|
19537
|
+
(applied) => {
|
|
19538
|
+
if (applied) setActive(null);
|
|
19539
|
+
}
|
|
19847
19540
|
);
|
|
19848
|
-
}
|
|
19849
|
-
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
},
|
|
19864
|
-
onMoveRight: () => {
|
|
19865
|
-
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19866
|
-
(applied) => {
|
|
19867
|
-
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19868
|
-
}
|
|
19869
|
-
);
|
|
19870
|
-
}
|
|
19871
|
-
}
|
|
19872
|
-
) }),
|
|
19873
|
-
/* @__PURE__ */ jsx21(
|
|
19874
|
-
"div",
|
|
19875
|
-
{
|
|
19876
|
-
"data-ohw-bridge": "",
|
|
19877
|
-
"data-ohw-item-interaction": "",
|
|
19878
|
-
"aria-hidden": true,
|
|
19879
|
-
className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
|
|
19880
|
-
style: {
|
|
19881
|
-
top: activeItemRect.top + activeItemRect.height + 10,
|
|
19882
|
-
left: activeItemRect.left - 5,
|
|
19883
|
-
background: PRIMARY3,
|
|
19884
|
-
zIndex: 2147483644
|
|
19885
|
-
},
|
|
19886
|
-
children: "Media item"
|
|
19887
|
-
}
|
|
19888
|
-
),
|
|
19889
|
-
linkOpen && /* @__PURE__ */ jsx21(
|
|
19890
|
-
LinkModal,
|
|
19891
|
-
{
|
|
19892
|
-
href: activeHref,
|
|
19893
|
-
linkTarget: activeTarget,
|
|
19894
|
-
onClose: () => setLinkOpen(false),
|
|
19895
|
-
onSave: (href, linkTarget) => {
|
|
19896
|
-
void runMutation(
|
|
19897
|
-
active.sectionId,
|
|
19898
|
-
(tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
|
|
19899
|
-
);
|
|
19541
|
+
},
|
|
19542
|
+
onMoveLeft: () => {
|
|
19543
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
|
|
19544
|
+
(applied) => {
|
|
19545
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
|
|
19546
|
+
}
|
|
19547
|
+
);
|
|
19548
|
+
},
|
|
19549
|
+
onMoveRight: () => {
|
|
19550
|
+
void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
|
|
19551
|
+
(applied) => {
|
|
19552
|
+
if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
|
|
19553
|
+
}
|
|
19554
|
+
);
|
|
19555
|
+
}
|
|
19900
19556
|
}
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19557
|
+
)
|
|
19558
|
+
}
|
|
19559
|
+
)
|
|
19904
19560
|
] });
|
|
19905
19561
|
}
|
|
19906
19562
|
|
|
19907
19563
|
// src/ui/ai-section/AiPricingCardOverlay.tsx
|
|
19908
|
-
import { useCallback as useCallback4, useEffect as useEffect9, useLayoutEffect as
|
|
19909
|
-
import { Check as
|
|
19910
|
-
import { Fragment as Fragment8, jsx as
|
|
19564
|
+
import { useCallback as useCallback4, useEffect as useEffect9, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState9 } from "react";
|
|
19565
|
+
import { Check as Check2, ChevronDown as ChevronDown3, Minus, Plus as Plus2, Star as Star2 } from "lucide-react";
|
|
19566
|
+
import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
19911
19567
|
var PRIMARY4 = "var(--ohw-primary, #0885FE)";
|
|
19912
|
-
var
|
|
19568
|
+
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]";
|
|
19913
19569
|
function findPricingCardElement(sectionId, index) {
|
|
19914
19570
|
const sectionEl = findByInstanceId(sectionId);
|
|
19915
19571
|
if (!sectionEl) return null;
|
|
@@ -19921,7 +19577,7 @@ function findPricingCardElement(sectionId, index) {
|
|
|
19921
19577
|
}
|
|
19922
19578
|
function cardRefFromTarget(target) {
|
|
19923
19579
|
if (!(target instanceof Element)) return null;
|
|
19924
|
-
if (target.closest(
|
|
19580
|
+
if (target.closest(CHROME_SELECTOR)) return null;
|
|
19925
19581
|
const cardEl = target.closest("[data-ohw-pricing-card]");
|
|
19926
19582
|
if (!cardEl) return null;
|
|
19927
19583
|
const sectionEl = cardEl.closest("[data-ohw-section]");
|
|
@@ -19931,21 +19587,21 @@ function cardRefFromTarget(target) {
|
|
|
19931
19587
|
if (!sectionId || Number.isNaN(index)) return null;
|
|
19932
19588
|
return { sectionId, index };
|
|
19933
19589
|
}
|
|
19934
|
-
function
|
|
19590
|
+
function sameRef(a, b) {
|
|
19935
19591
|
return a?.sectionId === b?.sectionId && a?.index === b?.index;
|
|
19936
19592
|
}
|
|
19937
|
-
function
|
|
19593
|
+
function rectOf(el) {
|
|
19938
19594
|
if (!el) return null;
|
|
19939
19595
|
const r2 = el.getBoundingClientRect();
|
|
19940
19596
|
if (r2.width <= 0 || r2.height <= 0) return null;
|
|
19941
19597
|
return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
|
|
19942
19598
|
}
|
|
19943
19599
|
function readRect3(ref) {
|
|
19944
|
-
return
|
|
19600
|
+
return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
|
|
19945
19601
|
}
|
|
19946
19602
|
function readGridRect(ref) {
|
|
19947
19603
|
const card = ref && findPricingCardElement(ref.sectionId, ref.index);
|
|
19948
|
-
return
|
|
19604
|
+
return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
|
|
19949
19605
|
}
|
|
19950
19606
|
function useLiveCardRect(ref, grid = false) {
|
|
19951
19607
|
const [rect, setRect] = useState9(null);
|
|
@@ -19975,19 +19631,19 @@ function useLiveCardRect(ref, grid = false) {
|
|
|
19975
19631
|
}
|
|
19976
19632
|
var TOOLBAR_GRID_GAP = 52;
|
|
19977
19633
|
var TOOLBAR_GRID_GAP_MOBILE = 42;
|
|
19978
|
-
var
|
|
19634
|
+
var TOOLBAR_EDGE_MARGIN2 = 4;
|
|
19979
19635
|
function GridToolbarSlot({ gridRect, children }) {
|
|
19980
19636
|
const slotRef = useRef6(null);
|
|
19981
19637
|
const [shift, setShift] = useState9(0);
|
|
19982
19638
|
const centerX = gridRect.left + gridRect.width / 2;
|
|
19983
|
-
|
|
19639
|
+
useLayoutEffect4(() => {
|
|
19984
19640
|
const slot = slotRef.current;
|
|
19985
19641
|
if (!slot) return;
|
|
19986
19642
|
const clamp = () => {
|
|
19987
19643
|
const w = slot.offsetWidth;
|
|
19988
19644
|
if (w <= 0) return;
|
|
19989
19645
|
const half = w / 2;
|
|
19990
|
-
const clamped = Math.max(
|
|
19646
|
+
const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
|
|
19991
19647
|
setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
|
|
19992
19648
|
};
|
|
19993
19649
|
clamp();
|
|
@@ -19996,7 +19652,7 @@ function GridToolbarSlot({ gridRect, children }) {
|
|
|
19996
19652
|
return () => ro.disconnect();
|
|
19997
19653
|
}, [centerX, children]);
|
|
19998
19654
|
const mobile = window.innerWidth <= 480;
|
|
19999
|
-
return /* @__PURE__ */
|
|
19655
|
+
return /* @__PURE__ */ jsx21(
|
|
20000
19656
|
"div",
|
|
20001
19657
|
{
|
|
20002
19658
|
ref: slotRef,
|
|
@@ -20031,7 +19687,7 @@ function requestValidateTree2(postToParent2, tree) {
|
|
|
20031
19687
|
});
|
|
20032
19688
|
}
|
|
20033
19689
|
function StyleSwatch({ style }) {
|
|
20034
|
-
return /* @__PURE__ */
|
|
19690
|
+
return /* @__PURE__ */ jsx21(
|
|
20035
19691
|
"span",
|
|
20036
19692
|
{
|
|
20037
19693
|
"aria-hidden": true,
|
|
@@ -20045,35 +19701,35 @@ function StyleSwatch({ style }) {
|
|
|
20045
19701
|
);
|
|
20046
19702
|
}
|
|
20047
19703
|
function ButtonGlyph() {
|
|
20048
|
-
return /* @__PURE__ */
|
|
20049
|
-
/* @__PURE__ */
|
|
20050
|
-
/* @__PURE__ */
|
|
19704
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
19705
|
+
/* @__PURE__ */ jsx21("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19706
|
+
/* @__PURE__ */ jsx21("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20051
19707
|
] });
|
|
20052
19708
|
}
|
|
20053
19709
|
function FeatureGlyph({ mode }) {
|
|
20054
|
-
return /* @__PURE__ */
|
|
20055
|
-
/* @__PURE__ */
|
|
20056
|
-
/* @__PURE__ */
|
|
20057
|
-
/* @__PURE__ */
|
|
20058
|
-
/* @__PURE__ */
|
|
20059
|
-
/* @__PURE__ */
|
|
20060
|
-
mode === "add" && /* @__PURE__ */
|
|
19710
|
+
return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
|
|
19711
|
+
/* @__PURE__ */ jsx21("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
19712
|
+
/* @__PURE__ */ jsx21("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
19713
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
|
|
19714
|
+
/* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
|
|
19715
|
+
/* @__PURE__ */ jsx21("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
|
|
19716
|
+
mode === "add" && /* @__PURE__ */ jsx21("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
|
|
20061
19717
|
] });
|
|
20062
19718
|
}
|
|
20063
|
-
function
|
|
19719
|
+
function ToolbarAction({
|
|
20064
19720
|
label,
|
|
20065
19721
|
onClick,
|
|
20066
19722
|
disabled = false,
|
|
20067
19723
|
children
|
|
20068
19724
|
}) {
|
|
20069
|
-
const button = /* @__PURE__ */
|
|
20070
|
-
return /* @__PURE__ */
|
|
20071
|
-
/* @__PURE__ */
|
|
20072
|
-
/* @__PURE__ */
|
|
19725
|
+
const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
|
|
19726
|
+
return /* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19727
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
|
|
19728
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
|
|
20073
19729
|
] });
|
|
20074
19730
|
}
|
|
20075
|
-
function
|
|
20076
|
-
return /* @__PURE__ */
|
|
19731
|
+
function ToolbarSeparator() {
|
|
19732
|
+
return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
|
|
20077
19733
|
}
|
|
20078
19734
|
function CardStyleMenu({
|
|
20079
19735
|
value,
|
|
@@ -20081,7 +19737,7 @@ function CardStyleMenu({
|
|
|
20081
19737
|
disabled = false
|
|
20082
19738
|
}) {
|
|
20083
19739
|
const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
|
|
20084
|
-
const trigger = /* @__PURE__ */
|
|
19740
|
+
const trigger = /* @__PURE__ */ jsxs12(
|
|
20085
19741
|
"button",
|
|
20086
19742
|
{
|
|
20087
19743
|
type: "button",
|
|
@@ -20092,28 +19748,28 @@ function CardStyleMenu({
|
|
|
20092
19748
|
disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
20093
19749
|
),
|
|
20094
19750
|
children: [
|
|
20095
|
-
/* @__PURE__ */
|
|
20096
|
-
/* @__PURE__ */
|
|
20097
|
-
/* @__PURE__ */
|
|
19751
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: current.value }),
|
|
19752
|
+
/* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
|
|
19753
|
+
/* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
|
|
20098
19754
|
]
|
|
20099
19755
|
}
|
|
20100
19756
|
);
|
|
20101
19757
|
if (disabled) {
|
|
20102
|
-
return /* @__PURE__ */
|
|
20103
|
-
/* @__PURE__ */
|
|
20104
|
-
/* @__PURE__ */
|
|
20105
|
-
/* @__PURE__ */
|
|
20106
|
-
/* @__PURE__ */
|
|
19758
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
19759
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
|
|
19760
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19761
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: trigger }) }),
|
|
19762
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
|
|
20107
19763
|
] })
|
|
20108
19764
|
] });
|
|
20109
19765
|
}
|
|
20110
|
-
return /* @__PURE__ */
|
|
20111
|
-
/* @__PURE__ */
|
|
20112
|
-
/* @__PURE__ */
|
|
20113
|
-
/* @__PURE__ */
|
|
20114
|
-
/* @__PURE__ */
|
|
19766
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
|
|
19767
|
+
/* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
|
|
19768
|
+
/* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
|
|
19769
|
+
/* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
19770
|
+
/* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
|
|
20115
19771
|
const selected = style.value === value;
|
|
20116
|
-
return /* @__PURE__ */
|
|
19772
|
+
return /* @__PURE__ */ jsxs12(
|
|
20117
19773
|
DropdownMenuItem,
|
|
20118
19774
|
{
|
|
20119
19775
|
role: "menuitemradio",
|
|
@@ -20121,9 +19777,9 @@ function CardStyleMenu({
|
|
|
20121
19777
|
onSelect: () => onChange(style.value),
|
|
20122
19778
|
className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
|
|
20123
19779
|
children: [
|
|
20124
|
-
/* @__PURE__ */
|
|
20125
|
-
/* @__PURE__ */
|
|
20126
|
-
selected && /* @__PURE__ */
|
|
19780
|
+
/* @__PURE__ */ jsx21(StyleSwatch, { style: style.value }),
|
|
19781
|
+
/* @__PURE__ */ jsx21("span", { children: style.label }),
|
|
19782
|
+
selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
|
|
20127
19783
|
]
|
|
20128
19784
|
},
|
|
20129
19785
|
style.value
|
|
@@ -20153,7 +19809,7 @@ function PricingCardToolbar({
|
|
|
20153
19809
|
const style = pricingCardStyle(entry.tree, index);
|
|
20154
19810
|
const featuredTag = pricingCardFeaturedTag(entry.tree, index);
|
|
20155
19811
|
const mobile = window.innerWidth <= 480;
|
|
20156
|
-
return /* @__PURE__ */
|
|
19812
|
+
return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
|
|
20157
19813
|
"div",
|
|
20158
19814
|
{
|
|
20159
19815
|
"data-ohw-bridge": "",
|
|
@@ -20165,7 +19821,7 @@ function PricingCardToolbar({
|
|
|
20165
19821
|
),
|
|
20166
19822
|
style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
|
|
20167
19823
|
children: [
|
|
20168
|
-
/* @__PURE__ */
|
|
19824
|
+
/* @__PURE__ */ jsxs12(
|
|
20169
19825
|
"div",
|
|
20170
19826
|
{
|
|
20171
19827
|
className: cn(
|
|
@@ -20174,8 +19830,8 @@ function PricingCardToolbar({
|
|
|
20174
19830
|
mobile ? "flex-wrap justify-center" : "flex-nowrap"
|
|
20175
19831
|
),
|
|
20176
19832
|
children: [
|
|
20177
|
-
/* @__PURE__ */
|
|
20178
|
-
/* @__PURE__ */
|
|
19833
|
+
/* @__PURE__ */ jsxs12(Tooltip, { children: [
|
|
19834
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
|
|
20179
19835
|
CustomToolbarButton,
|
|
20180
19836
|
{
|
|
20181
19837
|
type: "button",
|
|
@@ -20183,7 +19839,7 @@ function PricingCardToolbar({
|
|
|
20183
19839
|
"aria-pressed": featuredTag,
|
|
20184
19840
|
onClick: () => onSetFeaturedTag(!featuredTag),
|
|
20185
19841
|
className: "group size-8",
|
|
20186
|
-
children: /* @__PURE__ */
|
|
19842
|
+
children: /* @__PURE__ */ jsx21(
|
|
20187
19843
|
Star2,
|
|
20188
19844
|
{
|
|
20189
19845
|
size: 16,
|
|
@@ -20198,25 +19854,25 @@ function PricingCardToolbar({
|
|
|
20198
19854
|
)
|
|
20199
19855
|
}
|
|
20200
19856
|
) }),
|
|
20201
|
-
/* @__PURE__ */
|
|
19857
|
+
/* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
|
|
20202
19858
|
] }),
|
|
20203
|
-
/* @__PURE__ */
|
|
20204
|
-
/* @__PURE__ */
|
|
20205
|
-
/* @__PURE__ */
|
|
20206
|
-
/* @__PURE__ */
|
|
20207
|
-
/* @__PURE__ */
|
|
20208
|
-
/* @__PURE__ */
|
|
20209
|
-
/* @__PURE__ */
|
|
19859
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19860
|
+
/* @__PURE__ */ jsx21(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
|
|
19861
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19862
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx21(ButtonGlyph, {}) }),
|
|
19863
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
|
|
19864
|
+
/* @__PURE__ */ jsx21(ButtonGlyph, {}),
|
|
19865
|
+
/* @__PURE__ */ jsx21(Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
|
|
20210
19866
|
] }) }),
|
|
20211
|
-
/* @__PURE__ */
|
|
20212
|
-
/* @__PURE__ */
|
|
20213
|
-
/* @__PURE__ */
|
|
20214
|
-
/* @__PURE__ */
|
|
20215
|
-
/* @__PURE__ */
|
|
19867
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "add" }) }),
|
|
19868
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "remove" }) }),
|
|
19869
|
+
/* @__PURE__ */ jsx21(ToolbarSeparator, {}),
|
|
19870
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
|
|
19871
|
+
/* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) })
|
|
20216
19872
|
]
|
|
20217
19873
|
}
|
|
20218
19874
|
),
|
|
20219
|
-
error && /* @__PURE__ */
|
|
19875
|
+
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 })
|
|
20220
19876
|
]
|
|
20221
19877
|
}
|
|
20222
19878
|
) });
|
|
@@ -20250,7 +19906,7 @@ function AiPricingCardOverlay({
|
|
|
20250
19906
|
const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
|
|
20251
19907
|
setHover((prev) => {
|
|
20252
19908
|
const next = ref && !overEditable ? ref : null;
|
|
20253
|
-
return
|
|
19909
|
+
return sameRef(prev, next) ? prev : next;
|
|
20254
19910
|
});
|
|
20255
19911
|
};
|
|
20256
19912
|
const onLeave = () => setHover(null);
|
|
@@ -20265,10 +19921,10 @@ function AiPricingCardOverlay({
|
|
|
20265
19921
|
const onClick = (e) => {
|
|
20266
19922
|
const t = e.target;
|
|
20267
19923
|
if (!(t instanceof Element)) return;
|
|
20268
|
-
if (t.closest(
|
|
19924
|
+
if (t.closest(CHROME_SELECTOR)) return;
|
|
20269
19925
|
const ref = cardRefFromTarget(t);
|
|
20270
|
-
setActive((prev) =>
|
|
20271
|
-
if (!ref || !
|
|
19926
|
+
setActive((prev) => sameRef(prev, ref) ? prev : ref);
|
|
19927
|
+
if (!ref || !sameRef(activeRef.current, ref)) setError(null);
|
|
20272
19928
|
};
|
|
20273
19929
|
document.addEventListener("click", onClick, true);
|
|
20274
19930
|
return () => document.removeEventListener("click", onClick, true);
|
|
@@ -20333,12 +19989,12 @@ function AiPricingCardOverlay({
|
|
|
20333
19989
|
const activeEntry = active ? findEntry(active.sectionId) : null;
|
|
20334
19990
|
const activeCardRect = useLiveCardRect(active);
|
|
20335
19991
|
const activeGridRect = useLiveCardRect(active, true);
|
|
20336
|
-
const hoverRect = useLiveCardRect(hover && !
|
|
20337
|
-
return /* @__PURE__ */
|
|
20338
|
-
hoverRect && /* @__PURE__ */
|
|
20339
|
-
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */
|
|
20340
|
-
/* @__PURE__ */
|
|
20341
|
-
/* @__PURE__ */
|
|
19992
|
+
const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
|
|
19993
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
19994
|
+
hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
|
|
19995
|
+
activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
19996
|
+
/* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
|
|
19997
|
+
/* @__PURE__ */ jsx21(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx21(
|
|
20342
19998
|
PricingCardToolbar,
|
|
20343
19999
|
{
|
|
20344
20000
|
entry: activeEntry,
|
|
@@ -20366,7 +20022,7 @@ function AiPricingCardOverlay({
|
|
|
20366
20022
|
onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
|
|
20367
20023
|
}
|
|
20368
20024
|
) }),
|
|
20369
|
-
/* @__PURE__ */
|
|
20025
|
+
/* @__PURE__ */ jsx21(
|
|
20370
20026
|
"div",
|
|
20371
20027
|
{
|
|
20372
20028
|
"data-ohw-bridge": "",
|
|
@@ -20430,11 +20086,39 @@ function clearVideo(tree, path) {
|
|
|
20430
20086
|
});
|
|
20431
20087
|
}
|
|
20432
20088
|
|
|
20089
|
+
// src/lib/youtube.ts
|
|
20090
|
+
var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
|
|
20091
|
+
function extractYouTubeId(input) {
|
|
20092
|
+
const trimmed = input.trim();
|
|
20093
|
+
if (!trimmed) return null;
|
|
20094
|
+
if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
|
|
20095
|
+
let url;
|
|
20096
|
+
try {
|
|
20097
|
+
url = new URL(trimmed);
|
|
20098
|
+
} catch {
|
|
20099
|
+
return null;
|
|
20100
|
+
}
|
|
20101
|
+
const host = url.hostname.replace(/^www\./, "");
|
|
20102
|
+
if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
|
|
20103
|
+
return null;
|
|
20104
|
+
}
|
|
20105
|
+
let candidate = null;
|
|
20106
|
+
if (host === "youtu.be") {
|
|
20107
|
+
candidate = url.pathname.slice(1).split("/")[0] ?? null;
|
|
20108
|
+
} else if (url.pathname === "/watch") {
|
|
20109
|
+
candidate = url.searchParams.get("v");
|
|
20110
|
+
} else {
|
|
20111
|
+
const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
|
|
20112
|
+
candidate = match ? match[1] : null;
|
|
20113
|
+
}
|
|
20114
|
+
return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
|
|
20115
|
+
}
|
|
20116
|
+
|
|
20433
20117
|
// src/ui/ai-section/AiVideoOverlay.tsx
|
|
20434
|
-
import { Fragment as Fragment9, jsx as
|
|
20118
|
+
import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
20435
20119
|
var PRIMARY5 = "#0885FE";
|
|
20436
|
-
var
|
|
20437
|
-
var
|
|
20120
|
+
var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
|
|
20121
|
+
var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
|
|
20438
20122
|
function findVideoBlockElement(sectionId, path) {
|
|
20439
20123
|
const sectionEl = findByInstanceId(sectionId);
|
|
20440
20124
|
if (!sectionEl) return null;
|
|
@@ -20494,12 +20178,12 @@ function requestValidateTree3(postToParent2, tree) {
|
|
|
20494
20178
|
postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
|
|
20495
20179
|
});
|
|
20496
20180
|
}
|
|
20497
|
-
function
|
|
20181
|
+
function Pill2({
|
|
20498
20182
|
label,
|
|
20499
20183
|
onClick,
|
|
20500
20184
|
disabled
|
|
20501
20185
|
}) {
|
|
20502
|
-
return /* @__PURE__ */
|
|
20186
|
+
return /* @__PURE__ */ jsx22(
|
|
20503
20187
|
"button",
|
|
20504
20188
|
{
|
|
20505
20189
|
type: "button",
|
|
@@ -20515,7 +20199,7 @@ function Pill({
|
|
|
20515
20199
|
border: "none",
|
|
20516
20200
|
cursor: disabled ? "default" : "pointer",
|
|
20517
20201
|
background: "#ffffff",
|
|
20518
|
-
color:
|
|
20202
|
+
color: OHW_BLUE_DARK2,
|
|
20519
20203
|
opacity: disabled ? 0.4 : 1,
|
|
20520
20204
|
fontSize: 12,
|
|
20521
20205
|
lineHeight: "16px",
|
|
@@ -20558,8 +20242,8 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20558
20242
|
onCommit(id);
|
|
20559
20243
|
}
|
|
20560
20244
|
};
|
|
20561
|
-
return /* @__PURE__ */
|
|
20562
|
-
/* @__PURE__ */
|
|
20245
|
+
return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
|
|
20246
|
+
/* @__PURE__ */ jsxs13(
|
|
20563
20247
|
"div",
|
|
20564
20248
|
{
|
|
20565
20249
|
style: {
|
|
@@ -20575,12 +20259,12 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20575
20259
|
boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
|
|
20576
20260
|
},
|
|
20577
20261
|
children: [
|
|
20578
|
-
/* @__PURE__ */
|
|
20262
|
+
/* @__PURE__ */ jsx22(
|
|
20579
20263
|
"span",
|
|
20580
20264
|
{
|
|
20581
20265
|
style: {
|
|
20582
20266
|
flex: "0 0 auto",
|
|
20583
|
-
color:
|
|
20267
|
+
color: OHW_BLUE_DARK2,
|
|
20584
20268
|
fontSize: 10,
|
|
20585
20269
|
lineHeight: "16px",
|
|
20586
20270
|
fontWeight: 700,
|
|
@@ -20590,7 +20274,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20590
20274
|
children: "Video"
|
|
20591
20275
|
}
|
|
20592
20276
|
),
|
|
20593
|
-
/* @__PURE__ */
|
|
20277
|
+
/* @__PURE__ */ jsx22(
|
|
20594
20278
|
"input",
|
|
20595
20279
|
{
|
|
20596
20280
|
type: "text",
|
|
@@ -20627,7 +20311,7 @@ function VideoUrlInput({ value, onCommit }) {
|
|
|
20627
20311
|
]
|
|
20628
20312
|
}
|
|
20629
20313
|
),
|
|
20630
|
-
invalid && /* @__PURE__ */
|
|
20314
|
+
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." })
|
|
20631
20315
|
] });
|
|
20632
20316
|
}
|
|
20633
20317
|
function VideoToolbar({
|
|
@@ -20637,7 +20321,7 @@ function VideoToolbar({
|
|
|
20637
20321
|
onSetVideoId,
|
|
20638
20322
|
onRemove
|
|
20639
20323
|
}) {
|
|
20640
|
-
return /* @__PURE__ */
|
|
20324
|
+
return /* @__PURE__ */ jsxs13(
|
|
20641
20325
|
"div",
|
|
20642
20326
|
{
|
|
20643
20327
|
"data-ohw-bridge": "",
|
|
@@ -20649,7 +20333,7 @@ function VideoToolbar({
|
|
|
20649
20333
|
gap: 6,
|
|
20650
20334
|
alignItems: "center",
|
|
20651
20335
|
width: 280,
|
|
20652
|
-
background:
|
|
20336
|
+
background: OHW_BLUE2,
|
|
20653
20337
|
padding: 8,
|
|
20654
20338
|
borderRadius: 12,
|
|
20655
20339
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -20657,9 +20341,9 @@ function VideoToolbar({
|
|
|
20657
20341
|
opacity: pending ? 0.6 : 1
|
|
20658
20342
|
},
|
|
20659
20343
|
children: [
|
|
20660
|
-
/* @__PURE__ */
|
|
20661
|
-
/* @__PURE__ */
|
|
20662
|
-
error && /* @__PURE__ */
|
|
20344
|
+
/* @__PURE__ */ jsx22(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
|
|
20345
|
+
/* @__PURE__ */ jsx22(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
|
|
20346
|
+
error && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
20663
20347
|
]
|
|
20664
20348
|
}
|
|
20665
20349
|
);
|
|
@@ -20779,8 +20463,8 @@ function AiVideoOverlay({
|
|
|
20779
20463
|
const activeBlockRect = useLiveBlockRect(active);
|
|
20780
20464
|
const TOOLBAR_APPROX_H = 90;
|
|
20781
20465
|
const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
20782
|
-
return /* @__PURE__ */
|
|
20783
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
20466
|
+
return /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
20467
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx22(
|
|
20784
20468
|
"button",
|
|
20785
20469
|
{
|
|
20786
20470
|
type: "button",
|
|
@@ -20808,15 +20492,15 @@ function AiVideoOverlay({
|
|
|
20808
20492
|
fontSize: 14,
|
|
20809
20493
|
fontWeight: 700
|
|
20810
20494
|
},
|
|
20811
|
-
children: /* @__PURE__ */
|
|
20495
|
+
children: /* @__PURE__ */ jsx22(Star3, { size: 14, style: { pointerEvents: "none" } })
|
|
20812
20496
|
}
|
|
20813
20497
|
),
|
|
20814
|
-
activeBlockRect && active && activeEntry && /* @__PURE__ */
|
|
20498
|
+
activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx22(
|
|
20815
20499
|
ItemInteractionLayer,
|
|
20816
20500
|
{
|
|
20817
20501
|
rect: activeBlockRect,
|
|
20818
20502
|
state: toolbarState,
|
|
20819
|
-
toolbar: /* @__PURE__ */
|
|
20503
|
+
toolbar: /* @__PURE__ */ jsx22(
|
|
20820
20504
|
VideoToolbar,
|
|
20821
20505
|
{
|
|
20822
20506
|
videoId: videoIdAt(activeEntry.tree, active.path),
|
|
@@ -20891,10 +20575,10 @@ function setCarouselAutoplay(tree, on) {
|
|
|
20891
20575
|
}
|
|
20892
20576
|
|
|
20893
20577
|
// src/ui/ai-section/AiFadeCarouselOverlay.tsx
|
|
20894
|
-
import { Fragment as Fragment10, jsx as
|
|
20578
|
+
import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
20895
20579
|
var PRIMARY6 = "#0885FE";
|
|
20896
|
-
var
|
|
20897
|
-
var
|
|
20580
|
+
var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
|
|
20581
|
+
var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
|
|
20898
20582
|
function findCarouselItemElement(sectionId, index) {
|
|
20899
20583
|
const sectionEl = findByInstanceId(sectionId);
|
|
20900
20584
|
if (!sectionEl) return null;
|
|
@@ -20973,8 +20657,8 @@ function requestAssetPick2(postToParent2) {
|
|
|
20973
20657
|
postToParent2({ type: "ow:asset-pick", id });
|
|
20974
20658
|
});
|
|
20975
20659
|
}
|
|
20976
|
-
function
|
|
20977
|
-
return /* @__PURE__ */
|
|
20660
|
+
function Pill3({ label, onClick, disabled }) {
|
|
20661
|
+
return /* @__PURE__ */ jsx23(
|
|
20978
20662
|
"button",
|
|
20979
20663
|
{
|
|
20980
20664
|
type: "button",
|
|
@@ -20990,7 +20674,7 @@ function Pill2({ label, onClick, disabled }) {
|
|
|
20990
20674
|
border: "none",
|
|
20991
20675
|
cursor: disabled ? "default" : "pointer",
|
|
20992
20676
|
background: "#ffffff",
|
|
20993
|
-
color:
|
|
20677
|
+
color: OHW_BLUE_DARK3,
|
|
20994
20678
|
opacity: disabled ? 0.4 : 1,
|
|
20995
20679
|
fontSize: 12,
|
|
20996
20680
|
lineHeight: "16px",
|
|
@@ -21008,7 +20692,7 @@ function TogglePill({
|
|
|
21008
20692
|
onToggle,
|
|
21009
20693
|
disabled
|
|
21010
20694
|
}) {
|
|
21011
|
-
return /* @__PURE__ */
|
|
20695
|
+
return /* @__PURE__ */ jsxs14(
|
|
21012
20696
|
"button",
|
|
21013
20697
|
{
|
|
21014
20698
|
type: "button",
|
|
@@ -21027,7 +20711,7 @@ function TogglePill({
|
|
|
21027
20711
|
border: "none",
|
|
21028
20712
|
cursor: disabled ? "default" : "pointer",
|
|
21029
20713
|
background: "#ffffff",
|
|
21030
|
-
color:
|
|
20714
|
+
color: OHW_BLUE_DARK3,
|
|
21031
20715
|
opacity: disabled ? 0.4 : 1,
|
|
21032
20716
|
fontSize: 12,
|
|
21033
20717
|
lineHeight: "16px",
|
|
@@ -21037,7 +20721,7 @@ function TogglePill({
|
|
|
21037
20721
|
},
|
|
21038
20722
|
children: [
|
|
21039
20723
|
label,
|
|
21040
|
-
/* @__PURE__ */
|
|
20724
|
+
/* @__PURE__ */ jsx23(
|
|
21041
20725
|
"span",
|
|
21042
20726
|
{
|
|
21043
20727
|
"aria-hidden": true,
|
|
@@ -21050,10 +20734,10 @@ function TogglePill({
|
|
|
21050
20734
|
// Off is a grey track, not a washed-out blue: the pill's own white background already
|
|
21051
20735
|
// carries the brand colour in the text, and a pale blue track next to it read as
|
|
21052
20736
|
// "disabled control" rather than "switch that is off".
|
|
21053
|
-
background: on ?
|
|
20737
|
+
background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
|
|
21054
20738
|
transition: "background 120ms ease"
|
|
21055
20739
|
},
|
|
21056
|
-
children: /* @__PURE__ */
|
|
20740
|
+
children: /* @__PURE__ */ jsx23(
|
|
21057
20741
|
"span",
|
|
21058
20742
|
{
|
|
21059
20743
|
style: {
|
|
@@ -21082,7 +20766,7 @@ function CarouselSlideToolbar({
|
|
|
21082
20766
|
onChangeImage,
|
|
21083
20767
|
onToggleAutoplay
|
|
21084
20768
|
}) {
|
|
21085
|
-
return /* @__PURE__ */
|
|
20769
|
+
return /* @__PURE__ */ jsxs14(
|
|
21086
20770
|
"div",
|
|
21087
20771
|
{
|
|
21088
20772
|
"data-ohw-bridge": "",
|
|
@@ -21093,7 +20777,7 @@ function CarouselSlideToolbar({
|
|
|
21093
20777
|
flexDirection: "column",
|
|
21094
20778
|
gap: 6,
|
|
21095
20779
|
alignItems: "center",
|
|
21096
|
-
background:
|
|
20780
|
+
background: OHW_BLUE3,
|
|
21097
20781
|
padding: 8,
|
|
21098
20782
|
borderRadius: 12,
|
|
21099
20783
|
boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
|
|
@@ -21105,11 +20789,11 @@ function CarouselSlideToolbar({
|
|
|
21105
20789
|
pointerEvents: pending ? "none" : "auto"
|
|
21106
20790
|
},
|
|
21107
20791
|
children: [
|
|
21108
|
-
/* @__PURE__ */
|
|
21109
|
-
/* @__PURE__ */
|
|
21110
|
-
/* @__PURE__ */
|
|
20792
|
+
/* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
20793
|
+
/* @__PURE__ */ jsx23(Pill3, { label: "Change Image", onClick: onChangeImage }),
|
|
20794
|
+
/* @__PURE__ */ jsx23(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
|
|
21111
20795
|
] }),
|
|
21112
|
-
error && /* @__PURE__ */
|
|
20796
|
+
error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
|
|
21113
20797
|
]
|
|
21114
20798
|
}
|
|
21115
20799
|
);
|
|
@@ -21249,8 +20933,8 @@ function AiFadeCarouselOverlay({
|
|
|
21249
20933
|
const activeItemRect = useLiveItemRect2(active);
|
|
21250
20934
|
const TOOLBAR_APPROX_H = 90;
|
|
21251
20935
|
const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
|
|
21252
|
-
return /* @__PURE__ */
|
|
21253
|
-
hoverHandleRect && hover && /* @__PURE__ */
|
|
20936
|
+
return /* @__PURE__ */ jsxs14(Fragment10, { children: [
|
|
20937
|
+
hoverHandleRect && hover && /* @__PURE__ */ jsx23(
|
|
21254
20938
|
"button",
|
|
21255
20939
|
{
|
|
21256
20940
|
type: "button",
|
|
@@ -21279,10 +20963,10 @@ function AiFadeCarouselOverlay({
|
|
|
21279
20963
|
fontSize: 14,
|
|
21280
20964
|
fontWeight: 700
|
|
21281
20965
|
},
|
|
21282
|
-
children: /* @__PURE__ */
|
|
20966
|
+
children: /* @__PURE__ */ jsx23(Star4, { size: 14, style: { pointerEvents: "none" } })
|
|
21283
20967
|
}
|
|
21284
20968
|
),
|
|
21285
|
-
swapping && /* @__PURE__ */
|
|
20969
|
+
swapping && /* @__PURE__ */ jsx23(
|
|
21286
20970
|
"div",
|
|
21287
20971
|
{
|
|
21288
20972
|
ref: skeletonRef,
|
|
@@ -21300,15 +20984,15 @@ function AiFadeCarouselOverlay({
|
|
|
21300
20984
|
zIndex: 2147483646,
|
|
21301
20985
|
pointerEvents: "none"
|
|
21302
20986
|
},
|
|
21303
|
-
children: /* @__PURE__ */
|
|
20987
|
+
children: /* @__PURE__ */ jsx23("style", { children: MEDIA_SKELETON_CSS })
|
|
21304
20988
|
}
|
|
21305
20989
|
),
|
|
21306
|
-
activeItemRect && active && activeEntry && /* @__PURE__ */
|
|
20990
|
+
activeItemRect && active && activeEntry && /* @__PURE__ */ jsx23(
|
|
21307
20991
|
ItemInteractionLayer,
|
|
21308
20992
|
{
|
|
21309
20993
|
rect: activeItemRect,
|
|
21310
20994
|
state: toolbarState,
|
|
21311
|
-
toolbar: /* @__PURE__ */
|
|
20995
|
+
toolbar: /* @__PURE__ */ jsx23(
|
|
21312
20996
|
CarouselSlideToolbar,
|
|
21313
20997
|
{
|
|
21314
20998
|
pending,
|
|
@@ -21499,11 +21183,118 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
|
|
|
21499
21183
|
// src/ui/link-modal/LinkPopover.tsx
|
|
21500
21184
|
import { useEffect as useEffect15 } from "react";
|
|
21501
21185
|
|
|
21186
|
+
// src/ui/dialog.tsx
|
|
21187
|
+
import * as React9 from "react";
|
|
21188
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
21189
|
+
import { X as X2 } from "lucide-react";
|
|
21190
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
21191
|
+
function Dialog2({
|
|
21192
|
+
...props
|
|
21193
|
+
}) {
|
|
21194
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
21195
|
+
}
|
|
21196
|
+
function DialogPortal({
|
|
21197
|
+
...props
|
|
21198
|
+
}) {
|
|
21199
|
+
return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
|
|
21200
|
+
}
|
|
21201
|
+
function DialogOverlay({
|
|
21202
|
+
className,
|
|
21203
|
+
...props
|
|
21204
|
+
}) {
|
|
21205
|
+
return /* @__PURE__ */ jsx24(
|
|
21206
|
+
DialogPrimitive.Overlay,
|
|
21207
|
+
{
|
|
21208
|
+
"data-slot": "dialog-overlay",
|
|
21209
|
+
"data-ohw-link-modal-root": "",
|
|
21210
|
+
className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
|
|
21211
|
+
...props
|
|
21212
|
+
}
|
|
21213
|
+
);
|
|
21214
|
+
}
|
|
21215
|
+
var DialogContent = React9.forwardRef(
|
|
21216
|
+
({ className, children, showCloseButton = true, container, ...props }, ref) => {
|
|
21217
|
+
const positionMode = container ? "absolute" : "fixed";
|
|
21218
|
+
return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
|
|
21219
|
+
/* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
|
|
21220
|
+
/* @__PURE__ */ jsxs15(
|
|
21221
|
+
DialogPrimitive.Content,
|
|
21222
|
+
{
|
|
21223
|
+
ref,
|
|
21224
|
+
"data-slot": "dialog-content",
|
|
21225
|
+
className: cn(
|
|
21226
|
+
positionMode,
|
|
21227
|
+
"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",
|
|
21228
|
+
"rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
|
|
21229
|
+
container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
|
|
21230
|
+
className
|
|
21231
|
+
),
|
|
21232
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
21233
|
+
...props,
|
|
21234
|
+
children: [
|
|
21235
|
+
children,
|
|
21236
|
+
showCloseButton ? /* @__PURE__ */ jsx24(
|
|
21237
|
+
DialogPrimitive.Close,
|
|
21238
|
+
{
|
|
21239
|
+
type: "button",
|
|
21240
|
+
className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
|
|
21241
|
+
"aria-label": "Close",
|
|
21242
|
+
children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
|
|
21243
|
+
}
|
|
21244
|
+
) : null
|
|
21245
|
+
]
|
|
21246
|
+
}
|
|
21247
|
+
)
|
|
21248
|
+
] });
|
|
21249
|
+
}
|
|
21250
|
+
);
|
|
21251
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
21252
|
+
function DialogHeader({
|
|
21253
|
+
className,
|
|
21254
|
+
...props
|
|
21255
|
+
}) {
|
|
21256
|
+
return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
21257
|
+
}
|
|
21258
|
+
function DialogFooter({
|
|
21259
|
+
className,
|
|
21260
|
+
...props
|
|
21261
|
+
}) {
|
|
21262
|
+
return /* @__PURE__ */ jsx24(
|
|
21263
|
+
"div",
|
|
21264
|
+
{
|
|
21265
|
+
className: cn("flex items-center justify-end gap-2", className),
|
|
21266
|
+
...props
|
|
21267
|
+
}
|
|
21268
|
+
);
|
|
21269
|
+
}
|
|
21270
|
+
var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21271
|
+
DialogPrimitive.Title,
|
|
21272
|
+
{
|
|
21273
|
+
ref,
|
|
21274
|
+
className: cn(
|
|
21275
|
+
"text-lg font-semibold leading-none tracking-tight text-card-foreground",
|
|
21276
|
+
className
|
|
21277
|
+
),
|
|
21278
|
+
...props
|
|
21279
|
+
}
|
|
21280
|
+
));
|
|
21281
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
21282
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
21283
|
+
DialogPrimitive.Description,
|
|
21284
|
+
{
|
|
21285
|
+
ref,
|
|
21286
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
21287
|
+
...props
|
|
21288
|
+
}
|
|
21289
|
+
));
|
|
21290
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
21291
|
+
var DialogClose = DialogPrimitive.Close;
|
|
21292
|
+
|
|
21502
21293
|
// src/ui/link-modal/LinkEditorPanel.tsx
|
|
21503
21294
|
import { Info, X as X4 } from "lucide-react";
|
|
21504
21295
|
|
|
21505
21296
|
// src/ui/link-modal/DestinationBreadcrumb.tsx
|
|
21506
|
-
import { ArrowRight as
|
|
21297
|
+
import { ArrowRight as ArrowRight2, File, GalleryVertical } from "lucide-react";
|
|
21507
21298
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
21508
21299
|
function DestinationBreadcrumb({
|
|
21509
21300
|
pageTitle,
|
|
@@ -21517,7 +21308,7 @@ function DestinationBreadcrumb({
|
|
|
21517
21308
|
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
|
|
21518
21309
|
] }),
|
|
21519
21310
|
/* @__PURE__ */ jsx25(
|
|
21520
|
-
|
|
21311
|
+
ArrowRight2,
|
|
21521
21312
|
{
|
|
21522
21313
|
size: 16,
|
|
21523
21314
|
className: "shrink-0 text-muted-foreground",
|
|
@@ -21629,7 +21420,7 @@ function Label({ className, ...props }) {
|
|
|
21629
21420
|
}
|
|
21630
21421
|
|
|
21631
21422
|
// src/ui/link-modal/UrlOrPageInput.tsx
|
|
21632
|
-
import { ChevronDown as
|
|
21423
|
+
import { ChevronDown as ChevronDown4, File as File2, X as X3 } from "lucide-react";
|
|
21633
21424
|
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
21634
21425
|
function FieldChevron({
|
|
21635
21426
|
onClick
|
|
@@ -21642,7 +21433,7 @@ function FieldChevron({
|
|
|
21642
21433
|
onClick,
|
|
21643
21434
|
"aria-label": "Open page list",
|
|
21644
21435
|
tabIndex: -1,
|
|
21645
|
-
children: /* @__PURE__ */ jsx29(
|
|
21436
|
+
children: /* @__PURE__ */ jsx29(ChevronDown4, { size: 16 })
|
|
21646
21437
|
}
|
|
21647
21438
|
);
|
|
21648
21439
|
}
|
|
@@ -21872,7 +21663,7 @@ function LinkEditorPanel({ state, onClose }) {
|
|
|
21872
21663
|
// src/ui/link-modal/SectionPickerOverlay.tsx
|
|
21873
21664
|
import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
|
|
21874
21665
|
import { createPortal as createPortal2 } from "react-dom";
|
|
21875
|
-
import { ArrowLeft as
|
|
21666
|
+
import { ArrowLeft as ArrowLeft2, Check as Check3 } from "lucide-react";
|
|
21876
21667
|
import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
|
|
21877
21668
|
|
|
21878
21669
|
// src/lib/parent-scroll.ts
|
|
@@ -22149,7 +21940,7 @@ function SectionPickerOverlay({
|
|
|
22149
21940
|
className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
|
|
22150
21941
|
onClick: onBack,
|
|
22151
21942
|
children: [
|
|
22152
|
-
/* @__PURE__ */ jsx31(
|
|
21943
|
+
/* @__PURE__ */ jsx31(ArrowLeft2, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
22153
21944
|
"Back"
|
|
22154
21945
|
]
|
|
22155
21946
|
}
|
|
@@ -22218,7 +22009,7 @@ function SectionPickerOverlay({
|
|
|
22218
22009
|
className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
|
|
22219
22010
|
style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
|
|
22220
22011
|
"aria-hidden": true,
|
|
22221
|
-
children: /* @__PURE__ */ jsx31(
|
|
22012
|
+
children: /* @__PURE__ */ jsx31(Check3, { className: "size-5" })
|
|
22222
22013
|
}
|
|
22223
22014
|
) : null
|
|
22224
22015
|
]
|
|
@@ -22602,7 +22393,6 @@ function shouldUseDevFixtures() {
|
|
|
22602
22393
|
function getLogoElement(el) {
|
|
22603
22394
|
const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
|
|
22604
22395
|
if (marked) return marked;
|
|
22605
|
-
if (el.closest('[data-ohw-editable="icon"]')) return null;
|
|
22606
22396
|
const root = el.closest("nav, [data-ohw-nav-root], footer");
|
|
22607
22397
|
if (!root) return null;
|
|
22608
22398
|
const anchor = el.closest("a");
|
|
@@ -22672,7 +22462,7 @@ function addFooterColumnWithPersist({
|
|
|
22672
22462
|
import {
|
|
22673
22463
|
useCallback as useCallback9,
|
|
22674
22464
|
useEffect as useEffect16,
|
|
22675
|
-
useLayoutEffect as
|
|
22465
|
+
useLayoutEffect as useLayoutEffect5,
|
|
22676
22466
|
useRef as useRef11,
|
|
22677
22467
|
useState as useState15
|
|
22678
22468
|
} from "react";
|
|
@@ -22769,7 +22559,7 @@ function FloatingPanel({
|
|
|
22769
22559
|
return () => window.removeEventListener("message", onParentScroll);
|
|
22770
22560
|
}, [open]);
|
|
22771
22561
|
const positionRef = useRef11(position);
|
|
22772
|
-
|
|
22562
|
+
useLayoutEffect5(() => {
|
|
22773
22563
|
if (!open) {
|
|
22774
22564
|
positionRef.current = position;
|
|
22775
22565
|
return;
|
|
@@ -22779,7 +22569,7 @@ function FloatingPanel({
|
|
|
22779
22569
|
}
|
|
22780
22570
|
positionRef.current = position;
|
|
22781
22571
|
}, [open, position, liveScroll, parentScroll]);
|
|
22782
|
-
|
|
22572
|
+
useLayoutEffect5(() => {
|
|
22783
22573
|
if (!open || !panelRef.current) return;
|
|
22784
22574
|
const el = panelRef.current;
|
|
22785
22575
|
const header = el.querySelector("[data-ohw-floating-panel-header]");
|
|
@@ -22988,7 +22778,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
|
|
|
22988
22778
|
}
|
|
22989
22779
|
|
|
22990
22780
|
// src/ui/button-style-panel.tsx
|
|
22991
|
-
import { Check as
|
|
22781
|
+
import { Check as Check4 } from "lucide-react";
|
|
22992
22782
|
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
22993
22783
|
var SIZE_LABEL = { s: "S", m: "M", l: "L" };
|
|
22994
22784
|
function ButtonStylePanel({
|
|
@@ -23059,7 +22849,7 @@ function ButtonStylePanel({
|
|
|
23059
22849
|
{
|
|
23060
22850
|
className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
|
|
23061
22851
|
"aria-hidden": true,
|
|
23062
|
-
children: /* @__PURE__ */ jsx35(
|
|
22852
|
+
children: /* @__PURE__ */ jsx35(Check4, { className: "size-3", strokeWidth: 3 })
|
|
23063
22853
|
}
|
|
23064
22854
|
) : null
|
|
23065
22855
|
]
|
|
@@ -24084,7 +23874,7 @@ function useSectionDrag({
|
|
|
24084
23874
|
}
|
|
24085
23875
|
|
|
24086
23876
|
// src/ui/footer-container-chrome.tsx
|
|
24087
|
-
import { Plus as
|
|
23877
|
+
import { Plus as Plus3 } from "lucide-react";
|
|
24088
23878
|
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
24089
23879
|
function FooterContainerChrome({
|
|
24090
23880
|
rect,
|
|
@@ -24125,7 +23915,7 @@ function FooterContainerChrome({
|
|
|
24125
23915
|
if (addDisabled) return;
|
|
24126
23916
|
onAdd();
|
|
24127
23917
|
},
|
|
24128
|
-
children: /* @__PURE__ */ jsx36(
|
|
23918
|
+
children: /* @__PURE__ */ jsx36(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24129
23919
|
}
|
|
24130
23920
|
) }),
|
|
24131
23921
|
/* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
|
|
@@ -24303,138 +24093,6 @@ function deleteSelectedNavFooterItem(deps) {
|
|
|
24303
24093
|
return false;
|
|
24304
24094
|
}
|
|
24305
24095
|
|
|
24306
|
-
// src/lib/build-page-sync.ts
|
|
24307
|
-
import { useEffect as useEffect19 } from "react";
|
|
24308
|
-
var CHROME_KEY_RE = /^(nav|footer|header|navbar)[-_]/u;
|
|
24309
|
-
function normalisePath(path) {
|
|
24310
|
-
const trimmed = path.trim().replace(/[?#].*$/u, "");
|
|
24311
|
-
if (!trimmed || trimmed === "/") return "/";
|
|
24312
|
-
return `/${trimmed.replace(/^\/+|\/+$/gu, "")}`;
|
|
24313
|
-
}
|
|
24314
|
-
function isDeadPageHref(href, livePaths) {
|
|
24315
|
-
const value = href.trim();
|
|
24316
|
-
if (!value.startsWith("/") || value.startsWith("//")) return false;
|
|
24317
|
-
const path = normalisePath(value);
|
|
24318
|
-
if (path === "/") return false;
|
|
24319
|
-
return !livePaths.some((live) => {
|
|
24320
|
-
const p = normalisePath(live);
|
|
24321
|
-
return p === path || p !== "/" && path.startsWith(`${p}/`);
|
|
24322
|
-
});
|
|
24323
|
-
}
|
|
24324
|
-
var sameWords = (a, b) => a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
24325
|
-
function planBuildPageSync(links, msg) {
|
|
24326
|
-
const live = Array.isArray(msg.livePaths) ? msg.livePaths : [];
|
|
24327
|
-
const removed = new Set((msg.removed ?? []).map(normalisePath));
|
|
24328
|
-
const remove = [];
|
|
24329
|
-
const relabel = [];
|
|
24330
|
-
const retarget = [];
|
|
24331
|
-
const fallback = live.some((p) => normalisePath(p) === "/contact") ? "/contact" : "/";
|
|
24332
|
-
for (const link of links) {
|
|
24333
|
-
const href = link.href.trim();
|
|
24334
|
-
const isPage = href.startsWith("/") && !href.startsWith("//");
|
|
24335
|
-
if (isPage && (removed.has(normalisePath(href)) || live.length > 0 && isDeadPageHref(href, live))) {
|
|
24336
|
-
if (link.area === "chrome") retarget.push({ hrefKey: link.hrefKey, href: fallback });
|
|
24337
|
-
else remove.push(link.hrefKey);
|
|
24338
|
-
continue;
|
|
24339
|
-
}
|
|
24340
|
-
if (isPage) {
|
|
24341
|
-
const path = normalisePath(href);
|
|
24342
|
-
const rename = (msg.relabel ?? []).find((r2) => normalisePath(r2.path) === path);
|
|
24343
|
-
if (rename && sameWords(link.label, rename.oldTitle) && !sameWords(link.label, rename.label)) {
|
|
24344
|
-
relabel.push({ hrefKey: link.hrefKey, label: rename.label });
|
|
24345
|
-
}
|
|
24346
|
-
continue;
|
|
24347
|
-
}
|
|
24348
|
-
if (href.startsWith("#") || href.startsWith("/#")) {
|
|
24349
|
-
const anchor = href.replace(/^\/?#/u, "").toLowerCase();
|
|
24350
|
-
const target = (msg.anchorLabels ?? []).find((a) => a.anchors.some((id) => id.toLowerCase() === anchor));
|
|
24351
|
-
if (target && sameWords(link.label.replace(/\s+/gu, "-"), anchor) && !sameWords(link.label, target.label)) {
|
|
24352
|
-
relabel.push({ hrefKey: link.hrefKey, label: target.label });
|
|
24353
|
-
}
|
|
24354
|
-
}
|
|
24355
|
-
}
|
|
24356
|
-
return { remove, relabel, retarget };
|
|
24357
|
-
}
|
|
24358
|
-
function linkHref(el) {
|
|
24359
|
-
const key = el.getAttribute("data-ohw-href-key");
|
|
24360
|
-
const stored = key ? getStoredLinkHref(key) : void 0;
|
|
24361
|
-
return stored ?? el.getAttribute("href") ?? "";
|
|
24362
|
-
}
|
|
24363
|
-
function labelEl(anchor) {
|
|
24364
|
-
return anchor.querySelector('[data-ohw-editable="text"]');
|
|
24365
|
-
}
|
|
24366
|
-
function collectLinks() {
|
|
24367
|
-
const seen = /* @__PURE__ */ new Set();
|
|
24368
|
-
const links = [];
|
|
24369
|
-
document.querySelectorAll("[data-ohw-href-key]").forEach((el) => {
|
|
24370
|
-
const hrefKey = el.getAttribute("data-ohw-href-key") ?? "";
|
|
24371
|
-
if (seen.has(hrefKey)) return;
|
|
24372
|
-
const area = isNavbarHrefKey(hrefKey) ? "nav" : isFooterHrefKey(hrefKey) ? "footer" : CHROME_KEY_RE.test(hrefKey) ? "chrome" : null;
|
|
24373
|
-
if (!area) return;
|
|
24374
|
-
const label = labelEl(el);
|
|
24375
|
-
if (!label && area !== "chrome") return;
|
|
24376
|
-
seen.add(hrefKey);
|
|
24377
|
-
links.push({ hrefKey, href: linkHref(el), label: label?.textContent ?? el.textContent ?? "", area });
|
|
24378
|
-
});
|
|
24379
|
-
return links;
|
|
24380
|
-
}
|
|
24381
|
-
function applyBuildPageSync(msg, deps) {
|
|
24382
|
-
const plan = planBuildPageSync(collectLinks(), msg);
|
|
24383
|
-
const nodes = /* @__PURE__ */ new Map();
|
|
24384
|
-
for (const hrefKey of plan.remove) {
|
|
24385
|
-
const anchor = document.querySelector(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`);
|
|
24386
|
-
if (!anchor) continue;
|
|
24387
|
-
const nav = isNavbarHrefKey(hrefKey);
|
|
24388
|
-
const result = nav ? deleteNavbarItem(anchor) : deleteFooterItem(anchor);
|
|
24389
|
-
if (!result) continue;
|
|
24390
|
-
for (const key of result.removedKeys) {
|
|
24391
|
-
nodes.set(key, "");
|
|
24392
|
-
clearStoredLinkHref(key);
|
|
24393
|
-
}
|
|
24394
|
-
nodes.set(nav ? NAV_ORDER_KEY : FOOTER_ORDER_KEY, result.orderJson);
|
|
24395
|
-
}
|
|
24396
|
-
for (const { hrefKey, label } of plan.relabel) {
|
|
24397
|
-
const labelKey = hrefKey.replace(/-href$/u, "-label");
|
|
24398
|
-
document.querySelectorAll(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`).forEach((anchor) => {
|
|
24399
|
-
const el = labelEl(anchor);
|
|
24400
|
-
if (el) el.textContent = label;
|
|
24401
|
-
});
|
|
24402
|
-
nodes.set(labelKey, label);
|
|
24403
|
-
}
|
|
24404
|
-
for (const { hrefKey, href } of plan.retarget) {
|
|
24405
|
-
setStoredLinkHref(hrefKey, href);
|
|
24406
|
-
document.querySelectorAll(`[data-ohw-href-key="${CSS.escape(hrefKey)}"]`).forEach((anchor) => {
|
|
24407
|
-
if (anchor instanceof HTMLAnchorElement) anchor.setAttribute("href", href);
|
|
24408
|
-
});
|
|
24409
|
-
nodes.set(hrefKey, href);
|
|
24410
|
-
}
|
|
24411
|
-
if (nodes.size === 0) return 0;
|
|
24412
|
-
deps.setEditContent({ ...deps.getEditContent(), ...Object.fromEntries(nodes) });
|
|
24413
|
-
deps.postToParent({
|
|
24414
|
-
type: "ow:change",
|
|
24415
|
-
nodes: [...nodes].map(([key, text]) => ({ key, text }))
|
|
24416
|
-
});
|
|
24417
|
-
return plan.remove.length + plan.relabel.length + plan.retarget.length;
|
|
24418
|
-
}
|
|
24419
|
-
function useBuildPageSync(isEditMode, editContentRef, postToParent2) {
|
|
24420
|
-
useEffect19(() => {
|
|
24421
|
-
if (!isEditMode) return;
|
|
24422
|
-
const onMessage = (e) => {
|
|
24423
|
-
if (e.source !== window.parent || e.data?.type !== "ow:pages-sync") return;
|
|
24424
|
-
const changed = applyBuildPageSync(e.data, {
|
|
24425
|
-
getEditContent: () => editContentRef.current,
|
|
24426
|
-
setEditContent: (next) => {
|
|
24427
|
-
editContentRef.current = next;
|
|
24428
|
-
},
|
|
24429
|
-
postToParent: postToParent2
|
|
24430
|
-
});
|
|
24431
|
-
postToParent2({ type: "ow:pages-synced", changed });
|
|
24432
|
-
};
|
|
24433
|
-
window.addEventListener("message", onMessage);
|
|
24434
|
-
return () => window.removeEventListener("message", onMessage);
|
|
24435
|
-
}, [isEditMode, editContentRef, postToParent2]);
|
|
24436
|
-
}
|
|
24437
|
-
|
|
24438
24096
|
// src/lib/nav-page-sync.ts
|
|
24439
24097
|
function labelKeyFor(hrefKey) {
|
|
24440
24098
|
return hrefKey.replace(/-href$/, "-label");
|
|
@@ -24532,7 +24190,7 @@ function retargetPageLinks(change, deps) {
|
|
|
24532
24190
|
}
|
|
24533
24191
|
|
|
24534
24192
|
// src/ui/navbar-container-chrome.tsx
|
|
24535
|
-
import { Plus as
|
|
24193
|
+
import { Plus as Plus4 } from "lucide-react";
|
|
24536
24194
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
24537
24195
|
function NavbarContainerChrome({
|
|
24538
24196
|
rect,
|
|
@@ -24568,7 +24226,7 @@ function NavbarContainerChrome({
|
|
|
24568
24226
|
e.stopPropagation();
|
|
24569
24227
|
onAdd();
|
|
24570
24228
|
},
|
|
24571
|
-
children: /* @__PURE__ */ jsx37(
|
|
24229
|
+
children: /* @__PURE__ */ jsx37(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
|
|
24572
24230
|
}
|
|
24573
24231
|
)
|
|
24574
24232
|
}
|
|
@@ -24640,7 +24298,7 @@ function Badge({ className, variant, ...props }) {
|
|
|
24640
24298
|
}
|
|
24641
24299
|
|
|
24642
24300
|
// src/OhhwellsBridge.tsx
|
|
24643
|
-
import { Brush as Brush2, Link as Link2, Plus as
|
|
24301
|
+
import { Brush as Brush2, Link as Link2, Plus as Plus5, Settings } from "lucide-react";
|
|
24644
24302
|
import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
24645
24303
|
var PRIMARY7 = "#0885FE";
|
|
24646
24304
|
var IMAGE_FADE_MS = 300;
|
|
@@ -25418,7 +25076,7 @@ function getNavigationSelectionParent(el) {
|
|
|
25418
25076
|
if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
|
|
25419
25077
|
return resolveFooterLinksContainerFrom(el);
|
|
25420
25078
|
}
|
|
25421
|
-
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") ||
|
|
25079
|
+
if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
|
|
25422
25080
|
return getNavigationRoot(el);
|
|
25423
25081
|
}
|
|
25424
25082
|
return null;
|
|
@@ -25640,6 +25298,7 @@ var ICONS = {
|
|
|
25640
25298
|
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"/>',
|
|
25641
25299
|
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"/>'
|
|
25642
25300
|
};
|
|
25301
|
+
var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
|
|
25643
25302
|
var SELECTION_CHROME_GAP2 = 4;
|
|
25644
25303
|
var TOOLBAR_STROKE_GAP2 = 4;
|
|
25645
25304
|
var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
|
|
@@ -25737,7 +25396,7 @@ function applyVisibleViewport(el, parentScroll) {
|
|
|
25737
25396
|
el.style.top = `${top}px`;
|
|
25738
25397
|
el.style.height = `${height}px`;
|
|
25739
25398
|
}
|
|
25740
|
-
var
|
|
25399
|
+
var TOOLBAR_EDGE_MARGIN3 = 4;
|
|
25741
25400
|
function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
25742
25401
|
const isAbove = transform.includes("translateY(-100%)");
|
|
25743
25402
|
let visualTop = isAbove ? top - approxH : top;
|
|
@@ -25764,8 +25423,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
|
|
|
25764
25423
|
function clampToolbarLeft(centerX, toolbarWidth) {
|
|
25765
25424
|
const half = toolbarWidth / 2;
|
|
25766
25425
|
return Math.max(
|
|
25767
|
-
|
|
25768
|
-
Math.min(centerX, window.innerWidth -
|
|
25426
|
+
TOOLBAR_EDGE_MARGIN3 + half,
|
|
25427
|
+
Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
|
|
25769
25428
|
);
|
|
25770
25429
|
}
|
|
25771
25430
|
function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
|
|
@@ -26139,7 +25798,7 @@ function OhhwellsBridge() {
|
|
|
26139
25798
|
const searchParams = useSearchParams();
|
|
26140
25799
|
const isEditMode = isEditSessionActive();
|
|
26141
25800
|
const [bridgeRoot, setBridgeRoot] = useState18(null);
|
|
26142
|
-
|
|
25801
|
+
useEffect19(() => {
|
|
26143
25802
|
const figtreeFontId = "ohw-figtree-font";
|
|
26144
25803
|
if (!document.getElementById(figtreeFontId)) {
|
|
26145
25804
|
const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
|
|
@@ -26166,7 +25825,7 @@ function OhhwellsBridge() {
|
|
|
26166
25825
|
}, []);
|
|
26167
25826
|
const subdomainFromQuery = searchParams.get("subdomain");
|
|
26168
25827
|
const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
|
|
26169
|
-
|
|
25828
|
+
useLayoutEffect6(() => {
|
|
26170
25829
|
const next = resolveSubdomain(subdomainFromQuery);
|
|
26171
25830
|
if (next !== subdomain) setSubdomain(next);
|
|
26172
25831
|
if (next) return;
|
|
@@ -26178,7 +25837,7 @@ function OhhwellsBridge() {
|
|
|
26178
25837
|
}, 0);
|
|
26179
25838
|
return () => window.clearTimeout(t);
|
|
26180
25839
|
}, [subdomainFromQuery, subdomain]);
|
|
26181
|
-
|
|
25840
|
+
useEffect19(() => {
|
|
26182
25841
|
if (!subdomainFromQuery || typeof window === "undefined") return;
|
|
26183
25842
|
const url = new URL(window.location.href);
|
|
26184
25843
|
if (!url.searchParams.has("subdomain")) return;
|
|
@@ -26198,14 +25857,14 @@ function OhhwellsBridge() {
|
|
|
26198
25857
|
const [fetchState, setFetchState] = useState18("idle");
|
|
26199
25858
|
const [showBranding, setShowBranding] = useState18(false);
|
|
26200
25859
|
const autoSaveTimers = useRef14(/* @__PURE__ */ new Map());
|
|
26201
|
-
|
|
25860
|
+
useEffect19(() => {
|
|
26202
25861
|
stampBridgeVersionOnDocument();
|
|
26203
25862
|
}, []);
|
|
26204
|
-
|
|
25863
|
+
useEffect19(() => {
|
|
26205
25864
|
if (isEditMode) return;
|
|
26206
25865
|
return armLoaderHangBeacon(subdomain, fetchState);
|
|
26207
25866
|
}, [isEditMode, subdomain, fetchState]);
|
|
26208
|
-
|
|
25867
|
+
useEffect19(() => {
|
|
26209
25868
|
if (isEditMode || !subdomain) return;
|
|
26210
25869
|
const onError = (event) => {
|
|
26211
25870
|
reportOutageBeacon({
|
|
@@ -26346,7 +26005,7 @@ function OhhwellsBridge() {
|
|
|
26346
26005
|
}, []);
|
|
26347
26006
|
const selectMediaElementRef = useRef14(selectMediaElement);
|
|
26348
26007
|
selectMediaElementRef.current = selectMediaElement;
|
|
26349
|
-
|
|
26008
|
+
useEffect19(() => {
|
|
26350
26009
|
if (!selectedMedia) return;
|
|
26351
26010
|
const update = () => {
|
|
26352
26011
|
const el = selectedMediaElRef.current;
|
|
@@ -26561,7 +26220,7 @@ function OhhwellsBridge() {
|
|
|
26561
26220
|
const [fieldDragging, setFieldDragging] = useState18(false);
|
|
26562
26221
|
const clearFormPickRef = useRef14(clearFormPick);
|
|
26563
26222
|
clearFormPickRef.current = clearFormPick;
|
|
26564
|
-
|
|
26223
|
+
useEffect19(() => {
|
|
26565
26224
|
const el = fieldPickElRef.current;
|
|
26566
26225
|
if (!el || fieldPickRect === null) return;
|
|
26567
26226
|
const observer = new ResizeObserver(() => {
|
|
@@ -26570,7 +26229,7 @@ function OhhwellsBridge() {
|
|
|
26570
26229
|
observer.observe(el);
|
|
26571
26230
|
return () => observer.disconnect();
|
|
26572
26231
|
}, [fieldPickRect !== null, fieldPickState]);
|
|
26573
|
-
|
|
26232
|
+
useEffect19(() => {
|
|
26574
26233
|
const el = formPickElRef.current;
|
|
26575
26234
|
if (!el || formPickRect === null) return;
|
|
26576
26235
|
const observer = new ResizeObserver(() => {
|
|
@@ -26597,7 +26256,7 @@ function OhhwellsBridge() {
|
|
|
26597
26256
|
const hoveredItemElRef = useRef14(null);
|
|
26598
26257
|
const [hoveredItemRect, setHoveredItemRect] = useState18(null);
|
|
26599
26258
|
const [hoveredTextRect, setHoveredTextRect] = useState18(null);
|
|
26600
|
-
|
|
26259
|
+
useEffect19(() => {
|
|
26601
26260
|
const sync = () => {
|
|
26602
26261
|
const el = document.querySelector(
|
|
26603
26262
|
'[data-ohw-hovered]:not([contenteditable]):not([data-ohw-href-key]):not([data-ohw-editable="form"] *)'
|
|
@@ -26647,6 +26306,21 @@ function OhhwellsBridge() {
|
|
|
26647
26306
|
const [isItemDragging, setIsItemDragging] = useState18(false);
|
|
26648
26307
|
const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
|
|
26649
26308
|
isFooterFrameSelectionRef.current = isFooterFrameSelection;
|
|
26309
|
+
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
26310
|
+
const floatingPanelOpenRef = useRef14(false);
|
|
26311
|
+
floatingPanelOpenRef.current = floatingPanel !== null;
|
|
26312
|
+
const floatingPanelRef = useRef14(null);
|
|
26313
|
+
floatingPanelRef.current = floatingPanel;
|
|
26314
|
+
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
26315
|
+
const buttonCollectionDragRef = useRef14(null);
|
|
26316
|
+
const buttonDropInsertIndexRef = useRef14(null);
|
|
26317
|
+
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
26318
|
+
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
26319
|
+
const buttonPointerDragRef = useRef14(null);
|
|
26320
|
+
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
26321
|
+
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
26322
|
+
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
26323
|
+
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
26650
26324
|
const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
|
|
26651
26325
|
const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
|
|
26652
26326
|
const footerDragRef = useRef14(null);
|
|
@@ -26660,7 +26334,6 @@ function OhhwellsBridge() {
|
|
|
26660
26334
|
const linkPopoverSessionRef = useRef14(null);
|
|
26661
26335
|
const addNavAfterAnchorRef = useRef14(null);
|
|
26662
26336
|
const editContentRef = useRef14({});
|
|
26663
|
-
useBuildPageSync(isEditMode, editContentRef, postToParent2);
|
|
26664
26337
|
const aiSectionsRef = useRef14("");
|
|
26665
26338
|
const aiFooterRef = useRef14("");
|
|
26666
26339
|
const applyTreeLocalRef = useRef14(
|
|
@@ -26673,21 +26346,6 @@ function OhhwellsBridge() {
|
|
|
26673
26346
|
const stylesRef = useRef14("");
|
|
26674
26347
|
const appliedDrawerRef = useRef14(null);
|
|
26675
26348
|
const pendingDeleteUndoRef = useRef14(null);
|
|
26676
|
-
const [floatingPanel, setFloatingPanel] = useState18(null);
|
|
26677
|
-
const floatingPanelOpenRef = useRef14(false);
|
|
26678
|
-
const floatingPanelRef = useRef14(null);
|
|
26679
|
-
floatingPanelRef.current = floatingPanel;
|
|
26680
|
-
const setFloatingPanelRef = useRef14(setFloatingPanel);
|
|
26681
|
-
const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
|
|
26682
|
-
const buttonCollectionDragRef = useRef14(null);
|
|
26683
|
-
const buttonDropInsertIndexRef = useRef14(null);
|
|
26684
|
-
const [buttonDropSlots, setButtonDropSlots] = useState18([]);
|
|
26685
|
-
const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
|
|
26686
|
-
const buttonPointerDragRef = useRef14(null);
|
|
26687
|
-
const [buttonStyleTick, setButtonStyleTick] = useState18(0);
|
|
26688
|
-
const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
|
|
26689
|
-
const [editorViewport, setEditorViewport] = useState18("desktop");
|
|
26690
|
-
const [parentScrollSnap, setParentScrollSnap] = useState18(null);
|
|
26691
26349
|
const [sitePages, setSitePages] = useState18([]);
|
|
26692
26350
|
const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
|
|
26693
26351
|
const [sectionsByPath, setSectionsByPath] = useState18({});
|
|
@@ -26697,19 +26355,8 @@ function OhhwellsBridge() {
|
|
|
26697
26355
|
const linkPopoverOpenRef = useRef14(false);
|
|
26698
26356
|
const linkPopoverGraceUntilRef = useRef14(0);
|
|
26699
26357
|
setLinkPopoverRef.current = setLinkPopover;
|
|
26700
|
-
setFloatingPanelRef.current = setFloatingPanel;
|
|
26701
26358
|
linkPopoverSessionRef.current = linkPopover;
|
|
26702
|
-
|
|
26703
|
-
useEffect20(() => {
|
|
26704
|
-
const syncViewport = () => {
|
|
26705
|
-
const next = window.innerWidth <= 480 ? "mobile" : "desktop";
|
|
26706
|
-
setEditorViewport((prev) => prev === next ? prev : next);
|
|
26707
|
-
};
|
|
26708
|
-
syncViewport();
|
|
26709
|
-
window.addEventListener("resize", syncViewport);
|
|
26710
|
-
return () => window.removeEventListener("resize", syncViewport);
|
|
26711
|
-
}, []);
|
|
26712
|
-
useEffect20(() => {
|
|
26359
|
+
useEffect19(() => {
|
|
26713
26360
|
setSectionOrderPersistHandler((entries) => {
|
|
26714
26361
|
const currentPath = window.location.pathname;
|
|
26715
26362
|
const merged = mergePageSectionOrder(editContentRef.current[SECTION_ORDER_KEY], currentPath, entries);
|
|
@@ -26719,7 +26366,7 @@ function OhhwellsBridge() {
|
|
|
26719
26366
|
});
|
|
26720
26367
|
return () => setSectionOrderPersistHandler(null);
|
|
26721
26368
|
}, []);
|
|
26722
|
-
|
|
26369
|
+
useEffect19(() => {
|
|
26723
26370
|
setAiFooterMountOptions({
|
|
26724
26371
|
resolvePageHref: (pageOrAnchorId) => {
|
|
26725
26372
|
const [pageId, anchor] = pageOrAnchorId.split("#");
|
|
@@ -26803,7 +26450,7 @@ function OhhwellsBridge() {
|
|
|
26803
26450
|
}, [isEditMode, pathname]);
|
|
26804
26451
|
const runSectionsPrefetchRef = useRef14(runSectionsPrefetch);
|
|
26805
26452
|
runSectionsPrefetchRef.current = runSectionsPrefetch;
|
|
26806
|
-
|
|
26453
|
+
useEffect19(() => {
|
|
26807
26454
|
if (!linkPopover) {
|
|
26808
26455
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
26809
26456
|
return;
|
|
@@ -26831,7 +26478,7 @@ function OhhwellsBridge() {
|
|
|
26831
26478
|
document.documentElement.removeAttribute("data-ohw-link-popover-open");
|
|
26832
26479
|
};
|
|
26833
26480
|
}, [linkPopover, postToParent2]);
|
|
26834
|
-
|
|
26481
|
+
useEffect19(() => {
|
|
26835
26482
|
if (!isEditMode) return;
|
|
26836
26483
|
const useFixtures = shouldUseDevFixtures();
|
|
26837
26484
|
if (useFixtures) {
|
|
@@ -26857,7 +26504,7 @@ function OhhwellsBridge() {
|
|
|
26857
26504
|
if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
|
|
26858
26505
|
return () => window.removeEventListener("message", onSitePages);
|
|
26859
26506
|
}, [isEditMode, postToParent2]);
|
|
26860
|
-
|
|
26507
|
+
useEffect19(() => {
|
|
26861
26508
|
if (!isEditMode) return;
|
|
26862
26509
|
const deps = {
|
|
26863
26510
|
getEditContent: () => editContentRef.current,
|
|
@@ -26894,14 +26541,14 @@ function OhhwellsBridge() {
|
|
|
26894
26541
|
window.addEventListener("message", onPageMessage);
|
|
26895
26542
|
return () => window.removeEventListener("message", onPageMessage);
|
|
26896
26543
|
}, [isEditMode, postToParent2]);
|
|
26897
|
-
|
|
26544
|
+
useEffect19(() => {
|
|
26898
26545
|
if (!isEditMode || shouldUseDevFixtures()) return;
|
|
26899
26546
|
void loadAllSectionsManifest().then((manifest) => {
|
|
26900
26547
|
if (Object.keys(manifest).length === 0) return;
|
|
26901
26548
|
setSectionsByPath((prev) => ({ ...manifest, ...prev }));
|
|
26902
26549
|
});
|
|
26903
26550
|
}, [isEditMode]);
|
|
26904
|
-
|
|
26551
|
+
useEffect19(() => {
|
|
26905
26552
|
const update = () => {
|
|
26906
26553
|
const el = activeElRef.current ?? selectedElRef.current;
|
|
26907
26554
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
@@ -28160,7 +27807,7 @@ function OhhwellsBridge() {
|
|
|
28160
27807
|
},
|
|
28161
27808
|
[postToParent2]
|
|
28162
27809
|
);
|
|
28163
|
-
|
|
27810
|
+
useEffect19(() => {
|
|
28164
27811
|
const onDragOver = (e) => {
|
|
28165
27812
|
const dragged = buttonCollectionDragRef.current;
|
|
28166
27813
|
if (!dragged) return;
|
|
@@ -28231,7 +27878,7 @@ function OhhwellsBridge() {
|
|
|
28231
27878
|
setLogoSizeDraft(null);
|
|
28232
27879
|
deselectRef.current();
|
|
28233
27880
|
}, []);
|
|
28234
|
-
|
|
27881
|
+
useEffect19(() => {
|
|
28235
27882
|
const session = floatingPanel && floatingPanel.kind === "logo-size" ? floatingPanel : null;
|
|
28236
27883
|
if (!session || !logoSizeDraft) {
|
|
28237
27884
|
postToParentRef.current({ type: "ow:logo-size-panel", open: false });
|
|
@@ -28389,7 +28036,7 @@ function OhhwellsBridge() {
|
|
|
28389
28036
|
deselectRef.current = deselect;
|
|
28390
28037
|
closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
|
|
28391
28038
|
const lastSiteWideScopeRef = useRef14(null);
|
|
28392
|
-
|
|
28039
|
+
useEffect19(() => {
|
|
28393
28040
|
if (!isEditMode) {
|
|
28394
28041
|
if (lastSiteWideScopeRef.current !== false) {
|
|
28395
28042
|
lastSiteWideScopeRef.current = false;
|
|
@@ -28415,7 +28062,7 @@ function OhhwellsBridge() {
|
|
|
28415
28062
|
isFooterFrameSelection,
|
|
28416
28063
|
postToParent2
|
|
28417
28064
|
]);
|
|
28418
|
-
|
|
28065
|
+
useLayoutEffect6(() => {
|
|
28419
28066
|
if (!subdomain || isEditMode) {
|
|
28420
28067
|
setFetchState("done");
|
|
28421
28068
|
return;
|
|
@@ -28442,7 +28089,6 @@ function OhhwellsBridge() {
|
|
|
28442
28089
|
applyAiFooterFromContent(content);
|
|
28443
28090
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28444
28091
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
28445
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28446
28092
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28447
28093
|
}
|
|
28448
28094
|
applyBrandChrome(content);
|
|
@@ -28453,16 +28099,15 @@ function OhhwellsBridge() {
|
|
|
28453
28099
|
if (key === "__ohw_sections") continue;
|
|
28454
28100
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28455
28101
|
if (key === AI_FOOTER_KEY) continue;
|
|
28456
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28457
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28458
28102
|
if (key === BRAND_KIT_KEY) continue;
|
|
28459
28103
|
if (key === STYLE_STORE_KEY) continue;
|
|
28460
28104
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28105
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28461
28106
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
28107
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28462
28108
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28463
28109
|
continue;
|
|
28464
28110
|
}
|
|
28465
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28466
28111
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28467
28112
|
if (applyCarouselNode(key, val)) continue;
|
|
28468
28113
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28502,7 +28147,6 @@ function OhhwellsBridge() {
|
|
|
28502
28147
|
});
|
|
28503
28148
|
applyLinkByKey(key, val);
|
|
28504
28149
|
}
|
|
28505
|
-
applySectionEmbeds(content);
|
|
28506
28150
|
applyLogoFromContent(content);
|
|
28507
28151
|
applyLogoSizes(content);
|
|
28508
28152
|
reconcileNavbarItemsFromContent(content);
|
|
@@ -28569,7 +28213,7 @@ function OhhwellsBridge() {
|
|
|
28569
28213
|
cancelled = true;
|
|
28570
28214
|
};
|
|
28571
28215
|
}, [subdomain, isEditMode]);
|
|
28572
|
-
|
|
28216
|
+
useEffect19(() => {
|
|
28573
28217
|
if (!isEditMode) return;
|
|
28574
28218
|
const resolveIndex = (form, clientY) => {
|
|
28575
28219
|
const wrappers = listFieldWrappers(form).filter((el) => fieldKeyOf(el) !== fieldDragRef.current?.key);
|
|
@@ -28610,7 +28254,7 @@ function OhhwellsBridge() {
|
|
|
28610
28254
|
window.removeEventListener("drop", onDrop, true);
|
|
28611
28255
|
};
|
|
28612
28256
|
}, [buildFieldDropSlots, isEditMode, persistFields, selectField]);
|
|
28613
|
-
|
|
28257
|
+
useEffect19(() => {
|
|
28614
28258
|
if (!isEditMode) return;
|
|
28615
28259
|
const mark = () => document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
28616
28260
|
markFormFields(form);
|
|
@@ -28622,7 +28266,7 @@ function OhhwellsBridge() {
|
|
|
28622
28266
|
});
|
|
28623
28267
|
return () => observer.disconnect();
|
|
28624
28268
|
}, [isEditMode, fetchState, pathname]);
|
|
28625
|
-
|
|
28269
|
+
useEffect19(() => {
|
|
28626
28270
|
if (!isEditMode) return;
|
|
28627
28271
|
let saveTimer = null;
|
|
28628
28272
|
const onInput = (e) => {
|
|
@@ -28644,14 +28288,14 @@ function OhhwellsBridge() {
|
|
|
28644
28288
|
document.addEventListener("input", onInput, true);
|
|
28645
28289
|
return () => document.removeEventListener("input", onInput, true);
|
|
28646
28290
|
}, [isEditMode, persistFields]);
|
|
28647
|
-
|
|
28291
|
+
useEffect19(() => {
|
|
28648
28292
|
if (isEditMode || fetchState !== "done") return;
|
|
28649
28293
|
const content = contentCache.get(subdomain) ?? {};
|
|
28650
28294
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
28651
28295
|
reconcileFieldsFromContent(form, content);
|
|
28652
28296
|
});
|
|
28653
28297
|
}, [isEditMode, fetchState, subdomain]);
|
|
28654
|
-
|
|
28298
|
+
useEffect19(() => {
|
|
28655
28299
|
if (!isEditMode) return;
|
|
28656
28300
|
const swallow = (e) => {
|
|
28657
28301
|
const target = e.target;
|
|
@@ -28660,14 +28304,14 @@ function OhhwellsBridge() {
|
|
|
28660
28304
|
document.addEventListener("submit", swallow, true);
|
|
28661
28305
|
return () => document.removeEventListener("submit", swallow, true);
|
|
28662
28306
|
}, [isEditMode]);
|
|
28663
|
-
|
|
28307
|
+
useEffect19(() => {
|
|
28664
28308
|
if (isEditMode || fetchState !== "done") return;
|
|
28665
28309
|
console.log("env", process.env.NEXT_PUBLIC_FLOWOPS_API_URL);
|
|
28666
28310
|
const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
|
|
28667
28311
|
console.log({ apiUrl, subdomain });
|
|
28668
28312
|
bindPublishedForms(apiUrl, subdomain, contentCache.get(subdomain) ?? {});
|
|
28669
28313
|
}, [isEditMode, fetchState, subdomain]);
|
|
28670
|
-
|
|
28314
|
+
useEffect19(() => {
|
|
28671
28315
|
if (!subdomain || isEditMode) return;
|
|
28672
28316
|
let debounceTimer = null;
|
|
28673
28317
|
let observer = null;
|
|
@@ -28691,22 +28335,20 @@ function OhhwellsBridge() {
|
|
|
28691
28335
|
}
|
|
28692
28336
|
applyAiFooterFromContent(content);
|
|
28693
28337
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
28694
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
28695
28338
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
28696
28339
|
}
|
|
28697
28340
|
for (const [key, val] of Object.entries(content)) {
|
|
28698
28341
|
if (key === "__ohw_sections") continue;
|
|
28699
28342
|
if (key === AI_SECTIONS_KEY) continue;
|
|
28700
28343
|
if (key === AI_FOOTER_KEY) continue;
|
|
28701
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28702
|
-
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28703
28344
|
if (key === BRAND_KIT_KEY) continue;
|
|
28704
28345
|
if (key === STYLE_STORE_KEY) continue;
|
|
28705
28346
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
28347
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
28348
|
+
if (LOGO_IMAGE_KEYS.includes(key)) continue;
|
|
28706
28349
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
28707
28350
|
continue;
|
|
28708
28351
|
}
|
|
28709
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
28710
28352
|
if (applyVideoSettingNode(key, val)) continue;
|
|
28711
28353
|
if (applyCarouselNode(key, val)) continue;
|
|
28712
28354
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -28731,7 +28373,6 @@ function OhhwellsBridge() {
|
|
|
28731
28373
|
});
|
|
28732
28374
|
applyLinkByKey(key, val);
|
|
28733
28375
|
}
|
|
28734
|
-
applySectionEmbeds(content);
|
|
28735
28376
|
applyLogoFromContent(content);
|
|
28736
28377
|
reconcileNavbarItemsFromContent(content);
|
|
28737
28378
|
reconcileFooterOrderFromContent(content);
|
|
@@ -28787,16 +28428,16 @@ function OhhwellsBridge() {
|
|
|
28787
28428
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
28788
28429
|
};
|
|
28789
28430
|
}, [subdomain, isEditMode, pathname]);
|
|
28790
|
-
|
|
28431
|
+
useLayoutEffect6(() => {
|
|
28791
28432
|
const el = document.getElementById("ohw-loader");
|
|
28792
28433
|
if (!el) return;
|
|
28793
28434
|
const visible = Boolean(subdomain) && fetchState !== "done";
|
|
28794
28435
|
el.style.display = visible ? "flex" : "none";
|
|
28795
28436
|
}, [subdomain, fetchState]);
|
|
28796
|
-
|
|
28437
|
+
useEffect19(() => {
|
|
28797
28438
|
postToParent2({ type: "ow:navigation", path: pathname });
|
|
28798
28439
|
}, [pathname, postToParent2]);
|
|
28799
|
-
|
|
28440
|
+
useEffect19(() => {
|
|
28800
28441
|
if (!subdomain || isEditMode) return;
|
|
28801
28442
|
const content = contentCache.get(subdomain);
|
|
28802
28443
|
if (!content) return;
|
|
@@ -28814,7 +28455,7 @@ function OhhwellsBridge() {
|
|
|
28814
28455
|
}
|
|
28815
28456
|
applyAiFooterFromContent(content);
|
|
28816
28457
|
}, [pathname, subdomain, isEditMode]);
|
|
28817
|
-
|
|
28458
|
+
useEffect19(() => {
|
|
28818
28459
|
if (!isEditMode) return;
|
|
28819
28460
|
if (linkPopoverSessionRef.current?.intent === "add-nav") return;
|
|
28820
28461
|
if (document.querySelector("[data-ohw-section-picker]")) return;
|
|
@@ -28822,12 +28463,12 @@ function OhhwellsBridge() {
|
|
|
28822
28463
|
deselectRef.current();
|
|
28823
28464
|
deactivateRef.current();
|
|
28824
28465
|
}, [pathname, isEditMode]);
|
|
28825
|
-
|
|
28466
|
+
useEffect19(() => {
|
|
28826
28467
|
if (!isEditMode) return;
|
|
28827
28468
|
initSectionInstancesFromContent(editContentRef.current, pathname);
|
|
28828
28469
|
initItemInstancesFromContent(editContentRef.current);
|
|
28829
28470
|
}, [pathname, isEditMode]);
|
|
28830
|
-
|
|
28471
|
+
useEffect19(() => {
|
|
28831
28472
|
if (!isEditMode) return;
|
|
28832
28473
|
const observer = new MutationObserver(() => {
|
|
28833
28474
|
const drawer = document.querySelector("[data-ohw-nav-drawer]");
|
|
@@ -28838,7 +28479,7 @@ function OhhwellsBridge() {
|
|
|
28838
28479
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
28839
28480
|
return () => observer.disconnect();
|
|
28840
28481
|
}, [isEditMode, pathname]);
|
|
28841
|
-
|
|
28482
|
+
useEffect19(() => {
|
|
28842
28483
|
const contentForNav = () => {
|
|
28843
28484
|
if (isEditMode) return editContentRef.current;
|
|
28844
28485
|
if (!subdomain) return {};
|
|
@@ -28911,7 +28552,7 @@ function OhhwellsBridge() {
|
|
|
28911
28552
|
observer?.disconnect();
|
|
28912
28553
|
};
|
|
28913
28554
|
}, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
|
|
28914
|
-
|
|
28555
|
+
useEffect19(() => {
|
|
28915
28556
|
if (!isEditMode) return;
|
|
28916
28557
|
let applying = false;
|
|
28917
28558
|
let rafId = null;
|
|
@@ -28949,7 +28590,7 @@ function OhhwellsBridge() {
|
|
|
28949
28590
|
observer.disconnect();
|
|
28950
28591
|
};
|
|
28951
28592
|
}, [isEditMode, pathname]);
|
|
28952
|
-
|
|
28593
|
+
useEffect19(() => {
|
|
28953
28594
|
if (!isEditMode) return;
|
|
28954
28595
|
let lastPosted = 0;
|
|
28955
28596
|
const measure = () => {
|
|
@@ -28971,14 +28612,29 @@ function OhhwellsBridge() {
|
|
|
28971
28612
|
const t2 = setTimeout(measure, 500);
|
|
28972
28613
|
const ro = new ResizeObserver(schedule);
|
|
28973
28614
|
ro.observe(document.body);
|
|
28615
|
+
let lastWidth = window.innerWidth;
|
|
28616
|
+
let resizeTimers = [];
|
|
28617
|
+
const clearResizeTimers = () => {
|
|
28618
|
+
resizeTimers.forEach(clearTimeout);
|
|
28619
|
+
resizeTimers = [];
|
|
28620
|
+
};
|
|
28621
|
+
const handleResize = () => {
|
|
28622
|
+
if (window.innerWidth === lastWidth) return;
|
|
28623
|
+
lastWidth = window.innerWidth;
|
|
28624
|
+
clearResizeTimers();
|
|
28625
|
+
resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
|
|
28626
|
+
};
|
|
28627
|
+
window.addEventListener("resize", handleResize);
|
|
28974
28628
|
return () => {
|
|
28975
28629
|
clearTimeout(t1);
|
|
28976
28630
|
clearTimeout(t2);
|
|
28977
28631
|
if (raf != null) cancelAnimationFrame(raf);
|
|
28978
28632
|
ro.disconnect();
|
|
28633
|
+
clearResizeTimers();
|
|
28634
|
+
window.removeEventListener("resize", handleResize);
|
|
28979
28635
|
};
|
|
28980
28636
|
}, [pathname, isEditMode, postToParent2]);
|
|
28981
|
-
|
|
28637
|
+
useEffect19(() => {
|
|
28982
28638
|
if (isEditMode) return;
|
|
28983
28639
|
const handleClick = (e) => {
|
|
28984
28640
|
if (!isPlainLeftClick(e)) return;
|
|
@@ -28992,7 +28648,7 @@ function OhhwellsBridge() {
|
|
|
28992
28648
|
document.addEventListener("click", handleClick, true);
|
|
28993
28649
|
return () => document.removeEventListener("click", handleClick, true);
|
|
28994
28650
|
}, [isEditMode, router, pathname]);
|
|
28995
|
-
|
|
28651
|
+
useEffect19(() => {
|
|
28996
28652
|
if (!isEditMode) {
|
|
28997
28653
|
editStylesRef.current?.base.remove();
|
|
28998
28654
|
editStylesRef.current?.forceHover.remove();
|
|
@@ -29272,13 +28928,6 @@ function OhhwellsBridge() {
|
|
|
29272
28928
|
if (target.closest("[data-ohw-state-toggle]")) return;
|
|
29273
28929
|
if (target.closest("[data-ohw-max-badge]")) return;
|
|
29274
28930
|
if (isInsideLinkEditor(target)) return;
|
|
29275
|
-
if (isInsideFloatingPanel(target)) return;
|
|
29276
|
-
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29277
|
-
if (target.closest(
|
|
29278
|
-
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
29279
|
-
)) {
|
|
29280
|
-
return;
|
|
29281
|
-
}
|
|
29282
28931
|
if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
|
|
29283
28932
|
clearMediaSelectionRef.current();
|
|
29284
28933
|
}
|
|
@@ -29302,6 +28951,8 @@ function OhhwellsBridge() {
|
|
|
29302
28951
|
return;
|
|
29303
28952
|
}
|
|
29304
28953
|
}
|
|
28954
|
+
if (isInsideFloatingPanel(target)) return;
|
|
28955
|
+
if (target.closest("[data-ohw-form-toolbar]")) return;
|
|
29305
28956
|
const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
|
|
29306
28957
|
if (collectionItem) {
|
|
29307
28958
|
e.preventDefault();
|
|
@@ -29313,6 +28964,11 @@ function OhhwellsBridge() {
|
|
|
29313
28964
|
});
|
|
29314
28965
|
return;
|
|
29315
28966
|
}
|
|
28967
|
+
if (target.closest(
|
|
28968
|
+
'[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
|
|
28969
|
+
)) {
|
|
28970
|
+
return;
|
|
28971
|
+
}
|
|
29316
28972
|
{
|
|
29317
28973
|
const formEl = getFormElement(target);
|
|
29318
28974
|
const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
|
|
@@ -29466,13 +29122,9 @@ function OhhwellsBridge() {
|
|
|
29466
29122
|
if (isIconEditable(editable) && !getSocialItem(editable)) {
|
|
29467
29123
|
e.preventDefault();
|
|
29468
29124
|
e.stopPropagation();
|
|
29125
|
+
selectIconElementRef.current(editable);
|
|
29469
29126
|
const aiIcon = editable.hasAttribute("data-ai-icon");
|
|
29470
29127
|
const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
|
|
29471
|
-
if (aiIcon) {
|
|
29472
|
-
aiSectionApiRef.current?.selectFromElement(editable);
|
|
29473
|
-
} else {
|
|
29474
|
-
selectIconElementRef.current(editable);
|
|
29475
|
-
}
|
|
29476
29128
|
postToParentRef.current({
|
|
29477
29129
|
type: "ow:icon-pick",
|
|
29478
29130
|
key: editable.dataset.ohwKey ?? "",
|
|
@@ -29700,9 +29352,6 @@ function OhhwellsBridge() {
|
|
|
29700
29352
|
setHoveredItemRect(null);
|
|
29701
29353
|
hoveredNavContainerRef.current = null;
|
|
29702
29354
|
setHoveredNavContainerRect(null);
|
|
29703
|
-
siblingHintElRef.current = null;
|
|
29704
|
-
setSiblingHintRect(null);
|
|
29705
|
-
setSiblingHintRects([]);
|
|
29706
29355
|
return;
|
|
29707
29356
|
}
|
|
29708
29357
|
{
|
|
@@ -29823,6 +29472,7 @@ function OhhwellsBridge() {
|
|
|
29823
29472
|
hoveredNavContainerRef.current = null;
|
|
29824
29473
|
setHoveredNavContainerRect(null);
|
|
29825
29474
|
hoveredItemElRef.current = editable;
|
|
29475
|
+
setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
|
|
29826
29476
|
}
|
|
29827
29477
|
}
|
|
29828
29478
|
}
|
|
@@ -30532,11 +30182,7 @@ function OhhwellsBridge() {
|
|
|
30532
30182
|
};
|
|
30533
30183
|
const handleMouseMove = (e) => {
|
|
30534
30184
|
const { clientX, clientY } = e;
|
|
30535
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30536
|
-
dismissImageHover();
|
|
30537
|
-
clearImageHover();
|
|
30538
|
-
return;
|
|
30539
|
-
}
|
|
30185
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30540
30186
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
|
|
30541
30187
|
document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
|
|
30542
30188
|
formHoverElRef.current = null;
|
|
@@ -30565,12 +30211,7 @@ function OhhwellsBridge() {
|
|
|
30565
30211
|
setHoveredItemRect(null);
|
|
30566
30212
|
hoveredNavContainerRef.current = null;
|
|
30567
30213
|
setHoveredNavContainerRect(null);
|
|
30568
|
-
siblingHintElRef.current = null;
|
|
30569
|
-
setSiblingHintRect(null);
|
|
30570
|
-
setSiblingHintRects([]);
|
|
30571
30214
|
dismissImageHover();
|
|
30572
|
-
clearImageHover();
|
|
30573
|
-
setSectionGap(null);
|
|
30574
30215
|
return;
|
|
30575
30216
|
}
|
|
30576
30217
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
@@ -30582,11 +30223,7 @@ function OhhwellsBridge() {
|
|
|
30582
30223
|
if (e.data?.type !== "ow:pointer-sync") return;
|
|
30583
30224
|
const { clientX, clientY } = e.data;
|
|
30584
30225
|
if (typeof clientX !== "number" || typeof clientY !== "number") return;
|
|
30585
|
-
if (pointOwnedByFloatingPanel(clientX, clientY))
|
|
30586
|
-
dismissImageHover();
|
|
30587
|
-
clearImageHover();
|
|
30588
|
-
return;
|
|
30589
|
-
}
|
|
30226
|
+
if (pointOwnedByFloatingPanel(clientX, clientY)) return;
|
|
30590
30227
|
if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
|
|
30591
30228
|
if (probeSocialsRowAt(clientX, clientY)) return;
|
|
30592
30229
|
probeSectionGapAt(clientX, clientY);
|
|
@@ -30966,7 +30603,6 @@ function OhhwellsBridge() {
|
|
|
30966
30603
|
applyAiFooterFromContent(content);
|
|
30967
30604
|
if (typeof content[STYLE_STORE_KEY] === "string") {
|
|
30968
30605
|
stylesRef.current = content[STYLE_STORE_KEY];
|
|
30969
|
-
document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
|
|
30970
30606
|
applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
|
|
30971
30607
|
}
|
|
30972
30608
|
applyBrandChrome(content);
|
|
@@ -30981,16 +30617,15 @@ function OhhwellsBridge() {
|
|
|
30981
30617
|
}
|
|
30982
30618
|
if (key === AI_SECTIONS_KEY) continue;
|
|
30983
30619
|
if (key === AI_FOOTER_KEY) continue;
|
|
30984
|
-
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30985
|
-
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
30986
30620
|
if (key === BRAND_KIT_KEY) continue;
|
|
30987
30621
|
if (key === STYLE_STORE_KEY) continue;
|
|
30988
30622
|
if (BRAND_CHROME_KEYS.has(key)) continue;
|
|
30623
|
+
if (key === LOGO_PLACEHOLDER_KEY) continue;
|
|
30989
30624
|
if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
|
|
30625
|
+
if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
|
|
30990
30626
|
if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
|
|
30991
30627
|
continue;
|
|
30992
30628
|
}
|
|
30993
|
-
if (key.endsWith(SECTION_EMBED_SUFFIX)) continue;
|
|
30994
30629
|
if (applyVideoSettingNode(key, val)) continue;
|
|
30995
30630
|
if (applyCarouselNode(key, val)) continue;
|
|
30996
30631
|
document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
|
|
@@ -31016,7 +30651,6 @@ function OhhwellsBridge() {
|
|
|
31016
30651
|
});
|
|
31017
30652
|
applyLinkByKey(key, val);
|
|
31018
30653
|
}
|
|
31019
|
-
applySectionEmbeds(content);
|
|
31020
30654
|
applyLogoFromContent(content);
|
|
31021
30655
|
applyLogoSizes(content);
|
|
31022
30656
|
document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
|
|
@@ -31624,12 +31258,6 @@ function OhhwellsBridge() {
|
|
|
31624
31258
|
closeLinkPopoverRef.current();
|
|
31625
31259
|
return;
|
|
31626
31260
|
}
|
|
31627
|
-
if (floatingPanelOpenRef.current) {
|
|
31628
|
-
setFloatingPanelRef.current(null);
|
|
31629
|
-
deselectRef.current();
|
|
31630
|
-
deactivateRef.current();
|
|
31631
|
-
return;
|
|
31632
|
-
}
|
|
31633
31261
|
deselectRef.current();
|
|
31634
31262
|
deactivateRef.current();
|
|
31635
31263
|
clearMediaSelectionRef.current();
|
|
@@ -32465,17 +32093,17 @@ function OhhwellsBridge() {
|
|
|
32465
32093
|
window.removeEventListener("message", handleDuplicateSection);
|
|
32466
32094
|
window.removeEventListener("message", handleDeactivate);
|
|
32467
32095
|
window.removeEventListener("message", handleSelectNav);
|
|
32096
|
+
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32468
32097
|
window.removeEventListener("message", handleToastAction);
|
|
32469
32098
|
window.removeEventListener("message", handleFormCount);
|
|
32470
32099
|
window.removeEventListener("message", handleUiEscape);
|
|
32471
|
-
document.documentElement.removeAttribute("data-ohw-panel-dragging");
|
|
32472
32100
|
autoSaveTimers.current.forEach(clearTimeout);
|
|
32473
32101
|
autoSaveTimers.current.clear();
|
|
32474
32102
|
if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
|
|
32475
32103
|
if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
|
|
32476
32104
|
};
|
|
32477
32105
|
}, [isEditMode, refreshStateRules]);
|
|
32478
|
-
|
|
32106
|
+
useEffect19(() => {
|
|
32479
32107
|
if (!isEditMode) return;
|
|
32480
32108
|
const THRESHOLD = 10;
|
|
32481
32109
|
const resolveWasSelected = (el) => {
|
|
@@ -32631,7 +32259,7 @@ function OhhwellsBridge() {
|
|
|
32631
32259
|
unlockFooterDragInteraction();
|
|
32632
32260
|
};
|
|
32633
32261
|
}, [isEditMode]);
|
|
32634
|
-
|
|
32262
|
+
useEffect19(() => {
|
|
32635
32263
|
if (!isEditMode) return;
|
|
32636
32264
|
const THRESHOLD = 10;
|
|
32637
32265
|
const onPointerDown = (e) => {
|
|
@@ -32722,7 +32350,7 @@ function OhhwellsBridge() {
|
|
|
32722
32350
|
document.removeEventListener("selectstart", blockSelectStart, true);
|
|
32723
32351
|
};
|
|
32724
32352
|
}, [isEditMode, persistButtonCollectionDrag, refreshButtonDragVisuals]);
|
|
32725
|
-
|
|
32353
|
+
useEffect19(() => {
|
|
32726
32354
|
const handler = (e) => {
|
|
32727
32355
|
if (e.data?.type !== "ow:request-schedule-config") return;
|
|
32728
32356
|
const insertAfterVal = e.data.insertAfter;
|
|
@@ -32738,7 +32366,7 @@ function OhhwellsBridge() {
|
|
|
32738
32366
|
window.addEventListener("message", handler);
|
|
32739
32367
|
return () => window.removeEventListener("message", handler);
|
|
32740
32368
|
}, [processConfigRequest]);
|
|
32741
|
-
|
|
32369
|
+
useEffect19(() => {
|
|
32742
32370
|
if (!isEditMode) return;
|
|
32743
32371
|
document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
|
|
32744
32372
|
el.removeAttribute("data-ohw-active-state");
|
|
@@ -32762,7 +32390,7 @@ function OhhwellsBridge() {
|
|
|
32762
32390
|
postToParent2({
|
|
32763
32391
|
type: "ow:ready",
|
|
32764
32392
|
version: "1",
|
|
32765
|
-
bridgeVersion: "0.1.164
|
|
32393
|
+
bridgeVersion: "0.1.164",
|
|
32766
32394
|
path: pathname,
|
|
32767
32395
|
nodes: collectEditableNodes(editContentRef.current),
|
|
32768
32396
|
sections
|
|
@@ -32774,7 +32402,7 @@ function OhhwellsBridge() {
|
|
|
32774
32402
|
clearTimeout(timer);
|
|
32775
32403
|
};
|
|
32776
32404
|
}, [pathname, isEditMode, refreshStateRules, postToParent2]);
|
|
32777
|
-
|
|
32405
|
+
useEffect19(() => {
|
|
32778
32406
|
scrollToHashSectionWhenReady();
|
|
32779
32407
|
const onHashChange = () => scrollToHashSectionWhenReady();
|
|
32780
32408
|
window.addEventListener("hashchange", onHashChange);
|
|
@@ -32816,7 +32444,7 @@ function OhhwellsBridge() {
|
|
|
32816
32444
|
if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
|
|
32817
32445
|
refreshActiveCommandsRef.current();
|
|
32818
32446
|
}, []);
|
|
32819
|
-
|
|
32447
|
+
useEffect19(() => {
|
|
32820
32448
|
const session = floatingPanel && floatingPanel.kind === "logo-size" ? floatingPanel : null;
|
|
32821
32449
|
if (!session || !logoSizeDraft) return;
|
|
32822
32450
|
const onPanelAction = (e) => {
|
|
@@ -33497,7 +33125,7 @@ function OhhwellsBridge() {
|
|
|
33497
33125
|
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
|
|
33498
33126
|
onClick: () => setFieldTypePickerOpen((open) => !open),
|
|
33499
33127
|
"data-ohw-add-field": "",
|
|
33500
|
-
children: /* @__PURE__ */ jsx40(
|
|
33128
|
+
children: /* @__PURE__ */ jsx40(Plus5, { size: 15, "aria-hidden": true })
|
|
33501
33129
|
}
|
|
33502
33130
|
),
|
|
33503
33131
|
/* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),
|
|
@@ -33990,7 +33618,6 @@ export {
|
|
|
33990
33618
|
hasMountedContentNodes,
|
|
33991
33619
|
indexCollectionItems,
|
|
33992
33620
|
insertFooterHours,
|
|
33993
|
-
isDeadPageHref,
|
|
33994
33621
|
isEditSessionActive,
|
|
33995
33622
|
isPlainLeftClick,
|
|
33996
33623
|
isRenderableFooterTree,
|
|
@@ -34002,7 +33629,6 @@ export {
|
|
|
34002
33629
|
parseAiFooterState,
|
|
34003
33630
|
parseAiSectionsState,
|
|
34004
33631
|
parseTarget,
|
|
34005
|
-
planBuildPageSync,
|
|
34006
33632
|
recordOverriddenPaths,
|
|
34007
33633
|
releaseTemplateLogoIfReplaced,
|
|
34008
33634
|
removeFooterBlock,
|