@userflow-tech/react-native 0.4.4 → 0.5.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 (431) hide show
  1. package/README.md +124 -34
  2. package/docs/anchoring.md +6 -1
  3. package/docs/deep-linking.md +26 -0
  4. package/docs/troubleshooting.md +50 -23
  5. package/expo-plugin/hostDependencyWarnings.d.ts +6 -4
  6. package/expo-plugin/hostDependencyWarnings.d.ts.map +1 -1
  7. package/expo-plugin/hostDependencyWarnings.js +8 -6
  8. package/expo-plugin/hostDependencyWarnings.js.map +1 -1
  9. package/lib/commonjs/anchors/AutoAnchorRegistry.js +144 -34
  10. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  11. package/lib/commonjs/anchors/animationFrame.js +29 -1
  12. package/lib/commonjs/anchors/animationFrame.js.map +1 -1
  13. package/lib/commonjs/anchors/appActive.js +61 -0
  14. package/lib/commonjs/anchors/appActive.js.map +1 -0
  15. package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -8
  16. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  17. package/lib/commonjs/anchors/elementTapMonitor.js +67 -12
  18. package/lib/commonjs/anchors/elementTapMonitor.js.map +1 -1
  19. package/lib/commonjs/anchors/elementTargetMatch.js +33 -7
  20. package/lib/commonjs/anchors/elementTargetMatch.js.map +1 -1
  21. package/lib/commonjs/anchors/fiber/fiberInternals.js +66 -0
  22. package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
  23. package/lib/commonjs/anchors/fiber/indexHostFibers.js +4 -3
  24. package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -1
  25. package/lib/commonjs/anchors/fiber/resolveFiberPath.js +30 -15
  26. package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -1
  27. package/lib/commonjs/anchors/fiberAnchorCache.js +20 -0
  28. package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -1
  29. package/lib/commonjs/anchors/gestureHandlerHandoff.js +304 -0
  30. package/lib/commonjs/anchors/gestureHandlerHandoff.js.map +1 -0
  31. package/lib/commonjs/anchors/resolveAnchorHost.js +6 -0
  32. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  33. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +11 -6
  34. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
  35. package/lib/commonjs/anchors/resolveElementTargets.js +63 -8
  36. package/lib/commonjs/anchors/resolveElementTargets.js.map +1 -1
  37. package/lib/commonjs/anchors/semanticMatcher.js +43 -21
  38. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
  39. package/lib/commonjs/anchors/tapSlop.js +16 -0
  40. package/lib/commonjs/anchors/tapSlop.js.map +1 -0
  41. package/lib/commonjs/anchors/targetPressMonitor.js +66 -12
  42. package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -1
  43. package/lib/commonjs/authoring/fingerprintFromInstance.js +5 -9
  44. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
  45. package/lib/commonjs/content/RichContentRenderer.js +3 -3
  46. package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
  47. package/lib/commonjs/content/openSafeUrl.js +3 -1
  48. package/lib/commonjs/content/openSafeUrl.js.map +1 -1
  49. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +6 -0
  50. package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
  51. package/lib/commonjs/index.js +19 -5
  52. package/lib/commonjs/index.js.map +1 -1
  53. package/lib/commonjs/installCheck.js +2 -2
  54. package/lib/commonjs/installCheck.js.map +1 -1
  55. package/lib/commonjs/navigation/navigateUrlUtils.js +105 -0
  56. package/lib/commonjs/navigation/navigateUrlUtils.js.map +1 -0
  57. package/lib/commonjs/navigation/openExternalNavigateUrl.js +14 -0
  58. package/lib/commonjs/navigation/openExternalNavigateUrl.js.map +1 -0
  59. package/lib/commonjs/navigation/openFlowNavigateUrl.js +47 -41
  60. package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
  61. package/lib/commonjs/pairing/PairingController.js +3 -1
  62. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  63. package/lib/commonjs/runtime/BannerHost.js +38 -29
  64. package/lib/commonjs/runtime/BannerHost.js.map +1 -1
  65. package/lib/commonjs/runtime/TargetPressBridge.js +55 -7
  66. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  67. package/lib/commonjs/runtime/UserflowOverlay.js +5 -11
  68. package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -1
  69. package/lib/commonjs/runtime/UserflowProvider.js +66 -40
  70. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  71. package/lib/commonjs/runtime/bannerEngine.js +8 -2
  72. package/lib/commonjs/runtime/bannerEngine.js.map +1 -1
  73. package/lib/commonjs/runtime/bannerFlowSpacer.js +71 -0
  74. package/lib/commonjs/runtime/bannerFlowSpacer.js.map +1 -0
  75. package/lib/commonjs/runtime/flowEngine.js +11 -0
  76. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  77. package/lib/commonjs/runtime/previewStart.js +39 -0
  78. package/lib/commonjs/runtime/previewStart.js.map +1 -0
  79. package/lib/commonjs/runtime/pushBannerLayoutContext.js +98 -0
  80. package/lib/commonjs/runtime/pushBannerLayoutContext.js.map +1 -0
  81. package/lib/commonjs/screenTracker.js +12 -0
  82. package/lib/commonjs/screenTracker.js.map +1 -1
  83. package/lib/commonjs/surfaces/BannerBar.js +79 -61
  84. package/lib/commonjs/surfaces/BannerBar.js.map +1 -1
  85. package/lib/commonjs/surfaces/BannerSurface.js +26 -0
  86. package/lib/commonjs/surfaces/BannerSurface.js.map +1 -1
  87. package/lib/commonjs/surfaces/TooltipSurface.js +43 -41
  88. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  89. package/lib/commonjs/surfaces/bannerBarLayout.js +77 -10
  90. package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -1
  91. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +112 -63
  92. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
  93. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +59 -11
  94. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
  95. package/lib/commonjs/surfaces/hostAccessibilityTrap.js +28 -0
  96. package/lib/commonjs/surfaces/hostAccessibilityTrap.js.map +1 -0
  97. package/lib/commonjs/surfaces/resolveBannerTheme.js +6 -3
  98. package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -1
  99. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +3 -2
  100. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
  101. package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js +134 -0
  102. package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
  103. package/lib/commonjs/version.js +1 -1
  104. package/lib/module/anchors/AutoAnchorRegistry.js +145 -35
  105. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  106. package/lib/module/anchors/animationFrame.js +29 -2
  107. package/lib/module/anchors/animationFrame.js.map +1 -1
  108. package/lib/module/anchors/appActive.js +57 -0
  109. package/lib/module/anchors/appActive.js.map +1 -0
  110. package/lib/module/anchors/elementConditionEvaluator.js +26 -9
  111. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  112. package/lib/module/anchors/elementTapMonitor.js +67 -12
  113. package/lib/module/anchors/elementTapMonitor.js.map +1 -1
  114. package/lib/module/anchors/elementTargetMatch.js +32 -7
  115. package/lib/module/anchors/elementTargetMatch.js.map +1 -1
  116. package/lib/module/anchors/fiber/fiberInternals.js +65 -0
  117. package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
  118. package/lib/module/anchors/fiber/indexHostFibers.js +4 -3
  119. package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -1
  120. package/lib/module/anchors/fiber/resolveFiberPath.js +30 -15
  121. package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -1
  122. package/lib/module/anchors/fiberAnchorCache.js +19 -0
  123. package/lib/module/anchors/fiberAnchorCache.js.map +1 -1
  124. package/lib/module/anchors/gestureHandlerHandoff.js +298 -0
  125. package/lib/module/anchors/gestureHandlerHandoff.js.map +1 -0
  126. package/lib/module/anchors/resolveAnchorHost.js +1 -0
  127. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  128. package/lib/module/anchors/resolveAutoAnchorHost.js +11 -6
  129. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
  130. package/lib/module/anchors/resolveElementTargets.js +63 -8
  131. package/lib/module/anchors/resolveElementTargets.js.map +1 -1
  132. package/lib/module/anchors/semanticMatcher.js +43 -21
  133. package/lib/module/anchors/semanticMatcher.js.map +1 -1
  134. package/lib/module/anchors/tapSlop.js +11 -0
  135. package/lib/module/anchors/tapSlop.js.map +1 -0
  136. package/lib/module/anchors/targetPressMonitor.js +53 -8
  137. package/lib/module/anchors/targetPressMonitor.js.map +1 -1
  138. package/lib/module/authoring/fingerprintFromInstance.js +6 -10
  139. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
  140. package/lib/module/content/RichContentRenderer.js +3 -3
  141. package/lib/module/content/RichContentRenderer.js.map +1 -1
  142. package/lib/module/content/openSafeUrl.js +3 -1
  143. package/lib/module/content/openSafeUrl.js.map +1 -1
  144. package/lib/module/expo-router/useUserflowExpoRouter.js +7 -1
  145. package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
  146. package/lib/module/index.js +22 -7
  147. package/lib/module/index.js.map +1 -1
  148. package/lib/module/installCheck.js +2 -2
  149. package/lib/module/installCheck.js.map +1 -1
  150. package/lib/module/navigation/navigateUrlUtils.js +94 -0
  151. package/lib/module/navigation/navigateUrlUtils.js.map +1 -0
  152. package/lib/module/navigation/openExternalNavigateUrl.js +11 -0
  153. package/lib/module/navigation/openExternalNavigateUrl.js.map +1 -0
  154. package/lib/module/navigation/openFlowNavigateUrl.js +22 -36
  155. package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
  156. package/lib/module/pairing/PairingController.js +3 -1
  157. package/lib/module/pairing/PairingController.js.map +1 -1
  158. package/lib/module/runtime/BannerHost.js +38 -29
  159. package/lib/module/runtime/BannerHost.js.map +1 -1
  160. package/lib/module/runtime/TargetPressBridge.js +56 -8
  161. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  162. package/lib/module/runtime/UserflowOverlay.js +5 -11
  163. package/lib/module/runtime/UserflowOverlay.js.map +1 -1
  164. package/lib/module/runtime/UserflowProvider.js +66 -40
  165. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  166. package/lib/module/runtime/bannerEngine.js +7 -2
  167. package/lib/module/runtime/bannerEngine.js.map +1 -1
  168. package/lib/module/runtime/bannerFlowSpacer.js +65 -0
  169. package/lib/module/runtime/bannerFlowSpacer.js.map +1 -0
  170. package/lib/module/runtime/flowEngine.js +11 -0
  171. package/lib/module/runtime/flowEngine.js.map +1 -1
  172. package/lib/module/runtime/previewStart.js +35 -0
  173. package/lib/module/runtime/previewStart.js.map +1 -0
  174. package/lib/module/runtime/pushBannerLayoutContext.js +91 -0
  175. package/lib/module/runtime/pushBannerLayoutContext.js.map +1 -0
  176. package/lib/module/screenTracker.js +11 -0
  177. package/lib/module/screenTracker.js.map +1 -1
  178. package/lib/module/surfaces/BannerBar.js +80 -62
  179. package/lib/module/surfaces/BannerBar.js.map +1 -1
  180. package/lib/module/surfaces/BannerSurface.js +26 -0
  181. package/lib/module/surfaces/BannerSurface.js.map +1 -1
  182. package/lib/module/surfaces/TooltipSurface.js +44 -42
  183. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  184. package/lib/module/surfaces/bannerBarLayout.js +72 -11
  185. package/lib/module/surfaces/bannerBarLayout.js.map +1 -1
  186. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +113 -64
  187. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
  188. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +59 -11
  189. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
  190. package/lib/module/surfaces/hostAccessibilityTrap.js +24 -0
  191. package/lib/module/surfaces/hostAccessibilityTrap.js.map +1 -0
  192. package/lib/module/surfaces/resolveBannerTheme.js +6 -3
  193. package/lib/module/surfaces/resolveBannerTheme.js.map +1 -1
  194. package/lib/module/surfaces/tooltip/TooltipBubble.js +3 -2
  195. package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
  196. package/lib/module/surfaces/tooltip/targetSearchSchedule.js +128 -0
  197. package/lib/module/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
  198. package/lib/module/version.js +1 -1
  199. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +36 -2
  200. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  201. package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts +0 -4
  202. package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts.map +1 -1
  203. package/lib/typescript/commonjs/src/anchors/appActive.d.ts +8 -0
  204. package/lib/typescript/commonjs/src/anchors/appActive.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts +17 -0
  206. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts +7 -0
  208. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +7 -0
  210. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  211. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +3 -2
  212. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
  213. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
  214. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
  215. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +5 -0
  216. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -1
  217. package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts +70 -0
  218. package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +1 -0
  220. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
  222. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  223. package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +2 -0
  225. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts +9 -0
  227. package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +13 -8
  229. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -1
  230. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
  232. package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/src/index.d.ts +6 -5
  235. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  236. package/lib/typescript/commonjs/src/installCheck.d.ts +1 -1
  237. package/lib/typescript/commonjs/src/installCheck.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts +15 -0
  239. package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts +3 -0
  241. package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts +2 -5
  243. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +6 -0
  245. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +3 -0
  248. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +5 -1
  252. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts +15 -0
  254. package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
  255. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/src/runtime/previewStart.d.ts +13 -0
  257. package/lib/typescript/commonjs/src/runtime/previewStart.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts +17 -0
  259. package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/src/screenTracker.d.ts +6 -0
  261. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +3 -1
  263. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +5 -1
  265. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +1 -1
  267. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +17 -0
  269. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
  271. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
  274. package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +4 -1
  276. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
  278. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
  280. package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  282. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +36 -2
  283. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  284. package/lib/typescript/module/src/anchors/animationFrame.d.ts +0 -4
  285. package/lib/typescript/module/src/anchors/animationFrame.d.ts.map +1 -1
  286. package/lib/typescript/module/src/anchors/appActive.d.ts +8 -0
  287. package/lib/typescript/module/src/anchors/appActive.d.ts.map +1 -0
  288. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts +17 -0
  289. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts.map +1 -1
  290. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts +7 -0
  291. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts.map +1 -1
  292. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +7 -0
  293. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  294. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +3 -2
  295. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
  296. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
  297. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
  298. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +5 -0
  299. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -1
  300. package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts +70 -0
  301. package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
  302. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +1 -0
  303. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  304. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
  305. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  306. package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts.map +1 -1
  307. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +2 -0
  308. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
  309. package/lib/typescript/module/src/anchors/tapSlop.d.ts +9 -0
  310. package/lib/typescript/module/src/anchors/tapSlop.d.ts.map +1 -0
  311. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +13 -8
  312. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -1
  313. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  314. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
  315. package/lib/typescript/module/src/content/openSafeUrl.d.ts.map +1 -1
  316. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  317. package/lib/typescript/module/src/index.d.ts +6 -5
  318. package/lib/typescript/module/src/index.d.ts.map +1 -1
  319. package/lib/typescript/module/src/installCheck.d.ts +1 -1
  320. package/lib/typescript/module/src/installCheck.d.ts.map +1 -1
  321. package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts +15 -0
  322. package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts.map +1 -0
  323. package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts +3 -0
  324. package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
  325. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts +2 -5
  326. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  327. package/lib/typescript/module/src/pairing/PairingController.d.ts +6 -0
  328. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  329. package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -1
  330. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +3 -0
  331. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  332. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -1
  333. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  334. package/lib/typescript/module/src/runtime/bannerEngine.d.ts +5 -1
  335. package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -1
  336. package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts +15 -0
  337. package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
  338. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  339. package/lib/typescript/module/src/runtime/previewStart.d.ts +13 -0
  340. package/lib/typescript/module/src/runtime/previewStart.d.ts.map +1 -0
  341. package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts +17 -0
  342. package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
  343. package/lib/typescript/module/src/screenTracker.d.ts +6 -0
  344. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  345. package/lib/typescript/module/src/surfaces/BannerBar.d.ts +3 -1
  346. package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -1
  347. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +5 -1
  348. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -1
  349. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +1 -1
  350. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  351. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +17 -0
  352. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -1
  353. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
  354. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
  355. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
  356. package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
  357. package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
  358. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +4 -1
  359. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
  360. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
  361. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  362. package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
  363. package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
  364. package/lib/typescript/module/src/version.d.ts +1 -1
  365. package/package.json +1 -1
  366. package/src/anchors/AutoAnchorRegistry.ts +166 -35
  367. package/src/anchors/animationFrame.ts +31 -1
  368. package/src/anchors/appActive.ts +63 -0
  369. package/src/anchors/elementConditionEvaluator.ts +29 -12
  370. package/src/anchors/elementTapMonitor.ts +68 -10
  371. package/src/anchors/elementTargetMatch.ts +34 -7
  372. package/src/anchors/fiber/fiberInternals.ts +68 -0
  373. package/src/anchors/fiber/indexHostFibers.ts +8 -3
  374. package/src/anchors/fiber/resolveFiberPath.ts +25 -16
  375. package/src/anchors/fiberAnchorCache.ts +19 -0
  376. package/src/anchors/gestureHandlerHandoff.ts +356 -0
  377. package/src/anchors/resolveAnchorHost.ts +2 -0
  378. package/src/anchors/resolveAutoAnchorHost.ts +18 -8
  379. package/src/anchors/resolveElementTargets.ts +64 -7
  380. package/src/anchors/semanticMatcher.ts +48 -27
  381. package/src/anchors/tapSlop.ts +18 -0
  382. package/src/anchors/targetPressMonitor.ts +56 -19
  383. package/src/authoring/fingerprintFromInstance.ts +4 -5
  384. package/src/content/RichContentRenderer.tsx +4 -3
  385. package/src/content/openSafeUrl.ts +3 -1
  386. package/src/expo-router/useUserflowExpoRouter.ts +10 -1
  387. package/src/index.ts +20 -9
  388. package/src/installCheck.ts +4 -4
  389. package/src/navigation/navigateUrlUtils.ts +100 -0
  390. package/src/navigation/openExternalNavigateUrl.ts +9 -0
  391. package/src/navigation/openFlowNavigateUrl.ts +36 -36
  392. package/src/pairing/PairingController.ts +9 -1
  393. package/src/runtime/BannerHost.tsx +41 -23
  394. package/src/runtime/TargetPressBridge.tsx +66 -9
  395. package/src/runtime/UserflowOverlay.tsx +7 -9
  396. package/src/runtime/UserflowProvider.tsx +56 -32
  397. package/src/runtime/bannerEngine.ts +10 -2
  398. package/src/runtime/bannerFlowSpacer.tsx +70 -0
  399. package/src/runtime/flowEngine.ts +11 -0
  400. package/src/runtime/previewStart.ts +49 -0
  401. package/src/runtime/pushBannerLayoutContext.tsx +121 -0
  402. package/src/screenTracker.ts +11 -0
  403. package/src/surfaces/BannerBar.tsx +93 -55
  404. package/src/surfaces/BannerSurface.tsx +59 -3
  405. package/src/surfaces/TooltipSurface.tsx +63 -51
  406. package/src/surfaces/bannerBarLayout.ts +80 -7
  407. package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +149 -57
  408. package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +63 -11
  409. package/src/surfaces/hostAccessibilityTrap.ts +25 -0
  410. package/src/surfaces/resolveBannerTheme.ts +14 -3
  411. package/src/surfaces/tooltip/TooltipBubble.tsx +8 -1
  412. package/src/surfaces/tooltip/targetSearchSchedule.ts +140 -0
  413. package/src/version.ts +1 -1
  414. package/vendor/core/dist/engine/BannerSessionEngine.d.ts +29 -2
  415. package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -1
  416. package/vendor/core/dist/engine/BannerSessionEngine.js +87 -6
  417. package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -1
  418. package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -1
  419. package/vendor/core/dist/engine/ClientConditionEngine.js +30 -7
  420. package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -1
  421. package/vendor/core/dist/engine/PairingEngine.d.ts +6 -1
  422. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  423. package/vendor/core/dist/engine/PairingEngine.js +23 -3
  424. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  425. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  426. package/vendor/core/dist/engine/handleActions.js +67 -2
  427. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  428. package/vendor/core/dist/version.d.ts +1 -1
  429. package/vendor/core/dist/version.js +1 -1
  430. package/vendor/core/package.json +1 -1
  431. package/vendor/protocol/package.json +1 -1
