@flamingo-stack/openframe-frontend-core 0.0.731 → 0.0.732

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 (132) hide show
  1. package/dist/build/export-map.json +1 -1
  2. package/dist/{chunk-2UNQJVYN.cjs → chunk-22ZK7BA3.cjs} +1221 -1006
  3. package/dist/{chunk-Y4QRK3CB.cjs → chunk-3BLBWZ6A.cjs} +4 -4
  4. package/dist/{chunk-ZV6473Z4.cjs → chunk-5HMGK3N6.cjs} +18 -18
  5. package/dist/{chunk-HI7EFAFQ.cjs → chunk-5HSMTSHU.cjs} +28 -28
  6. package/dist/{chunk-XDBHGWFH.cjs → chunk-6HHUU56Y.cjs} +16 -16
  7. package/dist/{chunk-A4HNF4MP.cjs → chunk-6KDGIOLP.cjs} +80 -80
  8. package/dist/chunk-AEVGCB3Y.cjs +417 -0
  9. package/dist/{chunk-CLILWI6O.cjs → chunk-BDTX2OEE.cjs} +32 -32
  10. package/dist/{chunk-YDGBRI3Y.cjs → chunk-BS4EZZCN.cjs} +13 -13
  11. package/dist/{chunk-JPZ4Y6X3.cjs → chunk-C5NERNE6.cjs} +89 -89
  12. package/dist/{chunk-YUXRIR45.cjs → chunk-CC3LINHF.cjs} +95 -47
  13. package/dist/{chunk-53XZ6MJ5.cjs → chunk-CUF3IYIB.cjs} +28 -28
  14. package/dist/{chunk-FKKUQK4C.cjs → chunk-G37LT2ID.cjs} +5 -1
  15. package/dist/chunk-HELVKMRG.cjs +28 -0
  16. package/dist/{chunk-HEOD765R.cjs → chunk-HH4BMYDX.cjs} +23 -370
  17. package/dist/{chunk-4YPV4OI4.cjs → chunk-I46MQ4R5.cjs} +80 -80
  18. package/dist/{chunk-RAHRDJBP.cjs → chunk-MEDDKM3A.cjs} +2 -2
  19. package/dist/{chunk-3SWLL4IM.cjs → chunk-MVZ6XFPK.cjs} +6 -6
  20. package/dist/{chunk-TH4N726A.cjs → chunk-N466AJGN.cjs} +17 -17
  21. package/dist/{chunk-QP6QS3YU.cjs → chunk-OI7VCXYU.cjs} +48 -50
  22. package/dist/{chunk-25H2SZH7.cjs → chunk-OJ3XU3YZ.cjs} +4 -4
  23. package/dist/{chunk-JK75ZZP3.cjs → chunk-PRWBVIWW.cjs} +43 -43
  24. package/dist/chunk-PX7FY655.cjs +114 -0
  25. package/dist/{chunk-HLIJ3U2T.cjs → chunk-QMTC3BK3.cjs} +13 -11
  26. package/dist/{chunk-YJFN2W7A.cjs → chunk-RIXGLS5Y.cjs} +3 -3
  27. package/dist/{chunk-BFHLGEJK.cjs → chunk-SJRR745G.cjs} +61 -58
  28. package/dist/{chunk-6V4GEE55.cjs → chunk-TLDCSTTQ.cjs} +8 -8
  29. package/dist/{chunk-RBOIGJYF.cjs → chunk-XOQ2UUVS.cjs} +4 -4
  30. package/dist/{chunk-32ENYVFA.cjs → chunk-YGKVHSNQ.cjs} +42 -42
  31. package/dist/{chunk-HY2KTQSL.cjs → chunk-ZWMPAFGB.cjs} +183 -183
  32. package/dist/{cloud-tenants-SC4FNAC2.cjs → cloud-tenants-ILRE74JY.cjs} +16 -16
  33. package/dist/components/agent-identity.d.ts +8 -0
  34. package/dist/components/agent-identity.d.ts.map +1 -1
  35. package/dist/components/agent-identity.js +13 -1
  36. package/dist/components/case-studies/index.cjs +29 -29
  37. package/dist/components/chat/index.cjs +11 -11
  38. package/dist/components/contact/index.cjs +17 -17
  39. package/dist/components/docs/index.cjs +20 -20
  40. package/dist/components/embeds/index.cjs +17 -17
  41. package/dist/components/faq/index.cjs +17 -17
  42. package/dist/components/features/index.cjs +16 -16
  43. package/dist/components/help-center-pages/index.cjs +127 -127
  44. package/dist/components/index.cjs +79 -72
  45. package/dist/components/meeting-scheduler/index.cjs +47 -47
  46. package/dist/components/navigation/index.cjs +19 -19
  47. package/dist/components/onboarding-guides/index.cjs +19 -19
  48. package/dist/components/product-demo/index.cjs +8 -8
  49. package/dist/components/product-demo/screens/remote-desktop-picture.d.ts.map +1 -1
  50. package/dist/components/product-demo/screens/remote-desktop-picture.js +2 -1
  51. package/dist/components/related-content/index.cjs +6 -6
  52. package/dist/components/tickets/index.cjs +20 -20
  53. package/dist/components/ui/device-wallpaper.d.ts +7 -0
  54. package/dist/components/ui/device-wallpaper.d.ts.map +1 -0
  55. package/dist/components/ui/device-wallpaper.js +5 -0
  56. package/dist/components/ui/feature-list.d.ts +9 -4
  57. package/dist/components/ui/feature-list.d.ts.map +1 -1
  58. package/dist/components/ui/feature-list.js +26 -35
  59. package/dist/components/ui/index.cjs +22 -16
  60. package/dist/components/ui/index.d.ts +3 -1
  61. package/dist/components/ui/index.d.ts.map +1 -1
  62. package/dist/components/ui/index.js +3 -1
  63. package/dist/components/ui/notification-stack.d.ts +33 -0
  64. package/dist/components/ui/notification-stack.d.ts.map +1 -0
  65. package/dist/components/ui/notification-stack.js +78 -0
  66. package/dist/components/ui/numbered-step.d.ts +29 -0
  67. package/dist/components/ui/numbered-step.d.ts.map +1 -0
  68. package/dist/components/ui/numbered-step.js +57 -0
  69. package/dist/components/ui/phone-frame.d.ts +14 -9
  70. package/dist/components/ui/phone-frame.d.ts.map +1 -1
  71. package/dist/components/ui/phone-frame.js +50 -6
  72. package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts +5 -0
  73. package/dist/components/ui/phone-glyphs/lock-camera-glyph.d.ts.map +1 -0
  74. package/dist/components/ui/phone-glyphs/lock-camera-glyph.js +14 -0
  75. package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts +5 -0
  76. package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.d.ts.map +1 -0
  77. package/dist/components/ui/phone-glyphs/lock-flashlight-glyph.js +14 -0
  78. package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts +5 -0
  79. package/dist/components/ui/phone-glyphs/status-bar-glyphs.d.ts.map +1 -0
  80. package/dist/components/ui/phone-glyphs/status-bar-glyphs.js +68 -0
  81. package/dist/components/ui/snap-carousel.d.ts +5 -8
  82. package/dist/components/ui/snap-carousel.d.ts.map +1 -1
  83. package/dist/components/ui/snap-carousel.js +2 -27
  84. package/dist/components/ui/tab-navigation.d.ts +8 -1
  85. package/dist/components/ui/tab-navigation.d.ts.map +1 -1
  86. package/dist/components/ui/tab-navigation.js +30 -20
  87. package/dist/{devices-7MHSJNXS.cjs → devices-A6SFNGE4.cjs} +17 -17
  88. package/dist/{embeddable-chat-VPIG3F7E.cjs → embeddable-chat-BKPYNOIM.cjs} +80 -80
  89. package/dist/hooks/index.cjs +6 -6
  90. package/dist/hooks/ui/use-autoplay.d.ts +50 -13
  91. package/dist/hooks/ui/use-autoplay.d.ts.map +1 -1
  92. package/dist/hooks/ui/use-autoplay.js +76 -13
  93. package/dist/hooks/ui/use-in-view.d.ts +8 -0
  94. package/dist/hooks/ui/use-in-view.d.ts.map +1 -1
  95. package/dist/hooks/ui/use-in-view.js +21 -36
  96. package/dist/hooks/use-agent-identities.d.ts +6 -0
  97. package/dist/hooks/use-agent-identities.d.ts.map +1 -1
  98. package/dist/hooks/use-scenario-player.d.ts +26 -9
  99. package/dist/hooks/use-scenario-player.d.ts.map +1 -1
  100. package/dist/hooks/use-scenario-player.js +12 -9
  101. package/dist/index.cjs +51 -44
  102. package/dist/{knowledge-4DREGSOZ.cjs → knowledge-5ZCVKUYV.cjs} +17 -17
  103. package/dist/{logs-BWXNT2KP.cjs → logs-CL4OJASB.cjs} +24 -24
  104. package/dist/{policies-MGFUI23M.cjs → policies-7D44ZVS5.cjs} +20 -20
  105. package/dist/{remote-session-O6QGXV2N.cjs → remote-session-QB3CIZRM.cjs} +5 -4
  106. package/dist/{software-update-7LF7XEYC.cjs → software-update-AX6TZL26.cjs} +20 -20
  107. package/dist/{tickets-board-KNXK747O.cjs → tickets-board-7FAV2YWF.cjs} +10 -10
  108. package/package.json +1 -1
  109. package/src/components/agent-identity.tsx +20 -1
  110. package/src/components/product-demo/screens/remote-desktop-picture.tsx +2 -1
  111. package/src/components/ui/device-wallpaper.ts +7 -0
  112. package/src/components/ui/feature-list.tsx +24 -30
  113. package/src/components/ui/index.ts +3 -1
  114. package/src/components/ui/notification-stack.tsx +133 -0
  115. package/src/components/ui/numbered-step.tsx +81 -0
  116. package/src/components/ui/phone-frame.tsx +83 -19
  117. package/src/components/ui/phone-glyphs/lock-camera-glyph.tsx +14 -0
  118. package/src/components/ui/phone-glyphs/lock-flashlight-glyph.tsx +14 -0
  119. package/src/components/ui/phone-glyphs/status-bar-glyphs.tsx +45 -0
  120. package/src/components/ui/snap-carousel.tsx +6 -38
  121. package/src/components/ui/tab-navigation.tsx +49 -21
  122. package/src/hooks/ui/use-autoplay.ts +144 -27
  123. package/src/hooks/ui/use-in-view.ts +31 -38
  124. package/src/hooks/use-agent-identities.ts +6 -0
  125. package/src/hooks/use-scenario-player.ts +44 -20
  126. package/dist/chunk-2WXLQ5R5.cjs +0 -99
  127. package/dist/chunk-BE2WAMG5.cjs +0 -54
  128. package/dist/chunk-LCTDHLDL.cjs +0 -43
  129. package/dist/components/ui/playback-toggle.d.ts +0 -24
  130. package/dist/components/ui/playback-toggle.d.ts.map +0 -1
  131. package/dist/components/ui/playback-toggle.js +0 -32
  132. package/src/components/ui/playback-toggle.tsx +0 -53
