@userflow-tech/react-native 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (852) hide show
  1. package/README.md +116 -77
  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/deep-linking.md +70 -33
  8. package/docs/isolation.md +75 -0
  9. package/docs/troubleshooting.md +40 -17
  10. package/docs/webview-custom-banner-poc.md +64 -0
  11. package/expo-plugin/withUserflow.d.ts +3 -2
  12. package/expo-plugin/withUserflow.d.ts.map +1 -1
  13. package/expo-plugin/withUserflow.js +14 -8
  14. package/expo-plugin/withUserflow.js.map +1 -1
  15. package/lib/commonjs/anchors/AutoAnchorRegistry.js +37 -11
  16. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  17. package/lib/commonjs/anchors/fiber/fiberPath.js +122 -0
  18. package/lib/commonjs/anchors/fiber/fiberPath.js.map +1 -0
  19. package/lib/commonjs/anchors/fiber/findAnchorFiber.js +60 -50
  20. package/lib/commonjs/anchors/fiber/findAnchorFiber.js.map +1 -1
  21. package/lib/commonjs/anchors/fiber/resolveFiberPath.js +220 -0
  22. package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -0
  23. package/lib/commonjs/anchors/fiber/visibleRect.js +147 -0
  24. package/lib/commonjs/anchors/fiber/visibleRect.js.map +1 -0
  25. package/lib/commonjs/anchors/fiber/visibleScreens.js +73 -36
  26. package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
  27. package/lib/commonjs/anchors/fiber/walkVisibleFibers.js +66 -0
  28. package/lib/commonjs/anchors/fiber/walkVisibleFibers.js.map +1 -0
  29. package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js +51 -0
  30. package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js.map +1 -0
  31. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +22 -15
  32. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
  33. package/lib/commonjs/anchors/semanticMatcher.js +26 -8
  34. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
  35. package/lib/commonjs/anonymousId.js +4 -1
  36. package/lib/commonjs/anonymousId.js.map +1 -1
  37. package/lib/commonjs/authoring/ElementPickerOverlay.js +126 -50
  38. package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -1
  39. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +32 -10
  40. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -1
  41. package/lib/commonjs/authoring/chrome/ChromeButton.js +8 -3
  42. package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -1
  43. package/lib/commonjs/authoring/chrome/ChromeIcon.js +4 -0
  44. package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -1
  45. package/lib/commonjs/authoring/chrome/ChromeTopBar.js +23 -10
  46. package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -1
  47. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +19 -12
  48. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -1
  49. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +10 -0
  50. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -1
  51. package/lib/commonjs/authoring/chrome/icons/circle-exclamation.png +0 -0
  52. package/lib/commonjs/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  53. package/lib/commonjs/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  54. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation.png +0 -0
  55. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  56. package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  57. package/lib/commonjs/authoring/chrome/tokens.js +7 -6
  58. package/lib/commonjs/authoring/chrome/tokens.js.map +1 -1
  59. package/lib/commonjs/authoring/elementPickerController.js.map +1 -1
  60. package/lib/commonjs/authoring/fingerprintFromInstance.js +204 -4
  61. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
  62. package/lib/commonjs/authoring/hitTest.js +264 -16
  63. package/lib/commonjs/authoring/hitTest.js.map +1 -1
  64. package/lib/commonjs/authoring/hostAtPoint.js +204 -0
  65. package/lib/commonjs/authoring/hostAtPoint.js.map +1 -0
  66. package/lib/commonjs/content/BannerStepButton.js +68 -0
  67. package/lib/commonjs/content/BannerStepButton.js.map +1 -0
  68. package/lib/commonjs/content/buttonAppearance.js +16 -0
  69. package/lib/commonjs/content/buttonAppearance.js.map +1 -1
  70. package/lib/commonjs/content/resolveBannerButtonChrome.js +44 -0
  71. package/lib/commonjs/content/resolveBannerButtonChrome.js.map +1 -0
  72. package/lib/commonjs/content/themeColor.js +15 -0
  73. package/lib/commonjs/content/themeColor.js.map +1 -1
  74. package/lib/commonjs/deepLinking.js +4 -4
  75. package/lib/commonjs/evalJs/EvalJsHost.js +244 -0
  76. package/lib/commonjs/evalJs/EvalJsHost.js.map +1 -0
  77. package/lib/commonjs/evalJs/bootstrap.js +84 -0
  78. package/lib/commonjs/evalJs/bootstrap.js.map +1 -0
  79. package/lib/commonjs/evalJs/bridgeMessages.js +143 -0
  80. package/lib/commonjs/evalJs/bridgeMessages.js.map +1 -0
  81. package/lib/commonjs/evalJs/evalJsBridge.js +31 -0
  82. package/lib/commonjs/evalJs/evalJsBridge.js.map +1 -0
  83. package/lib/commonjs/evalJs/evalJsController.js +124 -0
  84. package/lib/commonjs/evalJs/evalJsController.js.map +1 -0
  85. package/lib/commonjs/evalJs/getWebView.js +81 -0
  86. package/lib/commonjs/evalJs/getWebView.js.map +1 -0
  87. package/lib/commonjs/evalJs/injectEvalPending.js +19 -0
  88. package/lib/commonjs/evalJs/injectEvalPending.js.map +1 -0
  89. package/lib/commonjs/evalJs/types.js +2 -0
  90. package/lib/commonjs/evalJs/types.js.map +1 -0
  91. package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js +40 -0
  92. package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js.map +1 -0
  93. package/lib/commonjs/expo-router/index.js +19 -0
  94. package/lib/commonjs/expo-router/index.js.map +1 -1
  95. package/lib/commonjs/expo-router/redirectSystemPath.js +75 -0
  96. package/lib/commonjs/expo-router/redirectSystemPath.js.map +1 -0
  97. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +2 -2
  98. package/lib/commonjs/index.js +118 -43
  99. package/lib/commonjs/index.js.map +1 -1
  100. package/lib/commonjs/lifecycle.js.map +1 -1
  101. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +14 -11
  102. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
  103. package/lib/commonjs/navigation/openFlowNavigateUrl.js +12 -5
  104. package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
  105. package/lib/commonjs/pairing/PairingController.js +245 -27
  106. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  107. package/lib/commonjs/pairing/PreviewModeBanner.js +55 -16
  108. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
  109. package/lib/commonjs/pairing/deepLink.js +22 -5
  110. package/lib/commonjs/pairing/deepLink.js.map +1 -1
  111. package/lib/commonjs/pairing/deviceId.js +47 -0
  112. package/lib/commonjs/pairing/deviceId.js.map +1 -0
  113. package/lib/commonjs/pairing/diagnostics.js +5 -4
  114. package/lib/commonjs/pairing/diagnostics.js.map +1 -1
  115. package/lib/commonjs/pairing/tokenStorage.js +47 -7
  116. package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
  117. package/lib/commonjs/pairing/usePairingState.js +3 -1
  118. package/lib/commonjs/pairing/usePairingState.js.map +1 -1
  119. package/lib/commonjs/pairing/usePreviewBarHold.js +139 -0
  120. package/lib/commonjs/pairing/usePreviewBarHold.js.map +1 -0
  121. package/lib/commonjs/runtime/BannerHost.js +96 -0
  122. package/lib/commonjs/runtime/BannerHost.js.map +1 -0
  123. package/lib/commonjs/runtime/EmbedBannerPlaceholder.js +99 -0
  124. package/lib/commonjs/runtime/EmbedBannerPlaceholder.js.map +1 -0
  125. package/lib/commonjs/runtime/SdkErrorBoundary.js +61 -0
  126. package/lib/commonjs/runtime/SdkErrorBoundary.js.map +1 -0
  127. package/lib/commonjs/runtime/TargetPressBridge.js +19 -12
  128. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  129. package/lib/commonjs/runtime/UserflowOverlay.js +97 -0
  130. package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -0
  131. package/lib/commonjs/runtime/UserflowProvider.js +135 -65
  132. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  133. package/lib/commonjs/runtime/bannerEngine.js +63 -0
  134. package/lib/commonjs/runtime/bannerEngine.js.map +1 -0
  135. package/lib/commonjs/runtime/bannerEngineContext.js +11 -0
  136. package/lib/commonjs/runtime/bannerEngineContext.js.map +1 -0
  137. package/lib/commonjs/runtime/bannerPlacement.js +37 -0
  138. package/lib/commonjs/runtime/bannerPlacement.js.map +1 -0
  139. package/lib/commonjs/runtime/embedBannerRegistry.js +30 -0
  140. package/lib/commonjs/runtime/embedBannerRegistry.js.map +1 -0
  141. package/lib/commonjs/runtime/flowEngine.js +75 -3
  142. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  143. package/lib/commonjs/runtime/isolateCall.js +48 -0
  144. package/lib/commonjs/runtime/isolateCall.js.map +1 -0
  145. package/lib/commonjs/runtime/reportSdkError.js +19 -0
  146. package/lib/commonjs/runtime/reportSdkError.js.map +1 -0
  147. package/lib/commonjs/runtime/useBannerSession.js +37 -0
  148. package/lib/commonjs/runtime/useBannerSession.js.map +1 -0
  149. package/lib/commonjs/screenTracker.js +34 -9
  150. package/lib/commonjs/screenTracker.js.map +1 -1
  151. package/lib/commonjs/surfaces/BannerBar.js +160 -0
  152. package/lib/commonjs/surfaces/BannerBar.js.map +1 -0
  153. package/lib/commonjs/surfaces/BannerSurface.js +78 -0
  154. package/lib/commonjs/surfaces/BannerSurface.js.map +1 -0
  155. package/lib/commonjs/surfaces/MadeWithUserflow.js +12 -8
  156. package/lib/commonjs/surfaces/MadeWithUserflow.js.map +1 -1
  157. package/lib/commonjs/surfaces/ModalSurface.js +1 -1
  158. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
  159. package/lib/commonjs/surfaces/TooltipSurface.js +17 -1
  160. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  161. package/lib/commonjs/surfaces/bannerBarLayout.js +88 -0
  162. package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -0
  163. package/lib/commonjs/surfaces/bannerBarTokens.js +42 -0
  164. package/lib/commonjs/surfaces/bannerBarTokens.js.map +1 -0
  165. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +277 -0
  166. package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
  167. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js +46 -0
  168. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
  169. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js +26 -0
  170. package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
  171. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +41 -0
  172. package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
  173. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +74 -0
  174. package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
  175. package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js +152 -0
  176. package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
  177. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +148 -0
  178. package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
  179. package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js +13 -0
  180. package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js.map +1 -0
  181. package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js +49 -0
  182. package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
  183. package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js +83 -0
  184. package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
  185. package/lib/commonjs/surfaces/resolveBannerTheme.js +22 -0
  186. package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -0
  187. package/lib/commonjs/surfaces/safeArea.js +23 -0
  188. package/lib/commonjs/surfaces/safeArea.js.map +1 -1
  189. package/lib/commonjs/version.js +1 -1
  190. package/lib/module/anchors/AutoAnchorRegistry.js +37 -11
  191. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  192. package/lib/module/anchors/fiber/fiberPath.js +118 -0
  193. package/lib/module/anchors/fiber/fiberPath.js.map +1 -0
  194. package/lib/module/anchors/fiber/findAnchorFiber.js +60 -50
  195. package/lib/module/anchors/fiber/findAnchorFiber.js.map +1 -1
  196. package/lib/module/anchors/fiber/resolveFiberPath.js +215 -0
  197. package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -0
  198. package/lib/module/anchors/fiber/visibleRect.js +139 -0
  199. package/lib/module/anchors/fiber/visibleRect.js.map +1 -0
  200. package/lib/module/anchors/fiber/visibleScreens.js +73 -37
  201. package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
  202. package/lib/module/anchors/fiber/walkVisibleFibers.js +61 -0
  203. package/lib/module/anchors/fiber/walkVisibleFibers.js.map +1 -0
  204. package/lib/module/anchors/isInstanceOnVisibleScreen.js +46 -0
  205. package/lib/module/anchors/isInstanceOnVisibleScreen.js.map +1 -0
  206. package/lib/module/anchors/resolveAutoAnchorHost.js +22 -15
  207. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
  208. package/lib/module/anchors/semanticMatcher.js +26 -9
  209. package/lib/module/anchors/semanticMatcher.js.map +1 -1
  210. package/lib/module/anonymousId.js +4 -2
  211. package/lib/module/anonymousId.js.map +1 -1
  212. package/lib/module/authoring/ElementPickerOverlay.js +128 -52
  213. package/lib/module/authoring/ElementPickerOverlay.js.map +1 -1
  214. package/lib/module/authoring/chrome/ChromeBottomSheet.js +32 -10
  215. package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -1
  216. package/lib/module/authoring/chrome/ChromeButton.js +8 -3
  217. package/lib/module/authoring/chrome/ChromeButton.js.map +1 -1
  218. package/lib/module/authoring/chrome/ChromeIcon.js +4 -0
  219. package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -1
  220. package/lib/module/authoring/chrome/ChromeTopBar.js +23 -10
  221. package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -1
  222. package/lib/module/authoring/chrome/DoubleTapBridge.js +19 -12
  223. package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -1
  224. package/lib/module/authoring/chrome/doubleTapMonitor.js +10 -0
  225. package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -1
  226. package/lib/module/authoring/chrome/icons/circle-exclamation.png +0 -0
  227. package/lib/module/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  228. package/lib/module/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  229. package/lib/module/authoring/chrome/icons/triangle-exclamation.png +0 -0
  230. package/lib/module/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  231. package/lib/module/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  232. package/lib/module/authoring/chrome/tokens.js +7 -6
  233. package/lib/module/authoring/chrome/tokens.js.map +1 -1
  234. package/lib/module/authoring/elementPickerController.js.map +1 -1
  235. package/lib/module/authoring/fingerprintFromInstance.js +198 -4
  236. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
  237. package/lib/module/authoring/hitTest.js +264 -18
  238. package/lib/module/authoring/hitTest.js.map +1 -1
  239. package/lib/module/authoring/hostAtPoint.js +199 -0
  240. package/lib/module/authoring/hostAtPoint.js.map +1 -0
  241. package/lib/module/content/BannerStepButton.js +63 -0
  242. package/lib/module/content/BannerStepButton.js.map +1 -0
  243. package/lib/module/content/buttonAppearance.js +14 -0
  244. package/lib/module/content/buttonAppearance.js.map +1 -1
  245. package/lib/module/content/resolveBannerButtonChrome.js +41 -0
  246. package/lib/module/content/resolveBannerButtonChrome.js.map +1 -0
  247. package/lib/module/content/themeColor.js +14 -0
  248. package/lib/module/content/themeColor.js.map +1 -1
  249. package/lib/module/deepLinking.js +4 -4
  250. package/lib/module/evalJs/EvalJsHost.js +239 -0
  251. package/lib/module/evalJs/EvalJsHost.js.map +1 -0
  252. package/lib/module/evalJs/bootstrap.js +76 -0
  253. package/lib/module/evalJs/bootstrap.js.map +1 -0
  254. package/lib/module/evalJs/bridgeMessages.js +139 -0
  255. package/lib/module/evalJs/bridgeMessages.js.map +1 -0
  256. package/lib/module/evalJs/evalJsBridge.js +25 -0
  257. package/lib/module/evalJs/evalJsBridge.js.map +1 -0
  258. package/lib/module/evalJs/evalJsController.js +119 -0
  259. package/lib/module/evalJs/evalJsController.js.map +1 -0
  260. package/lib/module/evalJs/getWebView.js +76 -0
  261. package/lib/module/evalJs/getWebView.js.map +1 -0
  262. package/lib/module/evalJs/injectEvalPending.js +15 -0
  263. package/lib/module/evalJs/injectEvalPending.js.map +1 -0
  264. package/lib/module/evalJs/types.js +2 -0
  265. package/lib/module/evalJs/types.js.map +1 -0
  266. package/lib/module/evalJs/useEvalJsWebViewInjection.js +35 -0
  267. package/lib/module/evalJs/useEvalJsWebViewInjection.js.map +1 -0
  268. package/lib/module/expo-router/index.js +1 -0
  269. package/lib/module/expo-router/index.js.map +1 -1
  270. package/lib/module/expo-router/redirectSystemPath.js +70 -0
  271. package/lib/module/expo-router/redirectSystemPath.js.map +1 -0
  272. package/lib/module/expo-router/useUserflowExpoRouter.js +2 -2
  273. package/lib/module/index.js +114 -45
  274. package/lib/module/index.js.map +1 -1
  275. package/lib/module/lifecycle.js.map +1 -1
  276. package/lib/module/navigation/WithUserflowReactNavigation.js +14 -11
  277. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
  278. package/lib/module/navigation/openFlowNavigateUrl.js +12 -5
  279. package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
  280. package/lib/module/pairing/PairingController.js +245 -27
  281. package/lib/module/pairing/PairingController.js.map +1 -1
  282. package/lib/module/pairing/PreviewModeBanner.js +54 -16
  283. package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
  284. package/lib/module/pairing/deepLink.js +21 -5
  285. package/lib/module/pairing/deepLink.js.map +1 -1
  286. package/lib/module/pairing/deviceId.js +41 -0
  287. package/lib/module/pairing/deviceId.js.map +1 -0
  288. package/lib/module/pairing/diagnostics.js +5 -4
  289. package/lib/module/pairing/diagnostics.js.map +1 -1
  290. package/lib/module/pairing/tokenStorage.js +47 -7
  291. package/lib/module/pairing/tokenStorage.js.map +1 -1
  292. package/lib/module/pairing/usePairingState.js +3 -1
  293. package/lib/module/pairing/usePairingState.js.map +1 -1
  294. package/lib/module/pairing/usePreviewBarHold.js +134 -0
  295. package/lib/module/pairing/usePreviewBarHold.js.map +1 -0
  296. package/lib/module/runtime/BannerHost.js +92 -0
  297. package/lib/module/runtime/BannerHost.js.map +1 -0
  298. package/lib/module/runtime/EmbedBannerPlaceholder.js +94 -0
  299. package/lib/module/runtime/EmbedBannerPlaceholder.js.map +1 -0
  300. package/lib/module/runtime/SdkErrorBoundary.js +55 -0
  301. package/lib/module/runtime/SdkErrorBoundary.js.map +1 -0
  302. package/lib/module/runtime/TargetPressBridge.js +19 -12
  303. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  304. package/lib/module/runtime/UserflowOverlay.js +92 -0
  305. package/lib/module/runtime/UserflowOverlay.js.map +1 -0
  306. package/lib/module/runtime/UserflowProvider.js +136 -66
  307. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  308. package/lib/module/runtime/bannerEngine.js +55 -0
  309. package/lib/module/runtime/bannerEngine.js.map +1 -0
  310. package/lib/module/runtime/bannerEngineContext.js +7 -0
  311. package/lib/module/runtime/bannerEngineContext.js.map +1 -0
  312. package/lib/module/runtime/bannerPlacement.js +30 -0
  313. package/lib/module/runtime/bannerPlacement.js.map +1 -0
  314. package/lib/module/runtime/embedBannerRegistry.js +24 -0
  315. package/lib/module/runtime/embedBannerRegistry.js.map +1 -0
  316. package/lib/module/runtime/flowEngine.js +72 -3
  317. package/lib/module/runtime/flowEngine.js.map +1 -1
  318. package/lib/module/runtime/isolateCall.js +43 -0
  319. package/lib/module/runtime/isolateCall.js.map +1 -0
  320. package/lib/module/runtime/reportSdkError.js +15 -0
  321. package/lib/module/runtime/reportSdkError.js.map +1 -0
  322. package/lib/module/runtime/useBannerSession.js +33 -0
  323. package/lib/module/runtime/useBannerSession.js.map +1 -0
  324. package/lib/module/screenTracker.js +33 -9
  325. package/lib/module/screenTracker.js.map +1 -1
  326. package/lib/module/surfaces/BannerBar.js +155 -0
  327. package/lib/module/surfaces/BannerBar.js.map +1 -0
  328. package/lib/module/surfaces/BannerSurface.js +72 -0
  329. package/lib/module/surfaces/BannerSurface.js.map +1 -0
  330. package/lib/module/surfaces/MadeWithUserflow.js +11 -7
  331. package/lib/module/surfaces/MadeWithUserflow.js.map +1 -1
  332. package/lib/module/surfaces/ModalSurface.js +1 -1
  333. package/lib/module/surfaces/ModalSurface.js.map +1 -1
  334. package/lib/module/surfaces/TooltipSurface.js +17 -1
  335. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  336. package/lib/module/surfaces/bannerBarLayout.js +69 -0
  337. package/lib/module/surfaces/bannerBarLayout.js.map +1 -0
  338. package/lib/module/surfaces/bannerBarTokens.js +37 -0
  339. package/lib/module/surfaces/bannerBarTokens.js.map +1 -0
  340. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +272 -0
  341. package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
  342. package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js +42 -0
  343. package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
  344. package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js +19 -0
  345. package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
  346. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +35 -0
  347. package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
  348. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +69 -0
  349. package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
  350. package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js +148 -0
  351. package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
  352. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +143 -0
  353. package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
  354. package/lib/module/surfaces/bannerWebView/buttonClassName.js +9 -0
  355. package/lib/module/surfaces/bannerWebView/buttonClassName.js.map +1 -0
  356. package/lib/module/surfaces/bannerWebView/resolveCdnHost.js +42 -0
  357. package/lib/module/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
  358. package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js +79 -0
  359. package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
  360. package/lib/module/surfaces/resolveBannerTheme.js +16 -0
  361. package/lib/module/surfaces/resolveBannerTheme.js.map +1 -0
  362. package/lib/module/surfaces/safeArea.js +22 -0
  363. package/lib/module/surfaces/safeArea.js.map +1 -1
  364. package/lib/module/version.js +1 -1
  365. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +14 -0
  366. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts +12 -0
  368. package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts +5 -4
  370. package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
  371. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
  372. package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts +32 -0
  374. package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts.map +1 -0
  375. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +6 -1
  376. package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  377. package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
  378. package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
  379. package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
  380. package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +6 -4
  383. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
  384. package/lib/typescript/commonjs/src/anonymousId.d.ts +1 -0
  385. package/lib/typescript/commonjs/src/anonymousId.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +1 -0
  387. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
  388. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
  389. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
  391. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +1 -1
  392. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
  394. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
  396. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
  397. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
  398. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +7 -6
  399. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -1
  400. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +2 -3
  401. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -1
  402. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +57 -2
  403. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  404. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +47 -3
  405. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -1
  406. package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts +7 -0
  407. package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts +14 -0
  409. package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -0
  410. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts +4 -0
  411. package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts.map +1 -1
  412. package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts +8 -0
  413. package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
  414. package/lib/typescript/commonjs/src/content/themeColor.d.ts +2 -0
  415. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/content/types.d.ts +1 -0
  417. package/lib/typescript/commonjs/src/content/types.d.ts.map +1 -1
  418. package/lib/typescript/commonjs/src/deepLinking.d.ts +4 -4
  419. package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts +14 -0
  420. package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts.map +1 -0
  421. package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts +18 -0
  422. package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts.map +1 -0
  423. package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts +37 -0
  424. package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts.map +1 -0
  425. package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts +16 -0
  426. package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts.map +1 -0
  427. package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts +24 -0
  428. package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts.map +1 -0
  429. package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts +64 -0
  430. package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts.map +1 -0
  431. package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts +4 -0
  432. package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts.map +1 -0
  433. package/lib/typescript/commonjs/src/evalJs/types.d.ts +53 -0
  434. package/lib/typescript/commonjs/src/evalJs/types.d.ts.map +1 -0
  435. package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
  436. package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
  437. package/lib/typescript/commonjs/src/expo-router/index.d.ts +1 -0
  438. package/lib/typescript/commonjs/src/expo-router/index.d.ts.map +1 -1
  439. package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts +50 -0
  440. package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts.map +1 -0
  441. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
  442. package/lib/typescript/commonjs/src/index.d.ts +16 -1
  443. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  444. package/lib/typescript/commonjs/src/lifecycle.d.ts +4 -1
  445. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
  446. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  448. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +71 -4
  449. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  450. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +9 -1
  451. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  452. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts +6 -2
  453. package/lib/typescript/commonjs/src/pairing/deepLink.d.ts.map +1 -1
  454. package/lib/typescript/commonjs/src/pairing/deviceId.d.ts +12 -0
  455. package/lib/typescript/commonjs/src/pairing/deviceId.d.ts.map +1 -0
  456. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +3 -2
  457. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +14 -2
  459. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
  461. package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts +19 -0
  462. package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts.map +1 -0
  463. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts +16 -0
  464. package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -0
  465. package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
  466. package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
  467. package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts +34 -0
  468. package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  470. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts +15 -0
  471. package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -0
  472. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +9 -3
  473. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  474. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +12 -0
  475. package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -0
  476. package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts +5 -0
  477. package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts.map +1 -0
  478. package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts +12 -0
  479. package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts.map +1 -0
  480. package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts +5 -0
  481. package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts.map +1 -0
  482. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts +25 -1
  483. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  484. package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts +20 -0
  485. package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts.map +1 -0
  486. package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts +10 -0
  487. package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts.map +1 -0
  488. package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts +5 -0
  489. package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts.map +1 -0
  490. package/lib/typescript/commonjs/src/screenTracker.d.ts +7 -3
  491. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  492. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +14 -0
  493. package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +15 -0
  495. package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -0
  496. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +10 -6
  497. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
  498. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  499. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +15 -0
  500. package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -0
  501. package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts +20 -0
  502. package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts.map +1 -0
  503. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
  504. package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
  505. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
  506. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
  507. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
  508. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
  509. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
  510. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
  511. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
  512. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
  513. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
  514. package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
  515. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
  516. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
  517. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
  518. package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
  519. package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
  520. package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
  521. package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
  522. package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
  523. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +7 -0
  524. package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
  525. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts +6 -0
  526. package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts.map +1 -1
  527. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  528. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +14 -0
  529. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  530. package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts +12 -0
  531. package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts.map +1 -0
  532. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts +5 -4
  533. package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
  534. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
  535. package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
  536. package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts +32 -0
  537. package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts.map +1 -0
  538. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +6 -1
  539. package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
  540. package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
  541. package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
  542. package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
  543. package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
  544. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
  545. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +6 -4
  546. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
  547. package/lib/typescript/module/src/anonymousId.d.ts +1 -0
  548. package/lib/typescript/module/src/anonymousId.d.ts.map +1 -1
  549. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +1 -0
  550. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
  551. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
  552. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
  553. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
  554. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +1 -1
  555. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
  556. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
  557. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
  558. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
  559. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
  560. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
  561. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +7 -6
  562. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -1
  563. package/lib/typescript/module/src/authoring/elementPickerController.d.ts +2 -3
  564. package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -1
  565. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +57 -2
  566. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
  567. package/lib/typescript/module/src/authoring/hitTest.d.ts +47 -3
  568. package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -1
  569. package/lib/typescript/module/src/authoring/hostAtPoint.d.ts +7 -0
  570. package/lib/typescript/module/src/authoring/hostAtPoint.d.ts.map +1 -0
  571. package/lib/typescript/module/src/content/BannerStepButton.d.ts +14 -0
  572. package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -0
  573. package/lib/typescript/module/src/content/buttonAppearance.d.ts +4 -0
  574. package/lib/typescript/module/src/content/buttonAppearance.d.ts.map +1 -1
  575. package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts +8 -0
  576. package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
  577. package/lib/typescript/module/src/content/themeColor.d.ts +2 -0
  578. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
  579. package/lib/typescript/module/src/content/types.d.ts +1 -0
  580. package/lib/typescript/module/src/content/types.d.ts.map +1 -1
  581. package/lib/typescript/module/src/deepLinking.d.ts +4 -4
  582. package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts +14 -0
  583. package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts.map +1 -0
  584. package/lib/typescript/module/src/evalJs/bootstrap.d.ts +18 -0
  585. package/lib/typescript/module/src/evalJs/bootstrap.d.ts.map +1 -0
  586. package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts +37 -0
  587. package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts.map +1 -0
  588. package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts +16 -0
  589. package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts.map +1 -0
  590. package/lib/typescript/module/src/evalJs/evalJsController.d.ts +24 -0
  591. package/lib/typescript/module/src/evalJs/evalJsController.d.ts.map +1 -0
  592. package/lib/typescript/module/src/evalJs/getWebView.d.ts +64 -0
  593. package/lib/typescript/module/src/evalJs/getWebView.d.ts.map +1 -0
  594. package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts +4 -0
  595. package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts.map +1 -0
  596. package/lib/typescript/module/src/evalJs/types.d.ts +53 -0
  597. package/lib/typescript/module/src/evalJs/types.d.ts.map +1 -0
  598. package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
  599. package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
  600. package/lib/typescript/module/src/expo-router/index.d.ts +1 -0
  601. package/lib/typescript/module/src/expo-router/index.d.ts.map +1 -1
  602. package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts +50 -0
  603. package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts.map +1 -0
  604. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
  605. package/lib/typescript/module/src/index.d.ts +16 -1
  606. package/lib/typescript/module/src/index.d.ts.map +1 -1
  607. package/lib/typescript/module/src/lifecycle.d.ts +4 -1
  608. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
  609. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  610. package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
  611. package/lib/typescript/module/src/pairing/PairingController.d.ts +71 -4
  612. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  613. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +9 -1
  614. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  615. package/lib/typescript/module/src/pairing/deepLink.d.ts +6 -2
  616. package/lib/typescript/module/src/pairing/deepLink.d.ts.map +1 -1
  617. package/lib/typescript/module/src/pairing/deviceId.d.ts +12 -0
  618. package/lib/typescript/module/src/pairing/deviceId.d.ts.map +1 -0
  619. package/lib/typescript/module/src/pairing/diagnostics.d.ts +3 -2
  620. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
  621. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +14 -2
  622. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
  623. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
  624. package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts +19 -0
  625. package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts.map +1 -0
  626. package/lib/typescript/module/src/runtime/BannerHost.d.ts +16 -0
  627. package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -0
  628. package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
  629. package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
  630. package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts +34 -0
  631. package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
  632. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  633. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts +15 -0
  634. package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -0
  635. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +9 -3
  636. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  637. package/lib/typescript/module/src/runtime/bannerEngine.d.ts +12 -0
  638. package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -0
  639. package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts +5 -0
  640. package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts.map +1 -0
  641. package/lib/typescript/module/src/runtime/bannerPlacement.d.ts +12 -0
  642. package/lib/typescript/module/src/runtime/bannerPlacement.d.ts.map +1 -0
  643. package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts +5 -0
  644. package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts.map +1 -0
  645. package/lib/typescript/module/src/runtime/flowEngine.d.ts +25 -1
  646. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  647. package/lib/typescript/module/src/runtime/isolateCall.d.ts +20 -0
  648. package/lib/typescript/module/src/runtime/isolateCall.d.ts.map +1 -0
  649. package/lib/typescript/module/src/runtime/reportSdkError.d.ts +10 -0
  650. package/lib/typescript/module/src/runtime/reportSdkError.d.ts.map +1 -0
  651. package/lib/typescript/module/src/runtime/useBannerSession.d.ts +5 -0
  652. package/lib/typescript/module/src/runtime/useBannerSession.d.ts.map +1 -0
  653. package/lib/typescript/module/src/screenTracker.d.ts +7 -3
  654. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  655. package/lib/typescript/module/src/surfaces/BannerBar.d.ts +14 -0
  656. package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -0
  657. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +15 -0
  658. package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -0
  659. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +10 -6
  660. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
  661. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  662. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +15 -0
  663. package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -0
  664. package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts +20 -0
  665. package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts.map +1 -0
  666. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
  667. package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
  668. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
  669. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
  670. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
  671. package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
  672. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
  673. package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
  674. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
  675. package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
  676. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
  677. package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
  678. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
  679. package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
  680. package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
  681. package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
  682. package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
  683. package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
  684. package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
  685. package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
  686. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +7 -0
  687. package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
  688. package/lib/typescript/module/src/surfaces/safeArea.d.ts +6 -0
  689. package/lib/typescript/module/src/surfaces/safeArea.d.ts.map +1 -1
  690. package/lib/typescript/module/src/version.d.ts +1 -1
  691. package/package.json +4 -3
  692. package/src/anchors/AutoAnchorRegistry.ts +41 -11
  693. package/src/anchors/fiber/fiberPath.ts +117 -0
  694. package/src/anchors/fiber/findAnchorFiber.ts +57 -47
  695. package/src/anchors/fiber/resolveFiberPath.ts +215 -0
  696. package/src/anchors/fiber/visibleRect.ts +153 -0
  697. package/src/anchors/fiber/visibleScreens.ts +74 -36
  698. package/src/anchors/fiber/walkVisibleFibers.ts +65 -0
  699. package/src/anchors/isInstanceOnVisibleScreen.ts +55 -0
  700. package/src/anchors/resolveAutoAnchorHost.ts +17 -15
  701. package/src/anchors/semanticMatcher.ts +38 -14
  702. package/src/anonymousId.ts +2 -1
  703. package/src/authoring/ElementPickerOverlay.tsx +168 -59
  704. package/src/authoring/chrome/ChromeBottomSheet.tsx +49 -8
  705. package/src/authoring/chrome/ChromeButton.tsx +9 -4
  706. package/src/authoring/chrome/ChromeIcon.tsx +10 -1
  707. package/src/authoring/chrome/ChromeTopBar.tsx +39 -15
  708. package/src/authoring/chrome/DoubleTapBridge.tsx +19 -12
  709. package/src/authoring/chrome/doubleTapMonitor.ts +10 -0
  710. package/src/authoring/chrome/icons/circle-exclamation.png +0 -0
  711. package/src/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
  712. package/src/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
  713. package/src/authoring/chrome/icons/triangle-exclamation.png +0 -0
  714. package/src/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
  715. package/src/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
  716. package/src/authoring/chrome/tokens.ts +7 -2
  717. package/src/authoring/elementPickerController.ts +2 -4
  718. package/src/authoring/fingerprintFromInstance.ts +170 -4
  719. package/src/authoring/hitTest.ts +324 -16
  720. package/src/authoring/hostAtPoint.ts +247 -0
  721. package/src/content/BannerStepButton.tsx +91 -0
  722. package/src/content/buttonAppearance.ts +16 -0
  723. package/src/content/resolveBannerButtonChrome.ts +49 -0
  724. package/src/content/themeColor.ts +15 -0
  725. package/src/content/types.ts +1 -0
  726. package/src/deepLinking.ts +4 -4
  727. package/src/evalJs/EvalJsHost.tsx +255 -0
  728. package/src/evalJs/bootstrap.ts +83 -0
  729. package/src/evalJs/bridgeMessages.ts +134 -0
  730. package/src/evalJs/evalJsBridge.ts +42 -0
  731. package/src/evalJs/evalJsController.ts +127 -0
  732. package/src/evalJs/getWebView.ts +124 -0
  733. package/src/evalJs/injectEvalPending.ts +14 -0
  734. package/src/evalJs/types.ts +56 -0
  735. package/src/evalJs/useEvalJsWebViewInjection.ts +37 -0
  736. package/src/expo-router/index.ts +8 -0
  737. package/src/expo-router/redirectSystemPath.ts +86 -0
  738. package/src/expo-router/useUserflowExpoRouter.ts +2 -2
  739. package/src/index.ts +129 -45
  740. package/src/lifecycle.ts +4 -1
  741. package/src/navigation/WithUserflowReactNavigation.tsx +13 -10
  742. package/src/navigation/openFlowNavigateUrl.ts +12 -5
  743. package/src/pairing/PairingController.ts +283 -29
  744. package/src/pairing/PreviewModeBanner.tsx +71 -14
  745. package/src/pairing/deepLink.ts +23 -5
  746. package/src/pairing/deviceId.ts +43 -0
  747. package/src/pairing/diagnostics.ts +6 -4
  748. package/src/pairing/tokenStorage.ts +60 -7
  749. package/src/pairing/usePairingState.ts +2 -0
  750. package/src/pairing/usePreviewBarHold.ts +160 -0
  751. package/src/runtime/BannerHost.tsx +102 -0
  752. package/src/runtime/EmbedBannerPlaceholder.tsx +115 -0
  753. package/src/runtime/SdkErrorBoundary.tsx +77 -0
  754. package/src/runtime/TargetPressBridge.tsx +19 -12
  755. package/src/runtime/UserflowOverlay.tsx +118 -0
  756. package/src/runtime/UserflowProvider.tsx +139 -64
  757. package/src/runtime/bannerEngine.ts +55 -0
  758. package/src/runtime/bannerEngineContext.ts +5 -0
  759. package/src/runtime/bannerPlacement.ts +36 -0
  760. package/src/runtime/embedBannerRegistry.ts +28 -0
  761. package/src/runtime/flowEngine.ts +76 -3
  762. package/src/runtime/isolateCall.ts +53 -0
  763. package/src/runtime/reportSdkError.ts +12 -0
  764. package/src/runtime/useBannerSession.ts +35 -0
  765. package/src/screenTracker.ts +34 -8
  766. package/src/surfaces/BannerBar.tsx +176 -0
  767. package/src/surfaces/BannerSurface.tsx +82 -0
  768. package/src/surfaces/MadeWithUserflow.tsx +15 -10
  769. package/src/surfaces/ModalSurface.tsx +1 -1
  770. package/src/surfaces/TooltipSurface.tsx +17 -1
  771. package/src/surfaces/bannerBarLayout.ts +74 -0
  772. package/src/surfaces/bannerBarTokens.ts +34 -0
  773. package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +312 -0
  774. package/src/surfaces/bannerWebView/bannerAutoRunEvalJs.ts +44 -0
  775. package/src/surfaces/bannerWebView/bannerAutoRunSession.ts +19 -0
  776. package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +38 -0
  777. package/src/surfaces/bannerWebView/bannerThemeStyles.ts +91 -0
  778. package/src/surfaces/bannerWebView/bannerWebFrameCss.ts +145 -0
  779. package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +178 -0
  780. package/src/surfaces/bannerWebView/buttonClassName.ts +15 -0
  781. package/src/surfaces/bannerWebView/resolveCdnHost.ts +47 -0
  782. package/src/surfaces/bannerWebView/richContentDocToHtml.ts +99 -0
  783. package/src/surfaces/resolveBannerTheme.ts +18 -0
  784. package/src/surfaces/safeArea.ts +29 -0
  785. package/src/version.ts +1 -1
  786. package/vendor/core/dist/attributes.d.ts.map +1 -1
  787. package/vendor/core/dist/attributes.js +4 -4
  788. package/vendor/core/dist/attributes.js.map +1 -1
  789. package/vendor/core/dist/engine/BannerSessionEngine.d.ts +73 -0
  790. package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -0
  791. package/vendor/core/dist/engine/BannerSessionEngine.js +236 -0
  792. package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -0
  793. package/vendor/core/dist/engine/FlowSessionEngine.d.ts +41 -1
  794. package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
  795. package/vendor/core/dist/engine/FlowSessionEngine.js +167 -28
  796. package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
  797. package/vendor/core/dist/engine/PairingEngine.d.ts +38 -2
  798. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  799. package/vendor/core/dist/engine/PairingEngine.js +19 -2
  800. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  801. package/vendor/core/dist/engine/UserflowCore.d.ts +10 -1
  802. package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
  803. package/vendor/core/dist/engine/UserflowCore.js +47 -27
  804. package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
  805. package/vendor/core/dist/engine/handleActions.d.ts +17 -3
  806. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  807. package/vendor/core/dist/engine/handleActions.js +17 -14
  808. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  809. package/vendor/core/dist/engine/trackCondition.d.ts +2 -0
  810. package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -1
  811. package/vendor/core/dist/engine/trackCondition.js +4 -2
  812. package/vendor/core/dist/engine/trackCondition.js.map +1 -1
  813. package/vendor/core/dist/engine/trackStepTriggers.d.ts +11 -1
  814. package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -1
  815. package/vendor/core/dist/engine/trackStepTriggers.js +42 -16
  816. package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -1
  817. package/vendor/core/dist/errors.d.ts +11 -1
  818. package/vendor/core/dist/errors.d.ts.map +1 -1
  819. package/vendor/core/dist/errors.js +2 -1
  820. package/vendor/core/dist/errors.js.map +1 -1
  821. package/vendor/core/dist/eventAttributes.d.ts.map +1 -1
  822. package/vendor/core/dist/eventAttributes.js +4 -2
  823. package/vendor/core/dist/eventAttributes.js.map +1 -1
  824. package/vendor/core/dist/index.d.ts +4 -1
  825. package/vendor/core/dist/index.d.ts.map +1 -1
  826. package/vendor/core/dist/index.js +1 -0
  827. package/vendor/core/dist/index.js.map +1 -1
  828. package/vendor/core/dist/normalizeAttributes.js +9 -7
  829. package/vendor/core/dist/normalizeAttributes.js.map +1 -1
  830. package/vendor/core/dist/transport/pairing.d.ts +5 -0
  831. package/vendor/core/dist/transport/pairing.d.ts.map +1 -1
  832. package/vendor/core/dist/transport/pairing.js +69 -2
  833. package/vendor/core/dist/transport/pairing.js.map +1 -1
  834. package/vendor/core/dist/transport/phoenix.d.ts +8 -0
  835. package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
  836. package/vendor/core/dist/transport/phoenix.js +16 -2
  837. package/vendor/core/dist/transport/phoenix.js.map +1 -1
  838. package/vendor/core/dist/version.d.ts +1 -1
  839. package/vendor/core/dist/version.js +1 -1
  840. package/vendor/core/package.json +1 -1
  841. package/vendor/protocol/dist/autoData.d.ts +8 -15
  842. package/vendor/protocol/dist/autoData.d.ts.map +1 -1
  843. package/vendor/protocol/dist/autoData.js.map +1 -1
  844. package/vendor/protocol/dist/flows.d.ts +58 -2
  845. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  846. package/vendor/protocol/dist/flows.js +20 -2
  847. package/vendor/protocol/dist/flows.js.map +1 -1
  848. package/vendor/protocol/dist/messages.d.ts +22 -12
  849. package/vendor/protocol/dist/messages.d.ts.map +1 -1
  850. package/vendor/protocol/dist/messages.js +5 -2
  851. package/vendor/protocol/dist/messages.js.map +1 -1
  852. package/vendor/protocol/package.json +1 -1
