@ohhwells/bridge 0.1.172-next.457 → 0.1.173

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7010,21 +7010,6 @@ function pricingCardFeatureCount(tree, index) {
7010
7010
  const target = findPricingCollection(tree)?.children?.[index];
7011
7011
  return target ? pricingFeatureList(target).length : 0;
7012
7012
  }
7013
- function prevailingFeatureIcon(features) {
7014
- const counts = /* @__PURE__ */ new Map();
7015
- for (const row of features) {
7016
- const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
7017
- const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
7018
- entry.count += 1;
7019
- counts.set(key, entry);
7020
- }
7021
- let best = null;
7022
- for (const entry of counts.values()) {
7023
- if (!best || entry.count > best.count) best = entry;
7024
- }
7025
- if (!best) return {};
7026
- return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
7027
- }
7028
7013
  function addPricingCardFeature(tree, index, text) {
7029
7014
  return withPricingCollection(tree, (collection) => {
7030
7015
  const children = collection.children;
@@ -7033,7 +7018,7 @@ function addPricingCardFeature(tree, index, text) {
7033
7018
  const features = pricingFeatureList(target);
7034
7019
  if (features.length >= PRICING_FEATURES_MAX) return false;
7035
7020
  target.slots = target.slots ?? {};
7036
- target.slots.features = [...features, { text, ...prevailingFeatureIcon(features) }];
7021
+ target.slots.features = [...features, { text }];
7037
7022
  return true;
7038
7023
  });
7039
7024
  }
@@ -8546,7 +8531,7 @@ var AI_MOBILE_CSS = [
8546
8531
  // page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
8547
8532
  // template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
8548
8533
  // an exact figure from (no live measurement exists), so this is a safe approximation, not a
8549
- // pixel-exact fit. Horizontal spacing already comes from `data-ai-section-inner`.
8534
+ // pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
8550
8535
  '[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
8551
8536
  // A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
8552
8537
  // window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
@@ -8562,10 +8547,8 @@ var AI_MOBILE_CSS = [
8562
8547
  "[data-ai-section]{overflow-x:hidden}",
8563
8548
  // `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
8564
8549
  // full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
8565
- // still got a 20px band of section background down both sides on a phone. The footer's own
8566
- // container keeps the unguarded rule below — `data-ai-full-bleed` can never appear on it.
8567
- "[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
8568
- "[data-ai-container]{padding:0 20px !important}",
8550
+ // still got a 20px band of section background down both sides on a phone.
8551
+ "[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
8569
8552
  "[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
8570
8553
  "[data-ai-cell]{width:100%;min-width:0}",
8571
8554
  // The rule above turns every row into a COLUMN flex container on phones, which silently breaks
@@ -8770,31 +8753,6 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
8770
8753
  function textAttrs(ctx, path) {
8771
8754
  return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
8772
8755
  }
8773
- var AI_RESPONSIVE_CSS = [
8774
- "@media (max-width: 960px) {",
8775
- " [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
8776
- ' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
8777
- "}",
8778
- "@media (max-width: 640px) {",
8779
- " [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
8780
- " [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
8781
- // Group containers flatten to a column on phones; span placements come along for free.
8782
- // `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
8783
- // the comment there. This sheet's copy is the narrower selector, so without the exemption it
8784
- // flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
8785
- // viewport with the heading/CTA in flow *under* the image, 219px of section background where the
8786
- // layered text used to be.
8787
- ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
8788
- ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
8789
- // `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
8790
- // is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
8791
- // a full-bleed hero gets its 20px side band back below 640px only — the one width where the
8792
- // other rule had already been taught to stand down.
8793
- " [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
8794
- " [data-ai-responsive] { overflow-x: hidden; }",
8795
- " [data-ai-responsive] img { max-width: 100%; }",
8796
- "}"
8797
- ].join("\n");
8798
8756
  var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
8799
8757
  function MediaBox({
8800
8758
  refValue,
@@ -8849,7 +8807,7 @@ function MediaBox({
8849
8807
  position: fill ? "absolute" : void 0,
8850
8808
  inset: fill ? 0 : void 0,
8851
8809
  width: fill ? "100%" : fixedSize ? "auto" : "100%",
8852
- height: fill ? "100%" : fixedSize ? height : void 0,
8810
+ height: fill ? "100%" : void 0,
8853
8811
  aspectRatio: fill ? void 0 : aspectRatio,
8854
8812
  minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
8855
8813
  borderRadius: radius,
@@ -10351,7 +10309,7 @@ function CollectionBlock({ node, ctx, path }) {
10351
10309
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
10352
10310
  "div",
10353
10311
  {
10354
- "data-ai-grid": String(itemsPerRow),
10312
+ "data-ai-grid": "",
10355
10313
  "data-ohw-pricing-collection": isPricing ? "" : void 0,
10356
10314
  style: {
10357
10315
  display: "grid",
@@ -10653,7 +10611,7 @@ function renderNode(node, ctx, path, ambientAlign) {
10653
10611
  },
10654
10612
  children: [
10655
10613
  i > 0 && ctx.heroOverlapFullBleed ? (
10656
- // The section's `data-ai-section-inner` gave up its max-width/gutter so the base
10614
+ // The section's `data-ai-container` gave up its max-width/gutter so the base
10657
10615
  // layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
10658
10616
  // scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
10659
10617
  // the full section width instead of reading at the usual content width.
@@ -11067,7 +11025,6 @@ function AiTreeRenderer({
11067
11025
  ...fillHeight ? { "data-ai-fill-height": "" } : {},
11068
11026
  ...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
11069
11027
  ...bgAttrs,
11070
- "data-ai-responsive": "",
11071
11028
  style: {
11072
11029
  position: "relative",
11073
11030
  padding: `${padCss} 0`,
@@ -11081,13 +11038,12 @@ function AiTreeRenderer({
11081
11038
  ...fillHeight ? { display: "grid" } : {}
11082
11039
  },
11083
11040
  children: [
11084
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
11085
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
11086
11041
  isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
11042
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
11087
11043
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
11088
11044
  "div",
11089
11045
  {
11090
- "data-ai-section-inner": "",
11046
+ "data-ai-container": "",
11091
11047
  ...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
11092
11048
  style: {
11093
11049
  position: "relative",
@@ -11104,7 +11060,7 @@ function AiTreeRenderer({
11104
11060
  children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
11105
11061
  "div",
11106
11062
  {
11107
- "data-ai-columns": "",
11063
+ "data-ai-row": "",
11108
11064
  style: {
11109
11065
  display: "grid",
11110
11066
  gridTemplateColumns: "repeat(12, 1fr)",
@@ -11766,10 +11722,9 @@ function applyAiSectionsToDom(state, options) {
11766
11722
  if (existing && existing.serialized === serialized && existing.container.isConnected) {
11767
11723
  continue;
11768
11724
  }
11725
+ const isNewMount = !existing || !existing.container.isConnected;
11769
11726
  let container = existing?.container;
11770
- let isNewMount = false;
11771
11727
  if (!container || !container.isConnected) {
11772
- isNewMount = true;
11773
11728
  existing?.root.unmount();
11774
11729
  container?.remove();
11775
11730
  container = document.createElement("div");
@@ -12107,34 +12062,6 @@ function minSpanForFooterBlock(type) {
12107
12062
  return 3;
12108
12063
  }
12109
12064
  }
12110
- function readLiveSocialItems() {
12111
- const root = getFooterRoot();
12112
- const row = root?.querySelector("[data-ohw-socials-row]");
12113
- if (!row) return [];
12114
- const items = [];
12115
- for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
12116
- const href = anchor.getAttribute("href")?.trim() ?? "";
12117
- const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
12118
- const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
12119
- if (!platform || !/^https?:\/\//i.test(href)) continue;
12120
- items.push({ platform, href });
12121
- }
12122
- return items;
12123
- }
12124
- function syncSocialRowsFromDom(tree) {
12125
- const root = getFooterRoot();
12126
- if (!root) return;
12127
- const row = root.querySelector("[data-ohw-socials-row]");
12128
- const live = readLiveSocialItems();
12129
- if (row && live.length === 0) return;
12130
- for (const col of tree.columns) {
12131
- col.blocks = col.blocks.flatMap((block) => {
12132
- if (block.type !== "social-row") return [block];
12133
- if (!row) return [];
12134
- return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
12135
- });
12136
- }
12137
- }
12138
12065
  function collectBrandBlocks(tree) {
12139
12066
  const brand = [];
12140
12067
  for (const col of tree.columns) {
@@ -12380,7 +12307,6 @@ function textOf2(el) {
12380
12307
  }
12381
12308
  function syncFooterTreeLinksFromDom(tree) {
12382
12309
  const next = cloneTree2(tree);
12383
- syncSocialRowsFromDom(next);
12384
12310
  const domCols = listFooterColumns().map((col) => {
12385
12311
  const heading = getFooterColumnHeadingEl(col);
12386
12312
  const title = heading ? textOf2(heading) : void 0;
@@ -18193,7 +18119,7 @@ function apiBase() {
18193
18119
  function bridgeVersion() {
18194
18120
  try {
18195
18121
  if (true) {
18196
- return "0.1.172-next.457";
18122
+ return "0.1.173";
18197
18123
  }
18198
18124
  } catch {
18199
18125
  }
@@ -18207,7 +18133,7 @@ function stampBridgeVersionOnDocument() {
18207
18133
  return;
18208
18134
  }
18209
18135
  try {
18210
- const v = true ? "0.1.172-next.457" : "";
18136
+ const v = true ? "0.1.173" : "";
18211
18137
  if (v) {
18212
18138
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
18213
18139
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -18888,7 +18814,6 @@ function MediaOverlay({
18888
18814
  (prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
18889
18815
  );
18890
18816
  }, [isVideo]);
18891
- const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
18892
18817
  const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
18893
18818
  const box = {
18894
18819
  position: "fixed",
@@ -18987,10 +18912,11 @@ function MediaOverlay({
18987
18912
  className: "flex items-center justify-center cursor-pointer",
18988
18913
  style: {
18989
18914
  ...box,
18990
- // Visual only. `pointer-events: auto` on this full-bleed rect covered the navbar
18991
- // (hero bg includes the absolute TopNav) and swallowed CTA press-drag. Text overlay
18992
- // and cueOnly also need clicks to fall through — Replace / video controls opt back in.
18993
- pointerEvents: "none",
18915
+ // When text overlays this media, let clicks fall THROUGH to the text underneath. In the
18916
+ // parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
18917
+ // in-document, pointer-events does it natively. The button below opts back in, so
18918
+ // Replace still works.
18919
+ pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
18994
18920
  // Selected: a firm component ring with no wash, so the image reads as chosen rather
18995
18921
  // than hovered. Hover keeps the existing tinted preview.
18996
18922
  boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
@@ -19017,18 +18943,15 @@ function MediaOverlay({
19017
18943
  },
19018
18944
  children: [
19019
18945
  isVideo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
19020
- replaceLabel
18946
+ isVideo ? "Replace video" : "Replace image"
19021
18947
  ]
19022
18948
  }
19023
18949
  ),
19024
- showChrome && replaceMode !== "none" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
18950
+ replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
19025
18951
  "div",
19026
18952
  {
19027
18953
  className: "flex items-center gap-1.5",
19028
- style: {
19029
- // Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
19030
- pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
19031
- },
18954
+ style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
19032
18955
  onClick: (e) => e.stopPropagation(),
19033
18956
  children: [
19034
18957
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
@@ -19037,7 +18960,7 @@ function MediaOverlay({
19037
18960
  "data-ohw-media-overlay": "",
19038
18961
  variant: "outline",
19039
18962
  size: "sm",
19040
- "aria-label": replaceLabel,
18963
+ "aria-label": isVideo ? "Replace video" : "Replace image",
19041
18964
  className: "gap-1.5 cursor-pointer hover:bg-background",
19042
18965
  style: {
19043
18966
  ...OVERLAY_BUTTON_STYLE,
@@ -19058,7 +18981,7 @@ function MediaOverlay({
19058
18981
  },
19059
18982
  children: [
19060
18983
  isVideo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
19061
- replaceMode === "full" ? replaceLabel : null
18984
+ replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
19062
18985
  ]
19063
18986
  }
19064
18987
  ),
@@ -19716,7 +19639,7 @@ function AiSectionOverlay({
19716
19639
 
19717
19640
  // src/ui/ai-section/AiMediaStripOverlay.tsx
19718
19641
  var import_react13 = require("react");
19719
- var import_lucide_react9 = require("lucide-react");
19642
+ var import_lucide_react8 = require("lucide-react");
19720
19643
 
19721
19644
  // src/lib/ai-media-strip-tree.ts
19722
19645
  var MEDIA_STRIP_ITEM_MIN = 1;
@@ -19830,6 +19753,14 @@ function setMediaStripItemAsset(tree, index, assetId) {
19830
19753
  return true;
19831
19754
  });
19832
19755
  }
19756
+ function setMediaStripItemAlt(tree, index, alt) {
19757
+ return withMediaStrip(tree, (block) => {
19758
+ const items = block.items;
19759
+ if (index < 0 || index >= items.length) return false;
19760
+ items[index] = { ...items[index], alt };
19761
+ return true;
19762
+ });
19763
+ }
19833
19764
  function setMediaStripItemLink(tree, index, link) {
19834
19765
  return withMediaStrip(tree, (block) => {
19835
19766
  const items = block.items;
@@ -19847,117 +19778,11 @@ function setMediaStripItemLink(tree, index, link) {
19847
19778
  });
19848
19779
  }
19849
19780
 
19850
- // src/ui/dialog.tsx
19851
- var React9 = __toESM(require("react"), 1);
19852
- var import_radix_ui6 = require("radix-ui");
19853
- var import_lucide_react8 = require("lucide-react");
19854
- var import_jsx_runtime20 = require("react/jsx-runtime");
19855
- function Dialog2({
19856
- ...props
19857
- }) {
19858
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
19859
- }
19860
- function DialogPortal({
19861
- ...props
19862
- }) {
19863
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
19864
- }
19865
- function DialogOverlay({
19866
- className,
19867
- ...props
19868
- }) {
19869
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19870
- import_radix_ui6.Dialog.Overlay,
19871
- {
19872
- "data-slot": "dialog-overlay",
19873
- "data-ohw-link-modal-root": "",
19874
- className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
19875
- ...props
19876
- }
19877
- );
19878
- }
19879
- var DialogContent = React9.forwardRef(
19880
- ({ className, children, showCloseButton = true, container, ...props }, ref) => {
19881
- const positionMode = container ? "absolute" : "fixed";
19882
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
19883
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
19884
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
19885
- import_radix_ui6.Dialog.Content,
19886
- {
19887
- ref,
19888
- "data-slot": "dialog-content",
19889
- className: cn(
19890
- positionMode,
19891
- "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",
19892
- "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
19893
- container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
19894
- className
19895
- ),
19896
- onMouseDown: (e) => e.stopPropagation(),
19897
- ...props,
19898
- children: [
19899
- children,
19900
- showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19901
- import_radix_ui6.Dialog.Close,
19902
- {
19903
- type: "button",
19904
- className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
19905
- "aria-label": "Close",
19906
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
19907
- }
19908
- ) : null
19909
- ]
19910
- }
19911
- )
19912
- ] });
19913
- }
19914
- );
19915
- DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
19916
- function DialogHeader({
19917
- className,
19918
- ...props
19919
- }) {
19920
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
19921
- }
19922
- function DialogFooter({
19923
- className,
19924
- ...props
19925
- }) {
19926
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19927
- "div",
19928
- {
19929
- className: cn("flex items-center justify-end gap-2", className),
19930
- ...props
19931
- }
19932
- );
19933
- }
19934
- var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19935
- import_radix_ui6.Dialog.Title,
19936
- {
19937
- ref,
19938
- className: cn(
19939
- "text-lg font-semibold leading-none tracking-tight text-card-foreground",
19940
- className
19941
- ),
19942
- ...props
19943
- }
19944
- ));
19945
- DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
19946
- var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19947
- import_radix_ui6.Dialog.Description,
19948
- {
19949
- ref,
19950
- className: cn("text-sm text-muted-foreground", className),
19951
- ...props
19952
- }
19953
- ));
19954
- DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
19955
- var DialogClose = import_radix_ui6.Dialog.Close;
19956
-
19957
19781
  // src/ui/ai-section/AiMediaStripOverlay.tsx
19958
- var import_jsx_runtime21 = require("react/jsx-runtime");
19959
- var PRIMARY3 = "var(--ohw-primary, #0885FE)";
19960
- 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]";
19782
+ var import_jsx_runtime20 = require("react/jsx-runtime");
19783
+ var PRIMARY3 = "#0885FE";
19784
+ var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
19785
+ var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
19961
19786
  function findMediaStripItemElement(sectionId, index) {
19962
19787
  const sectionEl2 = findByInstanceId(sectionId);
19963
19788
  if (!sectionEl2) return null;
@@ -19967,35 +19792,14 @@ function findMediaStripItemElement(sectionId, index) {
19967
19792
  }
19968
19793
  return null;
19969
19794
  }
19970
- function itemRefFromTarget(target) {
19971
- if (!(target instanceof Element)) return null;
19972
- if (target.closest(CHROME_SELECTOR)) return null;
19973
- const itemEl = target.closest("[data-ohw-media-strip-item]");
19974
- if (!itemEl) return null;
19975
- const sectionEl2 = itemEl.closest("[data-ohw-section]");
19976
- const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
19977
- const sectionId = unit ? instanceIdOf(unit) || null : null;
19978
- const index = Number(itemEl.dataset.ohwMediaStripIndex);
19979
- if (!sectionId || Number.isNaN(index)) return null;
19980
- return { sectionId, index };
19981
- }
19982
- function sameRef(a, b) {
19983
- return a?.sectionId === b?.sectionId && a?.index === b?.index;
19984
- }
19985
- function rectOf(el) {
19795
+ function readRect2(ref) {
19796
+ const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
19986
19797
  if (!el) return null;
19987
19798
  const r2 = el.getBoundingClientRect();
19988
19799
  if (r2.width <= 0 || r2.height <= 0) return null;
19989
19800
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
19990
19801
  }
19991
- function readRect2(ref) {
19992
- return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
19993
- }
19994
- function readStripRect(ref) {
19995
- const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
19996
- return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
19997
- }
19998
- function useLiveItemRect(ref, strip = false) {
19802
+ function useLiveItemRect(ref) {
19999
19803
  const [rect, setRect] = (0, import_react13.useState)(null);
20000
19804
  (0, import_react13.useEffect)(() => {
20001
19805
  if (!ref) {
@@ -20003,7 +19807,7 @@ function useLiveItemRect(ref, strip = false) {
20003
19807
  return;
20004
19808
  }
20005
19809
  const update = () => {
20006
- const next = strip ? readStripRect(ref) : readRect2(ref);
19810
+ const next = readRect2(ref);
20007
19811
  setRect(
20008
19812
  (prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
20009
19813
  );
@@ -20018,49 +19822,9 @@ function useLiveItemRect(ref, strip = false) {
20018
19822
  window.removeEventListener("resize", update);
20019
19823
  clearInterval(interval);
20020
19824
  };
20021
- }, [ref?.sectionId, ref?.index, strip]);
19825
+ }, [ref?.sectionId, ref?.index]);
20022
19826
  return rect;
20023
19827
  }
20024
- var TOOLBAR_STRIP_GAP = 52;
20025
- var TOOLBAR_STRIP_GAP_MOBILE = 42;
20026
- var TOOLBAR_EDGE_MARGIN2 = 4;
20027
- function StripToolbarSlot({ stripRect, children }) {
20028
- const slotRef = (0, import_react13.useRef)(null);
20029
- const [shift, setShift] = (0, import_react13.useState)(0);
20030
- const centerX = stripRect.left + stripRect.width / 2;
20031
- (0, import_react13.useLayoutEffect)(() => {
20032
- const slot = slotRef.current;
20033
- if (!slot) return;
20034
- const clamp = () => {
20035
- const w = slot.offsetWidth;
20036
- if (w <= 0) return;
20037
- const half = w / 2;
20038
- const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
20039
- setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
20040
- };
20041
- clamp();
20042
- const ro = new ResizeObserver(clamp);
20043
- ro.observe(slot);
20044
- return () => ro.disconnect();
20045
- }, [centerX, children]);
20046
- const mobile = window.innerWidth <= 480;
20047
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20048
- "div",
20049
- {
20050
- ref: slotRef,
20051
- "data-ohw-bridge": "",
20052
- "data-ohw-item-interaction": "",
20053
- className: "pointer-events-auto fixed",
20054
- style: {
20055
- top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
20056
- left: centerX + shift,
20057
- transform: "translate(-50%, -100%)",
20058
- zIndex: 2147483645
20059
- },
20060
- children
20061
- }
20062
- );
20063
- }
20064
19828
  function requestValidateTree(postToParent2, tree) {
20065
19829
  return new Promise((resolve) => {
20066
19830
  const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
@@ -20097,72 +19861,116 @@ function requestAssetPick(postToParent2) {
20097
19861
  postToParent2({ type: "ow:asset-pick", id });
20098
19862
  });
20099
19863
  }
20100
- function ToolbarAction({
19864
+ function Pill({
20101
19865
  label,
20102
19866
  onClick,
20103
- disabled = false,
20104
- active = false,
20105
- children
19867
+ disabled,
19868
+ active
20106
19869
  }) {
20107
- const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
20108
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
20109
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
20110
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
20111
- ] });
20112
- }
20113
- function ToolbarSeparator() {
20114
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
19870
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19871
+ "button",
19872
+ {
19873
+ type: "button",
19874
+ onClick,
19875
+ disabled,
19876
+ style: {
19877
+ height: 28,
19878
+ padding: "0 10px",
19879
+ display: "inline-flex",
19880
+ alignItems: "center",
19881
+ gap: 4,
19882
+ borderRadius: 999,
19883
+ border: "none",
19884
+ cursor: disabled ? "default" : "pointer",
19885
+ background: active ? OHW_BLUE_DARK : "#ffffff",
19886
+ color: active ? "#ffffff" : OHW_BLUE_DARK,
19887
+ opacity: disabled ? 0.4 : 1,
19888
+ fontSize: 12,
19889
+ lineHeight: "16px",
19890
+ fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
19891
+ whiteSpace: "nowrap",
19892
+ flex: "0 0 auto"
19893
+ },
19894
+ children: label
19895
+ }
19896
+ );
20115
19897
  }
20116
- function OptionMenu({
20117
- label,
20118
- value,
20119
- options,
20120
- onChange
20121
- }) {
20122
- const current = options.find((o) => o.value === value) ?? options[0];
20123
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
20124
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: label }),
20125
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
20126
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20127
- "button",
20128
- {
20129
- type: "button",
20130
- "aria-label": label,
20131
- 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",
20132
- children: [
20133
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
20134
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
20135
- ]
20136
- }
20137
- ) }),
20138
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
20139
- const selected = option.value === value;
20140
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20141
- DropdownMenuItem,
19898
+ function AltInput({ value, onCommit }) {
19899
+ const [draft, setDraft] = (0, import_react13.useState)(value);
19900
+ (0, import_react13.useEffect)(() => setDraft(value), [value]);
19901
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
19902
+ "div",
19903
+ {
19904
+ style: {
19905
+ display: "flex",
19906
+ alignItems: "center",
19907
+ gap: 6,
19908
+ height: 28,
19909
+ padding: "0 12px",
19910
+ borderRadius: 999,
19911
+ background: "#ffffff",
19912
+ width: "100%",
19913
+ maxWidth: 260,
19914
+ boxSizing: "border-box"
19915
+ },
19916
+ children: [
19917
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19918
+ "span",
20142
19919
  {
20143
- role: "menuitemradio",
20144
- "aria-checked": selected,
20145
- onSelect: () => onChange(option.value),
20146
- className: cn("grid grid-cols-[1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
20147
- children: [
20148
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: option.label }),
20149
- selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
20150
- ]
20151
- },
20152
- option.value
20153
- );
20154
- }) })
20155
- ] })
20156
- ] });
20157
- }
19920
+ style: {
19921
+ flex: "0 0 auto",
19922
+ color: OHW_BLUE_DARK,
19923
+ fontSize: 10,
19924
+ fontWeight: 700,
19925
+ textTransform: "uppercase",
19926
+ letterSpacing: 0.4
19927
+ },
19928
+ children: "Alt"
19929
+ }
19930
+ ),
19931
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
19932
+ "input",
19933
+ {
19934
+ type: "text",
19935
+ value: draft,
19936
+ onChange: (e) => setDraft(e.target.value),
19937
+ onBlur: () => {
19938
+ if (draft !== value) onCommit(draft);
19939
+ },
19940
+ onKeyDown: (e) => {
19941
+ if (e.key === "Enter") e.currentTarget.blur();
19942
+ if (e.key === "Escape") {
19943
+ setDraft(value);
19944
+ e.currentTarget.blur();
19945
+ }
19946
+ },
19947
+ placeholder: "Describe this image",
19948
+ "aria-label": "Image alt text",
19949
+ style: {
19950
+ flex: 1,
19951
+ minWidth: 0,
19952
+ border: "none",
19953
+ outline: "none",
19954
+ background: "transparent",
19955
+ fontSize: 12,
19956
+ lineHeight: "16px",
19957
+ fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
19958
+ color: "#1f2937"
19959
+ }
19960
+ }
19961
+ )
19962
+ ]
19963
+ }
19964
+ );
19965
+ }
20158
19966
  var VARIANTS = [
20159
19967
  { value: "logos", label: "Logos" },
20160
19968
  { value: "reel", label: "Reel" }
20161
19969
  ];
20162
19970
  var ALIGNS = [
20163
- { value: "left", label: "Align left", Icon: import_lucide_react9.AlignLeft },
20164
- { value: "center", label: "Align center", Icon: import_lucide_react9.AlignCenter },
20165
- { value: "right", label: "Align right", Icon: import_lucide_react9.AlignRight }
19971
+ { value: "left", label: "Left" },
19972
+ { value: "center", label: "Center" },
19973
+ { value: "right", label: "Right" }
20166
19974
  ];
20167
19975
  var HOVERS = [
20168
19976
  { value: "none", label: "None" },
@@ -20170,104 +19978,104 @@ var HOVERS = [
20170
19978
  { value: "zoom", label: "Zoom" },
20171
19979
  { value: "fade", label: "Fade" }
20172
19980
  ];
19981
+ var TREATMENTS = [
19982
+ { value: "color", label: "Color" },
19983
+ { value: "grayscale", label: "Grayscale" }
19984
+ ];
20173
19985
  var HTTP_URL_RE = /^https?:\/\/\S+$/i;
20174
- function LinkModal({
20175
- href,
20176
- linkTarget,
20177
- onClose,
20178
- onSave
20179
- }) {
20180
- const [draft, setDraft] = (0, import_react13.useState)(href);
20181
- const [newTab, setNewTab] = (0, import_react13.useState)(linkTarget !== "same-tab");
19986
+ function LinkInput({ value, onCommit }) {
19987
+ const [draft, setDraft] = (0, import_react13.useState)(value);
20182
19988
  const [invalid, setInvalid] = (0, import_react13.useState)(false);
20183
- const save = () => {
19989
+ (0, import_react13.useEffect)(() => {
19990
+ setDraft(value);
19991
+ setInvalid(false);
19992
+ }, [value]);
19993
+ const commit2 = () => {
20184
19994
  const next = draft.trim();
20185
- if (next && !HTTP_URL_RE.test(next)) {
20186
- setInvalid(true);
20187
- return;
20188
- }
20189
- onSave(next, newTab ? "new-tab" : "same-tab");
20190
- onClose();
19995
+ if (next === value) return setInvalid(false);
19996
+ if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
19997
+ setInvalid(false);
19998
+ onCommit(next);
20191
19999
  };
20192
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Dialog2, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogContent, { "data-ohw-link-modal-root": "", className: "max-w-[400px] gap-4 p-5", children: [
20193
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTitle, { className: "text-base", children: "Image link" }) }),
20194
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col gap-3", children: [
20195
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20196
- "input",
20197
- {
20198
- autoFocus: true,
20199
- type: "text",
20200
- inputMode: "url",
20201
- value: draft,
20202
- onChange: (e) => {
20203
- setDraft(e.target.value);
20204
- setInvalid(false);
20205
- },
20206
- onKeyDown: (e) => {
20207
- if (e.key === "Enter") save();
20208
- },
20209
- placeholder: "https://example.com",
20210
- "aria-label": "Image link URL",
20211
- "aria-invalid": invalid,
20212
- className: cn(
20213
- "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",
20214
- invalid && "border-destructive focus:border-destructive"
20215
- )
20216
- }
20217
- ),
20218
- invalid && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: "Enter a full URL starting with http:// or https://" }),
20219
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "flex items-center gap-2 text-[13px] text-foreground", children: [
20220
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "checkbox", checked: newTab, onChange: (e) => setNewTab(e.target.checked) }),
20221
- "Open in new tab"
20222
- ] })
20223
- ] }),
20224
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogFooter, { children: [
20225
- href && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20226
- "button",
20227
- {
20228
- type: "button",
20229
- onClick: () => {
20230
- onSave("", "new-tab");
20231
- onClose();
20232
- },
20233
- className: "mr-auto rounded-[6px] px-3 py-2 text-[13px] font-medium text-destructive transition-colors hover:bg-muted",
20234
- children: "Remove link"
20235
- }
20236
- ),
20237
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20238
- "button",
20239
- {
20240
- type: "button",
20241
- onClick: onClose,
20242
- className: "rounded-[6px] px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted",
20243
- children: "Cancel"
20244
- }
20245
- ),
20246
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20247
- "button",
20248
- {
20249
- type: "button",
20250
- onClick: save,
20251
- className: "rounded-[6px] bg-bridge-primary px-3 py-2 text-[13px] font-medium text-primary-foreground transition-opacity hover:opacity-90",
20252
- children: "Save"
20253
- }
20254
- )
20255
- ] })
20256
- ] }) });
20000
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
20001
+ "div",
20002
+ {
20003
+ style: {
20004
+ display: "flex",
20005
+ alignItems: "center",
20006
+ gap: 6,
20007
+ height: 28,
20008
+ padding: "0 12px",
20009
+ borderRadius: 999,
20010
+ background: "#ffffff",
20011
+ width: "100%",
20012
+ maxWidth: 260,
20013
+ boxSizing: "border-box",
20014
+ boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
20015
+ },
20016
+ children: [
20017
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
20018
+ "span",
20019
+ {
20020
+ style: {
20021
+ flex: "0 0 auto",
20022
+ color: OHW_BLUE_DARK,
20023
+ fontSize: 10,
20024
+ fontWeight: 700,
20025
+ textTransform: "uppercase",
20026
+ letterSpacing: 0.4
20027
+ },
20028
+ children: "Link"
20029
+ }
20030
+ ),
20031
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
20032
+ "input",
20033
+ {
20034
+ type: "text",
20035
+ inputMode: "url",
20036
+ value: draft,
20037
+ onChange: (e) => setDraft(e.target.value),
20038
+ onBlur: commit2,
20039
+ onKeyDown: (e) => {
20040
+ if (e.key === "Enter") e.currentTarget.blur();
20041
+ if (e.key === "Escape") {
20042
+ setDraft(value);
20043
+ setInvalid(false);
20044
+ e.currentTarget.blur();
20045
+ }
20046
+ },
20047
+ placeholder: "https://example.com",
20048
+ "aria-label": "Image link URL",
20049
+ "aria-invalid": invalid,
20050
+ style: {
20051
+ flex: 1,
20052
+ minWidth: 0,
20053
+ border: "none",
20054
+ outline: "none",
20055
+ background: "transparent",
20056
+ fontSize: 12,
20057
+ lineHeight: "16px",
20058
+ fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
20059
+ color: "#1f2937"
20060
+ }
20061
+ }
20062
+ )
20063
+ ]
20064
+ }
20065
+ );
20257
20066
  }