@@ -60,7 +60,7 @@
60
60
 
61
61
 
62
62
 
63
- var _chunkBFHLGEJKcjs = require('../chunk-BFHLGEJK.cjs');
63
+ var _chunkSJRR745Gcjs = require('../chunk-SJRR745G.cjs');
64
64
 
65
65
 
66
66
 
@@ -77,7 +77,7 @@ var _chunkA6P6DHEZcjs = require('../chunk-A6P6DHEZ.cjs');
77
77
  require('../chunk-MZ4KBSH7.cjs');
78
78
 
79
79
 
80
- var _chunkYJFN2W7Acjs = require('../chunk-YJFN2W7A.cjs');
80
+ var _chunkRIXGLS5Ycjs = require('../chunk-RIXGLS5Y.cjs');
81
81
 
82
82
 
83
83
 
@@ -88,8 +88,8 @@ var _chunkYJFN2W7Acjs = require('../chunk-YJFN2W7A.cjs');
88
88
 
89
89
 
90
90
 
91
- var _chunkYUXRIR45cjs = require('../chunk-YUXRIR45.cjs');
92
- require('../chunk-2WXLQ5R5.cjs');
91
+ var _chunkCC3LINHFcjs = require('../chunk-CC3LINHF.cjs');
92
+ require('../chunk-HELVKMRG.cjs');
93
93
  require('../chunk-JKX2C3I2.cjs');
94
94
  require('../chunk-7DNL734S.cjs');
95
95
  require('../chunk-WWUSFOJ7.cjs');
@@ -105,7 +105,7 @@ var _chunkEAY6ZUEScjs = require('../chunk-EAY6ZUES.cjs');
105
105
 
106
106
 
107
107
 
108
- var _chunkLCTDHLDLcjs = require('../chunk-LCTDHLDL.cjs');
108
+ var _chunkPX7FY655cjs = require('../chunk-PX7FY655.cjs');
109
109
 
110
110
 
111
111
 
@@ -243,4 +243,4 @@ require('../chunk-3ATAYP36.cjs');
243
243
 
244
244
 
245
245
 
