@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
@@ -8,22 +8,63 @@ exports.useUserflow = useUserflow;
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
  var _reactNative = require("react-native");
10
10
  var _FiberScanRoot = require("../anchors/fiber/FiberScanRoot.js");
11
- var _ElementPickerOverlay = require("../authoring/ElementPickerOverlay.js");
12
11
  var _DoubleTapBridge = require("../authoring/chrome/DoubleTapBridge.js");
13
12
  var _elementPickerController = require("../authoring/elementPickerController.js");
14
- var _PreviewModeBanner = require("../pairing/PreviewModeBanner.js");
15
- var _pairingRuntime = require("../pairing/pairingRuntime.js");
16
- var _usePairingState = require("../pairing/usePairingState.js");
17
13
  var _absoluteFill = require("../surfaces/absoluteFill.js");
14
+ var _safeArea = require("../surfaces/safeArea.js");
18
15
  var _surfaceLayoutInsets = require("../surfaces/surfaceLayoutInsets.js");
19
- var _FlowRenderer = require("./FlowRenderer.js");
16
+ var _BannerHost = require("./BannerHost.js");
17
+ var _SdkErrorBoundary = require("./SdkErrorBoundary.js");
20
18
  var _TargetPressBridge = require("./TargetPressBridge.js");
19
+ var _UserflowOverlay = require("./UserflowOverlay.js");
20
+ var _bannerEngine = require("./bannerEngine.js");
21
+ var _bannerEngineContext = require("./bannerEngineContext.js");
22
+ var _bannerPlacement = require("./bannerPlacement.js");
21
23
  var _flowEngine = require("./flowEngine.js");
22
- var _useFlowSessionState = require("./useFlowSessionState.js");
24
+ var _isolateCall = require("./isolateCall.js");
25
+ var _useBannerSession = require("./useBannerSession.js");
23
26
  var _userflowCore = require("./userflowCore.js");
24
27
  var _jsxRuntime = require("react/jsx-runtime");
25
28
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
26
29
  const UserflowContext = /*#__PURE__*/React.createContext(null);
30
+ function overlayResetKeyFromEngine(engine) {
31
+ const session = engine.getFlowSession();
32
+ if (!session) {
33
+ return '';
34
+ }
35
+ // `ForceGoToStep` updates displayedStepId without rewriting session.currentStep.
36
+ return `${session.id}:${engine.getCurrentStep()?.id ?? ''}`;
37
+ }
38
+
39
+ /**
40
+ * Session/step identity for retrying a crashed overlay. Lives in an effect so a
41
+ * throw cannot unmount host children (session hooks run inside the overlay
42
+ * boundary instead).
43
+ */
44
+ function useOverlayErrorBoundaryResetKey(engine) {
45
+ const [resetKey, setResetKey] = React.useState(() => {
46
+ try {
47
+ return overlayResetKeyFromEngine(engine);
48
+ } catch {
49
+ return '';
50
+ }
51
+ });
52
+ React.useEffect(() => {
53
+ const apply = next => {
54
+ setResetKey(next);
55
+ };
56
+ (0, _isolateCall.isolateSync)('overlay-reset-key', () => {
57
+ apply(overlayResetKeyFromEngine(engine));
58
+ });
59
+ return engine.on(() => {
60
+ (0, _isolateCall.isolateSync)('overlay-reset-key', () => {
61
+ apply(overlayResetKeyFromEngine(engine));
62
+ });
63
+ });
64
+ }, [engine]);
65
+ return resetKey;
66
+ }
67
+
27
68
  /**
28
69
  * Mount once at the application root, above the navigation container
29
70
  * (for example the root `_layout.tsx` or `App` component), after
@@ -35,6 +76,10 @@ const UserflowContext = /*#__PURE__*/React.createContext(null);
35
76
  * We deliberately do not use RN `<Modal>` — it is the wrong primitive for
36
77
  * non-modal tooltips (WS6).
37
78
  *
79
+ * Overlay render errors are contained by {@link SdkErrorBoundary}; host
80
+ * children are never inside that boundary. See
81
+ * `packages/react-native/docs/isolation.md`.
82
+ *
38
83
  * **Expo Router:** also mount `UserflowExpoRouterScreenTracker` from
39
84
  * `@userflow-tech/react-native/expo-router` under this provider so pathname and
40
85
  * navigation-state changes and path-like NAVIGATE actions are wired. The tracker
@@ -46,82 +91,110 @@ const UserflowContext = /*#__PURE__*/React.createContext(null);
46
91
  */
