@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 @@
|
|
|
1
|
+
{"version":3,"names":["React","Platform","useColorScheme","useWindowDimensions","View","getCurrentScreenLocation","subscribeScreenLocation","ABSOLUTE_FILL","useUserflowSafeAreaInsets","buildBootstrapHtml","EVAL_JS_BASE_URL","isBootstrapUrl","parseBridgeMessage","formatEvalJsError","getEvalJsBridgeHandlers","evalJsController","getEvalJsWebView","useEvalJsWebViewInjection","jsx","_jsx","screenFromLocation","location","path","screen","name","useEvalJsScreen","setScreen","useState","useEffect","clipFor","layout","viewport","suppressed","fullWeb","width","height","backgroundColor","hidden","mode","interactive","outer","opacity","web","rect","position","left","x","top","y","overflow","EvalJsHost","snapshot","useSyncExternalStore","subscribe","getSnapshot","active","bannerOwnsWebView","EvalJsWebView","generation","pendingCount","host","WebView","webRef","useRef","pageReady","setPageReady","generationRef","colorScheme","insets","context","useMemo","platform","OS","safeAreaInsets","initialContext","html","current","openExternal","useCallback","url","openUrl","onMessage","event","message","nativeEvent","data","bridge","type","reset","endFlow","sessionIds","setLayout","track","attributes","updateUser","updateGroup","options","warn","code","clip","debugging","__DEV__","undefined","pointerEvents","style","children","ref","source","baseUrl","originWhitelist","javaScriptEnabled","domStorageEnabled","scrollEnabled","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","setSupportMultipleWindows","androidLayerType","webviewDebuggingEnabled","onShouldStartLoadWithRequest","request","onOpenWindow","targetUrl","onError","description"],"sourceRoot":"../../../src","sources":["evalJs/EvalJsHost.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,cAAc,EAAEC,mBAAmB,EAAEC,IAAI,QAAwB,cAAc;AAElG,SAASC,wBAAwB,EAAEC,uBAAuB,QAAQ,qBAAkB;AACpF,SAASC,aAAa,QAAQ,6BAA0B;AACxD,SAASC,yBAAyB,QAAQ,yBAAsB;AAEhE,SAASC,kBAAkB,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,gBAAa;AAClF,SAASC,kBAAkB,QAAQ,qBAAkB;AACrD,SAASC,iBAAiB,EAAEC,uBAAuB,QAAQ,mBAAgB;AAC3E,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,gBAAgB,QAAkC,iBAAc;AAEzE,SAASC,yBAAyB,QAAQ,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOxE,SAASC,kBAAkBA,CAACC,QAAsD,EAAgB;EAChG,IAAI,CAACA,QAAQ,EAAE,OAAO,CAAC,CAAC;EACxB,IAAI,MAAM,IAAIA,QAAQ,EAAE,OAAOA,QAAQ,CAACC,IAAI,GAAG;IAAEA,IAAI,EAAED,QAAQ,CAACC;EAAK,CAAC,GAAG,CAAC,CAAC;EAC3E,OAAOD,QAAQ,CAACE,MAAM,GAAG;IAAEC,IAAI,EAAEH,QAAQ,CAACE;EAAO,CAAC,GAAG,CAAC,CAAC;AACzD;AAEA,SAASE,eAAeA,CAAA,EAAiB;EACvC,MAAM,CAACF,MAAM,EAAEG,SAAS,CAAC,GAAG1B,KAAK,CAAC2B,QAAQ,CAAe,MACvDP,kBAAkB,CAACf,wBAAwB,CAAC,CAAC,CAC/C,CAAC;EACDL,KAAK,CAAC4B,SAAS,CAAC,MAAM;IACpB,OAAOtB,uBAAuB,CAAEe,QAAQ,IAAK;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6C,OAAO,CAAC3C,GAAG,CAAC;UACzB,OAAO,KAAK;QACd,CAAE;QACF4C,YAAY,EAAGzC,KAAK,IAAK;UACvB,MAAMH,GAAG,GAAGG,KAAK,CAACE,WAAW,CAACwC,SAAS;UACvC,IAAI7C,GAAG,EAAEF,YAAY,CAACE,GAAG,CAAC;QAC5B,CAAE;QACF8C,OAAO,EAAG3C,KAAK,IAAK;UAClB,MAAM4C,WAAW,GAAG5C,KAAK,CAACE,WAAW,CAAC0C,WAAW;UACjD,IAAIA,WAAW,EAAE;YACfhH,uBAAuB,CAAC,CAAC,CAACmF,IAAI,CAACpF,iBAAiB,CAACiH,WAAW,CAAC,CAAC;UAChE;QACF;MAAE,CACH;IAAC,CACE;EAAC,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Document URL of the empty page that hosts customer scripts. */
|
|
4
|
+
export const EVAL_JS_BASE_URL = 'https://userflow.local/';
|
|
5
|
+
export function isBootstrapUrl(url) {
|
|
6
|
+
if (!url || url === 'about:blank' || url.startsWith('about:blank')) return true;
|
|
7
|
+
if (url.startsWith('data:text/html')) return true;
|
|
8
|
+
return url === EVAL_JS_BASE_URL || url.startsWith(EVAL_JS_BASE_URL);
|
|
9
|
+
}
|
|
10
|
+
function embedJson(value) {
|
|
11
|
+
return JSON.stringify(value).replace(/</g, '\\u003c');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Empty transparent page plus the `window.userflow` bridge.
|
|
16
|
+
* The bridge runs in the document itself, before any customer code is injected.
|
|
17
|
+
*/
|
|
18
|
+
export function buildBootstrapHtml(context, bodyHtml = '') {
|
|
19
|
+
const contextJson = embedJson(context);
|
|
20
|
+
return `<!DOCTYPE html>
|
|
21
|
+
<html>
|
|
22
|
+
<head>
|
|
23
|
+
<meta charset="utf-8" />
|
|
24
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
25
|
+
<style>
|
|
26
|
+
html, body { margin: 0; padding: 0; background: transparent; }
|
|
27
|
+
</style>
|
|
28
|
+
<script>
|
|
29
|
+
(function () {
|
|
30
|
+
function post(msg) {
|
|
31
|
+
try {
|
|
32
|
+
if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
|
|
33
|
+
window.ReactNativeWebView.postMessage(JSON.stringify(Object.assign({ __userflow: 1 }, msg)));
|
|
34
|
+
}
|
|
35
|
+
} catch (e) {}
|
|
36
|
+
}
|
|
37
|
+
window.__userflowApplyContext = function (next) {
|
|
38
|
+
window.userflowContext = next || {};
|
|
39
|
+
try { window.dispatchEvent(new Event('userflow:contextchange')); } catch (e) {}
|
|
40
|
+
};
|
|
41
|
+
window.__userflowApplyContext(${contextJson});
|
|
42
|
+
window.userflow = {
|
|
43
|
+
track: function (name, attributes) { post({ type: 'track', name: name, attributes: attributes }); },
|
|
44
|
+
updateUser: function (attributes) { post({ type: 'updateUser', attributes: attributes }); },
|
|
45
|
+
updateGroup: function (attributes, options) { post({ type: 'updateGroup', attributes: attributes, options: options }); },
|
|
46
|
+
openUrl: function (url) { post({ type: 'openUrl', url: String(url || '') }); },
|
|
47
|
+
close: function () { post({ type: 'close' }); },
|
|
48
|
+
endFlow: function () { post({ type: 'endFlow' }); },
|
|
49
|
+
setLayout: function (layout) { post({ type: 'setLayout', layout: layout }); }
|
|
50
|
+
};
|
|
51
|
+
window.addEventListener('error', function (event) {
|
|
52
|
+
post({ type: 'error', message: String((event && event.message) || 'error') });
|
|
53
|
+
});
|
|
54
|
+
post({ type: 'ready' });
|
|
55
|
+
})();
|
|
56
|
+
</script>
|
|
57
|
+
</head>
|
|
58
|
+
<body>${bodyHtml}</body>
|
|
59
|
+
</html>`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Push a fresh `userflowContext` and notify scripts. Does not reload the page. */
|
|
63
|
+
export function contextUpdateScript(context) {
|
|
64
|
+
return `window.__userflowApplyContext&&window.__userflowApplyContext(${embedJson(context)});true;`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Same execution model as web userflow.js: `new Function('"use strict";\\n' + code)`.
|
|
69
|
+
* The code is a JSON string literal so it cannot break out of the wrapper.
|
|
70
|
+
* `true;` is required so `injectJavaScript` settles on iOS.
|
|
71
|
+
*/
|
|
72
|
+
export function wrapCode(code) {
|
|
73
|
+
const literal = embedJson(code);
|
|
74
|
+
return `try{var __uf=new Function('"use strict";\\n'+${literal});__uf();}` + `catch(e){var __m=(e&&(e.stack||e.message))||String(e);` + `if(window.ReactNativeWebView&&window.ReactNativeWebView.postMessage){` + `window.ReactNativeWebView.postMessage(JSON.stringify({__userflow:1,type:'error',message:String(__m),code:${literal}}));}}` + `true;`;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EVAL_JS_BASE_URL","isBootstrapUrl","url","startsWith","embedJson","value","JSON","stringify","replace","buildBootstrapHtml","context","bodyHtml","contextJson","contextUpdateScript","wrapCode","code","literal"],"sourceRoot":"../../../src","sources":["evalJs/bootstrap.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,gBAAgB,GAAG,yBAAyB;AAEzD,OAAO,SAASC,cAAcA,CAACC,GAAW,EAAW;EACnD,IAAI,CAACA,GAAG,IAAIA,GAAG,KAAK,aAAa,IAAIA,GAAG,CAACC,UAAU,CAAC,aAAa,CAAC,EAAE,OAAO,IAAI;EAC/E,IAAID,GAAG,CAACC,UAAU,CAAC,gBAAgB,CAAC,EAAE,OAAO,IAAI;EACjD,OAAOD,GAAG,KAAKF,gBAAgB,IAAIE,GAAG,CAACC,UAAU,CAACH,gBAAgB,CAAC;AACrE;AAEA,SAASI,SAASA,CAACC,KAAc,EAAU;EACzC,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC,CAACG,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,OAAsB,EAAEC,QAAQ,GAAG,EAAE,EAAU;EAChF,MAAMC,WAAW,GAAGR,SAAS,CAACM,OAAO,CAAC;EACtC,OAAO;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkCE,WAAW;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQD,QAAQ;AAChB,QAAQ;AACR;;AAEA;AACA,OAAO,SAASE,mBAAmBA,CAACH,OAAsB,EAAU;EAClE,OAAO,gEAAgEN,SAAS,CAACM,OAAO,CAAC,SAAS;AACpG;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,QAAQA,CAACC,IAAY,EAAU;EAC7C,MAAMC,OAAO,GAAGZ,SAAS,CAACW,IAAI,CAAC;EAC/B,OACE,gDAAgDC,OAAO,YAAY,GACnE,wDAAwD,GACxD,uEAAuE,GACvE,4GAA4GA,OAAO,QAAQ,GAC3H,OAAO;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const MESSAGE_TYPES = new Set(['ready', 'close', 'endFlow', 'setLayout', 'track', 'updateUser', 'updateGroup', 'openUrl', 'error']);
|
|
4
|
+
/**
|
|
5
|
+
* Accept only JSON objects tagged `__userflow: 1` with an allowlisted type.
|
|
6
|
+
* Anything else (page noise, unexpected shapes) is ignored.
|
|
7
|
+
*/
|
|
8
|
+
export function parseBridgeMessage(raw) {
|
|
9
|
+
let value = raw;
|
|
10
|
+
if (typeof raw === 'string') {
|
|
11
|
+
try {
|
|
12
|
+
value = JSON.parse(raw);
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (value == null || typeof value !== 'object' || Array.isArray(value)) return null;
|
|
18
|
+
const record = value;
|
|
19
|
+
if (record.__userflow !== 1) return null;
|
|
20
|
+
if (typeof record.type !== 'string' || !MESSAGE_TYPES.has(record.type)) return null;
|
|
21
|
+
switch (record.type) {
|
|
22
|
+
case 'ready':
|
|
23
|
+
return {
|
|
24
|
+
type: 'ready'
|
|
25
|
+
};
|
|
26
|
+
case 'close':
|
|
27
|
+
return {
|
|
28
|
+
type: 'close'
|
|
29
|
+
};
|
|
30
|
+
case 'endFlow':
|
|
31
|
+
return {
|
|
32
|
+
type: 'endFlow'
|
|
33
|
+
};
|
|
34
|
+
case 'error':
|
|
35
|
+
return {
|
|
36
|
+
type: 'error',
|
|
37
|
+
message: typeof record.message === 'string' ? record.message : 'error',
|
|
38
|
+
...(typeof record.code === 'string' ? {
|
|
39
|
+
code: record.code
|
|
40
|
+
} : {})
|
|
41
|
+
};
|
|
42
|
+
case 'openUrl':
|
|
43
|
+
if (typeof record.url !== 'string' || record.url.length === 0) return null;
|
|
44
|
+
return {
|
|
45
|
+
type: 'openUrl',
|
|
46
|
+
url: record.url
|
|
47
|
+
};
|
|
48
|
+
case 'track':
|
|
49
|
+
{
|
|
50
|
+
if (typeof record.name !== 'string' || record.name.length === 0) return null;
|
|
51
|
+
if (record.attributes != null && !isRecord(record.attributes)) return null;
|
|
52
|
+
return {
|
|
53
|
+
type: 'track',
|
|
54
|
+
name: record.name,
|
|
55
|
+
...(isRecord(record.attributes) ? {
|
|
56
|
+
attributes: record.attributes
|
|
57
|
+
} : {})
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
case 'updateUser':
|
|
61
|
+
{
|
|
62
|
+
if (!isRecord(record.attributes)) return null;
|
|
63
|
+
return {
|
|
64
|
+
type: 'updateUser',
|
|
65
|
+
attributes: record.attributes
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
case 'updateGroup':
|
|
69
|
+
{
|
|
70
|
+
if (!isRecord(record.attributes)) return null;
|
|
71
|
+
const options = record.options;
|
|
72
|
+
if (options == null) return {
|
|
73
|
+
type: 'updateGroup',
|
|
74
|
+
attributes: record.attributes
|
|
75
|
+
};
|
|
76
|
+
if (!isRecord(options)) return null;
|
|
77
|
+
if (options.membership != null && !isRecord(options.membership)) return null;
|
|
78
|
+
return {
|
|
79
|
+
type: 'updateGroup',
|
|
80
|
+
attributes: record.attributes,
|
|
81
|
+
...(isRecord(options.membership) ? {
|
|
82
|
+
options: {
|
|
83
|
+
membership: options.membership
|
|
84
|
+
}
|
|
85
|
+
} : {})
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
case 'setLayout':
|
|
89
|
+
{
|
|
90
|
+
const layout = parseLayout(record.layout);
|
|
91
|
+
if (!layout) return null;
|
|
92
|
+
return {
|
|
93
|
+
type: 'setLayout',
|
|
94
|
+
layout
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
default:
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function parseLayout(value) {
|
|
102
|
+
if (!isRecord(value)) return null;
|
|
103
|
+
if (value.mode === 'hidden' || value.mode === 'fullscreen') {
|
|
104
|
+
return {
|
|
105
|
+
mode: value.mode
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (value.mode !== 'fitted') return null;
|
|
109
|
+
const rect = parseRect(value.rect);
|
|
110
|
+
if (!rect) return null;
|
|
111
|
+
return {
|
|
112
|
+
mode: 'fitted',
|
|
113
|
+
rect
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function parseRect(value) {
|
|
117
|
+
if (!isRecord(value)) return null;
|
|
118
|
+
const x = value.x;
|
|
119
|
+
const y = value.y;
|
|
120
|
+
const width = value.width;
|
|
121
|
+
const height = value.height;
|
|
122
|
+
if (!isFiniteNumber(x) || !isFiniteNumber(y) || !isFiniteNumber(width) || !isFiniteNumber(height)) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
if (width <= 0 || height <= 0) return null;
|
|
126
|
+
return {
|
|
127
|
+
x,
|
|
128
|
+
y,
|
|
129
|
+
width,
|
|
130
|
+
height
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function isRecord(value) {
|
|
134
|
+
return value != null && typeof value === 'object' && !Array.isArray(value);
|
|
135
|
+
}
|
|
136
|
+
function isFiniteNumber(value) {
|
|
137
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=bridgeMessages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MESSAGE_TYPES","Set","parseBridgeMessage","raw","value","JSON","parse","Array","isArray","record","__userflow","type","has","message","code","url","length","name","attributes","isRecord","options","membership","layout","parseLayout","mode","rect","parseRect","x","y","width","height","isFiniteNumber","Number","isFinite"],"sourceRoot":"../../../src","sources":["evalJs/bridgeMessages.ts"],"mappings":";;AAEA,MAAMA,aAAa,GAAG,IAAIC,GAAG,CAAC,CAC5B,OAAO,EACP,OAAO,EACP,SAAS,EACT,WAAW,EACX,OAAO,EACP,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,CACR,CAAC;AAiBF;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,GAAY,EAAwB;EACrE,IAAIC,KAAK,GAAGD,GAAG;EACf,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;IAC3B,IAAI;MACFC,KAAK,GAAGC,IAAI,CAACC,KAAK,CAACH,GAAG,CAAY;IACpC,CAAC,CAAC,MAAM;MACN,OAAO,IAAI;IACb;EACF;EACA,IAAIC,KAAK,IAAI,IAAI,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE,OAAO,IAAI;EACnF,MAAMK,MAAM,GAAGL,KAAgC;EAC/C,IAAIK,MAAM,CAACC,UAAU,KAAK,CAAC,EAAE,OAAO,IAAI;EACxC,IAAI,O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AAOA,KAAK,KAAK,QAAQ,IAAI4B,MAAM,CAACC,QAAQ,CAAC7B,KAAK,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Calls into the public SDK without importing the facade (that would cycle). */
|
|
4
|
+
|
|
5
|
+
const noopHandlers = {
|
|
6
|
+
track: () => undefined,
|
|
7
|
+
updateUser: () => undefined,
|
|
8
|
+
updateGroup: () => undefined,
|
|
9
|
+
openUrl: () => undefined,
|
|
10
|
+
endFlow: () => undefined,
|
|
11
|
+
warn: message => {
|
|
12
|
+
console.warn(message);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
let handlers = noopHandlers;
|
|
16
|
+
export function setEvalJsBridgeHandlers(next) {
|
|
17
|
+
handlers = next ?? noopHandlers;
|
|
18
|
+
}
|
|
19
|
+
export function getEvalJsBridgeHandlers() {
|
|
20
|
+
return handlers;
|
|
21
|
+
}
|
|
22
|
+
export function formatEvalJsError(message, code) {
|
|
23
|
+
return `Userflow: Evaluate JavaScript action failed.\n\n` + `Error:\n${message}\n\n` + `Code:\n${code ?? ''}`;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=evalJsBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["noopHandlers","track","undefined","updateUser","updateGroup","openUrl","endFlow","warn","message","console","handlers","setEvalJsBridgeHandlers","next","getEvalJsBridgeHandlers","formatEvalJsError","code"],"sourceRoot":"../../../src","sources":["evalJs/evalJsBridge.ts"],"mappings":";;AAAA;;AAcA,MAAMA,YAAkC,GAAG;EACzCC,KAAK,EAAEA,CAAA,KAAMC,SAAS;EACtBC,UAAU,EAAEA,CAAA,KAAMD,SAAS;EAC3BE,WAAW,EAAEA,CAAA,KAAMF,SAAS;EAC5BG,OAAO,EAAEA,CAAA,KAAMH,SAAS;EACxBI,OAAO,EAAEA,CAAA,KAAMJ,SAAS;EACxBK,IAAI,EAAGC,OAAO,IAAK;IACjBC,OAAO,CAACF,IAAI,CAACC,OAAO,CAAC;EACvB;AACF,CAAC;AAED,IAAIE,QAA8B,GAAGV,YAAY;AAEjD,OAAO,SAASW,uBAAuBA,CAACC,IAAiC,EAAQ;EAC/EF,QAAQ,GAAGE,IAAI,IAAIZ,YAAY;AACjC;AAEA,OAAO,SAASa,uBAAuBA,CAAA,EAAyB;EAC9D,OAAOH,QAAQ;AACjB;AAEA,OAAO,SAASI,iBAAiBA,CAACN,OAAe,EAAEO,IAAa,EAAU;EACxE,OACE,kDAAkD,GAClD,WAAWP,OAAO,MAAM,GACxB,UAAUO,IAAI,IAAI,EAAE,EAAE;AAE1B","ignoreList":[]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const HIDDEN = {
|
|
4
|
+
mode: 'hidden'
|
|
5
|
+
};
|
|
6
|
+
let generation = 0;
|
|
7
|
+
let active = false;
|
|
8
|
+
let pending = [];
|
|
9
|
+
/** Sessions whose scripts ran in the current WebView; `endFlow` may only end one of these. */
|
|
10
|
+
let sessionIds = new Set();
|
|
11
|
+
let layout = HIDDEN;
|
|
12
|
+
let host = {};
|
|
13
|
+
let bannerOwnsWebView = false;
|
|
14
|
+
const listeners = new Set();
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Cached for `useSyncExternalStore`: React re-renders forever if getSnapshot
|
|
18
|
+
* returns a new object while nothing changed.
|
|
19
|
+
*/
|
|
20
|
+
let currentSnapshot = {
|
|
21
|
+
active,
|
|
22
|
+
generation,
|
|
23
|
+
pendingCount: 0,
|
|
24
|
+
layout,
|
|
25
|
+
host,
|
|
26
|
+
bannerOwnsWebView
|
|
27
|
+
};
|
|
28
|
+
function emit() {
|
|
29
|
+
currentSnapshot = {
|
|
30
|
+
active,
|
|
31
|
+
generation,
|
|
32
|
+
pendingCount: pending.length,
|
|
33
|
+
layout,
|
|
34
|
+
host,
|
|
35
|
+
bannerOwnsWebView
|
|
36
|
+
};
|
|
37
|
+
for (const listener of listeners) {
|
|
38
|
+
listener();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export const evalJsController = {
|
|
42
|
+
subscribe(listener) {
|
|
43
|
+
listeners.add(listener);
|
|
44
|
+
return () => {
|
|
45
|
+
listeners.delete(listener);
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
getSnapshot() {
|
|
49
|
+
return currentSnapshot;
|
|
50
|
+
},
|
|
51
|
+
enqueue(request) {
|
|
52
|
+
if (!request.code) return;
|
|
53
|
+
pending = [...pending, request.code];
|
|
54
|
+
sessionIds.add(request.sessionId);
|
|
55
|
+
active = true;
|
|
56
|
+
emit();
|
|
57
|
+
},
|
|
58
|
+
sessionIds() {
|
|
59
|
+
return new Set(sessionIds);
|
|
60
|
+
},
|
|
61
|
+
/** Codes waiting to be injected. Clears the queue. */
|
|
62
|
+
consumePending() {
|
|
63
|
+
if (pending.length === 0) return [];
|
|
64
|
+
const codes = pending;
|
|
65
|
+
pending = [];
|
|
66
|
+
emit();
|
|
67
|
+
return codes;
|
|
68
|
+
},
|
|
69
|
+
setLayout(next) {
|
|
70
|
+
layout = next;
|
|
71
|
+
emit();
|
|
72
|
+
},
|
|
73
|
+
/** App-supplied values exposed as `userflowContext.host`. Survives reset. */
|
|
74
|
+
setHostContext(values) {
|
|
75
|
+
host = {
|
|
76
|
+
...values
|
|
77
|
+
};
|
|
78
|
+
emit();
|
|
79
|
+
},
|
|
80
|
+
/** Custom banner WebView is the sole eval page (no overlay EvalJsHost). */
|
|
81
|
+
setBannerOwnsWebView(owns) {
|
|
82
|
+
bannerOwnsWebView = owns;
|
|
83
|
+
emit();
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Destroy the shared WebView and drop queued code. Host context stays so the
|
|
87
|
+
* next script still sees language / tab-bar height the app provided.
|
|
88
|
+
*/
|
|
89
|
+
reset() {
|
|
90
|
+
generation += 1;
|
|
91
|
+
active = false;
|
|
92
|
+
pending = [];
|
|
93
|
+
sessionIds = new Set();
|
|
94
|
+
layout = HIDDEN;
|
|
95
|
+
bannerOwnsWebView = false;
|
|
96
|
+
emit();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export function resetEvalJsControllerForTests() {
|
|
102
|
+
generation = 0;
|
|
103
|
+
active = false;
|
|
104
|
+
pending = [];
|
|
105
|
+
sessionIds = new Set();
|
|
106
|
+
layout = HIDDEN;
|
|
107
|
+
host = {};
|
|
108
|
+
bannerOwnsWebView = false;
|
|
109
|
+
listeners.clear();
|
|
110
|
+
currentSnapshot = {
|
|
111
|
+
active,
|
|
112
|
+
generation,
|
|
113
|
+
pendingCount: 0,
|
|
114
|
+
layout,
|
|
115
|
+
host,
|
|
116
|
+
bannerOwnsWebView
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=evalJsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HIDDEN","mode","generation","active","pending","sessionIds","Set","layout","host","bannerOwnsWebView","listeners","currentSnapshot","pendingCount","emit","length","listener","evalJsController","subscribe","add","delete","getSnapshot","enqueue","request","code","sessionId","consumePending","codes","setLayout","next","setHostContext","values","setBannerOwnsWebView","owns","reset","resetEvalJsControllerForTests","clear"],"sourceRoot":"../../../src","sources":["evalJs/evalJsController.ts"],"mappings":";;AAEA,MAAMA,MAAoB,GAAG;EAAEC,IAAI,EAAE;AAAS,CAAC;AAI/C,IAAIC,UAAU,GAAG,CAAC;AAClB,IAAIC,MAAM,GAAG,KAAK;AAClB,IAAIC,OAAiB,GAAG,EAAE;AAC1B;AACA,IAAIC,UAAU,GAAG,IAAIC,GAAG,CAAS,CAAC;AAClC,IAAIC,MAAoB,GAAGP,MAAM;AACjC,IAAIQ,IAA6B,GAAG,CAAC,CAAC;AACtC,IAAIC,iBAAiB,GAAG,KAAK;AAC7B,MAAMC,SAAS,GAAG,I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IAAkB,EAAQ;IAClCrB,MAAM,GAAGqB,IAAI;IACbf,IAAI,CAAC,CAAC;EACR,CAAC;EAED;EACAgB,cAAcA,CAACC,MAA+B,EAAQ;IACpDtB,IAAI,GAAG;MAAE,GAAGsB;IAAO,CAAC;IACpBjB,IAAI,CAAC,CAAC;EACR,CAAC;EAED;EACAkB,oBAAoBA,CAACC,IAAa,EAAQ;IACxCvB,iBAAiB,GAAGuB,IAAI;IACxBnB,IAAI,CAAC,CAAC;EACR,CAAC;EAED;AACF;AACA;AACA;EACEoB,KAAKA,CAAA,EAAS;IACZ/B,UAAU,IAAI,CAAC;IACfC,MAAM,GAAG,KAAK;IACdC,OAAO,GAAG,EAAE;IACZC,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IACtBC,MAAM,GAAGP,MAAM;IACfS,iBAAiB,GAAG,KAAK;IACzBI,IAAI,CAAC,CAAC;EACR;AACF,CAAC;;AAED;AACA,OAAO,SAASqB,6BAA6BA,CAAA,EAAS;EACpDhC,UAAU,GAAG,CAAC;EACdC,MAAM,GAAG,KAAK;EACdC,OAAO,GAAG,EAAE;EACZC,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;EACtBC,MAAM,GAAGP,MAAM;EACfQ,IAAI,GAAG,CAAC,CAAC;EACTC,iBAAiB,GAAG,KAAK;EACzBC,SAAS,CAACyB,KAAK,CAAC,CAAC;EACjBxB,eAAe,GAAG;IAChBR,MAAM;IACND,UAAU;IACVU,YAAY,EAAE,CAAC;IACfL,MAAM;IACNC,IAAI;IACJC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NativeModules, TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Minimal surface of `react-native-webview` this spike uses.
|
|
7
|
+
* Defined locally so the package root never statically imports the optional peer.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
let cached;
|
|
11
|
+
let warnedMissing = false;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* True when the native `react-native-webview` binary is linked. Do not
|
|
15
|
+
* `require('react-native-webview')` before this passes — the JS entry calls
|
|
16
|
+
* `TurboModuleRegistry.getEnforcing('RNCWebViewModule')` and can red-screen.
|
|
17
|
+
*/
|
|
18
|
+
export function isEvalJsWebViewNativeLinked() {
|
|
19
|
+
try {
|
|
20
|
+
if (typeof TurboModuleRegistry?.get === 'function') {
|
|
21
|
+
if (TurboModuleRegistry.get('RNCWebViewModule') != null) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const legacy = NativeModules.RNCWebViewModule;
|
|
26
|
+
return legacy != null;
|
|
27
|
+
} catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Lazy `require('react-native-webview')`, cached. Returns null when the package
|
|
34
|
+
* or native module is missing so Evaluate JavaScript can no-op instead of crashing.
|
|
35
|
+
*/
|
|
36
|
+
export function getEvalJsWebView() {
|
|
37
|
+
if (cached !== undefined) return cached;
|
|
38
|
+
if (typeof require !== 'function') {
|
|
39
|
+
cached = null;
|
|
40
|
+
warnMissing('unavailable');
|
|
41
|
+
return cached;
|
|
42
|
+
}
|
|
43
|
+
if (!isEvalJsWebViewNativeLinked()) {
|
|
44
|
+
cached = null;
|
|
45
|
+
warnMissing('native');
|
|
46
|
+
return cached;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- peer probe
|
|
50
|
+
const mod = require('react-native-webview');
|
|
51
|
+
const component = mod?.WebView ?? mod?.default;
|
|
52
|
+
cached = component != null ? component : null;
|
|
53
|
+
} catch {
|
|
54
|
+
cached = null;
|
|
55
|
+
}
|
|
56
|
+
if (cached == null) {
|
|
57
|
+
warnMissing('js');
|
|
58
|
+
}
|
|
59
|
+
return cached;
|
|
60
|
+
}
|
|
61
|
+
function warnMissing(reason) {
|
|
62
|
+
if (warnedMissing) return;
|
|
63
|
+
warnedMissing = true;
|
|
64
|
+
if (reason === 'native') {
|
|
65
|
+
console.warn('Userflow: react-native-webview is listed in package.json but RNCWebViewModule is not in ' + 'this native build. Run npx expo install react-native-webview (or npm install), then ' + 'rebuild the dev client (expo prebuild + run:ios / run:android — not Expo Go). ' + 'Evaluate JavaScript and WebView banners will not run until then.');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
console.warn('Userflow: Evaluate JavaScript requires react-native-webview. Install it in your app ' + '(e.g. npx expo install react-native-webview), rebuild the native app, then retry. ' + 'The action was skipped.');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export function resetEvalJsWebViewCacheForTests() {
|
|
73
|
+
cached = undefined;
|
|
74
|
+
warnedMissing = false;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=getWebView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","TurboModuleRegistry","cached","warnedMissing","isEvalJsWebViewNativeLinked","get","legacy","RNCWebViewModule","getEvalJsWebView","undefined","require","warnMissing","mod","component","WebView","default","reason","console","warn","resetEvalJsWebViewCacheForTests"],"sourceRoot":"../../../src","sources":["evalJs/getWebView.ts"],"mappings":";;AACA,SAASA,aAAa,EAAEC,mBAAmB,QAAQ,cAAc;;AAEjE;AACA;AACA;AACA;;AAmCA,IAAIC,MAAiD;AACrD,IAAIC,aAAa,GAAG,KAAK;;AAEzB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CAAA,EAAY;EACrD,IAAI;IACF,IAAI,OAAOH,mBAAmB,EAAEI,GAAG,KAAK,UAAU,EAAE;MAClD,IAAIJ,mBAAmB,CAACI,GAAG,CAAC,kBAAkB,CAAC,IAAI,IAAI,EAAE;QACvD,OAAO,IAAI;MACb;IACF;IACA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a,GAAG,KAAK;AACvB","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { wrapCode } from "./bootstrap.js";
|
|
4
|
+
import { evalJsController } from "./evalJsController.js";
|
|
5
|
+
/** Inject queued Evaluate JavaScript into a WebView (same document as the banner). */
|
|
6
|
+
export function injectEvalPendingIntoWebView(view) {
|
|
7
|
+
if (!view) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const codes = evalJsController.consumePending();
|
|
11
|
+
for (const code of codes) {
|
|
12
|
+
view.injectJavaScript(wrapCode(code));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=injectEvalPending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["wrapCode","evalJsController","injectEvalPendingIntoWebView","view","codes","consumePending","code","injectJavaScript"],"sourceRoot":"../../../src","sources":["evalJs/injectEvalPending.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,gBAAa;AACtC,SAASC,gBAAgB,QAAQ,uBAAoB;AAGrD;AACA,OAAO,SAASC,4BAA4BA,CAACC,IAA4C,EAAQ;EAC/F,IAAI,CAACA,IAAI,EAAE;IACT;EACF;EACA,MAAMC,KAAK,GAAGH,gBAAgB,CAACI,cAAc,CAAC,CAAC;EAC/C,KAAK,MAAMC,IAAI,IAAIF,KAAK,EAAE;IACxBD,IAAI,CAACI,gBAAgB,CAACP,QAAQ,CAACM,IAAI,CAAC,CAAC;EACvC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["evalJs/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { contextUpdateScript, wrapCode } from "./bootstrap.js";
|
|
5
|
+
import { evalJsController } from "./evalJsController.js";
|
|
6
|
+
/**
|
|
7
|
+
* Keeps `userflowContext` fresh and drains the eval-js queue into one WebView.
|
|
8
|
+
*/
|
|
9
|
+
export function useEvalJsWebViewInjection(webRef, options) {
|
|
10
|
+
const {
|
|
11
|
+
pageReady,
|
|
12
|
+
context,
|
|
13
|
+
pendingCount
|
|
14
|
+
} = options;
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (!pageReady) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
webRef.current?.injectJavaScript(contextUpdateScript(context));
|
|
20
|
+
}, [context, pageReady, webRef]);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
if (!pageReady) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const view = webRef.current;
|
|
26
|
+
if (!view) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const codes = evalJsController.consumePending();
|
|
30
|
+
for (const code of codes) {
|
|
31
|
+
view.injectJavaScript(wrapCode(code));
|
|
32
|
+
}
|
|
33
|
+
}, [pageReady, pendingCount, webRef]);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=useEvalJsWebViewInjection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","contextUpdateScript","wrapCode","evalJsController","useEvalJsWebViewInjection","webRef","options","pageReady","context","pendingCount","useEffect","current","injectJavaScript","view","codes","consumePending","code"],"sourceRoot":"../../../src","sources":["evalJs/useEvalJsWebViewInjection.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,EAAEC,QAAQ,QAAQ,gBAAa;AAC3D,SAASC,gBAAgB,QAAQ,uBAAoB;AAIrD;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACvCC,MAAmD,EACnDC,OAA6E,EACvE;EACN,MAAM;IAAEC,SAAS;IAAEC,OAAO;IAAEC;EAAa,CAAC,GAAGH,OAAO;EAEpDN,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,IAAI,CAACH,SAAS,EAAE;MACd;IACF;IACAF,MAAM,CAACM,OAAO,EAAEC,gBAAgB,CAACX,mBAAmB,CAACO,OAAO,CAAC,CAAC;EAChE,CAAC,EAAE,CAACA,OAAO,EAAED,SAAS,EAAEF,MAAM,CAAC,CAAC;EAEhCL,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,IAAI,CAACH,SAAS,EAAE;MACd;IACF;IACA,MAAMM,IAAI,GAAGR,MAAM,CAACM,OAAO;IAC3B,IAAI,CAACE,IAAI,EAAE;MACT;IACF;IACA,MAAMC,KAAK,GAAGX,gBAAgB,CAACY,cAAc,CAAC,CAAC;IAC/C,KAAK,MAAMC,IAAI,IAAIF,KAAK,EAAE;MACxBD,IAAI,CAACD,gBAAgB,CAACV,QAAQ,CAACc,IAAI,CAAC,CAAC;IACvC;EACF,CAAC,EAAE,CAACT,SAAS,EAAEE,YAAY,EAAEJ,MAAM,CAAC,CAAC;AACvC","ignoreList":[]}
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
export { useUserflowExpoRouter } from "./useUserflowExpoRouter.js";
|
|
4
4
|
export { UserflowExpoRouterScreenTracker } from "./UserflowExpoRouterScreenTracker.js";
|
|
5
|
+
export { createRedirectSystemPath, isUserflowLinkPath, redirectSystemPath } from "./redirectSystemPath.js";
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useUserflowExpoRouter","UserflowExpoRouterScreenTracker"],"sourceRoot":"../../../src","sources":["expo-router/index.ts"],"mappings":";;AAAA,SAASA,qBAAqB,QAAQ,4BAAyB;AAC/D,SAASC,+BAA+B,QAAQ,sCAAmC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useUserflowExpoRouter","UserflowExpoRouterScreenTracker","createRedirectSystemPath","isUserflowLinkPath","redirectSystemPath"],"sourceRoot":"../../../src","sources":["expo-router/index.ts"],"mappings":";;AAAA,SAASA,qBAAqB,QAAQ,4BAAyB;AAC/D,SAASC,+BAA+B,QAAQ,sCAAmC;AACnF,SACEC,wBAAwB,EACxBC,kBAAkB,EAClBC,kBAAkB,QAIb,yBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { parsePreviewDeepLink } from "../deepLinking.js";
|
|
4
|
+
import { inspectPairingDeepLink, isPairingAttempt } from "../pairing/deepLink.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Arguments Expo Router passes to `redirectSystemPath` from `+native-intent`.
|
|
8
|
+
* @see https://docs.expo.dev/router/advanced/native-intent/
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* True when `path` is a full Userflow pairing or preview URL that Expo Router
|
|
13
|
+
* should not navigate to.
|
|
14
|
+
*
|
|
15
|
+
* Only full URLs are claimed. Expo Router passes the raw URL to
|
|
16
|
+
* `redirectSystemPath` for both the initial URL and later URL events, so a
|
|
17
|
+
* bare `?token=` or `?pairing_token=` must be left alone — it may belong to
|
|
18
|
+
* the host.
|
|
19
|
+
*/
|
|
20
|
+
export function isUserflowLinkPath(path) {
|
|
21
|
+
if (typeof path !== 'string' || path.length === 0) return false;
|
|
22
|
+
if (!/^[a-z][a-z0-9+.-]*:/i.test(path)) return false;
|
|
23
|
+
const pairing = inspectPairingDeepLink(path);
|
|
24
|
+
if (pairing.ok || isPairingAttempt(pairing.reason)) return true;
|
|
25
|
+
return parsePreviewDeepLink(path) != null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Build a `redirectSystemPath` that yields Userflow links and otherwise
|
|
30
|
+
* forwards to `next` (or returns the path unchanged).
|
|
31
|
+
*/
|
|
32
|
+
export function createRedirectSystemPath(options = {}) {
|
|
33
|
+
const {
|
|
34
|
+
next
|
|
35
|
+
} = options;
|
|
36
|
+
return event => {
|
|
37
|
+
try {
|
|
38
|
+
if (isUserflowLinkPath(event.path)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
// Expo warns that throwing here can crash the app. Fall through and let
|
|
43
|
+
// the router handle the original path.
|
|
44
|
+
}
|
|
45
|
+
if (next) {
|
|
46
|
+
return next(event);
|
|
47
|
+
}
|
|
48
|
+
return event.path;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Expo Router `redirectSystemPath` that swallows Userflow deep links.
|
|
54
|
+
*
|
|
55
|
+
* Returning `null` tells Expo Router to stay on the current path. The original
|
|
56
|
+
* URL remains available to React Native `Linking`, which the SDK already
|
|
57
|
+
* listens on.
|
|
58
|
+
*
|
|
59
|
+
* Mount from the host app:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* // app/+native-intent.ts
|
|
63
|
+
* export { redirectSystemPath } from '@userflow-tech/react-native/expo-router';
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* Hosts that already export `redirectSystemPath` should wrap it with
|
|
67
|
+
* {@link createRedirectSystemPath}.
|
|
68
|
+
*/
|
|
69
|
+
export const redirectSystemPath = createRedirectSystemPath();
|
|
70
|
+
//# sourceMappingURL=redirectSystemPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["parsePreviewDeepLink","inspectPairingDeepLink","isPairingAttempt","isUserflowLinkPath","path","length","test","pairing","ok","reason","createRedirectSystemPath","options","next","event","redirectSystemPath"],"sourceRoot":"../../../src","sources":["expo-router/redirectSystemPath.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ,wBAAqB;;AAE9E;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,IAAY,EAAW;EACxD,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE,OAAO,KAAK;EAC/D,IAAI,CAAC,sBAAsB,CAACC,IAAI,CAACF,IAAI,CAAC,EAAE,OAAO,KAAK;EAEpD,MAAMG,OAAO,GAAGN,sBAAsB,CAACG,IAAI,CAAC;EAC5C,IAAIG,OAAO,CAACC,EAAE,IAAIN,gBAAgB,CAACK,OAAO,CAACE,MAAM,CAAC,EAAE,OAAO,IAAI;EAC/D,OAAOT,oBAAoB,CAACI,IAAI,CAAC,IAAI,IAAI;AAC3C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASM,wBAAwBA,CACtCC,OAAwC,GAAG,CAAC,CAAC,EACzB;EACpB,MAAM;IAAEC;EAAK,CAAC,GAAGD,OAAO;EAExB,OAAQE,KAAK,IAAK;IAChB,IAAI;MACF,IAAIV,kBAAkB,CAACU,KAAK,CAACT,IAAI,CAAC,EAAE;QAClC,OAAO,IAAI;MACb;IACF,CAAC,CAAC,MAAM;MACN;MACA;IAAA;IAGF,IAAIQ,IAAI,EAAE;MACR,OAAOA,IAAI,CAACC,KAAK,CAAC;IACpB;IACA,OAAOA,KAAK,CAACT,IAAI;EACnB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,kBAAsC,GAAGJ,wBAAwB,CAAC,CAAC","ignoreList":[]}
|