@flamingo-stack/openframe-frontend-core 0.0.454 → 0.0.455-snapshot.20260719161719

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.
Files changed (163) hide show
  1. package/dist/{chunk-UGFB5EAW.js → chunk-2I3GN7WW.js} +4 -4
  2. package/dist/{chunk-44AD5D3C.cjs → chunk-6K6LAD6H.cjs} +18 -18
  3. package/dist/{chunk-44AD5D3C.cjs.map → chunk-6K6LAD6H.cjs.map} +1 -1
  4. package/dist/{chunk-UPRY4I63.cjs → chunk-6TI3DCOG.cjs} +3 -3
  5. package/dist/{chunk-UPRY4I63.cjs.map → chunk-6TI3DCOG.cjs.map} +1 -1
  6. package/dist/{chunk-YAZIVPUF.cjs → chunk-A7FTNFBX.cjs} +73 -73
  7. package/dist/{chunk-YAZIVPUF.cjs.map → chunk-A7FTNFBX.cjs.map} +1 -1
  8. package/dist/{chunk-YJ7SPS7I.js → chunk-DAEKUR3J.js} +2 -2
  9. package/dist/{chunk-PT233TJV.js → chunk-DU6R7XNU.js} +2 -2
  10. package/dist/{chunk-OZZ4VQ52.cjs → chunk-DYBATZJP.cjs} +5 -5
  11. package/dist/{chunk-OZZ4VQ52.cjs.map → chunk-DYBATZJP.cjs.map} +1 -1
  12. package/dist/{chunk-PB24PKG2.cjs → chunk-F2CCUPKC.cjs} +29 -29
  13. package/dist/{chunk-PB24PKG2.cjs.map → chunk-F2CCUPKC.cjs.map} +1 -1
  14. package/dist/{chunk-OGKDOG5D.js → chunk-F3IBBAKV.js} +2 -2
  15. package/dist/{chunk-IM5A5F2E.cjs → chunk-GC63K4VD.cjs} +73 -73
  16. package/dist/{chunk-IM5A5F2E.cjs.map → chunk-GC63K4VD.cjs.map} +1 -1
  17. package/dist/{chunk-N2UFIQAD.cjs → chunk-GQZGCMRF.cjs} +7 -7
  18. package/dist/{chunk-N2UFIQAD.cjs.map → chunk-GQZGCMRF.cjs.map} +1 -1
  19. package/dist/{chunk-EQWE64RJ.js → chunk-ILUX3DXS.js} +2 -2
  20. package/dist/{chunk-NUT3HRKS.cjs → chunk-INH6SIP5.cjs} +12 -12
  21. package/dist/{chunk-NUT3HRKS.cjs.map → chunk-INH6SIP5.cjs.map} +1 -1
  22. package/dist/{chunk-QF3NQW7C.cjs → chunk-IOHQJOLR.cjs} +35 -81
  23. package/dist/chunk-IOHQJOLR.cjs.map +1 -0
  24. package/dist/{chunk-TMST2WFZ.js → chunk-JHIT44TA.js} +3 -3
  25. package/dist/{chunk-ACUD4XVZ.cjs → chunk-KH5VTGCS.cjs} +40 -40
  26. package/dist/{chunk-ACUD4XVZ.cjs.map → chunk-KH5VTGCS.cjs.map} +1 -1
  27. package/dist/{chunk-MX2ITMKK.js → chunk-LAFCXJVT.js} +5 -5
  28. package/dist/{chunk-55ISAJFV.js → chunk-LMBPJAQ2.js} +6 -6
  29. package/dist/{chunk-MLFFBQ5B.js → chunk-MK2YWJAA.js} +98 -144
  30. package/dist/chunk-MK2YWJAA.js.map +1 -0
  31. package/dist/{chunk-5HQV2F5K.cjs → chunk-TXS2AMFV.cjs} +32 -32
  32. package/dist/{chunk-5HQV2F5K.cjs.map → chunk-TXS2AMFV.cjs.map} +1 -1
  33. package/dist/{chunk-GOWE4WSU.js → chunk-U27TXTAK.js} +6 -6
  34. package/dist/{chunk-UOTHXOCS.js → chunk-UEKCD6WV.js} +5539 -5559
  35. package/dist/chunk-UEKCD6WV.js.map +1 -0
  36. package/dist/{chunk-XH33VG5A.cjs → chunk-UHVVNVUE.cjs} +40 -40
  37. package/dist/{chunk-XH33VG5A.cjs.map → chunk-UHVVNVUE.cjs.map} +1 -1
  38. package/dist/{chunk-AJAF456I.js → chunk-UXKSOJR7.js} +3 -3
  39. package/dist/{chunk-WLUIXASU.cjs → chunk-VZNJ3RYI.cjs} +15 -15
  40. package/dist/{chunk-WLUIXASU.cjs.map → chunk-VZNJ3RYI.cjs.map} +1 -1
  41. package/dist/{chunk-YED55PQY.js → chunk-YLTY4Z4B.js} +3 -3
  42. package/dist/{chunk-72VDY6MM.cjs → chunk-YMGOTPY7.cjs} +1431 -1451
  43. package/dist/chunk-YMGOTPY7.cjs.map +1 -0
  44. package/dist/{chunk-JUNKHNWE.js → chunk-ZQHGSR3H.js} +5 -5
  45. package/dist/components/case-studies/index.cjs +9 -9
  46. package/dist/components/case-studies/index.js +3 -3
  47. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  48. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  49. package/dist/components/chat/guide-welcome.d.ts.map +1 -1
  50. package/dist/components/chat/index.cjs +3 -9
  51. package/dist/components/chat/index.cjs.map +1 -1
  52. package/dist/components/chat/index.d.ts +0 -2
  53. package/dist/components/chat/index.d.ts.map +1 -1
  54. package/dist/components/chat/index.js +2 -8
  55. package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
  56. package/dist/components/chat/quick-action-chip.d.ts +48 -0
  57. package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
  58. package/dist/components/chat/quick-action-marquee.d.ts.map +1 -1
  59. package/dist/components/chat/quick-action-wall.d.ts +6 -3
  60. package/dist/components/chat/quick-action-wall.d.ts.map +1 -1
  61. package/dist/components/chat/types/component.types.d.ts +17 -12
  62. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  63. package/dist/components/contact/index.cjs +4 -4
  64. package/dist/components/contact/index.js +3 -3
  65. package/dist/components/docs/index.cjs +6 -6
  66. package/dist/components/docs/index.js +5 -5
  67. package/dist/components/embeds/index.cjs +4 -4
  68. package/dist/components/embeds/index.js +3 -3
  69. package/dist/components/faq/index.cjs +5 -5
  70. package/dist/components/faq/index.js +4 -4
  71. package/dist/components/features/cards-strip.d.ts.map +1 -1
  72. package/dist/components/features/index.cjs +3 -3
  73. package/dist/components/features/index.js +2 -2
  74. package/dist/components/help-center-pages/index.cjs +22 -22
  75. package/dist/components/help-center-pages/index.js +13 -13
  76. package/dist/components/index.cjs +135 -141
  77. package/dist/components/index.cjs.map +1 -1
  78. package/dist/components/index.js +11 -17
  79. package/dist/components/index.js.map +1 -1
  80. package/dist/components/navigation/index.cjs +3 -3
  81. package/dist/components/navigation/index.js +2 -2
  82. package/dist/components/onboarding-guides/index.cjs +7 -7
  83. package/dist/components/onboarding-guides/index.js +6 -6
  84. package/dist/components/related-content/index.cjs +5 -5
  85. package/dist/components/related-content/index.js +4 -4
  86. package/dist/components/tickets/index.cjs +6 -6
  87. package/dist/components/tickets/index.js +5 -5
  88. package/dist/components/ui/index.cjs +3 -9
  89. package/dist/components/ui/index.cjs.map +1 -1
  90. package/dist/components/ui/index.js +2 -8
  91. package/dist/components/ui/marquee-wall.d.ts +8 -1
  92. package/dist/components/ui/marquee-wall.d.ts.map +1 -1
  93. package/dist/hooks/index.cjs +2 -2
  94. package/dist/hooks/index.cjs.map +1 -1
  95. package/dist/hooks/index.d.ts +0 -1
  96. package/dist/hooks/index.d.ts.map +1 -1
  97. package/dist/hooks/index.js +3 -3
  98. package/dist/hooks/ui/index.d.ts +1 -0
  99. package/dist/hooks/ui/index.d.ts.map +1 -1
  100. package/dist/hooks/ui/use-reset-on-page-hidden.d.ts +19 -0
  101. package/dist/hooks/ui/use-reset-on-page-hidden.d.ts.map +1 -0
  102. package/dist/hooks/use-near-viewport.d.ts +3 -1
  103. package/dist/hooks/use-near-viewport.d.ts.map +1 -1
  104. package/dist/index.cjs +3 -9
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.js +4 -10
  107. package/package.json +1 -1
  108. package/src/components/chat/approval-request-message.tsx +1 -1
  109. package/src/components/chat/chat-context-picker.tsx +1 -1
  110. package/src/components/chat/chat-input.tsx +1 -1
  111. package/src/components/chat/chat-message-list.tsx +47 -0
  112. package/src/components/chat/chat-message-skeleton.tsx +1 -1
  113. package/src/components/chat/chat-sidebar-skeleton.tsx +1 -1
  114. package/src/components/chat/chat-sidebar.tsx +2 -2
  115. package/src/components/chat/chat-ticket-list.tsx +1 -1
  116. package/src/components/chat/context-items-list.tsx +1 -1
  117. package/src/components/chat/embeddable-chat.tsx +46 -6
  118. package/src/components/chat/guide-welcome.tsx +24 -14
  119. package/src/components/chat/index.ts +0 -2
  120. package/src/components/chat/mingo-chat-history.tsx +1 -1
  121. package/src/components/chat/mingo-welcome.tsx +42 -27
  122. package/src/components/chat/quick-action-chip.tsx +77 -0
  123. package/src/components/chat/quick-action-marquee.tsx +1 -2
  124. package/src/components/chat/quick-action-wall.tsx +13 -4
  125. package/src/components/chat/slash-command-suggestions.tsx +1 -1
  126. package/src/components/chat/tool-call-blocks.tsx +1 -1
  127. package/src/components/chat/types/component.types.ts +17 -15
  128. package/src/components/features/cards-strip.tsx +16 -0
  129. package/src/components/ui/marquee-wall.tsx +160 -10
  130. package/src/hooks/.index.md +0 -1
  131. package/src/hooks/index.ts +0 -1
  132. package/src/hooks/ui/index.ts +1 -0
  133. package/src/hooks/ui/use-reset-on-page-hidden.ts +32 -0
  134. package/src/hooks/use-near-viewport.ts +36 -12
  135. package/src/stories/ChatContainer.stories.tsx +15 -12
  136. package/src/stories/QuickActionWall.stories.tsx +1 -2
  137. package/dist/chunk-72VDY6MM.cjs.map +0 -1
  138. package/dist/chunk-MLFFBQ5B.js.map +0 -1
  139. package/dist/chunk-QF3NQW7C.cjs.map +0 -1
  140. package/dist/chunk-UOTHXOCS.js.map +0 -1
  141. package/dist/components/chat/chat-quick-action-row.d.ts +0 -84
  142. package/dist/components/chat/chat-quick-action-row.d.ts.map +0 -1
  143. package/dist/components/chat/chat-quick-action.d.ts +0 -11
  144. package/dist/components/chat/chat-quick-action.d.ts.map +0 -1
  145. package/dist/hooks/use-quick-action-hint.d.ts +0 -25
  146. package/dist/hooks/use-quick-action-hint.d.ts.map +0 -1
  147. package/src/components/chat/.chat-quick-action.md +0 -46
  148. package/src/components/chat/chat-quick-action-row.tsx +0 -282
  149. package/src/components/chat/chat-quick-action.tsx +0 -59
  150. package/src/hooks/.use-quick-action-hint.md +0 -43
  151. package/src/hooks/use-quick-action-hint.ts +0 -126
  152. /package/dist/{chunk-UGFB5EAW.js.map → chunk-2I3GN7WW.js.map} +0 -0
  153. /package/dist/{chunk-YJ7SPS7I.js.map → chunk-DAEKUR3J.js.map} +0 -0
  154. /package/dist/{chunk-PT233TJV.js.map → chunk-DU6R7XNU.js.map} +0 -0
  155. /package/dist/{chunk-OGKDOG5D.js.map → chunk-F3IBBAKV.js.map} +0 -0
  156. /package/dist/{chunk-EQWE64RJ.js.map → chunk-ILUX3DXS.js.map} +0 -0
  157. /package/dist/{chunk-TMST2WFZ.js.map → chunk-JHIT44TA.js.map} +0 -0
  158. /package/dist/{chunk-MX2ITMKK.js.map → chunk-LAFCXJVT.js.map} +0 -0
  159. /package/dist/{chunk-55ISAJFV.js.map → chunk-LMBPJAQ2.js.map} +0 -0
  160. /package/dist/{chunk-GOWE4WSU.js.map → chunk-U27TXTAK.js.map} +0 -0
  161. /package/dist/{chunk-AJAF456I.js.map → chunk-UXKSOJR7.js.map} +0 -0
  162. /package/dist/{chunk-YED55PQY.js.map → chunk-YLTY4Z4B.js.map} +0 -0
  163. /package/dist/{chunk-JUNKHNWE.js.map → chunk-ZQHGSR3H.js.map} +0 -0