47
92
  function UserflowProvider({
48
93
  children,
49
- engine: engineProp
94
+ engine: engineProp,
95
+ bannerEngine: bannerEngineProp
50
96
  }) {
51
97
  const engine = engineProp ?? (0, _flowEngine.getFlowSessionEngine)((0, _userflowCore.getUserflowCore)());
98
+ const bannerEngine = bannerEngineProp ?? (0, _bannerEngine.getBannerSessionEngine)((0, _userflowCore.getUserflowCore)());
52
99
  const contextValue = React.useMemo(() => ({
53
100
  engine
54
101
  }), [engine]);
55
- const pairingState = (0, _usePairingState.usePairingState)();
56
- const {
57
- session,
58
- currentStep
59
- } = (0, _useFlowSessionState.useFlowSessionState)(engine);
60
- const [previewConfirming, setPreviewConfirming] = React.useState(false);
102
+ const overlayResetKey = useOverlayErrorBoundaryResetKey(engine);
103
+ const [trapHostAccessibility, setTrapHostAccessibility] = React.useState(false);
104
+ const onTrapChange = React.useCallback(trap => {
105
+ setTrapHostAccessibility(trap);
106
+ }, []);
107
+ const onOverlayError = React.useCallback(() => {
108
+ setTrapHostAccessibility(false);
109
+ }, []);
110
+ const bannerSession = (0, _useBannerSession.useBannerSession)(bannerEngine);
111
+ const safeInsets = (0, _safeArea.useUserflowSafeAreaInsets)();
61
112
  const [pickerActive, setPickerActive] = React.useState(() => _elementPickerController.elementPickerController.getState().active);
62
113
  React.useEffect(() => {
63
114
  return _elementPickerController.elementPickerController.subscribe(next => {
64
115
  setPickerActive(next.active);
65
116
  });
66
117
  }, []);
67
- const trapHostAccessibility = React.useMemo(() => {
68
- if (previewConfirming) {
69
- return true;
70
- }
71
- if (!session || !currentStep) {
72
- return false;
73
- }
74
- const appearance = String(currentStep.appearance).toUpperCase();
75
- if (appearance === 'HIDDEN') {
76
- return false;
77
- }
78
- if (appearance !== 'TOOLTIP') {
79
- return true;
80
- }
81
- return currentStep.tooltipTargetBlocked;
82
- }, [previewConfirming, session, currentStep]);
83
- const onExitPreview = React.useCallback(() => {
84
- void (0, _pairingRuntime.getPairingController)((0, _userflowCore.getUserflowCore)()).exitPreview();
85
- }, []);
86
- const onRestartPreview = React.useCallback(() => {
87
- void (0, _pairingRuntime.getPairingController)((0, _userflowCore.getUserflowCore)()).restartPreview();
88
- }, []);
89
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(UserflowContext.Provider, {
90
- value: contextValue,
91
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_surfaceLayoutInsets.SurfaceLayoutInsetsProvider, {
92
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DoubleTapBridge.DoubleTapBridge, {
93
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
94
- style: styles.root,
95
- collapsable: false,
96
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
97
- style: styles.appContent,
98
- testID: "userflow-app-content",
99
- importantForAccessibility: trapHostAccessibility ? 'no-hide-descendants' : undefined,
100
- accessibilityElementsHidden: trapHostAccessibility ? true : undefined,
101
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TargetPressBridge.TargetPressBridge, {
102
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FiberScanRoot.FiberScanRoot, {
103
- children: children
118
+ const banner = bannerSession?.version.banner ?? null;
119
+ const flowEdge = banner && banner.overlay === false && !pickerActive ? (0, _bannerPlacement.bannerEdge)(banner.embedMode) : null;
120
+ const hostInsets = flowEdge === 'top' || flowEdge === 'bottom' ? {
121
+ ...safeInsets,
122
+ top: flowEdge === 'top' ? 0 : safeInsets.top,
123
+ bottom: flowEdge === 'bottom' ? 0 : safeInsets.bottom
124
+ } : null;
125
+ const appContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
126
+ style: styles.appContent,
127
+ testID: "userflow-app-content",
128
+ importantForAccessibility: trapHostAccessibility ? 'no-hide-descendants' : undefined,
129
+ accessibilityElementsHidden: trapHostAccessibility ? true : undefined,
130
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TargetPressBridge.TargetPressBridge, {
131
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FiberScanRoot.FiberScanRoot, {
132
+ children: children
133
+ })
134
+ })
135
+ });
136
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bannerEngineContext.BannerEngineContext.Provider, {
137
+ value: bannerEngine,
138
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(UserflowContext.Provider, {
139
+ value: contextValue,
140
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_surfaceLayoutInsets.SurfaceLayoutInsetsProvider, {
141
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DoubleTapBridge.DoubleTapBridge, {
142
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
143
+ style: styles.root,
144
+ collapsable: false,
145
+ testID: "userflow-root",
146
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BannerHost.BannerHost, {
147
+ engine: bannerEngine,
148
+ placement: "flow",
149
+ edge: "top",
150
+ hidden: pickerActive
151
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(HostSafeArea, {
152
+ insets: hostInsets,
153
+ children: appContent
154
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BannerHost.BannerHost, {
155
+ engine: bannerEngine,
156
+ placement: "flow",
157
+ edge: "bottom",
158
+ hidden: pickerActive
159
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
160
+ style: styles.overlay,
161
+ pointerEvents: "box-none",
162
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SdkErrorBoundary.SdkErrorBoundary, {
163
+ scope: "overlay",
164
+ resetKey: overlayResetKey,
165
+ onError: onOverlayError,
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_UserflowOverlay.UserflowOverlay, {
167
+ engine: engine,
168
+ bannerEngine: bannerEngine,
169
+ onTrapChange: onTrapChange
170
+ })
104
171
  })
105
- })
106
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
107
- style: styles.overlay,
108
- pointerEvents: "box-none",
109
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PreviewModeBanner.PreviewModeBanner, {
110
- onConfirmingChange: setPreviewConfirming,
111
- onExit: onExitPreview,
112
- onRestart: onRestartPreview,
113
- state: pairingState,
114
- suppressed: pickerActive
115
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlowRenderer.FlowRenderer, {
116
- engine: engine,
117
- previewRestartGeneration: pairingState.previewRestartGeneration
118
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ElementPickerOverlay.ElementPickerOverlay, {})]
119
- })]
172
+ })]
173
+ })
120
174
  })
121
175
  })
122
176
  })
123
177
  });
124
178
  }
