@ohhwells/bridge 0.1.177 → 0.1.179-next.473

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.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 useEffect22, useLayoutEffect as useLayoutEffect6, useRef as useRef14, useState as useState18 } from "react";
4
+ import React12, { useCallback as useCallback12, useEffect as useEffect22, useLayoutEffect as useLayoutEffect7, useRef as useRef14, useState as useState18 } from "react";
5
5
  import { createRoot as createRoot3 } from "react-dom/client";
6
6
  import { flushSync as flushSync3 } from "react-dom";
7
7
 
@@ -840,6 +840,11 @@ function findImages(deps, section) {
840
840
  if (url && style.objectFit === "cover") out.push({ el, url, urlLayer: -1 });
841
841
  continue;
842
842
  }
843
+ if (el.tagName === "VIDEO") {
844
+ const url = el.poster;
845
+ if (url && style.objectFit === "cover") out.push({ el, url, urlLayer: -1 });
846
+ continue;
847
+ }
843
848
  const layers = bgLayers(style);
844
849
  const urlLayer = layers.findIndex((l) => urlOf(l) !== null);
845
850
  if (urlLayer >= 0) out.push({ el, url: urlOf(layers[urlLayer]), urlLayer });
@@ -1261,7 +1266,8 @@ function toneOverlayLogos(deps, root, photoSections, boxes) {
1261
1266
  if (root.matches(OVERLAY_LOGO_SELECTOR)) logos.unshift(root);
1262
1267
  for (const logo of logos) {
1263
1268
  if (onOwnSurface(deps, logo, root)) {
1264
- logo.removeAttribute(OVERLAY_TONE_ATTR);
1269
+ if (paintOver(deps.style(logo), { r: 0, g: 0, b: 0, a: 0 }).painted) logo.removeAttribute(OVERLAY_TONE_ATTR);
1270
+ else clearOverlayTone(logo);
1265
1271
  continue;
1266
1272
  }
1267
1273
  const box = deps.rect(logo);
@@ -1412,13 +1418,14 @@ var WATCHED_ATTRS = [
1412
1418
  "class",
1413
1419
  "src",
1414
1420
  "srcset",
1421
+ "poster",
1415
1422
  "data-ohw-style-bg",
1416
1423
  "data-ohw-style-bgcolor",
1417
1424
  "data-ohw-style-cardbg",
1418
1425
  // The editor's Default / Hover toggle forces :hover rules through this attribute.
1419
1426
  "data-ohw-active-state"
1420
1427
  ];
1421
- var VISIBILITY_TRANSITIONS = /* @__PURE__ */ new Set(["opacity", "visibility"]);
1428
+ var RESCAN_TRANSITIONS = /* @__PURE__ */ new Set(["opacity", "visibility", "background-color", "background"]);
1422
1429
  function outermostSection(node) {
1423
1430
  let el = node instanceof Element ? node : node?.parentElement ?? null;
1424
1431
  let top = null;
@@ -1483,7 +1490,7 @@ function mountBackgroundTone(doc = document) {
1483
1490
  });
1484
1491
  const onResize = () => schedule();
1485
1492
  const onTransitionEnd = (event) => {
1486
- if (!VISIBILITY_TRANSITIONS.has(event.propertyName)) return;
1493
+ if (!RESCAN_TRANSITIONS.has(event.propertyName)) return;
1487
1494
  const section = outermostSection(event.target);
1488
1495
  if (section) schedule(section);
1489
1496
  };
@@ -8058,6 +8065,21 @@ function pricingCardFeatureCount(tree, index) {
8058
8065
  const target = findPricingCollection(tree)?.children?.[index];
8059
8066
  return target ? pricingFeatureList(target).length : 0;
8060
8067
  }
8068
+ function prevailingFeatureIcon(features) {
8069
+ const counts = /* @__PURE__ */ new Map();
8070
+ for (const row of features) {
8071
+ const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
8072
+ const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
8073
+ entry.count += 1;
8074
+ counts.set(key, entry);
8075
+ }
8076
+ let best = null;
8077
+ for (const entry of counts.values()) {
8078
+ if (!best || entry.count > best.count) best = entry;
8079
+ }
8080
+ if (!best) return {};
8081
+ return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
8082
+ }
8061
8083
  function addPricingCardFeature(tree, index, text) {
8062
8084
  return withPricingCollection(tree, (collection) => {
8063
8085
  const children = collection.children;
@@ -8066,7 +8088,7 @@ function addPricingCardFeature(tree, index, text) {
8066
8088
  const features = pricingFeatureList(target);
8067
8089
  if (features.length >= PRICING_FEATURES_MAX) return false;
8068
8090
  target.slots = target.slots ?? {};
8069
- target.slots.features = [...features, { text }];
8091
+ target.slots.features = [...features, { text, ...prevailingFeatureIcon(features) }];
8070
8092
  return true;
8071
8093
  });
8072
8094
  }
@@ -9601,7 +9623,7 @@ var AI_MOBILE_CSS = [
9601
9623
  // page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
9602
9624
  // template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
9603
9625
  // an exact figure from (no live measurement exists), so this is a safe approximation, not a
9604
- // pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
9626
+ // pixel-exact fit. Horizontal spacing already comes from `data-ai-section-inner`.
9605
9627
  '[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
9606
9628
  // A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
9607
9629
  // window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
@@ -9617,8 +9639,10 @@ var AI_MOBILE_CSS = [
9617
9639
  "[data-ai-section]{overflow-x:hidden}",
9618
9640
  // `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
9619
9641
  // full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
9620
- // still got a 20px band of section background down both sides on a phone.
9621
- "[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
9642
+ // still got a 20px band of section background down both sides on a phone. The footer's own
9643
+ // container keeps the unguarded rule below — `data-ai-full-bleed` can never appear on it.
9644
+ "[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
9645
+ "[data-ai-container]{padding:0 20px !important}",
9622
9646
  "[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
9623
9647
  "[data-ai-cell]{width:100%;min-width:0}",
9624
9648
  // The rule above turns every row into a COLUMN flex container on phones, which silently breaks
@@ -9823,6 +9847,31 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
9823
9847
  function textAttrs(ctx, path) {
9824
9848
  return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
9825
9849
  }
9850
+ var AI_RESPONSIVE_CSS = [
9851
+ "@media (max-width: 960px) {",
9852
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
9853
+ ' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
9854
+ "}",
9855
+ "@media (max-width: 640px) {",
9856
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
9857
+ " [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
9858
+ // Group containers flatten to a column on phones; span placements come along for free.
9859
+ // `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
9860
+ // the comment there. This sheet's copy is the narrower selector, so without the exemption it
9861
+ // flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
9862
+ // viewport with the heading/CTA in flow *under* the image, 219px of section background where the
9863
+ // layered text used to be.
9864
+ ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
9865
+ ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
9866
+ // `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
9867
+ // is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
9868
+ // a full-bleed hero gets its 20px side band back below 640px only — the one width where the
9869
+ // other rule had already been taught to stand down.
9870
+ " [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
9871
+ " [data-ai-responsive] { overflow-x: hidden; }",
9872
+ " [data-ai-responsive] img { max-width: 100%; }",
9873
+ "}"
9874
+ ].join("\n");
9826
9875
  var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
9827
9876
  function MediaBox({
9828
9877
  refValue,
@@ -9877,7 +9926,7 @@ function MediaBox({
9877
9926
  position: fill ? "absolute" : void 0,
9878
9927
  inset: fill ? 0 : void 0,
9879
9928
  width: fill ? "100%" : fixedSize ? "auto" : "100%",
9880
- height: fill ? "100%" : void 0,
9929
+ height: fill ? "100%" : fixedSize ? height : void 0,
9881
9930
  aspectRatio: fill ? void 0 : aspectRatio,
9882
9931
  minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
9883
9932
  borderRadius: radius,
@@ -11379,7 +11428,7 @@ function CollectionBlock({ node, ctx, path }) {
11379
11428
  return /* @__PURE__ */ jsx(
11380
11429
  "div",
11381
11430
  {
11382
- "data-ai-grid": "",
11431
+ "data-ai-grid": String(itemsPerRow),
11383
11432
  "data-ohw-pricing-collection": isPricing ? "" : void 0,
11384
11433
  style: {
11385
11434
  display: "grid",
@@ -11681,7 +11730,7 @@ function renderNode(node, ctx, path, ambientAlign) {
11681
11730
  },
11682
11731
  children: [
11683
11732
  i > 0 && ctx.heroOverlapFullBleed ? (
11684
- // The section's `data-ai-container` gave up its max-width/gutter so the base
11733
+ // The section's `data-ai-section-inner` gave up its max-width/gutter so the base
11685
11734
  // layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
11686
11735
  // scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
11687
11736
  // the full section width instead of reading at the usual content width.
@@ -12095,6 +12144,7 @@ function AiTreeRenderer({
12095
12144
  ...fillHeight ? { "data-ai-fill-height": "" } : {},
12096
12145
  ...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
12097
12146
  ...bgAttrs,
12147
+ "data-ai-responsive": "",
12098
12148
  style: {
12099
12149
  position: "relative",
12100
12150
  padding: `${padCss} 0`,
@@ -12108,12 +12158,13 @@ function AiTreeRenderer({
12108
12158
  ...fillHeight ? { display: "grid" } : {}
12109
12159
  },
12110
12160
  children: [
12111
- isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
12161
+ /* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
12112
12162
  /* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
12163
+ isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
12113
12164
  /* @__PURE__ */ jsx(
12114
12165
  "div",
12115
12166
  {
12116
- "data-ai-container": "",
12167
+ "data-ai-section-inner": "",
12117
12168
  ...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
12118
12169
  style: {
12119
12170
  position: "relative",
@@ -12130,7 +12181,7 @@ function AiTreeRenderer({
12130
12181
  children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
12131
12182
  "div",
12132
12183
  {
12133
- "data-ai-row": "",
12184
+ "data-ai-columns": "",
12134
12185
  style: {
12135
12186
  display: "grid",
12136
12187
  gridTemplateColumns: "repeat(12, 1fr)",
@@ -12792,9 +12843,10 @@ function applyAiSectionsToDom(state, options) {
12792
12843
  if (existing && existing.serialized === serialized && existing.container.isConnected) {
12793
12844
  continue;
12794
12845
  }
12795
- const isNewMount = !existing || !existing.container.isConnected;
12796
12846
  let container = existing?.container;
12847
+ let isNewMount = false;
12797
12848
  if (!container || !container.isConnected) {
12849
+ isNewMount = true;
12798
12850
  existing?.root.unmount();
12799
12851
  container?.remove();
12800
12852
  container = document.createElement("div");
@@ -13132,6 +13184,34 @@ function minSpanForFooterBlock(type) {
13132
13184
  return 3;
13133
13185
  }
13134
13186
  }
13187
+ function readLiveSocialItems() {
13188
+ const root = getFooterRoot();
13189
+ const row = root?.querySelector("[data-ohw-socials-row]");
13190
+ if (!row) return [];
13191
+ const items = [];
13192
+ for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
13193
+ const href = anchor.getAttribute("href")?.trim() ?? "";
13194
+ const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
13195
+ const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
13196
+ if (!platform || !/^https?:\/\//i.test(href)) continue;
13197
+ items.push({ platform, href });
13198
+ }
13199
+ return items;
13200
+ }
13201
+ function syncSocialRowsFromDom(tree) {
13202
+ const root = getFooterRoot();
13203
+ if (!root) return;
13204
+ const row = root.querySelector("[data-ohw-socials-row]");
13205
+ const live = readLiveSocialItems();
13206
+ if (row && live.length === 0) return;
13207
+ for (const col of tree.columns) {
13208
+ col.blocks = col.blocks.flatMap((block) => {
13209
+ if (block.type !== "social-row") return [block];
13210
+ if (!row) return [];
13211
+ return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
13212
+ });
13213
+ }
13214
+ }
13135
13215
  function collectBrandBlocks(tree) {
13136
13216
  const brand = [];
13137
13217
  for (const col of tree.columns) {
@@ -13377,6 +13457,7 @@ function textOf2(el) {
13377
13457
  }
13378
13458
  function syncFooterTreeLinksFromDom(tree) {
13379
13459
  const next = cloneTree2(tree);
13460
+ syncSocialRowsFromDom(next);
13380
13461
  const domCols = listFooterColumns().map((col) => {
13381
13462
  const heading = getFooterColumnHeadingEl(col);
13382
13463
  const title = heading ? textOf2(heading) : void 0;
@@ -19202,7 +19283,7 @@ function apiBase() {
19202
19283
  function bridgeVersion() {
19203
19284
  try {
19204
19285
  if (true) {
19205
- return "0.1.177";
19286
+ return "0.1.179-next.473";
19206
19287
  }
19207
19288
  } catch {
19208
19289
  }
@@ -19216,7 +19297,7 @@ function stampBridgeVersionOnDocument() {
19216
19297
  return;
19217
19298
  }
19218
19299
  try {
19219
- const v = true ? "0.1.177" : "";
19300
+ const v = true ? "0.1.179-next.473" : "";
19220
19301
  if (v) {
19221
19302
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
19222
19303
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -19897,6 +19978,7 @@ function MediaOverlay({
19897
19978
  (prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
19898
19979
  );
19899
19980
  }, [isVideo]);
19981
+ const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
19900
19982
  const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
19901
19983
  const box = {
19902
19984
  position: "fixed",
@@ -19995,10 +20077,9 @@ function MediaOverlay({
19995
20077
  className: "flex items-center justify-center cursor-pointer",
19996
20078
  style: {
19997
20079
  ...box,
19998
- // When text overlays this media, let clicks fall THROUGH to the text underneath. In the
19999
- // parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
20000
- // in-document, pointer-events does it natively. The button below opts back in, so
20001
- // Replace still works.
20080
+ // Bare media takes the click: the first selects it, the next opens the picker. Text on
20081
+ // top and cueOnly let clicks fall through. Navbar, logo and buttons over a hero image
20082
+ // never reach here: probeImageAt dismisses the overlay before it can cover them.
20002
20083
  pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
20003
20084
  // Selected: a firm component ring with no wash, so the image reads as chosen rather
20004
20085
  // than hovered. Hover keeps the existing tinted preview.
@@ -20026,15 +20107,18 @@ function MediaOverlay({
20026
20107
  },
20027
20108
  children: [
20028
20109
  isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
20029
- isVideo ? "Replace video" : "Replace image"
20110
+ replaceLabel
20030
20111
  ]
20031
20112
  }
20032
20113
  ),
20033
- replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ jsxs8(
20114
+ showChrome && replaceMode !== "none" && /* @__PURE__ */ jsxs8(
20034
20115
  "div",
20035
20116
  {
20036
20117
  className: "flex items-center gap-1.5",
20037
- style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
20118
+ style: {
20119
+ // Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
20120
+ pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
20121
+ },
20038
20122
  onClick: (e) => e.stopPropagation(),
20039
20123
  children: [
20040
20124
  /* @__PURE__ */ jsxs8(
@@ -20043,7 +20127,7 @@ function MediaOverlay({
20043
20127
  "data-ohw-media-overlay": "",
20044
20128
  variant: "outline",
20045
20129
  size: "sm",
20046
- "aria-label": isVideo ? "Replace video" : "Replace image",
20130
+ "aria-label": replaceLabel,
20047
20131
  className: "gap-1.5 cursor-pointer hover:bg-background",
20048
20132
  style: {
20049
20133
  ...OVERLAY_BUTTON_STYLE,
@@ -20064,7 +20148,7 @@ function MediaOverlay({
20064
20148
  },
20065
20149
  children: [
20066
20150
  isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
20067
- replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
20151
+ replaceMode === "full" ? replaceLabel : null
20068
20152
  ]
20069
20153
  }
20070
20154
  ),
@@ -20721,8 +20805,24 @@ function AiSectionOverlay({
20721
20805
  }
20722
20806
 
20723
20807
  // src/ui/ai-section/AiMediaStripOverlay.tsx
20724
- import { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef5, useState as useState8 } from "react";
20725
- import { Star } from "lucide-react";
20808
+ import { useCallback as useCallback3, useEffect as useEffect10, useLayoutEffect as useLayoutEffect4, useRef as useRef5, useState as useState8 } from "react";
20809
+ import {
20810
+ AlignCenter,
20811
+ AlignLeft,
20812
+ AlignRight,
20813
+ ArrowLeft as ArrowLeft2,
20814
+ ArrowRight as ArrowRight2,
20815
+ Check as Check2,
20816
+ ChevronDown as ChevronDown3,
20817
+ Image as ImageIcon2,
20818
+ ImageMinus,
20819
+ ImagePlus,
20820
+ Link as LinkIcon,
20821
+ Minus,
20822
+ Palette,
20823
+ Plus as Plus2,
20824
+ Star
20825
+ } from "lucide-react";
20726
20826
 
20727
20827
  // src/lib/ai-media-strip-tree.ts
20728
20828
  var MEDIA_STRIP_ITEM_MIN = 1;
@@ -20836,14 +20936,6 @@ function setMediaStripItemAsset(tree, index, assetId) {
20836
20936
  return true;
20837
20937
  });
20838
20938
  }
20839
- function setMediaStripItemAlt(tree, index, alt) {
20840
- return withMediaStrip(tree, (block) => {
20841
- const items = block.items;
20842
- if (index < 0 || index >= items.length) return false;
20843
- items[index] = { ...items[index], alt };
20844
- return true;
20845
- });
20846
- }
20847
20939
  function setMediaStripItemLink(tree, index, link) {
20848
20940
  return withMediaStrip(tree, (block) => {
20849
20941
  const items = block.items;
@@ -20861,11 +20953,117 @@ function setMediaStripItemLink(tree, index, link) {
20861
20953
  });
20862
20954
  }
20863
20955
 
20956
+ // src/ui/dialog.tsx
20957
+ import * as React9 from "react";
20958
+ import { Dialog as DialogPrimitive } from "radix-ui";
20959
+ import { X as X2 } from "lucide-react";
20960
+ import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
20961
+ function Dialog2({
20962
+ ...props
20963
+ }) {
20964
+ return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
20965
+ }
20966
+ function DialogPortal({
20967
+ ...props
20968
+ }) {
20969
+ return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
20970
+ }
20971
+ function DialogOverlay({
20972
+ className,
20973
+ ...props
20974
+ }) {
20975
+ return /* @__PURE__ */ jsx20(
20976
+ DialogPrimitive.Overlay,
20977
+ {
20978
+ "data-slot": "dialog-overlay",
20979
+ "data-ohw-link-modal-root": "",
20980
+ className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
20981
+ ...props
20982
+ }
20983
+ );
20984
+ }
20985
+ var DialogContent = React9.forwardRef(
20986
+ ({ className, children, showCloseButton = true, container, ...props }, ref) => {
20987
+ const positionMode = container ? "absolute" : "fixed";
20988
+ return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
20989
+ /* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
20990
+ /* @__PURE__ */ jsxs11(
20991
+ DialogPrimitive.Content,
20992
+ {
20993
+ ref,
20994
+ "data-slot": "dialog-content",
20995
+ className: cn(
20996
+ positionMode,
20997
+ "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",
20998
+ "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
20999
+ container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
21000
+ className
21001
+ ),
21002
+ onMouseDown: (e) => e.stopPropagation(),
21003
+ ...props,
21004
+ children: [
21005
+ children,
21006
+ showCloseButton ? /* @__PURE__ */ jsx20(
21007
+ DialogPrimitive.Close,
21008
+ {
21009
+ type: "button",
21010
+ className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
21011
+ "aria-label": "Close",
21012
+ children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
21013
+ }
21014
+ ) : null
21015
+ ]
21016
+ }
21017
+ )
21018
+ ] });
21019
+ }
21020
+ );
21021
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
21022
+ function DialogHeader({
21023
+ className,
21024
+ ...props
21025
+ }) {
21026
+ return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
21027
+ }
21028
+ function DialogFooter({
21029
+ className,
21030
+ ...props
21031
+ }) {
21032
+ return /* @__PURE__ */ jsx20(
21033
+ "div",
21034
+ {
21035
+ className: cn("flex items-center justify-end gap-2", className),
21036
+ ...props
21037
+ }
21038
+ );
21039
+ }
21040
+ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
21041
+ DialogPrimitive.Title,
21042
+ {
21043
+ ref,
21044
+ className: cn(
21045
+ "text-lg font-semibold leading-none tracking-tight text-card-foreground",
21046
+ className
21047
+ ),
21048
+ ...props
21049
+ }
21050
+ ));
21051
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
21052
+ var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
21053
+ DialogPrimitive.Description,
21054
+ {
21055
+ ref,
21056
+ className: cn("text-sm text-muted-foreground", className),
21057
+ ...props
21058
+ }
21059
+ ));
21060
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
21061
+ var DialogClose = DialogPrimitive.Close;
21062
+
20864
21063
  // src/ui/ai-section/AiMediaStripOverlay.tsx
20865
- import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
20866
- var PRIMARY3 = "#0885FE";
20867
- var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
20868
- var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
21064
+ import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
21065
+ var PRIMARY3 = "var(--ohw-primary, #0885FE)";
21066
+ 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]";
20869
21067
  function findMediaStripItemElement(sectionId, index) {
20870
21068
  const sectionEl2 = findByInstanceId(sectionId);
20871
21069
  if (!sectionEl2) return null;
@@ -20875,14 +21073,35 @@ function findMediaStripItemElement(sectionId, index) {
20875
21073
  }
20876
21074
  return null;
20877
21075
  }
20878
- function readRect2(ref) {
20879
- const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
21076
+ function itemRefFromTarget(target) {
21077
+ if (!(target instanceof Element)) return null;
21078
+ if (target.closest(CHROME_SELECTOR)) return null;
21079
+ const itemEl = target.closest("[data-ohw-media-strip-item]");
21080
+ if (!itemEl) return null;
21081
+ const sectionEl2 = itemEl.closest("[data-ohw-section]");
21082
+ const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
21083
+ const sectionId = unit ? instanceIdOf(unit) || null : null;
21084
+ const index = Number(itemEl.dataset.ohwMediaStripIndex);
21085
+ if (!sectionId || Number.isNaN(index)) return null;
21086
+ return { sectionId, index };
21087
+ }
21088
+ function sameRef(a, b) {
21089
+ return a?.sectionId === b?.sectionId && a?.index === b?.index;
21090
+ }
21091
+ function rectOf(el) {
20880
21092
  if (!el) return null;
20881
21093
  const r2 = el.getBoundingClientRect();
20882
21094
  if (r2.width <= 0 || r2.height <= 0) return null;
20883
21095
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
20884
21096
  }
20885
- function useLiveItemRect(ref) {
21097
+ function readRect2(ref) {
21098
+ return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
21099
+ }
21100
+ function readStripRect(ref) {
21101
+ const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
21102
+ return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
21103
+ }
21104
+ function useLiveItemRect(ref, strip = false) {
20886
21105
  const [rect, setRect] = useState8(null);
20887
21106
  useEffect10(() => {
20888
21107
  if (!ref) {
@@ -20890,7 +21109,7 @@ function useLiveItemRect(ref) {
20890
21109
  return;
20891
21110
  }
20892
21111
  const update = () => {
20893
- const next = readRect2(ref);
21112
+ const next = strip ? readStripRect(ref) : readRect2(ref);
20894
21113
  setRect(
20895
21114
  (prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
20896
21115
  );
@@ -20905,9 +21124,49 @@ function useLiveItemRect(ref) {
20905
21124
  window.removeEventListener("resize", update);
20906
21125
  clearInterval(interval);
20907
21126
  };
20908
- }, [ref?.sectionId, ref?.index]);
21127
+ }, [ref?.sectionId, ref?.index, strip]);
20909
21128
  return rect;
20910
21129
  }
21130
+ var TOOLBAR_STRIP_GAP = 52;
21131
+ var TOOLBAR_STRIP_GAP_MOBILE = 42;
21132
+ var TOOLBAR_EDGE_MARGIN2 = 4;
21133
+ function StripToolbarSlot({ stripRect, children }) {
21134
+ const slotRef = useRef5(null);
21135
+ const [shift, setShift] = useState8(0);
21136
+ const centerX = stripRect.left + stripRect.width / 2;
21137
+ useLayoutEffect4(() => {
21138
+ const slot = slotRef.current;
21139
+ if (!slot) return;
21140
+ const clamp = () => {
21141
+ const w = slot.offsetWidth;
21142
+ if (w <= 0) return;
21143
+ const half = w / 2;
21144
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
21145
+ setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
21146
+ };
21147
+ clamp();
21148
+ const ro = new ResizeObserver(clamp);
21149
+ ro.observe(slot);
21150
+ return () => ro.disconnect();
21151
+ }, [centerX, children]);
21152
+ const mobile = window.innerWidth <= 480;
21153
+ return /* @__PURE__ */ jsx21(
21154
+ "div",
21155
+ {
21156
+ ref: slotRef,
21157
+ "data-ohw-bridge": "",
21158
+ "data-ohw-item-interaction": "",
21159
+ className: "pointer-events-auto fixed",
21160
+ style: {
21161
+ top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
21162
+ left: centerX + shift,
21163
+ transform: "translate(-50%, -100%)",
21164
+ zIndex: 2147483645
21165
+ },
21166
+ children
21167
+ }
21168
+ );
21169
+ }
20911
21170
  function requestValidateTree(postToParent2, tree) {
20912
21171
  return new Promise((resolve) => {
20913
21172
  const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
@@ -20944,116 +21203,72 @@ function requestAssetPick(postToParent2) {
20944
21203
  postToParent2({ type: "ow:asset-pick", id });
20945
21204
  });
20946
21205
  }
20947
- function Pill({
21206
+ function ToolbarAction({
20948
21207
  label,
20949
21208
  onClick,
20950
- disabled,
20951
- active
21209
+ disabled = false,
21210
+ active = false,
21211
+ children
20952
21212
  }) {
20953
- return /* @__PURE__ */ jsx20(
20954
- "button",
20955
- {
20956
- type: "button",
20957
- onClick,
20958
- disabled,
20959
- style: {
20960
- height: 28,
20961
- padding: "0 10px",
20962
- display: "inline-flex",
20963
- alignItems: "center",
20964
- gap: 4,
20965
- borderRadius: 999,
20966
- border: "none",
20967
- cursor: disabled ? "default" : "pointer",
20968
- background: active ? OHW_BLUE_DARK : "#ffffff",
20969
- color: active ? "#ffffff" : OHW_BLUE_DARK,
20970
- opacity: disabled ? 0.4 : 1,
20971
- fontSize: 12,
20972
- lineHeight: "16px",
20973
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
20974
- whiteSpace: "nowrap",
20975
- flex: "0 0 auto"
20976
- },
20977
- children: label
20978
- }
20979
- );
21213
+ const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
21214
+ return /* @__PURE__ */ jsxs12(Tooltip, { children: [
21215
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
21216
+ /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21217
+ ] });
20980
21218
  }
20981
- function AltInput({ value, onCommit }) {
20982
- const [draft, setDraft] = useState8(value);
20983
- useEffect10(() => setDraft(value), [value]);
20984
- return /* @__PURE__ */ jsxs11(
20985
- "div",
20986
- {
20987
- style: {
20988
- display: "flex",
20989
- alignItems: "center",
20990
- gap: 6,
20991
- height: 28,
20992
- padding: "0 12px",
20993
- borderRadius: 999,
20994
- background: "#ffffff",
20995
- width: "100%",
20996
- maxWidth: 260,
20997
- boxSizing: "border-box"
20998
- },
20999
- children: [
21000
- /* @__PURE__ */ jsx20(
21001
- "span",
21002
- {
21003
- style: {
21004
- flex: "0 0 auto",
21005
- color: OHW_BLUE_DARK,
21006
- fontSize: 10,
21007
- fontWeight: 700,
21008
- textTransform: "uppercase",
21009
- letterSpacing: 0.4
21010
- },
21011
- children: "Alt"
21012
- }
21013
- ),
21014
- /* @__PURE__ */ jsx20(
21015
- "input",
21219
+ function ToolbarSeparator() {
21220
+ return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21221
+ }
21222
+ function OptionMenu({
21223
+ label,
21224
+ value,
21225
+ options,
21226
+ onChange
21227
+ }) {
21228
+ const current = options.find((o) => o.value === value) ?? options[0];
21229
+ return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21230
+ /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: label }),
21231
+ /* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
21232
+ /* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
21233
+ "button",
21234
+ {
21235
+ type: "button",
21236
+ "aria-label": label,
21237
+ className: "inline-flex h-8 min-w-[76px] items-center gap-[7px] rounded-[6px] bg-transparent px-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted data-[state=open]:bg-muted",
21238
+ children: [
21239
+ /* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
21240
+ /* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
21241
+ ]
21242
+ }
21243
+ ) }),
21244
+ /* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
21245
+ const selected = option.value === value;
21246
+ return /* @__PURE__ */ jsxs12(
21247
+ DropdownMenuItem,
21016
21248
  {
21017
- type: "text",
21018
- value: draft,
21019
- onChange: (e) => setDraft(e.target.value),
21020
- onBlur: () => {
21021
- if (draft !== value) onCommit(draft);
21022
- },
21023
- onKeyDown: (e) => {
21024
- if (e.key === "Enter") e.currentTarget.blur();
21025
- if (e.key === "Escape") {
21026
- setDraft(value);
21027
- e.currentTarget.blur();
21028
- }
21029
- },
21030
- placeholder: "Describe this image",
21031
- "aria-label": "Image alt text",
21032
- style: {
21033
- flex: 1,
21034
- minWidth: 0,
21035
- border: "none",
21036
- outline: "none",
21037
- background: "transparent",
21038
- fontSize: 12,
21039
- lineHeight: "16px",
21040
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21041
- color: "#1f2937"
21042
- }
21043
- }
21044
- )
21045
- ]
21046
- }
21047
- );
21249
+ role: "menuitemradio",
21250
+ "aria-checked": selected,
21251
+ onSelect: () => onChange(option.value),
21252
+ className: cn("grid grid-cols-[1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
21253
+ children: [
21254
+ /* @__PURE__ */ jsx21("span", { children: option.label }),
21255
+ selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
21256
+ ]
21257
+ },
21258
+ option.value
21259
+ );
21260
+ }) })
21261
+ ] })
21262
+ ] });
21048
21263
  }
21049
21264
  var VARIANTS = [
21050
21265
  { value: "logos", label: "Logos" },
21051
21266
  { value: "reel", label: "Reel" }
21052
21267
  ];
21053
21268
  var ALIGNS = [
21054
- { value: "left", label: "Left" },
21055
- { value: "center", label: "Center" },
21056
- { value: "right", label: "Right" }
21269
+ { value: "left", label: "Align left", Icon: AlignLeft },
21270
+ { value: "center", label: "Align center", Icon: AlignCenter },
21271
+ { value: "right", label: "Align right", Icon: AlignRight }
21057
21272
  ];
21058
21273
  var HOVERS = [
21059
21274
  { value: "none", label: "None" },
@@ -21061,104 +21276,104 @@ var HOVERS = [
21061
21276
  { value: "zoom", label: "Zoom" },
21062
21277
  { value: "fade", label: "Fade" }
21063
21278
  ];
21064
- var TREATMENTS = [
21065
- { value: "color", label: "Color" },
21066
- { value: "grayscale", label: "Grayscale" }
21067
- ];
21068
21279
  var HTTP_URL_RE = /^https?:\/\/\S+$/i;
21069
- function LinkInput({ value, onCommit }) {
21070
- const [draft, setDraft] = useState8(value);
21280
+ function LinkModal({
21281
+ href,
21282
+ linkTarget,
21283
+ onClose,
21284
+ onSave
21285
+ }) {
21286
+ const [draft, setDraft] = useState8(href);
21287
+ const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
21071
21288
  const [invalid, setInvalid] = useState8(false);
21072
- useEffect10(() => {
21073
- setDraft(value);
21074
- setInvalid(false);
21075
- }, [value]);
21076
- const commit2 = () => {
21289
+ const save = () => {
21077
21290
  const next = draft.trim();
21078
- if (next === value) return setInvalid(false);
21079
- if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
21080
- setInvalid(false);
21081
- onCommit(next);
21082
- };
21083
- return /* @__PURE__ */ jsxs11(
21084
- "div",
21085
- {
21086
- style: {
21087
- display: "flex",
21088
- alignItems: "center",
21089
- gap: 6,
21090
- height: 28,
21091
- padding: "0 12px",
21092
- borderRadius: 999,
21093
- background: "#ffffff",
21094
- width: "100%",
21095
- maxWidth: 260,
21096
- boxSizing: "border-box",
21097
- boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
21098
- },
21099
- children: [
21100
- /* @__PURE__ */ jsx20(
21101
- "span",
21102
- {
21103
- style: {
21104
- flex: "0 0 auto",
21105
- color: OHW_BLUE_DARK,
21106
- fontSize: 10,
21107
- fontWeight: 700,
21108
- textTransform: "uppercase",
21109
- letterSpacing: 0.4
21110
- },
21111
- children: "Link"
21112
- }
21113
- ),
21114
- /* @__PURE__ */ jsx20(
21115
- "input",
21116
- {
21117
- type: "text",
21118
- inputMode: "url",
21119
- value: draft,
21120
- onChange: (e) => setDraft(e.target.value),
21121
- onBlur: commit2,
21122
- onKeyDown: (e) => {
21123
- if (e.key === "Enter") e.currentTarget.blur();
21124
- if (e.key === "Escape") {
21125
- setDraft(value);
21126
- setInvalid(false);
21127
- e.currentTarget.blur();
21128
- }
21129
- },
21130
- placeholder: "https://example.com",
21131
- "aria-label": "Image link URL",
21132
- "aria-invalid": invalid,
21133
- style: {
21134
- flex: 1,
21135
- minWidth: 0,
21136
- border: "none",
21137
- outline: "none",
21138
- background: "transparent",
21139
- fontSize: 12,
21140
- lineHeight: "16px",
21141
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21142
- color: "#1f2937"
21143
- }
21144
- }
21145
- )
21146
- ]
21291
+ if (next && !HTTP_URL_RE.test(next)) {
21292
+ setInvalid(true);
21293
+ return;
21147
21294
  }
21148
- );
21295
+ onSave(next, newTab ? "new-tab" : "same-tab");
21296
+ onClose();
21297
+ };
21298
+ return /* @__PURE__ */ jsx21(Dialog2, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs12(DialogContent, { "data-ohw-link-modal-root": "", className: "max-w-[400px] gap-4 p-5", children: [
21299
+ /* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { className: "text-base", children: "Image link" }) }),
21300
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-3", children: [
21301
+ /* @__PURE__ */ jsx21(
21302
+ "input",
21303
+ {
21304
+ autoFocus: true,
21305
+ type: "text",
21306
+ inputMode: "url",
21307
+ value: draft,
21308
+ onChange: (e) => {
21309
+ setDraft(e.target.value);
21310
+ setInvalid(false);
21311
+ },
21312
+ onKeyDown: (e) => {
21313
+ if (e.key === "Enter") save();
21314
+ },
21315
+ placeholder: "https://example.com",
21316
+ "aria-label": "Image link URL",
21317
+ "aria-invalid": invalid,
21318
+ className: cn(
21319
+ "h-9 w-full rounded-[6px] border border-border bg-background px-3 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-bridge-primary",
21320
+ invalid && "border-destructive focus:border-destructive"
21321
+ )
21322
+ }
21323
+ ),
21324
+ invalid && /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: "Enter a full URL starting with http:// or https://" }),
21325
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-2 text-[13px] text-foreground", children: [
21326
+ /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: newTab, onChange: (e) => setNewTab(e.target.checked) }),
21327
+ "Open in new tab"
21328
+ ] })
21329
+ ] }),
21330
+ /* @__PURE__ */ jsxs12(DialogFooter, { children: [
21331
+ href && /* @__PURE__ */ jsx21(
21332
+ "button",
21333
+ {
21334
+ type: "button",
21335
+ onClick: () => {
21336
+ onSave("", "new-tab");
21337
+ onClose();
21338
+ },
21339
+ className: "mr-auto rounded-[6px] px-3 py-2 text-[13px] font-medium text-destructive transition-colors hover:bg-muted",
21340
+ children: "Remove link"
21341
+ }
21342
+ ),
21343
+ /* @__PURE__ */ jsx21(
21344
+ "button",
21345
+ {
21346
+ type: "button",
21347
+ onClick: onClose,
21348
+ className: "rounded-[6px] px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted",
21349
+ children: "Cancel"
21350
+ }
21351
+ ),
21352
+ /* @__PURE__ */ jsx21(
21353
+ "button",
21354
+ {
21355
+ type: "button",
21356
+ onClick: save,
21357
+ className: "rounded-[6px] bg-bridge-primary px-3 py-2 text-[13px] font-medium text-primary-foreground transition-opacity hover:opacity-90",
21358
+ children: "Save"
21359
+ }
21360
+ )
21361
+ ] })
21362
+ ] }) });
21149
21363
  }
21150
21364
  function MediaStripToolbar({
21151
21365
  entry,
21152
21366
  index,
21153
21367
  pending,
21154
21368
  error,
21369
+ itemEditOn,
21370
+ onToggleItemEdit,
21155
21371
  onSetVariant,
21156
21372
  onSetAlign,
21157
21373
  onSetHover,
21158
21374
  onSetTreatment,
21159
21375
  onResize,
21160
- onSetAlt,
21161
- onSetLink,
21376
+ onOpenLink,
21162
21377
  onAddItem,
21163
21378
  onRemoveItem,
21164
21379
  onChangeImage,
@@ -21167,81 +21382,102 @@ function MediaStripToolbar({
21167
21382
  }) {
21168
21383
  const items = mediaStripItems(entry.tree);
21169
21384
  const itemCount = items.length;
21170
- const currentAlt = items[index]?.alt ?? "";
21171
- const currentHref2 = items[index]?.href ?? "";
21172
- const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
21173
21385
  const slots = findMediaStripSlots(entry.tree);
21174
21386
  const variant = slots?.variant === "reel" ? "reel" : "logos";
21175
21387
  const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
21176
21388
  const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
21177
21389
  const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
21178
21390
  const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21179
- const isMobile = window.innerWidth <= 480;
21180
- const rowStyle = isMobile ? {
21181
- display: "flex",
21182
- gap: 6,
21183
- flexWrap: "nowrap",
21184
- justifyContent: "center",
21185
- overflowX: "auto",
21186
- WebkitOverflowScrolling: "touch",
21187
- width: "100%",
21188
- scrollbarWidth: "none"
21189
- } : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
21190
- return /* @__PURE__ */ jsxs11(
21391
+ const mobile = window.innerWidth <= 480;
21392
+ const gatedLabel = (label) => itemEditOn ? label : "Turn on the star to edit this image";
21393
+ return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
21191
21394
  "div",
21192
21395
  {
21193
21396
  "data-ohw-bridge": "",
21194
21397
  "data-ohw-toolbar": "",
21195
21398
  onMouseDown: (e) => e.stopPropagation(),
21196
- style: {
21197
- display: "flex",
21198
- flexDirection: "column",
21199
- gap: 6,
21200
- alignItems: "center",
21201
- background: OHW_BLUE,
21202
- padding: 8,
21203
- borderRadius: 12,
21204
- boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
21205
- pointerEvents: pending ? "none" : "auto",
21206
- opacity: pending ? 0.6 : 1,
21207
- maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
21208
- },
21399
+ className: cn("flex flex-col items-center gap-1.5 font-sans", pending && "pointer-events-none opacity-60"),
21400
+ style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
21209
21401
  children: [
21210
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21211
- VARIANTS.map((v) => /* @__PURE__ */ jsx20(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
21212
- ALIGNS.map((a) => /* @__PURE__ */ jsx20(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
21213
- ] }),
21214
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21215
- HOVERS.map((h) => /* @__PURE__ */ jsx20(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
21216
- TREATMENTS.map((t) => /* @__PURE__ */ jsx20(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
21217
- ] }),
21218
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
21219
- /* @__PURE__ */ jsx20(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
21220
- /* @__PURE__ */ jsxs11("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
21221
- sizeValue,
21222
- "px"
21223
- ] }),
21224
- /* @__PURE__ */ jsx20(Pill, { label: "+", onClick: () => onResize(8) })
21225
- ] }),
21226
- /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
21227
- /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
21228
- currentHref2 && /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21229
- /* @__PURE__ */ jsx20(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
21230
- /* @__PURE__ */ jsx20(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
21231
- ] }),
21232
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21233
- /* @__PURE__ */ jsx20(Pill, { label: "Change Image", onClick: onChangeImage }),
21234
- /* @__PURE__ */ jsx20(Pill, { label: "+ Item", onClick: onAddItem }),
21235
- /* @__PURE__ */ jsx20(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
21236
- ] }),
21237
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21238
- /* @__PURE__ */ jsx20(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
21239
- /* @__PURE__ */ jsx20(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
21240
- ] }),
21241
- error && /* @__PURE__ */ jsx20("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21402
+ /* @__PURE__ */ jsxs12(
21403
+ "div",
21404
+ {
21405
+ className: cn(
21406
+ "flex items-center gap-1 rounded-[10px] border border-border bg-background p-1 whitespace-nowrap",
21407
+ "shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.1),0px_4px_6px_-4px_rgba(0,0,0,0.1)]",
21408
+ mobile ? "flex-wrap justify-center" : "flex-nowrap"
21409
+ ),
21410
+ children: [
21411
+ /* @__PURE__ */ jsxs12(Tooltip, { children: [
21412
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
21413
+ CustomToolbarButton,
21414
+ {
21415
+ type: "button",
21416
+ "aria-label": itemEditOn ? "Done editing this image" : "Edit this image",
21417
+ "aria-pressed": itemEditOn,
21418
+ onClick: onToggleItemEdit,
21419
+ className: "group size-8",
21420
+ children: /* @__PURE__ */ jsx21(
21421
+ Star,
21422
+ {
21423
+ size: 16,
21424
+ fill: "currentColor",
21425
+ strokeWidth: 0,
21426
+ className: cn(
21427
+ "transition-colors",
21428
+ itemEditOn ? "text-[#f59e0b] group-hover:text-[#d97706]" : "text-[#d6d3d1] group-hover:text-[#fbbf24]"
21429
+ ),
21430
+ style: { pointerEvents: "none" }
21431
+ }
21432
+ )
21433
+ }
21434
+ ) }),
21435
+ /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
21436
+ ] }),
21437
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21438
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
21439
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
21440
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
21441
+ /* @__PURE__ */ jsx21(
21442
+ ToolbarAction,
21443
+ {
21444
+ label: gatedLabel("Move right"),
21445
+ onClick: onMoveRight,
21446
+ disabled: !itemEditOn || index >= itemCount - 1,
21447
+ children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
21448
+ }
21449
+ ),
21450
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
21451
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21452
+ /* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
21453
+ /* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
21454
+ /* @__PURE__ */ jsx21(
21455
+ ToolbarAction,
21456
+ {
21457
+ label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
21458
+ active: treatment === "grayscale",
21459
+ onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
21460
+ children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
21461
+ }
21462
+ ),
21463
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21464
+ 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)),
21465
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21466
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
21467
+ /* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
21468
+ sizeValue,
21469
+ "px"
21470
+ ] }),
21471
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
21472
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21473
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
21474
+ ]
21475
+ }
21476
+ ),
21477
+ 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 })
21242
21478
  ]
21243
21479
  }
21244
- );
21480
+ ) });
21245
21481
  }
21246
21482
  function findMediaStripSlots(tree) {
21247
21483
  const stack = tree.rows.flatMap((row) => row.blocks);
@@ -21260,31 +21496,23 @@ function AiMediaStripOverlay({
21260
21496
  }) {
21261
21497
  const [hover, setHover] = useState8(null);
21262
21498
  const [active, setActive] = useState8(null);
21499
+ const [itemEditOn, setItemEditOn] = useState8(false);
21500
+ const [linkOpen, setLinkOpen] = useState8(false);
21263
21501
  const [pending, setPending] = useState8(false);
21264
21502
  const [error, setError] = useState8(null);
21265
21503
  const activeRef = useRef5(null);
21266
21504
  activeRef.current = active;
21505
+ const linkOpenRef = useRef5(false);
21506
+ linkOpenRef.current = linkOpen;
21267
21507
  useEffect10(() => {
21268
21508
  const onMove = (e) => {
21509
+ const ref = itemRefFromTarget(e.target);
21269
21510
  const t = e.target;
21270
- if (!(t instanceof HTMLElement)) return;
21271
- 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]")) {
21272
- return;
21273
- }
21274
- const itemEl = t.closest("[data-ohw-media-strip-item]");
21275
- if (!itemEl) {
21276
- setHover(null);
21277
- return;
21278
- }
21279
- const sectionEl2 = itemEl.closest("[data-ohw-section]");
21280
- const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
21281
- const sectionId = unit ? instanceIdOf(unit) || null : null;
21282
- const index = Number(itemEl.dataset.ohwMediaStripIndex);
21283
- if (!sectionId || Number.isNaN(index)) {
21284
- setHover(null);
21285
- return;
21286
- }
21287
- setHover({ sectionId, index });
21511
+ const overEditable = Boolean(t?.closest?.("[data-ohw-editable]"));
21512
+ setHover((prev) => {
21513
+ const next = ref && !overEditable ? ref : null;
21514
+ return sameRef(prev, next) ? prev : next;
21515
+ });
21288
21516
  };
21289
21517
  const onLeave = () => setHover(null);
21290
21518
  document.addEventListener("mousemove", onMove, { passive: true });
@@ -21296,23 +21524,25 @@ function AiMediaStripOverlay({
21296
21524
  }, []);
21297
21525
  useEffect10(() => {
21298
21526
  const onClick = (e) => {
21299
- const current = activeRef.current;
21300
- if (!current) return;
21301
21527
  const t = e.target;
21302
- if (!(t instanceof HTMLElement)) return;
21303
- if (t.closest("[data-ohw-item-interaction]")) return;
21304
- const itemEl = findMediaStripItemElement(current.sectionId, current.index);
21305
- if (itemEl && itemEl.contains(t)) return;
21306
- setActive(null);
21528
+ if (!(t instanceof Element)) return;
21529
+ if (t.closest(CHROME_SELECTOR)) return;
21530
+ const ref = itemRefFromTarget(t);
21531
+ if (sameRef(activeRef.current, ref)) return;
21532
+ if (ref) clearInteractionChromeRef.current();
21533
+ setItemEditOn(false);
21307
21534
  setError(null);
21535
+ setActive(ref);
21308
21536
  };
21309
21537
  document.addEventListener("click", onClick, true);
21310
21538
  return () => document.removeEventListener("click", onClick, true);
21311
- }, []);
21539
+ }, [clearInteractionChromeRef]);
21312
21540
  useEffect10(() => {
21313
21541
  const onBlur = () => {
21314
21542
  if (!activeRef.current) return;
21315
21543
  setActive(null);
21544
+ setItemEditOn(false);
21545
+ setLinkOpen(false);
21316
21546
  setError(null);
21317
21547
  };
21318
21548
  window.addEventListener("blur", onBlur);
@@ -21322,7 +21552,10 @@ function AiMediaStripOverlay({
21322
21552
  const onKeyDown = (e) => {
21323
21553
  if (e.key !== "Escape") return;
21324
21554
  if (!activeRef.current) return;
21555
+ if (linkOpenRef.current) return;
21556
+ if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
21325
21557
  setActive(null);
21558
+ setItemEditOn(false);
21326
21559
  setError(null);
21327
21560
  };
21328
21561
  document.addEventListener("keydown", onKeyDown);
@@ -21356,137 +21589,133 @@ function AiMediaStripOverlay({
21356
21589
  tree: nextTree,
21357
21590
  label: entry.label,
21358
21591
  media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
21359
- ...entry.brand ? { brand: entry.brand } : {}
21592
+ ...entry.brand ? { brand: entry.brand } : {},
21593
+ // The user is already looking at the strip they just edited — recentering the viewport
21594
+ // on every edit reads as the section jumping around.
21595
+ skipScrollIntoView: true
21360
21596
  });
21361
21597
  return true;
21362
21598
  },
21363
21599
  [findEntry, postToParent2, applyTreeLocalRef]
21364
21600
  );
21365
21601
  const activeEntry = active ? findEntry(active.sectionId) : null;
21366
- const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
21367
21602
  const activeItemRect = useLiveItemRect(active);
21368
- const TOOLBAR_APPROX_H = 170;
21369
- const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
21370
- return /* @__PURE__ */ jsxs11(Fragment7, { children: [
21371
- hoverHandleRect && hover && /* @__PURE__ */ jsx20(
21372
- "button",
21373
- {
21374
- type: "button",
21375
- "data-ohw-toolbar": "",
21376
- onClick: () => {
21377
- clearInteractionChromeRef.current();
21378
- setActive(hover);
21379
- },
21380
- "aria-label": "Configure media item",
21381
- style: {
21382
- position: "fixed",
21383
- top: hoverHandleRect.top + 8,
21384
- left: hoverHandleRect.left + hoverHandleRect.width - 36,
21385
- width: 28,
21386
- height: 28,
21387
- borderRadius: 8,
21388
- border: `1.5px dashed ${PRIMARY3}`,
21389
- background: "#ffffff",
21390
- color: PRIMARY3,
21391
- display: "flex",
21392
- alignItems: "center",
21393
- justifyContent: "center",
21394
- cursor: "pointer",
21395
- zIndex: 2147483643,
21396
- fontSize: 14,
21397
- fontWeight: 700
21398
- },
21399
- children: /* @__PURE__ */ jsx20(Star, { size: 14, style: { pointerEvents: "none" } })
21400
- }
21401
- ),
21402
- activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
21403
- ItemInteractionLayer,
21404
- {
21405
- rect: activeItemRect,
21406
- state: toolbarState,
21407
- toolbar: /* @__PURE__ */ jsx20(
21408
- MediaStripToolbar,
21409
- {
21410
- entry: activeEntry,
21411
- index: active.index,
21412
- pending,
21413
- error,
21414
- onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
21415
- onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
21416
- onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
21417
- onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
21418
- onResize: (delta) => {
21419
- const slots = findMediaStripSlots(activeEntry.tree);
21420
- const variant = slots?.variant === "reel" ? "reel" : "logos";
21421
- const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21422
- void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
21423
- },
21424
- onSetAlt: (alt) => {
21425
- void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
21426
- },
21427
- onSetLink: (href, linkTarget) => {
21603
+ const activeStripRect = useLiveItemRect(active, true);
21604
+ const hoverRect = useLiveItemRect(hover && !sameRef(hover, active) ? hover : null);
21605
+ const activeItems = activeEntry ? mediaStripItems(activeEntry.tree) : [];
21606
+ const activeItem = active ? activeItems[active.index] : void 0;
21607
+ const activeHref = activeItem?.href ?? "";
21608
+ const activeTarget = activeItem?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
21609
+ return /* @__PURE__ */ jsxs12(Fragment7, { children: [
21610
+ hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
21611
+ activeItemRect && activeStripRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment7, { children: [
21612
+ /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeItemRect, state: "active-top" }),
21613
+ /* @__PURE__ */ jsx21(StripToolbarSlot, { stripRect: activeStripRect, children: /* @__PURE__ */ jsx21(
21614
+ MediaStripToolbar,
21615
+ {
21616
+ entry: activeEntry,
21617
+ index: active.index,
21618
+ pending,
21619
+ error,
21620
+ itemEditOn,
21621
+ onToggleItemEdit: () => setItemEditOn((on) => !on),
21622
+ onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
21623
+ onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
21624
+ onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
21625
+ onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
21626
+ onResize: (delta) => {
21627
+ const slots = findMediaStripSlots(activeEntry.tree);
21628
+ const variant = slots?.variant === "reel" ? "reel" : "logos";
21629
+ const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21630
+ void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
21631
+ },
21632
+ onOpenLink: () => setLinkOpen(true),
21633
+ onAddItem: () => {
21634
+ void requestAssetPick(postToParent2).then((picked) => {
21635
+ if (!picked) return;
21636
+ const item = { assetId: picked.assetId, alt: "Logo" };
21428
21637
  void runMutation(
21429
21638
  active.sectionId,
21430
- (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
21431
- );
21432
- },
21433
- onAddItem: () => {
21434
- void requestAssetPick(postToParent2).then((picked) => {
21435
- if (!picked) return;
21436
- const item = { assetId: picked.assetId, alt: "Logo" };
21437
- void runMutation(
21438
- active.sectionId,
21439
- (tree) => addMediaStripItem(tree, item, active.index),
21440
- { [picked.assetId]: picked.url }
21441
- ).then((applied) => {
21442
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21443
- });
21444
- });
21445
- },
21446
- onChangeImage: () => {
21447
- void requestAssetPick(postToParent2).then((picked) => {
21448
- if (!picked) return;
21449
- void runMutation(
21450
- active.sectionId,
21451
- (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
21452
- { [picked.assetId]: picked.url }
21453
- );
21639
+ (tree) => addMediaStripItem(tree, item, active.index),
21640
+ { [picked.assetId]: picked.url }
21641
+ ).then((applied) => {
21642
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21454
21643
  });
21455
- },
21456
- onRemoveItem: () => {
21457
- void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
21458
- (applied) => {
21459
- if (applied) setActive(null);
21460
- }
21461
- );
21462
- },
21463
- onMoveLeft: () => {
21464
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
21465
- (applied) => {
21466
- if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
21467
- }
21468
- );
21469
- },
21470
- onMoveRight: () => {
21471
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
21472
- (applied) => {
21473
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21474
- }
21644
+ });
21645
+ },
21646
+ onChangeImage: () => {
21647
+ void requestAssetPick(postToParent2).then((picked) => {
21648
+ if (!picked) return;
21649
+ void runMutation(
21650
+ active.sectionId,
21651
+ (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
21652
+ { [picked.assetId]: picked.url }
21475
21653
  );
21476
- }
21654
+ });
21655
+ },
21656
+ onRemoveItem: () => {
21657
+ void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
21658
+ (applied) => {
21659
+ if (applied) setActive(null);
21660
+ }
21661
+ );
21662
+ },
21663
+ onMoveLeft: () => {
21664
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
21665
+ (applied) => {
21666
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
21667
+ }
21668
+ );
21669
+ },
21670
+ onMoveRight: () => {
21671
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
21672
+ (applied) => {
21673
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21674
+ }
21675
+ );
21477
21676
  }
21478
- )
21479
- }
21480
- )
21677
+ }
21678
+ ) }),
21679
+ /* @__PURE__ */ jsx21(
21680
+ "div",
21681
+ {
21682
+ "data-ohw-bridge": "",
21683
+ "data-ohw-item-interaction": "",
21684
+ "aria-hidden": true,
21685
+ className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
21686
+ style: {
21687
+ top: activeItemRect.top + activeItemRect.height + 10,
21688
+ left: activeItemRect.left - 5,
21689
+ background: PRIMARY3,
21690
+ zIndex: 2147483644
21691
+ },
21692
+ children: "Media item"
21693
+ }
21694
+ ),
21695
+ linkOpen && /* @__PURE__ */ jsx21(
21696
+ LinkModal,
21697
+ {
21698
+ href: activeHref,
21699
+ linkTarget: activeTarget,
21700
+ onClose: () => setLinkOpen(false),
21701
+ onSave: (href, linkTarget) => {
21702
+ void runMutation(
21703
+ active.sectionId,
21704
+ (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
21705
+ );
21706
+ }
21707
+ }
21708
+ )
21709
+ ] })
21481
21710
  ] });
21482
21711
  }
21483
21712
 
21484
21713
  // src/ui/ai-section/AiPricingCardOverlay.tsx
21485
- import { useCallback as useCallback4, useEffect as useEffect11, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState9 } from "react";
21486
- import { Check as Check2, ChevronDown as ChevronDown3, Minus, Plus as Plus2, Star as Star2 } from "lucide-react";
21487
- import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
21714
+ import { useCallback as useCallback4, useEffect as useEffect11, useLayoutEffect as useLayoutEffect5, useRef as useRef6, useState as useState9 } from "react";
21715
+ import { Check as Check3, ChevronDown as ChevronDown4, Minus as Minus2, Plus as Plus3, Star as Star2 } from "lucide-react";
21716
+ import { Fragment as Fragment8, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
21488
21717
  var PRIMARY4 = "var(--ohw-primary, #0885FE)";
21489
- 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]";
21718
+ var CHROME_SELECTOR2 = "[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review], [data-ohw-more-menu]";
21490
21719
  function findPricingCardElement(sectionId, index) {
21491
21720
  const sectionEl2 = findByInstanceId(sectionId);
21492
21721
  if (!sectionEl2) return null;
@@ -21498,7 +21727,7 @@ function findPricingCardElement(sectionId, index) {
21498
21727
  }
21499
21728
  function cardRefFromTarget(target) {
21500
21729
  if (!(target instanceof Element)) return null;
21501
- if (target.closest(CHROME_SELECTOR)) return null;
21730
+ if (target.closest(CHROME_SELECTOR2)) return null;
21502
21731
  const cardEl = target.closest("[data-ohw-pricing-card]");
21503
21732
  if (!cardEl) return null;
21504
21733
  const sectionEl2 = cardEl.closest("[data-ohw-section]");
@@ -21508,21 +21737,21 @@ function cardRefFromTarget(target) {
21508
21737
  if (!sectionId || Number.isNaN(index)) return null;
21509
21738
  return { sectionId, index };
21510
21739
  }
21511
- function sameRef(a, b) {
21740
+ function sameRef2(a, b) {
21512
21741
  return a?.sectionId === b?.sectionId && a?.index === b?.index;
21513
21742
  }
21514
- function rectOf(el) {
21743
+ function rectOf2(el) {
21515
21744
  if (!el) return null;
21516
21745
  const r2 = el.getBoundingClientRect();
21517
21746
  if (r2.width <= 0 || r2.height <= 0) return null;
21518
21747
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
21519
21748
  }
21520
21749
  function readRect3(ref) {
21521
- return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
21750
+ return rectOf2(ref && findPricingCardElement(ref.sectionId, ref.index));
21522
21751
  }
21523
21752
  function readGridRect(ref) {
21524
21753
  const card = ref && findPricingCardElement(ref.sectionId, ref.index);
21525
- return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
21754
+ return rectOf2(card?.closest("[data-ohw-pricing-collection]") ?? card);
21526
21755
  }
21527
21756
  function useLiveCardRect(ref, grid = false) {
21528
21757
  const [rect, setRect] = useState9(null);
@@ -21552,19 +21781,19 @@ function useLiveCardRect(ref, grid = false) {
21552
21781
  }
21553
21782
  var TOOLBAR_GRID_GAP = 52;
21554
21783
  var TOOLBAR_GRID_GAP_MOBILE = 42;
21555
- var TOOLBAR_EDGE_MARGIN2 = 4;
21784
+ var TOOLBAR_EDGE_MARGIN3 = 4;
21556
21785
  function GridToolbarSlot({ gridRect, children }) {
21557
21786
  const slotRef = useRef6(null);
21558
21787
  const [shift, setShift] = useState9(0);
21559
21788
  const centerX = gridRect.left + gridRect.width / 2;
21560
- useLayoutEffect4(() => {
21789
+ useLayoutEffect5(() => {
21561
21790
  const slot = slotRef.current;
21562
21791
  if (!slot) return;
21563
21792
  const clamp = () => {
21564
21793
  const w = slot.offsetWidth;
21565
21794
  if (w <= 0) return;
21566
21795
  const half = w / 2;
21567
- const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
21796
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN3 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half));
21568
21797
  setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
21569
21798
  };
21570
21799
  clamp();
@@ -21573,7 +21802,7 @@ function GridToolbarSlot({ gridRect, children }) {
21573
21802
  return () => ro.disconnect();
21574
21803
  }, [centerX, children]);
21575
21804
  const mobile = window.innerWidth <= 480;
21576
- return /* @__PURE__ */ jsx21(
21805
+ return /* @__PURE__ */ jsx22(
21577
21806
  "div",
21578
21807
  {
21579
21808
  ref: slotRef,
@@ -21608,7 +21837,7 @@ function requestValidateTree2(postToParent2, tree) {
21608
21837
  });
21609
21838
  }
21610
21839
  function StyleSwatch({ style }) {
21611
- return /* @__PURE__ */ jsx21(
21840
+ return /* @__PURE__ */ jsx22(
21612
21841
  "span",
21613
21842
  {
21614
21843
  "aria-hidden": true,
@@ -21622,35 +21851,35 @@ function StyleSwatch({ style }) {
21622
21851
  );
21623
21852
  }
21624
21853
  function ButtonGlyph() {
21625
- return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21626
- /* @__PURE__ */ jsx21("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
21627
- /* @__PURE__ */ jsx21("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
21854
+ return /* @__PURE__ */ jsxs13("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21855
+ /* @__PURE__ */ jsx22("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
21856
+ /* @__PURE__ */ jsx22("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
21628
21857
  ] });
21629
21858
  }
21630
21859
  function FeatureGlyph({ mode }) {
21631
- return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21632
- /* @__PURE__ */ jsx21("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
21633
- /* @__PURE__ */ jsx21("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
21634
- /* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
21635
- /* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
21636
- /* @__PURE__ */ jsx21("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
21637
- mode === "add" && /* @__PURE__ */ jsx21("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
21860
+ return /* @__PURE__ */ jsxs13("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21861
+ /* @__PURE__ */ jsx22("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
21862
+ /* @__PURE__ */ jsx22("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
21863
+ /* @__PURE__ */ jsx22("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
21864
+ /* @__PURE__ */ jsx22("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
21865
+ /* @__PURE__ */ jsx22("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
21866
+ mode === "add" && /* @__PURE__ */ jsx22("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
21638
21867
  ] });
21639
21868
  }
21640
- function ToolbarAction({
21869
+ function ToolbarAction2({
21641
21870
  label,
21642
21871
  onClick,
21643
21872
  disabled = false,
21644
21873
  children
21645
21874
  }) {
21646
- const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
21647
- return /* @__PURE__ */ jsxs12(Tooltip, { children: [
21648
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
21649
- /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21875
+ const button = /* @__PURE__ */ jsx22(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
21876
+ return /* @__PURE__ */ jsxs13(Tooltip, { children: [
21877
+ /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx22("span", { className: "inline-flex", children: button }) : button }),
21878
+ /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21650
21879
  ] });
21651
21880
  }
21652
- function ToolbarSeparator() {
21653
- return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21881
+ function ToolbarSeparator2() {
21882
+ return /* @__PURE__ */ jsx22("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21654
21883
  }
21655
21884
  function CardStyleMenu({
21656
21885
  value,
@@ -21658,7 +21887,7 @@ function CardStyleMenu({
21658
21887
  disabled = false
21659
21888
  }) {
21660
21889
  const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
21661
- const trigger = /* @__PURE__ */ jsxs12(
21890
+ const trigger = /* @__PURE__ */ jsxs13(
21662
21891
  "button",
21663
21892
  {
21664
21893
  type: "button",
@@ -21669,28 +21898,28 @@ function CardStyleMenu({
21669
21898
  disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
21670
21899
  ),
21671
21900
  children: [
21672
- /* @__PURE__ */ jsx21(StyleSwatch, { style: current.value }),
21673
- /* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
21674
- /* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
21901
+ /* @__PURE__ */ jsx22(StyleSwatch, { style: current.value }),
21902
+ /* @__PURE__ */ jsx22("span", { className: "flex-1 text-left", children: current.label }),
21903
+ /* @__PURE__ */ jsx22(ChevronDown4, { size: 16, style: { pointerEvents: "none" } })
21675
21904
  ]
21676
21905
  }
21677
21906
  );
21678
21907
  if (disabled) {
21679
- return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21680
- /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
21681
- /* @__PURE__ */ jsxs12(Tooltip, { children: [
21682
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: trigger }) }),
21683
- /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
21908
+ return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21909
+ /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
21910
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
21911
+ /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22("span", { className: "inline-flex", children: trigger }) }),
21912
+ /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
21684
21913
  ] })
21685
21914
  ] });
21686
21915
  }
21687
- return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21688
- /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
21689
- /* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
21690
- /* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
21691
- /* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
21916
+ return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21917
+ /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
21918
+ /* @__PURE__ */ jsxs13(DropdownMenu, { modal: false, children: [
21919
+ /* @__PURE__ */ jsx22(DropdownMenuTrigger, { asChild: true, children: trigger }),
21920
+ /* @__PURE__ */ jsx22(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
21692
21921
  const selected = style.value === value;
21693
- return /* @__PURE__ */ jsxs12(
21922
+ return /* @__PURE__ */ jsxs13(
21694
21923
  DropdownMenuItem,
21695
21924
  {
21696
21925
  role: "menuitemradio",
@@ -21698,9 +21927,9 @@ function CardStyleMenu({
21698
21927
  onSelect: () => onChange(style.value),
21699
21928
  className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
21700
21929
  children: [
21701
- /* @__PURE__ */ jsx21(StyleSwatch, { style: style.value }),
21702
- /* @__PURE__ */ jsx21("span", { children: style.label }),
21703
- selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
21930
+ /* @__PURE__ */ jsx22(StyleSwatch, { style: style.value }),
21931
+ /* @__PURE__ */ jsx22("span", { children: style.label }),
21932
+ selected && /* @__PURE__ */ jsx22(Check3, { size: 16, className: "text-bridge-primary" })
21704
21933
  ]
21705
21934
  },
21706
21935
  style.value
@@ -21730,7 +21959,7 @@ function PricingCardToolbar({
21730
21959
  const style = pricingCardStyle(entry.tree, index);
21731
21960
  const featuredTag = pricingCardFeaturedTag(entry.tree, index);
21732
21961
  const mobile = window.innerWidth <= 480;
21733
- return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
21962
+ return /* @__PURE__ */ jsx22(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs13(
21734
21963
  "div",
21735
21964
  {
21736
21965
  "data-ohw-bridge": "",
@@ -21742,7 +21971,7 @@ function PricingCardToolbar({
21742
21971
  ),
21743
21972
  style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
21744
21973
  children: [
21745
- /* @__PURE__ */ jsxs12(
21974
+ /* @__PURE__ */ jsxs13(
21746
21975
  "div",
21747
21976
  {
21748
21977
  className: cn(
@@ -21751,8 +21980,8 @@ function PricingCardToolbar({
21751
21980
  mobile ? "flex-wrap justify-center" : "flex-nowrap"
21752
21981
  ),
21753
21982
  children: [
21754
- /* @__PURE__ */ jsxs12(Tooltip, { children: [
21755
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
21983
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
21984
+ /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
21756
21985
  CustomToolbarButton,
21757
21986
  {
21758
21987
  type: "button",
@@ -21760,7 +21989,7 @@ function PricingCardToolbar({
21760
21989
  "aria-pressed": featuredTag,
21761
21990
  onClick: () => onSetFeaturedTag(!featuredTag),
21762
21991
  className: "group size-8",
21763
- children: /* @__PURE__ */ jsx21(
21992
+ children: /* @__PURE__ */ jsx22(
21764
21993
  Star2,
21765
21994
  {
21766
21995
  size: 16,
@@ -21775,25 +22004,25 @@ function PricingCardToolbar({
21775
22004
  )
21776
22005
  }
21777
22006
  ) }),
21778
- /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
22007
+ /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
21779
22008
  ] }),
21780
- /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21781
- /* @__PURE__ */ jsx21(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
21782
- /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21783
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx21(ButtonGlyph, {}) }),
21784
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
21785
- /* @__PURE__ */ jsx21(ButtonGlyph, {}),
21786
- /* @__PURE__ */ jsx21(Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
22009
+ /* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
22010
+ /* @__PURE__ */ jsx22(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
22011
+ /* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
22012
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx22(ButtonGlyph, {}) }),
22013
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs13("span", { className: "relative inline-flex", children: [
22014
+ /* @__PURE__ */ jsx22(ButtonGlyph, {}),
22015
+ /* @__PURE__ */ jsx22(Minus2, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
21787
22016
  ] }) }),
21788
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "add" }) }),
21789
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "remove" }) }),
21790
- /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21791
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
21792
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) })
22017
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx22(FeatureGlyph, { mode: "add" }) }),
22018
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx22(FeatureGlyph, { mode: "remove" }) }),
22019
+ /* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
22020
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx22(Plus3, { size: 16, style: { pointerEvents: "none" } }) }),
22021
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx22(Minus2, { size: 16, style: { pointerEvents: "none" } }) })
21793
22022
  ]
21794
22023
  }
21795
22024
  ),
21796
- 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 })
22025
+ error && /* @__PURE__ */ jsx22("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
21797
22026
  ]
21798
22027
  }
21799
22028
  ) });
@@ -21827,7 +22056,7 @@ function AiPricingCardOverlay({
21827
22056
  const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
21828
22057
  setHover((prev) => {
21829
22058
  const next = ref && !overEditable ? ref : null;
21830
- return sameRef(prev, next) ? prev : next;
22059
+ return sameRef2(prev, next) ? prev : next;
21831
22060
  });
21832
22061
  };
21833
22062
  const onLeave = () => setHover(null);
@@ -21842,10 +22071,10 @@ function AiPricingCardOverlay({
21842
22071
  const onClick = (e) => {
21843
22072
  const t = e.target;
21844
22073
  if (!(t instanceof Element)) return;
21845
- if (t.closest(CHROME_SELECTOR)) return;
22074
+ if (t.closest(CHROME_SELECTOR2)) return;
21846
22075
  const ref = cardRefFromTarget(t);
21847
- setActive((prev) => sameRef(prev, ref) ? prev : ref);
21848
- if (!ref || !sameRef(activeRef.current, ref)) setError(null);
22076
+ setActive((prev) => sameRef2(prev, ref) ? prev : ref);
22077
+ if (!ref || !sameRef2(activeRef.current, ref)) setError(null);
21849
22078
  };
21850
22079
  document.addEventListener("click", onClick, true);
21851
22080
  return () => document.removeEventListener("click", onClick, true);
@@ -21910,12 +22139,12 @@ function AiPricingCardOverlay({
21910
22139
  const activeEntry = active ? findEntry(active.sectionId) : null;
21911
22140
  const activeCardRect = useLiveCardRect(active);
21912
22141
  const activeGridRect = useLiveCardRect(active, true);
21913
- const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
21914
- return /* @__PURE__ */ jsxs12(Fragment8, { children: [
21915
- hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
21916
- activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment8, { children: [
21917
- /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
21918
- /* @__PURE__ */ jsx21(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx21(
22142
+ const hoverRect = useLiveCardRect(hover && !sameRef2(hover, active) ? hover : null);
22143
+ return /* @__PURE__ */ jsxs13(Fragment8, { children: [
22144
+ hoverRect && /* @__PURE__ */ jsx22(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
22145
+ activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs13(Fragment8, { children: [
22146
+ /* @__PURE__ */ jsx22(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
22147
+ /* @__PURE__ */ jsx22(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx22(
21919
22148
  PricingCardToolbar,
21920
22149
  {
21921
22150
  entry: activeEntry,
@@ -21943,7 +22172,7 @@ function AiPricingCardOverlay({
21943
22172
  onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
21944
22173
  }
21945
22174
  ) }),
21946
- /* @__PURE__ */ jsx21(
22175
+ /* @__PURE__ */ jsx22(
21947
22176
  "div",
21948
22177
  {
21949
22178
  "data-ohw-bridge": "",
@@ -22008,10 +22237,10 @@ function clearVideo(tree, path) {
22008
22237
  }
22009
22238
 
22010
22239
  // src/ui/ai-section/AiVideoOverlay.tsx
22011
- import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
22240
+ import { Fragment as Fragment9, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
22012
22241
  var PRIMARY5 = "#0885FE";
22013
- var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
22014
- var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
22242
+ var OHW_BLUE = `var(--ohw-primary, ${PRIMARY5})`;
22243
+ var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
22015
22244
  function findVideoBlockElement(sectionId, path) {
22016
22245
  const sectionEl2 = findByInstanceId(sectionId);
22017
22246
  if (!sectionEl2) return null;
@@ -22071,12 +22300,12 @@ function requestValidateTree3(postToParent2, tree) {
22071
22300
  postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
22072
22301
  });
22073
22302
  }
22074
- function Pill2({
22303
+ function Pill({
22075
22304
  label,
22076
22305
  onClick,
22077
22306
  disabled
22078
22307
  }) {
22079
- return /* @__PURE__ */ jsx22(
22308
+ return /* @__PURE__ */ jsx23(
22080
22309
  "button",
22081
22310
  {
22082
22311
  type: "button",
@@ -22092,7 +22321,7 @@ function Pill2({
22092
22321
  border: "none",
22093
22322
  cursor: disabled ? "default" : "pointer",
22094
22323
  background: "#ffffff",
22095
- color: OHW_BLUE_DARK2,
22324
+ color: OHW_BLUE_DARK,
22096
22325
  opacity: disabled ? 0.4 : 1,
22097
22326
  fontSize: 12,
22098
22327
  lineHeight: "16px",
@@ -22135,8 +22364,8 @@ function VideoUrlInput({ value, onCommit }) {
22135
22364
  onCommit(id);
22136
22365
  }
22137
22366
  };
22138
- return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
22139
- /* @__PURE__ */ jsxs13(
22367
+ return /* @__PURE__ */ jsxs14("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
22368
+ /* @__PURE__ */ jsxs14(
22140
22369
  "div",
22141
22370
  {
22142
22371
  style: {
@@ -22152,12 +22381,12 @@ function VideoUrlInput({ value, onCommit }) {
22152
22381
  boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
22153
22382
  },
22154
22383
  children: [
22155
- /* @__PURE__ */ jsx22(
22384
+ /* @__PURE__ */ jsx23(
22156
22385
  "span",
22157
22386
  {
22158
22387
  style: {
22159
22388
  flex: "0 0 auto",
22160
- color: OHW_BLUE_DARK2,
22389
+ color: OHW_BLUE_DARK,
22161
22390
  fontSize: 10,
22162
22391
  lineHeight: "16px",
22163
22392
  fontWeight: 700,
@@ -22167,7 +22396,7 @@ function VideoUrlInput({ value, onCommit }) {
22167
22396
  children: "Video"
22168
22397
  }
22169
22398
  ),
22170
- /* @__PURE__ */ jsx22(
22399
+ /* @__PURE__ */ jsx23(
22171
22400
  "input",
22172
22401
  {
22173
22402
  type: "text",
@@ -22204,7 +22433,7 @@ function VideoUrlInput({ value, onCommit }) {
22204
22433
  ]
22205
22434
  }
22206
22435
  ),
22207
- 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." })
22436
+ invalid && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
22208
22437
  ] });
22209
22438
  }
22210
22439
  function VideoToolbar({
@@ -22214,7 +22443,7 @@ function VideoToolbar({
22214
22443
  onSetVideoId,
22215
22444
  onRemove
22216
22445
  }) {
22217
- return /* @__PURE__ */ jsxs13(
22446
+ return /* @__PURE__ */ jsxs14(
22218
22447
  "div",
22219
22448
  {
22220
22449
  "data-ohw-bridge": "",
@@ -22226,7 +22455,7 @@ function VideoToolbar({
22226
22455
  gap: 6,
22227
22456
  alignItems: "center",
22228
22457
  width: 280,
22229
- background: OHW_BLUE2,
22458
+ background: OHW_BLUE,
22230
22459
  padding: 8,
22231
22460
  borderRadius: 12,
22232
22461
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -22234,9 +22463,9 @@ function VideoToolbar({
22234
22463
  opacity: pending ? 0.6 : 1
22235
22464
  },
22236
22465
  children: [
22237
- /* @__PURE__ */ jsx22(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
22238
- /* @__PURE__ */ jsx22(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
22239
- error && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22466
+ /* @__PURE__ */ jsx23(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
22467
+ /* @__PURE__ */ jsx23(Pill, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
22468
+ error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22240
22469
  ]
22241
22470
  }
22242
22471
  );
@@ -22356,8 +22585,8 @@ function AiVideoOverlay({
22356
22585
  const activeBlockRect = useLiveBlockRect(active);
22357
22586
  const TOOLBAR_APPROX_H = 90;
22358
22587
  const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
22359
- return /* @__PURE__ */ jsxs13(Fragment9, { children: [
22360
- hoverHandleRect && hover && /* @__PURE__ */ jsx22(
22588
+ return /* @__PURE__ */ jsxs14(Fragment9, { children: [
22589
+ hoverHandleRect && hover && /* @__PURE__ */ jsx23(
22361
22590
  "button",
22362
22591
  {
22363
22592
  type: "button",
@@ -22385,15 +22614,15 @@ function AiVideoOverlay({
22385
22614
  fontSize: 14,
22386
22615
  fontWeight: 700
22387
22616
  },
22388
- children: /* @__PURE__ */ jsx22(Star3, { size: 14, style: { pointerEvents: "none" } })
22617
+ children: /* @__PURE__ */ jsx23(Star3, { size: 14, style: { pointerEvents: "none" } })
22389
22618
  }
22390
22619
  ),
22391
- activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx22(
22620
+ activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx23(
22392
22621
  ItemInteractionLayer,
22393
22622
  {
22394
22623
  rect: activeBlockRect,
22395
22624
  state: toolbarState,
22396
- toolbar: /* @__PURE__ */ jsx22(
22625
+ toolbar: /* @__PURE__ */ jsx23(
22397
22626
  VideoToolbar,
22398
22627
  {
22399
22628
  videoId: videoIdAt(activeEntry.tree, active.path),
@@ -22468,10 +22697,10 @@ function setCarouselAutoplay(tree, on) {
22468
22697
  }
22469
22698
 
22470
22699
  // src/ui/ai-section/AiFadeCarouselOverlay.tsx
22471
- import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
22700
+ import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
22472
22701
  var PRIMARY6 = "#0885FE";
22473
- var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
22474
- var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
22702
+ var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY6})`;
22703
+ var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
22475
22704
  function findCarouselItemElement(sectionId, index) {
22476
22705
  const sectionEl2 = findByInstanceId(sectionId);
22477
22706
  if (!sectionEl2) return null;
@@ -22550,8 +22779,8 @@ function requestAssetPick2(postToParent2) {
22550
22779
  postToParent2({ type: "ow:asset-pick", id });
22551
22780
  });
22552
22781
  }
22553
- function Pill3({ label, onClick, disabled }) {
22554
- return /* @__PURE__ */ jsx23(
22782
+ function Pill2({ label, onClick, disabled }) {
22783
+ return /* @__PURE__ */ jsx24(
22555
22784
  "button",
22556
22785
  {
22557
22786
  type: "button",
@@ -22567,7 +22796,7 @@ function Pill3({ label, onClick, disabled }) {
22567
22796
  border: "none",
22568
22797
  cursor: disabled ? "default" : "pointer",
22569
22798
  background: "#ffffff",
22570
- color: OHW_BLUE_DARK3,
22799
+ color: OHW_BLUE_DARK2,
22571
22800
  opacity: disabled ? 0.4 : 1,
22572
22801
  fontSize: 12,
22573
22802
  lineHeight: "16px",
@@ -22585,7 +22814,7 @@ function TogglePill({
22585
22814
  onToggle,
22586
22815
  disabled
22587
22816
  }) {
22588
- return /* @__PURE__ */ jsxs14(
22817
+ return /* @__PURE__ */ jsxs15(
22589
22818
  "button",
22590
22819
  {
22591
22820
  type: "button",
@@ -22604,7 +22833,7 @@ function TogglePill({
22604
22833
  border: "none",
22605
22834
  cursor: disabled ? "default" : "pointer",
22606
22835
  background: "#ffffff",
22607
- color: OHW_BLUE_DARK3,
22836
+ color: OHW_BLUE_DARK2,
22608
22837
  opacity: disabled ? 0.4 : 1,
22609
22838
  fontSize: 12,
22610
22839
  lineHeight: "16px",
@@ -22614,7 +22843,7 @@ function TogglePill({
22614
22843
  },
22615
22844
  children: [
22616
22845
  label,
22617
- /* @__PURE__ */ jsx23(
22846
+ /* @__PURE__ */ jsx24(
22618
22847
  "span",
22619
22848
  {
22620
22849
  "aria-hidden": true,
@@ -22627,10 +22856,10 @@ function TogglePill({
22627
22856
  // Off is a grey track, not a washed-out blue: the pill's own white background already
22628
22857
  // carries the brand colour in the text, and a pale blue track next to it read as
22629
22858
  // "disabled control" rather than "switch that is off".
22630
- background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
22859
+ background: on ? OHW_BLUE_DARK2 : "#CBD5E1",
22631
22860
  transition: "background 120ms ease"
22632
22861
  },
22633
- children: /* @__PURE__ */ jsx23(
22862
+ children: /* @__PURE__ */ jsx24(
22634
22863
  "span",
22635
22864
  {
22636
22865
  style: {
@@ -22659,7 +22888,7 @@ function CarouselSlideToolbar({
22659
22888
  onChangeImage,
22660
22889
  onToggleAutoplay
22661
22890
  }) {
22662
- return /* @__PURE__ */ jsxs14(
22891
+ return /* @__PURE__ */ jsxs15(
22663
22892
  "div",
22664
22893
  {
22665
22894
  "data-ohw-bridge": "",
@@ -22670,7 +22899,7 @@ function CarouselSlideToolbar({
22670
22899
  flexDirection: "column",
22671
22900
  gap: 6,
22672
22901
  alignItems: "center",
22673
- background: OHW_BLUE3,
22902
+ background: OHW_BLUE2,
22674
22903
  padding: 8,
22675
22904
  borderRadius: 12,
22676
22905
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -22682,11 +22911,11 @@ function CarouselSlideToolbar({
22682
22911
  pointerEvents: pending ? "none" : "auto"
22683
22912
  },
22684
22913
  children: [
22685
- /* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
22686
- /* @__PURE__ */ jsx23(Pill3, { label: "Change Image", onClick: onChangeImage }),
22687
- /* @__PURE__ */ jsx23(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
22914
+ /* @__PURE__ */ jsxs15("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
22915
+ /* @__PURE__ */ jsx24(Pill2, { label: "Change Image", onClick: onChangeImage }),
22916
+ /* @__PURE__ */ jsx24(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
22688
22917
  ] }),
22689
- error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22918
+ error && /* @__PURE__ */ jsx24("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22690
22919
  ]
22691
22920
  }
22692
22921
  );
@@ -22826,8 +23055,8 @@ function AiFadeCarouselOverlay({
22826
23055
  const activeItemRect = useLiveItemRect2(active);
22827
23056
  const TOOLBAR_APPROX_H = 90;
22828
23057
  const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
22829
- return /* @__PURE__ */ jsxs14(Fragment10, { children: [
22830
- hoverHandleRect && hover && /* @__PURE__ */ jsx23(
23058
+ return /* @__PURE__ */ jsxs15(Fragment10, { children: [
23059
+ hoverHandleRect && hover && /* @__PURE__ */ jsx24(
22831
23060
  "button",
22832
23061
  {
22833
23062
  type: "button",
@@ -22856,10 +23085,10 @@ function AiFadeCarouselOverlay({
22856
23085
  fontSize: 14,
22857
23086
  fontWeight: 700
22858
23087
  },
22859
- children: /* @__PURE__ */ jsx23(Star4, { size: 14, style: { pointerEvents: "none" } })
23088
+ children: /* @__PURE__ */ jsx24(Star4, { size: 14, style: { pointerEvents: "none" } })
22860
23089
  }
22861
23090
  ),
22862
- swapping && /* @__PURE__ */ jsx23(
23091
+ swapping && /* @__PURE__ */ jsx24(
22863
23092
  "div",
22864
23093
  {
22865
23094
  ref: skeletonRef,
@@ -22877,15 +23106,15 @@ function AiFadeCarouselOverlay({
22877
23106
  zIndex: 2147483646,
22878
23107
  pointerEvents: "none"
22879
23108
  },
22880
- children: /* @__PURE__ */ jsx23("style", { children: MEDIA_SKELETON_CSS })
23109
+ children: /* @__PURE__ */ jsx24("style", { children: MEDIA_SKELETON_CSS })
22881
23110
  }
22882
23111
  ),
22883
- activeItemRect && active && activeEntry && /* @__PURE__ */ jsx23(
23112
+ activeItemRect && active && activeEntry && /* @__PURE__ */ jsx24(
22884
23113
  ItemInteractionLayer,
22885
23114
  {
22886
23115
  rect: activeItemRect,
22887
23116
  state: toolbarState,
22888
- toolbar: /* @__PURE__ */ jsx23(
23117
+ toolbar: /* @__PURE__ */ jsx24(
22889
23118
  CarouselSlideToolbar,
22890
23119
  {
22891
23120
  pending,
@@ -23123,118 +23352,11 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
23123
23352
  // src/ui/link-modal/LinkPopover.tsx
23124
23353
  import { useEffect as useEffect17 } from "react";
23125
23354
 
23126
- // src/ui/dialog.tsx
23127
- import * as React9 from "react";
23128
- import { Dialog as DialogPrimitive } from "radix-ui";
23129
- import { X as X2 } from "lucide-react";
23130
- import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
23131
- function Dialog2({
23132
- ...props
23133
- }) {
23134
- return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
23135
- }
23136
- function DialogPortal({
23137
- ...props
23138
- }) {
23139
- return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
23140
- }
23141
- function DialogOverlay({
23142
- className,
23143
- ...props
23144
- }) {
23145
- return /* @__PURE__ */ jsx24(
23146
- DialogPrimitive.Overlay,
23147
- {
23148
- "data-slot": "dialog-overlay",
23149
- "data-ohw-link-modal-root": "",
23150
- className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
23151
- ...props
23152
- }
23153
- );
23154
- }
23155
- var DialogContent = React9.forwardRef(
23156
- ({ className, children, showCloseButton = true, container, ...props }, ref) => {
23157
- const positionMode = container ? "absolute" : "fixed";
23158
- return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
23159
- /* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
23160
- /* @__PURE__ */ jsxs15(
23161
- DialogPrimitive.Content,
23162
- {
23163
- ref,
23164
- "data-slot": "dialog-content",
23165
- className: cn(
23166
- positionMode,
23167
- "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",
23168
- "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
23169
- container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
23170
- className
23171
- ),
23172
- onMouseDown: (e) => e.stopPropagation(),
23173
- ...props,
23174
- children: [
23175
- children,
23176
- showCloseButton ? /* @__PURE__ */ jsx24(
23177
- DialogPrimitive.Close,
23178
- {
23179
- type: "button",
23180
- className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
23181
- "aria-label": "Close",
23182
- children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
23183
- }
23184
- ) : null
23185
- ]
23186
- }
23187
- )
23188
- ] });
23189
- }
23190
- );
23191
- DialogContent.displayName = DialogPrimitive.Content.displayName;
23192
- function DialogHeader({
23193
- className,
23194
- ...props
23195
- }) {
23196
- return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
23197
- }
23198
- function DialogFooter({
23199
- className,
23200
- ...props
23201
- }) {
23202
- return /* @__PURE__ */ jsx24(
23203
- "div",
23204
- {
23205
- className: cn("flex items-center justify-end gap-2", className),
23206
- ...props
23207
- }
23208
- );
23209
- }
23210
- var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
23211
- DialogPrimitive.Title,
23212
- {
23213
- ref,
23214
- className: cn(
23215
- "text-lg font-semibold leading-none tracking-tight text-card-foreground",
23216
- className
23217
- ),
23218
- ...props
23219
- }
23220
- ));
23221
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
23222
- var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
23223
- DialogPrimitive.Description,
23224
- {
23225
- ref,
23226
- className: cn("text-sm text-muted-foreground", className),
23227
- ...props
23228
- }
23229
- ));
23230
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
23231
- var DialogClose = DialogPrimitive.Close;
23232
-
23233
23355
  // src/ui/link-modal/LinkEditorPanel.tsx
23234
23356
  import { Info, X as X4 } from "lucide-react";
23235
23357
 
23236
23358
  // src/ui/link-modal/DestinationBreadcrumb.tsx
23237
- import { ArrowRight as ArrowRight2, File, GalleryVertical } from "lucide-react";
23359
+ import { ArrowRight as ArrowRight3, File, GalleryVertical } from "lucide-react";
23238
23360
  import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
23239
23361
  function DestinationBreadcrumb({
23240
23362
  pageTitle,
@@ -23248,7 +23370,7 @@ function DestinationBreadcrumb({
23248
23370
  /* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
23249
23371
  ] }),
23250
23372
  /* @__PURE__ */ jsx25(
23251
- ArrowRight2,
23373
+ ArrowRight3,
23252
23374
  {
23253
23375
  size: 16,
23254
23376
  className: "shrink-0 text-muted-foreground",
@@ -23360,7 +23482,7 @@ function Label({ className, ...props }) {
23360
23482
  }
23361
23483
 
23362
23484
  // src/ui/link-modal/UrlOrPageInput.tsx
23363
- import { ChevronDown as ChevronDown4, File as File2, X as X3 } from "lucide-react";
23485
+ import { ChevronDown as ChevronDown5, File as File2, X as X3 } from "lucide-react";
23364
23486
  import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
23365
23487
  function FieldChevron({
23366
23488
  onClick
@@ -23373,7 +23495,7 @@ function FieldChevron({
23373
23495
  onClick,
23374
23496
  "aria-label": "Open page list",
23375
23497
  tabIndex: -1,
23376
- children: /* @__PURE__ */ jsx29(ChevronDown4, { size: 16 })
23498
+ children: /* @__PURE__ */ jsx29(ChevronDown5, { size: 16 })
23377
23499
  }
23378
23500
  );
23379
23501
  }
@@ -23603,7 +23725,7 @@ function LinkEditorPanel({ state, onClose }) {
23603
23725
  // src/ui/link-modal/SectionPickerOverlay.tsx
23604
23726
  import { useCallback as useCallback7, useEffect as useEffect15, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
23605
23727
  import { createPortal as createPortal2 } from "react-dom";
23606
- import { ArrowLeft as ArrowLeft2, Check as Check3 } from "lucide-react";
23728
+ import { ArrowLeft as ArrowLeft3, Check as Check4 } from "lucide-react";
23607
23729
  import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
23608
23730
 
23609
23731
  // src/lib/parent-scroll.ts
@@ -23880,7 +24002,7 @@ function SectionPickerOverlay({
23880
24002
  className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
23881
24003
  onClick: onBack,
23882
24004
  children: [
23883
- /* @__PURE__ */ jsx31(ArrowLeft2, { className: "size-4 shrink-0", "aria-hidden": true }),
24005
+ /* @__PURE__ */ jsx31(ArrowLeft3, { className: "size-4 shrink-0", "aria-hidden": true }),
23884
24006
  "Back"
23885
24007
  ]
23886
24008
  }
@@ -23949,7 +24071,7 @@ function SectionPickerOverlay({
23949
24071
  className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
23950
24072
  style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
23951
24073
  "aria-hidden": true,
23952
- children: /* @__PURE__ */ jsx31(Check3, { className: "size-5" })
24074
+ children: /* @__PURE__ */ jsx31(Check4, { className: "size-5" })
23953
24075
  }
23954
24076
  ) : null
23955
24077
  ]
@@ -24333,6 +24455,7 @@ function shouldUseDevFixtures() {
24333
24455
  function getLogoElement(el) {
24334
24456
  const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
24335
24457
  if (marked) return marked;
24458
+ if (el.closest('[data-ohw-editable="icon"]')) return null;
24336
24459
  const root = el.closest("nav, [data-ohw-nav-root], footer");
24337
24460
  if (!root) return null;
24338
24461
  const anchor = el.closest("a");
@@ -24402,7 +24525,7 @@ function addFooterColumnWithPersist({
24402
24525
  import {
24403
24526
  useCallback as useCallback9,
24404
24527
  useEffect as useEffect18,
24405
- useLayoutEffect as useLayoutEffect5,
24528
+ useLayoutEffect as useLayoutEffect6,
24406
24529
  useRef as useRef11,
24407
24530
  useState as useState15
24408
24531
  } from "react";
@@ -24499,7 +24622,7 @@ function FloatingPanel({
24499
24622
  return () => window.removeEventListener("message", onParentScroll);
24500
24623
  }, [open]);
24501
24624
  const positionRef = useRef11(position);
24502
- useLayoutEffect5(() => {
24625
+ useLayoutEffect6(() => {
24503
24626
  if (!open) {
24504
24627
  positionRef.current = position;
24505
24628
  return;
@@ -24509,7 +24632,7 @@ function FloatingPanel({
24509
24632
  }
24510
24633
  positionRef.current = position;
24511
24634
  }, [open, position, liveScroll, parentScroll]);
24512
- useLayoutEffect5(() => {
24635
+ useLayoutEffect6(() => {
24513
24636
  if (!open || !panelRef.current) return;
24514
24637
  const el = panelRef.current;
24515
24638
  const header = el.querySelector("[data-ohw-floating-panel-header]");
@@ -24718,7 +24841,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
24718
24841
  }
24719
24842
 
24720
24843
  // src/ui/button-style-panel.tsx
24721
- import { Check as Check4 } from "lucide-react";
24844
+ import { Check as Check5 } from "lucide-react";
24722
24845
  import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
24723
24846
  var SIZE_LABEL = { s: "S", m: "M", l: "L" };
24724
24847
  function ButtonStylePanel({
@@ -24789,7 +24912,7 @@ function ButtonStylePanel({
24789
24912
  {
24790
24913
  className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
24791
24914
  "aria-hidden": true,
24792
- children: /* @__PURE__ */ jsx35(Check4, { className: "size-3", strokeWidth: 3 })
24915
+ children: /* @__PURE__ */ jsx35(Check5, { className: "size-3", strokeWidth: 3 })
24793
24916
  }
24794
24917
  ) : null
24795
24918
  ]
@@ -25821,7 +25944,7 @@ function useSectionDrag({
25821
25944
  }
25822
25945
 
25823
25946
  // src/ui/footer-container-chrome.tsx
25824
- import { Plus as Plus3 } from "lucide-react";
25947
+ import { Plus as Plus4 } from "lucide-react";
25825
25948
  import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
25826
25949
  function FooterContainerChrome({
25827
25950
  rect,
@@ -25862,7 +25985,7 @@ function FooterContainerChrome({
25862
25985
  if (addDisabled) return;
25863
25986
  onAdd();
25864
25987
  },
25865
- children: /* @__PURE__ */ jsx36(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
25988
+ children: /* @__PURE__ */ jsx36(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
25866
25989
  }
25867
25990
  ) }),
25868
25991
  /* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
@@ -26269,7 +26392,7 @@ function retargetPageLinks(change, deps) {
26269
26392
  }
26270
26393
 
26271
26394
  // src/ui/navbar-container-chrome.tsx
26272
- import { Plus as Plus4 } from "lucide-react";
26395
+ import { Plus as Plus5 } from "lucide-react";
26273
26396
  import { jsx as jsx37 } from "react/jsx-runtime";
26274
26397
  function NavbarContainerChrome({
26275
26398
  rect,
@@ -26305,7 +26428,7 @@ function NavbarContainerChrome({
26305
26428
  e.stopPropagation();
26306
26429
  onAdd();
26307
26430
  },
26308
- children: /* @__PURE__ */ jsx37(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
26431
+ children: /* @__PURE__ */ jsx37(Plus5, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
26309
26432
  }
26310
26433
  )
26311
26434
  }
@@ -26377,7 +26500,7 @@ function Badge({ className, variant, ...props }) {
26377
26500
  }
26378
26501
 
26379
26502
  // src/OhhwellsBridge.tsx
26380
- import { Brush as Brush2, Link as Link2, Plus as Plus5, Settings, Trash2 as Trash24 } from "lucide-react";
26503
+ import { Brush as Brush2, Link as Link2, Plus as Plus6, Settings, Trash2 as Trash24 } from "lucide-react";
26381
26504
  import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
26382
26505
  var PRIMARY7 = "#0885FE";
26383
26506
  var IMAGE_FADE_MS = 300;
@@ -27155,7 +27278,7 @@ function getNavigationSelectionParent(el) {
27155
27278
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
27156
27279
  return resolveFooterLinksContainerFrom(el);
27157
27280
  }
27158
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
27281
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup2(el)) {
27159
27282
  return getNavigationRoot(el);
27160
27283
  }
27161
27284
  return null;
@@ -27377,7 +27500,6 @@ var ICONS = {
27377
27500
  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"/>',
27378
27501
  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"/>'
27379
27502
  };
27380
- var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
27381
27503
  var SELECTION_CHROME_GAP2 = 4;
27382
27504
  var TOOLBAR_STROKE_GAP2 = 4;
27383
27505
  var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
@@ -27475,7 +27597,7 @@ function applyVisibleViewport(el, parentScroll) {
27475
27597
  el.style.top = `${top}px`;
27476
27598
  el.style.height = `${height}px`;
27477
27599
  }
27478
- var TOOLBAR_EDGE_MARGIN3 = 4;
27600
+ var TOOLBAR_EDGE_MARGIN4 = 4;
27479
27601
  function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
27480
27602
  const isAbove = transform.includes("translateY(-100%)");
27481
27603
  let visualTop = isAbove ? top - approxH : top;
@@ -27502,8 +27624,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
27502
27624
  function clampToolbarLeft(centerX, toolbarWidth) {
27503
27625
  const half = toolbarWidth / 2;
27504
27626
  return Math.max(
27505
- TOOLBAR_EDGE_MARGIN3 + half,
27506
- Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
27627
+ TOOLBAR_EDGE_MARGIN4 + half,
27628
+ Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN4 - half)
27507
27629
  );
27508
27630
  }
27509
27631
  function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
@@ -27928,7 +28050,7 @@ function OhhwellsBridge() {
27928
28050
  }, []);
27929
28051
  const subdomainFromQuery = searchParams.get("subdomain");
27930
28052
  const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
27931
- useLayoutEffect6(() => {
28053
+ useLayoutEffect7(() => {
27932
28054
  const next = resolveSubdomain(subdomainFromQuery);
27933
28055
  if (next !== subdomain) setSubdomain(next);
27934
28056
  if (next) return;
@@ -28415,21 +28537,6 @@ function OhhwellsBridge() {
28415
28537
  const [isItemDragging, setIsItemDragging] = useState18(false);
28416
28538
  const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
28417
28539
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
28418
- const [floatingPanel, setFloatingPanel] = useState18(null);
28419
- const floatingPanelOpenRef = useRef14(false);
28420
- floatingPanelOpenRef.current = floatingPanel !== null;
28421
- const floatingPanelRef = useRef14(null);
28422
- floatingPanelRef.current = floatingPanel;
28423
- const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
28424
- const buttonCollectionDragRef = useRef14(null);
28425
- const buttonDropInsertIndexRef = useRef14(null);
28426
- const [buttonDropSlots, setButtonDropSlots] = useState18([]);
28427
- const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
28428
- const buttonPointerDragRef = useRef14(null);
28429
- const [buttonStyleTick, setButtonStyleTick] = useState18(0);
28430
- const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
28431
- const [editorViewport, setEditorViewport] = useState18("desktop");
28432
- const [parentScrollSnap, setParentScrollSnap] = useState18(null);
28433
28540
  const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
28434
28541
  const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
28435
28542
  const footerDragRef = useRef14(null);
@@ -28456,6 +28563,21 @@ function OhhwellsBridge() {
28456
28563
  const stylesRef = useRef14("");
28457
28564
  const appliedDrawerRef = useRef14(null);
28458
28565
  const pendingDeleteUndoRef = useRef14(null);
28566
+ const [floatingPanel, setFloatingPanel] = useState18(null);
28567
+ const floatingPanelOpenRef = useRef14(false);
28568
+ const floatingPanelRef = useRef14(null);
28569
+ floatingPanelRef.current = floatingPanel;
28570
+ const setFloatingPanelRef = useRef14(setFloatingPanel);
28571
+ const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
28572
+ const buttonCollectionDragRef = useRef14(null);
28573
+ const buttonDropInsertIndexRef = useRef14(null);
28574
+ const [buttonDropSlots, setButtonDropSlots] = useState18([]);
28575
+ const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
28576
+ const buttonPointerDragRef = useRef14(null);
28577
+ const [buttonStyleTick, setButtonStyleTick] = useState18(0);
28578
+ const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
28579
+ const [editorViewport, setEditorViewport] = useState18("desktop");
28580
+ const [parentScrollSnap, setParentScrollSnap] = useState18(null);
28459
28581
  const [sitePages, setSitePages] = useState18([]);
28460
28582
  const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
28461
28583
  const [sectionsByPath, setSectionsByPath] = useState18({});
@@ -28465,7 +28587,18 @@ function OhhwellsBridge() {
28465
28587
  const linkPopoverOpenRef = useRef14(false);
28466
28588
  const linkPopoverGraceUntilRef = useRef14(0);
28467
28589
  setLinkPopoverRef.current = setLinkPopover;
28590
+ setFloatingPanelRef.current = setFloatingPanel;
28468
28591
  linkPopoverSessionRef.current = linkPopover;
28592
+ floatingPanelOpenRef.current = Boolean(floatingPanel);
28593
+ useEffect22(() => {
28594
+ const syncViewport = () => {
28595
+ const next = window.innerWidth <= 480 ? "mobile" : "desktop";
28596
+ setEditorViewport((prev) => prev === next ? prev : next);
28597
+ };
28598
+ syncViewport();
28599
+ window.addEventListener("resize", syncViewport);
28600
+ return () => window.removeEventListener("resize", syncViewport);
28601
+ }, []);
28469
28602
  useEffect22(() => {
28470
28603
  setSectionOrderPersistHandler((entries) => {
28471
28604
  const currentPath = window.location.pathname;
@@ -30181,7 +30314,7 @@ function OhhwellsBridge() {
30181
30314
  isFooterFrameSelection,
30182
30315
  postToParent2
30183
30316
  ]);
30184
- useLayoutEffect6(() => {
30317
+ useLayoutEffect7(() => {
30185
30318
  if (!subdomain || isEditMode) {
30186
30319
  setFetchState("done");
30187
30320
  return;
@@ -30208,6 +30341,7 @@ function OhhwellsBridge() {
30208
30341
  applyAiFooterFromContent(content);
30209
30342
  if (typeof content[STYLE_STORE_KEY] === "string") {
30210
30343
  stylesRef.current = content[STYLE_STORE_KEY];
30344
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
30211
30345
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
30212
30346
  }
30213
30347
  applyBrandChrome(content);
@@ -30218,12 +30352,12 @@ function OhhwellsBridge() {
30218
30352
  if (key === "__ohw_sections") continue;
30219
30353
  if (key === AI_SECTIONS_KEY) continue;
30220
30354
  if (key === AI_FOOTER_KEY) continue;
30355
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
30356
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
30221
30357
  if (key === BRAND_KIT_KEY) continue;
30222
30358
  if (key === STYLE_STORE_KEY) continue;
30223
30359
  if (BRAND_CHROME_KEYS.has(key)) continue;
30224
- if (key === LOGO_PLACEHOLDER_KEY) continue;
30225
30360
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
30226
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
30227
30361
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
30228
30362
  continue;
30229
30363
  }
@@ -30458,17 +30592,18 @@ function OhhwellsBridge() {
30458
30592
  }
30459
30593
  applyAiFooterFromContent(content);
30460
30594
  if (typeof content[STYLE_STORE_KEY] === "string") {
30595
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
30461
30596
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
30462
30597
  }
30463
30598
  for (const [key, val] of Object.entries(content)) {
30464
30599
  if (key === "__ohw_sections") continue;
30465
30600
  if (key === AI_SECTIONS_KEY) continue;
30466
30601
  if (key === AI_FOOTER_KEY) continue;
30602
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
30603
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
30467
30604
  if (key === BRAND_KIT_KEY) continue;
30468
30605
  if (key === STYLE_STORE_KEY) continue;
30469
30606
  if (BRAND_CHROME_KEYS.has(key)) continue;
30470
- if (key === LOGO_PLACEHOLDER_KEY) continue;
30471
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
30472
30607
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
30473
30608
  continue;
30474
30609
  }
@@ -30555,7 +30690,7 @@ function OhhwellsBridge() {
30555
30690
  if (debounceTimer) clearTimeout(debounceTimer);
30556
30691
  };
30557
30692
  }, [subdomain, isEditMode, pathname]);
30558
- useLayoutEffect6(() => {
30693
+ useLayoutEffect7(() => {
30559
30694
  const el = document.getElementById("ohw-loader");
30560
30695
  if (!el) return;
30561
30696
  const visible = Boolean(subdomain) && fetchState !== "done";
@@ -30740,26 +30875,11 @@ function OhhwellsBridge() {
30740
30875
  const t2 = setTimeout(measure, 500);
30741
30876
  const ro = new ResizeObserver(schedule);
30742
30877
  ro.observe(document.body);
30743
- let lastWidth = window.innerWidth;
30744
- let resizeTimers = [];
30745
- const clearResizeTimers = () => {
30746
- resizeTimers.forEach(clearTimeout);
30747
- resizeTimers = [];
30748
- };
30749
- const handleResize = () => {
30750
- if (window.innerWidth === lastWidth) return;
30751
- lastWidth = window.innerWidth;
30752
- clearResizeTimers();
30753
- resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
30754
- };
30755
- window.addEventListener("resize", handleResize);
30756
30878
  return () => {
30757
30879
  clearTimeout(t1);
30758
30880
  clearTimeout(t2);
30759
30881
  if (raf != null) cancelAnimationFrame(raf);
30760
30882
  ro.disconnect();
30761
- clearResizeTimers();
30762
- window.removeEventListener("resize", handleResize);
30763
30883
  };
30764
30884
  }, [pathname, isEditMode, postToParent2]);
30765
30885
  useEffect22(() => {
@@ -31056,6 +31176,13 @@ function OhhwellsBridge() {
31056
31176
  if (target.closest("[data-ohw-state-toggle]")) return;
31057
31177
  if (target.closest("[data-ohw-max-badge]")) return;
31058
31178
  if (isInsideLinkEditor(target)) return;
31179
+ if (isInsideFloatingPanel(target)) return;
31180
+ if (target.closest("[data-ohw-form-toolbar]")) return;
31181
+ if (target.closest(
31182
+ '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
31183
+ )) {
31184
+ return;
31185
+ }
31059
31186
  if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
31060
31187
  clearMediaSelectionRef.current();
31061
31188
  }
@@ -31079,8 +31206,6 @@ function OhhwellsBridge() {
31079
31206
  return;
31080
31207
  }
31081
31208
  }
31082
- if (isInsideFloatingPanel(target)) return;
31083
- if (target.closest("[data-ohw-form-toolbar]")) return;
31084
31209
  const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
31085
31210
  if (collectionItem) {
31086
31211
  e.preventDefault();
@@ -31092,11 +31217,6 @@ function OhhwellsBridge() {
31092
31217
  });
31093
31218
  return;
31094
31219
  }
31095
- if (target.closest(
31096
- '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
31097
- )) {
31098
- return;
31099
- }
31100
31220
  {
31101
31221
  const formEl = getFormElement(target);
31102
31222
  const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
@@ -31260,9 +31380,13 @@ function OhhwellsBridge() {
31260
31380
  if (isIconEditable(editable) && !getSocialItem(editable)) {
31261
31381
  e.preventDefault();
31262
31382
  e.stopPropagation();
31263
- selectIconElementRef.current(editable);
31264
31383
  const aiIcon = editable.hasAttribute("data-ai-icon");
31265
31384
  const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
31385
+ if (aiIcon) {
31386
+ aiSectionApiRef.current?.selectFromElement(editable);
31387
+ } else {
31388
+ selectIconElementRef.current(editable);
31389
+ }
31266
31390
  postToParentRef.current({
31267
31391
  type: "ow:icon-pick",
31268
31392
  key: editable.dataset.ohwKey ?? "",
@@ -31490,6 +31614,9 @@ function OhhwellsBridge() {
31490
31614
  setHoveredItemRect(null);
31491
31615
  hoveredNavContainerRef.current = null;
31492
31616
  setHoveredNavContainerRect(null);
31617
+ siblingHintElRef.current = null;
31618
+ setSiblingHintRect(null);
31619
+ setSiblingHintRects([]);
31493
31620
  return;
31494
31621
  }
31495
31622
  {
@@ -31612,7 +31739,6 @@ function OhhwellsBridge() {
31612
31739
  hoveredNavContainerRef.current = null;
31613
31740
  setHoveredNavContainerRect(null);
31614
31741
  hoveredItemElRef.current = editable;
31615
- setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
31616
31742
  }
31617
31743
  }
31618
31744
  }
@@ -32319,7 +32445,11 @@ function OhhwellsBridge() {
32319
32445
  };
32320
32446
  const handleMouseMove = (e) => {
32321
32447
  const { clientX, clientY } = e;
32322
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
32448
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
32449
+ dismissImageHover();
32450
+ clearImageHover();
32451
+ return;
32452
+ }
32323
32453
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
32324
32454
  document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
32325
32455
  formHoverElRef.current = null;
@@ -32348,7 +32478,12 @@ function OhhwellsBridge() {
32348
32478
  setHoveredItemRect(null);
32349
32479
  hoveredNavContainerRef.current = null;
32350
32480
  setHoveredNavContainerRect(null);
32481
+ siblingHintElRef.current = null;
32482
+ setSiblingHintRect(null);
32483
+ setSiblingHintRects([]);
32351
32484
  dismissImageHover();
32485
+ clearImageHover();
32486
+ setSectionGap(null);
32352
32487
  return;
32353
32488
  }
32354
32489
  if (probeSocialsRowAt(clientX, clientY)) return;
@@ -32360,7 +32495,11 @@ function OhhwellsBridge() {
32360
32495
  if (e.data?.type !== "ow:pointer-sync") return;
32361
32496
  const { clientX, clientY } = e.data;
32362
32497
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
32363
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
32498
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
32499
+ dismissImageHover();
32500
+ clearImageHover();
32501
+ return;
32502
+ }
32364
32503
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
32365
32504
  if (probeSocialsRowAt(clientX, clientY)) return;
32366
32505
  probeSectionGapAt(clientX, clientY);
@@ -32740,6 +32879,7 @@ function OhhwellsBridge() {
32740
32879
  applyAiFooterFromContent(content);
32741
32880
  if (typeof content[STYLE_STORE_KEY] === "string") {
32742
32881
  stylesRef.current = content[STYLE_STORE_KEY];
32882
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
32743
32883
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
32744
32884
  }
32745
32885
  applyBrandChrome(content);
@@ -32754,12 +32894,12 @@ function OhhwellsBridge() {
32754
32894
  }
32755
32895
  if (key === AI_SECTIONS_KEY) continue;
32756
32896
  if (key === AI_FOOTER_KEY) continue;
32897
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
32898
+ if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
32757
32899
  if (key === BRAND_KIT_KEY) continue;
32758
32900
  if (key === STYLE_STORE_KEY) continue;
32759
32901
  if (BRAND_CHROME_KEYS.has(key)) continue;
32760
- if (key === LOGO_PLACEHOLDER_KEY) continue;
32761
32902
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
32762
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
32763
32903
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
32764
32904
  continue;
32765
32905
  }
@@ -33432,6 +33572,12 @@ function OhhwellsBridge() {
33432
33572
  closeLinkPopoverRef.current();
33433
33573
  return;
33434
33574
  }
33575
+ if (floatingPanelOpenRef.current) {
33576
+ setFloatingPanelRef.current(null);
33577
+ deselectRef.current();
33578
+ deactivateRef.current();
33579
+ return;
33580
+ }
33435
33581
  deselectRef.current();
33436
33582
  deactivateRef.current();
33437
33583
  clearMediaSelectionRef.current();
@@ -34261,10 +34407,10 @@ function OhhwellsBridge() {
34261
34407
  window.removeEventListener("message", handleDuplicateSection);
34262
34408
  window.removeEventListener("message", handleDeactivate);
34263
34409
  window.removeEventListener("message", handleSelectNav);
34264
- document.documentElement.removeAttribute("data-ohw-panel-dragging");
34265
34410
  window.removeEventListener("message", handleToastAction);
34266
34411
  window.removeEventListener("message", handleFormCount);
34267
34412
  window.removeEventListener("message", handleUiEscape);
34413
+ document.documentElement.removeAttribute("data-ohw-panel-dragging");
34268
34414
  autoSaveTimers.current.forEach(clearTimeout);
34269
34415
  autoSaveTimers.current.clear();
34270
34416
  if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
@@ -34558,7 +34704,7 @@ function OhhwellsBridge() {
34558
34704
  postToParent2({
34559
34705
  type: "ow:ready",
34560
34706
  version: "1",
34561
- bridgeVersion: "0.1.177",
34707
+ bridgeVersion: "0.1.179-next.473",
34562
34708
  path: pathname,
34563
34709
  nodes: collectEditableNodes(editContentRef.current),
34564
34710
  sections
@@ -35449,7 +35595,7 @@ function OhhwellsBridge() {
35449
35595
  className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
35450
35596
  onClick: () => setFieldTypePickerOpen((open) => !open),
35451
35597
  "data-ohw-add-field": "",
35452
- children: /* @__PURE__ */ jsx40(Plus5, { size: 15, "aria-hidden": true })
35598
+ children: /* @__PURE__ */ jsx40(Plus6, { size: 15, "aria-hidden": true })
35453
35599
  }
35454
35600
  ),
35455
35601
  /* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),