@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,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Multi-instance auto-anchor registry for Stage 3.
|
|
5
|
+
*
|
|
6
|
+
* Separate from {@link AnchorRegistry} (manual `useUserflowAnchor` / Tier 0).
|
|
7
|
+
* Each mounted host is a distinct instance indexed by registry key, template
|
|
8
|
+
* path, and developer ids so a later scored matcher can rank candidates.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Build-time descriptor stamped by `@userflow-tech/babel-plugin` (full or expanded compact). */
|
|
12
|
+
|
|
13
|
+
const PRESSABLE_KINDS = new Set(['Pressable', 'TouchableOpacity', 'TouchableHighlight', 'TouchableWithoutFeedback', 'TouchableNativeFeedback']);
|
|
14
|
+
export function roleForKind(kind) {
|
|
15
|
+
if (PRESSABLE_KINDS.has(kind)) return 'Action';
|
|
16
|
+
if (kind === 'Text') return 'Text';
|
|
17
|
+
if (kind === 'Image') return 'Image';
|
|
18
|
+
if (kind === 'TextInput' || kind === 'TextField') return 'Input';
|
|
19
|
+
if (kind === 'View' || kind === 'ScrollView' || kind === 'SafeAreaView') return 'Group';
|
|
20
|
+
return 'Other';
|
|
21
|
+
}
|
|
22
|
+
let nextInstanceSeq = 1;
|
|
23
|
+
function mintInstanceId() {
|
|
24
|
+
const id = `inst_${nextInstanceSeq.toString(36)}`;
|
|
25
|
+
nextInstanceSeq += 1;
|
|
26
|
+
return id;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Parent path for sibling grouping when `parentInstanceId` is unset (Babel stamps). */
|
|
30
|
+
function siblingGroupKey(inst) {
|
|
31
|
+
const path = inst.templatePath || inst.structuralPath;
|
|
32
|
+
const idx = path.lastIndexOf(' > ');
|
|
33
|
+
return idx === -1 ? path : path.slice(0, idx);
|
|
34
|
+
}
|
|
35
|
+
export class AutoAnchorRegistry {
|
|
36
|
+
instances = new Map();
|
|
37
|
+
byRegistryKey = new Map();
|
|
38
|
+
byManualId = new Map();
|
|
39
|
+
byTemplatePath = new Map();
|
|
40
|
+
listeners = new Set();
|
|
41
|
+
notifyScheduled = false;
|
|
42
|
+
registerInstance(input) {
|
|
43
|
+
const instanceId = mintInstanceId();
|
|
44
|
+
const hints = input.hints ?? undefined;
|
|
45
|
+
const kind = input.kind;
|
|
46
|
+
const role = hints?.role ?? roleForKind(kind);
|
|
47
|
+
const templatePath = hints?.templatePath ?? hints?.ufid ?? input.registryKey;
|
|
48
|
+
const structuralPath = hints?.structuralPath ?? hints?.ufid ?? templatePath;
|
|
49
|
+
const runtime = input.runtime ?? {};
|
|
50
|
+
const manualId = runtime.manualId ?? runtime.userflowId ?? hints?.literalUserflowId ?? runtime.testID ?? hints?.literalTestId ?? (runtime.nativeID && !runtime.nativeID.startsWith('uf_') ? runtime.nativeID : undefined);
|
|
51
|
+
const userflowId = runtime.userflowId ?? hints?.literalUserflowId;
|
|
52
|
+
const testID = runtime.testID ?? hints?.literalTestId;
|
|
53
|
+
const nativeID = runtime.nativeID ?? hints?.nativeId;
|
|
54
|
+
const childText = runtime.childText ?? hints?.childText;
|
|
55
|
+
const accessibilityLabel = runtime.accessibilityLabel ?? hints?.literalLabel;
|
|
56
|
+
const iconName = runtime.iconName ?? hints?.iconName;
|
|
57
|
+
const imageSrc = runtime.imageSrc ?? hints?.imageSrc;
|
|
58
|
+
const instance = {
|
|
59
|
+
instanceId,
|
|
60
|
+
registryKey: input.registryKey,
|
|
61
|
+
ref: input.ref,
|
|
62
|
+
kind,
|
|
63
|
+
role,
|
|
64
|
+
isPressable: PRESSABLE_KINDS.has(kind),
|
|
65
|
+
templatePath,
|
|
66
|
+
structuralPath,
|
|
67
|
+
...(input.instanceScope ? {
|
|
68
|
+
instanceScope: input.instanceScope
|
|
69
|
+
} : {}),
|
|
70
|
+
...(manualId ? {
|
|
71
|
+
manualId
|
|
72
|
+
} : {}),
|
|
73
|
+
...(userflowId ? {
|
|
74
|
+
userflowId
|
|
75
|
+
} : {}),
|
|
76
|
+
...(testID ? {
|
|
77
|
+
testID
|
|
78
|
+
} : {}),
|
|
79
|
+
...(nativeID ? {
|
|
80
|
+
nativeID
|
|
81
|
+
} : {}),
|
|
82
|
+
...(childText ? {
|
|
83
|
+
childText
|
|
84
|
+
} : {}),
|
|
85
|
+
...(accessibilityLabel ? {
|
|
86
|
+
accessibilityLabel
|
|
87
|
+
} : {}),
|
|
88
|
+
...(hints?.childShape ? {
|
|
89
|
+
childShape: hints.childShape
|
|
90
|
+
} : {}),
|
|
91
|
+
...(iconName ? {
|
|
92
|
+
iconName
|
|
93
|
+
} : {}),
|
|
94
|
+
...(imageSrc ? {
|
|
95
|
+
imageSrc
|
|
96
|
+
} : {}),
|
|
97
|
+
ancestors: hints?.ancestors ? [...hints.ancestors] : [],
|
|
98
|
+
...(hints?.ordinal !== undefined ? {
|
|
99
|
+
ordinal: hints.ordinal
|
|
100
|
+
} : {}),
|
|
101
|
+
...(hints?.siblingIndex !== undefined ? {
|
|
102
|
+
siblingIndex: hints.siblingIndex
|
|
103
|
+
} : {}),
|
|
104
|
+
...(input.parentInstanceId ? {
|
|
105
|
+
parentInstanceId: input.parentInstanceId
|
|
106
|
+
} : {}),
|
|
107
|
+
childInstanceIds: [],
|
|
108
|
+
ambiguous: false
|
|
109
|
+
};
|
|
110
|
+
this.instances.set(instanceId, instance);
|
|
111
|
+
this.addIndex(this.byRegistryKey, input.registryKey, instanceId);
|
|
112
|
+
this.addIndex(this.byTemplatePath, templatePath, instanceId);
|
|
113
|
+
if (manualId) this.addIndex(this.byManualId, manualId, instanceId);
|
|
114
|
+
if (instance.userflowId) this.addIndex(this.byManualId, instance.userflowId, instanceId);
|
|
115
|
+
if (instance.testID) this.addIndex(this.byManualId, instance.testID, instanceId);
|
|
116
|
+
if (input.parentInstanceId) {
|
|
117
|
+
const parent = this.instances.get(input.parentInstanceId);
|
|
118
|
+
if (parent) parent.childInstanceIds.push(instanceId);
|
|
119
|
+
}
|
|
120
|
+
this.recomputeAmbiguity(input.registryKey, templatePath, manualId);
|
|
121
|
+
this.notify();
|
|
122
|
+
return {
|
|
123
|
+
instanceId,
|
|
124
|
+
dispose: () => {
|
|
125
|
+
this.unregisterInstance(instanceId);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
updateInstance(instanceId, patch) {
|
|
130
|
+
const inst = this.instances.get(instanceId);
|
|
131
|
+
if (!inst) return;
|
|
132
|
+
const prevIds = {
|
|
133
|
+
manualId: inst.manualId,
|
|
134
|
+
userflowId: inst.userflowId,
|
|
135
|
+
testID: inst.testID
|
|
136
|
+
};
|
|
137
|
+
Object.assign(inst, patch);
|
|
138
|
+
if (patch.manualId !== undefined || patch.userflowId !== undefined || patch.testID !== undefined) {
|
|
139
|
+
const nextManual = patch.manualId ?? inst.userflowId ?? inst.testID ?? (inst.nativeID && !inst.nativeID.startsWith('uf_') ? inst.nativeID : undefined);
|
|
140
|
+
if (nextManual) inst.manualId = nextManual;else delete inst.manualId;
|
|
141
|
+
}
|
|
142
|
+
this.refreshManualIndexes(inst, prevIds);
|
|
143
|
+
this.recomputeAmbiguity(inst.registryKey, inst.templatePath, inst.manualId);
|
|
144
|
+
this.notify();
|
|
145
|
+
}
|
|
146
|
+
getInstance(instanceId) {
|
|
147
|
+
return this.instances.get(instanceId);
|
|
148
|
+
}
|
|
149
|
+
getInstancesByRegistryKey(key) {
|
|
150
|
+
return this.idsToInstances(this.byRegistryKey.get(key));
|
|
151
|
+
}
|
|
152
|
+
getInstancesByManualId(id) {
|
|
153
|
+
return this.idsToInstances(this.byManualId.get(id));
|
|
154
|
+
}
|
|
155
|
+
getInstancesByTemplatePath(path) {
|
|
156
|
+
return this.idsToInstances(this.byTemplatePath.get(path));
|
|
157
|
+
}
|
|
158
|
+
allInstances() {
|
|
159
|
+
return Array.from(this.instances.values());
|
|
160
|
+
}
|
|
161
|
+
orderedSiblingsIncludingSelf(instanceId) {
|
|
162
|
+
const inst = this.instances.get(instanceId);
|
|
163
|
+
if (!inst) return [];
|
|
164
|
+
if (!inst.parentInstanceId) {
|
|
165
|
+
const group = siblingGroupKey(inst);
|
|
166
|
+
return this.allInstances().filter(i => !i.parentInstanceId && siblingGroupKey(i) === group).sort((a, b) => (a.siblingIndex ?? 0) - (b.siblingIndex ?? 0));
|
|
167
|
+
}
|
|
168
|
+
const parent = this.instances.get(inst.parentInstanceId);
|
|
169
|
+
if (!parent) return [inst];
|
|
170
|
+
return parent.childInstanceIds.map(id => this.instances.get(id)).filter(i => !!i).sort((a, b) => (a.siblingIndex ?? 0) - (b.siblingIndex ?? 0));
|
|
171
|
+
}
|
|
172
|
+
siblingWindow(instanceId, windowSize = 2) {
|
|
173
|
+
const ordered = this.orderedSiblingsIncludingSelf(instanceId);
|
|
174
|
+
const idx = ordered.findIndex(i => i.instanceId === instanceId);
|
|
175
|
+
if (idx < 0) return {
|
|
176
|
+
previous: [],
|
|
177
|
+
next: []
|
|
178
|
+
};
|
|
179
|
+
const toDesc = i => ({
|
|
180
|
+
kind: i.kind,
|
|
181
|
+
role: i.role,
|
|
182
|
+
...(i.childText ? {
|
|
183
|
+
text: i.childText
|
|
184
|
+
} : {}),
|
|
185
|
+
...(i.testID ? {
|
|
186
|
+
testID: i.testID
|
|
187
|
+
} : {}),
|
|
188
|
+
...(i.userflowId ? {
|
|
189
|
+
userflowId: i.userflowId
|
|
190
|
+
} : {})
|
|
191
|
+
});
|
|
192
|
+
return {
|
|
193
|
+
previous: ordered.slice(Math.max(0, idx - windowSize), idx).map(toDesc),
|
|
194
|
+
next: ordered.slice(idx + 1, idx + 1 + windowSize).map(toDesc)
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
subscribe(listener) {
|
|
198
|
+
this.listeners.add(listener);
|
|
199
|
+
return () => {
|
|
200
|
+
this.listeners.delete(listener);
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
isAmbiguousKey(key) {
|
|
204
|
+
const byKey = this.getInstancesByRegistryKey(key);
|
|
205
|
+
if (byKey.length > 0) return byKey.some(i => i.ambiguous);
|
|
206
|
+
const byManual = this.getInstancesByManualId(key);
|
|
207
|
+
return byManual.length > 1 || byManual.some(i => i.ambiguous);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Test helper — drop every instance and reset ids. */
|
|
211
|
+
clear() {
|
|
212
|
+
this.instances.clear();
|
|
213
|
+
this.byRegistryKey.clear();
|
|
214
|
+
this.byManualId.clear();
|
|
215
|
+
this.byTemplatePath.clear();
|
|
216
|
+
this.notifyScheduled = false;
|
|
217
|
+
nextInstanceSeq = 1;
|
|
218
|
+
}
|
|
219
|
+
unregisterInstance(instanceId) {
|
|
220
|
+
const inst = this.instances.get(instanceId);
|
|
221
|
+
if (!inst) return;
|
|
222
|
+
if (inst.parentInstanceId) {
|
|
223
|
+
const parent = this.instances.get(inst.parentInstanceId);
|
|
224
|
+
if (parent) {
|
|
225
|
+
parent.childInstanceIds = parent.childInstanceIds.filter(id => id !== instanceId);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
for (const childId of [...inst.childInstanceIds]) {
|
|
229
|
+
const child = this.instances.get(childId);
|
|
230
|
+
if (child) delete child.parentInstanceId;
|
|
231
|
+
}
|
|
232
|
+
this.instances.delete(instanceId);
|
|
233
|
+
this.removeIndex(this.byRegistryKey, inst.registryKey, instanceId);
|
|
234
|
+
this.removeIndex(this.byTemplatePath, inst.templatePath, instanceId);
|
|
235
|
+
if (inst.manualId) this.removeIndex(this.byManualId, inst.manualId, instanceId);
|
|
236
|
+
if (inst.userflowId) this.removeIndex(this.byManualId, inst.userflowId, instanceId);
|
|
237
|
+
if (inst.testID) this.removeIndex(this.byManualId, inst.testID, instanceId);
|
|
238
|
+
this.recomputeAmbiguity(inst.registryKey, inst.templatePath, inst.manualId);
|
|
239
|
+
this.notify();
|
|
240
|
+
}
|
|
241
|
+
refreshManualIndexes(inst, prev) {
|
|
242
|
+
const prevKeys = new Set([prev.manualId, prev.userflowId, prev.testID].filter(k => !!k));
|
|
243
|
+
const nextKeys = new Set([inst.manualId, inst.userflowId, inst.testID].filter(k => !!k));
|
|
244
|
+
for (const key of prevKeys) {
|
|
245
|
+
if (!nextKeys.has(key)) this.removeIndex(this.byManualId, key, inst.instanceId);
|
|
246
|
+
}
|
|
247
|
+
for (const key of nextKeys) {
|
|
248
|
+
if (!prevKeys.has(key)) this.addIndex(this.byManualId, key, inst.instanceId);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
recomputeAmbiguity(registryKey, templatePath, manualId) {
|
|
252
|
+
const mark = list => {
|
|
253
|
+
const ambiguous = list.length > 1 && list.every(i => !i.manualId);
|
|
254
|
+
for (const i of list) {
|
|
255
|
+
i.ambiguous = ambiguous || (i.manualId ? this.getInstancesByManualId(i.manualId).length > 1 : false);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
mark(this.getInstancesByRegistryKey(registryKey));
|
|
259
|
+
mark(this.getInstancesByTemplatePath(templatePath));
|
|
260
|
+
if (manualId) {
|
|
261
|
+
const list = this.getInstancesByManualId(manualId);
|
|
262
|
+
for (const i of list) i.ambiguous = list.length > 1;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
addIndex(map, key, instanceId) {
|
|
266
|
+
let set = map.get(key);
|
|
267
|
+
if (!set) {
|
|
268
|
+
set = new Set();
|
|
269
|
+
map.set(key, set);
|
|
270
|
+
}
|
|
271
|
+
set.add(instanceId);
|
|
272
|
+
}
|
|
273
|
+
removeIndex(map, key, instanceId) {
|
|
274
|
+
const set = map.get(key);
|
|
275
|
+
if (!set) return;
|
|
276
|
+
set.delete(instanceId);
|
|
277
|
+
if (set.size === 0) map.delete(key);
|
|
278
|
+
}
|
|
279
|
+
idsToInstances(set) {
|
|
280
|
+
if (!set) return [];
|
|
281
|
+
const out = [];
|
|
282
|
+
for (const id of set) {
|
|
283
|
+
const inst = this.instances.get(id);
|
|
284
|
+
if (inst) out.push(inst);
|
|
285
|
+
}
|
|
286
|
+
return out;
|
|
287
|
+
}
|
|
288
|
+
notify() {
|
|
289
|
+
if (this.notifyScheduled) return;
|
|
290
|
+
this.notifyScheduled = true;
|
|
291
|
+
const flush = () => {
|
|
292
|
+
this.notifyScheduled = false;
|
|
293
|
+
for (const l of this.listeners) {
|
|
294
|
+
try {
|
|
295
|
+
l();
|
|
296
|
+
} catch {
|
|
297
|
+
// listeners are infrastructure; never propagate
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
if (typeof queueMicrotask === 'function') {
|
|
302
|
+
queueMicrotask(flush);
|
|
303
|
+
} else {
|
|
304
|
+
void Promise.resolve().then(flush);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
export const autoAnchorRegistry = new AutoAnchorRegistry();
|
|
309
|
+
//# sourceMappingURL=AutoAnchorRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PRESSABLE_KINDS","Set","roleForKind","kind","has","nextInstanceSeq","mintInstanceId","id","toString","siblingGroupKey","inst","path","templatePath","structuralPath","idx","lastIndexOf","slice","AutoAnchorRegistry","instances","Map","byRegistryKey","byManualId","byTemplatePath","listeners","notifyScheduled","registerInstance","input","instanceId","hints","undefined","role","ufid","registryKey","runtime","manualId","userflowId","literalUserflowId","testID","literalTestId","nativeID","startsWith","nativeId","childText","accessibilityLabel","literalLabel","iconName","imageSrc","instance","ref","isPressable","instanceScope","childShape","ancestors","ordinal","siblingIndex","parentInstanceId","childInstanceIds","ambiguous","set","addIndex","parent","get","push","recomputeAmbiguity","notify","dispose","unregisterInstance","updateInstance","patch","prevIds","Object","assign","nextManual","refreshManualIndexes","getInstance","getInstancesByRegistryKey","key","idsToInstances","getInstancesByManualId","getInstancesByTemplatePath","allInstances","Array","from","values","orderedSiblingsIncludingSelf","group","filter","i","sort","a","b","map","siblingWindow","windowSize","ordered","findIndex","previous","next","toDesc","text","Math","max","subscribe","listener","add","delete","isAmbiguousKey","byKey","length","some","byManual","clear","childId","child","removeIndex","prev","prevKeys","k","nextKeys","mark","list","every","size","out","flush","l","queueMicrotask","Promise","resolve","then","autoAnchorRegistry"],"sourceRoot":"../../../src","sources":["anchors/AutoAnchorRegistry.ts"],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;;AAoEA,MAAMA,eAAe,GAAG,IAAIC,GAAG,CAAS,CACtC,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,CAC1B,CAAC;AAEF,OAAO,SAASC,WAAWA,CAACC,IAAY,EAAgB;EACtD,IAAIH,eAAe,CAACI,GAAG,CAACD,IAAI,CAAC,EAAE,OAAO,QAAQ;EAC9C,IAAIA,IAAI,KAAK,MAAM,EAAE,OAAO,MAAM;EAClC,IAAIA,IAAI,KAAK,OAAO,EAAE,OAAO,OAAO;EACpC,IAAIA,IAAI,KAAK,WAAW,IAAIA,IAAI,KAAK,WAAW,EAAE,OAAO,OAAO;EAChE,IAAIA,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,YAAY,IAAIA,IAAI,KAAK,cAAc,EAAE,OAAO,OAAO;EACvF,OAAO,OAAO;AAChB;AAEA,IAAIE,eAAe,GAAG,CAAC;AAEvB,SAASC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H,EAAE,IAAImD,GAAG,EAAE;MACpB,MAAMhD,IAAI,GAAG,IAAI,CAACQ,SAAS,CAAC2C,GAAG,CAACtD,EAAE,CAAC;MACnC,IAAIG,IAAI,EAAEiH,GAAG,CAAC7D,IAAI,CAACpD,IAAI,CAAC;IAC1B;IACA,OAAOiH,GAAG;EACZ;EAEQ3D,MAAMA,CAAA,EAAS;IACrB,IAAI,IAAI,CAACxC,eAAe,EAAE;IAC1B,IAAI,CAACA,eAAe,GAAG,IAAI;IAC3B,MAAMoG,KAAK,GAAGA,CAAA,KAAM;MAClB,IAAI,CAACpG,eAAe,GAAG,KAAK;MAC5B,KAAK,MAAMqG,CAAC,IAAI,IAAI,CAACtG,SAAS,EAAE;QAC9B,IAAI;UACFsG,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,MAAM;UACN;QAAA;MAEJ;IACF,CAAC;IACD,IAAI,OAAOC,cAAc,KAAK,UAAU,EAAE;MACxCA,cAAc,CAACF,KAAK,CAAC;IACvB,CAAC,MAAM;MACL,KAAKG,OAAO,CAACC,OAAO,CAAC,CAAC,CAACC,IAAI,CAACL,KAAK,CAAC;IACpC;EACF;AACF;AAEA,OAAO,MAAMM,kBAAkB,GAAG,IAAIjH,kBAAkB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Padding applied when scrolling a target into the visible region of a container. */
|
|
4
|
+
const INTO_VIEW_PADDING = 24;
|
|
5
|
+
/**
|
|
6
|
+
* Registry of host {@link ScrollView}s used as an explicit override when
|
|
7
|
+
* scrolling tooltip anchors into view. Prefer automatic fiber discovery for
|
|
8
|
+
* `testID` anchors; register here for scroll libraries the walk cannot drive.
|
|
9
|
+
*/
|
|
10
|
+
export class ScrollContainerRegistry {
|
|
11
|
+
containers = new Set();
|
|
12
|
+
listeners = new Set();
|
|
13
|
+
register(host) {
|
|
14
|
+
this.containers.add(host);
|
|
15
|
+
this.emit();
|
|
16
|
+
}
|
|
17
|
+
unregister(host) {
|
|
18
|
+
this.containers.delete(host);
|
|
19
|
+
this.emit();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Snapshot of registered containers (most recently registered last). */
|
|
23
|
+
list() {
|
|
24
|
+
return [...this.containers];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Scroll the first registered container that can bring `target` into its
|
|
29
|
+
* visible window region. Best-effort — no-op when nothing is registered.
|
|
30
|
+
*/
|
|
31
|
+
scrollTargetIntoView(target) {
|
|
32
|
+
for (const host of this.containers) {
|
|
33
|
+
host.measureInWindow((x, y, width, height) => {
|
|
34
|
+
if (width <= 0 || height <= 0) return;
|
|
35
|
+
const offset = host.getContentOffset();
|
|
36
|
+
const targetContentY = offset.y + (target.y - y);
|
|
37
|
+
let nextY = null;
|
|
38
|
+
if (target.y < y + INTO_VIEW_PADDING) {
|
|
39
|
+
nextY = Math.max(0, targetContentY - INTO_VIEW_PADDING);
|
|
40
|
+
} else if (target.y + target.height > y + height - INTO_VIEW_PADDING) {
|
|
41
|
+
nextY = Math.max(0, targetContentY + target.height - height + INTO_VIEW_PADDING);
|
|
42
|
+
}
|
|
43
|
+
if (nextY == null || Math.abs(nextY - offset.y) < 1) return;
|
|
44
|
+
host.scrollTo({
|
|
45
|
+
y: nextY,
|
|
46
|
+
animated: true
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
// Prefer the first container for MVP; hosts typically have one root ScrollView.
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
subscribe(listener) {
|
|
54
|
+
this.listeners.add(listener);
|
|
55
|
+
return () => {
|
|
56
|
+
this.listeners.delete(listener);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
clear() {
|
|
60
|
+
this.containers.clear();
|
|
61
|
+
this.emit();
|
|
62
|
+
}
|
|
63
|
+
emit() {
|
|
64
|
+
for (const listener of this.listeners) {
|
|
65
|
+
listener();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Module singleton used by {@link useUserflowScrollContainer} and TooltipSurface. */
|
|
71
|
+
export const scrollContainerRegistry = new ScrollContainerRegistry();
|
|
72
|
+
|
|
73
|
+
/** Build a host from a live ScrollView + tracked content offset. */
|
|
74
|
+
export function createScrollContainerHost(node, getContentOffset) {
|
|
75
|
+
const measurable = node;
|
|
76
|
+
return {
|
|
77
|
+
measureInWindow: callback => {
|
|
78
|
+
measurable.measureInWindow(callback);
|
|
79
|
+
},
|
|
80
|
+
getContentOffset,
|
|
81
|
+
scrollTo: options => {
|
|
82
|
+
node.scrollTo(options);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=ScrollContainerRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["INTO_VIEW_PADDING","ScrollContainerRegistry","containers","Set","listeners","register","host","add","emit","unregister","delete","list","scrollTargetIntoView","target","measureInWindow","x","y","width","height","offset","getContentOffset","targetContentY","nextY","Math","max","abs","scrollTo","animated","subscribe","listener","clear","scrollContainerRegistry","createScrollContainerHost","node","measurable","callback","options"],"sourceRoot":"../../../src","sources":["anchors/ScrollContainerRegistry.ts"],"mappings":";;AAIA;AACA,MAAMA,iBAAiB,GAAG,EAAE;AAY5B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,CAAC;EAClBC,UAAU,GAAG,IAAIC,GAAG,CAAsB,CAAC;EAC3CC,SAAS,GAAG,IAAID,GAAG,CAAW,CAAC;EAEhDE,QAAQA,CAACC,IAAyB,EAAQ;IACxC,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACD,IAAI,CAAC;IACzB,IAAI,CAACE,IAAI,CAAC,CAAC;EACb;EAEAC,UAAUA,CAACH,IAAyB,EAAQ;IAC1C,IAAI,CAACJ,UAAU,CAACQ,MAAM,CAACJ,IAAI,CAAC;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;IACF;EACF;EAEAC,SAASA,CAACC,QAAkB,EAAc;IACxC,IAAI,CAACzB,SAAS,CAACG,GAAG,CAACsB,QAAQ,CAAC;IAC5B,OAAO,MAAM;MACX,IAAI,CAACzB,SAAS,CAACM,MAAM,CAACmB,QAAQ,CAAC;IACjC,CAAC;EACH;EAEAC,KAAKA,CAAA,EAAS;IACZ,IAAI,CAAC5B,UAAU,CAAC4B,KAAK,CAAC,CAAC;IACvB,IAAI,CAACtB,IAAI,CAAC,CAAC;EACb;EAEQA,IAAIA,CAAA,EAAS;IACnB,KAAK,MAAMqB,QAAQ,IAAI,IAAI,CAACzB,SAAS,EAAE;MACrCyB,QAAQ,CAAC,CAAC;IACZ;EACF;AACF;;AAEA;AACA,OAAO,MAAME,uBAAuB,GAAG,IAAI9B,uBAAuB,CAAC,CAAC;;AAEpE;AACA,OAAO,SAAS+B,yBAAyBA,CACvCC,IAAgB,EAChBb,gBAAgD,EAC3B;EACrB,MAAMc,UAAU,GAAGD,IAAyB;EAC5C,OAAO;IACLnB,eAAe,EAAGqB,QAAQ,IAAK;MAC7BD,UAAU,CAACpB,eAAe,CAACqB,QAAQ,CAAC;IACtC,CAAC;IACDf,gBAAgB;IAChBM,QAAQ,EAAGU,OAAO,IAAK;MACrBH,IAAI,CAACP,QAAQ,CAACU,OAAO,CAAC;IACxB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { anchorRegistry } from "./AnchorRegistry.js";
|
|
4
|
+
import { fiberScanRoot } from "./fiber/FiberScanRoot.js";
|
|
5
|
+
/**
|
|
6
|
+
* Change signal for ELEMENT client conditions.
|
|
7
|
+
*
|
|
8
|
+
* Fiber-resolved anchors (testID / nativeID / accessibilityLabel) do not emit
|
|
9
|
+
* registry events, so we combine:
|
|
10
|
+
* - {@link anchorRegistry} mount/unmount
|
|
11
|
+
* - {@link fiberScanRoot} mount/unmount
|
|
12
|
+
* - screen-change notifications
|
|
13
|
+
* - a slow interval that only runs while at least one listener is subscribed
|
|
14
|
+
*/
|
|
15
|
+
class AnchorChangeTicker {
|
|
16
|
+
listeners = new Set();
|
|
17
|
+
intervalHandle = null;
|
|
18
|
+
unsubRegistry = null;
|
|
19
|
+
unsubScan = null;
|
|
20
|
+
|
|
21
|
+
/** Poll interval while ELEMENT conditions are tracked (ms). */
|
|
22
|
+
static INTERVAL_MS = 1000;
|
|
23
|
+
subscribe(listener) {
|
|
24
|
+
const wasEmpty = this.listeners.size === 0;
|
|
25
|
+
this.listeners.add(listener);
|
|
26
|
+
if (wasEmpty) {
|
|
27
|
+
this.start();
|
|
28
|
+
}
|
|
29
|
+
return () => {
|
|
30
|
+
this.listeners.delete(listener);
|
|
31
|
+
if (this.listeners.size === 0) {
|
|
32
|
+
this.stop();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Push a change from outside (e.g. screen navigation). */
|
|
38
|
+
notify() {
|
|
39
|
+
this.emit();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Test helper. */
|
|
43
|
+
resetForTests() {
|
|
44
|
+
this.stop();
|
|
45
|
+
this.listeners.clear();
|
|
46
|
+
}
|
|
47
|
+
start() {
|
|
48
|
+
if (!this.unsubRegistry) {
|
|
49
|
+
this.unsubRegistry = anchorRegistry.subscribe(() => this.emit());
|
|
50
|
+
}
|
|
51
|
+
if (!this.unsubScan) {
|
|
52
|
+
this.unsubScan = fiberScanRoot.subscribe(() => this.emit());
|
|
53
|
+
}
|
|
54
|
+
if (!this.intervalHandle) {
|
|
55
|
+
this.intervalHandle = setInterval(() => this.emit(), AnchorChangeTicker.INTERVAL_MS);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
stop() {
|
|
59
|
+
if (this.intervalHandle) {
|
|
60
|
+
clearInterval(this.intervalHandle);
|
|
61
|
+
this.intervalHandle = null;
|
|
62
|
+
}
|
|
63
|
+
if (this.unsubRegistry) {
|
|
64
|
+
this.unsubRegistry();
|
|
65
|
+
this.unsubRegistry = null;
|
|
66
|
+
}
|
|
67
|
+
if (this.unsubScan) {
|
|
68
|
+
this.unsubScan();
|
|
69
|
+
this.unsubScan = null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
emit() {
|
|
73
|
+
for (const listener of this.listeners) {
|
|
74
|
+
listener();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export const anchorChangeTicker = new AnchorChangeTicker();
|
|
79
|
+
//# sourceMappingURL=anchorChangeTicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["anchorRegistry","fiberScanRoot","AnchorChangeTicker","listeners","Set","intervalHandle","unsubRegistry","unsubScan","INTERVAL_MS","subscribe","listener","wasEmpty","size","add","start","delete","stop","notify","emit","resetForTests","clear","setInterval","clearInterval","anchorChangeTicker"],"sourceRoot":"../../../src","sources":["anchors/anchorChangeTicker.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,aAAa,QAAQ,0BAAuB;AAIrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,CAAC;EACNC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;EACxCC,cAAc,GAA0C,IAAI;EAC5DC,aAAa,GAAwB,IAAI;EACzCC,SAAS,GAAwB,IAAI;;EAE7C;EACA,OAAgBC,WAAW,GAAG,IAAI;EAElCC,SAASA,CAACC,QAAkB,EAAc;IACxC,MAAMC,QAAQ,GAAG,IAAI,CAACR,SAAS,CAACS,IAAI,KAAK,CAAC;IAC1C,IAAI,CAACT,SAAS,CAACU,GAAG,CAACH,QAAQ,CAAC;IAC5B,IAAIC,QAAQ,EAAE;MACZ,IAAI,CAACG,KAAK,CAAC,CAAC;IACd;IACA,OAAO,MAAM;MACX,IAAI,CAACX,SAAS,CAACY,MAAM,CAACL,QAAQ,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AMR,QAAQ,IAAI,IAAI,CAACP,SAAS,EAAE;MACrCO,QAAQ,CAAC,CAAC;IACZ;EACF;AACF;AAEA,OAAO,MAAMa,kBAAkB,GAAG,IAAIrB,kBAAkB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared requestAnimationFrame hub so multiple surfaces never stack loops.
|
|
5
|
+
* Mirrors web userflowjs `util/animation-frame.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const callbacks = [];
|
|
9
|
+
let rafHandle = null;
|
|
10
|
+
let active = false;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `callback` runs on every animation frame. Starts the shared loop when the
|
|
14
|
+
* first subscriber attaches.
|
|
15
|
+
*/
|
|
16
|
+
export function addAnimationFrameCallback(callback) {
|
|
17
|
+
if (callbacks.includes(callback)) return;
|
|
18
|
+
callbacks.push(callback);
|
|
19
|
+
if (callbacks.length === 1) {
|
|
20
|
+
active = true;
|
|
21
|
+
requestNext();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Remove a previously added callback. Stops the loop when the last subscriber
|
|
27
|
+
* detaches.
|
|
28
|
+
*/
|
|
29
|
+
export function removeAnimationFrameCallback(callback) {
|
|
30
|
+
const idx = callbacks.indexOf(callback);
|
|
31
|
+
if (idx < 0) return;
|
|
32
|
+
callbacks.splice(idx, 1);
|
|
33
|
+
if (callbacks.length === 0) {
|
|
34
|
+
active = false;
|
|
35
|
+
cancelPending();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Test helper — drop all subscribers and cancel the pending frame. */
|
|
40
|
+
export function resetAnimationFrameForTests() {
|
|
41
|
+
callbacks.length = 0;
|
|
42
|
+
active = false;
|
|
43
|
+
cancelPending();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Test helper — number of active subscribers. */
|
|
47
|
+
export function animationFrameSubscriberCount() {
|
|
48
|
+
return callbacks.length;
|
|
49
|
+
}
|
|
50
|
+
function onAnimationFrame() {
|
|
51
|
+
rafHandle = null;
|
|
52
|
+
// Snapshot so a callback that unsubscribes mid-frame is safe.
|
|
53
|
+
const snapshot = callbacks.slice();
|
|
54
|
+
for (const callback of snapshot) {
|
|
55
|
+
try {
|
|
56
|
+
callback();
|
|
57
|
+
} catch {
|
|
58
|
+
// A single subscriber must not tear down the hub.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
requestNext();
|
|
62
|
+
}
|
|
63
|
+
function requestNext() {
|
|
64
|
+
if (!active) return;
|
|
65
|
+
const raf = typeof globalThis.requestAnimationFrame === 'function' ? globalThis.requestAnimationFrame.bind(globalThis) : null;
|
|
66
|
+
if (raf) {
|
|
67
|
+
rafHandle = raf(onAnimationFrame);
|
|
68
|
+
} else {
|
|
69
|
+
// Jest / environments without rAF — fall back to a short timer so tests
|
|
70
|
+
// and headless runs still drive the loop.
|
|
71
|
+
rafHandle = setTimeout(onAnimationFrame, 16);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function cancelPending() {
|
|
75
|
+
if (rafHandle == null) return;
|
|
76
|
+
if (typeof globalThis.cancelAnimationFrame === 'function' && typeof rafHandle === 'number') {
|
|
77
|
+
globalThis.cancelAnimationFrame(rafHandle);
|
|
78
|
+
} else {
|
|
79
|
+
clearTimeout(rafHandle);
|
|
80
|
+
}
|
|
81
|
+
rafHandle = null;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=animationFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["callbacks","rafHandle","active","addAnimationFrameCallback","callback","includes","push","length","requestNext","removeAnimationFrameCallback","idx","indexOf","splice","cancelPending","resetAnimationFrameForTests","animationFrameSubscriberCount","onAnimationFrame","snapshot","slice","raf","globalThis","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","clearTimeout"],"sourceRoot":"../../../src","sources":["anchors/animationFrame.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAIA,MAAMA,SAAqB,GAAG,EAAE;AAChC,IAAIC,SAAwD,GAAG,IAAI;AACnE,IAAIC,MAAM,GAAG,KAAK;;AAElB;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAACC,QAAkB,EAAQ;EAClE,IAAIJ,SAAS,CAACK,QAAQ,CAACD,QAAQ,CAAC,EAAE;EAClCJ,SAAS,CAACM,IAAI,CAACF,QAAQ,CAAC;EACxB,IAAIJ,SAAS,CAACO,MAAM,KAAK,CAAC,EAAE;IAC1BL,MAAM,GAAG,IAAI;IACbM,WAAW,CAAC,CAAC;EACf;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAACL,QAAkB,EAAQ;EACrE,MAAMM,GAAG,GAAGV,SAAS,CAACW,OAAO,CAACP,QAAQ,CAAC;EACvC,IAAIM,GAAG,GAAG,CAAC,EAAE;EACbV,SAAS,CAACY,MAAM,CAACF,GAAG,EAAE,CAAC,CAAC;EACxB,IAAIV,SAAS,CAACO,MAAM,KAAK,CAAC,EAAE;IAC1BL,MAAM,GAAG,KAAK;IACdW,aAAa,CAAC,CAAC;EACjB;AACF;;AAEA;AACA,OAAO,SAASC,2BAA2BA,CAAA,EAAS;EAClDd,SAAS,CAACO,MAAM,GAAG,CAAC;EACpBL,MAAM,GAAG,KAAK;EACdW,aAAa,CAAC,CAAC;AACjB;;AAEA;AACA,OAAO,SAASE,6BAA6BA,CAAA,EAAW;EACtD,OAAOf,SAAS,CAACO,MAAM;AACzB;AAEA,SAASS,gBAAgBA,CAAA,EAAS;EAChCf,SAAS,GAAG,IAAI;EAChB;EACA,MAAMgB,QAAQ,GAAGjB,SAAS,CAACkB,KAAK,CAAC,CAAC;EAClC,KAAK,MAAMd,QAAQ,IAAIa,QAAQ,EAAE;IAC/B,IAAI;MACFb,QAAQ,CAAC,CAAC;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