179
+ function HostSafeArea({
180
+ insets,
181
+ children
182
+ }) {
183
+ const Context = (0, _safeArea.getSafeAreaInsetsContext)();
184
+ // Re-provide only when a parent already supplied insets, or when a banner
185
+ // override applies. Supplying a value with no parent would hide the host's
186
+ // own missing SafeAreaProvider from its useSafeAreaInsets() calls.
187
+ const parent = (0, _safeArea.useParentSafeAreaInsets)();
188
+ if (!Context || insets == null && parent == null) {
189
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
190
+ children: children
191
+ });
192
+ }
193
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Context.Provider, {
194
+ value: insets ?? parent,
195
+ children: children
196
+ });
197
+ }
125
198
 
126
199
  /** Access the flow session engine from inside {@link UserflowProvider}. */
127
200
  function useUserflow() {
@@ -1 +1 @@
1
- {"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_FiberScanRoot","_ElementPickerOverlay","_DoubleTapBridge","_elementPickerController","_PreviewModeBanner","_pairingRuntime","_usePairingState","_absoluteFill","_surfaceLayoutInsets","_FlowRenderer","_TargetPressBridge","_flowEngine","_useFlowSessionState","_userflowCore","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","UserflowContext","createContext","UserflowProvider","children","engine","engineProp","getFlowSessionEngine","getUserflowCore","contextValue","useMemo","pairingState","usePairingState","session","currentStep","useFlowSessionState","previewConfirming","setPreviewConfirming","useState","pickerActive","setPickerActive","elementPickerController","getState","active","useEffect","subscribe","next","trapHostAccessibility","appearance","String","toUpperCase","tooltipTargetBlocked","onExitPreview","useCallback","getPairingController","exitPreview","onRestartPreview","restartPreview","jsx","Provider","value","SurfaceLayoutInsetsProvider","DoubleTapBridge","jsxs","View","style","styles","root","collapsable","appContent","testID","importantForAccessibility","undefined","accessibilityElementsHidden","TargetPressBridge","FiberScanRoot","overlay","pointerEvents","PreviewModeBanner","onConfirmingChange","onExit","onRestart","state","suppressed","FlowRenderer","previewRestartGeneration","ElementPickerOverlay","useUserflow","ctx","useContext","Error","StyleSheet","create","flex","ABSOLUTE_FILL"],"sourceRoot":"../../../src","sources":["runtime/UserflowProvider.tsx"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAV,OAAA;AAEA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,oBAAA,GAAAd,OAAA;AACA,IAAAe,aAAA,GAAAf,OAAA;AAAiD,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAD,wBAAAkB,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAApB,uBAAA,YA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AQ;YAACC,aAAa,EAAC,UAAU;YAAArD,QAAA,gBACnD,IAAAvB,WAAA,CAAAyD,GAAA,EAACnE,kBAAA,CAAAuF,iBAAiB;cAChBC,kBAAkB,EAAE1C,oBAAqB;cACzC2C,MAAM,EAAE5B,aAAc;cACtB6B,SAAS,EAAEzB,gBAAiB;cAC5B0B,KAAK,EAAEnD,YAAa;cACpBoD,UAAU,EAAE5C;YAAa,CAC1B,CAAC,eACF,IAAAtC,WAAA,CAAAyD,GAAA,EAAC9D,aAAA,CAAAwF,YAAY;cACX3D,MAAM,EAAEA,MAAO;cACf4D,wBAAwB,EAAEtD,YAAY,CAACsD;YAAyB,CACjE,CAAC,eACF,IAAApF,WAAA,CAAAyD,GAAA,EAACtE,qBAAA,CAAAkG,oBAAoB,IAAE,CAAC;UAAA,CACpB,CAAC;QAAA,CACH;MAAC,CACQ;IAAC,CACS;EAAC,CACN,CAAC;AAE/B;;AAEA;AACO,SAASC,WAAWA,CAAA,EAAyB;EAClD,MAAMC,GAAG,GAAGzG,KAAK,CAAC0G,UAAU,CAACpE,eAAe,CAAC;EAC7C,IAAI,CAACmE,GAAG,EAAE;IACR,MAAM,IAAIE,KAAK,CAAC,wDAAwD,CAAC;EAC3E;EACA,OAAOF,GAAG;AACZ;AAEA,MAAMtB,MAAM,GAAGyB,uBAAU,CAACC,MAAM,CAAC;EAC/BzB,IAAI,EAAE;IACJ0B,IAAI,EAAE;EACR,CAAC;EACDxB,UAAU,EAAE;IACVwB,IAAI,EAAE;EACR,CAAC;EACDjB,OAAO,EAAE;IACP,GAAGkB;EACL;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_FiberScanRoot","_DoubleTapBridge","_elementPickerController","_absoluteFill","_safeArea","_surfaceLayoutInsets","_BannerHost","_SdkErrorBoundary","_TargetPressBridge","_UserflowOverlay","_bannerEngine","_bannerEngineContext","_bannerPlacement","_flowEngine","_isolateCall","_useBannerSession","_userflowCore","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","UserflowContext","createContext","overlayResetKeyFromEngine","engine","session","getFlowSession","id","getCurrentStep","useOverlayErrorBoundaryResetKey","resetKey","setResetKey","useState","useEffect","apply","next","isolateSync","on","UserflowProvider","children","engineProp","bannerEngine","bannerEngineProp","getFlowSessionEngine","getUserflowCore","getBannerSessionEngine","contextValue","useMemo","overlayResetKey","trapHostAccessibility","setTrapHostAccessibility","onTrapChange","useCallback","trap","onOverlayError","bannerSession","useBannerSession","safeInsets","useUserflowSafeAreaInsets","pickerActive","setPickerActive","elementPickerController","getState","active","subscribe","banner","version","flowEdge","overlay","bannerEdge","embedMode","hostInsets","top","bottom","appContent","jsx","View","style","styles","testID","importantForAccessibility","undefined","accessibilityElementsHidden","TargetPressBridge","FiberScanRoot","BannerEngineContext","Provider","value","SurfaceLayoutInsetsProvider","DoubleTapBridge","jsxs","root","collapsable","BannerHost","placement","edge","hidden","HostSafeArea","insets","pointerEvents","SdkErrorBoundary","scope","onError","UserflowOverlay","Context","getSafeAreaInsetsContext","parent","useParentSafeAreaInsets","Fragment","useUserflow","ctx","useContext","Error","StyleSheet","create","flex","ABSOLUTE_FILL"],"sourceRoot":"../../../src","sources":["runtime/UserflowProvider.tsx"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAMA,IAAAO,oBAAA,GAAAP,OAAA;AAEA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW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,YAAa;kBAC3BU,YAAY,EAAEA;gBAAa,CAC5B;cAAC,CACc;YAAC,CACf,CAAC;UAAA,CACH;QAAC,CACQ;MAAC,CACS;IAAC,CACN;EAAC,CACC,CAAC;AAEnC;AAEA,SAAS8C,YAAYA,CAAC;EACpBC,MAAM;EACN3D;AAIF,CAAC,EAAsB;EACrB,MAAMiE,OAAO,GAAG,IAAAC,kCAAwB,EAAC,CAAC;EAC1C;EACA;EACA;EACA,MAAMC,MAAM,GAAG,IAAAC,iCAAuB,EAAC,CAAC;EACxC,IAAI,CAACH,OAAO,IAAKN,MAAM,IAAI,IAAI,IAAIQ,MAAM,IAAI,IAAK,EAAE;IAClD,oBAAO,IAAAzG,WAAA,CAAA0E,GAAA,EAAA1E,WAAA,CAAA2G,QAAA;MAAArE,QAAA,EAAGA;IAAQ,CAAG,CAAC;EACxB;EACA,oBAAO,IAAAtC,WAAA,CAAA0E,GAAA,EAAC6B,OAAO,CAAClB,QAAQ;IAACC,KAAK,EAAEW,MAAM,IAAIQ,MAAO;IAAAnE,QAAA,EAAEA;EAAQ,CAAmB,CAAC;AACjF;;AAEA;AACO,SAASsE,WAAWA,CAAA,EAAyB;EAClD,MAAMC,GAAG,GAAGlI,KAAK,CAACmI,UAAU,CAAC1F,eAAe,CAAC;EAC7C,IAAI,CAACyF,GAAG,EAAE;IACR,MAAM,IAAIE,KAAK,CAAC,wDAAwD,CAAC;EAC3E;EACA,OAAOF,GAAG;AACZ;AAEA,MAAMhC,MAAM,GAAGmC,uBAAU,CAACC,MAAM,CAAC;EAC/BvB,IAAI,EAAE;IACJwB,IAAI,EAAE;EACR,CAAC;EACDzC,UAAU,EAAE;IACVyC,IAAI,EAAE;EACR,CAAC;EACD/C,OAAO,EAAE;IACP,GAAGgD;EACL;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.__resetBannerSessionEngineForTests = __resetBannerSessionEngineForTests;
7
+ exports.attachBannerSessionEngine = attachBannerSessionEngine;
8
+ exports.clearBannerSessionEngineLocalSession = clearBannerSessionEngineLocalSession;
9
+ exports.getBannerSessionEngine = getBannerSessionEngine;
10
+ exports.resetBannerSessionEngine = resetBannerSessionEngine;
11
+ var _core = require("@userflow-tech/core");
12
+ var _evalJsController = require("../evalJs/evalJsController.js");
13
+ var _openFlowNavigateUrl = require("../navigation/openFlowNavigateUrl.js");
14
+ var _flowEngine = require("./flowEngine.js");
15
+ var _isolateCall = require("./isolateCall.js");
16
+ let bannerEngine = null;
17
+
18
+ /** Build (once) the module-level banner session engine over a {@link UserflowCore} transport. */
19
+ function getBannerSessionEngine(core) {
20
+ if (!bannerEngine) {
21
+ bannerEngine = new _core.BannerSessionEngine({
22
+ transport: {
23
+ send: message => core.send(message),
24
+ onServerMessage: handler => core.onServerMessage(handler),
25
+ setBannerSessionId: id => core.setBannerSessionId(id)
26
+ },
27
+ flowActions: () => (0, _flowEngine.getFlowSessionEngine)(core),
28
+ onOpenExternalUrl: url => {
29
+ void (0, _isolateCall.isolateAsync)('navigate', () => (0, _openFlowNavigateUrl.openFlowNavigateUrl)(url), {
30
+ rethrowHostContract: false
31
+ });
32
+ },
33
+ onEvalJs: request => {
34
+ _evalJsController.evalJsController.enqueue(request);
35
+ }
36
+ });
37
+ }
38
+ return bannerEngine;
39
+ }
40
+
41
+ /** Subscribe the engine to inbound server messages. Call after identify. */
42
+ function attachBannerSessionEngine(core) {
43
+ const engine = getBannerSessionEngine(core);
44
+ engine.attach();
45
+ return engine;
46
+ }
47
+
48
+ /** Clear the banner session and detach. Call from {@link Userflow.reset}. */
49
+ function resetBannerSessionEngine() {
50
+ bannerEngine?.reset();
51
+ }
52
+
53
+ /** Drop the local banner without detaching (preview exit, user switch). */
54
+ function clearBannerSessionEngineLocalSession() {
55
+ bannerEngine?.clearLocalSession();
56
+ }
57
+
58
+ /** Test helper: drop the singleton so the next get recreates it. */
59
+ function __resetBannerSessionEngineForTests() {
60
+ bannerEngine?.reset();
61
+ bannerEngine = null;
62
+ }
63
+ //# sourceMappingURL=bannerEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_evalJsController","_openFlowNavigateUrl","_flowEngine","_isolateCall","bannerEngine","getBannerSessionEngine","core","BannerSessionEngine","transport","send","message","onServerMessage","handler","setBannerSessionId","id","flowActions","getFlowSessionEngine","onOpenExternalUrl","url","isolateAsync","openFlowNavigateUrl","rethrowHostContract","onEvalJs","request","evalJsController","enqueue","attachBannerSessionEngine","engine","attach","resetBannerSessionEngine","reset","clearBannerSessionEngineLocalSession","clearLocalSession","__resetBannerSessionEngineForTests"],"sourceRoot":"../../../src","sources":["runtime/bannerEngine.ts"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAIK,YAAwC,GAAG,IAAI;;AAEnD;AACO,SAASC,sBAAsBA,CAACC,IAAkB,EAAuB;EAC9E,IAAI,CAACF,YAAY,EAAE;IACjBA,YAAY,GAAG,IAAIG,yBAAmB,CAAC;MACrCC,SAAS,EAAE;QACTC,IAAI,EAAGC,OAAO,IAAKJ,IAAI,CAACG,IAAI,CAACC,OAAO,CAAC;QACrCC,eAAe,EAAGC,OAAO,IAAKN,IAAI,CAACK,eAAe,CAACC,OAAO,CAAC;QAC3DC,kBAAkB,EAAGC,EAAE,IAAKR,IAAI,CAACO,kBAAkB,CAACC,EAAE;MACxD,CAAC;MACDC,WAAW,EAAEA,CAAA,KAAM,IAAAC,gCAAoB,EAACV,IAAI,CAAC;MAC7CW,iBAAiB,EAAGC,GAAG,IAAK;QAC1B,KAAK,IAAAC,yBAAY,EAAC,UAAU,EAAE,MAAM,IAAAC,wCAAmB,EAACF,GAAG,CAAC,EAAE;UAC5DG,mBAAmB,EAAE;QACvB,CAAC,CAAC;MACJ,CAAC;MACDC,QAAQ,EAAGC,OAAO,IAAK;QACrBC,kCAAgB,CAACC,OAAO,CAACF,OAAO,CAAC;MACnC;IACF,CAAC,CAAC;EACJ;EACA,OAAOnB,YAAY;AACrB;;AAEA;AACO,SAASsB,yBAAyBA,CAACpB,IAAkB,EAAuB;EACjF,MAAMqB,MAAM,GAAGtB,sBAAsB,CAACC,IAAI,CAAC;EAC3CqB,MAAM,CAACC,MAAM,CAAC,CAAC;EACf,OAAOD,MAAM;AACf;;AAEA;AACO,SAASE,wBAAwBA,CAAA,EAAS;EAC/CzB,YAAY,EAAE0B,KAAK,CAAC,CAAC;AACvB;;AAEA;AACO,SAASC,oCAAoCA,CAAA,EAAS;EAC3D3B,YAAY,EAAE4B,iBAAiB,CAAC,CAAC;AACnC;;AAEA;AACO,SAASC,kCAAkCA,CAAA,EAAS;EACzD7B,YAAY,EAAE0B,KAAK,CAAC,CAAC;EACrB1B,YAAY,GAAG,IAAI;AACrB","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BannerEngineContext = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
+ /** Banner engine for host slots. Null outside {@link UserflowProvider}. */
10
+ const BannerEngineContext = exports.BannerEngineContext = /*#__PURE__*/React.createContext(null);
11
+ //# sourceMappingURL=bannerEngineContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BannerEngineContext","exports","createContext"],"sourceRoot":"../../../src","sources":["runtime/bannerEngineContext.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAE/B;AACO,MAAMkB,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,gBAAGtB,KAAK,CAACwB,aAAa,CAA6B,IAAI,CAAC","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bannerEdge = bannerEdge;
7
+ exports.embedBannerPlaceholderId = embedBannerPlaceholderId;
8
+ exports.resetBannerWarningsForTests = resetBannerWarningsForTests;
9
+ exports.warnBannerOnce = warnBannerOnce;
10
+ var _resolveManualAnchorId = require("../anchors/resolveManualAnchorId.js");
11
+ const warned = new Set();
12
+
13
+ /** Body-first is the top edge; body-last is the bottom. Element modes use a placeholder. */
14
+ function bannerEdge(mode) {
15
+ if (mode === 'BODY_FIRST') return 'top';
16
+ if (mode === 'BODY_LAST') return 'bottom';
17
+ return null;
18
+ }
19
+
20
+ /**
21
+ * Id of the {@link EmbedBannerPlaceholder} an element-mode banner fills.
22
+ * Manual selectors use `#welcome-banner` or `welcome-banner`. Body modes
23
+ * return null so a top/bottom bar never occupies a host slot.
24
+ */
25
+ function embedBannerPlaceholderId(banner) {
26
+ if (bannerEdge(banner.embedMode)) return null;
27
+ return (0, _resolveManualAnchorId.resolveManualAnchorId)(banner.embedSelector?.css);
28
+ }
29
+ function warnBannerOnce(key, message, warn = console.warn) {
30
+ if (warned.has(key)) return;
31
+ warned.add(key);
32
+ warn(message);
33
+ }
34
+ function resetBannerWarningsForTests() {
35
+ warned.clear();
36
+ }
37
+ //# sourceMappingURL=bannerPlacement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_resolveManualAnchorId","require","warned","Set","bannerEdge","mode","embedBannerPlaceholderId","banner","embedMode","resolveManualAnchorId","embedSelector","css","warnBannerOnce","key","message","warn","console","has","add","resetBannerWarningsForTests","clear"],"sourceRoot":"../../../src","sources":["runtime/bannerPlacement.ts"],"mappings":";;;;;;;;;AAEA,IAAAA,sBAAA,GAAAC,OAAA;AAEA,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAS,CAAC;;AAEhC;AACO,SAASC,UAAUA,CAACC,IAA8B,EAA2B;EAClF,IAAIA,IAAI,KAAK,YAAY,EAAE,OAAO,KAAK;EACvC,IAAIA,IAAI,KAAK,WAAW,EAAE,OAAO,QAAQ;EACzC,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,wBAAwBA,CAACC,MAAsB,EAAiB;EAC9E,IAAIH,UAAU,CAACG,MAAM,CAACC,SAAS,CAAC,EAAE,OAAO,IAAI;EAC7C,OAAO,IAAAC,4CAAqB,EAACF,MAAM,CAACG,aAAa,EAAEC,GAAG,CAAC;AACzD;AAEO,SAASC,cAAcA,CAC5BC,GAAW,EACXC,OAAe,EACfC,IAA+B,GAAGC,OAAO,CAACD,IAAI,EACxC;EACN,IAAIb,MAAM,CAACe,GAAG,CAACJ,GAAG,CAAC,EAAE;EACrBX,MAAM,CAACgB,GAAG,CAACL,GAAG,CAAC;EACfE,IAAI,CAACD,OAAO,CAAC;AACf;AAEO,SAASK,2BAA2BA,CAAA,EAAS;EAClDjB,MAAM,CAACkB,KAAK,CAAC,CAAC;AAChB","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.hasEmbedBannerPlaceholder = hasEmbedBannerPlaceholder;
7
+ exports.registerEmbedBannerPlaceholder = registerEmbedBannerPlaceholder;
8
+ exports.resetEmbedBannerPlaceholdersForTests = resetEmbedBannerPlaceholdersForTests;
9
+ var _bannerPlacement = require("./bannerPlacement.js");
10
+ const counts = new Map();
11
+
12
+ /** Record a mounted {@link EmbedBannerPlaceholder}. Returns the unregister function. */
13
+ function registerEmbedBannerPlaceholder(id) {
14
+ const next = (counts.get(id) ?? 0) + 1;
15
+ counts.set(id, next);
16
+ if (next > 1) {
17
+ (0, _bannerPlacement.warnBannerOnce)(`embed-banner-dup:${id}`, `Userflow: more than one EmbedBannerPlaceholder uses id "${id}"`);
18
+ }
19
+ return () => {
20
+ const current = counts.get(id) ?? 0;
21
+ if (current <= 1) counts.delete(id);else counts.set(id, current - 1);
22
+ };
23
+ }
24
+ function hasEmbedBannerPlaceholder(id) {
25
+ return (counts.get(id) ?? 0) > 0;
26
+ }
27
+ function resetEmbedBannerPlaceholdersForTests() {
28
+ counts.clear();
29
+ }
30
+ //# sourceMappingURL=embedBannerRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_bannerPlacement","require","counts","Map","registerEmbedBannerPlaceholder","id","next","get","set","warnBannerOnce","current","delete","hasEmbedBannerPlaceholder","resetEmbedBannerPlaceholdersForTests","clear"],"sourceRoot":"../../../src","sources":["runtime/embedBannerRegistry.ts"],"mappings":";;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAiB,CAAC;;AAExC;AACO,SAASC,8BAA8BA,CAACC,EAAU,EAAc;EACrE,MAAMC,IAAI,GAAG,CAACJ,MAAM,CAACK,GAAG,CAACF,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;EACtCH,MAAM,CAACM,GAAG,CAACH,EAAE,EAAEC,IAAI,CAAC;EACpB,IAAIA,IAAI,GAAG,CAAC,EAAE;IACZ,IAAAG,+BAAc,EACZ,oBAAoBJ,EAAE,EAAE,EACxB,2DAA2DA,EAAE,GAC/D,CAAC;EACH;EACA,OAAO,MAAM;IACX,MAAMK,OAAO,GAAGR,MAAM,CAACK,GAAG,CAACF,EAAE,CAAC,IAAI,CAAC;IACnC,IAAIK,OAAO,IAAI,CAAC,EAAER,MAAM,CAACS,MAAM,CAACN,EAAE,CAAC,CAAC,KAC/BH,MAAM,CAACM,GAAG,CAACH,EAAE,EAAEK,OAAO,GAAG,CAAC,CAAC;EAClC,CAAC;AACH;AAEO,SAASE,yBAAyBA,CAACP,EAAU,EAAW;EAC7D,OAAO,CAACH,MAAM,CAACK,GAAG,CAACF,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;AAClC;AAEO,SAASQ,oCAAoCA,CAAA,EAAS;EAC3DX,MAAM,CAACY,KAAK,CAAC,CAAC;AAChB","ignoreList":[]}
@@ -5,13 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.__resetFlowSessionEngineForTests = __resetFlowSessionEngineForTests;
7
7
  exports.attachFlowSessionEngine = attachFlowSessionEngine;
8
+ exports.cancelPendingDraftEnd = cancelPendingDraftEnd;
8
9
  exports.clearFlowSessionEngineLocalSession = clearFlowSessionEngineLocalSession;
10
+ exports.endDraftFlowSession = endDraftFlowSession;
11
+ exports.endEvalJsFlowSession = endEvalJsFlowSession;
9
12
  exports.getFlowSessionEngine = getFlowSessionEngine;
10
13
  exports.hasActiveFlowSession = hasActiveFlowSession;
11
14
  exports.resetFlowSessionEngine = resetFlowSessionEngine;
12
15
  var _core = require("@userflow-tech/core");
16
+ var _evalJsController = require("../evalJs/evalJsController.js");
13
17
  var _openFlowNavigateUrl = require("../navigation/openFlowNavigateUrl.js");
18
+ var _isolateCall = require("./isolateCall.js");
14
19
  let flowEngine = null;
20
+ /** Exit asked to end a draft that identify has not delivered yet. */
21
+ let endDraftOnArrival = false;
22
+ let unsubscribeDraftArrival = null;
15
23
 
16
24
  /** Build (once) the module-level flow session engine over a {@link UserflowCore} transport. */
17
25
  function getFlowSessionEngine(core) {
@@ -23,11 +31,17 @@ function getFlowSessionEngine(core) {
23
31
  setFlowSessionId: id => core.setFlowSessionId(id)
24
32
  },
25
33
  onOpenExternalUrl: url => {
26
- void (0, _openFlowNavigateUrl.openFlowNavigateUrl)(url);
34
+ void (0, _isolateCall.isolateAsync)('navigate', () => (0, _openFlowNavigateUrl.openFlowNavigateUrl)(url), {
35
+ rethrowHostContract: false
36
+ });
37
+ },
38
+ onEvalJs: request => {
39
+ _evalJsController.evalJsController.enqueue(request);
27
40
  },
28
41
  updateUser: attributes => core.updateUser(attributes),
29
42
  updateGroup: (attributes, options) => core.updateGroup(attributes, options)
30
43
  });
44
+ if (endDraftOnArrival) watchForRestoredDraft();
31
45
  }