package/README.md CHANGED
@@ -75,7 +75,10 @@ needed with any package manager.
75
75
  ### Packages
76
76
 
77
77
  ```bash
78
- # Expo (dev build)
78
+ # Expo SDK 56–57 (dev build)
79
+ npx expo install @userflow-tech/react-native @react-native-async-storage/async-storage react-native-webview react-native-view-shot
80
+
81
+ # Expo SDK 55 and older (dev build): pin view-shot, see below
79
82
  npx expo install @userflow-tech/react-native @react-native-async-storage/async-storage react-native-webview react-native-view-shot@^5.0.0
80
83
 
81
84
  # Bare React Native
@@ -88,17 +91,27 @@ majors. `react-native-webview` 14 is outside the peer range, and npm only warns
88
91
  `ERESOLVE overriding peer dependency` and installs it anyway. AsyncStorage 3
89
92
  sits next to the SDK's own 2.x copy, which leaves two copies of one native
90
93
  module. `npx expo install` picks Expo's bundled versions, which fit the ranges
91
- on Expo SDK 53–57.
94
+ on Expo SDK 53–57, except view-shot on Expo SDK 55 and older.
92
95
 
93
96
  `react-native-webview` and `react-native-view-shot` (`^5.0.0`) are **required
94
97
  peers**. npm 7+ and pnpm install them. Yarn 1 and
95
98
  `npm install --legacy-peer-deps` do not, so the commands above install them in
96
99
  the app. Both are native modules — rebuild after install (a Metro reload is not
97
- enough). On Expo SDK 55 and older,
98
- unpinned `npx expo install react-native-view-shot` resolves **4.0.3**, which
99
- does not satisfy the peer. Pin `^5.0.0` as in the command above. If the app
100
- already depends on 4.0.3, that same command is what fixes it: installing the
101
- SDK alone fails with
100
+ enough).
101
+
102
+ On Expo SDK 56 and 57, leave view-shot unpinned. Expo's default there (5.1.0)
103
+ satisfies the peer. A `^5.0.0` pin installs the newest 5.x instead, which
104
+ `expo doctor` reports as a version mismatch. To fix an app that already has the
105
+ pin, remove `"react-native-view-shot"` from `expo.install.exclude` if it is
106
+ there, then run `npx expo install react-native-view-shot`. While the exclude is
107
+ set, Expo installs the latest view-shot instead of 5.1.0, and `expo doctor`
108
+ skips the check. Installed with the SDK, npm keeps view-shot on 5.x; installed
109
+ on its own, it can pull 6.x, outside the peer range.
110
+
111
+ On Expo SDK 55 and older, unpinned `npx expo install react-native-view-shot`
112
+ resolves **4.0.3**, which does not satisfy the peer. Pin `^5.0.0` as in the
113
+ command above. If the app already depends on 4.0.3, that same command is what
114
+ fixes it: installing the SDK alone fails with
102
115
 
103
116
  ```text
