@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.cjs CHANGED
@@ -1435,7 +1435,8 @@ function toneOverlayLogos(deps, root, photoSections, boxes) {
1435
1435
  if (root.matches(OVERLAY_LOGO_SELECTOR)) logos.unshift(root);
1436
1436
  for (const logo of logos) {
1437
1437
  if (onOwnSurface(deps, logo, root)) {
1438
- logo.removeAttribute(OVERLAY_TONE_ATTR);
1438
+ if (paintOver(deps.style(logo), { r: 0, g: 0, b: 0, a: 0 }).painted) logo.removeAttribute(OVERLAY_TONE_ATTR);
1439
+ else clearOverlayTone(logo);
1439
1440
  continue;
1440
1441
  }
1441
1442
  const box = deps.rect(logo);
@@ -8233,6 +8234,21 @@ function pricingCardFeatureCount(tree, index) {
8233
8234
  const target = findPricingCollection(tree)?.children?.[index];
8234
8235
  return target ? pricingFeatureList(target).length : 0;
8235
8236
  }
8237
+ function prevailingFeatureIcon(features) {
8238
+ const counts = /* @__PURE__ */ new Map();
8239
+ for (const row of features) {
8240
+ const key = `${row.icon ?? ""}|${row.iconColor ?? ""}`;
8241
+ const entry = counts.get(key) ?? { count: 0, ...row.icon ? { icon: row.icon } : {}, ...row.iconColor ? { iconColor: row.iconColor } : {} };
8242
+ entry.count += 1;
8243
+ counts.set(key, entry);
8244
+ }
8245
+ let best = null;
8246
+ for (const entry of counts.values()) {
8247
+ if (!best || entry.count > best.count) best = entry;
8248
+ }
8249
+ if (!best) return {};
8250
+ return { ...best.icon ? { icon: best.icon } : {}, ...best.iconColor ? { iconColor: best.iconColor } : {} };
8251
+ }
8236
8252
  function addPricingCardFeature(tree, index, text) {
8237
8253
  return withPricingCollection(tree, (collection) => {
8238
8254
  const children = collection.children;
@@ -8241,7 +8257,7 @@ function addPricingCardFeature(tree, index, text) {
8241
8257
  const features = pricingFeatureList(target);
8242
8258
  if (features.length >= PRICING_FEATURES_MAX) return false;
8243
8259
  target.slots = target.slots ?? {};
8244
- target.slots.features = [...features, { text }];
8260
+ target.slots.features = [...features, { text, ...prevailingFeatureIcon(features) }];
8245
8261
  return true;
8246
8262
  });
8247
8263
  }
@@ -9776,7 +9792,7 @@ var AI_MOBILE_CSS = [
9776
9792
  // page's first section. Top only (bottom needs no nav clearance); ~96px approximates the
9777
9793
  // template nav's own height (measured ~94px) — there's no shared `--ohw-header-h` var to read
9778
9794
  // an exact figure from (no live measurement exists), so this is a safe approximation, not a
9779
- // pixel-exact fit. Horizontal spacing already comes from `data-ai-container`.
9795
+ // pixel-exact fit. Horizontal spacing already comes from `data-ai-section-inner`.
9780
9796
  '[data-ai-overlay-clearance] [data-ai-overlap-layer="overlay"]{padding-top:96px}',
9781
9797
  // A full-bleed carousel's height is pure arithmetic: it spans the whole window, so 16/9 turns
9782
9798
  // window width straight into height. Measured at 16/9 it came out ~90% of the viewport at EVERY
@@ -9792,8 +9808,10 @@ var AI_MOBILE_CSS = [
9792
9808
  "[data-ai-section]{overflow-x:hidden}",
9793
9809
  // `:not([data-ai-full-bleed])`: this `!important` gutter beat the inline `padding: 0` that a
9794
9810
  // full-bleed section's container sets, so a carousel/media hero that is edge-to-edge on desktop
9795
- // still got a 20px band of section background down both sides on a phone.
9796
- "[data-ai-container]:not([data-ai-full-bleed]){padding:0 20px !important}",
9811
+ // still got a 20px band of section background down both sides on a phone. The footer's own
9812
+ // container keeps the unguarded rule below — `data-ai-full-bleed` can never appear on it.
9813
+ "[data-ai-section-inner]:not([data-ai-full-bleed]){padding:0 20px !important}",
9814
+ "[data-ai-container]{padding:0 20px !important}",
9797
9815
  "[data-ai-row]{display:flex !important;flex-direction:column !important;align-items:stretch !important}",
9798
9816
  "[data-ai-cell]{width:100%;min-width:0}",
9799
9817
  // The rule above turns every row into a COLUMN flex container on phones, which silently breaks
@@ -9998,6 +10016,31 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
9998
10016
  function textAttrs(ctx, path) {
9999
10017
  return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
10000
10018
  }
10019
+ var AI_RESPONSIVE_CSS = [
10020
+ "@media (max-width: 960px) {",
10021
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
10022
+ ' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
10023
+ "}",
10024
+ "@media (max-width: 640px) {",
10025
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
10026
+ " [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
10027
+ // Group containers flatten to a column on phones; span placements come along for free.
10028
+ // `:not([data-ai-group="overlap"])` for the same reason as the twin pair in AI_MOBILE_CSS — see
10029
+ // the comment there. This sheet's copy is the narrower selector, so without the exemption it
10030
+ // flattens an `overlap` hero below 640px even though the other rule stands down: measured a 390px
10031
+ // viewport with the heading/CTA in flow *under* the image, 219px of section background where the
10032
+ // layered text used to be.
10033
+ ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) { display: flex !important; flex-direction: column !important; }',
10034
+ ' [data-ai-responsive] [data-ai-group]:not([data-ai-group="overlap"]) > * { grid-column: auto !important; }',
10035
+ // `:not([data-ai-full-bleed])` for the same reason as the twin rule in AI_MOBILE_CSS: this one
10036
+ // is narrower (0,2,0 vs 0,1,0) and also `!important`, so without the guard it wins outright and
10037
+ // a full-bleed hero gets its 20px side band back below 640px only — the one width where the
10038
+ // other rule had already been taught to stand down.
10039
+ " [data-ai-responsive] [data-ai-section-inner]:not([data-ai-full-bleed]) { padding-left: 20px !important; padding-right: 20px !important; }",
10040
+ " [data-ai-responsive] { overflow-x: hidden; }",
10041
+ " [data-ai-responsive] img { max-width: 100%; }",
10042
+ "}"
10043
+ ].join("\n");
10001
10044
  var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
10002
10045
  function MediaBox({
10003
10046
  refValue,
@@ -10052,7 +10095,7 @@ function MediaBox({
10052
10095
  position: fill ? "absolute" : void 0,
10053
10096
  inset: fill ? 0 : void 0,
10054
10097
  width: fill ? "100%" : fixedSize ? "auto" : "100%",
10055
- height: fill ? "100%" : void 0,
10098
+ height: fill ? "100%" : fixedSize ? height : void 0,
10056
10099
  aspectRatio: fill ? void 0 : aspectRatio,
10057
10100
  minHeight: fill || fixedSize ? void 0 : height ?? (aspectRatio ? void 0 : 180),
10058
10101
  borderRadius: radius,
@@ -11554,7 +11597,7 @@ function CollectionBlock({ node, ctx, path }) {
11554
11597
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
11555
11598
  "div",
11556
11599
  {
11557
- "data-ai-grid": "",
11600
+ "data-ai-grid": String(itemsPerRow),
11558
11601
  "data-ohw-pricing-collection": isPricing ? "" : void 0,
11559
11602
  style: {
11560
11603
  display: "grid",
@@ -11856,7 +11899,7 @@ function renderNode(node, ctx, path, ambientAlign) {
11856
11899
  },
11857
11900
  children: [
11858
11901
  i > 0 && ctx.heroOverlapFullBleed ? (
11859
- // The section's `data-ai-container` gave up its max-width/gutter so the base
11902
+ // The section's `data-ai-section-inner` gave up its max-width/gutter so the base
11860
11903
  // layer (this group's i===0 sibling) can span edge-to-edge — reintroduced here,
11861
11904
  // scoped to just the overlay text, so a heading/copy/CTA stack doesn't stretch
11862
11905
  // the full section width instead of reading at the usual content width.
@@ -12270,6 +12313,7 @@ function AiTreeRenderer({
12270
12313
  ...fillHeight ? { "data-ai-fill-height": "" } : {},
12271
12314
  ...needsOverlayClearance ? { "data-ai-overlay-clearance": "" } : {},
12272
12315
  ...bgAttrs,
12316
+ "data-ai-responsive": "",
12273
12317
  style: {
12274
12318
  position: "relative",
12275
12319
  padding: `${padCss} 0`,
@@ -12283,12 +12327,13 @@ function AiTreeRenderer({
12283
12327
  ...fillHeight ? { display: "grid" } : {}
12284
12328
  },
12285
12329
  children: [
12286
- isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
12330
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
12287
12331
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
12332
+ isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
12288
12333
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
12289
12334
  "div",
12290
12335
  {
12291
- "data-ai-container": "",
12336
+ "data-ai-section-inner": "",
12292
12337
  ...fullBleedMedia ? { "data-ai-full-bleed": "" } : {},
12293
12338
  style: {
12294
12339
  position: "relative",
@@ -12305,7 +12350,7 @@ function AiTreeRenderer({
12305
12350
  children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
12306
12351
  "div",
12307
12352
  {
12308
- "data-ai-row": "",
12353
+ "data-ai-columns": "",
12309
12354
  style: {
12310
12355
  display: "grid",
12311
12356
  gridTemplateColumns: "repeat(12, 1fr)",
@@ -12967,9 +13012,10 @@ function applyAiSectionsToDom(state, options) {
12967
13012
  if (existing && existing.serialized === serialized && existing.container.isConnected) {
12968
13013
  continue;
12969
13014
  }
12970
- const isNewMount = !existing || !existing.container.isConnected;
12971
13015
  let container = existing?.container;
13016
+ let isNewMount = false;
12972
13017
  if (!container || !container.isConnected) {
13018
+ isNewMount = true;
12973
13019
  existing?.root.unmount();
12974
13020
  container?.remove();
12975
13021
  container = document.createElement("div");
@@ -13307,6 +13353,34 @@ function minSpanForFooterBlock(type) {
13307
13353
  return 3;
13308
13354
  }
13309
13355
  }
13356
+ function readLiveSocialItems() {
13357
+ const root = getFooterRoot();
13358
+ const row = root?.querySelector("[data-ohw-socials-row]");
13359
+ if (!row) return [];
13360
+ const items = [];
13361
+ for (const anchor of Array.from(row.querySelectorAll("a[href]"))) {
13362
+ const href = anchor.getAttribute("href")?.trim() ?? "";
13363
+ const aria = anchor.getAttribute("aria-label")?.trim().toLowerCase() ?? "";
13364
+ const platform = FOOTER_SOCIAL_PLATFORMS.find((name) => aria === name) ?? FOOTER_SOCIAL_PLATFORMS.find((name) => href.toLowerCase().includes(name));
13365
+ if (!platform || !/^https?:\/\//i.test(href)) continue;
13366
+ items.push({ platform, href });
13367
+ }
13368
+ return items;
13369
+ }
13370
+ function syncSocialRowsFromDom(tree) {
13371
+ const root = getFooterRoot();
13372
+ if (!root) return;
13373
+ const row = root.querySelector("[data-ohw-socials-row]");
13374
+ const live = readLiveSocialItems();
13375
+ if (row && live.length === 0) return;
13376
+ for (const col of tree.columns) {
13377
+ col.blocks = col.blocks.flatMap((block) => {
13378
+ if (block.type !== "social-row") return [block];
13379
+ if (!row) return [];
13380
+ return [{ ...block, items: live.map((item) => ({ platform: item.platform, href: item.href })) }];
13381
+ });
13382
+ }
13383
+ }
13310
13384
  function collectBrandBlocks(tree) {
13311
13385
  const brand = [];
13312
13386
  for (const col of tree.columns) {
@@ -13552,6 +13626,7 @@ function textOf2(el) {
13552
13626
  }
13553
13627
  function syncFooterTreeLinksFromDom(tree) {
13554
13628
  const next = cloneTree2(tree);
13629
+ syncSocialRowsFromDom(next);
13555
13630
  const domCols = listFooterColumns().map((col) => {
13556
13631
  const heading = getFooterColumnHeadingEl(col);
13557
13632
  const title = heading ? textOf2(heading) : void 0;
@@ -19377,7 +19452,7 @@ function apiBase() {
19377
19452
  function bridgeVersion() {
19378
19453
  try {
19379
19454
  if (true) {
19380
- return "0.1.178";
19455
+ return "0.1.179-next.473";
19381
19456
  }
19382
19457
  } catch {
19383
19458
  }
@@ -19391,7 +19466,7 @@ function stampBridgeVersionOnDocument() {
19391
19466
  return;
19392
19467
  }
19393
19468
  try {
19394
- const v = true ? "0.1.178" : "";
19469
+ const v = true ? "0.1.179-next.473" : "";
19395
19470
  if (v) {
19396
19471
  document.documentElement.setAttribute("data-ohw-bridge-version", v);
19397
19472
  window.__OHW_BRIDGE_VERSION__ = v;
@@ -20072,6 +20147,7 @@ function MediaOverlay({
20072
20147
  (prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
20073
20148
  );
20074
20149
  }, [isVideo]);
20150
+ const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
20075
20151
  const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
20076
20152
  const box = {
20077
20153
  position: "fixed",
@@ -20170,10 +20246,9 @@ function MediaOverlay({
20170
20246
  className: "flex items-center justify-center cursor-pointer",
20171
20247
  style: {
20172
20248
  ...box,
20173
- // When text overlays this media, let clicks fall THROUGH to the text underneath. In the
20174
- // parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
20175
- // in-document, pointer-events does it natively. The button below opts back in, so
20176
- // Replace still works.
20249
+ // Bare media takes the click: the first selects it, the next opens the picker. Text on
20250
+ // top and cueOnly let clicks fall through. Navbar, logo and buttons over a hero image
20251
+ // never reach here: probeImageAt dismisses the overlay before it can cover them.
20177
20252
  pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
20178
20253
  // Selected: a firm component ring with no wash, so the image reads as chosen rather
20179
20254
  // than hovered. Hover keeps the existing tinted preview.
@@ -20201,15 +20276,18 @@ function MediaOverlay({
20201
20276
  },
20202
20277
  children: [
20203
20278
  isVideo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
20204
- isVideo ? "Replace video" : "Replace image"
20279
+ replaceLabel
20205
20280
  ]
20206
20281
  }
20207
20282
  ),
20208
- replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
20283
+ showChrome && replaceMode !== "none" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
20209
20284
  "div",
20210
20285
  {
20211
20286
  className: "flex items-center gap-1.5",
20212
- style: { pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto" },
20287
+ style: {
20288
+ // Parent overlay is pointer-events:none; controls opt back in (unless text sits on top).
20289
+ pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto"
20290
+ },
20213
20291
  onClick: (e) => e.stopPropagation(),
20214
20292
  children: [
20215
20293
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
@@ -20218,7 +20296,7 @@ function MediaOverlay({
20218
20296
  "data-ohw-media-overlay": "",
20219
20297
  variant: "outline",
20220
20298
  size: "sm",
20221
- "aria-label": isVideo ? "Replace video" : "Replace image",
20299
+ "aria-label": replaceLabel,
20222
20300
  className: "gap-1.5 cursor-pointer hover:bg-background",
20223
20301
  style: {
20224
20302
  ...OVERLAY_BUTTON_STYLE,
@@ -20239,7 +20317,7 @@ function MediaOverlay({
20239
20317
  },
20240
20318
  children: [
20241
20319
  isVideo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
20242
- replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
20320
+ replaceMode === "full" ? replaceLabel : null
20243
20321
  ]
20244
20322
  }
20245
20323
  ),
@@ -20897,7 +20975,7 @@ function AiSectionOverlay({
20897
20975
 
20898
20976
  // src/ui/ai-section/AiMediaStripOverlay.tsx
20899
20977
  var import_react14 = require("react");
20900
- var import_lucide_react8 = require("lucide-react");
20978
+ var import_lucide_react9 = require("lucide-react");
20901
20979
 
20902
20980
  // src/lib/ai-media-strip-tree.ts
20903
20981
  var MEDIA_STRIP_ITEM_MIN = 1;
@@ -21011,14 +21089,6 @@ function setMediaStripItemAsset(tree, index, assetId) {
21011
21089
  return true;
21012
21090
  });
21013
21091
  }
21014
- function setMediaStripItemAlt(tree, index, alt) {
21015
- return withMediaStrip(tree, (block) => {
21016
- const items = block.items;
21017
- if (index < 0 || index >= items.length) return false;
21018
- items[index] = { ...items[index], alt };
21019
- return true;
21020
- });
21021
- }
21022
21092
  function setMediaStripItemLink(tree, index, link) {
21023
21093
  return withMediaStrip(tree, (block) => {
21024
21094
  const items = block.items;
@@ -21036,11 +21106,117 @@ function setMediaStripItemLink(tree, index, link) {
21036
21106
  });
21037
21107
  }
21038
21108
 
21039
- // src/ui/ai-section/AiMediaStripOverlay.tsx
21109
+ // src/ui/dialog.tsx
21110
+ var React9 = __toESM(require("react"), 1);
21111
+ var import_radix_ui6 = require("radix-ui");
21112
+ var import_lucide_react8 = require("lucide-react");
21040
21113
  var import_jsx_runtime20 = require("react/jsx-runtime");
21041
- var PRIMARY3 = "#0885FE";
21042
- var OHW_BLUE = `var(--ohw-primary, ${PRIMARY3})`;
21043
- var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY3}) 60%, #000000)`;
21114
+ function Dialog2({
21115
+ ...props
21116
+ }) {
21117
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
21118
+ }
21119
+ function DialogPortal({
21120
+ ...props
21121
+ }) {
21122
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
21123
+ }
21124
+ function DialogOverlay({
21125
+ className,
21126
+ ...props
21127
+ }) {
21128
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21129
+ import_radix_ui6.Dialog.Overlay,
21130
+ {
21131
+ "data-slot": "dialog-overlay",
21132
+ "data-ohw-link-modal-root": "",
21133
+ className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
21134
+ ...props
21135
+ }
21136
+ );
21137
+ }
21138
+ var DialogContent = React9.forwardRef(
21139
+ ({ className, children, showCloseButton = true, container, ...props }, ref) => {
21140
+ const positionMode = container ? "absolute" : "fixed";
21141
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
21142
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
21143
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
21144
+ import_radix_ui6.Dialog.Content,
21145
+ {
21146
+ ref,
21147
+ "data-slot": "dialog-content",
21148
+ className: cn(
21149
+ positionMode,
21150
+ "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",
21151
+ "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
21152
+ container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
21153
+ className
21154
+ ),
21155
+ onMouseDown: (e) => e.stopPropagation(),
21156
+ ...props,
21157
+ children: [
21158
+ children,
21159
+ showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21160
+ import_radix_ui6.Dialog.Close,
21161
+ {
21162
+ type: "button",
21163
+ className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
21164
+ "aria-label": "Close",
21165
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { size: 16, "aria-hidden": true })
21166
+ }
21167
+ ) : null
21168
+ ]
21169
+ }
21170
+ )
21171
+ ] });
21172
+ }
21173
+ );
21174
+ DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
21175
+ function DialogHeader({
21176
+ className,
21177
+ ...props
21178
+ }) {
21179
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
21180
+ }
21181
+ function DialogFooter({
21182
+ className,
21183
+ ...props
21184
+ }) {
21185
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21186
+ "div",
21187
+ {
21188
+ className: cn("flex items-center justify-end gap-2", className),
21189
+ ...props
21190
+ }
21191
+ );
21192
+ }
21193
+ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21194
+ import_radix_ui6.Dialog.Title,
21195
+ {
21196
+ ref,
21197
+ className: cn(
21198
+ "text-lg font-semibold leading-none tracking-tight text-card-foreground",
21199
+ className
21200
+ ),
21201
+ ...props
21202
+ }
21203
+ ));
21204
+ DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
21205
+ var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21206
+ import_radix_ui6.Dialog.Description,
21207
+ {
21208
+ ref,
21209
+ className: cn("text-sm text-muted-foreground", className),
21210
+ ...props
21211
+ }
21212
+ ));
21213
+ DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
21214
+ var DialogClose = import_radix_ui6.Dialog.Close;
21215
+
21216
+ // src/ui/ai-section/AiMediaStripOverlay.tsx
21217
+ var import_jsx_runtime21 = require("react/jsx-runtime");
21218
+ var PRIMARY3 = "var(--ohw-primary, #0885FE)";
21219
+ 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]";
21044
21220
  function findMediaStripItemElement(sectionId, index) {
21045
21221
  const sectionEl2 = findByInstanceId(sectionId);
21046
21222
  if (!sectionEl2) return null;
@@ -21050,14 +21226,35 @@ function findMediaStripItemElement(sectionId, index) {
21050
21226
  }
21051
21227
  return null;
21052
21228
  }
21053
- function readRect2(ref) {
21054
- const el = ref && findMediaStripItemElement(ref.sectionId, ref.index);
21229
+ function itemRefFromTarget(target) {
21230
+ if (!(target instanceof Element)) return null;
21231
+ if (target.closest(CHROME_SELECTOR)) return null;
21232
+ const itemEl = target.closest("[data-ohw-media-strip-item]");
21233
+ if (!itemEl) return null;
21234
+ const sectionEl2 = itemEl.closest("[data-ohw-section]");
21235
+ const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
21236
+ const sectionId = unit ? instanceIdOf(unit) || null : null;
21237
+ const index = Number(itemEl.dataset.ohwMediaStripIndex);
21238
+ if (!sectionId || Number.isNaN(index)) return null;
21239
+ return { sectionId, index };
21240
+ }
21241
+ function sameRef(a, b) {
21242
+ return a?.sectionId === b?.sectionId && a?.index === b?.index;
21243
+ }
21244
+ function rectOf(el) {
21055
21245
  if (!el) return null;
21056
21246
  const r2 = el.getBoundingClientRect();
21057
21247
  if (r2.width <= 0 || r2.height <= 0) return null;
21058
21248
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
21059
21249
  }
21060
- function useLiveItemRect(ref) {
21250
+ function readRect2(ref) {
21251
+ return rectOf(ref && findMediaStripItemElement(ref.sectionId, ref.index));
21252
+ }
21253
+ function readStripRect(ref) {
21254
+ const item = ref && findMediaStripItemElement(ref.sectionId, ref.index);
21255
+ return rectOf(item?.closest("[data-ohw-media-strip]") ?? item);
21256
+ }
21257
+ function useLiveItemRect(ref, strip = false) {
21061
21258
  const [rect, setRect] = (0, import_react14.useState)(null);
21062
21259
  (0, import_react14.useEffect)(() => {
21063
21260
  if (!ref) {
@@ -21065,7 +21262,7 @@ function useLiveItemRect(ref) {
21065
21262
  return;
21066
21263
  }
21067
21264
  const update = () => {
21068
- const next = readRect2(ref);
21265
+ const next = strip ? readStripRect(ref) : readRect2(ref);
21069
21266
  setRect(
21070
21267
  (prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
21071
21268
  );
@@ -21080,9 +21277,49 @@ function useLiveItemRect(ref) {
21080
21277
  window.removeEventListener("resize", update);
21081
21278
  clearInterval(interval);
21082
21279
  };
21083
- }, [ref?.sectionId, ref?.index]);
21280
+ }, [ref?.sectionId, ref?.index, strip]);
21084
21281
  return rect;
21085
21282
  }
21283
+ var TOOLBAR_STRIP_GAP = 52;
21284
+ var TOOLBAR_STRIP_GAP_MOBILE = 42;
21285
+ var TOOLBAR_EDGE_MARGIN2 = 4;
21286
+ function StripToolbarSlot({ stripRect, children }) {
21287
+ const slotRef = (0, import_react14.useRef)(null);
21288
+ const [shift, setShift] = (0, import_react14.useState)(0);
21289
+ const centerX = stripRect.left + stripRect.width / 2;
21290
+ (0, import_react14.useLayoutEffect)(() => {
21291
+ const slot = slotRef.current;
21292
+ if (!slot) return;
21293
+ const clamp = () => {
21294
+ const w = slot.offsetWidth;
21295
+ if (w <= 0) return;
21296
+ const half = w / 2;
21297
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
21298
+ setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
21299
+ };
21300
+ clamp();
21301
+ const ro = new ResizeObserver(clamp);
21302
+ ro.observe(slot);
21303
+ return () => ro.disconnect();
21304
+ }, [centerX, children]);
21305
+ const mobile = window.innerWidth <= 480;
21306
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21307
+ "div",
21308
+ {
21309
+ ref: slotRef,
21310
+ "data-ohw-bridge": "",
21311
+ "data-ohw-item-interaction": "",
21312
+ className: "pointer-events-auto fixed",
21313
+ style: {
21314
+ top: stripRect.top - (mobile ? TOOLBAR_STRIP_GAP_MOBILE : TOOLBAR_STRIP_GAP),
21315
+ left: centerX + shift,
21316
+ transform: "translate(-50%, -100%)",
21317
+ zIndex: 2147483645
21318
+ },
21319
+ children
21320
+ }
21321
+ );
21322
+ }
21086
21323
  function requestValidateTree(postToParent2, tree) {
21087
21324
  return new Promise((resolve) => {
21088
21325
  const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
@@ -21119,116 +21356,72 @@ function requestAssetPick(postToParent2) {
21119
21356
  postToParent2({ type: "ow:asset-pick", id });
21120
21357
  });
21121
21358
  }
21122
- function Pill({
21359
+ function ToolbarAction({
21123
21360
  label,
21124
21361
  onClick,
21125
- disabled,
21126
- active
21362
+ disabled = false,
21363
+ active = false,
21364
+ children
21127
21365
  }) {
21128
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21129
- "button",
21130
- {
21131
- type: "button",
21132
- onClick,
21133
- disabled,
21134
- style: {
21135
- height: 28,
21136
- padding: "0 10px",
21137
- display: "inline-flex",
21138
- alignItems: "center",
21139
- gap: 4,
21140
- borderRadius: 999,
21141
- border: "none",
21142
- cursor: disabled ? "default" : "pointer",
21143
- background: active ? OHW_BLUE_DARK : "#ffffff",
21144
- color: active ? "#ffffff" : OHW_BLUE_DARK,
21145
- opacity: disabled ? 0.4 : 1,
21146
- fontSize: 12,
21147
- lineHeight: "16px",
21148
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21149
- whiteSpace: "nowrap",
21150
- flex: "0 0 auto"
21151
- },
21152
- children: label
21153
- }
21154
- );
21366
+ const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, active, onClick, className: "size-8", children });
21367
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
21368
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
21369
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21370
+ ] });
21155
21371
  }
21156
- function AltInput({ value, onCommit }) {
21157
- const [draft, setDraft] = (0, import_react14.useState)(value);
21158
- (0, import_react14.useEffect)(() => setDraft(value), [value]);
21159
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
21160
- "div",
21161
- {
21162
- style: {
21163
- display: "flex",
21164
- alignItems: "center",
21165
- gap: 6,
21166
- height: 28,
21167
- padding: "0 12px",
21168
- borderRadius: 999,
21169
- background: "#ffffff",
21170
- width: "100%",
21171
- maxWidth: 260,
21172
- boxSizing: "border-box"
21173
- },
21174
- children: [
21175
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21176
- "span",
21177
- {
21178
- style: {
21179
- flex: "0 0 auto",
21180
- color: OHW_BLUE_DARK,
21181
- fontSize: 10,
21182
- fontWeight: 700,
21183
- textTransform: "uppercase",
21184
- letterSpacing: 0.4
21185
- },
21186
- children: "Alt"
21187
- }
21188
- ),
21189
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21190
- "input",
21372
+ function ToolbarSeparator() {
21373
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21374
+ }
21375
+ function OptionMenu({
21376
+ label,
21377
+ value,
21378
+ options,
21379
+ onChange
21380
+ }) {
21381
+ const current = options.find((o) => o.value === value) ?? options[0];
21382
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21383
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: label }),
21384
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
21385
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
21386
+ "button",
21387
+ {
21388
+ type: "button",
21389
+ "aria-label": label,
21390
+ 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",
21391
+ children: [
21392
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
21393
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
21394
+ ]
21395
+ }
21396
+ ) }),
21397
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[132px] min-w-[132px] p-1", children: options.map((option) => {
21398
+ const selected = option.value === value;
21399
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
21400
+ DropdownMenuItem,
21191
21401
  {
21192
- type: "text",
21193
- value: draft,
21194
- onChange: (e) => setDraft(e.target.value),
21195
- onBlur: () => {
21196
- if (draft !== value) onCommit(draft);
21197
- },
21198
- onKeyDown: (e) => {
21199
- if (e.key === "Enter") e.currentTarget.blur();
21200
- if (e.key === "Escape") {
21201
- setDraft(value);
21202
- e.currentTarget.blur();
21203
- }
21204
- },
21205
- placeholder: "Describe this image",
21206
- "aria-label": "Image alt text",
21207
- style: {
21208
- flex: 1,
21209
- minWidth: 0,
21210
- border: "none",
21211
- outline: "none",
21212
- background: "transparent",
21213
- fontSize: 12,
21214
- lineHeight: "16px",
21215
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21216
- color: "#1f2937"
21217
- }
21218
- }
21219
- )
21220
- ]
21221
- }
21222
- );
21402
+ role: "menuitemradio",
21403
+ "aria-checked": selected,
21404
+ onSelect: () => onChange(option.value),
21405
+ className: cn("grid grid-cols-[1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
21406
+ children: [
21407
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: option.label }),
21408
+ selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
21409
+ ]
21410
+ },
21411
+ option.value
21412
+ );
21413
+ }) })
21414
+ ] })
21415
+ ] });
21223
21416
  }
21224
21417
  var VARIANTS = [
21225
21418
  { value: "logos", label: "Logos" },
21226
21419
  { value: "reel", label: "Reel" }
21227
21420
  ];
21228
21421
  var ALIGNS = [
21229
- { value: "left", label: "Left" },
21230
- { value: "center", label: "Center" },
21231
- { value: "right", label: "Right" }
21422
+ { value: "left", label: "Align left", Icon: import_lucide_react9.AlignLeft },
21423
+ { value: "center", label: "Align center", Icon: import_lucide_react9.AlignCenter },
21424
+ { value: "right", label: "Align right", Icon: import_lucide_react9.AlignRight }
21232
21425
  ];
21233
21426
  var HOVERS = [
21234
21427
  { value: "none", label: "None" },
@@ -21236,104 +21429,104 @@ var HOVERS = [
21236
21429
  { value: "zoom", label: "Zoom" },
21237
21430
  { value: "fade", label: "Fade" }
21238
21431
  ];
21239
- var TREATMENTS = [
21240
- { value: "color", label: "Color" },
21241
- { value: "grayscale", label: "Grayscale" }
21242
- ];
21243
21432
  var HTTP_URL_RE = /^https?:\/\/\S+$/i;
21244
- function LinkInput({ value, onCommit }) {
21245
- const [draft, setDraft] = (0, import_react14.useState)(value);
21433
+ function LinkModal({
21434
+ href,
21435
+ linkTarget,
21436
+ onClose,
21437
+ onSave
21438
+ }) {
21439
+ const [draft, setDraft] = (0, import_react14.useState)(href);
21440
+ const [newTab, setNewTab] = (0, import_react14.useState)(linkTarget !== "same-tab");
21246
21441
  const [invalid, setInvalid] = (0, import_react14.useState)(false);
21247
- (0, import_react14.useEffect)(() => {
21248
- setDraft(value);
21249
- setInvalid(false);
21250
- }, [value]);
21251
- const commit2 = () => {
21442
+ const save = () => {
21252
21443
  const next = draft.trim();
21253
- if (next === value) return setInvalid(false);
21254
- if (next && !HTTP_URL_RE.test(next)) return setInvalid(true);
21255
- setInvalid(false);
21256
- onCommit(next);
21257
- };
21258
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
21259
- "div",
21260
- {
21261
- style: {
21262
- display: "flex",
21263
- alignItems: "center",
21264
- gap: 6,
21265
- height: 28,
21266
- padding: "0 12px",
21267
- borderRadius: 999,
21268
- background: "#ffffff",
21269
- width: "100%",
21270
- maxWidth: 260,
21271
- boxSizing: "border-box",
21272
- boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
21273
- },
21274
- children: [
21275
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21276
- "span",
21277
- {
21278
- style: {
21279
- flex: "0 0 auto",
21280
- color: OHW_BLUE_DARK,
21281
- fontSize: 10,
21282
- fontWeight: 700,
21283
- textTransform: "uppercase",
21284
- letterSpacing: 0.4
21285
- },
21286
- children: "Link"
21287
- }
21288
- ),
21289
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21290
- "input",
21291
- {
21292
- type: "text",
21293
- inputMode: "url",
21294
- value: draft,
21295
- onChange: (e) => setDraft(e.target.value),
21296
- onBlur: commit2,
21297
- onKeyDown: (e) => {
21298
- if (e.key === "Enter") e.currentTarget.blur();
21299
- if (e.key === "Escape") {
21300
- setDraft(value);
21301
- setInvalid(false);
21302
- e.currentTarget.blur();
21303
- }
21304
- },
21305
- placeholder: "https://example.com",
21306
- "aria-label": "Image link URL",
21307
- "aria-invalid": invalid,
21308
- style: {
21309
- flex: 1,
21310
- minWidth: 0,
21311
- border: "none",
21312
- outline: "none",
21313
- background: "transparent",
21314
- fontSize: 12,
21315
- lineHeight: "16px",
21316
- fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
21317
- color: "#1f2937"
21318
- }
21319
- }
21320
- )
21321
- ]
21444
+ if (next && !HTTP_URL_RE.test(next)) {
21445
+ setInvalid(true);
21446
+ return;
21322
21447
  }
21323
- );
21448
+ onSave(next, newTab ? "new-tab" : "same-tab");
21449
+ onClose();
21450
+ };
21451
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Dialog2, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogContent, { "data-ohw-link-modal-root": "", className: "max-w-[400px] gap-4 p-5", children: [
21452
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogTitle, { className: "text-base", children: "Image link" }) }),
21453
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col gap-3", children: [
21454
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21455
+ "input",
21456
+ {
21457
+ autoFocus: true,
21458
+ type: "text",
21459
+ inputMode: "url",
21460
+ value: draft,
21461
+ onChange: (e) => {
21462
+ setDraft(e.target.value);
21463
+ setInvalid(false);
21464
+ },
21465
+ onKeyDown: (e) => {
21466
+ if (e.key === "Enter") save();
21467
+ },
21468
+ placeholder: "https://example.com",
21469
+ "aria-label": "Image link URL",
21470
+ "aria-invalid": invalid,
21471
+ className: cn(
21472
+ "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",
21473
+ invalid && "border-destructive focus:border-destructive"
21474
+ )
21475
+ }
21476
+ ),
21477
+ invalid && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: "Enter a full URL starting with http:// or https://" }),
21478
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "flex items-center gap-2 text-[13px] text-foreground", children: [
21479
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { type: "checkbox", checked: newTab, onChange: (e) => setNewTab(e.target.checked) }),
21480
+ "Open in new tab"
21481
+ ] })
21482
+ ] }),
21483
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogFooter, { children: [
21484
+ href && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21485
+ "button",
21486
+ {
21487
+ type: "button",
21488
+ onClick: () => {
21489
+ onSave("", "new-tab");
21490
+ onClose();
21491
+ },
21492
+ className: "mr-auto rounded-[6px] px-3 py-2 text-[13px] font-medium text-destructive transition-colors hover:bg-muted",
21493
+ children: "Remove link"
21494
+ }
21495
+ ),
21496
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21497
+ "button",
21498
+ {
21499
+ type: "button",
21500
+ onClick: onClose,
21501
+ className: "rounded-[6px] px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-muted",
21502
+ children: "Cancel"
21503
+ }
21504
+ ),
21505
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21506
+ "button",
21507
+ {
21508
+ type: "button",
21509
+ onClick: save,
21510
+ className: "rounded-[6px] bg-bridge-primary px-3 py-2 text-[13px] font-medium text-primary-foreground transition-opacity hover:opacity-90",
21511
+ children: "Save"
21512
+ }
21513
+ )
21514
+ ] })
21515
+ ] }) });
21324
21516
  }