32
46
  return flowEngine;
33
47
  }
@@ -52,13 +66,71 @@ function clearFlowSessionEngineLocalSession() {
52
66
  flowEngine?.clearLocalSession();
53
67
  }
54
68
 
55
- /** Whether any mid-flow session (live or draft/preview) is currently on screen. */
69
+ /**
70
+ * Whether a mid-flow session is held (live, draft, or suppressed by Temporarily
71
+ * Hide). Foreground idle uses this so a hidden session keeps the socket that
72
+ * can deliver the attribute update which shows it again.
73
+ */
56
74
  function hasActiveFlowSession() {
57
- return flowEngine?.getFlowSession() != null;
75
+ return flowEngine?.hasHeldFlowSession() === true;
76
+ }
77
+
78
+ /**
79
+ * End the current flow on the server if it is a Builder preview draft. The
80
+ * server restores every active draft on identify, so clearing it locally is
81
+ * not enough to keep it from returning on the next launch.
82
+ *
83
+ * A draft Temporarily Hide is suppressing is still ended. `getFlowSession()`
84
+ * hides it, but the server will send it again. When exit runs before identify
85
+ * has delivered the draft, the next draft session is ended when it arrives.
86
+ * {@link cancelPendingDraftEnd} drops that wait; a new preview must call it
87
+ * so the preview's own draft is not ended.
88
+ */
89
+ async function endDraftFlowSession() {
90
+ const session = flowEngine?.getHeldFlowSession();
91
+ if (flowEngine && session?.draftMode) {
92
+ cancelPendingDraftEnd();
93
+ await flowEngine.endFlow('USER_CLOSED');
94
+ return;
95
+ }
96
+ watchForRestoredDraft();
97
+ }
98
+
99
+ /** Drop a pending end from {@link endDraftFlowSession}. A new preview calls this. */
100
+ function cancelPendingDraftEnd() {
101
+ endDraftOnArrival = false;
102
+ unsubscribeDraftArrival?.();
103
+ unsubscribeDraftArrival = null;
104
+ }
105
+ function watchForRestoredDraft() {
106
+ endDraftOnArrival = true;
107
+ if (!flowEngine || unsubscribeDraftArrival) return;
108
+ const engine = flowEngine;
109
+ unsubscribeDraftArrival = engine.on(event => {
110
+ if (event.type !== 'sessionChange' || !endDraftOnArrival) return;
111
+ const session = engine.getHeldFlowSession();
112
+ if (!session?.draftMode) return;
113
+ cancelPendingDraftEnd();
114
+ void engine.endFlow('USER_CLOSED').catch(() => {
115
+ // The session can disappear before EndFlow is built. Nothing to send.
116
+ });
117
+ });
118
+ }
119
+
120
+ /**
121
+ * `userflow.endFlow()` from an Evaluate JavaScript page. Ends the current
122
+ * session only if one of the page's scripts came from it, so a stale page
123
+ * cannot end a flow that started later.
124
+ */
125
+ async function endEvalJsFlowSession(sessionIds) {
126
+ const session = flowEngine?.getFlowSession();
127
+ if (!flowEngine || !session || !sessionIds.has(session.id)) return;
128
+ await flowEngine.endFlow('USERFLOWJS');
58
129
  }
