@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,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Topmost host fiber under a window point.
|
|
5
|
+
*
|
|
6
|
+
* Spike (RN 0.86 source, not a device run):
|
|
7
|
+
* - `findNodeAtPoint` is registered unconditionally in `UIManagerBinding.cpp`,
|
|
8
|
+
* and `ReactFabric-prod.js` already calls `nativeFabricUIManager`. The DEV
|
|
9
|
+
* inspector is the only JS caller, but the native method is present in
|
|
10
|
+
* release builds. Call it directly and feature-detect.
|
|
11
|
+
* - `pointerEvents="none"` fails `canBeTouchTarget` and
|
|
12
|
+
* `canChildrenBeTouchTarget`, so a decorative backdrop is not returned
|
|
13
|
+
* (see `FindNodeAtPointTest.overlappingViewsWithParentPointerEventsNone`).
|
|
14
|
+
* - Scroll views subtract `contentOffset` in `getContentOriginOffset`, so
|
|
15
|
+
* content scrolled out of the viewport is not a hit.
|
|
16
|
+
* - Modal content lives under `ModalHostView` in the same shadow tree, but
|
|
17
|
+
* its frame is relative to the modal window. If the root hit misses the
|
|
18
|
+
* visible modal's subtree, retry rooted at that modal.
|
|
19
|
+
* - Screens a navigator covers stay laid out in the shadow tree, on top of the
|
|
20
|
+
* visible one, and react-native-screens clears their zIndex, so the
|
|
21
|
+
* last-mounted sibling wins. After visiting a later tab, a tap on an earlier
|
|
22
|
+
* one lands on the hidden tab. Retry rooted at the visible screen.
|
|
23
|
+
*/
|
|
24
|
+
import { UIManager } from 'react-native';
|
|
25
|
+
import { fiberScanRoot } from "../anchors/fiber/FiberScanRoot.js";
|
|
26
|
+
import { coerceToFiber, getStateNode, isReactFiber, nativeTagFromHostFiber, resolveCurrentFiber } from "../anchors/fiber/fiberInternals.js";
|
|
27
|
+
import { nearestHostDescendant } from "../anchors/fiber/findAnchorFiber.js";
|
|
28
|
+
import { createHostFiberIndex } from "../anchors/fiber/indexHostFibers.js";
|
|
29
|
+
import { measureHostFiber } from "../anchors/fiber/measureHostFiber.js";
|
|
30
|
+
import { fiberIsUnder, topmostVisibleModalHost } from "../anchors/fiber/visibleRect.js";
|
|
31
|
+
import { isFiberOnVisibleScreen, screensCoveringFiber } from "../anchors/fiber/visibleScreens.js";
|
|
32
|
+
const HIT_TIMEOUT_MS = 400;
|
|
33
|
+
|
|
34
|
+
/** Re-hits allowed while a hit keeps landing on a covered screen (one per nesting level). */
|
|
35
|
+
const MAX_COVERED_SCREEN_RETRIES = 4;
|
|
36
|
+
function fabricManager() {
|
|
37
|
+
const manager = globalThis.nativeFabricUIManager;
|
|
38
|
+
if (!manager || typeof manager.findNodeAtPoint !== 'function') return null;
|
|
39
|
+
return manager;
|
|
40
|
+
}
|
|
41
|
+
function paperManager() {
|
|
42
|
+
const manager = UIManager;
|
|
43
|
+
if (!manager || typeof manager.findSubviewIn !== 'function') return null;
|
|
44
|
+
return manager;
|
|
45
|
+
}
|
|
46
|
+
function shadowNodeFromHost(fiber) {
|
|
47
|
+
const stateNode = getStateNode(fiber);
|
|
48
|
+
if (!stateNode || typeof stateNode !== 'object') return null;
|
|
49
|
+
const node = stateNode;
|
|
50
|
+
return node.node ?? node.canonical?.node ?? null;
|
|
51
|
+
}
|
|
52
|
+
function fiberFromInstanceHandle(handle) {
|
|
53
|
+
if (isReactFiber(handle)) {
|
|
54
|
+
try {
|
|
55
|
+
return resolveCurrentFiber(handle);
|
|
56
|
+
} catch {
|
|
57
|
+
return handle;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const coerced = coerceToFiber(handle);
|
|
61
|
+
if (coerced) return coerced;
|
|
62
|
+
if (!handle || typeof handle !== 'object') return null;
|
|
63
|
+
const record = handle;
|
|
64
|
+
const nested = record.stateNode?.canonical?.internalInstanceHandle;
|
|
65
|
+
if (isReactFiber(nested)) return resolveCurrentFiber(nested);
|
|
66
|
+
return coerceToFiber(nested);
|
|
67
|
+
}
|
|
68
|
+
function withTimeout(run, fallback) {
|
|
69
|
+
return new Promise(resolve => {
|
|
70
|
+
let settled = false;
|
|
71
|
+
const timer = setTimeout(() => {
|
|
72
|
+
if (settled) return;
|
|
73
|
+
settled = true;
|
|
74
|
+
resolve(fallback);
|
|
75
|
+
}, HIT_TIMEOUT_MS);
|
|
76
|
+
const settle = value => {
|
|
77
|
+
if (settled) return;
|
|
78
|
+
settled = true;
|
|
79
|
+
clearTimeout(timer);
|
|
80
|
+
resolve(value);
|
|
81
|
+
};
|
|
82
|
+
try {
|
|
83
|
+
run(settle);
|
|
84
|
+
} catch {
|
|
85
|
+
settle(fallback);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function measureOrigin(fiber) {
|
|
90
|
+
return withTimeout(settle => {
|
|
91
|
+
measureHostFiber(fiber, (x, y, width, height) => {
|
|
92
|
+
if (width <= 0 && height <= 0 && x === 0 && y === 0) {
|
|
93
|
+
settle(null);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
settle({
|
|
97
|
+
x,
|
|
98
|
+
y
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}, null);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* `node`'s origin within its parent. `findNodeAtPoint` tests the point against
|
|
106
|
+
* `node`'s own frame, which is in parent coordinates. Zero when `measure` is
|
|
107
|
+
* unavailable, which is exact for a node at its parent's origin.
|
|
108
|
+
*/
|
|
109
|
+
function originInParent(manager, node) {
|
|
110
|
+
const measure = manager.measure;
|
|
111
|
+
const none = {
|
|
112
|
+
x: 0,
|
|
113
|
+
y: 0
|
|
114
|
+
};
|
|
115
|
+
if (typeof measure !== 'function') return Promise.resolve(none);
|
|
116
|
+
return withTimeout(settle => {
|
|
117
|
+
measure.call(manager, node, (x, y) => {
|
|
118
|
+
settle(Number.isFinite(x) && Number.isFinite(y) ? {
|
|
119
|
+
x,
|
|
120
|
+
y
|
|
121
|
+
} : none);
|
|
122
|
+
});
|
|
123
|
+
}, none);
|
|
124
|
+
}
|
|
125
|
+
async function hitFabric(rootHost, x, y) {
|
|
126
|
+
const manager = fabricManager();
|
|
127
|
+
const node = shadowNodeFromHost(rootHost);
|
|
128
|
+
if (!manager || node == null) return null;
|
|
129
|
+
const origin = await measureOrigin(rootHost);
|
|
130
|
+
if (!origin) return null;
|
|
131
|
+
const inParent = await originInParent(manager, node);
|
|
132
|
+
const handle = await withTimeout(settle => {
|
|
133
|
+
manager.findNodeAtPoint(node, x - origin.x + inParent.x, y - origin.y + inParent.y, settle);
|
|
134
|
+
}, null);
|
|
135
|
+
if (!handle) return null;
|
|
136
|
+
return fiberFromInstanceHandle(handle);
|
|
137
|
+
}
|
|
138
|
+
async function hitPaper(rootHost, x, y) {
|
|
139
|
+
const manager = paperManager();
|
|
140
|
+
const tag = nativeTagFromHostFiber(rootHost);
|
|
141
|
+
if (!manager || tag === undefined) return null;
|
|
142
|
+
// `findSubviewIn` hit-tests in the view's own coordinates (iOS `hitTest:`,
|
|
143
|
+
// Android `TouchTargetHelper`). The window root sits at the window origin; a
|
|
144
|
+
// nested screen does not. Unmeasurable falls back to the window point.
|
|
145
|
+
const origin = (await measureOrigin(rootHost)) ?? {
|
|
146
|
+
x: 0,
|
|
147
|
+
y: 0
|
|
148
|
+
};
|
|
149
|
+
const nativeTag = await withTimeout(settle => {
|
|
150
|
+
manager.findSubviewIn(tag, [x - origin.x, y - origin.y], found => {
|
|
151
|
+
settle(typeof found === 'number' ? found : null);
|
|
152
|
+
});
|
|
153
|
+
}, null);
|
|
154
|
+
if (nativeTag == null) return null;
|
|
155
|
+
const index = createHostFiberIndex(fiberScanRoot.getFiber());
|
|
156
|
+
return index.byNativeTag.get(nativeTag) ?? null;
|
|
157
|
+
}
|
|
158
|
+
async function hitUnder(rootHost, x, y) {
|
|
159
|
+
const fabric = await hitFabric(rootHost, x, y);
|
|
160
|
+
if (fabric) return fabric;
|
|
161
|
+
return hitPaper(rootHost, x, y);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** {@link hitUnder}, re-hit from the visible screen while the hit lands on a covered one. */
|
|
165
|
+
async function hitOnVisibleScreen(rootHost, x, y) {
|
|
166
|
+
let hit = await hitUnder(rootHost, x, y);
|
|
167
|
+
for (let attempt = 0; hit && attempt < MAX_COVERED_SCREEN_RETRIES; attempt += 1) {
|
|
168
|
+
const screens = screensCoveringFiber(hit);
|
|
169
|
+
if (screens.length === 0) return hit;
|
|
170
|
+
let next = null;
|
|
171
|
+
for (const screen of screens) {
|
|
172
|
+
next = await hitUnder(screen, x, y);
|
|
173
|
+
if (next) break;
|
|
174
|
+
}
|
|
175
|
+
hit = next;
|
|
176
|
+
}
|
|
177
|
+
// Still on a covered screen: report no hit so the caller uses geometry.
|
|
178
|
+
return hit && isFiberOnVisibleScreen(hit) ? hit : null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Host fiber drawn on top at window coordinates, or null when neither Fabric
|
|
183
|
+
* nor Paper hit-testing is available.
|
|
184
|
+
*/
|
|
185
|
+
export async function hostAtPoint(x, y) {
|
|
186
|
+
const root = fiberScanRoot.getFiber();
|
|
187
|
+
if (!root) return null;
|
|
188
|
+
const rootHost = nearestHostDescendant(root);
|
|
189
|
+
if (!rootHost) return null;
|
|
190
|
+
let hit = await hitOnVisibleScreen(rootHost, x, y);
|
|
191
|
+
const modal = topmostVisibleModalHost(root);
|
|
192
|
+
const modalHost = modal ? nearestHostDescendant(modal) : null;
|
|
193
|
+
if (modalHost && (!hit || !fiberIsUnder(hit, modal))) {
|
|
194
|
+
const modalHit = await hitOnVisibleScreen(modalHost, x, y);
|
|
195
|
+
if (modalHit) hit = modalHit;
|
|
196
|
+
}
|
|
197
|
+
return hit;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=hostAtPoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UIManager","fiberScanRoot","coerceToFiber","getStateNode","isReactFiber","nativeTagFromHostFiber","resolveCurrentFiber","nearestHostDescendant","createHostFiberIndex","measureHostFiber","fiberIsUnder","topmostVisibleModalHost","isFiberOnVisibleScreen","screensCoveringFiber","HIT_TIMEOUT_MS","MAX_COVERED_SCREEN_RETRIES","fabricManager","manager","globalThis","nativeFabricUIManager","findNodeAtPoint","paperManager","findSubviewIn","shadowNodeFromHost","fiber","stateNode","node","canonical","fiberFromInstanceHandle","handle","coerced","record","nested","internalInstanceHandle","withTimeout","run","fallback","Promise","resolve","settled","timer","setTimeout","settle","value","clearTimeout","measureOrigin","x","y","width","height","originInParent","measure","none","call","Number","isFinite","hitFabric","rootHost","origin","inParent","hitPaper","tag","undefined","nativeTag","found","index","getFiber","byNativeTag","get","hitUnder","fabric","hitOnVisibleScreen","hit","attempt","screens","length","next","screen","hostAtPoint","root","modal","modalHost","modalHit"],"sourceRoot":"../../../src","sources":["authoring/hostAtPoint.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,cAAc;AAExC,SAASC,aAAa,QAAQ,mCAAgC;AAC9D,SAEEC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,sBAAsB,EACtBC,mBAAmB,QACd,oCAAiC;AACxC,SAASC,qBAAqB,QAAQ,qCAAkC;AACxE,SAASC,oBAAoB,QAAQ,qCAAkC;AACvE,SAAS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ACd,QAAQ,EAAEX,CAAC,EAAEC,CAAC,CAAC;EAClD,MAAMiC,KAAK,GAAGrE,uBAAuB,CAACoE,IAAI,CAAC;EAC3C,MAAME,SAAS,GAAGD,KAAK,GAAGzE,qBAAqB,CAACyE,KAAK,CAAC,GAAG,IAAI;EAC7D,IAAIC,SAAS,KAAK,CAACT,GAAG,IAAI,CAAC9D,YAAY,CAAC8D,GAAG,EAAEQ,KAAK,CAAC,CAAC,EAAE;IACpD,MAAME,QAAQ,GAAG,MAAMX,kBAAkB,CAACU,SAAS,EAAEnC,CAAC,EAAEC,CAAC,CAAC;IAC1D,IAAImC,QAAQ,EAAEV,GAAG,GAAGU,QAAQ;EAC9B;EACA,OAAOV,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { interpolateSessionData } from '@userflow-tech/core';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { Platform, Pressable, StyleSheet, Text } from 'react-native';
|
|
6
|
+
import { resolveBannerBackgroundColor, resolveBannerForegroundColor } from "../surfaces/resolveBannerTheme.js";
|
|
7
|
+
import { resolveBannerButtonChrome } from "./resolveBannerButtonChrome.js";
|
|
8
|
+
import { stepButtonContainerStyle } from "./resolveStepButtonChrome.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/** Step actions on the embed banner bar (Figma SDK Embed Banner). */
|
|
11
|
+
export function BannerStepButton({
|
|
12
|
+
button,
|
|
13
|
+
theme,
|
|
14
|
+
sessionData,
|
|
15
|
+
onActions
|
|
16
|
+
}) {
|
|
17
|
+
const label = interpolateSessionData(button.text, sessionData);
|
|
18
|
+
const bannerBackground = resolveBannerBackgroundColor(theme);
|
|
19
|
+
const bannerForeground = resolveBannerForegroundColor(theme);
|
|
20
|
+
const chrome = resolveBannerButtonChrome(theme, button.appearance, bannerBackground, bannerForeground);
|
|
21
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
22
|
+
testID: `userflow-button-${button.cvid}`,
|
|
23
|
+
accessibilityRole: "button",
|
|
24
|
+
accessibilityLabel: label,
|
|
25
|
+
onPress: () => onActions(button.actions),
|
|
26
|
+
style: ({
|
|
27
|
+
pressed
|
|
28
|
+
}) => [styles.button, stepButtonContainerStyle(chrome), {
|
|
29
|
+
opacity: pressed ? 0.88 : 1
|
|
30
|
+
}],
|
|
31
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
32
|
+
style: [styles.label, {
|
|
33
|
+
color: chrome.fontColor,
|
|
34
|
+
fontFamily: theme.fontFamily || undefined,
|
|
35
|
+
fontSize: chrome.fontSize,
|
|
36
|
+
fontWeight: chrome.fontWeight,
|
|
37
|
+
...labelMetrics(chrome.lineHeight)
|
|
38
|
+
}],
|
|
39
|
+
children: label
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function labelMetrics(lineHeight) {
|
|
44
|
+
if (Platform.OS === 'android') {
|
|
45
|
+
return {
|
|
46
|
+
includeFontPadding: false,
|
|
47
|
+
textAlignVertical: 'center'
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
lineHeight
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
button: {
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
justifyContent: 'center'
|
|
58
|
+
},
|
|
59
|
+
label: {
|
|
60
|
+
textAlign: 'center'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=BannerStepButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["interpolateSessionData","React","Platform","Pressable","StyleSheet","Text","resolveBannerBackgroundColor","resolveBannerForegroundColor","resolveBannerButtonChrome","stepButtonContainerStyle","jsx","_jsx","BannerStepButton","button","theme","sessionData","onActions","label","text","bannerBackground","bannerForeground","chrome","appearance","testID","cvid","accessibilityRole","accessibilityLabel","onPress","actions","style","pressed","styles","opacity","children","color","fontColor","fontFamily","undefined","fontSize","fontWeight","labelMetrics","lineHeight","OS","includeFontPadding","textAlignVertical","create","alignItems","justifyContent","textAlign"],"sourceRoot":"../../../src","sources":["content/BannerStepButton.tsx"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,qBAAqB;AAM5D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEpE,SACEC,4BAA4B,EAC5BC,4BAA4B,QACvB,mCAAgC;AAEvC,SAASC,yBAAyB,QAAQ,gCAA6B;AACvE,SAASC,wBAAwB,QAAQ,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASrE;AACA,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,MAAM;EACNC,KAAK;EACLC,WAAW;EACXC;AACqB,CAAC,EAAsB;EAC5C,MAAMC,KAAK,GAAGjB,sBAAsB,CAACa,MAAM,CAACK,IAAI,EAAEH,WAAW,CAAC;EAC9D,MAAMI,gBAAgB,GAAGb,4BAA4B,CAACQ,KAAK,CAAC;EAC5D,MAAMM,gBAAgB,GAAGb,4BAA4B,CAACO,KAAK,CAAC;EAC5D,MAAMO,MAAM,GAAGb,yBAAyB,CACtCM,KAAK,EACLD,MAAM,CAACS,UAAU,EACjBH,gBAAgB,EAChBC,gBACF,CAAC;EAED,oBACET,IAAA,CAACR,SAAS;IACRoB,MAAM,EAAE,mBAAmBV,MAAM,CAACW,IAAI,EAAG;IACzCC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAET,KAAM;IAC1BU,OAAO,EAAEA,CAAA,KAAMX,SAAS,CAACH,MAAM,CAACe,OAAO,CAAE;IACzCC,KAAK,EAAEA,CAAC;MAAEC;IAAQ,CAAC,KAAK,CACtBC,MAAM,CAAClB,MAAM,EACbJ,wBAAwB,CAACY,MAAM,CAAC,EAChC;MAAEW,OAAO,EAAEF,OAAO,GAAG,IAAI,GAAG;IAAE,CAAC,CAC/B;IAAAG,QAAA,eAEFtB,IAAA,CAACN,IAAI;MACHwB,KAAK,EAAE,CACLE,MAAM,CAACd,KAAK,EACZ;QACEiB,KAAK,EAAEb,MAAM,CAACc,SAAS;QACvBC,UAAU,EAAEtB,KAAK,CAACsB,UAAU,IAAIC,SAAS;QACzCC,QAAQ,EAAEjB,MAAM,CAACiB,QAAQ;QACzBC,UAAU,EAAElB,MAAM,CAACkB,UAAU;QAC7B,GAAGC,YAAY,CAACnB,MAAM,CAACoB,UAAU;MACnC,CAAC,CACD;MAAAR,QAAA,EAEDhB;IAAK,CACF;EAAC,CACE,CAAC;AAEhB;AAEA,SAASuB,YAAYA,CAACC,UAAkB,EAAa;EACnD,IAAIvC,QAAQ,CAACwC,EAAE,KAAK,SAAS,EAAE;IAC7B,OAAO;MACLC,kBAAkB,EAAE,KAAK;MACzBC,iBAAiB,EAAE;IACrB,CAAC;EACH;EACA,OAAO;IAAEH;EAAW,CAAC;AACvB;AAEA,MAAMV,MAAM,GAAG3B,UAAU,CAACyC,MAAM,CAAC;EAC/BhC,MAAM,EAAE;IACNiC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACD9B,KAAK,EAAE;IACL+B,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,4 +11,18 @@ export function isPrimaryButtonAppearance(appearance) {
|
|
|
11
11
|
const normalized = appearance.toLowerCase();
|
|
12
12
|
return normalized === 'primary' || normalized === 'banner-primary';
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/** Figma / web `userflowjs-bubble-button--banner-primary` (inverted CTA on the bar). */
|
|
16
|
+
export function isBannerPrimaryAppearance(appearance) {
|
|
17
|
+
if (!appearance) return false;
|
|
18
|
+
const normalized = appearance.toLowerCase();
|
|
19
|
+
return normalized === 'banner-primary' || normalized === 'primary';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Figma / web `userflowjs-bubble-button--banner-secondary` (outline on the bar). */
|
|
23
|
+
export function isBannerSecondaryAppearance(appearance) {
|
|
24
|
+
if (!appearance) return false;
|
|
25
|
+
const normalized = appearance.toLowerCase();
|
|
26
|
+
return normalized === 'banner-secondary' || normalized === 'default' || normalized === 'secondary';
|
|
27
|
+
}
|
|
14
28
|
//# sourceMappingURL=buttonAppearance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isPrimaryButtonAppearance","appearance","normalized","toLowerCase"],"sourceRoot":"../../../src","sources":["content/buttonAppearance.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,yBAAyBA,CAACC,UAAqC,EAAW;EACxF,IAAI,CAACA,UAAU,EAAE,OAAO,KAAK;EAC7B,MAAMC,UAAU,GAAGD,UAAU,CAACE,WAAW,CAAC,CAAC;EAC3C,OAAOD,UAAU,KAAK,SAAS,IAAIA,UAAU,KAAK,gBAAgB;AACpE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isPrimaryButtonAppearance","appearance","normalized","toLowerCase","isBannerPrimaryAppearance","isBannerSecondaryAppearance"],"sourceRoot":"../../../src","sources":["content/buttonAppearance.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,yBAAyBA,CAACC,UAAqC,EAAW;EACxF,IAAI,CAACA,UAAU,EAAE,OAAO,KAAK;EAC7B,MAAMC,UAAU,GAAGD,UAAU,CAACE,WAAW,CAAC,CAAC;EAC3C,OAAOD,UAAU,KAAK,SAAS,IAAIA,UAAU,KAAK,gBAAgB;AACpE;;AAEA;AACA,OAAO,SAASE,yBAAyBA,CAACH,UAAqC,EAAW;EACxF,IAAI,CAACA,UAAU,EAAE,OAAO,KAAK;EAC7B,MAAMC,UAAU,GAAGD,UAAU,CAACE,WAAW,CAAC,CAAC;EAC3C,OAAOD,UAAU,KAAK,gBAAgB,IAAIA,UAAU,KAAK,SAAS;AACpE;;AAEA;AACA,OAAO,SAASG,2BAA2BA,CAACJ,UAAqC,EAAW;EAC1F,IAAI,CAACA,UAAU,EAAE,OAAO,KAAK;EAC7B,MAAMC,UAAU,GAAGD,UAAU,CAACE,WAAW,CAAC,CAAC;EAC3C,OACED,UAAU,KAAK,kBAAkB,IAAIA,UAAU,KAAK,SAAS,IAAIA,UAAU,KAAK,WAAW;AAE/F","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { BANNER_BUTTON_PADDING_HORIZONTAL } from "../surfaces/bannerBarTokens.js";
|
|
4
|
+
import { isBannerPrimaryAppearance, isBannerSecondaryAppearance, isPrimaryButtonAppearance } from "./buttonAppearance.js";
|
|
5
|
+
import { resolveStepButtonChrome } from "./resolveStepButtonChrome.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Banner bar buttons (`userflowjs-bubble-button--banner-primary` /
|
|
9
|
+
* `--banner-secondary`). Primary is inverted on the bar; secondary is an outline.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveBannerButtonChrome(theme, appearance, bannerBackground, bannerForeground) {
|
|
12
|
+
const metrics = resolveStepButtonChrome(theme, false);
|
|
13
|
+
if (isBannerPrimaryAppearance(appearance)) {
|
|
14
|
+
const primaryMetrics = resolveStepButtonChrome(theme, true);
|
|
15
|
+
return {
|
|
16
|
+
...primaryMetrics,
|
|
17
|
+
minWidth: 0,
|
|
18
|
+
backgroundColor: bannerForeground,
|
|
19
|
+
fontColor: bannerBackground,
|
|
20
|
+
borderColor: bannerForeground,
|
|
21
|
+
borderWidth: 0,
|
|
22
|
+
paddingHorizontal: BANNER_BUTTON_PADDING_HORIZONTAL
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (isBannerSecondaryAppearance(appearance) || appearance == null || appearance === '') {
|
|
26
|
+
return {
|
|
27
|
+
...metrics,
|
|
28
|
+
minWidth: 0,
|
|
29
|
+
backgroundColor: bannerBackground,
|
|
30
|
+
fontColor: bannerForeground,
|
|
31
|
+
borderColor: bannerForeground,
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
paddingHorizontal: BANNER_BUTTON_PADDING_HORIZONTAL
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...resolveStepButtonChrome(theme, isPrimaryButtonAppearance(appearance)),
|
|
38
|
+
minWidth: 0
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=resolveBannerButtonChrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BANNER_BUTTON_PADDING_HORIZONTAL","isBannerPrimaryAppearance","isBannerSecondaryAppearance","isPrimaryButtonAppearance","resolveStepButtonChrome","resolveBannerButtonChrome","theme","appearance","bannerBackground","bannerForeground","metrics","primaryMetrics","minWidth","backgroundColor","fontColor","borderColor","borderWidth","paddingHorizontal"],"sourceRoot":"../../../src","sources":["content/resolveBannerButtonChrome.ts"],"mappings":";;AAEA,SAASA,gCAAgC,QAAQ,gCAA6B;AAE9E,SACEC,yBAAyB,EACzBC,2BAA2B,EAC3BC,yBAAyB,QACpB,uBAAoB;AAC3B,SAASC,uBAAuB,QAA+B,8BAA2B;;AAE1F;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CACvCC,KAAoB,EACpBC,UAAqC,EACrCC,gBAAwB,EACxBC,gBAAwB,EACN;EAClB,MAAMC,OAAO,GAAGN,uBAAuB,CAACE,KAAK,EAAE,KAAK,CAAC;EACrD,IAAIL,yBAAyB,CAACM,UAAU,CAAC,EAAE;IACzC,MAAMI,cAAc,GAAGP,uBAAuB,CAACE,KAAK,EAAE,IAAI,CAAC;IAC3D,OAAO;MACL,GAAGK,cAAc;MACjBC,QAAQ,EAAE,CAAC;MACXC,eAAe,EAAEJ,gBAAgB;MACjCK,SAAS,EAAEN,gBAAgB;MAC3BO,WAAW,EAAEN,gBAAgB;MAC7BO,WAAW,EAAE,CAAC;MACdC,iBAAiB,EAAEjB;IACrB,CAAC;EACH;EAEA,IAAIE,2BAA2B,CAACK,UAAU,CAAC,IAAIA,UAAU,IAAI,IAAI,IAAIA,UAAU,KAAK,EAAE,EAAE;IACtF,OAAO;MACL,GAAGG,OAAO;MACVE,QAAQ,EAAE,CAAC;MACXC,eAAe,EAAEL,gBAAgB;MACjCM,SAAS,EAAEL,gBAAgB;MAC3BM,WAAW,EAAEN,gBAAgB;MAC7BO,WAAW,EAAE,CAAC;MACdC,iBAAiB,EAAEjB;IACrB,CAAC;EACH;EAEA,OAAO;IAAE,GAAGI,uBAAuB,CAACE,KAAK,EAAEH,yBAAyB,CAACI,UAAU,CAAC,CAAC;IAAEK,QAAQ,EAAE;EAAE,CAAC;AAClG","ignoreList":[]}
|
|
@@ -87,6 +87,20 @@ export function foregroundAlpha(color, alpha) {
|
|
|
87
87
|
const rgb = parseThemeRgb(color) ?? FALLBACK_FG;
|
|
88
88
|
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`;
|
|
89
89
|
}
|
|
90
|
+
function byteToHex(n) {
|
|
91
|
+
return clampByte(n).toString(16).padStart(2, '0');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Linear blend between two theme colors (web hover/active approximations). */
|
|
95
|
+
export function mixThemeColors(base, overlay, overlayWeight) {
|
|
96
|
+
const b = parseThemeRgb(base) ?? FALLBACK_FG;
|
|
97
|
+
const o = parseThemeRgb(overlay) ?? FALLBACK_FG;
|
|
98
|
+
const w = Math.max(0, Math.min(1, overlayWeight));
|
|
99
|
+
const r = clampByte(b.r + (o.r - b.r) * w);
|
|
100
|
+
const g = clampByte(b.g + (o.g - b.g) * w);
|
|
101
|
+
const bCh = clampByte(b.b + (o.b - b.b) * w);
|
|
102
|
+
return `#${byteToHex(r)}${byteToHex(g)}${byteToHex(bCh)}`;
|
|
103
|
+
}
|
|
90
104
|
|
|
91
105
|
/**
|
|
92
106
|
* Web's default `backdropHighlightColor` is `#ffffff`. An opaque white stroke
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WEB_QUOTE_BORDER_ALPHA","WEB_CODE_BG_ALPHA","WEB_PADDING_2","WEB_PADDING_4","WEB_PADDING_8","WEB_PADDING_16","ROOT_CONTENT_GAP","WEB_CODE_FONT_SCALE","WEB_CODE_RADIUS_SCALE","WEB_LINE_HEIGHT_FALLBACK","FALLBACK_FG","r","g","b","clampByte","n","Number","isNaN","Math","max","min","round","parseThemeRgb","color","trimmed","trim","short","exec","chars","split","parseInt","long","hex","slice","rgb","foregroundAlpha","alpha","isNearWhite","blockMarginBelow","isLast"],"sourceRoot":"../../../src","sources":["content/themeColor.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA;AACA,OAAO,MAAMA,sBAAsB,GAAG,IAAI;;AAE1C;AACA,OAAO,MAAMC,iBAAiB,GAAG,IAAI;;AAErC;AACA,OAAO,MAAMC,aAAa,GAAG,CAAC;AAC9B,OAAO,MAAMC,aAAa,GAAG,CAAC;AAC9B,OAAO,MAAMC,aAAa,GAAG,CAAC;AAC9B,OAAO,MAAMC,cAAc,GAAG,EAAE;;AAEhC;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,CAAC;;AAEjC;AACA,OAAO,MAAMC,mBAAmB,GAAG,KAAK;;AAExC;AACA,OAAO,MAAMC,qBAAqB,GAAG,IAAI;;AAEzC;AACA,OAAO,MAAMC,wBAAwB,GAAG,EAAE;;AAE1C;AACA,MAAMC,WAAW,GAAG;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE;AAAI,CAAC;AAI9C,SAASC,SAASA,CAACC,CAAS,EAAU;EACpC,IAAIC,MAAM,CAACC,KAAK,CAACF,CAAC,CAAC,EAAE,OAAO,CAAC;EAC7B,OAAOG,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC,GAAG,EAAEF,IAAI,CAACG,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CAAC,EAAE,EAAE,CAAC;MAChCpB,CAAC,EAAEiB,QAAQ,CAACE,GAAG,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;IACjC,CAAC;EACH;EAEA,MAAMC,GAAG,GAAG,oDAAoD,CAACP,IAAI,CAACH,OAAO,CAAC;EAC9E,IAAIU,GAAG,EAAE;IACP,OAAO;MACLvB,CAAC,EAAEG,SAAS,CAACE,MAAM,CAACkB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;MAC5BtB,CAAC,EAAEE,SAAS,CAACE,MAAM,CAACkB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;MAC5BrB,CAAC,EAAEC,SAAS,CAACE,MAAM,CAACkB,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;EACH;EAEA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACZ,KAAgC,EAAEa,KAAa,EAAU;EACvF,MAAMF,GAAG,GAAGZ,aAAa,CAACC,KAAK,CAAC,IAAIb,WAAW;EAC/C,OAAO,QAAQwB,GAAG,CAACvB,CAAC,KAAKuB,GAAG,CAACtB,CAAC,KAAKsB,GAAG,CAACrB,CAAC,KAAKuB,KAAK,GAAG;AACvD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,
|
|
1
|
+
{"version":3,"names":["WEB_QUOTE_BORDER_ALPHA","WEB_CODE_BG_ALPHA","WEB_PADDING_2","WEB_PADDING_4","WEB_PADDING_8","WEB_PADDING_16","ROOT_CONTENT_GAP","WEB_CODE_FONT_SCALE","WEB_CODE_RADIUS_SCALE","WEB_LINE_HEIGHT_FALLBACK","FALLBACK_FG","r","g","b","clampByte","n","Number","isNaN","Math","max","min","round","parseThemeRgb","color","trimmed","trim","short","exec","chars","split","parseInt","long","hex","slice","rgb","foregroundAlpha","alpha","byteToHex","toString","padStart","mixThemeColors","base","overlay","overlayWeight","o","w","bCh","isNearWhite","bl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A,CAAC,GAAG,CAAC+B,CAAC,CAAC/B,CAAC,GAAGA,CAAC,CAACA,CAAC,IAAIgC,CAAC,CAAC;EAC5C,OAAO,IAAIR,SAAS,CAAC1B,CAAC,CAAC,GAAG0B,SAAS,CAACzB,CAAC,CAAC,GAAGyB,SAAS,CAACS,GAAG,CAAC,EAAE;AAC3D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACxB,KAAgC,EAAW;EACrE,MAAMW,GAAG,GAAGZ,aAAa,CAACC,KAAK,CAAC;EAChC,IAAI,CAACW,GAAG,EAAE,OAAO,KAAK;EACtB,OAAOA,GAAG,CAACvB,CAAC,IAAI,GAAG,IAAIuB,GAAG,CAACtB,CAAC,IAAI,GAAG,IAAIsB,GAAG,CAACrB,CAAC,IAAI,GAAG;AACrD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASmC,gBAAgBA,CAACC,MAAe,EAAU;EACxD,IAAIA,MAAM,EAAE,OAAO,CAAC;EACpB,OAAO/B,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEd,cAAc,GAAGC,gBAAgB,CAAC;AACvD","ignoreList":[]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Inbound deep-link handling for builder preview.
|
|
5
5
|
*
|
|
6
|
-
* Host apps register their environment's `scheme_id` (e.g.
|
|
7
|
-
* a URL scheme at build time. The SDK
|
|
8
|
-
* query (no init config) and starts a
|
|
9
|
-
* a user is identified.
|
|
6
|
+
* Host apps register their environment's `scheme_id` (e.g.
|
|
7
|
+
* `userflow-v7twv2fw2ja2jaco7kesvowmem`) as a URL scheme at build time. The SDK
|
|
8
|
+
* matches inbound URLs by prefix + root query (no init config) and starts a
|
|
9
|
+
* draft flow via `StartFlowWithToken` once a user is identified.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { Linking } from 'react-native';
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Platform, useColorScheme, useWindowDimensions, View } from 'react-native';
|
|
5
|
+
import { getCurrentScreenLocation, subscribeScreenLocation } from "../screenTracker.js";
|
|
6
|
+
import { ABSOLUTE_FILL } from "../surfaces/absoluteFill.js";
|
|
7
|
+
import { useUserflowSafeAreaInsets } from "../surfaces/safeArea.js";
|
|
8
|
+
import { buildBootstrapHtml, EVAL_JS_BASE_URL, isBootstrapUrl } from "./bootstrap.js";
|
|
9
|
+
import { parseBridgeMessage } from "./bridgeMessages.js";
|
|
10
|
+
import { formatEvalJsError, getEvalJsBridgeHandlers } from "./evalJsBridge.js";
|
|
11
|
+
import { evalJsController } from "./evalJsController.js";
|
|
12
|
+
import { getEvalJsWebView } from "./getWebView.js";
|
|
13
|
+
import { useEvalJsWebViewInjection } from "./useEvalJsWebViewInjection.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
function screenFromLocation(location) {
|
|
16
|
+
if (!location) return {};
|
|
17
|
+
if ('path' in location) return location.path ? {
|
|
18
|
+
path: location.path
|
|
19
|
+
} : {};
|
|
20
|
+
return location.screen ? {
|
|
21
|
+
name: location.screen
|
|
22
|
+
} : {};
|
|
23
|
+
}
|
|
24
|
+
function useEvalJsScreen() {
|
|
25
|
+
const [screen, setScreen] = React.useState(() => screenFromLocation(getCurrentScreenLocation()));
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
return subscribeScreenLocation(location => {
|
|
28
|
+
setScreen(screenFromLocation(location));
|
|
29
|
+
});
|
|
30
|
+
}, []);
|
|
31
|
+
return screen;
|
|
32
|
+
}
|
|
33
|
+
function clipFor(layout, viewport, suppressed) {
|
|
34
|
+
const fullWeb = {
|
|
35
|
+
width: viewport.width,
|
|
36
|
+
height: viewport.height,
|
|
37
|
+
backgroundColor: 'transparent'
|
|
38
|
+
};
|
|
39
|
+
const hidden = suppressed || layout.mode !== 'fitted' && layout.mode !== 'fullscreen';
|
|
40
|
+
if (hidden) {
|
|
41
|
+
return {
|
|
42
|
+
interactive: false,
|
|
43
|
+
outer: {
|
|
44
|
+
...ABSOLUTE_FILL,
|
|
45
|
+
opacity: 0
|
|
46
|
+
},
|
|
47
|
+
web: fullWeb
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (layout.mode === 'fullscreen') {
|
|
51
|
+
return {
|
|
52
|
+
interactive: true,
|
|
53
|
+
outer: ABSOLUTE_FILL,
|
|
54
|
+
web: fullWeb
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const rect = layout.rect;
|
|
58
|
+
if (!rect) {
|
|
59
|
+
return {
|
|
60
|
+
interactive: false,
|
|
61
|
+
outer: {
|
|
62
|
+
...ABSOLUTE_FILL,
|
|
63
|
+
opacity: 0
|
|
64
|
+
},
|
|
65
|
+
web: fullWeb
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
interactive: true,
|
|
70
|
+
outer: {
|
|
71
|
+
position: 'absolute',
|
|
72
|
+
left: rect.x,
|
|
73
|
+
top: rect.y,
|
|
74
|
+
width: rect.width,
|
|
75
|
+
height: rect.height,
|
|
76
|
+
overflow: 'hidden'
|
|
77
|
+
},
|
|
78
|
+
web: {
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
left: -rect.x,
|
|
81
|
+
top: -rect.y,
|
|
82
|
+
width: viewport.width,
|
|
83
|
+
height: viewport.height,
|
|
84
|
+
backgroundColor: 'transparent'
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* One shared WebView for Evaluate JavaScript. Mounted by the SDK overlay,
|
|
91
|
+
* created on first use, destroyed on {@link evalJsController.reset}.
|
|
92
|
+
*
|
|
93
|
+
* Fitted mode clips a full-size WebView to the script's rectangle so the
|
|
94
|
+
* page viewport does not change (and the rest of the app still receives taps).
|
|
95
|
+
*/
|
|
96
|
+
export function EvalJsHost({
|
|
97
|
+
suppressed
|
|
98
|
+
}) {
|
|
99
|
+
const snapshot = React.useSyncExternalStore(evalJsController.subscribe, evalJsController.getSnapshot, evalJsController.getSnapshot);
|
|
100
|
+
if (!snapshot.active) return null;
|
|
101
|
+
if (snapshot.bannerOwnsWebView) return null;
|
|
102
|
+
return /*#__PURE__*/_jsx(EvalJsWebView, {
|
|
103
|
+
suppressed: suppressed,
|
|
104
|
+
generation: snapshot.generation,
|
|
105
|
+
pendingCount: snapshot.pendingCount,
|
|
106
|
+
layout: snapshot.layout,
|
|
107
|
+
host: snapshot.host
|
|
108
|
+
}, snapshot.generation);
|
|
109
|
+
}
|
|
110
|
+
function EvalJsWebView({
|
|
111
|
+
suppressed,
|
|
112
|
+
generation,
|
|
113
|
+
pendingCount,
|
|
114
|
+
layout,
|
|
115
|
+
host
|
|
116
|
+
}) {
|
|
117
|
+
const WebView = getEvalJsWebView();
|
|
118
|
+
const webRef = React.useRef(null);
|
|
119
|
+
const [pageReady, setPageReady] = React.useState(false);
|
|
120
|
+
const generationRef = React.useRef(generation);
|
|
121
|
+
const colorScheme = useColorScheme();
|
|
122
|
+
const viewport = useWindowDimensions();
|
|
123
|
+
const insets = useUserflowSafeAreaInsets();
|
|
124
|
+
const screen = useEvalJsScreen();
|
|
125
|
+
const context = React.useMemo(() => ({
|
|
126
|
+
platform: Platform.OS,
|
|
127
|
+
colorScheme: colorScheme === 'dark' ? 'dark' : 'light',
|
|
128
|
+
safeAreaInsets: insets,
|
|
129
|
+
viewport: {
|
|
130
|
+
width: viewport.width,
|
|
131
|
+
height: viewport.height
|
|
132
|
+
},
|
|
133
|
+
screen,
|
|
134
|
+
host
|
|
135
|
+
}), [colorScheme, host, insets, screen, viewport.height, viewport.width]);
|
|
136
|
+
const initialContext = React.useRef(context);
|
|
137
|
+
const html = React.useMemo(() => buildBootstrapHtml(initialContext.current), []);
|
|
138
|
+
useEvalJsWebViewInjection(webRef, {
|
|
139
|
+
pageReady,
|
|
140
|
+
context,
|
|
141
|
+
pendingCount
|
|
142
|
+
});
|
|
143
|
+
const openExternal = React.useCallback(url => {
|
|
144
|
+
if (!url || isBootstrapUrl(url)) return;
|
|
145
|
+
getEvalJsBridgeHandlers().openUrl(url);
|
|
146
|
+
}, []);
|
|
147
|
+
const onMessage = React.useCallback(event => {
|
|
148
|
+
if (generationRef.current !== generation) return;
|
|
149
|
+
const message = parseBridgeMessage(event.nativeEvent.data);
|
|
150
|
+
if (!message) return;
|
|
151
|
+
const bridge = getEvalJsBridgeHandlers();
|
|
152
|
+
switch (message.type) {
|
|
153
|
+
case 'ready':
|
|
154
|
+
setPageReady(true);
|
|
155
|
+
return;
|
|
156
|
+
case 'close':
|
|
157
|
+
evalJsController.reset();
|
|
158
|
+
return;
|
|
159
|
+
case 'endFlow':
|
|
160
|
+
bridge.endFlow(evalJsController.sessionIds());
|
|
161
|
+
evalJsController.reset();
|
|
162
|
+
return;
|
|
163
|
+
case 'setLayout':
|
|
164
|
+
evalJsController.setLayout(message.layout);
|
|
165
|
+
return;
|
|
166
|
+
case 'track':
|
|
167
|
+
bridge.track(message.name, message.attributes);
|
|
168
|
+
return;
|
|
169
|
+
case 'updateUser':
|
|
170
|
+
bridge.updateUser(message.attributes);
|
|
171
|
+
return;
|
|
172
|
+
case 'updateGroup':
|
|
173
|
+
bridge.updateGroup(message.attributes, message.options);
|
|
174
|
+
return;
|
|
175
|
+
case 'openUrl':
|
|
176
|
+
bridge.openUrl(message.url);
|
|
177
|
+
return;
|
|
178
|
+
case 'error':
|
|
179
|
+
bridge.warn(formatEvalJsError(message.message, message.code));
|
|
180
|
+
return;
|
|
181
|
+
default:
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}, [generation]);
|
|
185
|
+
if (!WebView) return null;
|
|
186
|
+
const clip = clipFor(layout, {
|
|
187
|
+
width: viewport.width,
|
|
188
|
+
height: viewport.height
|
|
189
|
+
}, suppressed);
|
|
190
|
+
const debugging = typeof __DEV__ !== 'undefined' && __DEV__ ? true : undefined;
|
|
191
|
+
return /*#__PURE__*/_jsx(View, {
|
|
192
|
+
pointerEvents: "box-none",
|
|
193
|
+
style: ABSOLUTE_FILL,
|
|
194
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
195
|
+
pointerEvents: clip.interactive ? 'auto' : 'none',
|
|
196
|
+
style: clip.outer,
|
|
197
|
+
children: /*#__PURE__*/_jsx(WebView, {
|
|
198
|
+
ref: webRef,
|
|
199
|
+
source: {
|
|
200
|
+
html,
|
|
201
|
+
baseUrl: EVAL_JS_BASE_URL
|
|
202
|
+
},
|
|
203
|
+
style: clip.web,
|
|
204
|
+
pointerEvents: clip.interactive ? 'auto' : 'none',
|
|
205
|
+
originWhitelist: ['*'],
|
|
206
|
+
javaScriptEnabled: true,
|
|
207
|
+
domStorageEnabled: true,
|
|
208
|
+
scrollEnabled: false,
|
|
209
|
+
bounces: false,
|
|
210
|
+
showsHorizontalScrollIndicator: false,
|
|
211
|
+
showsVerticalScrollIndicator: false,
|
|
212
|
+
mediaPlaybackRequiresUserAction: false,
|
|
213
|
+
allowsInlineMediaPlayback: true,
|
|
214
|
+
setSupportMultipleWindows: false,
|
|
215
|
+
androidLayerType: "hardware",
|
|
216
|
+
...(debugging !== undefined ? {
|
|
217
|
+
webviewDebuggingEnabled: debugging
|
|
218
|
+
} : {}),
|
|
219
|
+
onMessage: onMessage,
|
|
220
|
+
onShouldStartLoadWithRequest: request => {
|
|
221
|
+
if (isBootstrapUrl(request.url)) return true;
|
|
222
|
+
openExternal(request.url);
|
|
223
|
+
return false;
|
|
224
|
+
},
|
|
225
|
+
onOpenWindow: event => {
|
|
226
|
+
const url = event.nativeEvent.targetUrl;
|
|
227
|
+
if (url) openExternal(url);
|
|
228
|
+
},
|
|
229
|
+
onError: event => {
|
|
230
|
+
const description = event.nativeEvent.description;
|
|
231
|
+
if (description) {
|
|
232
|
+
getEvalJsBridgeHandlers().warn(formatEvalJsError(description));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=EvalJsHost.js.map
|