21325
21517
  function MediaStripToolbar({
21326
21518
  entry,
21327
21519
  index,
21328
21520
  pending,
21329
21521
  error,
21522
+ itemEditOn,
21523
+ onToggleItemEdit,
21330
21524
  onSetVariant,
21331
21525
  onSetAlign,
21332
21526
  onSetHover,
21333
21527
  onSetTreatment,
21334
21528
  onResize,
21335
- onSetAlt,
21336
- onSetLink,
21529
+ onOpenLink,
21337
21530
  onAddItem,
21338
21531
  onRemoveItem,
21339
21532
  onChangeImage,
@@ -21342,81 +21535,102 @@ function MediaStripToolbar({
21342
21535
  }) {
21343
21536
  const items = mediaStripItems(entry.tree);
21344
21537
  const itemCount = items.length;
21345
- const currentAlt = items[index]?.alt ?? "";
21346
- const currentHref2 = items[index]?.href ?? "";
21347
- const currentTarget = items[index]?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
21348
21538
  const slots = findMediaStripSlots(entry.tree);
21349
21539
  const variant = slots?.variant === "reel" ? "reel" : "logos";
21350
21540
  const align = slots?.align === "left" || slots?.align === "right" ? slots.align : "center";
21351
21541
  const hover = slots?.hover === "none" || slots?.hover === "lift" || slots?.hover === "zoom" || slots?.hover === "fade" ? slots.hover : "lift";
21352
21542
  const treatment = slots?.treatment === "color" || slots?.treatment === "grayscale" ? slots.treatment : variant === "logos" ? "grayscale" : "color";
21353
21543
  const sizeValue = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21354
- const isMobile = window.innerWidth <= 480;
21355
- const rowStyle = isMobile ? {
21356
- display: "flex",
21357
- gap: 6,
21358
- flexWrap: "nowrap",
21359
- justifyContent: "center",
21360
- overflowX: "auto",
21361
- WebkitOverflowScrolling: "touch",
21362
- width: "100%",
21363
- scrollbarWidth: "none"
21364
- } : { display: "flex", gap: 6, flexWrap: "nowrap", justifyContent: "center" };
21365
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
21544
+ const mobile = window.innerWidth <= 480;
21545
+ const gatedLabel = (label) => itemEditOn ? label : "Turn on the star to edit this image";
21546
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
21366
21547
  "div",
21367
21548
  {
21368
21549
  "data-ohw-bridge": "",
21369
21550
  "data-ohw-toolbar": "",
21370
21551
  onMouseDown: (e) => e.stopPropagation(),
21371
- style: {
21372
- display: "flex",
21373
- flexDirection: "column",
21374
- gap: 6,
21375
- alignItems: "center",
21376
- background: OHW_BLUE,
21377
- padding: 8,
21378
- borderRadius: 12,
21379
- boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
21380
- pointerEvents: pending ? "none" : "auto",
21381
- opacity: pending ? 0.6 : 1,
21382
- maxWidth: isMobile ? "calc(100vw - 24px)" : "none"
21383
- },
21552
+ className: cn("flex flex-col items-center gap-1.5 font-sans", pending && "pointer-events-none opacity-60"),
21553
+ style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
21384
21554
  children: [
21385
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
21386
- VARIANTS.map((v) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: v.label, active: variant === v.value, onClick: () => onSetVariant(v.value) }, v.value)),
21387
- ALIGNS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: a.label, active: align === a.value, onClick: () => onSetAlign(a.value) }, a.value))
21388
- ] }),
21389
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
21390
- HOVERS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: h.label, active: hover === h.value, onClick: () => onSetHover(h.value) }, h.value)),
21391
- TREATMENTS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: t.label, active: treatment === t.value, onClick: () => onSetTreatment(t.value) }, t.value))
21392
- ] }),
21393
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
21394
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212", onClick: () => onResize(-8) }),
21395
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { color: "#ffffff", fontSize: 12, minWidth: 34, textAlign: "center" }, children: [
21396
- sizeValue,
21397
- "px"
21398
- ] }),
21399
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+", onClick: () => onResize(8) })
21400
- ] }),
21401
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AltInput, { value: currentAlt, onCommit: onSetAlt }) }),
21402
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "flex", justifyContent: "center", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(LinkInput, { value: currentHref2, onCommit: (href) => onSetLink(href, currentTarget) }) }),
21403
- currentHref2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
21404
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "New tab", active: currentTarget === "new-tab", onClick: () => onSetLink(currentHref2, "new-tab") }),
21405
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Same tab", active: currentTarget === "same-tab", onClick: () => onSetLink(currentHref2, "same-tab") })
21406
- ] }),
21407
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
21408
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "Change Image", onClick: onChangeImage }),
21409
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "+ Item", onClick: onAddItem }),
21410
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2212 Item", onClick: onRemoveItem, disabled: itemCount <= 1 })
21411
- ] }),
21412
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: rowStyle, children: [
21413
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2190 Move", onClick: onMoveLeft, disabled: index <= 0 }),
21414
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill, { label: "\u2192 Move", onClick: onMoveRight, disabled: index >= itemCount - 1 })
21415
- ] }),
21416
- error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
21555
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
21556
+ "div",
21557
+ {
21558
+ className: cn(
21559
+ "flex items-center gap-1 rounded-[10px] border border-border bg-background p-1 whitespace-nowrap",
21560
+ "shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.1),0px_4px_6px_-4px_rgba(0,0,0,0.1)]",
21561
+ mobile ? "flex-wrap justify-center" : "flex-nowrap"
21562
+ ),
21563
+ children: [
21564
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
21565
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21566
+ CustomToolbarButton,
21567
+ {
21568
+ type: "button",
21569
+ "aria-label": itemEditOn ? "Done editing this image" : "Edit this image",
21570
+ "aria-pressed": itemEditOn,
21571
+ onClick: onToggleItemEdit,
21572
+ className: "group size-8",
21573
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21574
+ import_lucide_react9.Star,
21575
+ {
21576
+ size: 16,
21577
+ fill: "currentColor",
21578
+ strokeWidth: 0,
21579
+ className: cn(
21580
+ "transition-colors",
21581
+ itemEditOn ? "text-[#f59e0b] group-hover:text-[#d97706]" : "text-[#d6d3d1] group-hover:text-[#fbbf24]"
21582
+ ),
21583
+ style: { pointerEvents: "none" }
21584
+ }
21585
+ )
21586
+ }
21587
+ ) }),
21588
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: itemEditOn ? "Done editing this image" : "Edit this image" })
21589
+ ] }),
21590
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21591
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Change image"), onClick: onChangeImage, disabled: !itemEditOn, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Image, { size: 16, style: { pointerEvents: "none" } }) }),
21592
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Link"), onClick: onOpenLink, disabled: !itemEditOn, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Link, { size: 16, style: { pointerEvents: "none" } }) }),
21593
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Move left"), onClick: onMoveLeft, disabled: !itemEditOn || index <= 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowLeft, { size: 16, style: { pointerEvents: "none" } }) }),
21594
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21595
+ ToolbarAction,
21596
+ {
21597
+ label: gatedLabel("Move right"),
21598
+ onClick: onMoveRight,
21599
+ disabled: !itemEditOn || index >= itemCount - 1,
21600
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ArrowRight, { size: 16, style: { pointerEvents: "none" } })
21601
+ }
21602
+ ),
21603
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: gatedLabel("Remove image"), onClick: onRemoveItem, disabled: !itemEditOn || itemCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ImageMinus, { size: 16, style: { pointerEvents: "none" } }) }),
21604
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21605
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Layout", value: variant, options: VARIANTS, onChange: onSetVariant }),
21606
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OptionMenu, { label: "Hover", value: hover, options: HOVERS, onChange: onSetHover }),
21607
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21608
+ ToolbarAction,
21609
+ {
21610
+ label: treatment === "grayscale" ? "Show in color" : "Show grayscale",
21611
+ active: treatment === "grayscale",
21612
+ onClick: () => onSetTreatment(treatment === "grayscale" ? "color" : "grayscale"),
21613
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Palette, { size: 16, style: { pointerEvents: "none" } })
21614
+ }
21615
+ ),
21616
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21617
+ ALIGNS.map(({ value, label, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label, active: align === value, onClick: () => onSetAlign(value), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { size: 16, style: { pointerEvents: "none" } }) }, value)),
21618
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21619
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Smaller", onClick: () => onResize(-8), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 16, style: { pointerEvents: "none" } }) }),
21620
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-[40px] text-center text-xs tabular-nums text-muted-foreground", children: [
21621
+ sizeValue,
21622
+ "px"
21623
+ ] }),
21624
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Larger", onClick: () => onResize(8), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
21625
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21626
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add image", onClick: onAddItem, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ImagePlus, { size: 16, style: { pointerEvents: "none" } }) })
21627
+ ]
21628
+ }
21629
+ ),
21630
+ error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
21417
21631
  ]