20258
20067
  function MediaStripToolbar({
20259
20068
  entry,
20260
20069
  index,
20261
20070
  pending,
20262
20071
  error,
20263
- itemEditOn,
20264
- onToggleItemEdit,
20265
20072
  onSetVariant,
20266
20073
  onSetAlign,
20267
20074
  onSetHover,
20268
20075
  onSetTreatment,
20269
20076
  onResize,
20270
- onOpenLink,
20077
+ onSetAlt,
20078
+ onSetLink,
20271
20079
  onAddItem,
20272
20080
  onRemoveItem,
20273
20081
  onChangeImage,
@@ -20276,102 +20084,81 @@ function MediaStripToolbar({
20276
20084
  }) {
20277
20085
  const items = mediaStripItems(entry.tree);
20278
20086
  const itemCount = items.length;
20087
+ const currentAlt = items[index]?.alt ?? "";
20088
+ const currentHref2 = items[index]?.href ?? "";
20089
+ const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
20279
20090
  const slots = findMediaStripSlots(entry.tree);
20280
20091
  const variant = slots?.variant === "reel" ? "reel" : "logos";
20281
20092
  const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
20282
20093
  const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
20283
20094
  const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
20284
20095
  const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
20285
- const mobile = window.innerWidth <= 480;
20286
- const gatedLabel = (label) => itemEditOn ? label : "Turn on the star to edit this image";
20287
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20096
+ const isMobile = window.innerWidth <= 480;
20097
+ const rowStyle = isMobile ? {
20098
+ display: "flex",
20099
+ gap: 6,
20100
+ flexWrap: "nowrap",
20101
+ justifyContent: "center",
20102
+ overflowX: "auto",
20103
+ WebkitOverflowScrolling: "touch",
20104
+ width: "100%",
20105
+ scrollbarWidth: "none"
20106
+ } : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
20107
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
20288
20108
  "div",
20289
20109
  {
20290
20110
  "data-ohw-bridge": "",
20291
20111
  "data-ohw-toolbar": "",
20292
20112
  onMouseDown: (e) => e.stopPropagation(),
20293
- className: cn("flex flex-col items-center gap-1.5 font-sans", pending && "pointer-events-none opacity-60"),
20294
- style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
20113
+ style: {
20114
+ display: "flex",
20115
+ flexDirection: "column",
20116
+ gap: 6,
20117
+ alignItems: "center",
20118
+ background: OHW_BLUE,
20119
+ padding: 8,
20120
+ borderRadius: 12,
20121
+ boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
20122
+ pointerEvents: pending ? "none" : "auto",
20123
+ opacity: pending ? 0.6 : 1,
20124
+ maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
20125
+ },
20295
20126
  children: [
20296
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20297
- "div",
20298
- {
20299
- className: cn(
20300
- "flex items-center gap-1 rounded-[10px] border border-border bg-background p-1 whitespace-nowrap",
20301
- "shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.1),0px_4px_6px_-4px_rgba(0,0,0,0.1)]",
20302
- mobile ? "flex-wrap justify-center" : "flex-nowrap"
20303
- ),
20304
- children: [
20305
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
20306
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20307
- CustomToolbarButton,
20308
- {
20309
- type: "button",
20310
- "aria-label": itemEditOn ? "Done editing this image" : "Edit this image",
20311
- "aria-pressed": itemEditOn,
20312
- onClick: onToggleItemEdit,
20313
- className: "group size-8",
20314
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20315
- import_lucide_react9.Star,
20316
- {
20317
- size: 16,
20318
- fill: "currentColor",
20319
- strokeWidth: 0,
20320
- className: cn(
20321
- "transition-colors",
20322
- itemEditOn ? "text-[#f59e0b] group-hover:text-[#d97706]" : "text-[#d6d3d1] group-hover:text-[#fbbf24]"
20323
- ),
20324
- style: { pointerEvents: "none" }
20325
- }
20326
- )
20327
- }
20328
- ) }),
20329
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
20330
- ] }),
20331
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20332
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Image, { size: 16, style: { pointerEvents: "none" } }) }),
20333
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Link, { size: 16, style: { pointerEvents: "none" } }) }),
20334
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowLeft, { size: 16, style: { pointerEvents: "none" } }) }),
20335
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20336
- ToolbarAction,
20337
- {
20338
- label: gatedLabel("Move right"),
20339
- onClick: onMoveRight,
20340
- disabled: !itemEditOn || index >= itemCount - 1,
20341
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
20342
- }
20343
- ),
20344
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
20345
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20346
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
20347
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
20348
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20349
- ToolbarAction,
20350
- {
20351
- label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
20352
- active: treatment === "grayscale",
20353
- onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
20354
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
20355
- }
20356
- ),
20357
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20358
- ALIGNS.map(({ value, label, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label, active: align === value, onClick: () => onSetAlign(value), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { size: 16, style: { pointerEvents: "none" } }) }, value)),
20359
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20360
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 16, style: { pointerEvents: "none" } }) }),
20361
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
20362
- sizeValue,
20363
- "px"
20364
- ] }),
20365
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
20366
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20367
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
20368
- ]
20369
- }
20370
- ),
20371
- error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
20127
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
20128
+ VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
20129
+ ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
20130
+ ] }),
20131
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
20132
+ HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
20133
+ TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
20134
+ ] }),
20135
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
20136
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
20137
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
20138
+ sizeValue,
20139
+ "px"
20140
+ ] }),
20141
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
20142
+ ] }),
20143
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
20144
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
20145
+ currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
20146
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
20147
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
20148
+ ] }),
20149
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
20150
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
20151
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
20152
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
20153
+ ] }),
20154
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
20155
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
20156
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
20157
+ ] }),
20158
+ error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
20372
20159
  ]