@@ -4,6 +4,7 @@ import * as React from 'react'
4
4
  import { cn } from '../../utils/cn'
5
5
  import { useMarqueeEngine } from '../../hooks/ui/use-marquee-engine'
6
6
  import { useMediaQuery } from '../../hooks/ui/use-media-query'
7
+ import { useResetOnPageHidden } from '../../hooks/ui/use-reset-on-page-hidden'
7
8
  import { useSuppressCloneFocus } from '../../hooks/ui/use-suppress-clone-focus'
8
9
  import { NEAR_VIEWPORT_ROOT_MARGIN } from '../../hooks/use-near-viewport'
9
10
 
@@ -153,6 +154,13 @@ export interface MarqueeWallProps {
153
154
  * must never move under a pointing cursor (required for interactive chip
154
155
  * walls). Default true. */
155
156
  pauseOnHover?: boolean
157
+ /** Opt-in MANUAL scroll: pointer-drag + horizontal wheel move the wall along
158
+ * its axis (transform-based — no inner scroller is created, so it stays
159
+ * deck-safe). The auto-marquee pauses during the interaction and briefly
160
+ * after, then resumes drifting from wherever the user left it. Off by
161
+ * default (decorative walls stay auto-only); enabled on the embeddable-chat
162
+ * quick-action walls so users can browse the actions by hand. */
163
+ dragScroll?: boolean
156
164
  /** Edge fade(s) — the "there's more" affordance. ONE spelling of the
157
165
  * clip-and-fade across every wall surface. */
158
166
  fade?: MarqueeWallFadeEdge | ReadonlyArray<MarqueeWallFadeEdge>
@@ -295,6 +303,7 @@ export function MarqueeWall({
295
303
  speed = 40,
296
304
  animate = true,
297
305
  pauseOnHover = true,
306
+ dragScroll = false,
298
307
  fade,
299
308
  fadeColor = 'var(--color-bg)',
300
309
  fadeSize,
@@ -386,6 +395,9 @@ export function MarqueeWall({
386
395
 
387
396
  // ---- pause-reason set ------------------------------------------------------
388
397
  const pointerInsideRef = React.useRef(false)
398
+ const clearPointerInside = React.useCallback(() => {
399
+ pointerInsideRef.current = false
400
+ }, [])
389
401
  const onPointerEnter = React.useCallback((e: React.PointerEvent) => {
390
402
  if (e.pointerType === 'touch') return
391
403
  pointerInsideRef.current = true
@@ -394,6 +406,21 @@ export function MarqueeWall({
394
406
  if (e.pointerType === 'touch') return
395
407
  pointerInsideRef.current = false
396
408
  }, [])
409
+ // Stale-flag self-heal (shared SSOT): if a `pointerleave` is MISSED (tab blur,
410
+ // overlay under the cursor, interrupted pointer), `inside` stays stuck true and
411
+ // the wall freezes forever — so un-stick it whenever the tab hides / the window
412
+ // loses focus. The next real pointer/enter re-arms it.
413
+ useResetOnPageHidden(clearPointerInside)
414
+
415
+ // ---- manual drag / wheel scroll (opt-in via `dragScroll`) ------------------
416
+ // Transform-based (no inner scroller → deck-safe): drag/wheel move the
417
+ // engine's float position directly; `draggingRef` + a short suppress window
418
+ // pause the auto-marquee during and just after the interaction so it resumes
419
+ // drifting from where the user left it. Refs declared here (before the engine)
420
+ // so `isPaused` can read them; the handlers (which need the engine's `wrap`)
421
+ // are defined after the engine call.
422
+ const draggingRef = React.useRef(false)
423
+ const dragSuppressUntilRef = React.useRef(0)
397
424
 
398
425
  // ---- transform driver ------------------------------------------------------
399
426
  const applyTransform = React.useCallback(
@@ -414,6 +441,26 @@ export function MarqueeWall({
414
441
  },
415
442
  [axis, reverse, trackId],
416
443
  )
444
+ // Sync-aware position writer — THE single entry point for every position
445
+ // update (the engine's rAF apply AND the manual drag/wheel handlers). With a
446
+ // `sync` controller it publishes to the shared position and drives every peer
447
+ // wall's transform; without one it just writes our own. Routing drag/wheel
448
+ // through here (instead of raw `applyTransform`) keeps a wall that is both
449
+ // `sync`-ed and `dragScroll`-ed in lockstep with its peers — a direct
450
+ // `applyTransform` would move only this wall and leave `sync.position` + peers
451
+ // stale. Members' own `apply` stays the raw `applyTransform` (no re-publish),
452
+ // so the `forEach` fan-out can't recurse.
453
+ const applyPos = React.useCallback(
454
+ (pos: number) => {
455
+ if (sync) {
456
+ sync.position = pos
457
+ sync.members.forEach(m => m.apply(pos))
458
+ } else {
459
+ applyTransform(pos)
460
+ }
461
+ },
462
+ [sync, applyTransform],
463
+ )
417
464
  // Clear any residual offset only when the marquee turns off STRUCTURALLY
418
465
  // (content shrank so it fits, reduced-motion flipped) — the static wall must
419
466
  // sit at its natural origin. A mere run-gate pause (`animate` false) does NOT
@@ -457,18 +504,16 @@ export function MarqueeWall({
457
504
  }
458
505
  }, [sync, applyTransform])
459
506
 
460
- const { posRef } = useMarqueeEngine({
507
+ const { posRef, wrap } = useMarqueeEngine({
461
508
  active: marqueeActive && nearViewport && isDriver,
462
509
  speed,
463
- isPaused: () =>
464
- (pauseOnHover && pointerInsideRef.current) || document.visibilityState === 'hidden',
510
+ isPaused: now =>
511
+ (pauseOnHover && pointerInsideRef.current) ||
512
+ draggingRef.current ||
513
+ now < dragSuppressUntilRef.current ||
514
+ document.visibilityState === 'hidden',
465
515
  getWrapSize: () => wrapSizeRef.current,
466
- apply: sync
467
- ? pos => {
468
- sync.position = pos
469
- sync.members.forEach(m => m.apply(pos))
470
- }
471
- : applyTransform,
516
+ apply: applyPos,
472
517
  // Synced pairs: a re-elected driver resumes from the pair's live position
473
518
  // (engine seeds from readBack on activation) instead of restarting at 0.
474
519
  readBack: sync ? () => sync.position : undefined,
@@ -490,17 +535,122 @@ export function MarqueeWall({
490
535
  }
491
536
  }, [marqueeMounted, reverse, posRef])
492
537
 
538
+ // ---- manual drag / wheel handlers (only wired when `dragScroll`) -----------
539
+ const DRAG_RESUME_MS = 1200
540
+ const dragStartRef = React.useRef({ coord: 0, pos: 0 })
541
+ const dragMovedRef = React.useRef(false)
542
+ const suppressClickRef = React.useRef(false)
543
+
544
+ const onDragPointerDown = React.useCallback((e: React.PointerEvent) => {
545
+ if (!marqueeMounted) return
546
+ draggingRef.current = true
547
+ dragMovedRef.current = false
548
+ // Clear any click-suppress left armed by a prior drag that ended WITHOUT a
549
+ // synthetic click on this container (pointercancel, or the pointer released
550
+ // off the wall) — otherwise `onDragClickCapture` would swallow this fresh
551
+ // tap's action. A new press is unambiguously a new intent.
552
+ suppressClickRef.current = false
553
+ dragStartRef.current = { coord: axis === 'y' ? e.clientY : e.clientX, pos: posRef.current }
554
+ try { containerRef.current?.setPointerCapture(e.pointerId) } catch { /* capture is best-effort */ }
555
+ }, [marqueeMounted, axis, posRef])
556
+
557
+ const onDragPointerMove = React.useCallback((e: React.PointerEvent) => {
558
+ if (!draggingRef.current) return
559
+ const delta = (axis === 'y' ? e.clientY : e.clientX) - dragStartRef.current.coord
560
+ if (Math.abs(delta) > 3) dragMovedRef.current = true
561
+ // Track follows the pointer. `applyPos` maps pos→translate as `-pos`
562
+ // (forward) / `pos-wrap` (reverse), so a rightward/downward drag (delta > 0)
563
+ // must DECREASE pos on a forward wall and INCREASE it on a reverse one.
564
+ // Via `applyPos` (not raw `applyTransform`) so synced peer walls follow.
565
+ posRef.current = wrap(dragStartRef.current.pos + (reverse ? delta : -delta))
566
+ applyPos(posRef.current)
567
+ dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS
568
+ }, [axis, reverse, wrap, posRef, applyPos])
569
+
570
+ const onDragPointerUp = React.useCallback((e: React.PointerEvent) => {
571
+ if (!draggingRef.current) return
572
+ draggingRef.current = false
573
+ // A real drag ends over a chip → swallow the synthetic click so the drag
574
+ // doesn't fire the chip's action.
575
+ if (dragMovedRef.current) suppressClickRef.current = true
576
+ dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS
577
+ try { containerRef.current?.releasePointerCapture(e.pointerId) } catch { /* best-effort */ }
578
+ }, [])
579
+
580
+ const onDragClickCapture = React.useCallback((e: React.MouseEvent) => {
581
+ if (suppressClickRef.current) {
582
+ suppressClickRef.current = false
583
+ e.preventDefault()
584
+ e.stopPropagation()
585
+ }
586
+ }, [])
587
+
588
+ // Along-axis wheel → move the wall. Wired as a NATIVE non-passive listener
589
+ // (not React's `onWheel`, which React attaches passively so `preventDefault`
590
+ // is a no-op): once WE consume an along-axis wheel we must `preventDefault` to
591
+ // suppress the browser's horizontal history-swipe (two-finger trackpad) on an
592
+ // x-wall. An x-wall ignores vertical page-scroll wheels (and vice-versa) so the
593
+ // surrounding page still scrolls normally.
594
+ React.useEffect(() => {
595
+ const el = containerRef.current
596
+ if (!el || !dragScroll || !marqueeMounted) return
597
+ const onWheel = (e: WheelEvent) => {
598
+ // Only claim the DOMINANT-axis wheel (per axis), so a cross-axis wheel
599
+ // still scrolls the page: an x-wall ignores vertical wheels, a y-wall
600
+ // ignores horizontal ones.
601
+ const primary =
602
+ axis === 'y'
603
+ ? Math.abs(e.deltaY) >= Math.abs(e.deltaX)
604
+ ? e.deltaY
605
+ : 0
606
+ : Math.abs(e.deltaX) >= Math.abs(e.deltaY)
607
+ ? e.deltaX
608
+ : 0
609
+ if (primary === 0) return
610
+ e.preventDefault()
611
+ // Via `applyPos` (not raw `applyTransform`) so synced peer walls follow.
612
+ posRef.current = wrap(posRef.current + (reverse ? -primary : primary))
613
+ applyPos(posRef.current)
614
+ dragSuppressUntilRef.current = performance.now() + DRAG_RESUME_MS
615
+ }
616
+ el.addEventListener('wheel', onWheel, { passive: false })
617
+ return () => el.removeEventListener('wheel', onWheel)
618
+ }, [dragScroll, marqueeMounted, axis, reverse, wrap, posRef, applyPos])
619
+
493
620
  // ---- render ----------------------------------------------------------------
494
621
  const renderContent = (isClone: boolean) =>
495
622
  typeof children === 'function' ? children({ isClone }) : children
496
623
 
624
+ // Reduced-motion static fallback: when the marquee does NOT mount (chiefly
625
+ // prefers-reduced-motion) but the content OVERFLOWS, the drag/transform path
626
+ // is inert — so on a `dragScroll` wall fall back to NATIVE
627
+ // overflow scroll along the axis. Otherwise the overflowing chips would be
628
+ // clipped by `overflow-hidden` with no way to reach them (a11y regression vs
629
+ // the old wrapping row). The visible thin scrollbar (global `*` rule) is the
630
+ // right affordance for reduced-motion users. No engine needed — the browser
631
+ // scrolls the single static track.
632
+ const staticScrollable = dragScroll && overflows && !marqueeMounted
633
+
497
634
  return (
498
635
  <div
499
636
  ref={containerRef}
500
- className={cn('relative overflow-hidden', className)}
637
+ className={cn(
638
+ 'relative',
639
+ staticScrollable ? (axis === 'y' ? 'overflow-y-auto' : 'overflow-x-auto') : 'overflow-hidden',
640
+ dragScroll && marqueeMounted && 'cursor-grab active:cursor-grabbing select-none',
641
+ className,
642
+ )}
643
+ // x-walls let vertical page-scroll pass (`pan-y`) and own horizontal
644
+ // drags; y-walls the reverse. Only when drag is actually live.
645
+ style={dragScroll && marqueeMounted ? { touchAction: axis === 'y' ? 'pan-x' : 'pan-y' } : undefined}
501
646
  data-marquee-track={trackId}
502
647
  onPointerEnter={onPointerEnter}
503
648
  onPointerLeave={onPointerLeave}
649
+ onPointerDown={dragScroll ? onDragPointerDown : undefined}
650
+ onPointerMove={dragScroll ? onDragPointerMove : undefined}
651
+ onPointerUp={dragScroll ? onDragPointerUp : undefined}
652
+ onPointerCancel={dragScroll ? onDragPointerUp : undefined}
653
+ onClickCapture={dragScroll ? onDragClickCapture : undefined}
504
654
  >
505
655
  <div
506
656
  ref={trackRef}
@@ -9,7 +9,6 @@ Central barrel export file for the hooks package, re-exporting all custom React
9
9
  | `./platform` | Platform-specific hooks |
10
10
  | `./use-toast` | Toast notification hook |
11
11
  | `./use-contact-submission` | Contact form submission hook |
12
- | `./use-quick-action-hint` | Quick action hint display hook |
13
12
  | `./use-copy-to-clipboard` | Clipboard write hook |
14
13
  | `./use-batch-images` | Authenticated batch image loading |
15
14
  | `./use-authenticated-image` | Single authenticated image hook |
@@ -3,7 +3,6 @@ export * from './ui'
3
3
  export * from './platform'
4
4
  export * from './use-toast'
5
5
  export * from './use-contact-submission'
6
- export * from './use-quick-action-hint'
7
6
  export * from './use-copy-to-clipboard'
8
7
 
9
8
  // Image authentication hooks
@@ -12,6 +12,7 @@ export * from './use-media-query'
12
12
  export * from './use-memoized-callback'
13
13
  export * from './use-notification-permission'
14
14
  export * from './use-onboarding-state'
15
+ export * from './use-reset-on-page-hidden'
15
16
  export * from './use-search'
16
17
  export * from './use-suppress-clone-focus'
17
18
  export * from './use-table-pagination'
@@ -0,0 +1,32 @@
1
+ import { useEffect } from 'react'
2
+
3
+ /**
4
+ * Runs `reset` whenever the tab is hidden or the window loses focus — exactly the
5
+ * moments a `pointerleave` / `pointercancel` can be SWALLOWED (tab blur, an
6
+ * overlay mounting under the cursor, an interrupted pointer), which otherwise
7
+ * leaves a hover/"inside" flag stuck `true` and freezes a marquee FOREVER. The
8
+ * next real pointer/hover re-arms the flag.
9
+ *
10
+ * SSOT self-heal for every marquee surface (MarqueeWall, CardsStrip) so the
11
+ * blur + `visibilitychange` wiring lives in one place. `reset` almost always
12
+ * only UN-sticks state. The one edge: on `blur` WITHOUT the tab hiding (a second
13
+ * window focused beside this one), clearing the hover-pause can let the marquee
14
+ * resume under a still-stationary cursor in the now-unfocused window — it
15
+ * re-pauses on the next `pointermove`/`pointerenter`. We keep the `blur` reset
16
+ * anyway because it's the only signal that catches a tab-blur that swallows the
17
+ * `pointerleave` without a `visibilitychange`. Pass a STABLE `reset` (memoize
18
+ * with `useCallback`) — the listeners re-attach whenever its identity changes.
19
+ */
20
+ export function useResetOnPageHidden(reset: () => void): void {
21
+ useEffect(() => {
22
+ const onVisibility = () => {
23
+ if (document.visibilityState === 'hidden') reset()
24
+ }
25
+ window.addEventListener('blur', reset)
26
+ document.addEventListener('visibilitychange', onVisibility)
27
+ return () => {
28
+ window.removeEventListener('blur', reset)
29
+ document.removeEventListener('visibilitychange', onVisibility)
30
+ }
31
+ }, [reset])
32
+ }
@@ -29,19 +29,39 @@
29
29
 
30
30
  import { useEffect, useRef, useState, useCallback } from 'react';
31
31
 
32
- // Per-rootMargin IO map. Multiple call sites with different margins each
33
- // get their own singleton observer.
32
+ // Per-(rootMargin, threshold) IO map. Multiple call sites with different
33
+ // margins/thresholds each get their own singleton observer.
34
34
  const observers = new Map<string, IntersectionObserver>();
35
35
  const subscribers = new WeakMap<Element, () => void>();
36
36
 
37
- function getObserverFor(rootMargin: string): IntersectionObserver {
38
- const existing = observers.get(rootMargin);
37
+ // Slack for the explicit ratio check: an element sized to exactly meet the
38
+ // threshold can report a ratio a hair under it (sub-pixel / float rounding), so
39
+ // accept `ratio >= threshold - EPSILON`. With `threshold: 0` this is a no-op
40
+ // (ratio is always ≥ 0 > -EPSILON) — the `isIntersecting` check alone gates.
41
+ const THRESHOLD_EPSILON = 0.01;
42
+
43
+ /** Stable map key for an observer config. */
44
+ function observerKey(rootMargin: string, threshold: number): string {
45
+ return `${rootMargin}|${threshold}`;
46
+ }
47
+
48
+ function getObserverFor(rootMargin: string, threshold: number): IntersectionObserver {
49
+ const key = observerKey(rootMargin, threshold);
50
+ const existing = observers.get(key);
39
51
  if (existing) return existing;
40
52
 
41
53
  const io = new IntersectionObserver(
42
54
  (entries) => {
43
55
  entries.forEach((entry) => {
56
+ // Enforce the threshold EXPLICITLY. `isIntersecting` is spec-defined as
57
+ // `intersectionRatio > 0` (any overlap), so the initial `observe()`
58
+ // firing can report `true` at, say, 20% visible even with
59
+ // `threshold: 0.5` — which would prematurely pass the gate. Require both
60
+ // an intersection AND the ratio to actually meet the threshold (minus a
61
+ // small epsilon for the float rounding where the ratio lands a hair
62
+ // under the exact value).
44
63
  if (!entry.isIntersecting) return;
64
+ if (entry.intersectionRatio < threshold - THRESHOLD_EPSILON) return;
45
65
  // Race-safe: re-read the callback at fire time. A late IO firing
46
66
  // after cleanup must not invoke a stale callback.
47
67
  const cb = subscribers.get(entry.target);
@@ -52,9 +72,9 @@ function getObserverFor(rootMargin: string): IntersectionObserver {
52
72
  }
53
73
  });
54
74
  },
55
- { rootMargin }
75
+ { rootMargin, threshold }
56
76
  );
57
- observers.set(rootMargin, io);
77
+ observers.set(key, io);
58
78
  return io;
59
79
  }
60
80
 
@@ -78,12 +98,16 @@ export interface UseNearViewportResult<T extends Element = HTMLElement> {
78
98
  * '500px' = element starts mounting 500px before scroll-in.
79
99
  * '1000px' = a full viewport's worth of lookahead.
80
100
  * '0px' = strict on-screen detection.
101
+ * @param threshold Fraction of the element that must be visible before firing
102
+ * (0 = any pixel — the default; 0.5 = at least half on-screen).
81
103
  */
82
104
  export function useNearViewport<T extends Element = HTMLElement>(
83
- rootMargin: string = NEAR_VIEWPORT_ROOT_MARGIN
105
+ rootMargin: string = NEAR_VIEWPORT_ROOT_MARGIN,
106
+ threshold: number = 0
84
107
  ): UseNearViewportResult<T> {
85
108
  const [isNear, setIsNear] = useState(false);
86
109
  const elRef = useRef<T | null>(null);
110
+ const key = observerKey(rootMargin, threshold);
87
111
 
88
112
  // Subscribe/unsubscribe on element change.
89
113
  const ref = useCallback(
@@ -96,7 +120,7 @@ export function useNearViewport<T extends Element = HTMLElement>(
96
120
  const stillOurs = subscribers.get(prev);
97
121
  if (stillOurs) {
98
122
  subscribers.delete(prev);
99
- observers.get(rootMargin)?.unobserve(prev);
123
+ observers.get(key)?.unobserve(prev);
100
124
  }
101
125
  }
102
126
 
@@ -105,9 +129,9 @@ export function useNearViewport<T extends Element = HTMLElement>(
105
129
 
106
130
  const cb = () => setIsNear(true);
107
131
  subscribers.set(node, cb);
108
- getObserverFor(rootMargin).observe(node);
132
+ getObserverFor(rootMargin, threshold).observe(node);
109
133
  },
110
- [rootMargin]
134
+ [key, rootMargin, threshold]
111
135
  );
112
136
 
113
137
  // Unsubscribe on unmount. Identity check guards the StrictMode race.
@@ -117,10 +141,10 @@ export function useNearViewport<T extends Element = HTMLElement>(
117
141
  if (!el) return;
118
142
  if (subscribers.get(el)) {
119
143
  subscribers.delete(el);
120
- observers.get(rootMargin)?.unobserve(el);
144
+ observers.get(key)?.unobserve(el);
121
145
  }
122
146
  };
123
- }, [rootMargin]);
147
+ }, [key]);
124
148
 
125
149
  return { ref, isNear };
126
150
  }
@@ -9,11 +9,8 @@ import {
9
9
  } from '../components/chat/chat-container'
10
10
  import { ChatInput } from '../components/chat/chat-input'
11
11
  import { ChatMessageList } from '../components/chat/chat-message-list'
12
- import {
13
- ChatQuickActionRow,
14
- ChatQuickActionRowSkeleton,
15
- type QuickActionChip,
16
- } from '../components/chat/chat-quick-action-row'
12
+ import { QuickActionWall } from '../components/chat/quick-action-wall'
13
+ import type { QuickActionChip } from '../components/chat/quick-action-chip'
17
14
  import { ModelDisplay, ModelDisplaySkeleton } from '../components/chat/model-display'
18
15
  import type { Message } from '../components/chat/types/message.types'
19
16
  import { cn } from '../utils/cn'
@@ -145,13 +142,19 @@ function FaeChatShell({
145
142
  />
146
143
  </ChatContent>
147
144
  <ChatFooter fullWidth={fullWidth}>
148
- {/* Quick-action chips above the composer — real row by default, skeleton
149
- placeholder in the loading variant (same pattern as ModelDisplay). */}
150
- {modelLoading ? (
151
- <ChatQuickActionRowSkeleton className="mb-[var(--spacing-system-s)]" />
152
- ) : (
153
- <ChatQuickActionRow className="mb-[var(--spacing-system-s)]" chips={SAMPLE_QUICK_ACTIONS} />
154
- )}
145
+ {/* Quick actions above the composer — the shared `QuickActionWall`
146
+ (its own 1:1 skeleton drives the loading variant, same pattern as
147
+ ModelDisplay). */}
148
+ <QuickActionWall
149
+ className="mb-[var(--spacing-system-s)] max-h-28"
150
+ chips={SAMPLE_QUICK_ACTIONS}
151
+ loading={modelLoading}
152
+ rows={2}
153
+ fade={['left', 'right']}
154
+ fadeSize={{ left: 32 }}
155
+ fadeColor="var(--color-bg)"
156
+ copyGap="var(--spacing-system-xxs)"
157
+ />
155
158
  <ChatInput
156
159
  onSend={handleSend}
157
160
  placeholder="Message Fae..."
@@ -1,7 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/nextjs-vite'
2
2
  import { QuickActionWall, interleave } from '../components/chat/quick-action-wall'
3
- import type { QuickActionChip } from '../components/chat/chat-quick-action-row'
4
- import type { QuickActionThemeSpec } from '../components/chat/quick-action-chip'
3
+ import type { QuickActionChip, QuickActionThemeSpec } from '../components/chat/quick-action-chip'
5
4
 
6
5
  // Theme specs are CALLER-supplied (the lib ships no registry, no fallbacks):
7
6
  // these are this story's own demo specs — real consumers resolve agent