21418
21632
  }
21419
- );
21633
+ ) });
21420
21634
  }
21421
21635
  function findMediaStripSlots(tree) {
21422
21636
  const stack = tree.rows.flatMap((row) => row.blocks);
@@ -21435,31 +21649,23 @@ function AiMediaStripOverlay({
21435
21649
  }) {
21436
21650
  const [hover, setHover] = (0, import_react14.useState)(null);
21437
21651
  const [active, setActive] = (0, import_react14.useState)(null);
21652
+ const [itemEditOn, setItemEditOn] = (0, import_react14.useState)(false);
21653
+ const [linkOpen, setLinkOpen] = (0, import_react14.useState)(false);
21438
21654
  const [pending, setPending] = (0, import_react14.useState)(false);
21439
21655
  const [error, setError] = (0, import_react14.useState)(null);
21440
21656
  const activeRef = (0, import_react14.useRef)(null);
21441
21657
  activeRef.current = active;
21658
+ const linkOpenRef = (0, import_react14.useRef)(false);
21659
+ linkOpenRef.current = linkOpen;
21442
21660
  (0, import_react14.useEffect)(() => {
21443
21661
  const onMove = (e) => {
21662
+ const ref = itemRefFromTarget(e.target);
21444
21663
  const t = e.target;
21445
- if (!(t instanceof HTMLElement)) return;
21446
- 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]")) {
21447
- return;
21448
- }
21449
- const itemEl = t.closest("[data-ohw-media-strip-item]");
21450
- if (!itemEl) {
21451
- setHover(null);
21452
- return;
21453
- }
21454
- const sectionEl2 = itemEl.closest("[data-ohw-section]");
21455
- const unit = sectionEl2 ? movableUnit(sectionEl2) : null;
21456
- const sectionId = unit ? instanceIdOf(unit) || null : null;
21457
- const index = Number(itemEl.dataset.ohwMediaStripIndex);
21458
- if (!sectionId || Number.isNaN(index)) {
21459
- setHover(null);
21460
- return;
21461
- }
21462
- setHover({ sectionId, index });
21664
+ const overEditable = Boolean(t?.closest?.("[data-ohw-editable]"));
21665
+ setHover((prev) => {
21666
+ const next = ref && !overEditable ? ref : null;
21667
+ return sameRef(prev, next) ? prev : next;
21668
+ });
21463
21669
  };
21464
21670
  const onLeave = () => setHover(null);
21465
21671
  document.addEventListener("mousemove", onMove, { passive: true });
@@ -21471,23 +21677,25 @@ function AiMediaStripOverlay({
21471
21677
  }, []);
21472
21678
  (0, import_react14.useEffect)(() => {
21473
21679
  const onClick = (e) => {
21474
- const current = activeRef.current;
21475
- if (!current) return;
21476
21680
  const t = e.target;
21477
- if (!(t instanceof HTMLElement)) return;
21478
- if (t.closest("[data-ohw-item-interaction]")) return;
21479
- const itemEl = findMediaStripItemElement(current.sectionId, current.index);
21480
- if (itemEl && itemEl.contains(t)) return;
21481
- setActive(null);
21681
+ if (!(t instanceof Element)) return;
21682
+ if (t.closest(CHROME_SELECTOR)) return;
21683
+ const ref = itemRefFromTarget(t);
21684
+ if (sameRef(activeRef.current, ref)) return;
21685
+ if (ref) clearInteractionChromeRef.current();
21686
+ setItemEditOn(false);
21482
21687
  setError(null);
21688
+ setActive(ref);
21483
21689
  };
21484
21690
  document.addEventListener("click", onClick, true);
21485
21691
  return () => document.removeEventListener("click", onClick, true);
21486
- }, []);
21692
+ }, [clearInteractionChromeRef]);
21487
21693
  (0, import_react14.useEffect)(() => {
21488
21694
  const onBlur = () => {
21489
21695
  if (!activeRef.current) return;
21490
21696
  setActive(null);
21697
+ setItemEditOn(false);
21698
+ setLinkOpen(false);
21491
21699
  setError(null);
21492
21700
  };
21493
21701
  window.addEventListener("blur", onBlur);
@@ -21497,7 +21705,10 @@ function AiMediaStripOverlay({
21497
21705
  const onKeyDown = (e) => {
21498
21706
  if (e.key !== "Escape") return;
21499
21707
  if (!activeRef.current) return;
21708
+ if (linkOpenRef.current) return;
21709
+ if (document.querySelector('[data-ohw-more-menu][data-state="open"]')) return;
21500
21710
  setActive(null);
21711
+ setItemEditOn(false);
21501
21712
  setError(null);
21502
21713
  };
21503
21714
  document.addEventListener("keydown", onKeyDown);
@@ -21531,137 +21742,133 @@ function AiMediaStripOverlay({
21531
21742
  tree: nextTree,
21532
21743
  label: entry.label,
21533
21744
  media: extraMedia ? { ...entry.media, ...extraMedia } : entry.media,
21534
- ...entry.brand ? { brand: entry.brand } : {}
21745
+ ...entry.brand ? { brand: entry.brand } : {},
21746
+ // The user is already looking at the strip they just edited — recentering the viewport
21747
+ // on every edit reads as the section jumping around.
21748
+ skipScrollIntoView: true
21535
21749
  });
21536
21750
  return true;
21537
21751
  },
21538
21752
  [findEntry, postToParent2, applyTreeLocalRef]
21539
21753
  );
21540
21754
  const activeEntry = active ? findEntry(active.sectionId) : null;
21541
- const hoverHandleRect = useLiveItemRect(!active && hover ? hover : null);
21542
21755
  const activeItemRect = useLiveItemRect(active);
21543
- const TOOLBAR_APPROX_H = 170;
21544
- const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
21545
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
21546
- hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21547
- "button",
21548
- {
21549
- type: "button",
21550
- "data-ohw-toolbar": "",
21551
- onClick: () => {
21552
- clearInteractionChromeRef.current();
21553
- setActive(hover);
21554
- },
21555
- "aria-label": "Configure media item",
21556
- style: {
21557
- position: "fixed",
21558
- top: hoverHandleRect.top + 8,
21559
- left: hoverHandleRect.left + hoverHandleRect.width - 36,
21560
- width: 28,
21561
- height: 28,
21562
- borderRadius: 8,
21563
- border: `1.5px dashed ${PRIMARY3}`,
21564
- background: "#ffffff",
21565
- color: PRIMARY3,
21566
- display: "flex",
21567
- alignItems: "center",
21568
- justifyContent: "center",
21569
- cursor: "pointer",
21570
- zIndex: 2147483643,
21571
- fontSize: 14,
21572
- fontWeight: 700
21573
- },
21574
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Star, { size: 14, style: { pointerEvents: "none" } })
21575
- }
21576
- ),
21577
- activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21578
- ItemInteractionLayer,
21579
- {
21580
- rect: activeItemRect,
21581
- state: toolbarState,
21582
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
21583
- MediaStripToolbar,
21584
- {
21585
- entry: activeEntry,
21586
- index: active.index,
21587
- pending,
21588
- error,
21589
- onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
21590
- onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
21591
- onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
21592
- onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
21593
- onResize: (delta) => {
21594
- const slots = findMediaStripSlots(activeEntry.tree);
21595
- const variant = slots?.variant === "reel" ? "reel" : "logos";
21596
- const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21597
- void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
21598
- },
21599
- onSetAlt: (alt) => {
21600
- void runMutation(active.sectionId, (tree) => setMediaStripItemAlt(tree, active.index, alt));
21601
- },
21602
- onSetLink: (href, linkTarget) => {
21756
+ const activeStripRect = useLiveItemRect(active, true);
21757
+ const hoverRect = useLiveItemRect(hover && !sameRef(hover, active) ? hover : null);
21758
+ const activeItems = activeEntry ? mediaStripItems(activeEntry.tree) : [];
21759
+ const activeItem = active ? activeItems[active.index] : void 0;
21760
+ const activeHref = activeItem?.href ?? "";
21761
+ const activeTarget = activeItem?.linkTarget === "same-tab" ? "same-tab" : "new-tab";
21762
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
21763
+ hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
21764
+ activeItemRect && activeStripRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
21765
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeItemRect, state: "active-top" }),
21766
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StripToolbarSlot, { stripRect: activeStripRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21767
+ MediaStripToolbar,
21768
+ {
21769
+ entry: activeEntry,
21770
+ index: active.index,
21771
+ pending,
21772
+ error,
21773
+ itemEditOn,
21774
+ onToggleItemEdit: () => setItemEditOn((on) => !on),
21775
+ onSetVariant: (variant) => runMutation(active.sectionId, (tree) => setMediaStripVariant(tree, variant)),
21776
+ onSetAlign: (align) => runMutation(active.sectionId, (tree) => setMediaStripAlign(tree, align)),
21777
+ onSetHover: (hoverPreset) => runMutation(active.sectionId, (tree) => setMediaStripHover(tree, hoverPreset)),
21778
+ onSetTreatment: (treatment) => runMutation(active.sectionId, (tree) => setMediaStripTreatment(tree, treatment)),
21779
+ onResize: (delta) => {
21780
+ const slots = findMediaStripSlots(activeEntry.tree);
21781
+ const variant = slots?.variant === "reel" ? "reel" : "logos";
21782
+ const current = variant === "logos" ? typeof slots?.logoMaxHeight === "number" ? slots.logoMaxHeight : 48 : typeof slots?.cardWidth === "number" ? slots.cardWidth : 240;
21783
+ void runMutation(active.sectionId, (tree) => setMediaStripSizing(tree, current + delta));
21784
+ },
21785
+ onOpenLink: () => setLinkOpen(true),
21786
+ onAddItem: () => {
21787
+ void requestAssetPick(postToParent2).then((picked) => {
21788
+ if (!picked) return;
21789
+ const item = { assetId: picked.assetId, alt: "Logo" };
21603
21790
  void runMutation(
21604
21791
  active.sectionId,
21605
- (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
21606
- );
21607
- },
21608
- onAddItem: () => {
21609
- void requestAssetPick(postToParent2).then((picked) => {
21610
- if (!picked) return;
21611
- const item = { assetId: picked.assetId, alt: "Logo" };
21612
- void runMutation(
21613
- active.sectionId,
21614
- (tree) => addMediaStripItem(tree, item, active.index),
21615
- { [picked.assetId]: picked.url }
21616
- ).then((applied) => {
21617
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21618
- });
21619
- });
21620
- },
21621
- onChangeImage: () => {
21622
- void requestAssetPick(postToParent2).then((picked) => {
21623
- if (!picked) return;
21624
- void runMutation(
21625
- active.sectionId,
21626
- (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
21627
- { [picked.assetId]: picked.url }
21628
- );
21792
+ (tree) => addMediaStripItem(tree, item, active.index),
21793
+ { [picked.assetId]: picked.url }
21794
+ ).then((applied) => {
21795
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21629
21796
  });
21630
- },
21631
- onRemoveItem: () => {
21632
- void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
21633
- (applied) => {
21634
- if (applied) setActive(null);
21635
- }
21636
- );
21637
- },
21638
- onMoveLeft: () => {
21639
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
21640
- (applied) => {
21641
- if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
21642
- }
21643
- );
21644
- },
21645
- onMoveRight: () => {
21646
- void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
21647
- (applied) => {
21648
- if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21649
- }
21797
+ });
21798
+ },
21799
+ onChangeImage: () => {
21800
+ void requestAssetPick(postToParent2).then((picked) => {
21801
+ if (!picked) return;
21802
+ void runMutation(
21803
+ active.sectionId,
21804
+ (tree) => setMediaStripItemAsset(tree, active.index, picked.assetId),
21805
+ { [picked.assetId]: picked.url }
21650
21806
  );
21651
- }
21807
+ });
21808
+ },
21809
+ onRemoveItem: () => {
21810
+ void runMutation(active.sectionId, (tree) => removeMediaStripItem(tree, active.index)).then(
21811
+ (applied) => {
21812
+ if (applied) setActive(null);
21813
+ }
21814
+ );
21815
+ },
21816
+ onMoveLeft: () => {
21817
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, -1)).then(
21818
+ (applied) => {
21819
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index - 1 });
21820
+ }
21821
+ );
21822
+ },
21823
+ onMoveRight: () => {
21824
+ void runMutation(active.sectionId, (tree) => reorderMediaStripItem(tree, active.index, 1)).then(
21825
+ (applied) => {
21826
+ if (applied) setActive({ sectionId: active.sectionId, index: active.index + 1 });
21827
+ }
21828
+ );
21652
21829
  }
