@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
|
@@ -7,7 +7,9 @@ import { Animated, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
|
7
7
|
import { BannerStepButton } from "../content/BannerStepButton.js";
|
|
8
8
|
import { RichContentRenderer } from "../content/RichContentRenderer.js";
|
|
9
9
|
import { mixThemeColors } from "../content/themeColor.js";
|
|
10
|
-
import {
|
|
10
|
+
import { usePushBannerHostInsetRegistration } from "../runtime/pushBannerLayoutContext.js";
|
|
11
|
+
import { BANNER_CLOSE_SLOT_SIZE, BANNER_ROOT_PADDING, bannerBarRootStyle, bannerFrameStyle, bannerInnerStyle, bannerPushLayoutChrome, resolveBannerBarBorderRadius } from "./bannerBarLayout.js";
|
|
12
|
+
import { useUserflowSafeAreaInsets } from "./safeArea.js";
|
|
11
13
|
import { BANNER_BUTTON_GAP, BANNER_CLOSE_BORDER_RADIUS, bannerOverlayShadowStyle } from "./bannerBarTokens.js";
|
|
12
14
|
import { resolveBannerBackgroundColor, resolveBannerForegroundColor } from "./resolveBannerTheme.js";
|
|
13
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -17,6 +19,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
19
|
*/
|
|
18
20
|
export function BannerBar({
|
|
19
21
|
session,
|
|
22
|
+
pushLayoutEdge = null,
|
|
23
|
+
overlaySafeEdge = null,
|
|
20
24
|
onActions,
|
|
21
25
|
onDismiss
|
|
22
26
|
}) {
|
|
@@ -30,9 +34,15 @@ export function BannerBar({
|
|
|
30
34
|
fontColor: foregroundColor
|
|
31
35
|
}), [theme, backgroundColor, foregroundColor]);
|
|
32
36
|
const lookupAttribute = React.useMemo(() => genSessionDataLookup(session.data), [session.data]);
|
|
33
|
-
const
|
|
37
|
+
const insets = useUserflowSafeAreaInsets();
|
|
38
|
+
const overlay = banner?.overlay !== false;
|
|
39
|
+
const hostInsetEdge = !overlay && pushLayoutEdge ? pushLayoutEdge : null;
|
|
40
|
+
const safeAreaEdge = hostInsetEdge ?? overlaySafeEdge ?? null;
|
|
41
|
+
const onPushChromeLayout = usePushBannerHostInsetRegistration(hostInsetEdge, session.id, hostInsetEdge != null);
|
|
42
|
+
const fadeIn = banner?.animate === true && hostInsetEdge == null;
|
|
43
|
+
const opacity = React.useRef(new Animated.Value(fadeIn ? 0 : 1)).current;
|
|
34
44
|
React.useEffect(() => {
|
|
35
|
-
if (!
|
|
45
|
+
if (!fadeIn) {
|
|
36
46
|
opacity.setValue(1);
|
|
37
47
|
return;
|
|
38
48
|
}
|
|
@@ -46,74 +56,82 @@ export function BannerBar({
|
|
|
46
56
|
return () => {
|
|
47
57
|
animation.stop();
|
|
48
58
|
};
|
|
49
|
-
}, [
|
|
59
|
+
}, [fadeIn, opacity, session.id]);
|
|
50
60
|
if (!banner) return null;
|
|
51
|
-
const overlay = banner.overlay !== false;
|
|
52
61
|
const frameStyle = bannerFrameStyle(banner);
|
|
62
|
+
const rootStyle = bannerBarRootStyle(banner);
|
|
53
63
|
const innerStyle = bannerInnerStyle(banner);
|
|
54
64
|
const closePressedBackground = mixThemeColors(backgroundColor, foregroundColor, 0.12);
|
|
55
65
|
const overlayEdge = banner.embedMode === BannerEmbedMode.BODY_LAST ? 'bottom' : 'top';
|
|
56
66
|
const barRadius = resolveBannerBarBorderRadius(banner);
|
|
67
|
+
const insetChrome = safeAreaEdge ? bannerPushLayoutChrome(safeAreaEdge, insets, backgroundColor) : null;
|
|
68
|
+
const insetChromeOutsideFade = insetChrome != null && fadeIn;
|
|
69
|
+
const bar = /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
testID: "userflow-banner",
|
|
71
|
+
style: [styles.root, rootStyle, {
|
|
72
|
+
backgroundColor
|
|
73
|
+
}, barRadius != null ? {
|
|
74
|
+
borderRadius: barRadius,
|
|
75
|
+
overflow: 'hidden'
|
|
76
|
+
} : null],
|
|
77
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: styles.startSpacer
|
|
79
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
80
|
+
style: innerStyle,
|
|
81
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
82
|
+
style: styles.content,
|
|
83
|
+
children: /*#__PURE__*/_jsx(RichContentRenderer, {
|
|
84
|
+
content: banner.content,
|
|
85
|
+
buttons: [],
|
|
86
|
+
theme: bannerTheme,
|
|
87
|
+
sessionData: session.data,
|
|
88
|
+
lookupAttribute: lookupAttribute,
|
|
89
|
+
onActions: onActions
|
|
90
|
+
})
|
|
91
|
+
}), banner.buttons.length > 0 ? /*#__PURE__*/_jsx(View, {
|
|
92
|
+
style: styles.buttons,
|
|
93
|
+
children: banner.buttons.map(button => /*#__PURE__*/_jsx(BannerStepButton, {
|
|
94
|
+
button: button,
|
|
95
|
+
theme: bannerTheme,
|
|
96
|
+
sessionData: session.data,
|
|
97
|
+
onActions: onActions
|
|
98
|
+
}, button.id))
|
|
99
|
+
}) : null]
|
|
100
|
+
}), session.version.closeDisabled ? /*#__PURE__*/_jsx(View, {
|
|
101
|
+
style: styles.startSpacer
|
|
102
|
+
}) : /*#__PURE__*/_jsx(Pressable, {
|
|
103
|
+
testID: "userflow-banner-dismiss",
|
|
104
|
+
accessibilityRole: "button",
|
|
105
|
+
accessibilityLabel: "Dismiss",
|
|
106
|
+
hitSlop: 8,
|
|
107
|
+
onPress: () => onDismiss(EndFlowReasonInput.USER_CLOSED),
|
|
108
|
+
style: ({
|
|
109
|
+
pressed
|
|
110
|
+
}) => [styles.close, pressed ? {
|
|
111
|
+
backgroundColor: closePressedBackground
|
|
112
|
+
} : null],
|
|
113
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
114
|
+
style: [styles.dismissIcon, {
|
|
115
|
+
color: foregroundColor
|
|
116
|
+
}],
|
|
117
|
+
children: "\xD7"
|
|
118
|
+
})
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
121
|
+
const animatedBar = /*#__PURE__*/_jsx(Animated.View, {
|
|
122
|
+
onLayout: hostInsetEdge ? onPushChromeLayout : undefined,
|
|
123
|
+
style: [{
|
|
124
|
+
opacity
|
|
125
|
+
}, overlay ? bannerOverlayShadowStyle(overlayEdge) : null, insetChromeOutsideFade ? null : insetChrome],
|
|
126
|
+
children: bar
|
|
127
|
+
});
|
|
57
128
|
return /*#__PURE__*/_jsx(View, {
|
|
58
129
|
testID: "userflow-banner-frame",
|
|
59
130
|
style: frameStyle,
|
|
60
|
-
children: /*#__PURE__*/_jsx(
|
|
61
|
-
style:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
65
|
-
testID: "userflow-banner",
|
|
66
|
-
style: [styles.root, {
|
|
67
|
-
backgroundColor
|
|
68
|
-
}, barRadius != null ? {
|
|
69
|
-
borderRadius: barRadius,
|
|
70
|
-
overflow: 'hidden'
|
|
71
|
-
} : null],
|
|
72
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
73
|
-
style: styles.startSpacer
|
|
74
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
75
|
-
style: innerStyle,
|
|
76
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
77
|
-
style: styles.content,
|
|
78
|
-
children: /*#__PURE__*/_jsx(RichContentRenderer, {
|
|
79
|
-
content: banner.content,
|
|
80
|
-
buttons: [],
|
|
81
|
-
theme: bannerTheme,
|
|
82
|
-
sessionData: session.data,
|
|
83
|
-
lookupAttribute: lookupAttribute,
|
|
84
|
-
onActions: onActions
|
|
85
|
-
})
|
|
86
|
-
}), banner.buttons.length > 0 ? /*#__PURE__*/_jsx(View, {
|
|
87
|
-
style: styles.buttons,
|
|
88
|
-
children: banner.buttons.map(button => /*#__PURE__*/_jsx(BannerStepButton, {
|
|
89
|
-
button: button,
|
|
90
|
-
theme: bannerTheme,
|
|
91
|
-
sessionData: session.data,
|
|
92
|
-
onActions: onActions
|
|
93
|
-
}, button.id))
|
|
94
|
-
}) : null]
|
|
95
|
-
}), session.version.closeDisabled ? /*#__PURE__*/_jsx(View, {
|
|
96
|
-
style: styles.startSpacer
|
|
97
|
-
}) : /*#__PURE__*/_jsx(Pressable, {
|
|
98
|
-
testID: "userflow-banner-dismiss",
|
|
99
|
-
accessibilityRole: "button",
|
|
100
|
-
accessibilityLabel: "Dismiss",
|
|
101
|
-
hitSlop: 8,
|
|
102
|
-
onPress: () => onDismiss(EndFlowReasonInput.USER_CLOSED),
|
|
103
|
-
style: ({
|
|
104
|
-
pressed
|
|
105
|
-
}) => [styles.close, pressed ? {
|
|
106
|
-
backgroundColor: closePressedBackground
|
|
107
|
-
} : null],
|
|
108
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
109
|
-
style: [styles.dismissIcon, {
|
|
110
|
-
color: foregroundColor
|
|
111
|
-
}],
|
|
112
|
-
children: "\xD7"
|
|
113
|
-
})
|
|
114
|
-
})]
|
|
115
|
-
})
|
|
116
|
-
})
|
|
131
|
+
children: insetChromeOutsideFade ? /*#__PURE__*/_jsx(View, {
|
|
132
|
+
style: insetChrome,
|
|
133
|
+
children: animatedBar
|
|
134
|
+
}) : animatedBar
|
|
117
135
|
});
|
|
118
136
|
}
|
|
119
137
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["genSessionDataLookup","BannerEmbedMode","EndFlowReasonInput","React","Animated","Pressable","StyleSheet","Text","View","BannerStepButton","RichContentRenderer","mixThemeColors","BANNER_CLOSE_SLOT_SIZE","BANNER_ROOT_PADDING","bannerFrameStyle","bannerInnerStyle","resolveBannerBarBorderRadius","BANNER_BUTTON_GAP","BANNER_CLOSE_BORDER_RADIUS","bannerOverlayShadowStyle","resolveBannerBackgroundColor","resolveBannerForegroundColor","jsx","_jsx","jsxs","_jsxs","BannerBar","session","onActions","onDismiss","banner","version","theme","backgroundColor","foregroundColor","bannerTheme","useMemo","fontColor","lookupAttribute","data","
|
|
1
|
+
{"version":3,"names":["genSessionDataLookup","BannerEmbedMode","EndFlowReasonInput","React","Animated","Pressable","StyleSheet","Text","View","BannerStepButton","RichContentRenderer","mixThemeColors","usePushBannerHostInsetRegistration","BANNER_CLOSE_SLOT_SIZE","BANNER_ROOT_PADDING","bannerBarRootStyle","bannerFrameStyle","bannerInnerStyle","bannerPushLayoutChrome","resolveBannerBarBorderRadius","useUserflowSafeAreaInsets","BANNER_BUTTON_GAP","BANNER_CLOSE_BORDER_RADIUS","bannerOverlayShadowStyle","resolveBannerBackgroundColor","resolveBannerForegroundColor","jsx","_jsx","jsxs","_jsxs","BannerBar","session","pushLayoutEdge","overlaySafeEdge","onActions","onDismiss","banner","version","theme","backgroundColor","foregroundColor","bannerTheme","useMemo","fontColor","lookupAttribute","data","insets","overlay","hostInsetEdge","safeAreaEdge","onPushChromeLayout","id","fadeIn","animate","opacity","useRef","Value","current","useEffect","setValue","animation","timing","toValue","duration","useNativeDriver","start","stop","frameStyle","rootStyle","innerStyle","closePressedBackground","overlayEdge","embedMode","BODY_LAST","barRadius","insetChrome","insetChromeOutsideFade","bar","testID","style","styles","root","borderRadius","overflow","children","startSpacer","content","buttons","sessionData","length","map","button","closeDisabled","accessibilityRole","accessibilityLabel","hitSlop","onPress","USER_CLOSED","pressed","close","dismissIcon","color","animatedBar","onLayout","undefined","create","flexDirection","alignItems","padding","flexGrow","flexShrink","maxWidth","height","minWidth","flexWrap","gap","width","justifyContent","fontSize","lineHeight","fontWeight"],"sourceRoot":"../../../src","sources":["surfaces/BannerBar.tsx"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,qBAAqB;AAE1D,SACEC,eAAe,EACfC,kBAAkB,QAEb,yBAAyB;AAChC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAE1E,SAASC,gBAAgB,QAAQ,gCAA6B;AAC9D,SAASC,mBAAmB,QAAQ,mCAAgC;AACpE,SAASC,cAAc,QAAQ,0BAAuB;AACtD,SAASC,kCAAkC,QAAQ,uCAAoC;AAEvF,SACEC,sBAAsB,EACtBC,mBAAmB,EACnBC,kBAAkB,EAClBC,gBAAgB,EAChBC,gBAAgB,EAChBC,sBAAsB,EACtBC,4BAA4B,QACvB,sBAAmB;AAC1B,SAASC,yBAAyB,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ACnB,IAAI;MAACuE,KAAK,EAAEJ,WAAY;MAAAS,QAAA,EAAEkB;IAAW,CAAO,CAAC,GAAGA;EAAW,CAClF,CAAC;AAEX;AAEA,MAAMtB,MAAM,GAAG1E,UAAU,CAACmG,MAAM,CAAC;EAC/BxB,IAAI,EAAE;IACJyB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE9F;EACX,CAAC;EACDuE,WAAW,EAAE;IACXwB,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE,CAAC;IACbC,QAAQ,EAAElG,sBAAsB;IAChCmG,MAAM,EAAEnG;EACV,CAAC;EACDyE,OAAO,EAAE;IACPwB,UAAU,EAAE,CAAC;IACbG,QAAQ,EAAE;EACZ,CAAC;EACD1B,OAAO,EAAE;IACPmB,aAAa,EAAE,KAAK;IACpBQ,QAAQ,EAAE,QAAQ;IAClBP,UAAU,EAAE,QAAQ;IACpBQ,GAAG,EAAE9F;EACP,CAAC;EACD8E,KAAK,EAAE;IACLiB,KAAK,EAAEvG,sBAAsB;IAC7BmG,MAAM,EAAEnG,sBAAsB;IAC9B8F,UAAU,EAAE,QAAQ;IACpBU,cAAc,EAAE,QAAQ;IACxBP,UAAU,EAAE,CAAC;IACb5B,YAAY,EAAE5D;EAChB,CAAC;EACD8E,WAAW,EAAE;IACXkB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -10,19 +10,35 @@ import { bannerNeedsWebView } from "./bannerWebView/bannerNeedsWebView.js";
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
let warnedMissingWebView = false;
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* Native banner bar, or a WebView when a button runs Evaluate JavaScript or the
|
|
15
|
-
* theme has published custom CSS (same CDN stylesheet as userflow.js iframes).
|
|
16
|
-
*/
|
|
13
|
+
/** Native banner bar, or a WebView when `customBannerEnabled` is set on the banner. */
|
|
17
14
|
export function BannerSurface({
|
|
18
15
|
session,
|
|
16
|
+
pushLayoutEdge = null,
|
|
17
|
+
overlaySafeEdge = null,
|
|
19
18
|
onActions,
|
|
20
19
|
onDismiss
|
|
21
20
|
}) {
|
|
22
21
|
const banner = session.version.banner;
|
|
23
|
-
const
|
|
24
|
-
const needsWebView = banner != null && bannerNeedsWebView(banner, theme);
|
|
22
|
+
const needsWebView = banner != null && bannerNeedsWebView(banner);
|
|
25
23
|
const webView = needsWebView ? getEvalJsWebView() : null;
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
if (!banner || !__DEV__) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
29
|
+
console.log('[Userflow] banner shown', {
|
|
30
|
+
flowId: session.flow.id,
|
|
31
|
+
flowName: session.flow.name,
|
|
32
|
+
bannerSessionId: session.id,
|
|
33
|
+
versionId: session.version.id,
|
|
34
|
+
embedMode: banner.embedMode,
|
|
35
|
+
overlay: banner.overlay !== false,
|
|
36
|
+
webView: needsWebView,
|
|
37
|
+
pushLayoutEdge: pushLayoutEdge ?? null,
|
|
38
|
+
overlaySafeEdge: overlaySafeEdge ?? null,
|
|
39
|
+
hostAsOverlay: banner.overlay !== false || needsWebView
|
|
40
|
+
});
|
|
41
|
+
}, [banner, needsWebView, overlaySafeEdge, pushLayoutEdge, session.flow.id, session.flow.name, session.id, session.version.id]);
|
|
26
42
|
React.useLayoutEffect(() => {
|
|
27
43
|
if (!needsWebView || !webView) {
|
|
28
44
|
return;
|
|
@@ -50,18 +66,24 @@ export function BannerSurface({
|
|
|
50
66
|
}
|
|
51
67
|
return /*#__PURE__*/_jsx(BannerBar, {
|
|
52
68
|
session: session,
|
|
69
|
+
pushLayoutEdge: pushLayoutEdge,
|
|
70
|
+
overlaySafeEdge: overlaySafeEdge,
|
|
53
71
|
onActions: onActions,
|
|
54
72
|
onDismiss: onDismiss
|
|
55
73
|
});
|
|
56
74
|
}
|
|
57
75
|
return /*#__PURE__*/_jsx(BannerWebViewBar, {
|
|
58
76
|
session: session,
|
|
77
|
+
pushLayoutEdge: pushLayoutEdge,
|
|
78
|
+
overlaySafeEdge: overlaySafeEdge,
|
|
59
79
|
onActions: onActions,
|
|
60
80
|
onDismiss: dismissWebViewBanner
|
|
61
81
|
});
|
|
62
82
|
}
|
|
63
83
|
return /*#__PURE__*/_jsx(BannerBar, {
|
|
64
84
|
session: session,
|
|
85
|
+
pushLayoutEdge: pushLayoutEdge,
|
|
86
|
+
overlaySafeEdge: overlaySafeEdge,
|
|
65
87
|
onActions: onActions,
|
|
66
88
|
onDismiss: onDismiss
|
|
67
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","evalJsController","getEvalJsWebView","BannerBar","BannerWebViewBar","clearBannerAutoRunEvalSession","bannerNeedsWebView","jsx","_jsx","warnedMissingWebView","BannerSurface","session","onActions","onDismiss","banner","version","
|
|
1
|
+
{"version":3,"names":["React","evalJsController","getEvalJsWebView","BannerBar","BannerWebViewBar","clearBannerAutoRunEvalSession","bannerNeedsWebView","jsx","_jsx","warnedMissingWebView","BannerSurface","session","pushLayoutEdge","overlaySafeEdge","onActions","onDismiss","banner","version","needsWebView","webView","useEffect","__DEV__","console","log","flowId","flow","id","flowName","name","bannerSessionId","versionId","embedMode","overlay","hostAsOverlay","useLayoutEffect","setBannerOwnsWebView","dismissWebViewBanner","useCallback","endReason","reset","warn","resetBannerSurfaceWarningsForTests"],"sourceRoot":"../../../src","sources":["surfaces/BannerSurface.tsx"],"mappings":";;AAKA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,gBAAgB,QAAQ,+BAA4B;AAC7D,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,gBAAgB,QAAQ,qCAAkC;AACnE,SAASC,6BAA6B,QAAQ,yCAAs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MACrBC,SAAS,EAAEqB;IAAqB,CACjC,CAAC;EAEN;EACA,oBACE5B,IAAA,CAACL,SAAS;IACRQ,OAAO,EAAEA,OAAQ;IACjBC,cAAc,EAAEA,cAAe;IAC/BC,eAAe,EAAEA,eAAgB;IACjCC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN;;AAEA;AACA,OAAO,SAAS0B,kCAAkCA,CAAA,EAAS;EACzDhC,oBAAoB,GAAG,KAAK;AAC9B","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { resolveContentFontFamily } from "../content/resolveContentFontFamily.js";
|
|
5
6
|
import { foregroundAlpha } from "../content/themeColor.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const PROGRESS_BAR_NUMBERED = 'NUMBERED';
|
|
@@ -47,7 +48,7 @@ export function ProgressBar({
|
|
|
47
48
|
testID: "userflow-progress-numbered",
|
|
48
49
|
style: [styles.numberedLabel, {
|
|
49
50
|
color: foregroundAlpha(theme.fontColor, 0.55),
|
|
50
|
-
fontFamily: theme
|
|
51
|
+
fontFamily: resolveContentFontFamily(theme),
|
|
51
52
|
fontSize: Math.max(12, Math.round(theme.fontSize * 0.875))
|
|
52
53
|
}],
|
|
53
54
|
children: label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","Text","View","foregroundAlpha","jsx","_jsx","PROGRESS_BAR_NUMBERED","progressBarType","theme","String","toUpperCase","numberedStepLabel","fraction","totalSteps","maxSteps","Math","max","selected","min","floor","ProgressBar","enabled","position","contentPadding","clamped","type","testId","label","testID","style","styles","numberedTrack","top","bottomNumbered","paddingHorizontal","alignItems","numberedCentered","accessibilityRole","accessibilityLabel","pointerEvents","children","numberedLabel","color","fontColor","fontFamily","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","View","resolveContentFontFamily","foregroundAlpha","jsx","_jsx","PROGRESS_BAR_NUMBERED","progressBarType","theme","String","toUpperCase","numberedStepLabel","fraction","totalSteps","maxSteps","Math","max","selected","min","floor","ProgressBar","enabled","position","contentPadding","clamped","type","testId","label","testID","style","styles","numberedTrack","top","bottomNumbered","paddingHorizontal","alignItems","numberedCentered","accessibilityRole","accessibilityLabel","pointerEvents","children","numberedLabel","color","fontColor","fontFamily","fontSize","round","track","bottom","accessibilityValue","now","fill","width","backgroundColor","defaultButtonBackgroundColor","create","left","right","height","overflow","zIndex","fontWeight"],"sourceRoot":"../../../src","sources":["surfaces/ProgressBar.tsx"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SAASC,wBAAwB,QAAQ,wCAAqC;AAC9E,SAASC,eAAe,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIxD,MAAMC,qBAAqB,GAAG,UAAU;AAaxC,SAASC,eAAeA,CAACC,KAAoB,EAAU;EACrD,OAAOC,MAAM,CAACD,KAAK,CAACD,eAAe,IAAI,SAAS,CAAC,CAACG,WAAW,CAAC,CAAC;AACjE;AAEA,SAASC,iBAAiBA,CAACC,QAAgB,EAAEC,UAAkB,EAAU;EACvE,MAAMC,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,UAAU,CAAC;EACxC,IAAIC,QAAQ,KAAK,CAAC,EAAE,OAAO,EAAE;EAC7B,MAAMG,QAAQ,GAAGF,IAAI,CAACG,GAAG,CAACH,IAAI,CAACI,KAAK,CAACP,QAAQ,GAAGE,QAAQ,CAAC,EAAEA,QAAQ,CAAC;EACpE,OAAO,GAAGG,QAAQ,OAAOH,QAAQ,EAAE;AACrC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASM,WAAWA,CAAC;EAC1BC,OAAO;EACPT,QA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EACDH,GAAG,EAAE;IACHA,GAAG,EAAE;EACP,CAAC;EACDgB,MAAM,EAAE;IACNA,MAAM,EAAE;EACV,CAAC;EACDf,cAAc,EAAE;IACde,MAAM,EAAE;EACV,CAAC;EACDG,IAAI,EAAE;IACJO,MAAM,EAAE;EACV,CAAC;EACDjB,aAAa,EAAE;IACboB,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { decodeMobileAutoData } from '@userflow-tech/protocol';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { ActivityIndicator, Dimensions, Keyboard, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
5
6
|
import { anchorRegistry } from "../anchors/AnchorRegistry.js";
|
|
6
7
|
import { autoAnchorRegistry } from "../anchors/AutoAnchorRegistry.js";
|
|
7
8
|
import { addAnimationFrameCallback, removeAnimationFrameCallback } from "../anchors/animationFrame.js";
|
|
9
|
+
import { isAppActive, subscribeAppActive } from "../anchors/appActive.js";
|
|
8
10
|
import { fiberScanRoot } from "../anchors/fiber/FiberScanRoot.js";
|
|
9
11
|
import { clipToScrollViewports } from "../anchors/fiber/visibleRect.js";
|
|
10
|
-
import { clearFiberAnchorCache, invalidateFiberAnchor, resolveAnchorHost } from "../anchors/resolveAnchorHost.js";
|
|
12
|
+
import { clearFiberAnchorCache, invalidateFiberAnchor, resolveAnchorHost, subscribeAnchorScreenChange } from "../anchors/resolveAnchorHost.js";
|
|
11
13
|
import { resolveAutoAnchorHost } from "../anchors/resolveAutoAnchorHost.js";
|
|
12
14
|
import { resolveManualAnchorId } from "../anchors/resolveManualAnchorId.js";
|
|
13
15
|
import { scrollAnchorIntoView } from "../anchors/scrollAnchorIntoView.js";
|
|
14
16
|
import { getScrollPadding } from "../anchors/scrollConfig.js";
|
|
15
17
|
import { targetPressMonitor } from "../anchors/targetPressMonitor.js";
|
|
16
18
|
import { RichContentRenderer } from "../content/RichContentRenderer.js";
|
|
19
|
+
import { resolveContentFontFamily } from "../content/resolveContentFontFamily.js";
|
|
17
20
|
import { CardFade } from "./CardFade.js";
|
|
18
21
|
import { CloseButton } from "./CloseButton.js";
|
|
19
22
|
import { MADE_WITH_USERFLOW_GAP, MadeWithUserflow } from "./MadeWithUserflow.js";
|
|
20
23
|
import { ProgressBar } from "./ProgressBar.js";
|
|
21
24
|
import { ABSOLUTE_FILL } from "./absoluteFill.js";
|
|
22
25
|
import { useCardTransitionPhase } from "./cardTransition.js";
|
|
26
|
+
import { stepTrapsHostAccessibility } from "./hostAccessibilityTrap.js";
|
|
23
27
|
import { parseBackdropOpacity } from "./parseBackdropOpacity.js";
|
|
24
28
|
import { resolveStepProgress } from "./progress.js";
|
|
25
29
|
import { resolveCloseButtonColor } from "./resolveCloseButtonColor.js";
|
|
@@ -37,11 +41,8 @@ import { parseBackdropPadding } from "./tooltip/parseBackdropPadding.js";
|
|
|
37
41
|
import { warnTooltipPlacementUnanchored, warnTooltipSidePlacementDropped } from "./tooltip/placementDiagnostics.js";
|
|
38
42
|
import { buildEffectiveViewport, expandRect, isRectFullyVisible, rectsEqual } from "./tooltip/rect.js";
|
|
39
43
|
import { resolveTooltipSideCardWidth, tooltipMinCardHeight, tooltipMinSideCardWidth, tooltipSideGap, tooltipVerticalGap } from "./tooltip/resolveSideCardWidth.js";
|
|
44
|
+
import { TargetSearchSchedule } from "./tooltip/targetSearchSchedule.js";
|
|
40
45
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
41
|
-
/** Interval for re-resolving a missing / remounted anchor (not for live measure). */
|
|
42
|
-
const RESOLVE_MS = 250;
|
|
43
|
-
/** Slower resolve poll after FLAG/ERROR report so a late-mounting target can recover. */
|
|
44
|
-
const RESOLVE_SLOW_MS = 1000;
|
|
45
46
|
/**
|
|
46
47
|
* One-frame delay before the first resolve after a step/reset so dialog
|
|
47
48
|
* teardown cannot arm the missing-target timer with a 0-size measure.
|
|
@@ -97,6 +98,7 @@ export function TooltipSurface({
|
|
|
97
98
|
}) {
|
|
98
99
|
const version = session.version;
|
|
99
100
|
const chrome = resolveBubbleChrome(theme, 'tooltip');
|
|
101
|
+
const contentFontFamily = resolveContentFontFamily(theme);
|
|
100
102
|
const progress = resolveStepProgress(version, currentStep.id);
|
|
101
103
|
const showClose = !version.closeDisabled;
|
|
102
104
|
const backdropOpacity = parseBackdropOpacity(theme.backdropOpacity);
|
|
@@ -104,6 +106,8 @@ export function TooltipSurface({
|
|
|
104
106
|
const selector = currentStep.selector;
|
|
105
107
|
const isAuto = selector?.type === 'AUTO';
|
|
106
108
|
const autoData = selector?.autoData ?? null;
|
|
109
|
+
// Decoded once per step rather than on every search.
|
|
110
|
+
const decodedAutoData = React.useMemo(() => isAuto ? decodeMobileAutoData(autoData) : null, [isAuto, autoData]);
|
|
107
111
|
const anchorId = isAuto ? null : resolveManualAnchorId(selector?.css);
|
|
108
112
|
const targetKey = isAuto ? `auto:${autoData ?? ''}` : anchorId ?? '';
|
|
109
113
|
const highlight = currentStep.backdrop ? resolveHighlightChrome(theme, backdropPadding) : null;
|
|
@@ -133,7 +137,6 @@ export function TooltipSurface({
|
|
|
133
137
|
});
|
|
134
138
|
const [placement, setPlacement] = React.useState(desiredPlacement ?? 'BELOW');
|
|
135
139
|
const [missingMode, setMissingMode] = React.useState('waiting');
|
|
136
|
-
const [registryTick, setRegistryTick] = React.useState(0);
|
|
137
140
|
/** True after at least one *failed* measure for the current step/anchor. */
|
|
138
141
|
const [measureAttempted, setMeasureAttempted] = React.useState(false);
|
|
139
142
|
/**
|
|
@@ -208,17 +211,6 @@ export function TooltipSurface({
|
|
|
208
211
|
mountedRef.current = false;
|
|
209
212
|
};
|
|
210
213
|
}, []);
|
|
211
|
-
React.useEffect(() => {
|
|
212
|
-
const bump = () => setRegistryTick(n => n + 1);
|
|
213
|
-
const unsubRegistry = anchorRegistry.subscribe(bump);
|
|
214
|
-
const unsubAuto = autoAnchorRegistry.subscribe(bump);
|
|
215
|
-
const unsubScan = fiberScanRoot.subscribe(bump);
|
|
216
|
-
return () => {
|
|
217
|
-
unsubRegistry();
|
|
218
|
-
unsubAuto();
|
|
219
|
-
unsubScan();
|
|
220
|
-
};
|
|
221
|
-
}, []);
|
|
222
214
|
React.useEffect(() => {
|
|
223
215
|
reportedRef.current = false;
|
|
224
216
|
scrollAttemptsRef.current = 0;
|
|
@@ -355,12 +347,12 @@ export function TooltipSurface({
|
|
|
355
347
|
}, [effectiveViewport]);
|
|
356
348
|
|
|
357
349
|
/**
|
|
358
|
-
* Resolve the anchor host (registry / fiber scan).
|
|
359
|
-
*
|
|
350
|
+
* Resolve the anchor host (registry / fiber scan). Driven by
|
|
351
|
+
* {@link TargetSearchSchedule} — intentionally NOT on every animation frame.
|
|
360
352
|
*/
|
|
361
353
|
const resolveTarget = React.useCallback(() => {
|
|
362
354
|
if (!mountedRef.current) return;
|
|
363
|
-
const resolution = isAuto ? resolveAutoAnchorHost(
|
|
355
|
+
const resolution = isAuto ? resolveAutoAnchorHost(decodedAutoData) : anchorId ? resolveAnchorHost(anchorId) : null;
|
|
364
356
|
if (!resolution || resolution.status !== 'found') {
|
|
365
357
|
dropHost();
|
|
366
358
|
return;
|
|
@@ -397,7 +389,7 @@ export function TooltipSurface({
|
|
|
397
389
|
maybeScrollIntoView(rect);
|
|
398
390
|
applyTarget(rect);
|
|
399
391
|
});
|
|
400
|
-
}, [anchorId, applyTarget,
|
|
392
|
+
}, [anchorId, applyTarget, decodedAutoData, dropHost, isAuto, maybeScrollIntoView]);
|
|
401
393
|
|
|
402
394
|
/**
|
|
403
395
|
* Live re-measure of an already-resolved host. Driven by the shared rAF hub
|
|
@@ -433,42 +425,50 @@ export function TooltipSurface({
|
|
|
433
425
|
applyTarget(rect);
|
|
434
426
|
});
|
|
435
427
|
}, [applyTarget, dropHost, maybeScrollIntoView]);
|
|
436
|
-
React.
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
428
|
+
const resolveTargetRef = React.useRef(resolveTarget);
|
|
429
|
+
resolveTargetRef.current = resolveTarget;
|
|
430
|
+
const searchRef = React.useRef(null);
|
|
431
|
+
const searchAllowsRecovery = behavior === 'FLAG' || behavior === 'ERROR' || behavior === 'END' && session.draftMode;
|
|
432
|
+
const searchStopped = missingMode === 'reported' && !searchAllowsRecovery;
|
|
440
433
|
|
|
441
|
-
//
|
|
434
|
+
// Target search: steady poll while anchored, backoff while missing, nothing
|
|
435
|
+
// while the app is in the background. Live measurement is on rAF. A new step
|
|
436
|
+
// or target restarts it right away; a same-step restart (`resetNonce`) goes
|
|
437
|
+
// through `resolveArmed`, after the first-resolve delay.
|
|
442
438
|
React.useEffect(() => {
|
|
443
|
-
if (!resolveArmed) {
|
|
439
|
+
if (!resolveArmed || searchStopped) {
|
|
444
440
|
return;
|
|
445
441
|
}
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
const dimSub = Dimensions.addEventListener('change', resolveTarget);
|
|
442
|
+
const search = new TargetSearchSchedule(() => resolveTargetRef.current());
|
|
443
|
+
searchRef.current = search;
|
|
444
|
+
search.setMode(targetRef.current ? 'anchored' : 'missing');
|
|
445
|
+
const trigger = () => search.trigger();
|
|
446
|
+
const unsubscribers = [anchorRegistry.subscribe(trigger), autoAnchorRegistry.subscribe(trigger), fiberScanRoot.subscribe(trigger), subscribeAnchorScreenChange(() => search.rearm()), subscribeAppActive(active => active ? search.resume() : search.pause())];
|
|
447
|
+
if (!isAppActive()) search.pause();
|
|
448
|
+
search.runNow();
|
|
449
|
+
const dimSub = Dimensions.addEventListener('change', () => search.runNow());
|
|
455
450
|
const onKeyboardShow = event => {
|
|
456
451
|
setKeyboardBottomInset(Math.max(0, event.endCoordinates?.height ?? 0));
|
|
457
|
-
|
|
452
|
+
search.runNow();
|
|
458
453
|
};
|
|
459
454
|
const onKeyboardHide = () => {
|
|
460
455
|
setKeyboardBottomInset(0);
|
|
461
|
-
|
|
456
|
+
search.runNow();
|
|
462
457
|
};
|
|
463
458
|
const kbShow = Keyboard.addListener('keyboardDidShow', onKeyboardShow);
|
|
464
459
|
const kbHide = Keyboard.addListener('keyboardDidHide', onKeyboardHide);
|
|
465
460
|
return () => {
|
|
466
|
-
|
|
461
|
+
for (const unsubscribe of unsubscribers) unsubscribe();
|
|
467
462
|
dimSub.remove();
|
|
468
463
|
kbShow.remove();
|
|
469
464
|
kbHide.remove();
|
|
465
|
+
search.dispose();
|
|
466
|
+
if (searchRef.current === search) searchRef.current = null;
|
|
470
467
|
};
|
|
471
|
-
}, [
|
|
468
|
+
}, [resolveArmed, searchStopped, currentStep.id, targetKey]);
|
|
469
|
+
React.useEffect(() => {
|
|
470
|
+
searchRef.current?.setMode(target ? 'anchored' : 'missing');
|
|
471
|
+
}, [target]);
|
|
472
472
|
|
|
473
473
|
// rAF tracking while a host is resolved (and we are not paused after report).
|
|
474
474
|
React.useEffect(() => {
|
|
@@ -727,6 +727,9 @@ export function TooltipSurface({
|
|
|
727
727
|
}
|
|
728
728
|
const showBranding = session.flow.company.flowBranding;
|
|
729
729
|
const contentPadding = chrome.contentPadding;
|
|
730
|
+
// Modal only while the host is trapped too. Otherwise VoiceOver would skip
|
|
731
|
+
// the host app, including the target this step asks the user to press.
|
|
732
|
+
const cardIsModal = stepTrapsHostAccessibility(currentStep);
|
|
730
733
|
|
|
731
734
|
// Still pending the first measure attempt — only the blocker shows.
|
|
732
735
|
if (isMissing && missingMode === 'waiting' && !measureAttempted) {
|
|
@@ -742,7 +745,7 @@ export function TooltipSurface({
|
|
|
742
745
|
pointerEvents: "box-none",
|
|
743
746
|
children: /*#__PURE__*/_jsx(CardFade, {
|
|
744
747
|
testID: "userflow-tooltip-waiting",
|
|
745
|
-
accessibilityViewIsModal:
|
|
748
|
+
accessibilityViewIsModal: cardIsModal,
|
|
746
749
|
pointerEvents: "auto",
|
|
747
750
|
style: [chrome.shadowStyle, styles.waitingCard, cardLayoutStyle, {
|
|
748
751
|
borderRadius: chrome.borderRadius,
|
|
@@ -766,6 +769,7 @@ export function TooltipSurface({
|
|
|
766
769
|
}), /*#__PURE__*/_jsx(Text, {
|
|
767
770
|
style: {
|
|
768
771
|
color: theme.fontColor,
|
|
772
|
+
fontFamily: contentFontFamily,
|
|
769
773
|
fontSize: theme.fontSize,
|
|
770
774
|
marginTop: 12,
|
|
771
775
|
textAlign: 'center'
|
|
@@ -807,12 +811,14 @@ export function TooltipSurface({
|
|
|
807
811
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
808
812
|
style: [styles.missingTitle, {
|
|
809
813
|
color: theme.fontColor,
|
|
814
|
+
fontFamily: contentFontFamily,
|
|
810
815
|
fontSize: theme.fontSize
|
|
811
816
|
}],
|
|
812
817
|
children: "Target not found"
|
|
813
818
|
}), /*#__PURE__*/_jsx(Text, {
|
|
814
819
|
style: {
|
|
815
820
|
color: theme.fontColor,
|
|
821
|
+
fontFamily: contentFontFamily,
|
|
816
822
|
fontSize: theme.fontSize,
|
|
817
823
|
opacity: 0.8
|
|
818
824
|
},
|
|
@@ -848,7 +854,7 @@ export function TooltipSurface({
|
|
|
848
854
|
pointerEvents: "box-none",
|
|
849
855
|
children: /*#__PURE__*/_jsx(CardFade, {
|
|
850
856
|
testID: "userflow-tooltip-card",
|
|
851
|
-
accessibilityViewIsModal:
|
|
857
|
+
accessibilityViewIsModal: cardIsModal,
|
|
852
858
|
pointerEvents: "auto",
|
|
853
859
|
onLayout: onCardLayout,
|
|
854
860
|
style: [chrome.shadowStyle, styles.fallbackCard, cardLayoutStyle, {
|
|
@@ -882,6 +888,7 @@ export function TooltipSurface({
|
|
|
882
888
|
onLayout: onCardLayout,
|
|
883
889
|
maxHeight: layout.maxCardHeight,
|
|
884
890
|
showNotch: layout.showNotch,
|
|
891
|
+
accessibilityViewIsModal: cardIsModal,
|
|
885
892
|
style: {
|
|
886
893
|
position: 'absolute',
|
|
887
894
|
left: layout.cardPosition.x,
|