@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
|
@@ -190,18 +190,21 @@ function intrinsicNonTextAgrees(fp: MobileFingerprint, inst: AutoAnchorInstance)
|
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
/**
|
|
194
|
+
* An id or kind conflict, or a childText disagreement no text-independent
|
|
195
|
+
* identity (authoritative id, matching icon/image) vouches for.
|
|
196
|
+
*/
|
|
197
|
+
function isContradicted(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
|
|
198
|
+
if (contradictsStrong(fp, inst)) return true;
|
|
199
|
+
return childTextDisagrees(fp, inst) && !idAgrees(fp, inst) && !intrinsicNonTextAgrees(fp, inst);
|
|
200
|
+
}
|
|
201
|
+
|
|
193
202
|
function scoreInstance(
|
|
194
203
|
fp: MobileFingerprint,
|
|
195
204
|
inst: AutoAnchorInstance,
|
|
196
205
|
ambiguous: boolean,
|
|
197
206
|
): number {
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
// A childText disagreement is disqualifying unless a text-independent identity
|
|
201
|
-
// vouches for the element (authoritative id, or matching icon/image).
|
|
202
|
-
if (childTextDisagrees(fp, inst) && !idAgrees(fp, inst) && !intrinsicNonTextAgrees(fp, inst)) {
|
|
203
|
-
return -Infinity;
|
|
204
|
-
}
|
|
207
|
+
if (isContradicted(fp, inst)) return -Infinity;
|
|
205
208
|
|
|
206
209
|
let score = 0;
|
|
207
210
|
|
|
@@ -231,11 +234,14 @@ function scoreInstance(
|
|
|
231
234
|
|
|
232
235
|
score += scoreAncestors(fp.ancestors ?? [], inst.ancestors ?? []);
|
|
233
236
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
// The window scans the registry, so skip it when there is nothing to compare.
|
|
238
|
+
if (fp.previousSiblings?.length || fp.nextSiblings?.length) {
|
|
239
|
+
const window = autoAnchorRegistry.siblingWindow(inst.instanceId, 2);
|
|
240
|
+
score += scoreSiblingWindow(fp.previousSiblings ?? [], window.previous);
|
|
241
|
+
// Score next siblings once. The POC added a reversed pass *and* a direct pass,
|
|
242
|
+
// which double-counted the next window.
|
|
243
|
+
score += scoreSiblingWindow(fp.nextSiblings ?? [], window.next);
|
|
244
|
+
}
|
|
239
245
|
|
|
240
246
|
if (ambiguous && !inst.manualId) score -= 40;
|
|
241
247
|
|
|
@@ -246,6 +252,8 @@ type InstanceFilter = (inst: AutoAnchorInstance) => boolean;
|
|
|
246
252
|
|
|
247
253
|
interface MatchOptions {
|
|
248
254
|
instanceFilter?: InstanceFilter;
|
|
255
|
+
/** The caller refreshed live content earlier in this same synchronous call. */
|
|
256
|
+
liveContentFresh?: boolean;
|
|
249
257
|
}
|
|
250
258
|
|
|
251
259
|
/** Each instance's visibility is computed once per match. */
|
|
@@ -260,10 +268,7 @@ function memoizeFilter(filter: InstanceFilter): InstanceFilter {
|
|
|
260
268
|
};
|
|
261
269
|
}
|
|
262
270
|
|
|
263
|
-
function candidatePool(
|
|
264
|
-
fp: MobileFingerprint,
|
|
265
|
-
instanceFilter?: InstanceFilter,
|
|
266
|
-
): AutoAnchorInstance[] {
|
|
271
|
+
function candidatePool(fp: MobileFingerprint): AutoAnchorInstance[] {
|
|
267
272
|
// Explicit ids are authoritative: a miss is no-candidates, not a full-registry search.
|
|
268
273
|
let pool: AutoAnchorInstance[];
|
|
269
274
|
if (fp.manualId) {
|
|
@@ -286,29 +291,45 @@ function candidatePool(
|
|
|
286
291
|
if (filtered.length > 0) pool = filtered;
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
|
-
return
|
|
294
|
+
return pool;
|
|
290
295
|
}
|
|
291
296
|
|
|
292
297
|
function miss(reason: MatchMissReason, score = 0, secondScore = 0): MatchResult {
|
|
293
298
|
return { instance: null, score, secondScore, reason };
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
function matchFingerprintCore(
|
|
301
|
+
function matchFingerprintCore(
|
|
302
|
+
fp: MobileFingerprint,
|
|
303
|
+
instanceFilter?: InstanceFilter,
|
|
304
|
+
liveContentFresh = false,
|
|
305
|
+
): MatchResult {
|
|
297
306
|
// Live text / testID must be applied *before* pooling. A shared Babel helper
|
|
298
307
|
// (`const field = () => <TextInput testID={id} />`) reuses one auto-anchor
|
|
299
308
|
// callback, so the runtime bag is last-writer-wins until we read the host.
|
|
309
|
+
// An unchanged host is a fiber and props-identity check after one shared
|
|
310
|
+
// ancestor walk per pass, so refreshing every instance stays cheap; the
|
|
311
|
+
// per-instance screen walk is what is not, and it only runs for the pool
|
|
312
|
+
// below.
|
|
313
|
+
const all = autoAnchorRegistry.allInstances();
|
|
314
|
+
if (all.length > 0 && !liveContentFresh) {
|
|
315
|
+
autoAnchorRegistry.refreshLiveContent(all);
|
|
316
|
+
}
|
|
317
|
+
|
|
300
318
|
// A filter's verdict is memoized so covered-screen checks run once per instance.
|
|
301
319
|
const filter = instanceFilter ? memoizeFilter(instanceFilter) : undefined;
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
320
|
+
const candidates = candidatePool(fp);
|
|
321
|
+
// A contradiction does not depend on visibility, so settle it before the
|
|
322
|
+
// covered-screen check. Visibility of contradicted instances only matters to
|
|
323
|
+
// tell `all-contradicted` from `no-candidates` when nothing else is left.
|
|
324
|
+
const viable: AutoAnchorInstance[] = [];
|
|
325
|
+
const contradicted: AutoAnchorInstance[] = [];
|
|
326
|
+
for (const inst of candidates) {
|
|
327
|
+
(isContradicted(fp, inst) ? contradicted : viable).push(inst);
|
|
307
328
|
}
|
|
308
|
-
|
|
309
|
-
const pool = candidatePool(fp, filter);
|
|
329
|
+
const pool = filter ? viable.filter(filter) : viable;
|
|
310
330
|
if (pool.length === 0) {
|
|
311
|
-
|
|
331
|
+
const anyContradictedCandidate = filter ? contradicted.some(filter) : contradicted.length > 0;
|
|
332
|
+
return miss(anyContradictedCandidate ? 'all-contradicted' : 'no-candidates');
|
|
312
333
|
}
|
|
313
334
|
|
|
314
335
|
// Visibility can clear a registry-wide ambiguous flag (a covered twin) but
|
|
@@ -367,7 +388,7 @@ function matchFingerprintCore(fp: MobileFingerprint, instanceFilter?: InstanceFi
|
|
|
367
388
|
* can flag weak (`structural`) targets.
|
|
368
389
|
*/
|
|
369
390
|
export function matchFingerprint(fp: MobileFingerprint, opts?: MatchOptions): MatchResult {
|
|
370
|
-
const result = matchFingerprintCore(fp, opts?.instanceFilter);
|
|
391
|
+
const result = matchFingerprintCore(fp, opts?.instanceFilter, opts?.liveContentFresh);
|
|
371
392
|
if (fp.identityStrength) result.identityStrength = fp.identityStrength;
|
|
372
393
|
return result;
|
|
373
394
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Max finger travel (px) between start and end to count as a tap, not a scroll. */
|
|
2
|
+
export const TARGET_PRESS_TAP_SLOP = 10;
|
|
3
|
+
|
|
4
|
+
export interface TouchPoint {
|
|
5
|
+
pageX: number;
|
|
6
|
+
pageY: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** True when the finger moved no more than `slop` between start and end. */
|
|
10
|
+
export function withinTapSlop(
|
|
11
|
+
start: TouchPoint,
|
|
12
|
+
end: TouchPoint,
|
|
13
|
+
slop: number = TARGET_PRESS_TAP_SLOP,
|
|
14
|
+
): boolean {
|
|
15
|
+
const dx = end.pageX - start.pageX;
|
|
16
|
+
const dy = end.pageY - start.pageY;
|
|
17
|
+
return dx * dx + dy * dy <= slop * slop;
|
|
18
|
+
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { gestureHandlerHandoff } from './gestureHandlerHandoff';
|
|
2
|
+
import { TARGET_PRESS_TAP_SLOP, type TouchPoint, withinTapSlop } from './tapSlop';
|
|
3
|
+
|
|
4
|
+
export { TARGET_PRESS_TAP_SLOP, type TouchPoint, withinTapSlop };
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Active tooltip target-press subscription.
|
|
3
8
|
*
|
|
@@ -19,29 +24,10 @@ export interface TargetPressSubscription {
|
|
|
19
24
|
onPress: () => void;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
/** Max finger travel (px) between start and end to count as a tap, not a scroll. */
|
|
23
|
-
export const TARGET_PRESS_TAP_SLOP = 10;
|
|
24
|
-
|
|
25
27
|
export function pointInRect(x: number, y: number, rect: TargetPressRect): boolean {
|
|
26
28
|
return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
export interface TouchPoint {
|
|
30
|
-
pageX: number;
|
|
31
|
-
pageY: number;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** True when the finger moved no more than `slop` between start and end. */
|
|
35
|
-
export function withinTapSlop(
|
|
36
|
-
start: TouchPoint,
|
|
37
|
-
end: TouchPoint,
|
|
38
|
-
slop: number = TARGET_PRESS_TAP_SLOP,
|
|
39
|
-
): boolean {
|
|
40
|
-
const dx = end.pageX - start.pageX;
|
|
41
|
-
const dy = end.pageY - start.pageY;
|
|
42
|
-
return dx * dx + dy * dy <= slop * slop;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
31
|
/**
|
|
46
32
|
* True when start and end both land in `rect` and movement stays within tap
|
|
47
33
|
* slop — mirrors a DOM click on the target without claiming the responder.
|
|
@@ -70,14 +56,25 @@ export type TouchIdentifier = number | string;
|
|
|
70
56
|
export class TargetPressMonitor {
|
|
71
57
|
private subscription: TargetPressSubscription | null = null;
|
|
72
58
|
private touchStarts = new Map<TouchIdentifier, TouchPoint>();
|
|
59
|
+
private handoffStops = new Map<TouchIdentifier, () => void>();
|
|
73
60
|
|
|
74
61
|
set(subscription: TargetPressSubscription | null): void {
|
|
75
62
|
this.subscription = subscription;
|
|
76
63
|
if (!subscription) {
|
|
77
64
|
this.touchStarts.clear();
|
|
65
|
+
this.dropHandoffs();
|
|
78
66
|
}
|
|
79
67
|
}
|
|
80
68
|
|
|
69
|
+
/** Fingers with a recorded start that have not ended, cancelled, or been handed off. */
|
|
70
|
+
inProgressIdentifiers(): TouchIdentifier[] {
|
|
71
|
+
return [...this.touchStarts.keys()];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
hasTouch(identifier: TouchIdentifier): boolean {
|
|
75
|
+
return this.touchStarts.has(identifier);
|
|
76
|
+
}
|
|
77
|
+
|
|
81
78
|
clear(): void {
|
|
82
79
|
this.set(null);
|
|
83
80
|
}
|
|
@@ -113,6 +110,38 @@ export class TargetPressMonitor {
|
|
|
113
110
|
}
|
|
114
111
|
}
|
|
115
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Gesture-handler cancelled this finger. Press if that handler later ends as
|
|
115
|
+
* a tap and the start (and the end, when the payload has one) is inside the
|
|
116
|
+
* current target rect.
|
|
117
|
+
*/
|
|
118
|
+
handOffTouch(identifier: TouchIdentifier, handlerTags: readonly number[]): void {
|
|
119
|
+
const start = this.touchStarts.get(identifier);
|
|
120
|
+
if (!start) return;
|
|
121
|
+
this.touchStarts.delete(identifier);
|
|
122
|
+
this.handoffStops.get(identifier)?.();
|
|
123
|
+
if (!this.subscription || handlerTags.length === 0) return;
|
|
124
|
+
const stop = gestureHandlerHandoff.track({
|
|
125
|
+
identifier,
|
|
126
|
+
pageX: start.pageX,
|
|
127
|
+
pageY: start.pageY,
|
|
128
|
+
handlerTags,
|
|
129
|
+
onResolve: (end) => {
|
|
130
|
+
const sub = this.subscription;
|
|
131
|
+
if (!sub) return;
|
|
132
|
+
const rect = sub.getRect();
|
|
133
|
+
if (!rect || rect.width <= 0 || rect.height <= 0) return;
|
|
134
|
+
if (!pointInRect(start.pageX, start.pageY, rect)) return;
|
|
135
|
+
if (end && !pointInRect(end.pageX, end.pageY, rect)) return;
|
|
136
|
+
sub.onPress();
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
this.handoffStops.set(identifier, () => {
|
|
140
|
+
stop();
|
|
141
|
+
this.handoffStops.delete(identifier);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
116
145
|
/**
|
|
117
146
|
* Drop in-progress gesture(s). With `identifier`, cancels that finger only;
|
|
118
147
|
* otherwise clears all (e.g. blanket `onTouchCancel`).
|
|
@@ -120,15 +149,23 @@ export class TargetPressMonitor {
|
|
|
120
149
|
cancelTouch(identifier?: TouchIdentifier): void {
|
|
121
150
|
if (identifier == null) {
|
|
122
151
|
this.touchStarts.clear();
|
|
152
|
+
this.dropHandoffs();
|
|
123
153
|
return;
|
|
124
154
|
}
|
|
125
155
|
this.touchStarts.delete(identifier);
|
|
156
|
+
this.handoffStops.get(identifier)?.();
|
|
126
157
|
}
|
|
127
158
|
|
|
128
159
|
/** Test helper. */
|
|
129
160
|
resetForTests(): void {
|
|
130
161
|
this.subscription = null;
|
|
131
162
|
this.touchStarts.clear();
|
|
163
|
+
this.dropHandoffs();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private dropHandoffs(): void {
|
|
167
|
+
for (const stop of this.handoffStops.values()) stop();
|
|
168
|
+
this.handoffStops.clear();
|
|
132
169
|
}
|
|
133
170
|
}
|
|
134
171
|
|
|
@@ -16,7 +16,7 @@ import { fibersMatch, resolveFiberPath } from '../anchors/fiber/resolveFiberPath
|
|
|
16
16
|
import { createVisibleInstanceFilter } from '../anchors/isInstanceOnVisibleScreen';
|
|
17
17
|
import * as semanticMatcher from '../anchors/semanticMatcher';
|
|
18
18
|
import type { MatchMissReason } from '../anchors/semanticMatcher';
|
|
19
|
-
import { getCurrentScreenLocation } from '../screenTracker';
|
|
19
|
+
import { getCurrentScreenLocation, screenIdFromLocation } from '../screenTracker';
|
|
20
20
|
|
|
21
21
|
import type { PickTarget } from './hitTest';
|
|
22
22
|
|
|
@@ -35,10 +35,9 @@ function deriveIdentityStrength(inst: AutoAnchorInstance): IdentityStrength {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function screenFromLocation(): { screenId: string; screenName?: string } {
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
return { screenId: location.screen, screenName: location.screen };
|
|
38
|
+
const screenId = screenIdFromLocation(getCurrentScreenLocation());
|
|
39
|
+
if (screenId === 'unknown') return { screenId };
|
|
40
|
+
return { screenId, screenName: screenId };
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
function deviceMetadata(): DeviceMetadata | undefined {
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '../surfaces/resolveBannerTheme';
|
|
15
15
|
|
|
16
16
|
import { resolveBannerButtonChrome } from './resolveBannerButtonChrome';
|
|
17
|
+
import { resolveContentFontFamily } from './resolveContentFontFamily';
|
|
17
18
|
import { stepButtonContainerStyle } from './resolveStepButtonChrome';
|
|
18
19
|
|
|
19
20
|
export interface BannerStepButtonProps {
|
|
@@ -57,7 +58,7 @@ export function BannerStepButton({
|
|
|
57
58
|
styles.label,
|
|
58
59
|
{
|
|
59
60
|
color: chrome.fontColor,
|
|
60
|
-
fontFamily: theme
|
|
61
|
+
fontFamily: resolveContentFontFamily(theme),
|
|
61
62
|
fontSize: chrome.fontSize,
|
|
62
63
|
fontWeight: chrome.fontWeight,
|
|
63
64
|
...labelMetrics(chrome.lineHeight),
|
|
@@ -8,6 +8,8 @@ import * as React from 'react';
|
|
|
8
8
|
import type { TextStyle, ViewStyle } from 'react-native';
|
|
9
9
|
import { Image, Platform, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
10
10
|
|
|
11
|
+
import { openFlowNavigateUrl } from '../navigation/openFlowNavigateUrl';
|
|
12
|
+
|
|
11
13
|
import { StepButton } from './StepButton';
|
|
12
14
|
import {
|
|
13
15
|
deserializeRichContentDoc,
|
|
@@ -17,7 +19,7 @@ import {
|
|
|
17
19
|
} from './deserialize';
|
|
18
20
|
import { resolveImageFrame } from './imageLayout';
|
|
19
21
|
import { migrateFlowBlocksIntoContent } from './migrateFlowBlocks';
|
|
20
|
-
import {
|
|
22
|
+
import { resolveContentFontFamily } from './resolveContentFontFamily';
|
|
21
23
|
import {
|
|
22
24
|
ROOT_CONTENT_GAP,
|
|
23
25
|
WEB_CODE_BG_ALPHA,
|
|
@@ -401,7 +403,7 @@ function RenderedLink({
|
|
|
401
403
|
accessibilityRole="link"
|
|
402
404
|
accessibilityHint={href || undefined}
|
|
403
405
|
onPress={() => {
|
|
404
|
-
void
|
|
406
|
+
void openFlowNavigateUrl(href);
|
|
405
407
|
}}
|
|
406
408
|
>
|
|
407
409
|
<InlineChildren
|
|
@@ -480,7 +482,7 @@ function RenderedImage({
|
|
|
480
482
|
accessibilityRole="link"
|
|
481
483
|
accessibilityLabel="Image link"
|
|
482
484
|
onPress={() => {
|
|
483
|
-
void
|
|
485
|
+
void openFlowNavigateUrl(href);
|
|
484
486
|
}}
|
|
485
487
|
>
|
|
486
488
|
{framed}
|
|
@@ -562,23 +564,27 @@ function RenderedButton({
|
|
|
562
564
|
}
|
|
563
565
|
|
|
564
566
|
function baseText(theme: ThemeFragment): TextStyle {
|
|
567
|
+
const fontFamily = resolveContentFontFamily(theme);
|
|
565
568
|
return {
|
|
566
569
|
color: theme.fontColor,
|
|
567
|
-
fontFamily: theme.fontFamily || undefined,
|
|
568
570
|
fontSize: theme.fontSize,
|
|
571
|
+
// Omit the key when unset. An explicit `undefined` is flattened to null,
|
|
572
|
+
// and RN treats that as "use the default face" rather than keeping a
|
|
573
|
+
// family set earlier on the same run.
|
|
574
|
+
...(fontFamily != null ? { fontFamily } : {}),
|
|
569
575
|
};
|
|
570
576
|
}
|
|
571
577
|
|
|
572
578
|
function markStyle(node: AbstractRichContentTextFormatting): TextStyle {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
const style: TextStyle = {};
|
|
580
|
+
if (node.bold) style.fontWeight = '700';
|
|
581
|
+
if (node.italic) style.fontStyle = 'italic';
|
|
582
|
+
const decoration = textDecoration(node);
|
|
583
|
+
if (decoration) style.textDecorationLine = decoration;
|
|
584
|
+
if (node.small) style.fontSize = 12;
|
|
585
|
+
else if (node.sup) style.fontSize = 10;
|
|
586
|
+
if (node.color) style.color = node.color;
|
|
587
|
+
return style;
|
|
582
588
|
}
|
|
583
589
|
|
|
584
590
|
/** View wrapper so inline code padding/radius work reliably on Android. */
|
|
@@ -9,6 +9,7 @@ import type { TextStyle } from 'react-native';
|
|
|
9
9
|
import { Platform, Pressable, StyleSheet, Text } from 'react-native';
|
|
10
10
|
|
|
11
11
|
import { isPrimaryButtonAppearance } from './buttonAppearance';
|
|
12
|
+
import { resolveContentFontFamily } from './resolveContentFontFamily';
|
|
12
13
|
import { resolveStepButtonChrome, stepButtonContainerStyle } from './resolveStepButtonChrome';
|
|
13
14
|
|
|
14
15
|
export interface StepButtonProps {
|
|
@@ -45,7 +46,7 @@ export function StepButton({
|
|
|
45
46
|
styles.label,
|
|
46
47
|
{
|
|
47
48
|
color: chrome.fontColor,
|
|
48
|
-
fontFamily: theme
|
|
49
|
+
fontFamily: resolveContentFontFamily(theme),
|
|
49
50
|
fontSize: chrome.fontSize,
|
|
50
51
|
fontWeight: chrome.fontWeight,
|
|
51
52
|
...labelMetrics(chrome.lineHeight),
|
|
@@ -15,7 +15,9 @@ export function isSafeUrl(url: string | null | undefined): boolean {
|
|
|
15
15
|
const parsed = new URL(trimmed);
|
|
16
16
|
return ALLOWED_PROTOCOLS.has(parsed.protocol);
|
|
17
17
|
} catch {
|
|
18
|
-
|
|
18
|
+
// Hermes / older runtimes can lack a full URL implementation; still allow
|
|
19
|
+
// obvious http(s) strings so NAVIGATE does not fall through to Expo Router.
|
|
20
|
+
return /^https?:\/\//i.test(trimmed);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font family for SDK content text.
|
|
3
|
+
*
|
|
4
|
+
* A single concrete theme family is kept. A comma-separated custom list keeps
|
|
5
|
+
* the first family that is not part of the default system stack. That stack,
|
|
6
|
+
* generics, and empty values use the detected app font, or omit `fontFamily`
|
|
7
|
+
* so the platform face renders with no warning.
|
|
8
|
+
*/
|
|
9
|
+
import type { ThemeFragment } from '@userflow-tech/protocol';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
concreteFontFamily,
|
|
13
|
+
detectAppFontFamily,
|
|
14
|
+
isBareCssFamily,
|
|
15
|
+
isIconFontFamily,
|
|
16
|
+
splitCssFamilies,
|
|
17
|
+
themeConcreteFontFamily,
|
|
18
|
+
} from '../anchors/fiber/detectAppFontFamily';
|
|
19
|
+
|
|
20
|
+
export type AppFontDetector = () => string | null;
|
|
21
|
+
|
|
22
|
+
const CSS_FONT_FALLBACK = 'system-ui, sans-serif';
|
|
23
|
+
|
|
24
|
+
export function resolveContentFontFamily(
|
|
25
|
+
theme: ThemeFragment,
|
|
26
|
+
detect: AppFontDetector = detectAppFontFamily,
|
|
27
|
+
): string | undefined {
|
|
28
|
+
return explicitThemeFamily(theme) ?? detectedFamily(detect);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* CSS `font-family` for banner WebViews. Names are quoted so a multi-word
|
|
33
|
+
* family stays one face. A substituted app face keeps a platform fallback for
|
|
34
|
+
* when the WebView cannot resolve it.
|
|
35
|
+
*/
|
|
36
|
+
export function contentFontFamilyCss(
|
|
37
|
+
theme: ThemeFragment,
|
|
38
|
+
detect: AppFontDetector = detectAppFontFamily,
|
|
39
|
+
): string {
|
|
40
|
+
const authored = explicitThemeCss(theme);
|
|
41
|
+
if (authored) return authored;
|
|
42
|
+
const family = detectedFamily(detect);
|
|
43
|
+
if (!family) return CSS_FONT_FALLBACK;
|
|
44
|
+
return `${quoteCssFamily(family)}, ${CSS_FONT_FALLBACK}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* `@font-face` rule that publishes the native family name inside the WebView.
|
|
49
|
+
*
|
|
50
|
+
* One regular face only. A weight range would make that static file match
|
|
51
|
+
* bold, and an italic rule with the same upright source would match italic,
|
|
52
|
+
* so the WebView would not synthesize either. `local()` is the family native
|
|
53
|
+
* text already uses. A `file://` source is not included: iOS treats that URL
|
|
54
|
+
* as a navigation and replaces the banner page.
|
|
55
|
+
*/
|
|
56
|
+
export function contentFontFaceCss(
|
|
57
|
+
theme: ThemeFragment,
|
|
58
|
+
detect: AppFontDetector = detectAppFontFamily,
|
|
59
|
+
): string {
|
|
60
|
+
const family = resolvedFamily(theme, detect);
|
|
61
|
+
if (!family) return '';
|
|
62
|
+
const quoted = quoteCssFamily(family);
|
|
63
|
+
return `@font-face{font-family:${quoted};src:local(${quoted});font-weight:400;font-style:normal;font-display:swap;}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Re-applies the banner face after theme custom.css. Equal-specificity rules
|
|
68
|
+
* in that stylesheet would otherwise replace it with a web font the WebView
|
|
69
|
+
* has not loaded. Code stays mono, including `<strong>`, `<em>`, and `<u>`
|
|
70
|
+
* wrapped inside `<code>`.
|
|
71
|
+
*/
|
|
72
|
+
export function bannerContentFontLockCss(
|
|
73
|
+
theme: ThemeFragment,
|
|
74
|
+
detect: AppFontDetector = detectAppFontFamily,
|
|
75
|
+
): string {
|
|
76
|
+
const family = contentFontFamilyCss(theme, detect);
|
|
77
|
+
return (
|
|
78
|
+
`.userflowjs-banner-root,.userflowjs-banner-root *:not(code):not(pre){font-family:${family};}` +
|
|
79
|
+
`.userflowjs-banner-root code,.userflowjs-banner-root pre,` +
|
|
80
|
+
`.userflowjs-banner-root code *,.userflowjs-banner-root pre *{font-family:ui-monospace,Menlo,monospace;}`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function resolvedFamily(theme: ThemeFragment, detect: AppFontDetector): string | undefined {
|
|
85
|
+
return explicitThemeFamily(theme) ?? detectedFamily(detect);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function explicitThemeFamily(theme: ThemeFragment): string | undefined {
|
|
89
|
+
return themeConcreteFontFamily(theme.fontFamily);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Authored theme list, quoted so a multi-word family stays one face. */
|
|
93
|
+
function explicitThemeCss(theme: ThemeFragment): string | undefined {
|
|
94
|
+
const native = explicitThemeFamily(theme);
|
|
95
|
+
if (!native) return undefined;
|
|
96
|
+
const parts = splitCssFamilies(theme.fontFamily);
|
|
97
|
+
if (parts.length <= 1) return quoteCssFamily(native);
|
|
98
|
+
return parts.map((part) => (isBareCssFamily(part) ? part : quoteCssFamily(part))).join(', ');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function detectedFamily(detect: AppFontDetector): string | undefined {
|
|
102
|
+
try {
|
|
103
|
+
const detected = detect();
|
|
104
|
+
if (typeof detected !== 'string') return undefined;
|
|
105
|
+
const concrete = concreteFontFamily(detected);
|
|
106
|
+
if (!concrete || isIconFontFamily(concrete)) return undefined;
|
|
107
|
+
return concrete;
|
|
108
|
+
} catch {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function quoteCssFamily(name: string): string {
|
|
114
|
+
return `"${escapeCssFamily(name)}"`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function escapeCssFamily(name: string): string {
|
|
118
|
+
return name.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
119
|
+
}
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
readNavigationPresentation,
|
|
7
7
|
subscribeNavigationState,
|
|
8
8
|
} from '../navigation/isOverlayPresentation';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
mustNotUseExpoRouterPush,
|
|
11
|
+
shouldOpenExternalNavigateUrl,
|
|
12
|
+
} from '../navigation/navigateUrlUtils';
|
|
13
|
+
import { openFlowNavigateUrl, setExpoRouterNavigator } from '../navigation/openFlowNavigateUrl';
|
|
10
14
|
import { handleScreenChange } from '../screenTracker';
|
|
11
15
|
|
|
12
16
|
/**
|
|
@@ -73,6 +77,11 @@ export function useUserflowExpoRouter(): void {
|
|
|
73
77
|
useEffect(() => {
|
|
74
78
|
setExpoRouterNavigator({
|
|
75
79
|
push: (href) => {
|
|
80
|
+
const trimmed = String(href).trim();
|
|
81
|
+
if (mustNotUseExpoRouterPush(trimmed) || shouldOpenExternalNavigateUrl(trimmed)) {
|
|
82
|
+
void openFlowNavigateUrl(trimmed);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
76
85
|
router.push(href as never);
|
|
77
86
|
},
|
|
78
87
|
});
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
|
|
23
23
|
import './anchors/autoAnchor';
|
|
24
24
|
import { anchorChangeTicker } from './anchors/anchorChangeTicker';
|
|
25
|
+
import { resetDetectedAppFont } from './anchors/fiber/detectAppFontFamily';
|
|
25
26
|
import { notifyAnchorScreenChange } from './anchors/resolveAnchorHost';
|
|
26
27
|
import {
|
|
27
28
|
setCustomScrollIntoView as setCustomScrollIntoViewConfig,
|
|
@@ -80,13 +81,13 @@ import {
|
|
|
80
81
|
attachFlowSessionEngine,
|
|
81
82
|
cancelPendingDraftEnd,
|
|
82
83
|
clearFlowSessionEngineLocalSession,
|
|
83
|
-
endDraftFlowSession,
|
|
84
84
|
endEvalJsFlowSession,
|
|
85
85
|
getFlowSessionEngine,
|
|
86
86
|
hasActiveFlowSession,
|
|
87
87
|
resetFlowSessionEngine,
|
|
88
88
|
} from './runtime/flowEngine';
|
|
89
89
|
import { isolateAsync, isolateSync } from './runtime/isolateCall';
|
|
90
|
+
import { endDraftPreviewSessions, prepareForBuilderPreviewStart } from './runtime/previewStart';
|
|
90
91
|
import { getUserflowCore } from './runtime/userflowCore';
|
|
91
92
|
import {
|
|
92
93
|
disableScreenTracking,
|
|
@@ -100,7 +101,9 @@ import {
|
|
|
100
101
|
} from './screenTracker';
|
|
101
102
|
import { setSurfaceInteractionBlocking as setSurfaceInteractionBlockingConfig } from './surfaces/surfaceInteractionConfig';
|
|
102
103
|
|
|
103
|
-
|
|
104
|
+
import { SDK_VERSION } from './version';
|
|
105
|
+
|
|
106
|
+
export { SDK_VERSION };
|
|
104
107
|
export type { DeviceContext, DeviceOs, DeviceType, SdkPlatform } from './deviceContext';
|
|
105
108
|
export type { HostAppVersion, HostAppVersionSource } from './hostAppVersion';
|
|
106
109
|
export { EmbedBannerPlaceholder } from './runtime/EmbedBannerPlaceholder';
|
|
@@ -141,8 +144,8 @@ export type {
|
|
|
141
144
|
/** Configuration passed to {@link Userflow.init}. */
|
|
142
145
|
export type UserflowInitConfig = UserflowInitOptions & {
|
|
143
146
|
/**
|
|
144
|
-
* Optional host handler for flow NAVIGATE actions. When set, wins
|
|
145
|
-
* React Navigation / Expo Router / Linking.
|
|
147
|
+
* Optional host handler for flow and banner NAVIGATE actions. When set, wins
|
|
148
|
+
* over React Navigation / Expo Router / Linking.
|
|
146
149
|
*/
|
|
147
150
|
onNavigate?: FlowNavigateHandler;
|
|
148
151
|
/**
|
|
@@ -297,6 +300,10 @@ export const Userflow = {
|
|
|
297
300
|
...(config.appBuild !== undefined ? { appBuild: config.appBuild } : {}),
|
|
298
301
|
});
|
|
299
302
|
warnIfInstallIncomplete();
|
|
303
|
+
if (__DEV__) {
|
|
304
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
305
|
+
console.log(`[Userflow] react-native SDK ${SDK_VERSION} (source)`);
|
|
306
|
+
}
|
|
300
307
|
cacheDeviceContextAtInit();
|
|
301
308
|
setHostOnNavigate(config.onNavigate);
|
|
302
309
|
lifecycle.start();
|
|
@@ -311,6 +318,7 @@ export const Userflow = {
|
|
|
311
318
|
// the success path makes a failed init look like a broken deep link.
|
|
312
319
|
const pairing = installPairingController(core, {
|
|
313
320
|
...(config.pairingEndpoint !== undefined ? { pairingEndpoint: config.pairingEndpoint } : {}),
|
|
321
|
+
prepareForBuilderPreviewStart: () => prepareForBuilderPreviewStart(core),
|
|
314
322
|
clearLocalSession: () => {
|
|
315
323
|
clearFlowSessionEngineLocalSession();
|
|
316
324
|
core.setFlowSessionId(null);
|
|
@@ -318,7 +326,7 @@ export const Userflow = {
|
|
|
318
326
|
core.setBannerSessionId(null);
|
|
319
327
|
evalJsController.reset();
|
|
320
328
|
},
|
|
321
|
-
endDraftSession:
|
|
329
|
+
endDraftSession: endDraftPreviewSessions,
|
|
322
330
|
cancelPendingDraftEnd,
|
|
323
331
|
});
|
|
324
332
|
pairing.notifyInitStarted();
|
|
@@ -354,8 +362,8 @@ export const Userflow = {
|
|
|
354
362
|
return getPairingController(core).exitPreview();
|
|
355
363
|
},
|
|
356
364
|
/**
|
|
357
|
-
* Override or clear the host NAVIGATE handler (same as
|
|
358
|
-
* Wins over React Navigation / Expo Router / Linking
|
|
365
|
+
* Override or clear the host NAVIGATE handler for flows and banners (same as
|
|
366
|
+
* `init({ onNavigate })`). Wins over React Navigation / Expo Router / Linking.
|
|
359
367
|
*/
|
|
360
368
|
setOnNavigate(handler: FlowNavigateHandler | null | undefined): void {
|
|
361
369
|
setHostOnNavigate(handler);
|
|
@@ -372,7 +380,9 @@ export const Userflow = {
|
|
|
372
380
|
if (previousId != null && previousId !== userId) {
|
|
373
381
|
resetClientConditionEngine();
|
|
374
382
|
core.setClientConditions([]);
|
|
375
|
-
|
|
383
|
+
clearFlowSessionEngineLocalSession();
|
|
384
|
+
clearBannerSessionEngineLocalSession({ rememberDraftForPreviewEnd: false });
|
|
385
|
+
core.setFlowSessionId(null);
|
|
376
386
|
core.setBannerSessionId(null);
|
|
377
387
|
evalJsController.reset();
|
|
378
388
|
await clearAnonymousId();
|
|
@@ -391,7 +401,9 @@ export const Userflow = {
|
|
|
391
401
|
if (previousId != null && previousId !== anonymousId) {
|
|
392
402
|
resetClientConditionEngine();
|
|
393
403
|
core.setClientConditions([]);
|
|
394
|
-
|
|
404
|
+
clearFlowSessionEngineLocalSession();
|
|
405
|
+
clearBannerSessionEngineLocalSession({ rememberDraftForPreviewEnd: false });
|
|
406
|
+
core.setFlowSessionId(null);
|
|
395
407
|
core.setBannerSessionId(null);
|
|
396
408
|
evalJsController.reset();
|
|
397
409
|
armScreenViewedForNextIdentify();
|
|
@@ -482,6 +494,7 @@ export const Userflow = {
|
|
|
482
494
|
},
|
|
483
495
|
/** Clears the current user identity and disconnects from Userflow. */
|
|
484
496
|
async reset(): Promise<void> {
|
|
497
|
+
resetDetectedAppFont();
|
|
485
498
|
resetClientConditionEngine();
|
|
486
499
|
resetFlowSessionEngine();
|
|
487
500
|
resetBannerSessionEngine();
|