21653
- )
21654
- }
21655
- )
21830
+ }
21831
+ ) }),
21832
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21833
+ "div",
21834
+ {
21835
+ "data-ohw-bridge": "",
21836
+ "data-ohw-item-interaction": "",
21837
+ "aria-hidden": true,
21838
+ className: "pointer-events-none fixed rounded-[4px] px-[7px] py-[3px] font-sans text-[11px] font-medium leading-none text-primary-foreground whitespace-nowrap",
21839
+ style: {
21840
+ top: activeItemRect.top + activeItemRect.height + 10,
21841
+ left: activeItemRect.left - 5,
21842
+ background: PRIMARY3,
21843
+ zIndex: 2147483644
21844
+ },
21845
+ children: "Media item"
21846
+ }
21847
+ ),
21848
+ linkOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21849
+ LinkModal,
21850
+ {
21851
+ href: activeHref,
21852
+ linkTarget: activeTarget,
21853
+ onClose: () => setLinkOpen(false),
21854
+ onSave: (href, linkTarget) => {
21855
+ void runMutation(
21856
+ active.sectionId,
21857
+ (tree) => setMediaStripItemLink(tree, active.index, href ? { href, linkTarget } : {})
21858
+ );
21859
+ }
21860
+ }
21861
+ )
21862
+ ] })
21656
21863
  ] });
