@userflow-tech/react-native 0.2.0 → 0.3.1

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 (966) hide show
  1. package/README.md +435 -134
  2. package/app.plugin.js +11 -3
  3. package/babel-plugin/index.d.ts.map +1 -1
  4. package/babel-plugin/index.js +53 -6
  5. package/babel-plugin/index.js.map +1 -1
  6. package/babel-plugin.js +11 -3
  7. package/docs/anchoring.md +58 -42
  8. package/docs/deep-linking.md +70 -33
  9. package/docs/isolation.md +75 -0
  10. package/docs/troubleshooting.md +103 -44
  11. package/docs/webview-custom-banner-poc.md +64 -0
  12. package/expo-plugin/hostDependencyWarnings.d.ts +18 -0
  13. package/expo-plugin/hostDependencyWarnings.d.ts.map +1 -0
  14. package/expo-plugin/hostDependencyWarnings.js +91 -0
  15. package/expo-plugin/hostDependencyWarnings.js.map +1 -0
  16. package/expo-plugin/withUserflow.d.ts +3 -2
  17. package/expo-plugin/withUserflow.d.ts.map +1 -1
  18. package/expo-plugin/withUserflow.js +30 -8
  19. package/expo-plugin/withUserflow.js.map +1 -1
  20. package/lib/commonjs/anchors/AnchorRegistry.js +7 -0
  21. package/lib/commonjs/anchors/AnchorRegistry.js.map +1 -1
  22. package/lib/commonjs/anchors/AutoAnchorRegistry.js +37 -11
  23. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  24. package/lib/commonjs/anchors/elementConditionEvaluator.js +189 -55
  25. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  26. package/lib/commonjs/anchors/elementTapMonitor.js +92 -0
  27. package/lib/commonjs/anchors/elementTapMonitor.js.map +1 -0
  28. package/lib/commonjs/anchors/elementTargetMatch.js +85 -0
  29. package/lib/commonjs/anchors/elementTargetMatch.js.map +1 -0
  30. package/lib/commonjs/anchors/fiber/fiberPath.js +122 -0
  31. package/lib/commonjs/anchors/fiber/fiberPath.js.map +1 -0
  32. package/lib/commonjs/anchors/fiber/findAnchorFiber.js +122 -87
  33. package/lib/commonjs/anchors/fiber/findAnchorFiber.js.map +1 -1
  34. package/lib/commonjs/anchors/fiber/resolveFiberPath.js +220 -0
  35. package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -0
  36. package/lib/commonjs/anchors/fiber/touchTargetFiber.js +105 -0
  37. package/lib/commonjs/anchors/fiber/touchTargetFiber.js.map +1 -0
  38. package/lib/commonjs/anchors/fiber/visibleRect.js +147 -0
  39. package/lib/commonjs/anchors/fiber/visibleRect.js.map +1 -0
  40. package/lib/commonjs/anchors/fiber/visibleScreens.js +73 -36
  41. package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
  42. package/lib/commonjs/anchors/fiber/walkVisibleFibers.js +66 -0
  43. package/lib/commonjs/anchors/fiber/walkVisibleFibers.js.map +1 -0
  44. package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js +51 -0
  45. package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js.map +1 -0
  46. package/lib/commonjs/anchors/resolveAnchorHost.js +2 -1
  47. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  48. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +26 -17
  49. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
  50. package/lib/commonjs/anchors/resolveElementTargets.js +158 -0
  51. package/lib/commonjs/anchors/resolveElementTargets.js.map +1 -0
  52. package/lib/commonjs/anchors/semanticMatcher.js +26 -8
  53. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
  54. package/lib/commonjs/anchors/targetPressMonitor.js +9 -3
  55. package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -1
  56. package/lib/commonjs/anchors/useUserflowAnchor.js +1 -0
  57. package/lib/commonjs/anchors/useUserflowAnchor.js.map +1 -1
  58. package/lib/commonjs/anonymousId.js +19 -7
  59. package/lib/commonjs/anonymousId.js.map +1 -1
  60. package/lib/commonjs/authoring/ElementPickerOverlay.js +126 -50
  61. package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -1
  62. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +32 -10
  63. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -1
  64. package/lib/commonjs/authoring/chrome/ChromeButton.js +8 -3
  65. package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -1
  66. package/lib/commonjs/authoring/chrome/ChromeIcon.js +4 -0
  67. package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -1
  68. package/lib/commonjs/authoring/chrome/ChromeTopBar.js +23 -10
  69. package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -1
  70. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +19 -12
  71. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -1
  72. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +10 -0
  73. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -1
  74. package/lib/commonjs/authoring/chrome/icons/circle-exclamation.png +0 -0
  75. package/lib/commonjs/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  76. package/lib/commonjs/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  77. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation.png +0 -0
  78. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  79. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  80. package/lib/commonjs/authoring/chrome/tokens.js +7 -6
  81. package/lib/commonjs/authoring/chrome/tokens.js.map +1 -1
  82. package/lib/commonjs/authoring/elementPickerController.js.map +1 -1
  83. package/lib/commonjs/authoring/fingerprintFromInstance.js +204 -4
  84. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
  85. package/lib/commonjs/authoring/hitTest.js +264 -16
  86. package/lib/commonjs/authoring/hitTest.js.map +1 -1
  87. package/lib/commonjs/authoring/hostAtPoint.js +204 -0
  88. package/lib/commonjs/authoring/hostAtPoint.js.map +1 -0
  89. package/lib/commonjs/content/BannerStepButton.js +68 -0
  90. package/lib/commonjs/content/BannerStepButton.js.map +1 -0
  91. package/lib/commonjs/content/buttonAppearance.js +16 -0
  92. package/lib/commonjs/content/buttonAppearance.js.map +1 -1
  93. package/lib/commonjs/content/resolveBannerButtonChrome.js +44 -0
  94. package/lib/commonjs/content/resolveBannerButtonChrome.js.map +1 -0
  95. package/lib/commonjs/content/themeColor.js +15 -0
  96. package/lib/commonjs/content/themeColor.js.map +1 -1
  97. package/lib/commonjs/deepLinking.js +4 -4
  98. package/lib/commonjs/evalJs/EvalJsHost.js +244 -0
  99. package/lib/commonjs/evalJs/EvalJsHost.js.map +1 -0
  100. package/lib/commonjs/evalJs/bootstrap.js +84 -0
  101. package/lib/commonjs/evalJs/bootstrap.js.map +1 -0
  102. package/lib/commonjs/evalJs/bridgeMessages.js +143 -0
  103. package/lib/commonjs/evalJs/bridgeMessages.js.map +1 -0
  104. package/lib/commonjs/evalJs/evalJsBridge.js +31 -0
  105. package/lib/commonjs/evalJs/evalJsBridge.js.map +1 -0
  106. package/lib/commonjs/evalJs/evalJsController.js +124 -0
  107. package/lib/commonjs/evalJs/evalJsController.js.map +1 -0
  108. package/lib/commonjs/evalJs/getWebView.js +81 -0
  109. package/lib/commonjs/evalJs/getWebView.js.map +1 -0
  110. package/lib/commonjs/evalJs/injectEvalPending.js +19 -0
  111. package/lib/commonjs/evalJs/injectEvalPending.js.map +1 -0
  112. package/lib/commonjs/evalJs/types.js +2 -0
  113. package/lib/commonjs/evalJs/types.js.map +1 -0
  114. package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js +40 -0
  115. package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js.map +1 -0
  116. package/lib/commonjs/expo-router/index.js +19 -0
  117. package/lib/commonjs/expo-router/index.js.map +1 -1
  118. package/lib/commonjs/expo-router/redirectSystemPath.js +75 -0
  119. package/lib/commonjs/expo-router/redirectSystemPath.js.map +1 -0
  120. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +2 -2
  121. package/lib/commonjs/index.js +123 -43
  122. package/lib/commonjs/index.js.map +1 -1
  123. package/lib/commonjs/installCheck.js +151 -0
  124. package/lib/commonjs/installCheck.js.map +1 -0
  125. package/lib/commonjs/lifecycle.js.map +1 -1
  126. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +14 -11
  127. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
  128. package/lib/commonjs/navigation/openFlowNavigateUrl.js +12 -5
  129. package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
  130. package/lib/commonjs/pairing/PairingController.js +245 -27
  131. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  132. package/lib/commonjs/pairing/PreviewModeBanner.js +55 -16
  133. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
  134. package/lib/commonjs/pairing/deepLink.js +22 -5
  135. package/lib/commonjs/pairing/deepLink.js.map +1 -1
  136. package/lib/commonjs/pairing/deviceId.js +50 -0
  137. package/lib/commonjs/pairing/deviceId.js.map +1 -0
  138. package/lib/commonjs/pairing/diagnostics.js +5 -4
  139. package/lib/commonjs/pairing/diagnostics.js.map +1 -1
  140. package/lib/commonjs/pairing/tokenStorage.js +47 -7
  141. package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
  142. package/lib/commonjs/pairing/usePairingState.js +3 -1
  143. package/lib/commonjs/pairing/usePairingState.js.map +1 -1
  144. package/lib/commonjs/pairing/usePreviewBarHold.js +139 -0
  145. package/lib/commonjs/pairing/usePreviewBarHold.js.map +1 -0
  146. package/lib/commonjs/runtime/BannerHost.js +96 -0
  147. package/lib/commonjs/runtime/BannerHost.js.map +1 -0
  148. package/lib/commonjs/runtime/EmbedBannerPlaceholder.js +99 -0
  149. package/lib/commonjs/runtime/EmbedBannerPlaceholder.js.map +1 -0
  150. package/lib/commonjs/runtime/SdkErrorBoundary.js +61 -0
  151. package/lib/commonjs/runtime/SdkErrorBoundary.js.map +1 -0
  152. package/lib/commonjs/runtime/TargetPressBridge.js +31 -13
  153. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  154. package/lib/commonjs/runtime/UserflowOverlay.js +97 -0
  155. package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -0
  156. package/lib/commonjs/runtime/UserflowProvider.js +138 -65
  157. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  158. package/lib/commonjs/runtime/bannerEngine.js +63 -0
  159. package/lib/commonjs/runtime/bannerEngine.js.map +1 -0
  160. package/lib/commonjs/runtime/bannerEngineContext.js +11 -0
  161. package/lib/commonjs/runtime/bannerEngineContext.js.map +1 -0
  162. package/lib/commonjs/runtime/bannerPlacement.js +37 -0
  163. package/lib/commonjs/runtime/bannerPlacement.js.map +1 -0
  164. package/lib/commonjs/runtime/embedBannerRegistry.js +30 -0
  165. package/lib/commonjs/runtime/embedBannerRegistry.js.map +1 -0
  166. package/lib/commonjs/runtime/flowEngine.js +75 -3
  167. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  168. package/lib/commonjs/runtime/isolateCall.js +48 -0
  169. package/lib/commonjs/runtime/isolateCall.js.map +1 -0
  170. package/lib/commonjs/runtime/reportSdkError.js +19 -0
  171. package/lib/commonjs/runtime/reportSdkError.js.map +1 -0
  172. package/lib/commonjs/runtime/useBannerSession.js +37 -0
  173. package/lib/commonjs/runtime/useBannerSession.js.map +1 -0
  174. package/lib/commonjs/screenTracker.js +34 -9
  175. package/lib/commonjs/screenTracker.js.map +1 -1
  176. package/lib/commonjs/storage/asyncStorage.js +67 -0
  177. package/lib/commonjs/storage/asyncStorage.js.map +1 -0
  178. package/lib/commonjs/surfaces/BannerBar.js +160 -0
  179. package/lib/commonjs/surfaces/BannerBar.js.map +1 -0
  180. package/lib/commonjs/surfaces/BannerSurface.js +78 -0
  181. package/lib/commonjs/surfaces/BannerSurface.js.map +1 -0
  182. package/lib/commonjs/surfaces/MadeWithUserflow.js +12 -8
  183. package/lib/commonjs/surfaces/MadeWithUserflow.js.map +1 -1
  184. package/lib/commonjs/surfaces/ModalSurface.js +1 -1
  185. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
  186. package/lib/commonjs/surfaces/TooltipSurface.js +17 -1
  187. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  188. package/lib/commonjs/surfaces/bannerBarLayout.js +88 -0
  189. package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -0
  190. package/lib/commonjs/surfaces/bannerBarTokens.js +42 -0
  191. package/lib/commonjs/surfaces/bannerBarTokens.js.map +1 -0
  192. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +277 -0
  193. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
  194. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js +46 -0
  195. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
  196. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js +26 -0
  197. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
  198. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +41 -0
  199. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
  200. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +74 -0
  201. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
  202. package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js +152 -0
  203. package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
  204. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +148 -0
  205. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
  206. package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js +13 -0
  207. package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js.map +1 -0
  208. package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js +49 -0
  209. package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
  210. package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js +83 -0
  211. package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
  212. package/lib/commonjs/surfaces/resolveBannerTheme.js +22 -0
  213. package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -0
  214. package/lib/commonjs/surfaces/safeArea.js +76 -13
  215. package/lib/commonjs/surfaces/safeArea.js.map +1 -1
  216. package/lib/commonjs/version.js +1 -1
  217. package/lib/module/anchors/AnchorRegistry.js +7 -0
  218. package/lib/module/anchors/AnchorRegistry.js.map +1 -1
  219. package/lib/module/anchors/AutoAnchorRegistry.js +37 -11
  220. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  221. package/lib/module/anchors/elementConditionEvaluator.js +189 -55
  222. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  223. package/lib/module/anchors/elementTapMonitor.js +87 -0
  224. package/lib/module/anchors/elementTapMonitor.js.map +1 -0
  225. package/lib/module/anchors/elementTargetMatch.js +78 -0
  226. package/lib/module/anchors/elementTargetMatch.js.map +1 -0
  227. package/lib/module/anchors/fiber/fiberPath.js +118 -0
  228. package/lib/module/anchors/fiber/fiberPath.js.map +1 -0
  229. package/lib/module/anchors/fiber/findAnchorFiber.js +120 -87
  230. package/lib/module/anchors/fiber/findAnchorFiber.js.map +1 -1
  231. package/lib/module/anchors/fiber/resolveFiberPath.js +215 -0
  232. package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -0
  233. package/lib/module/anchors/fiber/touchTargetFiber.js +100 -0
  234. package/lib/module/anchors/fiber/touchTargetFiber.js.map +1 -0
  235. package/lib/module/anchors/fiber/visibleRect.js +139 -0
  236. package/lib/module/anchors/fiber/visibleRect.js.map +1 -0
  237. package/lib/module/anchors/fiber/visibleScreens.js +73 -37
  238. package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
  239. package/lib/module/anchors/fiber/walkVisibleFibers.js +61 -0
  240. package/lib/module/anchors/fiber/walkVisibleFibers.js.map +1 -0
  241. package/lib/module/anchors/isInstanceOnVisibleScreen.js +46 -0
  242. package/lib/module/anchors/isInstanceOnVisibleScreen.js.map +1 -0
  243. package/lib/module/anchors/resolveAnchorHost.js +2 -1
  244. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  245. package/lib/module/anchors/resolveAutoAnchorHost.js +25 -18
  246. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
  247. package/lib/module/anchors/resolveElementTargets.js +152 -0
  248. package/lib/module/anchors/resolveElementTargets.js.map +1 -0
  249. package/lib/module/anchors/semanticMatcher.js +26 -9
  250. package/lib/module/anchors/semanticMatcher.js.map +1 -1
  251. package/lib/module/anchors/targetPressMonitor.js +8 -3
  252. package/lib/module/anchors/targetPressMonitor.js.map +1 -1
  253. package/lib/module/anchors/useUserflowAnchor.js +1 -0
  254. package/lib/module/anchors/useUserflowAnchor.js.map +1 -1
  255. package/lib/module/anonymousId.js +18 -6
  256. package/lib/module/anonymousId.js.map +1 -1
  257. package/lib/module/authoring/ElementPickerOverlay.js +128 -52
  258. package/lib/module/authoring/ElementPickerOverlay.js.map +1 -1
  259. package/lib/module/authoring/chrome/ChromeBottomSheet.js +32 -10
  260. package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -1
  261. package/lib/module/authoring/chrome/ChromeButton.js +8 -3
  262. package/lib/module/authoring/chrome/ChromeButton.js.map +1 -1
  263. package/lib/module/authoring/chrome/ChromeIcon.js +4 -0
  264. package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -1
  265. package/lib/module/authoring/chrome/ChromeTopBar.js +23 -10
  266. package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -1
  267. package/lib/module/authoring/chrome/DoubleTapBridge.js +19 -12
  268. package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -1
  269. package/lib/module/authoring/chrome/doubleTapMonitor.js +10 -0
  270. package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -1
  271. package/lib/module/authoring/chrome/icons/circle-exclamation.png +0 -0
  272. package/lib/module/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  273. package/lib/module/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  274. package/lib/module/authoring/chrome/icons/triangle-exclamation.png +0 -0
  275. package/lib/module/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  276. package/lib/module/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  277. package/lib/module/authoring/chrome/tokens.js +7 -6
  278. package/lib/module/authoring/chrome/tokens.js.map +1 -1
  279. package/lib/module/authoring/elementPickerController.js.map +1 -1
  280. package/lib/module/authoring/fingerprintFromInstance.js +198 -4
  281. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
  282. package/lib/module/authoring/hitTest.js +264 -18
  283. package/lib/module/authoring/hitTest.js.map +1 -1
  284. package/lib/module/authoring/hostAtPoint.js +199 -0
  285. package/lib/module/authoring/hostAtPoint.js.map +1 -0
  286. package/lib/module/content/BannerStepButton.js +63 -0
  287. package/lib/module/content/BannerStepButton.js.map +1 -0
  288. package/lib/module/content/buttonAppearance.js +14 -0
  289. package/lib/module/content/buttonAppearance.js.map +1 -1
  290. package/lib/module/content/resolveBannerButtonChrome.js +41 -0
  291. package/lib/module/content/resolveBannerButtonChrome.js.map +1 -0
  292. package/lib/module/content/themeColor.js +14 -0
  293. package/lib/module/content/themeColor.js.map +1 -1
  294. package/lib/module/deepLinking.js +4 -4
  295. package/lib/module/evalJs/EvalJsHost.js +239 -0
  296. package/lib/module/evalJs/EvalJsHost.js.map +1 -0
  297. package/lib/module/evalJs/bootstrap.js +76 -0
  298. package/lib/module/evalJs/bootstrap.js.map +1 -0
  299. package/lib/module/evalJs/bridgeMessages.js +139 -0
  300. package/lib/module/evalJs/bridgeMessages.js.map +1 -0
  301. package/lib/module/evalJs/evalJsBridge.js +25 -0
  302. package/lib/module/evalJs/evalJsBridge.js.map +1 -0
  303. package/lib/module/evalJs/evalJsController.js +119 -0
  304. package/lib/module/evalJs/evalJsController.js.map +1 -0
  305. package/lib/module/evalJs/getWebView.js +76 -0
  306. package/lib/module/evalJs/getWebView.js.map +1 -0
  307. package/lib/module/evalJs/injectEvalPending.js +15 -0
  308. package/lib/module/evalJs/injectEvalPending.js.map +1 -0
  309. package/lib/module/evalJs/types.js +2 -0
  310. package/lib/module/evalJs/types.js.map +1 -0
  311. package/lib/module/evalJs/useEvalJsWebViewInjection.js +35 -0
  312. package/lib/module/evalJs/useEvalJsWebViewInjection.js.map +1 -0
  313. package/lib/module/expo-router/index.js +1 -0
  314. package/lib/module/expo-router/index.js.map +1 -1
  315. package/lib/module/expo-router/redirectSystemPath.js +70 -0
  316. package/lib/module/expo-router/redirectSystemPath.js.map +1 -0
  317. package/lib/module/expo-router/useUserflowExpoRouter.js +2 -2
  318. package/lib/module/index.js +119 -45
  319. package/lib/module/index.js.map +1 -1
  320. package/lib/module/installCheck.js +139 -0
  321. package/lib/module/installCheck.js.map +1 -0
  322. package/lib/module/lifecycle.js.map +1 -1
  323. package/lib/module/navigation/WithUserflowReactNavigation.js +14 -11
  324. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
  325. package/lib/module/navigation/openFlowNavigateUrl.js +12 -5
  326. package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
  327. package/lib/module/pairing/PairingController.js +245 -27
  328. package/lib/module/pairing/PairingController.js.map +1 -1
  329. package/lib/module/pairing/PreviewModeBanner.js +54 -16
  330. package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
  331. package/lib/module/pairing/deepLink.js +21 -5
  332. package/lib/module/pairing/deepLink.js.map +1 -1
  333. package/lib/module/pairing/deviceId.js +45 -0
  334. package/lib/module/pairing/deviceId.js.map +1 -0
  335. package/lib/module/pairing/diagnostics.js +5 -4
  336. package/lib/module/pairing/diagnostics.js.map +1 -1
  337. package/lib/module/pairing/tokenStorage.js +47 -7
  338. package/lib/module/pairing/tokenStorage.js.map +1 -1
  339. package/lib/module/pairing/usePairingState.js +3 -1
  340. package/lib/module/pairing/usePairingState.js.map +1 -1
  341. package/lib/module/pairing/usePreviewBarHold.js +134 -0
  342. package/lib/module/pairing/usePreviewBarHold.js.map +1 -0
  343. package/lib/module/runtime/BannerHost.js +92 -0
  344. package/lib/module/runtime/BannerHost.js.map +1 -0
  345. package/lib/module/runtime/EmbedBannerPlaceholder.js +94 -0
  346. package/lib/module/runtime/EmbedBannerPlaceholder.js.map +1 -0
  347. package/lib/module/runtime/SdkErrorBoundary.js +55 -0
  348. package/lib/module/runtime/SdkErrorBoundary.js.map +1 -0
  349. package/lib/module/runtime/TargetPressBridge.js +31 -13
  350. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  351. package/lib/module/runtime/UserflowOverlay.js +92 -0
  352. package/lib/module/runtime/UserflowOverlay.js.map +1 -0
  353. package/lib/module/runtime/UserflowProvider.js +139 -66
  354. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  355. package/lib/module/runtime/bannerEngine.js +55 -0
  356. package/lib/module/runtime/bannerEngine.js.map +1 -0
  357. package/lib/module/runtime/bannerEngineContext.js +7 -0
  358. package/lib/module/runtime/bannerEngineContext.js.map +1 -0
  359. package/lib/module/runtime/bannerPlacement.js +30 -0
  360. package/lib/module/runtime/bannerPlacement.js.map +1 -0
  361. package/lib/module/runtime/embedBannerRegistry.js +24 -0
  362. package/lib/module/runtime/embedBannerRegistry.js.map +1 -0
  363. package/lib/module/runtime/flowEngine.js +72 -3
  364. package/lib/module/runtime/flowEngine.js.map +1 -1
  365. package/lib/module/runtime/isolateCall.js +43 -0
  366. package/lib/module/runtime/isolateCall.js.map +1 -0
  367. package/lib/module/runtime/reportSdkError.js +15 -0
  368. package/lib/module/runtime/reportSdkError.js.map +1 -0
  369. package/lib/module/runtime/useBannerSession.js +33 -0
  370. package/lib/module/runtime/useBannerSession.js.map +1 -0
  371. package/lib/module/screenTracker.js +33 -9
  372. package/lib/module/screenTracker.js.map +1 -1
  373. package/lib/module/storage/asyncStorage.js +61 -0
  374. package/lib/module/storage/asyncStorage.js.map +1 -0
  375. package/lib/module/surfaces/BannerBar.js +155 -0
  376. package/lib/module/surfaces/BannerBar.js.map +1 -0
  377. package/lib/module/surfaces/BannerSurface.js +72 -0
  378. package/lib/module/surfaces/BannerSurface.js.map +1 -0
  379. package/lib/module/surfaces/MadeWithUserflow.js +11 -7
  380. package/lib/module/surfaces/MadeWithUserflow.js.map +1 -1
  381. package/lib/module/surfaces/ModalSurface.js +1 -1
  382. package/lib/module/surfaces/ModalSurface.js.map +1 -1
  383. package/lib/module/surfaces/TooltipSurface.js +17 -1
  384. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  385. package/lib/module/surfaces/bannerBarLayout.js +69 -0
  386. package/lib/module/surfaces/bannerBarLayout.js.map +1 -0
  387. package/lib/module/surfaces/bannerBarTokens.js +37 -0
  388. package/lib/module/surfaces/bannerBarTokens.js.map +1 -0
  389. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +272 -0
  390. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
  391. package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js +42 -0
  392. package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
  393. package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js +19 -0
  394. package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
  395. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +35 -0
  396. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
  397. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +69 -0
  398. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
  399. package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js +148 -0
  400. package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
  401. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +143 -0
  402. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
  403. package/lib/module/surfaces/bannerWebView/buttonClassName.js +9 -0
  404. package/lib/module/surfaces/bannerWebView/buttonClassName.js.map +1 -0
  405. package/lib/module/surfaces/bannerWebView/resolveCdnHost.js +42 -0
  406. package/lib/module/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
  407. package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js +79 -0
  408. package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
  409. package/lib/module/surfaces/resolveBannerTheme.js +16 -0
  410. package/lib/module/surfaces/resolveBannerTheme.js.map +1 -0
  411. package/lib/module/surfaces/safeArea.js +72 -13
  412. package/lib/module/surfaces/safeArea.js.map +1 -1
  413. package/lib/module/version.js +1 -1
  414. package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts +7 -0
  415. package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +14 -0
  417. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  418. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +12 -16
  419. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  420. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts +36 -0
  421. package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts +20 -0
  423. package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts +12 -0
  425. package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts +21 -8
  427. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
  428. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
  429. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
  430. package/lib/typescript/commonjs/src/anchors/fiber/touchTargetFiber.d.ts +24 -0
  431. package/lib/typescript/commonjs/src/anchors/fiber/touchTargetFiber.d.ts.map +1 -0
  432. package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts +32 -0
  433. package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts.map +1 -0
  434. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +6 -1
  435. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  436. package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
  437. package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
  438. package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
  439. package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
  440. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +2 -1
  441. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  442. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +10 -1
  443. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  444. package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts +39 -0
  445. package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts.map +1 -0
  446. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +6 -4
  447. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
  448. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +2 -0
  449. package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -1
  450. package/lib/typescript/commonjs/src/anchors/useUserflowAnchor.d.ts.map +1 -1
  451. package/lib/typescript/commonjs/src/anonymousId.d.ts +3 -0
  452. package/lib/typescript/commonjs/src/anonymousId.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +1 -0
  454. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
  456. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +1 -1
  459. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
  461. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
  462. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
  464. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +7 -6
  466. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +2 -3
  468. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -1
  469. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +57 -2
  470. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  471. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +47 -3
  472. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -1
  473. package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts +7 -0
  474. package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts +14 -0
  476. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -0
  477. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts +4 -0
  478. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts.map +1 -1
  479. package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts +8 -0
  480. package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
  481. package/lib/typescript/commonjs/src/content/themeColor.d.ts +2 -0
  482. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
  483. package/lib/typescript/commonjs/src/content/types.d.ts +1 -0
  484. package/lib/typescript/commonjs/src/content/types.d.ts.map +1 -1
  485. package/lib/typescript/commonjs/src/deepLinking.d.ts +4 -4
  486. package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts +14 -0
  487. package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts.map +1 -0
  488. package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts +18 -0
  489. package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts.map +1 -0
  490. package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts +37 -0
  491. package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts.map +1 -0
  492. package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts +16 -0
  493. package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts +24 -0
  495. package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts.map +1 -0
  496. package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts +64 -0
  497. package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts.map +1 -0
  498. package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts +4 -0
  499. package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts.map +1 -0
  500. package/lib/typescript/commonjs/src/evalJs/types.d.ts +53 -0
  501. package/lib/typescript/commonjs/src/evalJs/types.d.ts.map +1 -0
  502. package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
  503. package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
  504. package/lib/typescript/commonjs/src/expo-router/index.d.ts +1 -0
  505. package/lib/typescript/commonjs/src/expo-router/index.d.ts.map +1 -1
  506. package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts +50 -0
  507. package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts.map +1 -0
  508. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
  509. package/lib/typescript/commonjs/src/index.d.ts +16 -1
  510. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/installCheck.d.ts +33 -0
  512. package/lib/typescript/commonjs/src/installCheck.d.ts.map +1 -0
  513. package/lib/typescript/commonjs/src/lifecycle.d.ts +4 -1
  514. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
  515. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  516. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  517. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +71 -4
  518. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  519. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +9 -1
  520. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  521. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts +6 -2
  522. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts.map +1 -1
  523. package/lib/typescript/commonjs/src/pairing/deviceId.d.ts +12 -0
  524. package/lib/typescript/commonjs/src/pairing/deviceId.d.ts.map +1 -0
  525. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +3 -2
  526. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
  527. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +14 -2
  528. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
  529. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
  530. package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts +19 -0
  531. package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts.map +1 -0
  532. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts +16 -0
  533. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -0
  534. package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
  535. package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
  536. package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts +34 -0
  537. package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
  538. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +2 -1
  539. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  540. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts +15 -0
  541. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -0
  542. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +9 -3
  543. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  544. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +12 -0
  545. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -0
  546. package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts +5 -0
  547. package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts.map +1 -0
  548. package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts +12 -0
  549. package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts.map +1 -0
  550. package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts +5 -0
  551. package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts.map +1 -0
  552. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts +25 -1
  553. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  554. package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts +20 -0
  555. package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts.map +1 -0
  556. package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts +10 -0
  557. package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts.map +1 -0
  558. package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts +5 -0
  559. package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts.map +1 -0
  560. package/lib/typescript/commonjs/src/screenTracker.d.ts +7 -3
  561. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  562. package/lib/typescript/commonjs/src/storage/asyncStorage.d.ts +15 -0
  563. package/lib/typescript/commonjs/src/storage/asyncStorage.d.ts.map +1 -0
  564. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +14 -0
  565. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -0
  566. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +15 -0
  567. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -0
  568. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +10 -6
  569. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
  570. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  571. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +15 -0
  572. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -0
  573. package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts +20 -0
  574. package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts.map +1 -0
  575. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
  576. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
  577. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
  578. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
  579. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
  580. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
  581. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
  582. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
  583. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
  584. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
  585. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
  586. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
  587. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
  588. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
  589. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
  590. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
  591. package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
  592. package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
  593. package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
  594. package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
  595. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +7 -0
  596. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
  597. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts +9 -1
  598. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts.map +1 -1
  599. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  600. package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts +7 -0
  601. package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts.map +1 -1
  602. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +14 -0
  603. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  604. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +12 -16
  605. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  606. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts +36 -0
  607. package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts.map +1 -0
  608. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts +20 -0
  609. package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts.map +1 -0
  610. package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts +12 -0
  611. package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts.map +1 -0
  612. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts +21 -8
  613. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
  614. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
  615. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
  616. package/lib/typescript/module/src/anchors/fiber/touchTargetFiber.d.ts +24 -0
  617. package/lib/typescript/module/src/anchors/fiber/touchTargetFiber.d.ts.map +1 -0
  618. package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts +32 -0
  619. package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts.map +1 -0
  620. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +6 -1
  621. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  622. package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
  623. package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
  624. package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
  625. package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
  626. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +2 -1
  627. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  628. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +10 -1
  629. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  630. package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts +39 -0
  631. package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts.map +1 -0
  632. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +6 -4
  633. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
  634. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +2 -0
  635. package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -1
  636. package/lib/typescript/module/src/anchors/useUserflowAnchor.d.ts.map +1 -1
  637. package/lib/typescript/module/src/anonymousId.d.ts +3 -0
  638. package/lib/typescript/module/src/anonymousId.d.ts.map +1 -1
  639. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +1 -0
  640. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
  641. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
  642. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
  643. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
  644. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +1 -1
  645. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
  646. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
  647. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
  648. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
  649. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
  650. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
  651. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +7 -6
  652. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -1
  653. package/lib/typescript/module/src/authoring/elementPickerController.d.ts +2 -3
  654. package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -1
  655. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +57 -2
  656. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  657. package/lib/typescript/module/src/authoring/hitTest.d.ts +47 -3
  658. package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -1
  659. package/lib/typescript/module/src/authoring/hostAtPoint.d.ts +7 -0
  660. package/lib/typescript/module/src/authoring/hostAtPoint.d.ts.map +1 -0
  661. package/lib/typescript/module/src/content/BannerStepButton.d.ts +14 -0
  662. package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -0
  663. package/lib/typescript/module/src/content/buttonAppearance.d.ts +4 -0
  664. package/lib/typescript/module/src/content/buttonAppearance.d.ts.map +1 -1
  665. package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts +8 -0
  666. package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
  667. package/lib/typescript/module/src/content/themeColor.d.ts +2 -0
  668. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
  669. package/lib/typescript/module/src/content/types.d.ts +1 -0
  670. package/lib/typescript/module/src/content/types.d.ts.map +1 -1
  671. package/lib/typescript/module/src/deepLinking.d.ts +4 -4
  672. package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts +14 -0
  673. package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts.map +1 -0
  674. package/lib/typescript/module/src/evalJs/bootstrap.d.ts +18 -0
  675. package/lib/typescript/module/src/evalJs/bootstrap.d.ts.map +1 -0
  676. package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts +37 -0
  677. package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts.map +1 -0
  678. package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts +16 -0
  679. package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts.map +1 -0
  680. package/lib/typescript/module/src/evalJs/evalJsController.d.ts +24 -0
  681. package/lib/typescript/module/src/evalJs/evalJsController.d.ts.map +1 -0
  682. package/lib/typescript/module/src/evalJs/getWebView.d.ts +64 -0
  683. package/lib/typescript/module/src/evalJs/getWebView.d.ts.map +1 -0
  684. package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts +4 -0
  685. package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts.map +1 -0
  686. package/lib/typescript/module/src/evalJs/types.d.ts +53 -0
  687. package/lib/typescript/module/src/evalJs/types.d.ts.map +1 -0
  688. package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
  689. package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
  690. package/lib/typescript/module/src/expo-router/index.d.ts +1 -0
  691. package/lib/typescript/module/src/expo-router/index.d.ts.map +1 -1
  692. package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts +50 -0
  693. package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts.map +1 -0
  694. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
  695. package/lib/typescript/module/src/index.d.ts +16 -1
  696. package/lib/typescript/module/src/index.d.ts.map +1 -1
  697. package/lib/typescript/module/src/installCheck.d.ts +33 -0
  698. package/lib/typescript/module/src/installCheck.d.ts.map +1 -0
  699. package/lib/typescript/module/src/lifecycle.d.ts +4 -1
  700. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
  701. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  702. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  703. package/lib/typescript/module/src/pairing/PairingController.d.ts +71 -4
  704. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  705. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +9 -1
  706. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  707. package/lib/typescript/module/src/pairing/deepLink.d.ts +6 -2
  708. package/lib/typescript/module/src/pairing/deepLink.d.ts.map +1 -1
  709. package/lib/typescript/module/src/pairing/deviceId.d.ts +12 -0
  710. package/lib/typescript/module/src/pairing/deviceId.d.ts.map +1 -0
  711. package/lib/typescript/module/src/pairing/diagnostics.d.ts +3 -2
  712. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
  713. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +14 -2
  714. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
  715. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
  716. package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts +19 -0
  717. package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts.map +1 -0
  718. package/lib/typescript/module/src/runtime/BannerHost.d.ts +16 -0
  719. package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -0
  720. package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
  721. package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
  722. package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts +34 -0
  723. package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
  724. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +2 -1
  725. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  726. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts +15 -0
  727. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -0
  728. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +9 -3
  729. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  730. package/lib/typescript/module/src/runtime/bannerEngine.d.ts +12 -0
  731. package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -0
  732. package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts +5 -0
  733. package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts.map +1 -0
  734. package/lib/typescript/module/src/runtime/bannerPlacement.d.ts +12 -0
  735. package/lib/typescript/module/src/runtime/bannerPlacement.d.ts.map +1 -0
  736. package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts +5 -0
  737. package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts.map +1 -0
  738. package/lib/typescript/module/src/runtime/flowEngine.d.ts +25 -1
  739. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  740. package/lib/typescript/module/src/runtime/isolateCall.d.ts +20 -0
  741. package/lib/typescript/module/src/runtime/isolateCall.d.ts.map +1 -0
  742. package/lib/typescript/module/src/runtime/reportSdkError.d.ts +10 -0
  743. package/lib/typescript/module/src/runtime/reportSdkError.d.ts.map +1 -0
  744. package/lib/typescript/module/src/runtime/useBannerSession.d.ts +5 -0
  745. package/lib/typescript/module/src/runtime/useBannerSession.d.ts.map +1 -0
  746. package/lib/typescript/module/src/screenTracker.d.ts +7 -3
  747. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  748. package/lib/typescript/module/src/storage/asyncStorage.d.ts +15 -0
  749. package/lib/typescript/module/src/storage/asyncStorage.d.ts.map +1 -0
  750. package/lib/typescript/module/src/surfaces/BannerBar.d.ts +14 -0
  751. package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -0
  752. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +15 -0
  753. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -0
  754. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +10 -6
  755. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
  756. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  757. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +15 -0
  758. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -0
  759. package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts +20 -0
  760. package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts.map +1 -0
  761. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
  762. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
  763. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
  764. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
  765. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
  766. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
  767. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
  768. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
  769. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
  770. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
  771. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
  772. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
  773. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
  774. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
  775. package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
  776. package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
  777. package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
  778. package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
  779. package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
  780. package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
  781. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +7 -0
  782. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
  783. package/lib/typescript/module/src/surfaces/safeArea.d.ts +9 -1
  784. package/lib/typescript/module/src/surfaces/safeArea.d.ts.map +1 -1
  785. package/lib/typescript/module/src/version.d.ts +1 -1
  786. package/package.json +16 -3
  787. package/src/anchors/AnchorRegistry.ts +12 -0
  788. package/src/anchors/AutoAnchorRegistry.ts +41 -11
  789. package/src/anchors/elementConditionEvaluator.ts +235 -70
  790. package/src/anchors/elementTapMonitor.ts +95 -0
  791. package/src/anchors/elementTargetMatch.ts +90 -0
  792. package/src/anchors/fiber/fiberPath.ts +117 -0
  793. package/src/anchors/fiber/findAnchorFiber.ts +121 -80
  794. package/src/anchors/fiber/resolveFiberPath.ts +215 -0
  795. package/src/anchors/fiber/touchTargetFiber.ts +125 -0
  796. package/src/anchors/fiber/visibleRect.ts +153 -0
  797. package/src/anchors/fiber/visibleScreens.ts +74 -36
  798. package/src/anchors/fiber/walkVisibleFibers.ts +65 -0
  799. package/src/anchors/isInstanceOnVisibleScreen.ts +55 -0
  800. package/src/anchors/resolveAnchorHost.ts +2 -1
  801. package/src/anchors/resolveAutoAnchorHost.ts +20 -18
  802. package/src/anchors/resolveElementTargets.ts +165 -0
  803. package/src/anchors/semanticMatcher.ts +38 -14
  804. package/src/anchors/targetPressMonitor.ts +12 -3
  805. package/src/anchors/useUserflowAnchor.ts +1 -0
  806. package/src/anonymousId.ts +20 -8
  807. package/src/authoring/ElementPickerOverlay.tsx +168 -59
  808. package/src/authoring/chrome/ChromeBottomSheet.tsx +49 -8
  809. package/src/authoring/chrome/ChromeButton.tsx +9 -4
  810. package/src/authoring/chrome/ChromeIcon.tsx +10 -1
  811. package/src/authoring/chrome/ChromeTopBar.tsx +39 -15
  812. package/src/authoring/chrome/DoubleTapBridge.tsx +19 -12
  813. package/src/authoring/chrome/doubleTapMonitor.ts +10 -0
  814. package/src/authoring/chrome/icons/circle-exclamation.png +0 -0
  815. package/src/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  816. package/src/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  817. package/src/authoring/chrome/icons/triangle-exclamation.png +0 -0
  818. package/src/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  819. package/src/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  820. package/src/authoring/chrome/tokens.ts +7 -2
  821. package/src/authoring/elementPickerController.ts +2 -4
  822. package/src/authoring/fingerprintFromInstance.ts +170 -4
  823. package/src/authoring/hitTest.ts +324 -16
  824. package/src/authoring/hostAtPoint.ts +247 -0
  825. package/src/content/BannerStepButton.tsx +91 -0
  826. package/src/content/buttonAppearance.ts +16 -0
  827. package/src/content/resolveBannerButtonChrome.ts +49 -0
  828. package/src/content/themeColor.ts +15 -0
  829. package/src/content/types.ts +1 -0
  830. package/src/deepLinking.ts +4 -4
  831. package/src/evalJs/EvalJsHost.tsx +255 -0
  832. package/src/evalJs/bootstrap.ts +83 -0
  833. package/src/evalJs/bridgeMessages.ts +134 -0
  834. package/src/evalJs/evalJsBridge.ts +42 -0
  835. package/src/evalJs/evalJsController.ts +127 -0
  836. package/src/evalJs/getWebView.ts +124 -0
  837. package/src/evalJs/injectEvalPending.ts +14 -0
  838. package/src/evalJs/types.ts +56 -0
  839. package/src/evalJs/useEvalJsWebViewInjection.ts +37 -0
  840. package/src/expo-router/index.ts +8 -0
  841. package/src/expo-router/redirectSystemPath.ts +86 -0
  842. package/src/expo-router/useUserflowExpoRouter.ts +2 -2
  843. package/src/index.ts +139 -45
  844. package/src/installCheck.ts +191 -0
  845. package/src/lifecycle.ts +4 -1
  846. package/src/navigation/WithUserflowReactNavigation.tsx +13 -10
  847. package/src/navigation/openFlowNavigateUrl.ts +12 -5
  848. package/src/pairing/PairingController.ts +283 -29
  849. package/src/pairing/PreviewModeBanner.tsx +71 -14
  850. package/src/pairing/deepLink.ts +23 -5
  851. package/src/pairing/deviceId.ts +46 -0
  852. package/src/pairing/diagnostics.ts +6 -4
  853. package/src/pairing/tokenStorage.ts +60 -7
  854. package/src/pairing/usePairingState.ts +2 -0
  855. package/src/pairing/usePreviewBarHold.ts +160 -0
  856. package/src/runtime/BannerHost.tsx +102 -0
  857. package/src/runtime/EmbedBannerPlaceholder.tsx +115 -0
  858. package/src/runtime/SdkErrorBoundary.tsx +77 -0
  859. package/src/runtime/TargetPressBridge.tsx +36 -13
  860. package/src/runtime/UserflowOverlay.tsx +118 -0
  861. package/src/runtime/UserflowProvider.tsx +146 -64
  862. package/src/runtime/bannerEngine.ts +55 -0
  863. package/src/runtime/bannerEngineContext.ts +5 -0
  864. package/src/runtime/bannerPlacement.ts +36 -0
  865. package/src/runtime/embedBannerRegistry.ts +28 -0
  866. package/src/runtime/flowEngine.ts +76 -3
  867. package/src/runtime/isolateCall.ts +53 -0
  868. package/src/runtime/reportSdkError.ts +12 -0
  869. package/src/runtime/useBannerSession.ts +35 -0
  870. package/src/screenTracker.ts +34 -8
  871. package/src/storage/asyncStorage.ts +88 -0
  872. package/src/surfaces/BannerBar.tsx +176 -0
  873. package/src/surfaces/BannerSurface.tsx +82 -0
  874. package/src/surfaces/MadeWithUserflow.tsx +15 -10
  875. package/src/surfaces/ModalSurface.tsx +1 -1
  876. package/src/surfaces/TooltipSurface.tsx +17 -1
  877. package/src/surfaces/bannerBarLayout.ts +74 -0
  878. package/src/surfaces/bannerBarTokens.ts +34 -0
  879. package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +312 -0
  880. package/src/surfaces/bannerWebView/bannerAutoRunEvalJs.ts +44 -0
  881. package/src/surfaces/bannerWebView/bannerAutoRunSession.ts +19 -0
  882. package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +38 -0
  883. package/src/surfaces/bannerWebView/bannerThemeStyles.ts +91 -0
  884. package/src/surfaces/bannerWebView/bannerWebFrameCss.ts +145 -0
  885. package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +178 -0
  886. package/src/surfaces/bannerWebView/buttonClassName.ts +15 -0
  887. package/src/surfaces/bannerWebView/resolveCdnHost.ts +47 -0
  888. package/src/surfaces/bannerWebView/richContentDocToHtml.ts +99 -0
  889. package/src/surfaces/resolveBannerTheme.ts +18 -0
  890. package/src/surfaces/safeArea.ts +88 -19
  891. package/src/version.ts +1 -1
  892. package/vendor/core/dist/attributes.d.ts.map +1 -1
  893. package/vendor/core/dist/attributes.js +4 -4
  894. package/vendor/core/dist/attributes.js.map +1 -1
  895. package/vendor/core/dist/constants.d.ts +2 -0
  896. package/vendor/core/dist/constants.d.ts.map +1 -1
  897. package/vendor/core/dist/constants.js +2 -0
  898. package/vendor/core/dist/constants.js.map +1 -1
  899. package/vendor/core/dist/engine/BannerSessionEngine.d.ts +73 -0
  900. package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -0
  901. package/vendor/core/dist/engine/BannerSessionEngine.js +236 -0
  902. package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -0
  903. package/vendor/core/dist/engine/ClientConditionEngine.d.ts +20 -1
  904. package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -1
  905. package/vendor/core/dist/engine/ClientConditionEngine.js +13 -10
  906. package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -1
  907. package/vendor/core/dist/engine/FlowSessionEngine.d.ts +41 -1
  908. package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
  909. package/vendor/core/dist/engine/FlowSessionEngine.js +167 -28
  910. package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
  911. package/vendor/core/dist/engine/PairingEngine.d.ts +38 -2
  912. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  913. package/vendor/core/dist/engine/PairingEngine.js +19 -2
  914. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  915. package/vendor/core/dist/engine/UserflowCore.d.ts +10 -1
  916. package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
  917. package/vendor/core/dist/engine/UserflowCore.js +68 -29
  918. package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
  919. package/vendor/core/dist/engine/handleActions.d.ts +17 -3
  920. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  921. package/vendor/core/dist/engine/handleActions.js +17 -14
  922. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  923. package/vendor/core/dist/engine/trackCondition.d.ts +2 -0
  924. package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -1
  925. package/vendor/core/dist/engine/trackCondition.js +4 -2
  926. package/vendor/core/dist/engine/trackCondition.js.map +1 -1
  927. package/vendor/core/dist/engine/trackStepTriggers.d.ts +11 -1
  928. package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -1
  929. package/vendor/core/dist/engine/trackStepTriggers.js +42 -16
  930. package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -1
  931. package/vendor/core/dist/errors.d.ts +11 -1
  932. package/vendor/core/dist/errors.d.ts.map +1 -1
  933. package/vendor/core/dist/errors.js +2 -1
  934. package/vendor/core/dist/errors.js.map +1 -1
  935. package/vendor/core/dist/eventAttributes.d.ts.map +1 -1
  936. package/vendor/core/dist/eventAttributes.js +4 -2
  937. package/vendor/core/dist/eventAttributes.js.map +1 -1
  938. package/vendor/core/dist/index.d.ts +5 -2
  939. package/vendor/core/dist/index.d.ts.map +1 -1
  940. package/vendor/core/dist/index.js +1 -0
  941. package/vendor/core/dist/index.js.map +1 -1
  942. package/vendor/core/dist/normalizeAttributes.js +9 -7
  943. package/vendor/core/dist/normalizeAttributes.js.map +1 -1
  944. package/vendor/core/dist/transport/pairing.d.ts +5 -0
  945. package/vendor/core/dist/transport/pairing.d.ts.map +1 -1
  946. package/vendor/core/dist/transport/pairing.js +69 -2
  947. package/vendor/core/dist/transport/pairing.js.map +1 -1
  948. package/vendor/core/dist/transport/phoenix.d.ts +8 -0
  949. package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
  950. package/vendor/core/dist/transport/phoenix.js +16 -2
  951. package/vendor/core/dist/transport/phoenix.js.map +1 -1
  952. package/vendor/core/dist/version.d.ts +1 -1
  953. package/vendor/core/dist/version.js +1 -1
  954. package/vendor/core/package.json +1 -1
  955. package/vendor/protocol/dist/autoData.d.ts +8 -15
  956. package/vendor/protocol/dist/autoData.d.ts.map +1 -1
  957. package/vendor/protocol/dist/autoData.js.map +1 -1
  958. package/vendor/protocol/dist/flows.d.ts +58 -2
  959. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  960. package/vendor/protocol/dist/flows.js +20 -2
  961. package/vendor/protocol/dist/flows.js.map +1 -1
  962. package/vendor/protocol/dist/messages.d.ts +22 -12
  963. package/vendor/protocol/dist/messages.d.ts.map +1 -1
  964. package/vendor/protocol/dist/messages.js +5 -2
  965. package/vendor/protocol/dist/messages.js.map +1 -1
  966. package/vendor/protocol/package.json +1 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { Linking } from 'react-native';
