@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,286 @@
1
+ "use strict";
2
+
3
+ import { DEFAULT_PAIRING_ENDPOINT, PairingEngine } from '@userflow-tech/core';
4
+ import { AppState, Linking, Platform } from 'react-native';
5
+ import { inspectPairingDeepLink, isPairingAttempt } from "./deepLink.js";
6
+ import { defaultPairingLogger, pairingAttemptRejectionMessage, pairingConnectFailedMessage, pairingLinkDeferredMessage, pairingLinkInitFailedMessage, pairingListenerSetupFailedMessage, pairingTokenStoreClearFailedMessage } from "./diagnostics.js";
7
+ import { createPairingTokenStore } from "./tokenStorage.js";
8
+
9
+ /**
10
+ * Readiness of the end-user session that a preview attaches to.
11
+ *
12
+ * Pairing listens independently of `Userflow.init()` so a QR link is never
13
+ * lost, but it can only connect once init has resolved. `Userflow.init` drives
14
+ * this via `notifyInitStarted` / `notifyInitialized` / `notifyInitFailed`;
15
+ * a controller nobody reports init progress for stays usable (`ready`).
16
+ */
17
+
18
+ /**
19
+ * Inbound deep links → pairing session → preview mode.
20
+ * Active in all builds (including release); security is the short-lived
21
+ * signed pairing JWT + Builder ability checks, not `__DEV__`.
22
+ */
23
+ export class PairingController {
24
+ engine = null;
25
+ started = false;
26
+ urlSub = null;
27
+ appStateSub = null;
28
+ listeners = new Set();
29
+ initPhase = 'ready';
30
+ initFailureReason = null;
31
+ /** Pairing token captured before init resolved, replayed once it does. */
32
+ deferredPairingToken = null;
33
+ /** Diagnostics already emitted for the current init attempt. */
34
+ loggedOnce = new Set();
35
+ constructor(options) {
36
+ this.core = options.core;
37
+ this.pairingEndpoint = options.pairingEndpoint ?? DEFAULT_PAIRING_ENDPOINT;
38
+ this.tokenStore = options.tokenStore ?? createPairingTokenStore();
39
+ this.LinkingModule = options.LinkingModule ?? Linking;
40
+ this.AppStateModule = options.AppStateModule ?? AppState;
41
+ this.clearLocalSession = options.clearLocalSession ?? undefined;
42
+ this.logger = options.logger ?? defaultPairingLogger;
43
+ }
44
+ getEngine() {
45
+ return this.engine;
46
+ }
47
+
48
+ /** Whether deep-link / AppState listeners have been started. */
49
+ hasStarted() {
50
+ return this.started;
51
+ }
52
+ getState() {
53
+ const blocked = this.blockedState();
54
+ if (blocked) return blocked;
55
+ return this.engine?.getState() ?? {
56
+ status: 'idle',
57
+ pairingId: null,
58
+ deviceId: null,
59
+ previewActive: false,
60
+ lastError: null,
61
+ needsRescan: false,
62
+ awaitingStartCondition: false
63
+ };
64
+ }
65
+
66
+ /**
67
+ * State for a link we captured but cannot act on because init failed. Without
68
+ * this the host app shows no sign that a pairing link was ever received.
69
+ */
70
+ blockedState() {
71
+ if (this.initPhase !== 'failed' || this.deferredPairingToken === null) return null;
72
+ return {
73
+ status: 'error',
74
+ pairingId: null,
75
+ deviceId: null,
76
+ previewActive: false,
77
+ lastError: `Userflow.init() failed, so preview could not start: ${this.initFailureReason ?? 'unknown error'}`,
78
+ needsRescan: true,
79
+ awaitingStartCondition: false
80
+ };
81
+ }
82
+ onStateChange(listener) {
83
+ this.listeners.add(listener);
84
+ return () => {
85
+ this.listeners.delete(listener);
86
+ };
87
+ }
88
+
89
+ /**
90
+ * Start deep-link listeners. Safe to call multiple times, and never rejects —
91
+ * `Userflow.init` fires it without awaiting, so a rejection here would become
92
+ * an unhandled promise rejection.
93
+ */
94
+ async start() {
95
+ if (this.started) return;
96
+ this.started = true;
97
+ try {
98
+ await this.startListening();
99
+ } catch (error) {
100
+ this.warnOnce(pairingListenerSetupFailedMessage(describeError(error)));
101
+ }
102
+ }
103
+ async startListening() {
104
+ // Exit pairing on app restart: drop any leftover secure token. Guarded so a
105
+ // storage failure cannot cost us the listeners registered below — losing
106
+ // those is what makes an inbound QR link vanish without explanation.
107
+ try {
108
+ await this.tokenStore.clear();
109
+ } catch (error) {
110
+ this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
111
+ }
112
+ this.ensureEngine();
113
+ this.urlSub = this.LinkingModule.addEventListener('url', ({
114
+ url
115
+ }) => {
116
+ // handleUrl still rejects for explicit callers (Userflow.handlePairingUrl);
117
+ // the auto-listener has nowhere to report, so log instead of leaving an
118
+ // unhandled rejection.
119
+ void this.handleUrl(url).catch(error => {
120
+ this.warnOnce(pairingConnectFailedMessage(describeError(error)));
121
+ });
122
+ });
123
+ this.appStateSub = this.AppStateModule.addEventListener('change', next => {
124
+ if (next === 'active') {
125
+ this.engine?.ensureAlive();
126
+ }
127
+ });
128
+ try {
129
+ const initial = await this.LinkingModule.getInitialURL();
130
+ if (initial) await this.handleUrl(initial);
131
+ } catch {
132
+ // Linking may throw on some platforms before the native module is ready.
133
+ }
134
+ }
135
+ stop() {
136
+ this.urlSub?.remove();
137
+ this.urlSub = null;
138
+ this.appStateSub?.remove();
139
+ this.appStateSub = null;
140
+ this.started = false;
141
+ void this.exitPreview();
142
+ }
143
+
144
+ /**
145
+ * Host apps that intercept deep links themselves can forward them here.
146
+ */
147
+ async handleUrl(url) {
148
+ const inspected = inspectPairingDeepLink(url);
149
+ if (!inspected.ok) {
150
+ // Links that are not recognisably ours belong to the host app. Stay silent
151
+ // so ordinary deep links — and preview links, which accept any
152
+ // `userflow-*` scheme — are never reported as pairing misconfiguration.
153
+ if (!isPairingAttempt(inspected.reason)) return false;
154
+
155
+ // A deliberate pairing attempt we cannot use. The OS already launched the
156
+ // app, so a silent return is indistinguishable from a broken deep link.
157
+ // Still return true — the URL was recognised as pairing, so the host
158
+ // should stop routing it (see docs/deep-linking.md).
159
+ this.warnOnce(pairingAttemptRejectionMessage(inspected.reason, url));
160
+ return true;
161
+ }
162
+ if (this.initPhase !== 'ready') {
163
+ // Hold the token rather than discarding it. `notifyInitialized` replays it;
164
+ // `notifyInitFailed` turns it into visible state.
165
+ this.deferredPairingToken = inspected.link.pairingToken;
166
+ this.warnOnce(this.initPhase === 'failed' ? pairingLinkInitFailedMessage(this.initFailureReason ?? 'unknown error') : pairingLinkDeferredMessage());
167
+ if (this.initPhase === 'failed') this.emit(this.getState());
168
+ return true;
169
+ }
170
+ await this.enterPreview(inspected.link.pairingToken);
171
+ return true;
172
+ }
173
+
174
+ /**
175
+ * Called when `Userflow.init()` begins. Clears a previous failure so a retried
176
+ * init does not keep reporting the old error.
177
+ */
178
+ notifyInitStarted() {
179
+ // A retry is a fresh attempt: allow its diagnostics through again, and drop
180
+ // a "Preview unavailable" banner that no longer reflects reality.
181
+ const wasBlocked = this.blockedState() !== null;
182
+ this.initPhase = 'pending';
183
+ this.initFailureReason = null;
184
+ this.loggedOnce.clear();
185
+ if (wasBlocked) this.emit(this.getState());
186
+ }
187
+
188
+ /**
189
+ * Called when `Userflow.init()` resolves. Connects a link that arrived while
190
+ * init was still in flight.
191
+ */
192
+ async notifyInitialized() {
193
+ this.initPhase = 'ready';
194
+ this.initFailureReason = null;
195
+ const deferred = this.deferredPairingToken;
196
+ if (deferred === null) return;
197
+ this.deferredPairingToken = null;
198
+ try {
199
+ await this.enterPreview(deferred);
200
+ } catch (error) {
201
+ // Preview must not fail host init. `Userflow.init` awaits this, and
202
+ // PairingEngine.start rethrows on every connect failure, so letting this
203
+ // escape would let an expired QR token fail the host app's entire init.
204
+ this.warnOnce(pairingConnectFailedMessage(describeError(error)));
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Called when `Userflow.init()` rejects. Pairing cannot connect without a
210
+ * session, so surface why instead of failing silently.
211
+ */
212
+ notifyInitFailed(error) {
213
+ this.initPhase = 'failed';
214
+ this.initFailureReason = describeError(error);
215
+ if (this.deferredPairingToken !== null) {
216
+ this.warnOnce(pairingLinkInitFailedMessage(this.initFailureReason));
217
+ this.emit(this.getState());
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Log `message` at most once per init attempt. Inbound links can repeat (URL
223
+ * event plus host forwarding), and these messages are several lines long.
224
+ */
225
+ warnOnce(message) {
226
+ if (this.loggedOnce.has(message)) return;
227
+ this.loggedOnce.add(message);
228
+ this.logger(message);
229
+ }
230
+
231
+ /** Explicit entry with a raw pairing JWT (tests / advanced hosts). */
232
+ async enterPreview(pairingToken) {
233
+ const engine = this.ensureEngine();
234
+ await this.tokenStore.set(pairingToken);
235
+ await engine.start(pairingToken);
236
+ }
237
+ async exitPreview() {
238
+ // Drop any held link too, so dismissing a blocked banner actually clears it.
239
+ this.deferredPairingToken = null;
240
+ await this.tokenStore.clear();
241
+ this.engine?.stop();
242
+ this.clearLocalSession?.();
243
+ this.emit(this.getState());
244
+ }
245
+
246
+ /** Flush queued startFlowWithToken after identify. */
247
+ notifyIdentified() {
248
+ this.engine?.notifyIdentified();
249
+ }
250
+ ensureEngine() {
251
+ if (this.engine) return this.engine;
252
+ this.engine = new PairingEngine({
253
+ sendClientMessage: message => this.core.send(message),
254
+ onServerMessage: handler => this.core.onServerMessage(handler),
255
+ isIdentified: () => this.core.getUserId() != null,
256
+ pairingOptions: {
257
+ pairingEndpoint: this.pairingEndpoint
258
+ },
259
+ deviceMeta: () => ({
260
+ os: Platform.OS
261
+ })
262
+ });
263
+ this.engine.onStateChange(state => {
264
+ this.emit(state);
265
+ if (state.status === 'token_expired' || state.needsRescan) {
266
+ void this.tokenStore.clear();
267
+ }
268
+ });
269
+ return this.engine;
270
+ }
271
+ emit(state) {
272
+ for (const listener of this.listeners) {
273
+ try {
274
+ listener(state);
275
+ } catch {
276
+ // ignore
277
+ }
278
+ }
279
+ }
280
+ }
281
+ function describeError(error) {
282
+ if (error instanceof Error) return error.message;
283
+ if (typeof error === 'string') return error;
284
+ return String(error);
285
+ }
286
+ //# sourceMappingURL=PairingController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DEFAULT_PAIRING_ENDPOINT","PairingEngine","AppState","Linking","Platform","inspectPairingDeepLink","isPairingAttempt","defaultPairingLogger","pairingAttemptRejectionMessage","pairingConnectFailedMessage","pairingLinkDeferredMessage","pairingLinkInitFailedMessage","pairingListenerSetupFailedMessage","pairingTokenStoreClearFailedMessage","createPairingTokenStore","PairingController","engine","started","urlSub","appStateSub","listeners","Set","initPhase","initFailureReason","deferredPairingToken","loggedOnce","constructor","options","core","pairingEndpoint","tokenStore","LinkingModule","AppStateModule","clearLocalSession","undefined","logger","getEngine","hasStarted","getState","blocked","blockedState","status","pairingId","deviceId","previewActive","lastError","needsRescan","awaitingStartCondition","onStateChange","listener","add","delete","start","startListening","error","warnOnce","describeError","clear","ensureEngine","addEventListener","url","handleUrl","catch","next","ensureAlive","initial","getInitialURL","stop","remove","exitPreview","inspected","ok","reason","link","pairingToken","emit","enterPreview","notifyInitStarted","wasBlocked","notifyInitialized","deferred","notifyInitFailed","message","has","set","notifyIdentified","sendClientMessage","send","onServerMessage","handler","isIdentified","getUserId","pairingOptions","deviceMeta","os","OS","state","Error","String"],"sourceRoot":"../../../src","sources":["pairing/PairingController.ts"],"mappings":";;AAAA,SACEA,wBAAwB,EACxBC,aAAa,QAGR,qBAAqB;AAC5B,SAASC,QAAQ,EAAuBC,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAE/E,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ,eAAY;AACrE,SACEC,oBAAoB,EACpBC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,iCAAiC,EACjCC,mCAAmC,QAE9B,kBAAe;AACtB,SAASC,uBAAuB,QAAgC,mBAAgB;;AAIhF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,CAAC;EACrBC,MAAM,GAAyB,IAAI;EACnCC,OAAO,GAAG,KAAK;EACfC,MAAM,GAA8B,IAAI;EACxCC,WAAW,GAA8B,IAAI;EACpCC,SAAS,GAAG,IAAIC,GAAG,CAA4B,CAAC;EAQzDC,SAAS,GAAc,OAAO;EAC9BC,iBAAiB,GAAkB,IAAI;EAC/C;EACQC,oBAAoB,GAAkB,IAAI;EAClD;EACiBC,UAAU,GAAG,IAAIJ,GAAG,CAAS,CAAC;EAE/CK,WAAWA,CAACC,OAAiC,EAAE;IAC7C,IAAI,CAACC,IAAI,GAAGD,OAAO,CAACC,IAAI;IACxB,IAAI,CAACC,eAAe,GAAGF,OAAO,CAACE,eAAe,IAAI7B,wBAAwB;IAC1E,IAAI,CAAC8B,UAAU,GAAGH,OAAO,CAACG,UAAU,IAAIh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View } from 'react-native';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ /**
7
+ * Overlay chrome for Builder pairing preview mode.
8
+ */
9
+ export function PreviewModeBanner({
10
+ state,
11
+ onExit
12
+ }) {
13
+ if (!state.previewActive && state.status === 'idle') return null;
14
+ if (!state.previewActive && state.status !== 'token_expired' && state.status !== 'device_already_paired' && state.status !== 'error') {
15
+ return null;
16
+ }
17
+ const needsRescan = state.needsRescan;
18
+ // No pairing id means the session never started (e.g. init failed), so
19
+ // "Pairing ended" would misdescribe it.
20
+ const neverPaired = state.status === 'error' && !state.previewActive && state.pairingId === null;
21
+ const title = neverPaired ? 'Preview unavailable' : needsRescan ? 'Pairing ended' : 'Preview mode';
22
+ const detail = state.lastError ?? (state.status === 'reconnecting' ? 'Reconnecting…' : state.status === 'connecting' ? 'Connecting to Builder…' :
23
+ // Mirrors the Builder's own wording. Without this the banner reads
24
+ // "Paired" while the flow is absent, which looks like a broken preview
25
+ // rather than a condition that has not matched yet.
26
+ state.awaitingStartCondition ? 'Waiting for auto-start condition to trigger…' : 'Paired with Userflow Builder');
27
+ return /*#__PURE__*/_jsx(View, {
28
+ style: styles.wrap,
29
+ pointerEvents: "box-none",
30
+ children: /*#__PURE__*/_jsxs(View, {
31
+ style: [styles.banner, needsRescan ? styles.bannerWarn : styles.bannerActive],
32
+ children: [/*#__PURE__*/_jsxs(View, {
33
+ style: styles.textCol,
34
+ children: [/*#__PURE__*/_jsx(Text, {
35
+ style: styles.title,
36
+ children: title
37
+ }), /*#__PURE__*/_jsx(Text, {
38
+ style: styles.detail,
39
+ numberOfLines: 2,
40
+ children: needsRescan ? `${detail} Re-scan the QR code to continue.` : detail
41
+ })]
42
+ }), !needsRescan ? /*#__PURE__*/_jsx(Pressable, {
43
+ accessibilityRole: "button",
44
+ accessibilityLabel: "Exit preview",
45
+ onPress: onExit,
46
+ style: styles.button,
47
+ children: /*#__PURE__*/_jsx(Text, {
48
+ style: styles.buttonLabel,
49
+ children: "Exit preview"
50
+ })
51
+ }) : /*#__PURE__*/_jsx(Pressable, {
52
+ accessibilityRole: "button",
53
+ accessibilityLabel: "Dismiss pairing message",
54
+ onPress: onExit,
55
+ style: styles.button,
56
+ children: /*#__PURE__*/_jsx(Text, {
57
+ style: styles.buttonLabel,
58
+ children: "Dismiss"
59
+ })
60
+ })]
61
+ })
62
+ });
63
+ }
64
+ const styles = StyleSheet.create({
65
+ wrap: {
66
+ position: 'absolute',
67
+ top: 0,
68
+ left: 0,
69
+ right: 0,
70
+ zIndex: 1000
71
+ },
72
+ banner: {
73
+ marginTop: 48,
74
+ marginHorizontal: 12,
75
+ borderRadius: 10,
76
+ paddingHorizontal: 12,
77
+ paddingVertical: 10,
78
+ flexDirection: 'row',
79
+ alignItems: 'center',
80
+ gap: 10
81
+ },
82
+ bannerActive: {
83
+ backgroundColor: 'rgba(17, 24, 39, 0.92)'
84
+ },
85
+ bannerWarn: {
86
+ backgroundColor: 'rgba(127, 29, 29, 0.94)'
87
+ },
88
+ textCol: {
89
+ flex: 1
90
+ },
91
+ title: {
92
+ color: '#ffffff',
93
+ fontSize: 13,
94
+ fontWeight: '700'
95
+ },
96
+ detail: {
97
+ color: 'rgba(255,255,255,0.85)',
98
+ fontSize: 12,
99
+ marginTop: 2
100
+ },
101
+ button: {
102
+ paddingHorizontal: 10,
103
+ paddingVertical: 8,
104
+ borderRadius: 8,
105
+ backgroundColor: 'rgba(255,255,255,0.14)'
106
+ },
107
+ buttonLabel: {
108
+ color: '#ffffff',
109
+ fontSize: 12,
110
+ fontWeight: '600'
111
+ }
112
+ });
113
+ //# sourceMappingURL=PreviewModeBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Pressable","StyleSheet","Text","View","jsx","_jsx","jsxs","_jsxs","PreviewModeBanner","state","onExit","previewActive","status","needsRescan","neverPaired","pairingId","title","detail","lastError","awaitingStartCondition","style","styles","wrap","pointerEvents","children","banner","bannerWarn","bannerActive","textCol","numberOfLines","accessibilityRole","accessibilityLabel","onPress","button","buttonLabel","create","position","top","left","right","zIndex","marginTop","marginHorizontal","borderRadius","paddingHorizontal","paddingVertical","flexDirection","alignItems","gap","backgroundColor","flex","color","fontSize","fontWeight"],"sourceRoot":"../../../src","sources":["pairing/PreviewModeBanner.tsx"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOjE;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,KAAK;EACLC;AACsB,CAAC,EAA6B;EACpD,IAAI,CAACD,KAAK,CAACE,aAAa,IAAIF,KAAK,CAACG,MAAM,KAAK,MAAM,EAAE,OAAO,IAAI;EAChE,IACE,CAACH,KAAK,CAACE,aAAa,IACpBF,KAAK,CAACG,MAAM,KAAK,eAAe,IAChCH,KAAK,CAACG,MAAM,KAAK,uBAAuB,IACxCH,KAAK,CAACG,MAAM,KAAK,OAAO,EACxB;IACA,OAAO,IAAI;EACb;EAEA,MAAMC,WAAW,GAAGJ,KAAK,CAACI,WAAW;EACrC;EACA;EACA,MAAMC,WAAW,GAAGL,KAAK,CAACG,MAAM,KAAK,OAAO,IAAI,CAACH,KAAK,CAACE,aAAa,IAAIF,KAAK,CAACM,SAAS,KAAK,IAAI;EAChG,MAAMC,KAAK,GAAGF,WAAW,GACrB,qBAAqB,GACrBD,WAAW,GACT,eAAe,GACf,cAAc;EACpB,MAAMI,MAAM,GACVR,KAAK,CAACS,SAAS,KACdT,KAAK,CAACG,MAAM,KAAK,cAAc,GAC5B,eAAe,GACfH,KAAK,CAACG,MAAM,KAAK,YAAY,GAC3B,wBAAwB;EACxB;EACA;EACA;EACAH,KAAK,CAACU,sBAAsB,GAC1B,8CAA8C,GAC9C,8BAA8B,CAAC;EAEzC,oBACEd,IAAA,CAACF,IAAI;I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MAAM,GAAGpB,UAAU,CAACkC,MAAM,CAAC;EAC/Bb,IAAI,EAAE;IACJc,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC;EACDf,MAAM,EAAE;IACNgB,SAAS,EAAE,EAAE;IACbC,gBAAgB,EAAE,EAAE;IACpBC,YAAY,EAAE,EAAE;IAChBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE;EACP,CAAC;EACDrB,YAAY,EAAE;IACZsB,eAAe,EAAE;EACnB,CAAC;EACDvB,UAAU,EAAE;IACVuB,eAAe,EAAE;EACnB,CAAC;EACDrB,OAAO,EAAE;IACPsB,IAAI,EAAE;EACR,CAAC;EACDlC,KAAK,EAAE;IACLmC,KAAK,EAAE,SAAS;IAChBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDpC,MAAM,EAAE;IACNkC,KAAK,EAAE,wBAAwB;IAC/BC,QAAQ,EAAE,EAAE;IACZX,SAAS,EAAE;EACb,CAAC;EACDR,MAAM,EAAE;IACNW,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClBF,YAAY,EAAE,CAAC;IACfM,eAAe,EAAE;EACnB,CAAC;EACDf,WAAW,EAAE;IACXiB,KAAK,EAAE,SAAS;IAChBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Parse Builder pairing deep links:
5
+ * {scheme_id}://?pairing_token=<jwt>
6
+ *
7
+ * `scheme_id` is typically `userflow-<digits>`.
8
+ */
9
+
10
+ /** Scheme prefix shared by preview and pairing links. */
11
+ const USERFLOW_SCHEME_PREFIX = 'userflow-';
12
+ const USERFLOW_SCHEME = /^userflow-\d+$/i;
13
+
14
+ /**
15
+ * Why a URL was not treated as a pairing link.
16
+ *
17
+ * `bad-scheme-shape` and `missing-token` are only reported for URLs that
18
+ * actually target pairing (root with a `pairing_token` query), so callers can
19
+ * tell a misconfigured pairing attempt apart from an unrelated link. See
20
+ * {@link isPairingAttempt}.
21
+ */
22
+
23
+ /**
24
+ * Rejections where the URL was a recognisable pairing attempt that could not be
25
+ * used. These are worth reporting; everything else belongs to the host app.
26
+ */
27
+
28
+ /**
29
+ * True when a rejected URL was nonetheless a recognisable pairing attempt rather
30
+ * than someone else's deep link.
31
+ *
32
+ * Callers use this to decide whether a rejection is worth reporting. Preview
33
+ * links accept any `userflow-*` scheme, so scheme shape alone cannot be the
34
+ * signal — reporting on it would flag valid preview links as broken pairing.
35
+ */
36
+ export function isPairingAttempt(reason) {
37
+ return reason === 'foreign-scheme' || reason === 'bad-scheme-shape' || reason === 'missing-token';
38
+ }
39
+
40
+ /**
41
+ * Parse `url` as a pairing deep link, reporting why it was rejected.
42
+ * Prefer this over {@link parsePairingDeepLink} when the reason matters.
43
+ */
44
+ export function inspectPairingDeepLink(url) {
45
+ if (typeof url !== 'string' || url.length === 0) {
46
+ return {
47
+ ok: false,
48
+ reason: 'not-userflow'
49
+ };
50
+ }
51
+ const schemeMatch = /^([a-z][a-z0-9+.-]*):/i.exec(url);
52
+ if (!schemeMatch?.[1]) return {
53
+ ok: false,
54
+ reason: 'not-userflow'
55
+ };
56
+ const scheme = schemeMatch[1];
57
+ const isUserflowScheme = scheme.toLowerCase().startsWith(USERFLOW_SCHEME_PREFIX);
58
+
59
+ // Parse before judging the scheme: a pairing link opened with the host app's
60
+ // own scheme still needs to be recognisable so it can be reported.
61
+ //
62
+ // Custom schemes are not valid WHATWG URLs on their own. Strip the scheme
63
+ // and re-parse as https. Root forms (`://?…`, `://`) use a placeholder base
64
+ // so the query survives — a bare `https://?…` is an invalid URL.
65
+ const remainder = url.slice(scheme.length + 1).replace(/^\/\//, '');
66
+ let parsed;
67
+ try {
68
+ if (remainder === '' || remainder.startsWith('?') || remainder.startsWith('/')) {
69
+ parsed = new URL(remainder === '' ? '/' : remainder, 'https://userflow.local');
70
+ } else {
71
+ parsed = new URL(`https://${remainder}`);
72
+ }
73
+ } catch {
74
+ return {
75
+ ok: false,
76
+ reason: isUserflowScheme ? 'unparseable' : 'not-userflow'
77
+ };
78
+ }
79
+ const pairingToken = parsed.searchParams.get('pairing_token');
80
+ const hasPairingTokenParam = parsed.searchParams.has('pairing_token');
81
+ const isRoot = (parsed.hostname === '' || parsed.hostname === 'userflow.local') && (parsed.pathname === '' || parsed.pathname === '/');
82
+ // Only the root query form is pairing. A host `/pair` route (or any other
83
+ // path) is left alone even when it carries `pairing_token`.
84
+ const isPair = isRoot && hasPairingTokenParam;
85
+ if (!isUserflowScheme) {
86
+ // Claim a scheme we do not own only when the URL is unmistakably ours: root
87
+ // form *and* our query parameter. That combination means someone swapped
88
+ // the environment's scheme_id for the app's own scheme.
89
+ return isPair ? {
90
+ ok: false,
91
+ reason: 'foreign-scheme'
92
+ } : {
93
+ ok: false,
94
+ reason: 'not-userflow'
95
+ };
96
+ }
97
+ if (!isPair) return {
98
+ ok: false,
99
+ reason: 'not-pair-path'
100
+ };
101
+
102
+ // Only once the URL is known to target pairing does the scheme shape matter.
103
+ // Checking it earlier would misreport preview links on non-numeric schemes.
104
+ if (!USERFLOW_SCHEME.test(scheme)) return {
105
+ ok: false,
106
+ reason: 'bad-scheme-shape'
107
+ };
108
+ if (!pairingToken) return {
109
+ ok: false,
110
+ reason: 'missing-token'
111
+ };
112
+ return {
113
+ ok: true,
114
+ link: {
115
+ scheme,
116
+ pairingToken
117
+ }
118
+ };
119
+ }
120
+
121
+ /**
122
+ * Returns pairing token details when `url` is a Userflow pairing deep link.
123
+ * Accepts only `userflow-*` schemes.
124
+ */
125
+ export function parsePairingDeepLink(url) {
126
+ const result = inspectPairingDeepLink(url);
127
+ return result.ok ? result.link : null;
128
+ }
129
+
130
+ /** True when the URL looks like a Userflow pairing deep link. */
131
+ export function isUserflowPairingUrl(url) {
132
+ return parsePairingDeepLink(url) != null;
133
+ }
134
+ //# sourceMappingURL=deepLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["USERFLOW_SCHEME_PREFIX","USERFLOW_SCHEME","isPairingAttempt","reason","inspectPairingDeepLink","url","length","ok","schemeMatch","exec","scheme","isUserflowScheme","toLowerCase","startsWith","remainder","slice","replace","parsed","URL","pairingToken","searchParams","get","hasPairingTokenParam","has","isRoot","hostname","pathname","isPair","test","link","parsePairingDeepLink","result","isUserflowPairingUrl"],"sourceRoot":"../../../src","sources":["pairing/deepLink.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA,MAAMA,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,eAAe,GAAG,iBAAiB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,MAAgC,EACG;EACnC,OAAOA,MAAM,KAAK,gBAAgB,IAAIA,MAAM,KAAK,kBAAkB,IAAIA,MAAM,KAAK,eAAe;AACnG;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,GAA8B,EAAyB;EAC5F,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACC,MAAM,KAAK,CAAC,EAAE;IAC/C,OAAO;MAAEC,EAAE,EAAE,KAAK;MAAEJ,MAAM,EAAE;IAAe,CAAC;EAC9C;EAEA,MAAMK,WAAW,GAAG,wBAAwB,CAACC,IAAI,CAACJ,GAAG,CAAC;EACtD,IAAI,CAACG,WAAW,GAAG,CAAC,CAAC,EAAE,OAAO;IAAED,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAe,CAAC;EACnE,MAAMO,MAAM,GAAGF,WAAW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AE,EAAE,KAAK;MAAEJ,MAAM,EAAE;IAAiB,CAAC,GAAG;MAAEI,EAAE,EAAE,KAAK;MAAEJ,MAAM,EAAE;IAAe,CAAC;EACjG;EAEA,IAAI,CAACwB,MAAM,EAAE,OAAO;IAAEpB,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAgB,CAAC;;EAE1D;EACA;EACA,IAAI,CAACF,eAAe,CAAC2B,IAAI,CAAClB,MAAM,CAAC,EAAE,OAAO;IAAEH,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAmB,CAAC;EAEnF,IAAI,CAACgB,YAAY,EAAE,OAAO;IAAEZ,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAgB,CAAC;EAEhE,OAAO;IAAEI,EAAE,EAAE,IAAI;IAAEsB,IAAI,EAAE;MAAEnB,MAAM;MAAES;IAAa;EAAE,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASW,oBAAoBA,CAACzB,GAA8B,EAA0B;EAC3F,MAAM0B,MAAM,GAAG3B,sBAAsB,CAACC,GAAG,CAAC;EAC1C,OAAO0B,MAAM,CAACxB,EAAE,GAAGwB,MAAM,CAACF,IAAI,GAAG,IAAI;AACvC;;AAEA;AACA,OAAO,SAASG,oBAAoBA,CAAC3B,GAA8B,EAAW;EAC5E,OAAOyB,oBAAoB,CAACzB,GAAG,CAAC,IAAI,IAAI;AAC1C","ignoreList":[]}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Diagnostics for Builder pairing deep links.
5
+ *
6
+ * Pairing failures are unusually easy to miss. The URL scheme is registered in
7
+ * the native project at build time, so the OS launches the host app from a
8
+ * Builder QR code whether or not the SDK is listening. When the SDK then drops
9
+ * the link, the app looks like it simply "opened and did nothing".
10
+ *
11
+ * Every drop path routes through a message below so the reason is visible.
12
+ */
13
+
14
+ const PREFIX = '[Userflow]';
15
+
16
+ /**
17
+ * Hide the pairing token before a URL reaches the console. It is a bearer
18
+ * credential for the pairing session, and these messages are printed verbatim.
19
+ */
20
+ function redactPairingToken(url) {
21
+ return url.replace(/(pairing_token=)[^&]+/i, '$1<redacted>');
22
+ }
23
+
24
+ /** Sink for pairing diagnostics. Injected in tests. */
25
+
26
+ /**
27
+ * Default logger. Pairing links only ever arrive from a deliberate developer
28
+ * action (scanning or opening a Builder QR code), so these warn unconditionally
29
+ * rather than behind `__DEV__` — a swallowed pairing link is otherwise
30
+ * undiagnosable, and this cannot fire for real end users.
31
+ */
32
+ export const defaultPairingLogger = message => {
33
+ // eslint-disable-next-line no-console -- intentional pairing diagnostic
34
+ console.warn(message);
35
+ };
36
+
37
+ /** A pairing link arrived while `Userflow.init()` was still in flight. */
38
+ export function pairingLinkDeferredMessage() {
39
+ return `${PREFIX} Builder pairing link received before Userflow.init() finished. ` + `Holding it and will connect as soon as init resolves.`;
40
+ }
41
+
42
+ /**
43
+ * A pairing link arrived but `Userflow.init()` rejected, so there is no session
44
+ * to attach the preview to.
45
+ */
46
+ export function pairingLinkInitFailedMessage(reason) {
47
+ return `${PREFIX} Builder pairing link received, but Userflow.init() failed so pairing ` + `cannot start: ${reason}. Fix the init error — most often an invalid clientToken ` + `or an unreachable serverEndpoint — then re-open the pairing link.`;
48
+ }
49
+
50
+ /**
51
+ * Pairing was reachable but the connection itself failed (expired token, device
52
+ * already paired, backend unreachable). Never fatal to the host app.
53
+ */
54
+ export function pairingConnectFailedMessage(reason) {
55
+ return `${PREFIX} Builder pairing could not connect: ${reason}. The app is unaffected — ` + `re-open the pairing link from the Builder to try again.`;
56
+ }
57
+
58
+ /** A pairing link arrived without the `pairing_token` query parameter. */
59
+ export function pairingMissingTokenMessage(url) {
60
+ return `${PREFIX} Ignoring Builder pairing link "${redactPairingToken(url)}": no ` + `"pairing_token" query parameter. Open the link straight from the Builder QR ` + `code rather than reconstructing it by hand.`;
61
+ }
62
+
63
+ /**
64
+ * A pairing link arrived on a scheme Userflow does not own — almost always the
65
+ * host app's own scheme substituted for the environment's `scheme_id`.
66
+ */
67
+ export function pairingForeignSchemeMessage(url) {
68
+ return `${PREFIX} Ignoring "${redactPairingToken(url)}": this is a Builder pairing ` + `link, but it was opened with a scheme Userflow does not own. Use your ` + `environment's scheme_id ("userflow-" followed by digits) exactly as the ` + `pairing QR code provides it — do not substitute your app's own scheme. ` + `Register it via the @userflow-tech/expo plugin ({ schemeId: 'userflow-…' }) and ` + `rebuild the native app; a Metro reload is not enough.`;
69
+ }
70
+
71
+ /** Message for a pairing attempt that could not be used. */
72
+ export function pairingAttemptRejectionMessage(reason, url) {
73
+ switch (reason) {
74
+ case 'foreign-scheme':
75
+ return pairingForeignSchemeMessage(url);
76
+ case 'bad-scheme-shape':
77
+ return pairingSchemeShapeMessage(url);
78
+ case 'missing-token':
79
+ return pairingMissingTokenMessage(url);
80
+ }
81
+ }
82
+
83
+ /** Clearing the persisted pairing token failed. Best-effort, never fatal. */
84
+ export function pairingTokenStoreClearFailedMessage(reason) {
85
+ return `${PREFIX} Could not clear the stored pairing token: ${reason}. Continuing — ` + `a stale preview may survive an app restart until you exit preview manually.`;
86
+ }
87
+
88
+ /** Attaching the deep-link listeners failed, which disables pairing entirely. */
89
+ export function pairingListenerSetupFailedMessage(reason) {
90
+ return `${PREFIX} Could not start Builder pairing listeners: ${reason}. Pairing deep ` + `links will be ignored for this session; the rest of the SDK is unaffected.`;
91
+ }
92
+
93
+ /**
94
+ * The URL used a `userflow-` scheme that is not a valid `scheme_id`. Pairing
95
+ * requires `userflow-` followed by digits, so an arbitrary `userflow-*` scheme
96
+ * can match preview links but not pairing ones.
97
+ */
98
+ export function pairingSchemeShapeMessage(url) {
99
+ return `${PREFIX} Ignoring Builder pairing link "${redactPairingToken(url)}": the scheme must be your ` + `environment's scheme_id — "userflow-" followed by digits (e.g. userflow-257587). ` + `Check the schemeId passed to the @userflow-tech/expo plugin.`;
100
+ }
101
+ //# sourceMappingURL=diagnostics.js.map