@userflow-tech/react-native 0.4.5 → 0.6.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 (502) hide show
  1. package/README.md +31 -2
  2. package/docs/anchoring.md +6 -1
  3. package/docs/custom-fonts.md +36 -0
  4. package/docs/troubleshooting.md +33 -6
  5. package/lib/commonjs/anchors/AutoAnchorRegistry.js +144 -34
  6. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  7. package/lib/commonjs/anchors/animationFrame.js +29 -1
  8. package/lib/commonjs/anchors/animationFrame.js.map +1 -1
  9. package/lib/commonjs/anchors/appActive.js +61 -0
  10. package/lib/commonjs/anchors/appActive.js.map +1 -0
  11. package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -8
  12. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  13. package/lib/commonjs/anchors/elementTapMonitor.js +67 -12
  14. package/lib/commonjs/anchors/elementTapMonitor.js.map +1 -1
  15. package/lib/commonjs/anchors/elementTargetMatch.js +33 -7
  16. package/lib/commonjs/anchors/elementTargetMatch.js.map +1 -1
  17. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +8 -0
  18. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -1
  19. package/lib/commonjs/anchors/fiber/detectAppFontFamily.js +341 -0
  20. package/lib/commonjs/anchors/fiber/detectAppFontFamily.js.map +1 -0
  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/fiber/visibleScreens.js +6 -0
  28. package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
  29. package/lib/commonjs/anchors/fiberAnchorCache.js +20 -0
  30. package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -1
  31. package/lib/commonjs/anchors/gestureHandlerHandoff.js +304 -0
  32. package/lib/commonjs/anchors/gestureHandlerHandoff.js.map +1 -0
  33. package/lib/commonjs/anchors/resolveAnchorHost.js +6 -0
  34. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  35. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +11 -6
  36. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
  37. package/lib/commonjs/anchors/resolveElementTargets.js +63 -8
  38. package/lib/commonjs/anchors/resolveElementTargets.js.map +1 -1
  39. package/lib/commonjs/anchors/semanticMatcher.js +43 -21
  40. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
  41. package/lib/commonjs/anchors/tapSlop.js +16 -0
  42. package/lib/commonjs/anchors/tapSlop.js.map +1 -0
  43. package/lib/commonjs/anchors/targetPressMonitor.js +66 -12
  44. package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -1
  45. package/lib/commonjs/authoring/fingerprintFromInstance.js +5 -9
  46. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
  47. package/lib/commonjs/content/BannerStepButton.js +2 -1
  48. package/lib/commonjs/content/BannerStepButton.js.map +1 -1
  49. package/lib/commonjs/content/RichContentRenderer.js +20 -14
  50. package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
  51. package/lib/commonjs/content/StepButton.js +2 -1
  52. package/lib/commonjs/content/StepButton.js.map +1 -1
  53. package/lib/commonjs/content/openSafeUrl.js +3 -1
  54. package/lib/commonjs/content/openSafeUrl.js.map +1 -1
  55. package/lib/commonjs/content/resolveContentFontFamily.js +96 -0
  56. package/lib/commonjs/content/resolveContentFontFamily.js.map +1 -0
  57. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +6 -0
  58. package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
  59. package/lib/commonjs/index.js +21 -5
  60. package/lib/commonjs/index.js.map +1 -1
  61. package/lib/commonjs/navigation/navigateUrlUtils.js +105 -0
  62. package/lib/commonjs/navigation/navigateUrlUtils.js.map +1 -0
  63. package/lib/commonjs/navigation/openExternalNavigateUrl.js +14 -0
  64. package/lib/commonjs/navigation/openExternalNavigateUrl.js.map +1 -0
  65. package/lib/commonjs/navigation/openFlowNavigateUrl.js +47 -41
  66. package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
  67. package/lib/commonjs/pairing/PairingController.js +3 -1
  68. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  69. package/lib/commonjs/runtime/BannerHost.js +38 -29
  70. package/lib/commonjs/runtime/BannerHost.js.map +1 -1
  71. package/lib/commonjs/runtime/TargetPressBridge.js +55 -7
  72. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  73. package/lib/commonjs/runtime/UserflowOverlay.js +5 -11
  74. package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -1
  75. package/lib/commonjs/runtime/UserflowProvider.js +66 -40
  76. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  77. package/lib/commonjs/runtime/bannerEngine.js +8 -2
  78. package/lib/commonjs/runtime/bannerEngine.js.map +1 -1
  79. package/lib/commonjs/runtime/bannerFlowSpacer.js +71 -0
  80. package/lib/commonjs/runtime/bannerFlowSpacer.js.map +1 -0
  81. package/lib/commonjs/runtime/flowEngine.js +11 -0
  82. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  83. package/lib/commonjs/runtime/previewStart.js +39 -0
  84. package/lib/commonjs/runtime/previewStart.js.map +1 -0
  85. package/lib/commonjs/runtime/pushBannerLayoutContext.js +101 -0
  86. package/lib/commonjs/runtime/pushBannerLayoutContext.js.map +1 -0
  87. package/lib/commonjs/screenTracker.js +12 -0
  88. package/lib/commonjs/screenTracker.js.map +1 -1
  89. package/lib/commonjs/surfaces/BannerBar.js +79 -61
  90. package/lib/commonjs/surfaces/BannerBar.js.map +1 -1
  91. package/lib/commonjs/surfaces/BannerSurface.js +28 -6
  92. package/lib/commonjs/surfaces/BannerSurface.js.map +1 -1
  93. package/lib/commonjs/surfaces/ProgressBar.js +2 -1
  94. package/lib/commonjs/surfaces/ProgressBar.js.map +1 -1
  95. package/lib/commonjs/surfaces/TooltipSurface.js +48 -41
  96. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  97. package/lib/commonjs/surfaces/bannerBarLayout.js +77 -10
  98. package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -1
  99. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +114 -63
  100. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
  101. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +3 -33
  102. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -1
  103. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +2 -1
  104. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -1
  105. package/lib/commonjs/surfaces/bannerWebView/bannerWebViewHeight.js +33 -0
  106. package/lib/commonjs/surfaces/bannerWebView/bannerWebViewHeight.js.map +1 -0
  107. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +104 -23
  108. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
  109. package/lib/commonjs/surfaces/hostAccessibilityTrap.js +28 -0
  110. package/lib/commonjs/surfaces/hostAccessibilityTrap.js.map +1 -0
  111. package/lib/commonjs/surfaces/resolveBannerTheme.js +6 -3
  112. package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -1
  113. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +3 -2
  114. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
  115. package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js +134 -0
  116. package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
  117. package/lib/commonjs/version.js +1 -1
  118. package/lib/module/anchors/AutoAnchorRegistry.js +145 -35
  119. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  120. package/lib/module/anchors/animationFrame.js +29 -2
  121. package/lib/module/anchors/animationFrame.js.map +1 -1
  122. package/lib/module/anchors/appActive.js +57 -0
  123. package/lib/module/anchors/appActive.js.map +1 -0
  124. package/lib/module/anchors/elementConditionEvaluator.js +26 -9
  125. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  126. package/lib/module/anchors/elementTapMonitor.js +67 -12
  127. package/lib/module/anchors/elementTapMonitor.js.map +1 -1
  128. package/lib/module/anchors/elementTargetMatch.js +32 -7
  129. package/lib/module/anchors/elementTargetMatch.js.map +1 -1
  130. package/lib/module/anchors/fiber/FiberScanRootStore.js +8 -0
  131. package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -1
  132. package/lib/module/anchors/fiber/detectAppFontFamily.js +330 -0
  133. package/lib/module/anchors/fiber/detectAppFontFamily.js.map +1 -0
  134. package/lib/module/anchors/fiber/fiberInternals.js +65 -0
  135. package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
  136. package/lib/module/anchors/fiber/indexHostFibers.js +4 -3
  137. package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -1
  138. package/lib/module/anchors/fiber/resolveFiberPath.js +30 -15
  139. package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -1
  140. package/lib/module/anchors/fiber/visibleScreens.js +5 -0
  141. package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
  142. package/lib/module/anchors/fiberAnchorCache.js +19 -0
  143. package/lib/module/anchors/fiberAnchorCache.js.map +1 -1
  144. package/lib/module/anchors/gestureHandlerHandoff.js +298 -0
  145. package/lib/module/anchors/gestureHandlerHandoff.js.map +1 -0
  146. package/lib/module/anchors/resolveAnchorHost.js +1 -0
  147. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  148. package/lib/module/anchors/resolveAutoAnchorHost.js +11 -6
  149. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
  150. package/lib/module/anchors/resolveElementTargets.js +63 -8
  151. package/lib/module/anchors/resolveElementTargets.js.map +1 -1
  152. package/lib/module/anchors/semanticMatcher.js +43 -21
  153. package/lib/module/anchors/semanticMatcher.js.map +1 -1
  154. package/lib/module/anchors/tapSlop.js +11 -0
  155. package/lib/module/anchors/tapSlop.js.map +1 -0
  156. package/lib/module/anchors/targetPressMonitor.js +53 -8
  157. package/lib/module/anchors/targetPressMonitor.js.map +1 -1
  158. package/lib/module/authoring/fingerprintFromInstance.js +6 -10
  159. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
  160. package/lib/module/content/BannerStepButton.js +2 -1
  161. package/lib/module/content/BannerStepButton.js.map +1 -1
  162. package/lib/module/content/RichContentRenderer.js +20 -14
  163. package/lib/module/content/RichContentRenderer.js.map +1 -1
  164. package/lib/module/content/StepButton.js +2 -1
  165. package/lib/module/content/StepButton.js.map +1 -1
  166. package/lib/module/content/openSafeUrl.js +3 -1
  167. package/lib/module/content/openSafeUrl.js.map +1 -1
  168. package/lib/module/content/resolveContentFontFamily.js +89 -0
  169. package/lib/module/content/resolveContentFontFamily.js.map +1 -0
  170. package/lib/module/expo-router/useUserflowExpoRouter.js +7 -1
  171. package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
  172. package/lib/module/index.js +24 -7
  173. package/lib/module/index.js.map +1 -1
  174. package/lib/module/navigation/navigateUrlUtils.js +94 -0
  175. package/lib/module/navigation/navigateUrlUtils.js.map +1 -0
  176. package/lib/module/navigation/openExternalNavigateUrl.js +11 -0
  177. package/lib/module/navigation/openExternalNavigateUrl.js.map +1 -0
  178. package/lib/module/navigation/openFlowNavigateUrl.js +22 -36
  179. package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
  180. package/lib/module/pairing/PairingController.js +3 -1
  181. package/lib/module/pairing/PairingController.js.map +1 -1
  182. package/lib/module/runtime/BannerHost.js +38 -29
  183. package/lib/module/runtime/BannerHost.js.map +1 -1
  184. package/lib/module/runtime/TargetPressBridge.js +56 -8
  185. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  186. package/lib/module/runtime/UserflowOverlay.js +5 -11
  187. package/lib/module/runtime/UserflowOverlay.js.map +1 -1
  188. package/lib/module/runtime/UserflowProvider.js +66 -40
  189. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  190. package/lib/module/runtime/bannerEngine.js +7 -2
  191. package/lib/module/runtime/bannerEngine.js.map +1 -1
  192. package/lib/module/runtime/bannerFlowSpacer.js +65 -0
  193. package/lib/module/runtime/bannerFlowSpacer.js.map +1 -0
  194. package/lib/module/runtime/flowEngine.js +11 -0
  195. package/lib/module/runtime/flowEngine.js.map +1 -1
  196. package/lib/module/runtime/previewStart.js +35 -0
  197. package/lib/module/runtime/previewStart.js.map +1 -0
  198. package/lib/module/runtime/pushBannerLayoutContext.js +94 -0
  199. package/lib/module/runtime/pushBannerLayoutContext.js.map +1 -0
  200. package/lib/module/screenTracker.js +11 -0
  201. package/lib/module/screenTracker.js.map +1 -1
  202. package/lib/module/surfaces/BannerBar.js +80 -62
  203. package/lib/module/surfaces/BannerBar.js.map +1 -1
  204. package/lib/module/surfaces/BannerSurface.js +28 -6
  205. package/lib/module/surfaces/BannerSurface.js.map +1 -1
  206. package/lib/module/surfaces/ProgressBar.js +2 -1
  207. package/lib/module/surfaces/ProgressBar.js.map +1 -1
  208. package/lib/module/surfaces/TooltipSurface.js +49 -42
  209. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  210. package/lib/module/surfaces/bannerBarLayout.js +72 -11
  211. package/lib/module/surfaces/bannerBarLayout.js.map +1 -1
  212. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +115 -64
  213. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
  214. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +3 -31
  215. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -1
  216. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +2 -1
  217. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -1
  218. package/lib/module/surfaces/bannerWebView/bannerWebViewHeight.js +29 -0
  219. package/lib/module/surfaces/bannerWebView/bannerWebViewHeight.js.map +1 -0
  220. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +104 -23
  221. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
  222. package/lib/module/surfaces/hostAccessibilityTrap.js +24 -0
  223. package/lib/module/surfaces/hostAccessibilityTrap.js.map +1 -0
  224. package/lib/module/surfaces/resolveBannerTheme.js +6 -3
  225. package/lib/module/surfaces/resolveBannerTheme.js.map +1 -1
  226. package/lib/module/surfaces/tooltip/TooltipBubble.js +3 -2
  227. package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
  228. package/lib/module/surfaces/tooltip/targetSearchSchedule.js +128 -0
  229. package/lib/module/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
  230. package/lib/module/version.js +1 -1
  231. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +36 -2
  232. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts +0 -4
  234. package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/src/anchors/appActive.d.ts +8 -0
  236. package/lib/typescript/commonjs/src/anchors/appActive.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts +17 -0
  238. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts.map +1 -1
  239. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts +7 -0
  240. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +5 -0
  242. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/src/anchors/fiber/detectAppFontFamily.d.ts +30 -0
  244. package/lib/typescript/commonjs/src/anchors/fiber/detectAppFontFamily.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +7 -0
  246. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +3 -2
  248. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
  250. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +2 -0
  252. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +5 -0
  254. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts +70 -0
  256. package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
  257. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +1 -0
  258. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
  260. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +2 -0
  263. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts +9 -0
  265. package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +13 -8
  267. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/src/content/resolveContentFontFamily.d.ts +35 -0
  274. package/lib/typescript/commonjs/src/content/resolveContentFontFamily.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/src/index.d.ts +6 -5
  277. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts +15 -0
  279. package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts.map +1 -0
  280. package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts +3 -0
  281. package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts +2 -5
  283. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +6 -0
  285. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  286. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +3 -0
  288. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  289. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  291. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +5 -1
  292. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts +15 -0
  294. package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
  295. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/runtime/previewStart.d.ts +13 -0
  297. package/lib/typescript/commonjs/src/runtime/previewStart.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts +22 -0
  299. package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/src/screenTracker.d.ts +6 -0
  301. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +3 -1
  303. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +6 -5
  305. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -1
  306. package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts.map +1 -1
  307. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +1 -1
  308. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  309. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +17 -0
  310. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -1
  311. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
  312. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
  313. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +3 -12
  314. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -1
  315. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts +13 -0
  317. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
  320. package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
  321. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +4 -1
  322. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
  323. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
  324. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  325. package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
  326. package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
  327. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  328. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +36 -2
  329. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  330. package/lib/typescript/module/src/anchors/animationFrame.d.ts +0 -4
  331. package/lib/typescript/module/src/anchors/animationFrame.d.ts.map +1 -1
  332. package/lib/typescript/module/src/anchors/appActive.d.ts +8 -0
  333. package/lib/typescript/module/src/anchors/appActive.d.ts.map +1 -0
  334. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts +17 -0
  335. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts.map +1 -1
  336. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts +7 -0
  337. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts.map +1 -1
  338. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +5 -0
  339. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -1
  340. package/lib/typescript/module/src/anchors/fiber/detectAppFontFamily.d.ts +30 -0
  341. package/lib/typescript/module/src/anchors/fiber/detectAppFontFamily.d.ts.map +1 -0
  342. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +7 -0
  343. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  344. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +3 -2
  345. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
  346. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
  347. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
  348. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +2 -0
  349. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  350. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +5 -0
  351. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -1
  352. package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts +70 -0
  353. package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
  354. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +1 -0
  355. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  356. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
  357. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  358. package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts.map +1 -1
  359. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +2 -0
  360. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
  361. package/lib/typescript/module/src/anchors/tapSlop.d.ts +9 -0
  362. package/lib/typescript/module/src/anchors/tapSlop.d.ts.map +1 -0
  363. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +13 -8
  364. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -1
  365. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  366. package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -1
  367. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
  368. package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
  369. package/lib/typescript/module/src/content/openSafeUrl.d.ts.map +1 -1
  370. package/lib/typescript/module/src/content/resolveContentFontFamily.d.ts +35 -0
  371. package/lib/typescript/module/src/content/resolveContentFontFamily.d.ts.map +1 -0
  372. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  373. package/lib/typescript/module/src/index.d.ts +6 -5
  374. package/lib/typescript/module/src/index.d.ts.map +1 -1
  375. package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts +15 -0
  376. package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts.map +1 -0
  377. package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts +3 -0
  378. package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
  379. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts +2 -5
  380. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  381. package/lib/typescript/module/src/pairing/PairingController.d.ts +6 -0
  382. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  383. package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -1
  384. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +3 -0
  385. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  386. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -1
  387. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  388. package/lib/typescript/module/src/runtime/bannerEngine.d.ts +5 -1
  389. package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -1
  390. package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts +15 -0
  391. package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
  392. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  393. package/lib/typescript/module/src/runtime/previewStart.d.ts +13 -0
  394. package/lib/typescript/module/src/runtime/previewStart.d.ts.map +1 -0
  395. package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts +22 -0
  396. package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
  397. package/lib/typescript/module/src/screenTracker.d.ts +6 -0
  398. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  399. package/lib/typescript/module/src/surfaces/BannerBar.d.ts +3 -1
  400. package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -1
  401. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +6 -5
  402. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -1
  403. package/lib/typescript/module/src/surfaces/ProgressBar.d.ts.map +1 -1
  404. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +1 -1
  405. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  406. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +17 -0
  407. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -1
  408. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
  409. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
  410. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +3 -12
  411. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -1
  412. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -1
  413. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts +13 -0
  414. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts.map +1 -0
  415. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
  416. package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
  417. package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
  418. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +4 -1
  419. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
  420. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
  421. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  422. package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
  423. package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
  424. package/lib/typescript/module/src/version.d.ts +1 -1
  425. package/package.json +1 -1
  426. package/src/anchors/AutoAnchorRegistry.ts +166 -35
  427. package/src/anchors/animationFrame.ts +31 -1
  428. package/src/anchors/appActive.ts +63 -0
  429. package/src/anchors/elementConditionEvaluator.ts +29 -12
  430. package/src/anchors/elementTapMonitor.ts +68 -10
  431. package/src/anchors/elementTargetMatch.ts +34 -7
  432. package/src/anchors/fiber/FiberScanRootStore.ts +8 -0
  433. package/src/anchors/fiber/detectAppFontFamily.ts +400 -0
  434. package/src/anchors/fiber/fiberInternals.ts +68 -0
  435. package/src/anchors/fiber/indexHostFibers.ts +8 -3
  436. package/src/anchors/fiber/resolveFiberPath.ts +25 -16
  437. package/src/anchors/fiber/visibleScreens.ts +5 -0
  438. package/src/anchors/fiberAnchorCache.ts +19 -0
  439. package/src/anchors/gestureHandlerHandoff.ts +356 -0
  440. package/src/anchors/resolveAnchorHost.ts +2 -0
  441. package/src/anchors/resolveAutoAnchorHost.ts +18 -8
  442. package/src/anchors/resolveElementTargets.ts +64 -7
  443. package/src/anchors/semanticMatcher.ts +48 -27
  444. package/src/anchors/tapSlop.ts +18 -0
  445. package/src/anchors/targetPressMonitor.ts +56 -19
  446. package/src/authoring/fingerprintFromInstance.ts +4 -5
  447. package/src/content/BannerStepButton.tsx +2 -1
  448. package/src/content/RichContentRenderer.tsx +19 -13
  449. package/src/content/StepButton.tsx +2 -1
  450. package/src/content/openSafeUrl.ts +3 -1
  451. package/src/content/resolveContentFontFamily.ts +119 -0
  452. package/src/expo-router/useUserflowExpoRouter.ts +10 -1
  453. package/src/index.ts +22 -9
  454. package/src/navigation/navigateUrlUtils.ts +100 -0
  455. package/src/navigation/openExternalNavigateUrl.ts +9 -0
  456. package/src/navigation/openFlowNavigateUrl.ts +36 -36
  457. package/src/pairing/PairingController.ts +9 -1
  458. package/src/runtime/BannerHost.tsx +41 -23
  459. package/src/runtime/TargetPressBridge.tsx +66 -9
  460. package/src/runtime/UserflowOverlay.tsx +7 -9
  461. package/src/runtime/UserflowProvider.tsx +56 -32
  462. package/src/runtime/bannerEngine.ts +10 -2
  463. package/src/runtime/bannerFlowSpacer.tsx +70 -0
  464. package/src/runtime/flowEngine.ts +11 -0
  465. package/src/runtime/previewStart.ts +49 -0
  466. package/src/runtime/pushBannerLayoutContext.tsx +126 -0
  467. package/src/screenTracker.ts +11 -0
  468. package/src/surfaces/BannerBar.tsx +93 -55
  469. package/src/surfaces/BannerSurface.tsx +61 -9
  470. package/src/surfaces/ProgressBar.tsx +2 -1
  471. package/src/surfaces/TooltipSurface.tsx +78 -53
  472. package/src/surfaces/bannerBarLayout.ts +80 -7
  473. package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +151 -57
  474. package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +4 -36
  475. package/src/surfaces/bannerWebView/bannerThemeStyles.ts +2 -1
  476. package/src/surfaces/bannerWebView/bannerWebViewHeight.ts +32 -0
  477. package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +111 -23
  478. package/src/surfaces/hostAccessibilityTrap.ts +25 -0
  479. package/src/surfaces/resolveBannerTheme.ts +14 -3
  480. package/src/surfaces/tooltip/TooltipBubble.tsx +8 -1
  481. package/src/surfaces/tooltip/targetSearchSchedule.ts +140 -0
  482. package/src/version.ts +1 -1
  483. package/vendor/core/dist/engine/BannerSessionEngine.d.ts +29 -2
  484. package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -1
  485. package/vendor/core/dist/engine/BannerSessionEngine.js +87 -6
  486. package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -1
  487. package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -1
  488. package/vendor/core/dist/engine/ClientConditionEngine.js +30 -7
  489. package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -1
  490. package/vendor/core/dist/engine/PairingEngine.d.ts +6 -1
  491. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  492. package/vendor/core/dist/engine/PairingEngine.js +23 -3
  493. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  494. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  495. package/vendor/core/dist/engine/handleActions.js +67 -2
  496. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  497. package/vendor/core/dist/version.d.ts +1 -1
  498. package/vendor/core/dist/version.js +1 -1
  499. package/vendor/core/package.json +1 -1
  500. package/vendor/protocol/dist/flows.d.ts +2 -0
  501. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  502. package/vendor/protocol/package.json +1 -1