4
4
  import { isSafeUrl, openSafeUrl } from "../content/openSafeUrl.js";
5
+ import { isolateAsync, isolateSync } from "../runtime/isolateCall.js";
5
6
  let hostOnNavigate = null;
6
7
  let navigationRef = null;
7
8
  let expoRouter = null;
@@ -63,7 +64,9 @@ export async function openFlowNavigateUrl(url) {
63
64
  const trimmed = url.trim();
64
65
  if (!trimmed) return;
65
66
  if (hostOnNavigate) {
66
- await hostOnNavigate(trimmed);
67
+ await isolateAsync('onNavigate', async () => {
68
+ await hostOnNavigate(trimmed);
69
+ });
67
70
  return;
68
71
  }
69
72
  if (isExternalNavigateUrl(trimmed)) {
@@ -72,13 +75,17 @@ export async function openFlowNavigateUrl(url) {
72
75
  }
73
76
  if (isInAppNavigateUrl(trimmed)) {
74
77
  if (expoRouter) {
75
- expoRouter.push(normalizeInAppPath(trimmed));
78
+ isolateSync('onNavigate', () => {
79
+ expoRouter.push(normalizeInAppPath(trimmed));
80
+ });
76
81
  return;
77
82
  }
78
83
  if (navigationRef?.isReady()) {
79
- const name = routeNameFromPath(trimmed);
80
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- route names are host-defined
81
- navigationRef.navigate(name);
84
+ isolateSync('onNavigate', () => {
85
+ const name = routeNameFromPath(trimmed);
86
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- route names are host-defined
87
+ navigationRef.navigate(name);
88
+ });
82
89
  return;
83
90
  }
84
91
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Linking","isSafeUrl","openSafeUrl","hostOnNavigate","navigationRef","expoRouter","setHostOnNavigate","handler","setReactNavigationRef","ref","setExpoRouterNavigator","router","isExternalNavigateUrl","url","isInAppNavigateUrl","trimmed","trim","test","normalizeInAppPath","startsWith","routeNameFromPath","path","normalized","replace","first","split","openFlowNavigateUrl","push","isReady","name","navigate","openURL","resetFlowNavigateRegistryForTests"],"sourceRoot":"../../../src","sources":["navigation/openFlowNavigateUrl.ts"],"mappings":";;AACA,SAASA,OAAO,QAAQ,cAAc;AAEtC,SAASC,SAAS,EAAEC,WAAW,QAAQ,2BAAwB;AAQ/D,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UAAU;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeI,mBAAmBA,CAACb,GAAW,EAAiB;EACpE,MAAME,OAAO,GAAGF,GAAG,CAACG,IAAI,CAAC,CAAC;EAC1B,IAAI,CAACD,OAAO,EAAE;EAEd,IAAIZ,cAAc,EAAE;IAClB,MAAMA,cAAc,CAACY,OAAO,CAAC;IAC7B;EACF;EAEA,IAAIH,qBAAqB,CAACG,OAAO,CAAC,EAAE;IAClC,MAAMb,WAAW,CAACa,OAAO,CAAC;IAC1B;EACF;EAEA,IAAID,kBAAkB,CAACC,OAAO,CAAC,EAAE;IAC/B,IAAIV,UAAU,EAAE;MACdA,UAAU,CAACsB,IAAI,CAACT,kBAAkB,CAACH,OAAO,CAAC,CAAC;MAC5C;IACF;IACA,IAAIX,aAAa,EAAEwB,OAAO,CAAC,CAAC,EAAE;MAC5B,MAAMC,IAAI,GAAGT,iBAAiB,CAACL,OAAO,CAAC;MACvC;MACCX,aAAa,CAA2C0B,QAAQ,CAACD,IAAW,CAAC;MAC9E;IACF;EACF;;EAEA;EACA,IAAI;IACF,MAAM7B,OAAO,CAAC+B,OAAO,CAAChB,OAAO,CAAC;EAChC,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ;;AAEA;AACA,OAAO,SAASiB,iCAAiCA,CAAA,EAAS;EACxD7B,cAAc,GAAG,IAAI;EACrBC,aAAa,GAAG,IAAI;EACpBC,UAAU,GAAG,IAAI;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["Linking","isSafeUrl","openSafeUrl","isolateAsync","isolateSync","hostOnNavigate","navigationRef","expoRouter","setHostOnNavigate","handler","setReactNavigationRef","ref","setExpoRouterNavigator","router","isExternalNavigateUrl","url","isInAppNavigateUrl","trimmed","trim","test","normalizeInAppPath","startsWith","routeNameFromPath","path","normalized","replace","first","split","openFlowNavigateUrl","push","isReady","name","navigate","openURL","resetFlowNavigateRegistryFor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EACxD7B,cAAc,GAAG,IAAI;EACrBC,aAAa,GAAG,IAAI;EACpBC,UAAU,GAAG,IAAI;AACnB","ignoreList":[]}
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  import { DEFAULT_PAIRING_ENDPOINT, PairingEngine } from '@userflow-tech/core';
4
+ import { decodePairingJwt, isPairingJwtExpired } from '@userflow-tech/protocol';
4
5
  import { AppState, Linking, Platform } from 'react-native';
5
6
  import { clearFiberAnchorCache } from "../anchors/fiberAnchorCache.js";
7
+ import { evalJsController } from "../evalJs/evalJsController.js";
6
8
  import { inspectPairingDeepLink, isPairingAttempt } from "./deepLink.js";
9
+ import { getOrCreatePairingDeviceId } from "./deviceId.js";
7
10
  import { defaultPairingLogger, pairingAttemptRejectionMessage, pairingConnectFailedMessage, pairingLinkDeferredMessage, pairingLinkInitFailedMessage, pairingListenerSetupFailedMessage, pairingPreviewErrorMessage, pairingTokenStoreClearFailedMessage } from "./diagnostics.js";
8
11
  import { bindElementPickerRelay } from "./elementPickerRelay.js";
9
12
  import { createPairingTokenStore } from "./tokenStorage.js";
@@ -28,10 +31,27 @@ export class PairingController {
28
31
  urlSub = null;
29
32
  appStateSub = null;
30
33
  listeners = new Set();
34
+ pairingDeviceId = null;
35
+ /** A link or resume already claimed this launch, so a stored token must not. */
36
+ acceptedPairingToken = false;
37
+ /**
38
+ * Bumped by exitPreview. An in-flight resume or connect checks it after
39
+ * every await and does not write the token or leave the socket up.
40
+ */
41
+ launchEpoch = 0;
42
+ /** Latest enterPreview. An older attempt must not clear a newer token. */
43
+ enterAttempt = 0;
44
+ /**
45
+ * Orders token and purpose writes. Two scans can overlap on the awaits, and
46
+ * the slower one's purpose must not land on the token the faster one saved.
47
+ */
48
+ previewSaveQueue = Promise.resolve();
31
49
  initPhase = 'ready';
32
50
  initFailureReason = null;
33
51
  /** Pairing token captured before init resolved, replayed once it does. */
34
52
  deferredPairingToken = null;
53
+ /** Purpose of {@link deferredPairingToken}, so the held banner already honours it. */
54
+ deferredPurpose = null;
35
55
  /** Diagnostics already emitted for the current init attempt. */
36
56
  loggedOnce = new Set();
37
57
  relayUnsub = null;
@@ -42,7 +62,10 @@ export class PairingController {
42
62
  this.LinkingModule = options.LinkingModule ?? Linking;
43
63
  this.AppStateModule = options.AppStateModule ?? AppState;
44
64
  this.clearLocalSession = options.clearLocalSession ?? undefined;
65
+ this.endDraftSession = options.endDraftSession ?? undefined;
66
+ this.cancelPendingDraftEnd = options.cancelPendingDraftEnd ?? undefined;
45
67
  this.logger = options.logger ?? defaultPairingLogger;
68
+ this.deviceIdProvider = options.deviceIdProvider ?? getOrCreatePairingDeviceId;
46
69
  }
47
70
  getEngine() {
48
71
  return this.engine;
@@ -55,6 +78,8 @@ export class PairingController {
55
78
  getState() {
56
79
  const blocked = this.blockedState();
57
80
  if (blocked) return blocked;
81
+ const held = this.heldState();
82
+ if (held) return held;
58
83
  return this.engine?.getState() ?? {
59
84
  status: 'idle',
60
85
  pairingId: null,
@@ -64,7 +89,9 @@ export class PairingController {
64
89
  needsRescan: false,
65
90
  awaitingStartCondition: false,
66
91
  canRestartPreview: false,
67
- previewRestartGeneration: 0
92
+ previewRestartGeneration: 0,
93
+ pairingSessionGeneration: 0,
94
+ previewStartGeneration: 0
68
95
  };
69
96
  }
70
97
 
@@ -83,7 +110,33 @@ export class PairingController {
83
110
  needsRescan: true,
84
111
  awaitingStartCondition: false,
85
112
  canRestartPreview: false,
86
- previewRestartGeneration: 0
113
+ previewRestartGeneration: 0,
114
+ pairingSessionGeneration: 0,
115
+ previewStartGeneration: 0
116
+ };
117
+ }
118
+
119
+ /**
120
+ * A link or resumed token is waiting for init. Report connecting so the
121
+ * banner is visible during credential validation instead of looking idle.
122
+ */
123
+ heldState() {
124
+ if (this.initPhase !== 'pending' || this.deferredPairingToken === null) return null;
125
+ return {
126
+ status: 'connecting',
127
+ pairingId: null,
128
+ deviceId: this.pairingDeviceId,
129
+ previewActive: true,
130
+ lastError: null,
131
+ needsRescan: false,
132
+ awaitingStartCondition: false,
133
+ canRestartPreview: false,
134
+ previewRestartGeneration: 0,
135
+ pairingSessionGeneration: 0,
136
+ previewStartGeneration: 0,
137
+ ...(this.deferredPurpose ? {
138
+ pairingPurpose: this.deferredPurpose
139
+ } : {})
87
140
  };
88
141
  }
89
142
  onStateChange(listener) {
@@ -108,14 +161,6 @@ export class PairingController {
108
161
  }
109
162
  }
110
163
  async startListening() {
111
- // Exit pairing on app restart: drop any leftover secure token. Guarded so a
112
- // storage failure cannot cost us the listeners registered below — losing
113
- // those is what makes an inbound QR link vanish without explanation.
114
- try {
115
- await this.tokenStore.clear();
116
- } catch (error) {
117
- this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
118
- }
119
164
  this.ensureEngine();
120
165
  this.urlSub = this.LinkingModule.addEventListener('url', ({
121
166
  url
@@ -138,6 +183,52 @@ export class PairingController {
138
183
  } catch {
139
184
  // Linking may throw on some platforms before the native module is ready.
140
185
  }
186
+
187
+ // A launch URL already claimed this process. Do not also resume storage.
188
+ if (this.acceptedPairingToken) return;
189
+ await this.resumeStoredToken();
190
+ }
191
+
192
+ /**
193
+ * Rejoin the Builder session after a relaunch when no new pairing link won.
194
+ * An expired or undecodable token is cleared so the next launch stays idle.
195
+ */
196
+ async resumeStoredToken() {
197
+ const epoch = this.launchEpoch;
198
+ let stored;
199
+ try {
200
+ stored = await this.tokenStore.get();
201
+ } catch (error) {
202
+ this.warnOnce(pairingConnectFailedMessage(describeError(error)));
203
+ return;
204
+ }
205
+ if (epoch !== this.launchEpoch || this.acceptedPairingToken || !stored) return;
206
+ const claims = decodePairingJwt(stored);
207
+ if (!claims || isPairingJwtExpired(claims)) {
208
+ // A link that arrived while we were reading storage owns the session.
209
+ if (epoch !== this.launchEpoch || this.acceptedPairingToken) return;
210
+ try {
211
+ const current = await this.tokenStore.get();
212
+ if (epoch !== this.launchEpoch || this.acceptedPairingToken || current !== stored) return;
213
+ await this.tokenStore.clear();
214
+ } catch (error) {
215
+ this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
216
+ }
217
+ return;
218
+ }
219
+ if (epoch !== this.launchEpoch || this.acceptedPairingToken) return;
220
+ let purpose = null;
221
+ try {
222
+ purpose = (await this.tokenStore.getPurpose?.()) ?? null;
223
+ } catch {
224
+ // Resume without it; the banner falls back to its default reveal.
225
+ }
226
+ if (epoch !== this.launchEpoch || this.acceptedPairingToken) return;
227
+ try {
228
+ await this.connectWhenReady(stored, 'resume', purpose);
229
+ } catch (error) {
230
+ this.warnOnce(pairingConnectFailedMessage(describeError(error)));
231
+ }
141
232
  }
142
233
  stop() {
143
234
  this.urlSub?.remove();
@@ -167,16 +258,32 @@ export class PairingController {
167
258
  this.warnOnce(pairingAttemptRejectionMessage(inspected.reason, url));
168
259
  return true;
169
260
  }
261
+ await this.connectWhenReady(inspected.link.pairingToken, 'link', inspected.link.purpose ?? null);
262
+ return true;
263
+ }
264
+
265
+ /**
266
+ * Connect now, or hold the token until init resolves or fails. Links and
267
+ * resumed sessions share this gate so both are deferred, replayed, and
268
+ * shown the same way.
269
+ */
270
+ async connectWhenReady(token, source = 'link', purpose = null) {
271
+ this.acceptedPairingToken = true;
170
272
  if (this.initPhase !== 'ready') {
171
273
  // Hold the token rather than discarding it. `notifyInitialized` replays it;
172
274
  // `notifyInitFailed` turns it into visible state.
173
- this.deferredPairingToken = inspected.link.pairingToken;
174
- this.warnOnce(this.initPhase === 'failed' ? pairingLinkInitFailedMessage(this.initFailureReason ?? 'unknown error') : pairingLinkDeferredMessage());
175
- if (this.initPhase === 'failed') this.emit(this.getState());
176
- return true;
275
+ this.deferredPairingToken = token;
276
+ this.deferredPurpose = purpose;
277
+ if (this.initPhase === 'failed') {
278
+ this.warnOnce(pairingLinkInitFailedMessage(this.initFailureReason ?? 'unknown error'));
279
+ } else if (source === 'link') {
280
+ // A resume waits on init on every relaunch; only a link needs this note.
281
+ this.warnOnce(pairingLinkDeferredMessage());
282
+ }
283
+ this.emit(this.getState());
284
+ return;
177
285
  }
178
- await this.enterPreview(inspected.link.pairingToken);
179
- return true;
286
+ await this.enterPreview(token, purpose);
180
287
  }
181
288
 
182
289
  /**
@@ -194,21 +301,25 @@ export class PairingController {
194
301
  }
195
302
 
196
303
  /**
197
- * Called when `Userflow.init()` resolves. Connects a link that arrived while
198
- * init was still in flight.
304
+ * Called when `Userflow.init()` resolves. Connects a link or resumed session
305
+ * that arrived while init was still in flight. `Userflow.init` does not await
306
+ * this — the pairing socket must not block identify.
199
307
  */
200
308
  async notifyInitialized() {
201
309
  this.initPhase = 'ready';
202
310
  this.initFailureReason = null;
203
311
  const deferred = this.deferredPairingToken;
204
312
  if (deferred === null) return;
313
+ const purpose = this.deferredPurpose;
205
314
  this.deferredPairingToken = null;
315
+ this.deferredPurpose = null;
206
316
  try {
207
- await this.enterPreview(deferred);
317
+ await this.enterPreview(deferred, purpose);
208
318
  } catch (error) {
209
- // Preview must not fail host init. `Userflow.init` awaits this, and
210
- // PairingEngine.start rethrows on every connect failure, so letting this
211
- // escape would let an expired QR token fail the host app's entire init.
319
+ // Preview must not fail host init. `Userflow.init` does not await this,
320
+ // and PairingEngine.start rethrows on every connect failure, so letting
321
+ // this escape would be an unhandled rejection — and, if it were awaited,
322
+ // an expired QR token would fail the host app's entire init.
212
323
  this.warnOnce(pairingConnectFailedMessage(describeError(error)));
213
324
  }
214
325
  }
@@ -237,16 +348,116 @@ export class PairingController {
237
348
  }
238
349
 
239
350
  /** Explicit entry with a raw pairing JWT (tests / advanced hosts). */
240
- async enterPreview(pairingToken) {
351
+ async enterPreview(pairingToken, purpose = null) {
352
+ const epoch = this.launchEpoch;
353
+ const attempt = ++this.enterAttempt;
241
354
  const engine = this.ensureEngine();
242
- await this.tokenStore.set(pairingToken);
243
- await engine.start(pairingToken);
355
+ // Before the first await, so an exit that runs later still arms its own end.
356
+ if (epoch === this.launchEpoch) this.cancelPendingDraftEnd?.();
357
+ const deviceId = await this.resolveDeviceId();
358
+ if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) return;
359
+ this.pairingDeviceId = deviceId;
360
+ const saved = await this.savePreviewCredentials(pairingToken, purpose, attempt, epoch);
361
+ if (!saved) return;
362
+ try {
363
+ await (purpose ? engine.start(pairingToken, {
364
+ purpose
365
+ }) : engine.start(pairingToken));
366
+ } catch (error) {
367
+ // A newer pair owns the engine now. Stopping here would drop it.
368
+ if (attempt !== this.enterAttempt) return;
369
+ if (epoch !== this.launchEpoch) {
370
+ // start() records a connect failure after stop() has already gone idle.
371
+ await this.discardPreviewToken(pairingToken, attempt);
372
+ this.engine?.stop();
373
+ return;
374
+ }
375
+ throw error;
376
+ }
377
+ if (attempt !== this.enterAttempt) return;
378
+ if (epoch !== this.launchEpoch) {
379
+ await this.discardPreviewToken(pairingToken, attempt);
380
+ this.engine?.stop();
381
+ }
382
+ }
383
+
384
+ /**
385
+ * Write the token and its purpose as one attempt. Writes are queued so an
386
+ * older scan cannot finish its purpose after a newer scan has saved its own.
387
+ * Returns false when this attempt lost the race; storage then still belongs
388
+ * to whoever connected, or is cleared if this attempt was the last writer.
389
+ */
390
+ async savePreviewCredentials(pairingToken, purpose, attempt, epoch) {
391
+ const previous = this.previewSaveQueue;
392
+ let release = () => undefined;
393
+ this.previewSaveQueue = new Promise(resolve => {
394
+ release = resolve;
395
+ });
396
+ try {
397
+ await previous;
398
+ if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) return false;
399
+ await this.tokenStore.set(pairingToken);
400
+ if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) {
401
+ await this.revertPreviewCredentials(pairingToken);
402
+ return false;
403
+ }
404
+ await this.tokenStore.setPurpose?.(purpose);
405
+ if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) {
406
+ await this.revertPreviewCredentials(pairingToken);
407
+ return false;
408
+ }
409
+ return true;
410
+ } finally {
411
+ release();
412
+ }
413
+ }
414
+
415
+ /**
416
+ * Drop credentials this attempt wrote, when they are still the ones stored.
417
+ * A newer scan may already have replaced them; those stay.
418
+ */
419
+ async revertPreviewCredentials(pairingToken) {
420
+ try {
421
+ const current = await this.tokenStore.get();
422
+ if (current !== pairingToken) return;
423
+ await this.tokenStore.clear();
424
+ } catch (error) {
425
+ this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
426
+ }
427
+ }
428
+
429
+ /**
430
+ * Remove the token this attempt wrote. A newer pair may already have
431
+ * replaced it; that token stays.
432
+ */
433
+ async discardPreviewToken(pairingToken, attempt) {
434
+ if (attempt !== this.enterAttempt) return;
435
+ try {
436
+ const current = await this.tokenStore.get();
437
+ if (attempt !== this.enterAttempt || current !== pairingToken) return;
438
+ await this.tokenStore.clear();
439
+ } catch (error) {
440
+ this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
441
+ }
442
+ }
443
+ async resolveDeviceId() {
444
+ if (this.pairingDeviceId !== null) return this.pairingDeviceId;
445
+ return this.deviceIdProvider();
244
446
  }
245
447
  async exitPreview() {
246
448
  // Drop any held link too, so dismissing a blocked banner actually clears it.
449
+ // Bump before the awaits so a resume still reading storage does not reconnect.
450
+ this.launchEpoch += 1;
451
+ evalJsController.reset();
247
452
  this.deferredPairingToken = null;
453
+ this.deferredPurpose = null;
248
454
  await this.tokenStore.clear();
249
455
  this.engine?.stop();
456
+ // Not awaited: the local clear is synchronous, and the banner must not wait
457
+ // on the end-user socket.
458
+ void this.endDraftSession?.().catch(error => {
459
+ this.warnOnce(pairingPreviewErrorMessage(describeError(error)));
460
+ });
250
461
  this.clearLocalSession?.();
251
462
  this.emit(this.getState());
252
463
  }
@@ -258,6 +469,7 @@ export class PairingController {
258
469
  async restartPreview() {
259
470
  if (!this.engine) return false;
260
471
  clearFiberAnchorCache();
472
+ evalJsController.reset();
261
473
  return this.engine.restartPreview();
262
474
  }
263
475
 
@@ -275,8 +487,14 @@ export class PairingController {
275
487
  pairingEndpoint: this.pairingEndpoint
276
488
  },
277
489
  deviceMeta: () => ({
278
- os: Platform.OS
279
- })
490
+ os: Platform.OS,
491
+ ...(this.pairingDeviceId !== null ? {
492
+ device_id: this.pairingDeviceId
493
+ } : {})
494
+ }),
495
+ onBeforePreviewStart: () => {
496
+ this.clearLocalSession?.();
497
+ }
280
498
  });
281
499
  this.engine.onStateChange(state => {
282
500
  this.emit(state);
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_PAIRING_ENDPOINT","PairingEngine","AppState","Linking","Platform","clearFiberAnchorCache","inspectPairingDeepLink","isPairingAttempt","defaultPairingLogger","pairingAttemptRejectionMessage","pairingConnectFailedMessage","pairingLinkDeferredMessage","pairingLinkInitFailedMessage","pairingListenerSetupFailedMessage","pairingPreviewErrorMessage","pairingTokenStoreClearFailedMessage","bindElementPickerRelay","createPairingTokenStore","PairingController","engine","started","urlSub","appStateSub","listeners","Set","initPhase","initFailureReason","deferredPairingToken","loggedOnce","relayUnsub","constructor","options","core","pairingEndpoint","tokenStore","LinkingModule","AppStateModule","clearLocalSession","undefined","logger","getEngine","hasStarted","getState","blocked","blockedState","status","pairingId","deviceId","previewActive","lastError","needsRescan","awaitingStartCondition","canRestartPreview","previewRestartGeneration","onStateChange","listener","add","delete","start","startListening","error","warnOnce","describeError","clear","ensureEngine","addEventListener","url","handleUrl","catch","next","ensureAlive","initial","getInitialURL","stop","remove","unbindRelay","exitPreview","inspected","ok","reason","link","pairingToken","emit","enterPreview","notifyInitStarted","wasBlocked","notifyInitialized","deferred","notifyInitFailed","message","has","set","restartPreview","notifyIdentified","sendClientMessage","send","onServerMessage","handler","isIdentified","getUserId","pairingOptions","deviceMeta","os","OS","state","Error","String"],"sourceRoot":"../../../src","sources":["pairing/PairingController.ts"],"mappings":";;AAAA,SACEA,wBAAwB,EACxBC,aAAa,QAGR,qBAAqB;AAC5B,SAASC,QAAQ,EAAuBC,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAE/E,SAASC,qBAAqB,QAAQ,gCAA6B;AAEnE,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ,eAAY;AACrE,SACEC,oBAAoB,EACpBC,8BAA8B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IAAIA,KAAK,YAAY6C,KAAK,EAAE,OAAO7C,KAAK,CAAC6B,OAAO;EAChD,IAAI,OAAO7B,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAC3C,OAAO8C,MAAM,CAAC9C,KAAK,CAAC;AACtB","ignoreList":[]}
1
+ {"version":3,"names":["DEFAULT_PAIRING_ENDPOINT","PairingEngine","decodePairingJwt","isPairingJwtExpired","AppState","Linking","Platform","clearFiberAnchorCache","evalJsController","inspectPairingDeepLink","isPairingAttempt","getOrCreatePairingDeviceId","defaultPairingLogger","pairingAttemptRejectionMessage","pairingConnectFailedMessage","pairingLinkDeferredMessage","pairingLinkInitFailedMessage","pairingListenerSetupFailedMessage","pairingPreviewErrorMessage","pairingTokenStoreClearFailedMessage","bindElementPickerRelay","createPairingTokenStore","PairingController","engine","started","urlSub","appStateSub","listeners","Set","pairingDeviceId","acceptedPairingToken","launchEpoch","enterAttempt","previewSaveQueue","Promise","resolve","initPhase","initFailureReason","deferredPairingToken","deferredPurpose","loggedOnce","relayUnsub","constructor","options","core","pairingEndpoint","tokenStore","LinkingModule","AppStateModule","clearLocalSession","undefined","endDraftSession","cancelPendingDraftEnd","logger","deviceIdProvider","getEngine","hasStarted","getState","blocked","blockedState","held","heldState","status","pairingId","deviceId","previewActive","lastError","needsRescan","awaitingStartCondition","canRestartPreview","previewRestartGeneration","pairingSessionGeneration","previewStartGeneration","pairingPurpose","onStateChange","listener","add","delete","start","startListening","error","warnOnce","describeError","ensureEngine","addEventListener","url","handleUrl","catch","next","ensureAlive","initial","getInitialURL","resumeStoredToken","epoch","stored","get","claims","current","clear","purpose","getPurpose","connectWhenReady","stop","remove","unbindRelay","exitPreview","inspected","ok","reason","link","pairingToken","token","source","emit","enterPreview","notifyInitStarted","wasBlocked","notifyInitialized","deferred","notifyInitFailed","message","has","attempt","resolveDeviceId","saved","savePreviewCredentials","discardPreviewToken","previous","release","set","revertPreviewCredentials","setPurpose","reset","restartPreview","notifyIdentified","sendClientMessage","send","onServerMessage","handler","isIdentified","getUserId","pairingOptions","deviceMeta","os","OS","device_id","onBeforePreviewStart","state","Error","String"],"sourceRoot":"../../../src","sources":["pairing/PairingController.ts"],"mappings":";;AAAA,SACEA,wBAAwB,EACxBC,aAAa,QAIR,qBAAqB;AAC5B,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ,yBAAyB;AAC/E,SAASC,QAAQ,EAAuBC,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAE/E,SAASC,qBAAqB,QAAQ,gCAA6B;AACnE,SAASC,gBAAgB,QAAQ,+BAA4B;AAE7D,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ,eAAY;AACrE,SAASC,0BAA0B,QAAQ,eAAY;AACvD,SACEC,oBAAoB,EACpBC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,iCAAiC,EACjCC,0BAA0B,EAC1BC,mCAAmC,QAE9B,kBAAe;AACtB,SAASC,sBAAsB,QAAQ,yBAAsB;AAC7D,SAASC,uBAAuB,QAAgC,mBAAgB;;AAIhF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiCA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,CAAC;EACrBC,MAAM,GAAyB,IAAI;EACnCC,OAAO,GAAG,KAAK;EACfC,MAAM,GAA8B,IAAI;EACxCC,WAAW,GAA8B,IAAI;EACpCC,SAAS,GAAG,IAAIC,GAAG,CAA4B,CAAC;EAWzDC,eAAe,GAAkB,IAAI;EAC7C;EACQC,oBAAoB,GAAG,KAAK;EACpC;AACF;AACA;AACA;EACUC,WAAW,GAAG,CAAC;EACvB;EACQC,YAAY,GAAG,CAAC;EACxB;AACF;AACA;AACA;EACUC,gBAAgB,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EACnDC,SAAS,GAAc,OAAO;EAC9BC,iBAAiB,GAAkB,IAAI;EAC/C;EACQC,oBAAoB,GAAkB,IAAI;EAClD;EACQC,e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;IAEJ;EACF;AACF;AAEA,SAASjE,aAAaA,CAACF,KAAc,EAAU;EAC7C,IAAIA,KAAK,YAAYoE,KAAK,EAAE,OAAOpE,KAAK,CAACwC,OAAO;EAChD,IAAI,OAAOxC,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAC3C,OAAOqE,MAAM,CAACrE,KAAK,CAAC;AACtB","ignoreList":[]}
@@ -12,6 +12,8 @@ import { useReportPreviewBannerHeight } from "../surfaces/surfaceLayoutInsets.js
12
12
  import { resolvePreviewChrome } from "./resolvePreviewChrome.js";
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const ONBOARDING_COPY = 'Double tap anywhere to access the menu';
15
+ /** A short blip stays quiet. Longer than this, the hidden bar comes back until the socket recovers. */
16
+ export const RECONNECT_REVEAL_DELAY_MS = 2000;
15
17
  /**
16
18
  * Overlay chrome for Builder pairing preview mode.
17
19
  */
@@ -20,16 +22,20 @@ export function PreviewModeBanner({
20
22
  onExit,
21
23
  onRestart,
22
24
  onConfirmingChange,
23
- suppressed = false
25
+ suppressed = false,
26
+ held = false
24
27
  }) {
25
28
  const setBannerHeight = useReportPreviewBannerHeight();
26
29
  const chrome = resolvePreviewChrome(state);
27
30
  const [chromeShown, setChromeShown] = React.useState(true);
28
31
  const [showOnboarding, setShowOnboarding] = React.useState(false);
29
32
  const [barHeight, setBarHeight] = React.useState(0);
30
- const sessionArmedRef = React.useRef(false);
33
+ const [reconnectRevealed, setReconnectRevealed] = React.useState(false);
34
+ const reconnectRevealedRef = React.useRef(reconnectRevealed);
35
+ reconnectRevealedRef.current = reconnectRevealed;
36
+ const armedGenerationRef = React.useRef(null);
31
37
  const isError = chrome.visible && chrome.tone === 'error';
32
- const visible = chrome.visible && !suppressed && (chromeShown || isError);
38
+ const visible = chrome.visible && !suppressed && (isError || !held && (chromeShown || reconnectRevealed));
33
39
  const [confirming, setConfirming] = React.useState(null);
34
40
  const showRestart = Boolean(state.canRestartPreview) && !isError;
35
41
  const showDialog = confirming != null && visible && !isError;
@@ -43,10 +49,11 @@ export function PreviewModeBanner({
43
49
  const barChrome = chrome.visible ? chrome : lastVisibleChromeRef.current;
44
50
  React.useEffect(() => {
45
51
  if (!chrome.visible) {
46
- sessionArmedRef.current = false;
52
+ armedGenerationRef.current = null;
47
53
  setChromeShown(true);
48
54
  setShowOnboarding(false);
49
55
  setBarHeight(0);
56
+ setReconnectRevealed(false);
50
57
  return;
51
58
  }
52
59
  if (isError) {
@@ -54,11 +61,24 @@ export function PreviewModeBanner({
54
61
  setShowOnboarding(false);
55
62
  return;
56
63
  }
57
- if (!sessionArmedRef.current) {
58
- sessionArmedRef.current = true;
64
+ if (armedGenerationRef.current !== state.pairingSessionGeneration) {
65
+ armedGenerationRef.current = state.pairingSessionGeneration;
66
+ setChromeShown(true);
59
67
  setShowOnboarding(true);
60
68
  }
61
- }, [chrome.visible, isError]);
69
+ }, [chrome.visible, isError, state.pairingSessionGeneration]);
70
+ React.useEffect(() => {
71
+ if (!chrome.visible || held || state.status !== 'reconnecting') return;
72
+ const timer = setTimeout(() => setReconnectRevealed(true), RECONNECT_REVEAL_DELAY_MS);
73
+ return () => clearTimeout(timer);
74
+ }, [chrome.visible, held, state.status]);
75
+ React.useEffect(() => {
76
+ if (chrome.visible && state.status === 'reconnecting') return;
77
+ // An exit dialog opened from the revealed bar must survive recovery.
78
+ // Dropping the reveal immediately would unmount that dialog.
79
+ if (chrome.visible && confirming != null) return;
80
+ setReconnectRevealed(false);
81
+ }, [chrome.visible, confirming, state.status]);
62
82
  React.useEffect(() => {
63
83
  if (!visible || isError) {
64
84
  setConfirming(null);
@@ -74,29 +94,46 @@ export function PreviewModeBanner({
74
94
  return;
75
95
  }
76
96
  if (suppressed) return;
77
- if (!chromeShown && !isError) {
97
+ // Held chrome is absent, and nothing else is reporting this slot. An error
98
+ // bar still shows, so it keeps the inset.
99
+ if (held && !isError) {
100
+ setBannerHeight(0);
101
+ return;
102
+ }
103
+ if (!chromeShown && !isError && !reconnectRevealed) {
78
104
  setBannerHeight(0);
79
105
  return;
80
106
  }
81
107
  if (barHeight > 0) {
82
108
  setBannerHeight(barHeight);
83
109
  }
84
- }, [barHeight, chrome.visible, chromeShown, isError, setBannerHeight, suppressed]);
110
+ }, [barHeight, chrome.visible, chromeShown, held, isError, reconnectRevealed, setBannerHeight, suppressed]);
85
111
  React.useEffect(() => {
86
- if (!chrome.visible || suppressed || isError) {
87
- doubleTapMonitor.set(null);
112
+ // Navigate-mode picking uses this same singleton. Only drop the subscription
113
+ // we installed — set(null) here would clear that owner when pairing chrome
114
+ // changes while this bar is already suppressed.
115
+ if (!chrome.visible || suppressed || isError || held) {
88
116
  return;
89
117
  }
90
- doubleTapMonitor.set({
118
+ const subscription = {
91
119
  onDoubleTap: () => {
92
120
  setShowOnboarding(false);
121
+ // The reveal keeps the bar up regardless of chromeShown, so toggling
122
+ // chromeShown alone would look like a no-op and then pin the bar on
123
+ // after recovery. A double tap on a revealed bar hides it.
124
+ if (reconnectRevealedRef.current) {
125
+ setReconnectRevealed(false);
126
+ setChromeShown(false);
127
+ return;
128
+ }
93
129
  setChromeShown(shown => !shown);
94
130
  }
95
- });
131
+ };
132
+ doubleTapMonitor.set(subscription);
96
133
  return () => {
97
- doubleTapMonitor.set(null);
134
+ doubleTapMonitor.clearIfCurrent(subscription);
98
135
  };
99
- }, [chrome.visible, isError, suppressed]);
136
+ }, [chrome.visible, held, isError, suppressed]);
100
137
  React.useEffect(() => {
101
138
  onConfirmingChange?.(showDialog);
102
139
  }, [showDialog, onConfirmingChange]);
@@ -212,9 +249,10 @@ export function PreviewModeBanner({
212
249
  children: /*#__PURE__*/_jsx(ChromeTooltip, {
213
250
  onDismiss: () => {
214
251
  setShowOnboarding(false);
252
+ setChromeShown(false);
215
253
  },
216
254
  children: ONBOARDING_COPY
217
- })
255
+ }, state.pairingSessionGeneration)
218
256
  }) : null]
219
257
  });
220
258
  }