104
117
  npm error Found: react-native-view-shot@4.0.3
@@ -107,8 +120,9 @@ npm error peer react-native-view-shot@"^5.0.0" from @userflow-tech/react-native
107
120
 
108
121
  Do not retry with `--force` or `--legacy-peer-deps`. That installs the SDK and
109
122
  leaves 4.0.3 in place. If that already happened, `Userflow.init` warns in
110
- development and names the installed version. If `expo doctor`
111
- reports the `^5.0.0` pin, exclude it from Expo's version check:
123
+ development and names the installed version. On Expo SDK 55 and older, also
124
+ exclude view-shot from Expo's version check. Otherwise `expo doctor` reports
125
+ the pin, and `npx expo install --fix` puts 4.0.3 back:
112
126
 
113
127
  ```json
114
128
  {
@@ -120,6 +134,10 @@ reports the `^5.0.0` pin, exclude it from Expo's version check:
120
134
  }
121
135
  ```
122
136
 
137
+ With the exclude set, always install view-shot as
138
+ `react-native-view-shot@^5.0.0`. Unpinned, Expo skips its version, so npm can
139
+ keep 4.0.3 or pull 6.x.
140
+
123
141
  On a bare React Native app, `expo-secure-store` needs Expo modules installed
124
142
  first (`npx install-expo-modules@latest`), then `npx expo install expo-secure-store`.
125
143
 
@@ -133,12 +151,36 @@ npx expo install react-native-safe-area-context @react-native-community/netinfo
133
151
  npm install 'react-native-safe-area-context@<6' '@react-native-community/netinfo@<13'
