@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,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EvalJsHost = EvalJsHost;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _screenTracker = require("../screenTracker.js");
|
|
10
|
+
var _absoluteFill = require("../surfaces/absoluteFill.js");
|
|
11
|
+
var _safeArea = require("../surfaces/safeArea.js");
|
|
12
|
+
var _bootstrap = require("./bootstrap.js");
|
|
13
|
+
var _bridgeMessages = require("./bridgeMessages.js");
|
|
14
|
+
var _evalJsBridge = require("./evalJsBridge.js");
|
|
15
|
+
var _evalJsController = require("./evalJsController.js");
|
|
16
|
+
var _getWebView = require("./getWebView.js");
|
|
17
|
+
var _useEvalJsWebViewInjection = require("./useEvalJsWebViewInjection.js");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
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); }
|
|
20
|
+
function screenFromLocation(location) {
|
|
21
|
+
if (!location) return {};
|
|
22
|
+
if ('path' in location) return location.path ? {
|
|
23
|
+
path: location.path
|
|
24
|
+
} : {};
|
|
25
|
+
return location.screen ? {
|
|
26
|
+
name: location.screen
|
|
27
|
+
} : {};
|
|
28
|
+
}
|
|
29
|
+
function useEvalJsScreen() {
|
|
30
|
+
const [screen, setScreen] = React.useState(() => screenFromLocation((0, _screenTracker.getCurrentScreenLocation)()));
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
return (0, _screenTracker.subscribeScreenLocation)(location => {
|
|
33
|
+
setScreen(screenFromLocation(location));
|
|
34
|
+
});
|
|
35
|
+
}, []);
|
|
36
|
+
return screen;
|
|
37
|
+
}
|
|
38
|
+
function clipFor(layout, viewport, suppressed) {
|
|
39
|
+
const fullWeb = {
|
|
40
|
+
width: viewport.width,
|
|
41
|
+
height: viewport.height,
|
|
42
|
+
backgroundColor: 'transparent'
|
|
43
|
+
};
|
|
44
|
+
const hidden = suppressed || layout.mode !== 'fitted' && layout.mode !== 'fullscreen';
|
|
45
|
+
if (hidden) {
|
|
46
|
+
return {
|
|
47
|
+
interactive: false,
|
|
48
|
+
outer: {
|
|
49
|
+
..._absoluteFill.ABSOLUTE_FILL,
|
|
50
|
+
opacity: 0
|
|
51
|
+
},
|
|
52
|
+
web: fullWeb
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (layout.mode === 'fullscreen') {
|
|
56
|
+
return {
|
|
57
|
+
interactive: true,
|
|
58
|
+
outer: _absoluteFill.ABSOLUTE_FILL,
|
|
59
|
+
web: fullWeb
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const rect = layout.rect;
|
|
63
|
+
if (!rect) {
|
|
64
|
+
return {
|
|
65
|
+
interactive: false,
|
|
66
|
+
outer: {
|
|
67
|
+
..._absoluteFill.ABSOLUTE_FILL,
|
|
68
|
+
opacity: 0
|
|
69
|
+
},
|
|
70
|
+
web: fullWeb
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
interactive: true,
|
|
75
|
+
outer: {
|
|
76
|
+
position: 'absolute',
|
|
77
|
+
left: rect.x,
|
|
78
|
+
top: rect.y,
|
|
79
|
+
width: rect.width,
|
|
80
|
+
height: rect.height,
|
|
81
|
+
overflow: 'hidden'
|
|
82
|
+
},
|
|
83
|
+
web: {
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
left: -rect.x,
|
|
86
|
+
top: -rect.y,
|
|
87
|
+
width: viewport.width,
|
|
88
|
+
height: viewport.height,
|
|
89
|
+
backgroundColor: 'transparent'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* One shared WebView for Evaluate JavaScript. Mounted by the SDK overlay,
|
|
96
|
+
* created on first use, destroyed on {@link evalJsController.reset}.
|
|
97
|
+
*
|
|
98
|
+
* Fitted mode clips a full-size WebView to the script's rectangle so the
|
|
99
|
+
* page viewport does not change (and the rest of the app still receives taps).
|
|
100
|
+
*/
|
|
101
|
+
function EvalJsHost({
|
|
102
|
+
suppressed
|
|
103
|
+
}) {
|
|
104
|
+
const snapshot = React.useSyncExternalStore(_evalJsController.evalJsController.subscribe, _evalJsController.evalJsController.getSnapshot, _evalJsController.evalJsController.getSnapshot);
|
|
105
|
+
if (!snapshot.active) return null;
|
|
106
|
+
if (snapshot.bannerOwnsWebView) return null;
|
|
107
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(EvalJsWebView, {
|
|
108
|
+
suppressed: suppressed,
|
|
109
|
+
generation: snapshot.generation,
|
|
110
|
+
pendingCount: snapshot.pendingCount,
|
|
111
|
+
layout: snapshot.layout,
|
|
112
|
+
host: snapshot.host
|
|
113
|
+
}, snapshot.generation);
|
|
114
|
+
}
|
|
115
|
+
function EvalJsWebView({
|
|
116
|
+
suppressed,
|
|
117
|
+
generation,
|
|
118
|
+
pendingCount,
|
|
119
|
+
layout,
|
|
120
|
+
host
|
|
121
|
+
}) {
|
|
122
|
+
const WebView = (0, _getWebView.getEvalJsWebView)();
|
|
123
|
+
const webRef = React.useRef(null);
|
|
124
|
+
const [pageReady, setPageReady] = React.useState(false);
|
|
125
|
+
const generationRef = React.useRef(generation);
|
|
126
|
+
const colorScheme = (0, _reactNative.useColorScheme)();
|
|
127
|
+
const viewport = (0, _reactNative.useWindowDimensions)();
|
|
128
|
+
const insets = (0, _safeArea.useUserflowSafeAreaInsets)();
|
|
129
|
+
const screen = useEvalJsScreen();
|
|
130
|
+
const context = React.useMemo(() => ({
|
|
131
|
+
platform: _reactNative.Platform.OS,
|
|
132
|
+
colorScheme: colorScheme === 'dark' ? 'dark' : 'light',
|
|
133
|
+
safeAreaInsets: insets,
|
|
134
|
+
viewport: {
|
|
135
|
+
width: viewport.width,
|
|
136
|
+
height: viewport.height
|
|
137
|
+
},
|
|
138
|
+
screen,
|
|
139
|
+
host
|
|
140
|
+
}), [colorScheme, host, insets, screen, viewport.height, viewport.width]);
|
|
141
|
+
const initialContext = React.useRef(context);
|
|
142
|
+
const html = React.useMemo(() => (0, _bootstrap.buildBootstrapHtml)(initialContext.current), []);
|
|
143
|
+
(0, _useEvalJsWebViewInjection.useEvalJsWebViewInjection)(webRef, {
|
|
144
|
+
pageReady,
|
|
145
|
+
context,
|
|
146
|
+
pendingCount
|
|
147
|
+
});
|
|
148
|
+
const openExternal = React.useCallback(url => {
|
|
149
|
+
if (!url || (0, _bootstrap.isBootstrapUrl)(url)) return;
|
|
150
|
+
(0, _evalJsBridge.getEvalJsBridgeHandlers)().openUrl(url);
|
|
151
|
+
}, []);
|
|
152
|
+
const onMessage = React.useCallback(event => {
|
|
153
|
+
if (generationRef.current !== generation) return;
|
|
154
|
+
const message = (0, _bridgeMessages.parseBridgeMessage)(event.nativeEvent.data);
|
|
155
|
+
if (!message) return;
|
|
156
|
+
const bridge = (0, _evalJsBridge.getEvalJsBridgeHandlers)();
|
|
157
|
+
switch (message.type) {
|
|
158
|
+
case 'ready':
|
|
159
|
+
setPageReady(true);
|
|
160
|
+
return;
|
|
161
|
+
case 'close':
|
|
162
|
+
_evalJsController.evalJsController.reset();
|
|
163
|
+
return;
|
|
164
|
+
case 'endFlow':
|
|
165
|
+
bridge.endFlow(_evalJsController.evalJsController.sessionIds());
|
|
166
|
+
_evalJsController.evalJsController.reset();
|
|
167
|
+
return;
|
|
168
|
+
case 'setLayout':
|
|
169
|
+
_evalJsController.evalJsController.setLayout(message.layout);
|
|
170
|
+
return;
|
|
171
|
+
case 'track':
|
|
172
|
+
bridge.track(message.name, message.attributes);
|
|
173
|
+
return;
|
|
174
|
+
case 'updateUser':
|
|
175
|
+
bridge.updateUser(message.attributes);
|
|
176
|
+
return;
|
|
177
|
+
case 'updateGroup':
|
|
178
|
+
bridge.updateGroup(message.attributes, message.options);
|
|
179
|
+
return;
|
|
180
|
+
case 'openUrl':
|
|
181
|
+
bridge.openUrl(message.url);
|
|
182
|
+
return;
|
|
183
|
+
case 'error':
|
|
184
|
+
bridge.warn((0, _evalJsBridge.formatEvalJsError)(message.message, message.code));
|
|
185
|
+
return;
|
|
186
|
+
default:
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
}, [generation]);
|
|
190
|
+
if (!WebView) return null;
|
|
191
|
+
const clip = clipFor(layout, {
|
|
192
|
+
width: viewport.width,
|
|
193
|
+
height: viewport.height
|
|
194
|
+
}, suppressed);
|
|
195
|
+
const debugging = typeof __DEV__ !== 'undefined' && __DEV__ ? true : undefined;
|
|
196
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
197
|
+
pointerEvents: "box-none",
|
|
198
|
+
style: _absoluteFill.ABSOLUTE_FILL,
|
|
199
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
200
|
+
pointerEvents: clip.interactive ? 'auto' : 'none',
|
|
201
|
+
style: clip.outer,
|
|
202
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(WebView, {
|
|
203
|
+
ref: webRef,
|
|
204
|
+
source: {
|
|
205
|
+
html,
|
|
206
|
+
baseUrl: _bootstrap.EVAL_JS_BASE_URL
|
|
207
|
+
},
|
|
208
|
+
style: clip.web,
|
|
209
|
+
pointerEvents: clip.interactive ? 'auto' : 'none',
|
|
210
|
+
originWhitelist: ['*'],
|
|
211
|
+
javaScriptEnabled: true,
|
|
212
|
+
domStorageEnabled: true,
|
|
213
|
+
scrollEnabled: false,
|
|
214
|
+
bounces: false,
|
|
215
|
+
showsHorizontalScrollIndicator: false,
|
|
216
|
+
showsVerticalScrollIndicator: false,
|
|
217
|
+
mediaPlaybackRequiresUserAction: false,
|
|
218
|
+
allowsInlineMediaPlayback: true,
|
|
219
|
+
setSupportMultipleWindows: false,
|
|
220
|
+
androidLayerType: "hardware",
|
|
221
|
+
...(debugging !== undefined ? {
|
|
222
|
+
webviewDebuggingEnabled: debugging
|
|
223
|
+
} : {}),
|
|
224
|
+
onMessage: onMessage,
|
|
225
|
+
onShouldStartLoadWithRequest: request => {
|
|
226
|
+
if ((0, _bootstrap.isBootstrapUrl)(request.url)) return true;
|
|
227
|
+
openExternal(request.url);
|
|
228
|
+
return false;
|
|
229
|
+
},
|
|
230
|
+
onOpenWindow: event => {
|
|
231
|
+
const url = event.nativeEvent.targetUrl;
|
|
232
|
+
if (url) openExternal(url);
|
|
233
|
+
},
|
|
234
|
+
onError: event => {
|
|
235
|
+
const description = event.nativeEvent.description;
|
|
236
|
+
if (description) {
|
|
237
|
+
(0, _evalJsBridge.getEvalJsBridgeHandlers)().warn((0, _evalJsBridge.formatEvalJsError)(description));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=EvalJsHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_screenTracker","_absoluteFill","_safeArea","_bootstrap","_bridgeMessages","_evalJsBridge","_evalJsController","_getWebView","_useEvalJsWebViewInjection","_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","clipFor","layout","viewport","suppressed","fullWeb","width","height","backgroundColor","hidden","mode","interactive","outer","ABSOLUTE_FILL","opacity","web","rect","position","left","x","top","y","overflow","EvalJsHost","snapshot","useSyncExternalStore","evalJsController","subscribe","getSnapshot","active","bannerOwnsWebView","jsx","EvalJsWebView","generation","pendingCount","host","WebView","getEvalJsWebView","webRef","useRef","pageReady","setPageReady","generationRef","colorScheme","useColorScheme","useWindowDimensions","insets","useUserflowSafeAreaInsets","context","useMemo","platform","Platform","OS","safeAreaInsets","initialContext","html","buildBootstrapHtml","current","useEvalJsWebViewInjection","openExternal","useCallback","url","isBootstrapUrl","getEvalJsBridgeHandlers","openUrl","onMessage","event","message","parseBridgeMessage","nativeEvent","data","bridge","type","reset","endFlow","sessionIds","setLayout","track","attributes","updateUser","updateGroup","options","warn","formatEvalJsError","code","clip","debugging","__DEV__","undefined","View","pointerEvents","style","children","ref","source","baseUrl","EVAL_JS_BASE_URL","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,IAAAA,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AiB,EAAC+B,WAAW,CAAC,CAAC;UAChE;QACF;MAAE,CACH;IAAC,CACE;EAAC,CACH,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EVAL_JS_BASE_URL = void 0;
|
|
7
|
+
exports.buildBootstrapHtml = buildBootstrapHtml;
|
|
8
|
+
exports.contextUpdateScript = contextUpdateScript;
|
|
9
|
+
exports.isBootstrapUrl = isBootstrapUrl;
|
|
10
|
+
exports.wrapCode = wrapCode;
|
|
11
|
+
/** Document URL of the empty page that hosts customer scripts. */
|
|
12
|
+
const EVAL_JS_BASE_URL = exports.EVAL_JS_BASE_URL = 'https://userflow.local/';
|
|
13
|
+
function isBootstrapUrl(url) {
|
|
14
|
+
if (!url || url === 'about:blank' || url.startsWith('about:blank')) return true;
|
|
15
|
+
if (url.startsWith('data:text/html')) return true;
|
|
16
|
+
return url === EVAL_JS_BASE_URL || url.startsWith(EVAL_JS_BASE_URL);
|
|
17
|
+
}
|
|
18
|
+
function embedJson(value) {
|
|
19
|
+
return JSON.stringify(value).replace(/</g, '\\u003c');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Empty transparent page plus the `window.userflow` bridge.
|
|
24
|
+
* The bridge runs in the document itself, before any customer code is injected.
|
|
25
|
+
*/
|
|
26
|
+
function buildBootstrapHtml(context, bodyHtml = '') {
|
|
27
|
+
const contextJson = embedJson(context);
|
|
28
|
+
return `<!DOCTYPE html>
|
|
29
|
+
<html>
|
|
30
|
+
<head>
|
|
31
|
+
<meta charset="utf-8" />
|
|
32
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
33
|
+
<style>
|
|
34
|
+
html, body { margin: 0; padding: 0; background: transparent; }
|
|
35
|
+
</style>
|
|
36
|
+
<script>
|
|
37
|
+
(function () {
|
|
38
|
+
function post(msg) {
|
|
39
|
+
try {
|
|
40
|
+
if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
|
|
41
|
+
window.ReactNativeWebView.postMessage(JSON.stringify(Object.assign({ __userflow: 1 }, msg)));
|
|
42
|
+
}
|
|
43
|
+
} catch (e) {}
|
|
44
|
+
}
|
|
45
|
+
window.__userflowApplyContext = function (next) {
|
|
46
|
+
window.userflowContext = next || {};
|
|
47
|
+
try { window.dispatchEvent(new Event('userflow:contextchange')); } catch (e) {}
|
|
48
|
+
};
|
|
49
|
+
window.__userflowApplyContext(${contextJson});
|
|
50
|
+
window.userflow = {
|
|
51
|
+
track: function (name, attributes) { post({ type: 'track', name: name, attributes: attributes }); },
|
|
52
|
+
updateUser: function (attributes) { post({ type: 'updateUser', attributes: attributes }); },
|
|
53
|
+
updateGroup: function (attributes, options) { post({ type: 'updateGroup', attributes: attributes, options: options }); },
|
|
54
|
+
openUrl: function (url) { post({ type: 'openUrl', url: String(url || '') }); },
|
|
55
|
+
close: function () { post({ type: 'close' }); },
|
|
56
|
+
endFlow: function () { post({ type: 'endFlow' }); },
|
|
57
|
+
setLayout: function (layout) { post({ type: 'setLayout', layout: layout }); }
|
|
58
|
+
};
|
|
59
|
+
window.addEventListener('error', function (event) {
|
|
60
|
+
post({ type: 'error', message: String((event && event.message) || 'error') });
|
|
61
|
+
});
|
|
62
|
+
post({ type: 'ready' });
|
|
63
|
+
})();
|
|
64
|
+
</script>
|
|
65
|
+
</head>
|
|
66
|
+
<body>${bodyHtml}</body>
|
|
67
|
+
</html>`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Push a fresh `userflowContext` and notify scripts. Does not reload the page. */
|
|
71
|
+
function contextUpdateScript(context) {
|
|
72
|
+
return `window.__userflowApplyContext&&window.__userflowApplyContext(${embedJson(context)});true;`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Same execution model as web userflow.js: `new Function('"use strict";\\n' + code)`.
|
|
77
|
+
* The code is a JSON string literal so it cannot break out of the wrapper.
|
|
78
|
+
* `true;` is required so `injectJavaScript` settles on iOS.
|
|
79
|
+
*/
|
|
80
|
+
function wrapCode(code) {
|
|
81
|
+
const literal = embedJson(code);
|
|
82
|
+
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;`;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EVAL_JS_BASE_URL","exports","isBootstrapUrl","url","startsWith","embedJson","value","JSON","stringify","replace","buildBootstrapHtml","context","bodyHtml","contextJson","contextUpdateScript","wrapCode","code","literal"],"sourceRoot":"../../../src","sources":["evalJs/bootstrap.ts"],"mappings":";;;;;;;;;;AAEA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,yBAAyB;AAElD,SAASE,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,KAAKH,gBAAgB,IAAIG,GAAG,CAACC,UAAU,CAACJ,gBAAgB,CAAC;AACrE;AAEA,SAASK,SAASA,CAACC,KAAc,EAAU;EACzC,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC,CAACG,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACO,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;AACO,SAASE,mBAAmBA,CAACH,OAAsB,EAAU;EAClE,OAAO,gEAAgEN,SAAS,CAACM,OAAO,CAAC,SAAS;AACpG;;AAEA;AACA;AACA;AACA;AACA;AACO,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,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseBridgeMessage = parseBridgeMessage;
|
|
7
|
+
const MESSAGE_TYPES = new Set(['ready', 'close', 'endFlow', 'setLayout', 'track', 'updateUser', 'updateGroup', 'openUrl', 'error']);
|
|
8
|
+
/**
|
|
9
|
+
* Accept only JSON objects tagged `__userflow: 1` with an allowlisted type.
|
|
10
|
+
* Anything else (page noise, unexpected shapes) is ignored.
|
|
11
|
+
*/
|
|
12
|
+
function parseBridgeMessage(raw) {
|
|
13
|
+
let value = raw;
|
|
14
|
+
if (typeof raw === 'string') {
|
|
15
|
+
try {
|
|
16
|
+
value = JSON.parse(raw);
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (value == null || typeof value !== 'object' || Array.isArray(value)) return null;
|
|
22
|
+
const record = value;
|
|
23
|
+
if (record.__userflow !== 1) return null;
|
|
24
|
+
if (typeof record.type !== 'string' || !MESSAGE_TYPES.has(record.type)) return null;
|
|
25
|
+
switch (record.type) {
|
|
26
|
+
case 'ready':
|
|
27
|
+
return {
|
|
28
|
+
type: 'ready'
|
|
29
|
+
};
|
|
30
|
+
case 'close':
|
|
31
|
+
return {
|
|
32
|
+
type: 'close'
|
|
33
|
+
};
|
|
34
|
+
case 'endFlow':
|
|
35
|
+
return {
|
|
36
|
+
type: 'endFlow'
|
|
37
|
+
};
|
|
38
|
+
case 'error':
|
|
39
|
+
return {
|
|
40
|
+
type: 'error',
|
|
41
|
+
message: typeof record.message === 'string' ? record.message : 'error',
|
|
42
|
+
...(typeof record.code === 'string' ? {
|
|
43
|
+
code: record.code
|
|
44
|
+
} : {})
|
|
45
|
+
};
|
|
46
|
+
case 'openUrl':
|
|
47
|
+
if (typeof record.url !== 'string' || record.url.length === 0) return null;
|
|
48
|
+
return {
|
|
49
|
+
type: 'openUrl',
|
|
50
|
+
url: record.url
|
|
51
|
+
};
|
|
52
|
+
case 'track':
|
|
53
|
+
{
|
|
54
|
+
if (typeof record.name !== 'string' || record.name.length === 0) return null;
|
|
55
|
+
if (record.attributes != null && !isRecord(record.attributes)) return null;
|
|
56
|
+
return {
|
|
57
|
+
type: 'track',
|
|
58
|
+
name: record.name,
|
|
59
|
+
...(isRecord(record.attributes) ? {
|
|
60
|
+
attributes: record.attributes
|
|
61
|
+
} : {})
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
case 'updateUser':
|
|
65
|
+
{
|
|
66
|
+
if (!isRecord(record.attributes)) return null;
|
|
67
|
+
return {
|
|
68
|
+
type: 'updateUser',
|
|
69
|
+
attributes: record.attributes
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
case 'updateGroup':
|
|
73
|
+
{
|
|
74
|
+
if (!isRecord(record.attributes)) return null;
|
|
75
|
+
const options = record.options;
|
|
76
|
+
if (options == null) return {
|
|
77
|
+
type: 'updateGroup',
|
|
78
|
+
attributes: record.attributes
|
|
79
|
+
};
|
|
80
|
+
if (!isRecord(options)) return null;
|
|
81
|
+
if (options.membership != null && !isRecord(options.membership)) return null;
|
|
82
|
+
return {
|
|
83
|
+
type: 'updateGroup',
|
|
84
|
+
attributes: record.attributes,
|
|
85
|
+
...(isRecord(options.membership) ? {
|
|
86
|
+
options: {
|
|
87
|
+
membership: options.membership
|
|
88
|
+
}
|
|
89
|
+
} : {})
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case 'setLayout':
|
|
93
|
+
{
|
|
94
|
+
const layout = parseLayout(record.layout);
|
|
95
|
+
if (!layout) return null;
|
|
96
|
+
return {
|
|
97
|
+
type: 'setLayout',
|
|
98
|
+
layout
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
default:
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function parseLayout(value) {
|
|
106
|
+
if (!isRecord(value)) return null;
|
|
107
|
+
if (value.mode === 'hidden' || value.mode === 'fullscreen') {
|
|
108
|
+
return {
|
|
109
|
+
mode: value.mode
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (value.mode !== 'fitted') return null;
|
|
113
|
+
const rect = parseRect(value.rect);
|
|
114
|
+
if (!rect) return null;
|
|
115
|
+
return {
|
|
116
|
+
mode: 'fitted',
|
|
117
|
+
rect
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function parseRect(value) {
|
|
121
|
+
if (!isRecord(value)) return null;
|
|
122
|
+
const x = value.x;
|
|
123
|
+
const y = value.y;
|
|
124
|
+
const width = value.width;
|
|
125
|
+
const height = value.height;
|
|
126
|
+
if (!isFiniteNumber(x) || !isFiniteNumber(y) || !isFiniteNumber(width) || !isFiniteNumber(height)) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
if (width <= 0 || height <= 0) return null;
|
|
130
|
+
return {
|
|
131
|
+
x,
|
|
132
|
+
y,
|
|
133
|
+
width,
|
|
134
|
+
height
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function isRecord(value) {
|
|
138
|
+
return value != null && typeof value === 'object' && !Array.isArray(value);
|
|
139
|
+
}
|
|
140
|
+
function isFiniteNumber(value) {
|
|
141
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
142
|
+
}
|
|
143
|
+
//# 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;AACO,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,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OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAI4B,MAAM,CAACC,QAAQ,CAAC7B,KAAK,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatEvalJsError = formatEvalJsError;
|
|
7
|
+
exports.getEvalJsBridgeHandlers = getEvalJsBridgeHandlers;
|
|
8
|
+
exports.setEvalJsBridgeHandlers = setEvalJsBridgeHandlers;
|
|
9
|
+
/** Calls into the public SDK without importing the facade (that would cycle). */
|
|
10
|
+
|
|
11
|
+
const noopHandlers = {
|
|
12
|
+
track: () => undefined,
|
|
13
|
+
updateUser: () => undefined,
|
|
14
|
+
updateGroup: () => undefined,
|
|
15
|
+
openUrl: () => undefined,
|
|
16
|
+
endFlow: () => undefined,
|
|
17
|
+
warn: message => {
|
|
18
|
+
console.warn(message);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
let handlers = noopHandlers;
|
|
22
|
+
function setEvalJsBridgeHandlers(next) {
|
|
23
|
+
handlers = next ?? noopHandlers;
|
|
24
|
+
}
|
|
25
|
+
function getEvalJsBridgeHandlers() {
|
|
26
|
+
return handlers;
|
|
27
|
+
}
|
|
28
|
+
function formatEvalJsError(message, code) {
|
|
29
|
+
return `Userflow: Evaluate JavaScript action failed.\n\n` + `Error:\n${message}\n\n` + `Code:\n${code ?? ''}`;
|
|
30
|
+
}
|
|
31
|
+
//# 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;AAE1C,SAASW,uBAAuBA,CAACC,IAAiC,EAAQ;EAC/EF,QAAQ,GAAGE,IAAI,IAAIZ,YAAY;AACjC;AAEO,SAASa,uBAAuBA,CAAA,EAAyB;EAC9D,OAAOH,QAAQ;AACjB;AAEO,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,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.evalJsController = void 0;
|
|
7
|
+
exports.resetEvalJsControllerForTests = resetEvalJsControllerForTests;
|
|
8
|
+
const HIDDEN = {
|
|
9
|
+
mode: 'hidden'
|
|
10
|
+
};
|
|
11
|
+
let generation = 0;
|
|
12
|
+
let active = false;
|
|
13
|
+
let pending = [];
|
|
14
|
+
/** Sessions whose scripts ran in the current WebView; `endFlow` may only end one of these. */
|
|
15
|
+
let sessionIds = new Set();
|
|
16
|
+
let layout = HIDDEN;
|
|
17
|
+
let host = {};
|
|
18
|
+
let bannerOwnsWebView = false;
|
|
19
|
+
const listeners = new Set();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Cached for `useSyncExternalStore`: React re-renders forever if getSnapshot
|
|
23
|
+
* returns a new object while nothing changed.
|
|
24
|
+
*/
|
|
25
|
+
let currentSnapshot = {
|
|
26
|
+
active,
|
|
27
|
+
generation,
|
|
28
|
+
pendingCount: 0,
|
|
29
|
+
layout,
|
|
30
|
+
host,
|
|
31
|
+
bannerOwnsWebView
|
|
32
|
+
};
|
|
33
|
+
function emit() {
|
|
34
|
+
currentSnapshot = {
|
|
35
|
+
active,
|
|
36
|
+
generation,
|
|
37
|
+
pendingCount: pending.length,
|
|
38
|
+
layout,
|
|
39
|
+
host,
|
|
40
|
+
bannerOwnsWebView
|
|
41
|
+
};
|
|
42
|
+
for (const listener of listeners) {
|
|
43
|
+
listener();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const evalJsController = exports.evalJsController = {
|
|
47
|
+
subscribe(listener) {
|
|
48
|
+
listeners.add(listener);
|
|
49
|
+
return () => {
|
|
50
|
+
listeners.delete(listener);
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
getSnapshot() {
|
|
54
|
+
return currentSnapshot;
|
|
55
|
+
},
|
|
56
|
+
enqueue(request) {
|
|
57
|
+
if (!request.code) return;
|
|
58
|
+
pending = [...pending, request.code];
|
|
59
|
+
sessionIds.add(request.sessionId);
|
|
60
|
+
active = true;
|
|
61
|
+
emit();
|
|
62
|
+
},
|
|
63
|
+
sessionIds() {
|
|
64
|
+
return new Set(sessionIds);
|
|
65
|
+
},
|
|
66
|
+
/** Codes waiting to be injected. Clears the queue. */
|
|
67
|
+
consumePending() {
|
|
68
|
+
if (pending.length === 0) return [];
|
|
69
|
+
const codes = pending;
|
|
70
|
+
pending = [];
|
|
71
|
+
emit();
|
|
72
|
+
return codes;
|
|
73
|
+
},
|
|
74
|
+
setLayout(next) {
|
|
75
|
+
layout = next;
|
|
76
|
+
emit();
|
|
77
|
+
},
|
|
78
|
+
/** App-supplied values exposed as `userflowContext.host`. Survives reset. */
|
|
79
|
+
setHostContext(values) {
|
|
80
|
+
host = {
|
|
81
|
+
...values
|
|
82
|
+
};
|
|
83
|
+
emit();
|
|
84
|
+
},
|
|
85
|
+
/** Custom banner WebView is the sole eval page (no overlay EvalJsHost). */
|
|
86
|
+
setBannerOwnsWebView(owns) {
|
|
87
|
+
bannerOwnsWebView = owns;
|
|
88
|
+
emit();
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* Destroy the shared WebView and drop queued code. Host context stays so the
|
|
92
|
+
* next script still sees language / tab-bar height the app provided.
|
|
93
|
+
*/
|
|
94
|
+
reset() {
|
|
95
|
+
generation += 1;
|
|
96
|
+
active = false;
|
|
97
|
+
pending = [];
|
|
98
|
+
sessionIds = new Set();
|
|
99
|
+
layout = HIDDEN;
|
|
100
|
+
bannerOwnsWebView = false;
|
|
101
|
+
emit();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
function resetEvalJsControllerForTests() {
|
|
107
|
+
generation = 0;
|
|
108
|
+
active = false;
|
|
109
|
+
pending = [];
|
|
110
|
+
sessionIds = new Set();
|
|
111
|
+
layout = HIDDEN;
|
|
112
|
+
host = {};
|
|
113
|
+
bannerOwnsWebView = false;
|
|
114
|
+
listeners.clear();
|
|
115
|
+
currentSnapshot = {
|
|
116
|
+
active,
|
|
117
|
+
generation,
|
|
118
|
+
pendingCount: 0,
|
|
119
|
+
layout,
|
|
120
|
+
host,
|
|
121
|
+
bannerOwnsWebView
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//# 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","exports","subscribe","add","delete","getSnapshot","enqueue","request","code","sessionId","consumePending","codes","setLayout","next","setHostContext","values","setBannerOwnsWebView","owns","reset","resetEvalJsControllerForTests","clear"],"sourceRoot":"../../../src","sources":["evalJs/eval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