@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,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as ReactNS from 'react';
|
|
4
|
+
import { autoAnchorRegistry, roleForKind } from "./AutoAnchorRegistry.js";
|
|
5
|
+
import { expandBuildTimeHints, isHintsInput } from "./hintsCodec.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Runtime half of build-time auto-anchoring (see `@userflow-tech/babel-plugin`).
|
|
9
|
+
*
|
|
10
|
+
* Each mount creates a distinct AutoAnchorRegistry instance. Shared templates
|
|
11
|
+
* (design-system / list rows) register separately and are marked ambiguous
|
|
12
|
+
* when they lack a unique manual id or call-site scope.
|
|
13
|
+
*
|
|
14
|
+
* Canonical signature (what Babel emits via `__ufRef`):
|
|
15
|
+
* __userflowAutoAnchor(id, hints, userRef, kind, runtime?)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
function cacheKey(id, scope) {
|
|
19
|
+
return scope ? `${id}@@${scope}` : id;
|
|
20
|
+
}
|
|
21
|
+
const cache = new Map();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Legacy string refs (`ref="foo"`) assigned `owner.refs.foo` via React internals.
|
|
25
|
+
* Best-effort: modern React may not expose an owner; never throws into app code.
|
|
26
|
+
*/
|
|
27
|
+
function assignLegacyStringRef(name, instance) {
|
|
28
|
+
try {
|
|
29
|
+
const React = ReactNS;
|
|
30
|
+
const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE ?? React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
31
|
+
const owner = internals?.ReactCurrentOwner?.current;
|
|
32
|
+
if (!owner) return;
|
|
33
|
+
if (owner.refs == null) {
|
|
34
|
+
owner.refs = {};
|
|
35
|
+
}
|
|
36
|
+
if (instance) {
|
|
37
|
+
owner.refs[name] = instance;
|
|
38
|
+
} else {
|
|
39
|
+
delete owner.refs[name];
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
// String-ref owner unavailable — ignore rather than break the host.
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function attachUserRef(userRef, instance) {
|
|
46
|
+
if (userRef == null || userRef === '') return;
|
|
47
|
+
if (typeof userRef === 'string') {
|
|
48
|
+
assignLegacyStringRef(userRef, instance);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (typeof userRef === 'function') {
|
|
52
|
+
const result = userRef(instance);
|
|
53
|
+
if (typeof result === 'function') {
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
userRef.current = instance;
|
|
60
|
+
} catch {
|
|
61
|
+
// Read-only ref object — nothing to do.
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function detachUserRef(userRef, reg) {
|
|
65
|
+
if (reg.userRefCleanup) {
|
|
66
|
+
try {
|
|
67
|
+
reg.userRefCleanup();
|
|
68
|
+
} catch {
|
|
69
|
+
// App cleanup must not break unmount.
|
|
70
|
+
}
|
|
71
|
+
reg.userRefCleanup = null;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
attachUserRef(userRef, null);
|
|
75
|
+
}
|
|
76
|
+
function teardownRegistration(entry, reg) {
|
|
77
|
+
detachUserRef(entry.userRef, reg);
|
|
78
|
+
reg.dispose();
|
|
79
|
+
}
|
|
80
|
+
function isRefLike(value) {
|
|
81
|
+
return typeof value === 'function' || typeof value === 'object' && value !== null && 'current' in value;
|
|
82
|
+
}
|
|
83
|
+
function isUserRef(value) {
|
|
84
|
+
if (typeof value === 'string') return value.length > 0;
|
|
85
|
+
return isRefLike(value);
|
|
86
|
+
}
|
|
87
|
+
function isRuntime(value) {
|
|
88
|
+
return typeof value === 'object' && value !== null && !isRefLike(value) && !isHintsInput(value);
|
|
89
|
+
}
|
|
90
|
+
function resolveHints(raw, kind) {
|
|
91
|
+
if (raw == null) return raw;
|
|
92
|
+
return expandBuildTimeHints(raw, kind);
|
|
93
|
+
}
|
|
94
|
+
export function __userflowAutoAnchor(id, hintsOrUserRef, userRefOrKind, kindOrRuntime, maybeRuntime) {
|
|
95
|
+
let hints;
|
|
96
|
+
let userRef;
|
|
97
|
+
let elementKind;
|
|
98
|
+
let runtime;
|
|
99
|
+
if (isHintsInput(hintsOrUserRef)) {
|
|
100
|
+
userRef = isUserRef(userRefOrKind) ? userRefOrKind : null;
|
|
101
|
+
if (typeof kindOrRuntime === 'string') {
|
|
102
|
+
elementKind = kindOrRuntime;
|
|
103
|
+
runtime = maybeRuntime;
|
|
104
|
+
} else if (isRuntime(kindOrRuntime)) {
|
|
105
|
+
runtime = kindOrRuntime;
|
|
106
|
+
}
|
|
107
|
+
hints = resolveHints(hintsOrUserRef, elementKind);
|
|
108
|
+
} else {
|
|
109
|
+
hints = undefined;
|
|
110
|
+
userRef = isUserRef(hintsOrUserRef) ? hintsOrUserRef : null;
|
|
111
|
+
elementKind = typeof userRefOrKind === 'string' ? userRefOrKind : undefined;
|
|
112
|
+
if (isRuntime(kindOrRuntime)) runtime = kindOrRuntime;else if (maybeRuntime) runtime = maybeRuntime;
|
|
113
|
+
}
|
|
114
|
+
const resolvedId = typeof id === 'string' && id.length > 0 ? id : hints?.nativeId ?? hints?.ufid ?? 'uf_unknown';
|
|
115
|
+
const scope = runtime?.scope;
|
|
116
|
+
const key = cacheKey(resolvedId, scope);
|
|
117
|
+
const existing = cache.get(key);
|
|
118
|
+
if (existing) {
|
|
119
|
+
existing.userRef = userRef;
|
|
120
|
+
existing.hints = hints;
|
|
121
|
+
existing.kind = elementKind ?? existing.kind;
|
|
122
|
+
existing.runtime = runtime ?? existing.runtime;
|
|
123
|
+
if (existing.registrations.size === 1 && (hints || runtime)) {
|
|
124
|
+
const [reg] = existing.registrations.values();
|
|
125
|
+
const patch = {};
|
|
126
|
+
if (runtime?.childText !== undefined) patch.childText = runtime.childText;
|
|
127
|
+
if (runtime?.accessibilityLabel !== undefined) {
|
|
128
|
+
patch.accessibilityLabel = runtime.accessibilityLabel;
|
|
129
|
+
}
|
|
130
|
+
if (runtime?.scope) patch.instanceScope = runtime.scope;
|
|
131
|
+
if (runtime?.userflowId) patch.userflowId = runtime.userflowId;
|
|
132
|
+
if (runtime?.testID) patch.testID = runtime.testID;
|
|
133
|
+
if (runtime?.nativeID) patch.nativeID = runtime.nativeID;
|
|
134
|
+
if (runtime?.manualId || runtime?.userflowId || runtime?.testID) {
|
|
135
|
+
const mid = runtime.manualId ?? runtime.userflowId ?? runtime.testID ?? existing.runtime?.manualId;
|
|
136
|
+
if (mid) patch.manualId = mid;
|
|
137
|
+
}
|
|
138
|
+
autoAnchorRegistry.updateInstance(reg.instanceId, patch);
|
|
139
|
+
}
|
|
140
|
+
return existing.callback;
|
|
141
|
+
}
|
|
142
|
+
const entry = {
|
|
143
|
+
userRef,
|
|
144
|
+
hints,
|
|
145
|
+
kind: elementKind,
|
|
146
|
+
runtime,
|
|
147
|
+
registrations: new Map(),
|
|
148
|
+
callback: instance => {
|
|
149
|
+
if (instance) {
|
|
150
|
+
if (entry.registrations.has(instance)) return undefined;
|
|
151
|
+
const cleanup = attachUserRef(entry.userRef, instance);
|
|
152
|
+
const holder = {
|
|
153
|
+
current: instance
|
|
154
|
+
};
|
|
155
|
+
const kind = entry.kind ?? 'View';
|
|
156
|
+
const rt = entry.runtime;
|
|
157
|
+
const composedPath = rt?.scope && entry.hints?.templatePath ? `${rt.scope} :: ${entry.hints.templatePath}` : entry.hints?.structuralPath ?? entry.hints?.ufid;
|
|
158
|
+
const hintsForReg = entry.hints ? {
|
|
159
|
+
...entry.hints,
|
|
160
|
+
...(composedPath ? {
|
|
161
|
+
structuralPath: composedPath,
|
|
162
|
+
ufid: composedPath
|
|
163
|
+
} : {}),
|
|
164
|
+
role: entry.hints.role ?? roleForKind(kind)
|
|
165
|
+
} : {
|
|
166
|
+
ufid: resolvedId,
|
|
167
|
+
nativeId: resolvedId,
|
|
168
|
+
role: roleForKind(kind)
|
|
169
|
+
};
|
|
170
|
+
const {
|
|
171
|
+
instanceId,
|
|
172
|
+
dispose
|
|
173
|
+
} = autoAnchorRegistry.registerInstance({
|
|
174
|
+
registryKey: resolvedId,
|
|
175
|
+
ref: holder,
|
|
176
|
+
kind,
|
|
177
|
+
hints: hintsForReg,
|
|
178
|
+
...(rt?.scope ? {
|
|
179
|
+
instanceScope: rt.scope
|
|
180
|
+
} : {}),
|
|
181
|
+
runtime: {
|
|
182
|
+
...(rt?.manualId ? {
|
|
183
|
+
manualId: rt.manualId
|
|
184
|
+
} : {}),
|
|
185
|
+
...(rt?.userflowId ? {
|
|
186
|
+
userflowId: rt.userflowId
|
|
187
|
+
} : {}),
|
|
188
|
+
...(rt?.testID ? {
|
|
189
|
+
testID: rt.testID
|
|
190
|
+
} : {}),
|
|
191
|
+
...(rt?.nativeID ? {
|
|
192
|
+
nativeID: rt.nativeID
|
|
193
|
+
} : {}),
|
|
194
|
+
...(rt?.childText ? {
|
|
195
|
+
childText: rt.childText
|
|
196
|
+
} : {}),
|
|
197
|
+
...(rt?.accessibilityLabel ? {
|
|
198
|
+
accessibilityLabel: rt.accessibilityLabel
|
|
199
|
+
} : {}),
|
|
200
|
+
...(rt?.iconName ? {
|
|
201
|
+
iconName: rt.iconName
|
|
202
|
+
} : {}),
|
|
203
|
+
...(rt?.imageSrc ? {
|
|
204
|
+
imageSrc: rt.imageSrc
|
|
205
|
+
} : {}),
|
|
206
|
+
...(rt?.reactKey ? {
|
|
207
|
+
reactKey: rt.reactKey
|
|
208
|
+
} : {}),
|
|
209
|
+
...(!rt?.manualId && !rt?.userflowId && !rt?.testID && !resolvedId.startsWith('uf_') ? {
|
|
210
|
+
manualId: resolvedId
|
|
211
|
+
} : {})
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
const reg = {
|
|
215
|
+
holder,
|
|
216
|
+
instanceId,
|
|
217
|
+
dispose,
|
|
218
|
+
userRefCleanup: typeof cleanup === 'function' ? cleanup : null
|
|
219
|
+
};
|
|
220
|
+
entry.registrations.set(instance, reg);
|
|
221
|
+
return () => {
|
|
222
|
+
const r = entry.registrations.get(instance);
|
|
223
|
+
if (!r) return;
|
|
224
|
+
entry.registrations.delete(instance);
|
|
225
|
+
teardownRegistration(entry, r);
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const first = entry.registrations.keys().next();
|
|
229
|
+
if (!first.done) {
|
|
230
|
+
const inst = first.value;
|
|
231
|
+
const r = entry.registrations.get(inst);
|
|
232
|
+
entry.registrations.delete(inst);
|
|
233
|
+
teardownRegistration(entry, r);
|
|
234
|
+
}
|
|
235
|
+
return undefined;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
cache.set(key, entry);
|
|
239
|
+
return entry.callback;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Test helper — drop factory cache and registry instances. */
|
|
243
|
+
export function __resetAutoAnchorForTests() {
|
|
244
|
+
cache.clear();
|
|
245
|
+
autoAnchorRegistry.clear();
|
|
246
|
+
}
|
|
247
|
+
globalThis.__userflowAutoAnchor = __userflowAutoAnchor;
|
|
248
|
+
//# sourceMappingURL=autoAnchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ReactNS","autoAnchorRegistry","roleForKind","expandBuildTimeHints","isHintsInput","cacheKey","id","scope","cache","Map","assignLegacyStringRef","name","instance","React","internals","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","owner","ReactCurrentOwner","current","refs","attachUserRef","userRef","result","detachUserRef","reg","userRefCleanup","teardownRegistration","entry","dispose","isRefLike","value","isUserRef","length","isRuntime","resolveHints","raw","kind","__userflowAutoAnchor","hintsOrUserRef","userRefOrKind","kindOrRuntime","maybeRuntime","hints","elementKind","runtime","undefined","resolvedId","nativeId","ufid","key","existing","get","registrations","size","values","patch","childText","accessibilityLabel","instanceScope","userflowId","testID","nativeID","manualId","mid","updateInstance","instanceId","callback","has","cleanup","holder","rt","composedPath","templatePath","structuralPath","hintsForReg","role","registerInstance","registryKey","ref","iconName","imageSrc","reactKey","startsWith","set","r","delete","first","keys","next","done","inst","__resetAutoAnchorForTests","clear","globalThis"],"sourceRoot":"../../../src","sources":["anchors/autoAnchor.ts"],"mappings":";;AAAA,OAAO,KAAKA,OAAO,MAAM,OAAO;AAGhC,SACEC,kBAAkB,EAClBC,WAAW,QAGN,yBAAsB;AAC7B,SAASC,oBAAoB,EAAEC,YAAY,QAAyB,iBAAc;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmCA,SAASC,QAAQA,CAACC,EAAU,EAAEC,KAAc,EAAU;EACpD,OAAOA,KAAK,GAAG,GAAGD,EAAE,KAAKC,KAAK,EAAE,GAAGD,EAAE;AACvC;AAEA,MAAME,KAAK,GAAG,IAAIC,GAAG,CAAsB,CAAC;;AAE5C;AACA;AACA;AACA;AACA,SAASC,qBAAqBA,CAACC,IAAY,EAAEC,QAAsB,EAAQ;EACzE,IAAI;IACF,MAAMC,KAAK,GAAGb,OAOb;IACD,MAAMc,SAAS,GACbD,KAAK,CAAC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
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { anchorChangeTicker } from "./anchorChangeTicker.js";
|
|
4
|
+
import { resolveAnchorHost } from "./resolveAnchorHost.js";
|
|
5
|
+
import { resolveManualAnchorId } from "./resolveManualAnchorId.js";
|
|
6
|
+
|
|
7
|
+
/** ELEMENT states the mobile SDK can evaluate today. */
|
|
8
|
+
const SUPPORTED_ELEMENT_STATES = new Set(['PRESENT', 'NOT_PRESENT']);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Evaluate ELEMENT client conditions against manual anchors and fiber-resolved
|
|
12
|
+
* `testID` / `nativeID` / `accessibilityLabel` targets.
|
|
13
|
+
*
|
|
14
|
+
* Supports PRESENT / NOT_PRESENT for MANUAL selectors (`css` → anchor id).
|
|
15
|
+
* AUTO / codeless selectors and web-interaction states (CLICK, DISABLED, …)
|
|
16
|
+
* report unknown (`null`) so gated flows stay blocked rather than inventing
|
|
17
|
+
* a truth value.
|
|
18
|
+
*
|
|
19
|
+
* "Present" means `resolveAnchorHost` finds a unique host. That already skips
|
|
20
|
+
* screens covered by another navigator screen, so an id on a pushed-under
|
|
21
|
+
* screen counts as absent. Pixel visibility (off-screen inside a ScrollView,
|
|
22
|
+
* opacity 0, etc.) would need async `measureInWindow` and is out of scope.
|
|
23
|
+
*
|
|
24
|
+
* Note: compares string literals rather than importing protocol enums so Jest
|
|
25
|
+
* (which cannot resolve the ESM-only `@userflow-tech/protocol` package) stays
|
|
26
|
+
* hermetic. Wire values match `FlowConditionElementState` / `FlowSelectorType`.
|
|
27
|
+
*/
|
|
28
|
+
export function createElementConditionEvaluator(warn = message => {
|
|
29
|
+
if (__DEV__) {
|
|
30
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
31
|
+
console.warn(message);
|
|
32
|
+
}
|
|
33
|
+
}) {
|
|
34
|
+
const warnedConditionIds = new Set();
|
|
35
|
+
const warnOnce = (conditionId, message) => {
|
|
36
|
+
if (warnedConditionIds.has(conditionId)) return;
|
|
37
|
+
warnedConditionIds.add(conditionId);
|
|
38
|
+
warn(message);
|
|
39
|
+
};
|
|
40
|
+
return (condition, report) => {
|
|
41
|
+
const evaluate = () => {
|
|
42
|
+
const result = evaluateElementCondition(condition, warnOnce);
|
|
43
|
+
report(result);
|
|
44
|
+
};
|
|
45
|
+
evaluate();
|
|
46
|
+
return anchorChangeTicker.subscribe(evaluate);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function evaluateElementCondition(condition, warnOnce) {
|
|
50
|
+
const elementState = condition.elementState;
|
|
51
|
+
if (elementState == null || !SUPPORTED_ELEMENT_STATES.has(elementState)) {
|
|
52
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} uses unsupported elementState ` + `"${elementState ?? 'null'}" (only PRESENT / NOT_PRESENT are supported); ` + 'leaving unknown');
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const selector = condition.selector;
|
|
56
|
+
if (selector == null) {
|
|
57
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} has no selector; leaving unknown`);
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
if (selector.type === 'AUTO') {
|
|
61
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} uses an AUTO (codeless) selector; ` + 'manual anchors only are supported today — leaving unknown');
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const anchorId = resolveManualAnchorId(selector.css);
|
|
65
|
+
if (anchorId == null) {
|
|
66
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} has no resolvable manual anchor id; ` + 'leaving unknown');
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const resolution = resolveAnchorHost(anchorId);
|
|
70
|
+
// Ambiguous counts as not present for PRESENT (fail closed) and as "present"
|
|
71
|
+
// for NOT_PRESENT would be wrong — treat ambiguous as unknown so gated flows
|
|
72
|
+
// stay blocked rather than inventing a truth value.
|
|
73
|
+
if (resolution.status === 'ambiguous') {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const present = resolution.status === 'found';
|
|
77
|
+
return elementState === 'PRESENT' ? present : !present;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=elementConditionEvaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["anchorChangeTicker","resolveAnchorHost","resolveManualAnchorId","SUPPORTED_ELEMENT_STATES","Set","createElementConditionEvaluator","warn","message","__DEV__","console","warnedConditionIds","warnOnce","conditionId","has","add","condition","report","evaluate","result","evaluateElementCondition","subscribe","elementState","id","selector","type","anchorId","css","resolution","status","present"],"sourceRoot":"../../../src","sources":["anchors/elementConditionEvaluator.ts"],"mappings":";;AAGA,SAASA,kBAAkB,QAAQ,yBAAsB;AACzD,SAASC,iBAAiB,QAAQ,wBAAqB;AACvD,SAASC,qBAAqB,QAAQ,4BAAyB;;AAE/D;AACA,MAAMC,wBAAwB,GAAG,IAAIC,GAAG,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,+BAA+BA,CAC7CC,IAA+B,GAAIC,OAAO,IAAK;EAC7C,IAAIC,OAAO,EAAE;IACX;IACAC,OAAO,CAACH,IAAI,CAACC,OAAO,CAAC;EACvB;AACF,CAAC,EACmB;EACpB,MAAMG,kBAAkB,GAAG,IAAIN,GAAG,CAAS,CAAC;EAE5C,MAAMO,QAAQ,GAAGA,CAACC,WAAmB,EAAEL,OAAe,KAAW;IAC/D,IAAIG,kBAAkB,CAACG,GAAG,CAACD,WAAW,CAAC,EAAE;IACzCF,kBAAkB,CAACI,GAAG,CAACF,WAAW,CAAC;IACnCN,IAAI,CAACC,OAAO,CAAC;EACf,CAAC;EAED,OAAO,CAACQ,SAAS,EAAEC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A,MAAMK,UAAU,GAAG1B,iBAAiB,CAACwB,QAAQ,CAAC;EAC9C;EACA;EACA;EACA,IAAIE,UAAU,CAACC,MAAM,KAAK,WAAW,EAAE;IACrC,OAAO,IAAI;EACb;EACA,MAAMC,OAAO,GAAGF,UAAU,CAACC,MAAM,KAAK,OAAO;EAC7C,OAAOP,YAAY,KAAK,SAAS,GAAGQ,OAAO,GAAG,CAACA,OAAO;AACxD","ignoreList":[]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import { fiberFromPublicInstance, resolveCurrentFiber } from "./fiberInternals.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* Module singleton holding the fiber under which testID / nativeID /
|
|
9
|
+
* accessibilityLabel scans run. Seeded by {@link FiberScanRoot}.
|
|
10
|
+
*/
|
|
11
|
+
class FiberScanRootStore {
|
|
12
|
+
instance = null;
|
|
13
|
+
listeners = new Set();
|
|
14
|
+
set(instance) {
|
|
15
|
+
this.instance = instance;
|
|
16
|
+
this.emit();
|
|
17
|
+
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.instance = null;
|
|
20
|
+
this.emit();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Current (resolved) fiber under the scan root, or null when unmounted. */
|
|
24
|
+
getFiber() {
|
|
25
|
+
if (!this.instance) return null;
|
|
26
|
+
const fiber = fiberFromPublicInstance(this.instance);
|
|
27
|
+
if (!fiber) return null;
|
|
28
|
+
return resolveCurrentFiber(fiber);
|
|
29
|
+
}
|
|
30
|
+
subscribe(listener) {
|
|
31
|
+
this.listeners.add(listener);
|
|
32
|
+
return () => {
|
|
33
|
+
this.listeners.delete(listener);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Test helper. */
|
|
38
|
+
resetForTests() {
|
|
39
|
+
this.instance = null;
|
|
40
|
+
this.listeners.clear();
|
|
41
|
+
}
|
|
42
|
+
emit() {
|
|
43
|
+
for (const listener of this.listeners) {
|
|
44
|
+
listener();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export const fiberScanRoot = new FiberScanRootStore();
|
|
49
|
+
/**
|
|
50
|
+
* Class component that publishes its own `_reactInternals` fiber as the scan
|
|
51
|
+
* root for testID-based anchoring. Class instances expose `_reactInternals` in
|
|
52
|
+
* both Paper and Fabric production builds (unlike host refs, which null out
|
|
53
|
+
* `_internalFiberInstanceHandleDEV` on Paper release).
|
|
54
|
+
*
|
|
55
|
+
* Renders the same content-root `View` that {@link UserflowProvider} previously
|
|
56
|
+
* owned so the layout tree is unchanged. The Userflow overlay sits as a
|
|
57
|
+
* *sibling*, so SDK-owned `testID`s never self-match.
|
|
58
|
+
*/
|
|
59
|
+
export class FiberScanRoot extends React.Component {
|
|
60
|
+
componentDidMount() {
|
|
61
|
+
fiberScanRoot.set(this);
|
|
62
|
+
}
|
|
63
|
+
componentDidUpdate() {
|
|
64
|
+
// Re-publish after updates so a remount-without-unmount still has a live
|
|
65
|
+
// pointer (defensive; normally the instance identity is stable).
|
|
66
|
+
fiberScanRoot.set(this);
|
|
67
|
+
}
|
|
68
|
+
componentWillUnmount() {
|
|
69
|
+
fiberScanRoot.clear();
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
return /*#__PURE__*/_jsx(View, {
|
|
73
|
+
style: styles.contentRoot,
|
|
74
|
+
collapsable: false,
|
|
75
|
+
children: this.props.children
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const styles = StyleSheet.create({
|
|
80
|
+
contentRoot: {
|
|
81
|
+
flex: 1
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=FiberScanRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","fiberFromPublicInstance","resolveCurrentFiber","jsx","_jsx","FiberScanRootStore","instance","listeners","Set","set","emit","clear","getFiber","fiber","subscribe","listener","add","delete","resetForTests","fiberScanRoot","FiberScanRoot","Component","componentDidMount","componentDidUpdate","componentWillUnmount","render","style","styles","contentRoot","collapsable","children","props","create","flex"],"sourceRoot":"../../../../src","sources":["anchors/fiber/FiberScanRoot.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAAwBC,uBAAuB,EAAEC,mBAAmB,QAAQ,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI/F;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,CAAC;EACfC,QAAQ,GAAY,IAAI;EACfC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;EAEhDC,GAAGA,CAACH,QAAiB,EAAQ;IAC3B,IAAI,CAACA,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACI,IAAI,CAAC,CAAC;EACb;EAEAC,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACL,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACI,IAAI,CAAC,CAAC;EACb;;EAEA;EACAE,QAAQA,CAAA,EAAoB;IAC1B,IAAI,CAAC,IAAI,CAACN,QAAQ,EAAE,OAAO,IAAI;IAC/B,MAAMO,KAAK,GAAGZ,uBAAuB,CAAC,IAAI,CAACK,QAAQ,CAAC;IACpD,IAAI,CAACO,KAAK,EAAE,OAAO,IAAI;IACvB,OAAOX,mBAAmB,CAACW,KAAK,CAAC;EACnC;EAEAC,SAASA,CAACC,QAAkB,EAAc;IACxC,IAAI,CAACR,SAAS,CAACS,GAAG,CAACD,QAAQ,CAAC;IAC5B,OAAO,MAAM;MACX,IAAI,CAACR,SAAS,CAACU,MAAM,CAACF,QAAQ,CAAC;IACjC,CAAC;EACH;;EAEA;EACAG,aAAaA,CAAA,EAAS;IACpB,IAAI,CAACZ,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,SAAS,CAACI,KAAK,CAAC,CAAC;EACxB;EAEQD,IAAIA,CAAA,EAAS;IACnB,KAAK,MAAMK,QAAQ,IAAI,IAAI,CAACR,SAAS,EAAE;MACrCQ,QAAQ,CAAC,CAAC;IACZ;EACF;AACF;AAEA,OAAO,MAAMI,aAAa,GAAG,IAAId,kBAAkB,CAAC,CAAC;AAMrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMe,aAAa,SAAStB,KAAK,CAACuB,SAAS,CAAqB;EAC5DC,iBAAiBA,CAAA,EAAS;IACjCH,aAAa,CAACV,GAAG,CAAC,IAAI,CAAC;EACzB;EAESc,kBAAkBA,CAAA,EAAS;IAClC;IACA;IACAJ,aAAa,CAACV,GAAG,CAAC,IAAI,CAAC;EACzB;EAESe,oBAAoBA,CAAA,EAAS;IACpCL,aAAa,CAACR,KAAK,CAAC,CAAC;EACvB;EAESc,MAAMA,CAAA,EAAuB;IACpC,oBACErB,IAAA,CAACJ,IAAI;MAAC0B,KAAK,EAAEC,MAAM,CAACC,WAAY;MAACC,WAAW,EAAE,KAAM;MAAAC,QAAA,EACjD,IAAI,CAACC,KAAK,CAACD;IAAQ,CAChB,CAAC;EAEX;AACF;AAEA,MAAMH,MAAM,GAAG5B,UAAU,CAACiC,MAAM,CAAC;EAC/BJ,WAAW,EAAE;IACXK,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compatibility layer for the React Native / React **internals** that
|
|
5
|
+
* testID-based anchoring depends on. Every accessor is feature-detected and
|
|
6
|
+
* **never throws** (returns `undefined`/`false`/`null` on a missing or renamed
|
|
7
|
+
* field) so an RN shape change degrades to not-found rather than crashing the
|
|
8
|
+
* host app.
|
|
9
|
+
*
|
|
10
|
+
* Explicitly **no** `__REACT_DEVTOOLS_GLOBAL_HOOK__`. Fibers are reached only
|
|
11
|
+
* through production-present pointers on class instances (`_reactInternals`).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// The fiber shape we touch is intentionally permissive; we never mutate.
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
|
|
17
|
+
/** React reconciler `HostComponent` fiber tag. */
|
|
18
|
+
const HOST_COMPONENT_TAG = 5;
|
|
19
|
+
|
|
20
|
+
/** React reconciler `HostRoot` fiber tag. */
|
|
21
|
+
const HOST_ROOT_TAG = 3;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Bound for `return`-pointer walks. Only a loop guard, not a real limit:
|
|
25
|
+
* measured fiber depth in a modest Expo Router app is already ~150 from a
|
|
26
|
+
* tagged view to the provider, and ~80 from the provider to the HostRoot, so a
|
|
27
|
+
* small cap silently disables the walk instead of protecting anything.
|
|
28
|
+
*/
|
|
29
|
+
export const MAX_ANCESTOR_WALK = 10_000;
|
|
30
|
+
|
|
31
|
+
/** Keys/methods that mark a `stateNode` as a measurable native view instance. */
|
|
32
|
+
const HOST_STATE_NODE_KEYS = ['viewConfig', '_nativeTag', '__nativeTag', 'nativeTag', '_internalInstanceHandle', 'node', 'canonical'];
|
|
33
|
+
export function getChild(fiber) {
|
|
34
|
+
return fiber?.child ?? null;
|
|
35
|
+
}
|
|
36
|
+
export function getSibling(fiber) {
|
|
37
|
+
return fiber?.sibling ?? null;
|
|
38
|
+
}
|
|
39
|
+
export function getReturn(fiber) {
|
|
40
|
+
return fiber?.return ?? null;
|
|
41
|
+
}
|
|
42
|
+
export function getAlternate(fiber) {
|
|
43
|
+
return fiber?.alternate ?? null;
|
|
44
|
+
}
|
|
45
|
+
export function getMemoizedProps(fiber) {
|
|
46
|
+
const p = fiber?.memoizedProps;
|
|
47
|
+
return p && typeof p === 'object' ? p : undefined;
|
|
48
|
+
}
|
|
49
|
+
export function getStateNode(fiber) {
|
|
50
|
+
return fiber?.stateNode ?? null;
|
|
51
|
+
}
|
|
52
|
+
export function getFiberTag(fiber) {
|
|
53
|
+
const t = fiber?.tag;
|
|
54
|
+
return typeof t === 'number' ? t : undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Native component name for a host fiber (e.g. `RNSScreen`), else undefined. */
|
|
58
|
+
export function getHostTypeName(fiber) {
|
|
59
|
+
const t = fiber?.type;
|
|
60
|
+
return typeof t === 'string' ? t : undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* True when `fiber` is a host component. Checks both Paper/Fabric stateNode
|
|
65
|
+
* markers and the HostComponent tag (react-test-renderer host fibers often
|
|
66
|
+
* have `tag === 5` without native keys).
|
|
67
|
+
*/
|
|
68
|
+
export function isHostFiber(fiber) {
|
|
69
|
+
const node = fiber?.stateNode;
|
|
70
|
+
if (node && typeof node === 'object') {
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
const n = node;
|
|
73
|
+
for (const k of HOST_STATE_NODE_KEYS) {
|
|
74
|
+
if (k in node) return true;
|
|
75
|
+
}
|
|
76
|
+
if (typeof n.measure === 'function' || typeof n.measureInWindow === 'function' || typeof n.measureLayout === 'function') {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return getFiberTag(fiber) === HOST_COMPONENT_TAG;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Ordered pointer names a class / public instance uses to reference its fiber.
|
|
85
|
+
* `_internalFiberInstanceHandleDEV` is intentionally omitted — DEV-only.
|
|
86
|
+
*/
|
|
87
|
+
const INSTANCE_FIBER_KEYS = ['_reactInternals',
|
|
88
|
+
// class / pre-19 / Fabric & Paper prod
|
|
89
|
+
'_reactInternalFiber',
|
|
90
|
+
// legacy
|
|
91
|
+
'__internalInstanceHandle',
|
|
92
|
+
// Fabric public instance (RN 0.7x+)
|
|
93
|
+
'_internalInstanceHandle' // older Fabric / Paper bridge
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
/** Resolve a fiber from a class or host public instance. Returns null when unavailable. */
|
|
97
|
+
export function fiberFromPublicInstance(instance) {
|
|
98
|
+
if (!instance || typeof instance !== 'object') return null;
|
|
99
|
+
try {
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
|
+
const inst = instance;
|
|
102
|
+
for (const key of INSTANCE_FIBER_KEYS) {
|
|
103
|
+
const handle = inst[key];
|
|
104
|
+
if (handle) return handle;
|
|
105
|
+
}
|
|
106
|
+
} catch {
|
|
107
|
+
// Feature-detection must itself never throw.
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Pick the "current" tree fiber between `fiber` and its alternate by walking
|
|
114
|
+
* to the HostRoot and comparing against `root.stateNode.current`.
|
|
115
|
+
*
|
|
116
|
+
* Returns the input fiber when the root cannot be resolved (best-effort).
|
|
117
|
+
*/
|
|
118
|
+
export function resolveCurrentFiber(fiber) {
|
|
119
|
+
if (!fiber) return fiber;
|
|
120
|
+
try {
|
|
121
|
+
const alternate = getAlternate(fiber);
|
|
122
|
+
if (!alternate) return fiber;
|
|
123
|
+
let cur = fiber;
|
|
124
|
+
for (let depth = 0; cur && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
125
|
+
if (getFiberTag(cur) === HOST_ROOT_TAG) {
|
|
126
|
+
const rootState = getStateNode(cur);
|
|
127
|
+
const currentRoot = rootState?.current;
|
|
128
|
+
if (!currentRoot) return fiber;
|
|
129
|
+
// Walk both candidates upward; whichever lands on currentRoot is live.
|
|
130
|
+
if (isInTree(fiber, currentRoot)) return fiber;
|
|
131
|
+
if (isInTree(alternate, currentRoot)) return alternate;
|
|
132
|
+
return fiber;
|
|
133
|
+
}
|
|
134
|
+
cur = getReturn(cur);
|
|
135
|
+
}
|
|
136
|
+
} catch {
|
|
137
|
+
// Best-effort.
|
|
138
|
+
}
|
|
139
|
+
return fiber;
|
|
140
|
+
}
|
|
141
|
+
function isInTree(fiber, root) {
|
|
142
|
+
let cur = fiber;
|
|
143
|
+
for (let depth = 0; cur && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
144
|
+
if (cur === root) return true;
|
|
145
|
+
cur = getReturn(cur);
|
|
146
|
+
}
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* True when a previously-resolved fiber is still attached to a live tree
|
|
152
|
+
* (has a return path, or is itself a HostRoot).
|
|
153
|
+
*/
|
|
154
|
+
export function isFiberMounted(fiber) {
|
|
155
|
+
if (!fiber) return false;
|
|
156
|
+
try {
|
|
157
|
+
if (getFiberTag(fiber) === HOST_ROOT_TAG) return true;
|
|
158
|
+
// A fiber with no return is detached (unless HostRoot, handled above).
|
|
159
|
+
return getReturn(fiber) != null;
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=fiberInternals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HOST_COMPONENT_TAG","HOST_ROOT_TAG","MAX_ANCESTOR_WALK","HOST_STATE_NODE_KEYS","getChild","fiber","child","getSibling","sibling","getReturn","return","getAlternate","alternate","getMemoizedProps","p","memoizedProps","undefined","getStateNode","stateNode","getFiberTag","t","tag","getHostTypeName","type","isHostFiber","node","n","k","measure","measureInWindow","measureLayout","INSTANCE_FIBER_KEYS","fiberFromPublicInstance","instance","inst","key","handle","resolveCurrentFiber","cur","depth","rootState","currentRoot","current","isInTree","root","isFiberMounted"],"sourceRoot":"../../../../src","sources":["anchors/fiber/fiberInternals.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAGA;AACA,MAAMA,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAA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