@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
@@ -1,9 +1,10 @@
1
1
  import type { FlowSessionEngine } from '@userflow-tech/core';
2
- import type {
3
- EndFlowReasonInput,
4
- FlowSessionFragment,
5
- FlowStepFragment,
6
- ThemeFragment,
2
+ import {
3
+ decodeMobileAutoData,
4
+ type EndFlowReasonInput,
5
+ type FlowSessionFragment,
6
+ type FlowStepFragment,
7
+ type ThemeFragment,
7
8
  } from '@userflow-tech/protocol';
8
9
  import * as React from 'react';
9
10
  import {
@@ -20,6 +21,7 @@ import {
20
21
  import { anchorRegistry } from '../anchors/AnchorRegistry';
21
22
  import { autoAnchorRegistry } from '../anchors/AutoAnchorRegistry';
22
23
  import { addAnimationFrameCallback, removeAnimationFrameCallback } from '../anchors/animationFrame';
24
+ import { isAppActive, subscribeAppActive } from '../anchors/appActive';
23
25
  import { fiberScanRoot } from '../anchors/fiber/FiberScanRoot';
24
26
  import type { AnyFiber } from '../anchors/fiber/fiberInternals';
25
27
  import { clipToScrollViewports } from '../anchors/fiber/visibleRect';
@@ -27,6 +29,7 @@ import {
27
29
  clearFiberAnchorCache,
28
30
  invalidateFiberAnchor,
29
31
  resolveAnchorHost,
32
+ subscribeAnchorScreenChange,
30
33
  } from '../anchors/resolveAnchorHost';
31
34
  import { resolveAutoAnchorHost } from '../anchors/resolveAutoAnchorHost';
32
35
  import { resolveManualAnchorId } from '../anchors/resolveManualAnchorId';
@@ -34,6 +37,7 @@ import { scrollAnchorIntoView } from '../anchors/scrollAnchorIntoView';
34
37
  import { getScrollPadding } from '../anchors/scrollConfig';
35
38
  import { targetPressMonitor } from '../anchors/targetPressMonitor';
36
39
  import { RichContentRenderer } from '../content/RichContentRenderer';
40
+ import { resolveContentFontFamily } from '../content/resolveContentFontFamily';
37
41
  import type { LookupAttribute } from '../content/types';
38
42
 
39
43
  import { CardFade } from './CardFade';
@@ -42,6 +46,7 @@ import { MADE_WITH_USERFLOW_GAP, MadeWithUserflow } from './MadeWithUserflow';
42
46
  import { ProgressBar } from './ProgressBar';
43
47
  import { ABSOLUTE_FILL } from './absoluteFill';
44
48
  import { useCardTransitionPhase } from './cardTransition';
49
+ import { stepTrapsHostAccessibility } from './hostAccessibilityTrap';
45
50
  import { parseBackdropOpacity } from './parseBackdropOpacity';
46
51
  import { resolveStepProgress } from './progress';
47
52
  import { resolveCloseButtonColor } from './resolveCloseButtonColor';
@@ -77,6 +82,7 @@ import {
77
82
  tooltipSideGap,
78
83
  tooltipVerticalGap,
79
84
  } from './tooltip/resolveSideCardWidth';
85
+ import { TargetSearchSchedule } from './tooltip/targetSearchSchedule';
80
86
 
81
87
  export interface TooltipSurfaceProps {
82
88
  engine: FlowSessionEngine;
@@ -94,10 +100,6 @@ export interface TooltipSurfaceProps {
94
100
 
95
101
  type MissingMode = 'waiting' | 'reported';
96
102
 
97
- /** Interval for re-resolving a missing / remounted anchor (not for live measure). */
98
- const RESOLVE_MS = 250;
99
- /** Slower resolve poll after FLAG/ERROR report so a late-mounting target can recover. */
100
- const RESOLVE_SLOW_MS = 1000;
101
103
  /**
102
104
  * One-frame delay before the first resolve after a step/reset so dialog
103
105
  * teardown cannot arm the missing-target timer with a 0-size measure.
@@ -155,6 +157,7 @@ export function TooltipSurface({
155
157
  }: TooltipSurfaceProps): React.ReactElement | null {
156
158
  const version = session.version;
157
159
  const chrome = resolveBubbleChrome(theme, 'tooltip');
160
+ const contentFontFamily = resolveContentFontFamily(theme);
158
161
  const progress = resolveStepProgress(version, currentStep.id);
159
162
  const showClose = !version.closeDisabled;
160
163
  const backdropOpacity = parseBackdropOpacity(theme.backdropOpacity);
@@ -162,6 +165,11 @@ export function TooltipSurface({
162
165
  const selector = currentStep.selector;
163
166
  const isAuto = (selector?.type as string | null) === 'AUTO';
164
167
  const autoData = selector?.autoData ?? null;
168
+ // Decoded once per step rather than on every search.
169
+ const decodedAutoData = React.useMemo(
170
+ () => (isAuto ? decodeMobileAutoData(autoData) : null),
171
+ [isAuto, autoData],
172
+ );
165
173
  const anchorId = isAuto ? null : resolveManualAnchorId(selector?.css);
166
174
  const targetKey = isAuto ? `auto:${autoData ?? ''}` : (anchorId ?? '');
167
175
  const highlight = currentStep.backdrop ? resolveHighlightChrome(theme, backdropPadding) : null;
@@ -191,7 +199,6 @@ export function TooltipSurface({
191
199
  desiredPlacement ?? 'BELOW',
192
200
  );
193
201
  const [missingMode, setMissingMode] = React.useState<MissingMode>('waiting');
194
- const [registryTick, setRegistryTick] = React.useState(0);
195
202
  /** True after at least one *failed* measure for the current step/anchor. */
196
203
  const [measureAttempted, setMeasureAttempted] = React.useState(false);
197
204
  /**
@@ -272,18 +279,6 @@ export function TooltipSurface({
272
279
  };
273
280
  }, []);
274
281
 
275
- React.useEffect(() => {
276
- const bump = () => setRegistryTick((n) => n + 1);
277
- const unsubRegistry = anchorRegistry.subscribe(bump);
278
- const unsubAuto = autoAnchorRegistry.subscribe(bump);
279
- const unsubScan = fiberScanRoot.subscribe(bump);
280
- return () => {
281
- unsubRegistry();
282
- unsubAuto();
283
- unsubScan();
284
- };
285
- }, []);
286
-
287
282
  React.useEffect(() => {
288
283
  reportedRef.current = false;
289
284
  scrollAttemptsRef.current = 0;
@@ -426,14 +421,14 @@ export function TooltipSurface({
426
421
  );
427
422
 
428
423
  /**
429
- * Resolve the anchor host (registry / fiber scan). Used by the interval and
430
- * on registry ticks — intentionally NOT on every animation frame.
424
+ * Resolve the anchor host (registry / fiber scan). Driven by
425
+ * {@link TargetSearchSchedule} — intentionally NOT on every animation frame.
431
426
  */
432
427
  const resolveTarget = React.useCallback(() => {
433
428
  if (!mountedRef.current) return;
434
429
 
435
430
  const resolution = isAuto
436
- ? resolveAutoAnchorHost(autoData)
431
+ ? resolveAutoAnchorHost(decodedAutoData)
437
432
  : anchorId
438
433
  ? resolveAnchorHost(anchorId)
439
434
  : null;
@@ -474,7 +469,7 @@ export function TooltipSurface({
474
469
  maybeScrollIntoView(rect);
475
470
  applyTarget(rect);
476
471
  });
477
- }, [anchorId, applyTarget, autoData, dropHost, isAuto, maybeScrollIntoView]);
472
+ }, [anchorId, applyTarget, decodedAutoData, dropHost, isAuto, maybeScrollIntoView]);
478
473
 
479
474
  /**
480
475
  * Live re-measure of an already-resolved host. Driven by the shared rAF hub
@@ -509,45 +504,60 @@ export function TooltipSurface({
509
504
  });
510
505
  }, [applyTarget, dropHost, maybeScrollIntoView]);
511
506
 
507
+ const resolveTargetRef = React.useRef(resolveTarget);
508
+ resolveTargetRef.current = resolveTarget;
509
+ const searchRef = React.useRef<TargetSearchSchedule | null>(null);
510
+ const searchAllowsRecovery =
511
+ behavior === 'FLAG' || behavior === 'ERROR' || (behavior === 'END' && session.draftMode);
512
+ const searchStopped = missingMode === 'reported' && !searchAllowsRecovery;
513
+
514
+ // Target search: steady poll while anchored, backoff while missing, nothing
515
+ // while the app is in the background. Live measurement is on rAF. A new step
516
+ // or target restarts it right away; a same-step restart (`resetNonce`) goes
517
+ // through `resolveArmed`, after the first-resolve delay.
512
518
  React.useEffect(() => {
513
- if (!resolveArmed) return;
514
- resolveTarget();
515
- }, [resolveTarget, registryTick, resolveArmed]);
516
-
517
- // Resolve poll: recover missing / remounted anchors. Live measurement is on rAF.
518
- React.useEffect(() => {
519
- if (!resolveArmed) {
520
- return;
521
- }
522
- const allowsRecovery =
523
- behavior === 'FLAG' || behavior === 'ERROR' || (behavior === 'END' && session.draftMode);
524
- const pauseAfterReport = missingMode === 'reported' && !allowsRecovery;
525
-
526
- if (pauseAfterReport) {
519
+ if (!resolveArmed || searchStopped) {
527
520
  return;
528
521
  }
529
-
530
- resolveTarget();
531
- const intervalMs = missingMode === 'reported' ? RESOLVE_SLOW_MS : RESOLVE_MS;
532
- const handle = setInterval(resolveTarget, intervalMs);
533
- const dimSub = Dimensions.addEventListener('change', resolveTarget);
522
+ const search = new TargetSearchSchedule(() => resolveTargetRef.current());
523
+ searchRef.current = search;
524
+ search.setMode(targetRef.current ? 'anchored' : 'missing');
525
+
526
+ const trigger = () => search.trigger();
527
+ const unsubscribers = [
528
+ anchorRegistry.subscribe(trigger),
529
+ autoAnchorRegistry.subscribe(trigger),
530
+ fiberScanRoot.subscribe(trigger),
531
+ subscribeAnchorScreenChange(() => search.rearm()),
532
+ subscribeAppActive((active) => (active ? search.resume() : search.pause())),
533
+ ];
534
+ if (!isAppActive()) search.pause();
535
+ search.runNow();
536
+
537
+ const dimSub = Dimensions.addEventListener('change', () => search.runNow());
534
538
  const onKeyboardShow = (event: { endCoordinates?: { height?: number } }) => {
535
539
  setKeyboardBottomInset(Math.max(0, event.endCoordinates?.height ?? 0));
536
- resolveTarget();
540
+ search.runNow();
537
541
  };
538
542
  const onKeyboardHide = () => {
539
543
  setKeyboardBottomInset(0);
540
- resolveTarget();
544
+ search.runNow();
541
545
  };
542
546
  const kbShow = Keyboard.addListener('keyboardDidShow', onKeyboardShow);
543
547
  const kbHide = Keyboard.addListener('keyboardDidHide', onKeyboardHide);
544
548
  return () => {
545
- clearInterval(handle);
549
+ for (const unsubscribe of unsubscribers) unsubscribe();
546
550
  dimSub.remove();
547
551
  kbShow.remove();
548
552
  kbHide.remove();
553
+ search.dispose();
554
+ if (searchRef.current === search) searchRef.current = null;
549
555
  };
550
- }, [resolveTarget, missingMode, behavior, session.draftMode, resolveArmed]);
556
+ }, [resolveArmed, searchStopped, currentStep.id, targetKey]);
557
+
558
+ React.useEffect(() => {
559
+ searchRef.current?.setMode(target ? 'anchored' : 'missing');
560
+ }, [target]);
551
561
 
552
562
  // rAF tracking while a host is resolved (and we are not paused after report).
553
563
  React.useEffect(() => {
@@ -864,6 +874,9 @@ export function TooltipSurface({
864
874
 
865
875
  const showBranding = session.flow.company.flowBranding;
866
876
  const contentPadding = chrome.contentPadding;
877
+ // Modal only while the host is trapped too. Otherwise VoiceOver would skip
878
+ // the host app, including the target this step asks the user to press.
879
+ const cardIsModal = stepTrapsHostAccessibility(currentStep);
867
880
 
868
881
  // Still pending the first measure attempt — only the blocker shows.
869
882
  if (isMissing && missingMode === 'waiting' && !measureAttempted) {
@@ -877,7 +890,7 @@ export function TooltipSurface({
877
890
  <View style={[styles.center, centerPaddingStyle]} pointerEvents="box-none">
878
891
  <CardFade
879
892
  testID="userflow-tooltip-waiting"
880
- accessibilityViewIsModal
893
+ accessibilityViewIsModal={cardIsModal}
881
894
  pointerEvents="auto"
882
895
  style={[
883
896
  chrome.shadowStyle,
@@ -904,6 +917,7 @@ export function TooltipSurface({
904
917
  <Text
905
918
  style={{
906
919
  color: theme.fontColor,
920
+ fontFamily: contentFontFamily,
907
921
  fontSize: theme.fontSize,
908
922
  marginTop: 12,
909
923
  textAlign: 'center',
@@ -951,11 +965,21 @@ export function TooltipSurface({
951
965
  {showMissingUi ? (
952
966
  <View testID="userflow-tooltip-missing">
953
967
  <Text
954
- style={[styles.missingTitle, { color: theme.fontColor, fontSize: theme.fontSize }]}
968
+ style={[
969
+ styles.missingTitle,
970
+ { color: theme.fontColor, fontFamily: contentFontFamily, fontSize: theme.fontSize },
971
+ ]}
955
972
  >
956
973
  Target not found
957
974
  </Text>
958
- <Text style={{ color: theme.fontColor, fontSize: theme.fontSize, opacity: 0.8 }}>
975
+ <Text
976
+ style={{
977
+ color: theme.fontColor,
978
+ fontFamily: contentFontFamily,
979
+ fontSize: theme.fontSize,
980
+ opacity: 0.8,
981
+ }}
982
+ >
959
983
  This step's anchor is missing. Close to continue, or wait if the screen is still
960
984
  loading.
961
985
  </Text>
@@ -990,7 +1014,7 @@ export function TooltipSurface({
990
1014
  <View style={[styles.center, centerPaddingStyle]} pointerEvents="box-none">
991
1015
  <CardFade
992
1016
  testID="userflow-tooltip-card"
993
- accessibilityViewIsModal
1017
+ accessibilityViewIsModal={cardIsModal}
994
1018
  pointerEvents="auto"
995
1019
  onLayout={onCardLayout}
996
1020
  style={[
@@ -1032,6 +1056,7 @@ export function TooltipSurface({
1032
1056
  onLayout={onCardLayout}
1033
1057
  maxHeight={layout.maxCardHeight}
1034
1058
  showNotch={layout.showNotch}
1059
+ accessibilityViewIsModal={cardIsModal}
1035
1060
  style={{
1036
1061
  position: 'absolute',
1037
1062
  left: layout.cardPosition.x,
@@ -3,10 +3,12 @@ import { BannerContentLayout } from '@userflow-tech/protocol';
3
3
  import type { ViewStyle } from 'react-native';
4
4
 
5
5
  import {
6
+ BANNER_CLOSE_SLOT_SIZE,
6
7
  BANNER_INNER_COLUMN_GAP,
7
8
  BANNER_INNER_MARGIN_HORIZONTAL,
8
9
  BANNER_INNER_ROW_GAP,
9
10
  BANNER_OVERLAY_SCREEN_INSET_HORIZONTAL,
11
+ BANNER_ROOT_PADDING,
10
12
  } from './bannerBarTokens';
11
13
  import type { EdgeInsets } from './safeArea';
12
14
 
@@ -16,13 +18,50 @@ function optionalMargin(value: number | null | undefined): number | undefined {
16
18
  return value == null ? undefined : value;
17
19
  }
18
20
 
21
+ /** Fixed horizontal chrome inside the embed width (padding, close/spacer slots, inner margins). */
22
+ export function bannerHorizontalChromeWidth(): number {
23
+ return BANNER_ROOT_PADDING * 2 + BANNER_CLOSE_SLOT_SIZE * 2 + BANNER_INNER_MARGIN_HORIZONTAL * 2;
24
+ }
25
+
26
+ /** Outer bar cap — max embed width only (max content width limits the inner row on web). */
27
+ export function resolveBannerFrameMaxWidth(banner: BannerFragment): number | null {
28
+ return banner.maxWidth;
29
+ }
30
+
31
+ export function bannerHasMaxContentWidth(banner: BannerFragment): boolean {
32
+ return banner.maxContentWidth != null;
33
+ }
34
+
35
+ /**
36
+ * Cap for the native inner row and WebView HTML `.userflowjs-banner-inner` only.
37
+ * Returns null when max content width is unset. May be 0 when embed width is narrower than chrome.
38
+ */
39
+ export function resolveBannerInnerMaxWidth(banner: BannerFragment): number | null {
40
+ if (!bannerHasMaxContentWidth(banner)) {
41
+ return null;
42
+ }
43
+ let cap = banner.maxContentWidth!;
44
+ if (banner.maxWidth != null) {
45
+ const embedInnerCap = Math.max(0, banner.maxWidth - bannerHorizontalChromeWidth());
46
+ cap = Math.min(cap, embedInnerCap);
47
+ }
48
+ return cap;
49
+ }
50
+
19
51
  /** Outer frame: max embed width and builder outer margin (web `userflowjs-banner-frame`). */
20
52
  export function bannerFrameStyle(banner: BannerFragment): ViewStyle {
21
- const hasMaxWidth = banner.maxWidth != null;
53
+ const frameMaxWidth = resolveBannerFrameMaxWidth(banner);
54
+ const hasFrameCap = frameMaxWidth != null;
22
55
 
23
56
  return {
24
- alignSelf: hasMaxWidth ? 'center' : 'stretch',
25
- ...(hasMaxWidth ? { maxWidth: banner.maxWidth! } : null),
57
+ alignSelf: hasFrameCap ? 'center' : 'stretch',
58
+ ...(hasFrameCap
59
+ ? {
60
+ maxWidth: frameMaxWidth!,
61
+ width: '100%' as const,
62
+ overflow: 'hidden' as const,
63
+ }
64
+ : null),
26
65
  marginTop: optionalMargin(banner.marginTop),
27
66
  marginRight: optionalMargin(banner.marginRight),
28
67
  marginBottom: optionalMargin(banner.marginBottom),
@@ -56,12 +95,45 @@ export function bannerInnerJustifyContent(
56
95
  }
57
96
  }
58
97
 
98
+ /**
99
+ * Push-layout chrome: safe-area pad + bar background on the same node as the
100
+ * fade so an animated banner does not leave a visible status-bar strip at opacity 0.
101
+ */
102
+ export function bannerPushLayoutChrome(
103
+ edge: 'top' | 'bottom',
104
+ insets: EdgeInsets,
105
+ backgroundColor: string,
106
+ ): ViewStyle {
107
+ return {
108
+ backgroundColor,
109
+ paddingTop: edge === 'top' ? insets.top : 0,
110
+ paddingBottom: edge === 'bottom' ? insets.bottom : 0,
111
+ };
112
+ }
113
+
114
+ /** Matches web `.userflowjs-banner-inner { flex(1000000) }` vs start-spacer `flex(1)`. */
115
+ const BANNER_INNER_FLEX_GROW = 1_000_000;
116
+
117
+ /** Painted bar (`userflow-banner`) — fill the frame so max embed width clips chrome, not just margins. */
118
+ export function bannerBarRootStyle(banner: BannerFragment): ViewStyle {
119
+ if (resolveBannerFrameMaxWidth(banner) == null) {
120
+ return {};
121
+ }
122
+ return {
123
+ width: '100%',
124
+ maxWidth: '100%',
125
+ };
126
+ }
127
+
59
128
  export function bannerInnerStyle(banner: BannerFragment): ViewStyle {
60
- const hasMaxContentWidth = banner.maxContentWidth != null;
129
+ const hasMaxContentWidth = bannerHasMaxContentWidth(banner);
130
+ const innerMaxWidth = resolveBannerInnerMaxWidth(banner);
61
131
  return {
62
- flexGrow: 1,
132
+ // Web `.userflowjs-banner-inner { flex(1000000) }` — grow with shrink so text wraps and close stays visible.
133
+ flexGrow: BANNER_INNER_FLEX_GROW,
63
134
  flexShrink: 1,
64
- flexBasis: 0,
135
+ // `auto` avoids the old `flexBasis: 0` + inner `width: 100%` sliver; `minWidth: 0` lets shrink wrap text.
136
+ flexBasis: hasMaxContentWidth ? ('auto' as const) : 0,
65
137
  flexDirection: 'row',
66
138
  flexWrap: 'wrap',
67
139
  alignItems: 'center',
@@ -69,6 +141,7 @@ export function bannerInnerStyle(banner: BannerFragment): ViewStyle {
69
141
  rowGap: BANNER_INNER_ROW_GAP,
70
142
  marginHorizontal: BANNER_INNER_MARGIN_HORIZONTAL,
71
143
  justifyContent: bannerInnerJustifyContent(banner.contentLayout),
72
- ...(hasMaxContentWidth ? { maxWidth: banner.maxContentWidth!, width: '100%' } : null),
144
+ minWidth: hasMaxContentWidth ? 0 : undefined,
145
+ ...(innerMaxWidth != null && innerMaxWidth > 0 ? { maxWidth: innerMaxWidth } : null),
73
146
  };
74
147
  }