21657
21864
  }
21658
21865
 
21659
21866
  // src/ui/ai-section/AiPricingCardOverlay.tsx
21660
21867
  var import_react15 = require("react");
21661
- var import_lucide_react9 = require("lucide-react");
21662
- var import_jsx_runtime21 = require("react/jsx-runtime");
21868
+ var import_lucide_react10 = require("lucide-react");
21869
+ var import_jsx_runtime22 = require("react/jsx-runtime");
21663
21870
  var PRIMARY4 = "var(--ohw-primary, #0885FE)";
21664
- 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]";
21871
+ 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]";
21665
21872
  function findPricingCardElement(sectionId, index) {
21666
21873
  const sectionEl2 = findByInstanceId(sectionId);
21667
21874
  if (!sectionEl2) return null;
@@ -21673,7 +21880,7 @@ function findPricingCardElement(sectionId, index) {
21673
21880
  }
21674
21881
  function cardRefFromTarget(target) {
21675
21882
  if (!(target instanceof Element)) return null;
21676
- if (target.closest(CHROME_SELECTOR)) return null;
21883
+ if (target.closest(CHROME_SELECTOR2)) return null;
21677
21884
  const cardEl = target.closest("[data-ohw-pricing-card]");
21678
21885
  if (!cardEl) return null;
21679
21886
  const sectionEl2 = cardEl.closest("[data-ohw-section]");
@@ -21683,21 +21890,21 @@ function cardRefFromTarget(target) {
21683
21890
  if (!sectionId || Number.isNaN(index)) return null;
21684
21891
  return { sectionId, index };
21685
21892
  }
21686
- function sameRef(a, b) {
21893
+ function sameRef2(a, b) {
21687
21894
  return a?.sectionId === b?.sectionId && a?.index === b?.index;
21688
21895
  }
21689
- function rectOf(el) {
21896
+ function rectOf2(el) {
21690
21897
  if (!el) return null;
21691
21898
  const r2 = el.getBoundingClientRect();
21692
21899
  if (r2.width <= 0 || r2.height <= 0) return null;
21693
21900
  return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
21694
21901
  }
21695
21902
  function readRect3(ref) {
21696
- return rectOf(ref && findPricingCardElement(ref.sectionId, ref.index));
21903
+ return rectOf2(ref && findPricingCardElement(ref.sectionId, ref.index));
21697
21904
  }
21698
21905
  function readGridRect(ref) {
21699
21906
  const card = ref && findPricingCardElement(ref.sectionId, ref.index);
21700
- return rectOf(card?.closest("[data-ohw-pricing-collection]") ?? card);
21907
+ return rectOf2(card?.closest("[data-ohw-pricing-collection]") ?? card);
21701
21908
  }
21702
21909
  function useLiveCardRect(ref, grid = false) {
21703
21910
  const [rect, setRect] = (0, import_react15.useState)(null);
@@ -21727,7 +21934,7 @@ function useLiveCardRect(ref, grid = false) {
21727
21934
  }
21728
21935
  var TOOLBAR_GRID_GAP = 52;
21729
21936
  var TOOLBAR_GRID_GAP_MOBILE = 42;
21730
- var TOOLBAR_EDGE_MARGIN2 = 4;
21937
+ var TOOLBAR_EDGE_MARGIN3 = 4;
21731
21938
  function GridToolbarSlot({ gridRect, children }) {
21732
21939
  const slotRef = (0, import_react15.useRef)(null);
21733
21940
  const [shift, setShift] = (0, import_react15.useState)(0);
@@ -21739,7 +21946,7 @@ function GridToolbarSlot({ gridRect, children }) {
21739
21946
  const w = slot.offsetWidth;
21740
21947
  if (w <= 0) return;
21741
21948
  const half = w / 2;
21742
- const clamped = Math.max(TOOLBAR_EDGE_MARGIN2 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN2 - half));
21949
+ const clamped = Math.max(TOOLBAR_EDGE_MARGIN3 + half, Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half));
21743
21950
  setShift((prev) => Math.abs(prev - (clamped - centerX)) < 0.5 ? prev : clamped - centerX);
21744
21951
  };
21745
21952
  clamp();
@@ -21748,7 +21955,7 @@ function GridToolbarSlot({ gridRect, children }) {
21748
21955
  return () => ro.disconnect();
21749
21956
  }, [centerX, children]);
21750
21957
  const mobile = window.innerWidth <= 480;
21751
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21958
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21752
21959
  "div",
21753
21960
  {
21754
21961
  ref: slotRef,
@@ -21783,7 +21990,7 @@ function requestValidateTree2(postToParent2, tree) {
21783
21990
  });
21784
21991
  }
21785
21992
  function StyleSwatch({ style }) {
21786
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21993
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21787
21994
  "span",
21788
21995
  {
21789
21996
  "aria-hidden": true,
@@ -21797,35 +22004,35 @@ function StyleSwatch({ style }) {
21797
22004
  );
21798
22005
  }
21799
22006
  function ButtonGlyph() {
21800
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21801
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
21802
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
22007
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
22008
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("rect", { x: "0.75", y: "0.75", width: "16.5", height: "10.5", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
22009
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M5.5 6H12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
21803
22010
  ] });
21804
22011
  }
21805
22012
  function FeatureGlyph({ mode }) {
21806
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
21807
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
21808
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
21809
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
21810
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
21811
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
21812
- mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
22013
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, style: { pointerEvents: "none" }, children: [
22014
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "8", cy: "8", r: "7.25", stroke: "currentColor", strokeWidth: "1.5" }),
22015
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M5 8.2L7.2 10.3L11 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
22016
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "13.5", cy: "13.5", r: "4.25", fill: "var(--ohw-background, #ffffff)", stroke: "var(--ohw-background, #ffffff)", strokeWidth: "1" }),
22017
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "13.5", cy: "13.5", r: "3.75", fill: "var(--ohw-background, #ffffff)", stroke: PRIMARY4, strokeWidth: "1" }),
22018
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M11.5 13.5H15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" }),
22019
+ mode === "add" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M13.5 11.5V15.5", stroke: PRIMARY4, strokeWidth: "1.5", strokeLinecap: "round" })
21813
22020
  ] });
21814
22021
  }
21815
- function ToolbarAction({
22022
+ function ToolbarAction2({
21816
22023
  label,
21817
22024
  onClick,
21818
22025
  disabled = false,
21819
22026
  children
21820
22027
  }) {
21821
- const button = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
21822
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
21823
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: button }) : button }),
21824
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
22028
+ const button = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CustomToolbarButton, { type: "button", "aria-label": label, disabled, onClick, className: "size-8", children });
22029
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
22030
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "inline-flex", children: button }) : button }),
22031
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: label })
21825
22032
  ] });
21826
22033
  }
21827
- function ToolbarSeparator() {
21828
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
22034
+ function ToolbarSeparator2() {
22035
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { "aria-hidden": true, className: "mx-0.5 block h-6 w-px shrink-0 bg-border" });
21829
22036
  }
21830
22037
  function CardStyleMenu({
21831
22038
  value,
@@ -21833,7 +22040,7 @@ function CardStyleMenu({
21833
22040
  disabled = false
21834
22041
  }) {
21835
22042
  const current = PRICING_CARD_STYLES.find((s) => s.value === value) ?? PRICING_CARD_STYLES[0];
21836
- const trigger = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
22043
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21837
22044
  "button",
21838
22045
  {
21839
22046
  type: "button",
@@ -21844,28 +22051,28 @@ function CardStyleMenu({
21844
22051
  disabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
21845
22052
  ),
21846
22053
  children: [
21847
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: current.value }),
21848
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex-1 text-left", children: current.label }),
21849
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
22054
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StyleSwatch, { style: current.value }),
22055
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-1 text-left", children: current.label }),
22056
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.ChevronDown, { size: 16, style: { pointerEvents: "none" } })
21850
22057
  ]
21851
22058
  }
21852
22059
  );
21853
22060
  if (disabled) {
21854
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21855
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
21856
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
21857
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "inline-flex", children: trigger }) }),
21858
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
22061
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
22062
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground opacity-50", children: "Card style" }),
22063
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
22064
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "inline-flex", children: trigger }) }),
22065
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: "Mark as featured to edit card style" })
21859
22066
  ] })
21860
22067
  ] });
21861
22068
  }
