@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,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { roleForKind } from "./AutoAnchorRegistry.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compact build-time hints wire format (v1) emitted by `@userflow-tech/babel-plugin`.
|
|
7
|
+
* Expanded once at register time so the auto-anchor registry still sees full paths.
|
|
8
|
+
*/
|
|
9
|
+
export const COMPACT_HINTS_VERSION = 1;
|
|
10
|
+
export function isCompactHints(value) {
|
|
11
|
+
return typeof value === 'object' && value !== null && value.v === COMPACT_HINTS_VERSION && typeof value.n === 'string' && typeof value.p === 'string';
|
|
12
|
+
}
|
|
13
|
+
export function isLegacyBuildTimeHints(value) {
|
|
14
|
+
return typeof value === 'object' && value !== null && typeof value.ufid === 'string' && typeof value.nativeId === 'string' && value.v !== COMPACT_HINTS_VERSION;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** True when the value is either compact v1 or legacy long-key hints. */
|
|
18
|
+
export function isHintsInput(value) {
|
|
19
|
+
return isCompactHints(value) || isLegacyBuildTimeHints(value);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Parse path segments after `module::Component > …` into ancestor descriptors
|
|
24
|
+
* (everything except the leaf). Matches Babel `formatSegment` output.
|
|
25
|
+
*/
|
|
26
|
+
export function parseAncestorsFromPath(path) {
|
|
27
|
+
const parts = path.split(' > ');
|
|
28
|
+
if (parts.length <= 1) return [];
|
|
29
|
+
const ancestorParts = parts.slice(1, -1);
|
|
30
|
+
const out = [];
|
|
31
|
+
for (const part of ancestorParts) {
|
|
32
|
+
const seg = parsePathSegment(part);
|
|
33
|
+
if (seg) out.push(seg);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
const SEGMENT_RE = /^([A-Za-z_][\w.]*)(?:\{(userflowId|testID|nativeID|key)=([^}]*)\}|#(\d+))?$/;
|
|
38
|
+
export function parsePathSegment(part) {
|
|
39
|
+
const m = SEGMENT_RE.exec(part.trim());
|
|
40
|
+
if (!m) return null;
|
|
41
|
+
const kind = m[1];
|
|
42
|
+
const role = roleForKind(kind);
|
|
43
|
+
const idKey = m[2];
|
|
44
|
+
const idVal = m[3];
|
|
45
|
+
const ordinalRaw = m[4];
|
|
46
|
+
const seg = {
|
|
47
|
+
kind,
|
|
48
|
+
role
|
|
49
|
+
};
|
|
50
|
+
if (idKey === 'userflowId' && idVal !== undefined) seg.userflowId = idVal;else if (idKey === 'testID' && idVal !== undefined) seg.testID = idVal;else if (idKey === 'nativeID' && idVal !== undefined) seg.nativeID = idVal;else if (idKey === 'key' && idVal !== undefined) seg.key = idVal;else if (ordinalRaw !== undefined) seg.ordinal = Number(ordinalRaw);
|
|
51
|
+
return seg;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Expand compact (or legacy) hints into the full `BuildTimeHints` shape used
|
|
56
|
+
* by AutoAnchorRegistry.
|
|
57
|
+
*/
|
|
58
|
+
export function expandBuildTimeHints(input, kind) {
|
|
59
|
+
if (isLegacyBuildTimeHints(input)) {
|
|
60
|
+
const role = input.role ?? (kind ? roleForKind(kind) : undefined);
|
|
61
|
+
return {
|
|
62
|
+
...input,
|
|
63
|
+
structuralPath: input.structuralPath ?? input.ufid,
|
|
64
|
+
templatePath: input.templatePath ?? input.ufid,
|
|
65
|
+
...(role ? {
|
|
66
|
+
role
|
|
67
|
+
} : {}),
|
|
68
|
+
ancestors: input.ancestors ?? parseAncestorsFromPath(input.structuralPath ?? input.ufid)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const path = input.p;
|
|
72
|
+
const role = kind ? roleForKind(kind) : undefined;
|
|
73
|
+
return {
|
|
74
|
+
ufid: path,
|
|
75
|
+
nativeId: input.n,
|
|
76
|
+
structuralPath: path,
|
|
77
|
+
templatePath: path,
|
|
78
|
+
...(input.ct !== undefined ? {
|
|
79
|
+
childText: input.ct
|
|
80
|
+
} : {}),
|
|
81
|
+
...(input.cs !== undefined ? {
|
|
82
|
+
childShape: input.cs
|
|
83
|
+
} : {}),
|
|
84
|
+
...(input.icn !== undefined ? {
|
|
85
|
+
iconName: input.icn
|
|
86
|
+
} : {}),
|
|
87
|
+
...(input.img !== undefined ? {
|
|
88
|
+
imageSrc: input.img
|
|
89
|
+
} : {}),
|
|
90
|
+
...(input.o !== undefined ? {
|
|
91
|
+
ordinal: input.o
|
|
92
|
+
} : {}),
|
|
93
|
+
...(input.si !== undefined ? {
|
|
94
|
+
siblingIndex: input.si
|
|
95
|
+
} : {}),
|
|
96
|
+
...(input.tid !== undefined ? {
|
|
97
|
+
literalTestId: input.tid
|
|
98
|
+
} : {}),
|
|
99
|
+
...(input.uid !== undefined ? {
|
|
100
|
+
literalUserflowId: input.uid
|
|
101
|
+
} : {}),
|
|
102
|
+
...(input.lid !== undefined ? {
|
|
103
|
+
literalLabel: input.lid
|
|
104
|
+
} : {}),
|
|
105
|
+
...(role ? {
|
|
106
|
+
role
|
|
107
|
+
} : {}),
|
|
108
|
+
ancestors: parseAncestorsFromPath(path)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=hintsCodec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["roleForKind","COMPACT_HINTS_VERSION","isCompactHints","value","v","n","p","isLegacyBuildTimeHints","ufid","nativeId","isHintsInput","parseAncestorsFromPath","path","parts","split","length","ancestorParts","slice","out","part","seg","parsePathSegment","push","SEGMENT_RE","m","exec","trim","kind","role","idKey","idVal","ordinalRaw","undefined","userflowId","testID","nativeID","key","ordinal","Number","expandBuildTimeHints","input","structuralPath","templatePath","ancestors","ct","childText","cs","childShape","icn","iconName","img","imageSrc","o","si","siblingIndex","tid","literalTestId","uid","literalUserflowId","lid","literalLabel"],"sourceRoot":"../../../src","sources":["anchors/hintsCodec.ts"],"mappings":";;AAEA,SAASA,WAAW,QAA6B,yBAAsB;;AAEvE;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAG,CAAU;AAqB/C,OAAO,SAASC,cAAcA,CAACC,KAAc,EAAkC;EAC7E,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACbA,KAAK,CAA2BC,CAAC,KAAKH,qBAAqB,IAC5D,OAAQE,KAAK,CAA2BE,CAAC,KAAK,QAAQ,IACtD,OAAQF,KAAK,CAA2BG,CAAC,KAAK,QAAQ;AAE1D;AAEA,OAAO,SAASC,sBAAsBA,CAACJ,KAAc,EAA2B;EAC9E,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACd,OAAQA,KAAK,CAAoBK,IAAI,KAAK,QAAQ,IAClD,OAAQL,KAAK,CAAoBM,QAAQ,KAAK,QAAQ,IACrDN,KAAK,CAA2BC,CAAC,KAAKH,qBAAqB;AAEhE;;AAEA;AACA,OAAO,SAASS,YAAYA,CAACP,KAAc,EAAuB;EAChE,OAAOD,cAAc,CAACC,KAAK,CAAC,IAAII,sBAAsB,CAACJ,KAAK,CAAC;AAC/D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASQ,sBAAsBA,CAACC,IAAY,EAAqB;EACtE,MAAMC,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|
|
4
|
+
import { fiberScanRoot } from "./fiber/FiberScanRoot.js";
|
|
5
|
+
import { isFiberMounted } from "./fiber/fiberInternals.js";
|
|
6
|
+
import { findAnchorFiber } from "./fiber/findAnchorFiber.js";
|
|
7
|
+
import { createFiberMeasureInWindow } from "./fiber/measureHostFiber.js";
|
|
8
|
+
import { isFiberOnVisibleScreen } from "./fiber/visibleScreens.js";
|
|
9
|
+
const fiberCache = new Map();
|
|
10
|
+
let currentScreenKey = null;
|
|
11
|
+
|
|
12
|
+
/** Invalidate fiber-resolved anchors when the active screen changes. */
|
|
13
|
+
export function notifyAnchorScreenChange(screenKey) {
|
|
14
|
+
if (screenKey === currentScreenKey) return;
|
|
15
|
+
currentScreenKey = screenKey;
|
|
16
|
+
fiberCache.clear();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Test helper — drop the fiber cache. */
|
|
20
|
+
export function clearFiberAnchorCache() {
|
|
21
|
+
fiberCache.clear();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Resolve a MANUAL anchor id to a measurable host.
|
|
26
|
+
*
|
|
27
|
+
* Tier 0: {@link anchorRegistry} (`useUserflowAnchor`) — higher priority, fails
|
|
28
|
+
* closed on ambiguous registry keys.
|
|
29
|
+
* Tier 1+: fiber scan for `testID`, then `nativeID`, then `accessibilityLabel`.
|
|
30
|
+
*
|
|
31
|
+
* Synchronous (the walk is pure JS; only measurement is async via the returned
|
|
32
|
+
* host). Caches the resolved fiber per id and revalidates cheaply before reuse.
|
|
33
|
+
*/
|
|
34
|
+
export function resolveAnchorHost(id) {
|
|
35
|
+
if (!id) return {
|
|
36
|
+
status: 'missing'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Tier 0 — explicit manual anchors win.
|
|
40
|
+
if (anchorRegistry.isAmbiguous(id)) {
|
|
41
|
+
return {
|
|
42
|
+
status: 'ambiguous'
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const registered = anchorRegistry.get(id);
|
|
46
|
+
if (registered) {
|
|
47
|
+
return {
|
|
48
|
+
status: 'found',
|
|
49
|
+
host: registered
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Cached fiber still mounted, on the same screen, and not covered by a screen
|
|
54
|
+
// pushed on top since it was cached?
|
|
55
|
+
const cached = fiberCache.get(id);
|
|
56
|
+
if (cached && cached.screenKey === currentScreenKey && isFiberMounted(cached.fiber) && isFiberOnVisibleScreen(cached.fiber)) {
|
|
57
|
+
return {
|
|
58
|
+
status: 'found',
|
|
59
|
+
host: {
|
|
60
|
+
measureInWindow: createFiberMeasureInWindow(cached.fiber)
|
|
61
|
+
},
|
|
62
|
+
fiber: cached.fiber
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (cached) {
|
|
66
|
+
fiberCache.delete(id);
|
|
67
|
+
}
|
|
68
|
+
const root = fiberScanRoot.getFiber();
|
|
69
|
+
if (!root) {
|
|
70
|
+
return {
|
|
71
|
+
status: 'missing'
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const result = findAnchorFiber(root, id);
|
|
75
|
+
if (result.status === 'ambiguous') {
|
|
76
|
+
return {
|
|
77
|
+
status: 'ambiguous'
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (result.status === 'missing') {
|
|
81
|
+
return {
|
|
82
|
+
status: 'missing'
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
fiberCache.set(id, {
|
|
86
|
+
fiber: result.fiber,
|
|
87
|
+
screenKey: currentScreenKey
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
status: 'found',
|
|
91
|
+
host: {
|
|
92
|
+
measureInWindow: createFiberMeasureInWindow(result.fiber)
|
|
93
|
+
},
|
|
94
|
+
fiber: result.fiber
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Drop a cached fiber entry after a zero-size measure so the next resolve
|
|
100
|
+
* re-scans (the host may have remounted under a new fiber).
|
|
101
|
+
*/
|
|
102
|
+
export function invalidateFiberAnchor(id) {
|
|
103
|
+
fiberCache.delete(id);
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=resolveAnchorHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["anchorRegistry","fiberScanRoot","isFiberMounted","findAnchorFiber","createFiberMeasureInWindow","isFiberOnVisibleScreen","fiberCache","Map","currentScreenKey","notifyAnchorScreenChange","screenKey","clear","clearFiberAnchorCache","resolveAnchorHost","id","status","isAmbiguous","registered","get","host","cached","fiber","measureInWindow","delete","root","getFiber","result","set","invalidateFiberAnchor"],"sourceRoot":"../../../src","sources":["anchors/resolveAnchorHost.ts"],"mappings":";;AAAA,SAA0BA,cAAc,QAAQ,qBAAkB;AAClE,SAASC,aAAa,QAAQ,0BAAuB;AAErD,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,eAAe,QAAQ,4BAAyB;AACzD,SAASC,0BAA0B,QAAQ,6BAA0B;AACrE,SAASC,sBAAsB,QAAQ,2BAAwB;AAY/D,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA0B,CAAC;AACrD,IAAIC,gBAA+B,GAAG,IAAI;;AAE1C;AACA,OAAO,SAASC,wBAAwBA,CAACC,SAAwB,EAAQ;EACvE,IAAIA,SAAS,KAAKF,gBAAgB,EAAE;EACpCA,gBAAgB,GAAGE,SAAS;EAC5BJ,UAAU,CAACK,KAAK,CAAC,CAAC;AACpB;;AAEA;AACA,OAAO,SAASC,qBAAqBA,CAAA,EAAS;EAC5CN,UAAU,CAACK,KAAK,CAAC,CAAC;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiBA,CAACC,EAAU,EAAoB;EAC9D,IAAI,CAACA,EAAE,EAAE,OAAO;IAAEC,MAAM,EAAE;EAAU,CAAC;;EAErC;EACA,IAAIf,cAAc,CAACgB,WA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CAAC;EACxE,OAAO;IACLO,MAAM,EAAE,OAAO;IACfI,IAAI,EAAE;MAAEG,eAAe,EAAElB,0BAA0B,CAACsB,MAAM,CAACL,KAAK;IAAE,CAAC;IACnEA,KAAK,EAAEK,MAAM,CAACL;EAChB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASO,qBAAqBA,CAACd,EAAU,EAAQ;EACtDR,UAAU,CAACiB,MAAM,CAACT,EAAE,CAAC;AACvB","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a manual tooltip target id from `FlowSelectorFragment.css`.
|
|
5
|
+
* Web MANUAL fixtures use `#save-button`; strip a leading `#`.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveManualAnchorId(css) {
|
|
8
|
+
if (css == null) return null;
|
|
9
|
+
const trimmed = css.trim();
|
|
10
|
+
if (!trimmed) return null;
|
|
11
|
+
return trimmed.startsWith('#') ? trimmed.slice(1) : trimmed;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=resolveManualAnchorId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveManualAnchorId","css","trimmed","trim","startsWith","slice"],"sourceRoot":"../../../src","sources":["anchors/resolveManualAnchorId.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,SAASA,qBAAqBA,CAACC,GAA8B,EAAiB;EACnF,IAAIA,GAAG,IAAI,IAAI,EAAE,OAAO,IAAI;EAC5B,MAAMC,OAAO,GAAGD,GAAG,CAACE,IAAI,CAAC,CAAC;EAC1B,IAAI,CAACD,OAAO,EAAE,OAAO,IAAI;EACzB,OAAOA,OAAO,CAACE,UAAU,CAAC,GAAG,CAAC,GAAGF,OAAO,CAACG,KAAK,CAAC,CAAC,CAAC,GAAGH,OAAO;AAC7D","ignoreList":[]}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Scroll a tooltip anchor into view by walking fiber scroll ancestors
|
|
5
|
+
* (or an explicit scroll-container registry override).
|
|
6
|
+
*
|
|
7
|
+
* Content offset is derived from two `measureInWindow` calls — container
|
|
8
|
+
* origin minus content origin — so the host app does not need to wire
|
|
9
|
+
* `onScroll`. Semantics match web `scrollIntoView({ block: 'nearest' })`:
|
|
10
|
+
* the minimal delta that brings the padded target fully inside the viewport.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { scrollContainerRegistry } from "./ScrollContainerRegistry.js";
|
|
14
|
+
import { findScrollAncestors } from "./fiber/findScrollAncestors.js";
|
|
15
|
+
import { measureHostFiber } from "./fiber/measureHostFiber.js";
|
|
16
|
+
import { getCustomScrollIntoView, getScrollPadding } from "./scrollConfig.js";
|
|
17
|
+
|
|
18
|
+
/** Padding applied inside a scroll container when bringing a target into view. */
|
|
19
|
+
const INTO_VIEW_PADDING = 24;
|
|
20
|
+
/**
|
|
21
|
+
* Best-effort scroll so `opts.rect` becomes fully visible.
|
|
22
|
+
*
|
|
23
|
+
* Order:
|
|
24
|
+
* 1. `setCustomScrollIntoView` override (replaces everything)
|
|
25
|
+
* 2. Explicit `useUserflowScrollContainer` registry (opt-in override)
|
|
26
|
+
* 3. Fiber scroll-ancestor walk (automatic for testID anchors)
|
|
27
|
+
* 4. `host.scrollIntoView` (RN Web / DOM)
|
|
28
|
+
*
|
|
29
|
+
* Returns `true` when at least one scroll was attempted.
|
|
30
|
+
*/
|
|
31
|
+
export function scrollAnchorIntoView(opts) {
|
|
32
|
+
const {
|
|
33
|
+
rect,
|
|
34
|
+
host,
|
|
35
|
+
fiber
|
|
36
|
+
} = opts;
|
|
37
|
+
const custom = getCustomScrollIntoView();
|
|
38
|
+
if (custom) {
|
|
39
|
+
try {
|
|
40
|
+
custom({
|
|
41
|
+
rect,
|
|
42
|
+
measureInWindow: host.measureInWindow.bind(host)
|
|
43
|
+
});
|
|
44
|
+
} catch {
|
|
45
|
+
// Best-effort.
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
let attempted = false;
|
|
50
|
+
|
|
51
|
+
// Explicit registry wins over the fiber walk (mirrors anchorRegistry vs scan).
|
|
52
|
+
if (scrollContainerRegistry.list().length > 0) {
|
|
53
|
+
try {
|
|
54
|
+
scrollContainerRegistry.scrollTargetIntoView(rect);
|
|
55
|
+
attempted = true;
|
|
56
|
+
} catch {
|
|
57
|
+
// Fall through.
|
|
58
|
+
}
|
|
59
|
+
} else if (fiber) {
|
|
60
|
+
attempted = scrollFiberAncestors(fiber, rect) || attempted;
|
|
61
|
+
}
|
|
62
|
+
if (typeof host.scrollIntoView === 'function') {
|
|
63
|
+
try {
|
|
64
|
+
host.scrollIntoView();
|
|
65
|
+
attempted = true;
|
|
66
|
+
} catch {
|
|
67
|
+
// Best-effort.
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return attempted;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Drive every scroll ancestor of `fiber`, innermost first, so nested
|
|
75
|
+
* scrollers compose correctly.
|
|
76
|
+
*/
|
|
77
|
+
export function scrollFiberAncestors(fiber, target) {
|
|
78
|
+
const ancestors = findScrollAncestors(fiber);
|
|
79
|
+
if (ancestors.length === 0) return false;
|
|
80
|
+
const padding = mergePadding(getScrollPadding());
|
|
81
|
+
let attempted = false;
|
|
82
|
+
for (const ancestor of ancestors) {
|
|
83
|
+
if (scrollOneAncestor(ancestor, target, padding)) {
|
|
84
|
+
attempted = true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return attempted;
|
|
88
|
+
}
|
|
89
|
+
function mergePadding(configured) {
|
|
90
|
+
return {
|
|
91
|
+
top: (configured?.top ?? 0) + INTO_VIEW_PADDING,
|
|
92
|
+
right: (configured?.right ?? 0) + INTO_VIEW_PADDING,
|
|
93
|
+
bottom: (configured?.bottom ?? 0) + INTO_VIEW_PADDING,
|
|
94
|
+
left: (configured?.left ?? 0) + INTO_VIEW_PADDING
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function scrollOneAncestor(ancestor, target, padding) {
|
|
98
|
+
const {
|
|
99
|
+
instance,
|
|
100
|
+
containerFiber,
|
|
101
|
+
contentFiber,
|
|
102
|
+
horizontal
|
|
103
|
+
} = ancestor;
|
|
104
|
+
|
|
105
|
+
// Need both fibers to derive offset from measure. Without them, try a
|
|
106
|
+
// best-effort scrollTo that assumes offset 0 (first paint / unmounted content).
|
|
107
|
+
if (!containerFiber) {
|
|
108
|
+
return scrollWithAssumedOffset(instance, target, padding, horizontal, {
|
|
109
|
+
x: 0,
|
|
110
|
+
y: 0
|
|
111
|
+
}, null);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// measureInWindow is async on Paper — fire-and-forget; callers treat a
|
|
115
|
+
// kicked-off measure as an attempted scroll.
|
|
116
|
+
measureHostFiber(containerFiber, (cx, cy, cw, ch) => {
|
|
117
|
+
if (cw <= 0 || ch <= 0) return;
|
|
118
|
+
const finish = (offsetX, offsetY) => {
|
|
119
|
+
scrollWithAssumedOffset(instance, target, padding, horizontal, {
|
|
120
|
+
x: Math.max(0, offsetX),
|
|
121
|
+
y: Math.max(0, offsetY)
|
|
122
|
+
}, {
|
|
123
|
+
x: cx,
|
|
124
|
+
y: cy,
|
|
125
|
+
width: cw,
|
|
126
|
+
height: ch
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
if (!contentFiber) {
|
|
130
|
+
finish(0, 0);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
measureHostFiber(contentFiber, (contentX, contentY) => {
|
|
134
|
+
// Content is translated up/left by the scroll offset.
|
|
135
|
+
const offsetY = cy - contentY;
|
|
136
|
+
const offsetX = cx - contentX;
|
|
137
|
+
finish(offsetX, offsetY);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
function scrollWithAssumedOffset(instance, target, padding, horizontal, offset, container) {
|
|
143
|
+
// Without a measured container, we can only nudge based on window-space
|
|
144
|
+
// heuristics via scrollToOffset-style APIs when the target is clearly
|
|
145
|
+
// off-screen relative to a zero origin — skip rather than guess badly.
|
|
146
|
+
if (!container) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
const targetContentY = offset.y + (target.y - container.y);
|
|
150
|
+
const targetContentX = offset.x + (target.x - container.x);
|
|
151
|
+
let nextY = null;
|
|
152
|
+
let nextX = null;
|
|
153
|
+
if (target.y < container.y + padding.top) {
|
|
154
|
+
nextY = Math.max(0, targetContentY - padding.top);
|
|
155
|
+
} else if (target.y + target.height > container.y + container.height - padding.bottom) {
|
|
156
|
+
nextY = Math.max(0, targetContentY + target.height - container.height + padding.bottom);
|
|
157
|
+
}
|
|
158
|
+
if (target.x < container.x + padding.left) {
|
|
159
|
+
nextX = Math.max(0, targetContentX - padding.left);
|
|
160
|
+
} else if (target.x + target.width > container.x + container.width - padding.right) {
|
|
161
|
+
nextX = Math.max(0, targetContentX + target.width - container.width + padding.right);
|
|
162
|
+
}
|
|
163
|
+
const yChanged = nextY != null && Math.abs(nextY - offset.y) >= 1;
|
|
164
|
+
const xChanged = nextX != null && Math.abs(nextX - offset.x) >= 1;
|
|
165
|
+
if (!yChanged && !xChanged) return false;
|
|
166
|
+
const y = yChanged ? nextY : offset.y;
|
|
167
|
+
const x = xChanged ? nextX : offset.x;
|
|
168
|
+
try {
|
|
169
|
+
if (typeof instance.scrollTo === 'function') {
|
|
170
|
+
instance.scrollTo({
|
|
171
|
+
x,
|
|
172
|
+
y,
|
|
173
|
+
animated: true
|
|
174
|
+
});
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
if (typeof instance.scrollToOffset === 'function') {
|
|
178
|
+
instance.scrollToOffset({
|
|
179
|
+
offset: horizontal ? x : y,
|
|
180
|
+
animated: true
|
|
181
|
+
});
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
// SectionList without a numeric offset path — cannot target by testID index.
|
|
185
|
+
} catch {
|
|
186
|
+
// Best-effort.
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Pure helper exported for unit tests: compute the next content offset that
|
|
193
|
+
* brings `target` fully inside `container` with `block: 'nearest'` semantics.
|
|
194
|
+
*/
|
|
195
|
+
export function computeNearestScrollOffset(opts) {
|
|
196
|
+
const padding = mergePadding(opts.padding ?? null);
|
|
197
|
+
const {
|
|
198
|
+
target,
|
|
199
|
+
container,
|
|
200
|
+
contentOffset
|
|
201
|
+
} = opts;
|
|
202
|
+
const targetContentY = contentOffset.y + (target.y - container.y);
|
|
203
|
+
const targetContentX = contentOffset.x + (target.x - container.x);
|
|
204
|
+
let nextY = contentOffset.y;
|
|
205
|
+
let nextX = contentOffset.x;
|
|
206
|
+
if (target.y < container.y + padding.top) {
|
|
207
|
+
nextY = Math.max(0, targetContentY - padding.top);
|
|
208
|
+
} else if (target.y + target.height > container.y + container.height - padding.bottom) {
|
|
209
|
+
nextY = Math.max(0, targetContentY + target.height - container.height + padding.bottom);
|
|
210
|
+
}
|
|
211
|
+
if (target.x < container.x + padding.left) {
|
|
212
|
+
nextX = Math.max(0, targetContentX - padding.left);
|
|
213
|
+
} else if (target.x + target.width > container.x + container.width - padding.right) {
|
|
214
|
+
nextX = Math.max(0, targetContentX + target.width - container.width + padding.right);
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
x: nextX,
|
|
218
|
+
y: nextY,
|
|
219
|
+
changed: Math.abs(nextX - contentOffset.x) >= 1 || Math.abs(nextY - contentOffset.y) >= 1
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=scrollAnchorIntoView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["scrollContainerRegistry","findScrollAncestors","measureHostFiber","getCustomScrollIntoView","getScrollPadding","INTO_VIEW_PADDING","scrollAnchorIntoView","opts","rect","host","fiber","custom","measureInWindow","bind","attempted","list","length","scrollTargetIntoView","scrollFiberAncestors","scrollIntoView","target","ancestors","padding","mergePadding","ancestor","scrollOneAncestor","configured","top","right","bottom","left","instance","containerFiber","contentFiber","horizontal","scrollWithAssumedOffset","x","y","cx","cy","cw","ch","finish","offsetX","offsetY","Math","max","width","height","contentX","contentY","offset","container","targetContentY","targetContentX","nextY","nextX","yChanged","abs","xChanged","scrollTo","animated","scrollToOffset","computeNearestScrollOffset","contentOffset","changed"],"sourceRoot":"../../../src","sources":["anchors/scrollAnchorIntoView.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASA,uBAAuB,QAAQ,8BAA2B;AAEnE,SAASC,mBAAmB,QAA6B,gCAA6B;AACtF,SAASC,gBAAgB,QAAQ,6BAA0B;AAC3D,SAASC,uBAAuB,EAAEC,gBAAgB,QAA4B,mBAAgB;;AAE9F;AACA,MAAMC,iBAAiB,GAAG,EAAE;AAc5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,IAAiC,EAAW;EAC/E,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGH,IAAI;EAElC,MAAMI,MAAM,GAAGR,uBAAuB,CAAC,CAAC;EACxC,IAAIQ,MAAM,EAAE;IACV,IAAI;MACFA,MAAM,CAAC;QAAEH,IAAI;QAAEI,eAAe,EAAEH,IAAI,CAACG,eAAe,CAACC,IAAI,CAACJ,IAAI;MAAE,CAAC,CAAC;IACpE,CAAC,CAAC,MAAM;MACN;IAAA;IAEF,OAAO,IAAI;EACb;EAEA,IAAIK,SAAS,GAAG,KAAK;;EAErB;EACA,IAAId,uBAAuB,CAACe,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;IAC7C,IAAI;MACFhB,uBAAuB,CAACiB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C,OAAO,CAACQ,IAAI,CAAC;EACpD,CAAC,MAAM,IAAIV,MAAM,CAACgB,CAAC,GAAGhB,MAAM,CAAC2B,KAAK,GAAGK,SAAS,CAAChB,CAAC,GAAGgB,SAAS,CAACL,KAAK,GAAGzB,OAAO,CAACM,KAAK,EAAE;IAClF4B,KAAK,GAAGX,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEQ,cAAc,GAAGlC,MAAM,CAAC2B,KAAK,GAAGK,SAAS,CAACL,KAAK,GAAGzB,OAAO,CAACM,KAAK,CAAC;EACtF;EAEA,OAAO;IACLQ,CAAC,EAAEoB,KAAK;IACRnB,CAAC,EAAEkB,KAAK;IACRU,OAAO,EAAEpB,IAAI,CAACa,GAAG,CAACF,KAAK,GAAGQ,aAAa,CAAC5B,CAAC,CAAC,IAAI,CAAC,IAAIS,IAAI,CAACa,GAAG,CAACH,KAAK,GAAGS,aAAa,CAAC3B,CAAC,CAAC,IAAI;EAC1F,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Integrator-level scroll configuration, mirroring web userflow.js
|
|
5
|
+
* `setScrollPadding` / `setCustomScrollIntoView`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Target passed to a custom scroll-into-view override. */
|
|
9
|
+
|
|
10
|
+
const config = {
|
|
11
|
+
scrollPadding: null,
|
|
12
|
+
customScrollIntoView: null
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Sticky header/footer insets applied when deciding whether / how far to scroll. */
|
|
16
|
+
export function setScrollPadding(padding) {
|
|
17
|
+
config.scrollPadding = padding ?? null;
|
|
18
|
+
}
|
|
19
|
+
export function getScrollPadding() {
|
|
20
|
+
return config.scrollPadding;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Replace the SDK's scroll-into-view behavior entirely. Useful for scroll
|
|
25
|
+
* libraries the fiber walk cannot drive (some FlashList / Reanimated setups).
|
|
26
|
+
* Pass `null` to restore the default.
|
|
27
|
+
*/
|
|
28
|
+
export function setCustomScrollIntoView(fn) {
|
|
29
|
+
config.customScrollIntoView = fn ?? null;
|
|
30
|
+
}
|
|
31
|
+
export function getCustomScrollIntoView() {
|
|
32
|
+
return config.customScrollIntoView;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Test helper — reset to defaults. */
|
|
36
|
+
export function resetScrollConfig() {
|
|
37
|
+
config.scrollPadding = null;
|
|
38
|
+
config.customScrollIntoView = null;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=scrollConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["config","scrollPadding","customScrollIntoView","setScrollPadding","padding","getScrollPadding","setCustomScrollIntoView","fn","getCustomScrollIntoView","resetScrollConfig"],"sourceRoot":"../../../src","sources":["anchors/scrollConfig.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAWA;;AAeA,MAAMA,MAAoB,GAAG;EAC3BC,aAAa,EAAE,IAAI;EACnBC,oBAAoB,EAAE;AACxB,CAAC;;AAED;AACA,OAAO,SAASC,gBAAgBA,CAACC,OAAyC,EAAQ;EAChFJ,MAAM,CAACC,aAAa,GAAGG,OAAO,IAAI,IAAI;AACxC;AAEA,OAAO,SAASC,gBAAgBA,CAAA,EAAyB;EACvD,OAAOL,MAAM,CAACC,aAAa;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,uBAAuBA,CAACC,EAA2C,EAAQ;EACzFP,MAAM,CAACE,oBAAoB,GAAGK,EAAE,IAAI,IAAI;AAC1C;AAEA,OAAO,SAASC,uBAAuBA,CAAA,EAAgC;EACrE,OAAOR,MAAM,CAACE,oBAAoB;AACpC;;AAEA;AACA,OAAO,SAASO,iBAAiBA,CAAA,EAAS;EACxCT,MAAM,CAACC,aAAa,GAAG,IAAI;EAC3BD,MAAM,CAACE,oBAAoB,GAAG,IAAI;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Active tooltip target-press subscription.
|
|
5
|
+
*
|
|
6
|
+
* {@link TooltipSurface} registers while a TOOLTIP step has a measured target,
|
|
7
|
+
* non-empty `actions`, and `tooltipTargetBlocked === false`. The bridge reads
|
|
8
|
+
* this at touch time so rAF measure updates do not re-render the provider.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Max finger travel (px) between start and end to count as a tap, not a scroll. */
|
|
12
|
+
export const TARGET_PRESS_TAP_SLOP = 10;
|
|
13
|
+
export function pointInRect(x, y, rect) {
|
|
14
|
+
return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* True when start and end both land in `rect` and movement stays within tap
|
|
18
|
+
* slop — mirrors a DOM click on the target without claiming the responder.
|
|
19
|
+
*/
|
|
20
|
+
export function isTargetTap(start, end, rect, slop = TARGET_PRESS_TAP_SLOP) {
|
|
21
|
+
if (!pointInRect(start.pageX, start.pageY, rect)) return false;
|
|
22
|
+
if (!pointInRect(end.pageX, end.pageY, rect)) return false;
|
|
23
|
+
const dx = end.pageX - start.pageX;
|
|
24
|
+
const dy = end.pageY - start.pageY;
|
|
25
|
+
return dx * dx + dy * dy <= slop * slop;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Module singleton for the active tooltip target-click listener.
|
|
30
|
+
* At most one subscription (one visible tooltip step).
|
|
31
|
+
*
|
|
32
|
+
* In-progress touches are keyed by native `identifier` so multi-touch start/end
|
|
33
|
+
* pairs correctly when several fingers are down. RN types `identifier` as
|
|
34
|
+
* `string`; accept `number | string` for tests and older typings.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export class TargetPressMonitor {
|
|
38
|
+
subscription = null;
|
|
39
|
+
touchStarts = new Map();
|
|
40
|
+
set(subscription) {
|
|
41
|
+
this.subscription = subscription;
|
|
42
|
+
if (!subscription) {
|
|
43
|
+
this.touchStarts.clear();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
clear() {
|
|
47
|
+
this.set(null);
|
|
48
|
+
}
|
|
49
|
+
get() {
|
|
50
|
+
return this.subscription;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Record touch start for `identifier`; ignores when no active subscription. */
|
|
54
|
+
handleTouchStart(identifier, pageX, pageY) {
|
|
55
|
+
if (!this.subscription) {
|
|
56
|
+
this.touchStarts.clear();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.touchStarts.set(identifier, {
|
|
60
|
+
pageX,
|
|
61
|
+
pageY
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* If the gesture for `identifier` is a tap on the registered target, invoke
|
|
67
|
+
* `onPress`. Never claims the responder — app controls still receive the press.
|
|
68
|
+
*/
|
|
69
|
+
handleTouchEnd(identifier, pageX, pageY) {
|
|
70
|
+
const start = this.touchStarts.get(identifier) ?? null;
|
|
71
|
+
this.touchStarts.delete(identifier);
|
|
72
|
+
const sub = this.subscription;
|
|
73
|
+
if (!start || !sub) return;
|
|
74
|
+
const rect = sub.getRect();
|
|
75
|
+
if (!rect || rect.width <= 0 || rect.height <= 0) return;
|
|
76
|
+
if (isTargetTap(start, {
|
|
77
|
+
pageX,
|
|
78
|
+
pageY
|
|
79
|
+
}, rect)) {
|
|
80
|
+
sub.onPress();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Drop in-progress gesture(s). With `identifier`, cancels that finger only;
|
|
86
|
+
* otherwise clears all (e.g. blanket `onTouchCancel`).
|
|
87
|
+
*/
|
|
88
|
+
cancelTouch(identifier) {
|
|
89
|
+
if (identifier == null) {
|
|
90
|
+
this.touchStarts.clear();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.touchStarts.delete(identifier);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Test helper. */
|
|
97
|
+
resetForTests() {
|
|
98
|
+
this.subscription = null;
|
|
99
|
+
this.touchStarts.clear();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Shared singleton used by TooltipSurface and TargetPressBridge. */
|
|
104
|
+
export const targetPressMonitor = new TargetPressMonitor();
|
|
105
|
+
//# sourceMappingURL=targetPressMonitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TARGET_PRESS_TAP_SLOP","pointInRect","x","y","rect","width","height","isTargetTap","start","end","slop","pageX","pageY","dx","dy","TargetPressMonitor","subscription","touchStarts","Map","set","clear","get","handleTouchStart","identifier","handleTouchEnd","delete","sub","getRect","onPress","cancelTouch","resetForTests","targetPressMonitor"],"sourceRoot":"../../../src","sources":["anchors/targetPressMonitor.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA,OAAO,MAAMA,qBAAqB,GAAG,EAAE;AAEvC,OAAO,SAASC,WAAWA,CAACC,CAAS,EAAEC,CAAS,EAAEC,IAAqB,EAAW;EAChF,OAAOF,CAAC,IAAIE,IAAI,CAACF,CAAC,IAAIA,CAAC,IAAIE,IAAI,CAACF,CAAC,GAAGE,IAAI,CAACC,KAAK,IAAIF,CAAC,IAAIC,IAAI,CAACD,CAAC,IAAIA,CAAC,IAAIC,IAAI,CAACD,CAAC,GAAGC,IAAI,CAACE,MAAM;AAC5F;AAOA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CACzBC,KAAiB,EACjBC,GAAe,EACfL,IAAqB,EACrBM,IAAY,GAAGV,qBAAqB,EAC3B;EACT,IAAI,CAACC,WAAW,CAACO,KAAK,CAACG,KAAK,EAAEH,KAAK,CAACI,KAAK,EAAER,IAAI,CAAC,EAAE,OAAO,KAAK;EAC9D,IA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