@userflow-tech/react-native 0.1.0

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 (783) hide show
  1. package/LICENSE +76 -0
  2. package/README.md +337 -0
  3. package/docs/anchoring.md +264 -0
  4. package/docs/deep-linking.md +271 -0
  5. package/docs/identity-verification.md +95 -0
  6. package/docs/theme-mapping.md +101 -0
  7. package/docs/troubleshooting.md +107 -0
  8. package/lib/commonjs/anchors/AnchorRegistry.js +72 -0
  9. package/lib/commonjs/anchors/AnchorRegistry.js.map +1 -0
  10. package/lib/commonjs/anchors/AutoAnchorRegistry.js +315 -0
  11. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -0
  12. package/lib/commonjs/anchors/ScrollContainerRegistry.js +93 -0
  13. package/lib/commonjs/anchors/ScrollContainerRegistry.js.map +1 -0
  14. package/lib/commonjs/anchors/anchorChangeTicker.js +83 -0
  15. package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -0
  16. package/lib/commonjs/anchors/animationFrame.js +90 -0
  17. package/lib/commonjs/anchors/animationFrame.js.map +1 -0
  18. package/lib/commonjs/anchors/autoAnchor.js +253 -0
  19. package/lib/commonjs/anchors/autoAnchor.js.map +1 -0
  20. package/lib/commonjs/anchors/elementConditionEvaluator.js +82 -0
  21. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -0
  22. package/lib/commonjs/anchors/fiber/FiberScanRoot.js +90 -0
  23. package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -0
  24. package/lib/commonjs/anchors/fiber/fiberInternals.js +180 -0
  25. package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -0
  26. package/lib/commonjs/anchors/fiber/findAnchorFiber.js +214 -0
  27. package/lib/commonjs/anchors/fiber/findAnchorFiber.js.map +1 -0
  28. package/lib/commonjs/anchors/fiber/findScrollAncestors.js +176 -0
  29. package/lib/commonjs/anchors/fiber/findScrollAncestors.js.map +1 -0
  30. package/lib/commonjs/anchors/fiber/measureHostFiber.js +75 -0
  31. package/lib/commonjs/anchors/fiber/measureHostFiber.js.map +1 -0
  32. package/lib/commonjs/anchors/fiber/visibleScreens.js +165 -0
  33. package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -0
  34. package/lib/commonjs/anchors/hintsCodec.js +120 -0
  35. package/lib/commonjs/anchors/hintsCodec.js.map +1 -0
  36. package/lib/commonjs/anchors/resolveAnchorHost.js +112 -0
  37. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -0
  38. package/lib/commonjs/anchors/resolveManualAnchorId.js +17 -0
  39. package/lib/commonjs/anchors/resolveManualAnchorId.js.map +1 -0
  40. package/lib/commonjs/anchors/scrollAnchorIntoView.js +227 -0
  41. package/lib/commonjs/anchors/scrollAnchorIntoView.js.map +1 -0
  42. package/lib/commonjs/anchors/scrollConfig.js +48 -0
  43. package/lib/commonjs/anchors/scrollConfig.js.map +1 -0
  44. package/lib/commonjs/anchors/targetPressMonitor.js +113 -0
  45. package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -0
  46. package/lib/commonjs/anchors/useUserflowAnchor.js +91 -0
  47. package/lib/commonjs/anchors/useUserflowAnchor.js.map +1 -0
  48. package/lib/commonjs/anchors/useUserflowScrollContainer.js +76 -0
  49. package/lib/commonjs/anchors/useUserflowScrollContainer.js.map +1 -0
  50. package/lib/commonjs/anonymousId.js +42 -0
  51. package/lib/commonjs/anonymousId.js.map +1 -0
  52. package/lib/commonjs/content/RichContentRenderer.js +675 -0
  53. package/lib/commonjs/content/RichContentRenderer.js.map +1 -0
  54. package/lib/commonjs/content/StepButton.js +57 -0
  55. package/lib/commonjs/content/StepButton.js.map +1 -0
  56. package/lib/commonjs/content/buttonAppearance.js +18 -0
  57. package/lib/commonjs/content/buttonAppearance.js.map +1 -0
  58. package/lib/commonjs/content/deserialize.js +129 -0
  59. package/lib/commonjs/content/deserialize.js.map +1 -0
  60. package/lib/commonjs/content/imageLayout.js +24 -0
  61. package/lib/commonjs/content/imageLayout.js.map +1 -0
  62. package/lib/commonjs/content/migrateFlowBlocks.js +39 -0
  63. package/lib/commonjs/content/migrateFlowBlocks.js.map +1 -0
  64. package/lib/commonjs/content/openSafeUrl.js +37 -0
  65. package/lib/commonjs/content/openSafeUrl.js.map +1 -0
  66. package/lib/commonjs/content/resolveStepButtonChrome.js +95 -0
  67. package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -0
  68. package/lib/commonjs/content/themeColor.js +106 -0
  69. package/lib/commonjs/content/themeColor.js.map +1 -0
  70. package/lib/commonjs/content/types.js +2 -0
  71. package/lib/commonjs/content/types.js.map +1 -0
  72. package/lib/commonjs/deepLinking.js +162 -0
  73. package/lib/commonjs/deepLinking.js.map +1 -0
  74. package/lib/commonjs/expo-router/UserflowExpoRouterScreenTracker.js +13 -0
  75. package/lib/commonjs/expo-router/UserflowExpoRouterScreenTracker.js.map +1 -0
  76. package/lib/commonjs/expo-router/getExpoRouterScreenTracker.js +44 -0
  77. package/lib/commonjs/expo-router/getExpoRouterScreenTracker.js.map +1 -0
  78. package/lib/commonjs/expo-router/index.js +20 -0
  79. package/lib/commonjs/expo-router/index.js.map +1 -0
  80. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +45 -0
  81. package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -0
  82. package/lib/commonjs/index.js +356 -0
  83. package/lib/commonjs/index.js.map +1 -0
  84. package/lib/commonjs/lifecycle.js +200 -0
  85. package/lib/commonjs/lifecycle.js.map +1 -0
  86. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +69 -0
  87. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -0
  88. package/lib/commonjs/navigation/chainCallbacks.js +16 -0
  89. package/lib/commonjs/navigation/chainCallbacks.js.map +1 -0
  90. package/lib/commonjs/navigation/getActiveRouteName.js +18 -0
  91. package/lib/commonjs/navigation/getActiveRouteName.js.map +1 -0
  92. package/lib/commonjs/navigation/index.js +50 -0
  93. package/lib/commonjs/navigation/index.js.map +1 -0
  94. package/lib/commonjs/navigation/openFlowNavigateUrl.js +110 -0
  95. package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -0
  96. package/lib/commonjs/network.js +90 -0
  97. package/lib/commonjs/network.js.map +1 -0
  98. package/lib/commonjs/pairing/PairingController.js +290 -0
  99. package/lib/commonjs/pairing/PairingController.js.map +1 -0
  100. package/lib/commonjs/pairing/PreviewModeBanner.js +118 -0
  101. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -0
  102. package/lib/commonjs/pairing/deepLink.js +141 -0
  103. package/lib/commonjs/pairing/deepLink.js.map +1 -0
  104. package/lib/commonjs/pairing/diagnostics.js +115 -0
  105. package/lib/commonjs/pairing/diagnostics.js.map +1 -0
  106. package/lib/commonjs/pairing/index.js +58 -0
  107. package/lib/commonjs/pairing/index.js.map +1 -0
  108. package/lib/commonjs/pairing/pairingRuntime.js +85 -0
  109. package/lib/commonjs/pairing/pairingRuntime.js.map +1 -0
  110. package/lib/commonjs/pairing/tokenStorage.js +70 -0
  111. package/lib/commonjs/pairing/tokenStorage.js.map +1 -0
  112. package/lib/commonjs/pairing/usePairingState.js +40 -0
  113. package/lib/commonjs/pairing/usePairingState.js.map +1 -0
  114. package/lib/commonjs/runtime/FlowRenderer.js +57 -0
  115. package/lib/commonjs/runtime/FlowRenderer.js.map +1 -0
  116. package/lib/commonjs/runtime/FlowSurfaceFade.js +53 -0
  117. package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -0
  118. package/lib/commonjs/runtime/TargetPressBridge.js +96 -0
  119. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -0
  120. package/lib/commonjs/runtime/UserflowProvider.js +91 -0
  121. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -0
  122. package/lib/commonjs/runtime/clientConditions.js +50 -0
  123. package/lib/commonjs/runtime/clientConditions.js.map +1 -0
  124. package/lib/commonjs/runtime/flowEngine.js +63 -0
  125. package/lib/commonjs/runtime/flowEngine.js.map +1 -0
  126. package/lib/commonjs/runtime/flowSessionViewState.js +48 -0
  127. package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -0
  128. package/lib/commonjs/runtime/useFlowSessionState.js +25 -0
  129. package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -0
  130. package/lib/commonjs/runtime/userflowCore.js +13 -0
  131. package/lib/commonjs/runtime/userflowCore.js.map +1 -0
  132. package/lib/commonjs/screenTracker.js +87 -0
  133. package/lib/commonjs/screenTracker.js.map +1 -0
  134. package/lib/commonjs/surfaces/CloseButton.js +52 -0
  135. package/lib/commonjs/surfaces/CloseButton.js.map +1 -0
  136. package/lib/commonjs/surfaces/MadeWithUserflow.js +90 -0
  137. package/lib/commonjs/surfaces/MadeWithUserflow.js.map +1 -0
  138. package/lib/commonjs/surfaces/ModalSurface.js +170 -0
  139. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -0
  140. package/lib/commonjs/surfaces/ProgressBar.js +116 -0
  141. package/lib/commonjs/surfaces/ProgressBar.js.map +1 -0
  142. package/lib/commonjs/surfaces/TooltipSurface.js +638 -0
  143. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -0
  144. package/lib/commonjs/surfaces/absoluteFill.js +29 -0
  145. package/lib/commonjs/surfaces/absoluteFill.js.map +1 -0
  146. package/lib/commonjs/surfaces/assets/png.d.js +2 -0
  147. package/lib/commonjs/surfaces/assets/png.d.js.map +1 -0
  148. package/lib/commonjs/surfaces/assets/userflow-logomark.png +0 -0
  149. package/lib/commonjs/surfaces/parseBackdropOpacity.js +20 -0
  150. package/lib/commonjs/surfaces/parseBackdropOpacity.js.map +1 -0
  151. package/lib/commonjs/surfaces/progress.js +35 -0
  152. package/lib/commonjs/surfaces/progress.js.map +1 -0
  153. package/lib/commonjs/surfaces/resolveCloseButtonColor.js +24 -0
  154. package/lib/commonjs/surfaces/resolveCloseButtonColor.js.map +1 -0
  155. package/lib/commonjs/surfaces/resolveModalLayout.js +67 -0
  156. package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -0
  157. package/lib/commonjs/surfaces/resolveTooltipLayout.js +64 -0
  158. package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -0
  159. package/lib/commonjs/surfaces/safeArea.js +46 -0
  160. package/lib/commonjs/surfaces/safeArea.js.map +1 -0
  161. package/lib/commonjs/surfaces/themeChrome.js +90 -0
  162. package/lib/commonjs/surfaces/themeChrome.js.map +1 -0
  163. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +108 -0
  164. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -0
  165. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +103 -0
  166. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -0
  167. package/lib/commonjs/surfaces/tooltip/TooltipNotch.js +64 -0
  168. package/lib/commonjs/surfaces/tooltip/TooltipNotch.js.map +1 -0
  169. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +102 -0
  170. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -0
  171. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +100 -0
  172. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -0
  173. package/lib/commonjs/surfaces/tooltip/parseBackdropPadding.js +15 -0
  174. package/lib/commonjs/surfaces/tooltip/parseBackdropPadding.js.map +1 -0
  175. package/lib/commonjs/surfaces/tooltip/rect.js +51 -0
  176. package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -0
  177. package/lib/commonjs/useUserflowScreen.js +24 -0
  178. package/lib/commonjs/useUserflowScreen.js.map +1 -0
  179. package/lib/commonjs/version.js +9 -0
  180. package/lib/commonjs/version.js.map +1 -0
  181. package/lib/module/anchors/AnchorRegistry.js +67 -0
  182. package/lib/module/anchors/AnchorRegistry.js.map +1 -0
  183. package/lib/module/anchors/AutoAnchorRegistry.js +309 -0
  184. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -0
  185. package/lib/module/anchors/ScrollContainerRegistry.js +86 -0
  186. package/lib/module/anchors/ScrollContainerRegistry.js.map +1 -0
  187. package/lib/module/anchors/anchorChangeTicker.js +79 -0
  188. package/lib/module/anchors/anchorChangeTicker.js.map +1 -0
  189. package/lib/module/anchors/animationFrame.js +83 -0
  190. package/lib/module/anchors/animationFrame.js.map +1 -0
  191. package/lib/module/anchors/autoAnchor.js +248 -0
  192. package/lib/module/anchors/autoAnchor.js.map +1 -0
  193. package/lib/module/anchors/elementConditionEvaluator.js +79 -0
  194. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -0
  195. package/lib/module/anchors/fiber/FiberScanRoot.js +84 -0
  196. package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -0
  197. package/lib/module/anchors/fiber/fiberInternals.js +164 -0
  198. package/lib/module/anchors/fiber/fiberInternals.js.map +1 -0
  199. package/lib/module/anchors/fiber/findAnchorFiber.js +210 -0
  200. package/lib/module/anchors/fiber/findAnchorFiber.js.map +1 -0
  201. package/lib/module/anchors/fiber/findScrollAncestors.js +172 -0
  202. package/lib/module/anchors/fiber/findScrollAncestors.js.map +1 -0
  203. package/lib/module/anchors/fiber/measureHostFiber.js +70 -0
  204. package/lib/module/anchors/fiber/measureHostFiber.js.map +1 -0
  205. package/lib/module/anchors/fiber/visibleScreens.js +159 -0
  206. package/lib/module/anchors/fiber/visibleScreens.js.map +1 -0
  207. package/lib/module/anchors/hintsCodec.js +111 -0
  208. package/lib/module/anchors/hintsCodec.js.map +1 -0
  209. package/lib/module/anchors/resolveAnchorHost.js +105 -0
  210. package/lib/module/anchors/resolveAnchorHost.js.map +1 -0
  211. package/lib/module/anchors/resolveManualAnchorId.js +13 -0
  212. package/lib/module/anchors/resolveManualAnchorId.js.map +1 -0
  213. package/lib/module/anchors/scrollAnchorIntoView.js +222 -0
  214. package/lib/module/anchors/scrollAnchorIntoView.js.map +1 -0
  215. package/lib/module/anchors/scrollConfig.js +40 -0
  216. package/lib/module/anchors/scrollConfig.js.map +1 -0
  217. package/lib/module/anchors/targetPressMonitor.js +105 -0
  218. package/lib/module/anchors/targetPressMonitor.js.map +1 -0
  219. package/lib/module/anchors/useUserflowAnchor.js +87 -0
  220. package/lib/module/anchors/useUserflowAnchor.js.map +1 -0
  221. package/lib/module/anchors/useUserflowScrollContainer.js +71 -0
  222. package/lib/module/anchors/useUserflowScrollContainer.js.map +1 -0
  223. package/lib/module/anonymousId.js +36 -0
  224. package/lib/module/anonymousId.js.map +1 -0
  225. package/lib/module/content/RichContentRenderer.js +670 -0
  226. package/lib/module/content/RichContentRenderer.js.map +1 -0
  227. package/lib/module/content/StepButton.js +52 -0
  228. package/lib/module/content/StepButton.js.map +1 -0
  229. package/lib/module/content/buttonAppearance.js +14 -0
  230. package/lib/module/content/buttonAppearance.js.map +1 -0
  231. package/lib/module/content/deserialize.js +116 -0
  232. package/lib/module/content/deserialize.js.map +1 -0
  233. package/lib/module/content/imageLayout.js +20 -0
  234. package/lib/module/content/imageLayout.js.map +1 -0
  235. package/lib/module/content/migrateFlowBlocks.js +35 -0
  236. package/lib/module/content/migrateFlowBlocks.js.map +1 -0
  237. package/lib/module/content/openSafeUrl.js +32 -0
  238. package/lib/module/content/openSafeUrl.js.map +1 -0
  239. package/lib/module/content/resolveStepButtonChrome.js +90 -0
  240. package/lib/module/content/resolveStepButtonChrome.js.map +1 -0
  241. package/lib/module/content/themeColor.js +99 -0
  242. package/lib/module/content/themeColor.js.map +1 -0
  243. package/lib/module/content/types.js +2 -0
  244. package/lib/module/content/types.js.map +1 -0
  245. package/lib/module/deepLinking.js +152 -0
  246. package/lib/module/deepLinking.js.map +1 -0
  247. package/lib/module/expo-router/UserflowExpoRouterScreenTracker.js +10 -0
  248. package/lib/module/expo-router/UserflowExpoRouterScreenTracker.js.map +1 -0
  249. package/lib/module/expo-router/getExpoRouterScreenTracker.js +39 -0
  250. package/lib/module/expo-router/getExpoRouterScreenTracker.js.map +1 -0
  251. package/lib/module/expo-router/index.js +5 -0
  252. package/lib/module/expo-router/index.js.map +1 -0
  253. package/lib/module/expo-router/useUserflowExpoRouter.js +42 -0
  254. package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -0
  255. package/lib/module/index.js +259 -0
  256. package/lib/module/index.js.map +1 -0
  257. package/lib/module/lifecycle.js +195 -0
  258. package/lib/module/lifecycle.js.map +1 -0
  259. package/lib/module/navigation/WithUserflowReactNavigation.js +65 -0
  260. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -0
  261. package/lib/module/navigation/chainCallbacks.js +12 -0
  262. package/lib/module/navigation/chainCallbacks.js.map +1 -0
  263. package/lib/module/navigation/getActiveRouteName.js +14 -0
  264. package/lib/module/navigation/getActiveRouteName.js.map +1 -0
  265. package/lib/module/navigation/index.js +5 -0
  266. package/lib/module/navigation/index.js.map +1 -0
  267. package/lib/module/navigation/openFlowNavigateUrl.js +100 -0
  268. package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -0
  269. package/lib/module/network.js +85 -0
  270. package/lib/module/network.js.map +1 -0
  271. package/lib/module/pairing/PairingController.js +286 -0
  272. package/lib/module/pairing/PairingController.js.map +1 -0
  273. package/lib/module/pairing/PreviewModeBanner.js +113 -0
  274. package/lib/module/pairing/PreviewModeBanner.js.map +1 -0
  275. package/lib/module/pairing/deepLink.js +134 -0
  276. package/lib/module/pairing/deepLink.js.map +1 -0
  277. package/lib/module/pairing/diagnostics.js +101 -0
  278. package/lib/module/pairing/diagnostics.js.map +1 -0
  279. package/lib/module/pairing/index.js +7 -0
  280. package/lib/module/pairing/index.js.map +1 -0
  281. package/lib/module/pairing/pairingRuntime.js +77 -0
  282. package/lib/module/pairing/pairingRuntime.js.map +1 -0
  283. package/lib/module/pairing/tokenStorage.js +65 -0
  284. package/lib/module/pairing/tokenStorage.js.map +1 -0
  285. package/lib/module/pairing/usePairingState.js +35 -0
  286. package/lib/module/pairing/usePairingState.js.map +1 -0
  287. package/lib/module/runtime/FlowRenderer.js +52 -0
  288. package/lib/module/runtime/FlowRenderer.js.map +1 -0
  289. package/lib/module/runtime/FlowSurfaceFade.js +48 -0
  290. package/lib/module/runtime/FlowSurfaceFade.js.map +1 -0
  291. package/lib/module/runtime/TargetPressBridge.js +91 -0
  292. package/lib/module/runtime/TargetPressBridge.js.map +1 -0
  293. package/lib/module/runtime/UserflowProvider.js +85 -0
  294. package/lib/module/runtime/UserflowProvider.js.map +1 -0
  295. package/lib/module/runtime/clientConditions.js +43 -0
  296. package/lib/module/runtime/clientConditions.js.map +1 -0
  297. package/lib/module/runtime/flowEngine.js +54 -0
  298. package/lib/module/runtime/flowEngine.js.map +1 -0
  299. package/lib/module/runtime/flowSessionViewState.js +42 -0
  300. package/lib/module/runtime/flowSessionViewState.js.map +1 -0
  301. package/lib/module/runtime/useFlowSessionState.js +21 -0
  302. package/lib/module/runtime/useFlowSessionState.js.map +1 -0
  303. package/lib/module/runtime/userflowCore.js +10 -0
  304. package/lib/module/runtime/userflowCore.js.map +1 -0
  305. package/lib/module/screenTracker.js +79 -0
  306. package/lib/module/screenTracker.js.map +1 -0
  307. package/lib/module/surfaces/CloseButton.js +47 -0
  308. package/lib/module/surfaces/CloseButton.js.map +1 -0
  309. package/lib/module/surfaces/MadeWithUserflow.js +83 -0
  310. package/lib/module/surfaces/MadeWithUserflow.js.map +1 -0
  311. package/lib/module/surfaces/ModalSurface.js +165 -0
  312. package/lib/module/surfaces/ModalSurface.js.map +1 -0
  313. package/lib/module/surfaces/ProgressBar.js +111 -0
  314. package/lib/module/surfaces/ProgressBar.js.map +1 -0
  315. package/lib/module/surfaces/TooltipSurface.js +633 -0
  316. package/lib/module/surfaces/TooltipSurface.js.map +1 -0
  317. package/lib/module/surfaces/absoluteFill.js +25 -0
  318. package/lib/module/surfaces/absoluteFill.js.map +1 -0
  319. package/lib/module/surfaces/assets/png.d.js +2 -0
  320. package/lib/module/surfaces/assets/png.d.js.map +1 -0
  321. package/lib/module/surfaces/assets/userflow-logomark.png +0 -0
  322. package/lib/module/surfaces/parseBackdropOpacity.js +16 -0
  323. package/lib/module/surfaces/parseBackdropOpacity.js.map +1 -0
  324. package/lib/module/surfaces/progress.js +31 -0
  325. package/lib/module/surfaces/progress.js.map +1 -0
  326. package/lib/module/surfaces/resolveCloseButtonColor.js +20 -0
  327. package/lib/module/surfaces/resolveCloseButtonColor.js.map +1 -0
  328. package/lib/module/surfaces/resolveModalLayout.js +59 -0
  329. package/lib/module/surfaces/resolveModalLayout.js.map +1 -0
  330. package/lib/module/surfaces/resolveTooltipLayout.js +57 -0
  331. package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -0
  332. package/lib/module/surfaces/safeArea.js +41 -0
  333. package/lib/module/surfaces/safeArea.js.map +1 -0
  334. package/lib/module/surfaces/themeChrome.js +86 -0
  335. package/lib/module/surfaces/themeChrome.js.map +1 -0
  336. package/lib/module/surfaces/tooltip/TooltipBubble.js +103 -0
  337. package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -0
  338. package/lib/module/surfaces/tooltip/TooltipCutout.js +98 -0
  339. package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -0
  340. package/lib/module/surfaces/tooltip/TooltipNotch.js +55 -0
  341. package/lib/module/surfaces/tooltip/TooltipNotch.js.map +1 -0
  342. package/lib/module/surfaces/tooltip/computeTooltipPosition.js +97 -0
  343. package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -0
  344. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +95 -0
  345. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -0
  346. package/lib/module/surfaces/tooltip/parseBackdropPadding.js +11 -0
  347. package/lib/module/surfaces/tooltip/parseBackdropPadding.js.map +1 -0
  348. package/lib/module/surfaces/tooltip/rect.js +44 -0
  349. package/lib/module/surfaces/tooltip/rect.js.map +1 -0
  350. package/lib/module/useUserflowScreen.js +21 -0
  351. package/lib/module/useUserflowScreen.js.map +1 -0
  352. package/lib/module/version.js +5 -0
  353. package/lib/module/version.js.map +1 -0
  354. package/lib/typescript/commonjs/package.json +1 -0
  355. package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts +32 -0
  356. package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +113 -0
  358. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/anchors/ScrollContainerRegistry.d.ts +46 -0
  360. package/lib/typescript/commonjs/src/anchors/ScrollContainerRegistry.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +30 -0
  362. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts +21 -0
  364. package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts +31 -0
  366. package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +21 -0
  368. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +41 -0
  370. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -0
  371. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +48 -0
  372. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts +33 -0
  374. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -0
  375. package/lib/typescript/commonjs/src/anchors/fiber/findScrollAncestors.d.ts +47 -0
  376. package/lib/typescript/commonjs/src/anchors/fiber/findScrollAncestors.d.ts.map +1 -0
  377. package/lib/typescript/commonjs/src/anchors/fiber/measureHostFiber.d.ts +20 -0
  378. package/lib/typescript/commonjs/src/anchors/fiber/measureHostFiber.d.ts.map +1 -0
  379. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +42 -0
  380. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts +40 -0
  382. package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +32 -0
  384. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -0
  385. package/lib/typescript/commonjs/src/anchors/resolveManualAnchorId.d.ts +6 -0
  386. package/lib/typescript/commonjs/src/anchors/resolveManualAnchorId.d.ts.map +1 -0
  387. package/lib/typescript/commonjs/src/anchors/scrollAnchorIntoView.d.ts +59 -0
  388. package/lib/typescript/commonjs/src/anchors/scrollAnchorIntoView.d.ts.map +1 -0
  389. package/lib/typescript/commonjs/src/anchors/scrollConfig.d.ts +30 -0
  390. package/lib/typescript/commonjs/src/anchors/scrollConfig.d.ts.map +1 -0
  391. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +64 -0
  392. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -0
  393. package/lib/typescript/commonjs/src/anchors/useUserflowAnchor.d.ts +30 -0
  394. package/lib/typescript/commonjs/src/anchors/useUserflowAnchor.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/src/anchors/useUserflowScrollContainer.d.ts +34 -0
  396. package/lib/typescript/commonjs/src/anchors/useUserflowScrollContainer.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/src/anonymousId.d.ts +5 -0
  398. package/lib/typescript/commonjs/src/anonymousId.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +21 -0
  400. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/content/StepButton.d.ts +13 -0
  402. package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts +8 -0
  404. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts.map +1 -0
  405. package/lib/typescript/commonjs/src/content/deserialize.d.ts +27 -0
  406. package/lib/typescript/commonjs/src/content/deserialize.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/content/imageLayout.d.ts +13 -0
  408. package/lib/typescript/commonjs/src/content/imageLayout.d.ts.map +1 -0
  409. package/lib/typescript/commonjs/src/content/migrateFlowBlocks.d.ts +12 -0
  410. package/lib/typescript/commonjs/src/content/migrateFlowBlocks.d.ts.map +1 -0
  411. package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts +12 -0
  412. package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts.map +1 -0
  413. package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts +24 -0
  414. package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -0
  415. package/lib/typescript/commonjs/src/content/themeColor.d.ts +43 -0
  416. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -0
  417. package/lib/typescript/commonjs/src/content/types.d.ts +144 -0
  418. package/lib/typescript/commonjs/src/content/types.d.ts.map +1 -0
  419. package/lib/typescript/commonjs/src/deepLinking.d.ts +54 -0
  420. package/lib/typescript/commonjs/src/deepLinking.d.ts.map +1 -0
  421. package/lib/typescript/commonjs/src/expo-router/UserflowExpoRouterScreenTracker.d.ts +3 -0
  422. package/lib/typescript/commonjs/src/expo-router/UserflowExpoRouterScreenTracker.d.ts.map +1 -0
  423. package/lib/typescript/commonjs/src/expo-router/getExpoRouterScreenTracker.d.ts +13 -0
  424. package/lib/typescript/commonjs/src/expo-router/getExpoRouterScreenTracker.d.ts.map +1 -0
  425. package/lib/typescript/commonjs/src/expo-router/index.d.ts +3 -0
  426. package/lib/typescript/commonjs/src/expo-router/index.d.ts.map +1 -0
  427. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts +17 -0
  428. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -0
  429. package/lib/typescript/commonjs/src/index.d.ts +112 -0
  430. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  431. package/lib/typescript/commonjs/src/lifecycle.d.ts +96 -0
  432. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -0
  433. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts +21 -0
  434. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -0
  435. package/lib/typescript/commonjs/src/navigation/chainCallbacks.d.ts +3 -0
  436. package/lib/typescript/commonjs/src/navigation/chainCallbacks.d.ts.map +1 -0
  437. package/lib/typescript/commonjs/src/navigation/getActiveRouteName.d.ts +6 -0
  438. package/lib/typescript/commonjs/src/navigation/getActiveRouteName.d.ts.map +1 -0
  439. package/lib/typescript/commonjs/src/navigation/index.d.ts +5 -0
  440. package/lib/typescript/commonjs/src/navigation/index.d.ts.map +1 -0
  441. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts +33 -0
  442. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -0
  443. package/lib/typescript/commonjs/src/network.d.ts +42 -0
  444. package/lib/typescript/commonjs/src/network.d.ts.map +1 -0
  445. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +104 -0
  446. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -0
  447. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +11 -0
  448. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -0
  449. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts +53 -0
  450. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +52 -0
  452. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -0
  453. package/lib/typescript/commonjs/src/pairing/index.d.ts +10 -0
  454. package/lib/typescript/commonjs/src/pairing/index.d.ts.map +1 -0
  455. package/lib/typescript/commonjs/src/pairing/pairingRuntime.d.ts +24 -0
  456. package/lib/typescript/commonjs/src/pairing/pairingRuntime.d.ts.map +1 -0
  457. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +16 -0
  458. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -0
  459. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts +4 -0
  460. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -0
  461. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +13 -0
  462. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -0
  463. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +13 -0
  464. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -0
  465. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +16 -0
  466. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -0
  467. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +32 -0
  468. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/runtime/clientConditions.d.ts +10 -0
  470. package/lib/typescript/commonjs/src/runtime/clientConditions.d.ts.map +1 -0
  471. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts +17 -0
  472. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -0
  473. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +18 -0
  474. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +10 -0
  476. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -0
  477. package/lib/typescript/commonjs/src/runtime/userflowCore.d.ts +3 -0
  478. package/lib/typescript/commonjs/src/runtime/userflowCore.d.ts.map +1 -0
  479. package/lib/typescript/commonjs/src/screenTracker.d.ts +28 -0
  480. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -0
  481. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -0
  482. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -0
  483. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +28 -0
  484. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts.map +1 -0
  485. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +23 -0
  486. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -0
  487. package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts +19 -0
  488. package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts.map +1 -0
  489. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +17 -0
  490. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -0
  491. package/lib/typescript/commonjs/src/surfaces/absoluteFill.d.ts +18 -0
  492. package/lib/typescript/commonjs/src/surfaces/absoluteFill.d.ts.map +1 -0
  493. package/lib/typescript/commonjs/src/surfaces/parseBackdropOpacity.d.ts +5 -0
  494. package/lib/typescript/commonjs/src/surfaces/parseBackdropOpacity.d.ts.map +1 -0
  495. package/lib/typescript/commonjs/src/surfaces/progress.d.ts +14 -0
  496. package/lib/typescript/commonjs/src/surfaces/progress.d.ts.map +1 -0
  497. package/lib/typescript/commonjs/src/surfaces/resolveCloseButtonColor.d.ts +9 -0
  498. package/lib/typescript/commonjs/src/surfaces/resolveCloseButtonColor.d.ts.map +1 -0
  499. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +36 -0
  500. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -0
  501. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +24 -0
  502. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -0
  503. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts +11 -0
  504. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts.map +1 -0
  505. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +36 -0
  506. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -0
  507. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +23 -0
  508. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -0
  509. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +31 -0
  510. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -0
  511. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipNotch.d.ts +29 -0
  512. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipNotch.d.ts.map +1 -0
  513. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +43 -0
  514. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -0
  515. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +34 -0
  516. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -0
  517. package/lib/typescript/commonjs/src/surfaces/tooltip/parseBackdropPadding.d.ts +3 -0
  518. package/lib/typescript/commonjs/src/surfaces/tooltip/parseBackdropPadding.d.ts.map +1 -0
  519. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +29 -0
  520. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -0
  521. package/lib/typescript/commonjs/src/useUserflowScreen.d.ts +10 -0
  522. package/lib/typescript/commonjs/src/useUserflowScreen.d.ts.map +1 -0
  523. package/lib/typescript/commonjs/src/version.d.ts +3 -0
  524. package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
  525. package/lib/typescript/module/package.json +1 -0
  526. package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts +32 -0
  527. package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts.map +1 -0
  528. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +113 -0
  529. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -0
  530. package/lib/typescript/module/src/anchors/ScrollContainerRegistry.d.ts +46 -0
  531. package/lib/typescript/module/src/anchors/ScrollContainerRegistry.d.ts.map +1 -0
  532. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +30 -0
  533. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -0
  534. package/lib/typescript/module/src/anchors/animationFrame.d.ts +21 -0
  535. package/lib/typescript/module/src/anchors/animationFrame.d.ts.map +1 -0
  536. package/lib/typescript/module/src/anchors/autoAnchor.d.ts +31 -0
  537. package/lib/typescript/module/src/anchors/autoAnchor.d.ts.map +1 -0
  538. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +21 -0
  539. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -0
  540. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +41 -0
  541. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -0
  542. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +48 -0
  543. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -0
  544. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts +33 -0
  545. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -0
  546. package/lib/typescript/module/src/anchors/fiber/findScrollAncestors.d.ts +47 -0
  547. package/lib/typescript/module/src/anchors/fiber/findScrollAncestors.d.ts.map +1 -0
  548. package/lib/typescript/module/src/anchors/fiber/measureHostFiber.d.ts +20 -0
  549. package/lib/typescript/module/src/anchors/fiber/measureHostFiber.d.ts.map +1 -0
  550. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +42 -0
  551. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -0
  552. package/lib/typescript/module/src/anchors/hintsCodec.d.ts +40 -0
  553. package/lib/typescript/module/src/anchors/hintsCodec.d.ts.map +1 -0
  554. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +32 -0
  555. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -0
  556. package/lib/typescript/module/src/anchors/resolveManualAnchorId.d.ts +6 -0
  557. package/lib/typescript/module/src/anchors/resolveManualAnchorId.d.ts.map +1 -0
  558. package/lib/typescript/module/src/anchors/scrollAnchorIntoView.d.ts +59 -0
  559. package/lib/typescript/module/src/anchors/scrollAnchorIntoView.d.ts.map +1 -0
  560. package/lib/typescript/module/src/anchors/scrollConfig.d.ts +30 -0
  561. package/lib/typescript/module/src/anchors/scrollConfig.d.ts.map +1 -0
  562. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +64 -0
  563. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -0
  564. package/lib/typescript/module/src/anchors/useUserflowAnchor.d.ts +30 -0
  565. package/lib/typescript/module/src/anchors/useUserflowAnchor.d.ts.map +1 -0
  566. package/lib/typescript/module/src/anchors/useUserflowScrollContainer.d.ts +34 -0
  567. package/lib/typescript/module/src/anchors/useUserflowScrollContainer.d.ts.map +1 -0
  568. package/lib/typescript/module/src/anonymousId.d.ts +5 -0
  569. package/lib/typescript/module/src/anonymousId.d.ts.map +1 -0
  570. package/lib/typescript/module/src/content/RichContentRenderer.d.ts +21 -0
  571. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -0
  572. package/lib/typescript/module/src/content/StepButton.d.ts +13 -0
  573. package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -0
  574. package/lib/typescript/module/src/content/buttonAppearance.d.ts +8 -0
  575. package/lib/typescript/module/src/content/buttonAppearance.d.ts.map +1 -0
  576. package/lib/typescript/module/src/content/deserialize.d.ts +27 -0
  577. package/lib/typescript/module/src/content/deserialize.d.ts.map +1 -0
  578. package/lib/typescript/module/src/content/imageLayout.d.ts +13 -0
  579. package/lib/typescript/module/src/content/imageLayout.d.ts.map +1 -0
  580. package/lib/typescript/module/src/content/migrateFlowBlocks.d.ts +12 -0
  581. package/lib/typescript/module/src/content/migrateFlowBlocks.d.ts.map +1 -0
  582. package/lib/typescript/module/src/content/openSafeUrl.d.ts +12 -0
  583. package/lib/typescript/module/src/content/openSafeUrl.d.ts.map +1 -0
  584. package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts +24 -0
  585. package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -0
  586. package/lib/typescript/module/src/content/themeColor.d.ts +43 -0
  587. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -0
  588. package/lib/typescript/module/src/content/types.d.ts +144 -0
  589. package/lib/typescript/module/src/content/types.d.ts.map +1 -0
  590. package/lib/typescript/module/src/deepLinking.d.ts +54 -0
  591. package/lib/typescript/module/src/deepLinking.d.ts.map +1 -0
  592. package/lib/typescript/module/src/expo-router/UserflowExpoRouterScreenTracker.d.ts +3 -0
  593. package/lib/typescript/module/src/expo-router/UserflowExpoRouterScreenTracker.d.ts.map +1 -0
  594. package/lib/typescript/module/src/expo-router/getExpoRouterScreenTracker.d.ts +13 -0
  595. package/lib/typescript/module/src/expo-router/getExpoRouterScreenTracker.d.ts.map +1 -0
  596. package/lib/typescript/module/src/expo-router/index.d.ts +3 -0
  597. package/lib/typescript/module/src/expo-router/index.d.ts.map +1 -0
  598. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts +17 -0
  599. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -0
  600. package/lib/typescript/module/src/index.d.ts +112 -0
  601. package/lib/typescript/module/src/index.d.ts.map +1 -0
  602. package/lib/typescript/module/src/lifecycle.d.ts +96 -0
  603. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -0
  604. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts +21 -0
  605. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -0
  606. package/lib/typescript/module/src/navigation/chainCallbacks.d.ts +3 -0
  607. package/lib/typescript/module/src/navigation/chainCallbacks.d.ts.map +1 -0
  608. package/lib/typescript/module/src/navigation/getActiveRouteName.d.ts +6 -0
  609. package/lib/typescript/module/src/navigation/getActiveRouteName.d.ts.map +1 -0
  610. package/lib/typescript/module/src/navigation/index.d.ts +5 -0
  611. package/lib/typescript/module/src/navigation/index.d.ts.map +1 -0
  612. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts +33 -0
  613. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -0
  614. package/lib/typescript/module/src/network.d.ts +42 -0
  615. package/lib/typescript/module/src/network.d.ts.map +1 -0
  616. package/lib/typescript/module/src/pairing/PairingController.d.ts +104 -0
  617. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -0
  618. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +11 -0
  619. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -0
  620. package/lib/typescript/module/src/pairing/deepLink.d.ts +53 -0
  621. package/lib/typescript/module/src/pairing/deepLink.d.ts.map +1 -0
  622. package/lib/typescript/module/src/pairing/diagnostics.d.ts +52 -0
  623. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -0
  624. package/lib/typescript/module/src/pairing/index.d.ts +10 -0
  625. package/lib/typescript/module/src/pairing/index.d.ts.map +1 -0
  626. package/lib/typescript/module/src/pairing/pairingRuntime.d.ts +24 -0
  627. package/lib/typescript/module/src/pairing/pairingRuntime.d.ts.map +1 -0
  628. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +16 -0
  629. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -0
  630. package/lib/typescript/module/src/pairing/usePairingState.d.ts +4 -0
  631. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -0
  632. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +13 -0
  633. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -0
  634. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +13 -0
  635. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -0
  636. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +16 -0
  637. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -0
  638. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +32 -0
  639. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -0
  640. package/lib/typescript/module/src/runtime/clientConditions.d.ts +10 -0
  641. package/lib/typescript/module/src/runtime/clientConditions.d.ts.map +1 -0
  642. package/lib/typescript/module/src/runtime/flowEngine.d.ts +17 -0
  643. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -0
  644. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +18 -0
  645. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -0
  646. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +10 -0
  647. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -0
  648. package/lib/typescript/module/src/runtime/userflowCore.d.ts +3 -0
  649. package/lib/typescript/module/src/runtime/userflowCore.d.ts.map +1 -0
  650. package/lib/typescript/module/src/screenTracker.d.ts +28 -0
  651. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -0
  652. package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -0
  653. package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -0
  654. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +28 -0
  655. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts.map +1 -0
  656. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +23 -0
  657. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -0
  658. package/lib/typescript/module/src/surfaces/ProgressBar.d.ts +19 -0
  659. package/lib/typescript/module/src/surfaces/ProgressBar.d.ts.map +1 -0
  660. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +17 -0
  661. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -0
  662. package/lib/typescript/module/src/surfaces/absoluteFill.d.ts +18 -0
  663. package/lib/typescript/module/src/surfaces/absoluteFill.d.ts.map +1 -0
  664. package/lib/typescript/module/src/surfaces/parseBackdropOpacity.d.ts +5 -0
  665. package/lib/typescript/module/src/surfaces/parseBackdropOpacity.d.ts.map +1 -0
  666. package/lib/typescript/module/src/surfaces/progress.d.ts +14 -0
  667. package/lib/typescript/module/src/surfaces/progress.d.ts.map +1 -0
  668. package/lib/typescript/module/src/surfaces/resolveCloseButtonColor.d.ts +9 -0
  669. package/lib/typescript/module/src/surfaces/resolveCloseButtonColor.d.ts.map +1 -0
  670. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +36 -0
  671. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -0
  672. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +24 -0
  673. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -0
  674. package/lib/typescript/module/src/surfaces/safeArea.d.ts +11 -0
  675. package/lib/typescript/module/src/surfaces/safeArea.d.ts.map +1 -0
  676. package/lib/typescript/module/src/surfaces/themeChrome.d.ts +36 -0
  677. package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -0
  678. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +23 -0
  679. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -0
  680. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +31 -0
  681. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -0
  682. package/lib/typescript/module/src/surfaces/tooltip/TooltipNotch.d.ts +29 -0
  683. package/lib/typescript/module/src/surfaces/tooltip/TooltipNotch.d.ts.map +1 -0
  684. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +43 -0
  685. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -0
  686. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +34 -0
  687. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -0
  688. package/lib/typescript/module/src/surfaces/tooltip/parseBackdropPadding.d.ts +3 -0
  689. package/lib/typescript/module/src/surfaces/tooltip/parseBackdropPadding.d.ts.map +1 -0
  690. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +29 -0
  691. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -0
  692. package/lib/typescript/module/src/useUserflowScreen.d.ts +10 -0
  693. package/lib/typescript/module/src/useUserflowScreen.d.ts.map +1 -0
  694. package/lib/typescript/module/src/version.d.ts +3 -0
  695. package/lib/typescript/module/src/version.d.ts.map +1 -0
  696. package/package.json +144 -0
  697. package/src/anchors/AnchorRegistry.ts +81 -0
  698. package/src/anchors/AutoAnchorRegistry.ts +439 -0
  699. package/src/anchors/ScrollContainerRegistry.ts +108 -0
  700. package/src/anchors/anchorChangeTicker.ts +84 -0
  701. package/src/anchors/animationFrame.ts +88 -0
  702. package/src/anchors/autoAnchor.ts +310 -0
  703. package/src/anchors/elementConditionEvaluator.ts +108 -0
  704. package/src/anchors/fiber/FiberScanRoot.tsx +98 -0
  705. package/src/anchors/fiber/fiberInternals.ts +181 -0
  706. package/src/anchors/fiber/findAnchorFiber.ts +225 -0
  707. package/src/anchors/fiber/findScrollAncestors.ts +229 -0
  708. package/src/anchors/fiber/measureHostFiber.ts +85 -0
  709. package/src/anchors/fiber/visibleScreens.ts +173 -0
  710. package/src/anchors/hintsCodec.ts +125 -0
  711. package/src/anchors/resolveAnchorHost.ts +102 -0
  712. package/src/anchors/resolveManualAnchorId.ts +10 -0
  713. package/src/anchors/scrollAnchorIntoView.ts +251 -0
  714. package/src/anchors/scrollConfig.ts +61 -0
  715. package/src/anchors/targetPressMonitor.ts +127 -0
  716. package/src/anchors/useUserflowAnchor.ts +88 -0
  717. package/src/anchors/useUserflowScrollContainer.ts +86 -0
  718. package/src/anonymousId.ts +38 -0
  719. package/src/content/RichContentRenderer.tsx +721 -0
  720. package/src/content/StepButton.tsx +70 -0
  721. package/src/content/buttonAppearance.ts +11 -0
  722. package/src/content/deserialize.ts +147 -0
  723. package/src/content/imageLayout.ts +29 -0
  724. package/src/content/migrateFlowBlocks.ts +39 -0
  725. package/src/content/openSafeUrl.ts +30 -0
  726. package/src/content/resolveStepButtonChrome.ts +122 -0
  727. package/src/content/themeColor.ts +98 -0
  728. package/src/content/types.ts +189 -0
  729. package/src/deepLinking.ts +182 -0
  730. package/src/expo-router/UserflowExpoRouterScreenTracker.tsx +7 -0
  731. package/src/expo-router/getExpoRouterScreenTracker.ts +49 -0
  732. package/src/expo-router/index.ts +2 -0
  733. package/src/expo-router/useUserflowExpoRouter.ts +40 -0
  734. package/src/index.ts +362 -0
  735. package/src/lifecycle.ts +253 -0
  736. package/src/navigation/WithUserflowReactNavigation.tsx +87 -0
  737. package/src/navigation/chainCallbacks.ts +12 -0
  738. package/src/navigation/getActiveRouteName.ts +18 -0
  739. package/src/navigation/index.ts +11 -0
  740. package/src/navigation/openFlowNavigateUrl.ts +113 -0
  741. package/src/network.ts +113 -0
  742. package/src/pairing/PairingController.ts +356 -0
  743. package/src/pairing/PreviewModeBanner.tsx +130 -0
  744. package/src/pairing/deepLink.ts +128 -0
  745. package/src/pairing/diagnostics.ts +135 -0
  746. package/src/pairing/index.ts +19 -0
  747. package/src/pairing/pairingRuntime.ts +76 -0
  748. package/src/pairing/tokenStorage.ts +76 -0
  749. package/src/pairing/usePairingState.ts +43 -0
  750. package/src/runtime/FlowRenderer.tsx +60 -0
  751. package/src/runtime/FlowSurfaceFade.tsx +55 -0
  752. package/src/runtime/TargetPressBridge.tsx +86 -0
  753. package/src/runtime/UserflowProvider.tsx +89 -0
  754. package/src/runtime/clientConditions.ts +42 -0
  755. package/src/runtime/flowEngine.ts +53 -0
  756. package/src/runtime/flowSessionViewState.ts +55 -0
  757. package/src/runtime/useFlowSessionState.ts +36 -0
  758. package/src/runtime/userflowCore.ts +8 -0
  759. package/src/screenTracker.ts +83 -0
  760. package/src/surfaces/CloseButton.tsx +41 -0
  761. package/src/surfaces/MadeWithUserflow.tsx +103 -0
  762. package/src/surfaces/ModalSurface.tsx +215 -0
  763. package/src/surfaces/ProgressBar.tsx +142 -0
  764. package/src/surfaces/TooltipSurface.tsx +743 -0
  765. package/src/surfaces/absoluteFill.ts +24 -0
  766. package/src/surfaces/assets/png.d.ts +4 -0
  767. package/src/surfaces/assets/userflow-logomark.png +0 -0
  768. package/src/surfaces/parseBackdropOpacity.ts +13 -0
  769. package/src/surfaces/progress.ts +37 -0
  770. package/src/surfaces/resolveCloseButtonColor.ts +23 -0
  771. package/src/surfaces/resolveModalLayout.ts +85 -0
  772. package/src/surfaces/resolveTooltipLayout.ts +73 -0
  773. package/src/surfaces/safeArea.ts +48 -0
  774. package/src/surfaces/themeChrome.ts +126 -0
  775. package/src/surfaces/tooltip/TooltipBubble.tsx +123 -0
  776. package/src/surfaces/tooltip/TooltipCutout.tsx +110 -0
  777. package/src/surfaces/tooltip/TooltipNotch.tsx +67 -0
  778. package/src/surfaces/tooltip/computeTooltipPosition.ts +125 -0
  779. package/src/surfaces/tooltip/inferTooltipPlacement.ts +109 -0
  780. package/src/surfaces/tooltip/parseBackdropPadding.ts +8 -0
  781. package/src/surfaces/tooltip/rect.ts +62 -0
  782. package/src/useUserflowScreen.ts +17 -0
  783. package/src/version.ts +2 -0
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.autoAnchorRegistry = exports.AutoAnchorRegistry = void 0;
7
+ exports.roleForKind = roleForKind;
8
+ /**
9
+ * Multi-instance auto-anchor registry for Stage 3.
10
+ *
11
+ * Separate from {@link AnchorRegistry} (manual `useUserflowAnchor` / Tier 0).
12
+ * Each mounted host is a distinct instance indexed by registry key, template
13
+ * path, and developer ids so a later scored matcher can rank candidates.
14
+ */
15
+
16
+ /** Build-time descriptor stamped by `@userflow-tech/babel-plugin` (full or expanded compact). */
17
+
18
+ const PRESSABLE_KINDS = new Set(['Pressable', 'TouchableOpacity', 'TouchableHighlight', 'TouchableWithoutFeedback', 'TouchableNativeFeedback']);
19
+ function roleForKind(kind) {
20
+ if (PRESSABLE_KINDS.has(kind)) return 'Action';
21
+ if (kind === 'Text') return 'Text';
22
+ if (kind === 'Image') return 'Image';
23
+ if (kind === 'TextInput' || kind === 'TextField') return 'Input';
24
+ if (kind === 'View' || kind === 'ScrollView' || kind === 'SafeAreaView') return 'Group';
25
+ return 'Other';
26
+ }
27
+ let nextInstanceSeq = 1;
28
+ function mintInstanceId() {
29
+ const id = `inst_${nextInstanceSeq.toString(36)}`;
30
+ nextInstanceSeq += 1;
31
+ return id;
32
+ }
33
+
34
+ /** Parent path for sibling grouping when `parentInstanceId` is unset (Babel stamps). */
35
+ function siblingGroupKey(inst) {
36
+ const path = inst.templatePath || inst.structuralPath;
37
+ const idx = path.lastIndexOf(' > ');
38
+ return idx === -1 ? path : path.slice(0, idx);
39
+ }
40
+ class AutoAnchorRegistry {
41
+ instances = new Map();
42
+ byRegistryKey = new Map();
43
+ byManualId = new Map();
44
+ byTemplatePath = new Map();
45
+ listeners = new Set();
46
+ notifyScheduled = false;
47
+ registerInstance(input) {
48
+ const instanceId = mintInstanceId();
49
+ const hints = input.hints ?? undefined;
50
+ const kind = input.kind;
51
+ const role = hints?.role ?? roleForKind(kind);
52
+ const templatePath = hints?.templatePath ?? hints?.ufid ?? input.registryKey;
53
+ const structuralPath = hints?.structuralPath ?? hints?.ufid ?? templatePath;
54
+ const runtime = input.runtime ?? {};
55
+ const manualId = runtime.manualId ?? runtime.userflowId ?? hints?.literalUserflowId ?? runtime.testID ?? hints?.literalTestId ?? (runtime.nativeID && !runtime.nativeID.startsWith('uf_') ? runtime.nativeID : undefined);
56
+ const userflowId = runtime.userflowId ?? hints?.literalUserflowId;
57
+ const testID = runtime.testID ?? hints?.literalTestId;
58
+ const nativeID = runtime.nativeID ?? hints?.nativeId;
59
+ const childText = runtime.childText ?? hints?.childText;
60
+ const accessibilityLabel = runtime.accessibilityLabel ?? hints?.literalLabel;
61
+ const iconName = runtime.iconName ?? hints?.iconName;
62
+ const imageSrc = runtime.imageSrc ?? hints?.imageSrc;
63
+ const instance = {
64
+ instanceId,
65
+ registryKey: input.registryKey,
66
+ ref: input.ref,
67
+ kind,
68
+ role,
69
+ isPressable: PRESSABLE_KINDS.has(kind),
70
+ templatePath,
71
+ structuralPath,
72
+ ...(input.instanceScope ? {
73
+ instanceScope: input.instanceScope
74
+ } : {}),
75
+ ...(manualId ? {
76
+ manualId
77
+ } : {}),
78
+ ...(userflowId ? {
79
+ userflowId
80
+ } : {}),
81
+ ...(testID ? {
82
+ testID
83
+ } : {}),
84
+ ...(nativeID ? {
85
+ nativeID
86
+ } : {}),
87
+ ...(childText ? {
88
+ childText
89
+ } : {}),
90
+ ...(accessibilityLabel ? {
91
+ accessibilityLabel
92
+ } : {}),
93
+ ...(hints?.childShape ? {
94
+ childShape: hints.childShape
95
+ } : {}),
96
+ ...(iconName ? {
97
+ iconName
98
+ } : {}),
99
+ ...(imageSrc ? {
100
+ imageSrc
101
+ } : {}),
102
+ ancestors: hints?.ancestors ? [...hints.ancestors] : [],
103
+ ...(hints?.ordinal !== undefined ? {
104
+ ordinal: hints.ordinal
105
+ } : {}),
106
+ ...(hints?.siblingIndex !== undefined ? {
107
+ siblingIndex: hints.siblingIndex
108
+ } : {}),
109
+ ...(input.parentInstanceId ? {
110
+ parentInstanceId: input.parentInstanceId
111
+ } : {}),
112
+ childInstanceIds: [],
113
+ ambiguous: false
114
+ };
115
+ this.instances.set(instanceId, instance);
116
+ this.addIndex(this.byRegistryKey, input.registryKey, instanceId);
117
+ this.addIndex(this.byTemplatePath, templatePath, instanceId);
118
+ if (manualId) this.addIndex(this.byManualId, manualId, instanceId);
119
+ if (instance.userflowId) this.addIndex(this.byManualId, instance.userflowId, instanceId);
120
+ if (instance.testID) this.addIndex(this.byManualId, instance.testID, instanceId);
121
+ if (input.parentInstanceId) {
122
+ const parent = this.instances.get(input.parentInstanceId);
123
+ if (parent) parent.childInstanceIds.push(instanceId);
124
+ }
125
+ this.recomputeAmbiguity(input.registryKey, templatePath, manualId);
126
+ this.notify();
127
+ return {
128
+ instanceId,
129
+ dispose: () => {
130
+ this.unregisterInstance(instanceId);
131
+ }
132
+ };
133
+ }
134
+ updateInstance(instanceId, patch) {
135
+ const inst = this.instances.get(instanceId);
136
+ if (!inst) return;
137
+ const prevIds = {
138
+ manualId: inst.manualId,
139
+ userflowId: inst.userflowId,
140
+ testID: inst.testID
141
+ };
142
+ Object.assign(inst, patch);
143
+ if (patch.manualId !== undefined || patch.userflowId !== undefined || patch.testID !== undefined) {
144
+ const nextManual = patch.manualId ?? inst.userflowId ?? inst.testID ?? (inst.nativeID && !inst.nativeID.startsWith('uf_') ? inst.nativeID : undefined);
145
+ if (nextManual) inst.manualId = nextManual;else delete inst.manualId;
146
+ }
147
+ this.refreshManualIndexes(inst, prevIds);
148
+ this.recomputeAmbiguity(inst.registryKey, inst.templatePath, inst.manualId);
149
+ this.notify();
150
+ }
151
+ getInstance(instanceId) {
152
+ return this.instances.get(instanceId);
153
+ }
154
+ getInstancesByRegistryKey(key) {
155
+ return this.idsToInstances(this.byRegistryKey.get(key));
156
+ }
157
+ getInstancesByManualId(id) {
158
+ return this.idsToInstances(this.byManualId.get(id));
159
+ }
160
+ getInstancesByTemplatePath(path) {
161
+ return this.idsToInstances(this.byTemplatePath.get(path));
162
+ }
163
+ allInstances() {
164
+ return Array.from(this.instances.values());
165
+ }
166
+ orderedSiblingsIncludingSelf(instanceId) {
167
+ const inst = this.instances.get(instanceId);
168
+ if (!inst) return [];
169
+ if (!inst.parentInstanceId) {
170
+ const group = siblingGroupKey(inst);
171
+ return this.allInstances().filter(i => !i.parentInstanceId && siblingGroupKey(i) === group).sort((a, b) => (a.siblingIndex ?? 0) - (b.siblingIndex ?? 0));
172
+ }
173
+ const parent = this.instances.get(inst.parentInstanceId);
174
+ if (!parent) return [inst];
175
+ return parent.childInstanceIds.map(id => this.instances.get(id)).filter(i => !!i).sort((a, b) => (a.siblingIndex ?? 0) - (b.siblingIndex ?? 0));
176
+ }
177
+ siblingWindow(instanceId, windowSize = 2) {
178
+ const ordered = this.orderedSiblingsIncludingSelf(instanceId);
179
+ const idx = ordered.findIndex(i => i.instanceId === instanceId);
180
+ if (idx < 0) return {
181
+ previous: [],
182
+ next: []
183
+ };
184
+ const toDesc = i => ({
185
+ kind: i.kind,
186
+ role: i.role,
187
+ ...(i.childText ? {
188
+ text: i.childText
189
+ } : {}),
190
+ ...(i.testID ? {
191
+ testID: i.testID
192
+ } : {}),
193
+ ...(i.userflowId ? {
194
+ userflowId: i.userflowId
195
+ } : {})
196
+ });
197
+ return {
198
+ previous: ordered.slice(Math.max(0, idx - windowSize), idx).map(toDesc),
199
+ next: ordered.slice(idx + 1, idx + 1 + windowSize).map(toDesc)
200
+ };
201
+ }
202
+ subscribe(listener) {
203
+ this.listeners.add(listener);
204
+ return () => {
205
+ this.listeners.delete(listener);
206
+ };
207
+ }
208
+ isAmbiguousKey(key) {
209
+ const byKey = this.getInstancesByRegistryKey(key);
210
+ if (byKey.length > 0) return byKey.some(i => i.ambiguous);
211
+ const byManual = this.getInstancesByManualId(key);
212
+ return byManual.length > 1 || byManual.some(i => i.ambiguous);
213
+ }
214
+
215
+ /** Test helper — drop every instance and reset ids. */
216
+ clear() {
217
+ this.instances.clear();
218
+ this.byRegistryKey.clear();
219
+ this.byManualId.clear();
220
+ this.byTemplatePath.clear();
221
+ this.notifyScheduled = false;
222
+ nextInstanceSeq = 1;
223
+ }
224
+ unregisterInstance(instanceId) {
225
+ const inst = this.instances.get(instanceId);
226
+ if (!inst) return;
227
+ if (inst.parentInstanceId) {
228
+ const parent = this.instances.get(inst.parentInstanceId);
229
+ if (parent) {
230
+ parent.childInstanceIds = parent.childInstanceIds.filter(id => id !== instanceId);
231
+ }
232
+ }
233
+ for (const childId of [...inst.childInstanceIds]) {
234
+ const child = this.instances.get(childId);
235
+ if (child) delete child.parentInstanceId;
236
+ }
237
+ this.instances.delete(instanceId);
238
+ this.removeIndex(this.byRegistryKey, inst.registryKey, instanceId);
239
+ this.removeIndex(this.byTemplatePath, inst.templatePath, instanceId);
240
+ if (inst.manualId) this.removeIndex(this.byManualId, inst.manualId, instanceId);
241
+ if (inst.userflowId) this.removeIndex(this.byManualId, inst.userflowId, instanceId);
242
+ if (inst.testID) this.removeIndex(this.byManualId, inst.testID, instanceId);
243
+ this.recomputeAmbiguity(inst.registryKey, inst.templatePath, inst.manualId);
244
+ this.notify();
245
+ }
246
+ refreshManualIndexes(inst, prev) {
247
+ const prevKeys = new Set([prev.manualId, prev.userflowId, prev.testID].filter(k => !!k));
248
+ const nextKeys = new Set([inst.manualId, inst.userflowId, inst.testID].filter(k => !!k));
249
+ for (const key of prevKeys) {
250
+ if (!nextKeys.has(key)) this.removeIndex(this.byManualId, key, inst.instanceId);
251
+ }
252
+ for (const key of nextKeys) {
253
+ if (!prevKeys.has(key)) this.addIndex(this.byManualId, key, inst.instanceId);
254
+ }
255
+ }
256
+ recomputeAmbiguity(registryKey, templatePath, manualId) {
257
+ const mark = list => {
258
+ const ambiguous = list.length > 1 && list.every(i => !i.manualId);
259
+ for (const i of list) {
260
+ i.ambiguous = ambiguous || (i.manualId ? this.getInstancesByManualId(i.manualId).length > 1 : false);
261
+ }
262
+ };
263
+ mark(this.getInstancesByRegistryKey(registryKey));
264
+ mark(this.getInstancesByTemplatePath(templatePath));
265
+ if (manualId) {
266
+ const list = this.getInstancesByManualId(manualId);
267
+ for (const i of list) i.ambiguous = list.length > 1;
268
+ }
269
+ }
270
+ addIndex(map, key, instanceId) {
271
+ let set = map.get(key);
272
+ if (!set) {
273
+ set = new Set();
274
+ map.set(key, set);
275
+ }
276
+ set.add(instanceId);
277
+ }
278
+ removeIndex(map, key, instanceId) {
279
+ const set = map.get(key);
280
+ if (!set) return;
281
+ set.delete(instanceId);
282
+ if (set.size === 0) map.delete(key);
283
+ }
284
+ idsToInstances(set) {
285
+ if (!set) return [];
286
+ const out = [];
287
+ for (const id of set) {
288
+ const inst = this.instances.get(id);
289
+ if (inst) out.push(inst);
290
+ }
291
+ return out;
292
+ }
293
+ notify() {
294
+ if (this.notifyScheduled) return;
295
+ this.notifyScheduled = true;
296
+ const flush = () => {
297
+ this.notifyScheduled = false;
298
+ for (const l of this.listeners) {
299
+ try {
300
+ l();
301
+ } catch {
302
+ // listeners are infrastructure; never propagate
303
+ }
304
+ }
305
+ };
306
+ if (typeof queueMicrotask === 'function') {
307
+ queueMicrotask(flush);
308
+ } else {
309
+ void Promise.resolve().then(flush);
310
+ }
311
+ }
312
+ }
313
+ exports.AutoAnchorRegistry = AutoAnchorRegistry;
314
+ const autoAnchorRegistry = exports.autoAnchorRegistry = new AutoAnchorRegistry();
315
+ //# sourceMappingURL=AutoAnchorRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PRESSABLE_KINDS","Set","roleForKind","kind","has","nextInstanceSeq","mintInstanceId","id","toString","siblingGroupKey","inst","path","templatePath","structuralPath","idx","lastIndexOf","slice","AutoAnchorRegistry","instances","Map","byRegistryKey","byManualId","byTemplatePath","listeners","notifyScheduled","registerInstance","input","instanceId","hints","undefined","role","ufid","registryKey","runtime","manualId","userflowId","literalUserflowId","testID","literalTestId","nativeID","startsWith","nativeId","childText","accessibilityLabel","literalLabel","iconName","imageSrc","instance","ref","isPressable","instanceScope","childShape","ancestors","ordinal","siblingIndex","parentInstanceId","childInstanceIds","ambiguous","set","addIndex","parent","get","push","recomputeAmbiguity","notify","dispose","unregisterInstance","updateInstance","patch","prevIds","Object","assign","nextManual","refreshManualIndexes","getInstance","getInstancesByRegistryKey","key","idsToInstances","getInstancesByManualId","getInstancesByTemplatePath","allInstances","Array","from","values","orderedSiblingsIncludingSelf","group","filter","i","sort","a","b","map","siblingWindow","windowSize","ordered","findIndex","previous","next","toDesc","text","Math","max","subscribe","listener","add","delete","isAmbiguousKey","byKey","length","some","byManual","clear","childId","child","removeIndex","prev","prevKeys","k","nextKeys","mark","list","every","size","out","flush","l","queueMicrotask","Promise","resolve","then","exports","autoAnchorRegistry"],"sourceRoot":"../../../src","sources":["anchors/AutoAnchorRegistry.ts"],"mappings":";;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;;AAoEA,MAAMA,eAAe,GAAG,IAAIC,GAAG,CAAS,CACtC,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,CAC1B,CAAC;AAEK,SAASC,WAAWA,CAACC,IAAY,EAAgB;EACtD,IAAIH,eAAe,CAACI,GAAG,CAACD,IAAI,CAAC,EAAE,OAAO,QAAQ;EAC9C,IAAIA,IAAI,KAAK,MAAM,EAAE,OAAO,MAAM;EAClC,IAAIA,IAAI,KAAK,OAAO,EAAE,OAAO,OAAO;EACpC,IAAIA,IAAI,KAAK,WAAW,IAAIA,IAAI,KAAK,WAAW,EAAE,OAAO,OAAO;EAChE,IAAIA,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,YAAY,IAAIA,IAAI,KAAK,cAAc,EAAE,OAAO,OAAO;EACvF,OAAO,OAAO;AAChB;AAEA,IAAIE,eAAe,GAAG,CAAC;AAEvB,SAASC,cAAcA,CAAA,EAAW;EAChC,MAAMC,EAAE,GAAG,QAAQF,eAAe,CAACG,QAAQ,CAAC,EAAE,CAAC,EAAE;EACjDH,eAAe,IAAI,CAAC;EACpB,OAAOE,EAAE;AACX;;AAEA;AACA,SAASE,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AAC;IAC1B;IACA,OAAOiH,GAAG;EACZ;EAEQ3D,MAAMA,CAAA,EAAS;IACrB,IAAI,IAAI,CAACxC,eAAe,EAAE;IAC1B,IAAI,CAACA,eAAe,GAAG,IAAI;IAC3B,MAAMoG,KAAK,GAAGA,CAAA,KAAM;MAClB,IAAI,CAACpG,eAAe,GAAG,KAAK;MAC5B,KAAK,MAAMqG,CAAC,IAAI,IAAI,CAACtG,SAAS,EAAE;QAC9B,IAAI;UACFsG,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,MAAM;UACN;QAAA;MAEJ;IACF,CAAC;IACD,IAAI,OAAOC,cAAc,KAAK,UAAU,EAAE;MACxCA,cAAc,CAACF,KAAK,CAAC;IACvB,CAAC,MAAM;MACL,KAAKG,OAAO,CAACC,OAAO,CAAC,CAAC,CAACC,IAAI,CAACL,KAAK,CAAC;IACpC;EACF;AACF;AAACM,OAAA,CAAAjH,kBAAA,GAAAA,kBAAA;AAEM,MAAMkH,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,IAAIlH,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScrollContainerRegistry = void 0;
7
+ exports.createScrollContainerHost = createScrollContainerHost;
8
+ exports.scrollContainerRegistry = void 0;
9
+ /** Padding applied when scrolling a target into the visible region of a container. */
10
+ const INTO_VIEW_PADDING = 24;
11
+ /**
12
+ * Registry of host {@link ScrollView}s used as an explicit override when
13
+ * scrolling tooltip anchors into view. Prefer automatic fiber discovery for
14
+ * `testID` anchors; register here for scroll libraries the walk cannot drive.
15
+ */
16
+ class ScrollContainerRegistry {
17
+ containers = new Set();
18
+ listeners = new Set();
19
+ register(host) {
20
+ this.containers.add(host);
21
+ this.emit();
22
+ }
23
+ unregister(host) {
24
+ this.containers.delete(host);
25
+ this.emit();
26
+ }
27
+
28
+ /** Snapshot of registered containers (most recently registered last). */
29
+ list() {
30
+ return [...this.containers];
31
+ }
32
+
33
+ /**
34
+ * Scroll the first registered container that can bring `target` into its
35
+ * visible window region. Best-effort — no-op when nothing is registered.
36
+ */
37
+ scrollTargetIntoView(target) {
38
+ for (const host of this.containers) {
39
+ host.measureInWindow((x, y, width, height) => {
40
+ if (width <= 0 || height <= 0) return;
41
+ const offset = host.getContentOffset();
42
+ const targetContentY = offset.y + (target.y - y);
43
+ let nextY = null;
44
+ if (target.y < y + INTO_VIEW_PADDING) {
45
+ nextY = Math.max(0, targetContentY - INTO_VIEW_PADDING);
46
+ } else if (target.y + target.height > y + height - INTO_VIEW_PADDING) {
47
+ nextY = Math.max(0, targetContentY + target.height - height + INTO_VIEW_PADDING);
48
+ }
49
+ if (nextY == null || Math.abs(nextY - offset.y) < 1) return;
50
+ host.scrollTo({
51
+ y: nextY,
52
+ animated: true
53
+ });
54
+ });
55
+ // Prefer the first container for MVP; hosts typically have one root ScrollView.
56
+ return;
57
+ }
58
+ }
59
+ subscribe(listener) {
60
+ this.listeners.add(listener);
61
+ return () => {
62
+ this.listeners.delete(listener);
63
+ };
64
+ }
65
+ clear() {
66
+ this.containers.clear();
67
+ this.emit();
68
+ }
69
+ emit() {
70
+ for (const listener of this.listeners) {
71
+ listener();
72
+ }
73
+ }
74
+ }
75
+
76
+ /** Module singleton used by {@link useUserflowScrollContainer} and TooltipSurface. */
77
+ exports.ScrollContainerRegistry = ScrollContainerRegistry;
78
+ const scrollContainerRegistry = exports.scrollContainerRegistry = new ScrollContainerRegistry();
79
+
80
+ /** Build a host from a live ScrollView + tracked content offset. */
81
+ function createScrollContainerHost(node, getContentOffset) {
82
+ const measurable = node;
83
+ return {
84
+ measureInWindow: callback => {
85
+ measurable.measureInWindow(callback);
86
+ },
87
+ getContentOffset,
88
+ scrollTo: options => {
89
+ node.scrollTo(options);
90
+ }
91
+ };
92
+ }
93
+ //# sourceMappingURL=ScrollContainerRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["INTO_VIEW_PADDING","ScrollContainerRegistry","containers","Set","listeners","register","host","add","emit","unregister","delete","list","scrollTargetIntoView","target","measureInWindow","x","y","width","height","offset","getContentOffset","targetContentY","nextY","Math","max","abs","scrollTo","animated","subscribe","listener","clear","exports","scrollContainerRegistry","createScrollContainerHost","node","measurable","callback","options"],"sourceRoot":"../../../src","sources":["anchors/ScrollContainerRegistry.ts"],"mappings":";;;;;;;;AAIA;AACA,MAAMA,iBAAiB,GAAG,EAAE;AAY5B;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,CAAC;EAClBC,UAAU,GAAG,IAAIC,GAAG,CAAsB,CAAC;EAC3CC,SAAS,GAAG,IAAID,GAAG,CAAW,CAAC;EAEhDE,QAAQA,CAACC,IAAyB,EAAQ;IACxC,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACD,IAAI,CAAC;IACzB,IAAI,CAACE,IAAI,CAAC,CAAC;EACb;EAEAC,UAAUA,CAACH,IAAyB,EAAQ;IAC1C,IAAI,CAACJ,UAAU,CAACQ,MAAM,CAACJ,IAAI,CAAC;IAC5B,IAAI,CAACE,IAAI,CAAC,CAAC;EACb;;EAEA;EACAG,IAAIA,CAAA,EAA0B;IAC5B,OAAO,CAAC,GAAG,IAAI,CAACT,UAAU,CAAC;EAC7B;;EAEA;AACF;AACA;AACA;EACEU,oBAAoBA,CAACC,MAAY,EAAQ;IACvC,KAAK,MAAMP,IAAI,IAAI,IAAI,CAACJ,UAAU,EAAE;MAClCI,IAAI,CAACQ,eAAe,CAAC,CAACC,CAAC,EAAEC,CAAC,EAAEC,KAAK,EAAEC,MAAM,KAAK;QAC5C,IAAID,KAAK,IAAI,CAAC,IAAIC,MAAM,IAAI,CAAC,EAAE;QAE/B,MAAMC,MAAM,GAAGb,IAAI,CAACc,gBAAgB,CAAC,CAAC;QACtC,MAAMC,cAAc,GAAGF,MAAM,CAACH,CAAC,IAAIH,MAAM,CAACG,CAAC,GAAGA,CAAC,CAAC;QAChD,IAA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,uBAAuB,CAAC,CAAC;;AAEpE;AACO,SAASgC,yBAAyBA,CACvCC,IAAgB,EAChBd,gBAAgD,EAC3B;EACrB,MAAMe,UAAU,GAAGD,IAAyB;EAC5C,OAAO;IACLpB,eAAe,EAAGsB,QAAQ,IAAK;MAC7BD,UAAU,CAACrB,eAAe,CAACsB,QAAQ,CAAC;IACtC,CAAC;IACDhB,gBAAgB;IAChBM,QAAQ,EAAGW,OAAO,IAAK;MACrBH,IAAI,CAACR,QAAQ,CAACW,OAAO,CAAC;IACxB;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.anchorChangeTicker = void 0;
7
+ var _AnchorRegistry = require("./AnchorRegistry.js");
8
+ var _FiberScanRoot = require("./fiber/FiberScanRoot.js");
9
+ /**
10
+ * Change signal for ELEMENT client conditions.
11
+ *
12
+ * Fiber-resolved anchors (testID / nativeID / accessibilityLabel) do not emit
13
+ * registry events, so we combine:
14
+ * - {@link anchorRegistry} mount/unmount
15
+ * - {@link fiberScanRoot} mount/unmount
16
+ * - screen-change notifications
17
+ * - a slow interval that only runs while at least one listener is subscribed
18
+ */
19
+ class AnchorChangeTicker {
20
+ listeners = new Set();
21
+ intervalHandle = null;
22
+ unsubRegistry = null;
23
+ unsubScan = null;
24
+
25
+ /** Poll interval while ELEMENT conditions are tracked (ms). */
26
+ static INTERVAL_MS = 1000;
27
+ subscribe(listener) {
28
+ const wasEmpty = this.listeners.size === 0;
29
+ this.listeners.add(listener);
30
+ if (wasEmpty) {
31
+ this.start();
32
+ }
33
+ return () => {
34
+ this.listeners.delete(listener);
35
+ if (this.listeners.size === 0) {
36
+ this.stop();
37
+ }
38
+ };
39
+ }
40
+
41
+ /** Push a change from outside (e.g. screen navigation). */
42
+ notify() {
43
+ this.emit();
44
+ }
45
+
46
+ /** Test helper. */
47
+ resetForTests() {
48
+ this.stop();
49
+ this.listeners.clear();
50
+ }
51
+ start() {
52
+ if (!this.unsubRegistry) {
53
+ this.unsubRegistry = _AnchorRegistry.anchorRegistry.subscribe(() => this.emit());
54
+ }
55
+ if (!this.unsubScan) {
56
+ this.unsubScan = _FiberScanRoot.fiberScanRoot.subscribe(() => this.emit());
57
+ }
58
+ if (!this.intervalHandle) {
59
+ this.intervalHandle = setInterval(() => this.emit(), AnchorChangeTicker.INTERVAL_MS);
60
+ }
61
+ }
62
+ stop() {
63
+ if (this.intervalHandle) {
64
+ clearInterval(this.intervalHandle);
65
+ this.intervalHandle = null;
66
+ }
67
+ if (this.unsubRegistry) {
68
+ this.unsubRegistry();
69
+ this.unsubRegistry = null;
70
+ }
71
+ if (this.unsubScan) {
72
+ this.unsubScan();
73
+ this.unsubScan = null;
74
+ }
75
+ }
76
+ emit() {
77
+ for (const listener of this.listeners) {
78
+ listener();
79
+ }
80
+ }
81
+ }
82
+ const anchorChangeTicker = exports.anchorChangeTicker = new AnchorChangeTicker();
83
+ //# sourceMappingURL=anchorChangeTicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_AnchorRegistry","require","_FiberScanRoot","AnchorChangeTicker","listeners","Set","intervalHandle","unsubRegistry","unsubScan","INTERVAL_MS","subscribe","listener","wasEmpty","size","add","start","delete","stop","notify","emit","resetForTests","clear","anchorRegistry","fiberScanRoot","setInterval","clearInterval","anchorChangeTicker","exports"],"sourceRoot":"../../../src","sources":["anchors/anchorChangeTicker.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,kBAAkB,CAAC;EACNC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;EACxCC,cAAc,GAA0C,IAAI;EAC5DC,aAAa,GAAwB,IAAI;EACzCC,SAAS,GAAwB,IAAI;;EAE7C;EACA,OAAgBC,WAAW,GAAG,IAAI;EAElCC,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IAAI;IAC5B;IACA,IAAI,IAAI,CAACC,aAAa,EAAE;MACtB,IAAI,CAACA,aAAa,CAAC,CAAC;MACpB,IAAI,CAACA,aAAa,GAAG,IAAI;IAC3B;IACA,IAAI,IAAI,CAACC,SAAS,EAAE;MAClB,IAAI,CAACA,SAAS,CAAC,CAAC;MAChB,IAAI,CAACA,SAAS,GAAG,IAAI;IACvB;EACF;EAEQW,IAAIA,CAAA,EAAS;IACnB,KAAK,MAAMR,QAAQ,IAAI,IAAI,CAACP,SAAS,EAAE;MACrCO,QAAQ,CAAC,CAAC;IACZ;EACF;AACF;AAEO,MAAMe,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAIvB,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.addAnimationFrameCallback = addAnimationFrameCallback;
7
+ exports.animationFrameSubscriberCount = animationFrameSubscriberCount;
8
+ exports.removeAnimationFrameCallback = removeAnimationFrameCallback;
9
+ exports.resetAnimationFrameForTests = resetAnimationFrameForTests;
10
+ /**
11
+ * Shared requestAnimationFrame hub so multiple surfaces never stack loops.
12
+ * Mirrors web userflowjs `util/animation-frame.tsx`.
13
+ */
14
+
15
+ const callbacks = [];
16
+ let rafHandle = null;
17
+ let active = false;
18
+
19
+ /**
20
+ * `callback` runs on every animation frame. Starts the shared loop when the
21
+ * first subscriber attaches.
22
+ */
23
+ function addAnimationFrameCallback(callback) {
24
+ if (callbacks.includes(callback)) return;
25
+ callbacks.push(callback);
26
+ if (callbacks.length === 1) {
27
+ active = true;
28
+ requestNext();
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Remove a previously added callback. Stops the loop when the last subscriber
34
+ * detaches.
35
+ */
36
+ function removeAnimationFrameCallback(callback) {
37
+ const idx = callbacks.indexOf(callback);
38
+ if (idx < 0) return;
39
+ callbacks.splice(idx, 1);
40
+ if (callbacks.length === 0) {
41
+ active = false;
42
+ cancelPending();
43
+ }
44
+ }
45
+
46
+ /** Test helper — drop all subscribers and cancel the pending frame. */
47
+ function resetAnimationFrameForTests() {
48
+ callbacks.length = 0;
49
+ active = false;
50
+ cancelPending();
51
+ }
52
+
53
+ /** Test helper — number of active subscribers. */
54
+ function animationFrameSubscriberCount() {
55
+ return callbacks.length;
56
+ }
57
+ function onAnimationFrame() {
58
+ rafHandle = null;
59
+ // Snapshot so a callback that unsubscribes mid-frame is safe.
60
+ const snapshot = callbacks.slice();
61
+ for (const callback of snapshot) {
62
+ try {
63
+ callback();
64
+ } catch {
65
+ // A single subscriber must not tear down the hub.
66
+ }
67
+ }
68
+ requestNext();
69
+ }
70
+ function requestNext() {
71
+ if (!active) return;
72
+ const raf = typeof globalThis.requestAnimationFrame === 'function' ? globalThis.requestAnimationFrame.bind(globalThis) : null;
73
+ if (raf) {
74
+ rafHandle = raf(onAnimationFrame);
75
+ } else {
76
+ // Jest / environments without rAF — fall back to a short timer so tests
77
+ // and headless runs still drive the loop.
78
+ rafHandle = setTimeout(onAnimationFrame, 16);
79
+ }
80
+ }
81
+ function cancelPending() {
82
+ if (rafHandle == null) return;
83
+ if (typeof globalThis.cancelAnimationFrame === 'function' && typeof rafHandle === 'number') {
84
+ globalThis.cancelAnimationFrame(rafHandle);
85
+ } else {
86
+ clearTimeout(rafHandle);
87
+ }
88
+ rafHandle = null;
89
+ }
90
+ //# sourceMappingURL=animationFrame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["callbacks","rafHandle","active","addAnimationFrameCallback","callback","includes","push","length","requestNext","removeAnimationFrameCallback","idx","indexOf","splice","cancelPending","resetAnimationFrameForTests","animationFrameSubscriberCount","onAnimationFrame","snapshot","slice","raf","globalThis","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","clearTimeout"],"sourceRoot":"../../../src","sources":["anchors/animationFrame.ts"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;;AAIA,MAAMA,SAAqB,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