@@ -2,14 +2,26 @@
2
2
 
3
3
  /**
4
4
  * Parse Builder pairing deep links:
5
- * {scheme_id}://?pairing_token=<jwt>
5
+ * {scheme_id}://?pairing_token=<jwt>[&purpose=preview|select_element]
6
6
  *
7
- * `scheme_id` is typically `userflow-<digits>`.
7
+ * `scheme_id` is `userflow-` followed by an opaque, backend-generated id.
8
8
  */
9
9
 
10
+ const PAIRING_PURPOSES = ['preview', 'select_element'];
11
+ export function parsePairingPurpose(value) {
12
+ return PAIRING_PURPOSES.find(purpose => purpose === value) ?? null;
13
+ }
14
+
10
15
  /** Scheme prefix shared by preview and pairing links. */
11
16
  const USERFLOW_SCHEME_PREFIX = 'userflow-';
12
- const USERFLOW_SCHEME = /^userflow-\d+$/i;
17
+ /**
18
+ * Environment scheme_id shape — must match Expo plugin registration
19
+ * (`packages/expo/plugin/withUserflow.ts`). Everything after `userflow-` is an
20
+ * opaque id owned by the backend (today 26 base32 chars), so only check that it
21
+ * is one or more alphanumeric segments joined by single hyphens. Digit-only ids
22
+ * used in local configs also pass.
23
+ */
24
+ const USERFLOW_SCHEME = /^userflow-[a-z0-9]+(?:-[a-z0-9]+)*$/i;
13
25
 