246
- exports.AGENT_IDENTITIES_API_PATH = _chunkLCTDHLDLcjs.AGENT_IDENTITIES_API_PATH; exports.CONTENT_BREAKPOINTS = _chunk7DUXR4HLcjs.CONTENT_BREAKPOINTS; exports.ContentAreaWidthContext = _chunk7DUXR4HLcjs.ContentAreaWidthContext; exports.DRAG_AND_DROP_MEDIA_QUERY = _chunkGID62YENcjs.DRAG_AND_DROP_MEDIA_QUERY; exports.GraphQLIntrospector = _chunkBFHLGEJKcjs.GraphQLIntrospector; exports.NEAR_VIEWPORT_ROOT_MARGIN = _chunkCW3ML76Ucjs.NEAR_VIEWPORT_ROOT_MARGIN; exports.PREFERS_REDUCED_MOTION_QUERY = _chunkYUXRIR45cjs.PREFERS_REDUCED_MOTION_QUERY; exports.ViewportBreakpoints = _chunk7DUXR4HLcjs.ViewportBreakpoints; exports.batchFetchAuthenticatedImages = _chunkBFHLGEJKcjs.batchFetchAuthenticatedImages; exports.breakpoints = _chunkMANNIJ42cjs.breakpoints; exports.clearAuthedAssetCache = _chunkVOX4E6AXcjs.clearAuthedAssetCache; exports.clearAuthedImageCache = _chunkMANNIJ42cjs.clearAuthedImageCache; exports.clearVariablesParams = _chunkBFHLGEJKcjs.clearParams; exports.coerceValue = _chunkBFHLGEJKcjs.coerceValue; exports.completeFormRescue = _chunkBFHLGEJKcjs.completeFormRescue; exports.configureAuthenticatedImage = _chunkBFHLGEJKcjs.configureAuthenticatedImage; exports.configureBatchImageFetch = _chunkBFHLGEJKcjs.configureBatchImageFetch; exports.contentBreakpointFor = _chunk7DUXR4HLcjs.contentBreakpointFor; exports.createSearchParams = _chunkBLH2SFOOcjs.createSearchParams; exports.extractVariablesFromQuery = _chunkBFHLGEJKcjs.extractVariablesFromQuery; exports.flattenQueryVariables = _chunkBFHLGEJKcjs.flattenQueryVariables; exports.getArrayParams = _chunkBFHLGEJKcjs.getArrayParams; exports.getNestedValue = _chunkBFHLGEJKcjs.getNestedValue; exports.getRequiredParams = _chunkBFHLGEJKcjs.getRequiredParams; exports.introspector = _chunkBFHLGEJKcjs.introspector; exports.isInputObjectType = _chunkBFHLGEJKcjs.isInputObjectType; exports.isScalarType = _chunkBFHLGEJKcjs.isScalarType; exports.mergeDefaults = _chunkBFHLGEJKcjs.mergeDefaults; exports.mergeVariables = _chunkBFHLGEJKcjs.mergeVariables; exports.resetDownloadsStore = _chunkBFHLGEJKcjs.resetDownloadsStore; exports.resolveActiveSection = _chunkBFHLGEJKcjs.resolveActiveSection; exports.setNestedValue = _chunkBFHLGEJKcjs.setNestedValue; exports.shouldIncludeInUrl = _chunkBLH2SFOOcjs.shouldIncludeInUrl; exports.toast = _chunkBFHLGEJKcjs.toast; exports.urlParamsToVariables = _chunkBFHLGEJKcjs.urlParamsToVariables; exports.useAccessCodeIntegration = _chunkBFHLGEJKcjs.useAccessCodeIntegration; exports.useActiveSection = _chunkBFHLGEJKcjs.useActiveSection; exports.useAgentIdentities = _chunkLCTDHLDLcjs.useAgentIdentities; exports.useApiParams = _chunkBFHLGEJKcjs.useApiParams; exports.useAuthedAssetSrc = _chunkVOX4E6AXcjs.useAuthedAssetSrc; exports.useAuthedImageSrc = _chunkMANNIJ42cjs.useAuthedImageSrc; exports.useAuthenticatedImage = _chunkBFHLGEJKcjs.useAuthenticatedImage; exports.useAutoLimitTags = _chunkA6P6DHEZcjs.useAutoLimitTags; exports.useAutoplay = _chunkYUXRIR45cjs.useAutoplay; exports.useBatchImages = _chunkBFHLGEJKcjs.useBatchImages; exports.useClaudeMirrorSrc = _chunkBFHLGEJKcjs.useClaudeMirrorSrc; exports.useContactSubmission = _chunkBFHLGEJKcjs.useContactSubmission; exports.useContentBreakpoint = _chunk7DUXR4HLcjs.useContentBreakpoint; exports.useContentLgUp = _chunk7DUXR4HLcjs.useContentLgUp; exports.useContentMdUp = _chunk7DUXR4HLcjs.useContentMdUp; exports.useCopyToClipboard = _chunkBFHLGEJKcjs.useCopyToClipboard; exports.useCursorPaginationState = _chunkBFHLGEJKcjs.useCursorPaginationState; exports.useDebounce = _chunkYUXRIR45cjs.useDebounce; exports.useDeferredError = _chunkBFHLGEJKcjs.useDeferredError; exports.useDownloads = _chunkBFHLGEJKcjs.useDownloads; exports.useDragAndDropEnabled = _chunkGID62YENcjs.useDragAndDropEnabled; exports.useFocusTrap = _chunkBFHLGEJKcjs.useFocusTrap; exports.useFormRescue = _chunkBFHLGEJKcjs.useFormRescue; exports.useHeaderHeight = _chunk24I6RFVUcjs.useHeaderHeight; exports.useHorizontalScrollbar = _chunkGID62YENcjs.useHorizontalScrollbar; exports.useHumanitySignals = _chunkBFHLGEJKcjs.useHumanitySignals; exports.useImageEdgeColor = _chunkEAY6ZUEScjs.useImageEdgeColor; exports.useInView = _chunkYUXRIR45cjs.useInView; exports.useIsTruncated = _chunkMANNIJ42cjs.useIsTruncated; exports.useIsomorphicLayoutEffect = _chunkVOX4E6AXcjs.useIsomorphicLayoutEffect; exports.useKeyboardCollisionPadding = _chunkA6P6DHEZcjs.useKeyboardCollisionPadding; exports.useLgUp = _chunkMANNIJ42cjs.useLgUp; exports.useLocalStorage = _chunkGID62YENcjs.useLocalStorage; exports.useLocationHash = _chunkBFHLGEJKcjs.useLocationHash; exports.useMarqueeEngine = _chunkYUXRIR45cjs.useMarqueeEngine; exports.useMdUp = _chunkMANNIJ42cjs.useMdUp; exports.useMediaQuery = _chunkMANNIJ42cjs.useMediaQuery; exports.useMemoizedCallback = _chunkBFHLGEJKcjs.useMemoizedCallback; exports.useNatsClient = _chunkBFHLGEJKcjs.useNatsClient; exports.useNavMenus = _chunkBFHLGEJKcjs.useNavMenus; exports.useNearViewport = _chunkCW3ML76Ucjs.useNearViewport; exports.useNotificationPermission = _chunkBFHLGEJKcjs.useNotificationPermission; exports.useOgPlaceholderUrl = _chunkEAY6ZUEScjs.useOgPlaceholderUrl; exports.useOnboardingState = _chunkBFHLGEJKcjs.useOnboardingState; exports.usePlatformByValue = _chunkBFHLGEJKcjs.usePlatformByValue; exports.usePlatformConfig = _chunkBFHLGEJKcjs.usePlatformConfig; exports.usePrefersReducedMotion = _chunkYUXRIR45cjs.usePrefersReducedMotion; exports.usePrefersReducedMotionState = _chunkYUXRIR45cjs.usePrefersReducedMotionState; exports.usePreventScroll = _chunkBFHLGEJKcjs.usePreventScroll; exports.useQueryParams = _chunkBFHLGEJKcjs.useQueryParams; exports.useRescuedForm = _chunkBFHLGEJKcjs.useRescuedForm; exports.useResetOnPageHidden = _chunkYUXRIR45cjs.useResetOnPageHidden; exports.useScenarioPlayer = _chunkBFHLGEJKcjs.useScenarioPlayer; exports.useScrollToHash = _chunkBFHLGEJKcjs.useScrollToHash; exports.useSearch = _chunkBFHLGEJKcjs.useSearch; exports.useSmUp = _chunkMANNIJ42cjs.useSmUp; exports.useStickyToolbar = _chunkBFHLGEJKcjs.useStickyToolbar; exports.useSuppressCloneFocus = _chunkYUXRIR45cjs.useSuppressCloneFocus; exports.useTablePagination = _chunkBFHLGEJKcjs.useTablePagination; exports.useThrottle = _chunkBFHLGEJKcjs.useThrottle; exports.useToast = _chunkBFHLGEJKcjs.useToast; exports.useValidatePlatform = _chunkBFHLGEJKcjs.useValidatePlatform; exports.useVisitorDesktopDownload = _chunkBFHLGEJKcjs.useVisitorDesktopDownload; exports.useVisitorOs = _chunkYJFN2W7Acjs.useVisitorOs; exports.useWindowSize = _chunkBFHLGEJKcjs.useWindowSize; exports.validateSchema = _chunkBFHLGEJKcjs.validateSchema; exports.validateVariables = _chunkBFHLGEJKcjs.validateVariables; exports.variablesToUrlParams = _chunkBFHLGEJKcjs.variablesToUrlParams;
246
+ exports.AGENT_IDENTITIES_API_PATH = _chunkPX7FY655cjs.AGENT_IDENTITIES_API_PATH; exports.CONTENT_BREAKPOINTS = _chunk7DUXR4HLcjs.CONTENT_BREAKPOINTS; exports.ContentAreaWidthContext = _chunk7DUXR4HLcjs.ContentAreaWidthContext; exports.DRAG_AND_DROP_MEDIA_QUERY = _chunkGID62YENcjs.DRAG_AND_DROP_MEDIA_QUERY; exports.GraphQLIntrospector = _chunkSJRR745Gcjs.GraphQLIntrospector; exports.NEAR_VIEWPORT_ROOT_MARGIN = _chunkCW3ML76Ucjs.NEAR_VIEWPORT_ROOT_MARGIN; exports.PREFERS_REDUCED_MOTION_QUERY = _chunkCC3LINHFcjs.PREFERS_REDUCED_MOTION_QUERY; exports.ViewportBreakpoints = _chunk7DUXR4HLcjs.ViewportBreakpoints; exports.batchFetchAuthenticatedImages = _chunkSJRR745Gcjs.batchFetchAuthenticatedImages; exports.breakpoints = _chunkMANNIJ42cjs.breakpoints; exports.clearAuthedAssetCache = _chunkVOX4E6AXcjs.clearAuthedAssetCache; exports.clearAuthedImageCache = _chunkMANNIJ42cjs.clearAuthedImageCache; exports.clearVariablesParams = _chunkSJRR745Gcjs.clearParams; exports.coerceValue = _chunkSJRR745Gcjs.coerceValue; exports.completeFormRescue = _chunkSJRR745Gcjs.completeFormRescue; exports.configureAuthenticatedImage = _chunkSJRR745Gcjs.configureAuthenticatedImage; exports.configureBatchImageFetch = _chunkSJRR745Gcjs.configureBatchImageFetch; exports.contentBreakpointFor = _chunk7DUXR4HLcjs.contentBreakpointFor; exports.createSearchParams = _chunkBLH2SFOOcjs.createSearchParams; exports.extractVariablesFromQuery = _chunkSJRR745Gcjs.extractVariablesFromQuery; exports.flattenQueryVariables = _chunkSJRR745Gcjs.flattenQueryVariables; exports.getArrayParams = _chunkSJRR745Gcjs.getArrayParams; exports.getNestedValue = _chunkSJRR745Gcjs.getNestedValue; exports.getRequiredParams = _chunkSJRR745Gcjs.getRequiredParams; exports.introspector = _chunkSJRR745Gcjs.introspector; exports.isInputObjectType = _chunkSJRR745Gcjs.isInputObjectType; exports.isScalarType = _chunkSJRR745Gcjs.isScalarType; exports.mergeDefaults = _chunkSJRR745Gcjs.mergeDefaults; exports.mergeVariables = _chunkSJRR745Gcjs.mergeVariables; exports.resetDownloadsStore = _chunkSJRR745Gcjs.resetDownloadsStore; exports.resolveActiveSection = _chunkSJRR745Gcjs.resolveActiveSection; exports.setNestedValue = _chunkSJRR745Gcjs.setNestedValue; exports.shouldIncludeInUrl = _chunkBLH2SFOOcjs.shouldIncludeInUrl; exports.toast = _chunkSJRR745Gcjs.toast; exports.urlParamsToVariables = _chunkSJRR745Gcjs.urlParamsToVariables; exports.useAccessCodeIntegration = _chunkSJRR745Gcjs.useAccessCodeIntegration; exports.useActiveSection = _chunkSJRR745Gcjs.useActiveSection; exports.useAgentIdentities = _chunkPX7FY655cjs.useAgentIdentities; exports.useApiParams = _chunkSJRR745Gcjs.useApiParams; exports.useAuthedAssetSrc = _chunkVOX4E6AXcjs.useAuthedAssetSrc; exports.useAuthedImageSrc = _chunkMANNIJ42cjs.useAuthedImageSrc; exports.useAuthenticatedImage = _chunkSJRR745Gcjs.useAuthenticatedImage; exports.useAutoLimitTags = _chunkA6P6DHEZcjs.useAutoLimitTags; exports.useAutoplay = _chunkCC3LINHFcjs.useAutoplay; exports.useBatchImages = _chunkSJRR745Gcjs.useBatchImages; exports.useClaudeMirrorSrc = _chunkSJRR745Gcjs.useClaudeMirrorSrc; exports.useContactSubmission = _chunkSJRR745Gcjs.useContactSubmission; exports.useContentBreakpoint = _chunk7DUXR4HLcjs.useContentBreakpoint; exports.useContentLgUp = _chunk7DUXR4HLcjs.useContentLgUp; exports.useContentMdUp = _chunk7DUXR4HLcjs.useContentMdUp; exports.useCopyToClipboard = _chunkSJRR745Gcjs.useCopyToClipboard; exports.useCursorPaginationState = _chunkSJRR745Gcjs.useCursorPaginationState; exports.useDebounce = _chunkCC3LINHFcjs.useDebounce; exports.useDeferredError = _chunkSJRR745Gcjs.useDeferredError; exports.useDownloads = _chunkSJRR745Gcjs.useDownloads; exports.useDragAndDropEnabled = _chunkGID62YENcjs.useDragAndDropEnabled; exports.useFocusTrap = _chunkSJRR745Gcjs.useFocusTrap; exports.useFormRescue = _chunkSJRR745Gcjs.useFormRescue; exports.useHeaderHeight = _chunk24I6RFVUcjs.useHeaderHeight; exports.useHorizontalScrollbar = _chunkGID62YENcjs.useHorizontalScrollbar; exports.useHumanitySignals = _chunkSJRR745Gcjs.useHumanitySignals; exports.useImageEdgeColor = _chunkEAY6ZUEScjs.useImageEdgeColor; exports.useInView = _chunkCC3LINHFcjs.useInView; exports.useIsTruncated = _chunkMANNIJ42cjs.useIsTruncated; exports.useIsomorphicLayoutEffect = _chunkVOX4E6AXcjs.useIsomorphicLayoutEffect; exports.useKeyboardCollisionPadding = _chunkA6P6DHEZcjs.useKeyboardCollisionPadding; exports.useLgUp = _chunkMANNIJ42cjs.useLgUp; exports.useLocalStorage = _chunkGID62YENcjs.useLocalStorage; exports.useLocationHash = _chunkSJRR745Gcjs.useLocationHash; exports.useMarqueeEngine = _chunkCC3LINHFcjs.useMarqueeEngine; exports.useMdUp = _chunkMANNIJ42cjs.useMdUp; exports.useMediaQuery = _chunkMANNIJ42cjs.useMediaQuery; exports.useMemoizedCallback = _chunkSJRR745Gcjs.useMemoizedCallback; exports.useNatsClient = _chunkSJRR745Gcjs.useNatsClient; exports.useNavMenus = _chunkSJRR745Gcjs.useNavMenus; exports.useNearViewport = _chunkCW3ML76Ucjs.useNearViewport; exports.useNotificationPermission = _chunkSJRR745Gcjs.useNotificationPermission; exports.useOgPlaceholderUrl = _chunkEAY6ZUEScjs.useOgPlaceholderUrl; exports.useOnboardingState = _chunkSJRR745Gcjs.useOnboardingState; exports.usePlatformByValue = _chunkSJRR745Gcjs.usePlatformByValue; exports.usePlatformConfig = _chunkSJRR745Gcjs.usePlatformConfig; exports.usePrefersReducedMotion = _chunkCC3LINHFcjs.usePrefersReducedMotion; exports.usePrefersReducedMotionState = _chunkCC3LINHFcjs.usePrefersReducedMotionState; exports.usePreventScroll = _chunkSJRR745Gcjs.usePreventScroll; exports.useQueryParams = _chunkSJRR745Gcjs.useQueryParams; exports.useRescuedForm = _chunkSJRR745Gcjs.useRescuedForm; exports.useResetOnPageHidden = _chunkCC3LINHFcjs.useResetOnPageHidden; exports.useScenarioPlayer = _chunkSJRR745Gcjs.useScenarioPlayer; exports.useScrollToHash = _chunkSJRR745Gcjs.useScrollToHash; exports.useSearch = _chunkSJRR745Gcjs.useSearch; exports.useSmUp = _chunkMANNIJ42cjs.useSmUp; exports.useStickyToolbar = _chunkSJRR745Gcjs.useStickyToolbar; exports.useSuppressCloneFocus = _chunkCC3LINHFcjs.useSuppressCloneFocus; exports.useTablePagination = _chunkSJRR745Gcjs.useTablePagination; exports.useThrottle = _chunkSJRR745Gcjs.useThrottle; exports.useToast = _chunkSJRR745Gcjs.useToast; exports.useValidatePlatform = _chunkSJRR745Gcjs.useValidatePlatform; exports.useVisitorDesktopDownload = _chunkSJRR745Gcjs.useVisitorDesktopDownload; exports.useVisitorOs = _chunkRIXGLS5Ycjs.useVisitorOs; exports.useWindowSize = _chunkSJRR745Gcjs.useWindowSize; exports.validateSchema = _chunkSJRR745Gcjs.validateSchema; exports.validateVariables = _chunkSJRR745Gcjs.validateVariables; exports.variablesToUrlParams = _chunkSJRR745Gcjs.variablesToUrlParams;
@@ -1,9 +1,23 @@
1
+ import type { FocusEvent, PointerEvent } from 'react';
2
+ /** The handlers that hold a moving thing still while a visitor is on it. Spread them on its outer element. */
3
+ export interface AutoplayHoldProps {
4
+ onPointerDown: (event: PointerEvent<HTMLElement>) => void;
5
+ onFocus: (event: FocusEvent<HTMLElement>) => void;
6
+ }
1
7
  export interface UseAutoplayResult {
2
8
  /** True while the thing may move by itself. */
3
9
  playing: boolean;
4
- /** The visitor stopped it with the pause control. */
5
- paused: boolean;
6
- setPaused: (paused: boolean) => void;
10
+ /** The visitor is holding it still: a finger or the mouse button is down on it, or the keyboard is inside it. */
11
+ held: boolean;
12
+ /** Spread on the element that moves: it is how a visitor stops it, with no control to find. */
13
+ holdProps: AutoplayHoldProps;
14
+ /**
15
+ * Lets go of every hold at once. Called when the visitor CHOOSES something on
16
+ * the thing itself (a tab, a step, an arrow): a choice is an instruction to
17
+ * play from there, and it must never depend on the browser reporting the end
18
+ * of the press or the focus that made it.
19
+ */
20
+ release: () => void;
7
21
  /** True once the system preference is known to be reduced motion. */
8
22
  reducedMotion: boolean;
9
23
  }