134
152
  ```
135
153
 
154
+ ### Babel plugin
155
+
156
+ Add `@userflow-tech/react-native/babel-plugin` to `babel.config.js`. It stamps
157
+ `View`, `Text`, `Pressable`, the Touchables, `TextInput`, and `Image` at build
158
+ time, so elements can be targeted without a `testID`. An Expo app without a
159
+ `babel.config.js` can create one with `npx expo customize babel.config.js`.
160
+
161
+ ```js
162
+ // babel.config.js
163
+ module.exports = function (api) {
164
+ api.cache(true);
165
+ return {
166
+ presets: ['babel-preset-expo'], // or the app's existing preset
167
+ plugins: ['@userflow-tech/react-native/babel-plugin'],
168
+ };
169
+ };
170
+ ```
171
+
172
+ Keep the app's own plugins. If it lists `react-native-reanimated/plugin` or
173
+ `react-native-worklets/plugin`, keep that one last. Start Metro once with a
174
+ cleared cache (`npx expo start -c`) so every file is stamped. Apps with Jest
175
+ should read [Babel plugin and snapshot tests](#babel-plugin-and-snapshot-tests).
176
+
136
177
  ### Install with an AI agent
137
178
 
138
- An Agent Skill that installs this SDK in Cursor, Claude Code, and other agents
139
- will be available soon. It will be `install-react-native-with-ai` in
140
- [userflow/ai-skills-library](https://github.com/userflow/ai-skills-library).
141
- Web apps will use `install-with-ai` from that library.
179
+ The `install-userflow-react-native-sdk-with-ai` Agent Skill installs this SDK
180
+ with Cursor, Claude Code, and other agents. It is in
181
+ [userflow/ai-skills-library](https://github.com/userflow/ai-skills-library),
182
+ whose README explains how to add it to your agent. Web apps use
183
+ `install-with-ai` from that library.
142
184
 
143
185
  ## Quick start
144
186
 
@@ -206,6 +248,9 @@ export default function RootLayout() {
206
248
  }
207
249
  ```
208
250
 
