@ohhwells/bridge 0.1.178 → 0.1.179-next.473

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // src/OhhwellsBridge.tsx
4
- import React12, { useCallback as useCallback12, useEffect as useEffect22, useLayoutEffect as useLayoutEffect6, useRef as useRef14, useState as useState18 } from "react";
4
+ import React12, { useCallback as useCallback12, useEffect as useEffect22, useLayoutEffect as useLayoutEffect7, useRef as useRef14, useState as useState18 } from "react";
5
5
  import { createRoot as createRoot3 } from "react-dom/client";
6
6
  import { flushSync as flushSync3 } from "react-dom";
7
7
 
@@ -1266,7 +1266,8 @@ function toneOverlayLogos(deps, root, photoSections, boxes) {
1266
1266
  if (root.matches(OVERLAY_LOGO_SELECTOR)) logos.unshift(root);
1267
1267
  for (const logo of logos) {
1268
1268
  if (onOwnSurface(deps, logo, root)) {
1269
- logo.removeAttribute(OVERLAY_TONE_ATTR);
1269
+ if (paintOver(deps.style(logo), { r: 0, g: 0, b: 0, a: 0 }).painted) logo.removeAttribute(OVERLAY_TONE_ATTR);
1270
+ else clearOverlayTone(logo);
1270
1271
  continue;
1271
1272
  }
1272
1273
  const box = deps.rect(logo);
@@ -8064,6 +8065,21 @@ function pricingCardFeatureCount(tree, index) {
8064
8065
  const target = findPricingCollection(tree)?.children?.[index];
8065
8066
  return target ? pricingFeatureList(target).length : 0;
8066
8067
  }
8068
+ function prevailingFeatureIcon(features) {
8069
+ const counts = /* @__PURE__ */ new Map();
8070
+ for (const row of features) {
8071
+ const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
8072
+ const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
8073
+ entry.count += 1;
8074
+ counts.set(key, entry);
8075
+ }
8076
+ let best = null;
8077
+ for (const entry of counts.values()) {
8078
+ if (!best || entry.count > best.count) best = entry;
8079
+ }
8080
+ if (!best) return {};
8081
+ return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
8082
+ }
8067
8083
  function addPricingCardFeature(tree, index, text) {
8068
8084
  return withPricingCollection(tree, (collection) => {
8069
8085
  const children = collection.children;
@@ -8072,7 +8088,7 @@ function addPricingCardFeature(tree, index, text) {
8072
8088
  const features = pricingFeatureList(target);
8073
8089
  if (features.length >= PRICING_FEATURES_MAX) return false;
8074
8090
  target.slots = target.slots ?? {};
8075
- target.slots.features = [...features, { text }];
8091
+ target.slots.features = [...features, { text, ...prevailingFeatureIcon(features) }];
8076
8092
  return true;
8077
8093
  });
8078
8094
  }
@@ -9607,7 +9623,7 @@ var AI_MOBILE_CSS = [
9607
9623
  // page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
9608
9624
  // template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
9609
9625
  // an exact figure from (no live measurement exists), so this is a safe approximation, not a
9610
- // pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
9626
+ // pixel-exact fit. Horizontal spacing already comes from `data-ai-section-inner`.
9611
9627
  '[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
9612
9628
  // A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
9613
9629
  // window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
@@ -9623,8 +9639,10 @@ var AI_MOBILE_CSS = [
9623
9639
  "[data-ai-section]{overflow-x:hidden}",
9624
9640
  // `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
9625
9641
  // full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
9626
- // still got a 20px band of section background down both sides on a phone.
9627
- "[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
9642
+ // still got a 20px band of section background down both sides on a phone. The footer's own
9643
+ // container keeps the unguarded rule below — `data-ai-full-bleed` can never appear on it.
9644
+ "[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
9645
+ "[data-ai-container]{padding:0 20px !important}",
9628
9646
  "[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
9629
9647
  "[data-ai-cell]{width:100%;min-width:0}",
9630
9648
  // The rule above turns every row into a COLUMN flex container on phones, which silently breaks
@@ -9829,6 +9847,31 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
9829
9847
  function textAttrs(ctx, path) {
9830
9848
  return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
9831
9849
  }
9850
+ var AI_RESPONSIVE_CSS = [
9851
+ "@media (max-width: 960px) {",
9852
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
9853
+ ' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
9854
+ "}",
9855
+ "@media (max-width: 640px) {",
9856
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
9857
+ " [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
9858
+ // Group containers flatten to a column on phones; span placements come along for free.
9859
+ // `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
9860
+ // the comment there. This sheet's copy is the narrower selector, so without the exemption it
9861
+ // flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
9862
+ // viewport with the heading/CTA in flow *under* the image, 219px of section background where the
9863
+ // layered text used to be.
9864
+ ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
9865
+ ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
9866
+ // `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
9867
+ // is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
9868
+ // a full-bleed hero gets its 20px side band back below 640px only — the one width where the
9869
+ // other rule had already been taught to stand down.
9870
+ " [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
9871
+ " [data-ai-responsive] { overflow-x: hidden; }",
9872
+ " [data-ai-responsive] img { max-width: 100%; }",
9873
+ "}"
9874
+ ].join("\n");
9832
9875
  var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
9833
9876
  function MediaBox({
9834
9877
  refValue,
@@ -9883,7 +9926,7 @@ function MediaBox({
9883
9926
  position: fill ? "absolute" : void 0,
9884
9927
  inset: fill ? 0 : void 0,
9885
9928
  width: fill ? "100%" : fixedSize ? "auto" : "100%",
9886
- height: fill ? "100%" : void 0,
9929
+ height: fill ? "100%" : fixedSize ? height : void 0,
9887
9930
  aspectRatio: fill ? void 0 : aspectRatio,
9888
9931
  minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
9889
9932
  borderRadius: radius,
@@ -11385,7 +11428,7 @@ function CollectionBlock({ node, ctx, path }) {
11385
11428
  return /* @__PURE__ */ jsx(
11386
11429
  "div",
11387
11430
  {
11388
- "data-ai-grid": "",
11431
+ "data-ai-grid": String(itemsPerRow),
11389
11432
  "data-ohw-pricing-collection": isPricing ? "" : void 0,
11390
11433
  style: {
11391
11434
  display: "grid",
@@ -11687,7 +11730,7 @@ function renderNode(node, ctx, path, ambientAlign) {
11687
11730
  },
11688
11731
  children: [
11689
11732
  i > 0 && ctx.heroOverlapFullBleed ? (
11690
- // The section's `data-ai-container` gave up its max-width/gutter so the base
11733
+ // The section's `data-ai-section-inner` gave up its max-width/gutter so the base
11691
11734
  // layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
11692
11735
  // scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
11693
11736
  // the full section width instead of reading at the usual content width.
@@ -12101,6 +12144,7 @@ function AiTreeRenderer({
12101
12144
  ...fillHeight ? { "data-ai-fill-height": "" } : {},
12102
12145
  ...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
12103
12146
  ...bgAttrs,
12147
+ "data-ai-responsive": "",
12104
12148
  style: {
12105
12149
  position: "relative",
12106
12150
  padding: `${padCss} 0`,
@@ -12114,12 +12158,13 @@ function AiTreeRenderer({
12114
12158
  ...fillHeight ? { display: "grid" } : {}
12115
12159
  },
12116
12160
  children: [
12117
- isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
12161
+ /* @__PURE__ */ jsx("style", { children: AI_RESPONSIVE_CSS }),
12118
12162
  /* @__PURE__ */ jsx("style", { children: AI_MOBILE_CSS }),
12163
+ isOverlay && backgroundUrl && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
12119
12164
  /* @__PURE__ */ jsx(
12120
12165
  "div",
12121
12166
  {
12122
- "data-ai-container": "",
12167
+ "data-ai-section-inner": "",
12123
12168
  ...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
12124
12169
  style: {
12125
12170
  position: "relative",
@@ -12136,7 +12181,7 @@ function AiTreeRenderer({
12136
12181
  children: tree.rows.map((row, r2) => /* @__PURE__ */ jsx(
12137
12182
  "div",
12138
12183
  {
12139
- "data-ai-row": "",
12184
+ "data-ai-columns": "",
12140
12185
  style: {
12141
12186
  display: "grid",
12142
12187
  gridTemplateColumns: "repeat(12, 1fr)",
@@ -12798,9 +12843,10 @@ function applyAiSectionsToDom(state, options) {
12798
12843
  if (existing && existing.serialized === serialized && existing.container.isConnected) {
12799
12844
  continue;
12800
12845
  }
12801
- const isNewMount = !existing || !existing.container.isConnected;
12802
12846
  let container = existing?.container;
12847
+ let isNewMount = false;
12803
12848
  if (!container || !container.isConnected) {
12849
+ isNewMount = true;
12804
12850
  existing?.root.unmount();
12805
12851
  container?.remove();
12806
12852
  container = document.createElement("div");
@@ -13138,6 +13184,34 @@ function minSpanForFooterBlock(type) {
13138
13184
  return 3;
13139
13185
  }
13140
13186
  }
13187
+ function readLiveSocialItems() {
13188
+ const root = getFooterRoot();
13189
+ const row = root?.querySelector("[data-ohw-socials-row]");
13190
+ if (!row) return [];
13191
+ const items = [];
13192
+ for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
13193
+ const href = anchor.getAttribute("href")?.trim() ?? "";
13194
+ const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
13195
+ const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
13196
+ if (!platform || !/^https?:\/\//i.test(href)) continue;
13197
+ items.push({ platform, href });
13198
+ }
13199
+ return items;
13200
+ }
13201
+ function syncSocialRowsFromDom(tree) {
13202
+ const root = getFooterRoot();
13203
+ if (!root) return;
13204
+ const row = root.querySelector("[data-ohw-socials-row]");
13205
+ const live = readLiveSocialItems();
13206
+ if (row && live.length === 0) return;
13207
+ for (const col of tree.columns) {
13208
+ col.blocks = col.blocks.flatMap((block) => {
13209
+ if (block.type !== "social-row") return [block];
13210
+ if (!row) return [];
13211
+ return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
13212
+ });
13213
+ }
13214
+ }
13141
13215
  function collectBrandBlocks(tree) {
13142
13216
  const brand = [];
13143
13217
  for (const col of tree.columns) {
@@ -13383,6 +13457,7 @@ function textOf2(el) {
13383
13457
  }
13384
13458
  function syncFooterTreeLinksFromDom(tree) {
13385
13459
  const next = cloneTree2(tree);
13460
+ syncSocialRowsFromDom(next);
13386
13461
  const domCols = listFooterColumns().map((col) => {
13387
13462
  const heading = getFooterColumnHeadingEl(col);
13388
13463
  const title = heading ? textOf2(heading) : void 0;
@@ -19208,7 +19283,7 @@ function apiBase() {
19208
19283
  function bridgeVersion() {
19209
19284
  try {
19210
19285
  if (true) {
19211
- return "0.1.178";
19286
+ return "0.1.179-next.473";
19212
19287
  }
19213
19288
  } catch {
19214
19289
  }
@@ -19222,7 +19297,7 @@ function stampBridgeVersionOnDocument() {
19222
19297
  return;
19223
19298
  }
19224
19299
  try {
19225
- const v = true ? "0.1.178" : "";
19300
+ const v = true ? "0.1.179-next.473" : "";
19226
19301
  if (v) {
19227
19302
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
19228
19303
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -19903,6 +19978,7 @@ function MediaOverlay({
19903
19978
  (prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
19904
19979
  );
19905
19980
  }, [isVideo]);
19981
+ const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
19906
19982
  const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
19907
19983
  const box = {
19908
19984
  position: "fixed",
@@ -20001,10 +20077,9 @@ function MediaOverlay({
20001
20077
  className: "flex items-center justify-center cursor-pointer",
20002
20078
  style: {
20003
20079
  ...box,
20004
- // When text overlays this media, let clicks fall THROUGH to the text underneath. In the
20005
- // parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
20006
- // in-document, pointer-events does it natively. The button below opts back in, so
20007
- // Replace still works.
20080
+ // Bare media takes the click: the first selects it, the next opens the picker. Text on
20081
+ // top and cueOnly let clicks fall through. Navbar, logo and buttons over a hero image
20082
+ // never reach here: probeImageAt dismisses the overlay before it can cover them.
20008
20083
  pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
20009
20084
  // Selected: a firm component ring with no wash, so the image reads as chosen rather
20010
20085
  // than hovered. Hover keeps the existing tinted preview.
@@ -20032,15 +20107,18 @@ function MediaOverlay({
20032
20107
  },
20033
20108
  children: [
20034
20109
  isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
20035
- isVideo ? "Replace video" : "Replace image"
20110
+ replaceLabel
20036
20111
  ]
20037
20112
  }
20038
20113
  ),
20039
- replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ jsxs8(
20114
+ showChrome && replaceMode !== "none" && /* @__PURE__ */ jsxs8(
20040
20115
  "div",
20041
20116
  {
20042
20117
  className: "flex items-center gap-1.5",
20043
- style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
20118
+ style: {
20119
+ // Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
20120
+ pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
20121
+ },
20044
20122
  onClick: (e) => e.stopPropagation(),
20045
20123
  children: [
20046
20124
  /* @__PURE__ */ jsxs8(
@@ -20049,7 +20127,7 @@ function MediaOverlay({
20049
20127
  "data-ohw-media-overlay": "",
20050
20128
  variant: "outline",
20051
20129
  size: "sm",
20052
- "aria-label": isVideo ? "Replace video" : "Replace image",
20130
+ "aria-label": replaceLabel,
20053
20131
  className: "gap-1.5 cursor-pointer hover:bg-background",
20054
20132
  style: {
20055
20133
  ...OVERLAY_BUTTON_STYLE,
@@ -20070,7 +20148,7 @@ function MediaOverlay({
20070
20148
  },
20071
20149
  children: [
20072
20150
  isVideo ? /* @__PURE__ */ jsx17(Film, { size: 14 }) : /* @__PURE__ */ jsx17(ImageIcon, { size: 14 }),
20073
- replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
20151
+ replaceMode === "full" ? replaceLabel : null
20074
20152
  ]
20075
20153
  }
20076
20154
  ),
@@ -20727,8 +20805,24 @@ function AiSectionOverlay({
20727
20805
  }
20728
20806
 
20729
20807
  // src/ui/ai-section/AiMediaStripOverlay.tsx
20730
- import { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef5, useState as useState8 } from "react";
20731
- import { Star } from "lucide-react";
20808
+ import { useCallback as useCallback3, useEffect as useEffect10, useLayoutEffect as useLayoutEffect4, useRef as useRef5, useState as useState8 } from "react";
20809
+ import {
20810
+ AlignCenter,
20811
+ AlignLeft,
20812
+ AlignRight,
20813
+ ArrowLeft as ArrowLeft2,
20814
+ ArrowRight as ArrowRight2,
20815
+ Check as Check2,
20816
+ ChevronDown as ChevronDown3,
20817
+ Image as ImageIcon2,
20818
+ ImageMinus,
20819
+ ImagePlus,
20820
+ Link as LinkIcon,
20821
+ Minus,
20822
+ Palette,
20823
+ Plus as Plus2,
20824
+ Star
20825
+ } from "lucide-react";
20732
20826
 
20733
20827
  // src/lib/ai-media-strip-tree.ts
20734
20828
  var MEDIA_STRIP_ITEM_MIN = 1;
@@ -20842,14 +20936,6 @@ function setMediaStripItemAsset(tree, index, assetId) {
20842
20936
  return true;
20843
20937
  });
20844
20938
  }
20845
- function setMediaStripItemAlt(tree, index, alt) {
20846
- return withMediaStrip(tree, (block) => {
20847
- const items = block.items;
20848
- if (index < 0 || index >= items.length) return false;
20849
- items[index] = { ...items[index], alt };
20850
- return true;
20851
- });
20852
- }
20853
20939
  function setMediaStripItemLink(tree, index, link) {
20854
20940
  return withMediaStrip(tree, (block) => {
20855
20941
  const items = block.items;
@@ -20867,11 +20953,117 @@ function setMediaStripItemLink(tree, index, link) {
20867
20953
  });
20868
20954
  }
20869
20955
 
20956
+ // src/ui/dialog.tsx
20957
+ import * as React9 from "react";
20958
+ import { Dialog as DialogPrimitive } from "radix-ui";
20959
+ import { X as X2 } from "lucide-react";
20960
+ import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
20961
+ function Dialog2({
20962
+ ...props
20963
+ }) {
20964
+ return /* @__PURE__ */ jsx20(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
20965
+ }
20966
+ function DialogPortal({
20967
+ ...props
20968
+ }) {
20969
+ return /* @__PURE__ */ jsx20(DialogPrimitive.Portal, { ...props });
20970
+ }
20971
+ function DialogOverlay({
20972
+ className,
20973
+ ...props
20974
+ }) {
20975
+ return /* @__PURE__ */ jsx20(
20976
+ DialogPrimitive.Overlay,
20977
+ {
20978
+ "data-slot": "dialog-overlay",
20979
+ "data-ohw-link-modal-root": "",
20980
+ className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
20981
+ ...props
20982
+ }
20983
+ );
20984
+ }
20985
+ var DialogContent = React9.forwardRef(
20986
+ ({ className, children, showCloseButton = true, container, ...props }, ref) => {
20987
+ const positionMode = container ? "absolute" : "fixed";
20988
+ return /* @__PURE__ */ jsxs11(DialogPortal, { container: container ?? void 0, children: [
20989
+ /* @__PURE__ */ jsx20(DialogOverlay, { className: cn(positionMode, "inset-0") }),
20990
+ /* @__PURE__ */ jsxs11(
20991
+ DialogPrimitive.Content,
20992
+ {
20993
+ ref,
20994
+ "data-slot": "dialog-content",
20995
+ className: cn(
20996
+ positionMode,
20997
+ "left-1/2 top-1/2 z-[2147483647] flex w-full max-w-[448px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-visible",
20998
+ "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
20999
+ container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
21000
+ className
21001
+ ),
21002
+ onMouseDown: (e) => e.stopPropagation(),
21003
+ ...props,
21004
+ children: [
21005
+ children,
21006
+ showCloseButton ? /* @__PURE__ */ jsx20(
21007
+ DialogPrimitive.Close,
21008
+ {
21009
+ type: "button",
21010
+ className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
21011
+ "aria-label": "Close",
21012
+ children: /* @__PURE__ */ jsx20(X2, { size: 16, "aria-hidden": true })
21013
+ }
21014
+ ) : null
21015
+ ]
21016
+ }
21017
+ )
21018
+ ] });
21019
+ }
21020
+ );
21021
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
21022
+ function DialogHeader({
21023
+ className,
21024
+ ...props
21025
+ }) {
21026
+ return /* @__PURE__ */ jsx20("div", { className: cn("flex flex-col gap-1.5", className), ...props });
21027
+ }
21028
+ function DialogFooter({
21029
+ className,
21030
+ ...props
21031
+ }) {
21032
+ return /* @__PURE__ */ jsx20(
21033
+ "div",
21034
+ {
21035
+ className: cn("flex items-center justify-end gap-2", className),
21036
+ ...props
21037
+ }
21038
+ );
21039
+ }
21040
+ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
21041
+ DialogPrimitive.Title,
21042
+ {
21043
+ ref,
21044
+ className: cn(
21045
+ "text-lg font-semibold leading-none tracking-tight text-card-foreground",
21046
+ className
21047
+ ),
21048
+ ...props
21049
+ }
21050
+ ));
21051
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
21052
+ var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
21053
+ DialogPrimitive.Description,
21054
+ {
21055
+ ref,
21056
+ className: cn("text-sm text-muted-foreground", className),
21057
+ ...props
21058
+ }
21059
+ ));
21060
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
21061
+ var DialogClose = DialogPrimitive.Close;
21062
+
20870
21063
  // src/ui/ai-section/AiMediaStripOverlay.tsx
20871
- import { Fragment as Fragment7, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
20872
- var PRIMARY3 = "#0885FE";
20873
- var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
20874
- var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
21064
+ import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
21065
+ var PRIMARY3 = "var(--ohw-primary, #0885FE)";
21066
+ var CHROME_SELECTOR = "[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review], [data-ohw-more-menu]";
20875
21067
  function findMediaStripItemElement(sectionId, index) {
20876
21068
  const sectionEl2 = findByInstanceId(sectionId);
20877
21069
  if (!sectionEl2) return null;
@@ -20881,14 +21073,35 @@ function findMediaStripItemElement(sectionId, index) {
20881
21073
  }
20882
21074
  return null;
20883
21075
  }
20884
- function readRect2(ref) {
20885
- const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
21076
+ function itemRefFromTarget(target) {
21077
+ if (!(target instanceof Element)) return null;
21078
+ if (target.closest(CHROME_SELECTOR)) return null;
21079
+ const itemEl = target.closest("[data-ohw-media-strip-item]");
21080
+ if (!itemEl) return null;
21081
+ const sectionEl2 = itemEl.closest("[data-ohw-section]");
21082
+ const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
21083
+ const sectionId = unit ? instanceIdOf(unit) || null : null;
21084
+ const index = Number(itemEl.dataset.ohwMediaStripIndex);
21085
+ if (!sectionId || Number.isNaN(index)) return null;
21086
+ return { sectionId, index };
21087
+ }
21088
+ function sameRef(a, b) {
21089
+ return a?.sectionId === b?.sectionId && a?.index === b?.index;
21090
+ }
21091
+ function rectOf(el) {
20886
21092
  if (!el) return null;
20887
21093
  const r2 = el.getBoundingClientRect();
20888
21094
  if (r2.width <= 0 || r2.height <= 0) return null;
20889
21095
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
20890
21096
  }
20891
- function useLiveItemRect(ref) {
21097
+ function readRect2(ref) {
21098
+ return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
21099
+ }
21100
+ function readStripRect(ref) {
21101
+ const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
21102
+ return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
21103
+ }
21104
+ function useLiveItemRect(ref, strip = false) {
20892
21105
  const [rect, setRect] = useState8(null);
20893
21106
  useEffect10(() => {
20894
21107
  if (!ref) {
@@ -20896,7 +21109,7 @@ function useLiveItemRect(ref) {
20896
21109
  return;
20897
21110
  }
20898
21111
  const update = () => {
20899
- const next = readRect2(ref);
21112
+ const next = strip ? readStripRect(ref) : readRect2(ref);
20900
21113
  setRect(
20901
21114
  (prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
20902
21115
  );
@@ -20911,9 +21124,49 @@ function useLiveItemRect(ref) {
20911
21124
  window.removeEventListener("resize", update);
20912
21125
  clearInterval(interval);
20913
21126
  };
20914
- }, [ref?.sectionId, ref?.index]);
21127
+ }, [ref?.sectionId, ref?.index, strip]);
20915
21128
  return rect;
20916
21129
  }
21130
+ var TOOLBAR_STRIP_GAP = 52;
21131
+ var TOOLBAR_STRIP_GAP_MOBILE = 42;
21132
+ var TOOLBAR_EDGE_MARGIN2 = 4;
21133
+ function StripToolbarSlot({ stripRect, children }) {
21134
+ const slotRef = useRef5(null);
21135
+ const [shift, setShift] = useState8(0);
21136
+ const centerX = stripRect.left + stripRect.width / 2;
21137
+ useLayoutEffect4(() => {
21138
+ const slot = slotRef.current;
21139
+ if (!slot) return;
21140
+ const clamp = () => {
21141
+ const w = slot.offsetWidth;
21142
+ if (w <= 0) return;
21143
+ const half = w / 2;
21144
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
21145
+ setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
21146
+ };
21147
+ clamp();
21148
+ const ro = new ResizeObserver(clamp);
21149
+ ro.observe(slot);
21150
+ return () => ro.disconnect();
21151
+ }, [centerX, children]);
21152
+ const mobile = window.innerWidth <= 480;
21153
+ return /* @__PURE__ */ jsx21(
21154
+ "div",
21155
+ {
21156
+ ref: slotRef,
21157
+ "data-ohw-bridge": "",
21158
+ "data-ohw-item-interaction": "",
21159
+ className: "pointer-events-auto fixed",
21160
+ style: {
21161
+ top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
21162
+ left: centerX + shift,
21163
+ transform: "translate(-50%, -100%)",
21164
+ zIndex: 2147483645
21165
+ },
21166
+ children
21167
+ }
21168
+ );
21169
+ }
20917
21170
  function requestValidateTree(postToParent2, tree) {
20918
21171
  return new Promise((resolve) => {
20919
21172
  const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
@@ -20950,116 +21203,72 @@ function requestAssetPick(postToParent2) {
20950
21203
  postToParent2({ type: "ow:asset-pick", id });
20951
21204
  });
20952
21205
  }
20953
- function Pill({
21206
+ function ToolbarAction({
20954
21207
  label,
20955
21208
  onClick,
20956
- disabled,
20957
- active
21209
+ disabled = false,
21210
+ active = false,
21211
+ children
20958
21212
  }) {
20959
- return /* @__PURE__ */ jsx20(
20960
- "button",
20961
- {
20962
- type: "button",
20963
- onClick,
20964
- disabled,
20965
- style: {
20966
- height: 28,
20967
- padding: "0 10px",
20968
- display: "inline-flex",
20969
- alignItems: "center",
20970
- gap: 4,
20971
- borderRadius: 999,
20972
- border: "none",
20973
- cursor: disabled ? "default" : "pointer",
20974
- background: active ? OHW_BLUE_DARK : "#ffffff",
20975
- color: active ? "#ffffff" : OHW_BLUE_DARK,
20976
- opacity: disabled ? 0.4 : 1,
20977
- fontSize: 12,
20978
- lineHeight: "16px",
20979
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
20980
- whiteSpace: "nowrap",
20981
- flex: "0 0 auto"
20982
- },
20983
- children: label
20984
- }
20985
- );
21213
+ const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
21214
+ return /* @__PURE__ */ jsxs12(Tooltip, { children: [
21215
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
21216
+ /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21217
+ ] });
20986
21218
  }
20987
- function AltInput({ value, onCommit }) {
20988
- const [draft, setDraft] = useState8(value);
20989
- useEffect10(() => setDraft(value), [value]);
20990
- return /* @__PURE__ */ jsxs11(
20991
- "div",
20992
- {
20993
- style: {
20994
- display: "flex",
20995
- alignItems: "center",
20996
- gap: 6,
20997
- height: 28,
20998
- padding: "0 12px",
20999
- borderRadius: 999,
21000
- background: "#ffffff",
21001
- width: "100%",
21002
- maxWidth: 260,
21003
- boxSizing: "border-box"
21004
- },
21005
- children: [
21006
- /* @__PURE__ */ jsx20(
21007
- "span",
21008
- {
21009
- style: {
21010
- flex: "0 0 auto",
21011
- color: OHW_BLUE_DARK,
21012
- fontSize: 10,
21013
- fontWeight: 700,
21014
- textTransform: "uppercase",
21015
- letterSpacing: 0.4
21016
- },
21017
- children: "Alt"
21018
- }
21019
- ),
21020
- /* @__PURE__ */ jsx20(
21021
- "input",
21219
+ function ToolbarSeparator() {
21220
+ return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21221
+ }
21222
+ function OptionMenu({
21223
+ label,
21224
+ value,
21225
+ options,
21226
+ onChange
21227
+ }) {
21228
+ const current = options.find((o) => o.value === value) ?? options[0];
21229
+ return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21230
+ /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: label }),
21231
+ /* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
21232
+ /* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
21233
+ "button",
21234
+ {
21235
+ type: "button",
21236
+ "aria-label": label,
21237
+ className: "inline-flex h-8 min-w-[76px] items-center gap-[7px] rounded-[6px] bg-transparent px-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted data-[state=open]:bg-muted",
21238
+ children: [
21239
+ /* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
21240
+ /* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
21241
+ ]
21242
+ }
21243
+ ) }),
21244
+ /* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
21245
+ const selected = option.value === value;
21246
+ return /* @__PURE__ */ jsxs12(
21247
+ DropdownMenuItem,
21022
21248
  {
21023
- type: "text",
21024
- value: draft,
21025
- onChange: (e) => setDraft(e.target.value),
21026
- onBlur: () => {
21027
- if (draft !== value) onCommit(draft);
21028
- },
21029
- onKeyDown: (e) => {
21030
- if (e.key === "Enter") e.currentTarget.blur();
21031
- if (e.key === "Escape") {
21032
- setDraft(value);
21033
- e.currentTarget.blur();
21034
- }
21035
- },
21036
- placeholder: "Describe this image",
21037
- "aria-label": "Image alt text",
21038
- style: {
21039
- flex: 1,
21040
- minWidth: 0,
21041
- border: "none",
21042
- outline: "none",
21043
- background: "transparent",
21044
- fontSize: 12,
21045
- lineHeight: "16px",
21046
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21047
- color: "#1f2937"
21048
- }
21049
- }
21050
- )
21051
- ]
21052
- }
21053
- );
21249
+ role: "menuitemradio",
21250
+ "aria-checked": selected,
21251
+ onSelect: () => onChange(option.value),
21252
+ className: cn("grid grid-cols-[1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
21253
+ children: [
21254
+ /* @__PURE__ */ jsx21("span", { children: option.label }),
21255
+ selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
21256
+ ]
21257
+ },
21258
+ option.value
21259
+ );
21260
+ }) })
21261
+ ] })
21262
+ ] });
21054
21263
  }
21055
21264
  var VARIANTS = [
21056
21265
  { value: "logos", label: "Logos" },
21057
21266
  { value: "reel", label: "Reel" }
21058
21267
  ];
21059
21268
  var ALIGNS = [
21060
- { value: "left", label: "Left" },
21061
- { value: "center", label: "Center" },
21062
- { value: "right", label: "Right" }
21269
+ { value: "left", label: "Align left", Icon: AlignLeft },
21270
+ { value: "center", label: "Align center", Icon: AlignCenter },
21271
+ { value: "right", label: "Align right", Icon: AlignRight }
21063
21272
  ];
21064
21273
  var HOVERS = [
21065
21274
  { value: "none", label: "None" },
@@ -21067,104 +21276,104 @@ var HOVERS = [
21067
21276
  { value: "zoom", label: "Zoom" },
21068
21277
  { value: "fade", label: "Fade" }
21069
21278
  ];
21070
- var TREATMENTS = [
21071
- { value: "color", label: "Color" },
21072
- { value: "grayscale", label: "Grayscale" }
21073
- ];
21074
21279
  var HTTP_URL_RE = /^https?:\/\/\S+$/i;
21075
- function LinkInput({ value, onCommit }) {
21076
- const [draft, setDraft] = useState8(value);
21280
+ function LinkModal({
21281
+ href,
21282
+ linkTarget,
21283
+ onClose,
21284
+ onSave
21285
+ }) {
21286
+ const [draft, setDraft] = useState8(href);
21287
+ const [newTab, setNewTab] = useState8(linkTarget !== "same-tab");
21077
21288
  const [invalid, setInvalid] = useState8(false);
21078
- useEffect10(() => {
21079
- setDraft(value);
21080
- setInvalid(false);
21081
- }, [value]);
21082
- const commit2 = () => {
21289
+ const save = () => {
21083
21290
  const next = draft.trim();
21084
- if (next === value) return setInvalid(false);
21085
- if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
21086
- setInvalid(false);
21087
- onCommit(next);
21088
- };
21089
- return /* @__PURE__ */ jsxs11(
21090
- "div",
21091
- {
21092
- style: {
21093
- display: "flex",
21094
- alignItems: "center",
21095
- gap: 6,
21096
- height: 28,
21097
- padding: "0 12px",
21098
- borderRadius: 999,
21099
- background: "#ffffff",
21100
- width: "100%",
21101
- maxWidth: 260,
21102
- boxSizing: "border-box",
21103
- boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
21104
- },
21105
- children: [
21106
- /* @__PURE__ */ jsx20(
21107
- "span",
21108
- {
21109
- style: {
21110
- flex: "0 0 auto",
21111
- color: OHW_BLUE_DARK,
21112
- fontSize: 10,
21113
- fontWeight: 700,
21114
- textTransform: "uppercase",
21115
- letterSpacing: 0.4
21116
- },
21117
- children: "Link"
21118
- }
21119
- ),
21120
- /* @__PURE__ */ jsx20(
21121
- "input",
21122
- {
21123
- type: "text",
21124
- inputMode: "url",
21125
- value: draft,
21126
- onChange: (e) => setDraft(e.target.value),
21127
- onBlur: commit2,
21128
- onKeyDown: (e) => {
21129
- if (e.key === "Enter") e.currentTarget.blur();
21130
- if (e.key === "Escape") {
21131
- setDraft(value);
21132
- setInvalid(false);
21133
- e.currentTarget.blur();
21134
- }
21135
- },
21136
- placeholder: "https://example.com",
21137
- "aria-label": "Image link URL",
21138
- "aria-invalid": invalid,
21139
- style: {
21140
- flex: 1,
21141
- minWidth: 0,
21142
- border: "none",
21143
- outline: "none",
21144
- background: "transparent",
21145
- fontSize: 12,
21146
- lineHeight: "16px",
21147
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21148
- color: "#1f2937"
21149
- }
21150
- }
21151
- )
21152
- ]
21291
+ if (next && !HTTP_URL_RE.test(next)) {
21292
+ setInvalid(true);
21293
+ return;
21153
21294
  }
21154
- );
21295
+ onSave(next, newTab ? "new-tab" : "same-tab");
21296
+ onClose();
21297
+ };
21298
+ return /* @__PURE__ */ jsx21(Dialog2, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs12(DialogContent, { "data-ohw-link-modal-root": "", className: "max-w-[400px] gap-4 p-5", children: [
21299
+ /* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { className: "text-base", children: "Image link" }) }),
21300
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-3", children: [
21301
+ /* @__PURE__ */ jsx21(
21302
+ "input",
21303
+ {
21304
+ autoFocus: true,
21305
+ type: "text",
21306
+ inputMode: "url",
21307
+ value: draft,
21308
+ onChange: (e) => {
21309
+ setDraft(e.target.value);
21310
+ setInvalid(false);
21311
+ },
21312
+ onKeyDown: (e) => {
21313
+ if (e.key === "Enter") save();
21314
+ },
21315
+ placeholder: "https://example.com",
21316
+ "aria-label": "Image link URL",
21317
+ "aria-invalid": invalid,
21318
+ className: cn(
21319
+ "h-9 w-full rounded-[6px] border border-border bg-background px-3 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-bridge-primary",
21320
+ invalid && "border-destructive focus:border-destructive"
21321
+ )
21322
+ }
21323
+ ),
21324
+ invalid && /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: "Enter a full URL starting with http:// or https://" }),
21325
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-2 text-[13px] text-foreground", children: [
21326
+ /* @__PURE__ */ jsx21("input", { type: "checkbox", checked: newTab, onChange: (e) => setNewTab(e.target.checked) }),
21327
+ "Open in new tab"
21328
+ ] })
21329
+ ] }),
21330
+ /* @__PURE__ */ jsxs12(DialogFooter, { children: [
21331
+ href && /* @__PURE__ */ jsx21(
21332
+ "button",
21333
+ {
21334
+ type: "button",
21335
+ onClick: () => {
21336
+ onSave("", "new-tab");
21337
+ onClose();
21338
+ },
21339
+ className: "mr-auto rounded-[6px] px-3 py-2 text-[13px] font-medium text-destructive transition-colors hover:bg-muted",
21340
+ children: "Remove link"
21341
+ }
21342
+ ),
21343
+ /* @__PURE__ */ jsx21(
21344
+ "button",
21345
+ {
21346
+ type: "button",
21347
+ onClick: onClose,
21348
+ className: "rounded-[6px] px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted",
21349
+ children: "Cancel"
21350
+ }
21351
+ ),
21352
+ /* @__PURE__ */ jsx21(
21353
+ "button",
21354
+ {
21355
+ type: "button",
21356
+ onClick: save,
21357
+ className: "rounded-[6px] bg-bridge-primary px-3 py-2 text-[13px] font-medium text-primary-foreground transition-opacity hover:opacity-90",
21358
+ children: "Save"
21359
+ }
21360
+ )
21361
+ ] })
21362
+ ] }) });
21155
21363
  }
21156
21364
  function MediaStripToolbar({
21157
21365
  entry,
21158
21366
  index,
21159
21367
  pending,
21160
21368
  error,
21369
+ itemEditOn,
21370
+ onToggleItemEdit,
21161
21371
  onSetVariant,
21162
21372
  onSetAlign,
21163
21373
  onSetHover,
21164
21374
  onSetTreatment,
21165
21375
  onResize,
21166
- onSetAlt,
21167
- onSetLink,
21376
+ onOpenLink,
21168
21377
  onAddItem,
21169
21378
  onRemoveItem,
21170
21379
  onChangeImage,
@@ -21173,81 +21382,102 @@ function MediaStripToolbar({
21173
21382
  }) {
21174
21383
  const items = mediaStripItems(entry.tree);
21175
21384
  const itemCount = items.length;
21176
- const currentAlt = items[index]?.alt ?? "";
21177
- const currentHref2 = items[index]?.href ?? "";
21178
- const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
21179
21385
  const slots = findMediaStripSlots(entry.tree);
21180
21386
  const variant = slots?.variant === "reel" ? "reel" : "logos";
21181
21387
  const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
21182
21388
  const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
21183
21389
  const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
21184
21390
  const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21185
- const isMobile = window.innerWidth <= 480;
21186
- const rowStyle = isMobile ? {
21187
- display: "flex",
21188
- gap: 6,
21189
- flexWrap: "nowrap",
21190
- justifyContent: "center",
21191
- overflowX: "auto",
21192
- WebkitOverflowScrolling: "touch",
21193
- width: "100%",
21194
- scrollbarWidth: "none"
21195
- } : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
21196
- return /* @__PURE__ */ jsxs11(
21391
+ const mobile = window.innerWidth <= 480;
21392
+ const gatedLabel = (label) => itemEditOn ? label : "Turn on the star to edit this image";
21393
+ return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
21197
21394
  "div",
21198
21395
  {
21199
21396
  "data-ohw-bridge": "",
21200
21397
  "data-ohw-toolbar": "",
21201
21398
  onMouseDown: (e) => e.stopPropagation(),
21202
- style: {
21203
- display: "flex",
21204
- flexDirection: "column",
21205
- gap: 6,
21206
- alignItems: "center",
21207
- background: OHW_BLUE,
21208
- padding: 8,
21209
- borderRadius: 12,
21210
- boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
21211
- pointerEvents: pending ? "none" : "auto",
21212
- opacity: pending ? 0.6 : 1,
21213
- maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
21214
- },
21399
+ className: cn("flex flex-col items-center gap-1.5 font-sans", pending && "pointer-events-none opacity-60"),
21400
+ style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
21215
21401
  children: [
21216
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21217
- VARIANTS.map((v) => /* @__PURE__ */ jsx20(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
21218
- ALIGNS.map((a) => /* @__PURE__ */ jsx20(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
21219
- ] }),
21220
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21221
- HOVERS.map((h) => /* @__PURE__ */ jsx20(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
21222
- TREATMENTS.map((t) => /* @__PURE__ */ jsx20(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
21223
- ] }),
21224
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
21225
- /* @__PURE__ */ jsx20(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
21226
- /* @__PURE__ */ jsxs11("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
21227
- sizeValue,
21228
- "px"
21229
- ] }),
21230
- /* @__PURE__ */ jsx20(Pill, { label: "+", onClick: () => onResize(8) })
21231
- ] }),
21232
- /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
21233
- /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ jsx20(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
21234
- currentHref2 && /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21235
- /* @__PURE__ */ jsx20(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
21236
- /* @__PURE__ */ jsx20(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
21237
- ] }),
21238
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21239
- /* @__PURE__ */ jsx20(Pill, { label: "Change Image", onClick: onChangeImage }),
21240
- /* @__PURE__ */ jsx20(Pill, { label: "+ Item", onClick: onAddItem }),
21241
- /* @__PURE__ */ jsx20(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
21242
- ] }),
21243
- /* @__PURE__ */ jsxs11("div", { style: rowStyle, children: [
21244
- /* @__PURE__ */ jsx20(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
21245
- /* @__PURE__ */ jsx20(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
21246
- ] }),
21247
- error && /* @__PURE__ */ jsx20("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21402
+ /* @__PURE__ */ jsxs12(
21403
+ "div",
21404
+ {
21405
+ className: cn(
21406
+ "flex items-center gap-1 rounded-[10px] border border-border bg-background p-1 whitespace-nowrap",
21407
+ "shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.1),0px_4px_6px_-4px_rgba(0,0,0,0.1)]",
21408
+ mobile ? "flex-wrap justify-center" : "flex-nowrap"
21409
+ ),
21410
+ children: [
21411
+ /* @__PURE__ */ jsxs12(Tooltip, { children: [
21412
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
21413
+ CustomToolbarButton,
21414
+ {
21415
+ type: "button",
21416
+ "aria-label": itemEditOn ? "Done editing this image" : "Edit this image",
21417
+ "aria-pressed": itemEditOn,
21418
+ onClick: onToggleItemEdit,
21419
+ className: "group size-8",
21420
+ children: /* @__PURE__ */ jsx21(
21421
+ Star,
21422
+ {
21423
+ size: 16,
21424
+ fill: "currentColor",
21425
+ strokeWidth: 0,
21426
+ className: cn(
21427
+ "transition-colors",
21428
+ itemEditOn ? "text-[#f59e0b] group-hover:text-[#d97706]" : "text-[#d6d3d1] group-hover:text-[#fbbf24]"
21429
+ ),
21430
+ style: { pointerEvents: "none" }
21431
+ }
21432
+ )
21433
+ }
21434
+ ) }),
21435
+ /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
21436
+ ] }),
21437
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21438
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(ImageIcon2, { size: 16, style: { pointerEvents: "none" } }) }),
21439
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ jsx21(LinkIcon, { size: 16, style: { pointerEvents: "none" } }) }),
21440
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ jsx21(ArrowLeft2, { size: 16, style: { pointerEvents: "none" } }) }),
21441
+ /* @__PURE__ */ jsx21(
21442
+ ToolbarAction,
21443
+ {
21444
+ label: gatedLabel("Move right"),
21445
+ onClick: onMoveRight,
21446
+ disabled: !itemEditOn || index >= itemCount - 1,
21447
+ children: /* @__PURE__ */ jsx21(ArrowRight2, { size: 16, style: { pointerEvents: "none" } })
21448
+ }
21449
+ ),
21450
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ jsx21(ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
21451
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21452
+ /* @__PURE__ */ jsx21(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
21453
+ /* @__PURE__ */ jsx21(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
21454
+ /* @__PURE__ */ jsx21(
21455
+ ToolbarAction,
21456
+ {
21457
+ label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
21458
+ active: treatment === "grayscale",
21459
+ onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
21460
+ children: /* @__PURE__ */ jsx21(Palette, { size: 16, style: { pointerEvents: "none" } })
21461
+ }
21462
+ ),
21463
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21464
+ ALIGNS.map(({ value, label, Icon }) => /* @__PURE__ */ jsx21(ToolbarAction, { label, active: align === value, onClick: () => onSetAlign(value), children: /* @__PURE__ */ jsx21(Icon, { size: 16, style: { pointerEvents: "none" } }) }, value)),
21465
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21466
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) }),
21467
+ /* @__PURE__ */ jsxs12("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
21468
+ sizeValue,
21469
+ "px"
21470
+ ] }),
21471
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
21472
+ /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21473
+ /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ jsx21(ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
21474
+ ]
21475
+ }
21476
+ ),
21477
+ error && /* @__PURE__ */ jsx21("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
21248
21478
  ]
21249
21479
  }
21250
- );
21480
+ ) });
21251
21481
  }
21252
21482
  function findMediaStripSlots(tree) {
21253
21483
  const stack = tree.rows.flatMap((row) => row.blocks);
@@ -21266,31 +21496,23 @@ function AiMediaStripOverlay({
21266
21496
  }) {
21267
21497
  const [hover, setHover] = useState8(null);
21268
21498
  const [active, setActive] = useState8(null);
21499
+ const [itemEditOn, setItemEditOn] = useState8(false);
21500
+ const [linkOpen, setLinkOpen] = useState8(false);
21269
21501
  const [pending, setPending] = useState8(false);
21270
21502
  const [error, setError] = useState8(null);
21271
21503
  const activeRef = useRef5(null);
21272
21504
  activeRef.current = active;
21505
+ const linkOpenRef = useRef5(false);
21506
+ linkOpenRef.current = linkOpen;
21273
21507
  useEffect10(() => {
21274
21508
  const onMove = (e) => {
21509
+ const ref = itemRefFromTarget(e.target);
21275
21510
  const t = e.target;
21276
- if (!(t instanceof HTMLElement)) return;
21277
- 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]")) {
21278
- return;
21279
- }
21280
- const itemEl = t.closest("[data-ohw-media-strip-item]");
21281
- if (!itemEl) {
21282
- setHover(null);
21283
- return;
21284
- }
21285
- const sectionEl2 = itemEl.closest("[data-ohw-section]");
21286
- const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
21287
- const sectionId = unit ? instanceIdOf(unit) || null : null;
21288
- const index = Number(itemEl.dataset.ohwMediaStripIndex);
21289
- if (!sectionId || Number.isNaN(index)) {
21290
- setHover(null);
21291
- return;
21292
- }
21293
- setHover({ sectionId, index });
21511
+ const overEditable = Boolean(t?.closest?.("[data-ohw-editable]"));
21512
+ setHover((prev) => {
21513
+ const next = ref && !overEditable ? ref : null;
21514
+ return sameRef(prev, next) ? prev : next;
21515
+ });
21294
21516
  };
21295
21517
  const onLeave = () => setHover(null);
21296
21518
  document.addEventListener("mousemove", onMove, { passive: true });
@@ -21302,23 +21524,25 @@ function AiMediaStripOverlay({
21302
21524
  }, []);
21303
21525
  useEffect10(() => {
21304
21526
  const onClick = (e) => {
21305
- const current = activeRef.current;
21306
- if (!current) return;
21307
21527
  const t = e.target;
21308
- if (!(t instanceof HTMLElement)) return;
21309
- if (t.closest("[data-ohw-item-interaction]")) return;
21310
- const itemEl = findMediaStripItemElement(current.sectionId, current.index);
21311
- if (itemEl && itemEl.contains(t)) return;
21312
- setActive(null);
21528
+ if (!(t instanceof Element)) return;
21529
+ if (t.closest(CHROME_SELECTOR)) return;
21530
+ const ref = itemRefFromTarget(t);
21531
+ if (sameRef(activeRef.current, ref)) return;
21532
+ if (ref) clearInteractionChromeRef.current();
21533
+ setItemEditOn(false);
21313
21534
  setError(null);
21535
+ setActive(ref);
21314
21536
  };
21315
21537
  document.addEventListener("click", onClick, true);
21316
21538
  return () => document.removeEventListener("click", onClick, true);
21317
- }, []);
21539
+ }, [clearInteractionChromeRef]);
21318
21540
  useEffect10(() => {
21319
21541
  const onBlur = () => {
21320
21542
  if (!activeRef.current) return;
21321
21543
  setActive(null);
21544
+ setItemEditOn(false);
21545
+ setLinkOpen(false);
21322
21546
  setError(null);
21323
21547
  };
21324
21548
  window.addEventListener("blur", onBlur);
@@ -21328,7 +21552,10 @@ function AiMediaStripOverlay({
21328
21552
  const onKeyDown = (e) => {
21329
21553
  if (e.key !== "Escape") return;
21330
21554
  if (!activeRef.current) return;
21555
+ if (linkOpenRef.current) return;
21556
+ if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
21331
21557
  setActive(null);
21558
+ setItemEditOn(false);
21332
21559
  setError(null);
21333
21560
  };
21334
21561
  document.addEventListener("keydown", onKeyDown);
@@ -21362,137 +21589,133 @@ function AiMediaStripOverlay({
21362
21589
  tree: nextTree,
21363
21590
  label: entry.label,
21364
21591
  media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
21365
- ...entry.brand ? { brand: entry.brand } : {}
21592
+ ...entry.brand ? { brand: entry.brand } : {},
21593
+ // The user is already looking at the strip they just edited — recentering the viewport
21594
+ // on every edit reads as the section jumping around.
21595
+ skipScrollIntoView: true
21366
21596
  });
21367
21597
  return true;
21368
21598
  },
21369
21599
  [findEntry, postToParent2, applyTreeLocalRef]
21370
21600
  );
21371
21601
  const activeEntry = active ? findEntry(active.sectionId) : null;
21372
- const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
21373
21602
  const activeItemRect = useLiveItemRect(active);
21374
- const TOOLBAR_APPROX_H = 170;
21375
- const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
21376
- return /* @__PURE__ */ jsxs11(Fragment7, { children: [
21377
- hoverHandleRect && hover && /* @__PURE__ */ jsx20(
21378
- "button",
21379
- {
21380
- type: "button",
21381
- "data-ohw-toolbar": "",
21382
- onClick: () => {
21383
- clearInteractionChromeRef.current();
21384
- setActive(hover);
21385
- },
21386
- "aria-label": "Configure media item",
21387
- style: {
21388
- position: "fixed",
21389
- top: hoverHandleRect.top + 8,
21390
- left: hoverHandleRect.left + hoverHandleRect.width - 36,
21391
- width: 28,
21392
- height: 28,
21393
- borderRadius: 8,
21394
- border: `1.5px dashed ${PRIMARY3}`,
21395
- background: "#ffffff",
21396
- color: PRIMARY3,
21397
- display: "flex",
21398
- alignItems: "center",
21399
- justifyContent: "center",
21400
- cursor: "pointer",
21401
- zIndex: 2147483643,
21402
- fontSize: 14,
21403
- fontWeight: 700
21404
- },
21405
- children: /* @__PURE__ */ jsx20(Star, { size: 14, style: { pointerEvents: "none" } })
21406
- }
21407
- ),
21408
- activeItemRect && active && activeEntry && /* @__PURE__ */ jsx20(
21409
- ItemInteractionLayer,
21410
- {
21411
- rect: activeItemRect,
21412
- state: toolbarState,
21413
- toolbar: /* @__PURE__ */ jsx20(
21414
- MediaStripToolbar,
21415
- {
21416
- entry: activeEntry,
21417
- index: active.index,
21418
- pending,
21419
- error,
21420
- onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
21421
- onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
21422
- onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
21423
- onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
21424
- onResize: (delta) => {
21425
- const slots = findMediaStripSlots(activeEntry.tree);
21426
- const variant = slots?.variant === "reel" ? "reel" : "logos";
21427
- const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21428
- void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
21429
- },
21430
- onSetAlt: (alt) => {
21431
- void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
21432
- },
21433
- onSetLink: (href, linkTarget) => {
21603
+ const activeStripRect = useLiveItemRect(active, true);
21604
+ const hoverRect = useLiveItemRect(hover && !sameRef(hover, active) ? hover : null);
21605
+ const activeItems = activeEntry ? mediaStripItems(activeEntry.tree) : [];
21606
+ const activeItem = active ? activeItems[active.index] : void 0;
21607
+ const activeHref = activeItem?.href ?? "";
21608
+ const activeTarget = activeItem?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
21609
+ return /* @__PURE__ */ jsxs12(Fragment7, { children: [
21610
+ hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
21611
+ activeItemRect && activeStripRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment7, { children: [
21612
+ /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeItemRect, state: "active-top" }),
21613
+ /* @__PURE__ */ jsx21(StripToolbarSlot, { stripRect: activeStripRect, children: /* @__PURE__ */ jsx21(
21614
+ MediaStripToolbar,
21615
+ {
21616
+ entry: activeEntry,
21617
+ index: active.index,
21618
+ pending,
21619
+ error,
21620
+ itemEditOn,
21621
+ onToggleItemEdit: () => setItemEditOn((on) => !on),
21622
+ onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
21623
+ onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
21624
+ onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
21625
+ onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
21626
+ onResize: (delta) => {
21627
+ const slots = findMediaStripSlots(activeEntry.tree);
21628
+ const variant = slots?.variant === "reel" ? "reel" : "logos";
21629
+ const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21630
+ void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
21631
+ },
21632
+ onOpenLink: () => setLinkOpen(true),
21633
+ onAddItem: () => {
21634
+ void requestAssetPick(postToParent2).then((picked) => {
21635
+ if (!picked) return;
21636
+ const item = { assetId: picked.assetId, alt: "Logo" };
21434
21637
  void runMutation(
21435
21638
  active.sectionId,
21436
- (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
21437
- );
21438
- },
21439
- onAddItem: () => {
21440
- void requestAssetPick(postToParent2).then((picked) => {
21441
- if (!picked) return;
21442
- const item = { assetId: picked.assetId, alt: "Logo" };
21443
- void runMutation(
21444
- active.sectionId,
21445
- (tree) => addMediaStripItem(tree, item, active.index),
21446
- { [picked.assetId]: picked.url }
21447
- ).then((applied) => {
21448
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21449
- });
21450
- });
21451
- },
21452
- onChangeImage: () => {
21453
- void requestAssetPick(postToParent2).then((picked) => {
21454
- if (!picked) return;
21455
- void runMutation(
21456
- active.sectionId,
21457
- (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
21458
- { [picked.assetId]: picked.url }
21459
- );
21639
+ (tree) => addMediaStripItem(tree, item, active.index),
21640
+ { [picked.assetId]: picked.url }
21641
+ ).then((applied) => {
21642
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21460
21643
  });
21461
- },
21462
- onRemoveItem: () => {
21463
- void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
21464
- (applied) => {
21465
- if (applied) setActive(null);
21466
- }
21467
- );
21468
- },
21469
- onMoveLeft: () => {
21470
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
21471
- (applied) => {
21472
- if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
21473
- }
21474
- );
21475
- },
21476
- onMoveRight: () => {
21477
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
21478
- (applied) => {
21479
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21480
- }
21644
+ });
21645
+ },
21646
+ onChangeImage: () => {
21647
+ void requestAssetPick(postToParent2).then((picked) => {
21648
+ if (!picked) return;
21649
+ void runMutation(
21650
+ active.sectionId,
21651
+ (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
21652
+ { [picked.assetId]: picked.url }
21481
21653
  );
21482
- }
21654
+ });
21655
+ },
21656
+ onRemoveItem: () => {
21657
+ void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
21658
+ (applied) => {
21659
+ if (applied) setActive(null);
21660
+ }
21661
+ );
21662
+ },
21663
+ onMoveLeft: () => {
21664
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
21665
+ (applied) => {
21666
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
21667
+ }
21668
+ );
21669
+ },
21670
+ onMoveRight: () => {
21671
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
21672
+ (applied) => {
21673
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21674
+ }
21675
+ );
21483
21676
  }
21484
- )
21485
- }
21486
- )
21677
+ }
21678
+ ) }),
21679
+ /* @__PURE__ */ jsx21(
21680
+ "div",
21681
+ {
21682
+ "data-ohw-bridge": "",
21683
+ "data-ohw-item-interaction": "",
21684
+ "aria-hidden": true,
21685
+ className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
21686
+ style: {
21687
+ top: activeItemRect.top + activeItemRect.height + 10,
21688
+ left: activeItemRect.left - 5,
21689
+ background: PRIMARY3,
21690
+ zIndex: 2147483644
21691
+ },
21692
+ children: "Media item"
21693
+ }
21694
+ ),
21695
+ linkOpen && /* @__PURE__ */ jsx21(
21696
+ LinkModal,
21697
+ {
21698
+ href: activeHref,
21699
+ linkTarget: activeTarget,
21700
+ onClose: () => setLinkOpen(false),
21701
+ onSave: (href, linkTarget) => {
21702
+ void runMutation(
21703
+ active.sectionId,
21704
+ (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
21705
+ );
21706
+ }
21707
+ }
21708
+ )
21709
+ ] })
21487
21710
  ] });
21488
21711
  }
21489
21712
 
21490
21713
  // src/ui/ai-section/AiPricingCardOverlay.tsx
21491
- import { useCallback as useCallback4, useEffect as useEffect11, useLayoutEffect as useLayoutEffect4, useRef as useRef6, useState as useState9 } from "react";
21492
- import { Check as Check2, ChevronDown as ChevronDown3, Minus, Plus as Plus2, Star as Star2 } from "lucide-react";
21493
- import { Fragment as Fragment8, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
21714
+ import { useCallback as useCallback4, useEffect as useEffect11, useLayoutEffect as useLayoutEffect5, useRef as useRef6, useState as useState9 } from "react";
21715
+ import { Check as Check3, ChevronDown as ChevronDown4, Minus as Minus2, Plus as Plus3, Star as Star2 } from "lucide-react";
21716
+ import { Fragment as Fragment8, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
21494
21717
  var PRIMARY4 = "var(--ohw-primary, #0885FE)";
21495
- var CHROME_SELECTOR = "[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review], [data-ohw-more-menu]";
21718
+ var CHROME_SELECTOR2 = "[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review], [data-ohw-more-menu]";
21496
21719
  function findPricingCardElement(sectionId, index) {
21497
21720
  const sectionEl2 = findByInstanceId(sectionId);
21498
21721
  if (!sectionEl2) return null;
@@ -21504,7 +21727,7 @@ function findPricingCardElement(sectionId, index) {
21504
21727
  }
21505
21728
  function cardRefFromTarget(target) {
21506
21729
  if (!(target instanceof Element)) return null;
21507
- if (target.closest(CHROME_SELECTOR)) return null;
21730
+ if (target.closest(CHROME_SELECTOR2)) return null;
21508
21731
  const cardEl = target.closest("[data-ohw-pricing-card]");
21509
21732
  if (!cardEl) return null;
21510
21733
  const sectionEl2 = cardEl.closest("[data-ohw-section]");
@@ -21514,21 +21737,21 @@ function cardRefFromTarget(target) {
21514
21737
  if (!sectionId || Number.isNaN(index)) return null;
21515
21738
  return { sectionId, index };
21516
21739
  }
21517
- function sameRef(a, b) {
21740
+ function sameRef2(a, b) {
21518
21741
  return a?.sectionId === b?.sectionId && a?.index === b?.index;
21519
21742
  }
21520
- function rectOf(el) {
21743
+ function rectOf2(el) {
21521
21744
  if (!el) return null;
21522
21745
  const r2 = el.getBoundingClientRect();
21523
21746
  if (r2.width <= 0 || r2.height <= 0) return null;
21524
21747
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
21525
21748
  }
21526
21749
  function readRect3(ref) {
21527
- return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
21750
+ return rectOf2(ref && findPricingCardElement(ref.sectionId, ref.index));
21528
21751
  }
21529
21752
  function readGridRect(ref) {
21530
21753
  const card = ref && findPricingCardElement(ref.sectionId, ref.index);
21531
- return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
21754
+ return rectOf2(card?.closest("[data-ohw-pricing-collection]") ?? card);
21532
21755
  }
21533
21756
  function useLiveCardRect(ref, grid = false) {
21534
21757
  const [rect, setRect] = useState9(null);
@@ -21558,19 +21781,19 @@ function useLiveCardRect(ref, grid = false) {
21558
21781
  }
21559
21782
  var TOOLBAR_GRID_GAP = 52;
21560
21783
  var TOOLBAR_GRID_GAP_MOBILE = 42;
21561
- var TOOLBAR_EDGE_MARGIN2 = 4;
21784
+ var TOOLBAR_EDGE_MARGIN3 = 4;
21562
21785
  function GridToolbarSlot({ gridRect, children }) {
21563
21786
  const slotRef = useRef6(null);
21564
21787
  const [shift, setShift] = useState9(0);
21565
21788
  const centerX = gridRect.left + gridRect.width / 2;
21566
- useLayoutEffect4(() => {
21789
+ useLayoutEffect5(() => {
21567
21790
  const slot = slotRef.current;
21568
21791
  if (!slot) return;
21569
21792
  const clamp = () => {
21570
21793
  const w = slot.offsetWidth;
21571
21794
  if (w <= 0) return;
21572
21795
  const half = w / 2;
21573
- const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
21796
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN3 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half));
21574
21797
  setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
21575
21798
  };
21576
21799
  clamp();
@@ -21579,7 +21802,7 @@ function GridToolbarSlot({ gridRect, children }) {
21579
21802
  return () => ro.disconnect();
21580
21803
  }, [centerX, children]);
21581
21804
  const mobile = window.innerWidth <= 480;
21582
- return /* @__PURE__ */ jsx21(
21805
+ return /* @__PURE__ */ jsx22(
21583
21806
  "div",
21584
21807
  {
21585
21808
  ref: slotRef,
@@ -21614,7 +21837,7 @@ function requestValidateTree2(postToParent2, tree) {
21614
21837
  });
21615
21838
  }
21616
21839
  function StyleSwatch({ style }) {
21617
- return /* @__PURE__ */ jsx21(
21840
+ return /* @__PURE__ */ jsx22(
21618
21841
  "span",
21619
21842
  {
21620
21843
  "aria-hidden": true,
@@ -21628,35 +21851,35 @@ function StyleSwatch({ style }) {
21628
21851
  );
21629
21852
  }
21630
21853
  function ButtonGlyph() {
21631
- return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21632
- /* @__PURE__ */ jsx21("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
21633
- /* @__PURE__ */ jsx21("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
21854
+ return /* @__PURE__ */ jsxs13("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21855
+ /* @__PURE__ */ jsx22("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
21856
+ /* @__PURE__ */ jsx22("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
21634
21857
  ] });
21635
21858
  }
21636
21859
  function FeatureGlyph({ mode }) {
21637
- return /* @__PURE__ */ jsxs12("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21638
- /* @__PURE__ */ jsx21("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
21639
- /* @__PURE__ */ jsx21("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
21640
- /* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
21641
- /* @__PURE__ */ jsx21("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
21642
- /* @__PURE__ */ jsx21("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
21643
- mode === "add" && /* @__PURE__ */ jsx21("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
21860
+ return /* @__PURE__ */ jsxs13("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21861
+ /* @__PURE__ */ jsx22("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
21862
+ /* @__PURE__ */ jsx22("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
21863
+ /* @__PURE__ */ jsx22("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
21864
+ /* @__PURE__ */ jsx22("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
21865
+ /* @__PURE__ */ jsx22("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
21866
+ mode === "add" && /* @__PURE__ */ jsx22("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
21644
21867
  ] });
21645
21868
  }
21646
- function ToolbarAction({
21869
+ function ToolbarAction2({
21647
21870
  label,
21648
21871
  onClick,
21649
21872
  disabled = false,
21650
21873
  children
21651
21874
  }) {
21652
- const button = /* @__PURE__ */ jsx21(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
21653
- return /* @__PURE__ */ jsxs12(Tooltip, { children: [
21654
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: button }) : button }),
21655
- /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21875
+ const button = /* @__PURE__ */ jsx22(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
21876
+ return /* @__PURE__ */ jsxs13(Tooltip, { children: [
21877
+ /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx22("span", { className: "inline-flex", children: button }) : button }),
21878
+ /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21656
21879
  ] });
21657
21880
  }
21658
- function ToolbarSeparator() {
21659
- return /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21881
+ function ToolbarSeparator2() {
21882
+ return /* @__PURE__ */ jsx22("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21660
21883
  }
21661
21884
  function CardStyleMenu({
21662
21885
  value,
@@ -21664,7 +21887,7 @@ function CardStyleMenu({
21664
21887
  disabled = false
21665
21888
  }) {
21666
21889
  const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
21667
- const trigger = /* @__PURE__ */ jsxs12(
21890
+ const trigger = /* @__PURE__ */ jsxs13(
21668
21891
  "button",
21669
21892
  {
21670
21893
  type: "button",
@@ -21675,28 +21898,28 @@ function CardStyleMenu({
21675
21898
  disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
21676
21899
  ),
21677
21900
  children: [
21678
- /* @__PURE__ */ jsx21(StyleSwatch, { style: current.value }),
21679
- /* @__PURE__ */ jsx21("span", { className: "flex-1 text-left", children: current.label }),
21680
- /* @__PURE__ */ jsx21(ChevronDown3, { size: 16, style: { pointerEvents: "none" } })
21901
+ /* @__PURE__ */ jsx22(StyleSwatch, { style: current.value }),
21902
+ /* @__PURE__ */ jsx22("span", { className: "flex-1 text-left", children: current.label }),
21903
+ /* @__PURE__ */ jsx22(ChevronDown4, { size: 16, style: { pointerEvents: "none" } })
21681
21904
  ]
21682
21905
  }
21683
21906
  );
21684
21907
  if (disabled) {
21685
- return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21686
- /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
21687
- /* @__PURE__ */ jsxs12(Tooltip, { children: [
21688
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21("span", { className: "inline-flex", children: trigger }) }),
21689
- /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
21908
+ return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21909
+ /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
21910
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
21911
+ /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22("span", { className: "inline-flex", children: trigger }) }),
21912
+ /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
21690
21913
  ] })
21691
21914
  ] });
21692
21915
  }
21693
- return /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21694
- /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
21695
- /* @__PURE__ */ jsxs12(DropdownMenu, { modal: false, children: [
21696
- /* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
21697
- /* @__PURE__ */ jsx21(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
21916
+ return /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21917
+ /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
21918
+ /* @__PURE__ */ jsxs13(DropdownMenu, { modal: false, children: [
21919
+ /* @__PURE__ */ jsx22(DropdownMenuTrigger, { asChild: true, children: trigger }),
21920
+ /* @__PURE__ */ jsx22(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
21698
21921
  const selected = style.value === value;
21699
- return /* @__PURE__ */ jsxs12(
21922
+ return /* @__PURE__ */ jsxs13(
21700
21923
  DropdownMenuItem,
21701
21924
  {
21702
21925
  role: "menuitemradio",
@@ -21704,9 +21927,9 @@ function CardStyleMenu({
21704
21927
  onSelect: () => onChange(style.value),
21705
21928
  className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
21706
21929
  children: [
21707
- /* @__PURE__ */ jsx21(StyleSwatch, { style: style.value }),
21708
- /* @__PURE__ */ jsx21("span", { children: style.label }),
21709
- selected && /* @__PURE__ */ jsx21(Check2, { size: 16, className: "text-bridge-primary" })
21930
+ /* @__PURE__ */ jsx22(StyleSwatch, { style: style.value }),
21931
+ /* @__PURE__ */ jsx22("span", { children: style.label }),
21932
+ selected && /* @__PURE__ */ jsx22(Check3, { size: 16, className: "text-bridge-primary" })
21710
21933
  ]
21711
21934
  },
21712
21935
  style.value
@@ -21736,7 +21959,7 @@ function PricingCardToolbar({
21736
21959
  const style = pricingCardStyle(entry.tree, index);
21737
21960
  const featuredTag = pricingCardFeaturedTag(entry.tree, index);
21738
21961
  const mobile = window.innerWidth <= 480;
21739
- return /* @__PURE__ */ jsx21(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs12(
21962
+ return /* @__PURE__ */ jsx22(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs13(
21740
21963
  "div",
21741
21964
  {
21742
21965
  "data-ohw-bridge": "",
@@ -21748,7 +21971,7 @@ function PricingCardToolbar({
21748
21971
  ),
21749
21972
  style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
21750
21973
  children: [
21751
- /* @__PURE__ */ jsxs12(
21974
+ /* @__PURE__ */ jsxs13(
21752
21975
  "div",
21753
21976
  {
21754
21977
  className: cn(
@@ -21757,8 +21980,8 @@ function PricingCardToolbar({
21757
21980
  mobile ? "flex-wrap justify-center" : "flex-nowrap"
21758
21981
  ),
21759
21982
  children: [
21760
- /* @__PURE__ */ jsxs12(Tooltip, { children: [
21761
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
21983
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
21984
+ /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
21762
21985
  CustomToolbarButton,
21763
21986
  {
21764
21987
  type: "button",
@@ -21766,7 +21989,7 @@ function PricingCardToolbar({
21766
21989
  "aria-pressed": featuredTag,
21767
21990
  onClick: () => onSetFeaturedTag(!featuredTag),
21768
21991
  className: "group size-8",
21769
- children: /* @__PURE__ */ jsx21(
21992
+ children: /* @__PURE__ */ jsx22(
21770
21993
  Star2,
21771
21994
  {
21772
21995
  size: 16,
@@ -21781,25 +22004,25 @@ function PricingCardToolbar({
21781
22004
  )
21782
22005
  }
21783
22006
  ) }),
21784
- /* @__PURE__ */ jsx21(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
22007
+ /* @__PURE__ */ jsx22(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
21785
22008
  ] }),
21786
- /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21787
- /* @__PURE__ */ jsx21(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
21788
- /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21789
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx21(ButtonGlyph, {}) }),
21790
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs12("span", { className: "relative inline-flex", children: [
21791
- /* @__PURE__ */ jsx21(ButtonGlyph, {}),
21792
- /* @__PURE__ */ jsx21(Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
22009
+ /* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
22010
+ /* @__PURE__ */ jsx22(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
22011
+ /* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
22012
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ jsx22(ButtonGlyph, {}) }),
22013
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ jsxs13("span", { className: "relative inline-flex", children: [
22014
+ /* @__PURE__ */ jsx22(ButtonGlyph, {}),
22015
+ /* @__PURE__ */ jsx22(Minus2, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
21793
22016
  ] }) }),
21794
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "add" }) }),
21795
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx21(FeatureGlyph, { mode: "remove" }) }),
21796
- /* @__PURE__ */ jsx21(ToolbarSeparator, {}),
21797
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx21(Plus2, { size: 16, style: { pointerEvents: "none" } }) }),
21798
- /* @__PURE__ */ jsx21(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx21(Minus, { size: 16, style: { pointerEvents: "none" } }) })
22017
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ jsx22(FeatureGlyph, { mode: "add" }) }),
22018
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ jsx22(FeatureGlyph, { mode: "remove" }) }),
22019
+ /* @__PURE__ */ jsx22(ToolbarSeparator2, {}),
22020
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ jsx22(Plus3, { size: 16, style: { pointerEvents: "none" } }) }),
22021
+ /* @__PURE__ */ jsx22(ToolbarAction2, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ jsx22(Minus2, { size: 16, style: { pointerEvents: "none" } }) })
21799
22022
  ]
21800
22023
  }
21801
22024
  ),
21802
- error && /* @__PURE__ */ jsx21("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
22025
+ error && /* @__PURE__ */ jsx22("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
21803
22026
  ]
21804
22027
  }
21805
22028
  ) });
@@ -21833,7 +22056,7 @@ function AiPricingCardOverlay({
21833
22056
  const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
21834
22057
  setHover((prev) => {
21835
22058
  const next = ref && !overEditable ? ref : null;
21836
- return sameRef(prev, next) ? prev : next;
22059
+ return sameRef2(prev, next) ? prev : next;
21837
22060
  });
21838
22061
  };
21839
22062
  const onLeave = () => setHover(null);
@@ -21848,10 +22071,10 @@ function AiPricingCardOverlay({
21848
22071
  const onClick = (e) => {
21849
22072
  const t = e.target;
21850
22073
  if (!(t instanceof Element)) return;
21851
- if (t.closest(CHROME_SELECTOR)) return;
22074
+ if (t.closest(CHROME_SELECTOR2)) return;
21852
22075
  const ref = cardRefFromTarget(t);
21853
- setActive((prev) => sameRef(prev, ref) ? prev : ref);
21854
- if (!ref || !sameRef(activeRef.current, ref)) setError(null);
22076
+ setActive((prev) => sameRef2(prev, ref) ? prev : ref);
22077
+ if (!ref || !sameRef2(activeRef.current, ref)) setError(null);
21855
22078
  };
21856
22079
  document.addEventListener("click", onClick, true);
21857
22080
  return () => document.removeEventListener("click", onClick, true);
@@ -21916,12 +22139,12 @@ function AiPricingCardOverlay({
21916
22139
  const activeEntry = active ? findEntry(active.sectionId) : null;
21917
22140
  const activeCardRect = useLiveCardRect(active);
21918
22141
  const activeGridRect = useLiveCardRect(active, true);
21919
- const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
21920
- return /* @__PURE__ */ jsxs12(Fragment8, { children: [
21921
- hoverRect && /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
21922
- activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs12(Fragment8, { children: [
21923
- /* @__PURE__ */ jsx21(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
21924
- /* @__PURE__ */ jsx21(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx21(
22142
+ const hoverRect = useLiveCardRect(hover && !sameRef2(hover, active) ? hover : null);
22143
+ return /* @__PURE__ */ jsxs13(Fragment8, { children: [
22144
+ hoverRect && /* @__PURE__ */ jsx22(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
22145
+ activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ jsxs13(Fragment8, { children: [
22146
+ /* @__PURE__ */ jsx22(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
22147
+ /* @__PURE__ */ jsx22(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ jsx22(
21925
22148
  PricingCardToolbar,
21926
22149
  {
21927
22150
  entry: activeEntry,
@@ -21949,7 +22172,7 @@ function AiPricingCardOverlay({
21949
22172
  onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
21950
22173
  }
21951
22174
  ) }),
21952
- /* @__PURE__ */ jsx21(
22175
+ /* @__PURE__ */ jsx22(
21953
22176
  "div",
21954
22177
  {
21955
22178
  "data-ohw-bridge": "",
@@ -22014,10 +22237,10 @@ function clearVideo(tree, path) {
22014
22237
  }
22015
22238
 
22016
22239
  // src/ui/ai-section/AiVideoOverlay.tsx
22017
- import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
22240
+ import { Fragment as Fragment9, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
22018
22241
  var PRIMARY5 = "#0885FE";
22019
- var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
22020
- var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
22242
+ var OHW_BLUE = `var(--ohw-primary, ${PRIMARY5})`;
22243
+ var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
22021
22244
  function findVideoBlockElement(sectionId, path) {
22022
22245
  const sectionEl2 = findByInstanceId(sectionId);
22023
22246
  if (!sectionEl2) return null;
@@ -22077,12 +22300,12 @@ function requestValidateTree3(postToParent2, tree) {
22077
22300
  postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
22078
22301
  });
22079
22302
  }
22080
- function Pill2({
22303
+ function Pill({
22081
22304
  label,
22082
22305
  onClick,
22083
22306
  disabled
22084
22307
  }) {
22085
- return /* @__PURE__ */ jsx22(
22308
+ return /* @__PURE__ */ jsx23(
22086
22309
  "button",
22087
22310
  {
22088
22311
  type: "button",
@@ -22098,7 +22321,7 @@ function Pill2({
22098
22321
  border: "none",
22099
22322
  cursor: disabled ? "default" : "pointer",
22100
22323
  background: "#ffffff",
22101
- color: OHW_BLUE_DARK2,
22324
+ color: OHW_BLUE_DARK,
22102
22325
  opacity: disabled ? 0.4 : 1,
22103
22326
  fontSize: 12,
22104
22327
  lineHeight: "16px",
@@ -22141,8 +22364,8 @@ function VideoUrlInput({ value, onCommit }) {
22141
22364
  onCommit(id);
22142
22365
  }
22143
22366
  };
22144
- return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
22145
- /* @__PURE__ */ jsxs13(
22367
+ return /* @__PURE__ */ jsxs14("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
22368
+ /* @__PURE__ */ jsxs14(
22146
22369
  "div",
22147
22370
  {
22148
22371
  style: {
@@ -22158,12 +22381,12 @@ function VideoUrlInput({ value, onCommit }) {
22158
22381
  boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
22159
22382
  },
22160
22383
  children: [
22161
- /* @__PURE__ */ jsx22(
22384
+ /* @__PURE__ */ jsx23(
22162
22385
  "span",
22163
22386
  {
22164
22387
  style: {
22165
22388
  flex: "0 0 auto",
22166
- color: OHW_BLUE_DARK2,
22389
+ color: OHW_BLUE_DARK,
22167
22390
  fontSize: 10,
22168
22391
  lineHeight: "16px",
22169
22392
  fontWeight: 700,
@@ -22173,7 +22396,7 @@ function VideoUrlInput({ value, onCommit }) {
22173
22396
  children: "Video"
22174
22397
  }
22175
22398
  ),
22176
- /* @__PURE__ */ jsx22(
22399
+ /* @__PURE__ */ jsx23(
22177
22400
  "input",
22178
22401
  {
22179
22402
  type: "text",
@@ -22210,7 +22433,7 @@ function VideoUrlInput({ value, onCommit }) {
22210
22433
  ]
22211
22434
  }
22212
22435
  ),
22213
- invalid && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
22436
+ invalid && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
22214
22437
  ] });
22215
22438
  }
22216
22439
  function VideoToolbar({
@@ -22220,7 +22443,7 @@ function VideoToolbar({
22220
22443
  onSetVideoId,
22221
22444
  onRemove
22222
22445
  }) {
22223
- return /* @__PURE__ */ jsxs13(
22446
+ return /* @__PURE__ */ jsxs14(
22224
22447
  "div",
22225
22448
  {
22226
22449
  "data-ohw-bridge": "",
@@ -22232,7 +22455,7 @@ function VideoToolbar({
22232
22455
  gap: 6,
22233
22456
  alignItems: "center",
22234
22457
  width: 280,
22235
- background: OHW_BLUE2,
22458
+ background: OHW_BLUE,
22236
22459
  padding: 8,
22237
22460
  borderRadius: 12,
22238
22461
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -22240,9 +22463,9 @@ function VideoToolbar({
22240
22463
  opacity: pending ? 0.6 : 1
22241
22464
  },
22242
22465
  children: [
22243
- /* @__PURE__ */ jsx22(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
22244
- /* @__PURE__ */ jsx22(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
22245
- error && /* @__PURE__ */ jsx22("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22466
+ /* @__PURE__ */ jsx23(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
22467
+ /* @__PURE__ */ jsx23(Pill, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
22468
+ error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22246
22469
  ]
22247
22470
  }
22248
22471
  );
@@ -22362,8 +22585,8 @@ function AiVideoOverlay({
22362
22585
  const activeBlockRect = useLiveBlockRect(active);
22363
22586
  const TOOLBAR_APPROX_H = 90;
22364
22587
  const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
22365
- return /* @__PURE__ */ jsxs13(Fragment9, { children: [
22366
- hoverHandleRect && hover && /* @__PURE__ */ jsx22(
22588
+ return /* @__PURE__ */ jsxs14(Fragment9, { children: [
22589
+ hoverHandleRect && hover && /* @__PURE__ */ jsx23(
22367
22590
  "button",
22368
22591
  {
22369
22592
  type: "button",
@@ -22391,15 +22614,15 @@ function AiVideoOverlay({
22391
22614
  fontSize: 14,
22392
22615
  fontWeight: 700
22393
22616
  },
22394
- children: /* @__PURE__ */ jsx22(Star3, { size: 14, style: { pointerEvents: "none" } })
22617
+ children: /* @__PURE__ */ jsx23(Star3, { size: 14, style: { pointerEvents: "none" } })
22395
22618
  }
22396
22619
  ),
22397
- activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx22(
22620
+ activeBlockRect && active && activeEntry && /* @__PURE__ */ jsx23(
22398
22621
  ItemInteractionLayer,
22399
22622
  {
22400
22623
  rect: activeBlockRect,
22401
22624
  state: toolbarState,
22402
- toolbar: /* @__PURE__ */ jsx22(
22625
+ toolbar: /* @__PURE__ */ jsx23(
22403
22626
  VideoToolbar,
22404
22627
  {
22405
22628
  videoId: videoIdAt(activeEntry.tree, active.path),
@@ -22474,10 +22697,10 @@ function setCarouselAutoplay(tree, on) {
22474
22697
  }
22475
22698
 
22476
22699
  // src/ui/ai-section/AiFadeCarouselOverlay.tsx
22477
- import { Fragment as Fragment10, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
22700
+ import { Fragment as Fragment10, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
22478
22701
  var PRIMARY6 = "#0885FE";
22479
- var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
22480
- var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
22702
+ var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY6})`;
22703
+ var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
22481
22704
  function findCarouselItemElement(sectionId, index) {
22482
22705
  const sectionEl2 = findByInstanceId(sectionId);
22483
22706
  if (!sectionEl2) return null;
@@ -22556,8 +22779,8 @@ function requestAssetPick2(postToParent2) {
22556
22779
  postToParent2({ type: "ow:asset-pick", id });
22557
22780
  });
22558
22781
  }
22559
- function Pill3({ label, onClick, disabled }) {
22560
- return /* @__PURE__ */ jsx23(
22782
+ function Pill2({ label, onClick, disabled }) {
22783
+ return /* @__PURE__ */ jsx24(
22561
22784
  "button",
22562
22785
  {
22563
22786
  type: "button",
@@ -22573,7 +22796,7 @@ function Pill3({ label, onClick, disabled }) {
22573
22796
  border: "none",
22574
22797
  cursor: disabled ? "default" : "pointer",
22575
22798
  background: "#ffffff",
22576
- color: OHW_BLUE_DARK3,
22799
+ color: OHW_BLUE_DARK2,
22577
22800
  opacity: disabled ? 0.4 : 1,
22578
22801
  fontSize: 12,
22579
22802
  lineHeight: "16px",
@@ -22591,7 +22814,7 @@ function TogglePill({
22591
22814
  onToggle,
22592
22815
  disabled
22593
22816
  }) {
22594
- return /* @__PURE__ */ jsxs14(
22817
+ return /* @__PURE__ */ jsxs15(
22595
22818
  "button",
22596
22819
  {
22597
22820
  type: "button",
@@ -22610,7 +22833,7 @@ function TogglePill({
22610
22833
  border: "none",
22611
22834
  cursor: disabled ? "default" : "pointer",
22612
22835
  background: "#ffffff",
22613
- color: OHW_BLUE_DARK3,
22836
+ color: OHW_BLUE_DARK2,
22614
22837
  opacity: disabled ? 0.4 : 1,
22615
22838
  fontSize: 12,
22616
22839
  lineHeight: "16px",
@@ -22620,7 +22843,7 @@ function TogglePill({
22620
22843
  },
22621
22844
  children: [
22622
22845
  label,
22623
- /* @__PURE__ */ jsx23(
22846
+ /* @__PURE__ */ jsx24(
22624
22847
  "span",
22625
22848
  {
22626
22849
  "aria-hidden": true,
@@ -22633,10 +22856,10 @@ function TogglePill({
22633
22856
  // Off is a grey track, not a washed-out blue: the pill's own white background already
22634
22857
  // carries the brand colour in the text, and a pale blue track next to it read as
22635
22858
  // "disabled control" rather than "switch that is off".
22636
- background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
22859
+ background: on ? OHW_BLUE_DARK2 : "#CBD5E1",
22637
22860
  transition: "background 120ms ease"
22638
22861
  },
22639
- children: /* @__PURE__ */ jsx23(
22862
+ children: /* @__PURE__ */ jsx24(
22640
22863
  "span",
22641
22864
  {
22642
22865
  style: {
@@ -22665,7 +22888,7 @@ function CarouselSlideToolbar({
22665
22888
  onChangeImage,
22666
22889
  onToggleAutoplay
22667
22890
  }) {
22668
- return /* @__PURE__ */ jsxs14(
22891
+ return /* @__PURE__ */ jsxs15(
22669
22892
  "div",
22670
22893
  {
22671
22894
  "data-ohw-bridge": "",
@@ -22676,7 +22899,7 @@ function CarouselSlideToolbar({
22676
22899
  flexDirection: "column",
22677
22900
  gap: 6,
22678
22901
  alignItems: "center",
22679
- background: OHW_BLUE3,
22902
+ background: OHW_BLUE2,
22680
22903
  padding: 8,
22681
22904
  borderRadius: 12,
22682
22905
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -22688,11 +22911,11 @@ function CarouselSlideToolbar({
22688
22911
  pointerEvents: pending ? "none" : "auto"
22689
22912
  },
22690
22913
  children: [
22691
- /* @__PURE__ */ jsxs14("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
22692
- /* @__PURE__ */ jsx23(Pill3, { label: "Change Image", onClick: onChangeImage }),
22693
- /* @__PURE__ */ jsx23(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
22914
+ /* @__PURE__ */ jsxs15("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
22915
+ /* @__PURE__ */ jsx24(Pill2, { label: "Change Image", onClick: onChangeImage }),
22916
+ /* @__PURE__ */ jsx24(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
22694
22917
  ] }),
22695
- error && /* @__PURE__ */ jsx23("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22918
+ error && /* @__PURE__ */ jsx24("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22696
22919
  ]
22697
22920
  }
22698
22921
  );
@@ -22832,8 +23055,8 @@ function AiFadeCarouselOverlay({
22832
23055
  const activeItemRect = useLiveItemRect2(active);
22833
23056
  const TOOLBAR_APPROX_H = 90;
22834
23057
  const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
22835
- return /* @__PURE__ */ jsxs14(Fragment10, { children: [
22836
- hoverHandleRect && hover && /* @__PURE__ */ jsx23(
23058
+ return /* @__PURE__ */ jsxs15(Fragment10, { children: [
23059
+ hoverHandleRect && hover && /* @__PURE__ */ jsx24(
22837
23060
  "button",
22838
23061
  {
22839
23062
  type: "button",
@@ -22862,10 +23085,10 @@ function AiFadeCarouselOverlay({
22862
23085
  fontSize: 14,
22863
23086
  fontWeight: 700
22864
23087
  },
22865
- children: /* @__PURE__ */ jsx23(Star4, { size: 14, style: { pointerEvents: "none" } })
23088
+ children: /* @__PURE__ */ jsx24(Star4, { size: 14, style: { pointerEvents: "none" } })
22866
23089
  }
22867
23090
  ),
22868
- swapping && /* @__PURE__ */ jsx23(
23091
+ swapping && /* @__PURE__ */ jsx24(
22869
23092
  "div",
22870
23093
  {
22871
23094
  ref: skeletonRef,
@@ -22883,15 +23106,15 @@ function AiFadeCarouselOverlay({
22883
23106
  zIndex: 2147483646,
22884
23107
  pointerEvents: "none"
22885
23108
  },
22886
- children: /* @__PURE__ */ jsx23("style", { children: MEDIA_SKELETON_CSS })
23109
+ children: /* @__PURE__ */ jsx24("style", { children: MEDIA_SKELETON_CSS })
22887
23110
  }
22888
23111
  ),
22889
- activeItemRect && active && activeEntry && /* @__PURE__ */ jsx23(
23112
+ activeItemRect && active && activeEntry && /* @__PURE__ */ jsx24(
22890
23113
  ItemInteractionLayer,
22891
23114
  {
22892
23115
  rect: activeItemRect,
22893
23116
  state: toolbarState,
22894
- toolbar: /* @__PURE__ */ jsx23(
23117
+ toolbar: /* @__PURE__ */ jsx24(
22895
23118
  CarouselSlideToolbar,
22896
23119
  {
22897
23120
  pending,
@@ -23129,118 +23352,11 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
23129
23352
  // src/ui/link-modal/LinkPopover.tsx
23130
23353
  import { useEffect as useEffect17 } from "react";
23131
23354
 
23132
- // src/ui/dialog.tsx
23133
- import * as React9 from "react";
23134
- import { Dialog as DialogPrimitive } from "radix-ui";
23135
- import { X as X2 } from "lucide-react";
23136
- import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
23137
- function Dialog2({
23138
- ...props
23139
- }) {
23140
- return /* @__PURE__ */ jsx24(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
23141
- }
23142
- function DialogPortal({
23143
- ...props
23144
- }) {
23145
- return /* @__PURE__ */ jsx24(DialogPrimitive.Portal, { ...props });
23146
- }
23147
- function DialogOverlay({
23148
- className,
23149
- ...props
23150
- }) {
23151
- return /* @__PURE__ */ jsx24(
23152
- DialogPrimitive.Overlay,
23153
- {
23154
- "data-slot": "dialog-overlay",
23155
- "data-ohw-link-modal-root": "",
23156
- className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
23157
- ...props
23158
- }
23159
- );
23160
- }
23161
- var DialogContent = React9.forwardRef(
23162
- ({ className, children, showCloseButton = true, container, ...props }, ref) => {
23163
- const positionMode = container ? "absolute" : "fixed";
23164
- return /* @__PURE__ */ jsxs15(DialogPortal, { container: container ?? void 0, children: [
23165
- /* @__PURE__ */ jsx24(DialogOverlay, { className: cn(positionMode, "inset-0") }),
23166
- /* @__PURE__ */ jsxs15(
23167
- DialogPrimitive.Content,
23168
- {
23169
- ref,
23170
- "data-slot": "dialog-content",
23171
- className: cn(
23172
- positionMode,
23173
- "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",
23174
- "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
23175
- container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
23176
- className
23177
- ),
23178
- onMouseDown: (e) => e.stopPropagation(),
23179
- ...props,
23180
- children: [
23181
- children,
23182
- showCloseButton ? /* @__PURE__ */ jsx24(
23183
- DialogPrimitive.Close,
23184
- {
23185
- type: "button",
23186
- className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
23187
- "aria-label": "Close",
23188
- children: /* @__PURE__ */ jsx24(X2, { size: 16, "aria-hidden": true })
23189
- }
23190
- ) : null
23191
- ]
23192
- }
23193
- )
23194
- ] });
23195
- }
23196
- );
23197
- DialogContent.displayName = DialogPrimitive.Content.displayName;
23198
- function DialogHeader({
23199
- className,
23200
- ...props
23201
- }) {
23202
- return /* @__PURE__ */ jsx24("div", { className: cn("flex flex-col gap-1.5", className), ...props });
23203
- }
23204
- function DialogFooter({
23205
- className,
23206
- ...props
23207
- }) {
23208
- return /* @__PURE__ */ jsx24(
23209
- "div",
23210
- {
23211
- className: cn("flex items-center justify-end gap-2", className),
23212
- ...props
23213
- }
23214
- );
23215
- }
23216
- var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
23217
- DialogPrimitive.Title,
23218
- {
23219
- ref,
23220
- className: cn(
23221
- "text-lg font-semibold leading-none tracking-tight text-card-foreground",
23222
- className
23223
- ),
23224
- ...props
23225
- }
23226
- ));
23227
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
23228
- var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
23229
- DialogPrimitive.Description,
23230
- {
23231
- ref,
23232
- className: cn("text-sm text-muted-foreground", className),
23233
- ...props
23234
- }
23235
- ));
23236
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
23237
- var DialogClose = DialogPrimitive.Close;
23238
-
23239
23355
  // src/ui/link-modal/LinkEditorPanel.tsx
23240
23356
  import { Info, X as X4 } from "lucide-react";
23241
23357
 
23242
23358
  // src/ui/link-modal/DestinationBreadcrumb.tsx
23243
- import { ArrowRight as ArrowRight2, File, GalleryVertical } from "lucide-react";
23359
+ import { ArrowRight as ArrowRight3, File, GalleryVertical } from "lucide-react";
23244
23360
  import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
23245
23361
  function DestinationBreadcrumb({
23246
23362
  pageTitle,
@@ -23254,7 +23370,7 @@ function DestinationBreadcrumb({
23254
23370
  /* @__PURE__ */ jsx25("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
23255
23371
  ] }),
23256
23372
  /* @__PURE__ */ jsx25(
23257
- ArrowRight2,
23373
+ ArrowRight3,
23258
23374
  {
23259
23375
  size: 16,
23260
23376
  className: "shrink-0 text-muted-foreground",
@@ -23366,7 +23482,7 @@ function Label({ className, ...props }) {
23366
23482
  }
23367
23483
 
23368
23484
  // src/ui/link-modal/UrlOrPageInput.tsx
23369
- import { ChevronDown as ChevronDown4, File as File2, X as X3 } from "lucide-react";
23485
+ import { ChevronDown as ChevronDown5, File as File2, X as X3 } from "lucide-react";
23370
23486
  import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
23371
23487
  function FieldChevron({
23372
23488
  onClick
@@ -23379,7 +23495,7 @@ function FieldChevron({
23379
23495
  onClick,
23380
23496
  "aria-label": "Open page list",
23381
23497
  tabIndex: -1,
23382
- children: /* @__PURE__ */ jsx29(ChevronDown4, { size: 16 })
23498
+ children: /* @__PURE__ */ jsx29(ChevronDown5, { size: 16 })
23383
23499
  }
23384
23500
  );
23385
23501
  }
@@ -23609,7 +23725,7 @@ function LinkEditorPanel({ state, onClose }) {
23609
23725
  // src/ui/link-modal/SectionPickerOverlay.tsx
23610
23726
  import { useCallback as useCallback7, useEffect as useEffect15, useMemo as useMemo2, useRef as useRef10, useState as useState13 } from "react";
23611
23727
  import { createPortal as createPortal2 } from "react-dom";
23612
- import { ArrowLeft as ArrowLeft2, Check as Check3 } from "lucide-react";
23728
+ import { ArrowLeft as ArrowLeft3, Check as Check4 } from "lucide-react";
23613
23729
  import { usePathname as usePathname2, useRouter as useRouter2 } from "next/navigation";
23614
23730
 
23615
23731
  // src/lib/parent-scroll.ts
@@ -23886,7 +24002,7 @@ function SectionPickerOverlay({
23886
24002
  className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
23887
24003
  onClick: onBack,
23888
24004
  children: [
23889
- /* @__PURE__ */ jsx31(ArrowLeft2, { className: "size-4 shrink-0", "aria-hidden": true }),
24005
+ /* @__PURE__ */ jsx31(ArrowLeft3, { className: "size-4 shrink-0", "aria-hidden": true }),
23890
24006
  "Back"
23891
24007
  ]
23892
24008
  }
@@ -23955,7 +24071,7 @@ function SectionPickerOverlay({
23955
24071
  className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
23956
24072
  style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
23957
24073
  "aria-hidden": true,
23958
- children: /* @__PURE__ */ jsx31(Check3, { className: "size-5" })
24074
+ children: /* @__PURE__ */ jsx31(Check4, { className: "size-5" })
23959
24075
  }
23960
24076
  ) : null
23961
24077
  ]
@@ -24339,6 +24455,7 @@ function shouldUseDevFixtures() {
24339
24455
  function getLogoElement(el) {
24340
24456
  const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
24341
24457
  if (marked) return marked;
24458
+ if (el.closest('[data-ohw-editable="icon"]')) return null;
24342
24459
  const root = el.closest("nav, [data-ohw-nav-root], footer");
24343
24460
  if (!root) return null;
24344
24461
  const anchor = el.closest("a");
@@ -24408,7 +24525,7 @@ function addFooterColumnWithPersist({
24408
24525
  import {
24409
24526
  useCallback as useCallback9,
24410
24527
  useEffect as useEffect18,
24411
- useLayoutEffect as useLayoutEffect5,
24528
+ useLayoutEffect as useLayoutEffect6,
24412
24529
  useRef as useRef11,
24413
24530
  useState as useState15
24414
24531
  } from "react";
@@ -24505,7 +24622,7 @@ function FloatingPanel({
24505
24622
  return () => window.removeEventListener("message", onParentScroll);
24506
24623
  }, [open]);
24507
24624
  const positionRef = useRef11(position);
24508
- useLayoutEffect5(() => {
24625
+ useLayoutEffect6(() => {
24509
24626
  if (!open) {
24510
24627
  positionRef.current = position;
24511
24628
  return;
@@ -24515,7 +24632,7 @@ function FloatingPanel({
24515
24632
  }
24516
24633
  positionRef.current = position;
24517
24634
  }, [open, position, liveScroll, parentScroll]);
24518
- useLayoutEffect5(() => {
24635
+ useLayoutEffect6(() => {
24519
24636
  if (!open || !panelRef.current) return;
24520
24637
  const el = panelRef.current;
24521
24638
  const header = el.querySelector("[data-ohw-floating-panel-header]");
@@ -24724,7 +24841,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
24724
24841
  }
24725
24842
 
24726
24843
  // src/ui/button-style-panel.tsx
24727
- import { Check as Check4 } from "lucide-react";
24844
+ import { Check as Check5 } from "lucide-react";
24728
24845
  import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
24729
24846
  var SIZE_LABEL = { s: "S", m: "M", l: "L" };
24730
24847
  function ButtonStylePanel({
@@ -24795,7 +24912,7 @@ function ButtonStylePanel({
24795
24912
  {
24796
24913
  className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
24797
24914
  "aria-hidden": true,
24798
- children: /* @__PURE__ */ jsx35(Check4, { className: "size-3", strokeWidth: 3 })
24915
+ children: /* @__PURE__ */ jsx35(Check5, { className: "size-3", strokeWidth: 3 })
24799
24916
  }
24800
24917
  ) : null
24801
24918
  ]
@@ -25827,7 +25944,7 @@ function useSectionDrag({
25827
25944
  }
25828
25945
 
25829
25946
  // src/ui/footer-container-chrome.tsx
25830
- import { Plus as Plus3 } from "lucide-react";
25947
+ import { Plus as Plus4 } from "lucide-react";
25831
25948
  import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
25832
25949
  function FooterContainerChrome({
25833
25950
  rect,
@@ -25868,7 +25985,7 @@ function FooterContainerChrome({
25868
25985
  if (addDisabled) return;
25869
25986
  onAdd();
25870
25987
  },
25871
- children: /* @__PURE__ */ jsx36(Plus3, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
25988
+ children: /* @__PURE__ */ jsx36(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
25872
25989
  }
25873
25990
  ) }),
25874
25991
  /* @__PURE__ */ jsx36(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
@@ -26275,7 +26392,7 @@ function retargetPageLinks(change, deps) {
26275
26392
  }
26276
26393
 
26277
26394
  // src/ui/navbar-container-chrome.tsx
26278
- import { Plus as Plus4 } from "lucide-react";
26395
+ import { Plus as Plus5 } from "lucide-react";
26279
26396
  import { jsx as jsx37 } from "react/jsx-runtime";
26280
26397
  function NavbarContainerChrome({
26281
26398
  rect,
@@ -26311,7 +26428,7 @@ function NavbarContainerChrome({
26311
26428
  e.stopPropagation();
26312
26429
  onAdd();
26313
26430
  },
26314
- children: /* @__PURE__ */ jsx37(Plus4, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
26431
+ children: /* @__PURE__ */ jsx37(Plus5, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
26315
26432
  }
26316
26433
  )
26317
26434
  }
@@ -26383,7 +26500,7 @@ function Badge({ className, variant, ...props }) {
26383
26500
  }
26384
26501
 
26385
26502
  // src/OhhwellsBridge.tsx
26386
- import { Brush as Brush2, Link as Link2, Plus as Plus5, Settings, Trash2 as Trash24 } from "lucide-react";
26503
+ import { Brush as Brush2, Link as Link2, Plus as Plus6, Settings, Trash2 as Trash24 } from "lucide-react";
26387
26504
  import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
26388
26505
  var PRIMARY7 = "#0885FE";
26389
26506
  var IMAGE_FADE_MS = 300;
@@ -27161,7 +27278,7 @@ function getNavigationSelectionParent(el) {
27161
27278
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
27162
27279
  return resolveFooterLinksContainerFrom(el);
27163
27280
  }
27164
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
27281
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup2(el)) {
27165
27282
  return getNavigationRoot(el);
27166
27283
  }
27167
27284
  return null;
@@ -27383,7 +27500,6 @@ var ICONS = {
27383
27500
  insertUnorderedList: '<line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/>',
27384
27501
  insertOrderedList: '<line x1="10" y1="6" x2="21" y2="6"/><line x1="10" y1="12" x2="21" y2="12"/><line x1="10" y1="18" x2="21" y2="18"/><path d="M4 6h1v4"/><path d="M4 10h2"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/>'
27385
27502
  };
27386
- var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
27387
27503
  var SELECTION_CHROME_GAP2 = 4;
27388
27504
  var TOOLBAR_STROKE_GAP2 = 4;
27389
27505
  var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
@@ -27481,7 +27597,7 @@ function applyVisibleViewport(el, parentScroll) {
27481
27597
  el.style.top = `${top}px`;
27482
27598
  el.style.height = `${height}px`;
27483
27599
  }
27484
- var TOOLBAR_EDGE_MARGIN3 = 4;
27600
+ var TOOLBAR_EDGE_MARGIN4 = 4;
27485
27601
  function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
27486
27602
  const isAbove = transform.includes("translateY(-100%)");
27487
27603
  let visualTop = isAbove ? top - approxH : top;
@@ -27508,8 +27624,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
27508
27624
  function clampToolbarLeft(centerX, toolbarWidth) {
27509
27625
  const half = toolbarWidth / 2;
27510
27626
  return Math.max(
27511
- TOOLBAR_EDGE_MARGIN3 + half,
27512
- Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
27627
+ TOOLBAR_EDGE_MARGIN4 + half,
27628
+ Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN4 - half)
27513
27629
  );
27514
27630
  }
27515
27631
  function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
@@ -27934,7 +28050,7 @@ function OhhwellsBridge() {
27934
28050
  }, []);
27935
28051
  const subdomainFromQuery = searchParams.get("subdomain");
27936
28052
  const [subdomain, setSubdomain] = useState18(() => resolveSubdomain(subdomainFromQuery));
27937
- useLayoutEffect6(() => {
28053
+ useLayoutEffect7(() => {
27938
28054
  const next = resolveSubdomain(subdomainFromQuery);
27939
28055
  if (next !== subdomain) setSubdomain(next);
27940
28056
  if (next) return;
@@ -28421,21 +28537,6 @@ function OhhwellsBridge() {
28421
28537
  const [isItemDragging, setIsItemDragging] = useState18(false);
28422
28538
  const [isFooterFrameSelection, setIsFooterFrameSelection] = useState18(false);
28423
28539
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
28424
- const [floatingPanel, setFloatingPanel] = useState18(null);
28425
- const floatingPanelOpenRef = useRef14(false);
28426
- floatingPanelOpenRef.current = floatingPanel !== null;
28427
- const floatingPanelRef = useRef14(null);
28428
- floatingPanelRef.current = floatingPanel;
28429
- const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
28430
- const buttonCollectionDragRef = useRef14(null);
28431
- const buttonDropInsertIndexRef = useRef14(null);
28432
- const [buttonDropSlots, setButtonDropSlots] = useState18([]);
28433
- const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
28434
- const buttonPointerDragRef = useRef14(null);
28435
- const [buttonStyleTick, setButtonStyleTick] = useState18(0);
28436
- const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
28437
- const [editorViewport, setEditorViewport] = useState18("desktop");
28438
- const [parentScrollSnap, setParentScrollSnap] = useState18(null);
28439
28540
  const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = useState18(null);
28440
28541
  const [footerHeadingVisible, setFooterHeadingVisible] = useState18(null);
28441
28542
  const footerDragRef = useRef14(null);
@@ -28462,6 +28563,21 @@ function OhhwellsBridge() {
28462
28563
  const stylesRef = useRef14("");
28463
28564
  const appliedDrawerRef = useRef14(null);
28464
28565
  const pendingDeleteUndoRef = useRef14(null);
28566
+ const [floatingPanel, setFloatingPanel] = useState18(null);
28567
+ const floatingPanelOpenRef = useRef14(false);
28568
+ const floatingPanelRef = useRef14(null);
28569
+ floatingPanelRef.current = floatingPanel;
28570
+ const setFloatingPanelRef = useRef14(setFloatingPanel);
28571
+ const [floatingPanelPos, setFloatingPanelPos] = useState18(null);
28572
+ const buttonCollectionDragRef = useRef14(null);
28573
+ const buttonDropInsertIndexRef = useRef14(null);
28574
+ const [buttonDropSlots, setButtonDropSlots] = useState18([]);
28575
+ const [activeButtonDropIndex, setActiveButtonDropIndex] = useState18(null);
28576
+ const buttonPointerDragRef = useRef14(null);
28577
+ const [buttonStyleTick, setButtonStyleTick] = useState18(0);
28578
+ const [logoSizeDraft, setLogoSizeDraft] = useState18(null);
28579
+ const [editorViewport, setEditorViewport] = useState18("desktop");
28580
+ const [parentScrollSnap, setParentScrollSnap] = useState18(null);
28465
28581
  const [sitePages, setSitePages] = useState18([]);
28466
28582
  const collectionItemsRef = useRef14(/* @__PURE__ */ new Map());
28467
28583
  const [sectionsByPath, setSectionsByPath] = useState18({});
@@ -28471,7 +28587,18 @@ function OhhwellsBridge() {
28471
28587
  const linkPopoverOpenRef = useRef14(false);
28472
28588
  const linkPopoverGraceUntilRef = useRef14(0);
28473
28589
  setLinkPopoverRef.current = setLinkPopover;
28590
+ setFloatingPanelRef.current = setFloatingPanel;
28474
28591
  linkPopoverSessionRef.current = linkPopover;
28592
+ floatingPanelOpenRef.current = Boolean(floatingPanel);
28593
+ useEffect22(() => {
28594
+ const syncViewport = () => {
28595
+ const next = window.innerWidth <= 480 ? "mobile" : "desktop";
28596
+ setEditorViewport((prev) => prev === next ? prev : next);
28597
+ };
28598
+ syncViewport();
28599
+ window.addEventListener("resize", syncViewport);
28600
+ return () => window.removeEventListener("resize", syncViewport);
28601
+ }, []);
28475
28602
  useEffect22(() => {
28476
28603
  setSectionOrderPersistHandler((entries) => {
28477
28604
  const currentPath = window.location.pathname;
@@ -30187,7 +30314,7 @@ function OhhwellsBridge() {
30187
30314
  isFooterFrameSelection,
30188
30315
  postToParent2
30189
30316
  ]);
30190
- useLayoutEffect6(() => {
30317
+ useLayoutEffect7(() => {
30191
30318
  if (!subdomain || isEditMode) {
30192
30319
  setFetchState("done");
30193
30320
  return;
@@ -30214,6 +30341,7 @@ function OhhwellsBridge() {
30214
30341
  applyAiFooterFromContent(content);
30215
30342
  if (typeof content[STYLE_STORE_KEY] === "string") {
30216
30343
  stylesRef.current = content[STYLE_STORE_KEY];
30344
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
30217
30345
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
30218
30346
  }
30219
30347
  applyBrandChrome(content);
@@ -30224,12 +30352,12 @@ function OhhwellsBridge() {
30224
30352
  if (key === "__ohw_sections") continue;
30225
30353
  if (key === AI_SECTIONS_KEY) continue;
30226
30354
  if (key === AI_FOOTER_KEY) continue;
30355
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
30356
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
30227
30357
  if (key === BRAND_KIT_KEY) continue;
30228
30358
  if (key === STYLE_STORE_KEY) continue;
30229
30359
  if (BRAND_CHROME_KEYS.has(key)) continue;
30230
- if (key === LOGO_PLACEHOLDER_KEY) continue;
30231
30360
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
30232
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
30233
30361
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
30234
30362
  continue;
30235
30363
  }
@@ -30464,17 +30592,18 @@ function OhhwellsBridge() {
30464
30592
  }
30465
30593
  applyAiFooterFromContent(content);
30466
30594
  if (typeof content[STYLE_STORE_KEY] === "string") {
30595
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
30467
30596
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
30468
30597
  }
30469
30598
  for (const [key, val] of Object.entries(content)) {
30470
30599
  if (key === "__ohw_sections") continue;
30471
30600
  if (key === AI_SECTIONS_KEY) continue;
30472
30601
  if (key === AI_FOOTER_KEY) continue;
30602
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
30603
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
30473
30604
  if (key === BRAND_KIT_KEY) continue;
30474
30605
  if (key === STYLE_STORE_KEY) continue;
30475
30606
  if (BRAND_CHROME_KEYS.has(key)) continue;
30476
- if (key === LOGO_PLACEHOLDER_KEY) continue;
30477
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
30478
30607
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
30479
30608
  continue;
30480
30609
  }
@@ -30561,7 +30690,7 @@ function OhhwellsBridge() {
30561
30690
  if (debounceTimer) clearTimeout(debounceTimer);
30562
30691
  };
30563
30692
  }, [subdomain, isEditMode, pathname]);
30564
- useLayoutEffect6(() => {
30693
+ useLayoutEffect7(() => {
30565
30694
  const el = document.getElementById("ohw-loader");
30566
30695
  if (!el) return;
30567
30696
  const visible = Boolean(subdomain) && fetchState !== "done";
@@ -30746,26 +30875,11 @@ function OhhwellsBridge() {
30746
30875
  const t2 = setTimeout(measure, 500);
30747
30876
  const ro = new ResizeObserver(schedule);
30748
30877
  ro.observe(document.body);
30749
- let lastWidth = window.innerWidth;
30750
- let resizeTimers = [];
30751
- const clearResizeTimers = () => {
30752
- resizeTimers.forEach(clearTimeout);
30753
- resizeTimers = [];
30754
- };
30755
- const handleResize = () => {
30756
- if (window.innerWidth === lastWidth) return;
30757
- lastWidth = window.innerWidth;
30758
- clearResizeTimers();
30759
- resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
30760
- };
30761
- window.addEventListener("resize", handleResize);
30762
30878
  return () => {
30763
30879
  clearTimeout(t1);
30764
30880
  clearTimeout(t2);
30765
30881
  if (raf != null) cancelAnimationFrame(raf);
30766
30882
  ro.disconnect();
30767
- clearResizeTimers();
30768
- window.removeEventListener("resize", handleResize);
30769
30883
  };
30770
30884
  }, [pathname, isEditMode, postToParent2]);
30771
30885
  useEffect22(() => {
@@ -31062,6 +31176,13 @@ function OhhwellsBridge() {
31062
31176
  if (target.closest("[data-ohw-state-toggle]")) return;
31063
31177
  if (target.closest("[data-ohw-max-badge]")) return;
31064
31178
  if (isInsideLinkEditor(target)) return;
31179
+ if (isInsideFloatingPanel(target)) return;
31180
+ if (target.closest("[data-ohw-form-toolbar]")) return;
31181
+ if (target.closest(
31182
+ '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
31183
+ )) {
31184
+ return;
31185
+ }
31065
31186
  if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
31066
31187
  clearMediaSelectionRef.current();
31067
31188
  }
@@ -31085,8 +31206,6 @@ function OhhwellsBridge() {
31085
31206
  return;
31086
31207
  }
31087
31208
  }
31088
- if (isInsideFloatingPanel(target)) return;
31089
- if (target.closest("[data-ohw-form-toolbar]")) return;
31090
31209
  const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
31091
31210
  if (collectionItem) {
31092
31211
  e.preventDefault();
@@ -31098,11 +31217,6 @@ function OhhwellsBridge() {
31098
31217
  });
31099
31218
  return;
31100
31219
  }
31101
- if (target.closest(
31102
- '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
31103
- )) {
31104
- return;
31105
- }
31106
31220
  {
31107
31221
  const formEl = getFormElement(target);
31108
31222
  const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
@@ -31266,9 +31380,13 @@ function OhhwellsBridge() {
31266
31380
  if (isIconEditable(editable) && !getSocialItem(editable)) {
31267
31381
  e.preventDefault();
31268
31382
  e.stopPropagation();
31269
- selectIconElementRef.current(editable);
31270
31383
  const aiIcon = editable.hasAttribute("data-ai-icon");
31271
31384
  const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
31385
+ if (aiIcon) {
31386
+ aiSectionApiRef.current?.selectFromElement(editable);
31387
+ } else {
31388
+ selectIconElementRef.current(editable);
31389
+ }
31272
31390
  postToParentRef.current({
31273
31391
  type: "ow:icon-pick",
31274
31392
  key: editable.dataset.ohwKey ?? "",
@@ -31496,6 +31614,9 @@ function OhhwellsBridge() {
31496
31614
  setHoveredItemRect(null);
31497
31615
  hoveredNavContainerRef.current = null;
31498
31616
  setHoveredNavContainerRect(null);
31617
+ siblingHintElRef.current = null;
31618
+ setSiblingHintRect(null);
31619
+ setSiblingHintRects([]);
31499
31620
  return;
31500
31621
  }
31501
31622
  {
@@ -31618,7 +31739,6 @@ function OhhwellsBridge() {
31618
31739
  hoveredNavContainerRef.current = null;
31619
31740
  setHoveredNavContainerRect(null);
31620
31741
  hoveredItemElRef.current = editable;
31621
- setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
31622
31742
  }
31623
31743
  }
31624
31744
  }
@@ -32325,7 +32445,11 @@ function OhhwellsBridge() {
32325
32445
  };
32326
32446
  const handleMouseMove = (e) => {
32327
32447
  const { clientX, clientY } = e;
32328
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
32448
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
32449
+ dismissImageHover();
32450
+ clearImageHover();
32451
+ return;
32452
+ }
32329
32453
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
32330
32454
  document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
32331
32455
  formHoverElRef.current = null;
@@ -32354,7 +32478,12 @@ function OhhwellsBridge() {
32354
32478
  setHoveredItemRect(null);
32355
32479
  hoveredNavContainerRef.current = null;
32356
32480
  setHoveredNavContainerRect(null);
32481
+ siblingHintElRef.current = null;
32482
+ setSiblingHintRect(null);
32483
+ setSiblingHintRects([]);
32357
32484
  dismissImageHover();
32485
+ clearImageHover();
32486
+ setSectionGap(null);
32358
32487
  return;
32359
32488
  }
32360
32489
  if (probeSocialsRowAt(clientX, clientY)) return;
@@ -32366,7 +32495,11 @@ function OhhwellsBridge() {
32366
32495
  if (e.data?.type !== "ow:pointer-sync") return;
32367
32496
  const { clientX, clientY } = e.data;
32368
32497
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
32369
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
32498
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
32499
+ dismissImageHover();
32500
+ clearImageHover();
32501
+ return;
32502
+ }
32370
32503
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
32371
32504
  if (probeSocialsRowAt(clientX, clientY)) return;
32372
32505
  probeSectionGapAt(clientX, clientY);
@@ -32746,6 +32879,7 @@ function OhhwellsBridge() {
32746
32879
  applyAiFooterFromContent(content);
32747
32880
  if (typeof content[STYLE_STORE_KEY] === "string") {
32748
32881
  stylesRef.current = content[STYLE_STORE_KEY];
32882
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
32749
32883
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
32750
32884
  }
32751
32885
  applyBrandChrome(content);
@@ -32760,12 +32894,12 @@ function OhhwellsBridge() {
32760
32894
  }
32761
32895
  if (key === AI_SECTIONS_KEY) continue;
32762
32896
  if (key === AI_FOOTER_KEY) continue;
32897
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
32898
+ if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
32763
32899
  if (key === BRAND_KIT_KEY) continue;
32764
32900
  if (key === STYLE_STORE_KEY) continue;
32765
32901
  if (BRAND_CHROME_KEYS.has(key)) continue;
32766
- if (key === LOGO_PLACEHOLDER_KEY) continue;
32767
32902
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
32768
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
32769
32903
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
32770
32904
  continue;
32771
32905
  }
@@ -33438,6 +33572,12 @@ function OhhwellsBridge() {
33438
33572
  closeLinkPopoverRef.current();
33439
33573
  return;
33440
33574
  }
33575
+ if (floatingPanelOpenRef.current) {
33576
+ setFloatingPanelRef.current(null);
33577
+ deselectRef.current();
33578
+ deactivateRef.current();
33579
+ return;
33580
+ }
33441
33581
  deselectRef.current();
33442
33582
  deactivateRef.current();
33443
33583
  clearMediaSelectionRef.current();
@@ -34267,10 +34407,10 @@ function OhhwellsBridge() {
34267
34407
  window.removeEventListener("message", handleDuplicateSection);
34268
34408
  window.removeEventListener("message", handleDeactivate);
34269
34409
  window.removeEventListener("message", handleSelectNav);
34270
- document.documentElement.removeAttribute("data-ohw-panel-dragging");
34271
34410
  window.removeEventListener("message", handleToastAction);
34272
34411
  window.removeEventListener("message", handleFormCount);
34273
34412
  window.removeEventListener("message", handleUiEscape);
34413
+ document.documentElement.removeAttribute("data-ohw-panel-dragging");
34274
34414
  autoSaveTimers.current.forEach(clearTimeout);
34275
34415
  autoSaveTimers.current.clear();
34276
34416
  if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
@@ -34564,7 +34704,7 @@ function OhhwellsBridge() {
34564
34704
  postToParent2({
34565
34705
  type: "ow:ready",
34566
34706
  version: "1",
34567
- bridgeVersion: "0.1.178",
34707
+ bridgeVersion: "0.1.179-next.473",
34568
34708
  path: pathname,
34569
34709
  nodes: collectEditableNodes(editContentRef.current),
34570
34710
  sections
@@ -35455,7 +35595,7 @@ function OhhwellsBridge() {
35455
35595
  className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
35456
35596
  onClick: () => setFieldTypePickerOpen((open) => !open),
35457
35597
  "data-ohw-add-field": "",
35458
- children: /* @__PURE__ */ jsx40(Plus5, { size: 15, "aria-hidden": true })
35598
+ children: /* @__PURE__ */ jsx40(Plus6, { size: 15, "aria-hidden": true })
35459
35599
  }
35460
35600
  ),
35461
35601
  /* @__PURE__ */ jsx40("div", { className: "mx-0.5 h-5 w-px bg-border" }),