@userflow-tech/react-native 0.4.5 → 0.6.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 +31 -2
- package/docs/anchoring.md +6 -1
- package/docs/custom-fonts.md +36 -0
- package/docs/troubleshooting.md +33 -6
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +144 -34
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/commonjs/anchors/animationFrame.js +29 -1
- package/lib/commonjs/anchors/animationFrame.js.map +1 -1
- package/lib/commonjs/anchors/appActive.js +61 -0
- package/lib/commonjs/anchors/appActive.js.map +1 -0
- package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -8
- package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/commonjs/anchors/elementTapMonitor.js +67 -12
- package/lib/commonjs/anchors/elementTapMonitor.js.map +1 -1
- package/lib/commonjs/anchors/elementTargetMatch.js +33 -7
- package/lib/commonjs/anchors/elementTargetMatch.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +8 -0
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -1
- package/lib/commonjs/anchors/fiber/detectAppFontFamily.js +341 -0
- package/lib/commonjs/anchors/fiber/detectAppFontFamily.js.map +1 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js +66 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/commonjs/anchors/fiber/indexHostFibers.js +4 -3
- package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -1
- package/lib/commonjs/anchors/fiber/resolveFiberPath.js +30 -15
- package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -1
- package/lib/commonjs/anchors/fiber/visibleScreens.js +6 -0
- package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -1
- package/lib/commonjs/anchors/fiberAnchorCache.js +20 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -1
- package/lib/commonjs/anchors/gestureHandlerHandoff.js +304 -0
- package/lib/commonjs/anchors/gestureHandlerHandoff.js.map +1 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js +6 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js +11 -6
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveElementTargets.js +63 -8
- package/lib/commonjs/anchors/resolveElementTargets.js.map +1 -1
- package/lib/commonjs/anchors/semanticMatcher.js +43 -21
- package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
- package/lib/commonjs/anchors/tapSlop.js +16 -0
- package/lib/commonjs/anchors/tapSlop.js.map +1 -0
- package/lib/commonjs/anchors/targetPressMonitor.js +66 -12
- package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -1
- package/lib/commonjs/authoring/fingerprintFromInstance.js +5 -9
- package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
- package/lib/commonjs/content/BannerStepButton.js +2 -1
- package/lib/commonjs/content/BannerStepButton.js.map +1 -1
- package/lib/commonjs/content/RichContentRenderer.js +20 -14
- package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
- package/lib/commonjs/content/StepButton.js +2 -1
- package/lib/commonjs/content/StepButton.js.map +1 -1
- package/lib/commonjs/content/openSafeUrl.js +3 -1
- package/lib/commonjs/content/openSafeUrl.js.map +1 -1
- package/lib/commonjs/content/resolveContentFontFamily.js +96 -0
- package/lib/commonjs/content/resolveContentFontFamily.js.map +1 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +6 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/commonjs/index.js +21 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigation/navigateUrlUtils.js +105 -0
- package/lib/commonjs/navigation/navigateUrlUtils.js.map +1 -0
- package/lib/commonjs/navigation/openExternalNavigateUrl.js +14 -0
- package/lib/commonjs/navigation/openExternalNavigateUrl.js.map +1 -0
- package/lib/commonjs/navigation/openFlowNavigateUrl.js +47 -41
- package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
- package/lib/commonjs/pairing/PairingController.js +3 -1
- package/lib/commonjs/pairing/PairingController.js.map +1 -1
- package/lib/commonjs/runtime/BannerHost.js +38 -29
- package/lib/commonjs/runtime/BannerHost.js.map +1 -1
- package/lib/commonjs/runtime/TargetPressBridge.js +55 -7
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
- package/lib/commonjs/runtime/UserflowOverlay.js +5 -11
- package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -1
- package/lib/commonjs/runtime/UserflowProvider.js +66 -40
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
- package/lib/commonjs/runtime/bannerEngine.js +8 -2
- package/lib/commonjs/runtime/bannerEngine.js.map +1 -1
- package/lib/commonjs/runtime/bannerFlowSpacer.js +71 -0
- package/lib/commonjs/runtime/bannerFlowSpacer.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +11 -0
- package/lib/commonjs/runtime/flowEngine.js.map +1 -1
- package/lib/commonjs/runtime/previewStart.js +39 -0
- package/lib/commonjs/runtime/previewStart.js.map +1 -0
- package/lib/commonjs/runtime/pushBannerLayoutContext.js +101 -0
- package/lib/commonjs/runtime/pushBannerLayoutContext.js.map +1 -0
- package/lib/commonjs/screenTracker.js +12 -0
- package/lib/commonjs/screenTracker.js.map +1 -1
- package/lib/commonjs/surfaces/BannerBar.js +79 -61
- package/lib/commonjs/surfaces/BannerBar.js.map +1 -1
- package/lib/commonjs/surfaces/BannerSurface.js +28 -6
- package/lib/commonjs/surfaces/BannerSurface.js.map +1 -1
- package/lib/commonjs/surfaces/ProgressBar.js +2 -1
- package/lib/commonjs/surfaces/ProgressBar.js.map +1 -1
- package/lib/commonjs/surfaces/TooltipSurface.js +48 -41
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
- package/lib/commonjs/surfaces/bannerBarLayout.js +77 -10
- package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -1
- package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +114 -63
- package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
- package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js +3 -33
- package/lib/commonjs/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -1
- package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js +2 -1
- package/lib/commonjs/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -1
- package/lib/commonjs/surfaces/bannerWebView/bannerWebViewHeight.js +33 -0
- package/lib/commonjs/surfaces/bannerWebView/bannerWebViewHeight.js.map +1 -0
- package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +104 -23
- package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
- package/lib/commonjs/surfaces/hostAccessibilityTrap.js +28 -0
- package/lib/commonjs/surfaces/hostAccessibilityTrap.js.map +1 -0
- package/lib/commonjs/surfaces/resolveBannerTheme.js +6 -3
- package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +3 -2
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js +134 -0
- package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/anchors/AutoAnchorRegistry.js +145 -35
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/module/anchors/animationFrame.js +29 -2
- package/lib/module/anchors/animationFrame.js.map +1 -1
- package/lib/module/anchors/appActive.js +57 -0
- package/lib/module/anchors/appActive.js.map +1 -0
- package/lib/module/anchors/elementConditionEvaluator.js +26 -9
- package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/module/anchors/elementTapMonitor.js +67 -12
- package/lib/module/anchors/elementTapMonitor.js.map +1 -1
- package/lib/module/anchors/elementTargetMatch.js +32 -7
- package/lib/module/anchors/elementTargetMatch.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRootStore.js +8 -0
- package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -1
- package/lib/module/anchors/fiber/detectAppFontFamily.js +330 -0
- package/lib/module/anchors/fiber/detectAppFontFamily.js.map +1 -0
- package/lib/module/anchors/fiber/fiberInternals.js +65 -0
- package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/module/anchors/fiber/indexHostFibers.js +4 -3
- package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -1
- package/lib/module/anchors/fiber/resolveFiberPath.js +30 -15
- package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -1
- package/lib/module/anchors/fiber/visibleScreens.js +5 -0
- package/lib/module/anchors/fiber/visibleScreens.js.map +1 -1
- package/lib/module/anchors/fiberAnchorCache.js +19 -0
- package/lib/module/anchors/fiberAnchorCache.js.map +1 -1
- package/lib/module/anchors/gestureHandlerHandoff.js +298 -0
- package/lib/module/anchors/gestureHandlerHandoff.js.map +1 -0
- package/lib/module/anchors/resolveAnchorHost.js +1 -0
- package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveAutoAnchorHost.js +11 -6
- package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveElementTargets.js +63 -8
- package/lib/module/anchors/resolveElementTargets.js.map +1 -1
- package/lib/module/anchors/semanticMatcher.js +43 -21
- package/lib/module/anchors/semanticMatcher.js.map +1 -1
- package/lib/module/anchors/tapSlop.js +11 -0
- package/lib/module/anchors/tapSlop.js.map +1 -0
- package/lib/module/anchors/targetPressMonitor.js +53 -8
- package/lib/module/anchors/targetPressMonitor.js.map +1 -1
- package/lib/module/authoring/fingerprintFromInstance.js +6 -10
- package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
- package/lib/module/content/BannerStepButton.js +2 -1
- package/lib/module/content/BannerStepButton.js.map +1 -1
- package/lib/module/content/RichContentRenderer.js +20 -14
- package/lib/module/content/RichContentRenderer.js.map +1 -1
- package/lib/module/content/StepButton.js +2 -1
- package/lib/module/content/StepButton.js.map +1 -1
- package/lib/module/content/openSafeUrl.js +3 -1
- package/lib/module/content/openSafeUrl.js.map +1 -1
- package/lib/module/content/resolveContentFontFamily.js +89 -0
- package/lib/module/content/resolveContentFontFamily.js.map +1 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js +7 -1
- package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/module/index.js +24 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/navigateUrlUtils.js +94 -0
- package/lib/module/navigation/navigateUrlUtils.js.map +1 -0
- package/lib/module/navigation/openExternalNavigateUrl.js +11 -0
- package/lib/module/navigation/openExternalNavigateUrl.js.map +1 -0
- package/lib/module/navigation/openFlowNavigateUrl.js +22 -36
- package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
- package/lib/module/pairing/PairingController.js +3 -1
- package/lib/module/pairing/PairingController.js.map +1 -1
- package/lib/module/runtime/BannerHost.js +38 -29
- package/lib/module/runtime/BannerHost.js.map +1 -1
- package/lib/module/runtime/TargetPressBridge.js +56 -8
- package/lib/module/runtime/TargetPressBridge.js.map +1 -1
- package/lib/module/runtime/UserflowOverlay.js +5 -11
- package/lib/module/runtime/UserflowOverlay.js.map +1 -1
- package/lib/module/runtime/UserflowProvider.js +66 -40
- package/lib/module/runtime/UserflowProvider.js.map +1 -1
- package/lib/module/runtime/bannerEngine.js +7 -2
- package/lib/module/runtime/bannerEngine.js.map +1 -1
- package/lib/module/runtime/bannerFlowSpacer.js +65 -0
- package/lib/module/runtime/bannerFlowSpacer.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +11 -0
- package/lib/module/runtime/flowEngine.js.map +1 -1
- package/lib/module/runtime/previewStart.js +35 -0
- package/lib/module/runtime/previewStart.js.map +1 -0
- package/lib/module/runtime/pushBannerLayoutContext.js +94 -0
- package/lib/module/runtime/pushBannerLayoutContext.js.map +1 -0
- package/lib/module/screenTracker.js +11 -0
- package/lib/module/screenTracker.js.map +1 -1
- package/lib/module/surfaces/BannerBar.js +80 -62
- package/lib/module/surfaces/BannerBar.js.map +1 -1
- package/lib/module/surfaces/BannerSurface.js +28 -6
- package/lib/module/surfaces/BannerSurface.js.map +1 -1
- package/lib/module/surfaces/ProgressBar.js +2 -1
- package/lib/module/surfaces/ProgressBar.js.map +1 -1
- package/lib/module/surfaces/TooltipSurface.js +49 -42
- package/lib/module/surfaces/TooltipSurface.js.map +1 -1
- package/lib/module/surfaces/bannerBarLayout.js +72 -11
- package/lib/module/surfaces/bannerBarLayout.js.map +1 -1
- package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +115 -64
- package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
- package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js +3 -31
- package/lib/module/surfaces/bannerWebView/bannerNeedsWebView.js.map +1 -1
- package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js +2 -1
- package/lib/module/surfaces/bannerWebView/bannerThemeStyles.js.map +1 -1
- package/lib/module/surfaces/bannerWebView/bannerWebViewHeight.js +29 -0
- package/lib/module/surfaces/bannerWebView/bannerWebViewHeight.js.map +1 -0
- package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +104 -23
- package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
- package/lib/module/surfaces/hostAccessibilityTrap.js +24 -0
- package/lib/module/surfaces/hostAccessibilityTrap.js.map +1 -0
- package/lib/module/surfaces/resolveBannerTheme.js +6 -3
- package/lib/module/surfaces/resolveBannerTheme.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipBubble.js +3 -2
- package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/module/surfaces/tooltip/targetSearchSchedule.js +128 -0
- package/lib/module/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +36 -2
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts +0 -4
- package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/appActive.d.ts +8 -0
- package/lib/typescript/commonjs/src/anchors/appActive.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts +17 -0
- package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts +7 -0
- package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +5 -0
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/detectAppFontFamily.d.ts +30 -0
- package/lib/typescript/commonjs/src/anchors/fiber/detectAppFontFamily.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +7 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +3 -2
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
- package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +2 -0
- package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +5 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts +70 -0
- package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +2 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts +9 -0
- package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +13 -8
- package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/BannerStepButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/resolveContentFontFamily.d.ts +35 -0
- package/lib/typescript/commonjs/src/content/resolveContentFontFamily.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +6 -5
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts +15 -0
- package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts +3 -0
- package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts +2 -5
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +6 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +3 -0
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +5 -1
- package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts +15 -0
- package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/previewStart.d.ts +13 -0
- package/lib/typescript/commonjs/src/runtime/previewStart.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts +22 -0
- package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts +6 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +6 -5
- package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +17 -0
- package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +3 -12
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts +13 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
- package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +4 -1
- package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +36 -2
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/animationFrame.d.ts +0 -4
- package/lib/typescript/module/src/anchors/animationFrame.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/appActive.d.ts +8 -0
- package/lib/typescript/module/src/anchors/appActive.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts +17 -0
- package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts +7 -0
- package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +5 -0
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/detectAppFontFamily.d.ts +30 -0
- package/lib/typescript/module/src/anchors/fiber/detectAppFontFamily.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +7 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +3 -2
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
- package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +2 -0
- package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +5 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts +70 -0
- package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +1 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +2 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/tapSlop.d.ts +9 -0
- package/lib/typescript/module/src/anchors/tapSlop.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +13 -8
- package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
- package/lib/typescript/module/src/content/BannerStepButton.d.ts.map +1 -1
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/module/src/content/openSafeUrl.d.ts.map +1 -1
- package/lib/typescript/module/src/content/resolveContentFontFamily.d.ts +35 -0
- package/lib/typescript/module/src/content/resolveContentFontFamily.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +6 -5
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts +15 -0
- package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts +3 -0
- package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts +2 -5
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PairingController.d.ts +6 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +3 -0
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/bannerEngine.d.ts +5 -1
- package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts +15 -0
- package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/previewStart.d.ts +13 -0
- package/lib/typescript/module/src/runtime/previewStart.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts +22 -0
- package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
- package/lib/typescript/module/src/screenTracker.d.ts +6 -0
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/BannerBar.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +6 -5
- package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/ProgressBar.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +17 -0
- package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts +3 -12
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerNeedsWebView.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerThemeStyles.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts +13 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/bannerWebViewHeight.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
- package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +4 -1
- package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
- package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/anchors/AutoAnchorRegistry.ts +166 -35
- package/src/anchors/animationFrame.ts +31 -1
- package/src/anchors/appActive.ts +63 -0
- package/src/anchors/elementConditionEvaluator.ts +29 -12
- package/src/anchors/elementTapMonitor.ts +68 -10
- package/src/anchors/elementTargetMatch.ts +34 -7
- package/src/anchors/fiber/FiberScanRootStore.ts +8 -0
- package/src/anchors/fiber/detectAppFontFamily.ts +400 -0
- package/src/anchors/fiber/fiberInternals.ts +68 -0
- package/src/anchors/fiber/indexHostFibers.ts +8 -3
- package/src/anchors/fiber/resolveFiberPath.ts +25 -16
- package/src/anchors/fiber/visibleScreens.ts +5 -0
- package/src/anchors/fiberAnchorCache.ts +19 -0
- package/src/anchors/gestureHandlerHandoff.ts +356 -0
- package/src/anchors/resolveAnchorHost.ts +2 -0
- package/src/anchors/resolveAutoAnchorHost.ts +18 -8
- package/src/anchors/resolveElementTargets.ts +64 -7
- package/src/anchors/semanticMatcher.ts +48 -27
- package/src/anchors/tapSlop.ts +18 -0
- package/src/anchors/targetPressMonitor.ts +56 -19
- package/src/authoring/fingerprintFromInstance.ts +4 -5
- package/src/content/BannerStepButton.tsx +2 -1
- package/src/content/RichContentRenderer.tsx +19 -13
- package/src/content/StepButton.tsx +2 -1
- package/src/content/openSafeUrl.ts +3 -1
- package/src/content/resolveContentFontFamily.ts +119 -0
- package/src/expo-router/useUserflowExpoRouter.ts +10 -1
- package/src/index.ts +22 -9
- package/src/navigation/navigateUrlUtils.ts +100 -0
- package/src/navigation/openExternalNavigateUrl.ts +9 -0
- package/src/navigation/openFlowNavigateUrl.ts +36 -36
- package/src/pairing/PairingController.ts +9 -1
- package/src/runtime/BannerHost.tsx +41 -23
- package/src/runtime/TargetPressBridge.tsx +66 -9
- package/src/runtime/UserflowOverlay.tsx +7 -9
- package/src/runtime/UserflowProvider.tsx +56 -32
- package/src/runtime/bannerEngine.ts +10 -2
- package/src/runtime/bannerFlowSpacer.tsx +70 -0
- package/src/runtime/flowEngine.ts +11 -0
- package/src/runtime/previewStart.ts +49 -0
- package/src/runtime/pushBannerLayoutContext.tsx +126 -0
- package/src/screenTracker.ts +11 -0
- package/src/surfaces/BannerBar.tsx +93 -55
- package/src/surfaces/BannerSurface.tsx +61 -9
- package/src/surfaces/ProgressBar.tsx +2 -1
- package/src/surfaces/TooltipSurface.tsx +78 -53
- package/src/surfaces/bannerBarLayout.ts +80 -7
- package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +151 -57
- package/src/surfaces/bannerWebView/bannerNeedsWebView.ts +4 -36
- package/src/surfaces/bannerWebView/bannerThemeStyles.ts +2 -1
- package/src/surfaces/bannerWebView/bannerWebViewHeight.ts +32 -0
- package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +111 -23
- package/src/surfaces/hostAccessibilityTrap.ts +25 -0
- package/src/surfaces/resolveBannerTheme.ts +14 -3
- package/src/surfaces/tooltip/TooltipBubble.tsx +8 -1
- package/src/surfaces/tooltip/targetSearchSchedule.ts +140 -0
- package/src/version.ts +1 -1
- package/vendor/core/dist/engine/BannerSessionEngine.d.ts +29 -2
- package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/BannerSessionEngine.js +87 -6
- package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -1
- package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/ClientConditionEngine.js +30 -7
- package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts +6 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.js +23 -3
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
- package/vendor/core/dist/engine/handleActions.js +67 -2
- package/vendor/core/dist/engine/handleActions.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/flows.d.ts +2 -0
- package/vendor/protocol/dist/flows.d.ts.map +1 -1
- package/vendor/protocol/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const ABSOLUTE_WEB_URL = /^https?:\/\//i;
|
|
2
|
+
|
|
3
|
+
/** Hostname.tld with optional port, path, query, or hash — not an in-app screen name like `Profile`. */
|
|
4
|
+
const BARE_EXTERNAL_HOST =
|
|
5
|
+
/^[\w.-]+\.[a-z]{2,}(?::\d+)?(?:\/[^\s?#]*)?(?:\?[^\s#]*)?(?:#[^\s]*)?$/i;
|
|
6
|
+
|
|
7
|
+
function isAllowlistedWebUrl(url: string): boolean {
|
|
8
|
+
const trimmed = url.trim();
|
|
9
|
+
if (!trimmed) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
if (!ABSOLUTE_WEB_URL.test(trimmed) && !/^mailto:/i.test(trimmed) && !/^tel:/i.test(trimmed)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const parsed = new URL(trimmed);
|
|
17
|
+
return (
|
|
18
|
+
parsed.protocol === 'http:' ||
|
|
19
|
+
parsed.protocol === 'https:' ||
|
|
20
|
+
parsed.protocol === 'mailto:' ||
|
|
21
|
+
parsed.protocol === 'tel:'
|
|
22
|
+
);
|
|
23
|
+
} catch {
|
|
24
|
+
return ABSOLUTE_WEB_URL.test(trimmed);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Fix common builder typos before classification (`https:/google.com`). */
|
|
29
|
+
export function normalizeNavigateUrlInput(url: string): string {
|
|
30
|
+
const trimmed = url.trim();
|
|
31
|
+
return trimmed.replace(/^(https?):\/(?!\/)/i, '$1://');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Prefix `https://` when the builder URL omitted the scheme (e.g. `google.com`). */
|
|
35
|
+
export function normalizeExternalNavigateUrl(url: string): string {
|
|
36
|
+
const trimmed = normalizeNavigateUrlInput(url);
|
|
37
|
+
if (ABSOLUTE_WEB_URL.test(trimmed)) {
|
|
38
|
+
return trimmed;
|
|
39
|
+
}
|
|
40
|
+
if (BARE_EXTERNAL_HOST.test(trimmed) && !trimmed.startsWith('/')) {
|
|
41
|
+
return `https://${trimmed}`;
|
|
42
|
+
}
|
|
43
|
+
return trimmed;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** True when the URL should open outside the app (browser / mail / tel). */
|
|
47
|
+
export function shouldOpenExternalNavigateUrl(url: string): boolean {
|
|
48
|
+
const trimmed = normalizeNavigateUrlInput(url);
|
|
49
|
+
if (!trimmed) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (isAllowlistedWebUrl(trimmed)) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
if (ABSOLUTE_WEB_URL.test(trimmed)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (/^mailto:/i.test(trimmed) || /^tel:/i.test(trimmed)) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (BARE_EXTERNAL_HOST.test(trimmed) && !trimmed.startsWith('/')) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** True for http(s) / mailto / tel (external). */
|
|
68
|
+
export function isExternalNavigateUrl(url: string): boolean {
|
|
69
|
+
return shouldOpenExternalNavigateUrl(url);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Path-like in-app URL: leading slash, or no scheme. */
|
|
73
|
+
export function isInAppNavigateUrl(url: string): boolean {
|
|
74
|
+
const trimmed = normalizeNavigateUrlInput(url);
|
|
75
|
+
if (!trimmed) return false;
|
|
76
|
+
if (shouldOpenExternalNavigateUrl(trimmed)) return false;
|
|
77
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return false;
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Never pass absolute / external URLs to Expo Router `push`. */
|
|
82
|
+
export function mustNotUseExpoRouterPush(url: string): boolean {
|
|
83
|
+
const trimmed = normalizeNavigateUrlInput(url);
|
|
84
|
+
if (!trimmed) return false;
|
|
85
|
+
if (shouldOpenExternalNavigateUrl(trimmed)) return true;
|
|
86
|
+
if (trimmed.includes('://')) return true;
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function normalizeInAppPath(url: string): string {
|
|
91
|
+
const trimmed = normalizeNavigateUrlInput(url);
|
|
92
|
+
if (trimmed.startsWith('/')) return trimmed;
|
|
93
|
+
return `/${trimmed}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function routeNameFromPath(path: string): string {
|
|
97
|
+
const normalized = normalizeInAppPath(path).replace(/^\//, '');
|
|
98
|
+
const [first] = normalized.split(/[/?#]/);
|
|
99
|
+
return first || normalized;
|
|
100
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { openSafeUrl } from '../content/openSafeUrl';
|
|
2
|
+
|
|
3
|
+
import { normalizeExternalNavigateUrl } from './navigateUrlUtils';
|
|
4
|
+
|
|
5
|
+
/** Open http(s)/mailto/tel via Linking (documented SDK behavior). */
|
|
6
|
+
export async function openExternalNavigateUrl(url: string): Promise<void> {
|
|
7
|
+
const external = normalizeExternalNavigateUrl(url);
|
|
8
|
+
await openSafeUrl(external);
|
|
9
|
+
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { NavigationContainerRef, ParamListBase } from '@react-navigation/native';
|
|
2
|
-
import { Linking } from 'react-native';
|
|
3
2
|
|
|
4
|
-
import { isSafeUrl
|
|
3
|
+
import { isSafeUrl } from '../content/openSafeUrl';
|
|
5
4
|
import { isolateAsync, isolateSync } from '../runtime/isolateCall';
|
|
6
5
|
|
|
6
|
+
import {
|
|
7
|
+
isInAppNavigateUrl,
|
|
8
|
+
mustNotUseExpoRouterPush,
|
|
9
|
+
normalizeInAppPath,
|
|
10
|
+
normalizeNavigateUrlInput,
|
|
11
|
+
routeNameFromPath,
|
|
12
|
+
shouldOpenExternalNavigateUrl,
|
|
13
|
+
} from './navigateUrlUtils';
|
|
14
|
+
import { openExternalNavigateUrl } from './openExternalNavigateUrl';
|
|
15
|
+
|
|
7
16
|
export type FlowNavigateHandler = (url: string) => void | boolean | Promise<void | boolean>;
|
|
8
17
|
|
|
9
18
|
export type ExpoRouterLike = {
|
|
@@ -31,38 +40,19 @@ export function setExpoRouterNavigator(router: ExpoRouterLike | null | undefined
|
|
|
31
40
|
expoRouter = router ?? null;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export function isInAppNavigateUrl(url: string): boolean {
|
|
41
|
-
const trimmed = url.trim();
|
|
42
|
-
if (!trimmed) return false;
|
|
43
|
-
if (isExternalNavigateUrl(trimmed)) return false;
|
|
44
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return false;
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function normalizeInAppPath(url: string): string {
|
|
49
|
-
const trimmed = url.trim();
|
|
50
|
-
if (trimmed.startsWith('/')) return trimmed;
|
|
51
|
-
return `/${trimmed}`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function routeNameFromPath(path: string): string {
|
|
55
|
-
const normalized = normalizeInAppPath(path).replace(/^\//, '');
|
|
56
|
-
const [first] = normalized.split(/[/?#]/);
|
|
57
|
-
return first || normalized;
|
|
58
|
-
}
|
|
43
|
+
export {
|
|
44
|
+
isExternalNavigateUrl,
|
|
45
|
+
isInAppNavigateUrl,
|
|
46
|
+
normalizeExternalNavigateUrl,
|
|
47
|
+
shouldOpenExternalNavigateUrl,
|
|
48
|
+
} from './navigateUrlUtils';
|
|
59
49
|
|
|
60
50
|
/**
|
|
61
51
|
* Open a flow NAVIGATE url.
|
|
62
52
|
*
|
|
63
53
|
* Priority:
|
|
64
54
|
* 1. Host `onNavigate` (custom schemes / exotic routing)
|
|
65
|
-
* 2. External allowlisted schemes →
|
|
55
|
+
* 2. External allowlisted schemes → in-app browser / Linking
|
|
66
56
|
* 3. Path-like → Expo Router `push` or React Navigation `navigate`
|
|
67
57
|
* 4. Fallback → Linking (best-effort)
|
|
68
58
|
*
|
|
@@ -72,9 +62,18 @@ function routeNameFromPath(path: string): string {
|
|
|
72
62
|
* `@userflow-tech/react-native/expo-router` under `UserflowProvider`.
|
|
73
63
|
*/
|
|
74
64
|
export async function openFlowNavigateUrl(url: string): Promise<void> {
|
|
75
|
-
const trimmed = url
|
|
65
|
+
const trimmed = normalizeNavigateUrlInput(url);
|
|
76
66
|
if (!trimmed) return;
|
|
77
67
|
|
|
68
|
+
if (__DEV__) {
|
|
69
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
70
|
+
console.log('[Userflow] NAVIGATE openFlowNavigateUrl', {
|
|
71
|
+
url: trimmed,
|
|
72
|
+
external: shouldOpenExternalNavigateUrl(trimmed),
|
|
73
|
+
inApp: isInAppNavigateUrl(trimmed),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
78
77
|
if (hostOnNavigate) {
|
|
79
78
|
await isolateAsync('onNavigate', async () => {
|
|
80
79
|
await hostOnNavigate!(trimmed);
|
|
@@ -82,13 +81,17 @@ export async function openFlowNavigateUrl(url: string): Promise<void> {
|
|
|
82
81
|
return;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
if (
|
|
86
|
-
await
|
|
84
|
+
if (shouldOpenExternalNavigateUrl(trimmed)) {
|
|
85
|
+
await openExternalNavigateUrl(trimmed);
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
if (isInAppNavigateUrl(trimmed)) {
|
|
91
90
|
if (expoRouter) {
|
|
91
|
+
if (mustNotUseExpoRouterPush(trimmed)) {
|
|
92
|
+
await openExternalNavigateUrl(trimmed);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
92
95
|
isolateSync('onNavigate', () => {
|
|
93
96
|
expoRouter!.push(normalizeInAppPath(trimmed));
|
|
94
97
|
});
|
|
@@ -104,11 +107,8 @@ export async function openFlowNavigateUrl(url: string): Promise<void> {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
await Linking.openURL(trimmed);
|
|
110
|
-
} catch {
|
|
111
|
-
// Best-effort.
|
|
110
|
+
if (isSafeUrl(trimmed) || /^https?:\/\//i.test(trimmed)) {
|
|
111
|
+
await openExternalNavigateUrl(trimmed);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -46,6 +46,11 @@ export interface PairingControllerOptions {
|
|
|
46
46
|
tokenStore?: PairingTokenStore;
|
|
47
47
|
/** Clear mid-flow session when exiting preview. */
|
|
48
48
|
clearLocalSession?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Runs before a Builder preview start is sent on the end-user channel.
|
|
51
|
+
* Defaults to {@link clearLocalSession} when omitted.
|
|
52
|
+
*/
|
|
53
|
+
prepareForBuilderPreviewStart?: () => void | Promise<void>;
|
|
49
54
|
/** End the previewed draft on the server when exiting preview. */
|
|
50
55
|
endDraftSession?: () => Promise<void>;
|
|
51
56
|
/**
|
|
@@ -84,6 +89,7 @@ export class PairingController {
|
|
|
84
89
|
private readonly LinkingModule: NonNullable<PairingControllerOptions['LinkingModule']>;
|
|
85
90
|
private readonly AppStateModule: NonNullable<PairingControllerOptions['AppStateModule']>;
|
|
86
91
|
private readonly clearLocalSession: (() => void) | undefined;
|
|
92
|
+
private readonly prepareForBuilderPreviewStart: (() => void | Promise<void>) | undefined;
|
|
87
93
|
private readonly endDraftSession: (() => Promise<void>) | undefined;
|
|
88
94
|
private readonly cancelPendingDraftEnd: (() => void) | undefined;
|
|
89
95
|
private readonly core: UserflowCore;
|
|
@@ -122,6 +128,7 @@ export class PairingController {
|
|
|
122
128
|
this.LinkingModule = options.LinkingModule ?? Linking;
|
|
123
129
|
this.AppStateModule = options.AppStateModule ?? AppState;
|
|
124
130
|
this.clearLocalSession = options.clearLocalSession ?? undefined;
|
|
131
|
+
this.prepareForBuilderPreviewStart = options.prepareForBuilderPreviewStart ?? undefined;
|
|
125
132
|
this.endDraftSession = options.endDraftSession ?? undefined;
|
|
126
133
|
this.cancelPendingDraftEnd = options.cancelPendingDraftEnd ?? undefined;
|
|
127
134
|
this.logger = options.logger ?? defaultPairingLogger;
|
|
@@ -596,7 +603,8 @@ export class PairingController {
|
|
|
596
603
|
...(this.pairingDeviceId !== null ? { device_id: this.pairingDeviceId } : {}),
|
|
597
604
|
}),
|
|
598
605
|
onBeforePreviewStart: () => {
|
|
599
|
-
this.clearLocalSession
|
|
606
|
+
const run = this.prepareForBuilderPreviewStart ?? this.clearLocalSession;
|
|
607
|
+
return run?.();
|
|
600
608
|
},
|
|
601
609
|
});
|
|
602
610
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { BannerSessionEngine } from '@userflow-tech/core';
|
|
2
|
-
import type { BannerSessionFragment } from '@userflow-tech/protocol';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { StyleSheet, View } from 'react-native';
|
|
5
4
|
|
|
6
5
|
import { BannerSurface } from '../surfaces/BannerSurface';
|
|
7
6
|
import { bannerOverlayHostPadding } from '../surfaces/bannerBarLayout';
|
|
8
|
-
import {
|
|
7
|
+
import { bannerNeedsWebView } from '../surfaces/bannerWebView/bannerNeedsWebView';
|
|
9
8
|
import { useUserflowSafeAreaInsets } from '../surfaces/safeArea';
|
|
10
9
|
|
|
11
10
|
import { SdkErrorBoundary } from './SdkErrorBoundary';
|
|
@@ -50,53 +49,72 @@ export function BannerHost({
|
|
|
50
49
|
if (edgeFilter && edge !== edgeFilter) return null;
|
|
51
50
|
|
|
52
51
|
const floats = banner.overlay !== false;
|
|
53
|
-
|
|
52
|
+
const usesWebView = bannerNeedsWebView(banner);
|
|
53
|
+
// Custom banner WebViews paint in the overlay host (same as userflow.js). A second
|
|
54
|
+
// WKWebView in the flow slot often fails to load after the first banner dismisses.
|
|
55
|
+
const hostAsOverlay = floats || usesWebView;
|
|
56
|
+
if ((placement === 'overlay') !== hostAsOverlay) return null;
|
|
57
|
+
|
|
58
|
+
const pushLayoutEdge = placement === 'flow' && !hostAsOverlay ? edge : null;
|
|
59
|
+
// Builder overlay:true floats below the status bar. Push-layout WebViews in the overlay
|
|
60
|
+
// host still paint safe-area chrome (overlay:false + custom banner).
|
|
61
|
+
const overlaySafeEdge = hostAsOverlay && !floats ? edge : null;
|
|
62
|
+
|
|
63
|
+
const surface = (
|
|
64
|
+
<BannerSurface
|
|
65
|
+
session={session}
|
|
66
|
+
pushLayoutEdge={pushLayoutEdge}
|
|
67
|
+
overlaySafeEdge={overlaySafeEdge}
|
|
68
|
+
onActions={(actions) => engine.handleActions(actions)}
|
|
69
|
+
onDismiss={(endReason) => {
|
|
70
|
+
void engine.endBanner(endReason);
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
54
74
|
|
|
55
75
|
const bar = (
|
|
56
76
|
<SdkErrorBoundary scope="banner" resetKey={session.id}>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
{placement === 'flow' ? (
|
|
78
|
+
<View testID="userflow-banner-flow" style={styles.flow}>
|
|
79
|
+
{surface}
|
|
80
|
+
</View>
|
|
81
|
+
) : (
|
|
82
|
+
surface
|
|
83
|
+
)}
|
|
64
84
|
</SdkErrorBoundary>
|
|
65
85
|
);
|
|
66
86
|
|
|
67
87
|
if (placement === 'flow') {
|
|
68
|
-
|
|
69
|
-
const safePad = edge === 'top' ? { paddingTop: insets.top } : { paddingBottom: insets.bottom };
|
|
70
|
-
return (
|
|
71
|
-
<View testID="userflow-banner-flow" style={[styles.flow, safePad, { backgroundColor }]}>
|
|
72
|
-
{bar}
|
|
73
|
-
</View>
|
|
74
|
-
);
|
|
88
|
+
return bar;
|
|
75
89
|
}
|
|
76
90
|
|
|
77
|
-
const edgeStyle =
|
|
91
|
+
const edgeStyle =
|
|
92
|
+
edge === 'top' ? { top: floats ? insets.top : 0 } : { bottom: floats ? insets.bottom : 0 };
|
|
78
93
|
|
|
79
94
|
return (
|
|
80
95
|
<View
|
|
81
96
|
pointerEvents="box-none"
|
|
82
97
|
style={[styles.pin, edgeStyle, bannerOverlayHostPadding(insets)]}
|
|
83
98
|
>
|
|
84
|
-
{
|
|
99
|
+
<View pointerEvents="auto" style={styles.pinInteractive}>
|
|
100
|
+
{bar}
|
|
101
|
+
</View>
|
|
85
102
|
</View>
|
|
86
103
|
);
|
|
87
104
|
}
|
|
88
105
|
|
|
89
|
-
function bannerBackground(session: BannerSessionFragment): string {
|
|
90
|
-
return resolveBannerBackgroundColor(session.version.theme);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
106
|
const styles = StyleSheet.create({
|
|
94
107
|
pin: {
|
|
95
108
|
position: 'absolute',
|
|
96
109
|
left: 0,
|
|
97
110
|
right: 0,
|
|
111
|
+
zIndex: 10,
|
|
112
|
+
elevation: 10,
|
|
98
113
|
},
|
|
99
114
|
flow: {
|
|
100
115
|
alignSelf: 'stretch',
|
|
101
116
|
},
|
|
117
|
+
pinInteractive: {
|
|
118
|
+
alignSelf: 'stretch',
|
|
119
|
+
},
|
|
102
120
|
});
|
|
@@ -2,10 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { StyleSheet, View, type GestureResponderEvent } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { elementTapMonitor } from '../anchors/elementTapMonitor';
|
|
5
|
+
import type { AnyFiber } from '../anchors/fiber/fiberInternals';
|
|
5
6
|
import { touchBelongsToEvent, touchTargetFiber } from '../anchors/fiber/touchTargetFiber';
|
|
6
|
-
import {
|
|
7
|
+
import { collectGestureHandlerTags } from '../anchors/gestureHandlerHandoff';
|
|
8
|
+
import { targetPressMonitor, type TouchIdentifier } from '../anchors/targetPressMonitor';
|
|
7
9
|
|
|
8
|
-
import {
|
|
10
|
+
import { forEachChangedTouch } from './changedTouchPoints';
|
|
9
11
|
import { isolateSync } from './isolateCall';
|
|
10
12
|
|
|
11
13
|
export interface TargetPressBridgeProps {
|
|
@@ -25,6 +27,9 @@ export interface TargetPressBridgeProps {
|
|
|
25
27
|
* Preview-chrome double taps are observed by `DoubleTapBridge` around the
|
|
26
28
|
* whole provider tree — this bridge never sees overlay touches.
|
|
27
29
|
*
|
|
30
|
+
* A touch that gesture-handler cancels is not dropped. The start is kept and
|
|
31
|
+
* counts as a tap if that handler later ends from ACTIVE.
|
|
32
|
+
*
|
|
28
33
|
* Does not claim the gesture responder.
|
|
29
34
|
*/
|
|
30
35
|
export function TargetPressBridge({ children }: TargetPressBridgeProps): React.ReactElement {
|
|
@@ -57,15 +62,23 @@ export function TargetPressBridge({ children }: TargetPressBridgeProps): React.R
|
|
|
57
62
|
|
|
58
63
|
const onTouchCancel = React.useCallback((event: GestureResponderEvent) => {
|
|
59
64
|
isolateSync('target-press', () => {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
const changed = event.nativeEvent.changedTouches;
|
|
66
|
+
if (!changed || changed.length === 0) {
|
|
67
|
+
const identifiers = inProgressIdentifiers();
|
|
68
|
+
if (identifiers.length === 0) {
|
|
69
|
+
targetPressMonitor.cancelTouch();
|
|
70
|
+
elementTapMonitor.cancelTouch();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// No per-finger target on this event; every finger shares its view.
|
|
74
|
+
const fallback = touchTargetFiber(event);
|
|
75
|
+
for (const identifier of identifiers) {
|
|
76
|
+
handOffCancelledTouch(event, identifier, fallback);
|
|
77
|
+
}
|
|
64
78
|
return;
|
|
65
79
|
}
|
|
66
|
-
for (const touch of
|
|
67
|
-
|
|
68
|
-
elementTapMonitor.cancelTouch(touch.identifier);
|
|
80
|
+
for (const touch of changed) {
|
|
81
|
+
handOffCancelledTouch(event, touch.identifier, null);
|
|
69
82
|
}
|
|
70
83
|
});
|
|
71
84
|
}, []);
|
|
@@ -84,6 +97,50 @@ export function TargetPressBridge({ children }: TargetPressBridgeProps): React.R
|
|
|
84
97
|
);
|
|
85
98
|
}
|
|
86
99
|
|
|
100
|
+
/**
|
|
101
|
+
* A finger gesture-handler cancelled. Keep it if the touched view belongs to a
|
|
102
|
+
* gesture-handler control. A scroll container, or a touch with no handler, is
|
|
103
|
+
* dropped the way a system cancel is.
|
|
104
|
+
* `fallbackFiber` is used when this event names no per-finger target.
|
|
105
|
+
*/
|
|
106
|
+
function handOffCancelledTouch(
|
|
107
|
+
event: GestureResponderEvent,
|
|
108
|
+
identifier: TouchIdentifier,
|
|
109
|
+
fallbackFiber: AnyFiber | null,
|
|
110
|
+
): void {
|
|
111
|
+
const elementHas = elementTapMonitor.hasTouch(identifier);
|
|
112
|
+
const tooltipHas = targetPressMonitor.hasTouch(identifier);
|
|
113
|
+
if (!elementHas && !tooltipHas) {
|
|
114
|
+
elementTapMonitor.cancelTouch(identifier);
|
|
115
|
+
targetPressMonitor.cancelTouch(identifier);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const stored = elementHas ? elementTapMonitor.startFiber(identifier) : null;
|
|
119
|
+
const fiber = stored ?? fallbackFiber ?? touchTargetFiber(event, identifier);
|
|
120
|
+
const tags = collectGestureHandlerTags(fiber);
|
|
121
|
+
if (tags.length === 0) {
|
|
122
|
+
elementTapMonitor.cancelTouch(identifier);
|
|
123
|
+
targetPressMonitor.cancelTouch(identifier);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (elementHas) elementTapMonitor.handOffTouch(identifier, tags);
|
|
127
|
+
if (tooltipHas) targetPressMonitor.handOffTouch(identifier, tags);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function inProgressIdentifiers(): TouchIdentifier[] {
|
|
131
|
+
const seen = new Set<TouchIdentifier>();
|
|
132
|
+
const identifiers: TouchIdentifier[] = [];
|
|
133
|
+
for (const identifier of [
|
|
134
|
+
...elementTapMonitor.inProgressIdentifiers(),
|
|
135
|
+
...targetPressMonitor.inProgressIdentifiers(),
|
|
136
|
+
]) {
|
|
137
|
+
if (seen.has(identifier)) continue;
|
|
138
|
+
seen.add(identifier);
|
|
139
|
+
identifiers.push(identifier);
|
|
140
|
+
}
|
|
141
|
+
return identifiers;
|
|
142
|
+
}
|
|
143
|
+
|
|
87
144
|
const styles = StyleSheet.create({
|
|
88
145
|
root: {
|
|
89
146
|
flex: 1,
|
|
@@ -8,6 +8,7 @@ import { PreviewModeBanner } from '../pairing/PreviewModeBanner';
|
|
|
8
8
|
import { getPairingController } from '../pairing/pairingRuntime';
|
|
9
9
|
import { usePairingState } from '../pairing/usePairingState';
|
|
10
10
|
import { usePreviewBarHold } from '../pairing/usePreviewBarHold';
|
|
11
|
+
import { stepTrapsHostAccessibility } from '../surfaces/hostAccessibilityTrap';
|
|
11
12
|
|
|
12
13
|
import { BannerHost } from './BannerHost';
|
|
13
14
|
import { FlowRenderer } from './FlowRenderer';
|
|
@@ -57,14 +58,7 @@ export function UserflowOverlay({
|
|
|
57
58
|
if (!session || !currentStep) {
|
|
58
59
|
return false;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
if (appearance === 'HIDDEN') {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
if (appearance !== 'TOOLTIP') {
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
return currentStep.tooltipTargetBlocked;
|
|
61
|
+
return stepTrapsHostAccessibility(currentStep);
|
|
68
62
|
}, [pickerActive, previewConfirming, session, currentStep]);
|
|
69
63
|
|
|
70
64
|
React.useLayoutEffect(() => {
|
|
@@ -105,13 +99,17 @@ export function UserflowOverlay({
|
|
|
105
99
|
* captureScreen would otherwise include the modal or tooltip.
|
|
106
100
|
* Remounting reads the same session back.
|
|
107
101
|
*/}
|
|
108
|
-
<BannerHost engine={bannerEngine} hidden={pickerActive} />
|
|
109
102
|
{pickerActive ? null : (
|
|
110
103
|
<FlowRenderer
|
|
111
104
|
engine={engine}
|
|
112
105
|
previewRestartGeneration={pairingState.previewRestartGeneration}
|
|
113
106
|
/>
|
|
114
107
|
)}
|
|
108
|
+
{/*
|
|
109
|
+
* After flow chrome so BODY_FIRST / BODY_LAST overlay banners stay visible
|
|
110
|
+
* while a tour step (modal, tooltip, condition wait) is still active.
|
|
111
|
+
*/}
|
|
112
|
+
<BannerHost engine={bannerEngine} hidden={pickerActive} />
|
|
115
113
|
<ElementPickerOverlay />
|
|
116
114
|
</>
|
|
117
115
|
);
|
|
@@ -15,15 +15,15 @@ import type { EdgeInsets } from '../surfaces/safeArea';
|
|
|
15
15
|
import { SurfaceLayoutInsetsProvider } from '../surfaces/surfaceLayoutInsets';
|
|
16
16
|
|
|
17
17
|
import { BannerHost } from './BannerHost';
|
|
18
|
+
import { BannerWebViewFlowSpacer } from './bannerFlowSpacer';
|
|
18
19
|
import { SdkErrorBoundary } from './SdkErrorBoundary';
|
|
19
20
|
import { TargetPressBridge } from './TargetPressBridge';
|
|
20
21
|
import { UserflowOverlay } from './UserflowOverlay';
|
|
21
22
|
import { getBannerSessionEngine } from './bannerEngine';
|
|
22
23
|
import { BannerEngineContext } from './bannerEngineContext';
|
|
23
|
-
import { bannerEdge } from './bannerPlacement';
|
|
24
24
|
import { getFlowSessionEngine } from './flowEngine';
|
|
25
|
+
import { PushBannerLayoutProvider, type PushBannerLayoutEdge } from './pushBannerLayoutContext';
|
|
25
26
|
import { isolateSync } from './isolateCall';
|
|
26
|
-
import { useBannerSession } from './useBannerSession';
|
|
27
27
|
import { getUserflowCore } from './userflowCore';
|
|
28
28
|
|
|
29
29
|
export interface UserflowContextValue {
|
|
@@ -122,8 +122,9 @@ export function UserflowProvider({
|
|
|
122
122
|
const onOverlayError = React.useCallback(() => {
|
|
123
123
|
setTrapHostAccessibility(false);
|
|
124
124
|
}, []);
|
|
125
|
-
const bannerSession = useBannerSession(bannerEngine);
|
|
126
125
|
const safeInsets = useUserflowSafeAreaInsets();
|
|
126
|
+
const [pushBannerLayoutEdge, setPushBannerLayoutEdge] =
|
|
127
|
+
React.useState<PushBannerLayoutEdge | null>(null);
|
|
127
128
|
const [pickerActive, setPickerActive] = React.useState(
|
|
128
129
|
() => elementPickerController.getState().active,
|
|
129
130
|
);
|
|
@@ -134,15 +135,12 @@ export function UserflowProvider({
|
|
|
134
135
|
});
|
|
135
136
|
}, []);
|
|
136
137
|
|
|
137
|
-
const banner = bannerSession?.version.banner ?? null;
|
|
138
|
-
const flowEdge =
|
|
139
|
-
banner && banner.overlay === false && !pickerActive ? bannerEdge(banner.embedMode) : null;
|
|
140
138
|
const hostInsets: EdgeInsets | null =
|
|
141
|
-
|
|
139
|
+
pushBannerLayoutEdge === 'top' || pushBannerLayoutEdge === 'bottom'
|
|
142
140
|
? {
|
|
143
141
|
...safeInsets,
|
|
144
|
-
top:
|
|
145
|
-
bottom:
|
|
142
|
+
top: pushBannerLayoutEdge === 'top' ? 0 : safeInsets.top,
|
|
143
|
+
bottom: pushBannerLayoutEdge === 'bottom' ? 0 : safeInsets.bottom,
|
|
146
144
|
}
|
|
147
145
|
: null;
|
|
148
146
|
|
|
@@ -163,31 +161,44 @@ export function UserflowProvider({
|
|
|
163
161
|
<BannerEngineContext.Provider value={bannerEngine}>
|
|
164
162
|
<UserflowContext.Provider value={contextValue}>
|
|
165
163
|
<SurfaceLayoutInsetsProvider>
|
|
166
|
-
<
|
|
167
|
-
<
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/>
|
|
176
|
-
<View style={styles.overlay} pointerEvents="box-none">
|
|
177
|
-
<SdkErrorBoundary
|
|
178
|
-
scope="overlay"
|
|
179
|
-
resetKey={overlayResetKey}
|
|
180
|
-
onError={onOverlayError}
|
|
181
|
-
>
|
|
182
|
-
<UserflowOverlay
|
|
183
|
-
engine={engine}
|
|
184
|
-
bannerEngine={bannerEngine}
|
|
185
|
-
onTrapChange={onTrapChange}
|
|
164
|
+
<PushBannerLayoutProvider onActiveEdgeChange={setPushBannerLayoutEdge}>
|
|
165
|
+
<DoubleTapBridge>
|
|
166
|
+
<View style={styles.root} collapsable={false} testID="userflow-root">
|
|
167
|
+
<View style={styles.flowBannerTop}>
|
|
168
|
+
<BannerHost
|
|
169
|
+
engine={bannerEngine}
|
|
170
|
+
placement="flow"
|
|
171
|
+
edge="top"
|
|
172
|
+
hidden={pickerActive}
|
|
186
173
|
/>
|
|
187
|
-
|
|
174
|
+
<BannerWebViewFlowSpacer engine={bannerEngine} edge="top" />
|
|
175
|
+
</View>
|
|
176
|
+
<HostSafeArea insets={hostInsets}>{appContent}</HostSafeArea>
|
|
177
|
+
<View style={styles.flowBannerBottom}>
|
|
178
|
+
<BannerHost
|
|
179
|
+
engine={bannerEngine}
|
|
180
|
+
placement="flow"
|
|
181
|
+
edge="bottom"
|
|
182
|
+
hidden={pickerActive}
|
|
183
|
+
/>
|
|
184
|
+
<BannerWebViewFlowSpacer engine={bannerEngine} edge="bottom" />
|
|
185
|
+
</View>
|
|
186
|
+
<View style={styles.overlay} pointerEvents="box-none">
|
|
187
|
+
<SdkErrorBoundary
|
|
188
|
+
scope="overlay"
|
|
189
|
+
resetKey={overlayResetKey}
|
|
190
|
+
onError={onOverlayError}
|
|
191
|
+
>
|
|
192
|
+
<UserflowOverlay
|
|
193
|
+
engine={engine}
|
|
194
|
+
bannerEngine={bannerEngine}
|
|
195
|
+
onTrapChange={onTrapChange}
|
|
196
|
+
/>
|
|
197
|
+
</SdkErrorBoundary>
|
|
198
|
+
</View>
|
|
188
199
|
</View>
|
|
189
|
-
</
|
|
190
|
-
</
|
|
200
|
+
</DoubleTapBridge>
|
|
201
|
+
</PushBannerLayoutProvider>
|
|
191
202
|
</SurfaceLayoutInsetsProvider>
|
|
192
203
|
</UserflowContext.Provider>
|
|
193
204
|
</BannerEngineContext.Provider>
|
|
@@ -228,7 +239,20 @@ const styles = StyleSheet.create({
|
|
|
228
239
|
appContent: {
|
|
229
240
|
flex: 1,
|
|
230
241
|
},
|
|
242
|
+
flowBannerTop: {
|
|
243
|
+
zIndex: 1,
|
|
244
|
+
elevation: 1,
|
|
245
|
+
pointerEvents: 'box-none',
|
|
246
|
+
},
|
|
247
|
+
flowBannerBottom: {
|
|
248
|
+
zIndex: 1,
|
|
249
|
+
elevation: 1,
|
|
250
|
+
pointerEvents: 'box-none',
|
|
251
|
+
},
|
|
231
252
|
overlay: {
|
|
232
253
|
...ABSOLUTE_FILL,
|
|
254
|
+
// Above flow banner slots so WebView banners receive touches (spacers are layout-only).
|
|
255
|
+
zIndex: 2,
|
|
256
|
+
elevation: 2,
|
|
233
257
|
},
|
|
234
258
|
});
|