20373
20160
  }
20374
- ) });
20161
+ );
20375
20162
  }
20376
20163
  function findMediaStripSlots(tree) {
20377
20164
  const stack = tree.rows.flatMap((row) => row.blocks);
@@ -20390,23 +20177,31 @@ function AiMediaStripOverlay({
20390
20177
  }) {
20391
20178
  const [hover, setHover] = (0, import_react13.useState)(null);
20392
20179
  const [active, setActive] = (0, import_react13.useState)(null);
20393
- const [itemEditOn, setItemEditOn] = (0, import_react13.useState)(false);
20394
- const [linkOpen, setLinkOpen] = (0, import_react13.useState)(false);
20395
20180
  const [pending, setPending] = (0, import_react13.useState)(false);
20396
20181
  const [error, setError] = (0, import_react13.useState)(null);
20397
20182
  const activeRef = (0, import_react13.useRef)(null);
20398
20183
  activeRef.current = active;
20399
- const linkOpenRef = (0, import_react13.useRef)(false);
20400
- linkOpenRef.current = linkOpen;
20401
20184
  (0, import_react13.useEffect)(() => {
20402
20185
  const onMove = (e) => {
20403
- const ref = itemRefFromTarget(e.target);
20404
20186
  const t = e.target;
20405
- const overEditable = Boolean(t?.closest?.("[data-ohw-editable]"));
20406
- setHover((prev) => {
20407
- const next = ref && !overEditable ? ref : null;
20408
- return sameRef(prev, next) ? prev : next;
20409
- });
20187
+ if (!(t instanceof HTMLElement)) return;
20188
+ 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]")) {
20189
+ return;
20190
+ }
20191
+ const itemEl = t.closest("[data-ohw-media-strip-item]");
20192
+ if (!itemEl) {
20193
+ setHover(null);
20194
+ return;
20195
+ }
20196
+ const sectionEl2 = itemEl.closest("[data-ohw-section]");
20197
+ const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
20198
+ const sectionId = unit ? instanceIdOf(unit) || null : null;
20199
+ const index = Number(itemEl.dataset.ohwMediaStripIndex);
20200
+ if (!sectionId || Number.isNaN(index)) {
20201
+ setHover(null);
20202
+ return;
20203
+ }
20204
+ setHover({ sectionId, index });
20410
20205
  };
20411
20206
  const onLeave = () => setHover(null);
20412
20207
  document.addEventListener("mousemove", onMove, { passive: true });
@@ -20418,25 +20213,23 @@ function AiMediaStripOverlay({
20418
20213
  }, []);
20419
20214
  (0, import_react13.useEffect)(() => {
20420
20215
  const onClick = (e) => {
20216
+ const current = activeRef.current;
20217
+ if (!current) return;
20421
20218
  const t = e.target;
20422
- if (!(t instanceof Element)) return;
20423
- if (t.closest(CHROME_SELECTOR)) return;
20424
- const ref = itemRefFromTarget(t);
20425
- if (sameRef(activeRef.current, ref)) return;
20426
- if (ref) clearInteractionChromeRef.current();
20427
- setItemEditOn(false);
20219
+ if (!(t instanceof HTMLElement)) return;
20220
+ if (t.closest("[data-ohw-item-interaction]")) return;
20221
+ const itemEl = findMediaStripItemElement(current.sectionId, current.index);
20222
+ if (itemEl && itemEl.contains(t)) return;
20223
+ setActive(null);
20428
20224
  setError(null);
20429
- setActive(ref);
20430
20225
  };
20431
20226
  document.addEventListener("click", onClick, true);
20432
20227
  return () => document.removeEventListener("click", onClick, true);
20433
- }, [clearInteractionChromeRef]);
20228
+ }, []);
20434
20229
  (0, import_react13.useEffect)(() => {
20435
20230
  const onBlur = () => {
20436
20231
  if (!activeRef.current) return;
20437
20232
  setActive(null);
20438
- setItemEditOn(false);
20439
- setLinkOpen(false);
20440
20233
  setError(null);
20441
20234
  };
20442
20235
  window.addEventListener("blur", onBlur);
@@ -20446,10 +20239,7 @@ function AiMediaStripOverlay({
20446
20239
  const onKeyDown = (e) => {
20447
20240
  if (e.key !== "Escape") return;
20448
20241
  if (!activeRef.current) return;
20449
- if (linkOpenRef.current) return;
20450
- if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
20451
20242
  setActive(null);
20452
- setItemEditOn(false);
20453
20243
  setError(null);
20454
20244
  };
20455
20245
  document.addEventListener("keydown", onKeyDown);
@@ -20483,133 +20273,137 @@ function AiMediaStripOverlay({
20483
20273
  tree: nextTree,
20484
20274
  label: entry.label,
20485
20275
  media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
20486
- ...entry.brand ? { brand: entry.brand } : {},
20487
- // The user is already looking at the strip they just edited — recentering the viewport
20488
- // on every edit reads as the section jumping around.
20489
- skipScrollIntoView: true
20276
+ ...entry.brand ? { brand: entry.brand } : {}
20490
20277
  });
20491
20278
  return true;
20492
20279
  },
20493
20280
  [findEntry, postToParent2, applyTreeLocalRef]
20494
20281
  );
20495
20282
  const activeEntry = active ? findEntry(active.sectionId) : null;
20283
+ const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
20496
20284
  const activeItemRect = useLiveItemRect(active);
20497
- const activeStripRect = useLiveItemRect(active, true);
20498
- const hoverRect = useLiveItemRect(hover && !sameRef(hover, active) ? hover : null);
20499
- const activeItems = activeEntry ? mediaStripItems(activeEntry.tree) : [];
20500
- const activeItem = active ? activeItems[active.index] : void 0;
20501
- const activeHref = activeItem?.href ?? "";
20502
- const activeTarget = activeItem?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
20503
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
20504
- hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
20505
- activeItemRect && activeStripRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
20506
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeItemRect, state: "active-top" }),
20507
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StripToolbarSlot, { stripRect: activeStripRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20508
- MediaStripToolbar,
20509
- {
20510
- entry: activeEntry,
20511
- index: active.index,
20512
- pending,
20513
- error,
20514
- itemEditOn,
20515
- onToggleItemEdit: () => setItemEditOn((on) => !on),
20516
- onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
20517
- onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
20518
- onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
20519
- onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
20520
- onResize: (delta) => {
20521
- const slots = findMediaStripSlots(activeEntry.tree);
20522
- const variant = slots?.variant === "reel" ? "reel" : "logos";
20523
- const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
20524
- void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
20525
- },
20526
- onOpenLink: () => setLinkOpen(true),
20527
- onAddItem: () => {
20528
- void requestAssetPick(postToParent2).then((picked) => {
20529
- if (!picked) return;
20530
- const item = { assetId: picked.assetId, alt: "Logo" };
20285
+ const TOOLBAR_APPROX_H = 170;
20286
+ const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
20287
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
20288
+ hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
20289
+ "button",
20290
+ {
20291
+ type: "button",
20292
+ "data-ohw-toolbar": "",
20293
+ onClick: () => {
20294
+ clearInteractionChromeRef.current();
20295
+ setActive(hover);
20296
+ },
20297
+ "aria-label": "Configure media item",
20298
+ style: {
20299
+ position: "fixed",
20300
+ top: hoverHandleRect.top + 8,
20301
+ left: hoverHandleRect.left + hoverHandleRect.width - 36,
20302
+ width: 28,
20303
+ height: 28,
20304
+ borderRadius: 8,
20305
+ border: `1.5px dashed ${PRIMARY3}`,
20306
+ background: "#ffffff",
20307
+ color: PRIMARY3,
20308
+ display: "flex",
20309
+ alignItems: "center",
20310
+ justifyContent: "center",
20311
+ cursor: "pointer",
20312
+ zIndex: 2147483643,
20313
+ fontSize: 14,
20314
+ fontWeight: 700
20315
+ },
20316
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
20317
+ }
20318
+ ),
20319
+ activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
20320
+ ItemInteractionLayer,
20321
+ {
20322
+ rect: activeItemRect,
20323
+ state: toolbarState,
20324
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
20325
+ MediaStripToolbar,
20326
+ {
20327
+ entry: activeEntry,
20328
+ index: active.index,
20329
+ pending,
20330
+ error,
20331
+ onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
20332
+ onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
20333
+ onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
20334
+ onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
20335
+ onResize: (delta) => {
20336
+ const slots = findMediaStripSlots(activeEntry.tree);
20337
+ const variant = slots?.variant === "reel" ? "reel" : "logos";
20338
+ const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
20339
+ void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
20340
+ },
20341
+ onSetAlt: (alt) => {
20342
+ void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
20343
+ },
20344
+ onSetLink: (href, linkTarget) => {
20531
20345
  void runMutation(
20532
20346
  active.sectionId,
20533
- (tree) => addMediaStripItem(tree, item, active.index),
20534
- { [picked.assetId]: picked.url }
20535
- ).then((applied) => {
20536
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
20347
+ (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
20348
+ );
20349
+ },
20350
+ onAddItem: () => {
20351
+ void requestAssetPick(postToParent2).then((picked) => {
20352
+ if (!picked) return;
20353
+ const item = { assetId: picked.assetId, alt: "Logo" };
20354
+ void runMutation(
20355
+ active.sectionId,
20356
+ (tree) => addMediaStripItem(tree, item, active.index),
20357
+ { [picked.assetId]: picked.url }
20358
+ ).then((applied) => {
20359
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
20360
+ });
20537
20361
  });
20538
- });
20539
- },
20540
- onChangeImage: () => {
20541
- void requestAssetPick(postToParent2).then((picked) => {
20542
- if (!picked) return;
20543
- void runMutation(
20544
- active.sectionId,
20545
- (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
20546
- { [picked.assetId]: picked.url }
20362
+ },
20363
+ onChangeImage: () => {
20364
+ void requestAssetPick(postToParent2).then((picked) => {
20365
+ if (!picked) return;
20366
+ void runMutation(
20367
+ active.sectionId,
20368
+ (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
20369
+ { [picked.assetId]: picked.url }
20370
+ );
20371
+ });
20372
+ },
20373
+ onRemoveItem: () => {
20374
+ void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
20375
+ (applied) => {
20376
+ if (applied) setActive(null);
20377
+ }
20547
20378
  );
20548
- });
20549
- },
20550
- onRemoveItem: () => {
20551
- void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
20552
- (applied) => {
20553
- if (applied) setActive(null);
20554
- }
20555
- );
20556
- },
20557
- onMoveLeft: () => {
20558
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
20559
- (applied) => {
20560
- if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
20561
- }
20562
- );
20563
- },
20564
- onMoveRight: () => {
20565
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
20566
- (applied) => {
20567
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
20568
- }
20569
- );
20570
- }
20571
- }
20572
- ) }),
20573
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20574
- "div",
20575
- {
20576
- "data-ohw-bridge": "",
20577
- "data-ohw-item-interaction": "",
20578
- "aria-hidden": true,
20579
- className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
20580
- style: {
20581
- top: activeItemRect.top + activeItemRect.height + 10,
20582
- left: activeItemRect.left - 5,
20583
- background: PRIMARY3,
20584
- zIndex: 2147483644
20585
- },
20586
- children: "Media item"
20587
- }
20588
- ),
20589
- linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20590
- LinkModal,
20591
- {
20592
- href: activeHref,
20593
- linkTarget: activeTarget,
20594
- onClose: () => setLinkOpen(false),
20595
- onSave: (href, linkTarget) => {
20596
- void runMutation(
20597
- active.sectionId,
20598
- (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
20599
- );
20600
- }
20601
- }
20602
- )
20603
- ] })
20379
+ },
20380
+ onMoveLeft: () => {
20381
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
20382
+ (applied) => {
20383
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
20384
+ }
20385
+ );
20386
+ },
20387
+ onMoveRight: () => {
20388
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
20389
+ (applied) => {
20390
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
20391
+ }
20392
+ );
20393
+ }
20394
+ }
20395
+ )
20396
+ }
20397
+ )
20604
20398
  ] });