@@ -190,18 +190,21 @@ function intrinsicNonTextAgrees(fp: MobileFingerprint, inst: AutoAnchorInstance)
190
190
  );
191
191
  }
192
192
 
193
+ /**
194
+ * An id or kind conflict, or a childText disagreement no text-independent
195
+ * identity (authoritative id, matching icon/image) vouches for.
196
+ */
197
+ function isContradicted(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
198
+ if (contradictsStrong(fp, inst)) return true;
199
+ return childTextDisagrees(fp, inst) && !idAgrees(fp, inst) && !intrinsicNonTextAgrees(fp, inst);
200
+ }
201
+
193
202
  function scoreInstance(
194
203
  fp: MobileFingerprint,
195
204
  inst: AutoAnchorInstance,
196
205
  ambiguous: boolean,
197
206
  ): number {
198
- if (contradictsStrong(fp, inst)) return -Infinity;
199
-
200
- // A childText disagreement is disqualifying unless a text-independent identity
201
- // vouches for the element (authoritative id, or matching icon/image).
202
- if (childTextDisagrees(fp, inst) && !idAgrees(fp, inst) && !intrinsicNonTextAgrees(fp, inst)) {
203
- return -Infinity;
204
- }
207
+ if (isContradicted(fp, inst)) return -Infinity;
205
208
 
206
209
  let score = 0;
207
210
 
@@ -231,11 +234,14 @@ function scoreInstance(
231
234
 
232
235
  score += scoreAncestors(fp.ancestors ?? [], inst.ancestors ?? []);
233
236
 
234
- const window = autoAnchorRegistry.siblingWindow(inst.instanceId, 2);
235
- score += scoreSiblingWindow(fp.previousSiblings ?? [], window.previous);
236
- // Score next siblings once. The POC added a reversed pass *and* a direct pass,
237
- // which double-counted the next window.
238
- score += scoreSiblingWindow(fp.nextSiblings ?? [], window.next);
237
+ // The window scans the registry, so skip it when there is nothing to compare.
238
+ if (fp.previousSiblings?.length || fp.nextSiblings?.length) {
239
+ const window = autoAnchorRegistry.siblingWindow(inst.instanceId, 2);
240
+ score += scoreSiblingWindow(fp.previousSiblings ?? [], window.previous);
241
+ // Score next siblings once. The POC added a reversed pass *and* a direct pass,
242
+ // which double-counted the next window.
243
+ score += scoreSiblingWindow(fp.nextSiblings ?? [], window.next);
244
+ }
239
245
 
240
246
  if (ambiguous && !inst.manualId) score -= 40;
241
247
 
@@ -246,6 +252,8 @@ type InstanceFilter = (inst: AutoAnchorInstance) => boolean;
246
252
 
247
253
  interface MatchOptions {
248
254
  instanceFilter?: InstanceFilter;
255
+ /** The caller refreshed live content earlier in this same synchronous call. */
256
+ liveContentFresh?: boolean;
249
257
  }
250
258
 
251
259
  /** Each instance's visibility is computed once per match. */
@@ -260,10 +268,7 @@ function memoizeFilter(filter: InstanceFilter): InstanceFilter {
260
268
  };
261
269
  }
262
270
 
263
- function candidatePool(
264
- fp: MobileFingerprint,
265
- instanceFilter?: InstanceFilter,
266
- ): AutoAnchorInstance[] {
271
+ function candidatePool(fp: MobileFingerprint): AutoAnchorInstance[] {
267
272
  // Explicit ids are authoritative: a miss is no-candidates, not a full-registry search.
268
273
  let pool: AutoAnchorInstance[];
269
274
  if (fp.manualId) {
@@ -286,29 +291,45 @@ function candidatePool(
286
291
  if (filtered.length > 0) pool = filtered;
287
292
  }
288
293
  }
289
- return instanceFilter ? pool.filter(instanceFilter) : pool;
294
+ return pool;
290
295
  }
291
296
 
292
297
  function miss(reason: MatchMissReason, score = 0, secondScore = 0): MatchResult {
293
298
  return { instance: null, score, secondScore, reason };
294
299
  }
295
300
 
296
- function matchFingerprintCore(fp: MobileFingerprint, instanceFilter?: InstanceFilter): MatchResult {
301
+ function matchFingerprintCore(
302
+ fp: MobileFingerprint,
303
+ instanceFilter?: InstanceFilter,
304
+ liveContentFresh = false,
305
+ ): MatchResult {
297
306
  // Live text / testID must be applied *before* pooling. A shared Babel helper
298
307
  // (`const field = () => <TextInput testID={id} />`) reuses one auto-anchor
299
308
  // callback, so the runtime bag is last-writer-wins until we read the host.
309
+ // An unchanged host is a fiber and props-identity check after one shared
310
+ // ancestor walk per pass, so refreshing every instance stays cheap; the
311
+ // per-instance screen walk is what is not, and it only runs for the pool
312
+ // below.
313
+ const all = autoAnchorRegistry.allInstances();
314
+ if (all.length > 0 && !liveContentFresh) {
315
+ autoAnchorRegistry.refreshLiveContent(all);
316
+ }
317
+
300
318
  // A filter's verdict is memoized so covered-screen checks run once per instance.
301
319
  const filter = instanceFilter ? memoizeFilter(instanceFilter) : undefined;
302
- const broad = filter
303
- ? autoAnchorRegistry.allInstances().filter(filter)
304
- : autoAnchorRegistry.allInstances();
305
- if (broad.length > 0) {
306
- autoAnchorRegistry.refreshLiveContent(broad);
320
+ const candidates = candidatePool(fp);
321
+ // A contradiction does not depend on visibility, so settle it before the
322
+ // covered-screen check. Visibility of contradicted instances only matters to
323
+ // tell `all-contradicted` from `no-candidates` when nothing else is left.
324
+ const viable: AutoAnchorInstance[] = [];
325
+ const contradicted: AutoAnchorInstance[] = [];
326
+ for (const inst of candidates) {
327
+ (isContradicted(fp, inst) ? contradicted : viable).push(inst);
307
328
  }
308
-
309
- const pool = candidatePool(fp, filter);
329
+ const pool = filter ? viable.filter(filter) : viable;
310
330
  if (pool.length === 0) {
311
- return miss('no-candidates');
331
+ const anyContradictedCandidate = filter ? contradicted.some(filter) : contradicted.length > 0;
332
+ return miss(anyContradictedCandidate ? 'all-contradicted' : 'no-candidates');
312
333
  }
313
334
 
314
335
  // Visibility can clear a registry-wide ambiguous flag (a covered twin) but
@@ -367,7 +388,7 @@ function matchFingerprintCore(fp: MobileFingerprint, instanceFilter?: InstanceFi
367
388
  * can flag weak (`structural`) targets.
368
389
  */
369
390
  export function matchFingerprint(fp: MobileFingerprint, opts?: MatchOptions): MatchResult {
370
- const result = matchFingerprintCore(fp, opts?.instanceFilter);
391
+ const result = matchFingerprintCore(fp, opts?.instanceFilter, opts?.liveContentFresh);
371
392
  if (fp.identityStrength) result.identityStrength = fp.identityStrength;
372
393
  return result;
373
394
  }
@@ -0,0 +1,18 @@
1
+ /** Max finger travel (px) between start and end to count as a tap, not a scroll. */
2
+ export const TARGET_PRESS_TAP_SLOP = 10;
3
+
4
+ export interface TouchPoint {
5
+ pageX: number;
6
+ pageY: number;
7
+ }
8
+
9
+ /** True when the finger moved no more than `slop` between start and end. */
10
+ export function withinTapSlop(
11
+ start: TouchPoint,
12
+ end: TouchPoint,
13
+ slop: number = TARGET_PRESS_TAP_SLOP,
14
+ ): boolean {
15
+ const dx = end.pageX - start.pageX;
16
+ const dy = end.pageY - start.pageY;
17
+ return dx * dx + dy * dy <= slop * slop;
18
+ }
@@ -1,3 +1,8 @@
1
+ import { gestureHandlerHandoff } from './gestureHandlerHandoff';
2
+ import { TARGET_PRESS_TAP_SLOP, type TouchPoint, withinTapSlop } from './tapSlop';
3
+
4
+ export { TARGET_PRESS_TAP_SLOP, type TouchPoint, withinTapSlop };
5
+
1
6
  /**
2
7
  * Active tooltip target-press subscription.
3
8
  *
@@ -19,29 +24,10 @@ export interface TargetPressSubscription {
19
24
  onPress: () => void;
20
25
  }
21
26
 
22
- /** Max finger travel (px) between start and end to count as a tap, not a scroll. */
23
- export const TARGET_PRESS_TAP_SLOP = 10;
24
-
25
27
  export function pointInRect(x: number, y: number, rect: TargetPressRect): boolean {
26
28
  return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
27
29
  }
28
30
 
29
- export interface TouchPoint {
30
- pageX: number;
31
- pageY: number;
32
- }
33
-
34
- /** True when the finger moved no more than `slop` between start and end. */
35
- export function withinTapSlop(
36
- start: TouchPoint,
37
- end: TouchPoint,
38
- slop: number = TARGET_PRESS_TAP_SLOP,
39
- ): boolean {
40
- const dx = end.pageX - start.pageX;
41
- const dy = end.pageY - start.pageY;
42
- return dx * dx + dy * dy <= slop * slop;
43
- }
44
-
45
31
  /**
46
32
  * True when start and end both land in `rect` and movement stays within tap
47
33
  * slop — mirrors a DOM click on the target without claiming the responder.
@@ -70,14 +56,25 @@ export type TouchIdentifier = number | string;
70
56
  export class TargetPressMonitor {
71
57
  private subscription: TargetPressSubscription | null = null;
72
58
  private touchStarts = new Map<TouchIdentifier, TouchPoint>();
59
+ private handoffStops = new Map<TouchIdentifier, () => void>();
73
60
 
74
61
  set(subscription: TargetPressSubscription | null): void {
75
62
  this.subscription = subscription;
76
63
  if (!subscription) {
77
64
  this.touchStarts.clear();
65
+ this.dropHandoffs();
78
66
  }
79
67
  }
80
68
 
69
+ /** Fingers with a recorded start that have not ended, cancelled, or been handed off. */
70
+ inProgressIdentifiers(): TouchIdentifier[] {
71
+ return [...this.touchStarts.keys()];
72
+ }
73
+
74
+ hasTouch(identifier: TouchIdentifier): boolean {
75
+ return this.touchStarts.has(identifier);
76
+ }
77
+
81
78
  clear(): void {
82
79
  this.set(null);
83
80
  }
@@ -113,6 +110,38 @@ export class TargetPressMonitor {
113
110
  }
114
111
  }
115
112
 
113
+ /**
114
+ * Gesture-handler cancelled this finger. Press if that handler later ends as
115
+ * a tap and the start (and the end, when the payload has one) is inside the
116
+ * current target rect.
117
+ */
118
+ handOffTouch(identifier: TouchIdentifier, handlerTags: readonly number[]): void {
119
+ const start = this.touchStarts.get(identifier);
120
+ if (!start) return;
121
+ this.touchStarts.delete(identifier);
122
+ this.handoffStops.get(identifier)?.();
123
+ if (!this.subscription || handlerTags.length === 0) return;
124
+ const stop = gestureHandlerHandoff.track({
125
+ identifier,
126
+ pageX: start.pageX,
127
+ pageY: start.pageY,
128
+ handlerTags,
129
+ onResolve: (end) => {
130
+ const sub = this.subscription;
131
+ if (!sub) return;
132
+ const rect = sub.getRect();
133
+ if (!rect || rect.width <= 0 || rect.height <= 0) return;
134
+ if (!pointInRect(start.pageX, start.pageY, rect)) return;
135
+ if (end && !pointInRect(end.pageX, end.pageY, rect)) return;
136
+ sub.onPress();
137
+ },
138
+ });
139
+ this.handoffStops.set(identifier, () => {
140
+ stop();
141
+ this.handoffStops.delete(identifier);
142
+ });
143
+ }
144
+
116
145
  /**
117
146
  * Drop in-progress gesture(s). With `identifier`, cancels that finger only;
118
147
  * otherwise clears all (e.g. blanket `onTouchCancel`).
@@ -120,15 +149,23 @@ export class TargetPressMonitor {
120
149
  cancelTouch(identifier?: TouchIdentifier): void {
121
150
  if (identifier == null) {
122
151
  this.touchStarts.clear();
152
+ this.dropHandoffs();
123
153
  return;
124
154
  }
125
155
  this.touchStarts.delete(identifier);
156
+ this.handoffStops.get(identifier)?.();
126
157
  }
127
158
 
128
159
  /** Test helper. */
129
160
  resetForTests(): void {
130
161
  this.subscription = null;
131
162
  this.touchStarts.clear();
163
+ this.dropHandoffs();
164
+ }
165
+
166
+ private dropHandoffs(): void {
167
+ for (const stop of this.handoffStops.values()) stop();
168
+ this.handoffStops.clear();
132
169
  }
133
170
  }
134
171
 
@@ -16,7 +16,7 @@ import { fibersMatch, resolveFiberPath } from '../anchors/fiber/resolveFiberPath
16
16
  import { createVisibleInstanceFilter } from '../anchors/isInstanceOnVisibleScreen';
17
17
  import * as semanticMatcher from '../anchors/semanticMatcher';
18
18
  import type { MatchMissReason } from '../anchors/semanticMatcher';
19
- import { getCurrentScreenLocation } from '../screenTracker';
19
+ import { getCurrentScreenLocation, screenIdFromLocation } from '../screenTracker';
20
20
 
21
21
  import type { PickTarget } from './hitTest';
22
22
 
@@ -35,10 +35,9 @@ function deriveIdentityStrength(inst: AutoAnchorInstance): IdentityStrength {
35
35
  }
36
36
 
37
37
  function screenFromLocation(): { screenId: string; screenName?: string } {
38
- const location = getCurrentScreenLocation();
39
- if (!location) return { screenId: 'unknown' };
40
- if ('path' in location) return { screenId: location.path, screenName: location.path };
41
- return { screenId: location.screen, screenName: location.screen };
38
+ const screenId = screenIdFromLocation(getCurrentScreenLocation());
39
+ if (screenId === 'unknown') return { screenId };
40
+ return { screenId, screenName: screenId };
42
41
  }
43
42
 
44
43
  function deviceMetadata(): DeviceMetadata | undefined {
@@ -14,6 +14,7 @@ import {
14
14
  } from '../surfaces/resolveBannerTheme';
15
15
 
16
16
  import { resolveBannerButtonChrome } from './resolveBannerButtonChrome';
17
+ import { resolveContentFontFamily } from './resolveContentFontFamily';
17
18
  import { stepButtonContainerStyle } from './resolveStepButtonChrome';
18
19
 
19
20
  export interface BannerStepButtonProps {
@@ -57,7 +58,7 @@ export function BannerStepButton({
57
58
  styles.label,
58
59
  {
59
60
  color: chrome.fontColor,
60
- fontFamily: theme.fontFamily || undefined,
61
+ fontFamily: resolveContentFontFamily(theme),
61
62
  fontSize: chrome.fontSize,
62
63
  fontWeight: chrome.fontWeight,
63
64
  ...labelMetrics(chrome.lineHeight),
@@ -8,6 +8,8 @@ import * as React from 'react';
8
8
  import type { TextStyle, ViewStyle } from 'react-native';
9
9
  import { Image, Platform, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
10
10
 
11
+ import { openFlowNavigateUrl } from '../navigation/openFlowNavigateUrl';
12
+
11
13
  import { StepButton } from './StepButton';
12
14
  import {
13
15
  deserializeRichContentDoc,
@@ -17,7 +19,7 @@ import {
17
19
  } from './deserialize';
18
20
  import { resolveImageFrame } from './imageLayout';
19
21
  import { migrateFlowBlocksIntoContent } from './migrateFlowBlocks';
20
- import { openSafeUrl } from './openSafeUrl';
22
+ import { resolveContentFontFamily } from './resolveContentFontFamily';
21
23
  import {
22
24
  ROOT_CONTENT_GAP,
23
25
  WEB_CODE_BG_ALPHA,
@@ -401,7 +403,7 @@ function RenderedLink({
401
403
  accessibilityRole="link"
402
404
  accessibilityHint={href || undefined}
403
405
  onPress={() => {
404
- void openSafeUrl(href);
406
+ void openFlowNavigateUrl(href);
405
407
  }}
406
408
  >
407
409
  <InlineChildren
@@ -480,7 +482,7 @@ function RenderedImage({
480
482
  accessibilityRole="link"
481
483
  accessibilityLabel="Image link"
482
484
  onPress={() => {
483
- void openSafeUrl(href);
485
+ void openFlowNavigateUrl(href);
484
486
  }}
485
487
  >
486
488
  {framed}
@@ -562,23 +564,27 @@ function RenderedButton({
562
564
  }
563
565
 
564
566
  function baseText(theme: ThemeFragment): TextStyle {
567
+ const fontFamily = resolveContentFontFamily(theme);
565
568
  return {
566
569
  color: theme.fontColor,
567
- fontFamily: theme.fontFamily || undefined,
568
570
  fontSize: theme.fontSize,
571
+ // Omit the key when unset. An explicit `undefined` is flattened to null,
572
+ // and RN treats that as "use the default face" rather than keeping a
573
+ // family set earlier on the same run.
574
+ ...(fontFamily != null ? { fontFamily } : {}),
569
575
  };
570
576
  }
571
577
 
572
578
  function markStyle(node: AbstractRichContentTextFormatting): TextStyle {
573
- return {
574
- fontWeight: node.bold ? '700' : undefined,
575
- fontStyle: node.italic ? 'italic' : undefined,
576
- textDecorationLine: textDecoration(node),
577
- fontSize: node.small ? 12 : node.sup ? 10 : undefined,
578
- color: node.color || undefined,
579
- // Inline `code` uses View chrome via RenderedText / RenderedAttribute.
580
- fontFamily: node.code ? monoFontFamily() : undefined,
581
- };
579
+ const style: TextStyle = {};
580
+ if (node.bold) style.fontWeight = '700';
581
+ if (node.italic) style.fontStyle = 'italic';
582
+ const decoration = textDecoration(node);
583
+ if (decoration) style.textDecorationLine = decoration;
584
+ if (node.small) style.fontSize = 12;
585
+ else if (node.sup) style.fontSize = 10;
586
+ if (node.color) style.color = node.color;
587
+ return style;
582
588
  }
583
589
 
584
590
  /** View wrapper so inline code padding/radius work reliably on Android. */
@@ -9,6 +9,7 @@ import type { TextStyle } from 'react-native';
9
9
  import { Platform, Pressable, StyleSheet, Text } from 'react-native';
10
10
 
11
11
  import { isPrimaryButtonAppearance } from './buttonAppearance';
12
+ import { resolveContentFontFamily } from './resolveContentFontFamily';
12
13
  import { resolveStepButtonChrome, stepButtonContainerStyle } from './resolveStepButtonChrome';
13
14
 
14
15
  export interface StepButtonProps {
@@ -45,7 +46,7 @@ export function StepButton({
45
46
  styles.label,
46
47
  {
47
48
  color: chrome.fontColor,
48
- fontFamily: theme.fontFamily || undefined,
49
+ fontFamily: resolveContentFontFamily(theme),
49
50
  fontSize: chrome.fontSize,
50
51
  fontWeight: chrome.fontWeight,
51
52
  ...labelMetrics(chrome.lineHeight),
@@ -15,7 +15,9 @@ export function isSafeUrl(url: string | null | undefined): boolean {
15
15
  const parsed = new URL(trimmed);
16
16
  return ALLOWED_PROTOCOLS.has(parsed.protocol);
17
17
  } catch {
18
- return false;
18
+ // Hermes / older runtimes can lack a full URL implementation; still allow
19
+ // obvious http(s) strings so NAVIGATE does not fall through to Expo Router.
20
+ return /^https?:\/\//i.test(trimmed);
19
21
  }
20
22
  }
21
23
 
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Font family for SDK content text.
3
+ *
4
+ * A single concrete theme family is kept. A comma-separated custom list keeps
5
+ * the first family that is not part of the default system stack. That stack,
6
+ * generics, and empty values use the detected app font, or omit `fontFamily`
7
+ * so the platform face renders with no warning.
8
+ */
9
+ import type { ThemeFragment } from '@userflow-tech/protocol';
10
+
11
+ import {
12
+ concreteFontFamily,
13
+ detectAppFontFamily,
14
+ isBareCssFamily,
15
+ isIconFontFamily,
16
+ splitCssFamilies,
17
+ themeConcreteFontFamily,
18
+ } from '../anchors/fiber/detectAppFontFamily';
19
+
20
+ export type AppFontDetector = () => string | null;
21
+
22
+ const CSS_FONT_FALLBACK = 'system-ui, sans-serif';
23
+
24
+ export function resolveContentFontFamily(
25
+ theme: ThemeFragment,
26
+ detect: AppFontDetector = detectAppFontFamily,
27
+ ): string | undefined {
28
+ return explicitThemeFamily(theme) ?? detectedFamily(detect);
29
+ }
30
+
31
+ /**
32
+ * CSS `font-family` for banner WebViews. Names are quoted so a multi-word
33
+ * family stays one face. A substituted app face keeps a platform fallback for
34
+ * when the WebView cannot resolve it.
35
+ */
36
+ export function contentFontFamilyCss(
37
+ theme: ThemeFragment,
38
+ detect: AppFontDetector = detectAppFontFamily,
39
+ ): string {
40
+ const authored = explicitThemeCss(theme);
41
+ if (authored) return authored;
42
+ const family = detectedFamily(detect);
43
+ if (!family) return CSS_FONT_FALLBACK;
44
+ return `${quoteCssFamily(family)}, ${CSS_FONT_FALLBACK}`;
45
+ }
46
+
47
+ /**
48
+ * `@font-face` rule that publishes the native family name inside the WebView.
49
+ *
50
+ * One regular face only. A weight range would make that static file match
51
+ * bold, and an italic rule with the same upright source would match italic,
52
+ * so the WebView would not synthesize either. `local()` is the family native
53
+ * text already uses. A `file://` source is not included: iOS treats that URL
54
+ * as a navigation and replaces the banner page.
55
+ */
56
+ export function contentFontFaceCss(
57
+ theme: ThemeFragment,
58
+ detect: AppFontDetector = detectAppFontFamily,
59
+ ): string {
60
+ const family = resolvedFamily(theme, detect);
61
+ if (!family) return '';
62
+ const quoted = quoteCssFamily(family);
63
+ return `@font-face{font-family:${quoted};src:local(${quoted});font-weight:400;font-style:normal;font-display:swap;}`;
64
+ }
65
+
66
+ /**
67
+ * Re-applies the banner face after theme custom.css. Equal-specificity rules
68
+ * in that stylesheet would otherwise replace it with a web font the WebView
69
+ * has not loaded. Code stays mono, including `<strong>`, `<em>`, and `<u>`
70
+ * wrapped inside `<code>`.
71
+ */
72
+ export function bannerContentFontLockCss(
73
+ theme: ThemeFragment,
74
+ detect: AppFontDetector = detectAppFontFamily,
75
+ ): string {
76
+ const family = contentFontFamilyCss(theme, detect);
77
+ return (
78
+ `.userflowjs-banner-root,.userflowjs-banner-root *:not(code):not(pre){font-family:${family};}` +
79
+ `.userflowjs-banner-root code,.userflowjs-banner-root pre,` +
80
+ `.userflowjs-banner-root code *,.userflowjs-banner-root pre *{font-family:ui-monospace,Menlo,monospace;}`
81
+ );
82
+ }
83
+
84
+ function resolvedFamily(theme: ThemeFragment, detect: AppFontDetector): string | undefined {
85
+ return explicitThemeFamily(theme) ?? detectedFamily(detect);
86
+ }
87
+
88
+ function explicitThemeFamily(theme: ThemeFragment): string | undefined {
89
+ return themeConcreteFontFamily(theme.fontFamily);
90
+ }
91
+
92
+ /** Authored theme list, quoted so a multi-word family stays one face. */
93
+ function explicitThemeCss(theme: ThemeFragment): string | undefined {
94
+ const native = explicitThemeFamily(theme);
95
+ if (!native) return undefined;
96
+ const parts = splitCssFamilies(theme.fontFamily);
97
+ if (parts.length <= 1) return quoteCssFamily(native);
98
+ return parts.map((part) => (isBareCssFamily(part) ? part : quoteCssFamily(part))).join(', ');
99
+ }
100
+
101
+ function detectedFamily(detect: AppFontDetector): string | undefined {
102
+ try {
103
+ const detected = detect();
104
+ if (typeof detected !== 'string') return undefined;
105
+ const concrete = concreteFontFamily(detected);
106
+ if (!concrete || isIconFontFamily(concrete)) return undefined;
107
+ return concrete;
108
+ } catch {
109
+ return undefined;
110
+ }
111
+ }
112
+
113
+ function quoteCssFamily(name: string): string {
114
+ return `"${escapeCssFamily(name)}"`;
115
+ }
116
+
117
+ function escapeCssFamily(name: string): string {
118
+ return name.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
119
+ }
@@ -6,7 +6,11 @@ import {
6
6
  readNavigationPresentation,
7
7
  subscribeNavigationState,
8
8
  } from '../navigation/isOverlayPresentation';
9
- import { setExpoRouterNavigator } from '../navigation/openFlowNavigateUrl';
9
+ import {
10
+ mustNotUseExpoRouterPush,
11
+ shouldOpenExternalNavigateUrl,
12
+ } from '../navigation/navigateUrlUtils';
13
+ import { openFlowNavigateUrl, setExpoRouterNavigator } from '../navigation/openFlowNavigateUrl';
10
14
  import { handleScreenChange } from '../screenTracker';
11
15
 
12
16
  /**
@@ -73,6 +77,11 @@ export function useUserflowExpoRouter(): void {
73
77
  useEffect(() => {
74
78
  setExpoRouterNavigator({
75
79
  push: (href) => {
80
+ const trimmed = String(href).trim();
81
+ if (mustNotUseExpoRouterPush(trimmed) || shouldOpenExternalNavigateUrl(trimmed)) {
82
+ void openFlowNavigateUrl(trimmed);
83
+ return;
84
+ }
76
85
  router.push(href as never);
77
86
  },
78
87
  });
package/src/index.ts CHANGED
@@ -22,6 +22,7 @@ import type {
22
22
 
23
23
  import './anchors/autoAnchor';
24
24
  import { anchorChangeTicker } from './anchors/anchorChangeTicker';
25
+ import { resetDetectedAppFont } from './anchors/fiber/detectAppFontFamily';
25
26
  import { notifyAnchorScreenChange } from './anchors/resolveAnchorHost';
26
27
  import {
27
28
  setCustomScrollIntoView as setCustomScrollIntoViewConfig,
@@ -80,13 +81,13 @@ import {
80
81
  attachFlowSessionEngine,
81
82
  cancelPendingDraftEnd,
82
83
  clearFlowSessionEngineLocalSession,
83
- endDraftFlowSession,
84
84
  endEvalJsFlowSession,
85
85
  getFlowSessionEngine,
86
86
  hasActiveFlowSession,
87
87
  resetFlowSessionEngine,
88
88
  } from './runtime/flowEngine';
89
89
  import { isolateAsync, isolateSync } from './runtime/isolateCall';
90
+ import { endDraftPreviewSessions, prepareForBuilderPreviewStart } from './runtime/previewStart';
90
91
  import { getUserflowCore } from './runtime/userflowCore';
91
92
  import {
92
93
  disableScreenTracking,
@@ -100,7 +101,9 @@ import {
100
101
  } from './screenTracker';
101
102
  import { setSurfaceInteractionBlocking as setSurfaceInteractionBlockingConfig } from './surfaces/surfaceInteractionConfig';
102
103
 
103
- export { SDK_VERSION } from './version';
104
+ import { SDK_VERSION } from './version';
105
+
106
+ export { SDK_VERSION };
104
107
  export type { DeviceContext, DeviceOs, DeviceType, SdkPlatform } from './deviceContext';
105
108
  export type { HostAppVersion, HostAppVersionSource } from './hostAppVersion';
106
109
  export { EmbedBannerPlaceholder } from './runtime/EmbedBannerPlaceholder';
@@ -141,8 +144,8 @@ export type {
141
144
  /** Configuration passed to {@link Userflow.init}. */
142
145
  export type UserflowInitConfig = UserflowInitOptions & {
143
146
  /**
144
- * Optional host handler for flow NAVIGATE actions. When set, wins over
145
- * React Navigation / Expo Router / Linking.
147
+ * Optional host handler for flow and banner NAVIGATE actions. When set, wins
148
+ * over React Navigation / Expo Router / Linking.
146
149
  */
147
150
  onNavigate?: FlowNavigateHandler;
148
151
  /**
@@ -297,6 +300,10 @@ export const Userflow = {
297
300
  ...(config.appBuild !== undefined ? { appBuild: config.appBuild } : {}),
298
301
  });
299
302
  warnIfInstallIncomplete();
303
+ if (__DEV__) {
304
+ // eslint-disable-next-line no-console -- intentional development diagnostic
305
+ console.log(`[Userflow] react-native SDK ${SDK_VERSION} (source)`);
306
+ }
300
307
  cacheDeviceContextAtInit();
301
308
  setHostOnNavigate(config.onNavigate);
302
309
  lifecycle.start();
@@ -311,6 +318,7 @@ export const Userflow = {
311
318
  // the success path makes a failed init look like a broken deep link.
312
319
  const pairing = installPairingController(core, {
313
320
  ...(config.pairingEndpoint !== undefined ? { pairingEndpoint: config.pairingEndpoint } : {}),
321
+ prepareForBuilderPreviewStart: () => prepareForBuilderPreviewStart(core),
314
322
  clearLocalSession: () => {
315
323
  clearFlowSessionEngineLocalSession();
316
324
  core.setFlowSessionId(null);
@@ -318,7 +326,7 @@ export const Userflow = {
318
326
  core.setBannerSessionId(null);
319
327
  evalJsController.reset();
320
328
  },
321
- endDraftSession: endDraftFlowSession,
329
+ endDraftSession: endDraftPreviewSessions,
322
330
  cancelPendingDraftEnd,
323
331
  });
324
332
  pairing.notifyInitStarted();
@@ -354,8 +362,8 @@ export const Userflow = {
354
362
  return getPairingController(core).exitPreview();
355
363
  },
356
364
  /**
357
- * Override or clear the host NAVIGATE handler (same as `init({ onNavigate })`).
358
- * Wins over React Navigation / Expo Router / Linking when set.
365
+ * Override or clear the host NAVIGATE handler for flows and banners (same as
366
+ * `init({ onNavigate })`). Wins over React Navigation / Expo Router / Linking.
359
367
  */
360
368
  setOnNavigate(handler: FlowNavigateHandler | null | undefined): void {
361
369
  setHostOnNavigate(handler);
@@ -372,7 +380,9 @@ export const Userflow = {
372
380
  if (previousId != null && previousId !== userId) {
373
381
  resetClientConditionEngine();
374
382
  core.setClientConditions([]);
375
- clearBannerSessionEngineLocalSession();
383
+ clearFlowSessionEngineLocalSession();
384
+ clearBannerSessionEngineLocalSession({ rememberDraftForPreviewEnd: false });
385
+ core.setFlowSessionId(null);
376
386
  core.setBannerSessionId(null);
377
387
  evalJsController.reset();
378
388
  await clearAnonymousId();
@@ -391,7 +401,9 @@ export const Userflow = {
391
401
  if (previousId != null && previousId !== anonymousId) {
392
402
  resetClientConditionEngine();
393
403
  core.setClientConditions([]);
394
- clearBannerSessionEngineLocalSession();
404
+ clearFlowSessionEngineLocalSession();
405
+ clearBannerSessionEngineLocalSession({ rememberDraftForPreviewEnd: false });
406
+ core.setFlowSessionId(null);
395
407
  core.setBannerSessionId(null);
396
408
  evalJsController.reset();
397
409
  armScreenViewedForNextIdentify();
@@ -482,6 +494,7 @@ export const Userflow = {
482
494
  },
483
495
  /** Clears the current user identity and disconnects from Userflow. */
484
496
  async reset(): Promise<void> {
497
+ resetDetectedAppFont();
485
498
  resetClientConditionEngine();
486
499
  resetFlowSessionEngine();
487
500
  resetBannerSessionEngine();