21862
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
21863
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
21864
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { modal: false, children: [
21865
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
21866
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
22069
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-1.5 pl-1.5", children: [
22070
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-muted-foreground", children: "Card style" }),
22071
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(DropdownMenu, { modal: false, children: [
22072
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
22073
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropdownMenuContent, { align: "end", sideOffset: 8, className: "w-[152px] min-w-[152px] p-1", children: PRICING_CARD_STYLES.map((style) => {
21867
22074
  const selected = style.value === value;
21868
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
22075
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21869
22076
  DropdownMenuItem,
21870
22077
  {
21871
22078
  role: "menuitemradio",
@@ -21873,9 +22080,9 @@ function CardStyleMenu({
21873
22080
  onSelect: () => onChange(style.value),
21874
22081
  className: cn("grid grid-cols-[18px_1fr_16px] gap-2 py-2 pl-2 pr-2 text-[13px]", selected && "bg-muted"),
21875
22082
  children: [
21876
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyleSwatch, { style: style.value }),
21877
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: style.label }),
21878
- selected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Check, { size: 16, className: "text-bridge-primary" })
22083
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StyleSwatch, { style: style.value }),
22084
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: style.label }),
22085
+ selected && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Check, { size: 16, className: "text-bridge-primary" })
21879
22086
  ]
21880
22087
  },
21881
22088
  style.value
@@ -21905,7 +22112,7 @@ function PricingCardToolbar({
21905
22112
  const style = pricingCardStyle(entry.tree, index);
21906
22113
  const featuredTag = pricingCardFeaturedTag(entry.tree, index);
21907
22114
  const mobile = window.innerWidth <= 480;
21908
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
22115
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21909
22116
  "div",
21910
22117
  {
21911
22118
  "data-ohw-bridge": "",
@@ -21917,7 +22124,7 @@ function PricingCardToolbar({
21917
22124
  ),
21918
22125
  style: { maxWidth: mobile ? "calc(100vw - 24px)" : void 0 },
21919
22126
  children: [
21920
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
22127
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21921
22128
  "div",
21922
22129
  {
21923
22130
  className: cn(
@@ -21926,8 +22133,8 @@ function PricingCardToolbar({
21926
22133
  mobile ? "flex-wrap justify-center" : "flex-nowrap"
21927
22134
  ),
21928
22135
  children: [
21929
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
21930
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
22136
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tooltip, { children: [
22137
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21931
22138
  CustomToolbarButton,
21932
22139
  {
21933
22140
  type: "button",
@@ -21935,8 +22142,8 @@ function PricingCardToolbar({
21935
22142
  "aria-pressed": featuredTag,
21936
22143
  onClick: () => onSetFeaturedTag(!featuredTag),
21937
22144
  className: "group size-8",
21938
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
21939
- import_lucide_react9.Star,
22145
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22146
+ import_lucide_react10.Star,
21940
22147
  {
21941
22148
  size: 16,
21942
22149
  fill: "currentColor",
@@ -21950,25 +22157,25 @@ function PricingCardToolbar({
21950
22157
  )
21951
22158
  }
21952
22159
  ) }),
21953
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
22160
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TooltipContent, { side: "bottom", sideOffset: 8, children: featuredTag ? "Unmark featured" : "Mark as featured" })
21954
22161
  ] }),
21955
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21956
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
21957
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21958
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}) }),
21959
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "relative inline-flex", children: [
21960
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonGlyph, {}),
21961
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
22162
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarSeparator2, {}),
22163
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardStyleMenu, { value: style, onChange: onSetStyle, disabled: !featuredTag }),
22164
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarSeparator2, {}),
22165
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Add button", onClick: onAddButton, disabled: buttonCount >= 2, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ButtonGlyph, {}) }),
22166
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Remove button", onClick: onRemoveButton, disabled: buttonCount === 0, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "relative inline-flex", children: [
22167
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ButtonGlyph, {}),
22168
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Minus, { size: 10, strokeWidth: 2.5, className: "absolute -right-1.5 -top-1.5 rounded-full bg-background text-bridge-primary" })
21962
22169
  ] }) }),
21963
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeatureGlyph, { mode: "add" }) }),
21964
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FeatureGlyph, { mode: "remove" }) }),
21965
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarSeparator, {}),
21966
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
21967
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ToolbarAction, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Minus, { size: 16, style: { pointerEvents: "none" } }) })
22170
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Add feature", onClick: onAddFeature, disabled: featureCount >= 10, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FeatureGlyph, { mode: "add" }) }),
22171
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Remove feature", onClick: onRemoveFeature, disabled: featureCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FeatureGlyph, { mode: "remove" }) }),
22172
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarSeparator2, {}),
22173
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Add tier", onClick: onAddTier, disabled: collectionCount >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Plus, { size: 16, style: { pointerEvents: "none" } }) }),
22174
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ToolbarAction2, { label: "Remove tier", onClick: onRemoveTier, disabled: collectionCount <= 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Minus, { size: 16, style: { pointerEvents: "none" } }) })
21968
22175
  ]
21969
22176
  }
21970
22177
  ),
21971
- error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
22178
+ error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "max-w-[260px] rounded-md bg-background px-2 py-1 text-center text-[11px] text-destructive shadow-sm", children: error })
21972
22179
  ]
21973
22180
  }
21974
22181
  ) });
