@ohhwells/bridge 0.1.117-next.327 → 0.1.117-next.329

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
@@ -2442,7 +2442,7 @@ function MediaStripBlock({ node, ctx, path }) {
2442
2442
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
2443
2443
  // Host sites often style `a:hover{opacity}` globally — that would fade every linked item
2444
2444
  // whatever preset is chosen, so the anchors here opt out and only the preset applies.
2445
- children: '[data-ohw-media-strip] a,[data-ohw-media-strip] a:hover{opacity:1}[data-ohw-media-strip-item]{transition:transform 0.2s ease, opacity 0.2s ease}[data-ohw-media-strip-hover="lift"]:hover{transform:translateY(-4px)}[data-ohw-media-strip-hover="zoom"]:hover{transform:scale(1.05)}[data-ohw-media-strip-hover="fade"]:hover{opacity:0.75}'
2445
+ children: '[data-ohw-media-strip] a,[data-ohw-media-strip] a:hover{opacity:1}[data-ohw-media-strip-hover]{transition:transform 0.2s ease, opacity 0.2s ease}[data-ohw-media-strip-item]:hover>[data-ohw-media-strip-hover="lift"]{transform:translateY(-4px)}[data-ohw-media-strip-item]:hover>[data-ohw-media-strip-hover="zoom"]{transform:scale(1.05)}[data-ohw-media-strip-item]:hover>[data-ohw-media-strip-hover="fade"]{opacity:0.75}'
2446
2446
  }),
2447
2447
  label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2448
2448
  "div",
@@ -2474,22 +2474,28 @@ function MediaStripBlock({ node, ctx, path }) {
2474
2474
  {
2475
2475
  "data-ohw-media-strip-item": "",
2476
2476
  "data-ohw-media-strip-index": i,
2477
- "data-ohw-media-strip-hover": hoverPreset === "none" ? void 0 : hoverPreset,
2478
2477
  style: variant === "logos" ? { height: logoMaxHeight, width: "auto" } : { width: cardWidth, flexShrink: 0 },
2479
2478
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2480
- MediaBox,
2479
+ "div",
2481
2480
  {
2482
- refValue: item.assetId,
2483
- ctx,
2484
- aspect: variant === "reel" ? "9:16" : void 0,
2485
- radius: variant === "reel" ? AI_TREE_TOKENS.radiusCard : 4,
2486
- height: variant === "logos" ? logoMaxHeight : void 0,
2487
- editPath: `${path}.items.${i}.assetId`,
2488
- alt: item.alt,
2489
- fit: variant === "logos" ? "contain" : "cover",
2490
- grayscale: treatment === "grayscale",
2491
- fixedSize: variant === "logos",
2492
- genericImageEdit: false
2481
+ "data-ohw-media-strip-hover": hoverPreset === "none" ? void 0 : hoverPreset,
2482
+ style: { height: "100%" },
2483
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2484
+ MediaBox,
2485
+ {
2486
+ refValue: item.assetId,
2487
+ ctx,
2488
+ aspect: variant === "reel" ? "9:16" : void 0,
2489
+ radius: variant === "reel" ? AI_TREE_TOKENS.radiusCard : 4,
2490
+ height: variant === "logos" ? logoMaxHeight : void 0,
2491
+ editPath: `${path}.items.${i}.assetId`,
2492
+ alt: item.alt,
2493
+ fit: variant === "logos" ? "contain" : "cover",
2494
+ grayscale: treatment === "grayscale",
2495
+ fixedSize: variant === "logos",
2496
+ genericImageEdit: false
2497
+ }
2498
+ )
2493
2499
  }
2494
2500
  )
2495
2501
  }
@@ -15546,10 +15552,10 @@ function FloatingPanel({
15546
15552
  y: fittedY
15547
15553
  };
15548
15554
  (0, import_react14.useEffect)(() => {
15549
- if (!open) {
15550
- setLiveScroll(parentScroll);
15551
- return;
15552
- }
15555
+ setLiveScroll(parentScroll);
15556
+ }, [parentScroll]);
15557
+ (0, import_react14.useEffect)(() => {
15558
+ if (!open) return;
15553
15559
  const onParentScroll = (e) => {
15554
15560
  if (e.data?.type !== "ow:parent-scroll") return;
15555
15561
  const { iframeOffsetTop, headerH, canvasH, promptBarH = 0 } = e.data;
@@ -15557,7 +15563,18 @@ function FloatingPanel({
15557
15563
  };
15558
15564
  window.addEventListener("message", onParentScroll);
15559
15565
  return () => window.removeEventListener("message", onParentScroll);
15560
- }, [open, parentScroll]);
15566
+ }, [open]);
15567
+ const positionRef = (0, import_react14.useRef)(position);
15568
+ (0, import_react14.useLayoutEffect)(() => {
15569
+ if (!open) {
15570
+ positionRef.current = position;
15571
+ return;
15572
+ }
15573
+ if (position == null && positionRef.current != null) {
15574
+ homeRef.current = defaultFloatingPanelPosition(liveScroll ?? parentScroll);
15575
+ }
15576
+ positionRef.current = position;
15577
+ }, [open, position, liveScroll, parentScroll]);
15561
15578
  (0, import_react14.useLayoutEffect)(() => {
15562
15579
  if (!open || !panelRef.current) return;
15563
15580
  const el = panelRef.current;
@@ -21906,6 +21923,7 @@ function OhhwellsBridge() {
21906
21923
  if (id && panel.buttonId !== id) {
21907
21924
  captureButtonOrigin(anchor);
21908
21925
  setFloatingPanelPos(null);
21926
+ setParentScrollSnap(parentScrollRef.current);
21909
21927
  setFloatingPanel({
21910
21928
  ...panel,
21911
21929
  key: `button-style:${id}`,