@userflow-tech/react-native 0.1.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/LICENSE +76 -0
- package/README.md +337 -0
- package/docs/anchoring.md +264 -0
- package/docs/deep-linking.md +271 -0
- package/docs/identity-verification.md +95 -0
- package/docs/theme-mapping.md +101 -0
- package/docs/troubleshooting.md +107 -0
- package/lib/commonjs/anchors/AnchorRegistry.js +72 -0
- package/lib/commonjs/anchors/AnchorRegistry.js.map +1 -0
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +315 -0
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -0
- package/lib/commonjs/anchors/ScrollContainerRegistry.js +93 -0
- package/lib/commonjs/anchors/ScrollContainerRegistry.js.map +1 -0
- package/lib/commonjs/anchors/anchorChangeTicker.js +83 -0
- package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -0
- package/lib/commonjs/anchors/animationFrame.js +90 -0
- package/lib/commonjs/anchors/animationFrame.js.map +1 -0
- package/lib/commonjs/anchors/autoAnchor.js +253 -0
- package/lib/commonjs/anchors/autoAnchor.js.map +1 -0
- package/lib/commonjs/anchors/elementConditionEvaluator.js +82 -0
- package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -0
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js +90 -0
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js +180 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -0
- package/lib/commonjs/anchors/fiber/findAnchorFiber.js +214 -0
- package/lib/commonjs/anchors/fiber/findAnchorFiber.js.map +1 -0
- package/lib/commonjs/anchors/fiber/findScrollAncestors.js +176 -0
- package/lib/commonjs/anchors/fiber/findScrollAncestors.js.map +1 -0
- package/lib/commonjs/anchors/fiber/measureHostFiber.js +75 -0
- package/lib/commonjs/anchors/fiber/measureHostFiber.js.map +1 -0
- package/lib/commonjs/anchors/fiber/visibleScreens.js +165 -0
- package/lib/commonjs/anchors/fiber/visibleScreens.js.map +1 -0
- package/lib/commonjs/anchors/hintsCodec.js +120 -0
- package/lib/commonjs/anchors/hintsCodec.js.map +1 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js +112 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -0
- package/lib/commonjs/anchors/resolveManualAnchorId.js +17 -0
- package/lib/commonjs/anchors/resolveManualAnchorId.js.map +1 -0
- package/lib/commonjs/anchors/scrollAnchorIntoView.js +227 -0
- package/lib/commonjs/anchors/scrollAnchorIntoView.js.map +1 -0
- package/lib/commonjs/anchors/scrollConfig.js +48 -0
- package/lib/commonjs/anchors/scrollConfig.js.map +1 -0
- package/lib/commonjs/anchors/targetPressMonitor.js +113 -0
- package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -0
- package/lib/commonjs/anchors/useUserflowAnchor.js +91 -0
- package/lib/commonjs/anchors/useUserflowAnchor.js.map +1 -0
- package/lib/commonjs/anchors/useUserflowScrollContainer.js +76 -0
- package/lib/commonjs/anchors/useUserflowScrollContainer.js.map +1 -0
- package/lib/commonjs/anonymousId.js +42 -0
- package/lib/commonjs/anonymousId.js.map +1 -0
- package/lib/commonjs/content/RichContentRenderer.js +675 -0
- package/lib/commonjs/content/RichContentRenderer.js.map +1 -0
- package/lib/commonjs/content/StepButton.js +57 -0
- package/lib/commonjs/content/StepButton.js.map +1 -0
- package/lib/commonjs/content/buttonAppearance.js +18 -0
- package/lib/commonjs/content/buttonAppearance.js.map +1 -0
- package/lib/commonjs/content/deserialize.js +129 -0
- package/lib/commonjs/content/deserialize.js.map +1 -0
- package/lib/commonjs/content/imageLayout.js +24 -0
- package/lib/commonjs/content/imageLayout.js.map +1 -0
- package/lib/commonjs/content/migrateFlowBlocks.js +39 -0
- package/lib/commonjs/content/migrateFlowBlocks.js.map +1 -0
- package/lib/commonjs/content/openSafeUrl.js +37 -0
- package/lib/commonjs/content/openSafeUrl.js.map +1 -0
- package/lib/commonjs/content/resolveStepButtonChrome.js +95 -0
- package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -0
- package/lib/commonjs/content/themeColor.js +106 -0
- package/lib/commonjs/content/themeColor.js.map +1 -0
- package/lib/commonjs/content/types.js +2 -0
- package/lib/commonjs/content/types.js.map +1 -0
- package/lib/commonjs/deepLinking.js +162 -0
- package/lib/commonjs/deepLinking.js.map +1 -0
- package/lib/commonjs/expo-router/UserflowExpoRouterScreenTracker.js +13 -0
- package/lib/commonjs/expo-router/UserflowExpoRouterScreenTracker.js.map +1 -0
- package/lib/commonjs/expo-router/getExpoRouterScreenTracker.js +44 -0
- package/lib/commonjs/expo-router/getExpoRouterScreenTracker.js.map +1 -0
- package/lib/commonjs/expo-router/index.js +20 -0
- package/lib/commonjs/expo-router/index.js.map +1 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +45 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -0
- package/lib/commonjs/index.js +356 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lifecycle.js +200 -0
- package/lib/commonjs/lifecycle.js.map +1 -0
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js +69 -0
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -0
- package/lib/commonjs/navigation/chainCallbacks.js +16 -0
- package/lib/commonjs/navigation/chainCallbacks.js.map +1 -0
- package/lib/commonjs/navigation/getActiveRouteName.js +18 -0
- package/lib/commonjs/navigation/getActiveRouteName.js.map +1 -0
- package/lib/commonjs/navigation/index.js +50 -0
- package/lib/commonjs/navigation/index.js.map +1 -0
- package/lib/commonjs/navigation/openFlowNavigateUrl.js +110 -0
- package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -0
- package/lib/commonjs/network.js +90 -0
- package/lib/commonjs/network.js.map +1 -0
- package/lib/commonjs/pairing/PairingController.js +290 -0
- package/lib/commonjs/pairing/PairingController.js.map +1 -0
- package/lib/commonjs/pairing/PreviewModeBanner.js +118 -0
- package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -0
- package/lib/commonjs/pairing/deepLink.js +141 -0
- package/lib/commonjs/pairing/deepLink.js.map +1 -0
- package/lib/commonjs/pairing/diagnostics.js +115 -0
- package/lib/commonjs/pairing/diagnostics.js.map +1 -0
- package/lib/commonjs/pairing/index.js +58 -0
- package/lib/commonjs/pairing/index.js.map +1 -0
- package/lib/commonjs/pairing/pairingRuntime.js +85 -0
- package/lib/commonjs/pairing/pairingRuntime.js.map +1 -0
- package/lib/commonjs/pairing/tokenStorage.js +70 -0
- package/lib/commonjs/pairing/tokenStorage.js.map +1 -0
- package/lib/commonjs/pairing/usePairingState.js +40 -0
- package/lib/commonjs/pairing/usePairingState.js.map +1 -0
- package/lib/commonjs/runtime/FlowRenderer.js +57 -0
- package/lib/commonjs/runtime/FlowRenderer.js.map +1 -0
- package/lib/commonjs/runtime/FlowSurfaceFade.js +53 -0
- package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -0
- package/lib/commonjs/runtime/TargetPressBridge.js +96 -0
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -0
- package/lib/commonjs/runtime/UserflowProvider.js +91 -0
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -0
- package/lib/commonjs/runtime/clientConditions.js +50 -0
- package/lib/commonjs/runtime/clientConditions.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +63 -0
- package/lib/commonjs/runtime/flowEngine.js.map +1 -0
- package/lib/commonjs/runtime/flowSessionViewState.js +48 -0
- package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -0
- package/lib/commonjs/runtime/useFlowSessionState.js +25 -0
- package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -0
- package/lib/commonjs/runtime/userflowCore.js +13 -0
- package/lib/commonjs/runtime/userflowCore.js.map +1 -0
- package/lib/commonjs/screenTracker.js +87 -0
- package/lib/commonjs/screenTracker.js.map +1 -0
- package/lib/commonjs/surfaces/CloseButton.js +52 -0
- package/lib/commonjs/surfaces/CloseButton.js.map +1 -0
- package/lib/commonjs/surfaces/MadeWithUserflow.js +90 -0
- package/lib/commonjs/surfaces/MadeWithUserflow.js.map +1 -0
- package/lib/commonjs/surfaces/ModalSurface.js +170 -0
- package/lib/commonjs/surfaces/ModalSurface.js.map +1 -0
- package/lib/commonjs/surfaces/ProgressBar.js +116 -0
- package/lib/commonjs/surfaces/ProgressBar.js.map +1 -0
- package/lib/commonjs/surfaces/TooltipSurface.js +638 -0
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -0
- package/lib/commonjs/surfaces/absoluteFill.js +29 -0
- package/lib/commonjs/surfaces/absoluteFill.js.map +1 -0
- package/lib/commonjs/surfaces/assets/png.d.js +2 -0
- package/lib/commonjs/surfaces/assets/png.d.js.map +1 -0
- package/lib/commonjs/surfaces/assets/userflow-logomark.png +0 -0
- package/lib/commonjs/surfaces/parseBackdropOpacity.js +20 -0
- package/lib/commonjs/surfaces/parseBackdropOpacity.js.map +1 -0
- package/lib/commonjs/surfaces/progress.js +35 -0
- package/lib/commonjs/surfaces/progress.js.map +1 -0
- package/lib/commonjs/surfaces/resolveCloseButtonColor.js +24 -0
- package/lib/commonjs/surfaces/resolveCloseButtonColor.js.map +1 -0
- package/lib/commonjs/surfaces/resolveModalLayout.js +67 -0
- package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -0
- package/lib/commonjs/surfaces/resolveTooltipLayout.js +64 -0
- package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -0
- package/lib/commonjs/surfaces/safeArea.js +46 -0
- package/lib/commonjs/surfaces/safeArea.js.map +1 -0
- package/lib/commonjs/surfaces/themeChrome.js +90 -0
- package/lib/commonjs/surfaces/themeChrome.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +108 -0
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +103 -0
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/TooltipNotch.js +64 -0
- package/lib/commonjs/surfaces/tooltip/TooltipNotch.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +102 -0
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +100 -0
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/parseBackdropPadding.js +15 -0
- package/lib/commonjs/surfaces/tooltip/parseBackdropPadding.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/rect.js +51 -0
- package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -0
- package/lib/commonjs/useUserflowScreen.js +24 -0
- package/lib/commonjs/useUserflowScreen.js.map +1 -0
- package/lib/commonjs/version.js +9 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/anchors/AnchorRegistry.js +67 -0
- package/lib/module/anchors/AnchorRegistry.js.map +1 -0
- package/lib/module/anchors/AutoAnchorRegistry.js +309 -0
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -0
- package/lib/module/anchors/ScrollContainerRegistry.js +86 -0
- package/lib/module/anchors/ScrollContainerRegistry.js.map +1 -0
- package/lib/module/anchors/anchorChangeTicker.js +79 -0
- package/lib/module/anchors/anchorChangeTicker.js.map +1 -0
- package/lib/module/anchors/animationFrame.js +83 -0
- package/lib/module/anchors/animationFrame.js.map +1 -0
- package/lib/module/anchors/autoAnchor.js +248 -0
- package/lib/module/anchors/autoAnchor.js.map +1 -0
- package/lib/module/anchors/elementConditionEvaluator.js +79 -0
- package/lib/module/anchors/elementConditionEvaluator.js.map +1 -0
- package/lib/module/anchors/fiber/FiberScanRoot.js +84 -0
- package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -0
- package/lib/module/anchors/fiber/fiberInternals.js +164 -0
- package/lib/module/anchors/fiber/fiberInternals.js.map +1 -0
- package/lib/module/anchors/fiber/findAnchorFiber.js +210 -0
- package/lib/module/anchors/fiber/findAnchorFiber.js.map +1 -0
- package/lib/module/anchors/fiber/findScrollAncestors.js +172 -0
- package/lib/module/anchors/fiber/findScrollAncestors.js.map +1 -0
- package/lib/module/anchors/fiber/measureHostFiber.js +70 -0
- package/lib/module/anchors/fiber/measureHostFiber.js.map +1 -0
- package/lib/module/anchors/fiber/visibleScreens.js +159 -0
- package/lib/module/anchors/fiber/visibleScreens.js.map +1 -0
- package/lib/module/anchors/hintsCodec.js +111 -0
- package/lib/module/anchors/hintsCodec.js.map +1 -0
- package/lib/module/anchors/resolveAnchorHost.js +105 -0
- package/lib/module/anchors/resolveAnchorHost.js.map +1 -0
- package/lib/module/anchors/resolveManualAnchorId.js +13 -0
- package/lib/module/anchors/resolveManualAnchorId.js.map +1 -0
- package/lib/module/anchors/scrollAnchorIntoView.js +222 -0
- package/lib/module/anchors/scrollAnchorIntoView.js.map +1 -0
- package/lib/module/anchors/scrollConfig.js +40 -0
- package/lib/module/anchors/scrollConfig.js.map +1 -0
- package/lib/module/anchors/targetPressMonitor.js +105 -0
- package/lib/module/anchors/targetPressMonitor.js.map +1 -0
- package/lib/module/anchors/useUserflowAnchor.js +87 -0
- package/lib/module/anchors/useUserflowAnchor.js.map +1 -0
- package/lib/module/anchors/useUserflowScrollContainer.js +71 -0
- package/lib/module/anchors/useUserflowScrollContainer.js.map +1 -0
- package/lib/module/anonymousId.js +36 -0
- package/lib/module/anonymousId.js.map +1 -0
- package/lib/module/content/RichContentRenderer.js +670 -0
- package/lib/module/content/RichContentRenderer.js.map +1 -0
- package/lib/module/content/StepButton.js +52 -0
- package/lib/module/content/StepButton.js.map +1 -0
- package/lib/module/content/buttonAppearance.js +14 -0
- package/lib/module/content/buttonAppearance.js.map +1 -0
- package/lib/module/content/deserialize.js +116 -0
- package/lib/module/content/deserialize.js.map +1 -0
- package/lib/module/content/imageLayout.js +20 -0
- package/lib/module/content/imageLayout.js.map +1 -0
- package/lib/module/content/migrateFlowBlocks.js +35 -0
- package/lib/module/content/migrateFlowBlocks.js.map +1 -0
- package/lib/module/content/openSafeUrl.js +32 -0
- package/lib/module/content/openSafeUrl.js.map +1 -0
- package/lib/module/content/resolveStepButtonChrome.js +90 -0
- package/lib/module/content/resolveStepButtonChrome.js.map +1 -0
- package/lib/module/content/themeColor.js +99 -0
- package/lib/module/content/themeColor.js.map +1 -0
- package/lib/module/content/types.js +2 -0
- package/lib/module/content/types.js.map +1 -0
- package/lib/module/deepLinking.js +152 -0
- package/lib/module/deepLinking.js.map +1 -0
- package/lib/module/expo-router/UserflowExpoRouterScreenTracker.js +10 -0
- package/lib/module/expo-router/UserflowExpoRouterScreenTracker.js.map +1 -0
- package/lib/module/expo-router/getExpoRouterScreenTracker.js +39 -0
- package/lib/module/expo-router/getExpoRouterScreenTracker.js.map +1 -0
- package/lib/module/expo-router/index.js +5 -0
- package/lib/module/expo-router/index.js.map +1 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js +42 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -0
- package/lib/module/index.js +259 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lifecycle.js +195 -0
- package/lib/module/lifecycle.js.map +1 -0
- package/lib/module/navigation/WithUserflowReactNavigation.js +65 -0
- package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -0
- package/lib/module/navigation/chainCallbacks.js +12 -0
- package/lib/module/navigation/chainCallbacks.js.map +1 -0
- package/lib/module/navigation/getActiveRouteName.js +14 -0
- package/lib/module/navigation/getActiveRouteName.js.map +1 -0
- package/lib/module/navigation/index.js +5 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/openFlowNavigateUrl.js +100 -0
- package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -0
- package/lib/module/network.js +85 -0
- package/lib/module/network.js.map +1 -0
- package/lib/module/pairing/PairingController.js +286 -0
- package/lib/module/pairing/PairingController.js.map +1 -0
- package/lib/module/pairing/PreviewModeBanner.js +113 -0
- package/lib/module/pairing/PreviewModeBanner.js.map +1 -0
- package/lib/module/pairing/deepLink.js +134 -0
- package/lib/module/pairing/deepLink.js.map +1 -0
- package/lib/module/pairing/diagnostics.js +101 -0
- package/lib/module/pairing/diagnostics.js.map +1 -0
- package/lib/module/pairing/index.js +7 -0
- package/lib/module/pairing/index.js.map +1 -0
- package/lib/module/pairing/pairingRuntime.js +77 -0
- package/lib/module/pairing/pairingRuntime.js.map +1 -0
- package/lib/module/pairing/tokenStorage.js +65 -0
- package/lib/module/pairing/tokenStorage.js.map +1 -0
- package/lib/module/pairing/usePairingState.js +35 -0
- package/lib/module/pairing/usePairingState.js.map +1 -0
- package/lib/module/runtime/FlowRenderer.js +52 -0
- package/lib/module/runtime/FlowRenderer.js.map +1 -0
- package/lib/module/runtime/FlowSurfaceFade.js +48 -0
- package/lib/module/runtime/FlowSurfaceFade.js.map +1 -0
- package/lib/module/runtime/TargetPressBridge.js +91 -0
- package/lib/module/runtime/TargetPressBridge.js.map +1 -0
- package/lib/module/runtime/UserflowProvider.js +85 -0
- package/lib/module/runtime/UserflowProvider.js.map +1 -0
- package/lib/module/runtime/clientConditions.js +43 -0
- package/lib/module/runtime/clientConditions.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +54 -0
- package/lib/module/runtime/flowEngine.js.map +1 -0
- package/lib/module/runtime/flowSessionViewState.js +42 -0
- package/lib/module/runtime/flowSessionViewState.js.map +1 -0
- package/lib/module/runtime/useFlowSessionState.js +21 -0
- package/lib/module/runtime/useFlowSessionState.js.map +1 -0
- package/lib/module/runtime/userflowCore.js +10 -0
- package/lib/module/runtime/userflowCore.js.map +1 -0
- package/lib/module/screenTracker.js +79 -0
- package/lib/module/screenTracker.js.map +1 -0
- package/lib/module/surfaces/CloseButton.js +47 -0
- package/lib/module/surfaces/CloseButton.js.map +1 -0
- package/lib/module/surfaces/MadeWithUserflow.js +83 -0
- package/lib/module/surfaces/MadeWithUserflow.js.map +1 -0
- package/lib/module/surfaces/ModalSurface.js +165 -0
- package/lib/module/surfaces/ModalSurface.js.map +1 -0
- package/lib/module/surfaces/ProgressBar.js +111 -0
- package/lib/module/surfaces/ProgressBar.js.map +1 -0
- package/lib/module/surfaces/TooltipSurface.js +633 -0
- package/lib/module/surfaces/TooltipSurface.js.map +1 -0
- package/lib/module/surfaces/absoluteFill.js +25 -0
- package/lib/module/surfaces/absoluteFill.js.map +1 -0
- package/lib/module/surfaces/assets/png.d.js +2 -0
- package/lib/module/surfaces/assets/png.d.js.map +1 -0
- package/lib/module/surfaces/assets/userflow-logomark.png +0 -0
- package/lib/module/surfaces/parseBackdropOpacity.js +16 -0
- package/lib/module/surfaces/parseBackdropOpacity.js.map +1 -0
- package/lib/module/surfaces/progress.js +31 -0
- package/lib/module/surfaces/progress.js.map +1 -0
- package/lib/module/surfaces/resolveCloseButtonColor.js +20 -0
- package/lib/module/surfaces/resolveCloseButtonColor.js.map +1 -0
- package/lib/module/surfaces/resolveModalLayout.js +59 -0
- package/lib/module/surfaces/resolveModalLayout.js.map +1 -0
- package/lib/module/surfaces/resolveTooltipLayout.js +57 -0
- package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -0
- package/lib/module/surfaces/safeArea.js +41 -0
- package/lib/module/surfaces/safeArea.js.map +1 -0
- package/lib/module/surfaces/themeChrome.js +86 -0
- package/lib/module/surfaces/themeChrome.js.map +1 -0
- package/lib/module/surfaces/tooltip/TooltipBubble.js +103 -0
- package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -0
- package/lib/module/surfaces/tooltip/TooltipCutout.js +98 -0
- package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -0
- package/lib/module/surfaces/tooltip/TooltipNotch.js +55 -0
- package/lib/module/surfaces/tooltip/TooltipNotch.js.map +1 -0
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js +97 -0
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -0
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +95 -0
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -0
- package/lib/module/surfaces/tooltip/parseBackdropPadding.js +11 -0
- package/lib/module/surfaces/tooltip/parseBackdropPadding.js.map +1 -0
- package/lib/module/surfaces/tooltip/rect.js +44 -0
- package/lib/module/surfaces/tooltip/rect.js.map +1 -0
- package/lib/module/useUserflowScreen.js +21 -0
- package/lib/module/useUserflowScreen.js.map +1 -0
- package/lib/module/version.js +5 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts +32 -0
- package/lib/typescript/commonjs/src/anchors/AnchorRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +113 -0
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/ScrollContainerRegistry.d.ts +46 -0
- package/lib/typescript/commonjs/src/anchors/ScrollContainerRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +30 -0
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts +21 -0
- package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts +31 -0
- package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +21 -0
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +41 -0
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +48 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts +33 -0
- package/lib/typescript/commonjs/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/findScrollAncestors.d.ts +47 -0
- package/lib/typescript/commonjs/src/anchors/fiber/findScrollAncestors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/measureHostFiber.d.ts +20 -0
- package/lib/typescript/commonjs/src/anchors/fiber/measureHostFiber.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts +42 -0
- package/lib/typescript/commonjs/src/anchors/fiber/visibleScreens.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts +40 -0
- package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +32 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveManualAnchorId.d.ts +6 -0
- package/lib/typescript/commonjs/src/anchors/resolveManualAnchorId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/scrollAnchorIntoView.d.ts +59 -0
- package/lib/typescript/commonjs/src/anchors/scrollAnchorIntoView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/scrollConfig.d.ts +30 -0
- package/lib/typescript/commonjs/src/anchors/scrollConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +64 -0
- package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/useUserflowAnchor.d.ts +30 -0
- package/lib/typescript/commonjs/src/anchors/useUserflowAnchor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/useUserflowScrollContainer.d.ts +34 -0
- package/lib/typescript/commonjs/src/anchors/useUserflowScrollContainer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anonymousId.d.ts +5 -0
- package/lib/typescript/commonjs/src/anonymousId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +21 -0
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/StepButton.d.ts +13 -0
- package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts +8 -0
- package/lib/typescript/commonjs/src/content/buttonAppearance.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/deserialize.d.ts +27 -0
- package/lib/typescript/commonjs/src/content/deserialize.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/imageLayout.d.ts +13 -0
- package/lib/typescript/commonjs/src/content/imageLayout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/migrateFlowBlocks.d.ts +12 -0
- package/lib/typescript/commonjs/src/content/migrateFlowBlocks.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts +12 -0
- package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts +24 -0
- package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts +43 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/types.d.ts +144 -0
- package/lib/typescript/commonjs/src/content/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/deepLinking.d.ts +54 -0
- package/lib/typescript/commonjs/src/deepLinking.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/UserflowExpoRouterScreenTracker.d.ts +3 -0
- package/lib/typescript/commonjs/src/expo-router/UserflowExpoRouterScreenTracker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/getExpoRouterScreenTracker.d.ts +13 -0
- package/lib/typescript/commonjs/src/expo-router/getExpoRouterScreenTracker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts +17 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +112 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/lifecycle.d.ts +96 -0
- package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts +21 -0
- package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/chainCallbacks.d.ts +3 -0
- package/lib/typescript/commonjs/src/navigation/chainCallbacks.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/getActiveRouteName.d.ts +6 -0
- package/lib/typescript/commonjs/src/navigation/getActiveRouteName.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/navigation/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts +33 -0
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/network.d.ts +42 -0
- package/lib/typescript/commonjs/src/network.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +104 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +11 -0
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/deepLink.d.ts +53 -0
- package/lib/typescript/commonjs/src/pairing/deepLink.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +52 -0
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/pairing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/pairingRuntime.d.ts +24 -0
- package/lib/typescript/commonjs/src/pairing/pairingRuntime.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +16 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts +4 -0
- package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +13 -0
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +13 -0
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +16 -0
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +32 -0
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/clientConditions.d.ts +10 -0
- package/lib/typescript/commonjs/src/runtime/clientConditions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts +17 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +18 -0
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +10 -0
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/userflowCore.d.ts +3 -0
- package/lib/typescript/commonjs/src/runtime/userflowCore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts +28 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -0
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +28 -0
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +23 -0
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts +19 -0
- package/lib/typescript/commonjs/src/surfaces/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +17 -0
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/absoluteFill.d.ts +18 -0
- package/lib/typescript/commonjs/src/surfaces/absoluteFill.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/parseBackdropOpacity.d.ts +5 -0
- package/lib/typescript/commonjs/src/surfaces/parseBackdropOpacity.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/progress.d.ts +14 -0
- package/lib/typescript/commonjs/src/surfaces/progress.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveCloseButtonColor.d.ts +9 -0
- package/lib/typescript/commonjs/src/surfaces/resolveCloseButtonColor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +36 -0
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +24 -0
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts +11 -0
- package/lib/typescript/commonjs/src/surfaces/safeArea.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +36 -0
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +23 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +31 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipNotch.d.ts +29 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipNotch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +43 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +34 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/parseBackdropPadding.d.ts +3 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/parseBackdropPadding.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +29 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/useUserflowScreen.d.ts +10 -0
- package/lib/typescript/commonjs/src/useUserflowScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +3 -0
- package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts +32 -0
- package/lib/typescript/module/src/anchors/AnchorRegistry.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +113 -0
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/ScrollContainerRegistry.d.ts +46 -0
- package/lib/typescript/module/src/anchors/ScrollContainerRegistry.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +30 -0
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/animationFrame.d.ts +21 -0
- package/lib/typescript/module/src/anchors/animationFrame.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/autoAnchor.d.ts +31 -0
- package/lib/typescript/module/src/anchors/autoAnchor.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +21 -0
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +41 -0
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +48 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts +33 -0
- package/lib/typescript/module/src/anchors/fiber/findAnchorFiber.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/findScrollAncestors.d.ts +47 -0
- package/lib/typescript/module/src/anchors/fiber/findScrollAncestors.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/measureHostFiber.d.ts +20 -0
- package/lib/typescript/module/src/anchors/fiber/measureHostFiber.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts +42 -0
- package/lib/typescript/module/src/anchors/fiber/visibleScreens.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/hintsCodec.d.ts +40 -0
- package/lib/typescript/module/src/anchors/hintsCodec.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +32 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/resolveManualAnchorId.d.ts +6 -0
- package/lib/typescript/module/src/anchors/resolveManualAnchorId.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/scrollAnchorIntoView.d.ts +59 -0
- package/lib/typescript/module/src/anchors/scrollAnchorIntoView.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/scrollConfig.d.ts +30 -0
- package/lib/typescript/module/src/anchors/scrollConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +64 -0
- package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/useUserflowAnchor.d.ts +30 -0
- package/lib/typescript/module/src/anchors/useUserflowAnchor.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/useUserflowScrollContainer.d.ts +34 -0
- package/lib/typescript/module/src/anchors/useUserflowScrollContainer.d.ts.map +1 -0
- package/lib/typescript/module/src/anonymousId.d.ts +5 -0
- package/lib/typescript/module/src/anonymousId.d.ts.map +1 -0
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts +21 -0
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -0
- package/lib/typescript/module/src/content/StepButton.d.ts +13 -0
- package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -0
- package/lib/typescript/module/src/content/buttonAppearance.d.ts +8 -0
- package/lib/typescript/module/src/content/buttonAppearance.d.ts.map +1 -0
- package/lib/typescript/module/src/content/deserialize.d.ts +27 -0
- package/lib/typescript/module/src/content/deserialize.d.ts.map +1 -0
- package/lib/typescript/module/src/content/imageLayout.d.ts +13 -0
- package/lib/typescript/module/src/content/imageLayout.d.ts.map +1 -0
- package/lib/typescript/module/src/content/migrateFlowBlocks.d.ts +12 -0
- package/lib/typescript/module/src/content/migrateFlowBlocks.d.ts.map +1 -0
- package/lib/typescript/module/src/content/openSafeUrl.d.ts +12 -0
- package/lib/typescript/module/src/content/openSafeUrl.d.ts.map +1 -0
- package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts +24 -0
- package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/content/themeColor.d.ts +43 -0
- package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -0
- package/lib/typescript/module/src/content/types.d.ts +144 -0
- package/lib/typescript/module/src/content/types.d.ts.map +1 -0
- package/lib/typescript/module/src/deepLinking.d.ts +54 -0
- package/lib/typescript/module/src/deepLinking.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/UserflowExpoRouterScreenTracker.d.ts +3 -0
- package/lib/typescript/module/src/expo-router/UserflowExpoRouterScreenTracker.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/getExpoRouterScreenTracker.d.ts +13 -0
- package/lib/typescript/module/src/expo-router/getExpoRouterScreenTracker.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/index.d.ts +3 -0
- package/lib/typescript/module/src/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts +17 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +112 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/lifecycle.d.ts +96 -0
- package/lib/typescript/module/src/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts +21 -0
- package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/chainCallbacks.d.ts +3 -0
- package/lib/typescript/module/src/navigation/chainCallbacks.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/getActiveRouteName.d.ts +6 -0
- package/lib/typescript/module/src/navigation/getActiveRouteName.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/index.d.ts +5 -0
- package/lib/typescript/module/src/navigation/index.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts +33 -0
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -0
- package/lib/typescript/module/src/network.d.ts +42 -0
- package/lib/typescript/module/src/network.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts +104 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +11 -0
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/deepLink.d.ts +53 -0
- package/lib/typescript/module/src/pairing/deepLink.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/diagnostics.d.ts +52 -0
- package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/index.d.ts +10 -0
- package/lib/typescript/module/src/pairing/index.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/pairingRuntime.d.ts +24 -0
- package/lib/typescript/module/src/pairing/pairingRuntime.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts +16 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/usePairingState.d.ts +4 -0
- package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +13 -0
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +13 -0
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +16 -0
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +32 -0
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/clientConditions.d.ts +10 -0
- package/lib/typescript/module/src/runtime/clientConditions.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts +17 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +18 -0
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +10 -0
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/userflowCore.d.ts +3 -0
- package/lib/typescript/module/src/runtime/userflowCore.d.ts.map +1 -0
- package/lib/typescript/module/src/screenTracker.d.ts +28 -0
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -0
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +28 -0
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +23 -0
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/ProgressBar.d.ts +19 -0
- package/lib/typescript/module/src/surfaces/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +17 -0
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/absoluteFill.d.ts +18 -0
- package/lib/typescript/module/src/surfaces/absoluteFill.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/parseBackdropOpacity.d.ts +5 -0
- package/lib/typescript/module/src/surfaces/parseBackdropOpacity.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/progress.d.ts +14 -0
- package/lib/typescript/module/src/surfaces/progress.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveCloseButtonColor.d.ts +9 -0
- package/lib/typescript/module/src/surfaces/resolveCloseButtonColor.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +36 -0
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +24 -0
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/safeArea.d.ts +11 -0
- package/lib/typescript/module/src/surfaces/safeArea.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts +36 -0
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +23 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +31 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipNotch.d.ts +29 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipNotch.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +43 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +34 -0
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/parseBackdropPadding.d.ts +3 -0
- package/lib/typescript/module/src/surfaces/tooltip/parseBackdropPadding.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +29 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -0
- package/lib/typescript/module/src/useUserflowScreen.d.ts +10 -0
- package/lib/typescript/module/src/useUserflowScreen.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +3 -0
- package/lib/typescript/module/src/version.d.ts.map +1 -0
- package/package.json +144 -0
- package/src/anchors/AnchorRegistry.ts +81 -0
- package/src/anchors/AutoAnchorRegistry.ts +439 -0
- package/src/anchors/ScrollContainerRegistry.ts +108 -0
- package/src/anchors/anchorChangeTicker.ts +84 -0
- package/src/anchors/animationFrame.ts +88 -0
- package/src/anchors/autoAnchor.ts +310 -0
- package/src/anchors/elementConditionEvaluator.ts +108 -0
- package/src/anchors/fiber/FiberScanRoot.tsx +98 -0
- package/src/anchors/fiber/fiberInternals.ts +181 -0
- package/src/anchors/fiber/findAnchorFiber.ts +225 -0
- package/src/anchors/fiber/findScrollAncestors.ts +229 -0
- package/src/anchors/fiber/measureHostFiber.ts +85 -0
- package/src/anchors/fiber/visibleScreens.ts +173 -0
- package/src/anchors/hintsCodec.ts +125 -0
- package/src/anchors/resolveAnchorHost.ts +102 -0
- package/src/anchors/resolveManualAnchorId.ts +10 -0
- package/src/anchors/scrollAnchorIntoView.ts +251 -0
- package/src/anchors/scrollConfig.ts +61 -0
- package/src/anchors/targetPressMonitor.ts +127 -0
- package/src/anchors/useUserflowAnchor.ts +88 -0
- package/src/anchors/useUserflowScrollContainer.ts +86 -0
- package/src/anonymousId.ts +38 -0
- package/src/content/RichContentRenderer.tsx +721 -0
- package/src/content/StepButton.tsx +70 -0
- package/src/content/buttonAppearance.ts +11 -0
- package/src/content/deserialize.ts +147 -0
- package/src/content/imageLayout.ts +29 -0
- package/src/content/migrateFlowBlocks.ts +39 -0
- package/src/content/openSafeUrl.ts +30 -0
- package/src/content/resolveStepButtonChrome.ts +122 -0
- package/src/content/themeColor.ts +98 -0
- package/src/content/types.ts +189 -0
- package/src/deepLinking.ts +182 -0
- package/src/expo-router/UserflowExpoRouterScreenTracker.tsx +7 -0
- package/src/expo-router/getExpoRouterScreenTracker.ts +49 -0
- package/src/expo-router/index.ts +2 -0
- package/src/expo-router/useUserflowExpoRouter.ts +40 -0
- package/src/index.ts +362 -0
- package/src/lifecycle.ts +253 -0
- package/src/navigation/WithUserflowReactNavigation.tsx +87 -0
- package/src/navigation/chainCallbacks.ts +12 -0
- package/src/navigation/getActiveRouteName.ts +18 -0
- package/src/navigation/index.ts +11 -0
- package/src/navigation/openFlowNavigateUrl.ts +113 -0
- package/src/network.ts +113 -0
- package/src/pairing/PairingController.ts +356 -0
- package/src/pairing/PreviewModeBanner.tsx +130 -0
- package/src/pairing/deepLink.ts +128 -0
- package/src/pairing/diagnostics.ts +135 -0
- package/src/pairing/index.ts +19 -0
- package/src/pairing/pairingRuntime.ts +76 -0
- package/src/pairing/tokenStorage.ts +76 -0
- package/src/pairing/usePairingState.ts +43 -0
- package/src/runtime/FlowRenderer.tsx +60 -0
- package/src/runtime/FlowSurfaceFade.tsx +55 -0
- package/src/runtime/TargetPressBridge.tsx +86 -0
- package/src/runtime/UserflowProvider.tsx +89 -0
- package/src/runtime/clientConditions.ts +42 -0
- package/src/runtime/flowEngine.ts +53 -0
- package/src/runtime/flowSessionViewState.ts +55 -0
- package/src/runtime/useFlowSessionState.ts +36 -0
- package/src/runtime/userflowCore.ts +8 -0
- package/src/screenTracker.ts +83 -0
- package/src/surfaces/CloseButton.tsx +41 -0
- package/src/surfaces/MadeWithUserflow.tsx +103 -0
- package/src/surfaces/ModalSurface.tsx +215 -0
- package/src/surfaces/ProgressBar.tsx +142 -0
- package/src/surfaces/TooltipSurface.tsx +743 -0
- package/src/surfaces/absoluteFill.ts +24 -0
- package/src/surfaces/assets/png.d.ts +4 -0
- package/src/surfaces/assets/userflow-logomark.png +0 -0
- package/src/surfaces/parseBackdropOpacity.ts +13 -0
- package/src/surfaces/progress.ts +37 -0
- package/src/surfaces/resolveCloseButtonColor.ts +23 -0
- package/src/surfaces/resolveModalLayout.ts +85 -0
- package/src/surfaces/resolveTooltipLayout.ts +73 -0
- package/src/surfaces/safeArea.ts +48 -0
- package/src/surfaces/themeChrome.ts +126 -0
- package/src/surfaces/tooltip/TooltipBubble.tsx +123 -0
- package/src/surfaces/tooltip/TooltipCutout.tsx +110 -0
- package/src/surfaces/tooltip/TooltipNotch.tsx +67 -0
- package/src/surfaces/tooltip/computeTooltipPosition.ts +125 -0
- package/src/surfaces/tooltip/inferTooltipPlacement.ts +109 -0
- package/src/surfaces/tooltip/parseBackdropPadding.ts +8 -0
- package/src/surfaces/tooltip/rect.ts +62 -0
- package/src/useUserflowScreen.ts +17 -0
- package/src/version.ts +2 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MAX_ANCESTOR_WALK, getChild, getMemoizedProps, getReturn, getSibling, isHostFiber } from "./fiberInternals.js";
|
|
4
|
+
import { coveredScreenBranches, isScreenContainerFiber } from "./visibleScreens.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Soft cap so a dense screen cannot stall the JS thread. One modest Expo Router
|
|
8
|
+
* screen measures ~2,700 fibers, and a navigation stack keeps earlier screens
|
|
9
|
+
* mounted, so this has to allow for several screens at once.
|
|
10
|
+
*/
|
|
11
|
+
const MAX_NODES = 60_000;
|
|
12
|
+
|
|
13
|
+
/** One production warning per process — truncation must not look like "missing". */
|
|
14
|
+
let maxNodesWarned = false;
|
|
15
|
+
const TIER_ORDER = ['testID', 'nativeID', 'accessibilityLabel'];
|
|
16
|
+
/**
|
|
17
|
+
* Bounded DFS under `rootFiber` looking for fibers whose memoizedProps match
|
|
18
|
+
* `id` on testID, then nativeID, then accessibilityLabel. Uses the highest
|
|
19
|
+
* tier that has any match so a testID hit is never made ambiguous by an
|
|
20
|
+
* unrelated accessibilityLabel.
|
|
21
|
+
*
|
|
22
|
+
* Composite matches descend to the shallowest host descendant. Multiple
|
|
23
|
+
* matches on a single root-to-leaf chain (e.g. Pressable forwarding testID to
|
|
24
|
+
* its inner View) collapse to the outermost host. Disjoint matches fail closed
|
|
25
|
+
* as ambiguous.
|
|
26
|
+
*
|
|
27
|
+
* The walk never follows `rootFiber.sibling` so the Userflow overlay (a sibling
|
|
28
|
+
* of {@link FiberScanRoot} in UserflowProvider) cannot self-match SDK testIDs.
|
|
29
|
+
*/
|
|
30
|
+
export function findAnchorFiber(rootFiber, id) {
|
|
31
|
+
if (!rootFiber || !id) return {
|
|
32
|
+
status: 'missing'
|
|
33
|
+
};
|
|
34
|
+
try {
|
|
35
|
+
const byTier = {
|
|
36
|
+
testID: [],
|
|
37
|
+
nativeID: [],
|
|
38
|
+
accessibilityLabel: []
|
|
39
|
+
};
|
|
40
|
+
const stack = [rootFiber];
|
|
41
|
+
// Branches belonging to screens the user cannot see. Their siblings are
|
|
42
|
+
// still walked, so only the covered subtree is skipped.
|
|
43
|
+
const covered = new Set();
|
|
44
|
+
let visited = 0;
|
|
45
|
+
while (stack.length > 0 && visited < MAX_NODES) {
|
|
46
|
+
const fiber = stack.pop();
|
|
47
|
+
if (!fiber) continue;
|
|
48
|
+
visited += 1;
|
|
49
|
+
if (covered.has(fiber)) {
|
|
50
|
+
// Keep following the chain, but do not match or descend here.
|
|
51
|
+
if (fiber !== rootFiber) {
|
|
52
|
+
const sibling = getSibling(fiber);
|
|
53
|
+
if (sibling) stack.push(sibling);
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const props = getMemoizedProps(fiber);
|
|
58
|
+
if (props) {
|
|
59
|
+
if (typeof props.testID === 'string' && props.testID === id) {
|
|
60
|
+
byTier.testID.push(fiber);
|
|
61
|
+
}
|
|
62
|
+
if (typeof props.nativeID === 'string' && props.nativeID === id) {
|
|
63
|
+
byTier.nativeID.push(fiber);
|
|
64
|
+
}
|
|
65
|
+
if (typeof props.accessibilityLabel === 'string' && props.accessibilityLabel === id) {
|
|
66
|
+
byTier.accessibilityLabel.push(fiber);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Descend into children. Do NOT follow the seed root's sibling — in
|
|
71
|
+
// UserflowProvider the overlay (with SDK testIDs) is a sibling of
|
|
72
|
+
// FiberScanRoot and must stay outside the scan.
|
|
73
|
+
if (fiber !== rootFiber) {
|
|
74
|
+
const sibling = getSibling(fiber);
|
|
75
|
+
if (sibling) stack.push(sibling);
|
|
76
|
+
}
|
|
77
|
+
if (isScreenContainerFiber(fiber)) {
|
|
78
|
+
for (const branch of coveredScreenBranches(fiber)) {
|
|
79
|
+
covered.add(branch);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const child = getChild(fiber);
|
|
83
|
+
if (child) stack.push(child);
|
|
84
|
+
}
|
|
85
|
+
if (visited >= MAX_NODES) {
|
|
86
|
+
// Truncation would otherwise look exactly like "the anchor isn't there".
|
|
87
|
+
// eslint-disable-next-line no-console -- actionable: the anchor may exist but was not reached
|
|
88
|
+
const warn = message => console.warn(message);
|
|
89
|
+
if (__DEV__) {
|
|
90
|
+
warn(`[Userflow] Anchor scan for "${id}" stopped after ${MAX_NODES} nodes. ` + `The element may exist but was not reached. Register it explicitly with ` + `useUserflowAnchor("${id}") to skip the scan.`);
|
|
91
|
+
} else if (!maxNodesWarned) {
|
|
92
|
+
maxNodesWarned = true;
|
|
93
|
+
warn(`[Userflow] Anchor scan stopped after ${MAX_NODES} nodes; some anchors may ` + `be missed. Prefer useUserflowAnchor for deep or dense trees.`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
for (const tier of TIER_ORDER) {
|
|
97
|
+
const matches = byTier[tier];
|
|
98
|
+
if (matches.length === 0) continue;
|
|
99
|
+
const hosts = uniqueHosts(matches);
|
|
100
|
+
if (hosts.length === 0) continue;
|
|
101
|
+
if (hosts.length === 1) {
|
|
102
|
+
return {
|
|
103
|
+
status: 'found',
|
|
104
|
+
fiber: hosts[0],
|
|
105
|
+
tier
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const collapsed = collapseToChains(hosts);
|
|
109
|
+
if (collapsed.length === 1) {
|
|
110
|
+
return {
|
|
111
|
+
status: 'found',
|
|
112
|
+
fiber: collapsed[0],
|
|
113
|
+
tier
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
status: 'ambiguous',
|
|
118
|
+
tier
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
status: 'missing'
|
|
123
|
+
};
|
|
124
|
+
} catch {
|
|
125
|
+
return {
|
|
126
|
+
status: 'missing'
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* For each matched fiber, resolve the shallowest host descendant (or itself
|
|
133
|
+
* when already a host). Deduplicate by identity / alternate.
|
|
134
|
+
*/
|
|
135
|
+
function uniqueHosts(matches) {
|
|
136
|
+
const seen = new Set();
|
|
137
|
+
const out = [];
|
|
138
|
+
for (const match of matches) {
|
|
139
|
+
const host = nearestHostDescendant(match) ?? (isHostFiber(match) ? match : null);
|
|
140
|
+
if (!host) continue;
|
|
141
|
+
const identity = host.alternate ?? host;
|
|
142
|
+
if (seen.has(host) || seen.has(identity)) continue;
|
|
143
|
+
seen.add(host);
|
|
144
|
+
seen.add(identity);
|
|
145
|
+
if (host.alternate) seen.add(host.alternate);
|
|
146
|
+
out.push(host);
|
|
147
|
+
}
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* BFS under `fiber` for the shallowest host descendant. Returns `fiber` itself
|
|
153
|
+
* when it is already a host.
|
|
154
|
+
*/
|
|
155
|
+
export function nearestHostDescendant(fiber, maxNodes = 2_000) {
|
|
156
|
+
if (!fiber) return null;
|
|
157
|
+
if (isHostFiber(fiber)) return fiber;
|
|
158
|
+
const queue = [fiber];
|
|
159
|
+
let visited = 0;
|
|
160
|
+
while (queue.length > 0 && visited < maxNodes) {
|
|
161
|
+
const f = queue.shift();
|
|
162
|
+
if (!f) continue;
|
|
163
|
+
visited += 1;
|
|
164
|
+
if (f !== fiber && isHostFiber(f)) return f;
|
|
165
|
+
let child = getChild(f);
|
|
166
|
+
while (child) {
|
|
167
|
+
queue.push(child);
|
|
168
|
+
child = getSibling(child);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Collapse hosts that all lie on one ancestor chain into the outermost
|
|
176
|
+
* (closest to the root). Disjoint subtrees remain as separate entries.
|
|
177
|
+
*/
|
|
178
|
+
function collapseToChains(hosts) {
|
|
179
|
+
if (hosts.length <= 1) return hosts;
|
|
180
|
+
|
|
181
|
+
// Prefer the outermost host when A is an ancestor of B.
|
|
182
|
+
const survivors = [];
|
|
183
|
+
for (const candidate of hosts) {
|
|
184
|
+
let dominated = false;
|
|
185
|
+
for (let i = survivors.length - 1; i >= 0; i -= 1) {
|
|
186
|
+
const other = survivors[i];
|
|
187
|
+
if (isAncestorOf(other, candidate)) {
|
|
188
|
+
// other is outer — drop candidate
|
|
189
|
+
dominated = true;
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
if (isAncestorOf(candidate, other)) {
|
|
193
|
+
// candidate is outer — replace other
|
|
194
|
+
survivors.splice(i, 1);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (!dominated) survivors.push(candidate);
|
|
198
|
+
}
|
|
199
|
+
return survivors;
|
|
200
|
+
}
|
|
201
|
+
function isAncestorOf(ancestor, descendant) {
|
|
202
|
+
let cur = descendant;
|
|
203
|
+
for (let depth = 0; cur && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
204
|
+
if (cur === ancestor) return true;
|
|
205
|
+
if (ancestor.alternate && cur === ancestor.alternate) return true;
|
|
206
|
+
cur = getReturn(cur);
|
|
207
|
+
}
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=findAnchorFiber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_ANCESTOR_WALK","getChild","getMemoizedProps","getReturn","getSibling","isHostFiber","coveredScreenBranches","isScreenContainerFiber","MAX_NODES","maxNodesWarned","TIER_ORDER","findAnchorFiber","rootFiber","id","status","byTier","testID","nativeID","accessibilityLabel","stack","covered","Set","visited","length","fiber","pop","has","sibling","push","props","branch","add","child","warn","message","console","__DEV__","tier","matches","hosts","uniqueHosts","collapsed","collapseToChains","seen","out","match","host","nearestHostDescendant","identity","alternate","maxNodes","queue","f","shift","survivors","candidate","dominated","i","other","isAncestorOf","splice","ancestor","descendant","cur","depth"],"sourceRoot":"../../../../src","sources":["anchors/fiber/findAnchorFiber.ts"],"mappings":";;AAAA,SAEEA,iBAAiB,EACjBC,QAAQ,EACRC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,EACVC,WAAW,QACN,qBAAkB;AACzB,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ,qBAAkB;;AAEhF;AACA;AACA;AACA;AACA;AACA,MAAMC,SAAS,GAAG,MAAM;;AAExB;AACA,IAAIC,cAAc,GAAG,KAAK;AAI1B,MAAMC,UAA4B,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,oBAAoB,CAAC;AAOjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,SAAmB,EAAEC,EAAU,EAAyB;EACtF,IAAI,CAACD,SAAS,IAAI,CAACC,EAAE,EAAE,OAAO;IAAEC,MAAM,EAAE;EAAU,CAAC;EAEnD,IAAI;IACF,MAAMC,MAA0C,GAAG;MACjDC,MAAM,EAAE,EAAE;MACVC,QAAQ,EAAE,EAAE;MACZC,kBAAkB,EAAE;IACtB,CAAC;IAED,MAAMC,KAAiB,GAAG,CAACP,SAAS,CAAC;IACrC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;IACF;IACA,IAAI,CAACD,SAAS,EAAEF,SAAS,CAAC1B,IAAI,CAAC2B,SAAS,CAAC;EAC3C;EACA,OAAOD,SAAS;AAClB;AAEA,SAASK,YAAYA,CAACE,QAAkB,EAAEC,UAAoB,EAAW;EACvE,IAAIC,GAAa,GAAGD,UAAU;EAC9B,KAAK,IAAIE,KAAK,GAAG,CAAC,EAAED,GAAG,IAAIC,KAAK,GAAGhE,iBAAiB,EAAEgE,KAAK,IAAI,CAAC,EAAE;IAChE,IAAID,GAAG,KAAKF,QAAQ,EAAE,OAAO,IAAI;IACjC,IAAIA,QAAQ,CAACZ,SAAS,IAAIc,GAAG,KAAKF,QAAQ,CAACZ,SAAS,EAAE,OAAO,IAAI;IACjEc,GAAG,GAAG5D,SAAS,CAAC4D,GAAG,CAAC;EACtB;EACA,OAAO,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Walk the fiber `return` chain from an anchor host upward and collect
|
|
5
|
+
* scrollable ancestors (innermost first). Used to scroll tooltip targets into
|
|
6
|
+
* view without requiring the host app to register ScrollViews.
|
|
7
|
+
*
|
|
8
|
+
* Detection is duck-typed on `stateNode` (ScrollView → `scrollTo`,
|
|
9
|
+
* FlatList/VirtualizedList → `scrollToOffset`, SectionList → `scrollToLocation`)
|
|
10
|
+
* so an RN rename degrades to "no scroll ancestor" rather than crashing.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { MAX_ANCESTOR_WALK, getChild, getHostTypeName, getMemoizedProps, getReturn, getSibling, getStateNode, isHostFiber } from "./fiberInternals.js";
|
|
14
|
+
import { nearestHostDescendant } from "./findAnchorFiber.js";
|
|
15
|
+
const SCROLL_METHODS = ['scrollTo', 'scrollToOffset', 'scrollToLocation'];
|
|
16
|
+
|
|
17
|
+
/** Native host types that own the scroll viewport. */
|
|
18
|
+
const SCROLL_HOST_TYPES = new Set(['RCTScrollView', 'AndroidHorizontalScrollView']);
|
|
19
|
+
|
|
20
|
+
/** Native host type for the scroll content (moves with contentOffset). */
|
|
21
|
+
const SCROLL_CONTENT_TYPES = new Set(['RCTScrollContentView', 'AndroidHorizontalScrollContentView']);
|
|
22
|
+
/**
|
|
23
|
+
* Collect scrollable ancestors of `fiber`, innermost first.
|
|
24
|
+
* Never throws — missing / renamed internals simply yield an empty list.
|
|
25
|
+
*/
|
|
26
|
+
export function findScrollAncestors(fiber) {
|
|
27
|
+
const out = [];
|
|
28
|
+
if (!fiber) return out;
|
|
29
|
+
try {
|
|
30
|
+
let current = fiber;
|
|
31
|
+
for (let depth = 0; current && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
32
|
+
const instance = asScrollableInstance(getStateNode(current));
|
|
33
|
+
if (instance) {
|
|
34
|
+
const {
|
|
35
|
+
containerFiber,
|
|
36
|
+
contentFiber
|
|
37
|
+
} = resolveScrollGeometry(current, instance);
|
|
38
|
+
out.push({
|
|
39
|
+
instance,
|
|
40
|
+
containerFiber,
|
|
41
|
+
contentFiber,
|
|
42
|
+
horizontal: isHorizontal(instance, current)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
current = getReturn(current);
|
|
46
|
+
}
|
|
47
|
+
} catch {
|
|
48
|
+
// Feature-detection must itself never throw.
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
function asScrollableInstance(node) {
|
|
53
|
+
if (!node || typeof node !== 'object') return null;
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
const n = node;
|
|
56
|
+
for (const method of SCROLL_METHODS) {
|
|
57
|
+
if (typeof n[method] === 'function') {
|
|
58
|
+
return n;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// FlatList/SectionList often expose the list via `_listRef`.
|
|
62
|
+
if (n._listRef && typeof n._listRef === 'object') {
|
|
63
|
+
return asScrollableInstance(n._listRef);
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
function isHorizontal(instance, fiber) {
|
|
68
|
+
try {
|
|
69
|
+
if (instance.props && typeof instance.props.horizontal === 'boolean') {
|
|
70
|
+
return instance.props.horizontal;
|
|
71
|
+
}
|
|
72
|
+
const props = getMemoizedProps(fiber);
|
|
73
|
+
if (props && typeof props.horizontal === 'boolean') {
|
|
74
|
+
return props.horizontal;
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
// Best-effort.
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Resolve the viewport host + content host for offset-from-measure.
|
|
84
|
+
*
|
|
85
|
+
* Prefers imperative refs on the ScrollView instance when present; otherwise
|
|
86
|
+
* walks descendants looking for RCTScrollView / RCTScrollContentView.
|
|
87
|
+
*/
|
|
88
|
+
function resolveScrollGeometry(scrollFiber, instance) {
|
|
89
|
+
// Prefer live refs when the instance is a ScrollView (bind `this`).
|
|
90
|
+
const nativeRef = safeCall(instance, instance.getNativeScrollRef);
|
|
91
|
+
const innerRef = safeCall(instance, instance.getInnerViewRef);
|
|
92
|
+
let containerFiber = fiberFromMaybeInstance(nativeRef) ?? findDescendantByHostType(scrollFiber, SCROLL_HOST_TYPES);
|
|
93
|
+
let contentFiber = fiberFromMaybeInstance(innerRef) ?? (containerFiber ? findDescendantByHostType(containerFiber, SCROLL_CONTENT_TYPES) : findDescendantByHostType(scrollFiber, SCROLL_CONTENT_TYPES));
|
|
94
|
+
|
|
95
|
+
// Fall back: nearest host under the scroll composite = viewport; its first
|
|
96
|
+
// host child is typically the content wrapper.
|
|
97
|
+
if (!containerFiber) {
|
|
98
|
+
containerFiber = nearestHostDescendant(scrollFiber);
|
|
99
|
+
}
|
|
100
|
+
if (!contentFiber && containerFiber) {
|
|
101
|
+
contentFiber = firstHostChild(containerFiber);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
containerFiber,
|
|
105
|
+
contentFiber
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function fiberFromMaybeInstance(instance) {
|
|
109
|
+
if (!instance || typeof instance === 'number') return null;
|
|
110
|
+
try {
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
|
+
const inst = instance;
|
|
113
|
+
const handle = inst._reactInternals ?? inst._reactInternalFiber ?? inst.__internalInstanceHandle ?? inst._internalInstanceHandle;
|
|
114
|
+
if (handle) return handle;
|
|
115
|
+
// Fabric public instance may itself be a host stateNode with a fiber link.
|
|
116
|
+
if (isHostFiber({
|
|
117
|
+
stateNode: instance,
|
|
118
|
+
tag: 5
|
|
119
|
+
})) {
|
|
120
|
+
// No fiber pointer — caller will measure via stateNode directly if needed.
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
} catch {
|
|
124
|
+
// Best-effort.
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
function findDescendantByHostType(fiber, types, maxNodes = 2_000) {
|
|
129
|
+
if (!fiber) return null;
|
|
130
|
+
const queue = [fiber];
|
|
131
|
+
let visited = 0;
|
|
132
|
+
while (queue.length > 0 && visited < maxNodes) {
|
|
133
|
+
const f = queue.shift();
|
|
134
|
+
if (!f) continue;
|
|
135
|
+
visited += 1;
|
|
136
|
+
if (f !== fiber && isHostFiber(f)) {
|
|
137
|
+
const name = getHostTypeName(f);
|
|
138
|
+
if (name && types.has(name)) return f;
|
|
139
|
+
}
|
|
140
|
+
let child = getChild(f);
|
|
141
|
+
while (child) {
|
|
142
|
+
queue.push(child);
|
|
143
|
+
child = getSibling(child);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
function firstHostChild(fiber) {
|
|
149
|
+
let child = getChild(fiber);
|
|
150
|
+
let guard = 0;
|
|
151
|
+
while (child && guard < 200) {
|
|
152
|
+
if (isHostFiber(child)) return child;
|
|
153
|
+
// Prefer descending into the first child before siblings.
|
|
154
|
+
const grandchild = getChild(child);
|
|
155
|
+
if (grandchild) {
|
|
156
|
+
child = grandchild;
|
|
157
|
+
} else {
|
|
158
|
+
child = getSibling(child);
|
|
159
|
+
}
|
|
160
|
+
guard += 1;
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
function safeCall(self, fn) {
|
|
165
|
+
if (typeof fn !== 'function') return null;
|
|
166
|
+
try {
|
|
167
|
+
return fn.call(self);
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=findScrollAncestors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_ANCESTOR_WALK","getChild","getHostTypeName","getMemoizedProps","getReturn","getSibling","getStateNode","isHostFiber","nearestHostDescendant","SCROLL_METHODS","SCROLL_HOST_TYPES","Set","SCROLL_CONTENT_TYPES","findScrollAncestors","fiber","out","current","depth","instance","asScrollableInstance","containerFiber","contentFiber","resolveScrollGeometry","push","horizontal","isHorizontal","node","n","method","_listRef","props","scrollFiber","nativeRef","safeCall","getNativeScrollRef","innerRef","getInnerViewRef","fiberFromMaybeInstance","findDescendantByHostType","firstHostChild","inst","handle","_reactInternals","_reactInternalFiber","__internalInstanceHandle","_internalInstanceHandle","stateNode","tag","types","maxNodes","queue","visited","length","f","shift","name","has","child","guard","grandchild","self","fn","call"],"sourceRoot":"../../../../src","sources":["anchors/fiber/findScrollAncestors.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEEA,iBAAiB,EACjBC,QAAQ,EACRC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,EACVC,YAAY,EACZC,WAAW,QACN,qBAAkB;AACzB,SAASC,qBAAqB,QAAQ,sBAAmB;AAEzD,MAAMC,cAAc,GAAG,CAAC,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,CA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,CAACQ,GAAG,CAACD,IAAI,CAAC,EAAE,OAAOF,CAAC;IACvC;IACA,IAAII,KAAK,GAAGxD,QAAQ,CAACoD,CAAC,CAAC;IACvB,OAAOI,KAAK,EAAE;MACZP,KAAK,CAAC3B,IAAI,CAACkC,KAAK,CAAC;MACjBA,KAAK,GAAGpD,UAAU,CAACoD,KAAK,CAAC;IAC3B;EACF;EACA,OAAO,IAAI;AACb;AAEA,SAASlB,cAAcA,CAACzB,KAAe,EAAmB;EACxD,IAAI2C,KAAK,GAAGxD,QAAQ,CAACa,KAAK,CAAC;EAC3B,IAAI4C,KAAK,GAAG,CAAC;EACb,OAAOD,KAAK,IAAIC,KAAK,GAAG,GAAG,EAAE;IAC3B,IAAInD,WAAW,CAACkD,KAAK,CAAC,EAAE,OAAOA,KAAK;IACpC;IACA,MAAME,UAAU,GAAG1D,QAAQ,CAACwD,KAAK,CAAC;IAClC,IAAIE,UAAU,EAAE;MACdF,KAAK,GAAGE,UAAU;IACpB,CAAC,MAAM;MACLF,KAAK,GAAGpD,UAAU,CAACoD,KAAK,CAAC;IAC3B;IACAC,KAAK,IAAI,CAAC;EACZ;EACA,OAAO,IAAI;AACb;AAEA,SAASzB,QAAQA,CAAC2B,IAAwB,EAAEC,EAA+B,EAAW;EACpF,IAAI,OAAOA,EAAE,KAAK,UAAU,EAAE,OAAO,IAAI;EACzC,IAAI;IACF,OAAOA,EAAE,CAACC,IAAI,CAACF,IAAI,CAAC;EACtB,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { UIManager } from 'react-native';
|
|
4
|
+
import { getStateNode } from "./fiberInternals.js";
|
|
5
|
+
/**
|
|
6
|
+
* Feature-detected `measureInWindow` for a host fiber. Tries, in order:
|
|
7
|
+
*
|
|
8
|
+
* 1. `stateNode.measureInWindow` — Paper host, or materialized Fabric public instance
|
|
9
|
+
* 2. `nativeFabricUIManager.measureInWindow(stateNode.node, …)` — Fabric without public instance
|
|
10
|
+
* 3. `stateNode.canonical.publicInstance.measureInWindow`
|
|
11
|
+
* 4. `UIManager.measureInWindow(nativeTag, …)` — last resort
|
|
12
|
+
*
|
|
13
|
+
* Invokes `callback` with zeros when no measurable path is found (callers treat
|
|
14
|
+
* zero-size as missing).
|
|
15
|
+
*/
|
|
16
|
+
export function measureHostFiber(fiber, callback) {
|
|
17
|
+
const fail = () => {
|
|
18
|
+
callback(0, 0, 0, 0);
|
|
19
|
+
};
|
|
20
|
+
if (!fiber) {
|
|
21
|
+
fail();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const stateNode = getStateNode(fiber);
|
|
26
|
+
if (!stateNode || typeof stateNode !== 'object') {
|
|
27
|
+
fail();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
const node = stateNode;
|
|
33
|
+
if (typeof node.measureInWindow === 'function') {
|
|
34
|
+
node.measureInWindow(callback);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Fabric: measure via the shadow node without materializing a public instance.
|
|
39
|
+
const fabricNode = node.node;
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
const fabricUIManager = globalThis.nativeFabricUIManager;
|
|
42
|
+
if (fabricNode != null && fabricUIManager && typeof fabricUIManager.measureInWindow === 'function') {
|
|
43
|
+
fabricUIManager.measureInWindow(fabricNode, callback);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const publicInstance = node.canonical?.publicInstance;
|
|
47
|
+
if (publicInstance && typeof publicInstance.measureInWindow === 'function') {
|
|
48
|
+
publicInstance.measureInWindow(callback);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const nativeTag = node._nativeTag ?? node.__nativeTag ?? node.nativeTag ?? node.canonical?.nativeTag;
|
|
52
|
+
if (typeof nativeTag === 'number' && Number.isFinite(nativeTag)) {
|
|
53
|
+
UIManager.measureInWindow(nativeTag, callback);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
// Fall through to fail.
|
|
58
|
+
}
|
|
59
|
+
fail();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Build an `AnchorHost`-compatible `measureInWindow` bound to a host fiber.
|
|
64
|
+
*/
|
|
65
|
+
export function createFiberMeasureInWindow(fiber) {
|
|
66
|
+
return callback => {
|
|
67
|
+
measureHostFiber(fiber, callback);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=measureHostFiber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UIManager","getStateNode","measureHostFiber","fiber","callback","fail","stateNode","node","measureInWindow","fabricNode","fabricUIManager","globalThis","nativeFabricUIManager","publicInstance","canonical","nativeTag","_nativeTag","__nativeTag","Number","isFinite","createFiberMeasureInWindow"],"sourceRoot":"../../../../src","sources":["anchors/fiber/measureHostFiber.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,cAAc;AAGxC,SAASC,YAAY,QAAQ,qBAAkB;AAI/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAAe,EAAEC,QAAiC,EAAQ;EACzF,MAAMC,IAAI,GAAGA,CAAA,KAAY;IACvBD,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACtB,CAAC;EAED,IAAI,CAACD,KAAK,EAAE;IACVE,IAAI,CAAC,CAAC;IACN;EACF;EAEA,IAAI;IACF,MAAMC,SAAS,GAAGL,YAAY,CAACE,KAAK,CAAC;IACrC,IAAI,CAACG,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;MAC/CD,I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
|
4
|
+
* Restricts anchor scanning to the screens a user can actually see.
|
|
5
|
+
*
|
|
6
|
+
* A navigator keeps earlier screens mounted, so without this a tooltip could
|
|
7
|
+
* anchor to a view on a covered screen — measured on device: with a screen
|
|
8
|
+
* pushed on top, an anchor on the screen underneath still resolved and measured
|
|
9
|
+
* to an on-screen rect. Reusing one `testID` across two stacked screens also
|
|
10
|
+
* degraded to `ambiguous` and failed closed, even though only one was visible.
|
|
11
|
+
*
|
|
12
|
+
* Rules, derived from what react-native-screens actually exposes:
|
|
13
|
+
*
|
|
14
|
+
* - Native stack (`RNSScreenStack`): every mounted screen reports
|
|
15
|
+
* `activityState === 2`, so it is useless as a discriminator. Sibling order
|
|
16
|
+
* is what matters — the **last** branch owning a screen is on top.
|
|
17
|
+
* - Container-style navigators (tabs, non-native stacks) do vary
|
|
18
|
+
* `activityState`, so the active branches win. When every branch is active
|
|
19
|
+
* (e.g. multi-pane), all stay scannable — we must not fall back to
|
|
20
|
+
* last-sibling there, or visible panes get pruned.
|
|
21
|
+
*
|
|
22
|
+
* Branches that own no screen at all (tab bars, headers, other global chrome)
|
|
23
|
+
* are always kept, so anchors outside the screen stack keep resolving.
|
|
24
|
+
*
|
|
25
|
+
* Everything is feature-detected: an app without react-native-screens, or a
|
|
26
|
+
* renamed native component, prunes nothing and behaves as before.
|
|
27
|
+
*/
|
|
28
|
+
import { MAX_ANCESTOR_WALK, getAlternate, getChild, getHostTypeName, getMemoizedProps, getReturn, getSibling } from "./fiberInternals.js";
|
|
29
|
+
|
|
30
|
+
/** Host screen types (push screens and iOS modal presentations). */
|
|
31
|
+
const SCREEN_TYPES = new Set(['RNSScreen', 'RNSModalScreen']);
|
|
32
|
+
|
|
33
|
+
/** Host components that own a set of sibling screen branches. */
|
|
34
|
+
const SCREEN_CONTAINER_TYPES = new Set(['RNSScreenStack', 'RNSScreenContainer', 'RNSScreenNavigationContainer']);
|
|
35
|
+
|
|
36
|
+
/** Native stacks cannot use activityState; last sibling branch is on top. */
|
|
37
|
+
const STACK_CONTAINER_TYPES = new Set(['RNSScreenStack']);
|
|
38
|
+
|
|
39
|
+
/** `activityState === 2` is react-native-screens' "on screen" value. */
|
|
40
|
+
const ACTIVITY_STATE_ACTIVE = 2;
|
|
41
|
+
|
|
42
|
+
/** Bound for the per-branch search for the screen it owns. */
|
|
43
|
+
const MAX_BRANCH_NODES = 400;
|
|
44
|
+
export function isScreenContainerFiber(fiber) {
|
|
45
|
+
const type = getHostTypeName(fiber);
|
|
46
|
+
return type !== undefined && SCREEN_CONTAINER_TYPES.has(type);
|
|
47
|
+
}
|
|
48
|
+
function isScreenFiber(fiber) {
|
|
49
|
+
const type = getHostTypeName(fiber);
|
|
50
|
+
return type !== undefined && SCREEN_TYPES.has(type);
|
|
51
|
+
}
|
|
52
|
+
function isStackContainer(fiber) {
|
|
53
|
+
const type = getHostTypeName(fiber);
|
|
54
|
+
return type !== undefined && STACK_CONTAINER_TYPES.has(type);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Nearest screen under `branch`, not crossing into a nested container. */
|
|
58
|
+
function ownedScreen(branch) {
|
|
59
|
+
const stack = [branch];
|
|
60
|
+
let visited = 0;
|
|
61
|
+
while (stack.length > 0 && visited < MAX_BRANCH_NODES) {
|
|
62
|
+
const fiber = stack.pop();
|
|
63
|
+
if (!fiber) continue;
|
|
64
|
+
visited += 1;
|
|
65
|
+
if (isScreenFiber(fiber)) return fiber;
|
|
66
|
+
// A nested container's screens belong to that container, not this branch.
|
|
67
|
+
// Still follow siblings so a screen next to a nested navigator is found.
|
|
68
|
+
if (fiber !== branch && isScreenContainerFiber(fiber)) {
|
|
69
|
+
const sibling = getSibling(fiber);
|
|
70
|
+
if (sibling) stack.push(sibling);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const child = getChild(fiber);
|
|
74
|
+
if (child) stack.push(child);
|
|
75
|
+
if (fiber !== branch) {
|
|
76
|
+
const sibling = getSibling(fiber);
|
|
77
|
+
if (sibling) stack.push(sibling);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
function isActive(screen) {
|
|
83
|
+
return getMemoizedProps(screen)?.activityState === ACTIVITY_STATE_ACTIVE;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Branches of `container` that are covered by another screen and so must not be
|
|
88
|
+
* scanned. Empty when there is nothing to prune. Alternates are included so a
|
|
89
|
+
* fiber captured on a previous render still matches.
|
|
90
|
+
*/
|
|
91
|
+
export function coveredScreenBranches(container) {
|
|
92
|
+
const branches = [];
|
|
93
|
+
let child = getChild(container);
|
|
94
|
+
let guard = 0;
|
|
95
|
+
while (child && guard < 200) {
|
|
96
|
+
const screen = ownedScreen(child);
|
|
97
|
+
if (screen) branches.push({
|
|
98
|
+
branch: child,
|
|
99
|
+
screen
|
|
100
|
+
});
|
|
101
|
+
child = getSibling(child);
|
|
102
|
+
guard += 1;
|
|
103
|
+
}
|
|
104
|
+
const covered = new Set();
|
|
105
|
+
if (branches.length <= 1) return covered;
|
|
106
|
+
let visible;
|
|
107
|
+
if (isStackContainer(container)) {
|
|
108
|
+
// Native stack: activityState is always 2 for mounted screens; last branch
|
|
109
|
+
// owns the top of the stack (including an iOS RNSModalScreen presentation).
|
|
110
|
+
visible = [branches[branches.length - 1]];
|
|
111
|
+
} else {
|
|
112
|
+
const active = branches.filter(entry => isActive(entry.screen));
|
|
113
|
+
// Keep every active pane (tabs + multi-visible). If none report active
|
|
114
|
+
// (transition), fall back to last sibling rather than pruning everything.
|
|
115
|
+
visible = active.length > 0 ? active : [branches[branches.length - 1]];
|
|
116
|
+
}
|
|
117
|
+
for (const entry of branches) {
|
|
118
|
+
if (visible.includes(entry)) continue;
|
|
119
|
+
covered.add(entry.branch);
|
|
120
|
+
const alternate = entry.branch.alternate;
|
|
121
|
+
if (alternate) covered.add(alternate);
|
|
122
|
+
}
|
|
123
|
+
return covered;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Whether `fiber` lives on a screen the user can currently see.
|
|
128
|
+
*
|
|
129
|
+
* Needed in addition to scan-time pruning: a resolved anchor is cached, and the
|
|
130
|
+
* cache would otherwise keep serving a host after its screen was covered by a
|
|
131
|
+
* newly pushed one. Walks outward so nested navigators are handled.
|
|
132
|
+
*/
|
|
133
|
+
export function isFiberOnVisibleScreen(fiber) {
|
|
134
|
+
if (!fiber) return false;
|
|
135
|
+
try {
|
|
136
|
+
let previous = null;
|
|
137
|
+
let current = fiber;
|
|
138
|
+
for (let depth = 0; current && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
139
|
+
if (previous) {
|
|
140
|
+
// A cached fiber's `return` chain can point at the previous render, whose
|
|
141
|
+
// container still lists the old branches — so consult both alternates.
|
|
142
|
+
for (const container of [current, getAlternate(current)]) {
|
|
143
|
+
if (!container || !isScreenContainerFiber(container)) continue;
|
|
144
|
+
const covered = coveredScreenBranches(container);
|
|
145
|
+
if (covered.size === 0) continue;
|
|
146
|
+
if (covered.has(previous)) return false;
|
|
147
|
+
const previousAlternate = getAlternate(previous);
|
|
148
|
+
if (previousAlternate && covered.has(previousAlternate)) return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
previous = current;
|
|
152
|
+
current = getReturn(current);
|
|
153
|
+
}
|
|
154
|
+
} catch {
|
|
155
|
+
// Visibility is a refinement; never let it break resolution.
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=visibleScreens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_ANCESTOR_WALK","getAlternate","getChild","getHostTypeName","getMemoizedProps","getReturn","getSibling","SCREEN_TYPES","Set","SCREEN_CONTAINER_TYPES","STACK_CONTAINER_TYPES","ACTIVITY_STATE_ACTIVE","MAX_BRANCH_NODES","isScreenContainerFiber","fiber","type","undefined","has","isScreenFiber","isStackContainer","ownedScreen","branch","stack","visited","length","pop","sibling","push","child","isActive","screen","activityState","coveredScreenBranches","container","branches","guard","covered","visible","active","filter","entry","includes","add","alternate","isFiberOnVisibleScreen","previous","current","depth","size","previousAlternate"],"sourceRoot":"../../../../src","sources":["anchors/fiber/visibleScreens.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAEEA,iBAAiB,EACjBC,YAAY,EACZC,QAAQ,EACRC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,QACL,qBAAkB;;AAEzB;AACA,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;;AAE7D;AACA,MAAMC,sBAAsB,GAAG,IAAID,GAAG,CAAC,CACrC,gBAAgB,EAChB,oBAAoB,EACpB,8BAA8B,CAC/B,CAAC;;AAEF;AACA,MAAME,qBAAqB,GAAG,IAAIF,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC;;AAEzD;AACA,MAAMG,qBAAqB,GAAG,CAAC;;AAE/B;AACA,MAAMC,gBAAgB,GAAG,GAAG;AAE5B,OAAO,SAASC,sBAAsBA,CAACC,KAAe,EAAW;EAC/D,MAAMC,IAAI,GAAGZ,eAAe,CAACW,KAAK,CAAC;EACnC,OAAOC,IAAI,KAAKC,SAAS,IAAIP,sBAAsB,CAACQ,GAAG,CAACF,IAAI,CAAC;AAC/D;AAEA,SAASG,aAAaA,CAACJ,KAAe,EAAW;EAC/C,MAAMC,IAAI,GAAGZ,eAAe,CAACW,KAAK,CAAC;EACnC,OAAOC,IAAI,KAAKC,SAAS,IAAIT,YAAY,CAACU,GAAG,CAACF,IAAI,CAAC;AACrD;AAEA,SAASI,gBAAgBA,CAACL,KAAe,EAAW;EAClD,MAAMC,IAAI,GAAGZ,eAAe,CAACW,KAAK,CAAC;EACnC,OAAO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