@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,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.__resetAutoAnchorForTests = __resetAutoAnchorForTests;
|
|
7
|
+
exports.__userflowAutoAnchor = __userflowAutoAnchor;
|
|
8
|
+
var ReactNS = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _AutoAnchorRegistry = require("./AutoAnchorRegistry.js");
|
|
10
|
+
var _hintsCodec = require("./hintsCodec.js");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* Runtime half of build-time auto-anchoring (see `@userflow-tech/babel-plugin`).
|
|
14
|
+
*
|
|
15
|
+
* Each mount creates a distinct AutoAnchorRegistry instance. Shared templates
|
|
16
|
+
* (design-system / list rows) register separately and are marked ambiguous
|
|
17
|
+
* when they lack a unique manual id or call-site scope.
|
|
18
|
+
*
|
|
19
|
+
* Canonical signature (what Babel emits via `__ufRef`):
|
|
20
|
+
* __userflowAutoAnchor(id, hints, userRef, kind, runtime?)
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
function cacheKey(id, scope) {
|
|
24
|
+
return scope ? `${id}@@${scope}` : id;
|
|
25
|
+
}
|
|
26
|
+
const cache = new Map();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Legacy string refs (`ref="foo"`) assigned `owner.refs.foo` via React internals.
|
|
30
|
+
* Best-effort: modern React may not expose an owner; never throws into app code.
|
|
31
|
+
*/
|
|
32
|
+
function assignLegacyStringRef(name, instance) {
|
|
33
|
+
try {
|
|
34
|
+
const React = ReactNS;
|
|
35
|
+
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;
|
|
36
|
+
const owner = internals?.ReactCurrentOwner?.current;
|
|
37
|
+
if (!owner) return;
|
|
38
|
+
if (owner.refs == null) {
|
|
39
|
+
owner.refs = {};
|
|
40
|
+
}
|
|
41
|
+
if (instance) {
|
|
42
|
+
owner.refs[name] = instance;
|
|
43
|
+
} else {
|
|
44
|
+
delete owner.refs[name];
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
// String-ref owner unavailable — ignore rather than break the host.
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function attachUserRef(userRef, instance) {
|
|
51
|
+
if (userRef == null || userRef === '') return;
|
|
52
|
+
if (typeof userRef === 'string') {
|
|
53
|
+
assignLegacyStringRef(userRef, instance);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (typeof userRef === 'function') {
|
|
57
|
+
const result = userRef(instance);
|
|
58
|
+
if (typeof result === 'function') {
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
userRef.current = instance;
|
|
65
|
+
} catch {
|
|
66
|
+
// Read-only ref object — nothing to do.
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function detachUserRef(userRef, reg) {
|
|
70
|
+
if (reg.userRefCleanup) {
|
|
71
|
+
try {
|
|
72
|
+
reg.userRefCleanup();
|
|
73
|
+
} catch {
|
|
74
|
+
// App cleanup must not break unmount.
|
|
75
|
+
}
|
|
76
|
+
reg.userRefCleanup = null;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
attachUserRef(userRef, null);
|
|
80
|
+
}
|
|
81
|
+
function teardownRegistration(entry, reg) {
|
|
82
|
+
detachUserRef(entry.userRef, reg);
|
|
83
|
+
reg.dispose();
|
|
84
|
+
}
|
|
85
|
+
function isRefLike(value) {
|
|
86
|
+
return typeof value === 'function' || typeof value === 'object' && value !== null && 'current' in value;
|
|
87
|
+
}
|
|
88
|
+
function isUserRef(value) {
|
|
89
|
+
if (typeof value === 'string') return value.length > 0;
|
|
90
|
+
return isRefLike(value);
|
|
91
|
+
}
|
|
92
|
+
function isRuntime(value) {
|
|
93
|
+
return typeof value === 'object' && value !== null && !isRefLike(value) && !(0, _hintsCodec.isHintsInput)(value);
|
|
94
|
+
}
|
|
95
|
+
function resolveHints(raw, kind) {
|
|
96
|
+
if (raw == null) return raw;
|
|
97
|
+
return (0, _hintsCodec.expandBuildTimeHints)(raw, kind);
|
|
98
|
+
}
|
|
99
|
+
function __userflowAutoAnchor(id, hintsOrUserRef, userRefOrKind, kindOrRuntime, maybeRuntime) {
|
|
100
|
+
let hints;
|
|
101
|
+
let userRef;
|
|
102
|
+
let elementKind;
|
|
103
|
+
let runtime;
|
|
104
|
+
if ((0, _hintsCodec.isHintsInput)(hintsOrUserRef)) {
|
|
105
|
+
userRef = isUserRef(userRefOrKind) ? userRefOrKind : null;
|
|
106
|
+
if (typeof kindOrRuntime === 'string') {
|
|
107
|
+
elementKind = kindOrRuntime;
|
|
108
|
+
runtime = maybeRuntime;
|
|
109
|
+
} else if (isRuntime(kindOrRuntime)) {
|
|
110
|
+
runtime = kindOrRuntime;
|
|
111
|
+
}
|
|
112
|
+
hints = resolveHints(hintsOrUserRef, elementKind);
|
|
113
|
+
} else {
|
|
114
|
+
hints = undefined;
|
|
115
|
+
userRef = isUserRef(hintsOrUserRef) ? hintsOrUserRef : null;
|
|
116
|
+
elementKind = typeof userRefOrKind === 'string' ? userRefOrKind : undefined;
|
|
117
|
+
if (isRuntime(kindOrRuntime)) runtime = kindOrRuntime;else if (maybeRuntime) runtime = maybeRuntime;
|
|
118
|
+
}
|
|
119
|
+
const resolvedId = typeof id === 'string' && id.length > 0 ? id : hints?.nativeId ?? hints?.ufid ?? 'uf_unknown';
|
|
120
|
+
const scope = runtime?.scope;
|
|
121
|
+
const key = cacheKey(resolvedId, scope);
|
|
122
|
+
const existing = cache.get(key);
|
|
123
|
+
if (existing) {
|
|
124
|
+
existing.userRef = userRef;
|
|
125
|
+
existing.hints = hints;
|
|
126
|
+
existing.kind = elementKind ?? existing.kind;
|
|
127
|
+
existing.runtime = runtime ?? existing.runtime;
|
|
128
|
+
if (existing.registrations.size === 1 && (hints || runtime)) {
|
|
129
|
+
const [reg] = existing.registrations.values();
|
|
130
|
+
const patch = {};
|
|
131
|
+
if (runtime?.childText !== undefined) patch.childText = runtime.childText;
|
|
132
|
+
if (runtime?.accessibilityLabel !== undefined) {
|
|
133
|
+
patch.accessibilityLabel = runtime.accessibilityLabel;
|
|
134
|
+
}
|
|
135
|
+
if (runtime?.scope) patch.instanceScope = runtime.scope;
|
|
136
|
+
if (runtime?.userflowId) patch.userflowId = runtime.userflowId;
|
|
137
|
+
if (runtime?.testID) patch.testID = runtime.testID;
|
|
138
|
+
if (runtime?.nativeID) patch.nativeID = runtime.nativeID;
|
|
139
|
+
if (runtime?.manualId || runtime?.userflowId || runtime?.testID) {
|
|
140
|
+
const mid = runtime.manualId ?? runtime.userflowId ?? runtime.testID ?? existing.runtime?.manualId;
|
|
141
|
+
if (mid) patch.manualId = mid;
|
|
142
|
+
}
|
|
143
|
+
_AutoAnchorRegistry.autoAnchorRegistry.updateInstance(reg.instanceId, patch);
|
|
144
|
+
}
|
|
145
|
+
return existing.callback;
|
|
146
|
+
}
|
|
147
|
+
const entry = {
|
|
148
|
+
userRef,
|
|
149
|
+
hints,
|
|
150
|
+
kind: elementKind,
|
|
151
|
+
runtime,
|
|
152
|
+
registrations: new Map(),
|
|
153
|
+
callback: instance => {
|
|
154
|
+
if (instance) {
|
|
155
|
+
if (entry.registrations.has(instance)) return undefined;
|
|
156
|
+
const cleanup = attachUserRef(entry.userRef, instance);
|
|
157
|
+
const holder = {
|
|
158
|
+
current: instance
|
|
159
|
+
};
|
|
160
|
+
const kind = entry.kind ?? 'View';
|
|
161
|
+
const rt = entry.runtime;
|
|
162
|
+
const composedPath = rt?.scope && entry.hints?.templatePath ? `${rt.scope} :: ${entry.hints.templatePath}` : entry.hints?.structuralPath ?? entry.hints?.ufid;
|
|
163
|
+
const hintsForReg = entry.hints ? {
|
|
164
|
+
...entry.hints,
|
|
165
|
+
...(composedPath ? {
|
|
166
|
+
structuralPath: composedPath,
|
|
167
|
+
ufid: composedPath
|
|
168
|
+
} : {}),
|
|
169
|
+
role: entry.hints.role ?? (0, _AutoAnchorRegistry.roleForKind)(kind)
|
|
170
|
+
} : {
|
|
171
|
+
ufid: resolvedId,
|
|
172
|
+
nativeId: resolvedId,
|
|
173
|
+
role: (0, _AutoAnchorRegistry.roleForKind)(kind)
|
|
174
|
+
};
|
|
175
|
+
const {
|
|
176
|
+
instanceId,
|
|
177
|
+
dispose
|
|
178
|
+
} = _AutoAnchorRegistry.autoAnchorRegistry.registerInstance({
|
|
179
|
+
registryKey: resolvedId,
|
|
180
|
+
ref: holder,
|
|
181
|
+
kind,
|
|
182
|
+
hints: hintsForReg,
|
|
183
|
+
...(rt?.scope ? {
|
|
184
|
+
instanceScope: rt.scope
|
|
185
|
+
} : {}),
|
|
186
|
+
runtime: {
|
|
187
|
+
...(rt?.manualId ? {
|
|
188
|
+
manualId: rt.manualId
|
|
189
|
+
} : {}),
|
|
190
|
+
...(rt?.userflowId ? {
|
|
191
|
+
userflowId: rt.userflowId
|
|
192
|
+
} : {}),
|
|
193
|
+
...(rt?.testID ? {
|
|
194
|
+
testID: rt.testID
|
|
195
|
+
} : {}),
|
|
196
|
+
...(rt?.nativeID ? {
|
|
197
|
+
nativeID: rt.nativeID
|
|
198
|
+
} : {}),
|
|
199
|
+
...(rt?.childText ? {
|
|
200
|
+
childText: rt.childText
|
|
201
|
+
} : {}),
|
|
202
|
+
...(rt?.accessibilityLabel ? {
|
|
203
|
+
accessibilityLabel: rt.accessibilityLabel
|
|
204
|
+
} : {}),
|
|
205
|
+
...(rt?.iconName ? {
|
|
206
|
+
iconName: rt.iconName
|
|
207
|
+
} : {}),
|
|
208
|
+
...(rt?.imageSrc ? {
|
|
209
|
+
imageSrc: rt.imageSrc
|
|
210
|
+
} : {}),
|
|
211
|
+
...(rt?.reactKey ? {
|
|
212
|
+
reactKey: rt.reactKey
|
|
213
|
+
} : {}),
|
|
214
|
+
...(!rt?.manualId && !rt?.userflowId && !rt?.testID && !resolvedId.startsWith('uf_') ? {
|
|
215
|
+
manualId: resolvedId
|
|
216
|
+
} : {})
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
const reg = {
|
|
220
|
+
holder,
|
|
221
|
+
instanceId,
|
|
222
|
+
dispose,
|
|
223
|
+
userRefCleanup: typeof cleanup === 'function' ? cleanup : null
|
|
224
|
+
};
|
|
225
|
+
entry.registrations.set(instance, reg);
|
|
226
|
+
return () => {
|
|
227
|
+
const r = entry.registrations.get(instance);
|
|
228
|
+
if (!r) return;
|
|
229
|
+
entry.registrations.delete(instance);
|
|
230
|
+
teardownRegistration(entry, r);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
const first = entry.registrations.keys().next();
|
|
234
|
+
if (!first.done) {
|
|
235
|
+
const inst = first.value;
|
|
236
|
+
const r = entry.registrations.get(inst);
|
|
237
|
+
entry.registrations.delete(inst);
|
|
238
|
+
teardownRegistration(entry, r);
|
|
239
|
+
}
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
cache.set(key, entry);
|
|
244
|
+
return entry.callback;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Test helper — drop factory cache and registry instances. */
|
|
248
|
+
function __resetAutoAnchorForTests() {
|
|
249
|
+
cache.clear();
|
|
250
|
+
_AutoAnchorRegistry.autoAnchorRegistry.clear();
|
|
251
|
+
}
|
|
252
|
+
globalThis.__userflowAutoAnchor = __userflowAutoAnchor;
|
|
253
|
+
//# sourceMappingURL=autoAnchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ReactNS","_interopRequireWildcard","require","_AutoAnchorRegistry","_hintsCodec","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","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","isHintsInput","resolveHints","raw","kind","expandBuildTimeHints","__userflowAutoAnchor","hintsOrUserRef","userRefOrKind","kindOrRuntime","maybeRuntime","hints","elementKind","runtime","undefined","resolvedId","nativeId","ufid","key","existing","registrations","size","values","patch","childText","accessibilityLabel","instanceScope","userflowId","testID","nativeID","manualId","mid","autoAnchorRegistry","updateInstance","instanceId","callback","cleanup","holder","rt","composedPath","templatePath","structuralPath","hintsForReg","role","roleForKind","registerInstance","registryKey","ref","iconName","imageSrc","reactKey","startsWith","delete","first","keys","next","done","inst","__resetAutoAnchorForTests","clear","globalThis"],"sourceRoot":"../../../src","sources":["anchors/autoAnchor.ts"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AAAmF,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,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a,CAACxD,GAAG,CAAC6F,IAAI,CAAE;QACxC/D,KAAK,CAAC0B,aAAa,CAACgC,MAAM,CAACK,IAAI,CAAC;QAChChE,oBAAoB,CAACC,KAAK,EAAEvC,CAAC,CAAC;MAChC;MACA,OAAO2D,SAAS;IAClB;EACF,CAAC;EACDxC,KAAK,CAACT,GAAG,CAACqD,GAAG,EAAExB,KAAK,CAAC;EACrB,OAAOA,KAAK,CAACyC,QAAQ;AACvB;;AAEA;AACO,SAASuB,yBAAyBA,CAAA,EAAS;EAChDpF,KAAK,CAACqF,KAAK,CAAC,CAAC;EACb3B,sCAAkB,CAAC2B,KAAK,CAAC,CAAC;AAC5B;AAECC,UAAU,CAA4DtD,oBAAoB,GACzFA,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createElementConditionEvaluator = createElementConditionEvaluator;
|
|
7
|
+
var _anchorChangeTicker = require("./anchorChangeTicker.js");
|
|
8
|
+
var _resolveAnchorHost = require("./resolveAnchorHost.js");
|
|
9
|
+
var _resolveManualAnchorId = require("./resolveManualAnchorId.js");
|
|
10
|
+
/** ELEMENT states the mobile SDK can evaluate today. */
|
|
11
|
+
const SUPPORTED_ELEMENT_STATES = new Set(['PRESENT', 'NOT_PRESENT']);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Evaluate ELEMENT client conditions against manual anchors and fiber-resolved
|
|
15
|
+
* `testID` / `nativeID` / `accessibilityLabel` targets.
|
|
16
|
+
*
|
|
17
|
+
* Supports PRESENT / NOT_PRESENT for MANUAL selectors (`css` → anchor id).
|
|
18
|
+
* AUTO / codeless selectors and web-interaction states (CLICK, DISABLED, …)
|
|
19
|
+
* report unknown (`null`) so gated flows stay blocked rather than inventing
|
|
20
|
+
* a truth value.
|
|
21
|
+
*
|
|
22
|
+
* "Present" means `resolveAnchorHost` finds a unique host. That already skips
|
|
23
|
+
* screens covered by another navigator screen, so an id on a pushed-under
|
|
24
|
+
* screen counts as absent. Pixel visibility (off-screen inside a ScrollView,
|
|
25
|
+
* opacity 0, etc.) would need async `measureInWindow` and is out of scope.
|
|
26
|
+
*
|
|
27
|
+
* Note: compares string literals rather than importing protocol enums so Jest
|
|
28
|
+
* (which cannot resolve the ESM-only `@userflow-tech/protocol` package) stays
|
|
29
|
+
* hermetic. Wire values match `FlowConditionElementState` / `FlowSelectorType`.
|
|
30
|
+
*/
|
|
31
|
+
function createElementConditionEvaluator(warn = message => {
|
|
32
|
+
if (__DEV__) {
|
|
33
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
34
|
+
console.warn(message);
|
|
35
|
+
}
|
|
36
|
+
}) {
|
|
37
|
+
const warnedConditionIds = new Set();
|
|
38
|
+
const warnOnce = (conditionId, message) => {
|
|
39
|
+
if (warnedConditionIds.has(conditionId)) return;
|
|
40
|
+
warnedConditionIds.add(conditionId);
|
|
41
|
+
warn(message);
|
|
42
|
+
};
|
|
43
|
+
return (condition, report) => {
|
|
44
|
+
const evaluate = () => {
|
|
45
|
+
const result = evaluateElementCondition(condition, warnOnce);
|
|
46
|
+
report(result);
|
|
47
|
+
};
|
|
48
|
+
evaluate();
|
|
49
|
+
return _anchorChangeTicker.anchorChangeTicker.subscribe(evaluate);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function evaluateElementCondition(condition, warnOnce) {
|
|
53
|
+
const elementState = condition.elementState;
|
|
54
|
+
if (elementState == null || !SUPPORTED_ELEMENT_STATES.has(elementState)) {
|
|
55
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} uses unsupported elementState ` + `"${elementState ?? 'null'}" (only PRESENT / NOT_PRESENT are supported); ` + 'leaving unknown');
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const selector = condition.selector;
|
|
59
|
+
if (selector == null) {
|
|
60
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} has no selector; leaving unknown`);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
if (selector.type === 'AUTO') {
|
|
64
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} uses an AUTO (codeless) selector; ` + 'manual anchors only are supported today — leaving unknown');
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const anchorId = (0, _resolveManualAnchorId.resolveManualAnchorId)(selector.css);
|
|
68
|
+
if (anchorId == null) {
|
|
69
|
+
warnOnce(condition.id, `[Userflow] ELEMENT condition ${condition.id} has no resolvable manual anchor id; ` + 'leaving unknown');
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const resolution = (0, _resolveAnchorHost.resolveAnchorHost)(anchorId);
|
|
73
|
+
// Ambiguous counts as not present for PRESENT (fail closed) and as "present"
|
|
74
|
+
// for NOT_PRESENT would be wrong — treat ambiguous as unknown so gated flows
|
|
75
|
+
// stay blocked rather than inventing a truth value.
|
|
76
|
+
if (resolution.status === 'ambiguous') {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const present = resolution.status === 'found';
|
|
80
|
+
return elementState === 'PRESENT' ? present : !present;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=elementConditionEvaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_anchorChangeTicker","require","_resolveAnchorHost","_resolveManualAnchorId","SUPPORTED_ELEMENT_STATES","Set","createElementConditionEvaluator","warn","message","__DEV__","console","warnedConditionIds","warnOnce","conditionId","has","add","condition","report","evaluate","result","evaluateElementCondition","anchorChangeTicker","subscribe","elementState","id","selector","type","anchorId","resolveManualAnchorId","css","resolution","resolveAnchorHost","status","present"],"sourceRoot":"../../../src","sources":["anchors/elementConditionEvaluator.ts"],"mappings":";;;;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAC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AgD,GAC1E,iBACJ,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAME,QAAQ,GAAGT,SAAS,CAACS,QAAQ;EACnC,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpBb,QAAQ,CACNI,SAAS,CAACQ,EAAE,EACZ,gCAAgCR,SAAS,CAACQ,EAAE,mCAC9C,CAAC;IACD,OAAO,IAAI;EACb;EAEA,IAAKC,QAAQ,CAACC,IAAI,KAAuB,MAAM,EAAE;IAC/Cd,QAAQ,CACNI,SAAS,CAACQ,EAAE,EACZ,gCAAgCR,SAAS,CAACQ,EAAE,qCAAqC,GAC/E,2DACJ,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAMG,QAAQ,GAAG,IAAAC,4CAAqB,EAACH,QAAQ,CAACI,GAAG,CAAC;EACpD,IAAIF,QAAQ,IAAI,IAAI,EAAE;IACpBf,QAAQ,CACNI,SAAS,CAACQ,EAAE,EACZ,gCAAgCR,SAAS,CAACQ,EAAE,uCAAuC,GACjF,iBACJ,CAAC;IACD,OAAO,IAAI;EACb;EAEA,MAAMM,UAAU,GAAG,IAAAC,oCAAiB,EAACJ,QAAQ,CAAC;EAC9C;EACA;EACA;EACA,IAAIG,UAAU,CAACE,MAAM,KAAK,WAAW,EAAE;IACrC,OAAO,IAAI;EACb;EACA,MAAMC,OAAO,GAAGH,UAAU,CAACE,MAAM,KAAK,OAAO;EAC7C,OAAOT,YAAY,KAAK,SAAS,GAAGU,OAAO,GAAG,CAACA,OAAO;AACxD","ignoreList":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fiberScanRoot = exports.FiberScanRoot = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _fiberInternals = require("./fiberInternals.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* Module singleton holding the fiber under which testID / nativeID /
|
|
14
|
+
* accessibilityLabel scans run. Seeded by {@link FiberScanRoot}.
|
|
15
|
+
*/
|
|
16
|
+
class FiberScanRootStore {
|
|
17
|
+
instance = null;
|
|
18
|
+
listeners = new Set();
|
|
19
|
+
set(instance) {
|
|
20
|
+
this.instance = instance;
|
|
21
|
+
this.emit();
|
|
22
|
+
}
|
|
23
|
+
clear() {
|
|
24
|
+
this.instance = null;
|
|
25
|
+
this.emit();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Current (resolved) fiber under the scan root, or null when unmounted. */
|
|
29
|
+
getFiber() {
|
|
30
|
+
if (!this.instance) return null;
|
|
31
|
+
const fiber = (0, _fiberInternals.fiberFromPublicInstance)(this.instance);
|
|
32
|
+
if (!fiber) return null;
|
|
33
|
+
return (0, _fiberInternals.resolveCurrentFiber)(fiber);
|
|
34
|
+
}
|
|
35
|
+
subscribe(listener) {
|
|
36
|
+
this.listeners.add(listener);
|
|
37
|
+
return () => {
|
|
38
|
+
this.listeners.delete(listener);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Test helper. */
|
|
43
|
+
resetForTests() {
|
|
44
|
+
this.instance = null;
|
|
45
|
+
this.listeners.clear();
|
|
46
|
+
}
|
|
47
|
+
emit() {
|
|
48
|
+
for (const listener of this.listeners) {
|
|
49
|
+
listener();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const fiberScanRoot = exports.fiberScanRoot = new FiberScanRootStore();
|
|
54
|
+
/**
|
|
55
|
+
* Class component that publishes its own `_reactInternals` fiber as the scan
|
|
56
|
+
* root for testID-based anchoring. Class instances expose `_reactInternals` in
|
|
57
|
+
* both Paper and Fabric production builds (unlike host refs, which null out
|
|
58
|
+
* `_internalFiberInstanceHandleDEV` on Paper release).
|
|
59
|
+
*
|
|
60
|
+
* Renders the same content-root `View` that {@link UserflowProvider} previously
|
|
61
|
+
* owned so the layout tree is unchanged. The Userflow overlay sits as a
|
|
62
|
+
* *sibling*, so SDK-owned `testID`s never self-match.
|
|
63
|
+
*/
|
|
64
|
+
class FiberScanRoot extends React.Component {
|
|
65
|
+
componentDidMount() {
|
|
66
|
+
fiberScanRoot.set(this);
|
|
67
|
+
}
|
|
68
|
+
componentDidUpdate() {
|
|
69
|
+
// Re-publish after updates so a remount-without-unmount still has a live
|
|
70
|
+
// pointer (defensive; normally the instance identity is stable).
|
|
71
|
+
fiberScanRoot.set(this);
|
|
72
|
+
}
|
|
73
|
+
componentWillUnmount() {
|
|
74
|
+
fiberScanRoot.clear();
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
78
|
+
style: styles.contentRoot,
|
|
79
|
+
collapsable: false,
|
|
80
|
+
children: this.props.children
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.FiberScanRoot = FiberScanRoot;
|
|
85
|
+
const styles = _reactNative.StyleSheet.create({
|
|
86
|
+
contentRoot: {
|
|
87
|
+
flex: 1
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=FiberScanRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_fiberInternals","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FiberScanRootStore","instance","listeners","Set","emit","clear","getFiber","fiber","fiberFromPublicInstance","resolveCurrentFiber","subscribe","listener","add","delete","resetForTests","fiberScanRoot","exports","FiberScanRoot","Component","componentDidMount","componentDidUpdate","componentWillUnmount","render","jsx","View","style","styles","contentRoot","collapsable","children","props","StyleSheet","create","flex"],"sourceRoot":"../../../../src","sources":["anchors/fiber/FiberScanRoot.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAA+F,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,K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AAE;MACrCS,QAAQ,CAAC,CAAC;IACZ;EACF;AACF;AAEO,MAAMI,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAIf,kBAAkB,CAAC,CAAC;AAMrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiB,aAAa,SAAS1C,KAAK,CAAC2C,SAAS,CAAqB;EAC5DC,iBAAiBA,CAAA,EAAS;IACjCJ,aAAa,CAACrB,GAAG,CAAC,IAAI,CAAC;EACzB;EAES0B,kBAAkBA,CAAA,EAAS;IAClC;IACA;IACAL,aAAa,CAACrB,GAAG,CAAC,IAAI,CAAC;EACzB;EAES2B,oBAAoBA,CAAA,EAAS;IACpCN,aAAa,CAACV,KAAK,CAAC,CAAC;EACvB;EAESiB,MAAMA,CAAA,EAAuB;IACpC,oBACE,IAAA1C,WAAA,CAAA2C,GAAA,EAAC7C,YAAA,CAAA8C,IAAI;MAACC,KAAK,EAAEC,MAAM,CAACC,WAAY;MAACC,WAAW,EAAE,KAAM;MAAAC,QAAA,EACjD,IAAI,CAACC,KAAK,CAACD;IAAQ,CAChB,CAAC;EAEX;AACF;AAACb,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAED,MAAMS,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,WAAW,EAAE;IACXM,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MAX_ANCESTOR_WALK = void 0;
|
|
7
|
+
exports.fiberFromPublicInstance = fiberFromPublicInstance;
|
|
8
|
+
exports.getAlternate = getAlternate;
|
|
9
|
+
exports.getChild = getChild;
|
|
10
|
+
exports.getFiberTag = getFiberTag;
|
|
11
|
+
exports.getHostTypeName = getHostTypeName;
|
|
12
|
+
exports.getMemoizedProps = getMemoizedProps;
|
|
13
|
+
exports.getReturn = getReturn;
|
|
14
|
+
exports.getSibling = getSibling;
|
|
15
|
+
exports.getStateNode = getStateNode;
|
|
16
|
+
exports.isFiberMounted = isFiberMounted;
|
|
17
|
+
exports.isHostFiber = isHostFiber;
|
|
18
|
+
exports.resolveCurrentFiber = resolveCurrentFiber;
|
|
19
|
+
/**
|
|
20
|
+
* Compatibility layer for the React Native / React **internals** that
|
|
21
|
+
* testID-based anchoring depends on. Every accessor is feature-detected and
|
|
22
|
+
* **never throws** (returns `undefined`/`false`/`null` on a missing or renamed
|
|
23
|
+
* field) so an RN shape change degrades to not-found rather than crashing the
|
|
24
|
+
* host app.
|
|
25
|
+
*
|
|
26
|
+
* Explicitly **no** `__REACT_DEVTOOLS_GLOBAL_HOOK__`. Fibers are reached only
|
|
27
|
+
* through production-present pointers on class instances (`_reactInternals`).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// The fiber shape we touch is intentionally permissive; we never mutate.
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
|
|
33
|
+
/** React reconciler `HostComponent` fiber tag. */
|
|
34
|
+
const HOST_COMPONENT_TAG = 5;
|
|
35
|
+
|
|
36
|
+
/** React reconciler `HostRoot` fiber tag. */
|
|
37
|
+
const HOST_ROOT_TAG = 3;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Bound for `return`-pointer walks. Only a loop guard, not a real limit:
|
|
41
|
+
* measured fiber depth in a modest Expo Router app is already ~150 from a
|
|
42
|
+
* tagged view to the provider, and ~80 from the provider to the HostRoot, so a
|
|
43
|
+
* small cap silently disables the walk instead of protecting anything.
|
|
44
|
+
*/
|
|
45
|
+
const MAX_ANCESTOR_WALK = exports.MAX_ANCESTOR_WALK = 10_000;
|
|
46
|
+
|
|
47
|
+
/** Keys/methods that mark a `stateNode` as a measurable native view instance. */
|
|
48
|
+
const HOST_STATE_NODE_KEYS = ['viewConfig', '_nativeTag', '__nativeTag', 'nativeTag', '_internalInstanceHandle', 'node', 'canonical'];
|
|
49
|
+
function getChild(fiber) {
|
|
50
|
+
return fiber?.child ?? null;
|
|
51
|
+
}
|
|
52
|
+
function getSibling(fiber) {
|
|
53
|
+
return fiber?.sibling ?? null;
|
|
54
|
+
}
|
|
55
|
+
function getReturn(fiber) {
|
|
56
|
+
return fiber?.return ?? null;
|
|
57
|
+
}
|
|
58
|
+
function getAlternate(fiber) {
|
|
59
|
+
return fiber?.alternate ?? null;
|
|
60
|
+
}
|
|
61
|
+
function getMemoizedProps(fiber) {
|
|
62
|
+
const p = fiber?.memoizedProps;
|
|
63
|
+
return p && typeof p === 'object' ? p : undefined;
|
|
64
|
+
}
|
|
65
|
+
function getStateNode(fiber) {
|
|
66
|
+
return fiber?.stateNode ?? null;
|
|
67
|
+
}
|
|
68
|
+
function getFiberTag(fiber) {
|
|
69
|
+
const t = fiber?.tag;
|
|
70
|
+
return typeof t === 'number' ? t : undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Native component name for a host fiber (e.g. `RNSScreen`), else undefined. */
|
|
74
|
+
function getHostTypeName(fiber) {
|
|
75
|
+
const t = fiber?.type;
|
|
76
|
+
return typeof t === 'string' ? t : undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* True when `fiber` is a host component. Checks both Paper/Fabric stateNode
|
|
81
|
+
* markers and the HostComponent tag (react-test-renderer host fibers often
|
|
82
|
+
* have `tag === 5` without native keys).
|
|
83
|
+
*/
|
|
84
|
+
function isHostFiber(fiber) {
|
|
85
|
+
const node = fiber?.stateNode;
|
|
86
|
+
if (node && typeof node === 'object') {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
|
+
const n = node;
|
|
89
|
+
for (const k of HOST_STATE_NODE_KEYS) {
|
|
90
|
+
if (k in node) return true;
|
|
91
|
+
}
|
|
92
|
+
if (typeof n.measure === 'function' || typeof n.measureInWindow === 'function' || typeof n.measureLayout === 'function') {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return getFiberTag(fiber) === HOST_COMPONENT_TAG;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Ordered pointer names a class / public instance uses to reference its fiber.
|
|
101
|
+
* `_internalFiberInstanceHandleDEV` is intentionally omitted — DEV-only.
|
|
102
|
+
*/
|
|
103
|
+
const INSTANCE_FIBER_KEYS = ['_reactInternals',
|
|
104
|
+
// class / pre-19 / Fabric & Paper prod
|
|
105
|
+
'_reactInternalFiber',
|
|
106
|
+
// legacy
|
|
107
|
+
'__internalInstanceHandle',
|
|
108
|
+
// Fabric public instance (RN 0.7x+)
|
|
109
|
+
'_internalInstanceHandle' // older Fabric / Paper bridge
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
/** Resolve a fiber from a class or host public instance. Returns null when unavailable. */
|
|
113
|
+
function fiberFromPublicInstance(instance) {
|
|
114
|
+
if (!instance || typeof instance !== 'object') return null;
|
|
115
|
+
try {
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
|
+
const inst = instance;
|
|
118
|
+
for (const key of INSTANCE_FIBER_KEYS) {
|
|
119
|
+
const handle = inst[key];
|
|
120
|
+
if (handle) return handle;
|
|
121
|
+
}
|
|
122
|
+
} catch {
|
|
123
|
+
// Feature-detection must itself never throw.
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Pick the "current" tree fiber between `fiber` and its alternate by walking
|
|
130
|
+
* to the HostRoot and comparing against `root.stateNode.current`.
|
|
131
|
+
*
|
|
132
|
+
* Returns the input fiber when the root cannot be resolved (best-effort).
|
|
133
|
+
*/
|
|
134
|
+
function resolveCurrentFiber(fiber) {
|
|
135
|
+
if (!fiber) return fiber;
|
|
136
|
+
try {
|
|
137
|
+
const alternate = getAlternate(fiber);
|
|
138
|
+
if (!alternate) return fiber;
|
|
139
|
+
let cur = fiber;
|
|
140
|
+
for (let depth = 0; cur && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
141
|
+
if (getFiberTag(cur) === HOST_ROOT_TAG) {
|
|
142
|
+
const rootState = getStateNode(cur);
|
|
143
|
+
const currentRoot = rootState?.current;
|
|
144
|
+
if (!currentRoot) return fiber;
|
|
145
|
+
// Walk both candidates upward; whichever lands on currentRoot is live.
|
|
146
|
+
if (isInTree(fiber, currentRoot)) return fiber;
|
|
147
|
+
if (isInTree(alternate, currentRoot)) return alternate;
|
|
148
|
+
return fiber;
|
|
149
|
+
}
|
|
150
|
+
cur = getReturn(cur);
|
|
151
|
+
}
|
|
152
|
+
} catch {
|
|
153
|
+
// Best-effort.
|
|
154
|
+
}
|
|
155
|
+
return fiber;
|
|
156
|
+
}
|
|
157
|
+
function isInTree(fiber, root) {
|
|
158
|
+
let cur = fiber;
|
|
159
|
+
for (let depth = 0; cur && depth < MAX_ANCESTOR_WALK; depth += 1) {
|
|
160
|
+
if (cur === root) return true;
|
|
161
|
+
cur = getReturn(cur);
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* True when a previously-resolved fiber is still attached to a live tree
|
|
168
|
+
* (has a return path, or is itself a HostRoot).
|
|
169
|
+
*/
|
|
170
|
+
function isFiberMounted(fiber) {
|
|
171
|
+
if (!fiber) return false;
|
|
172
|
+
try {
|
|
173
|
+
if (getFiberTag(fiber) === HOST_ROOT_TAG) return true;
|
|
174
|
+
// A fiber with no return is detached (unless HostRoot, handled above).
|
|
175
|
+
return getReturn(fiber) != null;
|
|
176
|
+
} catch {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=fiberInternals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HOST_COMPONENT_TAG","HOST_ROOT_TAG","MAX_ANCESTOR_WALK","exports","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,MAAMC,aAAa,GAAG,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,MAAM;;AAEvC;AACA,MAAME,oBAAoB,GAAG,CAC3B,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,yBAAyB,EACzB,MAAM,EACN,WAAW,CACH;AAEH,SAASC,QAAQA,CAACC,KAAe,EAAmB;EACzD,OAAOA,KAAK,EAAEC,KAAK,IAAI,IAAI;AAC7B;AAEO,SAASC,UAAUA,CAACF,KAAe,EAAmB;EAC3D,OAAOA,KAAK,EAAEG,OAAO,IAAI,IAAI;AAC/B;AAEO,SAASC,SAASA,CAACJ,KAAe,EAAmB;EAC1D,OAAOA,KAAK,EAAEK,MAAM,IAAI,IAAI;AAC9B;AAEO,SAASC,YAAYA,CAACN,KAAe,EAAmB;EAC7D,OAAOA,KAAK,EAAEO,SAAS,IAAI,IAAI;AACjC;AAEO,SAASC,gBAAgBA,CAACR,KAAe,EAAuC;EACrF,MAAMS,CAAC,GAAGT,KAAK,EAAEU,aAAa;EAC9B,OAAOD,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,GAAIA,CAAC,G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