14
26
  /**
15
27
  * Why a URL was not treated as a pairing link.
@@ -100,7 +112,7 @@ export function inspectPairingDeepLink(url) {
100
112
  };
101
113
 
102
114
  // Only once the URL is known to target pairing does the scheme shape matter.
103
- // Checking it earlier would misreport preview links on non-numeric schemes.
115
+ // Checking it earlier would misreport preview links on malformed schemes.
104
116
  if (!USERFLOW_SCHEME.test(scheme)) return {
105
117
  ok: false,
106
118
  reason: 'bad-scheme-shape'
@@ -109,11 +121,15 @@ export function inspectPairingDeepLink(url) {
109
121
  ok: false,
110
122
  reason: 'missing-token'
111
123
  };
124
+ const purpose = parsePairingPurpose(parsed.searchParams.get('purpose'));
112
125
  return {
113
126
  ok: true,
114
127
  link: {
115
128
  scheme,
116
- pairingToken
129
+ pairingToken,
130
+ ...(purpose ? {
131
+ purpose
132
+ } : {})
117
133
  }
118
134
  };
119
135
  }
@@ -1 +1 @@
1
- {"version":3,"names":["USERFLOW_SCHEME_PREFIX","USERFLOW_SCHEME","isPairingAttempt","reason","inspectPairingDeepLink","url","length","ok","schemeMatch","exec","scheme","isUserflowScheme","toLowerCase","startsWith","remainder","slice","replace","parsed","URL","pairingToken","searchParams","get","hasPairingTokenParam","has","isRoot","hostname","pathname","isPair","test","link","parsePairingDeepLink","result","isUserflowPairingUrl"],"sourceRoot":"../../../src","sources":["pairing/deepLink.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA,MAAMA,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,eAAe,GAAG,iBAAiB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,MAAgC,EACG;EACnC,OAAOA,MAAM,KAAK,gBAAgB,IAAIA,MAAM,KAAK,kBAAkB,IAAIA,MAAM,KAAK,eAAe;AACnG;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,GAA8B,EAAyB;EAC5F,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACC,MAAM,KAAK,CAAC,EAAE;IAC/C,OAAO;MAAEC,EAAE,EAAE,KAAK;MAAEJ,MAAM,EAAE;IAAe,CAAC;EAC9C;EAEA,MAAMK,WAAW,GAAG,wBAAwB,CAACC,IAAI,CAACJ,GAAG,CAAC;EACtD,IAAI,CAACG,WAAW,GAAG,CAAC,CAAC,EAAE,OAAO;IAAED,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAe,CAAC;EACnE,MAAMO,MAAM,GAAGF,WAAW,CAAC,CAAC,CAAC;EAC7B,MAAMG,gBAAgB,GAAGD,MAAM,CAACE,WAAW,CAAC,CAAC,CAACC,UAAU,CAACb,sBAAsB,CAAC;;EAEhF;EACA;EACA;EACA;E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B,MAAM,EAAE,OAAO;IAAEpB,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAgB,CAAC;;EAE1D;EACA;EACA,IAAI,CAACF,eAAe,CAAC2B,IAAI,CAAClB,MAAM,CAAC,EAAE,OAAO;IAAEH,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAmB,CAAC;EAEnF,IAAI,CAACgB,YAAY,EAAE,OAAO;IAAEZ,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAgB,CAAC;EAEhE,OAAO;IAAEI,EAAE,EAAE,IAAI;IAAEsB,IAAI,EAAE;MAAEnB,MAAM;MAAES;IAAa;EAAE,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASW,oBAAoBA,CAACzB,GAA8B,EAA0B;EAC3F,MAAM0B,MAAM,GAAG3B,sBAAsB,CAACC,GAAG,CAAC;EAC1C,OAAO0B,MAAM,CAACxB,EAAE,GAAGwB,MAAM,CAACF,IAAI,GAAG,IAAI;AACvC;;AAEA;AACA,OAAO,SAASG,oBAAoBA,CAAC3B,GAA8B,EAAW;EAC5E,OAAOyB,oBAAoB,CAACzB,GAAG,CAAC,IAAI,IAAI;AAC1C","ignoreList":[]}
1
+ {"version":3,"names":["PAIRING_PURPOSES","parsePairingPurpose","value","find","purpose","USERFLOW_SCHEME_PREFIX","USERFLOW_SCHEME","isPairingAttempt","reason","inspectPairingDeepLink","url","length","ok","schemeMatch","exec","scheme","isUserflowScheme","toLowerCase","startsWith","remainder","slice","replace","parsed","URL","pairingToken","searchParams","get","hasPairingTokenParam","has","isRoot","hostname","pathname","isPair","test","link","parsePairingDeepLink","result","isUserflowPairingUrl"],"sourceRoot":"../../../src","sources":["pairing/deepLink.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;;AASA,MAAMA,gBAA2C,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAC;AAEjF,OAAO,SAASC,mBAAmBA,CAACC,KAAgC,EAAyB;EAC3F,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AAC;EAEnF,IAAI,CAACgB,YAAY,EAAE,OAAO;IAAEZ,EAAE,EAAE,KAAK;IAAEJ,MAAM,EAAE;EAAgB,CAAC;EAEhE,MAAMJ,OAAO,GAAGH,mBAAmB,CAACqB,MAAM,CAACG,YAAY,CAACC,GAAG,CAAC,SAAS,CAAC,CAAC;EACvE,OAAO;IAAEd,EAAE,EAAE,IAAI;IAAEsB,IAAI,EAAE;MAAEnB,MAAM;MAAES,YAAY;MAAE,IAAIpB,OAAO,GAAG;QAAEA;MAAQ,CAAC,GAAG,CAAC,CAAC;IAAE;EAAE,CAAC;AACtF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAAS+B,oBAAoBA,CAACzB,GAA8B,EAA0B;EAC3F,MAAM0B,MAAM,GAAG3B,sBAAsB,CAACC,GAAG,CAAC;EAC1C,OAAO0B,MAAM,CAACxB,EAAE,GAAGwB,MAAM,CAACF,IAAI,GAAG,IAAI;AACvC;;AAEA;AACA,OAAO,SAASG,oBAAoBA,CAAC3B,GAA8B,EAAW;EAC5E,OAAOyB,oBAAoB,CAACzB,GAAG,CAAC,IAAI,IAAI;AAC1C","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ import AsyncStorage from '@react-native-async-storage/async-storage';
4
+ import { uuid } from "../anonymousId.js";
5
+
6
+ /**
7
+ * Stable id for this install on the pairing channel.
8
+ *
9
+ * The server allows one device per pairing topic and only the same id may
10
+ * rejoin while the previous presence lingers. The id identifies the device,
11
+ * not the user, so `reset()` and `exitPreview()` must not clear it.
12
+ */
13
+ export const PAIRING_DEVICE_ID_STORAGE_KEY = 'userflow:pairingDeviceId';
14
+ let memoized = null;
15
+ export async function getOrCreatePairingDeviceId() {
16
+ if (memoized !== null) return memoized;
17
+ try {
18
+ const stored = await AsyncStorage.getItem(PAIRING_DEVICE_ID_STORAGE_KEY);
19
+ if (typeof stored === 'string' && stored.length > 0) {
20
+ memoized = stored;
21
+ return stored;
22
+ }
23
+ } catch {
24
+ memoized = uuid();
25
+ return memoized;
26
+ }
27
+ const created = uuid();
28
+ memoized = created;
29
+ try {
30
+ await AsyncStorage.setItem(PAIRING_DEVICE_ID_STORAGE_KEY, created);
31
+ } catch {
32
+ // Keep the in-memory id for this process. A later launch may mint another.
33
+ }
34
+ return created;
35
+ }
36
+
37
+ /** @internal Clears the process memo so tests can simulate a new launch. */
38
+ export function resetPairingDeviceIdForTests() {
39
+ memoized = null;
40
+ }
41
+ //# sourceMappingURL=deviceId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AsyncStorage","uuid","PAIRING_DEVICE_ID_STORAGE_KEY","memoized","getOrCreatePairingDeviceId","stored","getItem","length","created","setItem","resetPairingDeviceIdForTests"],"sourceRoot":"../../../src","sources":["pairing/deviceId.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,2CAA2C;AAEpE,SAASC,IAAI,QAAQ,mBAAgB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAG,0BAA0B;AAEvE,IAAIC,QAAuB,GAAG,IAAI;AAElC,OAAO,eAAeC,0BAA0BA,CAAA,EAAoB;EAClE,IAAID,QAAQ,KAAK,IAAI,EAAE,OAAOA,QAAQ;EAEtC,IAAI;IACF,MAAME,MAAM,GAAG,MAAML,YAAY,CAACM,OAAO,CAACJ,6BAA6B,CAAC;IACxE,IAAI,OAAOG,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACE,MAAM,GAAG,CAAC,EAAE;MACnDJ,QAAQ,GAAGE,MAAM;MACjB,OAAOA,MAAM;IACf;EACF,CAAC,CAAC,MAAM;IACNF,QAAQ,GAAGF,IAAI,CAAC,CAAC;IACjB,OAAOE,QAAQ;EACjB;EAEA,MAAMK,OAAO,GAAGP,IAAI,CAAC,CAAC;EACtBE,QAAQ,GAAGK,OAAO;EAClB,IAAI;IACF,MAAMR,YAAY,CAACS,OAAO,CAACP,6BAA6B,EAAEM,OAAO,CAAC;EACpE,CAAC,CAAC,MAAM;IACN;EAAA;EAEF,OAAOA,OAAO;AAChB;;AAEA;AACA,OAAO,SAASE,4BAA4BA,CAAA,EAAS;EACnDP,QAAQ,GAAG,IAAI;AACjB","ignoreList":[]}
@@ -73,7 +73,7 @@ export function pairingMissingTokenMessage(url) {
73
73
  * host app's own scheme substituted for the environment's `scheme_id`.
74
74
  */
75
75
  export function pairingForeignSchemeMessage(url) {
76
- return `${PREFIX} Ignoring "${redactPairingToken(url)}": this is a Builder pairing ` + `link, but it was opened with a scheme Userflow does not own. Use your ` + `environment's scheme_id ("userflow-" followed by digits) exactly as the ` + `pairing QR code provides it — do not substitute your app's own scheme. ` + `Register it via the @userflow-tech/react-native plugin ({ schemeId: 'userflow-…' }) and ` + `rebuild the native app; a Metro reload is not enough.`;
76
+ return `${PREFIX} Ignoring "${redactPairingToken(url)}": this is a Builder pairing ` + `link, but it was opened with a scheme Userflow does not own. Use your ` + `environment's scheme_id ("userflow-" followed by its id) exactly as the ` + `pairing QR code provides it — do not substitute your app's own scheme. ` + `Register it via the @userflow-tech/react-native plugin ({ schemeId: 'userflow-…' }) and ` + `rebuild the native app; a Metro reload is not enough.`;
77
77
  }
78
78
 
79
79
  /** Message for a pairing attempt that could not be used. */
@@ -100,10 +100,11 @@ export function pairingListenerSetupFailedMessage(reason) {
100
100
 
101
101
  /**
102
102
  * The URL used a `userflow-` scheme that is not a valid `scheme_id`. Pairing
103
- * requires `userflow-` followed by digits, so an arbitrary `userflow-*` scheme
104
- * can match preview links but not pairing ones.
103
+ * requires `userflow-` followed by one or more alphanumeric segments joined by
104
+ * single hyphens. A malformed `userflow-*` scheme can match preview links but
105
+ * not pairing ones.
105
106
  */
106
107
  export function pairingSchemeShapeMessage(url) {
107
- return `${PREFIX} Ignoring Builder pairing link "${redactPairingToken(url)}": the scheme must be your ` + `environment's scheme_id — "userflow-" followed by digits (e.g. userflow-257587). ` + `Check the schemeId passed to the @userflow-tech/react-native plugin.`;
108
+ return `${PREFIX} Ignoring Builder pairing link "${redactPairingToken(url)}": the scheme must be your ` + `environment's scheme_id — "userflow-" followed by letters and digits, optionally ` + `split by single hyphens (e.g. userflow-v7twv2fw2ja2jaco7kesvowmem). ` + `Check the schemeId passed to the @userflow-tech/react-native plugin.`;
108
109
  }
109
110
  //# sourceMappingURL=diagnostics.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PREFIX","redactPairingToken","url","replace","defaultPairingLogger","message","console","warn","pairingLinkDeferredMessage","pairingLinkInitFailedMessage","reason","pairingConnectFailedMessage","pairingPreviewErrorMessage","pairingMissingTokenMessage","pairingForeignSchemeMessage","pairingAttemptRejectionMessage","pairingSchemeShapeMessage","pairingTokenStoreClearFailedMessage","pairingListenerSetupFailedMessage"],"sourceRoot":"../../../src","sources":["pairing/diagnostics.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,MAAM,GAAG,YAAY;;AAE3B;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,GAAW,EAAU;EAC/C,OAAOA,GAAG,CAACC,OAAO,CAAC,wBAAwB,EAAE,cAAc,CAAC;AAC9D;;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAmC,GAAIC,OAAO,IAAK;EAC9D;EACAC,OAAO,CAACC,IAAI,CAACF,OAAO,CAAC;AACvB,CAAC;;AAED;AACA,OAAO,SAASG,0BAA0BA,CAAA,EAAW;EACnD,OACE,GAAGR,MAAM,kEAAkE,GAC3E,uDAAuD;AAE3D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASS,4BAA4BA,CAACC,MAAc,EAAU;EACnE,OACE,GAAGV,MAAM,wEAAwE,GACjF,iBAAiBU,MAAM,2DAA2D,GAClF,mEAAmE;AAEvE;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CAACD,MAAc,EAAU;EAClE,OACE,GAAGV,MAAM,uCAAuCU,MAAM,4BAA4B,GAClF,yDAA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":3,"names":["PREFIX","redactPairingToken","url","replace","defaultPairingLogger","message","console","warn","pairingLinkDeferredMessage","pairingLinkInitFailedMessage","reason","pairingConnectFailedMessage","pairingPreviewErrorMessage","pairingMissingTokenMessage","pairingForeignSchemeMessage","pairingAttemptRejectionMessage","pairingSchemeShapeMessage","pairingTokenStoreClearFailedMessage","pairingListenerSetupFailedMessage"],"sourceRoot":"../../../src","sources":["pairing/diagnostics.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,MAAM,GAAG,YAAY;;AAE3B;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAACC,GAAW,EAAU;EAC/C,OAAOA,GAAG,CAACC,OAAO,CAAC,wBAAwB,EAAE,cAAc,CAAC;AAC9D;;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAmC,GAAIC,OAAO,IAAK;EAC9D;EACAC,OAAO,CAACC,IAAI,CAACF,OAAO,CAAC;AACvB,CAAC;;AAED;AACA,OAAO,SAASG,0BAA0BA,CAAA,EAAW;EACnD,OACE,GAAGR,MAAM,kEAAkE,GAC3E,uDAAuD;AAE3D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASS,4BAA4BA,CAACC,MAAc,EAAU;EACnE,OACE,GAAGV,MAAM,wEAAwE,GACjF,iBAAiBU,MAAM,2DAA2D,GAClF,mEAAmE;AAEvE;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CAACD,MAAc,EAAU;EAClE,OACE,GAAGV,MAAM,uCAAuCU,MAAM,4BAA4B,GAClF,yDAAyD;AAE7D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASE,0BAA0BA,CAACF,MAAc,EAAU;EACjE,OAAO,GAAGV,MAAM,qBAAqBU,MAAM,EAAE;AAC/C;;AAEA;AACA,OAAO,SAASG,0BAA0BA,CAACX,GAAW,EAAU;EAC9D,OACE,GAAGF,MAAM,mCAAmCC,kBAAkB,CAACC,GAAG,CAAC,QAAQ,GAC3E,8EAA8E,GAC9E,6CAA6C;AAEjD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASY,2BAA2BA,CAACZ,GAAW,EAAU;EAC/D,OACE,GAAGF,MAAM,cAAcC,kBAAkB,CAACC,GAAG,CAAC,+BAA+B,GAC7E,wEAAwE,GACxE,0EAA0E,GAC1E,yEAAyE,GACzE,0FAA0F,GAC1F,uDAAuD;AAE3D;;AAEA;AACA,OAAO,SAASa,8BAA8BA,CAC5CL,MAA+B,EAC/BR,GAAW,EACH;EACR,QAAQQ,MAAM;IACZ,KAAK,gBAAgB;MACnB,OAAOI,2BAA2B,CAACZ,GAAG,CAAC;IACzC,KAAK,kBAAkB;MACrB,OAAOc,yBAAyB,CAACd,GAAG,CAAC;IACvC,KAAK,eAAe;MAClB,OAAOW,0BAA0B,CAACX,GAAG,CAAC;EAC1C;AACF;;AAEA;AACA,OAAO,SAASe,mCAAmCA,CAACP,MAAc,EAAU;EAC1E,OACE,GAAGV,MAAM,8CAA8CU,MAAM,iBAAiB,GAC9E,6EAA6E;AAEjF;;AAEA;AACA,OAAO,SAASQ,iCAAiCA,CAACR,MAAc,EAAU;EACxE,OACE,GAAGV,MAAM,+CAA+CU,MAAM,iBAAiB,GAC/E,4EAA4E;AAEhF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,yBAAyBA,CAACd,GAAW,EAAU;EAC7D,OACE,GAAGF,MAAM,mCAAmCC,kBAAkB,CAACC,GAAG,CAAC,6BAA6B,GAChG,mFAAmF,GACnF,sEAAsE,GACtE,sEAAsE;AAE1E","ignoreList":[]}
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  /**
4
- * Persist the pairing JWT for reconnect within the current app session.
5
- * Cleared on SDK init / exit preview / app restart (pairing exits on restart).
4
+ * Persist the pairing JWT so a relaunch can resume Builder pairing until the
5
+ * token expires or preview is exited. Resume requires `expo-secure-store`;
6
+ * the in-memory fallback does not survive a process restart.
6
7
  */
7
8
 
8
- const STORAGE_KEY = 'userflow:pairingToken';
9
+ import { parsePairingPurpose } from "./deepLink.js";
10
+
11
+ // SecureStore rejects keys outside [A-Za-z0-9._-], so no `userflow:` prefix here.
12
+ export const PAIRING_TOKEN_STORAGE_KEY = 'userflow.pairingToken';
13
+ export const PAIRING_PURPOSE_STORAGE_KEY = 'userflow.pairingPurpose';
9
14
  let cachedSecureStore;
10
15
 
11
16
  /** Expo modules must be installed natively — not just the JS package. */
@@ -36,6 +41,7 @@ function tryLoadExpoSecureStore() {
36
41
  /** In-memory store used when SecureStore is unavailable (and in tests). */
37
42
  export function createMemoryPairingTokenStore() {
38
43
  let value = null;
44
+ let purposeValue = null;
39
45
  return {
40
46
  async get() {
41
47
  return value;
@@ -45,6 +51,13 @@ export function createMemoryPairingTokenStore() {
45
51
  },
46
52
  async clear() {
47
53
  value = null;
54
+ purposeValue = null;
55
+ },
56
+ async getPurpose() {
57
+ return purposeValue;
58
+ },
59
+ async setPurpose(purpose) {
60
+ purposeValue = purpose;
48
61
  }
49
62
  };
50
63
  }
@@ -58,24 +71,51 @@ export function createPairingTokenStore() {
58
71
  return {
59
72
  async get() {
60
73
  try {
61
- return await secure.getItemAsync(STORAGE_KEY);
74
+ return await secure.getItemAsync(PAIRING_TOKEN_STORAGE_KEY);
62
75
  } catch {
63
76
  return null;
64
77
  }
65
78
  },
66
79
  async set(token) {
67
80
  try {
68
- await secure.setItemAsync(STORAGE_KEY, token);
69
- } catch {
81
+ await secure.setItemAsync(PAIRING_TOKEN_STORAGE_KEY, token);
82
+ } catch (error) {
70
83
  // Best-effort; reconnect still works from in-memory PairingEngine token.
84
+ if (__DEV__) {
85
+ // eslint-disable-next-line no-console -- intentional persistence diagnostic
86
+ console.warn('[Userflow] Could not save the pairing token, so preview will not resume after a relaunch:', error instanceof Error ? error.message : String(error));
87
+ }
71
88
  }
72
89
  },
73
90
  async clear() {
74
91
  try {
75
- await secure.deleteItemAsync(STORAGE_KEY);
92
+ await secure.deleteItemAsync(PAIRING_TOKEN_STORAGE_KEY);
76
93
  } catch {
77
94
  // ignore
78
95
  }
96
+ try {
97
+ await secure.deleteItemAsync(PAIRING_PURPOSE_STORAGE_KEY);
98
+ } catch {
99
+ // ignore
100
+ }
101
+ },
102
+ async getPurpose() {
103
+ try {
104
+ return parsePairingPurpose(await secure.getItemAsync(PAIRING_PURPOSE_STORAGE_KEY));
105
+ } catch {
106
+ return null;
107
+ }
108
+ },
109
+ async setPurpose(purpose) {
110
+ try {
111
+ if (purpose) {
112
+ await secure.setItemAsync(PAIRING_PURPOSE_STORAGE_KEY, purpose);
113
+ } else {
114
+ await secure.deleteItemAsync(PAIRING_PURPOSE_STORAGE_KEY);
115
+ }
116
+ } catch {
117
+ // Best-effort; a resume without it falls back to the default reveal.
118
+ }
79
119
  }
80
120
  };
81
121
  }
@@ -1 +1 @@
1
- {"version":3,"names":["STORAGE_KEY","cachedSecureStore","isExpoModulesRuntimeAvailable","expo","globalThis","EventEmitter","tryLoadExpoSecureStore","undefined","require","__DEV__","console","warn","createMemoryPairingTokenStore","value","get","set","token","clear","createPairingTokenStore","secure","getItemAsync","setItemAsync","deleteItemAsync","resetPairingTokenStoreCacheForTests"],"sourceRoot":"../../../src","sources":["pairing/tokenStorage.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,MAAMA,WAAW,GAAG,uBAAuB;AAc3C,IAAIC,iBAAuD;;AAE3D;AACA,SAASC,6BAA6BA,CAAA,EAAY;EAChD,MAAMC,IAAI,GAAIC,UAAU,CAA2CD,IAAI;EACvE,OAAO,OAAOA,IAAI,EAAEE,YAAY,KAAK,UAAU;AACjD;AAEA,SAASC,sBAAsBA,CAAA,EAA6B;EAC1D,IAAIL,iBAAiB,KAAKM,SAAS,EAAE,OAAON,iBAAiB;EAE7D,IAAI,OAAOO,OAAO,KAAK,UAAU,IAAI,CAACN,6BAA6B,CAAC,CAAC,EAAE;IACrED,iBAAiB,GAAG,IAAI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AACA,OAAO,SAASuB,mCAAmCA,CAAA,EAAS;EAC1DtB,iBAAiB,GAAGM,SAAS;AAC/B","ignoreList":[]}
1
+ {"version":3,"names":["parsePairingPurpose","PAIRING_TOKEN_STORAGE_KEY","PAIRING_PURPOSE_STORAGE_KEY","cachedSecureStore","isExpoModulesRuntimeAvailable","expo","globalThis","EventEmitter","tryLoadExpoSecureStore","undefined","require","__DEV__","console","warn","createMemoryPairingTokenStore","value","purposeValue","get","set","token","clear","getPurpose","setPurpose","purpose","createPairingTokenStore","secure","getItemAsync","setItemAsync","error","Error","message","String","deleteItemAsync","resetPairingTokenStoreCacheForTests"],"sourceRoot":"../../../src","sources":["pairing/tokenStorage.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAIA,SAASA,mBAAmB,QAAQ,eAAY;;AAEhD;AACA,OAAO,MAAMC,yBAAyB,GAAG,uBAAuB;AAChE,OAAO,MAAMC,2BAA2B,GAAG,yBAAyB;AAsBpE,IAAIC,iBAAuD;;AAE3D;AACA,SAASC,6BAA6BA,CAAA,EAAY;EAChD,MAAMC,IAAI,GAAIC,UAAU,CAA2CD,IAAI;EACvE,OAAO,OAAOA,IAAI,EAAEE,YAAY,KAAK,UAAU;AACjD;AAEA,SAASC,sBAAsBA,CAAA,EAA6B;EAC1D,IAAIL,iBAAiB,KAAKM,SAAS,EAAE,OAAON,iBAAiB;EAE7D,IAAI,OAAOO,OAAO,KAAK,UAAU,IAAI,CAACN,6BAA6B,CAAC,CAAC,EAAE;IACrED,iBAAiB,GAAG,IAAI;IACxB,OAAOA,iBAAiB;EAC1B;EAEA,IAAI;IACF;IACA;IACAA,iBAAiB,GAAGO,OAAO,CAAC,mBAAmB,CAAsB;EACvE,CAAC,CAAC,MAAM;IACNP,iBAAiB,GAAG,IAAI;IACxB,IAAIQ,OAAO,EAAE;MACX;MACAC,OAAO,CAACC,IAAI,CACV,6DAA6D,GAC3D,0DACJ,CAAC;IACH;EACF;EAEA,OAAOV,iBAAiB;AAC1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MAAMK,MAAM,CAACO,eAAe,CAAC/B,yBAAyB,CAAC;MACzD,CAAC,CAAC,MAAM;QACN;MAAA;MAEF,IAAI;QACF,MAAMwB,MAAM,CAACO,eAAe,CAAC9B,2BAA2B,CAAC;MAC3D,CAAC,CAAC,MAAM;QACN;MAAA;IAEJ,CAAC;IACD,MAAMmB,UAAUA,CAAA,EAAG;MACjB,IAAI;QACF,OAAOrB,mBAAmB,CAAC,MAAMyB,MAAM,CAACC,YAAY,CAACxB,2BAA2B,CAAC,CAAC;MACpF,CAAC,CAAC,MAAM;QACN,OAAO,IAAI;MACb;IACF,CAAC;IACD,MAAMoB,UAAUA,CAACC,OAA8B,EAAE;MAC/C,IAAI;QACF,IAAIA,OAAO,EAAE;UACX,MAAME,MAAM,CAACE,YAAY,CAACzB,2BAA2B,EAAEqB,OAAO,CAAC;QACjE,CAAC,MAAM;UACL,MAAME,MAAM,CAACO,eAAe,CAAC9B,2BAA2B,CAAC;QAC3D;MACF,CAAC,CAAC,MAAM;QACN;MAAA;IAEJ;EACF,CAAC;AACH;;AAEA;AACA,OAAO,SAAS+B,mCAAmCA,CAAA,EAAS;EAC1D9B,iBAAiB,GAAGM,SAAS;AAC/B","ignoreList":[]}
@@ -11,7 +11,9 @@ const IDLE = {
11
11
  needsRescan: false,
12
12
  awaitingStartCondition: false,
13
13
  canRestartPreview: false,
14
- previewRestartGeneration: 0
14
+ previewRestartGeneration: 0,
15
+ pairingSessionGeneration: 0,
16
+ previewStartGeneration: 0
15
17
  };
16
18
 
17
19
  /** Subscribe to Builder pairing / preview-mode state (dev builds only). */
@@ -1 +1 @@
1
- {"version":3,"names":["React","onPairingController","peekPairingController","IDLE","status","pairingId","deviceId","previewActive","lastError","needsRescan","awaitingStartCondition","canRestartPreview","previewRestartGeneration","usePairingState","state","setState","useState","getState","useEffect","unsubState","bind","controller","onStateChange","existing","unsubInstall"],"sourceRoot":"../../../src","sources":["pairing/usePairingState.ts"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,mBAAmB,EAAEC,qBAAqB,QAAQ,qBAAkB;AAE7E,MAAMC,IAAwB,GAAG;EAC/BC,MAAM,EAAE,MAAM;EACdC,SAAS,EAAE,IAAI;EACfC,QAAQ,EAAE,IAAI;EACdC,aAAa,EAAE,KAAK;EACpBC,SAAS,EAAE,IAAI;EACfC,WAAW,EAAE,KAAK;EAClBC,sBAAsB,EAAE,KAAK;EAC7BC,iBAAiB,EAAE,KAAK;EACxBC,wBAAwB,EAAE;AAC5B,CAAC;;AAED;AACA,OAAO,SAASC,eAAeA,CAAA,EAAuB;EACpD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGf,KAAK,CAACgB,QAAQ,CACtC,MAAMd,qBAAqB,CAAC,CAAC,EAAEe,QAAQ,CAAC,CAAC,IAAId,IAC/C,CAAC;EAEDH,KAAK,CAACkB,SAAS,CAAC,MAAM;IACpB,IAAIC,UAAoC;IAExC,MAAMC,IAAI,GAAIC,UAA6B,IAAK;MAC9CF,UAAU,GAAG,CAAC;MACdJ,QAAQ,CAACM,UAAU,CAACJ,QAAQ,CAAC,CAAC,CAAC;MAC/BE,UAAU,GAAGE,UAAU,CAACC,aAAa,CAACP,QAAQ,CAAC;IACjD,CAAC;IAED,MAAMQ,QAAQ,GAAGrB,qBAAqB,CAAC,CAAC;IACxC,IAAIqB,QAAQ,EAAEH,IAAI,CAACG,QAAQ,CAAC;IAC5B,MAAMC,YAAY,GAAGvB,mBAAmB,CAACmB,IAAI,CAAC;IAE9C,OAAO,MAAM;MACXI,YAAY,CAAC,CAAC;MACdL,UAAU,GAAG,CAAC;IAChB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"names":["React","onPairingController","peekPairingController","IDLE","status","pairingId","deviceId","previewActive","lastError","needsRescan","awaitingStartCondition","canRestartPreview","previewRestartGeneration","pairingSessionGeneration","previewStartGeneration","usePairingState","state","setState","useState","getState","useEffect","unsubState","bind","controller","onStateChange","existing","unsubInstall"],"sourceRoot":"../../../src","sources":["pairing/usePairingState.ts"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,mBAAmB,EAAEC,qBAAqB,QAAQ,qBAAkB;AAE7E,MAAMC,IAAwB,GAAG;EAC/BC,MAAM,EAAE,MAAM;EACdC,SAAS,EAAE,IAAI;EACfC,QAAQ,EAAE,IAAI;EACdC,aAAa,EAAE,KAAK;EACpBC,SAAS,EAAE,IAAI;EACfC,WAAW,EAAE,KAAK;EAClBC,sBAAsB,EAAE,KAAK;EAC7BC,iBAAiB,EAAE,KAAK;EACxBC,wBAAwB,EAAE,CAAC;EAC3BC,wBAAwB,EAAE,CAAC;EAC3BC,sBAAsB,EAAE;AAC1B,CAAC;;AAED;AACA,OAAO,SAASC,eAAeA,CAAA,EAAuB;EACpD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGjB,KAAK,CAACkB,QAAQ,CACtC,MAAMhB,qBAAqB,CAAC,CAAC,EAAEiB,QAAQ,CAAC,CAAC,IAAIhB,IAC/C,CAAC;EAEDH,KAAK,CAACoB,SAAS,CAAC,MAAM;IACpB,IAAIC,UAAoC;IAExC,MAAMC,IAAI,GAAIC,UAA6B,IAAK;MAC9CF,UAAU,GAAG,CAAC;MACdJ,QAAQ,CAACM,UAAU,CAACJ,QAAQ,CAAC,CAAC,CAAC;MAC/BE,UAAU,GAAGE,UAAU,CAACC,aAAa,CAACP,QAAQ,CAAC;IACjD,CAAC;IAED,MAAMQ,QAAQ,GAAGvB,qBAAqB,CAAC,CAAC;IACxC,IAAIuB,QAAQ,EAAEH,IAAI,CAACG,QAAQ,CAAC;IAC5B,MAAMC,YAAY,GAAGzB,mBAAmB,CAACqB,IAAI,CAAC;IAE9C,OAAO,MAAM;MACXI,YAAY,CAAC,CAAC;MACdL,UAAU,GAAG,CAAC;IAChB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { resolvePreviewChrome } from "./resolvePreviewChrome.js";
5
+
6
+ /**
7
+ * How long a new pairing session with no `purpose` on its link keeps the
8
+ * default preview bar hidden, so a `selectElement` that arrives after the join
9
+ * never flashes "Preview mode". Restarts once when the socket first reaches
10
+ * `connected` while the hold is still up: a slow connect still shows
11
+ * "Connecting…" after this delay, and a pick that starts shortly after the
12
+ * join stays inside the window.
13
+ */
14
+ export const INITIAL_REVEAL_DELAY_MS = 2000;
15
+ /**
16
+ * A new session (or chrome appearing) is decided by the link's purpose:
17
+ * `select_element` starts in the selection hold, `preview` is never held, and
18
+ * no purpose falls back to the intro hold. The intro hold hides the bar when
19
+ * preview chrome appears, and again when the session changes while a hold is
20
+ * already hiding it. A bar that is already showing stays up across a re-scan
21
+ * with no purpose. Selection hold replaces the intro once the picker is active
22
+ * and outlives the picker until a Builder preview, a `preview` re-scan, or a
23
+ * re-scan with no purpose. A `select_element` re-scan starts held, including
24
+ * when the bar is already up.
25
+ */
26
+ function decideHold(prev, holds, input) {
27
+ let introHeld = holds.introHeld;
28
+ let selectionHeld = holds.selectionHeld;
29
+ let connectRestarted = prev.connectRestarted;
30
+ let restartTimer = false;
31
+ const armIntro = () => {
32
+ introHeld = true;
33
+ connectRestarted = false;
34
+ restartTimer = true;
35
+ };
36
+ if (!input.chromeVisible) {
37
+ return {
38
+ introHeld: false,
39
+ selectionHeld: false,
40
+ restartTimer: false,
41
+ inputs: {
42
+ ...input,
43
+ connectRestarted: false
44
+ }
45
+ };
46
+ }
47
+ const sessionChanged = input.session !== prev.session;
48
+ const previewStarted = input.previewStart > prev.previewStart;
49
+ if (previewStarted) {
50
+ introHeld = false;
51
+ selectionHeld = false;
52
+ connectRestarted = true;
53
+ } else if (input.pickerActive) {
54
+ selectionHeld = true;
55
+ introHeld = false;
56
+ } else if (sessionChanged || !prev.chromeVisible) {
57
+ if (input.purpose === 'select_element') {
58
+ selectionHeld = true;
59
+ introHeld = false;
60
+ } else if (input.purpose === 'preview') {
61
+ selectionHeld = false;
62
+ introHeld = false;
63
+ } else if (introHeld || selectionHeld || !prev.chromeVisible) {
64
+ selectionHeld = false;
65
+ armIntro();
66
+ }
67
+ }
68
+ if (introHeld && input.status === 'connected' && !connectRestarted) {
69
+ connectRestarted = true;
70
+ restartTimer = true;
71
+ }
72
+ return {
73
+ introHeld,
74
+ selectionHeld,
75
+ restartTimer,
76
+ inputs: {
77
+ ...input,
78
+ connectRestarted
79
+ }
80
+ };
81
+ }
82
+
83
+ /**
84
+ * Whether the preview top bar should stay down.
85
+ *
86
+ * The decision is applied during render. Waiting for an effect would mount
87
+ * the bar for a frame and play its slide-in before the hold could hide it.
88
+ * The reveal timer stays in an effect.
89
+ */
90
+ export function usePreviewBarHold(state, pickerActive) {
91
+ const chromeVisible = resolvePreviewChrome(state).visible;
92
+ const [introHeld, setIntroHeld] = React.useState(false);
93
+ const [selectionHeld, setSelectionHeld] = React.useState(false);
94
+ const [introEpoch, setIntroEpoch] = React.useState(0);
95
+ const purpose = state.pairingPurpose ?? null;
96
+ const inputsRef = React.useRef({
97
+ session: state.pairingSessionGeneration,
98
+ previewStart: state.previewStartGeneration,
99
+ chromeVisible: false,
100
+ pickerActive: false,
101
+ status: state.status,
102
+ purpose,
103
+ connectRestarted: false
104
+ });
105
+ const decision = decideHold(inputsRef.current, {
106
+ introHeld,
107
+ selectionHeld
108
+ }, {
109
+ session: state.pairingSessionGeneration,
110
+ previewStart: state.previewStartGeneration,
111
+ chromeVisible,
112
+ pickerActive,
113
+ status: state.status,
114
+ purpose,
115
+ connectRestarted: false
116
+ });
117
+ inputsRef.current = decision.inputs;
118
+ if (decision.introHeld !== introHeld) {
119
+ setIntroHeld(decision.introHeld);
120
+ }
121
+ if (decision.selectionHeld !== selectionHeld) {
122
+ setSelectionHeld(decision.selectionHeld);
123
+ }
124
+ if (decision.restartTimer) {
125
+ setIntroEpoch(epoch => epoch + 1);
126
+ }
127
+ React.useEffect(() => {
128
+ if (!introHeld) return;
129
+ const timer = setTimeout(() => setIntroHeld(false), INITIAL_REVEAL_DELAY_MS);
130
+ return () => clearTimeout(timer);
131
+ }, [introEpoch, introHeld]);
132
+ return decision.introHeld || decision.selectionHeld;
133
+ }
134
+ //# sourceMappingURL=usePreviewBarHold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","resolvePreviewChrome","INITIAL_REVEAL_DELAY_MS","decideHold","prev","holds","input","introHeld","selectionHeld","connectRestarted","restartTimer","armIntro","chromeVisible","inputs","sessionChanged","session","previewStarted","previewStart","pickerActive","purpose","status","usePreviewBarHold","state","visible","setIntroHeld","useState","setSelectionHeld","introEpoch","setIntroEpoch","pairingPurpose","inputsRef","useRef","pairingSessionGeneration","previewStartGeneration","decision","current","epoch","useEffect","timer","setTimeout","clearTimeout"],"sourceRoot":"../../../src","sources":["pairing/usePreviewBarHold.ts"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,oBAAoB,QAAQ,2BAAwB;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,IAAI;AAmB3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CACjBC,IAAgB,EAChBC,KAAqD,EACrDC,KAAiB,EACH;EACd,IAAIC,SAAS,GAAGF,KAAK,CAACE,SAAS;EAC/B,IAAIC,aAAa,GAAGH,KAAK,CAACG,aAAa;EACvC,IAAIC,gBAAgB,GAAGL,IAAI,CAACK,gBAAgB;EAC5C,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,QAAQ,GAAGA,CAAA,KAAY;IAC3BJ,SAAS,GAAG,IAAI;IAChBE,gBAAgB,GAAG,KAAK;IACxBC,YAAY,GAAG,IAAI;EACrB,CAAC;EAED,IAAI,CAACJ,KAAK,CAACM,a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EACA,IAAI2B,QAAQ,CAAC1B,aAAa,KAAKA,aAAa,EAAE;IAC5CkB,gBAAgB,CAACQ,QAAQ,CAAC1B,aAAa,CAAC;EAC1C;EACA,IAAI0B,QAAQ,CAACxB,YAAY,EAAE;IACzBkB,aAAa,CAAEQ,KAAK,IAAKA,KAAK,GAAG,CAAC,CAAC;EACrC;EAEApC,KAAK,CAACqC,SAAS,CAAC,MAAM;IACpB,IAAI,CAAC9B,SAAS,EAAE;IAChB,MAAM+B,KAAK,GAAGC,UAAU,CAAC,MAAMf,YAAY,CAAC,KAAK,CAAC,EAAEtB,uBAAuB,CAAC;IAC5E,OAAO,MAAMsC,YAAY,CAACF,KAAK,CAAC;EAClC,CAAC,EAAE,CAACX,UAAU,EAAEpB,SAAS,CAAC,CAAC;EAE3B,OAAO2B,QAAQ,CAAC3B,SAAS,IAAI2B,QAAQ,CAAC1B,aAAa;AACrD","ignoreList":[]}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { BannerSurface } from "../surfaces/BannerSurface.js";
6
+ import { bannerOverlayHostPadding } from "../surfaces/bannerBarLayout.js";
7
+ import { resolveBannerBackgroundColor } from "../surfaces/resolveBannerTheme.js";
8
+ import { useUserflowSafeAreaInsets } from "../surfaces/safeArea.js";
9
+ import { SdkErrorBoundary } from "./SdkErrorBoundary.js";
10
+ import { bannerEdge, embedBannerPlaceholderId, warnBannerOnce } from "./bannerPlacement.js";
11
+ import { hasEmbedBannerPlaceholder } from "./embedBannerRegistry.js";
12
+ import { useBannerSession } from "./useBannerSession.js";
13
+
14
+ /**
15
+ * Top or bottom banner bar. Element modes render in {@link EmbedBannerPlaceholder}.
16
+ *
17
+ * `overlay` floats over the host. `flow` sits in layout and pushes the app.
18
+ * The bar does not participate in the host accessibility trap.
19
+ */
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ export function BannerHost({
22
+ engine,
23
+ hidden,
24
+ placement = 'overlay',
25
+ edge: edgeFilter
26
+ }) {
27
+ const session = useBannerSession(engine);
28
+ const banner = session?.version.banner ?? null;
29
+ const edge = banner ? bannerEdge(banner.embedMode) : null;
30
+ const insets = useUserflowSafeAreaInsets();
31
+ React.useEffect(() => {
32
+ if (!session || !banner || edge) return;
33
+ const placeholderId = embedBannerPlaceholderId(banner);
34
+ if (placeholderId && hasEmbedBannerPlaceholder(placeholderId)) return;
35
+ const message = placeholderId ? `Userflow: no EmbedBannerPlaceholder with id "${placeholderId}" is mounted; the banner is not shown` : `Userflow: banner embed mode ${banner.embedMode} needs a manual embed selector and an EmbedBannerPlaceholder with that id`;
36
+ warnBannerOnce(`embed:${session.id}:${banner.embedMode}:${placeholderId ?? 'none'}`, message);
37
+ }, [banner, edge, session]);
38
+ if (hidden || !session || !banner || !edge) return null;
39
+ if (edgeFilter && edge !== edgeFilter) return null;
40
+ const floats = banner.overlay !== false;
41
+ if (placement === 'overlay' !== floats) return null;
42
+ const bar = /*#__PURE__*/_jsx(SdkErrorBoundary, {
43
+ scope: "banner",
44
+ resetKey: session.id,
45
+ children: /*#__PURE__*/_jsx(BannerSurface, {
46
+ session: session,
47
+ onActions: actions => engine.handleActions(actions),
48
+ onDismiss: endReason => {
49
+ void engine.endBanner(endReason);
50
+ }
51
+ })
52
+ });
53
+ if (placement === 'flow') {
54
+ const backgroundColor = bannerBackground(session);
55
+ const safePad = edge === 'top' ? {
56
+ paddingTop: insets.top
57
+ } : {
58
+ paddingBottom: insets.bottom
59
+ };
60
+ return /*#__PURE__*/_jsx(View, {
61
+ testID: "userflow-banner-flow",
62
+ style: [styles.flow, safePad, {
63
+ backgroundColor
64
+ }],
65
+ children: bar
66
+ });
67
+ }
68
+ const edgeStyle = edge === 'top' ? {
69
+ top: insets.top
70
+ } : {
71
+ bottom: insets.bottom
72
+ };
73
+ return /*#__PURE__*/_jsx(View, {
74
+ pointerEvents: "box-none",
75
+ style: [styles.pin, edgeStyle, bannerOverlayHostPadding(insets)],
76
+ children: bar
77
+ });
78
+ }
79
+ function bannerBackground(session) {
80
+ return resolveBannerBackgroundColor(session.version.theme);
81
+ }
82
+ const styles = StyleSheet.create({
83
+ pin: {
84
+ position: 'absolute',
85
+ left: 0,
86
+ right: 0
87
+ },
88
+ flow: {
89
+ alignSelf: 'stretch'
90
+ }
91
+ });
92
+ //# sourceMappingURL=BannerHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","BannerSurface","bannerOverlayHostPadding","resolveBannerBackgroundColor","useUserflowSafeAreaInsets","SdkErrorBoundary","bannerEdge","embedBannerPlaceholderId","warnBannerOnce","hasEmbedBannerPlaceholder","useBannerSession","jsx","_jsx","BannerHost","engine","hidden","placement","edge","edgeFilter","session","banner","version","embedMode","insets","useEffect","placeholderId","message","id","floats","overlay","bar","scope","resetKey","children","onActions","actions","handleActions","onDismiss","endReason","endBanner","backgroundColor","bannerBackground","safePad","paddingTop","top","paddingBottom","bottom","testID","style","styles","flow","edgeStyle","pointerEvents","pin","theme","create","position","left","right","alignSelf"],"sourceRoot":"../../../src","sources":["runtime/BannerHost.tsx"],"mappings":";;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,aAAa,QAAQ,8BAA2B;AACzD,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SAASC,4BAA4B,QAAQ,mCAAgC;AAC7E,SAASC,yBAAyB,QAAQ,yBAAsB;AAEhE,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,UAAU,EAAEC,wBAAwB,EAAEC,cAAc,QAAQ,sBAAmB;AACxF,SAASC,yBAAyB,QAAQ,0BAAuB;AACjE,SAASC,gBAAgB,QAAQ,uBAAoB;;AAErD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAMA,OAAO,SAASC,UAAUA,CAAC;EACzBC,MAAM;EACNC,MAAM;EACNC,SAAS,G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QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT,CAAC;EACDR,IAAI,EAAE;IACJS,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { elementPickerController } from "../authoring/elementPickerController.js";
6
+ import { BannerSurface } from "../surfaces/BannerSurface.js";
7
+ import { bannerOverlayHostPadding } from "../surfaces/bannerBarLayout.js";
8
+ import { useUserflowSafeAreaInsets } from "../surfaces/safeArea.js";
9
+ import { SdkErrorBoundary } from "./SdkErrorBoundary.js";
10
+ import { BannerEngineContext } from "./bannerEngineContext.js";
11
+ import { embedBannerPlaceholderId, warnBannerOnce } from "./bannerPlacement.js";
12
+ import { registerEmbedBannerPlaceholder } from "./embedBannerRegistry.js";
13
+ import { useBannerSession } from "./useBannerSession.js";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ /**
16
+ * Host slot for an element-mode banner (`ELEMENT_BEFORE`, `ELEMENT_AFTER`,
17
+ * `ELEMENT_FIRST`, `ELEMENT_LAST`). Mount it where the bar should appear.
18
+ * Until a matching banner is active the slot renders nothing, so it takes no
19
+ * space and is not visible. Top and bottom bars ignore this slot.
20
+ * `overlay: false` keeps the bar in layout; `overlay: true` paints it over
21
+ * the content below the slot.
22
+ */
23
+ export function EmbedBannerPlaceholder({
24
+ id
25
+ }) {
26
+ const engine = React.useContext(BannerEngineContext);
27
+ const placeholderId = id.trim();
28
+ const session = useBannerSession(engine);
29
+ const insets = useUserflowSafeAreaInsets();
30
+ const [pickerActive, setPickerActive] = React.useState(() => elementPickerController.getState().active);
31
+ React.useEffect(() => {
32
+ return elementPickerController.subscribe(next => {
33
+ setPickerActive(next.active);
34
+ });
35
+ }, []);
36
+ React.useLayoutEffect(() => {
37
+ if (!placeholderId) {
38
+ warnBannerOnce('embed-banner-empty-id', 'Userflow: EmbedBannerPlaceholder requires an id');
39
+ return;
40
+ }
41
+ return registerEmbedBannerPlaceholder(placeholderId);
42
+ }, [placeholderId]);
43
+ React.useEffect(() => {
44
+ if (engine) return;
45
+ warnBannerOnce('embed-banner-outside-provider', 'Userflow: EmbedBannerPlaceholder must be rendered inside UserflowProvider');
46
+ }, [engine]);
47
+
48
+ // No host view until a banner is actually shown. An empty slot would still
49
+ // participate in flex gap and stretch layout.
50
+ if (!engine || !placeholderId || pickerActive || !session) return null;
51
+ const banner = session.version.banner ?? null;
52
+ if (!banner || embedBannerPlaceholderId(banner) !== placeholderId) return null;
53
+ const bar = /*#__PURE__*/_jsx(BannerSurface, {
54
+ session: session,
55
+ onActions: actions => engine.handleActions(actions),
56
+ onDismiss: endReason => {
57
+ void engine.endBanner(endReason);
58
+ }
59
+ });
60
+ return /*#__PURE__*/_jsx(SdkErrorBoundary, {
61
+ scope: "banner",
62
+ resetKey: session.id,
63
+ children: banner.overlay !== false ? /*#__PURE__*/_jsx(View, {
64
+ pointerEvents: "box-none",
65
+ testID: "userflow-embed-banner",
66
+ style: styles.overlaySlot,
67
+ children: /*#__PURE__*/_jsx(View, {
68
+ pointerEvents: "box-none",
69
+ style: [styles.overlayBar, bannerOverlayHostPadding(insets)],
70
+ children: bar
71
+ })
72
+ }) : /*#__PURE__*/_jsx(View, {
73
+ testID: "userflow-embed-banner",
74
+ style: styles.slot,
75
+ children: bar
76
+ })
77
+ });
78
+ }
79
+ const styles = StyleSheet.create({
80
+ slot: {
81
+ alignSelf: 'stretch'
82
+ },
83
+ overlaySlot: {
84
+ height: 0,
85
+ alignSelf: 'stretch'
86
+ },
87
+ overlayBar: {
88
+ position: 'absolute',
89
+ left: 0,
90
+ right: 0,
91
+ top: 0
92
+ }
93
+ });
94
+ //# sourceMappingURL=EmbedBannerPlaceholder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","elementPickerController","BannerSurface","bannerOverlayHostPadding","useUserflowSafeAreaInsets","SdkErrorBoundary","BannerEngineContext","embedBannerPlaceholderId","warnBannerOnce","registerEmbedBannerPlaceholder","useBannerSession","jsx","_jsx","EmbedBannerPlaceholder","id","engine","useContext","placeholderId","trim","session","insets","pickerActive","setPickerActive","useState","getState","active","useEffect","subscribe","next","useLayoutEffect","banner","version","bar","onActions","actions","handleActions","onDismiss","endReason","endBanner","scope","resetKey","children","overlay","pointerEvents","testID","style","styles","overlaySlot","overlayBar","slot","create","alignSelf","height","position","left","right","top"],"sourceRoot":"../../../src","sources":["runtime/EmbedBannerPlaceholder.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,uBAAuB,QAAQ,yCAAsC;AAC9E,SAASC,aAAa,QAAQ,8BAA2B;AACzD,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SAASC,yBAAyB,QAAQ,yBAAsB;AAEhE,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,mBAAmB,QAAQ,0BAAuB;AAC3D,SAASC,wBAAwB,EAAEC,cAAc,QAAQ,sBAAmB;AAC5E,SAASC,8BAA8B,QAAQ,0BAAuB;AACtE,SAASC,gBAAgB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAC;EACrCC;AAC2B,CAAC,EAA6B;EACzD,MAAMC,MAAM,GAAGjB,KAAK,CAACkB,UAAU,CAACV,mBAAmB,CAAC;EACpD,MAAMW,aAAa,GAAGH,EAAE,CAACI,IAAI,CAAC,CAAC;EAC/B,MAAMC,OAAO,GAAGT,gBAAgB,CAACK,MAAM,CAAC;EACxC,MAAMK,MAAM,GAAGhB,yBAAyB,CAAC,CAAC;EAC1C,MAAM,CAACiB,YAAY,EAAEC,eAAe,CAAC,GAAGxB,KAAK,CAACyB,QAAQ,CACpD,MAAMtB,uB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