@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,12 @@
|
|
|
1
|
+
/** Runs two optional callbacks in sequence, forwarding the same arguments. */
|
|
2
|
+
export function chainCallbacks<A extends unknown[]>(
|
|
3
|
+
first: ((...args: A) => void) | undefined,
|
|
4
|
+
second: ((...args: A) => void) | undefined,
|
|
5
|
+
): ((...args: A) => void) | undefined {
|
|
6
|
+
if (!first) return second;
|
|
7
|
+
if (!second) return first;
|
|
8
|
+
return (...args: A) => {
|
|
9
|
+
first(...args);
|
|
10
|
+
second(...args);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NavigationState, PartialState } from '@react-navigation/native';
|
|
2
|
+
|
|
3
|
+
type RoutableState = NavigationState | PartialState<NavigationState>;
|
|
4
|
+
|
|
5
|
+
/** Returns the deepest active route name from a React Navigation state tree. */
|
|
6
|
+
export function getActiveRouteName(state: RoutableState | undefined): string | undefined {
|
|
7
|
+
if (!state) return undefined;
|
|
8
|
+
|
|
9
|
+
const index = state.index ?? 0;
|
|
10
|
+
const route = state.routes[index];
|
|
11
|
+
if (!route) return undefined;
|
|
12
|
+
|
|
13
|
+
if (route.state) {
|
|
14
|
+
return getActiveRouteName(route.state);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return route.name;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { WithUserflowReactNavigation } from './WithUserflowReactNavigation';
|
|
2
|
+
export type { WithUserflowReactNavigationProps } from './WithUserflowReactNavigation';
|
|
3
|
+
export {
|
|
4
|
+
openFlowNavigateUrl,
|
|
5
|
+
setHostOnNavigate,
|
|
6
|
+
setReactNavigationRef,
|
|
7
|
+
setExpoRouterNavigator,
|
|
8
|
+
isExternalNavigateUrl,
|
|
9
|
+
isInAppNavigateUrl,
|
|
10
|
+
} from './openFlowNavigateUrl';
|
|
11
|
+
export type { FlowNavigateHandler, ExpoRouterLike } from './openFlowNavigateUrl';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { NavigationContainerRef, ParamListBase } from '@react-navigation/native';
|
|
2
|
+
import { Linking } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { isSafeUrl, openSafeUrl } from '../content/openSafeUrl';
|
|
5
|
+
|
|
6
|
+
export type FlowNavigateHandler = (url: string) => void | boolean | Promise<void | boolean>;
|
|
7
|
+
|
|
8
|
+
export type ExpoRouterLike = {
|
|
9
|
+
push: (href: string) => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let hostOnNavigate: FlowNavigateHandler | null = null;
|
|
13
|
+
let navigationRef: NavigationContainerRef<ParamListBase> | null = null;
|
|
14
|
+
let expoRouter: ExpoRouterLike | null = null;
|
|
15
|
+
|
|
16
|
+
/** Optional host escape hatch — wins over router / Linking when set. */
|
|
17
|
+
export function setHostOnNavigate(handler: FlowNavigateHandler | null | undefined): void {
|
|
18
|
+
hostOnNavigate = handler ?? null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Register the React Navigation container used by {@link WithUserflowReactNavigation}. */
|
|
22
|
+
export function setReactNavigationRef(
|
|
23
|
+
ref: NavigationContainerRef<ParamListBase> | null | undefined,
|
|
24
|
+
): void {
|
|
25
|
+
navigationRef = ref ?? null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Register Expo Router push for path-like NAVIGATE actions. */
|
|
29
|
+
export function setExpoRouterNavigator(router: ExpoRouterLike | null | undefined): void {
|
|
30
|
+
expoRouter = router ?? null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** True for http(s) / mailto / tel (external). */
|
|
34
|
+
export function isExternalNavigateUrl(url: string): boolean {
|
|
35
|
+
return isSafeUrl(url);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Path-like in-app URL: leading slash, or no scheme. */
|
|
39
|
+
export function isInAppNavigateUrl(url: string): boolean {
|
|
40
|
+
const trimmed = url.trim();
|
|
41
|
+
if (!trimmed) return false;
|
|
42
|
+
if (isExternalNavigateUrl(trimmed)) return false;
|
|
43
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return false;
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function normalizeInAppPath(url: string): string {
|
|
48
|
+
const trimmed = url.trim();
|
|
49
|
+
if (trimmed.startsWith('/')) return trimmed;
|
|
50
|
+
return `/${trimmed}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function routeNameFromPath(path: string): string {
|
|
54
|
+
const normalized = normalizeInAppPath(path).replace(/^\//, '');
|
|
55
|
+
const [first] = normalized.split(/[/?#]/);
|
|
56
|
+
return first || normalized;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Open a flow NAVIGATE url.
|
|
61
|
+
*
|
|
62
|
+
* Priority:
|
|
63
|
+
* 1. Host `onNavigate` (custom schemes / exotic routing)
|
|
64
|
+
* 2. External allowlisted schemes → Linking / `openSafeUrl`
|
|
65
|
+
* 3. Path-like → Expo Router `push` or React Navigation `navigate`
|
|
66
|
+
* 4. Fallback → Linking (best-effort)
|
|
67
|
+
*
|
|
68
|
+
* Note: screen tracking ≠ action routing. React Navigation hosts must wrap with
|
|
69
|
+
* `WithUserflowReactNavigation` for in-app NAVIGATE; Expo Router apps get a
|
|
70
|
+
* navigator handle when the host mounts `UserflowExpoRouterScreenTracker` from
|
|
71
|
+
* `@userflow-tech/react-native/expo-router` under `UserflowProvider`.
|
|
72
|
+
*/
|
|
73
|
+
export async function openFlowNavigateUrl(url: string): Promise<void> {
|
|
74
|
+
const trimmed = url.trim();
|
|
75
|
+
if (!trimmed) return;
|
|
76
|
+
|
|
77
|
+
if (hostOnNavigate) {
|
|
78
|
+
await hostOnNavigate(trimmed);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (isExternalNavigateUrl(trimmed)) {
|
|
83
|
+
await openSafeUrl(trimmed);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (isInAppNavigateUrl(trimmed)) {
|
|
88
|
+
if (expoRouter) {
|
|
89
|
+
expoRouter.push(normalizeInAppPath(trimmed));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (navigationRef?.isReady()) {
|
|
93
|
+
const name = routeNameFromPath(trimmed);
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- route names are host-defined
|
|
95
|
+
(navigationRef as NavigationContainerRef<ParamListBase>).navigate(name as any);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Last resort — may fail for custom schemes; hosts should set onNavigate.
|
|
101
|
+
try {
|
|
102
|
+
await Linking.openURL(trimmed);
|
|
103
|
+
} catch {
|
|
104
|
+
// Best-effort.
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export function resetFlowNavigateRegistryForTests(): void {
|
|
110
|
+
hostOnNavigate = null;
|
|
111
|
+
navigationRef = null;
|
|
112
|
+
expoRouter = null;
|
|
113
|
+
}
|
package/src/network.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network reachability → eager liveness check (optional enhancement).
|
|
3
|
+
*
|
|
4
|
+
* When connectivity returns while the app is foregrounded (and the transport is
|
|
5
|
+
* not suspended), call {@link NetworkControllerDeps.ensureAlive} so we do not
|
|
6
|
+
* wait for the adaptive heartbeat / foreground probe to notice the drop.
|
|
7
|
+
* `ensureAlive` probes a still-open (possibly half-dead) socket and reconnects
|
|
8
|
+
* eagerly when the transport is already dropped — covering both cases.
|
|
9
|
+
*
|
|
10
|
+
* This is layered on top of a complete zero-dependency recovery path (socket
|
|
11
|
+
* close → reconnect ladder, adaptive heartbeat, and the foreground liveness
|
|
12
|
+
* probe). `@react-native-community/netinfo` is therefore an *optional* peer: when
|
|
13
|
+
* present it makes offline→online recovery fast; when absent the baseline still
|
|
14
|
+
* recovers within a few seconds of the next beat / foreground return.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface NetworkStatus {
|
|
18
|
+
isConnected: boolean | null;
|
|
19
|
+
/** `null` means unknown — treat as reachable when connected. */
|
|
20
|
+
isInternetReachable: boolean | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface NetworkControllerDeps {
|
|
24
|
+
ensureAlive: () => void;
|
|
25
|
+
/** Override for tests; defaults to `@react-native-community/netinfo`. */
|
|
26
|
+
subscribe?: (handler: (status: NetworkStatus) => void) => () => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isOnline(status: NetworkStatus): boolean {
|
|
30
|
+
return status.isConnected === true && status.isInternetReachable !== false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function defaultSubscribe(handler: (status: NetworkStatus) => void): () => void {
|
|
34
|
+
// Lazy require so the SDK works without the optional peer. When installed,
|
|
35
|
+
// NetInfo makes offline→online reconnect fast; when absent the transport's
|
|
36
|
+
// adaptive heartbeat + foreground probe still recover the connection.
|
|
37
|
+
try {
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- optional peer at import time
|
|
39
|
+
const NetInfo = require('@react-native-community/netinfo') as {
|
|
40
|
+
addEventListener: (
|
|
41
|
+
listener: (state: {
|
|
42
|
+
isConnected: boolean | null;
|
|
43
|
+
isInternetReachable: boolean | null;
|
|
44
|
+
}) => void,
|
|
45
|
+
) => () => void;
|
|
46
|
+
};
|
|
47
|
+
return NetInfo.addEventListener((state) => {
|
|
48
|
+
handler({
|
|
49
|
+
isConnected: state.isConnected,
|
|
50
|
+
isInternetReachable: state.isInternetReachable,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
} catch {
|
|
54
|
+
if (__DEV__) {
|
|
55
|
+
// eslint-disable-next-line no-console -- intentional missing-optional-peer diagnostic
|
|
56
|
+
console.warn(
|
|
57
|
+
'[Userflow] Optional peer @react-native-community/netinfo is not installed; ' +
|
|
58
|
+
'skipping instant network-aware reconnect. Connection recovery still works ' +
|
|
59
|
+
'via the adaptive heartbeat and foreground liveness probe.',
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return () => {};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Owns the NetInfo subscription. Call {@link start} from `Userflow.init` and
|
|
68
|
+
* {@link stop} from `Userflow.teardown`.
|
|
69
|
+
*/
|
|
70
|
+
export class NetworkController {
|
|
71
|
+
private readonly ensureAlive: () => void;
|
|
72
|
+
private readonly subscribe: (handler: (status: NetworkStatus) => void) => () => void;
|
|
73
|
+
|
|
74
|
+
private unsubscribe: (() => void) | null = null;
|
|
75
|
+
private started = false;
|
|
76
|
+
private wasOnline: boolean | null = null;
|
|
77
|
+
|
|
78
|
+
constructor(deps: NetworkControllerDeps) {
|
|
79
|
+
this.ensureAlive = deps.ensureAlive;
|
|
80
|
+
this.subscribe = deps.subscribe ?? defaultSubscribe;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
start(): void {
|
|
84
|
+
if (this.started) return;
|
|
85
|
+
this.started = true;
|
|
86
|
+
this.unsubscribe = this.subscribe((status) => {
|
|
87
|
+
this.handleStatus(status);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
stop(): void {
|
|
92
|
+
if (!this.started) return;
|
|
93
|
+
this.started = false;
|
|
94
|
+
this.unsubscribe?.();
|
|
95
|
+
this.unsubscribe = null;
|
|
96
|
+
this.wasOnline = null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Visible for tests. */
|
|
100
|
+
handleStatus(status: NetworkStatus): void {
|
|
101
|
+
if (!this.started) return;
|
|
102
|
+
|
|
103
|
+
const online = isOnline(status);
|
|
104
|
+
const previous = this.wasOnline;
|
|
105
|
+
this.wasOnline = online;
|
|
106
|
+
|
|
107
|
+
// First sample only seeds state — do not reconnect on start.
|
|
108
|
+
if (previous === null) return;
|
|
109
|
+
if (!previous && online) {
|
|
110
|
+
this.ensureAlive();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_PAIRING_ENDPOINT,
|
|
3
|
+
PairingEngine,
|
|
4
|
+
type PairingEngineState,
|
|
5
|
+
type UserflowCore,
|
|
6
|
+
} from '@userflow-tech/core';
|
|
7
|
+
import { AppState, type AppStateStatus, Linking, Platform } from 'react-native';
|
|
8
|
+
|
|
9
|
+
import { inspectPairingDeepLink, isPairingAttempt } from './deepLink';
|
|
10
|
+
import {
|
|
11
|
+
defaultPairingLogger,
|
|
12
|
+
pairingAttemptRejectionMessage,
|
|
13
|
+
pairingConnectFailedMessage,
|
|
14
|
+
pairingLinkDeferredMessage,
|
|
15
|
+
pairingLinkInitFailedMessage,
|
|
16
|
+
pairingListenerSetupFailedMessage,
|
|
17
|
+
pairingTokenStoreClearFailedMessage,
|
|
18
|
+
type PairingLogger,
|
|
19
|
+
} from './diagnostics';
|
|
20
|
+
import { createPairingTokenStore, type PairingTokenStore } from './tokenStorage';
|
|
21
|
+
|
|
22
|
+
export type PairingControllerListener = (state: PairingEngineState) => void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Readiness of the end-user session that a preview attaches to.
|
|
26
|
+
*
|
|
27
|
+
* Pairing listens independently of `Userflow.init()` so a QR link is never
|
|
28
|
+
* lost, but it can only connect once init has resolved. `Userflow.init` drives
|
|
29
|
+
* this via `notifyInitStarted` / `notifyInitialized` / `notifyInitFailed`;
|
|
30
|
+
* a controller nobody reports init progress for stays usable (`ready`).
|
|
31
|
+
*/
|
|
32
|
+
type InitPhase = 'pending' | 'ready' | 'failed';
|
|
33
|
+
|
|
34
|
+
export interface PairingControllerOptions {
|
|
35
|
+
core: UserflowCore;
|
|
36
|
+
/** Override pairing host (local/staging). Defaults to US-pinned production. */
|
|
37
|
+
pairingEndpoint?: string;
|
|
38
|
+
tokenStore?: PairingTokenStore;
|
|
39
|
+
/** Clear mid-flow session when exiting preview. */
|
|
40
|
+
clearLocalSession?: () => void;
|
|
41
|
+
LinkingModule?: {
|
|
42
|
+
getInitialURL(): Promise<string | null>;
|
|
43
|
+
addEventListener(type: 'url', handler: (event: { url: string }) => void): { remove(): void };
|
|
44
|
+
};
|
|
45
|
+
AppStateModule?: {
|
|
46
|
+
addEventListener(type: 'change', handler: (state: AppStateStatus) => void): { remove(): void };
|
|
47
|
+
};
|
|
48
|
+
/** Sink for pairing diagnostics. Injected in tests. */
|
|
49
|
+
logger?: PairingLogger;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Inbound deep links → pairing session → preview mode.
|
|
54
|
+
* Active in all builds (including release); security is the short-lived
|
|
55
|
+
* signed pairing JWT + Builder ability checks, not `__DEV__`.
|
|
56
|
+
*/
|
|
57
|
+
export class PairingController {
|
|
58
|
+
private engine: PairingEngine | null = null;
|
|
59
|
+
private started = false;
|
|
60
|
+
private urlSub: { remove(): void } | null = null;
|
|
61
|
+
private appStateSub: { remove(): void } | null = null;
|
|
62
|
+
private readonly listeners = new Set<PairingControllerListener>();
|
|
63
|
+
private readonly tokenStore: PairingTokenStore;
|
|
64
|
+
private readonly LinkingModule: NonNullable<PairingControllerOptions['LinkingModule']>;
|
|
65
|
+
private readonly AppStateModule: NonNullable<PairingControllerOptions['AppStateModule']>;
|
|
66
|
+
private readonly clearLocalSession: (() => void) | undefined;
|
|
67
|
+
private readonly core: UserflowCore;
|
|
68
|
+
private readonly pairingEndpoint: string;
|
|
69
|
+
private readonly logger: PairingLogger;
|
|
70
|
+
private initPhase: InitPhase = 'ready';
|
|
71
|
+
private initFailureReason: string | null = null;
|
|
72
|
+
/** Pairing token captured before init resolved, replayed once it does. */
|
|
73
|
+
private deferredPairingToken: string | null = null;
|
|
74
|
+
/** Diagnostics already emitted for the current init attempt. */
|
|
75
|
+
private readonly loggedOnce = new Set<string>();
|
|
76
|
+
|
|
77
|
+
constructor(options: PairingControllerOptions) {
|
|
78
|
+
this.core = options.core;
|
|
79
|
+
this.pairingEndpoint = options.pairingEndpoint ?? DEFAULT_PAIRING_ENDPOINT;
|
|
80
|
+
this.tokenStore = options.tokenStore ?? createPairingTokenStore();
|
|
81
|
+
this.LinkingModule = options.LinkingModule ?? Linking;
|
|
82
|
+
this.AppStateModule = options.AppStateModule ?? AppState;
|
|
83
|
+
this.clearLocalSession = options.clearLocalSession ?? undefined;
|
|
84
|
+
this.logger = options.logger ?? defaultPairingLogger;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
getEngine(): PairingEngine | null {
|
|
88
|
+
return this.engine;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Whether deep-link / AppState listeners have been started. */
|
|
92
|
+
hasStarted(): boolean {
|
|
93
|
+
return this.started;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
getState(): PairingEngineState {
|
|
97
|
+
const blocked = this.blockedState();
|
|
98
|
+
if (blocked) return blocked;
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
this.engine?.getState() ?? {
|
|
102
|
+
status: 'idle',
|
|
103
|
+
pairingId: null,
|
|
104
|
+
deviceId: null,
|
|
105
|
+
previewActive: false,
|
|
106
|
+
lastError: null,
|
|
107
|
+
needsRescan: false,
|
|
108
|
+
awaitingStartCondition: false,
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* State for a link we captured but cannot act on because init failed. Without
|
|
115
|
+
* this the host app shows no sign that a pairing link was ever received.
|
|
116
|
+
*/
|
|
117
|
+
private blockedState(): PairingEngineState | null {
|
|
118
|
+
if (this.initPhase !== 'failed' || this.deferredPairingToken === null) return null;
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
status: 'error',
|
|
122
|
+
pairingId: null,
|
|
123
|
+
deviceId: null,
|
|
124
|
+
previewActive: false,
|
|
125
|
+
lastError: `Userflow.init() failed, so preview could not start: ${
|
|
126
|
+
this.initFailureReason ?? 'unknown error'
|
|
127
|
+
}`,
|
|
128
|
+
needsRescan: true,
|
|
129
|
+
awaitingStartCondition: false,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
onStateChange(listener: PairingControllerListener): () => void {
|
|
134
|
+
this.listeners.add(listener);
|
|
135
|
+
return () => {
|
|
136
|
+
this.listeners.delete(listener);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Start deep-link listeners. Safe to call multiple times, and never rejects —
|
|
142
|
+
* `Userflow.init` fires it without awaiting, so a rejection here would become
|
|
143
|
+
* an unhandled promise rejection.
|
|
144
|
+
*/
|
|
145
|
+
async start(): Promise<void> {
|
|
146
|
+
if (this.started) return;
|
|
147
|
+
this.started = true;
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
await this.startListening();
|
|
151
|
+
} catch (error) {
|
|
152
|
+
this.warnOnce(pairingListenerSetupFailedMessage(describeError(error)));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
private async startListening(): Promise<void> {
|
|
157
|
+
// Exit pairing on app restart: drop any leftover secure token. Guarded so a
|
|
158
|
+
// storage failure cannot cost us the listeners registered below — losing
|
|
159
|
+
// those is what makes an inbound QR link vanish without explanation.
|
|
160
|
+
try {
|
|
161
|
+
await this.tokenStore.clear();
|
|
162
|
+
} catch (error) {
|
|
163
|
+
this.warnOnce(pairingTokenStoreClearFailedMessage(describeError(error)));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
this.ensureEngine();
|
|
167
|
+
|
|
168
|
+
this.urlSub = this.LinkingModule.addEventListener('url', ({ url }) => {
|
|
169
|
+
// handleUrl still rejects for explicit callers (Userflow.handlePairingUrl);
|
|
170
|
+
// the auto-listener has nowhere to report, so log instead of leaving an
|
|
171
|
+
// unhandled rejection.
|
|
172
|
+
void this.handleUrl(url).catch((error: unknown) => {
|
|
173
|
+
this.warnOnce(pairingConnectFailedMessage(describeError(error)));
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
this.appStateSub = this.AppStateModule.addEventListener('change', (next) => {
|
|
178
|
+
if (next === 'active') {
|
|
179
|
+
this.engine?.ensureAlive();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
try {
|
|
184
|
+
const initial = await this.LinkingModule.getInitialURL();
|
|
185
|
+
if (initial) await this.handleUrl(initial);
|
|
186
|
+
} catch {
|
|
187
|
+
// Linking may throw on some platforms before the native module is ready.
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
stop(): void {
|
|
192
|
+
this.urlSub?.remove();
|
|
193
|
+
this.urlSub = null;
|
|
194
|
+
this.appStateSub?.remove();
|
|
195
|
+
this.appStateSub = null;
|
|
196
|
+
this.started = false;
|
|
197
|
+
void this.exitPreview();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Host apps that intercept deep links themselves can forward them here.
|
|
202
|
+
*/
|
|
203
|
+
async handleUrl(url: string): Promise<boolean> {
|
|
204
|
+
const inspected = inspectPairingDeepLink(url);
|
|
205
|
+
|
|
206
|
+
if (!inspected.ok) {
|
|
207
|
+
// Links that are not recognisably ours belong to the host app. Stay silent
|
|
208
|
+
// so ordinary deep links — and preview links, which accept any
|
|
209
|
+
// `userflow-*` scheme — are never reported as pairing misconfiguration.
|
|
210
|
+
if (!isPairingAttempt(inspected.reason)) return false;
|
|
211
|
+
|
|
212
|
+
// A deliberate pairing attempt we cannot use. The OS already launched the
|
|
213
|
+
// app, so a silent return is indistinguishable from a broken deep link.
|
|
214
|
+
// Still return true — the URL was recognised as pairing, so the host
|
|
215
|
+
// should stop routing it (see docs/deep-linking.md).
|
|
216
|
+
this.warnOnce(pairingAttemptRejectionMessage(inspected.reason, url));
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (this.initPhase !== 'ready') {
|
|
221
|
+
// Hold the token rather than discarding it. `notifyInitialized` replays it;
|
|
222
|
+
// `notifyInitFailed` turns it into visible state.
|
|
223
|
+
this.deferredPairingToken = inspected.link.pairingToken;
|
|
224
|
+
this.warnOnce(
|
|
225
|
+
this.initPhase === 'failed'
|
|
226
|
+
? pairingLinkInitFailedMessage(this.initFailureReason ?? 'unknown error')
|
|
227
|
+
: pairingLinkDeferredMessage(),
|
|
228
|
+
);
|
|
229
|
+
if (this.initPhase === 'failed') this.emit(this.getState());
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
await this.enterPreview(inspected.link.pairingToken);
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Called when `Userflow.init()` begins. Clears a previous failure so a retried
|
|
239
|
+
* init does not keep reporting the old error.
|
|
240
|
+
*/
|
|
241
|
+
notifyInitStarted(): void {
|
|
242
|
+
// A retry is a fresh attempt: allow its diagnostics through again, and drop
|
|
243
|
+
// a "Preview unavailable" banner that no longer reflects reality.
|
|
244
|
+
const wasBlocked = this.blockedState() !== null;
|
|
245
|
+
this.initPhase = 'pending';
|
|
246
|
+
this.initFailureReason = null;
|
|
247
|
+
this.loggedOnce.clear();
|
|
248
|
+
if (wasBlocked) this.emit(this.getState());
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Called when `Userflow.init()` resolves. Connects a link that arrived while
|
|
253
|
+
* init was still in flight.
|
|
254
|
+
*/
|
|
255
|
+
async notifyInitialized(): Promise<void> {
|
|
256
|
+
this.initPhase = 'ready';
|
|
257
|
+
this.initFailureReason = null;
|
|
258
|
+
|
|
259
|
+
const deferred = this.deferredPairingToken;
|
|
260
|
+
if (deferred === null) return;
|
|
261
|
+
this.deferredPairingToken = null;
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
await this.enterPreview(deferred);
|
|
265
|
+
} catch (error) {
|
|
266
|
+
// Preview must not fail host init. `Userflow.init` awaits this, and
|
|
267
|
+
// PairingEngine.start rethrows on every connect failure, so letting this
|
|
268
|
+
// escape would let an expired QR token fail the host app's entire init.
|
|
269
|
+
this.warnOnce(pairingConnectFailedMessage(describeError(error)));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Called when `Userflow.init()` rejects. Pairing cannot connect without a
|
|
275
|
+
* session, so surface why instead of failing silently.
|
|
276
|
+
*/
|
|
277
|
+
notifyInitFailed(error: unknown): void {
|
|
278
|
+
this.initPhase = 'failed';
|
|
279
|
+
this.initFailureReason = describeError(error);
|
|
280
|
+
|
|
281
|
+
if (this.deferredPairingToken !== null) {
|
|
282
|
+
this.warnOnce(pairingLinkInitFailedMessage(this.initFailureReason));
|
|
283
|
+
this.emit(this.getState());
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Log `message` at most once per init attempt. Inbound links can repeat (URL
|
|
289
|
+
* event plus host forwarding), and these messages are several lines long.
|
|
290
|
+
*/
|
|
291
|
+
private warnOnce(message: string): void {
|
|
292
|
+
if (this.loggedOnce.has(message)) return;
|
|
293
|
+
this.loggedOnce.add(message);
|
|
294
|
+
this.logger(message);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/** Explicit entry with a raw pairing JWT (tests / advanced hosts). */
|
|
298
|
+
async enterPreview(pairingToken: string): Promise<void> {
|
|
299
|
+
const engine = this.ensureEngine();
|
|
300
|
+
await this.tokenStore.set(pairingToken);
|
|
301
|
+
await engine.start(pairingToken);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
async exitPreview(): Promise<void> {
|
|
305
|
+
// Drop any held link too, so dismissing a blocked banner actually clears it.
|
|
306
|
+
this.deferredPairingToken = null;
|
|
307
|
+
await this.tokenStore.clear();
|
|
308
|
+
this.engine?.stop();
|
|
309
|
+
this.clearLocalSession?.();
|
|
310
|
+
this.emit(this.getState());
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** Flush queued startFlowWithToken after identify. */
|
|
314
|
+
notifyIdentified(): void {
|
|
315
|
+
this.engine?.notifyIdentified();
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
private ensureEngine(): PairingEngine {
|
|
319
|
+
if (this.engine) return this.engine;
|
|
320
|
+
|
|
321
|
+
this.engine = new PairingEngine({
|
|
322
|
+
sendClientMessage: (message) => this.core.send(message),
|
|
323
|
+
onServerMessage: (handler) => this.core.onServerMessage(handler),
|
|
324
|
+
isIdentified: () => this.core.getUserId() != null,
|
|
325
|
+
pairingOptions: { pairingEndpoint: this.pairingEndpoint },
|
|
326
|
+
deviceMeta: () => ({
|
|
327
|
+
os: Platform.OS,
|
|
328
|
+
}),
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
this.engine.onStateChange((state) => {
|
|
332
|
+
this.emit(state);
|
|
333
|
+
if (state.status === 'token_expired' || state.needsRescan) {
|
|
334
|
+
void this.tokenStore.clear();
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
return this.engine;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
private emit(state: PairingEngineState): void {
|
|
342
|
+
for (const listener of this.listeners) {
|
|
343
|
+
try {
|
|
344
|
+
listener(state);
|
|
345
|
+
} catch {
|
|
346
|
+
// ignore
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function describeError(error: unknown): string {
|
|
353
|
+
if (error instanceof Error) return error.message;
|
|
354
|
+
if (typeof error === 'string') return error;
|
|
355
|
+
return String(error);
|
|
356
|
+
}
|