20605
20399
  }
20606
20400
 
20607
20401
  // src/ui/ai-section/AiPricingCardOverlay.tsx
20608
20402
  var import_react14 = require("react");
20609
- var import_lucide_react10 = require("lucide-react");
20610
- var import_jsx_runtime22 = require("react/jsx-runtime");
20403
+ var import_lucide_react9 = require("lucide-react");
20404
+ var import_jsx_runtime21 = require("react/jsx-runtime");
20611
20405
  var PRIMARY4 = "var(--ohw-primary, #0885FE)";
20612
- 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]";
20406
+ 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]";
20613
20407
  function findPricingCardElement(sectionId, index) {
20614
20408
  const sectionEl2 = findByInstanceId(sectionId);
20615
20409
  if (!sectionEl2) return null;
@@ -20621,7 +20415,7 @@ function findPricingCardElement(sectionId, index) {
20621
20415
  }
20622
20416
  function cardRefFromTarget(target) {
20623
20417
  if (!(target instanceof Element)) return null;
20624
- if (target.closest(CHROME_SELECTOR2)) return null;
20418
+ if (target.closest(CHROME_SELECTOR)) return null;
20625
20419
  const cardEl = target.closest("[data-ohw-pricing-card]");
20626
20420
  if (!cardEl) return null;
20627
20421
  const sectionEl2 = cardEl.closest("[data-ohw-section]");
@@ -20631,21 +20425,21 @@ function cardRefFromTarget(target) {
20631
20425
  if (!sectionId || Number.isNaN(index)) return null;
20632
20426
  return { sectionId, index };
20633
20427
  }
20634
- function sameRef2(a, b) {
20428
+ function sameRef(a, b) {
20635
20429
  return a?.sectionId === b?.sectionId && a?.index === b?.index;
20636
20430
  }
20637
- function rectOf2(el) {
20431
+ function rectOf(el) {
20638
20432
  if (!el) return null;
20639
20433
  const r2 = el.getBoundingClientRect();
20640
20434
  if (r2.width <= 0 || r2.height <= 0) return null;
20641
20435
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
20642
20436
  }
20643
20437
  function readRect3(ref) {
20644
- return rectOf2(ref && findPricingCardElement(ref.sectionId, ref.index));
20438
+ return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
20645
20439
  }
20646
20440
  function readGridRect(ref) {
20647
20441
  const card = ref && findPricingCardElement(ref.sectionId, ref.index);
20648
- return rectOf2(card?.closest("[data-ohw-pricing-collection]") ?? card);
20442
+ return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
20649
20443
  }
20650
20444
  function useLiveCardRect(ref, grid = false) {
20651
20445
  const [rect, setRect] = (0, import_react14.useState)(null);
@@ -20675,7 +20469,7 @@ function useLiveCardRect(ref, grid = false) {
20675
20469
  }
20676
20470
  var TOOLBAR_GRID_GAP = 52;
20677
20471
  var TOOLBAR_GRID_GAP_MOBILE = 42;
20678
- var TOOLBAR_EDGE_MARGIN3 = 4;
20472
+ var TOOLBAR_EDGE_MARGIN2 = 4;
20679
20473
  function GridToolbarSlot({ gridRect, children }) {
20680
20474
  const slotRef = (0, import_react14.useRef)(null);
20681
20475
  const [shift, setShift] = (0, import_react14.useState)(0);
@@ -20687,7 +20481,7 @@ function GridToolbarSlot({ gridRect, children }) {
20687
20481
  const w = slot.offsetWidth;
20688
20482
  if (w <= 0) return;
20689
20483
  const half = w / 2;
20690
- const clamped = Math.max(TOOLBAR_EDGE_MARGIN3 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half));
20484
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
20691
20485
  setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
20692
20486
  };
20693
20487
  clamp();
@@ -20696,7 +20490,7 @@ function GridToolbarSlot({ gridRect, children }) {
20696
20490
  return () => ro.disconnect();
20697
20491
  }, [centerX, children]);
20698
20492
  const mobile = window.innerWidth <= 480;
20699
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
20493
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20700
20494
  "div",
20701
20495
  {
20702
20496
  ref: slotRef,
@@ -20731,7 +20525,7 @@ function requestValidateTree2(postToParent2, tree) {
20731
20525
  });
20732
20526
  }
20733
20527
  function StyleSwatch({ style }) {
20734
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
20528
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20735
20529
  "span",
20736
20530
  {
20737
20531
  "aria-hidden": true,
@@ -20745,35 +20539,35 @@ function StyleSwatch({ style }) {
20745
20539
  );
20746
20540
  }
20747
20541
  function ButtonGlyph() {
20748
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
20749
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
20750
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
20542
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
20543
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
20544
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
20751
20545
  ] });
20752
20546
  }
20753
20547
  function FeatureGlyph({ mode }) {
20754
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
20755
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
20756
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
20757
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
20758
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
20759
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
20760
- mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
20548
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
20549
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
20550
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
20551
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
20552
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
20553
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
20554
+ mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
20761
20555
  ] });