@@ -13,20 +27,43 @@ export interface UseAutoplayResult {
13
27
  * else decides it.
14
28
  *
15
29
  * 1. it is on screen (`onScreen`, the caller's `useInView`);
16
- * 2. the browser tab is visible (`visibilitychange`, and `pageshow` for a
17
- * page restored from the back/forward cache);
18
- * 3. the visitor has not pressed pause (`setPaused`: the stop control
30
+ * 2. the browser tab is visible;
31
+ * 3. the visitor is not holding it (`holdProps`: the way to stop it that
19
32
  * WCAG 2.2.2 asks of anything that moves for more than five seconds);
20
33
  * 4. motion is allowed (never under reduced motion, and not before the
21
34
  * preference is known).
22
35
  *
23
- * Every one of those has a way back that needs nothing particular from the
24
- * visitor: scroll back, return to the tab, press play. It deliberately does
25
- * NOT stop on hover, on keyboard focus, on a wheel event or on a touch.
26
- * Each was tried: a browser re-reports focus when its window is re-activated,
27
- * and a wheel or a touch is what scrolling the PAGE past the thing produces,
28
- * so those rules stopped it for reasons the visitor could not see, with no
29
- * visible way to start it again.
36
+ * There is NO pause button. A visitor holds it by PRESSING on it (a finger or
37
+ * the mouse button down, as a story is held) or by having KEYBOARD focus inside
38
+ * it. Each ends by itself (the press is released, wherever that happens; focus
39
+ * moves on), so it can never be left stopped with no visible way to start it again.
40
+ *
41
+ * HOW it knows, which is what keeps it from sticking. Each hold has more than
42
+ * one way to end, and every one of them is checked:
43
+ * - a PRESS ends on its release, listened for on the WINDOW (a drag that
44
+ * leaves the element still ends it), by ANY of the events a release can
45
+ * arrive as (`RELEASE_EVENTS`: a native drag ends in `dragend`, not
46
+ * `pointerup`), and, as the net under those, by the first pointer movement
47
+ * that reports no button down;
48
+ * - the KEYBOARD holds it only when focus ARRIVED by keyboard (the browser
49
+ * drew a ring for it as it came in), and only until focus leaves the
50
+ * element or the visitor reaches for the pointer. "Is `:focus-visible`
51
+ * inside" alone is not the test: a browser turns the ring on for a control
52
+ * that was CLICKED as soon as any key is pressed, which held the demo for a
53
+ * visitor who clicked a tab and then scrolled with the space bar;
54
+ * - a CHOICE made on the thing itself (`release`, called by whoever handles
55
+ * the tab, the step or the arrow) lets go of everything: it plays from
56
+ * there whatever the browser did or did not report;
57
+ * - the tab is read from the document (`useSyncExternalStore`), never copied
58
+ * into state.
59
+ *
60
+ * What does NOT hold it, each tried and removed:
61
+ * - HOVER: a visitor watching a demo rests the mouse on it, so it stopped the
62
+ * moment it had their attention and read as stuck;
63
+ * - a WHEEL event or a passing touch: that is what scrolling the PAGE past
64
+ * the thing produces (the browser cancels a press the moment it becomes a scroll);
65
+ * - focus the browser shows no ring for: a browser re-reports focus when its
66
+ * window is re-activated, and a mouse click on a control is not the keyboard.
30
67
  */
31
68
  export declare function useAutoplay(onScreen: boolean): UseAutoplayResult;
32
69
  //# sourceMappingURL=use-autoplay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-autoplay.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/use-autoplay.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB,CAsBhE"}
1
+ {"version":3,"file":"use-autoplay.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/use-autoplay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGtD,8GAA8G;AAC9G,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1D,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,iHAAiH;IACjH,IAAI,EAAE,OAAO,CAAC;IACd,+FAA+F;IAC/F,SAAS,EAAE,iBAAiB,CAAC;IAC7B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAC;CACxB;AA0BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB,CA6EhE"}
@@ -1,24 +1,87 @@
1
1
  "use client";
2
- import { useEffect, useState } from "react";
2
+ import { useCallback, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { usePrefersReducedMotionState } from "./use-prefers-reduced-motion.js";
4
+ function listen(target, events, onChange) {
5
+ const controller = new AbortController();
6
+ for (const event of events) target.addEventListener(event, onChange, { signal: controller.signal });
7
+ return () => controller.abort();
8
+ }
9
+ const subscribeToTab = (onChange) => {
10
+ const stopDocument = listen(document, ["visibilitychange"], onChange);
11
+ const stopWindow = listen(window, ["pageshow"], onChange);
12
+ return () => {
13
+ stopDocument();
14
+ stopWindow();
15
+ };
16
+ };
17
+ const tabIsHidden = () => document.visibilityState === "hidden";
18
+ const never = () => false;
19
+ const RELEASE_EVENTS = ["pointerup", "pointercancel", "mouseup", "touchend", "dragend", "blur"];
4
20
  function useAutoplay(onScreen) {
5
21
  const reducedState = usePrefersReducedMotionState();
6
- const [paused, setPaused] = useState(false);
7
- const [tabHidden, setTabHidden] = useState(false);
8
- useEffect(() => {
9
- const sync = () => setTabHidden(document.visibilityState === "hidden");
10
- sync();
11
- document.addEventListener("visibilitychange", sync);
12
- window.addEventListener("pageshow", sync);
22
+ const tabHidden = useSyncExternalStore(subscribeToTab, tabIsHidden, never);
23
+ const host = useRef(null);
24
+ const keyboardCameIn = useRef(false);
25
+ const subscribeToKeyboard = useCallback((onChange) => {
26
+ const usedPointer = () => {
27
+ keyboardCameIn.current = false;
28
+ onChange();
29
+ };
30
+ const stopFocus = listen(document, ["focusin", "focusout", "visibilitychange"], onChange);
31
+ const stopPointer = listen(document, ["pointerdown", "pointermove"], usedPointer);
32
+ const stopWindow = listen(window, ["focus", "blur"], onChange);
13
33
  return () => {
14
- document.removeEventListener("visibilitychange", sync);
15
- window.removeEventListener("pageshow", sync);
34
+ stopFocus();
35
+ stopPointer();
36
+ stopWindow();
16
37
  };
17
38
  }, []);
39
+ const keyboardIsInside = useCallback(() => {
40
+ if (!keyboardCameIn.current) return false;
41
+ const inside = !!host.current?.isConnected && host.current.contains(document.activeElement);
42
+ if (!inside) keyboardCameIn.current = false;
43
+ return inside;
44
+ }, []);
45
+ const focused = useSyncExternalStore(subscribeToKeyboard, keyboardIsInside, never);
46
+ const [pressed, setPressed] = useState(false);
47
+ const holdProps = useMemo(
48
+ () => ({
49
+ onPointerDown: (event) => {
50
+ host.current = event.currentTarget;
51
+ setPressed(true);
52
+ const released = new AbortController();
53
+ const release2 = () => {
54
+ setPressed(false);
55
+ released.abort();
56
+ };
57
+ for (const type of RELEASE_EVENTS) window.addEventListener(type, release2, { signal: released.signal });
58
+ window.addEventListener(
59
+ "pointermove",
60
+ (move) => {
61
+ if (move.buttons === 0) release2();
62
+ },
63
+ { signal: released.signal }
64
+ );
65
+ },
66
+ onFocus: (event) => {
67
+ host.current = event.currentTarget;
68
+ if (event.target.matches(":focus-visible")) keyboardCameIn.current = true;
69
+ }
70
+ }),
71
+ []
72
+ );
73
+ const [, setReleases] = useState(0);
74
+ const release = useCallback(() => {
75
+ keyboardCameIn.current = false;
76
+ setPressed(false);
77
+ setReleases((count) => count + 1);
78
+ }, []);
79
+ const held = pressed || focused;
18
80
  return {
19
- playing: onScreen && !paused && !tabHidden && reducedState === false,
20
- paused,
21
- setPaused,
81
+ playing: onScreen && !held && !tabHidden && reducedState === false,
82
+ held,
83
+ holdProps,
84
+ release,
22
85
  reducedMotion: reducedState === true
23
86
  };
24
87
  }
@@ -26,6 +26,14 @@ export interface UseInViewResult<T extends Element> {
26
26
  * `useNearViewport` is the fire-once sibling (mount a heavy thing when it gets
27
27
  * close, never unmount). This one is for things that should run only WHILE
28
28
  * visible, like an auto-advancing carousel or a looping demo.
29
+ *
30
+ * The observer LIVES IN AN EFFECT keyed on the element, never in the ref
31
+ * callback. An observer made in the callback and torn down by a separate
32
+ * effect is torn down every time React re-runs effects without re-attaching
33
+ * refs (a Fast Refresh, an Activity that hides and shows): nothing observed any
34
+ * more, and `inView` froze at its last value, so a demo that happened to be off
35
+ * screen at that moment never played again. An effect that owns it makes it
36
+ * again whenever it is torn down.
29
37
  */
30
38
  export declare function useInView<T extends Element = HTMLElement>({ threshold, rootMargin, initial, }?: UseInViewOptions): UseInViewResult<T>;
31
39
  //# sourceMappingURL=use-in-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-in-view.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/use-in-view.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,OAAO;IAChD,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9B,mFAAmF;IACnF,MAAM,EAAE,OAAO,CAAC;CACjB;AAaD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW,EAAE,EACzD,SAAa,EACb,UAAkB,EAClB,OAAe,GAChB,GAAE,gBAAqB,GAAG,eAAe,CAAC,CAAC,CAAC,CAwC5C"}
1
+ {"version":3,"file":"use-in-view.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/use-in-view.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,OAAO;IAChD,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9B,mFAAmF;IACnF,MAAM,EAAE,OAAO,CAAC;CACjB;AAaD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW,EAAE,EACzD,SAAa,EACb,UAAkB,EAClB,OAAe,GAChB,GAAE,gBAAqB,GAAG,eAAe,CAAC,CAAC,CAAC,CAyB5C"}
@@ -1,46 +1,31 @@
1
1
  "use client";
2
- import { useCallback, useEffect, useRef, useState } from "react";
2
+ import { useEffect, useState } from "react";
3
3
  const STEPS = Array.from({ length: 21 }, (_, i) => i / 20);
4
4
  function useInView({
5
5
  threshold = 0,
6
6
  rootMargin = "0px",
7
7
  initial = false
8
8
  } = {}) {
9
- const [inView, setInView] = useState(initial);
10
- const observerRef = useRef(null);
11
- const disconnect = useCallback(() => {
12
- observerRef.current?.disconnect();
13
- observerRef.current = null;
14
- }, []);
15
- const ref = useCallback(
16
- (node) => {
17
- disconnect();
18
- if (!node) {
19
- setInView(false);
20
- return;
21
- }
22
- if (typeof IntersectionObserver === "undefined") {
23
- setInView(initial);
24
- return;
25
- }
26
- const observer = new IntersectionObserver(
27
- (entries) => {
28
- const entry = entries[entries.length - 1];
29
- if (!entry) return;
30
- const ofElement = entry.intersectionRatio >= threshold;
31
- const viewportHeight = entry.rootBounds?.height ?? 0;
32
- const ofViewport = viewportHeight > 0 && (entry.intersectionRect?.height ?? 0) >= viewportHeight * threshold;
33
- setInView(entry.isIntersecting && (ofElement || ofViewport));
34
- },
35
- { threshold: STEPS, rootMargin }
36
- );
37
- observer.observe(node);
38
- observerRef.current = observer;
39
- },
40
- [disconnect, threshold, rootMargin, initial]
41
- );
42
- useEffect(() => disconnect, [disconnect]);
43
- return { ref, inView };
9
+ const [node, setNode] = useState(null);
10
+ const [seen, setSeen] = useState(null);
11
+ useEffect(() => {
12
+ if (!node || typeof IntersectionObserver === "undefined") return void 0;
13
+ const observer = new IntersectionObserver(
14
+ (entries) => {
15
+ const entry = entries[entries.length - 1];
16
+ if (!entry) return;
17
+ const ofElement = entry.intersectionRatio >= threshold;
18
+ const viewportHeight = entry.rootBounds?.height ?? 0;
19
+ const ofViewport = viewportHeight > 0 && (entry.intersectionRect?.height ?? 0) >= viewportHeight * threshold;
20
+ setSeen({ node, inView: entry.isIntersecting && (ofElement || ofViewport) });
21
+ },
22
+ { threshold: STEPS, rootMargin }
23
+ );
24
+ observer.observe(node);
25
+ return () => observer.disconnect();
26
+ }, [node, threshold, rootMargin]);
27
+ const inView = !node ? false : seen?.node === node ? seen.inView : initial;
28
+ return { ref: setNode, inView };
44
29
  }
45
30
  export {
46
31
  useInView
@@ -3,6 +3,12 @@ export interface AgentIdentityIcon {
3
3
  name?: string | null;
4
4
  url?: string | null;
5
5
  props?: Record<string, unknown> | null;
6
+ /**
7
+ * The identity's accent, travelling with its icon: a hex colour (`#5efaf0`),
8
+ * as the server stores it. What is drawn in the agent's colour (its tab, the
9
+ * step it is on) reads it through `useAgentAccents`; unset, that is the platform's accent.
10
+ */
11
+ accent?: string | null;
6
12
  }
7
13
  /** Each agent's identity icon, keyed by the agent's slug. */
8
14
  export type AgentIdentityIcons = Readonly<Record<string, AgentIdentityIcon | null | undefined>>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-agent-identities.d.ts","sourceRoot":"","sources":["../../src/hooks/use-agent-identities.ts"],"names":[],"mappings":"AAKA,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxC;AAED,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;AAEhG,gJAAgJ;AAChJ,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAW1D;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,GAAE,MAAkC,EAC5C,OAAO,GAAE,OAAc,GACtB,kBAAkB,GAAG,SAAS,CAUhC"}
1
+ {"version":3,"file":"use-agent-identities.d.ts","sourceRoot":"","sources":["../../src/hooks/use-agent-identities.ts"],"names":[],"mappings":"AAKA,yGAAyG;AACzG,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;AAEhG,gJAAgJ;AAChJ,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAW1D;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,GAAE,MAAkC,EAC5C,OAAO,GAAE,OAAc,GACtB,kBAAkB,GAAG,SAAS,CAUhC"}
@@ -1,3 +1,4 @@
1
+ import { type AutoplayHoldProps } from './ui/use-autoplay';
1
2
  export interface UseScenarioPlayerOptions {
2
3
  /** How many scenarios (tabs) the stage cycles through. */
3
4
  scenarioCount: number;
@@ -19,15 +20,30 @@ export interface UseScenarioPlayerOptions {
19
20
  * never gets to play (it is never scrolled into view) still reads complete.
20
21
  */
21
22
  startAtEnd?: boolean;
23
+ /**
24
+ * Whether step 0 of every scenario is an EMPTY stage, to be left at once
25
+ * (default true: a stage that sits empty for a whole step after a tap reads
26
+ * as not responding). False when step 0 already shows something to read:
27
+ * every step then lasts a whole `stepMs`, however the scenario was started
28
+ * (a page load, the rotation and a chosen tab all pace it the same).
29
+ */
30
+ emptyFirstStep?: boolean;
22
31
  }
23
32
  export interface UseScenarioPlayerResult {
24
33
  /** Index of the scenario being shown. */
25
34
  scenario: number;
26
35
  /** Current step, 0..lastStep. */
27
36
  step: number;
28
- /** The visitor stopped it with the pause control. */
29
- paused: boolean;
30
- setPaused: (paused: boolean) => void;
37
+ /**
38
+ * False until it has been playable once (it has not been on screen yet).
39
+ * A progress line reads 0 until then, so it starts from empty when the
40
+ * visitor first reaches it, never part-way through a step nobody saw begin.
41
+ */
42
+ started: boolean;
43
+ /** The visitor is holding it still (pressing on it, or the keyboard is inside it). */
44
+ held: boolean;
45
+ /** Spread on the stage's outer element: how a visitor stops it (`useAutoplay`). */
46
+ holdProps: AutoplayHoldProps;
31
47
  /** Jump to a step in the current scenario (a visitor's tap, a stepper button). */
32
48
  setStep: (step: number) => void;
33
49
  /** Switch scenario and restart it from step 0. */
@@ -45,14 +61,15 @@ export interface UseScenarioPlayerResult {
45
61
  * line and the stage itself agree by construction.
46
62
  *
47
63
  * WHEN IT MOVES is `useAutoplay`'s rule: on screen (`enabled`), tab visible,
48
- * not paused, motion allowed. Under reduced motion it parks on the last step
64
+ * not held by the visitor, motion allowed. Under reduced motion it parks on the last step
49
65
  * of the current scenario, and every scenario can still be read by choosing it.
50
66
  *
51
- * The moment it becomes playable its first step follows within `START_MS`,
52
- * not a whole step later; from there every step takes `stepMs`.
67
+ * The moment it becomes playable, and at the top of every scenario (the
68
+ * rotation moved on, or a tab was chosen), its first step follows within
69
+ * `START_MS`, not a whole step later; from there every step takes `stepMs`.
53
70
  *
54
- * A visitor's own choice (`go`, `setStep`) moves the clock there and un-pauses
55
- * it; the rotation carries on from that point.
71
+ * A visitor's own choice (`go`, `setStep`) moves the clock there and lets go of
72
+ * any hold; the rotation carries on from that point.
56
73
  */
57
- export declare function useScenarioPlayer({ scenarioCount, lastStep: lastStepOption, stepMs, holdMs, enabled, initialScenario, startAtEnd, }: UseScenarioPlayerOptions): UseScenarioPlayerResult;
74
+ export declare function useScenarioPlayer({ scenarioCount, lastStep: lastStepOption, stepMs, holdMs, enabled, initialScenario, startAtEnd, emptyFirstStep, }: UseScenarioPlayerOptions): UseScenarioPlayerResult;
58
75
  //# sourceMappingURL=use-scenario-player.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-scenario-player.d.ts","sourceRoot":"","sources":["../../src/hooks/use-scenario-player.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAClD,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,kFAAkF;IAClF,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kDAAkD;IAClD,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,QAAQ,EAAE,cAAc,EACxB,MAAM,EACN,MAAM,EACN,OAAc,EACd,eAAmB,EACnB,UAAkB,GACnB,EAAE,wBAAwB,GAAG,uBAAuB,CAyDpD"}
1
+ {"version":3,"file":"use-scenario-player.d.ts","sourceRoot":"","sources":["../../src/hooks/use-scenario-player.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,mBAAmB,CAAC;AAUxE,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAClD,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,sFAAsF;IACtF,IAAI,EAAE,OAAO,CAAC;IACd,mFAAmF;IACnF,SAAS,EAAE,iBAAiB,CAAC;IAC7B,kFAAkF;IAClF,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kDAAkD;IAClD,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,QAAQ,EAAE,cAAc,EACxB,MAAM,EACN,MAAM,EACN,OAAc,EACd,eAAmB,EACnB,UAAkB,EAClB,cAAqB,GACtB,EAAE,wBAAwB,GAAG,uBAAuB,CAgEpD"}
@@ -9,15 +9,18 @@ function useScenarioPlayer({
9
9
  holdMs,
10
10
  enabled = true,
11
11
  initialScenario = 0,
12
- startAtEnd = false
12
+ startAtEnd = false,
13
+ emptyFirstStep = true
13
14
  }) {
14
15
  const auto = useAutoplay(enabled);
15
- const { reducedMotion, paused, setPaused } = auto;
16
+ const { reducedMotion, held, holdProps, release } = auto;
16
17
  const [scenario, setScenario] = useState(initialScenario);
17
18
  const [rawStep, setRawStep] = useState(startAtEnd ? Number.MAX_SAFE_INTEGER : 0);
18
19
  const lastStep = typeof lastStepOption === "function" ? lastStepOption(scenario) : lastStepOption;
19
20
  const step = reducedMotion ? lastStep : Math.min(rawStep, lastStep);
20
21
  const playing = auto.playing && scenarioCount > 0;
22
+ const [started, setStarted] = useState(false);
23
+ if (playing && !started) setStarted(true);
21
24
  const starting = useRef(false);
22
25
  const wasPlaying = useRef(false);
23
26
  useEffect(() => {
@@ -25,7 +28,7 @@ function useScenarioPlayer({
25
28
  wasPlaying.current = playing;
26
29
  if (!playing) return void 0;
27
30
  const atEnd = rawStep >= lastStep;
28
- const quickStart = starting.current && !atEnd;
31
+ const quickStart = emptyFirstStep && (starting.current || rawStep === 0) && !atEnd;
29
32
  starting.current = false;
30
33
  const timer = setTimeout(
31
34
  () => {
@@ -39,23 +42,23 @@ function useScenarioPlayer({
39
42
  atEnd ? holdMs : quickStart ? Math.min(START_MS, stepMs) : stepMs
40
43
  );
41
44
  return () => clearTimeout(timer);
42
- }, [playing, rawStep, lastStep, stepMs, holdMs, scenario, scenarioCount]);
45
+ }, [playing, rawStep, lastStep, stepMs, holdMs, scenario, scenarioCount, emptyFirstStep]);
43
46
  const setStep = useCallback(
44
47
  (next) => {
45
48
  setRawStep(Math.max(0, Math.min(lastStep, next)));
46
- setPaused(false);
49
+ release();
47
50
  },
48
- [lastStep, setPaused]
51
+ [lastStep, release]
49
52
  );
50
53
  const go = useCallback(
51
54
  (next) => {
52
55
  setScenario(next);
53
56
  setRawStep(0);
54
- setPaused(false);
57
+ release();
55
58
  },
56
- [setPaused]
59
+ [release]
57
60
  );
58
- return { scenario, step, paused, setPaused, setStep, go, reducedMotion };
61
+ return { scenario, step, started: started || reducedMotion, held, holdProps, setStep, go, reducedMotion };
59
62
  }
60
63
  export {
61
64
  useScenarioPlayer