59
130
 
60
131
  /** Test helper: drop the singleton so the next get recreates it. */
61
132
  function __resetFlowSessionEngineForTests() {
133
+ cancelPendingDraftEnd();
62
134
  flowEngine?.reset();
63
135
  flowEngine = null;
64
136
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_openFlowNavigateUrl","flowEngine","getFlowSessionEngine","core","FlowSessionEngine","transport","send","message","onServerMessage","handler","setFlowSessionId","id","onOpenExternalUrl","url","openFlowNavigateUrl","updateUser","attributes","updateGroup","options","attachFlowSessionEngine","engine","attach","resetFlowSessionEngine","reset","clearFlowSessionEngineLocalSession","clearLocalSession","hasActiveFlowSession","getFlowSession","__resetFlowSessionEngineForTests"],"sourceRoot":"../../../src","sources":["runtime/flowEngine.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AAEA,IAAIE,UAAoC,GAAG,IAAI;;AAE/C;AACO,SAASC,oBAAoBA,CAACC,IAAkB,EAAqB;EAC1E,IAAI,CAACF,UAAU,EAAE;IACfA,UAAU,GAAG,IAAIG,uBAAiB,CAAC;MACjCC,SAAS,EAAE;QACTC,IAAI,EAAGC,OAAO,IAAKJ,IAAI,CAACG,IAAI,CAACC,OAAO,CAAC;QACrCC,eAAe,EAAGC,OAAO,IAAKN,IAAI,CAACK,eAAe,CAACC,OAAO,CAAC;QAC3DC,gBAAgB,EAAGC,EAAE,IAAKR,IAAI,CAACO,gBAAgB,CAACC,EAAE;MACpD,CAAC;MACDC,iBAAiB,EAAGC,GAAG,IAAK;QAC1B,KAAK,IAAAC,wCAAmB,EAACD,GAAG,CAAC;MAC/B,CAAC;MACDE,UAAU,EAAGC,UAAU,IAAKb,IAAI,CAACY,UAAU,CAACC,UAAU,CAAC;MACvDC,WAAW,EAAEA,CAACD,UAAU,EAAEE,OAAO,KAAKf,IAAI,CAACc,WAAW,CAACD,UAAU,EAAEE,OAAO;IAC5E,CAAC,CAAC;EACJ;EACA,OAAOjB,UAAU;AACnB;;AAEA;AACO,SAASkB,uBAAuBA,CAAChB,IAAkB,EAAqB;EAC7E,MAAMiB,MAAM,GAAGlB,oBAAoB,CAACC,IAAI,CAAC;EACzCiB,MAAM,CAACC,MAAM,CAAC,CAAC;EACf,OAAOD,MAAM;AACf;;AAEA;AACO,SAASE,sBAAsBA,CAAA,EAAS;EAC7CrB,UAAU,EAAEsB,KAAK,CAAC,CAAC;AACrB;;AAEA;AACA;AACA;AACA;AACO,SAASC,kCAAkCA,CAAA,EAAS;EACzDvB,UAAU,EAAEwB,iBAAiB,CAAC,CAAC;AACjC;;AAEA;AACO,SAASC,oBAAoBA,CAAA,EAAY;EAC9C,OAAOzB,UAAU,EAAE0B,cAAc,CAAC,CAAC,IAAI,IAAI;AAC7C;;AAEA;AACO,SAASC,gCAAgCA,CAAA,EAAS;EACvD3B,UAAU,EAAEsB,KAAK,CAAC,CAAC;EACnBtB,UAAU,GAAG,IAAI;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_evalJsController","_openFlowNavigateUrl","_isolateCall","flowEngine","endDraftOnArrival","unsubscribeDraftArrival","getFlowSessionEngine","core","FlowSessionEngine","transport","send","message","onServerMessage","handler","setFlowSessionId","id","onOpenExternalUrl","url","isolateAsync","openFlowNavigateUrl","rethrowHostContract","onEvalJs","request","evalJsController","enqueue","updateUser","attributes","updateGroup","options","watchForRestoredDraft","attachFlowSessionEngine","engine","attach","resetFlowSessionEngine","reset","clearFlowSessionEngineLocalSession","clearLocalSession","hasActiveFlowSession","hasHeldFlowSession","endDraftFlowSession","session","getHeldFlowSession","draftMode","cancelPendingDraftEnd","endFlow","on","event","type","catch","endEvalJsFlowSession","sessionIds","getFlowSession","has","__resetFlowSessionEngineForTests"],"sourceRoot":"../../../src","sources":["runtime/flowEngine.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAII,UAAoC,GAAG,IAAI;AAC/C;AACA,IAAIC,iBAAiB,GAAG,KAAK;AAC7B,IAAIC,uBAA4C,GAAG,IAAI;;AAEvD;AACO,SAASC,oBAAoBA,CAACC,IAAkB,EAAqB;EAC1E,IAAI,CAACJ,UAAU,EAAE;IACfA,UAAU,GAAG,IAAIK,uBAAiB,CAAC;MACjCC,SAAS,EAAE;QACTC,IAAI,EAAGC,OAAO,IAAKJ,IAAI,CAACG,IAAI,CAACC,OAAO,CAAC;QACrCC,eAAe,EAAGC,OAAO,IAAKN,IAAI,CAACK,eAAe,CAACC,OAAO,CAAC;QAC3DC,gBAAgB,EAAGC,EAAE,IAAKR,IAAI,CAACO,gBAAgB,CAACC,EAAE;MACpD,CAAC;MACDC,iBAAiB,EAAGC,GAAG,IAAK;QAC1B,KAAK,IAAAC,yBAAY,EAAC,UAAU,EAAE,MAAM,IAAAC,wCAAmB,EAACF,GAAG,CAAC,EAAE;UAC5DG,mBAAmB,EAAE;QACvB,CAAC,CAAC;MACJ,CAAC;MACDC,QAAQ,EAAGC,OAAO,IAAK;QACrBC,kCAAgB,CAACC,OAAO,CAACF,OAAO,CAAC;MACnC,CAAC;MACDG,UAAU,EAAGC,UAAU,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