251
+ Expo Router apps also add `app/+native-intent.ts`, so Builder pairing links do
252
+ not navigate. See [Builder preview & pairing](#builder-preview--pairing).
253
+
209
254
  React Navigation:
210
255
 
211
256
  ```tsx
@@ -404,10 +449,12 @@ To preview draft flows from the Userflow builder onto a device (QR / deep link):
404
449
  `userflow-v7twv2fw2ja2jaco7kesvowmem` — **not** the env UUID) with the
405
450
  `@userflow-tech/react-native` config plugin, then **rebuild native**
406
451
  (`npx expo prebuild` / a new development client). Metro reload is not enough.
407
- 2. Call `Userflow.init` and wrap the tree in `UserflowProvider`.
408
- 3. Open the builder Preview dialog → **Pair a device** → scan/open the QR. The
452
+ 2. Expo Router only: add `app/+native-intent.ts` (below) so pairing and preview
453
+ links do not navigate.
454
+ 3. Call `Userflow.init` and wrap the tree in `UserflowProvider`.
455
+ 4. Open the builder Preview dialog → **Pair a device** → scan/open the QR. The
409
456
  app should show a **Preview mode** top bar.
410
- 4. Hit **Preview** in the builder. The draft flow lands on that paired device.
457
+ 5. Hit **Preview** in the builder. The draft flow lands on that paired device.
411
458
 
412
459
  ```json
413
460
  {
@@ -422,8 +469,20 @@ To preview draft flows from the Userflow builder onto a device (QR / deep link):
422
469
  `schemeId` is the env's `scheme_id` from the dashboard, copied exactly. It is
423
470
  `userflow-` followed by an opaque id. Do not rely on its shape. Preview links
424
471
  (`…://?token=…`) and pairing links (`…://?pairing_token=…`) both ride that one
425
- scheme. Expo Router needs no extra host files for these root-form URLs, and
426
- pairing works in every build, including release.
472
+ scheme. Pairing works in every build, including release.
473
+
474
+ Expo Router treats these root-form URLs as `/`, so without
475
+ `app/+native-intent.ts` it navigates when a link arrives: the app jumps to its
476
+ home route, or element selection fails with "Can't select this element".
477
+ Re-export the SDK's handler to keep the current screen:
478
+
479
+ ```ts
480
+ // app/+native-intent.ts
481
+ export { redirectSystemPath } from '@userflow-tech/react-native/expo-router';
482
+ ```
483
+
484
+ If the app already has a `+native-intent.ts`, wrap it instead. See
485
+ [docs/deep-linking.md](https://unpkg.com/@userflow-tech/react-native/docs/deep-linking.md).
427
486
 
428
487
  Deep-link / pairing helpers:
429
488
 
@@ -465,12 +524,17 @@ heartbeat or foreground return.
465
524
 
466
525
  ## NAVIGATE actions
467
526
 
468
- Flow NAVIGATE buttons open URLs in this order:
527
+ Flow and banner **Navigate to page** button actions (and in-content links) open
528
+ URLs in this order:
469
529
 
470
530
  1. Host `onNavigate` from `Userflow.init({ onNavigate })` / `Userflow.setOnNavigate` (wins)
471
531
  2. http(s) / mailto / tel → Linking
472
532
  3. Path-like in-app URLs → Expo Router `push` or React Navigation `navigate`
473
- 4. Otherwise best-effort Linking
533
+ 4. Otherwise allowlisted http(s) / mailto / tel via Linking
534
+
535
+ In the builder **Navigate to page** action, use a full URL such as
536
+ `https://example.com` to open the system browser, a React Navigation screen
537
+ name such as `Profile`, or an Expo Router path such as `/settings`.
474
538
 
475
539
  Screen tracking ≠ action routing. React Navigation apps need
476
540
  `WithUserflowReactNavigation` for in-app NAVIGATE. Expo Router apps need
@@ -537,10 +601,10 @@ and forwards URLs itself.
537
601
 
538
602
  ### Subpath exports
539
603
 
540
- | Import | Provides |
541
- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------- |
542
- | `@userflow-tech/react-native/navigation` | `WithUserflowReactNavigation` |
543
- | `@userflow-tech/react-native/expo-router` | `UserflowExpoRouterScreenTracker`, `useUserflowExpoRouter`, `redirectSystemPath` (for `+native-intent`) |
604
+ | Import | Provides |
605
+ | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
606
+ | `@userflow-tech/react-native/navigation` | `WithUserflowReactNavigation` |
607
+ | `@userflow-tech/react-native/expo-router` | `UserflowExpoRouterScreenTracker`, `useUserflowExpoRouter`, `redirectSystemPath` and `createRedirectSystemPath` (for `+native-intent`), `isUserflowLinkPath`, type `RedirectSystemPathOptions` |
544
608
 
545
609
  ## Guides in this package
546
610
 
@@ -568,17 +632,16 @@ These guides also ship in the package, under
568
632
  - Client conditions — `ELEMENT` PRESENT / NOT_PRESENT on manual anchors and
569
633
  AUTO selectors (guarded: weak evidence stays unknown)
570
634
  - Connection lifecycle — suspend/resume, reconnect, optional NetInfo
635
+ - Build-time stamping with `@userflow-tech/react-native/babel-plugin`
636
+ (`stampOnly: true` stamps `nativeID` only; full mode is the default). Jest
637
+ runs the plugin too, which changes snapshots; see
638
+ [Babel plugin and snapshot tests](#babel-plugin-and-snapshot-tests).
571
639
 
572
640
  ### Experimental
573
641
 
574
642
  - AUTO / codeless element targeting (exact-id fast path + scored matcher;
575
643
  scored path needs Babel full mode to populate the auto-anchor registry).
576
644
  See [docs/anchoring.md](https://unpkg.com/@userflow-tech/react-native/docs/anchoring.md).
577
- - Build-time stamping with `@userflow-tech/react-native/babel-plugin`
578
- (`stampOnly: true` stamps `nativeID` only; full mode is the default). Jest
579
- runs the plugin too, which changes snapshots. Read
580
- [Babel plugin and snapshot tests](#babel-plugin-and-snapshot-tests) before
581
- enabling it.
582
645
 
583
646
  ### Not available yet
584
647
 
@@ -602,7 +665,7 @@ missing lines are included):
602
665
  ```text
603
666
  [Userflow] Native setup is incomplete. Flows may not run until you fix the following, then rebuild the app (a Metro reload is not enough):
604
667
  - @react-native-async-storage/async-storage is not linked. Anonymous users and Builder pairing will not persist. Add it to the app package.json (npx expo install @react-native-async-storage/async-storage), run pod install on iOS, and rebuild.
605
- - react-native-view-shot is not linked, so Builder element selection gets no screenshot. Install react-native-view-shot@^5.0.0 and rebuild. On Expo SDK 54, pin ^5.0.0; an unpinned npx expo install resolves 4.0.3.
668
+ - react-native-view-shot is not linked, so Builder element selection gets no screenshot. Install it and rebuild. On Expo SDK 56 and 57, run npx expo install react-native-view-shot unpinned, with no expo.install.exclude entry for it. Otherwise install react-native-view-shot@^5.0.0; on Expo SDK 55 and older, an unpinned npx expo install resolves 4.0.3.
606
669
  - react-native-webview is not linked. Evaluate JavaScript and WebView banners will not run. Install it (npx expo install react-native-webview) and rebuild.
607
670
  - react-native-device-info is not linked, so app_version and app_build are not sent. npm install react-native-device-info, then rebuild.
608
671
  See node_modules/@userflow-tech/react-native/docs/troubleshooting.md.
@@ -666,6 +729,28 @@ jest.mock('@userflow-tech/react-native/navigation', () => ({
666
729
  In a JavaScript setup file, drop the `ReactNode` import and the type
667
730
  annotations.
668
731
 
732
+ If `app/+native-intent.ts` imports `redirectSystemPath` or
733
+ `createRedirectSystemPath`, replace the `@userflow-tech/react-native/expo-router`
734
+ mock above with the one below (in a JavaScript setup file, drop its type
735
+ annotations too). Two `jest.mock` calls for one path do not merge; the later
736
+ one wins. Expo Router loads `+native-intent.ts` when a test renders the
737
+ router, and the mock replaces the whole module, so an export it leaves out is
738
+ `undefined`. A `+native-intent.ts` that calls `createRedirectSystemPath()` then
739
+ fails the suite with `createRedirectSystemPath is not a function`. These stubs
740
+ pass every URL through, as the real handlers do for links that are not Userflow
741
+ links:
742
+
743
+ ```ts
744
+ jest.mock('@userflow-tech/react-native/expo-router', () => ({
745
+ UserflowExpoRouterScreenTracker: () => null,
746
+ redirectSystemPath: ({ path }: { path: string }) => path,
747
+ createRedirectSystemPath:
748
+ ({ next }: { next?: (event: { path: string }) => unknown } = {}) =>
749
+ (event: { path: string }) =>
750
+ next ? next(event) : event.path,
751
+ }));
752
+ ```
753
+
669
754
  A custom Metro config that does not extend `getDefaultConfig` from `expo/metro-config`
670
755
  or `@react-native/metro-config` leaves `allowOptionalDependencies` off. Optional
671
756
  peers that this package loads inside `try/catch` then fail the bundle with
@@ -673,8 +758,8 @@ peers that this package loads inside `try/catch` then fail the bundle with
673
758
 
674
759
  ### Babel plugin and snapshot tests
675
760
 
676
- If you add the optional `@userflow-tech/react-native/babel-plugin` to
677
- `babel.config.js`, Jest runs it too, because `babel-jest` reads the same config.
761
+ With `@userflow-tech/react-native/babel-plugin` in `babel.config.js`, Jest
762
+ runs it too, because `babel-jest` reads the same config.
678
763
  The plugin adds props to `View`, `Text`, `Pressable`, the Touchables,
679
764
  `TextInput`, and `Image`, and React Native's Jest mocks render them, so they
680
765
  appear in snapshots:
@@ -705,7 +790,8 @@ or moving or renaming a file changes them again. The plugin also imports this
705
790
  package into every stamped file, so any test that renders a stamped component
706
791
  loads the SDK. Keep the mock above in the Jest setup file.
707
792
 
708
- Skip the plugin under Jest:
793
+ Skip the plugin under Jest, and keep the app's own plugins in every
794
+ environment:
709
795
 
710
796
  ```js
711
797
  // babel.config.js
@@ -713,7 +799,11 @@ module.exports = function (api) {
713
799
  const isTest = api.env('test');
714
800
  return {
715
801
  presets: ['babel-preset-expo'],
716
- plugins: isTest ? [] : ['@userflow-tech/react-native/babel-plugin'],
802
+ plugins: [
803
+ // ...the app's own plugins
804
+ ...(isTest ? [] : ['@userflow-tech/react-native/babel-plugin']),
805
+ // react-native-reanimated/plugin or react-native-worklets/plugin, if listed, stays last
806
+ ],
717
807
  };
718
808
  };
719
809
  ```
package/docs/anchoring.md CHANGED
@@ -354,7 +354,7 @@ When a tooltip cannot resolve / measure its target:
354
354
 
355
355
  | Behavior | After tolerance |
356
356
  | ---------------- | ------------------------------------------------------------------------------ |
357
- | `FLAG` (default) | Centered “Target not found” card; keeps remeasuring slowly for recovery |
357
+ | `FLAG` (default) | Centered “Target not found” card; keeps looking for the target to recover |
358
358
  | `ERROR` | Same missing UI as `FLAG` |
359
359
  | `BUBBLE` | Centered card with normal step content (modal-like fallback) |
360
360
  | `END` | Hides the flow UI (`null`); in draft/preview mode shows the missing UI instead |
@@ -362,6 +362,11 @@ When a tooltip cannot resolve / measure its target:
362
362
  Ambiguous ids, missing hosts, and zero-width/height measures all count as
363
363
  missing.
364
364
 
365
+ While the target is missing, the SDK keeps looking with a backoff (up to every
366
+ 4 s), looks again right away when the screen changes or the app returns to the
367
+ foreground, and within ~500 ms when a registered element mounts. Nothing runs
368
+ while the app is in the background.
369
+
365
370
  ## ELEMENT client conditions
366
371
 
367
372
  `PRESENT` / `NOT_PRESENT` / `CLICK` / `NOT_CLICK` resolve through
@@ -78,6 +78,32 @@ export const redirectSystemPath = createRedirectSystemPath({
78
78
  });
79
79
  ```
80
80
 
81
+ `next` runs only for links that are not Userflow links. A pairing or preview
82
+ link returns `null` before `next` is called, so host code inside `next` (logging
83
+ incoming URLs, for example) never sees it. If the host must see every URL, run
84
+ its code first, then return the SDK handler's result:
85
+
86
+ ```ts
87
+ import {
88
+ createRedirectSystemPath,
89
+ type RedirectSystemPathOptions,
90
+ } from '@userflow-tech/react-native/expo-router';
91
+
92
+ const userflowRedirectSystemPath = createRedirectSystemPath({
93
+ next: (event) => event.path, // the host's handling of non-Userflow links
94
+ });
95
+
96
+ export function redirectSystemPath(event: RedirectSystemPathOptions) {
97
+ try {
98
+ // Runs for every URL, Userflow links included. Use the app's own logger here.
99
+ console.log('[app] incoming URL', event.path);
100
+ } catch {
101
+ // Expo warns that throwing here can crash the app.
102
+ }
103
+ return userflowRedirectSystemPath(event);
104
+ }
105
+ ```
106
+
81
107
  Bare React Native / React Navigation apps need nothing beyond scheme
82
108
  registration.
83
109
 
@@ -7,23 +7,23 @@ Messages are quoted exactly so you can search logs for them.
7
7
 
8
8
  | Symptom / log message | Likely cause | Fix |
9
9
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10
- | `expo doctor` reports `react-native-view-shot` | The app pins `^5.0.0` and Expo SDK 55 and older expect 4.0.3. | Keep the pin. Add `"react-native-view-shot"` to `expo.install.exclude`. |
10
+ | `expo doctor` reports `react-native-view-shot` | The app pins `^5.0.0`. Expo SDK 55 and older expect 4.0.3. Expo SDK 56 and 57 expect 5.1.0, and the pin installed a newer 5.x. | Expo SDK 55 and older: keep the pin and add `"react-native-view-shot"` to `expo.install.exclude`. Expo SDK 56 and 57: drop the pin, remove `"react-native-view-shot"` from `expo.install.exclude` if it is there, and reinstall with `npx expo install react-native-view-shot`. |
11
11
  | `Unable to resolve module` for an optional peer (`netinfo`, `expo-secure-store`, `expo-router`, safe-area, navigation) | A custom Metro config does not extend `getDefaultConfig`, so `allowOptionalDependencies` is off. | Extend `getDefaultConfig` from `expo/metro-config` or `@react-native/metro-config`. |
12
12
  | `ERESOLVE` while installing `@userflow-tech/react-native` | The app already has a version outside a peer range: view-shot 4.0.3 (what unpinned `npx expo install` installs on Expo SDK 55 and older), NetInfo 9.x, safe-area-context 3.x, WebView 13.6.x or 14.x, or React Native older than 0.76. | Move that package into the range in the package README. For view-shot, npm prints `Found: react-native-view-shot@4.0.3` and `peer react-native-view-shot@"^5.0.0" from @userflow-tech/react-native`. Install the SDK and `react-native-view-shot@^5.0.0` in one command, then add `"react-native-view-shot"` to `expo.install.exclude` on Expo SDK 55 and older. Do not retry with `--force` or `--legacy-peer-deps`; that leaves 4.0.3 installed. Raise React Native to 0.76 or later when that is the conflict. |
13
13
  | `npm warn ERESOLVE overriding peer dependency` naming `react-native-webview`, or `npm ls` lists two versions of `@react-native-async-storage/async-storage` | An unpinned bare install picked WebView 14 (outside `>=13.8.0 <14`) or AsyncStorage 3 (the SDK keeps its own 2.x copy). npm only warns and installs the invalid tree. | Reinstall with the ranges from the bare command in the package README: `'@react-native-async-storage/async-storage@^2'` and `'react-native-webview@>=13.8.0 <14'`. Then run `pod install` and rebuild. |
14
- | Yarn 1 or `npm install --legacy-peer-deps` succeeded, but `react-native-webview` or `react-native-view-shot` is not installed | Those installs do not fetch peers. WebView and view-shot are required peers, not dependencies. | Install `react-native-webview` and `react-native-view-shot@^5.0.0` in the app, then rebuild native. |
14
+ | Yarn 1 or `npm install --legacy-peer-deps` succeeded, but `react-native-webview` or `react-native-view-shot` is not installed | Those installs do not fetch peers. WebView and view-shot are required peers, not dependencies. | Install `react-native-webview` and `react-native-view-shot` in the app (on Expo SDK 56 and 57, `npx expo install react-native-view-shot` unpinned; otherwise `react-native-view-shot@^5.0.0`), then rebuild native. |
15
15
  | Banners, flow cards, or Builder bars draw under the status bar, notch, or home indicator. Development logs `[Userflow] react-native-safe-area-context is not installed, so banners, flow cards, and Builder bars draw under the status bar and home indicator. Install it (npx expo install react-native-safe-area-context) and wrap the app in <SafeAreaProvider>.` | `react-native-safe-area-context` is not installed, so insets are zero. | Install the package and wrap the tree in `<SafeAreaProvider>`. |
16
16
  | `Uncaught Error` / `NativeModule.RNCNetInfo is null` as soon as `Userflow.init` runs | On SDK 0.3.1 and earlier, NetInfo's JavaScript was loaded while its native module was not in the binary. Debug builds show a red screen. Dismissing it leaves the app running; a release build can crash. | Link `@react-native-community/netinfo` and rebuild, or remove it. Current versions skip NetInfo when `RNCNetInfo` is not registered and log one dev warning instead. |
17
17
  | `[@userflow-tech/react-native] schemeId "…" looks like an environment id. Pass the scheme_id value that starts with userflow- (an opaque id from the dashboard), not the environment UUID.` | The config plugin received the environment UUID. | Pass the `scheme_id` (`userflow-…`) from the dashboard. |
18
18
  | `No schemeId was passed, so the plugin left the native config unchanged. Builder preview and pairing links will not open this app. Pass the environment scheme_id (userflow-...) from the Userflow dashboard as the plugin schemeId.` | `expo prebuild` ran the plugin without `schemeId`. | Add `{ "schemeId": "userflow-…" }` and rebuild native. |
19
- | react-native-view-shot is not a direct dependency. Builder element selection needs >=5.0.0. On Expo SDK 54, an unpinned `npx expo install react-native-view-shot` resolves 4.0.3. Pin ^5.0.0. If expo doctor reports a version mismatch, add "react-native-view-shot" to expo.install.exclude. | Prebuild did not find view-shot in the app `package.json`. | `npx expo install react-native-view-shot@^5.0.0` and rebuild. |
19
+ | react-native-view-shot is not a direct dependency. Builder element selection needs >=5.0.0. On Expo SDK 56 and 57, run `npx expo install react-native-view-shot` unpinned, with no expo.install.exclude entry for it. On Expo SDK 55 and older, an unpinned install resolves 4.0.3, so pin ^5.0.0 and add "react-native-view-shot" to expo.install.exclude. | Prebuild did not find view-shot in the app `package.json`. | Expo SDK 56 and 57: `npx expo install react-native-view-shot` (unpinned). Expo SDK 55 and older: `npx expo install react-native-view-shot@^5.0.0` and add `"react-native-view-shot"` to `expo.install.exclude`. Then rebuild. |
20
20
  | `react-native-safe-area-context is not listed in the app package.json. Expo SDK 53 does not autolink native modules that the app only receives indirectly. Without the native module, banners, flow cards, and Builder bars draw under the status bar and home indicator. Install it in the app (npx expo install react-native-safe-area-context) and wrap the app in <SafeAreaProvider>.` | Expo SDK older than 54, and safe-area-context is not a direct dependency, so its native module is not autolinked. | `npx expo install react-native-safe-area-context` and wrap the tree in `<SafeAreaProvider>`. |
21
- | `[Userflow] react-native-view-shot@4.0.3 is older than 5.0.0, so Builder element selection may not get a screenshot.` The installed version is filled in. The warning also says not to retry with `--force` or `--legacy-peer-deps`. | view-shot 4.x is installed, usually because an `ERESOLVE` was retried with `--force` or `--legacy-peer-deps`, or the 4.0.3 default on Expo SDK 55 and older was left in place. | Install `react-native-view-shot@^5.0.0` in the same command as the SDK and rebuild. On Expo SDK 55 and older, add `"react-native-view-shot"` to `expo.install.exclude`. |
22
- | `react-native-view-shot@4.0.3 is older than 5.0.0. Expo SDK 54's default is 4.0.3, which does not work with this SDK. Pin ^5.0.0 and add "react-native-view-shot" to expo.install.exclude if expo doctor complains.` | The app has view-shot 4.x. | Pin `^5.0.0` and rebuild. |
21
+ | `[Userflow] react-native-view-shot@4.0.3 is older than 5.0.0, so Builder element selection may not get a screenshot.` The installed version is filled in. The warning also says not to retry with `--force` or `--legacy-peer-deps`. | view-shot 4.x is installed, usually because an `ERESOLVE` was retried with `--force` or `--legacy-peer-deps`, or the 4.0.3 default on Expo SDK 55 and older was left in place. | Expo SDK 56 and 57: remove any view-shot entry from `expo.install.exclude`, run `npx expo install react-native-view-shot` unpinned, and rebuild. Otherwise install `react-native-view-shot@^5.0.0` in the same command as the SDK and rebuild; on Expo SDK 55 and older, also add `"react-native-view-shot"` to `expo.install.exclude`. |
22
+ | `react-native-view-shot@4.0.3 is older than 5.0.0, which does not work with this SDK. On Expo SDK 56 and 57, run npx expo install react-native-view-shot unpinned, with no expo.install.exclude entry for it. Expo SDK 55 and older default to 4.0.3: pin ^5.0.0 and add "react-native-view-shot" to expo.install.exclude.` | The app has view-shot 4.x. | Expo SDK 56 and 57: `npx expo install react-native-view-shot` (unpinned), then rebuild. Expo SDK 55 and older: pin `^5.0.0`, add the exclude, and rebuild. |
23
23
  | `@react-native-async-storage/async-storage is not listed in the app package.json. Expo SDK 53 does not autolink native modules that the app only receives indirectly. Install it in the app (npx expo install @react-native-async-storage/async-storage) and rebuild.` | Expo SDK older than 54, and AsyncStorage is only a transitive dependency. The WebView line is the same shape with `react-native-webview`. | Install that package in the app and rebuild. |
24
24
  | `[Userflow] Native setup is incomplete. Flows may not run until you fix the following, then rebuild the app (a Metro reload is not enough):` | Dev-only check on the first `Userflow.init`. Following lines name each missing native module. A missing safe-area package is a separate warning, because flows still run. | Install the named packages and rebuild. The footer is `See node_modules/@userflow-tech/react-native/docs/troubleshooting.md.` |
25
25
  | `- @react-native-async-storage/async-storage is not linked. Anonymous users and Builder pairing will not persist. Add it to the app package.json (npx expo install @react-native-async-storage/async-storage), run pod install on iOS, and rebuild.` | AsyncStorage's native module is not in this binary. | Add it to the app `package.json`, run `pod install` on iOS, and rebuild. |
26
- | `- react-native-view-shot is not linked, so Builder element selection gets no screenshot. Install react-native-view-shot@^5.0.0 and rebuild. On Expo SDK 54, pin ^5.0.0; an unpinned npx expo install resolves 4.0.3.` | `RNViewShot` is not registered. | Install `react-native-view-shot@^5.0.0` and rebuild. |
26
+ | `- react-native-view-shot is not linked, so Builder element selection gets no screenshot. Install it and rebuild. On Expo SDK 56 and 57, run npx expo install react-native-view-shot unpinned, with no expo.install.exclude entry for it. Otherwise install react-native-view-shot@^5.0.0; on Expo SDK 55 and older, an unpinned npx expo install resolves 4.0.3.` | `RNViewShot` is not registered. | Expo SDK 56 and 57: `npx expo install react-native-view-shot` (unpinned). Otherwise install `react-native-view-shot@^5.0.0`. Then rebuild. |
27
27
  | `- react-native-webview is not linked. Evaluate JavaScript and WebView banners will not run. Install it (npx expo install react-native-webview) and rebuild.` | The WebView native module is not registered. | Install `react-native-webview` and rebuild. |
28
28
  | `- react-native-device-info is not linked, so app_version and app_build are not sent. npm install react-native-device-info, then rebuild.` | Bare React Native, and `RNDeviceInfo` is not registered. Expo apps that have `expo-constants` do not log this line. | `npm install react-native-device-info` and rebuild. |
29
29
  | `[Userflow] This app is running in Expo Go, which cannot load the SDK native modules. Builder preview links will not open the app. Use a development build (npx expo run:ios / npx expo run:android).` | The app is the Expo Go store client. | Use a development build. |
@@ -78,6 +78,32 @@ evaluated. `DISABLED`, `NOT_DISABLED`, and `MOUSEDOWN` are not.
78
78
  the four supported states, and tag the target with matching `userflowId`,
79
79
  `testID`, or `nativeID` (or `useUserflowAnchor('…')`). See [anchoring.md](anchoring.md).
80
80
 
81
+ ### Click conditions and gesture-handler controls
82
+
83
+ `RectButton`, `BorderlessButton`, `BaseButton`, the older gesture-handler
84
+ touchables, and a `GestureDetector` gesture with `.runOnJS(true)` still count
85
+ as a tap, including when they cancel React Native's touch. A plain React Native
86
+ `Pressable`, including one inside a `Modal`, counts through the normal touch
87
+ stream. A manual id on the view touched at the start of the press still matches
88
+ after that press navigates away, once a live scan no longer finds that id.
89
+
90
+ On-device checks of these controls (iOS 26, Android API 35) saw a normal touch
91
+ end, so that is the path those runs exercised. A control that instead cancels
92
+ the touch is counted when its handler later ends from `ACTIVE`. That hand-off
93
+ is covered by unit tests.
94
+
95
+ These do **not** count. `CLICK` stays false and `NOT_CLICK` stays true:
96
+
97
+ | Control | Why |
98
+ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
99
+ | A scroll in a gesture-handler `ScrollView`, `FlatList`, or `RefreshControl` | Those handlers set `disallowInterruption` and report no finger position, so a scroll must not latch the row it started on. A button inside the container still counts. |
100
+ | A worklet `GestureDetector` gesture that also cancels React Native's touch | The end stays on the UI thread and never arrives as `onGestureHandlerStateChange`. Add `.runOnJS(true)` if you can. A worklet gesture that leaves the touch stream alone still counts through the normal touch end. |
101
+ | The same controls on the old architecture (Paper) | That architecture does not deliver the state-change event this watches. React Native 0.86 is new-architecture only. |
102
+
103
+ A drag that starts on the control, a long press, and a finger that slides off
104
+ it are not taps. A tap in the first half-second after a flow closes can also
105
+ miss: the server has not re-tracked the condition yet.
106
+
81
107
  ### 2. Anchor / tooltip placement
82
108
 
83
109
  | Symptom | Likely cause |
@@ -114,18 +140,18 @@ Id matching: dashboard `#invite-teammates` ↔ `userflowId="invite-teammates"`,
114
140
 
115
141
  Full setup: [deep-linking.md](deep-linking.md). Pairing is available in all builds (including release).
116
142
 
117
- | Symptom | Likely cause | Fix |
118
- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
119
- | Deep link opens the app but nothing happens | Scheme added in config but **no native rebuild** | `npx expo prebuild` / new development client; Metro reload is not enough |
120
- | Deep link opens the app but nothing happens, and no **Preview mode** top bar appears | `Userflow.init()` rejected, so there is no session to preview into | Check the logs for `[Userflow] Builder pairing link received, but Userflow.init() failed` — fix that error (usually `clientToken`) and re-open the link |
121
- | Killed app opens from a pairing link with no banner, or Preview returns on the wrong step | Pairing did not resume, or the install joined as a new device while the old presence was still on the topic | Install `expo-secure-store` so a relaunch can resume. A cold start should show **Connecting to Builder…** immediately, then **Preview mode**, with the flow at step 1. `exitPreview()` or an expired token ends resume |
122
- | Deep link opens the app and the router shows **Unmatched Route** / "page could not be found" | Deep link is not the root form from the QR; **or** the link was rebuilt with the app's own scheme instead of `scheme_id` | Open the QR unmodified (`userflow-<id>://?pairing_token=…`). If the log says `a scheme Userflow does not own`, do not substitute your app scheme |
123
- | "Can't select this element" right after pairing, or the app jumps to home when pairing | Expo Router navigated on the pairing link | Add `app/+native-intent.ts` exporting `redirectSystemPath` from `@userflow-tech/react-native/expo-router` (see [deep-linking.md](deep-linking.md#expo-router-hosts)) |
124
- | Pairing deep link ignored (preview URL may still work) | Scheme is `userflow-*` but the id after it is empty or has stray hyphens | Use the env's `scheme_id` from the dashboard exactly (e.g. `userflow-v7twv2fw2ja2jaco7kesvowmem`), not the env UUID |
125
- | Builder says “A device was paired earlier…” and Preview closes immediately after a brief spinner | Stale pairing session still present; a ghost device acks | Pair again on the device you are watching, or clear the env's pairing session and re-QR |
126
- | Preview succeeds on the server but the phone stays idle | App is not the paired instance (no **Preview mode** top bar) | Confirm the top bar before hitting Preview; re-open the pairing QR on this install |
127
- | QR / `https://…/pair/<jwt>` does nothing in the app | SDK only parses the **scheme** form after the backend redirect | Open via the OS (scan QR) or forward `{schemeId}://?pairing_token=…` with `handlePairingUrl` |
128
- | Builder selector has no screenshot after Confirm | Missing / unlinked `react-native-view-shot`, or 4.0.3 from Expo SDK 55 and older | Install `react-native-view-shot@^5.0.0` and **rebuild native**. At init, look for `- react-native-view-shot is not linked, so Builder element selection gets no screenshot`. When confirming a pick, look for `[Userflow] Required peer react-native-view-shot is not installed; skipping picker screenshot.` |
143
+ | Symptom | Likely cause | Fix |
144
+ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
145
+ | Deep link opens the app but nothing happens | Scheme added in config but **no native rebuild** | `npx expo prebuild` / new development client; Metro reload is not enough |
146
+ | Deep link opens the app but nothing happens, and no **Preview mode** top bar appears | `Userflow.init()` rejected, so there is no session to preview into | Check the logs for `[Userflow] Builder pairing link received, but Userflow.init() failed` — fix that error (usually `clientToken`) and re-open the link |
147
+ | Killed app opens from a pairing link with no banner, or Preview returns on the wrong step | Pairing did not resume, or the install joined as a new device while the old presence was still on the topic | Install `expo-secure-store` so a relaunch can resume. A cold start should show **Connecting to Builder…** immediately, then **Preview mode**, with the flow at step 1. `exitPreview()` or an expired token ends resume |
148
+ | Deep link opens the app and the router shows **Unmatched Route** / "page could not be found" | Deep link is not the root form from the QR; **or** the link was rebuilt with the app's own scheme instead of `scheme_id` | Open the QR unmodified (`userflow-<id>://?pairing_token=…`). If the log says `a scheme Userflow does not own`, do not substitute your app scheme |
149
+ | "Can't select this element" right after pairing, or the app jumps to home when pairing | Expo Router navigated on the pairing link | Add `app/+native-intent.ts` exporting `redirectSystemPath` from `@userflow-tech/react-native/expo-router` (see [deep-linking.md](deep-linking.md#expo-router-hosts)) |
150
+ | Pairing deep link ignored (preview URL may still work) | Scheme is `userflow-*` but the id after it is empty or has stray hyphens | Use the env's `scheme_id` from the dashboard exactly (e.g. `userflow-v7twv2fw2ja2jaco7kesvowmem`), not the env UUID |
151
+ | Builder says “A device was paired earlier…” and Preview closes immediately after a brief spinner | Stale pairing session still present; a ghost device acks | Pair again on the device you are watching, or clear the env's pairing session and re-QR |
152
+ | Preview succeeds on the server but the phone stays idle | App is not the paired instance (no **Preview mode** top bar) | Confirm the top bar before hitting Preview; re-open the pairing QR on this install |
153
+ | QR / `https://…/pair/<jwt>` does nothing in the app | SDK only parses the **scheme** form after the backend redirect | Open via the OS (scan QR) or forward `{schemeId}://?pairing_token=…` with `handlePairingUrl` |
154
+ | Builder selector has no screenshot after Confirm | Missing / unlinked `react-native-view-shot`, or 4.0.3 from Expo SDK 55 and older | Install view-shot (on Expo SDK 56 and 57, `npx expo install react-native-view-shot` unpinned; otherwise `react-native-view-shot@^5.0.0`) and **rebuild native**. At init, look for `- react-native-view-shot is not linked, so Builder element selection gets no screenshot`. When confirming a pick, look for `[Userflow] Required peer react-native-view-shot is not installed; skipping picker screenshot.` |
129
155
 
130
156
  ## Expo
131
157
 
@@ -137,11 +163,12 @@ Full setup: [deep-linking.md](deep-linking.md). Pairing is available in all buil
137
163
 
138
164
  ## Jest
139
165
 
140
- | Symptom | Likely cause | Fix |
141
- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
142
- | Snapshots gain `nativeID="uf_…"`, `collapsable={false}`, `__ufid`, or `__ufManual` props, and keep changing after unrelated JSX edits | The Babel plugin runs under Jest, because `babel-jest` reads `babel.config.js`. Its ids depend on file path, component name, sibling order, and static labels. | Skip the plugin when `api.env('test')` is true. See the README section "Babel plugin and snapshot tests". |
143
- | `Caching has already been configured with .never or .forever()` after adding `api.env('test')` | `babel.config.js` still calls `api.cache(true)` before `api.env`. | Remove `api.cache(true)`. `api.env` already caches per environment. |
144
- | Component tests load the SDK after enabling the Babel plugin | Full mode imports `@userflow-tech/react-native` into every stamped file. | Mock the SDK in the Jest setup file, or skip the plugin in tests. |
166
+ | Symptom | Likely cause | Fix |
167
+ | ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
168
+ | `Jest encountered an unexpected token` in a test that loads `@userflow-tech/react-native` or one of its subpaths | The package's `react-native` entry is TypeScript source, and the app's `transformIgnorePatterns` does not include `@userflow-tech`, so Jest reads that source untransformed. | Add the README's Jest mock to the setup file, with a mock for each subpath the app imports. See the README section "Jest". |
169
+ | Snapshots gain `nativeID="uf_…"`, `collapsable={false}`, `__ufid`, or `__ufManual` props, and keep changing after unrelated JSX edits | The Babel plugin runs under Jest, because `babel-jest` reads `babel.config.js`. Its ids depend on file path, component name, sibling order, and static labels. | Skip the plugin when `api.env('test')` is true. See the README section "Babel plugin and snapshot tests". |
170
+ | `Caching has already been configured with .never or .forever()` after adding `api.env('test')` | `babel.config.js` still calls `api.cache(true)` before `api.env`. | Remove `api.cache(true)`. `api.env` already caches per environment. |
171
+ | Component tests load the SDK after enabling the Babel plugin | Full mode imports `@userflow-tech/react-native` into every stamped file. | Mock the SDK in the Jest setup file, or skip the plugin in tests. |
145
172
 
146
173
  ## Still stuck?
147
174
 
@@ -7,10 +7,12 @@ export interface HostDependencyWarning {
7
7
  /**
8
8
  * Prebuild checks that do not change the native config.
9
9
  *
10
- * `react-native-view-shot` must be at least 5. Expo SDK 54's unpinned install
11
- * resolves 4.0.3. Expo SDK 53 and older only autolink native modules listed in
12
- * the app's own package.json, so AsyncStorage, WebView, and safe-area-context
13
- * have to be direct dependencies there. Expo SDK 54 and later autolink
10
+ * `react-native-view-shot` must be at least 5. On Expo SDK 55 and older an
11
+ * unpinned install resolves 4.0.3; Expo SDK 56 and 57 bundle 5.1.0, so a
12
+ * `^5.0.0` pin there only adds a version mismatch. Expo SDK 53 and older only
13
+ * autolink native modules listed in the app's own package.json, so
14
+ * AsyncStorage, WebView, and safe-area-context have to be direct dependencies
15
+ * there. Expo SDK 54 and later autolink
14
16
  * safe-area-context when Expo Router or React Navigation brought it in, so
15
17
  * prebuild does not warn about it on those SDKs. `Userflow.init` warns when
16
18
  * the package itself cannot be loaded.
@@ -1 +1 @@
1
- {"version":3,"file":"hostDependencyWarnings.d.ts","sourceRoot":"","sources":["../plugin/hostDependencyWarnings.ts"],"names":[],"mappings":"AAKA,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,wOACoM,CAAC;AAExO,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,qBAAqB,EAAE,CA+CzB;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAaN"}
1
+ {"version":3,"file":"hostDependencyWarnings.d.ts","sourceRoot":"","sources":["../plugin/hostDependencyWarnings.ts"],"names":[],"mappings":"AAKA,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,wOACoM,CAAC;AAExO,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,qBAAqB,EAAE,CA+CzB;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAaN"}
@@ -17,10 +17,12 @@ const TRANSITIVE_NATIVE_MODULES = [
17
17
  /**
18
18
  * Prebuild checks that do not change the native config.
19
19
  *
20
- * `react-native-view-shot` must be at least 5. Expo SDK 54's unpinned install
21
- * resolves 4.0.3. Expo SDK 53 and older only autolink native modules listed in
22
- * the app's own package.json, so AsyncStorage, WebView, and safe-area-context
23
- * have to be direct dependencies there. Expo SDK 54 and later autolink
20
+ * `react-native-view-shot` must be at least 5. On Expo SDK 55 and older an
21
+ * unpinned install resolves 4.0.3; Expo SDK 56 and 57 bundle 5.1.0, so a
22
+ * `^5.0.0` pin there only adds a version mismatch. Expo SDK 53 and older only
23
+ * autolink native modules listed in the app's own package.json, so
24
+ * AsyncStorage, WebView, and safe-area-context have to be direct dependencies
25
+ * there. Expo SDK 54 and later autolink
24
26
  * safe-area-context when Expo Router or React Navigation brought it in, so
25
27
  * prebuild does not warn about it on those SDKs. `Userflow.init` warns when
26
28
  * the package itself cannot be loaded.
@@ -38,7 +40,7 @@ function hostDependencyWarnings(projectRoot, sdkVersion) {
38
40
  if (!viewShot) {
39
41
  warnings.push({
40
42
  property: VIEW_SHOT,
41
- message: 'react-native-view-shot is not a direct dependency. Builder element selection needs >=5.0.0. On Expo SDK 54, an unpinned `npx expo install react-native-view-shot` resolves 4.0.3. Pin ^5.0.0. If expo doctor reports a version mismatch, add "react-native-view-shot" to expo.install.exclude.',
43
+ message: 'react-native-view-shot is not a direct dependency. Builder element selection needs >=5.0.0. On Expo SDK 56 and 57, run `npx expo install react-native-view-shot` unpinned, with no expo.install.exclude entry for it. On Expo SDK 55 and older, an unpinned install resolves 4.0.3, so pin ^5.0.0 and add "react-native-view-shot" to expo.install.exclude.',
42
44
  });
43
45
  }
44
46
  else {
@@ -46,7 +48,7 @@ function hostDependencyWarnings(projectRoot, sdkVersion) {
46
48
  if (major != null && major < 5) {
47
49
  warnings.push({
48
50
  property: VIEW_SHOT,
49
- message: `react-native-view-shot@${viewShot} is older than 5.0.0. Expo SDK 54's default is 4.0.3, which does not work with this SDK. Pin ^5.0.0 and add "react-native-view-shot" to expo.install.exclude if expo doctor complains.`,
51
+ message: `react-native-view-shot@${viewShot} is older than 5.0.0, which does not work with this SDK. On Expo SDK 56 and 57, run npx expo install react-native-view-shot unpinned, with no expo.install.exclude entry for it. Expo SDK 55 and older default to 4.0.3: pin ^5.0.0 and add "react-native-view-shot" to expo.install.exclude.`,
50
52
  });
51
53
  }
52
54
  }