20762
20556
  }
20763
- function ToolbarAction2({
20557
+ function ToolbarAction({
20764
20558
  label,
20765
20559
  onClick,
20766
20560
  disabled = false,
20767
20561
  children
20768
20562
  }) {
20769
- const button = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
20770
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
20771
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "inline-flex", children: button }) : button }),
20772
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
20563
+ const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
20564
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
20565
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
20566
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
20773
20567
  ] });
20774
20568
  }
20775
- function ToolbarSeparator2() {
20776
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
20569
+ function ToolbarSeparator() {
20570
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
20777
20571
  }
20778
20572
  function CardStyleMenu({
20779
20573
  value,
@@ -20781,7 +20575,7 @@ function CardStyleMenu({
20781
20575
  disabled = false
20782
20576
  }) {
20783
20577
  const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
20784
- const trigger = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
20578
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20785
20579
  "button",
20786
20580
  {
20787
20581
  type: "button",
@@ -20792,28 +20586,28 @@ function CardStyleMenu({
20792
20586
  disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
20793
20587
  ),
20794
20588
  children: [
20795
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StyleSwatch, { style: current.value }),
20796
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-1 text-left", children: current.label }),
20797
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
20589
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
20590
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
20591
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
20798
20592
  ]
20799
20593
  }
20800
20594
  );
20801
20595
  if (disabled) {
20802
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
20803
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
20804
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
20805
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "inline-flex", children: trigger }) }),
20806
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
20596
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
20597
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
20598
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
20599
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
20600
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
20807
20601
  ] })
20808
20602
  ] });
20809
20603
  }
20810
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
20811
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
20812
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu, { modal: false, children: [
20813
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
20814
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
20604
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
20605
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
20606
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
20607
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
20608
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
20815
20609
  const selected = style.value === value;
20816
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
20610
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20817
20611
  DropdownMenuItem,
20818
20612
  {
20819
20613
  role: "menuitemradio",
@@ -20821,9 +20615,9 @@ function CardStyleMenu({
20821
20615
  onSelect: () => onChange(style.value),
20822
20616
  className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
20823
20617
  children: [
20824
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StyleSwatch, { style: style.value }),
20825
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: style.label }),
20826
- selected && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Check, { size: 16, className: "text-bridge-primary" })
20618
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
20619
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
20620
+ selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
20827
20621
  ]
20828
20622
  },
20829
20623
  style.value
@@ -20853,7 +20647,7 @@ function PricingCardToolbar({
20853
20647
  const style = pricingCardStyle(entry.tree, index);
20854
20648
  const featuredTag = pricingCardFeaturedTag(entry.tree, index);
20855
20649
  const mobile = window.innerWidth <= 480;
20856
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
20650
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20857
20651
  "div",
20858
20652
  {
20859
20653
  "data-ohw-bridge": "",
@@ -20865,7 +20659,7 @@ function PricingCardToolbar({
20865
20659
  ),
20866
20660
  style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
20867
20661
  children: [
20868
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
20662
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
20869
20663
  "div",
20870
20664
  {
20871
20665
  className: cn(
@@ -20874,8 +20668,8 @@ function PricingCardToolbar({
20874
20668
  mobile ? "flex-wrap justify-center" : "flex-nowrap"
20875
20669
  ),
20876
20670
  children: [
20877
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
20878
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
20671
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
20672
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20879
20673
  CustomToolbarButton,
20880
20674
  {
20881
20675
  type: "button",
@@ -20883,8 +20677,8 @@ function PricingCardToolbar({
20883
20677
  "aria-pressed": featuredTag,
20884
20678
  onClick: () => onSetFeaturedTag(!featuredTag),
20885
20679
  className: "group size-8",
20886
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
20887
- import_lucide_react10.Star,
20680
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
20681
+ import_lucide_react9.Star,
20888
20682
  {
20889
20683
  size: 16,
20890
20684
  fill: "currentColor",
@@ -20898,25 +20692,25 @@ function PricingCardToolbar({
20898
20692
  )
20899
20693
  }
20900
20694
  ) }),
20901
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
20695
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
20902
20696
  ] }),
20903
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarSeparator2, {}),
20904
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
20905
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarSeparator2, {}),
20906
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ButtonGlyph, {}) }),
20907
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "relative inline-flex", children: [
20908
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ButtonGlyph, {}),
20909
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
20697
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20698
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
20699
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20700
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
20701
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "relative inline-flex", children: [
20702
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
20703
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
20910
20704
  ] }) }),
