@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 @@
1
+ {"version":3,"names":["_autoAnchor","require","_anchorChangeTicker","_resolveAnchorHost","_scrollConfig","_anonymousId","_deepLinking","_lifecycle","_openFlowNavigateUrl","_network","_pairingRuntime","_clientConditions","_flowEngine","_userflowCore","_screenTracker","_version","_UserflowProvider","_useFlowSessionState","_useUserflowScreen","_useUserflowAnchor","_useUserflowScrollContainer","_index","core","getUserflowCore","lifecycle","LifecycleController","suspend","resume","getFlowSessionEngine","flushPendingSends","clearLocalSession","clearFlowSessionEngineLocalSession","setFlowSessionId","ensureAlive","hasActiveSession","hasActiveFlowSession","network","NetworkController","wireScreenChangeReporter","setScreenChangeReporter","location","reportActivity","screenKey","path","screen","notifyAnchorScreenChange","anchorChangeTicker","notify","__DEV__","identified","getUserId","console","log","updateScreen","catch","wireDeepLinking","startDeepLinking","isIdentified","startFlowWithToken","token","afterIdentify","attachFlowSessionEngine","attachClientConditionEngine","getPairingController","notifyIdentified","flushPendingPreviewToken","Userflow","exports","init","config","setHostOnNavigate","onNavigate","start","pairing","installPairingController","pairingEndpoint","undefined","notifyInitStarted","then","resolved","enableScreenTracking","notifyInitialized","error","notifyInitFailed","handlePairingUrl","url","handleUrl","exitPreview","setOnNavigate","handler","identify","userId","attributes","options","previousId","resetClientConditionEngine","setClientConditions","clearAnonymousId","identifyAnonymous","anonymousId","getOrCreateAnonymousId","didHandleURL","group","groupId","track","name","getAttributes","reset","resetFlowSessionEngine","teardown","stop","disableScreenTracking","stopDeepLinking","screenName","handleScreenChange","setScrollPadding","padding","setScrollPaddingConfig","setCustomScrollIntoView","fn","setCustomScrollIntoViewConfig"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IA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AAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEvE,cAAcA,CAAA,EAAS;IACrBjB,SAAS,CAACiB,cAAc,CAAC,CAAC;EAC5B,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEY,YAAYA,CAAC4D,UAA8B,EAAQ;IACjD,IAAAC,iCAAkB,EAACD,UAAU,GAAG;MAAErE,MAAM,EAAEqE;IAAW,CAAC,GAAGrC,SAAS,CAAC;EACrE,CAAC;EACD;AACF;AACA;AACA;EACEuC,gBAAgBA,CAACC,OAAyC,EAAQ;IAChE,IAAAC,8BAAsB,EAACD,OAAO,CAAC;EACjC,CAAC;EACD;AACF;AACA;AACA;EACEE,uBAAuBA,CAACC,EAA2C,EAAQ;IACzE,IAAAC,qCAA6B,EAACD,EAAE,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SUSPEND_GRACE_MS = exports.SESSION_STALE_AFTER_BACKGROUND_MS = exports.LifecycleController = exports.INACTIVITY_TIMEOUT_MS = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * Mobile connection lifecycle policy.
10
+ *
11
+ * - Background / inactive → arm a short grace timer, then suspend the socket.
12
+ * Returning to active before grace elapses avoids suspend/resume churn: resume
13
+ * if already idle-suspended, otherwise probe liveness (`ensureAlive`) so a
14
+ * silently-dead socket recovers without waiting for the next heartbeat.
15
+ * - Foreground after grace but < {@link SESSION_STALE_AFTER_BACKGROUND_MS}
16
+ * (5 min) → resume and keep the mid-flow session (short-background “resume”).
17
+ * - Foreground after ≥ 5 min → clear local flow session, then resume
18
+ * (long-background reconnect without stale mid-flow UI).
19
+ * - Foreground idle for 5 min → suspend (skip while any flow session is active).
20
+ * - Activity while foreground → reset idle timer and resume if idle-suspended.
21
+ *
22
+ * This 5-minute policy is the ticket meaning of FLOW_RENDERING_SPEC “resume”:
23
+ * short backgrounds continue the active flow; long backgrounds clear then reconnect.
24
+ */
25
+
26
+ /** Match web `INACTIVITY_TIMEOUT` — disconnect after this much idle time in foreground. */
27
+ const INACTIVITY_TIMEOUT_MS = exports.INACTIVITY_TIMEOUT_MS = 5 * 60 * 1000;
28
+
29
+ /** Away this long → drop local mid-flow session before reconnecting. */
30
+ const SESSION_STALE_AFTER_BACKGROUND_MS = exports.SESSION_STALE_AFTER_BACKGROUND_MS = 5 * 60 * 1000;
31
+
32
+ /**
33
+ * Delay before suspending on leave. Covers transient iOS `inactive` (Control
34
+ * Center, biometric prompts, app-switcher peek) and quick app-switches.
35
+ */
36
+ const SUSPEND_GRACE_MS = exports.SUSPEND_GRACE_MS = 3_000;
37
+ const defaultScheduler = {
38
+ setTimeout: (handler, ms) => setTimeout(handler, ms),
39
+ clearTimeout: handle => clearTimeout(handle)
40
+ };
41
+ function defaultSubscribeAppState(handler) {
42
+ const subscription = _reactNative.AppState.addEventListener('change', handler);
43
+ return () => subscription.remove();
44
+ }
45
+
46
+ /**
47
+ * Owns AppState subscription, background duration tracking, and the foreground
48
+ * idle timer. Call {@link start} from `Userflow.init` and {@link stop} from
49
+ * `Userflow.teardown`.
50
+ */
51
+ class LifecycleController {
52
+ unsubscribeAppState = null;
53
+ idleTimer = null;
54
+ graceTimer = null;
55
+ backgroundedAt = null;
56
+ appIsActive = true;
57
+ started = false;
58
+ /** True once the grace timer has fired (or we suspended on long-away resume). */
59
+ suspended = false;
60
+ constructor(deps) {
61
+ this.suspend = deps.suspend;
62
+ this.resume = deps.resume;
63
+ this.clearLocalSession = deps.clearLocalSession;
64
+ this.ensureAlive = deps.ensureAlive;
65
+ this.hasActiveSession = deps.hasActiveSession;
66
+ this.scheduler = deps.scheduler ?? defaultScheduler;
67
+ this.now = deps.now ?? (() => Date.now());
68
+ this.suspendGraceMs = deps.suspendGraceMs ?? SUSPEND_GRACE_MS;
69
+ this.getCurrentAppState = deps.getCurrentAppState ?? (() => _reactNative.AppState.currentState);
70
+ this.subscribeAppState = deps.subscribeAppState ?? defaultSubscribeAppState;
71
+ }
72
+ start() {
73
+ if (this.started) return;
74
+ this.started = true;
75
+ this.appIsActive = this.getCurrentAppState() === 'active';
76
+ this.unsubscribeAppState = this.subscribeAppState(status => {
77
+ this.handleAppStateChange(status);
78
+ });
79
+ if (this.appIsActive) {
80
+ this.scheduleIdleTimer();
81
+ }
82
+ }
83
+ stop() {
84
+ if (!this.started) return;
85
+ this.started = false;
86
+ this.clearIdleTimer();
87
+ this.clearGraceTimer();
88
+ this.unsubscribeAppState?.();
89
+ this.unsubscribeAppState = null;
90
+ this.backgroundedAt = null;
91
+ this.suspended = false;
92
+ }
93
+
94
+ /**
95
+ * Signal user/SDK activity while the app is foregrounded. Resets the idle
96
+ * timer and reconnects if the socket was idle-suspended.
97
+ */
98
+ reportActivity() {
99
+ if (!this.started || !this.appIsActive) return;
100
+ this.resume();
101
+ this.suspended = false;
102
+ this.scheduleIdleTimer();
103
+ }
104
+
105
+ /** Visible for tests. */
106
+ handleAppStateChange(status) {
107
+ if (!this.started) return;
108
+ if (status === 'active') {
109
+ this.onForeground();
110
+ return;
111
+ }
112
+ if (status === 'background' || status === 'inactive') {
113
+ this.onBackground();
114
+ }
115
+ }
116
+ onBackground() {
117
+ // Already leaving (e.g. inactive → background): keep first timestamp; do not
118
+ // re-arm the grace timer.
119
+ if (!this.appIsActive && this.backgroundedAt != null) {
120
+ return;
121
+ }
122
+ if (this.appIsActive) {
123
+ this.backgroundedAt = this.now();
124
+ } else if (this.backgroundedAt == null) {
125
+ this.backgroundedAt = this.now();
126
+ }
127
+ this.appIsActive = false;
128
+ this.clearIdleTimer();
129
+ this.scheduleGraceTimer();
130
+ }
131
+ onForeground() {
132
+ const awayMs = this.backgroundedAt != null ? this.now() - this.backgroundedAt : 0;
133
+ this.backgroundedAt = null;
134
+ this.appIsActive = true;
135
+ this.clearGraceTimer();
136
+ if (awayMs < this.suspendGraceMs) {
137
+ // Transient blur / quick switch. If already idle-suspended, resume —
138
+ // ensureAlive is a no-op while the transport is lifecycle-suspended.
139
+ // Otherwise probe liveness so a silently-dead socket recovers fast.
140
+ if (this.suspended) {
141
+ this.resume();
142
+ this.suspended = false;
143
+ } else {
144
+ this.ensureAlive();
145
+ }
146
+ this.scheduleIdleTimer();
147
+ return;
148
+ }
149
+
150
+ // Away past grace: ensure a clean suspend (covers iOS freezing JS before
151
+ // the grace timer fired) then resume. Clear mid-flow session if stale.
152
+ if (!this.suspended) {
153
+ this.suspend();
154
+ this.suspended = true;
155
+ }
156
+ if (awayMs >= SESSION_STALE_AFTER_BACKGROUND_MS) {
157
+ this.clearLocalSession();
158
+ }
159
+ this.resume();
160
+ this.suspended = false;
161
+ this.scheduleIdleTimer();
162
+ }
163
+ scheduleGraceTimer() {
164
+ this.clearGraceTimer();
165
+ this.graceTimer = this.scheduler.setTimeout(() => {
166
+ this.graceTimer = null;
167
+ if (this.appIsActive) return;
168
+ if (this.suspended) return;
169
+ this.suspend();
170
+ this.suspended = true;
171
+ }, this.suspendGraceMs);
172
+ }
173
+ clearGraceTimer() {
174
+ if (this.graceTimer != null) {
175
+ this.scheduler.clearTimeout(this.graceTimer);
176
+ this.graceTimer = null;
177
+ }
178
+ }
179
+ scheduleIdleTimer() {
180
+ this.clearIdleTimer();
181
+ this.idleTimer = this.scheduler.setTimeout(() => {
182
+ this.idleTimer = null;
183
+ if (!this.appIsActive) return;
184
+ if (this.hasActiveSession()) {
185
+ this.scheduleIdleTimer();
186
+ return;
187
+ }
188
+ this.suspend();
189
+ this.suspended = true;
190
+ }, INACTIVITY_TIMEOUT_MS);
191
+ }
192
+ clearIdleTimer() {
193
+ if (this.idleTimer != null) {
194
+ this.scheduler.clearTimeout(this.idleTimer);
195
+ this.idleTimer = null;
196
+ }
197
+ }
198
+ }
199
+ exports.LifecycleController = LifecycleController;
200
+ //# sourceMappingURL=lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","INACTIVITY_TIMEOUT_MS","exports","SESSION_STALE_AFTER_BACKGROUND_MS","SUSPEND_GRACE_MS","defaultScheduler","setTimeout","handler","ms","clearTimeout","handle","defaultSubscribeAppState","subscription","AppState","addEventListener","remove","LifecycleController","unsubscribeAppState","idleTimer","graceTimer","backgroundedAt","appIsActive","started","suspended","constructor","deps","suspend","resume","clearLocalSession","ensureAlive","hasActiveSession","scheduler","now","Date","suspendGraceMs","getCurrentAppState","currentState","subscribeAppState","start","status","handleAppStateChange","scheduleIdleTimer","stop","clearIdleTimer","clearGraceTimer","reportActivity","onForeground","onBackground","scheduleGraceTimer","awayMs"],"sourceRoot":"../../src","sources":["lifecycle.ts"],"mappings":";;;;;;AAkBA,IAAAA,YAAA,GAAAC,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACO,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAElD;AACO,MAAME,iCAAiC,GAAAD,OAAA,CAAAC,iCAAA,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAE9D;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,GAAAF,OAAA,CAAAE,gBAAA,GAAG,KAAK;AAgCrC,MAAMC,gBAAoC,GAAG;EAC3CC,UAAU,EAAEA,CAACC,OAAO,EAAEC,EAAE,KAAKF,UAAU,CAACC,OAAO,EAAEC,EAAE,CAAC;EACpDC,YAAY,EAAGC,MAAM,IAAKD,YAAY,CAACC,MAAM;AAC/C,CAAC;AAED,SAASC,wBAAwBA,CAACJ,OAAyC,EAAc;EACvF,MAAMK,YAAqC,GAAGC,qBAAQ,CAACC,gBAAgB,CAAC,QAAQ,EAAEP,OAAO,CAAC;EAC1F,OAAO,MAAMK,YAAY,CAACG,MAAM,CAAC,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,CAAC;EAYvBC,mBAAmB,GAAwB,IA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AI,CAACE,WAAW,EAAE;MACtB,IAAI,IAAI,CAACE,SAAS,EAAE;MACpB,IAAI,CAACG,OAAO,CAAC,CAAC;MACd,IAAI,CAACH,SAAS,GAAG,IAAI;IACvB,CAAC,EAAE,IAAI,CAACW,cAAc,CAAC;EACzB;EAEQU,eAAeA,CAAA,EAAS;IAC9B,IAAI,IAAI,CAACzB,UAAU,IAAI,IAAI,EAAE;MAC3B,IAAI,CAACY,SAAS,CAACtB,YAAY,CAAC,IAAI,CAACU,UAAU,CAAC;MAC5C,IAAI,CAACA,UAAU,GAAG,IAAI;IACxB;EACF;EAEQsB,iBAAiBA,CAAA,EAAS;IAChC,IAAI,CAACE,cAAc,CAAC,CAAC;IACrB,IAAI,CAACzB,SAAS,GAAG,IAAI,CAACa,SAAS,CAACzB,UAAU,CAAC,MAAM;MAC/C,IAAI,CAACY,SAAS,GAAG,IAAI;MACrB,IAAI,CAAC,IAAI,CAACG,WAAW,EAAE;MACvB,IAAI,IAAI,CAACS,gBAAgB,CAAC,CAAC,EAAE;QAC3B,IAAI,CAACW,iBAAiB,CAAC,CAAC;QACxB;MACF;MACA,IAAI,CAACf,OAAO,CAAC,CAAC;MACd,IAAI,CAACH,SAAS,GAAG,IAAI;IACvB,CAAC,EAAEtB,qBAAqB,CAAC;EAC3B;EAEQ0C,cAAcA,CAAA,EAAS;IAC7B,IAAI,IAAI,CAACzB,SAAS,IAAI,IAAI,EAAE;MAC1B,IAAI,CAACa,SAAS,CAACtB,YAAY,CAAC,IAAI,CAACS,SAAS,CAAC;MAC3C,IAAI,CAACA,SAAS,GAAG,IAAI;IACvB;EACF;AACF;AAAChB,OAAA,CAAAc,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WithUserflowReactNavigation = WithUserflowReactNavigation;
7
+ var _native = require("@react-navigation/native");
8
+ var _react = require("react");
9
+ var _screenTracker = require("../screenTracker.js");
10
+ var _chainCallbacks = require("./chainCallbacks.js");
11
+ var _getActiveRouteName = require("./getActiveRouteName.js");
12
+ var _openFlowNavigateUrl = require("./openFlowNavigateUrl.js");
13
+ function assignRef(ref, value) {
14
+ if (typeof ref === 'function') {
15
+ ref(value);
16
+ } else if (ref != null && typeof ref === 'object' && 'current' in ref) {
17
+ ref.current = value;
18
+ }
19
+ }
20
+ function mergeRefs(...refs) {
21
+ return value => {
22
+ for (const ref of refs) {
23
+ assignRef(ref, value);
24
+ }
25
+ };
26
+ }
27
+
28
+ /**
29
+ * Wraps a React Navigation `NavigationContainer` to report screen changes to
30
+ * Userflow after {@link Userflow.init} has completed.
31
+ *
32
+ * Also registers the container ref for in-app NAVIGATE actions (path-like URLs).
33
+ * Screen tracking ≠ action routing — without this wrapper, NAVIGATE falls back to
34
+ * Linking / host `onNavigate`.
35
+ */
36
+ function WithUserflowReactNavigation({
37
+ children
38
+ }) {
39
+ const navigationRef = (0, _native.useNavigationContainerRef)();
40
+ (0, _react.useEffect)(() => {
41
+ (0, _openFlowNavigateUrl.setReactNavigationRef)(navigationRef);
42
+ return () => {
43
+ (0, _openFlowNavigateUrl.setReactNavigationRef)(null);
44
+ };
45
+ }, [navigationRef]);
46
+ const handleReady = (0, _react.useCallback)(() => {
47
+ (0, _openFlowNavigateUrl.setReactNavigationRef)(navigationRef);
48
+ const name = (0, _getActiveRouteName.getActiveRouteName)(navigationRef.getRootState());
49
+ (0, _screenTracker.handleScreenChange)(name ? {
50
+ screen: name
51
+ } : undefined);
52
+ }, [navigationRef]);
53
+ const handleStateChange = (0, _react.useCallback)(state => {
54
+ const name = (0, _getActiveRouteName.getActiveRouteName)(state ?? navigationRef.getRootState());
55
+ (0, _screenTracker.handleScreenChange)(name ? {
56
+ screen: name
57
+ } : undefined);
58
+ }, [navigationRef]);
59
+ if (! /*#__PURE__*/(0, _react.isValidElement)(children)) {
60
+ throw new Error('WithUserflowReactNavigation expects a single React element child.');
61
+ }
62
+ const childProps = children.props;
63
+ return /*#__PURE__*/(0, _react.cloneElement)(children, {
64
+ ref: mergeRefs(childProps.ref, navigationRef),
65
+ onReady: (0, _chainCallbacks.chainCallbacks)(childProps.onReady, handleReady) ?? handleReady,
66
+ onStateChange: (0, _chainCallbacks.chainCallbacks)(childProps.onStateChange, handleStateChange) ?? handleStateChange
67
+ });
68
+ }
69
+ //# sourceMappingURL=WithUserflowReactNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_native","require","_react","_screenTracker","_chainCallbacks","_getActiveRouteName","_openFlowNavigateUrl","assignRef","ref","value","current","mergeRefs","refs","WithUserflowReactNavigation","children","navigationRef","useNavigationContainerRef","useEffect","setReactNavigationRef","handleReady","useCallback","name","getActiveRouteName","getRootState","handleScreenChange","screen","undefined","handleStateChange","state","isValidElement","Error","childProps","props","cloneElement","onReady","chainCallbacks","onStateChange"],"sourceRoot":"../../../src","sources":["navigation/WithUserflowReactNavigation.tsx"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAYA,SAASM,SAASA,CAAIC,GAA6B,EAAEC,KAAe,EAAQ;EAC1E,IAAI,OAAOD,GAAG,KAAK,UAAU,EAAE;IAC7BA,GAAG,CAACC,KAAK,CAAC;EACZ,CAAC,MAAM,IAAID,GAAG,IAAI,IAAI,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAIA,GAAG,EAAE;IACpEA,GAAG,CAAsCE,OAAO,GAAGD,KAAK;EAC3D;AACF;AAEA,SAASE,SAASA,CAAI,GAAGC,IAAqC,EAAwB;EACpF,OAAQH,KAAK,IAAK;IAChB,KAAK,MAAMD,GAAG,IAAII,IAAI,EAAE;MACtBL,SAAS,CAACC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,UAAU,CAACvB,GAAG,EAAEO,aAAa,CAAC;IAC7CmB,OAAO,EAAE,IAAAC,8BAAc,EAACJ,UAAU,CAACG,OAAO,EAAEf,WAAW,CAAC,IAAIA,WAAW;IACvEiB,aAAa,EAAE,IAAAD,8BAAc,EAACJ,UAAU,CAACK,aAAa,EAAET,iBAAiB,CAAC,IAAIA;EAChF,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.chainCallbacks = chainCallbacks;
7
+ /** Runs two optional callbacks in sequence, forwarding the same arguments. */
8
+ function chainCallbacks(first, second) {
9
+ if (!first) return second;
10
+ if (!second) return first;
11
+ return (...args) => {
12
+ first(...args);
13
+ second(...args);
14
+ };
15
+ }
16
+ //# sourceMappingURL=chainCallbacks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chainCallbacks","first","second","args"],"sourceRoot":"../../../src","sources":["navigation/chainCallbacks.ts"],"mappings":";;;;;;AAAA;AACO,SAASA,cAAcA,CAC5BC,KAAyC,EACzCC,MAA0C,EACN;EACpC,IAAI,CAACD,KAAK,EAAE,OAAOC,MAAM;EACzB,IAAI,CAACA,MAAM,EAAE,OAAOD,KAAK;EACzB,OAAO,CAAC,GAAGE,IAAO,KAAK;IACrBF,KAAK,CAAC,GAAGE,IAAI,CAAC;IACdD,MAAM,CAAC,GAAGC,IAAI,CAAC;EACjB,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getActiveRouteName = getActiveRouteName;
7
+ /** Returns the deepest active route name from a React Navigation state tree. */
8
+ function getActiveRouteName(state) {
9
+ if (!state) return undefined;
10
+ const index = state.index ?? 0;
11
+ const route = state.routes[index];
12
+ if (!route) return undefined;
13
+ if (route.state) {
14
+ return getActiveRouteName(route.state);
15
+ }
16
+ return route.name;
17
+ }
18
+ //# sourceMappingURL=getActiveRouteName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getActiveRouteName","state","undefined","index","route","routes","name"],"sourceRoot":"../../../src","sources":["navigation/getActiveRouteName.ts"],"mappings":";;;;;;AAIA;AACO,SAASA,kBAAkBA,CAACC,KAAgC,EAAsB;EACvF,IAAI,CAACA,KAAK,EAAE,OAAOC,SAAS;EAE5B,MAAMC,KAAK,GAAGF,KAAK,CAACE,KAAK,IAAI,CAAC;EAC9B,MAAMC,KAAK,GAAGH,KAAK,CAACI,MAAM,CAACF,KAAK,CAAC;EACjC,IAAI,CAACC,KAAK,EAAE,OAAOF,SAAS;EAE5B,IAAIE,KAAK,CAACH,KAAK,EAAE;IACf,OAAOD,kBAAkB,CAACI,KAAK,CAACH,KAAK,CAAC;EACxC;EAEA,OAAOG,KAAK,CAACE,IAAI;AACnB","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "WithUserflowReactNavigation", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _WithUserflowReactNavigation.WithUserflowReactNavigation;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "isExternalNavigateUrl", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _openFlowNavigateUrl.isExternalNavigateUrl;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "isInAppNavigateUrl", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _openFlowNavigateUrl.isInAppNavigateUrl;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "openFlowNavigateUrl", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _openFlowNavigateUrl.openFlowNavigateUrl;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "setExpoRouterNavigator", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _openFlowNavigateUrl.setExpoRouterNavigator;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "setHostOnNavigate", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _openFlowNavigateUrl.setHostOnNavigate;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "setReactNavigationRef", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _openFlowNavigateUrl.setReactNavigationRef;
46
+ }
47
+ });
48
+ var _WithUserflowReactNavigation = require("./WithUserflowReactNavigation.js");
49
+ var _openFlowNavigateUrl = require("./openFlowNavigateUrl.js");
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_WithUserflowReactNavigation","require","_openFlowNavigateUrl"],"sourceRoot":"../../../src","sources":["navigation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isExternalNavigateUrl = isExternalNavigateUrl;
7
+ exports.isInAppNavigateUrl = isInAppNavigateUrl;
8
+ exports.openFlowNavigateUrl = openFlowNavigateUrl;
9
+ exports.resetFlowNavigateRegistryForTests = resetFlowNavigateRegistryForTests;
10
+ exports.setExpoRouterNavigator = setExpoRouterNavigator;
11
+ exports.setHostOnNavigate = setHostOnNavigate;
12
+ exports.setReactNavigationRef = setReactNavigationRef;
13
+ var _reactNative = require("react-native");
14
+ var _openSafeUrl = require("../content/openSafeUrl.js");
15
+ let hostOnNavigate = null;
16
+ let navigationRef = null;
17
+ let expoRouter = null;
18
+
19
+ /** Optional host escape hatch — wins over router / Linking when set. */
20
+ function setHostOnNavigate(handler) {
21
+ hostOnNavigate = handler ?? null;
22
+ }
23
+
24
+ /** Register the React Navigation container used by {@link WithUserflowReactNavigation}. */
25
+ function setReactNavigationRef(ref) {
26
+ navigationRef = ref ?? null;
27
+ }
28
+
29
+ /** Register Expo Router push for path-like NAVIGATE actions. */
30
+ function setExpoRouterNavigator(router) {
31
+ expoRouter = router ?? null;
32
+ }
33
+
34
+ /** True for http(s) / mailto / tel (external). */
35
+ function isExternalNavigateUrl(url) {
36
+ return (0, _openSafeUrl.isSafeUrl)(url);
37
+ }
38
+
39
+ /** Path-like in-app URL: leading slash, or no scheme. */
40
+ function isInAppNavigateUrl(url) {
41
+ const trimmed = url.trim();
42
+ if (!trimmed) return false;
43
+ if (isExternalNavigateUrl(trimmed)) return false;
44
+ if (/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return false;
45
+ return true;
46
+ }
47
+ function normalizeInAppPath(url) {
48
+ const trimmed = url.trim();
49
+ if (trimmed.startsWith('/')) return trimmed;
50
+ return `/${trimmed}`;
51
+ }
52
+ function routeNameFromPath(path) {
53
+ const normalized = normalizeInAppPath(path).replace(/^\//, '');
54
+ const [first] = normalized.split(/[/?#]/);
55
+ return first || normalized;
56
+ }
57
+
58
+ /**
59
+ * Open a flow NAVIGATE url.
60
+ *
61
+ * Priority:
62
+ * 1. Host `onNavigate` (custom schemes / exotic routing)
63
+ * 2. External allowlisted schemes → Linking / `openSafeUrl`
64
+ * 3. Path-like → Expo Router `push` or React Navigation `navigate`
65
+ * 4. Fallback → Linking (best-effort)
66
+ *
67
+ * Note: screen tracking ≠ action routing. React Navigation hosts must wrap with
68
+ * `WithUserflowReactNavigation` for in-app NAVIGATE; Expo Router apps get a
69
+ * navigator handle when the host mounts `UserflowExpoRouterScreenTracker` from
70
+ * `@userflow-tech/react-native/expo-router` under `UserflowProvider`.
71
+ */
72
+ async function openFlowNavigateUrl(url) {
73
+ const trimmed = url.trim();
74
+ if (!trimmed) return;
75
+ if (hostOnNavigate) {
76
+ await hostOnNavigate(trimmed);
77
+ return;
78
+ }
79
+ if (isExternalNavigateUrl(trimmed)) {
80
+ await (0, _openSafeUrl.openSafeUrl)(trimmed);
81
+ return;
82
+ }
83
+ if (isInAppNavigateUrl(trimmed)) {
84
+ if (expoRouter) {
85
+ expoRouter.push(normalizeInAppPath(trimmed));
86
+ return;
87
+ }
88
+ if (navigationRef?.isReady()) {
89
+ const name = routeNameFromPath(trimmed);
90
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- route names are host-defined
91
+ navigationRef.navigate(name);
92
+ return;
93
+ }
94
+ }
95
+
96
+ // Last resort — may fail for custom schemes; hosts should set onNavigate.
97
+ try {
98
+ await _reactNative.Linking.openURL(trimmed);
99
+ } catch {
100
+ // Best-effort.
101
+ }
102
+ }
103
+
104
+ /** @internal */
105
+ function resetFlowNavigateRegistryForTests() {
106
+ hostOnNavigate = null;
107
+ navigationRef = null;
108
+ expoRouter = null;
109
+ }
110
+ //# sourceMappingURL=openFlowNavigateUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_openSafeUrl","hostOnNavigate","navigationRef","expoRouter","setHostOnNavigate","handler","setReactNavigationRef","ref","setExpoRouterNavigator","router","isExternalNavigateUrl","url","isSafeUrl","isInAppNavigateUrl","trimmed","trim","test","normalizeInAppPath","startsWith","routeNameFromPath","path","normalized","replace","first","split","openFlowNavigateUrl","openSafeUrl","push","isReady","name","navigate","Linking","openURL","resetFlowNavigateRegistryForTests"],"sourceRoot":"../../../src","sources":["navigation/openFlowNavigateUrl.ts"],"mappings":";;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAIE,cAA0C,GAAG,IAAI;AACrD,IAAIC,aAA2D,GAAG,IAAI;AACtE,IAAIC,UAAiC,GAAG,IAAI;;AAE5C;AACO,SAASC,iBAAiBA,CAACC,OAA+C,EAAQ;EACvFJ,cAAc,GAAGI,OAAO,IAAI,IAAI;AAClC;;AAEA;AACO,SAASC,qBAAqBA,CACnCC,GAA6D,EACvD;EACNL,aAAa,GAAGK,GAAG,IAAI,IAAI;AAC7B;;AAEA;AACO,SAASC,sBAAsBA,CA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AE;IAClC,MAAM,IAAAY,wBAAW,EAACZ,OAAO,CAAC;IAC1B;EACF;EAEA,IAAID,kBAAkB,CAACC,OAAO,CAAC,EAAE;IAC/B,IAAIX,UAAU,EAAE;MACdA,UAAU,CAACwB,IAAI,CAACV,kBAAkB,CAACH,OAAO,CAAC,CAAC;MAC5C;IACF;IACA,IAAIZ,aAAa,EAAE0B,OAAO,CAAC,CAAC,EAAE;MAC5B,MAAMC,IAAI,GAAGV,iBAAiB,CAACL,OAAO,CAAC;MACvC;MACCZ,aAAa,CAA2C4B,QAAQ,CAACD,IAAW,CAAC;MAC9E;IACF;EACF;;EAEA;EACA,IAAI;IACF,MAAME,oBAAO,CAACC,OAAO,CAAClB,OAAO,CAAC;EAChC,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ;;AAEA;AACO,SAASmB,iCAAiCA,CAAA,EAAS;EACxDhC,cAAc,GAAG,IAAI;EACrBC,aAAa,GAAG,IAAI;EACpBC,UAAU,GAAG,IAAI;AACnB","ignoreList":[]}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NetworkController = void 0;
7
+ /**
8
+ * Network reachability → eager liveness check (optional enhancement).
9
+ *
10
+ * When connectivity returns while the app is foregrounded (and the transport is
11
+ * not suspended), call {@link NetworkControllerDeps.ensureAlive} so we do not
12
+ * wait for the adaptive heartbeat / foreground probe to notice the drop.
13
+ * `ensureAlive` probes a still-open (possibly half-dead) socket and reconnects
14
+ * eagerly when the transport is already dropped — covering both cases.
15
+ *
16
+ * This is layered on top of a complete zero-dependency recovery path (socket
17
+ * close → reconnect ladder, adaptive heartbeat, and the foreground liveness
18
+ * probe). `@react-native-community/netinfo` is therefore an *optional* peer: when
19
+ * present it makes offline→online recovery fast; when absent the baseline still
20
+ * recovers within a few seconds of the next beat / foreground return.
21
+ */
22
+
23
+ function isOnline(status) {
24
+ return status.isConnected === true && status.isInternetReachable !== false;
25
+ }
26
+ function defaultSubscribe(handler) {
27
+ // Lazy require so the SDK works without the optional peer. When installed,
28
+ // NetInfo makes offline→online reconnect fast; when absent the transport's
29
+ // adaptive heartbeat + foreground probe still recover the connection.
30
+ try {
31
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- optional peer at import time
32
+ const NetInfo = require('@react-native-community/netinfo');
33
+ return NetInfo.addEventListener(state => {
34
+ handler({
35
+ isConnected: state.isConnected,
36
+ isInternetReachable: state.isInternetReachable
37
+ });
38
+ });
39
+ } catch {
40
+ if (__DEV__) {
41
+ // eslint-disable-next-line no-console -- intentional missing-optional-peer diagnostic
42
+ console.warn('[Userflow] Optional peer @react-native-community/netinfo is not installed; ' + 'skipping instant network-aware reconnect. Connection recovery still works ' + 'via the adaptive heartbeat and foreground liveness probe.');
43
+ }
44
+ return () => {};
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Owns the NetInfo subscription. Call {@link start} from `Userflow.init` and
50
+ * {@link stop} from `Userflow.teardown`.
51
+ */
52
+ class NetworkController {
53
+ unsubscribe = null;
54
+ started = false;
55
+ wasOnline = null;
56
+ constructor(deps) {
57
+ this.ensureAlive = deps.ensureAlive;
58
+ this.subscribe = deps.subscribe ?? defaultSubscribe;
59
+ }
60
+ start() {
61
+ if (this.started) return;
62
+ this.started = true;
63
+ this.unsubscribe = this.subscribe(status => {
64
+ this.handleStatus(status);
65
+ });
66
+ }
67
+ stop() {
68
+ if (!this.started) return;
69
+ this.started = false;
70
+ this.unsubscribe?.();
71
+ this.unsubscribe = null;
72
+ this.wasOnline = null;
73
+ }
74
+
75
+ /** Visible for tests. */
76
+ handleStatus(status) {
77
+ if (!this.started) return;
78
+ const online = isOnline(status);
79
+ const previous = this.wasOnline;
80
+ this.wasOnline = online;
81
+
82
+ // First sample only seeds state — do not reconnect on start.
83
+ if (previous === null) return;
84
+ if (!previous && online) {
85
+ this.ensureAlive();
86
+ }
87
+ }
88
+ }
89
+ exports.NetworkController = NetworkController;
90
+ //# sourceMappingURL=network.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isOnline","status","isConnected","isInternetReachable","defaultSubscribe","handler","NetInfo","require","addEventListener","state","__DEV__","console","warn","NetworkController","unsubscribe","started","wasOnline","constructor","deps","ensureAlive","subscribe","start","handleStatus","stop","online","previous","exports"],"sourceRoot":"../../src","sources":["network.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,SAASA,QAAQA,CAACC,MAAqB,EAAW;EAChD,OAAOA,MAAM,CAACC,WAAW,KAAK,IAAI,IAAID,MAAM,CAACE,mBAAmB,KAAK,KAAK;AAC5E;AAEA,SAASC,gBAAgBA,CAACC,OAAwC,EAAc;EAC9E;EACA;EACA;EACA,IAAI;IACF;IACA,MAAMC,OAAO,GAAGC,OAAO,CAAC,iCAAiC,CAOxD;IACD,OAAOD,OAAO,CAACE,gBAAgB,CAAEC,KAAK,IAAK;MACzCJ,OAAO,CAAC;QACNH,WAAW,EAAEO,KAAK,CAACP,WAAW;QAC9BC,mBAAmB,EAAEM,KAAK,CAACN;MAC7B,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN,IAAIO,OAAO,EAAE;MACX;MACAC,OAAO,CAACC,IAAI,CACV,6EAA6E,GAC3E,4EAA4E,GAC5E,2DACJ,CAAC;IACH;IACA,OAAO,MAAM,CAAC,CAAC;EACjB;AACF;;AAEA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,CAAC;EAIrBC,WAAW,GAAwB,IAAI;EACvCC,OAAO,GAAG,KAAK;EACfC,SAAS,GAAmB,IAAI;EAExCC,WAAWA,CAACC,IAA2B,EAAE;IACvC,IAAI,CAACC,WAAW,GAAGD,IAAI,CAACC,WAAW;IACnC,IAAI,CAACC,SAAS,GAAGF,IAAI,CAACE,SAAS,IAAIhB,gBAAgB;EACrD;EAEAiB,KAAKA,CAAA,EA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