@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,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BannerWebViewBar = BannerWebViewBar;
|
|
7
|
+
var _core = require("@userflow-tech/core");
|
|
8
|
+
var _protocol = require("@userflow-tech/protocol");
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
var _bootstrap = require("../../evalJs/bootstrap.js");
|
|
12
|
+
var _bridgeMessages = require("../../evalJs/bridgeMessages.js");
|
|
13
|
+
var _evalJsBridge = require("../../evalJs/evalJsBridge.js");
|
|
14
|
+
var _evalJsController = require("../../evalJs/evalJsController.js");
|
|
15
|
+
var _getWebView = require("../../evalJs/getWebView.js");
|
|
16
|
+
var _injectEvalPending = require("../../evalJs/injectEvalPending.js");
|
|
17
|
+
var _useEvalJsWebViewInjection = require("../../evalJs/useEvalJsWebViewInjection.js");
|
|
18
|
+
var _userflowCore = require("../../runtime/userflowCore.js");
|
|
19
|
+
var _screenTracker = require("../../screenTracker.js");
|
|
20
|
+
var _bannerBarLayout = require("../bannerBarLayout.js");
|
|
21
|
+
var _bannerBarTokens = require("../bannerBarTokens.js");
|
|
22
|
+
var _safeArea = require("../safeArea.js");
|
|
23
|
+
var _bannerAutoRunEvalJs = require("./bannerAutoRunEvalJs.js");
|
|
24
|
+
var _bannerAutoRunSession = require("./bannerAutoRunSession.js");
|
|
25
|
+
var _buildCustomBannerHtml = require("./buildCustomBannerHtml.js");
|
|
26
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
28
|
+
function screenFromLocation(location) {
|
|
29
|
+
if (!location) {
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
if ('path' in location) {
|
|
33
|
+
return location.path ? {
|
|
34
|
+
path: location.path
|
|
35
|
+
} : {};
|
|
36
|
+
}
|
|
37
|
+
return location.screen ? {
|
|
38
|
+
name: location.screen
|
|
39
|
+
} : {};
|
|
40
|
+
}
|
|
41
|
+
function useEvalJsScreen() {
|
|
42
|
+
const [screen, setScreen] = React.useState(() => screenFromLocation((0, _screenTracker.getCurrentScreenLocation)()));
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
return (0, _screenTracker.subscribeScreenLocation)(location => {
|
|
45
|
+
setScreen(screenFromLocation(location));
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
return screen;
|
|
49
|
+
}
|
|
50
|
+
function BannerWebViewBar({
|
|
51
|
+
session,
|
|
52
|
+
onActions,
|
|
53
|
+
onDismiss
|
|
54
|
+
}) {
|
|
55
|
+
const banner = session.version.banner;
|
|
56
|
+
const WebView = (0, _getWebView.getEvalJsWebView)();
|
|
57
|
+
const webRef = React.useRef(null);
|
|
58
|
+
const [pageReady, setPageReady] = React.useState(false);
|
|
59
|
+
const [contentHeight, setContentHeight] = React.useState(56);
|
|
60
|
+
const colorScheme = (0, _reactNative.useColorScheme)();
|
|
61
|
+
const viewport = (0, _reactNative.useWindowDimensions)();
|
|
62
|
+
const insets = (0, _safeArea.useUserflowSafeAreaInsets)();
|
|
63
|
+
const screen = useEvalJsScreen();
|
|
64
|
+
const lookupAttribute = React.useMemo(() => (0, _core.genSessionDataLookup)(session.data), [session.data]);
|
|
65
|
+
const evalSnapshot = React.useSyncExternalStore(_evalJsController.evalJsController.subscribe, _evalJsController.evalJsController.getSnapshot, _evalJsController.evalJsController.getSnapshot);
|
|
66
|
+
const host = evalSnapshot.host;
|
|
67
|
+
const context = React.useMemo(() => ({
|
|
68
|
+
platform: _reactNative.Platform.OS,
|
|
69
|
+
colorScheme: colorScheme === 'dark' ? 'dark' : 'light',
|
|
70
|
+
safeAreaInsets: insets,
|
|
71
|
+
viewport: {
|
|
72
|
+
width: viewport.width,
|
|
73
|
+
height: viewport.height
|
|
74
|
+
},
|
|
75
|
+
screen,
|
|
76
|
+
host
|
|
77
|
+
}), [colorScheme, host, insets, screen, viewport.height, viewport.width]);
|
|
78
|
+
const serverEndpoint = (0, _userflowCore.getUserflowCore)().getServerEndpoint() ?? _core.DEFAULT_SERVER_ENDPOINT;
|
|
79
|
+
const skipAutoRunEval = (0, _bannerAutoRunSession.shouldSkipBannerAutoRunEval)(session.id);
|
|
80
|
+
const initialContext = React.useRef(context);
|
|
81
|
+
const html = React.useMemo(() => {
|
|
82
|
+
const body = (0, _buildCustomBannerHtml.buildCustomBannerBodyHtml)(session, lookupAttribute, serverEndpoint, {
|
|
83
|
+
skipAutoRunEval
|
|
84
|
+
});
|
|
85
|
+
return (0, _bootstrap.buildBootstrapHtml)(initialContext.current, body);
|
|
86
|
+
}, [lookupAttribute, serverEndpoint, session, skipAutoRunEval]);
|
|
87
|
+
const opacity = React.useRef(new _reactNative.Animated.Value(banner?.animate ? 0 : 1)).current;
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (!banner?.animate) {
|
|
90
|
+
opacity.setValue(1);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
opacity.setValue(0);
|
|
94
|
+
const animation = _reactNative.Animated.timing(opacity, {
|
|
95
|
+
toValue: 1,
|
|
96
|
+
duration: 200,
|
|
97
|
+
useNativeDriver: true
|
|
98
|
+
});
|
|
99
|
+
animation.start();
|
|
100
|
+
return () => {
|
|
101
|
+
animation.stop();
|
|
102
|
+
};
|
|
103
|
+
}, [banner?.animate, opacity, session.id]);
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
setPageReady(false);
|
|
106
|
+
setContentHeight(56);
|
|
107
|
+
}, [session.id, html]);
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
if (!pageReady || skipAutoRunEval || !banner) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if ((0, _bannerAutoRunEvalJs.collectBannerAutoRunEvalCodes)(banner, lookupAttribute).length === 0) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
(0, _bannerAutoRunSession.markBannerAutoRunEvalComplete)(session.id);
|
|
116
|
+
}, [banner, lookupAttribute, pageReady, session.id, skipAutoRunEval]);
|
|
117
|
+
(0, _useEvalJsWebViewInjection.useEvalJsWebViewInjection)(webRef, {
|
|
118
|
+
pageReady,
|
|
119
|
+
context,
|
|
120
|
+
pendingCount: evalSnapshot.pendingCount
|
|
121
|
+
});
|
|
122
|
+
const openExternal = React.useCallback(url => {
|
|
123
|
+
if (!url || (0, _bootstrap.isBootstrapUrl)(url)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
(0, _evalJsBridge.getEvalJsBridgeHandlers)().openUrl(url);
|
|
127
|
+
}, []);
|
|
128
|
+
const onMessage = React.useCallback(event => {
|
|
129
|
+
let parsed = event.nativeEvent.data;
|
|
130
|
+
if (typeof parsed === 'string') {
|
|
131
|
+
try {
|
|
132
|
+
parsed = JSON.parse(parsed);
|
|
133
|
+
} catch {
|
|
134
|
+
parsed = null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (parsed != null && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
138
|
+
const record = parsed;
|
|
139
|
+
if (record.__userflow === 1 && record.type === 'bannerLayout') {
|
|
140
|
+
const height = record.height;
|
|
141
|
+
if (typeof height === 'number' && height > 0) {
|
|
142
|
+
const maxHeight = Math.floor(viewport.height * 0.92);
|
|
143
|
+
const next = Math.min(Math.ceil(height), maxHeight);
|
|
144
|
+
setContentHeight(prev => Math.abs(next - prev) <= 1 ? prev : next);
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (record.__userflow === 1 && record.type === 'bannerButton') {
|
|
149
|
+
const buttonId = record.buttonId;
|
|
150
|
+
if (typeof buttonId === 'string' && banner) {
|
|
151
|
+
const button = banner.buttons.find(entry => entry.id === buttonId);
|
|
152
|
+
if (button) {
|
|
153
|
+
void Promise.resolve(onActions(button.actions)).then(() => {
|
|
154
|
+
(0, _injectEvalPending.injectEvalPendingIntoWebView)(webRef.current);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (record.__userflow === 1 && record.type === 'bannerDismiss') {
|
|
161
|
+
webRef.current?.injectJavaScript('window.__userflowBannerEvalDismissed=true;true;');
|
|
162
|
+
onDismiss(_protocol.EndFlowReasonInput.USER_CLOSED);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const message = (0, _bridgeMessages.parseBridgeMessage)(event.nativeEvent.data);
|
|
167
|
+
if (!message) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const bridge = (0, _evalJsBridge.getEvalJsBridgeHandlers)();
|
|
171
|
+
switch (message.type) {
|
|
172
|
+
case 'ready':
|
|
173
|
+
setPageReady(true);
|
|
174
|
+
webRef.current?.injectJavaScript('window.__userflowBannerLayout&&window.__userflowBannerLayout();true;');
|
|
175
|
+
return;
|
|
176
|
+
case 'close':
|
|
177
|
+
webRef.current?.injectJavaScript('window.__userflowBannerEvalDismissed=true;true;');
|
|
178
|
+
onDismiss(_protocol.EndFlowReasonInput.USER_CLOSED);
|
|
179
|
+
return;
|
|
180
|
+
case 'endFlow':
|
|
181
|
+
webRef.current?.injectJavaScript('window.__userflowBannerEvalDismissed=true;true;');
|
|
182
|
+
onDismiss(_protocol.EndFlowReasonInput.USER_CLOSED);
|
|
183
|
+
return;
|
|
184
|
+
case 'setLayout':
|
|
185
|
+
_evalJsController.evalJsController.setLayout(message.layout);
|
|
186
|
+
return;
|
|
187
|
+
case 'track':
|
|
188
|
+
bridge.track(message.name, message.attributes);
|
|
189
|
+
return;
|
|
190
|
+
case 'updateUser':
|
|
191
|
+
bridge.updateUser(message.attributes);
|
|
192
|
+
return;
|
|
193
|
+
case 'updateGroup':
|
|
194
|
+
bridge.updateGroup(message.attributes, message.options);
|
|
195
|
+
return;
|
|
196
|
+
case 'openUrl':
|
|
197
|
+
bridge.openUrl(message.url);
|
|
198
|
+
return;
|
|
199
|
+
case 'error':
|
|
200
|
+
bridge.warn((0, _evalJsBridge.formatEvalJsError)(message.message, message.code));
|
|
201
|
+
return;
|
|
202
|
+
default:
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
}, [banner, onActions, onDismiss, viewport.height]);
|
|
206
|
+
if (!banner || !WebView) {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
const overlay = banner.overlay !== false;
|
|
210
|
+
const frameStyle = (0, _bannerBarLayout.bannerFrameStyle)(banner);
|
|
211
|
+
const innerStyle = (0, _bannerBarLayout.bannerInnerStyle)(banner);
|
|
212
|
+
const overlayEdge = banner.embedMode === _protocol.BannerEmbedMode.BODY_LAST ? 'bottom' : 'top';
|
|
213
|
+
const barRadius = (0, _bannerBarLayout.resolveBannerBarBorderRadius)(banner);
|
|
214
|
+
const webStyle = {
|
|
215
|
+
width: '100%',
|
|
216
|
+
height: contentHeight,
|
|
217
|
+
backgroundColor: 'transparent'
|
|
218
|
+
};
|
|
219
|
+
const debugging = typeof __DEV__ !== 'undefined' && __DEV__ ? true : undefined;
|
|
220
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
221
|
+
testID: "userflow-banner-frame",
|
|
222
|
+
style: frameStyle,
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
224
|
+
style: [{
|
|
225
|
+
opacity
|
|
226
|
+
}, overlay ? (0, _bannerBarTokens.bannerOverlayShadowStyle)(overlayEdge) : null],
|
|
227
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
228
|
+
testID: "userflow-banner-webview",
|
|
229
|
+
style: [{
|
|
230
|
+
borderRadius: barRadius ?? 0,
|
|
231
|
+
overflow: 'hidden'
|
|
232
|
+
}, innerStyle.maxWidth != null ? {
|
|
233
|
+
maxWidth: innerStyle.maxWidth
|
|
234
|
+
} : null],
|
|
235
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(WebView, {
|
|
236
|
+
ref: webRef,
|
|
237
|
+
source: {
|
|
238
|
+
html,
|
|
239
|
+
baseUrl: _bootstrap.EVAL_JS_BASE_URL
|
|
240
|
+
},
|
|
241
|
+
style: webStyle,
|
|
242
|
+
javaScriptEnabled: true,
|
|
243
|
+
domStorageEnabled: true,
|
|
244
|
+
scrollEnabled: false,
|
|
245
|
+
bounces: false,
|
|
246
|
+
showsHorizontalScrollIndicator: false,
|
|
247
|
+
showsVerticalScrollIndicator: false,
|
|
248
|
+
originWhitelist: ['*'],
|
|
249
|
+
setSupportMultipleWindows: false,
|
|
250
|
+
androidLayerType: "hardware",
|
|
251
|
+
...(debugging !== undefined ? {
|
|
252
|
+
webviewDebuggingEnabled: debugging
|
|
253
|
+
} : {}),
|
|
254
|
+
onMessage: onMessage,
|
|
255
|
+
onLoadEnd: () => {
|
|
256
|
+
setPageReady(true);
|
|
257
|
+
webRef.current?.injectJavaScript('window.__userflowBannerLayout&&window.__userflowBannerLayout();true;');
|
|
258
|
+
},
|
|
259
|
+
onShouldStartLoadWithRequest: request => {
|
|
260
|
+
if ((0, _bootstrap.isBootstrapUrl)(request.url)) {
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
openExternal(request.url);
|
|
264
|
+
return false;
|
|
265
|
+
},
|
|
266
|
+
onOpenWindow: event => {
|
|
267
|
+
const url = event.nativeEvent.targetUrl;
|
|
268
|
+
if (url) {
|
|
269
|
+
openExternal(url);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
})
|
|
274
|
+
})
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=BannerWebViewBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_protocol","React","_interopRequireWildcard","_reactNative","_bootstrap","_bridgeMessages","_evalJsBridge","_evalJsController","_getWebView","_injectEvalPending","_useEvalJsWebViewInjection","_userflowCore","_screenTracker","_bannerBarLayout","_bannerBarTokens","_safeArea","_bannerAutoRunEvalJs","_bannerAutoRunSession","_buildCustomBannerHtml","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","screenFromLocation","location","path","screen","name","useEvalJsScreen","setScreen","useState","getCurrentScreenLocation","useEffect","subscribeScreenLocation","BannerWebViewBar","session","onActions","onDismiss","banner","version","WebView","getEvalJsWebView","webRef","useRef","pageReady","setPageReady","contentHeight","setContentHeight","colorScheme","useColorScheme","viewport","useWindowDimensions","insets","useUserflowSafeAreaInsets","lookupAttribute","useMemo","genSessionDataLookup","data","evalSnapshot","useSyncExternalStore","evalJsController","subscribe","getSnapshot","host","context","platform","Platform","OS","safeAreaInsets","width","height","serverEndpoint","getUserflowCore","getServerEndpoint","DEFAULT_SERVER_ENDPOINT","skipAutoRunEval","shouldSkipBannerAutoRunEval","id","initialContext","html","body","buildCustomBannerBodyHtml","buildBootstrapHtml","current","opacity","Animated","Value","animate","setValue","animation","timing","toValue","duration","useNativeDriver","start","stop","collectBannerAutoRunEvalCodes","length","markBannerAutoRunEvalComplete","useEvalJsWebViewInjection","pendingCount","openExternal","useCallback","url","isBootstrapUrl","getEvalJsBridgeHandlers","openUrl","onMessage","event","parsed","nativeEvent","JSON","parse","Array","isArray","record","__userflow","type","maxHeight","Math","floor","next","min","ceil","prev","abs","buttonId","button","buttons","find","entry","Promise","resolve","actions","then","injectEvalPendingIntoWebView","injectJavaScript","EndFlowReasonInput","USER_CLOSED","message","parseBridgeMessage","bridge","setLayout","layout","track","attributes","updateUser","updateGroup","options","warn","formatEvalJsError","code","overlay","frameStyle","bannerFrameStyle","innerStyle","bannerInnerStyle","overlayEdge","embedMode","BannerEmbedMode","BODY_LAST","barRadius","resolveBannerBarBorderRadius","webStyle","backgroundColor","debugging","__DEV__","undefined","jsx","View","testID","style","children","bannerOverlayShadowStyle","borderRadius","overflow","maxWidth","ref","source","baseUrl","EVAL_JS_BASE_URL","javaScriptEnabled","domStorageEnabled","scrollEnabled","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","originWhitelist","setSupportMultipleWindows","androidLayerType","webviewDebuggingEnabled","onLoadEnd","onShouldStartLoadWithRequest","request","onOpenWindow","targetUrl"],"sourceRoot":"../../../../src","sources":["surfaces/bannerWebView/BannerWebViewBar.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AASA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO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AK,CAACE,WAAW,CAACqF,SAAS;YACvC,IAAI5F,GAAG,EAAE;cACPF,YAAY,CAACE,GAAG,CAAC;YACnB;UACF;QAAE,CACH;MAAC,CACE;IAAC,CACM;EAAC,CACZ,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.collectBannerAutoRunEvalCodes = collectBannerAutoRunEvalCodes;
|
|
7
|
+
var _core = require("@userflow-tech/core");
|
|
8
|
+
var _protocol = require("@userflow-tech/protocol");
|
|
9
|
+
function buttonIsEvalJsOnly(button) {
|
|
10
|
+
const actions = button.actions.filter(action => action.type != null);
|
|
11
|
+
if (actions.length === 0) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return actions.every(action => action.type === _protocol.FlowActionType.EVAL_JS);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Evaluate JavaScript bodies from buttons whose **only** actions are EVAL_JS.
|
|
19
|
+
* Auto-run once when the WebView loads; click still runs the button action list.
|
|
20
|
+
*/
|
|
21
|
+
function collectBannerAutoRunEvalCodes(banner, lookupAttribute) {
|
|
22
|
+
const codes = [];
|
|
23
|
+
const seen = new Set();
|
|
24
|
+
for (const button of banner.buttons) {
|
|
25
|
+
if (!buttonIsEvalJsOnly(button)) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
for (const action of button.actions) {
|
|
29
|
+
if (action.type !== _protocol.FlowActionType.EVAL_JS) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const raw = action.code ?? '';
|
|
33
|
+
if (!raw.trim()) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const code = (0, _core.interpolateVariables)(raw, lookupAttribute);
|
|
37
|
+
if (seen.has(code)) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
seen.add(code);
|
|
41
|
+
codes.push(code);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return codes;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=bannerAutoRunEvalJs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_protocol","buttonIsEvalJsOnly","button","actions","filter","action","type","length","every","FlowActionType","EVAL_JS","collectBannerAutoRunEvalCodes","banner","lookupAttribute","codes","seen","Set","buttons","raw","code","trim","interpolateVariables","has","add","push"],"sourceRoot":"../../../../src","sources":["surfaces/bannerWebView/bannerAutoRunEvalJs.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAEA,SAASE,kBAAkBA,CAACC,MAAyC,EAAW;EAC9E,MAAMC,OAAO,GAAGD,MAAM,CAACC,OAAO,CAACC,MAAM,CAAEC,MAAM,IAAKA,MAAM,CAACC,IAAI,IAAI,IAAI,CAAC;EACtE,IAAIH,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE;IACxB,OAAO,KAAK;EACd;EACA,OAAOJ,OAAO,CAACK,KAAK,CAAEH,MAAM,IAAKA,MAAM,CAACC,IAAI,KAAKG,wBAAc,CAACC,OAAO,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACO,SAASC,6BAA6BA,CAC3CC,MAAsB,EACtBC,eAA+C,EACrC;EACV,MAAMC,KAAe,GAAG,EAAE;EAC1B,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;EAC9B,KAAK,MAAMd,MAAM,IAAIU,MAAM,CAACK,OAAO,EAAE;IACnC,IAAI,CAAChB,kBAAkB,CAACC,MAAM,CAAC,EAAE;MAC/B;IACF;IACA,KAAK,MAAMG,MAAM,IAAIH,MAAM,CAACC,OAAO,EAAE;MACnC,IAAIE,MAAM,CAACC,IAAI,KAAKG,wBAAc,CAACC,OAAO,EAAE;QAC1C;MACF;MACA,MAAMQ,GAAG,GAAGb,MAAM,CAACc,IAAI,IAAI,EAAE;MAC7B,IAAI,CAACD,GAAG,CAACE,IAAI,CAAC,CAAC,EAAE;QACf;MACF;MACA,MAAMD,IAAI,GAAG,IAAAE,0BAAoB,EAACH,GAAG,EAAEL,eAAe,CAAC;MACvD,IAAIE,IAAI,CAACO,GAAG,CAACH,IAAI,CAAC,EAAE;QAClB;MACF;MACAJ,IAAI,CAACQ,GAAG,CAACJ,IAAI,CAAC;MACdL,KAAK,CAACU,IAAI,CAACL,IAAI,CAAC;IAClB;EACF;EACA,OAAOL,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearBannerAutoRunEvalSession = clearBannerAutoRunEvalSession;
|
|
7
|
+
exports.markBannerAutoRunEvalComplete = markBannerAutoRunEvalComplete;
|
|
8
|
+
exports.resetBannerAutoRunSessionsForTests = resetBannerAutoRunSessionsForTests;
|
|
9
|
+
exports.shouldSkipBannerAutoRunEval = shouldSkipBannerAutoRunEval;
|
|
10
|
+
/** Banner session ids whose eval-only auto-run already ran (survives temporary WebView unmount). */
|
|
11
|
+
const autoRunCompletedSessionIds = new Set();
|
|
12
|
+
function shouldSkipBannerAutoRunEval(sessionId) {
|
|
13
|
+
return autoRunCompletedSessionIds.has(sessionId);
|
|
14
|
+
}
|
|
15
|
+
function markBannerAutoRunEvalComplete(sessionId) {
|
|
16
|
+
autoRunCompletedSessionIds.add(sessionId);
|
|
17
|
+
}
|
|
18
|
+
function clearBannerAutoRunEvalSession(sessionId) {
|
|
19
|
+
autoRunCompletedSessionIds.delete(sessionId);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
function resetBannerAutoRunSessionsForTests() {
|
|
24
|
+
autoRunCompletedSessionIds.clear();
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=bannerAutoRunSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["autoRunCompletedSessionIds","Set","shouldSkipBannerAutoRunEval","sessionId","has","markBannerAutoRunEvalComplete","add","clearBannerAutoRunEvalSession","delete","resetBannerAutoRunSessionsForTests","clear"],"sourceRoot":"../../../../src","sources":["surfaces/bannerWebView/bannerAutoRunSession.ts"],"mappings":";;;;;;;;;AAAA;AACA,MAAMA,0BAA0B,GAAG,IAAIC,GAAG,CAAS,CAAC;AAE7C,SAASC,2BAA2BA,CAACC,SAAiB,EAAW;EACtE,OAAOH,0BAA0B,CAACI,GAAG,CAACD,SAAS,CAAC;AAClD;AAEO,SAASE,6BAA6BA,CAACF,SAAiB,EAAQ;EACrEH,0BAA0B,CAACM,GAAG,CAACH,SAAS,CAAC;AAC3C;AAEO,SAASI,6BAA6BA,CAACJ,SAAiB,EAAQ;EACrEH,0BAA0B,CAACQ,MAAM,CAACL,SAAS,CAAC;AAC9C;;AAEA;AACO,SAASM,kCAAkCA,CAAA,EAAS;EACzDT,0BAA0B,CAACU,KAAK,CAAC,CAAC;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bannerNeedsWebView = bannerNeedsWebView;
|
|
7
|
+
exports.resetDebugForceWebViewBannerForTests = resetDebugForceWebViewBannerForTests;
|
|
8
|
+
exports.setDebugForceWebViewBanner = setDebugForceWebViewBanner;
|
|
9
|
+
var _protocol = require("@userflow-tech/protocol");
|
|
10
|
+
var _resolveCdnHost = require("./resolveCdnHost.js");
|
|
11
|
+
let debugForceWebViewBanner = false;
|
|
12
|
+
|
|
13
|
+
/** POC / local testing when the builder flag is not on the wire yet. */
|
|
14
|
+
function setDebugForceWebViewBanner(enabled) {
|
|
15
|
+
debugForceWebViewBanner = enabled;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
function resetDebugForceWebViewBannerForTests() {
|
|
20
|
+
debugForceWebViewBanner = false;
|
|
21
|
+
}
|
|
22
|
+
function bannerHasEvalJsAction(banner) {
|
|
23
|
+
return banner.buttons.some(button => button.actions.some(action => action.type === _protocol.FlowActionType.EVAL_JS));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Use the WebView banner renderer when any button runs Evaluate JavaScript
|
|
28
|
+
* (needs the shared eval page), when the theme has published custom CSS
|
|
29
|
+
* (`.userflow-custom-container-*` / `.userflow-custom-button-*` via CDN),
|
|
30
|
+
* or when {@link setDebugForceWebViewBanner} is true.
|
|
31
|
+
*/
|
|
32
|
+
function bannerNeedsWebView(banner, theme) {
|
|
33
|
+
if (debugForceWebViewBanner) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (theme != null && (0, _resolveCdnHost.themeHasPublishedCustomCss)(theme)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return bannerHasEvalJsAction(banner);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=bannerNeedsWebView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_protocol","require","_resolveCdnHost","debugForceWebViewBanner","setDebugForceWebViewBanner","enabled","resetDebugForceWebViewBannerForTests","bannerHasEvalJsAction","banner","buttons","some","button","actions","action","type","FlowActionType","EVAL_JS","bannerNeedsWebView","theme","themeHasPublishedCustomCss"],"sourceRoot":"../../../../src","sources":["surfaces/bannerWebView/bannerNeedsWebView.ts"],"mappings":";;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAIE,uBAAuB,GAAG,KAAK;;AAEnC;AACO,SAASC,0BAA0BA,CAACC,OAAgB,EAAQ;EACjEF,uBAAuB,GAAGE,OAAO;AACnC;;AAEA;AACO,SAASC,oCAAoCA,CAAA,EAAS;EAC3DH,uBAAuB,GAAG,KAAK;AACjC;AAEA,SAASI,qBAAqBA,CAACC,MAAsB,EAAW;EAC9D,OAAOA,MAAM,CAACC,OAAO,CAACC,IAAI,CAAEC,MAAM,IAChCA,MAAM,CAACC,OAAO,CAACF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,IAAI,KAAKC,wBAAc,CAACC,OAAO,CACxE,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACT,MAAsB,EAAEU,KAA4B,EAAW;EAChG,IAAIf,uBAAuB,EAAE;IAC3B,OAAO,IAAI;EACb;EACA,IAAIe,KAAK,IAAI,IAAI,IAAI,IAAAC,0CAA0B,EAACD,KAAK,CAAC,EAAE;IACtD,OAAO,IAAI;EACb;EACA,OAAOX,qBAAqB,CAACC,MAAM,CAAC;AACtC","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bannerThemeInlineStyles = bannerThemeInlineStyles;
|
|
7
|
+
exports.bannerThemeStyleAttribute = bannerThemeStyleAttribute;
|
|
8
|
+
var _resolveBannerTheme = require("../resolveBannerTheme.js");
|
|
9
|
+
function readString(theme, key, fallback) {
|
|
10
|
+
const value = theme[key];
|
|
11
|
+
if (typeof value === 'string' && value.trim()) {
|
|
12
|
+
return value.trim();
|
|
13
|
+
}
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
function readNumber(theme, key, fallback) {
|
|
17
|
+
const value = theme[key];
|
|
18
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
if (typeof value === 'string') {
|
|
22
|
+
const parsed = parseFloat(value);
|
|
23
|
+
if (Number.isFinite(parsed)) {
|
|
24
|
+
return parsed;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return fallback;
|
|
28
|
+
}
|
|
29
|
+
function readCssLength(theme, key, fallbackPx) {
|
|
30
|
+
const value = theme[key];
|
|
31
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
32
|
+
return `${value}px`;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === 'string' && value.trim()) {
|
|
35
|
+
return value.trim();
|
|
36
|
+
}
|
|
37
|
+
return `${fallbackPx}px`;
|
|
38
|
+
}
|
|
39
|
+
function escapeHtmlAttribute(value) {
|
|
40
|
+
return value.replace(/&/g, '&').replace(/"/g, '"');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Inline CSS custom properties for banner WebView (subset of web `getThemeRootStyles`). */
|
|
44
|
+
function bannerThemeInlineStyles(theme) {
|
|
45
|
+
const bannerBg = (0, _resolveBannerTheme.resolveBannerBackgroundColor)(theme);
|
|
46
|
+
const bannerFg = (0, _resolveBannerTheme.resolveBannerForegroundColor)(theme);
|
|
47
|
+
const fontSize = typeof theme.fontSize === 'number' ? theme.fontSize : 16;
|
|
48
|
+
const lineHeight = readNumber(theme, 'lineHeight', Math.round(fontSize * 1.5));
|
|
49
|
+
return {
|
|
50
|
+
'--userflow-banner-background-color': bannerBg,
|
|
51
|
+
'--userflow-banner-foreground-color': bannerFg,
|
|
52
|
+
'--userflow-banner-hover-background-color': readString(theme, 'bannerHoverBackgroundColor', bannerBg),
|
|
53
|
+
'--userflow-banner-active-background-color': readString(theme, 'bannerActiveBackgroundColor', bannerBg),
|
|
54
|
+
'--userflow-banner-hover-foreground-color': readString(theme, 'bannerHoverForegroundColor', bannerFg),
|
|
55
|
+
'--userflow-banner-active-foreground-color': readString(theme, 'bannerActiveForegroundColor', bannerFg),
|
|
56
|
+
'--userflow-font-family': readString(theme, 'fontFamily', 'system-ui, sans-serif'),
|
|
57
|
+
'--userflow-font-size': `${fontSize}px`,
|
|
58
|
+
'--userflow-line-height': `${lineHeight}px`,
|
|
59
|
+
'--userflow-button-height': readCssLength(theme, 'buttonHeight', 32),
|
|
60
|
+
'--userflow-button-border-radius': readCssLength(theme, 'buttonBorderRadius', 6),
|
|
61
|
+
'--userflow-button-min-width': readCssLength(theme, 'buttonMinWidth', 0),
|
|
62
|
+
'--userflow-main-foreground-color': bannerFg,
|
|
63
|
+
'--userflow-link-color': readString(theme, 'linkColor', bannerFg),
|
|
64
|
+
'--userflow-h1-font-size': `${Math.round(fontSize * 1.25)}px`,
|
|
65
|
+
'--userflow-h2-font-size': `${Math.round(fontSize * 1.125)}px`,
|
|
66
|
+
'--userflow-font-weight-normal': '400',
|
|
67
|
+
'--userflow-font-weight-bold': '600'
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function bannerThemeStyleAttribute(theme) {
|
|
71
|
+
const entries = bannerThemeInlineStyles(theme);
|
|
72
|
+
return Object.entries(entries).map(([key, value]) => `${key}:${escapeHtmlAttribute(value)}`).join(';');
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=bannerThemeStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_resolveBannerTheme","require","readString","theme","key","fallback","value","trim","readNumber","Number","isFinite","parsed","parseFloat","readCssLength","fallbackPx","escapeHtmlAttribute","replace","bannerThemeInlineStyles","bannerBg","resolveBannerBackgroundColor","bannerFg","resolveBannerForegroundColor","fontSize","lineHeight","Math","round","bannerThemeStyleAttribute","entries","Object","map","join"],"sourceRoot":"../../../../src","sources":["surfaces/bannerWebView/bannerThemeStyles.ts"],"mappings":";;;;;;;AAEA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,SAASC,UAAUA,CAACC,KAAoB,EAAEC,GAAW,EAAEC,QAAgB,EAAU;EAC/E,MAAMC,KAAK,GAAGH,KAAK,CAACC,GAAG,CAAC;EACxB,IAAI,OAAOE,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAA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