@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.
- package/README.md +116 -77
- package/app.plugin.js +11 -3
- package/babel-plugin/index.d.ts.map +1 -1
- package/babel-plugin/index.js +53 -6
- package/babel-plugin/index.js.map +1 -1
- package/babel-plugin.js +11 -3
- package/docs/deep-linking.md +70 -33
- package/docs/isolation.md +75 -0
- package/docs/troubleshooting.md +40 -17
- package/docs/webview-custom-banner-poc.md +64 -0
- package/expo-plugin/withUserflow.d.ts +3 -2
- package/expo-plugin/withUserflow.d.ts.map +1 -1
- package/expo-plugin/withUserflow.js +14 -8
- package/expo-plugin/withUserflow.js.map +1 -1
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +37 -11
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/commonjs/anchors/fiber/fiberPath.js +122 -0
- package/lib/commonjs/anchors/fiber/fiberPath.js.map +1 -0
- package/lib/commonjs/anchors/fiber/findAnchorFiber.js +60 -50
- package/lib/commonjs/anchors/fiber/findAnchorFiber.js.map +1 -1
- package/lib/commonjs/anchors/fiber/resolveFiberPath.js +220 -0
- package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -0
- package/lib/commonjs/anchors/fiber/visibleRect.js +147 -0
- package/lib/commonjs/anchors/fiber/visibleRect.js.map +1 -0
- package/lib/commonjs/anchors/fiber/visibleScreens.js +73 -36
- package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
- package/lib/commonjs/anchors/fiber/walkVisibleFibers.js +66 -0
- package/lib/commonjs/anchors/fiber/walkVisibleFibers.js.map +1 -0
- package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js +51 -0
- package/lib/commonjs/anchors/isInstanceOnVisibleScreen.js.map +1 -0
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js +22 -15
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/semanticMatcher.js +26 -8
- package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
- package/lib/commonjs/anonymousId.js +4 -1
- package/lib/commonjs/anonymousId.js.map +1 -1
- package/lib/commonjs/authoring/ElementPickerOverlay.js +126 -50
- package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -1
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +32 -10
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -1
- package/lib/commonjs/authoring/chrome/ChromeButton.js +8 -3
- package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -1
- package/lib/commonjs/authoring/chrome/ChromeIcon.js +4 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -1
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js +23 -10
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -1
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +19 -12
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -1
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +10 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -1
- package/lib/commonjs/authoring/chrome/icons/circle-exclamation.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/triangle-exclamation.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/tokens.js +7 -6
- package/lib/commonjs/authoring/chrome/tokens.js.map +1 -1
- package/lib/commonjs/authoring/elementPickerController.js.map +1 -1
- package/lib/commonjs/authoring/fingerprintFromInstance.js +204 -4
- package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
- package/lib/commonjs/authoring/hitTest.js +264 -16
- package/lib/commonjs/authoring/hitTest.js.map +1 -1
- package/lib/commonjs/authoring/hostAtPoint.js +204 -0
- package/lib/commonjs/authoring/hostAtPoint.js.map +1 -0
- package/lib/commonjs/content/BannerStepButton.js +68 -0
- package/lib/commonjs/content/BannerStepButton.js.map +1 -0
- package/lib/commonjs/content/buttonAppearance.js +16 -0
- package/lib/commonjs/content/buttonAppearance.js.map +1 -1
- package/lib/commonjs/content/resolveBannerButtonChrome.js +44 -0
- package/lib/commonjs/content/resolveBannerButtonChrome.js.map +1 -0
- package/lib/commonjs/content/themeColor.js +15 -0
- package/lib/commonjs/content/themeColor.js.map +1 -1
- package/lib/commonjs/deepLinking.js +4 -4
- package/lib/commonjs/evalJs/EvalJsHost.js +244 -0
- package/lib/commonjs/evalJs/EvalJsHost.js.map +1 -0
- package/lib/commonjs/evalJs/bootstrap.js +84 -0
- package/lib/commonjs/evalJs/bootstrap.js.map +1 -0
- package/lib/commonjs/evalJs/bridgeMessages.js +143 -0
- package/lib/commonjs/evalJs/bridgeMessages.js.map +1 -0
- package/lib/commonjs/evalJs/evalJsBridge.js +31 -0
- package/lib/commonjs/evalJs/evalJsBridge.js.map +1 -0
- package/lib/commonjs/evalJs/evalJsController.js +124 -0
- package/lib/commonjs/evalJs/evalJsController.js.map +1 -0
- package/lib/commonjs/evalJs/getWebView.js +81 -0
- package/lib/commonjs/evalJs/getWebView.js.map +1 -0
- package/lib/commonjs/evalJs/injectEvalPending.js +19 -0
- package/lib/commonjs/evalJs/injectEvalPending.js.map +1 -0
- package/lib/commonjs/evalJs/types.js +2 -0
- package/lib/commonjs/evalJs/types.js.map +1 -0
- package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js +40 -0
- package/lib/commonjs/evalJs/useEvalJsWebViewInjection.js.map +1 -0
- package/lib/commonjs/expo-router/index.js +19 -0
- package/lib/commonjs/expo-router/index.js.map +1 -1
- package/lib/commonjs/expo-router/redirectSystemPath.js +75 -0
- package/lib/commonjs/expo-router/redirectSystemPath.js.map +1 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +2 -2
- package/lib/commonjs/index.js +118 -43
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lifecycle.js.map +1 -1
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js +14 -11
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/commonjs/navigation/openFlowNavigateUrl.js +12 -5
- package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
- package/lib/commonjs/pairing/PairingController.js +245 -27
- package/lib/commonjs/pairing/PairingController.js.map +1 -1
- package/lib/commonjs/pairing/PreviewModeBanner.js +55 -16
- package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/commonjs/pairing/deepLink.js +22 -5
- package/lib/commonjs/pairing/deepLink.js.map +1 -1
- package/lib/commonjs/pairing/deviceId.js +47 -0
- package/lib/commonjs/pairing/deviceId.js.map +1 -0
- package/lib/commonjs/pairing/diagnostics.js +5 -4
- package/lib/commonjs/pairing/diagnostics.js.map +1 -1
- package/lib/commonjs/pairing/tokenStorage.js +47 -7
- package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
- package/lib/commonjs/pairing/usePairingState.js +3 -1
- package/lib/commonjs/pairing/usePairingState.js.map +1 -1
- package/lib/commonjs/pairing/usePreviewBarHold.js +139 -0
- package/lib/commonjs/pairing/usePreviewBarHold.js.map +1 -0
- package/lib/commonjs/runtime/BannerHost.js +96 -0
- package/lib/commonjs/runtime/BannerHost.js.map +1 -0
- package/lib/commonjs/runtime/EmbedBannerPlaceholder.js +99 -0
- package/lib/commonjs/runtime/EmbedBannerPlaceholder.js.map +1 -0
- package/lib/commonjs/runtime/SdkErrorBoundary.js +61 -0
- package/lib/commonjs/runtime/SdkErrorBoundary.js.map +1 -0
- package/lib/commonjs/runtime/TargetPressBridge.js +19 -12
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
- package/lib/commonjs/runtime/UserflowOverlay.js +97 -0
- package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -0
- package/lib/commonjs/runtime/UserflowProvider.js +135 -65
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
- package/lib/commonjs/runtime/bannerEngine.js +63 -0
- package/lib/commonjs/runtime/bannerEngine.js.map +1 -0
- package/lib/commonjs/runtime/bannerEngineContext.js +11 -0
- package/lib/commonjs/runtime/bannerEngineContext.js.map +1 -0
- package/lib/commonjs/runtime/bannerPlacement.js +37 -0
- package/lib/commonjs/runtime/bannerPlacement.js.map +1 -0
- package/lib/commonjs/runtime/embedBannerRegistry.js +30 -0
- package/lib/commonjs/runtime/embedBannerRegistry.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +75 -3
- package/lib/commonjs/runtime/flowEngine.js.map +1 -1
- package/lib/commonjs/runtime/isolateCall.js +48 -0
- package/lib/commonjs/runtime/isolateCall.js.map +1 -0
- package/lib/commonjs/runtime/reportSdkError.js +19 -0
- package/lib/commonjs/runtime/reportSdkError.js.map +1 -0
- package/lib/commonjs/runtime/useBannerSession.js +37 -0
- package/lib/commonjs/runtime/useBannerSession.js.map +1 -0
- package/lib/commonjs/screenTracker.js +34 -9
- package/lib/commonjs/screenTracker.js.map +1 -1
- package/lib/commonjs/surfaces/BannerBar.js +160 -0
- package/lib/commonjs/surfaces/BannerBar.js.map +1 -0
- package/lib/commonjs/surfaces/BannerSurface.js +78 -0
- package/lib/commonjs/surfaces/BannerSurface.js.map +1 -0
- package/lib/commonjs/surfaces/MadeWithUserflow.js +12 -8
- package/lib/commonjs/surfaces/MadeWithUserflow.js.map +1 -1
- package/lib/commonjs/surfaces/ModalSurface.js +1 -1
- package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
- package/lib/commonjs/surfaces/TooltipSurface.js +17 -1
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
- package/lib/commonjs/surfaces/bannerBarLayout.js +88 -0
- package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -0
- package/lib/commonjs/surfaces/bannerBarTokens.js +42 -0
- package/lib/commonjs/surfaces/bannerBarTokens.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +277 -0
- package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js +46 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js +26 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +41 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +74 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js +152 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +148 -0
- package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js +13 -0
- package/lib/commonjs/surfaces/bannerWebView/buttonClassName.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js +49 -0
- package/lib/commonjs/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js +83 -0
- package/lib/commonjs/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
- package/lib/commonjs/surfaces/resolveBannerTheme.js +22 -0
- package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -0
- package/lib/commonjs/surfaces/safeArea.js +23 -0
- package/lib/commonjs/surfaces/safeArea.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/anchors/AutoAnchorRegistry.js +37 -11
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/module/anchors/fiber/fiberPath.js +118 -0
- package/lib/module/anchors/fiber/fiberPath.js.map +1 -0
- package/lib/module/anchors/fiber/findAnchorFiber.js +60 -50
- package/lib/module/anchors/fiber/findAnchorFiber.js.map +1 -1
- package/lib/module/anchors/fiber/resolveFiberPath.js +215 -0
- package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -0
- package/lib/module/anchors/fiber/visibleRect.js +139 -0
- package/lib/module/anchors/fiber/visibleRect.js.map +1 -0
- package/lib/module/anchors/fiber/visibleScreens.js +73 -37
- package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
- package/lib/module/anchors/fiber/walkVisibleFibers.js +61 -0
- package/lib/module/anchors/fiber/walkVisibleFibers.js.map +1 -0
- package/lib/module/anchors/isInstanceOnVisibleScreen.js +46 -0
- package/lib/module/anchors/isInstanceOnVisibleScreen.js.map +1 -0
- package/lib/module/anchors/resolveAutoAnchorHost.js +22 -15
- package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
- package/lib/module/anchors/semanticMatcher.js +26 -9
- package/lib/module/anchors/semanticMatcher.js.map +1 -1
- package/lib/module/anonymousId.js +4 -2
- package/lib/module/anonymousId.js.map +1 -1
- package/lib/module/authoring/ElementPickerOverlay.js +128 -52
- package/lib/module/authoring/ElementPickerOverlay.js.map +1 -1
- package/lib/module/authoring/chrome/ChromeBottomSheet.js +32 -10
- package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -1
- package/lib/module/authoring/chrome/ChromeButton.js +8 -3
- package/lib/module/authoring/chrome/ChromeButton.js.map +1 -1
- package/lib/module/authoring/chrome/ChromeIcon.js +4 -0
- package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -1
- package/lib/module/authoring/chrome/ChromeTopBar.js +23 -10
- package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -1
- package/lib/module/authoring/chrome/DoubleTapBridge.js +19 -12
- package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -1
- package/lib/module/authoring/chrome/doubleTapMonitor.js +10 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -1
- package/lib/module/authoring/chrome/icons/circle-exclamation.png +0 -0
- package/lib/module/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/triangle-exclamation.png +0 -0
- package/lib/module/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
- package/lib/module/authoring/chrome/tokens.js +7 -6
- package/lib/module/authoring/chrome/tokens.js.map +1 -1
- package/lib/module/authoring/elementPickerController.js.map +1 -1
- package/lib/module/authoring/fingerprintFromInstance.js +198 -4
- package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
- package/lib/module/authoring/hitTest.js +264 -18
- package/lib/module/authoring/hitTest.js.map +1 -1
- package/lib/module/authoring/hostAtPoint.js +199 -0
- package/lib/module/authoring/hostAtPoint.js.map +1 -0
- package/lib/module/content/BannerStepButton.js +63 -0
- package/lib/module/content/BannerStepButton.js.map +1 -0
- package/lib/module/content/buttonAppearance.js +14 -0
- package/lib/module/content/buttonAppearance.js.map +1 -1
- package/lib/module/content/resolveBannerButtonChrome.js +41 -0
- package/lib/module/content/resolveBannerButtonChrome.js.map +1 -0
- package/lib/module/content/themeColor.js +14 -0
- package/lib/module/content/themeColor.js.map +1 -1
- package/lib/module/deepLinking.js +4 -4
- package/lib/module/evalJs/EvalJsHost.js +239 -0
- package/lib/module/evalJs/EvalJsHost.js.map +1 -0
- package/lib/module/evalJs/bootstrap.js +76 -0
- package/lib/module/evalJs/bootstrap.js.map +1 -0
- package/lib/module/evalJs/bridgeMessages.js +139 -0
- package/lib/module/evalJs/bridgeMessages.js.map +1 -0
- package/lib/module/evalJs/evalJsBridge.js +25 -0
- package/lib/module/evalJs/evalJsBridge.js.map +1 -0
- package/lib/module/evalJs/evalJsController.js +119 -0
- package/lib/module/evalJs/evalJsController.js.map +1 -0
- package/lib/module/evalJs/getWebView.js +76 -0
- package/lib/module/evalJs/getWebView.js.map +1 -0
- package/lib/module/evalJs/injectEvalPending.js +15 -0
- package/lib/module/evalJs/injectEvalPending.js.map +1 -0
- package/lib/module/evalJs/types.js +2 -0
- package/lib/module/evalJs/types.js.map +1 -0
- package/lib/module/evalJs/useEvalJsWebViewInjection.js +35 -0
- package/lib/module/evalJs/useEvalJsWebViewInjection.js.map +1 -0
- package/lib/module/expo-router/index.js +1 -0
- package/lib/module/expo-router/index.js.map +1 -1
- package/lib/module/expo-router/redirectSystemPath.js +70 -0
- package/lib/module/expo-router/redirectSystemPath.js.map +1 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js +2 -2
- package/lib/module/index.js +114 -45
- package/lib/module/index.js.map +1 -1
- package/lib/module/lifecycle.js.map +1 -1
- package/lib/module/navigation/WithUserflowReactNavigation.js +14 -11
- package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/module/navigation/openFlowNavigateUrl.js +12 -5
- package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
- package/lib/module/pairing/PairingController.js +245 -27
- package/lib/module/pairing/PairingController.js.map +1 -1
- package/lib/module/pairing/PreviewModeBanner.js +54 -16
- package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/module/pairing/deepLink.js +21 -5
- package/lib/module/pairing/deepLink.js.map +1 -1
- package/lib/module/pairing/deviceId.js +41 -0
- package/lib/module/pairing/deviceId.js.map +1 -0
- package/lib/module/pairing/diagnostics.js +5 -4
- package/lib/module/pairing/diagnostics.js.map +1 -1
- package/lib/module/pairing/tokenStorage.js +47 -7
- package/lib/module/pairing/tokenStorage.js.map +1 -1
- package/lib/module/pairing/usePairingState.js +3 -1
- package/lib/module/pairing/usePairingState.js.map +1 -1
- package/lib/module/pairing/usePreviewBarHold.js +134 -0
- package/lib/module/pairing/usePreviewBarHold.js.map +1 -0
- package/lib/module/runtime/BannerHost.js +92 -0
- package/lib/module/runtime/BannerHost.js.map +1 -0
- package/lib/module/runtime/EmbedBannerPlaceholder.js +94 -0
- package/lib/module/runtime/EmbedBannerPlaceholder.js.map +1 -0
- package/lib/module/runtime/SdkErrorBoundary.js +55 -0
- package/lib/module/runtime/SdkErrorBoundary.js.map +1 -0
- package/lib/module/runtime/TargetPressBridge.js +19 -12
- package/lib/module/runtime/TargetPressBridge.js.map +1 -1
- package/lib/module/runtime/UserflowOverlay.js +92 -0
- package/lib/module/runtime/UserflowOverlay.js.map +1 -0
- package/lib/module/runtime/UserflowProvider.js +136 -66
- package/lib/module/runtime/UserflowProvider.js.map +1 -1
- package/lib/module/runtime/bannerEngine.js +55 -0
- package/lib/module/runtime/bannerEngine.js.map +1 -0
- package/lib/module/runtime/bannerEngineContext.js +7 -0
- package/lib/module/runtime/bannerEngineContext.js.map +1 -0
- package/lib/module/runtime/bannerPlacement.js +30 -0
- package/lib/module/runtime/bannerPlacement.js.map +1 -0
- package/lib/module/runtime/embedBannerRegistry.js +24 -0
- package/lib/module/runtime/embedBannerRegistry.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +72 -3
- package/lib/module/runtime/flowEngine.js.map +1 -1
- package/lib/module/runtime/isolateCall.js +43 -0
- package/lib/module/runtime/isolateCall.js.map +1 -0
- package/lib/module/runtime/reportSdkError.js +15 -0
- package/lib/module/runtime/reportSdkError.js.map +1 -0
- package/lib/module/runtime/useBannerSession.js +33 -0
- package/lib/module/runtime/useBannerSession.js.map +1 -0
- package/lib/module/screenTracker.js +33 -9
- package/lib/module/screenTracker.js.map +1 -1
- package/lib/module/surfaces/BannerBar.js +155 -0
- package/lib/module/surfaces/BannerBar.js.map +1 -0
- package/lib/module/surfaces/BannerSurface.js +72 -0
- package/lib/module/surfaces/BannerSurface.js.map +1 -0
- package/lib/module/surfaces/MadeWithUserflow.js +11 -7
- package/lib/module/surfaces/MadeWithUserflow.js.map +1 -1
- package/lib/module/surfaces/ModalSurface.js +1 -1
- package/lib/module/surfaces/ModalSurface.js.map +1 -1
- package/lib/module/surfaces/TooltipSurface.js +17 -1
- package/lib/module/surfaces/TooltipSurface.js.map +1 -1
- package/lib/module/surfaces/bannerBarLayout.js +69 -0
- package/lib/module/surfaces/bannerBarLayout.js.map +1 -0
- package/lib/module/surfaces/bannerBarTokens.js +37 -0
- package/lib/module/surfaces/bannerBarTokens.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +272 -0
- package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js +42 -0
- package/lib/module/surfaces/bannerWebView/bannerAutoRunEvalJs.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js +19 -0
- package/lib/module/surfaces/bannerWebView/bannerAutoRunSession.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +35 -0
- package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +69 -0
- package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js +148 -0
- package/lib/module/surfaces/bannerWebView/bannerWebFrameCss.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +143 -0
- package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/buttonClassName.js +9 -0
- package/lib/module/surfaces/bannerWebView/buttonClassName.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/resolveCdnHost.js +42 -0
- package/lib/module/surfaces/bannerWebView/resolveCdnHost.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js +79 -0
- package/lib/module/surfaces/bannerWebView/richContentDocToHtml.js.map +1 -0
- package/lib/module/surfaces/resolveBannerTheme.js +16 -0
- package/lib/module/surfaces/resolveBannerTheme.js.map +1 -0
- package/lib/module/surfaces/safeArea.js +22 -0
- package/lib/module/surfaces/safeArea.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +14 -0
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts +12 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberPath.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts +5 -4
- package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
- package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts +32 -0
- package/lib/typescript/commonjs/src/anchors/fiber/visibleRect.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +6 -1
- package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
- package/lib/typescript/commonjs/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
- package/lib/typescript/commonjs/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +6 -4
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anonymousId.d.ts +1 -0
- package/lib/typescript/commonjs/src/anonymousId.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +1 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +7 -6
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +2 -3
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +57 -2
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +47 -3
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts +7 -0
- package/lib/typescript/commonjs/src/authoring/hostAtPoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts +14 -0
- package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts +4 -0
- package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts +8 -0
- package/lib/typescript/commonjs/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts +2 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/types.d.ts +1 -0
- package/lib/typescript/commonjs/src/content/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/deepLinking.d.ts +4 -4
- package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts +14 -0
- package/lib/typescript/commonjs/src/evalJs/EvalJsHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts +18 -0
- package/lib/typescript/commonjs/src/evalJs/bootstrap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts +37 -0
- package/lib/typescript/commonjs/src/evalJs/bridgeMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts +16 -0
- package/lib/typescript/commonjs/src/evalJs/evalJsBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts +24 -0
- package/lib/typescript/commonjs/src/evalJs/evalJsController.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts +64 -0
- package/lib/typescript/commonjs/src/evalJs/getWebView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts +4 -0
- package/lib/typescript/commonjs/src/evalJs/injectEvalPending.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/types.d.ts +53 -0
- package/lib/typescript/commonjs/src/evalJs/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
- package/lib/typescript/commonjs/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/expo-router/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts +50 -0
- package/lib/typescript/commonjs/src/expo-router/redirectSystemPath.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts +16 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/lifecycle.d.ts +4 -1
- package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +71 -4
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +9 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/deepLink.d.ts +6 -2
- package/lib/typescript/commonjs/src/pairing/deepLink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/deviceId.d.ts +12 -0
- package/lib/typescript/commonjs/src/pairing/deviceId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +3 -2
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +14 -2
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts +19 -0
- package/lib/typescript/commonjs/src/pairing/usePreviewBarHold.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts +16 -0
- package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
- package/lib/typescript/commonjs/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts +34 -0
- package/lib/typescript/commonjs/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts +15 -0
- package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +9 -3
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +12 -0
- package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts +5 -0
- package/lib/typescript/commonjs/src/runtime/bannerEngineContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts +12 -0
- package/lib/typescript/commonjs/src/runtime/bannerPlacement.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts +5 -0
- package/lib/typescript/commonjs/src/runtime/embedBannerRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts +25 -1
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts +20 -0
- package/lib/typescript/commonjs/src/runtime/isolateCall.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts +10 -0
- package/lib/typescript/commonjs/src/runtime/reportSdkError.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts +5 -0
- package/lib/typescript/commonjs/src/runtime/useBannerSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts +7 -3
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +14 -0
- package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +15 -0
- package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +10 -6
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +15 -0
- package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts +20 -0
- package/lib/typescript/commonjs/src/surfaces/bannerBarTokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +7 -0
- package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts +6 -0
- package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +14 -0
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts +12 -0
- package/lib/typescript/module/src/anchors/fiber/fiberPath.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts +5 -4
- package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +24 -0
- package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts +32 -0
- package/lib/typescript/module/src/anchors/fiber/visibleRect.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +6 -1
- package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts +20 -0
- package/lib/typescript/module/src/anchors/fiber/walkVisibleFibers.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts +19 -0
- package/lib/typescript/module/src/anchors/isInstanceOnVisibleScreen.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +6 -4
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
- package/lib/typescript/module/src/anonymousId.d.ts +1 -0
- package/lib/typescript/module/src/anonymousId.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +1 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +14 -3
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +1 -1
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +12 -4
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +5 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +7 -6
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts +2 -3
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +57 -2
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/hitTest.d.ts +47 -3
- package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/hostAtPoint.d.ts +7 -0
- package/lib/typescript/module/src/authoring/hostAtPoint.d.ts.map +1 -0
- package/lib/typescript/module/src/content/BannerStepButton.d.ts +14 -0
- package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -0
- package/lib/typescript/module/src/content/buttonAppearance.d.ts +4 -0
- package/lib/typescript/module/src/content/buttonAppearance.d.ts.map +1 -1
- package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts +8 -0
- package/lib/typescript/module/src/content/resolveBannerButtonChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/content/themeColor.d.ts +2 -0
- package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/module/src/content/types.d.ts +1 -0
- package/lib/typescript/module/src/content/types.d.ts.map +1 -1
- package/lib/typescript/module/src/deepLinking.d.ts +4 -4
- package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts +14 -0
- package/lib/typescript/module/src/evalJs/EvalJsHost.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/bootstrap.d.ts +18 -0
- package/lib/typescript/module/src/evalJs/bootstrap.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts +37 -0
- package/lib/typescript/module/src/evalJs/bridgeMessages.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts +16 -0
- package/lib/typescript/module/src/evalJs/evalJsBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/evalJsController.d.ts +24 -0
- package/lib/typescript/module/src/evalJs/evalJsController.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/getWebView.d.ts +64 -0
- package/lib/typescript/module/src/evalJs/getWebView.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts +4 -0
- package/lib/typescript/module/src/evalJs/injectEvalPending.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/types.d.ts +53 -0
- package/lib/typescript/module/src/evalJs/types.d.ts.map +1 -0
- package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts +12 -0
- package/lib/typescript/module/src/evalJs/useEvalJsWebViewInjection.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/index.d.ts +1 -0
- package/lib/typescript/module/src/expo-router/index.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts +50 -0
- package/lib/typescript/module/src/expo-router/redirectSystemPath.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts +16 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/lifecycle.d.ts +4 -1
- package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PairingController.d.ts +71 -4
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +9 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/deepLink.d.ts +6 -2
- package/lib/typescript/module/src/pairing/deepLink.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/deviceId.d.ts +12 -0
- package/lib/typescript/module/src/pairing/deviceId.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/diagnostics.d.ts +3 -2
- package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts +14 -2
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts +19 -0
- package/lib/typescript/module/src/pairing/usePreviewBarHold.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/BannerHost.d.ts +16 -0
- package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts +18 -0
- package/lib/typescript/module/src/runtime/EmbedBannerPlaceholder.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts +34 -0
- package/lib/typescript/module/src/runtime/SdkErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts +15 -0
- package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +9 -3
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/bannerEngine.d.ts +12 -0
- package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts +5 -0
- package/lib/typescript/module/src/runtime/bannerEngineContext.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/bannerPlacement.d.ts +12 -0
- package/lib/typescript/module/src/runtime/bannerPlacement.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts +5 -0
- package/lib/typescript/module/src/runtime/embedBannerRegistry.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts +25 -1
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/isolateCall.d.ts +20 -0
- package/lib/typescript/module/src/runtime/isolateCall.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/reportSdkError.d.ts +10 -0
- package/lib/typescript/module/src/runtime/reportSdkError.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/useBannerSession.d.ts +5 -0
- package/lib/typescript/module/src/runtime/useBannerSession.d.ts.map +1 -0
- package/lib/typescript/module/src/screenTracker.d.ts +7 -3
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/BannerBar.d.ts +14 -0
- package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +15 -0
- package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +10 -6
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +15 -0
- package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts +20 -0
- package/lib/typescript/module/src/surfaces/bannerBarTokens.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +10 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts +7 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunEvalJs.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts +6 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerAutoRunSession.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +13 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts +5 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts +6 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebFrameCss.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts +9 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts +3 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/buttonClassName.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts +10 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/resolveCdnHost.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts +3 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/richContentDocToHtml.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +7 -0
- package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/safeArea.d.ts +6 -0
- package/lib/typescript/module/src/surfaces/safeArea.d.ts.map +1 -1
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +4 -3
- package/src/anchors/AutoAnchorRegistry.ts +41 -11
- package/src/anchors/fiber/fiberPath.ts +117 -0
- package/src/anchors/fiber/findAnchorFiber.ts +57 -47
- package/src/anchors/fiber/resolveFiberPath.ts +215 -0
- package/src/anchors/fiber/visibleRect.ts +153 -0
- package/src/anchors/fiber/visibleScreens.ts +74 -36
- package/src/anchors/fiber/walkVisibleFibers.ts +65 -0
- package/src/anchors/isInstanceOnVisibleScreen.ts +55 -0
- package/src/anchors/resolveAutoAnchorHost.ts +17 -15
- package/src/anchors/semanticMatcher.ts +38 -14
- package/src/anonymousId.ts +2 -1
- package/src/authoring/ElementPickerOverlay.tsx +168 -59
- package/src/authoring/chrome/ChromeBottomSheet.tsx +49 -8
- package/src/authoring/chrome/ChromeButton.tsx +9 -4
- package/src/authoring/chrome/ChromeIcon.tsx +10 -1
- package/src/authoring/chrome/ChromeTopBar.tsx +39 -15
- package/src/authoring/chrome/DoubleTapBridge.tsx +19 -12
- package/src/authoring/chrome/doubleTapMonitor.ts +10 -0
- package/src/authoring/chrome/icons/circle-exclamation.png +0 -0
- package/src/authoring/chrome/icons/circle-exclamation@2x.png +0 -0
- package/src/authoring/chrome/icons/circle-exclamation@3x.png +0 -0
- package/src/authoring/chrome/icons/triangle-exclamation.png +0 -0
- package/src/authoring/chrome/icons/triangle-exclamation@2x.png +0 -0
- package/src/authoring/chrome/icons/triangle-exclamation@3x.png +0 -0
- package/src/authoring/chrome/tokens.ts +7 -2
- package/src/authoring/elementPickerController.ts +2 -4
- package/src/authoring/fingerprintFromInstance.ts +170 -4
- package/src/authoring/hitTest.ts +324 -16
- package/src/authoring/hostAtPoint.ts +247 -0
- package/src/content/BannerStepButton.tsx +91 -0
- package/src/content/buttonAppearance.ts +16 -0
- package/src/content/resolveBannerButtonChrome.ts +49 -0
- package/src/content/themeColor.ts +15 -0
- package/src/content/types.ts +1 -0
- package/src/deepLinking.ts +4 -4
- package/src/evalJs/EvalJsHost.tsx +255 -0
- package/src/evalJs/bootstrap.ts +83 -0
- package/src/evalJs/bridgeMessages.ts +134 -0
- package/src/evalJs/evalJsBridge.ts +42 -0
- package/src/evalJs/evalJsController.ts +127 -0
- package/src/evalJs/getWebView.ts +124 -0
- package/src/evalJs/injectEvalPending.ts +14 -0
- package/src/evalJs/types.ts +56 -0
- package/src/evalJs/useEvalJsWebViewInjection.ts +37 -0
- package/src/expo-router/index.ts +8 -0
- package/src/expo-router/redirectSystemPath.ts +86 -0
- package/src/expo-router/useUserflowExpoRouter.ts +2 -2
- package/src/index.ts +129 -45
- package/src/lifecycle.ts +4 -1
- package/src/navigation/WithUserflowReactNavigation.tsx +13 -10
- package/src/navigation/openFlowNavigateUrl.ts +12 -5
- package/src/pairing/PairingController.ts +283 -29
- package/src/pairing/PreviewModeBanner.tsx +71 -14
- package/src/pairing/deepLink.ts +23 -5
- package/src/pairing/deviceId.ts +43 -0
- package/src/pairing/diagnostics.ts +6 -4
- package/src/pairing/tokenStorage.ts +60 -7
- package/src/pairing/usePairingState.ts +2 -0
- package/src/pairing/usePreviewBarHold.ts +160 -0
- package/src/runtime/BannerHost.tsx +102 -0
- package/src/runtime/EmbedBannerPlaceholder.tsx +115 -0
- package/src/runtime/SdkErrorBoundary.tsx +77 -0
- package/src/runtime/TargetPressBridge.tsx +19 -12
- package/src/runtime/UserflowOverlay.tsx +118 -0
- package/src/runtime/UserflowProvider.tsx +139 -64
- package/src/runtime/bannerEngine.ts +55 -0
- package/src/runtime/bannerEngineContext.ts +5 -0
- package/src/runtime/bannerPlacement.ts +36 -0
- package/src/runtime/embedBannerRegistry.ts +28 -0
- package/src/runtime/flowEngine.ts +76 -3
- package/src/runtime/isolateCall.ts +53 -0
- package/src/runtime/reportSdkError.ts +12 -0
- package/src/runtime/useBannerSession.ts +35 -0
- package/src/screenTracker.ts +34 -8
- package/src/surfaces/BannerBar.tsx +176 -0
- package/src/surfaces/BannerSurface.tsx +82 -0
- package/src/surfaces/MadeWithUserflow.tsx +15 -10
- package/src/surfaces/ModalSurface.tsx +1 -1
- package/src/surfaces/TooltipSurface.tsx +17 -1
- package/src/surfaces/bannerBarLayout.ts +74 -0
- package/src/surfaces/bannerBarTokens.ts +34 -0
- package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +312 -0
- package/src/surfaces/bannerWebView/bannerAutoRunEvalJs.ts +44 -0
- package/src/surfaces/bannerWebView/bannerAutoRunSession.ts +19 -0
- package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +38 -0
- package/src/surfaces/bannerWebView/bannerThemeStyles.ts +91 -0
- package/src/surfaces/bannerWebView/bannerWebFrameCss.ts +145 -0
- package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +178 -0
- package/src/surfaces/bannerWebView/buttonClassName.ts +15 -0
- package/src/surfaces/bannerWebView/resolveCdnHost.ts +47 -0
- package/src/surfaces/bannerWebView/richContentDocToHtml.ts +99 -0
- package/src/surfaces/resolveBannerTheme.ts +18 -0
- package/src/surfaces/safeArea.ts +29 -0
- package/src/version.ts +1 -1
- package/vendor/core/dist/attributes.d.ts.map +1 -1
- package/vendor/core/dist/attributes.js +4 -4
- package/vendor/core/dist/attributes.js.map +1 -1
- package/vendor/core/dist/engine/BannerSessionEngine.d.ts +73 -0
- package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/BannerSessionEngine.js +236 -0
- package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -0
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts +41 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.js +167 -28
- package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts +38 -2
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.js +19 -2
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.d.ts +10 -1
- package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.js +47 -27
- package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
- package/vendor/core/dist/engine/handleActions.d.ts +17 -3
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
- package/vendor/core/dist/engine/handleActions.js +17 -14
- package/vendor/core/dist/engine/handleActions.js.map +1 -1
- package/vendor/core/dist/engine/trackCondition.d.ts +2 -0
- package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -1
- package/vendor/core/dist/engine/trackCondition.js +4 -2
- package/vendor/core/dist/engine/trackCondition.js.map +1 -1
- package/vendor/core/dist/engine/trackStepTriggers.d.ts +11 -1
- package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -1
- package/vendor/core/dist/engine/trackStepTriggers.js +42 -16
- package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -1
- package/vendor/core/dist/errors.d.ts +11 -1
- package/vendor/core/dist/errors.d.ts.map +1 -1
- package/vendor/core/dist/errors.js +2 -1
- package/vendor/core/dist/errors.js.map +1 -1
- package/vendor/core/dist/eventAttributes.d.ts.map +1 -1
- package/vendor/core/dist/eventAttributes.js +4 -2
- package/vendor/core/dist/eventAttributes.js.map +1 -1
- package/vendor/core/dist/index.d.ts +4 -1
- package/vendor/core/dist/index.d.ts.map +1 -1
- package/vendor/core/dist/index.js +1 -0
- package/vendor/core/dist/index.js.map +1 -1
- package/vendor/core/dist/normalizeAttributes.js +9 -7
- package/vendor/core/dist/normalizeAttributes.js.map +1 -1
- package/vendor/core/dist/transport/pairing.d.ts +5 -0
- package/vendor/core/dist/transport/pairing.d.ts.map +1 -1
- package/vendor/core/dist/transport/pairing.js +69 -2
- package/vendor/core/dist/transport/pairing.js.map +1 -1
- package/vendor/core/dist/transport/phoenix.d.ts +8 -0
- package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
- package/vendor/core/dist/transport/phoenix.js +16 -2
- package/vendor/core/dist/transport/phoenix.js.map +1 -1
- package/vendor/core/dist/version.d.ts +1 -1
- package/vendor/core/dist/version.js +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/protocol/dist/autoData.d.ts +8 -15
- package/vendor/protocol/dist/autoData.d.ts.map +1 -1
- package/vendor/protocol/dist/autoData.js.map +1 -1
- package/vendor/protocol/dist/flows.d.ts +58 -2
- package/vendor/protocol/dist/flows.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.js +20 -2
- package/vendor/protocol/dist/flows.js.map +1 -1
- package/vendor/protocol/dist/messages.d.ts +22 -12
- package/vendor/protocol/dist/messages.d.ts.map +1 -1
- package/vendor/protocol/dist/messages.js +5 -2
- package/vendor/protocol/dist/messages.js.map +1 -1
- package/vendor/protocol/package.json +1 -1
|
@@ -2,13 +2,17 @@ import {
|
|
|
2
2
|
DEFAULT_PAIRING_ENDPOINT,
|
|
3
3
|
PairingEngine,
|
|
4
4
|
type PairingEngineState,
|
|
5
|
+
type PairingPurpose,
|
|
5
6
|
type UserflowCore,
|
|
6
7
|
} from '@userflow-tech/core';
|
|
8
|
+
import { decodePairingJwt, isPairingJwtExpired } from '@userflow-tech/protocol';
|
|
7
9
|
import { AppState, type AppStateStatus, Linking, Platform } from 'react-native';
|
|
8
10
|
|
|
9
11
|
import { clearFiberAnchorCache } from '../anchors/fiberAnchorCache';
|
|
12
|
+
import { evalJsController } from '../evalJs/evalJsController';
|
|
10
13
|
|
|
11
14
|
import { inspectPairingDeepLink, isPairingAttempt } from './deepLink';
|
|
15
|
+
import { getOrCreatePairingDeviceId } from './deviceId';
|
|
12
16
|
import {
|
|
13
17
|
defaultPairingLogger,
|
|
14
18
|
pairingAttemptRejectionMessage,
|
|
@@ -42,6 +46,13 @@ export interface PairingControllerOptions {
|
|
|
42
46
|
tokenStore?: PairingTokenStore;
|
|
43
47
|
/** Clear mid-flow session when exiting preview. */
|
|
44
48
|
clearLocalSession?: () => void;
|
|
49
|
+
/** End the previewed draft on the server when exiting preview. */
|
|
50
|
+
endDraftSession?: () => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Drop an end that is waiting for a draft identify has not delivered.
|
|
53
|
+
* A new preview must call this so that draft is not ended when it arrives.
|
|
54
|
+
*/
|
|
55
|
+
cancelPendingDraftEnd?: () => void;
|
|
45
56
|
LinkingModule?: {
|
|
46
57
|
getInitialURL(): Promise<string | null>;
|
|
47
58
|
addEventListener(type: 'url', handler: (event: { url: string }) => void): { remove(): void };
|
|
@@ -51,6 +62,11 @@ export interface PairingControllerOptions {
|
|
|
51
62
|
};
|
|
52
63
|
/** Sink for pairing diagnostics. Injected in tests. */
|
|
53
64
|
logger?: PairingLogger;
|
|
65
|
+
/**
|
|
66
|
+
* Stable pairing device id. Defaults to the persisted install id.
|
|
67
|
+
* Injected in tests.
|
|
68
|
+
*/
|
|
69
|
+
deviceIdProvider?: () => Promise<string>;
|
|
54
70
|
}
|
|
55
71
|
|
|
56
72
|
/**
|
|
@@ -68,13 +84,33 @@ export class PairingController {
|
|
|
68
84
|
private readonly LinkingModule: NonNullable<PairingControllerOptions['LinkingModule']>;
|
|
69
85
|
private readonly AppStateModule: NonNullable<PairingControllerOptions['AppStateModule']>;
|
|
70
86
|
private readonly clearLocalSession: (() => void) | undefined;
|
|
87
|
+
private readonly endDraftSession: (() => Promise<void>) | undefined;
|
|
88
|
+
private readonly cancelPendingDraftEnd: (() => void) | undefined;
|
|
71
89
|
private readonly core: UserflowCore;
|
|
72
90
|
private readonly pairingEndpoint: string;
|
|
73
91
|
private readonly logger: PairingLogger;
|
|
92
|
+
private readonly deviceIdProvider: () => Promise<string>;
|
|
93
|
+
private pairingDeviceId: string | null = null;
|
|
94
|
+
/** A link or resume already claimed this launch, so a stored token must not. */
|
|
95
|
+
private acceptedPairingToken = false;
|
|
96
|
+
/**
|
|
97
|
+
* Bumped by exitPreview. An in-flight resume or connect checks it after
|
|
98
|
+
* every await and does not write the token or leave the socket up.
|
|
99
|
+
*/
|
|
100
|
+
private launchEpoch = 0;
|
|
101
|
+
/** Latest enterPreview. An older attempt must not clear a newer token. */
|
|
102
|
+
private enterAttempt = 0;
|
|
103
|
+
/**
|
|
104
|
+
* Orders token and purpose writes. Two scans can overlap on the awaits, and
|
|
105
|
+
* the slower one's purpose must not land on the token the faster one saved.
|
|
106
|
+
*/
|
|
107
|
+
private previewSaveQueue: Promise<void> = Promise.resolve();
|
|
74
108
|
private initPhase: InitPhase = 'ready';
|
|
75
109
|
private initFailureReason: string | null = null;
|
|
76
110
|
/** Pairing token captured before init resolved, replayed once it does. */
|
|
77
111
|
private deferredPairingToken: string | null = null;
|
|
112
|
+
/** Purpose of {@link deferredPairingToken}, so the held banner already honours it. */
|
|
113
|
+
private deferredPurpose: PairingPurpose | null = null;
|
|
78
114
|
/** Diagnostics already emitted for the current init attempt. */
|
|
79
115
|
private readonly loggedOnce = new Set<string>();
|
|
80
116
|
private relayUnsub: (() => void) | null = null;
|
|
@@ -86,7 +122,10 @@ export class PairingController {
|
|
|
86
122
|
this.LinkingModule = options.LinkingModule ?? Linking;
|
|
87
123
|
this.AppStateModule = options.AppStateModule ?? AppState;
|
|
88
124
|
this.clearLocalSession = options.clearLocalSession ?? undefined;
|
|
125
|
+
this.endDraftSession = options.endDraftSession ?? undefined;
|
|
126
|
+
this.cancelPendingDraftEnd = options.cancelPendingDraftEnd ?? undefined;
|
|
89
127
|
this.logger = options.logger ?? defaultPairingLogger;
|
|
128
|
+
this.deviceIdProvider = options.deviceIdProvider ?? getOrCreatePairingDeviceId;
|
|
90
129
|
}
|
|
91
130
|
|
|
92
131
|
getEngine(): PairingEngine | null {
|
|
@@ -101,6 +140,8 @@ export class PairingController {
|
|
|
101
140
|
getState(): PairingEngineState {
|
|
102
141
|
const blocked = this.blockedState();
|
|
103
142
|
if (blocked) return blocked;
|
|
143
|
+
const held = this.heldState();
|
|
144
|
+
if (held) return held;
|
|
104
145
|
|
|
105
146
|
return (
|
|
106
147
|
this.engine?.getState() ?? {
|
|
@@ -113,6 +154,8 @@ export class PairingController {
|
|
|
113
154
|
awaitingStartCondition: false,
|
|
114
155
|
canRestartPreview: false,
|
|
115
156
|
previewRestartGeneration: 0,
|
|
157
|
+
pairingSessionGeneration: 0,
|
|
158
|
+
previewStartGeneration: 0,
|
|
116
159
|
}
|
|
117
160
|
);
|
|
118
161
|
}
|
|
@@ -136,6 +179,31 @@ export class PairingController {
|
|
|
136
179
|
awaitingStartCondition: false,
|
|
137
180
|
canRestartPreview: false,
|
|
138
181
|
previewRestartGeneration: 0,
|
|
182
|
+
pairingSessionGeneration: 0,
|
|
183
|
+
previewStartGeneration: 0,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* A link or resumed token is waiting for init. Report connecting so the
|
|
189
|
+
* banner is visible during credential validation instead of looking idle.
|
|
190
|
+
*/
|
|
191
|
+
private heldState(): PairingEngineState | null {
|
|
192
|
+
if (this.initPhase !== 'pending' || this.deferredPairingToken === null) return null;
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
status: 'connecting',
|
|
196
|
+
pairingId: null,
|
|
197
|
+
deviceId: this.pairingDeviceId,
|
|
198
|
+
previewActive: true,
|
|
199
|
+
lastError: null,
|
|
200
|
+
needsRescan: false,
|
|
201
|
+
awaitingStartCondition: false,
|
|
202
|
+
canRestartPreview: false,
|
|
203
|
+
previewRestartGeneration: 0,
|
|
204
|
+
pairingSessionGeneration: 0,
|
|
205
|
+
previewStartGeneration: 0,
|
|
206
|
+
...(this.deferredPurpose ? { pairingPurpose: this.deferredPurpose } : {}),
|
|
139
207
|
};
|
|
140
208
|
}
|
|
141
209
|
|
|
@@ -163,15 +231,6 @@ export class PairingController {
|
|
|
163
231
|
}
|
|
164
232
|
|
|
165
233
|
private async startListening(): Promise<void> {
|
|
166
|
-
// Exit pairing on app restart: drop any leftover secure token. Guarded so a
|
|
167
|
-
// storage failure cannot cost us the listeners registered below — losing
|
|
168
|
-
// those is what makes an inbound QR link vanish without explanation.
|
|
169
|
-
try {
|
|
170
|
-
await this.tokenStore.clear();
|
|
171
|
-
} catch (error) {
|
|
172
|
-
this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
234
|
this.ensureEngine();
|
|
176
235
|
|
|
177
236
|
this.urlSub = this.LinkingModule.addEventListener('url', ({ url }) => {
|
|
@@ -195,6 +254,58 @@ export class PairingController {
|
|
|
195
254
|
} catch {
|
|
196
255
|
// Linking may throw on some platforms before the native module is ready.
|
|
197
256
|
}
|
|
257
|
+
|
|
258
|
+
// A launch URL already claimed this process. Do not also resume storage.
|
|
259
|
+
if (this.acceptedPairingToken) return;
|
|
260
|
+
await this.resumeStoredToken();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Rejoin the Builder session after a relaunch when no new pairing link won.
|
|
265
|
+
* An expired or undecodable token is cleared so the next launch stays idle.
|
|
266
|
+
*/
|
|
267
|
+
private async resumeStoredToken(): Promise<void> {
|
|
268
|
+
const epoch = this.launchEpoch;
|
|
269
|
+
let stored: string | null;
|
|
270
|
+
try {
|
|
271
|
+
stored = await this.tokenStore.get();
|
|
272
|
+
} catch (error) {
|
|
273
|
+
this.warnOnce(pairingConnectFailedMessage(describeError(error)));
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (epoch !== this.launchEpoch || this.acceptedPairingToken || !stored) return;
|
|
278
|
+
|
|
279
|
+
const claims = decodePairingJwt(stored);
|
|
280
|
+
if (!claims || isPairingJwtExpired(claims)) {
|
|
281
|
+
// A link that arrived while we were reading storage owns the session.
|
|
282
|
+
if (epoch !== this.launchEpoch || this.acceptedPairingToken) return;
|
|
283
|
+
try {
|
|
284
|
+
const current = await this.tokenStore.get();
|
|
285
|
+
if (epoch !== this.launchEpoch || this.acceptedPairingToken || current !== stored) return;
|
|
286
|
+
await this.tokenStore.clear();
|
|
287
|
+
} catch (error) {
|
|
288
|
+
this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
|
|
289
|
+
}
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (epoch !== this.launchEpoch || this.acceptedPairingToken) return;
|
|
294
|
+
|
|
295
|
+
let purpose: PairingPurpose | null = null;
|
|
296
|
+
try {
|
|
297
|
+
purpose = (await this.tokenStore.getPurpose?.()) ?? null;
|
|
298
|
+
} catch {
|
|
299
|
+
// Resume without it; the banner falls back to its default reveal.
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (epoch !== this.launchEpoch || this.acceptedPairingToken) return;
|
|
303
|
+
|
|
304
|
+
try {
|
|
305
|
+
await this.connectWhenReady(stored, 'resume', purpose);
|
|
306
|
+
} catch (error) {
|
|
307
|
+
this.warnOnce(pairingConnectFailedMessage(describeError(error)));
|
|
308
|
+
}
|
|
198
309
|
}
|
|
199
310
|
|
|
200
311
|
stop(): void {
|
|
@@ -227,21 +338,42 @@ export class PairingController {
|
|
|
227
338
|
return true;
|
|
228
339
|
}
|
|
229
340
|
|
|
341
|
+
await this.connectWhenReady(
|
|
342
|
+
inspected.link.pairingToken,
|
|
343
|
+
'link',
|
|
344
|
+
inspected.link.purpose ?? null,
|
|
345
|
+
);
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Connect now, or hold the token until init resolves or fails. Links and
|
|
351
|
+
* resumed sessions share this gate so both are deferred, replayed, and
|
|
352
|
+
* shown the same way.
|
|
353
|
+
*/
|
|
354
|
+
private async connectWhenReady(
|
|
355
|
+
token: string,
|
|
356
|
+
source: 'link' | 'resume' = 'link',
|
|
357
|
+
purpose: PairingPurpose | null = null,
|
|
358
|
+
): Promise<void> {
|
|
359
|
+
this.acceptedPairingToken = true;
|
|
360
|
+
|
|
230
361
|
if (this.initPhase !== 'ready') {
|
|
231
362
|
// Hold the token rather than discarding it. `notifyInitialized` replays it;
|
|
232
363
|
// `notifyInitFailed` turns it into visible state.
|
|
233
|
-
this.deferredPairingToken =
|
|
234
|
-
this.
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
364
|
+
this.deferredPairingToken = token;
|
|
365
|
+
this.deferredPurpose = purpose;
|
|
366
|
+
if (this.initPhase === 'failed') {
|
|
367
|
+
this.warnOnce(pairingLinkInitFailedMessage(this.initFailureReason ?? 'unknown error'));
|
|
368
|
+
} else if (source === 'link') {
|
|
369
|
+
// A resume waits on init on every relaunch; only a link needs this note.
|
|
370
|
+
this.warnOnce(pairingLinkDeferredMessage());
|
|
371
|
+
}
|
|
372
|
+
this.emit(this.getState());
|
|
373
|
+
return;
|
|
241
374
|
}
|
|
242
375
|
|
|
243
|
-
await this.enterPreview(
|
|
244
|
-
return true;
|
|
376
|
+
await this.enterPreview(token, purpose);
|
|
245
377
|
}
|
|
246
378
|
|
|
247
379
|
/**
|
|
@@ -259,8 +391,9 @@ export class PairingController {
|
|
|
259
391
|
}
|
|
260
392
|
|
|
261
393
|
/**
|
|
262
|
-
* Called when `Userflow.init()` resolves. Connects a link
|
|
263
|
-
* init was still in flight.
|
|
394
|
+
* Called when `Userflow.init()` resolves. Connects a link or resumed session
|
|
395
|
+
* that arrived while init was still in flight. `Userflow.init` does not await
|
|
396
|
+
* this — the pairing socket must not block identify.
|
|
264
397
|
*/
|
|
265
398
|
async notifyInitialized(): Promise<void> {
|
|
266
399
|
this.initPhase = 'ready';
|
|
@@ -268,14 +401,17 @@ export class PairingController {
|
|
|
268
401
|
|
|
269
402
|
const deferred = this.deferredPairingToken;
|
|
270
403
|
if (deferred === null) return;
|
|
404
|
+
const purpose = this.deferredPurpose;
|
|
271
405
|
this.deferredPairingToken = null;
|
|
406
|
+
this.deferredPurpose = null;
|
|
272
407
|
|
|
273
408
|
try {
|
|
274
|
-
await this.enterPreview(deferred);
|
|
409
|
+
await this.enterPreview(deferred, purpose);
|
|
275
410
|
} catch (error) {
|
|
276
|
-
// Preview must not fail host init. `Userflow.init`
|
|
277
|
-
// PairingEngine.start rethrows on every connect failure, so letting
|
|
278
|
-
// escape would
|
|
411
|
+
// Preview must not fail host init. `Userflow.init` does not await this,
|
|
412
|
+
// and PairingEngine.start rethrows on every connect failure, so letting
|
|
413
|
+
// this escape would be an unhandled rejection — and, if it were awaited,
|
|
414
|
+
// an expired QR token would fail the host app's entire init.
|
|
279
415
|
this.warnOnce(pairingConnectFailedMessage(describeError(error)));
|
|
280
416
|
}
|
|
281
417
|
}
|
|
@@ -305,17 +441,128 @@ export class PairingController {
|
|
|
305
441
|
}
|
|
306
442
|
|
|
307
443
|
/** Explicit entry with a raw pairing JWT (tests / advanced hosts). */
|
|
308
|
-
async enterPreview(pairingToken: string): Promise<void> {
|
|
444
|
+
async enterPreview(pairingToken: string, purpose: PairingPurpose | null = null): Promise<void> {
|
|
445
|
+
const epoch = this.launchEpoch;
|
|
446
|
+
const attempt = ++this.enterAttempt;
|
|
309
447
|
const engine = this.ensureEngine();
|
|
310
|
-
await
|
|
311
|
-
|
|
448
|
+
// Before the first await, so an exit that runs later still arms its own end.
|
|
449
|
+
if (epoch === this.launchEpoch) this.cancelPendingDraftEnd?.();
|
|
450
|
+
|
|
451
|
+
const deviceId = await this.resolveDeviceId();
|
|
452
|
+
if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) return;
|
|
453
|
+
|
|
454
|
+
this.pairingDeviceId = deviceId;
|
|
455
|
+
const saved = await this.savePreviewCredentials(pairingToken, purpose, attempt, epoch);
|
|
456
|
+
if (!saved) return;
|
|
457
|
+
|
|
458
|
+
try {
|
|
459
|
+
await (purpose ? engine.start(pairingToken, { purpose }) : engine.start(pairingToken));
|
|
460
|
+
} catch (error) {
|
|
461
|
+
// A newer pair owns the engine now. Stopping here would drop it.
|
|
462
|
+
if (attempt !== this.enterAttempt) return;
|
|
463
|
+
if (epoch !== this.launchEpoch) {
|
|
464
|
+
// start() records a connect failure after stop() has already gone idle.
|
|
465
|
+
await this.discardPreviewToken(pairingToken, attempt);
|
|
466
|
+
this.engine?.stop();
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
throw error;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (attempt !== this.enterAttempt) return;
|
|
473
|
+
if (epoch !== this.launchEpoch) {
|
|
474
|
+
await this.discardPreviewToken(pairingToken, attempt);
|
|
475
|
+
this.engine?.stop();
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Write the token and its purpose as one attempt. Writes are queued so an
|
|
481
|
+
* older scan cannot finish its purpose after a newer scan has saved its own.
|
|
482
|
+
* Returns false when this attempt lost the race; storage then still belongs
|
|
483
|
+
* to whoever connected, or is cleared if this attempt was the last writer.
|
|
484
|
+
*/
|
|
485
|
+
private async savePreviewCredentials(
|
|
486
|
+
pairingToken: string,
|
|
487
|
+
purpose: PairingPurpose | null,
|
|
488
|
+
attempt: number,
|
|
489
|
+
epoch: number,
|
|
490
|
+
): Promise<boolean> {
|
|
491
|
+
const previous = this.previewSaveQueue;
|
|
492
|
+
let release: () => void = () => undefined;
|
|
493
|
+
this.previewSaveQueue = new Promise<void>((resolve) => {
|
|
494
|
+
release = resolve;
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
try {
|
|
498
|
+
await previous;
|
|
499
|
+
if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) return false;
|
|
500
|
+
|
|
501
|
+
await this.tokenStore.set(pairingToken);
|
|
502
|
+
if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) {
|
|
503
|
+
await this.revertPreviewCredentials(pairingToken);
|
|
504
|
+
return false;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
await this.tokenStore.setPurpose?.(purpose);
|
|
508
|
+
if (attempt !== this.enterAttempt || epoch !== this.launchEpoch) {
|
|
509
|
+
await this.revertPreviewCredentials(pairingToken);
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
return true;
|
|
513
|
+
} finally {
|
|
514
|
+
release();
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Drop credentials this attempt wrote, when they are still the ones stored.
|
|
520
|
+
* A newer scan may already have replaced them; those stay.
|
|
521
|
+
*/
|
|
522
|
+
private async revertPreviewCredentials(pairingToken: string): Promise<void> {
|
|
523
|
+
try {
|
|
524
|
+
const current = await this.tokenStore.get();
|
|
525
|
+
if (current !== pairingToken) return;
|
|
526
|
+
await this.tokenStore.clear();
|
|
527
|
+
} catch (error) {
|
|
528
|
+
this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Remove the token this attempt wrote. A newer pair may already have
|
|
534
|
+
* replaced it; that token stays.
|
|
535
|
+
*/
|
|
536
|
+
private async discardPreviewToken(pairingToken: string, attempt: number): Promise<void> {
|
|
537
|
+
if (attempt !== this.enterAttempt) return;
|
|
538
|
+
try {
|
|
539
|
+
const current = await this.tokenStore.get();
|
|
540
|
+
if (attempt !== this.enterAttempt || current !== pairingToken) return;
|
|
541
|
+
await this.tokenStore.clear();
|
|
542
|
+
} catch (error) {
|
|
543
|
+
this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
private async resolveDeviceId(): Promise<string> {
|
|
548
|
+
if (this.pairingDeviceId !== null) return this.pairingDeviceId;
|
|
549
|
+
return this.deviceIdProvider();
|
|
312
550
|
}
|
|
313
551
|
|
|
314
552
|
async exitPreview(): Promise<void> {
|
|
315
553
|
// Drop any held link too, so dismissing a blocked banner actually clears it.
|
|
554
|
+
// Bump before the awaits so a resume still reading storage does not reconnect.
|
|
555
|
+
this.launchEpoch += 1;
|
|
556
|
+
evalJsController.reset();
|
|
316
557
|
this.deferredPairingToken = null;
|
|
558
|
+
this.deferredPurpose = null;
|
|
317
559
|
await this.tokenStore.clear();
|
|
318
560
|
this.engine?.stop();
|
|
561
|
+
// Not awaited: the local clear is synchronous, and the banner must not wait
|
|
562
|
+
// on the end-user socket.
|
|
563
|
+
void this.endDraftSession?.().catch((error: unknown) => {
|
|
564
|
+
this.warnOnce(pairingPreviewErrorMessage(describeError(error)));
|
|
565
|
+
});
|
|
319
566
|
this.clearLocalSession?.();
|
|
320
567
|
this.emit(this.getState());
|
|
321
568
|
}
|
|
@@ -327,6 +574,7 @@ export class PairingController {
|
|
|
327
574
|
async restartPreview(): Promise<boolean> {
|
|
328
575
|
if (!this.engine) return false;
|
|
329
576
|
clearFiberAnchorCache();
|
|
577
|
+
evalJsController.reset();
|
|
330
578
|
return this.engine.restartPreview();
|
|
331
579
|
}
|
|
332
580
|
|
|
@@ -343,7 +591,13 @@ export class PairingController {
|
|
|
343
591
|
onServerMessage: (handler) => this.core.onServerMessage(handler),
|
|
344
592
|
isIdentified: () => this.core.getUserId() != null,
|
|
345
593
|
pairingOptions: { pairingEndpoint: this.pairingEndpoint },
|
|
346
|
-
deviceMeta: () => ({
|
|
594
|
+
deviceMeta: () => ({
|
|
595
|
+
os: Platform.OS,
|
|
596
|
+
...(this.pairingDeviceId !== null ? { device_id: this.pairingDeviceId } : {}),
|
|
597
|
+
}),
|
|
598
|
+
onBeforePreviewStart: () => {
|
|
599
|
+
this.clearLocalSession?.();
|
|
600
|
+
},
|
|
347
601
|
});
|
|
348
602
|
|
|
349
603
|
this.engine.onStateChange((state) => {
|
|
@@ -16,6 +16,8 @@ type VisiblePreviewChrome = Extract<PreviewChrome, { visible: true }>;
|
|
|
16
16
|
type ConfirmingKind = 'exit' | 'restart';
|
|
17
17
|
|
|
18
18
|
const ONBOARDING_COPY = 'Double tap anywhere to access the menu';
|
|
19
|
+
/** A short blip stays quiet. Longer than this, the hidden bar comes back until the socket recovers. */
|
|
20
|
+
export const RECONNECT_REVEAL_DELAY_MS = 2000;
|
|
19
21
|
|
|
20
22
|
export interface PreviewModeBannerProps {
|
|
21
23
|
state: PairingEngineState;
|
|
@@ -25,6 +27,12 @@ export interface PreviewModeBannerProps {
|
|
|
25
27
|
onConfirmingChange?: (open: boolean) => void;
|
|
26
28
|
/** Hide the preview bar while the element picker is using the same top slot. */
|
|
27
29
|
suppressed?: boolean | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Hide default-tone chrome without giving the top slot to the picker.
|
|
32
|
+
* Error tone still shows. Set for the brief intro after a new pairing and
|
|
33
|
+
* for the stretch after element selection until the Builder starts a preview.
|
|
34
|
+
*/
|
|
35
|
+
held?: boolean | undefined;
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
/**
|
|
@@ -36,15 +44,20 @@ export function PreviewModeBanner({
|
|
|
36
44
|
onRestart,
|
|
37
45
|
onConfirmingChange,
|
|
38
46
|
suppressed = false,
|
|
47
|
+
held = false,
|
|
39
48
|
}: PreviewModeBannerProps): React.ReactElement | null {
|
|
40
49
|
const setBannerHeight = useReportPreviewBannerHeight();
|
|
41
50
|
const chrome = resolvePreviewChrome(state);
|
|
42
51
|
const [chromeShown, setChromeShown] = React.useState(true);
|
|
43
52
|
const [showOnboarding, setShowOnboarding] = React.useState(false);
|
|
44
53
|
const [barHeight, setBarHeight] = React.useState(0);
|
|
45
|
-
const
|
|
54
|
+
const [reconnectRevealed, setReconnectRevealed] = React.useState(false);
|
|
55
|
+
const reconnectRevealedRef = React.useRef(reconnectRevealed);
|
|
56
|
+
reconnectRevealedRef.current = reconnectRevealed;
|
|
57
|
+
const armedGenerationRef = React.useRef<number | null>(null);
|
|
46
58
|
const isError = chrome.visible && chrome.tone === 'error';
|
|
47
|
-
const visible =
|
|
59
|
+
const visible =
|
|
60
|
+
chrome.visible && !suppressed && (isError || (!held && (chromeShown || reconnectRevealed)));
|
|
48
61
|
const [confirming, setConfirming] = React.useState<ConfirmingKind | null>(null);
|
|
49
62
|
const showRestart = Boolean(state.canRestartPreview) && !isError;
|
|
50
63
|
const showDialog = confirming != null && visible && !isError;
|
|
@@ -59,10 +72,11 @@ export function PreviewModeBanner({
|
|
|
59
72
|
|
|
60
73
|
React.useEffect(() => {
|
|
61
74
|
if (!chrome.visible) {
|
|
62
|
-
|
|
75
|
+
armedGenerationRef.current = null;
|
|
63
76
|
setChromeShown(true);
|
|
64
77
|
setShowOnboarding(false);
|
|
65
78
|
setBarHeight(0);
|
|
79
|
+
setReconnectRevealed(false);
|
|
66
80
|
return;
|
|
67
81
|
}
|
|
68
82
|
if (isError) {
|
|
@@ -70,11 +84,26 @@ export function PreviewModeBanner({
|
|
|
70
84
|
setShowOnboarding(false);
|
|
71
85
|
return;
|
|
72
86
|
}
|
|
73
|
-
if (
|
|
74
|
-
|
|
87
|
+
if (armedGenerationRef.current !== state.pairingSessionGeneration) {
|
|
88
|
+
armedGenerationRef.current = state.pairingSessionGeneration;
|
|
89
|
+
setChromeShown(true);
|
|
75
90
|
setShowOnboarding(true);
|
|
76
91
|
}
|
|
77
|
-
}, [chrome.visible, isError]);
|
|
92
|
+
}, [chrome.visible, isError, state.pairingSessionGeneration]);
|
|
93
|
+
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
if (!chrome.visible || held || state.status !== 'reconnecting') return;
|
|
96
|
+
const timer = setTimeout(() => setReconnectRevealed(true), RECONNECT_REVEAL_DELAY_MS);
|
|
97
|
+
return () => clearTimeout(timer);
|
|
98
|
+
}, [chrome.visible, held, state.status]);
|
|
99
|
+
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
if (chrome.visible && state.status === 'reconnecting') return;
|
|
102
|
+
// An exit dialog opened from the revealed bar must survive recovery.
|
|
103
|
+
// Dropping the reveal immediately would unmount that dialog.
|
|
104
|
+
if (chrome.visible && confirming != null) return;
|
|
105
|
+
setReconnectRevealed(false);
|
|
106
|
+
}, [chrome.visible, confirming, state.status]);
|
|
78
107
|
|
|
79
108
|
React.useEffect(() => {
|
|
80
109
|
if (!visible || isError) {
|
|
@@ -92,30 +121,56 @@ export function PreviewModeBanner({
|
|
|
92
121
|
return;
|
|
93
122
|
}
|
|
94
123
|
if (suppressed) return;
|
|
95
|
-
|
|
124
|
+
// Held chrome is absent, and nothing else is reporting this slot. An error
|
|
125
|
+
// bar still shows, so it keeps the inset.
|
|
126
|
+
if (held && !isError) {
|
|
127
|
+
setBannerHeight(0);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (!chromeShown && !isError && !reconnectRevealed) {
|
|
96
131
|
setBannerHeight(0);
|
|
97
132
|
return;
|
|
98
133
|
}
|
|
99
134
|
if (barHeight > 0) {
|
|
100
135
|
setBannerHeight(barHeight);
|
|
101
136
|
}
|
|
102
|
-
}, [
|
|
137
|
+
}, [
|
|
138
|
+
barHeight,
|
|
139
|
+
chrome.visible,
|
|
140
|
+
chromeShown,
|
|
141
|
+
held,
|
|
142
|
+
isError,
|
|
143
|
+
reconnectRevealed,
|
|
144
|
+
setBannerHeight,
|
|
145
|
+
suppressed,
|
|
146
|
+
]);
|
|
103
147
|
|
|
104
148
|
React.useEffect(() => {
|
|
105
|
-
|
|
106
|
-
|
|
149
|
+
// Navigate-mode picking uses this same singleton. Only drop the subscription
|
|
150
|
+
// we installed — set(null) here would clear that owner when pairing chrome
|
|
151
|
+
// changes while this bar is already suppressed.
|
|
152
|
+
if (!chrome.visible || suppressed || isError || held) {
|
|
107
153
|
return;
|
|
108
154
|
}
|
|
109
|
-
|
|
155
|
+
const subscription = {
|
|
110
156
|
onDoubleTap: () => {
|
|
111
157
|
setShowOnboarding(false);
|
|
158
|
+
// The reveal keeps the bar up regardless of chromeShown, so toggling
|
|
159
|
+
// chromeShown alone would look like a no-op and then pin the bar on
|
|
160
|
+
// after recovery. A double tap on a revealed bar hides it.
|
|
161
|
+
if (reconnectRevealedRef.current) {
|
|
162
|
+
setReconnectRevealed(false);
|
|
163
|
+
setChromeShown(false);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
112
166
|
setChromeShown((shown) => !shown);
|
|
113
167
|
},
|
|
114
|
-
}
|
|
168
|
+
};
|
|
169
|
+
doubleTapMonitor.set(subscription);
|
|
115
170
|
return () => {
|
|
116
|
-
doubleTapMonitor.
|
|
171
|
+
doubleTapMonitor.clearIfCurrent(subscription);
|
|
117
172
|
};
|
|
118
|
-
}, [chrome.visible, isError, suppressed]);
|
|
173
|
+
}, [chrome.visible, held, isError, suppressed]);
|
|
119
174
|
|
|
120
175
|
React.useEffect(() => {
|
|
121
176
|
onConfirmingChange?.(showDialog);
|
|
@@ -253,8 +308,10 @@ export function PreviewModeBanner({
|
|
|
253
308
|
{tooltipVisible ? (
|
|
254
309
|
<View pointerEvents="none" style={[styles.tooltip, { top: barHeight }]}>
|
|
255
310
|
<ChromeTooltip
|
|
311
|
+
key={state.pairingSessionGeneration}
|
|
256
312
|
onDismiss={() => {
|
|
257
313
|
setShowOnboarding(false);
|
|
314
|
+
setChromeShown(false);
|
|
258
315
|
}}
|
|
259
316
|
>
|
|
260
317
|
{ONBOARDING_COPY}
|
package/src/pairing/deepLink.ts
CHANGED
|
@@ -1,18 +1,35 @@
|
|
|
1
|
+
import type { PairingPurpose } from '@userflow-tech/core';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Parse Builder pairing deep links:
|
|
3
|
-
* {scheme_id}://?pairing_token=<jwt>
|
|
5
|
+
* {scheme_id}://?pairing_token=<jwt>[&purpose=preview|select_element]
|
|
4
6
|
*
|
|
5
|
-
* `scheme_id` is
|
|
7
|
+
* `scheme_id` is `userflow-` followed by an opaque, backend-generated id.
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
10
|
export interface PairingDeepLink {
|
|
9
11
|
scheme: string;
|
|
10
12
|
pairingToken: string;
|
|
13
|
+
/** Absent when the link has no `purpose`, or one this SDK does not know. */
|
|
14
|
+
purpose?: PairingPurpose;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const PAIRING_PURPOSES: readonly PairingPurpose[] = ['preview', 'select_element'];
|
|
18
|
+
|
|
19
|
+
export function parsePairingPurpose(value: string | null | undefined): PairingPurpose | null {
|
|
20
|
+
return PAIRING_PURPOSES.find((purpose) => purpose === value) ?? null;
|
|
11
21
|
}
|
|
12
22
|
|
|
13
23
|
/** Scheme prefix shared by preview and pairing links. */
|
|
14
24
|
const USERFLOW_SCHEME_PREFIX = 'userflow-';
|
|
15
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Environment scheme_id shape — must match Expo plugin registration
|
|
27
|
+
* (`packages/expo/plugin/withUserflow.ts`). Everything after `userflow-` is an
|
|
28
|
+
* opaque id owned by the backend (today 26 base32 chars), so only check that it
|
|
29
|
+
* is one or more alphanumeric segments joined by single hyphens. Digit-only ids
|
|
30
|
+
* used in local configs also pass.
|
|
31
|
+
*/
|
|
32
|
+
const USERFLOW_SCHEME = /^userflow-[a-z0-9]+(?:-[a-z0-9]+)*$/i;
|
|
16
33
|
|
|
17
34
|
/**
|
|
18
35
|
* Why a URL was not treated as a pairing link.
|
|
@@ -105,12 +122,13 @@ export function inspectPairingDeepLink(url: string | null | undefined): PairingD
|
|
|
105
122
|
if (!isPair) return { ok: false, reason: 'not-pair-path' };
|
|
106
123
|
|
|
107
124
|
// Only once the URL is known to target pairing does the scheme shape matter.
|
|
108
|
-
// Checking it earlier would misreport preview links on
|
|
125
|
+
// Checking it earlier would misreport preview links on malformed schemes.
|
|
109
126
|
if (!USERFLOW_SCHEME.test(scheme)) return { ok: false, reason: 'bad-scheme-shape' };
|
|
110
127
|
|
|
111
128
|
if (!pairingToken) return { ok: false, reason: 'missing-token' };
|
|
112
129
|
|
|
113
|
-
|
|
130
|
+
const purpose = parsePairingPurpose(parsed.searchParams.get('purpose'));
|
|
131
|
+
return { ok: true, link: { scheme, pairingToken, ...(purpose ? { purpose } : {}) } };
|
|
114
132
|
}
|
|
115
133
|
|
|
116
134
|
/**
|