20911
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FeatureGlyph, { mode: "add" }) }),
20912
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FeatureGlyph, { mode: "remove" }) }),
20913
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarSeparator2, {}),
20914
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
20915
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Minus, { size: 16, style: { pointerEvents: "none" } }) })
20705
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeatureGlyph, { mode: "add" }) }),
20706
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeatureGlyph, { mode: "remove" }) }),
20707
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
20708
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
20709
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 16, style: { pointerEvents: "none" } }) })
20916
20710
  ]
20917
20711
  }
20918
20712
  ),
20919
- error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
20713
+ error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
20920
20714
  ]
20921
20715
  }
20922
20716
  ) });
@@ -20950,7 +20744,7 @@ function AiPricingCardOverlay({
20950
20744
  const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
20951
20745
  setHover((prev) => {
20952
20746
  const next = ref && !overEditable ? ref : null;
20953
- return sameRef2(prev, next) ? prev : next;
20747
+ return sameRef(prev, next) ? prev : next;
20954
20748
  });
20955
20749
  };
20956
20750
  const onLeave = () => setHover(null);
@@ -20965,10 +20759,10 @@ function AiPricingCardOverlay({
20965
20759
  const onClick = (e) => {
20966
20760
  const t = e.target;
20967
20761
  if (!(t instanceof Element)) return;
20968
- if (t.closest(CHROME_SELECTOR2)) return;
20762
+ if (t.closest(CHROME_SELECTOR)) return;
20969
20763
  const ref = cardRefFromTarget(t);
20970
- setActive((prev) => sameRef2(prev, ref) ? prev : ref);
20971
- if (!ref || !sameRef2(activeRef.current, ref)) setError(null);
20764
+ setActive((prev) => sameRef(prev, ref) ? prev : ref);
20765
+ if (!ref || !sameRef(activeRef.current, ref)) setError(null);
20972
20766
  };
20973
20767
  document.addEventListener("click", onClick, true);
20974
20768
  return () => document.removeEventListener("click", onClick, true);
@@ -21033,12 +20827,12 @@ function AiPricingCardOverlay({
21033
20827
  const activeEntry = active ? findEntry(active.sectionId) : null;
21034
20828
  const activeCardRect = useLiveCardRect(active);
21035
20829
  const activeGridRect = useLiveCardRect(active, true);
21036
- const hoverRect = useLiveCardRect(hover && !sameRef2(hover, active) ? hover : null);
21037
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
21038
- hoverRect && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
21039
- activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
21040
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
21041
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
20830
+ const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
20831
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
20832
+ hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
20833
+ activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
20834
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
20835
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21042
20836
  PricingCardToolbar,
21043
20837
  {
21044
20838
  entry: activeEntry,
@@ -21066,7 +20860,7 @@ function AiPricingCardOverlay({
21066
20860
  onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
21067
20861
  }
21068
20862
  ) }),
21069
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
20863
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21070
20864
  "div",
21071
20865
  {
21072
20866
  "data-ohw-bridge": "",
@@ -21088,7 +20882,7 @@ function AiPricingCardOverlay({
21088
20882
 
21089
20883
  // src/ui/ai-section/AiVideoOverlay.tsx
21090
20884
  var import_react15 = require("react");
21091
- var import_lucide_react11 = require("lucide-react");
20885
+ var import_lucide_react10 = require("lucide-react");
21092
20886
 
21093
20887
  // src/lib/ai-video-tree.ts
21094
20888
  function resolveVideoBlock(tree, path) {
@@ -21131,10 +20925,10 @@ function clearVideo(tree, path) {
21131
20925
  }
21132
20926
 
21133
20927
  // src/ui/ai-section/AiVideoOverlay.tsx
21134
- var import_jsx_runtime23 = require("react/jsx-runtime");
20928
+ var import_jsx_runtime22 = require("react/jsx-runtime");
21135
20929
  var PRIMARY5 = "#0885FE";
21136
- var OHW_BLUE = `var(--ohw-primary, ${PRIMARY5})`;
21137
- var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
20930
+ var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
20931
+ var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
21138
20932
  function findVideoBlockElement(sectionId, path) {
21139
20933
  const sectionEl2 = findByInstanceId(sectionId);
21140
20934
  if (!sectionEl2) return null;
@@ -21194,12 +20988,12 @@ function requestValidateTree3(postToParent2, tree) {
21194
20988
  postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
21195
20989
  });
21196
20990
  }
21197
- function Pill({
20991
+ function Pill2({
21198
20992
  label,
21199
20993
  onClick,
21200
20994
  disabled
21201
20995
  }) {
21202
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
20996
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21203
20997
  "button",
21204
20998
  {
21205
20999
  type: "button",
@@ -21215,7 +21009,7 @@ function Pill({
21215
21009
  border: "none",
21216
21010
  cursor: disabled ? "default" : "pointer",
21217
21011
  background: "#ffffff",
21218
- color: OHW_BLUE_DARK,
21012
+ color: OHW_BLUE_DARK2,
21219
21013
  opacity: disabled ? 0.4 : 1,
21220
21014
  fontSize: 12,
21221
21015
  lineHeight: "16px",
@@ -21258,8 +21052,8 @@ function VideoUrlInput({ value, onCommit }) {
21258
21052
  onCommit(id);
21259
21053
  }
21260
21054
  };
21261
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
21262
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
21055
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
21056
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21263
21057
  "div",
21264
21058
  {
21265
21059
  style: {
@@ -21275,12 +21069,12 @@ function VideoUrlInput({ value, onCommit }) {
21275
21069
  boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
21276
21070
  },
21277
21071
  children: [
21278
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21072
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21279
21073
  "span",
21280
21074
  {
21281
21075
  style: {
21282
21076
  flex: "0 0 auto",
21283
- color: OHW_BLUE_DARK,
21077
+ color: OHW_BLUE_DARK2,
21284
21078
  fontSize: 10,
21285
21079
  lineHeight: "16px",
21286
21080
  fontWeight: 700,
@@ -21290,7 +21084,7 @@ function VideoUrlInput({ value, onCommit }) {
21290
21084
  children: "Video"
21291
21085
  }
21292
21086
  ),
21293
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21087
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21294
21088
  "input",
21295
21089
  {
21296
21090
  type: "text",
@@ -21327,7 +21121,7 @@ function VideoUrlInput({ value, onCommit }) {
21327
21121
  ]
21328
21122
  }
21329
21123
  ),
21330
- invalid && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
21124
+ invalid && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
21331
21125
  ] });
21332
21126
  }
21333
21127
  function VideoToolbar({
@@ -21337,7 +21131,7 @@ function VideoToolbar({
21337
21131
  onSetVideoId,
21338
21132
  onRemove
21339
21133
  }) {
21340
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
21134
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21341
21135
  "div",
21342
21136
  {
21343
21137
  "data-ohw-bridge": "",
@@ -21349,7 +21143,7 @@ function VideoToolbar({
21349
21143
  gap: 6,
21350
21144
  alignItems: "center",
21351
21145
  width: 280,
21352
- background: OHW_BLUE,
21146
+ background: OHW_BLUE2,
21353
21147
  padding: 8,
21354
21148
  borderRadius: 12,
21355
21149
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -21357,9 +21151,9 @@ function VideoToolbar({
21357
21151
  opacity: pending ? 0.6 : 1
21358
21152
  },
21359
21153
  children: [
21360
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
21361
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
21362
- error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21154
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
21155
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
21156
+ error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21363
21157
  ]
21364
21158
  }
21365
21159
  );
@@ -21479,8 +21273,8 @@ function AiVideoOverlay({
21479
21273
  const activeBlockRect = useLiveBlockRect(active);
21480
21274
  const TOOLBAR_APPROX_H = 90;
21481
21275
  const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
21482
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
21483
- hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21276
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
21277
+ hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21484
21278
  "button",
21485
21279
  {
21486
21280
  type: "button",
@@ -21508,15 +21302,15 @@ function AiVideoOverlay({
21508
21302
  fontSize: 14,
21509
21303
  fontWeight: 700
21510
21304
  },
21511
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
21305
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
21512
21306
  }
21513
21307
  ),
21514
- activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21308
+ activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21515
21309
  ItemInteractionLayer,
21516
21310
  {
21517
21311
  rect: activeBlockRect,
21518
21312
  state: toolbarState,
21519
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21313
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21520
21314
  VideoToolbar,
21521
21315
  {
21522
21316
  videoId: videoIdAt(activeEntry.tree, active.path),
@@ -21540,7 +21334,7 @@ function AiVideoOverlay({
21540
21334
 
21541
21335
  // src/ui/ai-section/AiFadeCarouselOverlay.tsx
21542
21336
  var import_react16 = require("react");
21543
- var import_lucide_react12 = require("lucide-react");
21337
+ var import_lucide_react11 = require("lucide-react");
21544
21338
 
21545
21339
  // src/lib/ai-carousel-tree.ts
21546
21340
  function isCarouselBlock(node) {
@@ -21591,10 +21385,10 @@ function setCarouselAutoplay(tree, on) {
21591
21385
  }
21592
21386
 
21593
21387
  // src/ui/ai-section/AiFadeCarouselOverlay.tsx
21594
- var import_jsx_runtime24 = require("react/jsx-runtime");
21388
+ var import_jsx_runtime23 = require("react/jsx-runtime");
21595
21389
  var PRIMARY6 = "#0885FE";
21596
- var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY6})`;
21597
- var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
21390
+ var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
21391
+ var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
21598
21392
  function findCarouselItemElement(sectionId, index) {
21599
21393
  const sectionEl2 = findByInstanceId(sectionId);
21600
21394
  if (!sectionEl2) return null;
@@ -21673,8 +21467,8 @@ function requestAssetPick2(postToParent2) {
21673
21467
  postToParent2({ type: "ow:asset-pick", id });
21674
21468
  });
21675
21469
  }
21676
- function Pill2({ label, onClick, disabled }) {
21677
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21470
+ function Pill3({ label, onClick, disabled }) {
21471
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21678
21472
  "button",
21679
21473
  {
21680
21474
  type: "button",
@@ -21690,7 +21484,7 @@ function Pill2({ label, onClick, disabled }) {
21690
21484
  border: "none",
21691
21485
  cursor: disabled ? "default" : "pointer",
21692
21486
  background: "#ffffff",
21693
- color: OHW_BLUE_DARK2,
21487
+ color: OHW_BLUE_DARK3,
21694
21488
  opacity: disabled ? 0.4 : 1,
21695
21489
  fontSize: 12,
21696
21490
  lineHeight: "16px",
@@ -21708,7 +21502,7 @@ function TogglePill({
21708
21502
  onToggle,
21709
21503
  disabled
21710
21504
  }) {
21711
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
21505
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
21712
21506
  "button",
21713
21507
  {
21714
21508
  type: "button",
@@ -21727,7 +21521,7 @@ function TogglePill({
21727
21521
  border: "none",
21728
21522
  cursor: disabled ? "default" : "pointer",
21729
21523
  background: "#ffffff",
21730
- color: OHW_BLUE_DARK2,
21524
+ color: OHW_BLUE_DARK3,
21731
21525
  opacity: disabled ? 0.4 : 1,
21732
21526
  fontSize: 12,
21733
21527
  lineHeight: "16px",
@@ -21737,7 +21531,7 @@ function TogglePill({
21737
21531
  },
21738
21532
  children: [
21739
21533
  label,
21740
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21534
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21741
21535
  "span",
21742
21536
  {
21743
21537
  "aria-hidden": true,
@@ -21750,10 +21544,10 @@ function TogglePill({
21750
21544
  // Off is a grey track, not a washed-out blue: the pill's own white background already
21751
21545
  // carries the brand colour in the text, and a pale blue track next to it read as
21752
21546
  // "disabled control" rather than "switch that is off".
21753
- background: on ? OHW_BLUE_DARK2 : "#CBD5E1",
21547
+ background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
21754
21548
  transition: "background 120ms ease"
21755
21549
  },
21756
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21550
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21757
21551
  "span",
21758
21552
  {
21759
21553
  style: {
@@ -21782,7 +21576,7 @@ function CarouselSlideToolbar({
21782
21576
  onChangeImage,
21783
21577
  onToggleAutoplay
21784
21578
  }) {
21785
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
21579
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
21786
21580
  "div",
21787
21581
  {
21788
21582
  "data-ohw-bridge": "",
@@ -21793,7 +21587,7 @@ function CarouselSlideToolbar({
21793
21587
  flexDirection: "column",
21794
21588
  gap: 6,
21795
21589
  alignItems: "center",
21796
- background: OHW_BLUE2,
21590
+ background: OHW_BLUE3,
21797
21591
  padding: 8,
21798
21592
  borderRadius: 12,
21799
21593
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -21805,11 +21599,11 @@ function CarouselSlideToolbar({
21805
21599
  pointerEvents: pending ? "none" : "auto"
21806
21600
  },
21807
21601
  children: [
21808
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
21809
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pill2, { label: "Change Image", onClick: onChangeImage }),
21810
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
21602
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
21603
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
21604
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
21811
21605
  ] }),
21812
- error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21606
+ error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21813
21607
  ]
21814
21608
  }
21815
21609
  );
@@ -21949,8 +21743,8 @@ function AiFadeCarouselOverlay({
21949
21743
  const activeItemRect = useLiveItemRect2(active);
21950
21744
  const TOOLBAR_APPROX_H = 90;
21951
21745
  const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
21952
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
21953
- hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21746
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
21747
+ hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21954
21748
  "button",
21955
21749
  {
21956
21750
  type: "button",
@@ -21979,10 +21773,10 @@ function AiFadeCarouselOverlay({
21979
21773
  fontSize: 14,
21980
21774
  fontWeight: 700
21981
21775
  },
21982
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Star, { size: 14, style: { pointerEvents: "none" } })
21776
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
21983
21777
  }
21984
21778
  ),
21985
- swapping && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21779
+ swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21986
21780
  "div",
21987
21781
  {
21988
21782
  ref: skeletonRef,
@@ -22000,15 +21794,15 @@ function AiFadeCarouselOverlay({
22000
21794
  zIndex: 2147483646,
22001
21795
  pointerEvents: "none"
22002
21796
  },
22003
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("style", { children: MEDIA_SKELETON_CSS })
21797
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
22004
21798
  }
22005
21799
  ),
22006
- activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21800
+ activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22007
21801
  ItemInteractionLayer,
22008
21802
  {
22009
21803
  rect: activeItemRect,
22010
21804
  state: toolbarState,
22011
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21805
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22012
21806
  CarouselSlideToolbar,
22013
21807
  {
22014
21808
  pending,
@@ -22199,6 +21993,113 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
22199
21993
  // src/ui/link-modal/LinkPopover.tsx
22200
21994
  var import_react20 = require("react");
22201
21995
 
21996
+ // src/ui/dialog.tsx
21997
+ var React9 = __toESM(require("react"), 1);
21998
+ var import_radix_ui6 = require("radix-ui");
21999
+ var import_lucide_react12 = require("lucide-react");
22000
+ var import_jsx_runtime24 = require("react/jsx-runtime");
22001
+ function Dialog2({
22002
+ ...props
22003
+ }) {
22004
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
22005
+ }
22006
+ function DialogPortal({
22007
+ ...props
22008
+ }) {
22009
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
22010
+ }
22011
+ function DialogOverlay({
22012
+ className,
22013
+ ...props
22014
+ }) {
22015
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22016
+ import_radix_ui6.Dialog.Overlay,
22017
+ {
22018
+ "data-slot": "dialog-overlay",
22019
+ "data-ohw-link-modal-root": "",
22020
+ className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
22021
+ ...props
22022
+ }
22023
+ );
22024
+ }
22025
+ var DialogContent = React9.forwardRef(
22026
+ ({ className, children, showCloseButton = true, container, ...props }, ref) => {
22027
+ const positionMode = container ? "absolute" : "fixed";
22028
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
22029
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
22030
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
22031
+ import_radix_ui6.Dialog.Content,
22032
+ {
22033
+ ref,
22034
+ "data-slot": "dialog-content",
22035
+ className: cn(
22036
+ positionMode,
22037
+ "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",
22038
+ "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
22039
+ container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
22040
+ className
22041
+ ),
22042
+ onMouseDown: (e) => e.stopPropagation(),
22043
+ ...props,
22044
+ children: [
22045
+ children,
22046
+ showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22047
+ import_radix_ui6.Dialog.Close,
22048
+ {
22049
+ type: "button",
22050
+ className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
22051
+ "aria-label": "Close",
22052
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
22053
+ }
22054
+ ) : null
22055
+ ]
22056
+ }
22057
+ )
22058
+ ] });
22059
+ }
22060
+ );
22061
+ DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
22062
+ function DialogHeader({
22063
+ className,
22064
+ ...props
22065
+ }) {
22066
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
22067
+ }
22068
+ function DialogFooter({
22069
+ className,
22070
+ ...props
22071
+ }) {
22072
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22073
+ "div",
22074
+ {
22075
+ className: cn("flex items-center justify-end gap-2", className),
22076
+ ...props
22077
+ }
22078
+ );
22079
+ }
22080
+ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22081
+ import_radix_ui6.Dialog.Title,
22082
+ {
22083
+ ref,
22084
+ className: cn(
22085
+ "text-lg font-semibold leading-none tracking-tight text-card-foreground",
22086
+ className
22087
+ ),
22088
+ ...props
22089
+ }
22090
+ ));
22091
+ DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
22092
+ var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22093
+ import_radix_ui6.Dialog.Description,
22094
+ {
22095
+ ref,
22096
+ className: cn("text-sm text-muted-foreground", className),
22097
+ ...props
22098
+ }
22099
+ ));
22100
+ DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
22101
+ var DialogClose = import_radix_ui6.Dialog.Close;
22102
+
22202
22103
  // src/ui/link-modal/LinkEditorPanel.tsx
22203
22104
  var import_lucide_react16 = require("lucide-react");
22204
22105
 
@@ -23302,7 +23203,6 @@ function shouldUseDevFixtures() {
23302
23203
  function getLogoElement(el) {
23303
23204
  const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
23304
23205
  if (marked) return marked;
23305
- if (el.closest('[data-ohw-editable="icon"]')) return null;
23306
23206
  const root = el.closest("nav, [data-ohw-nav-root], footer");
23307
23207
  if (!root) return null;
23308
23208
  const anchor = el.closest("a");
@@ -26119,7 +26019,7 @@ function getNavigationSelectionParent(el) {
26119
26019
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
26120
26020
  return resolveFooterLinksContainerFrom(el);
26121
26021
  }
26122
- 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)) {
26022
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
26123
26023
  return getNavigationRoot(el);
26124
26024
  }
26125
26025
  return null;
@@ -26341,6 +26241,7 @@ var ICONS = {
26341
26241
  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"/>',
26342
26242
  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"/>'
26343
26243
  };
26244
+ var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
26344
26245
  var SELECTION_CHROME_GAP2 = 4;
26345
26246
  var TOOLBAR_STROKE_GAP2 = 4;
26346
26247
  var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
@@ -26438,7 +26339,7 @@ function applyVisibleViewport(el, parentScroll) {
26438
26339
  el.style.top = `${top}px`;
26439
26340
  el.style.height = `${height}px`;
26440
26341
  }
26441
- var TOOLBAR_EDGE_MARGIN4 = 4;
26342
+ var TOOLBAR_EDGE_MARGIN3 = 4;
26442
26343
  function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
26443
26344
  const isAbove = transform.includes("translateY(-100%)");
26444
26345
  let visualTop = isAbove ? top - approxH : top;
@@ -26465,8 +26366,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
26465
26366
  function clampToolbarLeft(centerX, toolbarWidth) {
26466
26367
  const half = toolbarWidth / 2;
26467
26368
  return Math.max(
26468
- TOOLBAR_EDGE_MARGIN4 + half,
26469
- Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN4 - half)
26369
+ TOOLBAR_EDGE_MARGIN3 + half,
26370
+ Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
26470
26371
  );
26471
26372
  }
26472
26373
  function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
@@ -27375,6 +27276,21 @@ function OhhwellsBridge() {
27375
27276
  const [isItemDragging, setIsItemDragging] = (0, import_react25.useState)(false);
27376
27277
  const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react25.useState)(false);
27377
27278
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
27279
+ const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
27280
+ const floatingPanelOpenRef = (0, import_react25.useRef)(false);
27281
+ floatingPanelOpenRef.current = floatingPanel !== null;
27282
+ const floatingPanelRef = (0, import_react25.useRef)(null);
27283
+ floatingPanelRef.current = floatingPanel;
27284
+ const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
27285
+ const buttonCollectionDragRef = (0, import_react25.useRef)(null);
27286
+ const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
27287
+ const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
27288
+ const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
27289
+ const buttonPointerDragRef = (0, import_react25.useRef)(null);
27290
+ const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
27291
+ const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
27292
+ const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
27293
+ const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
27378
27294
  const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react25.useState)(null);
27379
27295
  const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react25.useState)(null);
27380
27296
  const footerDragRef = (0, import_react25.useRef)(null);
@@ -27401,21 +27317,6 @@ function OhhwellsBridge() {
27401
27317
  const stylesRef = (0, import_react25.useRef)("");
27402
27318
  const appliedDrawerRef = (0, import_react25.useRef)(null);
27403
27319
  const pendingDeleteUndoRef = (0, import_react25.useRef)(null);
27404
- const [floatingPanel, setFloatingPanel] = (0, import_react25.useState)(null);
27405
- const floatingPanelOpenRef = (0, import_react25.useRef)(false);
27406
- const floatingPanelRef = (0, import_react25.useRef)(null);
27407
- floatingPanelRef.current = floatingPanel;
27408
- const setFloatingPanelRef = (0, import_react25.useRef)(setFloatingPanel);
27409
- const [floatingPanelPos, setFloatingPanelPos] = (0, import_react25.useState)(null);
27410
- const buttonCollectionDragRef = (0, import_react25.useRef)(null);
27411
- const buttonDropInsertIndexRef = (0, import_react25.useRef)(null);
27412
- const [buttonDropSlots, setButtonDropSlots] = (0, import_react25.useState)([]);
27413
- const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react25.useState)(null);
27414
- const buttonPointerDragRef = (0, import_react25.useRef)(null);
27415
- const [buttonStyleTick, setButtonStyleTick] = (0, import_react25.useState)(0);
27416
- const [logoSizeDraft, setLogoSizeDraft] = (0, import_react25.useState)(null);
27417
- const [editorViewport, setEditorViewport] = (0, import_react25.useState)("desktop");
27418
- const [parentScrollSnap, setParentScrollSnap] = (0, import_react25.useState)(null);
27419
27320
  const [sitePages, setSitePages] = (0, import_react25.useState)([]);
27420
27321
  const collectionItemsRef = (0, import_react25.useRef)(/* @__PURE__ */ new Map());
27421
27322
  const [sectionsByPath, setSectionsByPath] = (0, import_react25.useState)({});
@@ -27425,18 +27326,7 @@ function OhhwellsBridge() {
27425
27326
  const linkPopoverOpenRef = (0, import_react25.useRef)(false);
27426
27327
  const linkPopoverGraceUntilRef = (0, import_react25.useRef)(0);
27427
27328
  setLinkPopoverRef.current = setLinkPopover;
27428
- setFloatingPanelRef.current = setFloatingPanel;
27429
27329
  linkPopoverSessionRef.current = linkPopover;
27430
- floatingPanelOpenRef.current = Boolean(floatingPanel);
27431
- (0, import_react25.useEffect)(() => {
27432
- const syncViewport = () => {
27433
- const next = window.innerWidth <= 480 ? "mobile" : "desktop";
27434
- setEditorViewport((prev) => prev === next ? prev : next);
27435
- };
27436
- syncViewport();
27437
- window.addEventListener("resize", syncViewport);
27438
- return () => window.removeEventListener("resize", syncViewport);
27439
- }, []);
27440
27330
  (0, import_react25.useEffect)(() => {
27441
27331
  setSectionOrderPersistHandler((entries) => {
27442
27332
  const currentPath = window.location.pathname;
@@ -29179,7 +29069,6 @@ function OhhwellsBridge() {
29179
29069
  applyAiFooterFromContent(content);
29180
29070
  if (typeof content[STYLE_STORE_KEY] === "string") {
29181
29071
  stylesRef.current = content[STYLE_STORE_KEY];
29182
- document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
29183
29072
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
29184
29073
  }
29185
29074
  applyBrandChrome(content);
@@ -29190,12 +29079,12 @@ function OhhwellsBridge() {
29190
29079
  if (key === "__ohw_sections") continue;
29191
29080
  if (key === AI_SECTIONS_KEY) continue;
29192
29081
  if (key === AI_FOOTER_KEY) continue;
29193
- if (key === LOGO_PLACEHOLDER_KEY) continue;
29194
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
29195
29082
  if (key === BRAND_KIT_KEY) continue;
29196
29083
  if (key === STYLE_STORE_KEY) continue;
29197
29084
  if (BRAND_CHROME_KEYS.has(key)) continue;
29085
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
29198
29086
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
29087
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
29199
29088
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
29200
29089
  continue;
29201
29090
  }
@@ -29430,18 +29319,17 @@ function OhhwellsBridge() {
29430
29319
  }
29431
29320
  applyAiFooterFromContent(content);
29432
29321
  if (typeof content[STYLE_STORE_KEY] === "string") {
29433
- document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
29434
29322
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
29435
29323
  }
29436
29324
  for (const [key, val] of Object.entries(content)) {
29437
29325
  if (key === "__ohw_sections") continue;
29438
29326
  if (key === AI_SECTIONS_KEY) continue;
29439
29327
  if (key === AI_FOOTER_KEY) continue;
29440
- if (key === LOGO_PLACEHOLDER_KEY) continue;
29441
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
29442
29328
  if (key === BRAND_KIT_KEY) continue;
29443
29329
  if (key === STYLE_STORE_KEY) continue;
29444
29330
  if (BRAND_CHROME_KEYS.has(key)) continue;
29331
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
29332
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
29445
29333
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
29446
29334
  continue;
29447
29335
  }
@@ -29713,11 +29601,26 @@ function OhhwellsBridge() {
29713
29601
  const t2 = setTimeout(measure, 500);
29714
29602
  const ro = new ResizeObserver(schedule);
29715
29603
  ro.observe(document.body);
29604
+ let lastWidth = window.innerWidth;
29605
+ let resizeTimers = [];
29606
+ const clearResizeTimers = () => {
29607
+ resizeTimers.forEach(clearTimeout);
29608
+ resizeTimers = [];
29609
+ };
29610
+ const handleResize = () => {
29611
+ if (window.innerWidth === lastWidth) return;
29612
+ lastWidth = window.innerWidth;
29613
+ clearResizeTimers();
29614
+ resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
29615
+ };
29616
+ window.addEventListener("resize", handleResize);
29716
29617
  return () => {
29717
29618
  clearTimeout(t1);
29718
29619
  clearTimeout(t2);
29719
29620
  if (raf != null) cancelAnimationFrame(raf);
29720
29621
  ro.disconnect();
29622
+ clearResizeTimers();
29623
+ window.removeEventListener("resize", handleResize);
29721
29624
  };
29722
29625
  }, [pathname, isEditMode, postToParent2]);
29723
29626
  (0, import_react25.useEffect)(() => {
@@ -30014,13 +29917,6 @@ function OhhwellsBridge() {
30014
29917
  if (target.closest("[data-ohw-state-toggle]")) return;
30015
29918
  if (target.closest("[data-ohw-max-badge]")) return;
30016
29919
  if (isInsideLinkEditor(target)) return;
30017
- if (isInsideFloatingPanel(target)) return;
30018
- if (target.closest("[data-ohw-form-toolbar]")) return;
30019
- if (target.closest(
30020
- '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
30021
- )) {
30022
- return;
30023
- }
30024
29920
  if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
30025
29921
  clearMediaSelectionRef.current();
30026
29922
  }
@@ -30044,6 +29940,8 @@ function OhhwellsBridge() {
30044
29940
  return;
30045
29941
  }
30046
29942
  }
29943
+ if (isInsideFloatingPanel(target)) return;
29944
+ if (target.closest("[data-ohw-form-toolbar]")) return;
30047
29945
  const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
30048
29946
  if (collectionItem) {
30049
29947
  e.preventDefault();
@@ -30055,6 +29953,11 @@ function OhhwellsBridge() {
30055
29953
  });
30056
29954
  return;
30057
29955
  }
29956
+ if (target.closest(
29957
+ '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
29958
+ )) {
29959
+ return;
29960
+ }
30058
29961
  {
30059
29962
  const formEl = getFormElement(target);
30060
29963
  const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
@@ -30208,13 +30111,9 @@ function OhhwellsBridge() {
30208
30111
  if (isIconEditable(editable) && !getSocialItem(editable)) {
30209
30112
  e.preventDefault();
30210
30113
  e.stopPropagation();
30114
+ selectIconElementRef.current(editable);
30211
30115
  const aiIcon = editable.hasAttribute("data-ai-icon");
30212
30116
  const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
30213
- if (aiIcon) {
30214
- aiSectionApiRef.current?.selectFromElement(editable);
30215
- } else {
30216
- selectIconElementRef.current(editable);
30217
- }
30218
30117
  postToParentRef.current({
30219
30118
  type: "ow:icon-pick",
30220
30119
  key: editable.dataset.ohwKey ?? "",
@@ -30442,9 +30341,6 @@ function OhhwellsBridge() {
30442
30341
  setHoveredItemRect(null);
30443
30342
  hoveredNavContainerRef.current = null;
30444
30343
  setHoveredNavContainerRect(null);
30445
- siblingHintElRef.current = null;
30446
- setSiblingHintRect(null);
30447
- setSiblingHintRects([]);
30448
30344
  return;
30449
30345
  }
30450
30346
  {
@@ -30565,6 +30461,7 @@ function OhhwellsBridge() {
30565
30461
  hoveredNavContainerRef.current = null;
30566
30462
  setHoveredNavContainerRect(null);
30567
30463
  hoveredItemElRef.current = editable;
30464
+ setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
30568
30465
  }
30569
30466
  }
30570
30467
  }
@@ -31274,11 +31171,7 @@ function OhhwellsBridge() {
31274
31171
  };
31275
31172
  const handleMouseMove = (e) => {
31276
31173
  const { clientX, clientY } = e;
31277
- if (pointOwnedByFloatingPanel(clientX, clientY)) {
31278
- dismissImageHover();
31279
- clearImageHover();
31280
- return;
31281
- }
31174
+ if (pointOwnedByFloatingPanel(clientX, clientY)) return;
31282
31175
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
31283
31176
  document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
31284
31177
  formHoverElRef.current = null;
@@ -31307,12 +31200,7 @@ function OhhwellsBridge() {
31307
31200
  setHoveredItemRect(null);
31308
31201
  hoveredNavContainerRef.current = null;
31309
31202
  setHoveredNavContainerRect(null);
31310
- siblingHintElRef.current = null;
31311
- setSiblingHintRect(null);
31312
- setSiblingHintRects([]);
31313
31203
  dismissImageHover();
31314
- clearImageHover();
31315
- setSectionGap(null);
31316
31204
  return;
31317
31205
  }
31318
31206
  if (probeSocialsRowAt(clientX, clientY)) return;
@@ -31324,11 +31212,7 @@ function OhhwellsBridge() {
31324
31212
  if (e.data?.type !== "ow:pointer-sync") return;
31325
31213
  const { clientX, clientY } = e.data;
31326
31214
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
31327
- if (pointOwnedByFloatingPanel(clientX, clientY)) {
31328
- dismissImageHover();
31329
- clearImageHover();
31330
- return;
31331
- }
31215
+ if (pointOwnedByFloatingPanel(clientX, clientY)) return;
31332
31216
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
31333
31217
  if (probeSocialsRowAt(clientX, clientY)) return;
31334
31218
  probeSectionGapAt(clientX, clientY);
@@ -31708,7 +31592,6 @@ function OhhwellsBridge() {
31708
31592
  applyAiFooterFromContent(content);
31709
31593
  if (typeof content[STYLE_STORE_KEY] === "string") {
31710
31594
  stylesRef.current = content[STYLE_STORE_KEY];
31711
- document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
31712
31595
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
31713
31596
  }
31714
31597
  applyBrandChrome(content);
@@ -31723,12 +31606,12 @@ function OhhwellsBridge() {
31723
31606
  }
31724
31607
  if (key === AI_SECTIONS_KEY) continue;
31725
31608
  if (key === AI_FOOTER_KEY) continue;
31726
- if (key === LOGO_PLACEHOLDER_KEY) continue;
31727
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
31728
31609
  if (key === BRAND_KIT_KEY) continue;
31729
31610
  if (key === STYLE_STORE_KEY) continue;
31730
31611
  if (BRAND_CHROME_KEYS.has(key)) continue;
31612
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
31731
31613
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
31614
+ if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
31732
31615
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
31733
31616
  continue;
31734
31617
  }
@@ -32400,12 +32283,6 @@ function OhhwellsBridge() {
32400
32283
  closeLinkPopoverRef.current();
32401
32284
  return;
32402
32285
  }
32403
- if (floatingPanelOpenRef.current) {
32404
- setFloatingPanelRef.current(null);
32405
- deselectRef.current();
32406
- deactivateRef.current();
32407
- return;
32408
- }
32409
32286
  deselectRef.current();
32410
32287
  deactivateRef.current();
32411
32288
  clearMediaSelectionRef.current();
@@ -33236,10 +33113,10 @@ function OhhwellsBridge() {
33236
33113
  window.removeEventListener("message", handleDuplicateSection);
33237
33114
  window.removeEventListener("message", handleDeactivate);
33238
33115
  window.removeEventListener("message", handleSelectNav);
33116
+ document.documentElement.removeAttribute("data-ohw-panel-dragging");
33239
33117
  window.removeEventListener("message", handleToastAction);
33240
33118
  window.removeEventListener("message", handleFormCount);
33241
33119
  window.removeEventListener("message", handleUiEscape);
33242
- document.documentElement.removeAttribute("data-ohw-panel-dragging");
33243
33120
  autoSaveTimers.current.forEach(clearTimeout);
33244
33121
  autoSaveTimers.current.clear();
33245
33122
  if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
@@ -33533,7 +33410,7 @@ function OhhwellsBridge() {
33533
33410
  postToParent2({
33534
33411
  type: "ow:ready",
33535
33412
  version: "1",
33536
- bridgeVersion: "0.1.172-next.457",
33413
+ bridgeVersion: "0.1.173",
33537
33414
  path: pathname,
33538
33415
  nodes: collectEditableNodes(editContentRef.current),
33539
33416
  sections