@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { warnBannerOnce } from "./bannerPlacement.js";
|
|
4
|
+
const counts = new Map();
|
|
5
|
+
|
|
6
|
+
/** Record a mounted {@link EmbedBannerPlaceholder}. Returns the unregister function. */
|
|
7
|
+
export function registerEmbedBannerPlaceholder(id) {
|
|
8
|
+
const next = (counts.get(id) ?? 0) + 1;
|
|
9
|
+
counts.set(id, next);
|
|
10
|
+
if (next > 1) {
|
|
11
|
+
warnBannerOnce(`embed-banner-dup:${id}`, `Userflow: more than one EmbedBannerPlaceholder uses id "${id}"`);
|
|
12
|
+
}
|
|
13
|
+
return () => {
|
|
14
|
+
const current = counts.get(id) ?? 0;
|
|
15
|
+
if (current <= 1) counts.delete(id);else counts.set(id, current - 1);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function hasEmbedBannerPlaceholder(id) {
|
|
19
|
+
return (counts.get(id) ?? 0) > 0;
|
|
20
|
+
}
|
|
21
|
+
export function resetEmbedBannerPlaceholdersForTests() {
|
|
22
|
+
counts.clear();
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=embedBannerRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["warnBannerOnce","counts","Map","registerEmbedBannerPlaceholder","id","next","get","set","current","delete","hasEmbedBannerPlaceholder","resetEmbedBannerPlaceholdersForTests","clear"],"sourceRoot":"../../../src","sources":["runtime/embedBannerRegistry.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,sBAAmB;AAElD,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAiB,CAAC;;AAExC;AACA,OAAO,SAASC,8BAA8BA,CAACC,EAAU,EAAc;EACrE,MAAMC,IAAI,GAAG,CAACJ,MAAM,CAACK,GAAG,CAACF,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;EACtCH,MAAM,CAACM,GAAG,CAACH,EAAE,EAAEC,IAAI,CAAC;EACpB,IAAIA,IAAI,GAAG,CAAC,EAAE;IACZL,cAAc,CACZ,oBAAoBI,EAAE,EAAE,EACxB,2DAA2DA,EAAE,GAC/D,CAAC;EACH;EACA,OAAO,MAAM;IACX,MAAMI,OAAO,GAAGP,MAAM,CAACK,GAAG,CAACF,EAAE,CAAC,IAAI,CAAC;IACnC,IAAII,OAAO,IAAI,CAAC,EAAEP,MAAM,CAACQ,MAAM,CAACL,EAAE,CAAC,CAAC,KAC/BH,MAAM,CAACM,GAAG,CAACH,EAAE,EAAEI,OAAO,GAAG,CAAC,CAAC;EAClC,CAAC;AACH;AAEA,OAAO,SAASE,yBAAyBA,CAACN,EAAU,EAAW;EAC7D,OAAO,CAACH,MAAM,CAACK,GAAG,CAACF,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;AAClC;AAEA,OAAO,SAASO,oCAAoCA,CAAA,EAAS;EAC3DV,MAAM,CAACW,KAAK,CAAC,CAAC;AAChB","ignoreList":[]}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { FlowSessionEngine } from '@userflow-tech/core';
|
|
4
|
+
import { evalJsController } from "../evalJs/evalJsController.js";
|
|
4
5
|
import { openFlowNavigateUrl } from "../navigation/openFlowNavigateUrl.js";
|
|
6
|
+
import { isolateAsync } from "./isolateCall.js";
|
|
5
7
|
let flowEngine = null;
|
|
8
|
+
/** Exit asked to end a draft that identify has not delivered yet. */
|
|
9
|
+
let endDraftOnArrival = false;
|
|
10
|
+
let unsubscribeDraftArrival = null;
|
|
6
11
|
|
|
7
12
|
/** Build (once) the module-level flow session engine over a {@link UserflowCore} transport. */
|
|
8
13
|
export function getFlowSessionEngine(core) {
|
|
@@ -14,11 +19,17 @@ export function getFlowSessionEngine(core) {
|
|
|
14
19
|
setFlowSessionId: id => core.setFlowSessionId(id)
|
|
15
20
|
},
|
|
16
21
|
onOpenExternalUrl: url => {
|
|
17
|
-
void openFlowNavigateUrl(url)
|
|
22
|
+
void isolateAsync('navigate', () => openFlowNavigateUrl(url), {
|
|
23
|
+
rethrowHostContract: false
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
onEvalJs: request => {
|
|
27
|
+
evalJsController.enqueue(request);
|
|
18
28
|
},
|
|
19
29
|
updateUser: attributes => core.updateUser(attributes),
|
|
20
30
|
updateGroup: (attributes, options) => core.updateGroup(attributes, options)
|
|
21
31
|
});
|
|
32
|
+
if (endDraftOnArrival) watchForRestoredDraft();
|
|
22
33
|
}
|
|
23
34
|
return flowEngine;
|
|
24
35
|
}
|
|
@@ -43,13 +54,71 @@ export function clearFlowSessionEngineLocalSession() {
|
|
|
43
54
|
flowEngine?.clearLocalSession();
|
|
44
55
|
}
|
|
45
56
|
|
|
46
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Whether a mid-flow session is held (live, draft, or suppressed by Temporarily
|
|
59
|
+
* Hide). Foreground idle uses this so a hidden session keeps the socket that
|
|
60
|
+
* can deliver the attribute update which shows it again.
|
|
61
|
+
*/
|
|
47
62
|
export function hasActiveFlowSession() {
|
|
48
|
-
return flowEngine?.
|
|
63
|
+
return flowEngine?.hasHeldFlowSession() === true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* End the current flow on the server if it is a Builder preview draft. The
|
|
68
|
+
* server restores every active draft on identify, so clearing it locally is
|
|
69
|
+
* not enough to keep it from returning on the next launch.
|
|
70
|
+
*
|
|
71
|
+
* A draft Temporarily Hide is suppressing is still ended. `getFlowSession()`
|
|
72
|
+
* hides it, but the server will send it again. When exit runs before identify
|
|
73
|
+
* has delivered the draft, the next draft session is ended when it arrives.
|
|
74
|
+
* {@link cancelPendingDraftEnd} drops that wait; a new preview must call it
|
|
75
|
+
* so the preview's own draft is not ended.
|
|
76
|
+
*/
|
|
77
|
+
export async function endDraftFlowSession() {
|
|
78
|
+
const session = flowEngine?.getHeldFlowSession();
|
|
79
|
+
if (flowEngine && session?.draftMode) {
|
|
80
|
+
cancelPendingDraftEnd();
|
|
81
|
+
await flowEngine.endFlow('USER_CLOSED');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
watchForRestoredDraft();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Drop a pending end from {@link endDraftFlowSession}. A new preview calls this. */
|
|
88
|
+
export function cancelPendingDraftEnd() {
|
|
89
|
+
endDraftOnArrival = false;
|
|
90
|
+
unsubscribeDraftArrival?.();
|
|
91
|
+
unsubscribeDraftArrival = null;
|
|
92
|
+
}
|
|
93
|
+
function watchForRestoredDraft() {
|
|
94
|
+
endDraftOnArrival = true;
|
|
95
|
+
if (!flowEngine || unsubscribeDraftArrival) return;
|
|
96
|
+
const engine = flowEngine;
|
|
97
|
+
unsubscribeDraftArrival = engine.on(event => {
|
|
98
|
+
if (event.type !== 'sessionChange' || !endDraftOnArrival) return;
|
|
99
|
+
const session = engine.getHeldFlowSession();
|
|
100
|
+
if (!session?.draftMode) return;
|
|
101
|
+
cancelPendingDraftEnd();
|
|
102
|
+
void engine.endFlow('USER_CLOSED').catch(() => {
|
|
103
|
+
// The session can disappear before EndFlow is built. Nothing to send.
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* `userflow.endFlow()` from an Evaluate JavaScript page. Ends the current
|
|
110
|
+
* session only if one of the page's scripts came from it, so a stale page
|
|
111
|
+
* cannot end a flow that started later.
|
|
112
|
+
*/
|
|
113
|
+
export async function endEvalJsFlowSession(sessionIds) {
|
|
114
|
+
const session = flowEngine?.getFlowSession();
|
|
115
|
+
if (!flowEngine || !session || !sessionIds.has(session.id)) return;
|
|
116
|
+
await flowEngine.endFlow('USERFLOWJS');
|
|
49
117
|
}
|
|
50
118
|
|
|
51
119
|
/** Test helper: drop the singleton so the next get recreates it. */
|
|
52
120
|
export function __resetFlowSessionEngineForTests() {
|
|
121
|
+
cancelPendingDraftEnd();
|
|
53
122
|
flowEngine?.reset();
|
|
54
123
|
flowEngine = null;
|
|
55
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FlowSessionEngine","openFlowNavigateUrl","flowEngine","getFlowSessionEngine","core","transport","send","message","onServerMessage","handler","setFlowSessionId","id","onOpenExternalUrl","url","updateUser","attributes","updateGroup","options","attachFlowSessionEngine","engine","attach","resetFlowSessionEngine","reset","clearFlowSessionEngineLocalSession","clearLocalSession","hasActiveFlowSession","getFlowSession","__resetFlowSessionEngineForTests"],"sourceRoot":"../../../src","sources":["runtime/flowEngine.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAA2B,qBAAqB;
|
|
1
|
+
{"version":3,"names":["FlowSessionEngine","evalJsController","openFlowNavigateUrl","isolateAsync","flowEngine","endDraftOnArrival","unsubscribeDraftArrival","getFlowSessionEngine","core","transport","send","message","onServerMessage","handler","setFlowSessionId","id","onOpenExternalUrl","url","rethrowHostContract","onEvalJs","request","enqueue","updateUser","attributes","updateGroup","options","watchForRestoredDraft","attachFlowSessionEngine","engine","attach","resetFlowSessionEngine","reset","clearFlowSessionEngineLocalSession","clearLocalSession","hasActiveFlowSession","hasHeldFlowSession","endDraftFlowSession","session","getHeldFlowSession","draftMode","cancelPendingDraftEnd","endFlow","on","event","type","catch","endEvalJsFlowSession","sessionIds","getFlowSession","has","__resetFlowSessionEngineForTests"],"sourceR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AMgC,OAAO,GAAGT,MAAM,CAACU,kBAAkB,CAAC,CAAC;IAC3C,IAAI,CAACD,OAAO,EAAEE,SAAS,EAAE;IACzBC,qBAAqB,CAAC,CAAC;IACvB,KAAKZ,MAAM,CAACa,OAAO,CAAC,aAAmC,CAAC,CAACI,KAAK,CAAC,MAAM;MACnE;IAAA,CACD,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,oBAAoBA,CAACC,UAA+B,EAAiB;EACzF,MAAMV,OAAO,GAAGjC,UAAU,EAAE4C,cAAc,CAAC,CAAC;EAC5C,IAAI,CAAC5C,UAAU,IAAI,CAACiC,OAAO,IAAI,CAACU,UAAU,CAACE,GAAG,CAACZ,OAAO,CAACtB,EAAE,CAAC,EAAE;EAC5D,MAAMX,UAAU,CAACqC,OAAO,CAAC,YAAkC,CAAC;AAC9D;;AAEA;AACA,OAAO,SAASS,gCAAgCA,CAAA,EAAS;EACvDV,qBAAqB,CAAC,CAAC;EACvBpC,UAAU,EAAE2B,KAAK,CAAC,CAAC;EACnB3B,UAAU,GAAG,IAAI;AACnB","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { reportSdkError } from "./reportSdkError.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* True for missing `init` / `identify`, invalid event or attribute names — not
|
|
7
|
+
* for transport `UserflowAuthError`s. The flag is set at the throw site on
|
|
8
|
+
* `UserflowAuthError.isHostContract`; message text is not consulted.
|
|
9
|
+
* Matched by `error.name` plus the flag so mocked test doubles with the same
|
|
10
|
+
* name are treated like the real class.
|
|
11
|
+
*/
|
|
12
|
+
export function isHostContractError(error) {
|
|
13
|
+
if (!(error instanceof Error) || error.name !== 'UserflowAuthError') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return error.isHostContract === true;
|
|
17
|
+
}
|
|
18
|
+
/** Run synchronous SDK work; swallow and report anything except host-contract errors. */
|
|
19
|
+
export function isolateSync(scope, work) {
|
|
20
|
+
try {
|
|
21
|
+
return work();
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if (isHostContractError(error)) {
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
reportSdkError(scope, error);
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Run async SDK work; swallow and report anything except host-contract errors. */
|
|
32
|
+
export async function isolateAsync(scope, work, options) {
|
|
33
|
+
try {
|
|
34
|
+
return await work();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if ((options?.rethrowHostContract ?? true) && isHostContractError(error)) {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
reportSdkError(scope, error);
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=isolateCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reportSdkError","isHostContractError","error","Error","name","isHostContract","isolateSync","scope","work","undefined","isolateAsync","options","rethrowHostContract"],"sourceRoot":"../../../src","sources":["runtime/isolateCall.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAACC,KAAc,EAAW;EAC3D,IAAI,EAAEA,KAAK,YAAYC,KAAK,CAAC,IAAID,KAAK,CAACE,IAAI,KAAK,mBAAmB,EAAE;IACnE,OAAO,KAAK;EACd;EACA,OAAQF,KAAK,CAAkCG,cAAc,KAAK,IAAI;AACxE;AAUA;AACA,OAAO,SAASC,WAAWA,CAAIC,KAAa,EAAEC,IAAa,EAAiB;EAC1E,IAAI;IACF,OAAOA,IAAI,CAAC,CAAC;EACf,CAAC,CAAC,OAAON,KAAK,EAAE;IACd,IAAID,mBAAmB,CAACC,KAAK,CAAC,EAAE;MAC9B,MAAMA,KAAK;IACb;IACAF,cAAc,CAACO,KAAK,EAAEL,KAAK,CAAC;IAC5B,OAAOO,SAAS;EAClB;AACF;;AAEA;AACA,OAAO,eAAeC,YAAYA,CAChCH,KAAa,EACbC,IAAsB,EACtBG,OAA6B,EACL;EACxB,IAAI;IACF,OAAO,MAAMH,IAAI,CAAC,CAAC;EACrB,CAAC,CAAC,OAAON,KAAK,EAAE;IACd,IAAI,CAACS,OAAO,EAAEC,mBAAmB,IAAI,IAAI,KAAKX,mBAAmB,CAACC,KAAK,CAAC,EAAE;MACxE,MAAMA,KAAK;IACb;IACAF,cAAc,CAACO,KAAK,EAAEL,KAAK,CAAC;IAC5B,OAAOO,SAAS;EAClB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internal reporter for SDK failures that must not reach the host app.
|
|
5
|
+
* Always logs (not `__DEV__`-only) so a swallowed error is still diagnosable.
|
|
6
|
+
*
|
|
7
|
+
* Uses `console.warn`, not `console.error`: React Native release builds forward
|
|
8
|
+
* `console.error` to the native exception manager (Crashlytics / Sentry), which
|
|
9
|
+
* would report an isolated tooltip failure as a host crash.
|
|
10
|
+
*/
|
|
11
|
+
export function reportSdkError(scope, error, extra) {
|
|
12
|
+
// eslint-disable-next-line no-console -- isolation diagnostics must reach host logs
|
|
13
|
+
console.warn('[Userflow] isolated error', scope, error, extra ?? '');
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=reportSdkError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reportSdkError","scope","error","extra","console","warn"],"sourceRoot":"../../../src","sources":["runtime/reportSdkError.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAACC,KAAa,EAAEC,KAAc,EAAEC,KAAe,EAAQ;EACnF;EACAC,OAAO,CAACC,IAAI,CAAC,2BAA2B,EAAEJ,KAAK,EAAEC,KAAK,EAAEC,KAAK,IAAI,EAAE,CAAC;AACtE","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { isolateSync } from "./isolateCall.js";
|
|
5
|
+
|
|
6
|
+
/** Subscribe to the active banner. A throw while reading the session stays off the host tree. */
|
|
7
|
+
export function useBannerSession(engine) {
|
|
8
|
+
const [session, setSession] = React.useState(() => {
|
|
9
|
+
if (!engine) return null;
|
|
10
|
+
try {
|
|
11
|
+
return engine.getBannerSession();
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (!engine) {
|
|
18
|
+
setSession(null);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const read = () => {
|
|
22
|
+
isolateSync('banner-session', () => {
|
|
23
|
+
setSession(engine.getBannerSession());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
read();
|
|
27
|
+
return engine.on(() => {
|
|
28
|
+
read();
|
|
29
|
+
});
|
|
30
|
+
}, [engine]);
|
|
31
|
+
return session;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=useBannerSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","isolateSync","useBannerSession","engine","session","setSession","useState","getBannerSession","useEffect","read","on"],"sourceRoot":"../../../src","sources":["runtime/useBannerSession.ts"],"mappings":";;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,WAAW,QAAQ,kBAAe;;AAE3C;AACA,OAAO,SAASC,gBAAgBA,CAACC,MAAkC,EAAgC;EACjG,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGL,KAAK,CAACM,QAAQ,CAA+B,MAAM;IAC/E,IAAI,CAACH,MAAM,EAAE,OAAO,IAAI;IACxB,IAAI;MACF,OAAOA,MAAM,CAACI,gBAAgB,CAAC,CAAC;IAClC,CAAC,CAAC,MAAM;MACN,OAAO,IAAI;IACb;EACF,CAAC,CAAC;EAEFP,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,IAAI,CAACL,MAAM,EAAE;MACXE,UAAU,CAAC,IAAI,CAAC;MAChB;IACF;IACA,MAAMI,IAAI,GAAGA,CAAA,KAAM;MACjBR,WAAW,CAAC,gBAAgB,EAAE,MAAM;QAClCI,UAAU,CAACF,MAAM,CAACI,gBAAgB,CAAC,CAAC,CAAC;MACvC,CAAC,CAAC;IACJ,CAAC;IACDE,IAAI,CAAC,CAAC;IACN,OAAON,MAAM,CAACO,EAAE,CAAC,MAAM;MACrBD,IAAI,CAAC,CAAC;IACR,CAAC,CAAC;EACJ,CAAC,EAAE,CAACN,MAAM,CAAC,CAAC;EAEZ,OAAOC,OAAO;AAChB","ignoreList":[]}
|
|
@@ -12,21 +12,17 @@ let currentLocation = null;
|
|
|
12
12
|
/** Latest location seen while tracking was disabled; flushed on enable. */
|
|
13
13
|
let pendingLocation = null;
|
|
14
14
|
let reporter = null;
|
|
15
|
+
const screenListeners = new Set();
|
|
15
16
|
function locationKey(location) {
|
|
16
17
|
return 'path' in location ? `path:${location.path}` : `screen:${location.screen}`;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/** Event attributes for `screen_viewed`, or `null` when the location has no identity. */
|
|
20
21
|
export function screenViewedAttributes(location) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
screen_path: location.path
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
if (!location.screen) return null;
|
|
22
|
+
const screenName = 'path' in location ? location.path : location.screen;
|
|
23
|
+
if (!screenName) return null;
|
|
28
24
|
return {
|
|
29
|
-
screen_name:
|
|
25
|
+
screen_name: screenName
|
|
30
26
|
};
|
|
31
27
|
}
|
|
32
28
|
|
|
@@ -37,10 +33,37 @@ export function screenViewedAttributes(location) {
|
|
|
37
33
|
export function setScreenChangeReporter(next) {
|
|
38
34
|
reporter = next;
|
|
39
35
|
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Observe accepted screen changes (Evaluate JavaScript context, and similar).
|
|
39
|
+
* Fires immediately with the latest known location when one exists.
|
|
40
|
+
* A throwing listener does not block the reporter or the other listeners.
|
|
41
|
+
*/
|
|
42
|
+
export function subscribeScreenLocation(listener) {
|
|
43
|
+
screenListeners.add(listener);
|
|
44
|
+
const current = getCurrentScreenLocation();
|
|
45
|
+
if (current) {
|
|
46
|
+
try {
|
|
47
|
+
listener(current);
|
|
48
|
+
} catch {
|
|
49
|
+
// Listener failures must not break screen tracking.
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
screenListeners.delete(listener);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
40
56
|
function report(location) {
|
|
41
57
|
currentKey = locationKey(location);
|
|
42
58
|
currentLocation = location;
|
|
43
59
|
reporter?.(location);
|
|
60
|
+
for (const listener of screenListeners) {
|
|
61
|
+
try {
|
|
62
|
+
listener(location);
|
|
63
|
+
} catch {
|
|
64
|
+
// Listener failures must not break screen tracking.
|
|
65
|
+
}
|
|
66
|
+
}
|
|
44
67
|
}
|
|
45
68
|
|
|
46
69
|
/** Latest screen/path the SDK has recorded, or `null` before the first report. */
|
|
@@ -79,7 +102,7 @@ export function disableScreenTracking() {
|
|
|
79
102
|
* flushed when tracking is enabled (so init-after-mount still picks up the
|
|
80
103
|
* active route).
|
|
81
104
|
*
|
|
82
|
-
* - Expo Router: `{ path: "/settings/billing" }` → wire `
|
|
105
|
+
* - Expo Router: `{ path: "/settings/billing" }` → wire `screenName`
|
|
83
106
|
* - React Navigation / manual: `{ screen: "BillingSettings" }` → wire `screenName`
|
|
84
107
|
*/
|
|
85
108
|
export function handleScreenChange(location, options) {
|
|
@@ -113,5 +136,6 @@ export function resetScreenTrackerForTests() {
|
|
|
113
136
|
currentLocation = null;
|
|
114
137
|
currentKey = null;
|
|
115
138
|
pendingLocation = null;
|
|
139
|
+
screenListeners.clear();
|
|
116
140
|
}
|
|
117
141
|
//# sourceMappingURL=screenTracker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SCREEN_VIEWED_EVENT","enabled","currentKey","currentLocation","pendingLocation","reporter","locationKey","location","path","screen","screenViewedAttributes","
|
|
1
|
+
{"version":3,"names":["SCREEN_VIEWED_EVENT","enabled","currentKey","currentLocation","pendingLocation","reporter","screenListeners","Set","locationKey","location","path","screen","screenViewedAttributes","screenName","screen_name","setScreenChangeReporter","next","subscribeScreenLocation","listener","add","current","getCurrentScreenLocation","delete","report","enableScreenTracking","disableScreenTracking","handleScreenChange","options","force","reportCurrentScreen","resetScreenTrackerForTests","clear"],"sourceRoot":"../../src","sources":["screenTracker.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,mBAAmB,GAAG,eAAe;;AAElD;;AAQA,IAAIC,OAAO,GAAG,KAAK;AACnB,IAAIC,UAAyB,GAAG,IAAI;AACpC;AACA,IAAIC,eAA4C,GAAG,IAAI;AACvD;AACA,IAAIC,eAA4C,GAAG,IAAI;AACvD,IAAIC,QAAqC,GAAG,IAAI;AAChD,MAAMC,eAAe,GAAG,IAAIC,GAAG,CAAuB,CAAC;AAEvD,SAASC,WAAWA,CAACC,QAA8B,EAAU;EAC3D,OAAO,MAAM,IAAIA,QAAQ,GAAG,QAAQA,QAAQ,CAACC,IAAI,EAAE,GAAG,UAAUD,QAAQ,CAACE,MAAM,EAAE;AACnF;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CACpCH,QAA8B,EACE;EAChC,MAAMI,UAAU,GAAG,MAAM,IAAIJ,QAAQ,GAAGA,QAAQ,CAACC,IAAI,GAAGD,QAAQ,CAACE,MAAM;EACvE,IAAI,CAACE,UAAU,EAAE,OAAO,IAAI;EAC5B,OAAO;IAAEC,WAAW,EAAED;EAAW,CAAC;AACpC;;AAEA;AACA;AACA;AACA;A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AAe,GAAG,IAAI;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,kBAAkBA,CAChCjB,QAA0C,EAC1CkB,OAAmC,EAC7B;EACN,IAAI,CAAClB,QAAQ,EAAE;EACf,IAAI,MAAM,IAAIA,QAAQ,EAAE;IACtB,IAAI,CAACA,QAAQ,CAACC,IAAI,EAAE;EACtB,CAAC,MAAM,IAAI,CAACD,QAAQ,CAACE,MAAM,EAAE;IAC3B;EACF;EAEA,IAAI,CAACV,OAAO,EAAE;IACZG,eAAe,GAAGK,QAAQ;IAC1B;EACF;EAEA,IAAI,CAACkB,OAAO,EAAEC,KAAK,IAAIpB,WAAW,CAACC,QAAQ,CAAC,KAAKP,UAAU,EAAE;EAC7DE,eAAe,GAAG,IAAI;EACtBmB,MAAM,CAACd,QAAQ,CAAC;AAClB;;AAEA;AACA,OAAO,SAASoB,mBAAmBA,CAAA,EAAS;EAC1C,MAAMpB,QAAQ,GAAGY,wBAAwB,CAAC,CAAC;EAC3C,IAAI,CAACZ,QAAQ,EAAE;EACfiB,kBAAkB,CAACjB,QAAQ,EAAE;IAAEmB,KAAK,EAAE;EAAK,CAAC,CAAC;AAC/C;;AAEA;AACA,OAAO,SAASE,0BAA0BA,CAAA,EAAS;EACjD7B,OAAO,GAAG,KAAK;EACfE,eAAe,GAAG,IAAI;EACtBD,UAAU,GAAG,IAAI;EACjBE,eAAe,GAAG,IAAI;EACtBE,eAAe,CAACyB,KAAK,CAAC,CAAC;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { genSessionDataLookup } from '@userflow-tech/core';
|
|
4
|
+
import { BannerEmbedMode, EndFlowReasonInput } from '@userflow-tech/protocol';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { Animated, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
7
|
+
import { BannerStepButton } from "../content/BannerStepButton.js";
|
|
8
|
+
import { RichContentRenderer } from "../content/RichContentRenderer.js";
|
|
9
|
+
import { mixThemeColors } from "../content/themeColor.js";
|
|
10
|
+
import { BANNER_CLOSE_SLOT_SIZE, BANNER_ROOT_PADDING, bannerFrameStyle, bannerInnerStyle, resolveBannerBarBorderRadius } from "./bannerBarLayout.js";
|
|
11
|
+
import { BANNER_BUTTON_GAP, BANNER_CLOSE_BORDER_RADIUS, bannerOverlayShadowStyle } from "./bannerBarTokens.js";
|
|
12
|
+
import { resolveBannerBackgroundColor, resolveBannerForegroundColor } from "./resolveBannerTheme.js";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
/**
|
|
15
|
+
* Banner chrome. An overlay parent floats this over the host. A flow parent
|
|
16
|
+
* keeps it in layout so the app is pushed instead of covered.
|
|
17
|
+
*/
|
|
18
|
+
export function BannerBar({
|
|
19
|
+
session,
|
|
20
|
+
onActions,
|
|
21
|
+
onDismiss
|
|
22
|
+
}) {
|
|
23
|
+
const banner = session.version.banner;
|
|
24
|
+
const theme = session.version.theme;
|
|
25
|
+
const backgroundColor = resolveBannerBackgroundColor(theme);
|
|
26
|
+
const foregroundColor = resolveBannerForegroundColor(theme);
|
|
27
|
+
const bannerTheme = React.useMemo(() => ({
|
|
28
|
+
...theme,
|
|
29
|
+
backgroundColor,
|
|
30
|
+
fontColor: foregroundColor
|
|
31
|
+
}), [theme, backgroundColor, foregroundColor]);
|
|
32
|
+
const lookupAttribute = React.useMemo(() => genSessionDataLookup(session.data), [session.data]);
|
|
33
|
+
const opacity = React.useRef(new Animated.Value(banner?.animate ? 0 : 1)).current;
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (!banner?.animate) {
|
|
36
|
+
opacity.setValue(1);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
opacity.setValue(0);
|
|
40
|
+
const animation = Animated.timing(opacity, {
|
|
41
|
+
toValue: 1,
|
|
42
|
+
duration: 200,
|
|
43
|
+
useNativeDriver: true
|
|
44
|
+
});
|
|
45
|
+
animation.start();
|
|
46
|
+
return () => {
|
|
47
|
+
animation.stop();
|
|
48
|
+
};
|
|
49
|
+
}, [banner?.animate, opacity, session.id]);
|
|
50
|
+
if (!banner) return null;
|
|
51
|
+
const overlay = banner.overlay !== false;
|
|
52
|
+
const frameStyle = bannerFrameStyle(banner);
|
|
53
|
+
const innerStyle = bannerInnerStyle(banner);
|
|
54
|
+
const closePressedBackground = mixThemeColors(backgroundColor, foregroundColor, 0.12);
|
|
55
|
+
const overlayEdge = banner.embedMode === BannerEmbedMode.BODY_LAST ? 'bottom' : 'top';
|
|
56
|
+
const barRadius = resolveBannerBarBorderRadius(banner);
|
|
57
|
+
return /*#__PURE__*/_jsx(View, {
|
|
58
|
+
testID: "userflow-banner-frame",
|
|
59
|
+
style: frameStyle,
|
|
60
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
61
|
+
style: [{
|
|
62
|
+
opacity
|
|
63
|
+
}, overlay ? bannerOverlayShadowStyle(overlayEdge) : null],
|
|
64
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
65
|
+
testID: "userflow-banner",
|
|
66
|
+
style: [styles.root, {
|
|
67
|
+
backgroundColor
|
|
68
|
+
}, barRadius != null ? {
|
|
69
|
+
borderRadius: barRadius,
|
|
70
|
+
overflow: 'hidden'
|
|
71
|
+
} : null],
|
|
72
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
73
|
+
style: styles.startSpacer
|
|
74
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
75
|
+
style: innerStyle,
|
|
76
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
77
|
+
style: styles.content,
|
|
78
|
+
children: /*#__PURE__*/_jsx(RichContentRenderer, {
|
|
79
|
+
content: banner.content,
|
|
80
|
+
buttons: [],
|
|
81
|
+
theme: bannerTheme,
|
|
82
|
+
sessionData: session.data,
|
|
83
|
+
lookupAttribute: lookupAttribute,
|
|
84
|
+
onActions: onActions
|
|
85
|
+
})
|
|
86
|
+
}), banner.buttons.length > 0 ? /*#__PURE__*/_jsx(View, {
|
|
87
|
+
style: styles.buttons,
|
|
88
|
+
children: banner.buttons.map(button => /*#__PURE__*/_jsx(BannerStepButton, {
|
|
89
|
+
button: button,
|
|
90
|
+
theme: bannerTheme,
|
|
91
|
+
sessionData: session.data,
|
|
92
|
+
onActions: onActions
|
|
93
|
+
}, button.id))
|
|
94
|
+
}) : null]
|
|
95
|
+
}), session.version.closeDisabled ? /*#__PURE__*/_jsx(View, {
|
|
96
|
+
style: styles.startSpacer
|
|
97
|
+
}) : /*#__PURE__*/_jsx(Pressable, {
|
|
98
|
+
testID: "userflow-banner-dismiss",
|
|
99
|
+
accessibilityRole: "button",
|
|
100
|
+
accessibilityLabel: "Dismiss",
|
|
101
|
+
hitSlop: 8,
|
|
102
|
+
onPress: () => onDismiss(EndFlowReasonInput.USER_CLOSED),
|
|
103
|
+
style: ({
|
|
104
|
+
pressed
|
|
105
|
+
}) => [styles.close, pressed ? {
|
|
106
|
+
backgroundColor: closePressedBackground
|
|
107
|
+
} : null],
|
|
108
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
109
|
+
style: [styles.dismissIcon, {
|
|
110
|
+
color: foregroundColor
|
|
111
|
+
}],
|
|
112
|
+
children: "\xD7"
|
|
113
|
+
})
|
|
114
|
+
})]
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const styles = StyleSheet.create({
|
|
120
|
+
root: {
|
|
121
|
+
flexDirection: 'row',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
padding: BANNER_ROOT_PADDING
|
|
124
|
+
},
|
|
125
|
+
startSpacer: {
|
|
126
|
+
flexGrow: 1,
|
|
127
|
+
flexShrink: 1,
|
|
128
|
+
maxWidth: BANNER_CLOSE_SLOT_SIZE,
|
|
129
|
+
height: BANNER_CLOSE_SLOT_SIZE
|
|
130
|
+
},
|
|
131
|
+
content: {
|
|
132
|
+
flexShrink: 1,
|
|
133
|
+
minWidth: 0
|
|
134
|
+
},
|
|
135
|
+
buttons: {
|
|
136
|
+
flexDirection: 'row',
|
|
137
|
+
flexWrap: 'nowrap',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
gap: BANNER_BUTTON_GAP
|
|
140
|
+
},
|
|
141
|
+
close: {
|
|
142
|
+
width: BANNER_CLOSE_SLOT_SIZE,
|
|
143
|
+
height: BANNER_CLOSE_SLOT_SIZE,
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
justifyContent: 'center',
|
|
146
|
+
flexShrink: 0,
|
|
147
|
+
borderRadius: BANNER_CLOSE_BORDER_RADIUS
|
|
148
|
+
},
|
|
149
|
+
dismissIcon: {
|
|
150
|
+
fontSize: 18,
|
|
151
|
+
lineHeight: 22,
|
|
152
|
+
fontWeight: '300'
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=BannerBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["genSessionDataLookup","BannerEmbedMode","EndFlowReasonInput","React","Animated","Pressable","StyleSheet","Text","View","BannerStepButton","RichContentRenderer","mixThemeColors","BANNER_CLOSE_SLOT_SIZE","BANNER_ROOT_PADDING","bannerFrameStyle","bannerInnerStyle","resolveBannerBarBorderRadius","BANNER_BUTTON_GAP","BANNER_CLOSE_BORDER_RADIUS","bannerOverlayShadowStyle","resolveBannerBackgroundColor","resolveBannerForegroundColor","jsx","_jsx","jsxs","_jsxs","BannerBar","session","onActions","onDismiss","banner","version","theme","backgroundColor","foregroundColor","bannerTheme","useMemo","fontColor","lookupAttribute","data","opacity","useRef","Value","animate","current","useEffect","setValue","animation","timing","toValue","duration","useNativeDriver","start","stop","id","overlay","frameStyle","innerStyle","closePressedBackground","overlayEdge","embedMode","BODY_LAST","barRadius","testID","style","children","styles","root","borderRadius","overflow","startSpacer","content","buttons","sessionData","length","map","button","closeDisabled","accessibilityRole","accessibilityLabel","hitSlop","onPress","USER_CLOSED","pressed","close","dismissIcon","color","create","flexDirection","alignItems","padding","flexGrow","flexShrink","maxWidth","height","minWidth","flexWrap","gap","width","justifyContent","fontSize","lineHeight","fontWeight"],"sourceRoot":"../../../src","sources":["surfaces/BannerBar.tsx"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,qBAAqB;AAE1D,SACEC,eAAe,EACfC,kBAAkB,QAEb,yBAAyB;AAChC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAE1E,SAASC,gBAAgB,QAAQ,gCAA6B;AAC9D,SAASC,mBAAmB,QAAQ,mCAAgC;AACpE,SAASC,cAAc,QAAQ,0BAAuB;AAEtD,SACEC,sBAAsB,EACtBC,mBAAmB,EACnBC,gBAAgB,EAChBC,gBAAgB,EAChBC,4BAA4B,QACvB,sBAAmB;AAC1B,SACEC,iBAAiB,EACjBC,0BAA0B,EAC1BC,wBAAwB,QACnB,sBAAmB;AAC1B,SAASC,4BAA4B,EAAEC,4BAA4B,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQlG;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAC;EACxBC,OAAO;EACPC,SAAS;EACTC;AACc,CAAC,EAA6B;EAC5C,MAAMC,MAAM,GAAGH,OAAO,CAACI,OAAO,CAACD,MAAM;EACrC,MAAME,KAAK,GAAGL,OAAO,CAACI,OAAO,CAACC,KAAK;EACnC,MAAMC,eAAe,GAAGb,4BAA4B,CAACY,KAAK,CAAC;EAC3D,MAAME,eAAe,GAAGb,4BAA4B,CAACW,KAAK,CAAC;EAC3D,MAAMG,WAAW,GAAGhC,KAAK,CAACiC,OAAO,CAC/B,OAAO;IAAE,GAAGJ,KAAK;IAAEC,eAAe;IAAEI,SAAS,EAA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EAAE,CAAC;IACXC,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAEjF,sBAAsB;IAChCkF,MAAM,EAAElF;EACV,CAAC;EACD2D,OAAO,EAAE;IACPqB,UAAU,EAAE,CAAC;IACbG,QAAQ,EAAE;EACZ,CAAC;EACDvB,OAAO,EAAE;IACPgB,aAAa,EAAE,KAAK;IACpBQ,QAAQ,EAAE,QAAQ;IAClBP,UAAU,EAAE,QAAQ;IACpBQ,GAAG,EAAEhF;EACP,CAAC;EACDmE,KAAK,EAAE;IACLc,KAAK,EAAEtF,sBAAsB;IAC7BkF,MAAM,EAAElF,sBAAsB;IAC9B6E,UAAU,EAAE,QAAQ;IACpBU,cAAc,EAAE,QAAQ;IACxBP,UAAU,EAAE,CAAC;IACbxB,YAAY,EAAElD;EAChB,CAAC;EACDmE,WAAW,EAAE;IACXe,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { evalJsController } from "../evalJs/evalJsController.js";
|
|
5
|
+
import { getEvalJsWebView } from "../evalJs/getWebView.js";
|
|
6
|
+
import { BannerBar } from "./BannerBar.js";
|
|
7
|
+
import { BannerWebViewBar } from "./bannerWebView/BannerWebViewBar.js";
|
|
8
|
+
import { clearBannerAutoRunEvalSession } from "./bannerWebView/bannerAutoRunSession.js";
|
|
9
|
+
import { bannerNeedsWebView } from "./bannerWebView/bannerNeedsWebView.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
let warnedMissingWebView = false;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Native banner bar, or a WebView when a button runs Evaluate JavaScript or the
|
|
15
|
+
* theme has published custom CSS (same CDN stylesheet as userflow.js iframes).
|
|
16
|
+
*/
|
|
17
|
+
export function BannerSurface({
|
|
18
|
+
session,
|
|
19
|
+
onActions,
|
|
20
|
+
onDismiss
|
|
21
|
+
}) {
|
|
22
|
+
const banner = session.version.banner;
|
|
23
|
+
const theme = session.version.theme;
|
|
24
|
+
const needsWebView = banner != null && bannerNeedsWebView(banner, theme);
|
|
25
|
+
const webView = needsWebView ? getEvalJsWebView() : null;
|
|
26
|
+
React.useLayoutEffect(() => {
|
|
27
|
+
if (!needsWebView || !webView) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
evalJsController.setBannerOwnsWebView(true);
|
|
31
|
+
return () => {
|
|
32
|
+
evalJsController.setBannerOwnsWebView(false);
|
|
33
|
+
};
|
|
34
|
+
}, [needsWebView, webView, session.id]);
|
|
35
|
+
const dismissWebViewBanner = React.useCallback(endReason => {
|
|
36
|
+
clearBannerAutoRunEvalSession(session.id);
|
|
37
|
+
evalJsController.reset();
|
|
38
|
+
onDismiss(endReason);
|
|
39
|
+
}, [onDismiss, session.id]);
|
|
40
|
+
if (!banner) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (needsWebView) {
|
|
44
|
+
if (!webView) {
|
|
45
|
+
if (!warnedMissingWebView) {
|
|
46
|
+
warnedMissingWebView = true;
|
|
47
|
+
console.warn('Userflow: WebView banner requires react-native-webview in the native binary. ' + 'Add it to your app (e.g. npx expo install react-native-webview), run pod install under ios/, ' + 'then rebuild with expo run:ios (not Expo Go). Falling back to the native banner bar.');
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/_jsx(BannerBar, {
|
|
50
|
+
session: session,
|
|
51
|
+
onActions: onActions,
|
|
52
|
+
onDismiss: onDismiss
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/_jsx(BannerWebViewBar, {
|
|
56
|
+
session: session,
|
|
57
|
+
onActions: onActions,
|
|
58
|
+
onDismiss: dismissWebViewBanner
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return /*#__PURE__*/_jsx(BannerBar, {
|
|
62
|
+
session: session,
|
|
63
|
+
onActions: onActions,
|
|
64
|
+
onDismiss: onDismiss
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export function resetBannerSurfaceWarningsForTests() {
|
|
70
|
+
warnedMissingWebView = false;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=BannerSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","evalJsController","getEvalJsWebView","BannerBar","BannerWebViewBar","clearBannerAutoRunEvalSession","bannerNeedsWebView","jsx","_jsx","warnedMissingWebView","BannerSurface","session","onActions","onDismiss","banner","version","theme","needsWebView","webView","useLayoutEffect","setBannerOwnsWebView","id","dismissWebViewBanner","useCallback","endReason","reset","console","warn","resetBannerSurfaceWarningsForTests"],"sourceRoot":"../../../src","sources":["surfaces/BannerSurface.tsx"],"mappings":";;AAKA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,gBAAgB,QAAQ,+BAA4B;AAC7D,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,gBAAgB,QAAQ,qCAAkC;AACnE,SAASC,6BAA6B,QAAQ,yCAAsC;AACpF,SAASC,kBAAkB,QAAQ,uCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQxE,IAAIC,oBAAoB,GAAG,KAAK;;AAEhC;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAC;EAC5BC,OAAO;EACPC,SAAS;EACTC;AACkB,CAAC,EAA6B;EAChD,MAAMC,MAAM,GAAGH,OAAO,CAACI,OAAO,CAACD,MAAM;EACrC,MAAME,KAAK,GAAGL,OAAO,CAACI,OAAO,CAACC,KAAK;EACnC,MAAMC,YAAY,GAAGH,MAAM,IAAI,IAAI,IAAIR,kBAAkB,CAACQ,MAAM,EAAEE,KAAK,CAAC;EACxE,MAAME,OAAO,GAA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