@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,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Mobile connection lifecycle policy.
|
|
5
|
+
*
|
|
6
|
+
* - Background / inactive → arm a short grace timer, then suspend the socket.
|
|
7
|
+
* Returning to active before grace elapses avoids suspend/resume churn: resume
|
|
8
|
+
* if already idle-suspended, otherwise probe liveness (`ensureAlive`) so a
|
|
9
|
+
* silently-dead socket recovers without waiting for the next heartbeat.
|
|
10
|
+
* - Foreground after grace but < {@link SESSION_STALE_AFTER_BACKGROUND_MS}
|
|
11
|
+
* (5 min) → resume and keep the mid-flow session (short-background “resume”).
|
|
12
|
+
* - Foreground after ≥ 5 min → clear local flow session, then resume
|
|
13
|
+
* (long-background reconnect without stale mid-flow UI).
|
|
14
|
+
* - Foreground idle for 5 min → suspend (skip while any flow session is active).
|
|
15
|
+
* - Activity while foreground → reset idle timer and resume if idle-suspended.
|
|
16
|
+
*
|
|
17
|
+
* This 5-minute policy is the ticket meaning of FLOW_RENDERING_SPEC “resume”:
|
|
18
|
+
* short backgrounds continue the active flow; long backgrounds clear then reconnect.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { AppState } from 'react-native';
|
|
22
|
+
/** Match web `INACTIVITY_TIMEOUT` — disconnect after this much idle time in foreground. */
|
|
23
|
+
export const INACTIVITY_TIMEOUT_MS = 5 * 60 * 1000;
|
|
24
|
+
|
|
25
|
+
/** Away this long → drop local mid-flow session before reconnecting. */
|
|
26
|
+
export const SESSION_STALE_AFTER_BACKGROUND_MS = 5 * 60 * 1000;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Delay before suspending on leave. Covers transient iOS `inactive` (Control
|
|
30
|
+
* Center, biometric prompts, app-switcher peek) and quick app-switches.
|
|
31
|
+
*/
|
|
32
|
+
export const SUSPEND_GRACE_MS = 3_000;
|
|
33
|
+
const defaultScheduler = {
|
|
34
|
+
setTimeout: (handler, ms) => setTimeout(handler, ms),
|
|
35
|
+
clearTimeout: handle => clearTimeout(handle)
|
|
36
|
+
};
|
|
37
|
+
function defaultSubscribeAppState(handler) {
|
|
38
|
+
const subscription = AppState.addEventListener('change', handler);
|
|
39
|
+
return () => subscription.remove();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Owns AppState subscription, background duration tracking, and the foreground
|
|
44
|
+
* idle timer. Call {@link start} from `Userflow.init` and {@link stop} from
|
|
45
|
+
* `Userflow.teardown`.
|
|
46
|
+
*/
|
|
47
|
+
export class LifecycleController {
|
|
48
|
+
unsubscribeAppState = null;
|
|
49
|
+
idleTimer = null;
|
|
50
|
+
graceTimer = null;
|
|
51
|
+
backgroundedAt = null;
|
|
52
|
+
appIsActive = true;
|
|
53
|
+
started = false;
|
|
54
|
+
/** True once the grace timer has fired (or we suspended on long-away resume). */
|
|
55
|
+
suspended = false;
|
|
56
|
+
constructor(deps) {
|
|
57
|
+
this.suspend = deps.suspend;
|
|
58
|
+
this.resume = deps.resume;
|
|
59
|
+
this.clearLocalSession = deps.clearLocalSession;
|
|
60
|
+
this.ensureAlive = deps.ensureAlive;
|
|
61
|
+
this.hasActiveSession = deps.hasActiveSession;
|
|
62
|
+
this.scheduler = deps.scheduler ?? defaultScheduler;
|
|
63
|
+
this.now = deps.now ?? (() => Date.now());
|
|
64
|
+
this.suspendGraceMs = deps.suspendGraceMs ?? SUSPEND_GRACE_MS;
|
|
65
|
+
this.getCurrentAppState = deps.getCurrentAppState ?? (() => AppState.currentState);
|
|
66
|
+
this.subscribeAppState = deps.subscribeAppState ?? defaultSubscribeAppState;
|
|
67
|
+
}
|
|
68
|
+
start() {
|
|
69
|
+
if (this.started) return;
|
|
70
|
+
this.started = true;
|
|
71
|
+
this.appIsActive = this.getCurrentAppState() === 'active';
|
|
72
|
+
this.unsubscribeAppState = this.subscribeAppState(status => {
|
|
73
|
+
this.handleAppStateChange(status);
|
|
74
|
+
});
|
|
75
|
+
if (this.appIsActive) {
|
|
76
|
+
this.scheduleIdleTimer();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
stop() {
|
|
80
|
+
if (!this.started) return;
|
|
81
|
+
this.started = false;
|
|
82
|
+
this.clearIdleTimer();
|
|
83
|
+
this.clearGraceTimer();
|
|
84
|
+
this.unsubscribeAppState?.();
|
|
85
|
+
this.unsubscribeAppState = null;
|
|
86
|
+
this.backgroundedAt = null;
|
|
87
|
+
this.suspended = false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Signal user/SDK activity while the app is foregrounded. Resets the idle
|
|
92
|
+
* timer and reconnects if the socket was idle-suspended.
|
|
93
|
+
*/
|
|
94
|
+
reportActivity() {
|
|
95
|
+
if (!this.started || !this.appIsActive) return;
|
|
96
|
+
this.resume();
|
|
97
|
+
this.suspended = false;
|
|
98
|
+
this.scheduleIdleTimer();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Visible for tests. */
|
|
102
|
+
handleAppStateChange(status) {
|
|
103
|
+
if (!this.started) return;
|
|
104
|
+
if (status === 'active') {
|
|
105
|
+
this.onForeground();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (status === 'background' || status === 'inactive') {
|
|
109
|
+
this.onBackground();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
onBackground() {
|
|
113
|
+
// Already leaving (e.g. inactive → background): keep first timestamp; do not
|
|
114
|
+
// re-arm the grace timer.
|
|
115
|
+
if (!this.appIsActive && this.backgroundedAt != null) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (this.appIsActive) {
|
|
119
|
+
this.backgroundedAt = this.now();
|
|
120
|
+
} else if (this.backgroundedAt == null) {
|
|
121
|
+
this.backgroundedAt = this.now();
|
|
122
|
+
}
|
|
123
|
+
this.appIsActive = false;
|
|
124
|
+
this.clearIdleTimer();
|
|
125
|
+
this.scheduleGraceTimer();
|
|
126
|
+
}
|
|
127
|
+
onForeground() {
|
|
128
|
+
const awayMs = this.backgroundedAt != null ? this.now() - this.backgroundedAt : 0;
|
|
129
|
+
this.backgroundedAt = null;
|
|
130
|
+
this.appIsActive = true;
|
|
131
|
+
this.clearGraceTimer();
|
|
132
|
+
if (awayMs < this.suspendGraceMs) {
|
|
133
|
+
// Transient blur / quick switch. If already idle-suspended, resume —
|
|
134
|
+
// ensureAlive is a no-op while the transport is lifecycle-suspended.
|
|
135
|
+
// Otherwise probe liveness so a silently-dead socket recovers fast.
|
|
136
|
+
if (this.suspended) {
|
|
137
|
+
this.resume();
|
|
138
|
+
this.suspended = false;
|
|
139
|
+
} else {
|
|
140
|
+
this.ensureAlive();
|
|
141
|
+
}
|
|
142
|
+
this.scheduleIdleTimer();
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Away past grace: ensure a clean suspend (covers iOS freezing JS before
|
|
147
|
+
// the grace timer fired) then resume. Clear mid-flow session if stale.
|
|
148
|
+
if (!this.suspended) {
|
|
149
|
+
this.suspend();
|
|
150
|
+
this.suspended = true;
|
|
151
|
+
}
|
|
152
|
+
if (awayMs >= SESSION_STALE_AFTER_BACKGROUND_MS) {
|
|
153
|
+
this.clearLocalSession();
|
|
154
|
+
}
|
|
155
|
+
this.resume();
|
|
156
|
+
this.suspended = false;
|
|
157
|
+
this.scheduleIdleTimer();
|
|
158
|
+
}
|
|
159
|
+
scheduleGraceTimer() {
|
|
160
|
+
this.clearGraceTimer();
|
|
161
|
+
this.graceTimer = this.scheduler.setTimeout(() => {
|
|
162
|
+
this.graceTimer = null;
|
|
163
|
+
if (this.appIsActive) return;
|
|
164
|
+
if (this.suspended) return;
|
|
165
|
+
this.suspend();
|
|
166
|
+
this.suspended = true;
|
|
167
|
+
}, this.suspendGraceMs);
|
|
168
|
+
}
|
|
169
|
+
clearGraceTimer() {
|
|
170
|
+
if (this.graceTimer != null) {
|
|
171
|
+
this.scheduler.clearTimeout(this.graceTimer);
|
|
172
|
+
this.graceTimer = null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
scheduleIdleTimer() {
|
|
176
|
+
this.clearIdleTimer();
|
|
177
|
+
this.idleTimer = this.scheduler.setTimeout(() => {
|
|
178
|
+
this.idleTimer = null;
|
|
179
|
+
if (!this.appIsActive) return;
|
|
180
|
+
if (this.hasActiveSession()) {
|
|
181
|
+
this.scheduleIdleTimer();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
this.suspend();
|
|
185
|
+
this.suspended = true;
|
|
186
|
+
}, INACTIVITY_TIMEOUT_MS);
|
|
187
|
+
}
|
|
188
|
+
clearIdleTimer() {
|
|
189
|
+
if (this.idleTimer != null) {
|
|
190
|
+
this.scheduler.clearTimeout(this.idleTimer);
|
|
191
|
+
this.idleTimer = null;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AppState","INACTIVITY_TIMEOUT_MS","SESSION_STALE_AFTER_BACKGROUND_MS","SUSPEND_GRACE_MS","defaultScheduler","setTimeout","handler","ms","clearTimeout","handle","defaultSubscribeAppState","subscription","addEventListener","remove","LifecycleController","unsubscribeAppState","idleTimer","graceTimer","backgroundedAt","appIsActive","started","suspended","constructor","deps","suspend","resume","clearLocalSession","ensureAlive","hasActiveSession","scheduler","now","Date","suspendGraceMs","getCurrentAppState","currentState","subscribeAppState","start","status","handleAppStateChange","scheduleIdleTimer","stop","clearIdleTimer","clearGraceTimer","reportActivity","onForeground","onBackground","scheduleGraceTimer","awayMs"],"sourceRoot":"../../src","sources":["lifecycle.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AAGvC;AACA,OAAO,MAAMC,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAElD;AACA,OAAO,MAAMC,iCAAiC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAE9D;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,KAAK;AAgCrC,MAAMC,gBAAoC,GAAG;EAC3CC,UAAU,EAAEA,CAACC,OAAO,EAAEC,EAAE,KAAKF,UAAU,CAACC,OAAO,EAAEC,EAAE,CAAC;EACpDC,YAAY,EAAGC,MAAM,IAAKD,YAAY,CAACC,MAAM;AAC/C,CAAC;AAED,SAASC,wBAAwBA,CAACJ,OAAyC,EAAc;EACvF,MAAMK,YAAqC,GAAGX,QAAQ,CAACY,gBAAgB,CAAC,QAAQ,EAAEN,OAAO,CAAC;EAC1F,OAAO,MAAMK,YAAY,CAACE,MAAM,CAAC,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAC;EAYvBC,mBAAmB,GAAwB,IAAI;EAC/CC,SAAS,GAAuB,IAAI;EACpCC,UAAU,GAAuB,IAAI;EACrCC,cAAc,GAAkB,IAAI;EACpCC,WAAW,GAAG,IAAI;EAClBC,OAAO,GAAG,KAAK;EACvB;EACQC,SAAS,GAAG,KAAK;EAEzBC,WAAWA,CAACC,IAA6B,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A,EAAS;IAC9B,IAAI,IAAI,CAACzB,UAAU,IAAI,IAAI,EAAE;MAC3B,IAAI,CAACY,SAAS,CAACrB,YAAY,CAAC,IAAI,CAACS,UAAU,CAAC;MAC5C,IAAI,CAACA,UAAU,GAAG,IAAI;IACxB;EACF;EAEQsB,iBAAiBA,CAAA,EAAS;IAChC,IAAI,CAACE,cAAc,CAAC,CAAC;IACrB,IAAI,CAACzB,SAAS,GAAG,IAAI,CAACa,SAAS,CAACxB,UAAU,CAAC,MAAM;MAC/C,IAAI,CAACW,SAAS,GAAG,IAAI;MACrB,IAAI,CAAC,IAAI,CAACG,WAAW,EAAE;MACvB,IAAI,IAAI,CAACS,gBAAgB,CAAC,CAAC,EAAE;QAC3B,IAAI,CAACW,iBAAiB,CAAC,CAAC;QACxB;MACF;MACA,IAAI,CAACf,OAAO,CAAC,CAAC;MACd,IAAI,CAACH,SAAS,GAAG,IAAI;IACvB,CAAC,EAAEpB,qBAAqB,CAAC;EAC3B;EAEQwC,cAAcA,CAAA,EAAS;IAC7B,IAAI,IAAI,CAACzB,SAAS,IAAI,IAAI,EAAE;MAC1B,IAAI,CAACa,SAAS,CAACrB,YAAY,CAAC,IAAI,CAACQ,SAAS,CAAC;MAC3C,IAAI,CAACA,SAAS,GAAG,IAAI;IACvB;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useNavigationContainerRef } from '@react-navigation/native';
|
|
4
|
+
import { cloneElement, isValidElement, useCallback, useEffect } from 'react';
|
|
5
|
+
import { handleScreenChange } from "../screenTracker.js";
|
|
6
|
+
import { chainCallbacks } from "./chainCallbacks.js";
|
|
7
|
+
import { getActiveRouteName } from "./getActiveRouteName.js";
|
|
8
|
+
import { setReactNavigationRef } from "./openFlowNavigateUrl.js";
|
|
9
|
+
function assignRef(ref, value) {
|
|
10
|
+
if (typeof ref === 'function') {
|
|
11
|
+
ref(value);
|
|
12
|
+
} else if (ref != null && typeof ref === 'object' && 'current' in ref) {
|
|
13
|
+
ref.current = value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function mergeRefs(...refs) {
|
|
17
|
+
return value => {
|
|
18
|
+
for (const ref of refs) {
|
|
19
|
+
assignRef(ref, value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Wraps a React Navigation `NavigationContainer` to report screen changes to
|
|
26
|
+
* Userflow after {@link Userflow.init} has completed.
|
|
27
|
+
*
|
|
28
|
+
* Also registers the container ref for in-app NAVIGATE actions (path-like URLs).
|
|
29
|
+
* Screen tracking ≠ action routing — without this wrapper, NAVIGATE falls back to
|
|
30
|
+
* Linking / host `onNavigate`.
|
|
31
|
+
*/
|
|
32
|
+
export function WithUserflowReactNavigation({
|
|
33
|
+
children
|
|
34
|
+
}) {
|
|
35
|
+
const navigationRef = useNavigationContainerRef();
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setReactNavigationRef(navigationRef);
|
|
38
|
+
return () => {
|
|
39
|
+
setReactNavigationRef(null);
|
|
40
|
+
};
|
|
41
|
+
}, [navigationRef]);
|
|
42
|
+
const handleReady = useCallback(() => {
|
|
43
|
+
setReactNavigationRef(navigationRef);
|
|
44
|
+
const name = getActiveRouteName(navigationRef.getRootState());
|
|
45
|
+
handleScreenChange(name ? {
|
|
46
|
+
screen: name
|
|
47
|
+
} : undefined);
|
|
48
|
+
}, [navigationRef]);
|
|
49
|
+
const handleStateChange = useCallback(state => {
|
|
50
|
+
const name = getActiveRouteName(state ?? navigationRef.getRootState());
|
|
51
|
+
handleScreenChange(name ? {
|
|
52
|
+
screen: name
|
|
53
|
+
} : undefined);
|
|
54
|
+
}, [navigationRef]);
|
|
55
|
+
if (! /*#__PURE__*/isValidElement(children)) {
|
|
56
|
+
throw new Error('WithUserflowReactNavigation expects a single React element child.');
|
|
57
|
+
}
|
|
58
|
+
const childProps = children.props;
|
|
59
|
+
return /*#__PURE__*/cloneElement(children, {
|
|
60
|
+
ref: mergeRefs(childProps.ref, navigationRef),
|
|
61
|
+
onReady: chainCallbacks(childProps.onReady, handleReady) ?? handleReady,
|
|
62
|
+
onStateChange: chainCallbacks(childProps.onStateChange, handleStateChange) ?? handleStateChange
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=WithUserflowReactNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useNavigationContainerRef","cloneElement","isValidElement","useCallback","useEffect","handleScreenChange","chainCallbacks","getActiveRouteName","setReactNavigationRef","assignRef","ref","value","current","mergeRefs","refs","WithUserflowReactNavigation","children","navigationRef","handleReady","name","getRootState","screen","undefined","handleStateChange","state","Error","childProps","props","onReady","onStateChange"],"sourceRoot":"../../../src","sources":["navigation/WithUserflowReactNavigation.tsx"],"mappings":";;AAAA,SAASA,yBAAyB,QAAQ,0BAA0B;AAMpE,SAASC,YAAY,EAAEC,cAAc,EAAEC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AAG5E,SAASC,kBAAkB,QAAQ,qBAAkB;AAErD,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SAASC,qBAAqB,QAAQ,0BAAuB;AAY7D,SAASC,SAASA,CAAIC,GAA6B,EAAEC,KAAe,EAAQ;EAC1E,IAAI,OAAOD,GAAG,KAAK,UAAU,EAAE;IAC7BA,GAAG,CAACC,KAAK,CAAC;EACZ,CAAC,MAAM,IAAID,GAAG,IAAI,IAAI,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAIA,GAAG,EAAE;IACpEA,GAAG,CAAsCE,OAAO,GAAGD,KAAK;EAC3D;AACF;AAEA,SAASE,SAASA,CAAI,GAAGC,IAAqC,EAAwB;EACpF,OAAQH,KAAK,IAAK;IAChB,KAAK,MAAMD,GAAG,IAAII,IAAI,EAAE;MACtBL,SAAS,CAACC,G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OAAO,EAAEV,WAAW,CAAC,IAAIA,WAAW;IACvEW,aAAa,EAAEvB,cAAc,CAACoB,UAAU,CAACG,aAAa,EAAEN,iBAAiB,CAAC,IAAIA;EAChF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Runs two optional callbacks in sequence, forwarding the same arguments. */
|
|
4
|
+
export function chainCallbacks(first, second) {
|
|
5
|
+
if (!first) return second;
|
|
6
|
+
if (!second) return first;
|
|
7
|
+
return (...args) => {
|
|
8
|
+
first(...args);
|
|
9
|
+
second(...args);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=chainCallbacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["chainCallbacks","first","second","args"],"sourceRoot":"../../../src","sources":["navigation/chainCallbacks.ts"],"mappings":";;AAAA;AACA,OAAO,SAASA,cAAcA,CAC5BC,KAAyC,EACzCC,MAA0C,EACN;EACpC,IAAI,CAACD,KAAK,EAAE,OAAOC,MAAM;EACzB,IAAI,CAACA,MAAM,EAAE,OAAOD,KAAK;EACzB,OAAO,CAAC,GAAGE,IAAO,KAAK;IACrBF,KAAK,CAAC,GAAGE,IAAI,CAAC;IACdD,MAAM,CAAC,GAAGC,IAAI,CAAC;EACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Returns the deepest active route name from a React Navigation state tree. */
|
|
4
|
+
export function getActiveRouteName(state) {
|
|
5
|
+
if (!state) return undefined;
|
|
6
|
+
const index = state.index ?? 0;
|
|
7
|
+
const route = state.routes[index];
|
|
8
|
+
if (!route) return undefined;
|
|
9
|
+
if (route.state) {
|
|
10
|
+
return getActiveRouteName(route.state);
|
|
11
|
+
}
|
|
12
|
+
return route.name;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=getActiveRouteName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getActiveRouteName","state","undefined","index","route","routes","name"],"sourceRoot":"../../../src","sources":["navigation/getActiveRouteName.ts"],"mappings":";;AAIA;AACA,OAAO,SAASA,kBAAkBA,CAACC,KAAgC,EAAsB;EACvF,IAAI,CAACA,KAAK,EAAE,OAAOC,SAAS;EAE5B,MAAMC,KAAK,GAAGF,KAAK,CAACE,KAAK,IAAI,CAAC;EAC9B,MAAMC,KAAK,GAAGH,KAAK,CAACI,MAAM,CAACF,KAAK,CAAC;EACjC,IAAI,CAACC,KAAK,EAAE,OAAOF,SAAS;EAE5B,IAAIE,KAAK,CAACH,KAAK,EAAE;IACf,OAAOD,kBAAkB,CAACI,KAAK,CAACH,KAAK,CAAC;EACxC;EAEA,OAAOG,KAAK,CAACE,IAAI;AACnB","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { WithUserflowReactNavigation } from "./WithUserflowReactNavigation.js";
|
|
4
|
+
export { openFlowNavigateUrl, setHostOnNavigate, setReactNavigationRef, setExpoRouterNavigator, isExternalNavigateUrl, isInAppNavigateUrl } from "./openFlowNavigateUrl.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WithUserflowReactNavigation","openFlowNavigateUrl","setHostOnNavigate","setReactNavigationRef","setExpoRouterNavigator","isExternalNavigateUrl","isInAppNavigateUrl"],"sourceRoot":"../../../src","sources":["navigation/index.ts"],"mappings":";;AAAA,SAASA,2BAA2B,QAAQ,kCAA+B;AAE3E,SACEC,mBAAmB,EACnBC,iBAAiB,EACjBC,qBAAqB,EACrBC,sBAAsB,EACtBC,qBAAqB,EACrBC,kBAAkB,QACb,0BAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Linking } from 'react-native';
|
|
4
|
+
import { isSafeUrl, openSafeUrl } from "../content/openSafeUrl.js";
|
|
5
|
+
let hostOnNavigate = null;
|
|
6
|
+
let navigationRef = null;
|
|
7
|
+
let expoRouter = null;
|
|
8
|
+
|
|
9
|
+
/** Optional host escape hatch — wins over router / Linking when set. */
|
|
10
|
+
export function setHostOnNavigate(handler) {
|
|
11
|
+
hostOnNavigate = handler ?? null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Register the React Navigation container used by {@link WithUserflowReactNavigation}. */
|
|
15
|
+
export function setReactNavigationRef(ref) {
|
|
16
|
+
navigationRef = ref ?? null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Register Expo Router push for path-like NAVIGATE actions. */
|
|
20
|
+
export function setExpoRouterNavigator(router) {
|
|
21
|
+
expoRouter = router ?? null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** True for http(s) / mailto / tel (external). */
|
|
25
|
+
export function isExternalNavigateUrl(url) {
|
|
26
|
+
return isSafeUrl(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Path-like in-app URL: leading slash, or no scheme. */
|
|
30
|
+
export function isInAppNavigateUrl(url) {
|
|
31
|
+
const trimmed = url.trim();
|
|
32
|
+
if (!trimmed) return false;
|
|
33
|
+
if (isExternalNavigateUrl(trimmed)) return false;
|
|
34
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
function normalizeInAppPath(url) {
|
|
38
|
+
const trimmed = url.trim();
|
|
39
|
+
if (trimmed.startsWith('/')) return trimmed;
|
|
40
|
+
return `/${trimmed}`;
|
|
41
|
+
}
|
|
42
|
+
function routeNameFromPath(path) {
|
|
43
|
+
const normalized = normalizeInAppPath(path).replace(/^\//, '');
|
|
44
|
+
const [first] = normalized.split(/[/?#]/);
|
|
45
|
+
return first || normalized;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Open a flow NAVIGATE url.
|
|
50
|
+
*
|
|
51
|
+
* Priority:
|
|
52
|
+
* 1. Host `onNavigate` (custom schemes / exotic routing)
|
|
53
|
+
* 2. External allowlisted schemes → Linking / `openSafeUrl`
|
|
54
|
+
* 3. Path-like → Expo Router `push` or React Navigation `navigate`
|
|
55
|
+
* 4. Fallback → Linking (best-effort)
|
|
56
|
+
*
|
|
57
|
+
* Note: screen tracking ≠ action routing. React Navigation hosts must wrap with
|
|
58
|
+
* `WithUserflowReactNavigation` for in-app NAVIGATE; Expo Router apps get a
|
|
59
|
+
* navigator handle when the host mounts `UserflowExpoRouterScreenTracker` from
|
|
60
|
+
* `@userflow-tech/react-native/expo-router` under `UserflowProvider`.
|
|
61
|
+
*/
|
|
62
|
+
export async function openFlowNavigateUrl(url) {
|
|
63
|
+
const trimmed = url.trim();
|
|
64
|
+
if (!trimmed) return;
|
|
65
|
+
if (hostOnNavigate) {
|
|
66
|
+
await hostOnNavigate(trimmed);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (isExternalNavigateUrl(trimmed)) {
|
|
70
|
+
await openSafeUrl(trimmed);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (isInAppNavigateUrl(trimmed)) {
|
|
74
|
+
if (expoRouter) {
|
|
75
|
+
expoRouter.push(normalizeInAppPath(trimmed));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (navigationRef?.isReady()) {
|
|
79
|
+
const name = routeNameFromPath(trimmed);
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- route names are host-defined
|
|
81
|
+
navigationRef.navigate(name);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Last resort — may fail for custom schemes; hosts should set onNavigate.
|
|
87
|
+
try {
|
|
88
|
+
await Linking.openURL(trimmed);
|
|
89
|
+
} catch {
|
|
90
|
+
// Best-effort.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** @internal */
|
|
95
|
+
export function resetFlowNavigateRegistryForTests() {
|
|
96
|
+
hostOnNavigate = null;
|
|
97
|
+
navigationRef = null;
|
|
98
|
+
expoRouter = null;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=openFlowNavigateUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Linking","isSafeUrl","openSafeUrl","hostOnNavigate","navigationRef","expoRouter","setHostOnNavigate","handler","setReactNavigationRef","ref","setExpoRouterNavigator","router","isExternalNavigateUrl","url","isInAppNavigateUrl","trimmed","trim","test","normalizeInAppPath","startsWith","routeNameFromPath","path","normalized","replace","first","split","openFlowNavigateUrl","push","isReady","name","navigate","openURL","resetFlowNavigateRegistryForTests"],"sourceRoot":"../../../src","sources":["navigation/openFlowNavigateUrl.ts"],"mappings":";;AACA,SAASA,OAAO,QAAQ,cAAc;AAEtC,SAASC,SAAS,EAAEC,WAAW,QAAQ,2BAAwB;AAQ/D,IAAIC,cAA0C,GAAG,IAAI;AACrD,IAAIC,aAA2D,GAAG,IAAI;AACtE,IAAIC,UAAiC,GAAG,IAAI;;AAE5C;AACA,OAAO,SAASC,iBAAiBA,CAACC,OAA+C,EAAQ;EACvFJ,cAAc,GAAGI,OAAO,IAAI,IAAI;AAClC;;AAEA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,GAA6D,EACvD;EACNL,aAAa,GAAGK,GAAG,IAAI,IAAI;AAC7B;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CAACC,MAAyC,EAAQ;EACtFN,UAAU,GAAGM,MAAM,IAAI,IAAI;AAC7B;;AAEA;AACA,OAAO,SAASC,qBAAqBA,CAACC,GAAW,EAAW;EAC1D,OAAOZ,SAAS,CAACY,GAAG,CAAC;AACvB;;AAEA;AACA,OAAO,SAASC,kBAAkBA,CAACD,GAAW,EAAW;EACvD,MAAME,OAAO,GAAGF,GA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AAC,CAAC,EAAE;MAC5B,MAAMC,IAAI,GAAGT,iBAAiB,CAACL,OAAO,CAAC;MACvC;MACCX,aAAa,CAA2C0B,QAAQ,CAACD,IAAW,CAAC;MAC9E;IACF;EACF;;EAEA;EACA,IAAI;IACF,MAAM7B,OAAO,CAAC+B,OAAO,CAAChB,OAAO,CAAC;EAChC,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ;;AAEA;AACA,OAAO,SAASiB,iCAAiCA,CAAA,EAAS;EACxD7B,cAAc,GAAG,IAAI;EACrBC,aAAa,GAAG,IAAI;EACpBC,UAAU,GAAG,IAAI;AACnB","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Network reachability → eager liveness check (optional enhancement).
|
|
5
|
+
*
|
|
6
|
+
* When connectivity returns while the app is foregrounded (and the transport is
|
|
7
|
+
* not suspended), call {@link NetworkControllerDeps.ensureAlive} so we do not
|
|
8
|
+
* wait for the adaptive heartbeat / foreground probe to notice the drop.
|
|
9
|
+
* `ensureAlive` probes a still-open (possibly half-dead) socket and reconnects
|
|
10
|
+
* eagerly when the transport is already dropped — covering both cases.
|
|
11
|
+
*
|
|
12
|
+
* This is layered on top of a complete zero-dependency recovery path (socket
|
|
13
|
+
* close → reconnect ladder, adaptive heartbeat, and the foreground liveness
|
|
14
|
+
* probe). `@react-native-community/netinfo` is therefore an *optional* peer: when
|
|
15
|
+
* present it makes offline→online recovery fast; when absent the baseline still
|
|
16
|
+
* recovers within a few seconds of the next beat / foreground return.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function isOnline(status) {
|
|
20
|
+
return status.isConnected === true && status.isInternetReachable !== false;
|
|
21
|
+
}
|
|
22
|
+
function defaultSubscribe(handler) {
|
|
23
|
+
// Lazy require so the SDK works without the optional peer. When installed,
|
|
24
|
+
// NetInfo makes offline→online reconnect fast; when absent the transport's
|
|
25
|
+
// adaptive heartbeat + foreground probe still recover the connection.
|
|
26
|
+
try {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- optional peer at import time
|
|
28
|
+
const NetInfo = require('@react-native-community/netinfo');
|
|
29
|
+
return NetInfo.addEventListener(state => {
|
|
30
|
+
handler({
|
|
31
|
+
isConnected: state.isConnected,
|
|
32
|
+
isInternetReachable: state.isInternetReachable
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
} catch {
|
|
36
|
+
if (__DEV__) {
|
|
37
|
+
// eslint-disable-next-line no-console -- intentional missing-optional-peer diagnostic
|
|
38
|
+
console.warn('[Userflow] Optional peer @react-native-community/netinfo is not installed; ' + 'skipping instant network-aware reconnect. Connection recovery still works ' + 'via the adaptive heartbeat and foreground liveness probe.');
|
|
39
|
+
}
|
|
40
|
+
return () => {};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Owns the NetInfo subscription. Call {@link start} from `Userflow.init` and
|
|
46
|
+
* {@link stop} from `Userflow.teardown`.
|
|
47
|
+
*/
|
|
48
|
+
export class NetworkController {
|
|
49
|
+
unsubscribe = null;
|
|
50
|
+
started = false;
|
|
51
|
+
wasOnline = null;
|
|
52
|
+
constructor(deps) {
|
|
53
|
+
this.ensureAlive = deps.ensureAlive;
|
|
54
|
+
this.subscribe = deps.subscribe ?? defaultSubscribe;
|
|
55
|
+
}
|
|
56
|
+
start() {
|
|
57
|
+
if (this.started) return;
|
|
58
|
+
this.started = true;
|
|
59
|
+
this.unsubscribe = this.subscribe(status => {
|
|
60
|
+
this.handleStatus(status);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
stop() {
|
|
64
|
+
if (!this.started) return;
|
|
65
|
+
this.started = false;
|
|
66
|
+
this.unsubscribe?.();
|
|
67
|
+
this.unsubscribe = null;
|
|
68
|
+
this.wasOnline = null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Visible for tests. */
|
|
72
|
+
handleStatus(status) {
|
|
73
|
+
if (!this.started) return;
|
|
74
|
+
const online = isOnline(status);
|
|
75
|
+
const previous = this.wasOnline;
|
|
76
|
+
this.wasOnline = online;
|
|
77
|
+
|
|
78
|
+
// First sample only seeds state — do not reconnect on start.
|
|
79
|
+
if (previous === null) return;
|
|
80
|
+
if (!previous && online) {
|
|
81
|
+
this.ensureAlive();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isOnline","status","isConnected","isInternetReachable","defaultSubscribe","handler","NetInfo","require","addEventListener","state","__DEV__","console","warn","NetworkController","unsubscribe","started","wasOnline","constructor","deps","ensureAlive","subscribe","start","handleStatus","stop","online","previous"],"sourceRoot":"../../src","sources":["network.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,SAASA,QAAQA,CAACC,MAAqB,EAAW;EAChD,OAAOA,MAAM,CAACC,WAAW,KAAK,IAAI,IAAID,MAAM,CAACE,mBAAmB,KAAK,KAAK;AAC5E;AAEA,SAASC,gBAAgBA,CAACC,OAAwC,EAAc;EAC9E;EACA;EACA;EACA,IAAI;IACF;IACA,MAAMC,OAAO,GAAGC,OAAO,CAAC,iCAAiC,CAOxD;IACD,OAAOD,OAAO,CAACE,gBAAgB,CAAEC,KAAK,IAAK;MACzCJ,OAAO,CAAC;QACNH,WAAW,EAAEO,KAAK,CAACP,WAAW;QAC9BC,mBAAmB,EAAEM,KAAK,CAACN;MAC7B,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC,MAAM;IACN,IAAIO,OAAO,EAAE;MACX;MACAC,OAAO,CAACC,IAAI,CACV,6EAA6E,GAC3E,4EAA4E,GAC5E,2DACJ,CAAC;IACH;IACA,OAAO,MAAM,CAAC,CAAC;EACjB;AACF;;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