@@ -22002,7 +22209,7 @@ function AiPricingCardOverlay({
22002
22209
  const overEditable = Boolean(t?.closest?.("[data-ohw-editable], [data-ohw-role], a, button"));
22003
22210
  setHover((prev) => {
22004
22211
  const next = ref && !overEditable ? ref : null;
22005
- return sameRef(prev, next) ? prev : next;
22212
+ return sameRef2(prev, next) ? prev : next;
22006
22213
  });
22007
22214
  };
22008
22215
  const onLeave = () => setHover(null);
@@ -22017,10 +22224,10 @@ function AiPricingCardOverlay({
22017
22224
  const onClick = (e) => {
22018
22225
  const t = e.target;
22019
22226
  if (!(t instanceof Element)) return;
22020
- if (t.closest(CHROME_SELECTOR)) return;
22227
+ if (t.closest(CHROME_SELECTOR2)) return;
22021
22228
  const ref = cardRefFromTarget(t);
22022
- setActive((prev) => sameRef(prev, ref) ? prev : ref);
22023
- if (!ref || !sameRef(activeRef.current, ref)) setError(null);
22229
+ setActive((prev) => sameRef2(prev, ref) ? prev : ref);
22230
+ if (!ref || !sameRef2(activeRef.current, ref)) setError(null);
22024
22231
  };
22025
22232
  document.addEventListener("click", onClick, true);
22026
22233
  return () => document.removeEventListener("click", onClick, true);
@@ -22085,12 +22292,12 @@ function AiPricingCardOverlay({
22085
22292
  const activeEntry = active ? findEntry(active.sectionId) : null;
22086
22293
  const activeCardRect = useLiveCardRect(active);
22087
22294
  const activeGridRect = useLiveCardRect(active, true);
22088
- const hoverRect = useLiveCardRect(hover && !sameRef(hover, active) ? hover : null);
22089
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
22090
- hoverRect && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
22091
- activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
22092
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
22093
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
22295
+ const hoverRect = useLiveCardRect(hover && !sameRef2(hover, active) ? hover : null);
22296
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
22297
+ hoverRect && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ItemInteractionLayer, { rect: hoverRect, state: "hover" }),
22298
+ activeCardRect && activeGridRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
22299
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ItemInteractionLayer, { rect: activeCardRect, state: "active-top" }),
22300
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridToolbarSlot, { gridRect: activeGridRect, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22094
22301
  PricingCardToolbar,
22095
22302
  {
22096
22303
  entry: activeEntry,
@@ -22118,7 +22325,7 @@ function AiPricingCardOverlay({
22118
22325
  onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
22119
22326
  }
22120
22327
  ) }),
22121
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
22328
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22122
22329
  "div",
22123
22330
  {
22124
22331
  "data-ohw-bridge": "",
@@ -22140,7 +22347,7 @@ function AiPricingCardOverlay({
22140
22347
 
22141
22348
  // src/ui/ai-section/AiVideoOverlay.tsx
22142
22349
  var import_react16 = require("react");
22143
- var import_lucide_react10 = require("lucide-react");
22350
+ var import_lucide_react11 = require("lucide-react");
22144
22351
 
22145
22352
  // src/lib/ai-video-tree.ts
22146
22353
  function resolveVideoBlock(tree, path) {
@@ -22183,10 +22390,10 @@ function clearVideo(tree, path) {
22183
22390
  }
22184
22391
 
22185
22392
  // src/ui/ai-section/AiVideoOverlay.tsx
22186
- var import_jsx_runtime22 = require("react/jsx-runtime");
22393
+ var import_jsx_runtime23 = require("react/jsx-runtime");
22187
22394
  var PRIMARY5 = "#0885FE";
22188
- var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY5})`;
22189
- var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
22395
+ var OHW_BLUE = `var(--ohw-primary, ${PRIMARY5})`;
22396
+ var OHW_BLUE_DARK = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
22190
22397
  function findVideoBlockElement(sectionId, path) {
22191
22398
  const sectionEl2 = findByInstanceId(sectionId);
22192
22399
  if (!sectionEl2) return null;
@@ -22246,12 +22453,12 @@ function requestValidateTree3(postToParent2, tree) {
22246
22453
  postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
22247
22454
  });
22248
22455
  }
22249
- function Pill2({
22456
+ function Pill({
22250
22457
  label,
22251
22458
  onClick,
22252
22459
  disabled
22253
22460
  }) {
22254
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22461
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22255
22462
  "button",
22256
22463
  {
22257
22464
  type: "button",
@@ -22267,7 +22474,7 @@ function Pill2({
22267
22474
  border: "none",
22268
22475
  cursor: disabled ? "default" : "pointer",
22269
22476
  background: "#ffffff",
22270
- color: OHW_BLUE_DARK2,
22477
+ color: OHW_BLUE_DARK,
22271
22478
  opacity: disabled ? 0.4 : 1,
22272
22479
  fontSize: 12,
22273
22480
  lineHeight: "16px",
@@ -22310,8 +22517,8 @@ function VideoUrlInput({ value, onCommit }) {
22310
22517
  onCommit(id);
22311
22518
  }
22312
22519
  };
22313
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
22314
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
22520
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
22521
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
22315
22522
  "div",
22316
22523
  {
22317
22524
  style: {
@@ -22327,12 +22534,12 @@ function VideoUrlInput({ value, onCommit }) {
22327
22534
  boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
22328
22535
  },
22329
22536
  children: [
22330
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22537
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22331
22538
  "span",
22332
22539
  {
22333
22540
  style: {
22334
22541
  flex: "0 0 auto",
22335
- color: OHW_BLUE_DARK2,
22542
+ color: OHW_BLUE_DARK,
22336
22543
  fontSize: 10,
22337
22544
  lineHeight: "16px",
22338
22545
  fontWeight: 700,
@@ -22342,7 +22549,7 @@ function VideoUrlInput({ value, onCommit }) {
22342
22549
  children: "Video"
22343
22550
  }
22344
22551
  ),
22345
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22552
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22346
22553
  "input",
22347
22554
  {
22348
22555
  type: "text",
@@ -22379,7 +22586,7 @@ function VideoUrlInput({ value, onCommit }) {
22379
22586
  ]
22380
22587
  }
22381
22588
  ),
22382
- invalid && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
22589
+ invalid && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
22383
22590
  ] });
22384
22591
  }
22385
22592
  function VideoToolbar({
@@ -22389,7 +22596,7 @@ function VideoToolbar({
22389
22596
  onSetVideoId,
22390
22597
  onRemove
22391
22598
  }) {
22392
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
22599
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
22393
22600
  "div",
22394
22601
  {
22395
22602
  "data-ohw-bridge": "",
@@ -22401,7 +22608,7 @@ function VideoToolbar({
22401
22608
  gap: 6,
22402
22609
  alignItems: "center",
22403
22610
  width: 280,
22404
- background: OHW_BLUE2,
22611
+ background: OHW_BLUE,
22405
22612
  padding: 8,
22406
22613
  borderRadius: 12,
22407
22614
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -22409,9 +22616,9 @@ function VideoToolbar({
22409
22616
  opacity: pending ? 0.6 : 1
22410
22617
  },
22411
22618
  children: [
22412
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
22413
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pill2, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
22414
- error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22619
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
22620
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
22621
+ error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22415
22622
  ]
22416
22623
  }
22417
22624
  );
@@ -22531,8 +22738,8 @@ function AiVideoOverlay({
22531
22738
  const activeBlockRect = useLiveBlockRect(active);
22532
22739
  const TOOLBAR_APPROX_H = 90;
22533
22740
  const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
22534
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
22535
- hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22741
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
22742
+ hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22536
22743
  "button",
22537
22744
  {
22538
22745
  type: "button",
@@ -22560,15 +22767,15 @@ function AiVideoOverlay({
22560
22767
  fontSize: 14,
22561
22768
  fontWeight: 700
22562
22769
  },
22563
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
22770
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
22564
22771
  }
22565
22772
  ),
22566
- activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22773
+ activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22567
22774
  ItemInteractionLayer,
22568
22775
  {
22569
22776
  rect: activeBlockRect,
22570
22777
  state: toolbarState,
22571
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
22778
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22572
22779
  VideoToolbar,
22573
22780
  {
22574
22781
  videoId: videoIdAt(activeEntry.tree, active.path),
@@ -22592,7 +22799,7 @@ function AiVideoOverlay({
22592
22799
 
22593
22800
  // src/ui/ai-section/AiFadeCarouselOverlay.tsx
22594
22801
  var import_react17 = require("react");
22595
- var import_lucide_react11 = require("lucide-react");
22802
+ var import_lucide_react12 = require("lucide-react");
22596
22803
 
22597
22804
  // src/lib/ai-carousel-tree.ts
22598
22805
  function isCarouselBlock(node) {
@@ -22643,10 +22850,10 @@ function setCarouselAutoplay(tree, on) {
22643
22850
  }
22644
22851
 
22645
22852
  // src/ui/ai-section/AiFadeCarouselOverlay.tsx
22646
- var import_jsx_runtime23 = require("react/jsx-runtime");
22853
+ var import_jsx_runtime24 = require("react/jsx-runtime");
22647
22854
  var PRIMARY6 = "#0885FE";
22648
- var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY6})`;
22649
- var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
22855
+ var OHW_BLUE2 = `var(--ohw-primary, ${PRIMARY6})`;
22856
+ var OHW_BLUE_DARK2 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY6}) 60%, #000000)`;
22650
22857
  function findCarouselItemElement(sectionId, index) {
22651
22858
  const sectionEl2 = findByInstanceId(sectionId);
22652
22859
  if (!sectionEl2) return null;
@@ -22725,8 +22932,8 @@ function requestAssetPick2(postToParent2) {
22725
22932
  postToParent2({ type: "ow:asset-pick", id });
22726
22933
  });
22727
22934
  }
22728
- function Pill3({ label, onClick, disabled }) {
22729
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22935
+ function Pill2({ label, onClick, disabled }) {
22936
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22730
22937
  "button",
22731
22938
  {
22732
22939
  type: "button",
@@ -22742,7 +22949,7 @@ function Pill3({ label, onClick, disabled }) {
22742
22949
  border: "none",
22743
22950
  cursor: disabled ? "default" : "pointer",
22744
22951
  background: "#ffffff",
22745
- color: OHW_BLUE_DARK3,
22952
+ color: OHW_BLUE_DARK2,
22746
22953
  opacity: disabled ? 0.4 : 1,
22747
22954
  fontSize: 12,
22748
22955
  lineHeight: "16px",
@@ -22760,7 +22967,7 @@ function TogglePill({
22760
22967
  onToggle,
22761
22968
  disabled
22762
22969
  }) {
22763
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
22970
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
22764
22971
  "button",
22765
22972
  {
22766
22973
  type: "button",
@@ -22779,7 +22986,7 @@ function TogglePill({
22779
22986
  border: "none",
22780
22987
  cursor: disabled ? "default" : "pointer",
22781
22988
  background: "#ffffff",
22782
- color: OHW_BLUE_DARK3,
22989
+ color: OHW_BLUE_DARK2,
22783
22990
  opacity: disabled ? 0.4 : 1,
22784
22991
  fontSize: 12,
22785
22992
  lineHeight: "16px",
@@ -22789,7 +22996,7 @@ function TogglePill({
22789
22996
  },
22790
22997
  children: [
22791
22998
  label,
22792
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
22999
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22793
23000
  "span",
22794
23001
  {
22795
23002
  "aria-hidden": true,
@@ -22802,10 +23009,10 @@ function TogglePill({
22802
23009
  // Off is a grey track, not a washed-out blue: the pill's own white background already
22803
23010
  // carries the brand colour in the text, and a pale blue track next to it read as
22804
23011
  // "disabled control" rather than "switch that is off".
22805
- background: on ? OHW_BLUE_DARK3 : "#CBD5E1",
23012
+ background: on ? OHW_BLUE_DARK2 : "#CBD5E1",
22806
23013
  transition: "background 120ms ease"
22807
23014
  },
22808
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
23015
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
22809
23016
  "span",
22810
23017
  {
22811
23018
  style: {
@@ -22834,7 +23041,7 @@ function CarouselSlideToolbar({
22834
23041
  onChangeImage,
22835
23042
  onToggleAutoplay
22836
23043
  }) {
22837
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
23044
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
22838
23045
  "div",
22839
23046
  {
22840
23047
  "data-ohw-bridge": "",
@@ -22845,7 +23052,7 @@ function CarouselSlideToolbar({
22845
23052
  flexDirection: "column",
22846
23053
  gap: 6,
22847
23054
  alignItems: "center",
22848
- background: OHW_BLUE3,
23055
+ background: OHW_BLUE2,
22849
23056
  padding: 8,
22850
23057
  borderRadius: 12,
22851
23058
  boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
@@ -22857,11 +23064,11 @@ function CarouselSlideToolbar({
22857
23064
  pointerEvents: pending ? "none" : "auto"
22858
23065
  },
22859
23066
  children: [
22860
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
22861
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Pill3, { label: "Change Image", onClick: onChangeImage }),
22862
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
23067
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
23068
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pill2, { label: "Change Image", onClick: onChangeImage }),
23069
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TogglePill, { label: "Autoplay", on: autoplay, onToggle: onToggleAutoplay })
22863
23070
  ] }),
22864
- error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
23071
+ error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
22865
23072
  ]
22866
23073
  }
22867
23074
  );
@@ -23001,8 +23208,8 @@ function AiFadeCarouselOverlay({
23001
23208
  const activeItemRect = useLiveItemRect2(active);
23002
23209
  const TOOLBAR_APPROX_H = 90;
23003
23210
  const toolbarState = activeItemRect && activeItemRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
23004
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
23005
- hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
23211
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
23212
+ hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23006
23213
  "button",
23007
23214
  {
23008
23215
  type: "button",
@@ -23031,10 +23238,10 @@ function AiFadeCarouselOverlay({
23031
23238
  fontSize: 14,
23032
23239
  fontWeight: 700
23033
23240
  },
23034
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Star, { size: 14, style: { pointerEvents: "none" } })
23241
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.Star, { size: 14, style: { pointerEvents: "none" } })
23035
23242
  }
23036
23243
  ),
23037
- swapping && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
23244
+ swapping && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23038
23245
  "div",
23039
23246
  {
23040
23247
  ref: skeletonRef,
@@ -23052,15 +23259,15 @@ function AiFadeCarouselOverlay({
23052
23259
  zIndex: 2147483646,
23053
23260
  pointerEvents: "none"
23054
23261
  },
23055
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: MEDIA_SKELETON_CSS })
23262
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("style", { children: MEDIA_SKELETON_CSS })
23056
23263
  }
23057
23264
  ),
23058
- activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
23265
+ activeItemRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23059
23266
  ItemInteractionLayer,
23060
23267
  {
23061
23268
  rect: activeItemRect,
23062
23269
  state: toolbarState,
23063
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
23270
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23064
23271
  CarouselSlideToolbar,
23065
23272
  {
23066
23273
  pending,
@@ -23298,113 +23505,6 @@ function mergePrefetchedSections(prev, fetched, livePath, liveSections) {
23298
23505
  // src/ui/link-modal/LinkPopover.tsx
23299
23506
  var import_react21 = require("react");
23300
23507
 
23301
- // src/ui/dialog.tsx
23302
- var React9 = __toESM(require("react"), 1);
23303
- var import_radix_ui6 = require("radix-ui");
23304
- var import_lucide_react12 = require("lucide-react");
23305
- var import_jsx_runtime24 = require("react/jsx-runtime");
23306
- function Dialog2({
23307
- ...props
23308
- }) {
23309
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
23310
- }
23311
- function DialogPortal({
23312
- ...props
23313
- }) {
23314
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
23315
- }
23316
- function DialogOverlay({
23317
- className,
23318
- ...props
23319
- }) {
23320
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23321
- import_radix_ui6.Dialog.Overlay,
23322
- {
23323
- "data-slot": "dialog-overlay",
23324
- "data-ohw-link-modal-root": "",
23325
- className: cn("fixed inset-0 z-[2147483646] bg-black/50", className),
23326
- ...props
23327
- }
23328
- );
23329
- }
23330
- var DialogContent = React9.forwardRef(
23331
- ({ className, children, showCloseButton = true, container, ...props }, ref) => {
23332
- const positionMode = container ? "absolute" : "fixed";
23333
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogPortal, { container: container ?? void 0, children: [
23334
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
23335
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
23336
- import_radix_ui6.Dialog.Content,
23337
- {
23338
- ref,
23339
- "data-slot": "dialog-content",
23340
- className: cn(
23341
- positionMode,
23342
- "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",
23343
- "rounded-xl border border-border bg-background font-sans shadow-lg outline-none",
23344
- container ? "max-h-[calc(100%-32px)]" : "max-h-[calc(100vh-32px)]",
23345
- className
23346
- ),
23347
- onMouseDown: (e) => e.stopPropagation(),
23348
- ...props,
23349
- children: [
23350
- children,
23351
- showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23352
- import_radix_ui6.Dialog.Close,
23353
- {
23354
- type: "button",
23355
- className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
23356
- "aria-label": "Close",
23357
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.X, { size: 16, "aria-hidden": true })
23358
- }
23359
- ) : null
23360
- ]
23361
- }
23362
- )
23363
- ] });
23364
- }
23365
- );
23366
- DialogContent.displayName = import_radix_ui6.Dialog.Content.displayName;
23367
- function DialogHeader({
23368
- className,
23369
- ...props
23370
- }) {
23371
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
23372
- }
23373
- function DialogFooter({
23374
- className,
23375
- ...props
23376
- }) {
23377
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23378
- "div",
23379
- {
23380
- className: cn("flex items-center justify-end gap-2", className),
23381
- ...props
23382
- }
23383
- );
23384
- }
23385
- var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23386
- import_radix_ui6.Dialog.Title,
23387
- {
23388
- ref,
23389
- className: cn(
23390
- "text-lg font-semibold leading-none tracking-tight text-card-foreground",
23391
- className
23392
- ),
23393
- ...props
23394
- }
23395
- ));
23396
- DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
23397
- var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23398
- import_radix_ui6.Dialog.Description,
23399
- {
23400
- ref,
23401
- className: cn("text-sm text-muted-foreground", className),
23402
- ...props
23403
- }
23404
- ));
23405
- DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
23406
- var DialogClose = import_radix_ui6.Dialog.Close;
23407
-
23408
23508
  // src/ui/link-modal/LinkEditorPanel.tsx
23409
23509
  var import_lucide_react16 = require("lucide-react");
23410
23510
 
@@ -24508,6 +24608,7 @@ function shouldUseDevFixtures() {
24508
24608
  function getLogoElement(el) {
24509
24609
  const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
24510
24610
  if (marked) return marked;
24611
+ if (el.closest('[data-ohw-editable="icon"]')) return null;
24511
24612
  const root = el.closest("nav, [data-ohw-nav-root], footer");
24512
24613
  if (!root) return null;
24513
24614
  const anchor = el.closest("a");
@@ -27324,7 +27425,7 @@ function getNavigationSelectionParent(el) {
27324
27425
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
27325
27426
  return resolveFooterLinksContainerFrom(el);
27326
27427
  }
27327
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
27428
+ 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)) {
27328
27429
  return getNavigationRoot(el);
27329
27430
  }
27330
27431
  return null;
@@ -27546,7 +27647,6 @@ var ICONS = {
27546
27647
  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"/>',
27547
27648
  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"/>'
27548
27649
  };
27549
- var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
27550
27650
  var SELECTION_CHROME_GAP2 = 4;
27551
27651
  var TOOLBAR_STROKE_GAP2 = 4;
27552
27652
  var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
@@ -27644,7 +27744,7 @@ function applyVisibleViewport(el, parentScroll) {
27644
27744
  el.style.top = `${top}px`;
27645
27745
  el.style.height = `${height}px`;
27646
27746
  }
27647
- var TOOLBAR_EDGE_MARGIN3 = 4;
27747
+ var TOOLBAR_EDGE_MARGIN4 = 4;
27648
27748
  function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
27649
27749
  const isAbove = transform.includes("translateY(-100%)");
27650
27750
  let visualTop = isAbove ? top - approxH : top;
@@ -27671,8 +27771,8 @@ function clampToolbarToClip(top, transform, rect, clip, approxH, gap) {
27671
27771
  function clampToolbarLeft(centerX, toolbarWidth) {
27672
27772
  const half = toolbarWidth / 2;
27673
27773
  return Math.max(
27674
- TOOLBAR_EDGE_MARGIN3 + half,
27675
- Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN3 - half)
27774
+ TOOLBAR_EDGE_MARGIN4 + half,
27775
+ Math.min(centerX, window.innerWidth - TOOLBAR_EDGE_MARGIN4 - half)
27676
27776
  );
27677
27777
  }
27678
27778
  function calcToolbarPos(rect, parentScroll, toolbarW = 306) {
@@ -28584,21 +28684,6 @@ function OhhwellsBridge() {
28584
28684
  const [isItemDragging, setIsItemDragging] = (0, import_react26.useState)(false);
28585
28685
  const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react26.useState)(false);
28586
28686
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
28587
- const [floatingPanel, setFloatingPanel] = (0, import_react26.useState)(null);
28588
- const floatingPanelOpenRef = (0, import_react26.useRef)(false);
28589
- floatingPanelOpenRef.current = floatingPanel !== null;
28590
- const floatingPanelRef = (0, import_react26.useRef)(null);
28591
- floatingPanelRef.current = floatingPanel;
28592
- const [floatingPanelPos, setFloatingPanelPos] = (0, import_react26.useState)(null);
28593
- const buttonCollectionDragRef = (0, import_react26.useRef)(null);
28594
- const buttonDropInsertIndexRef = (0, import_react26.useRef)(null);
28595
- const [buttonDropSlots, setButtonDropSlots] = (0, import_react26.useState)([]);
28596
- const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react26.useState)(null);
28597
- const buttonPointerDragRef = (0, import_react26.useRef)(null);
28598
- const [buttonStyleTick, setButtonStyleTick] = (0, import_react26.useState)(0);
28599
- const [logoSizeDraft, setLogoSizeDraft] = (0, import_react26.useState)(null);
28600
- const [editorViewport, setEditorViewport] = (0, import_react26.useState)("desktop");
28601
- const [parentScrollSnap, setParentScrollSnap] = (0, import_react26.useState)(null);
28602
28687
  const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react26.useState)(null);
28603
28688
  const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react26.useState)(null);
28604
28689
  const footerDragRef = (0, import_react26.useRef)(null);
@@ -28625,6 +28710,21 @@ function OhhwellsBridge() {
28625
28710
  const stylesRef = (0, import_react26.useRef)("");
28626
28711
  const appliedDrawerRef = (0, import_react26.useRef)(null);
28627
28712
  const pendingDeleteUndoRef = (0, import_react26.useRef)(null);
28713
+ const [floatingPanel, setFloatingPanel] = (0, import_react26.useState)(null);
28714
+ const floatingPanelOpenRef = (0, import_react26.useRef)(false);
28715
+ const floatingPanelRef = (0, import_react26.useRef)(null);
28716
+ floatingPanelRef.current = floatingPanel;
28717
+ const setFloatingPanelRef = (0, import_react26.useRef)(setFloatingPanel);
28718
+ const [floatingPanelPos, setFloatingPanelPos] = (0, import_react26.useState)(null);
28719
+ const buttonCollectionDragRef = (0, import_react26.useRef)(null);
28720
+ const buttonDropInsertIndexRef = (0, import_react26.useRef)(null);
28721
+ const [buttonDropSlots, setButtonDropSlots] = (0, import_react26.useState)([]);
28722
+ const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react26.useState)(null);
28723
+ const buttonPointerDragRef = (0, import_react26.useRef)(null);
28724
+ const [buttonStyleTick, setButtonStyleTick] = (0, import_react26.useState)(0);
28725
+ const [logoSizeDraft, setLogoSizeDraft] = (0, import_react26.useState)(null);
28726
+ const [editorViewport, setEditorViewport] = (0, import_react26.useState)("desktop");
28727
+ const [parentScrollSnap, setParentScrollSnap] = (0, import_react26.useState)(null);
28628
28728
  const [sitePages, setSitePages] = (0, import_react26.useState)([]);
28629
28729
  const collectionItemsRef = (0, import_react26.useRef)(/* @__PURE__ */ new Map());
28630
28730
  const [sectionsByPath, setSectionsByPath] = (0, import_react26.useState)({});
@@ -28634,7 +28734,18 @@ function OhhwellsBridge() {
28634
28734
  const linkPopoverOpenRef = (0, import_react26.useRef)(false);
28635
28735
  const linkPopoverGraceUntilRef = (0, import_react26.useRef)(0);
28636
28736
  setLinkPopoverRef.current = setLinkPopover;
28737
+ setFloatingPanelRef.current = setFloatingPanel;
28637
28738
  linkPopoverSessionRef.current = linkPopover;
28739
+ floatingPanelOpenRef.current = Boolean(floatingPanel);
28740
+ (0, import_react26.useEffect)(() => {
28741
+ const syncViewport = () => {
28742
+ const next = window.innerWidth <= 480 ? "mobile" : "desktop";
28743
+ setEditorViewport((prev) => prev === next ? prev : next);
28744
+ };
28745
+ syncViewport();
28746
+ window.addEventListener("resize", syncViewport);
28747
+ return () => window.removeEventListener("resize", syncViewport);
28748
+ }, []);
28638
28749
  (0, import_react26.useEffect)(() => {
28639
28750
  setSectionOrderPersistHandler((entries) => {
28640
28751
  const currentPath = window.location.pathname;
@@ -30377,6 +30488,7 @@ function OhhwellsBridge() {
30377
30488
  applyAiFooterFromContent(content);
30378
30489
  if (typeof content[STYLE_STORE_KEY] === "string") {
30379
30490
  stylesRef.current = content[STYLE_STORE_KEY];
30491
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
30380
30492
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
30381
30493
  }
30382
30494
  applyBrandChrome(content);
@@ -30387,12 +30499,12 @@ function OhhwellsBridge() {
30387
30499
  if (key === "__ohw_sections") continue;
30388
30500
  if (key === AI_SECTIONS_KEY) continue;
30389
30501
  if (key === AI_FOOTER_KEY) continue;
30502
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
30503
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
30390
30504
  if (key === BRAND_KIT_KEY) continue;
30391
30505
  if (key === STYLE_STORE_KEY) continue;
30392
30506
  if (BRAND_CHROME_KEYS.has(key)) continue;
30393
- if (key === LOGO_PLACEHOLDER_KEY) continue;
30394
30507
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
30395
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
30396
30508
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
30397
30509
  continue;
30398
30510
  }
@@ -30627,17 +30739,18 @@ function OhhwellsBridge() {
30627
30739
  }
30628
30740
  applyAiFooterFromContent(content);
30629
30741
  if (typeof content[STYLE_STORE_KEY] === "string") {
30742
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
30630
30743
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
30631
30744
  }
30632
30745
  for (const [key, val] of Object.entries(content)) {
30633
30746
  if (key === "__ohw_sections") continue;
30634
30747
  if (key === AI_SECTIONS_KEY) continue;
30635
30748
  if (key === AI_FOOTER_KEY) continue;
30749
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
30750
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
30636
30751
  if (key === BRAND_KIT_KEY) continue;
30637
30752
  if (key === STYLE_STORE_KEY) continue;
30638
30753
  if (BRAND_CHROME_KEYS.has(key)) continue;
30639
- if (key === LOGO_PLACEHOLDER_KEY) continue;
30640
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
30641
30754
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
30642
30755
  continue;
30643
30756
  }
@@ -30909,26 +31022,11 @@ function OhhwellsBridge() {
30909
31022
  const t2 = setTimeout(measure, 500);
30910
31023
  const ro = new ResizeObserver(schedule);
30911
31024
  ro.observe(document.body);
30912
- let lastWidth = window.innerWidth;
30913
- let resizeTimers = [];
30914
- const clearResizeTimers = () => {
30915
- resizeTimers.forEach(clearTimeout);
30916
- resizeTimers = [];
30917
- };
30918
- const handleResize = () => {
30919
- if (window.innerWidth === lastWidth) return;
30920
- lastWidth = window.innerWidth;
30921
- clearResizeTimers();
30922
- resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
30923
- };
30924
- window.addEventListener("resize", handleResize);
30925
31025
  return () => {
30926
31026
  clearTimeout(t1);
30927
31027
  clearTimeout(t2);
30928
31028
  if (raf != null) cancelAnimationFrame(raf);
30929
31029
  ro.disconnect();
30930
- clearResizeTimers();
30931
- window.removeEventListener("resize", handleResize);
30932
31030
  };
30933
31031
  }, [pathname, isEditMode, postToParent2]);
30934
31032
  (0, import_react26.useEffect)(() => {
@@ -31225,6 +31323,13 @@ function OhhwellsBridge() {
31225
31323
  if (target.closest("[data-ohw-state-toggle]")) return;
31226
31324
  if (target.closest("[data-ohw-max-badge]")) return;
31227
31325
  if (isInsideLinkEditor(target)) return;
31326
+ if (isInsideFloatingPanel(target)) return;
31327
+ if (target.closest("[data-ohw-form-toolbar]")) return;
31328
+ if (target.closest(
31329
+ '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
31330
+ )) {
31331
+ return;
31332
+ }
31228
31333
  if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
31229
31334
  clearMediaSelectionRef.current();
31230
31335
  }
@@ -31248,8 +31353,6 @@ function OhhwellsBridge() {
31248
31353
  return;
31249
31354
  }
31250
31355
  }
31251
- if (isInsideFloatingPanel(target)) return;
31252
- if (target.closest("[data-ohw-form-toolbar]")) return;
31253
31356
  const collectionItem = matchCollectionItemClick(target, collectionItemsRef.current);
31254
31357
  if (collectionItem) {
31255
31358
  e.preventDefault();
@@ -31261,11 +31364,6 @@ function OhhwellsBridge() {
31261
31364
  });
31262
31365
  return;
31263
31366
  }
31264
- if (target.closest(
31265
- '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
31266
- )) {
31267
- return;
31268
- }
31269
31367
  {
31270
31368
  const formEl = getFormElement(target);
31271
31369
  const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
@@ -31429,9 +31527,13 @@ function OhhwellsBridge() {
31429
31527
  if (isIconEditable(editable) && !getSocialItem(editable)) {
31430
31528
  e.preventDefault();
31431
31529
  e.stopPropagation();
31432
- selectIconElementRef.current(editable);
31433
31530
  const aiIcon = editable.hasAttribute("data-ai-icon");
31434
31531
  const featureIcon = aiIcon && /\.features\.\d+\.icon$/.test(editable.dataset.ohwKey ?? "");
31532
+ if (aiIcon) {
31533
+ aiSectionApiRef.current?.selectFromElement(editable);
31534
+ } else {
31535
+ selectIconElementRef.current(editable);
31536
+ }
31435
31537
  postToParentRef.current({
31436
31538
  type: "ow:icon-pick",
31437
31539
  key: editable.dataset.ohwKey ?? "",
@@ -31659,6 +31761,9 @@ function OhhwellsBridge() {
31659
31761
  setHoveredItemRect(null);
31660
31762
  hoveredNavContainerRef.current = null;
31661
31763
  setHoveredNavContainerRect(null);
31764
+ siblingHintElRef.current = null;
31765
+ setSiblingHintRect(null);
31766
+ setSiblingHintRects([]);
31662
31767
  return;
31663
31768
  }
31664
31769
  {
@@ -31781,7 +31886,6 @@ function OhhwellsBridge() {
31781
31886
  hoveredNavContainerRef.current = null;
31782
31887
  setHoveredNavContainerRect(null);
31783
31888
  hoveredItemElRef.current = editable;
31784
- setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
31785
31889
  }
31786
31890
  }
31787
31891
  }
@@ -32488,7 +32592,11 @@ function OhhwellsBridge() {
32488
32592
  };
32489
32593
  const handleMouseMove = (e) => {
32490
32594
  const { clientX, clientY } = e;
32491
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
32595
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
32596
+ dismissImageHover();
32597
+ clearImageHover();
32598
+ return;
32599
+ }
32492
32600
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
32493
32601
  document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
32494
32602
  formHoverElRef.current = null;
@@ -32517,7 +32625,12 @@ function OhhwellsBridge() {
32517
32625
  setHoveredItemRect(null);
32518
32626
  hoveredNavContainerRef.current = null;
32519
32627
  setHoveredNavContainerRect(null);
32628
+ siblingHintElRef.current = null;
32629
+ setSiblingHintRect(null);
32630
+ setSiblingHintRects([]);
32520
32631
  dismissImageHover();
32632
+ clearImageHover();
32633
+ setSectionGap(null);
32521
32634
  return;
32522
32635
  }
32523
32636
  if (probeSocialsRowAt(clientX, clientY)) return;
@@ -32529,7 +32642,11 @@ function OhhwellsBridge() {
32529
32642
  if (e.data?.type !== "ow:pointer-sync") return;
32530
32643
  const { clientX, clientY } = e.data;
32531
32644
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
32532
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
32645
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
32646
+ dismissImageHover();
32647
+ clearImageHover();
32648
+ return;
32649
+ }
32533
32650
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
32534
32651
  if (probeSocialsRowAt(clientX, clientY)) return;
32535
32652
  probeSectionGapAt(clientX, clientY);
@@ -32909,6 +33026,7 @@ function OhhwellsBridge() {
32909
33026
  applyAiFooterFromContent(content);
32910
33027
  if (typeof content[STYLE_STORE_KEY] === "string") {
32911
33028
  stylesRef.current = content[STYLE_STORE_KEY];
33029
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
32912
33030
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
32913
33031
  }
32914
33032
  applyBrandChrome(content);
@@ -32923,12 +33041,12 @@ function OhhwellsBridge() {
32923
33041
  }
32924
33042
  if (key === AI_SECTIONS_KEY) continue;
32925
33043
  if (key === AI_FOOTER_KEY) continue;
33044
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
33045
+ if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
32926
33046
  if (key === BRAND_KIT_KEY) continue;
32927
33047
  if (key === STYLE_STORE_KEY) continue;
32928
33048
  if (BRAND_CHROME_KEYS.has(key)) continue;
32929
- if (key === LOGO_PLACEHOLDER_KEY) continue;
32930
33049
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
32931
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
32932
33050
  if (typeof content[AI_FOOTER_KEY] === "string" && content[AI_FOOTER_KEY] && isAiFooterOwnedContentKey(key)) {
32933
33051
  continue;
32934
33052
  }
@@ -33601,6 +33719,12 @@ function OhhwellsBridge() {
33601
33719
  closeLinkPopoverRef.current();
33602
33720
  return;
33603
33721
  }
33722
+ if (floatingPanelOpenRef.current) {
33723
+ setFloatingPanelRef.current(null);
33724
+ deselectRef.current();
33725
+ deactivateRef.current();
33726
+ return;
33727
+ }
33604
33728
  deselectRef.current();
33605
33729
  deactivateRef.current();
33606
33730
  clearMediaSelectionRef.current();
@@ -34430,10 +34554,10 @@ function OhhwellsBridge() {
34430
34554
  window.removeEventListener("message", handleDuplicateSection);
34431
34555
  window.removeEventListener("message", handleDeactivate);
34432
34556
  window.removeEventListener("message", handleSelectNav);
34433
- document.documentElement.removeAttribute("data-ohw-panel-dragging");
34434
34557
  window.removeEventListener("message", handleToastAction);
34435
34558
  window.removeEventListener("message", handleFormCount);
34436
34559
  window.removeEventListener("message", handleUiEscape);
34560
+ document.documentElement.removeAttribute("data-ohw-panel-dragging");
34437
34561
  autoSaveTimers.current.forEach(clearTimeout);
34438
34562
  autoSaveTimers.current.clear();
34439
34563
  if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
@@ -34727,7 +34851,7 @@ function OhhwellsBridge() {
34727
34851
  postToParent2({
34728
34852
  type: "ow:ready",
34729
34853
  version: "1",
34730
- bridgeVersion: "0.1.178",
34854
+ bridgeVersion: "0.1.179-next.473",
34731
34855
  path: pathname,
34732
34856
  nodes: collectEditableNodes(editContentRef.current),
34733
34857
  sections