@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,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared requestAnimationFrame hub so multiple surfaces never stack loops.
|
|
3
|
+
* Mirrors web userflowjs `util/animation-frame.tsx`.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
type Callback = () => void;
|
|
7
|
+
|
|
8
|
+
const callbacks: Callback[] = [];
|
|
9
|
+
let rafHandle: number | ReturnType<typeof setTimeout> | null = null;
|
|
10
|
+
let active = false;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `callback` runs on every animation frame. Starts the shared loop when the
|
|
14
|
+
* first subscriber attaches.
|
|
15
|
+
*/
|
|
16
|
+
export function addAnimationFrameCallback(callback: Callback): void {
|
|
17
|
+
if (callbacks.includes(callback)) return;
|
|
18
|
+
callbacks.push(callback);
|
|
19
|
+
if (callbacks.length === 1) {
|
|
20
|
+
active = true;
|
|
21
|
+
requestNext();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Remove a previously added callback. Stops the loop when the last subscriber
|
|
27
|
+
* detaches.
|
|
28
|
+
*/
|
|
29
|
+
export function removeAnimationFrameCallback(callback: Callback): void {
|
|
30
|
+
const idx = callbacks.indexOf(callback);
|
|
31
|
+
if (idx < 0) return;
|
|
32
|
+
callbacks.splice(idx, 1);
|
|
33
|
+
if (callbacks.length === 0) {
|
|
34
|
+
active = false;
|
|
35
|
+
cancelPending();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Test helper — drop all subscribers and cancel the pending frame. */
|
|
40
|
+
export function resetAnimationFrameForTests(): void {
|
|
41
|
+
callbacks.length = 0;
|
|
42
|
+
active = false;
|
|
43
|
+
cancelPending();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Test helper — number of active subscribers. */
|
|
47
|
+
export function animationFrameSubscriberCount(): number {
|
|
48
|
+
return callbacks.length;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function onAnimationFrame(): void {
|
|
52
|
+
rafHandle = null;
|
|
53
|
+
// Snapshot so a callback that unsubscribes mid-frame is safe.
|
|
54
|
+
const snapshot = callbacks.slice();
|
|
55
|
+
for (const callback of snapshot) {
|
|
56
|
+
try {
|
|
57
|
+
callback();
|
|
58
|
+
} catch {
|
|
59
|
+
// A single subscriber must not tear down the hub.
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
requestNext();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function requestNext(): void {
|
|
66
|
+
if (!active) return;
|
|
67
|
+
const raf =
|
|
68
|
+
typeof globalThis.requestAnimationFrame === 'function'
|
|
69
|
+
? globalThis.requestAnimationFrame.bind(globalThis)
|
|
70
|
+
: null;
|
|
71
|
+
if (raf) {
|
|
72
|
+
rafHandle = raf(onAnimationFrame);
|
|
73
|
+
} else {
|
|
74
|
+
// Jest / environments without rAF — fall back to a short timer so tests
|
|
75
|
+
// and headless runs still drive the loop.
|
|
76
|
+
rafHandle = setTimeout(onAnimationFrame, 16);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function cancelPending(): void {
|
|
81
|
+
if (rafHandle == null) return;
|
|
82
|
+
if (typeof globalThis.cancelAnimationFrame === 'function' && typeof rafHandle === 'number') {
|
|
83
|
+
globalThis.cancelAnimationFrame(rafHandle);
|
|
84
|
+
} else {
|
|
85
|
+
clearTimeout(rafHandle as ReturnType<typeof setTimeout>);
|
|
86
|
+
}
|
|
87
|
+
rafHandle = null;
|
|
88
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import * as ReactNS from 'react';
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
autoAnchorRegistry,
|
|
6
|
+
roleForKind,
|
|
7
|
+
type AutoAnchorRef,
|
|
8
|
+
type BuildTimeHints,
|
|
9
|
+
} from './AutoAnchorRegistry';
|
|
10
|
+
import { expandBuildTimeHints, isHintsInput, type HintsInput } from './hintsCodec';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Runtime half of build-time auto-anchoring (see `@userflow-tech/babel-plugin`).
|
|
14
|
+
*
|
|
15
|
+
* Each mount creates a distinct AutoAnchorRegistry instance. Shared templates
|
|
16
|
+
* (design-system / list rows) register separately and are marked ambiguous
|
|
17
|
+
* when they lack a unique manual id or call-site scope.
|
|
18
|
+
*
|
|
19
|
+
* Canonical signature (what Babel emits via `__ufRef`):
|
|
20
|
+
* __userflowAutoAnchor(id, hints, userRef, kind, runtime?)
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
type HostInstance = unknown;
|
|
24
|
+
|
|
25
|
+
type UserRef = Ref<HostInstance> | string | null | undefined;
|
|
26
|
+
|
|
27
|
+
export interface AutoAnchorRuntime {
|
|
28
|
+
userflowId?: string;
|
|
29
|
+
testID?: string;
|
|
30
|
+
nativeID?: string;
|
|
31
|
+
childText?: string;
|
|
32
|
+
accessibilityLabel?: string;
|
|
33
|
+
iconName?: string;
|
|
34
|
+
imageSrc?: string;
|
|
35
|
+
scope?: string;
|
|
36
|
+
reactKey?: string;
|
|
37
|
+
manualId?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface AnchorRegistration {
|
|
41
|
+
holder: { current: HostInstance };
|
|
42
|
+
instanceId: string;
|
|
43
|
+
dispose: () => void;
|
|
44
|
+
userRefCleanup: (() => void) | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface AnchorEntry {
|
|
48
|
+
callback: (instance: HostInstance) => void | (() => void);
|
|
49
|
+
userRef: UserRef;
|
|
50
|
+
hints: BuildTimeHints | null | undefined;
|
|
51
|
+
kind: string | undefined;
|
|
52
|
+
runtime: AutoAnchorRuntime | undefined;
|
|
53
|
+
registrations: Map<HostInstance, AnchorRegistration>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function cacheKey(id: string, scope?: string): string {
|
|
57
|
+
return scope ? `${id}@@${scope}` : id;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const cache = new Map<string, AnchorEntry>();
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Legacy string refs (`ref="foo"`) assigned `owner.refs.foo` via React internals.
|
|
64
|
+
* Best-effort: modern React may not expose an owner; never throws into app code.
|
|
65
|
+
*/
|
|
66
|
+
function assignLegacyStringRef(name: string, instance: HostInstance): void {
|
|
67
|
+
try {
|
|
68
|
+
const React = ReactNS as typeof ReactNS & {
|
|
69
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?: {
|
|
70
|
+
ReactCurrentOwner?: { current?: { refs?: Record<string, unknown> | null } };
|
|
71
|
+
};
|
|
72
|
+
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {
|
|
73
|
+
ReactCurrentOwner?: { current?: { refs?: Record<string, unknown> | null } };
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const internals =
|
|
77
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE ??
|
|
78
|
+
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
79
|
+
const owner = internals?.ReactCurrentOwner?.current;
|
|
80
|
+
if (!owner) return;
|
|
81
|
+
if (owner.refs == null) {
|
|
82
|
+
owner.refs = {};
|
|
83
|
+
}
|
|
84
|
+
if (instance) {
|
|
85
|
+
owner.refs[name] = instance;
|
|
86
|
+
} else {
|
|
87
|
+
delete owner.refs[name];
|
|
88
|
+
}
|
|
89
|
+
} catch {
|
|
90
|
+
// String-ref owner unavailable — ignore rather than break the host.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function attachUserRef(userRef: UserRef, instance: HostInstance): void | (() => void) {
|
|
95
|
+
if (userRef == null || userRef === '') return;
|
|
96
|
+
|
|
97
|
+
if (typeof userRef === 'string') {
|
|
98
|
+
assignLegacyStringRef(userRef, instance);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (typeof userRef === 'function') {
|
|
103
|
+
const result = (userRef as (instance: HostInstance) => unknown)(instance);
|
|
104
|
+
if (typeof result === 'function') {
|
|
105
|
+
return result as () => void;
|
|
106
|
+
}
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
(userRef as { current: HostInstance }).current = instance;
|
|
112
|
+
} catch {
|
|
113
|
+
// Read-only ref object — nothing to do.
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function detachUserRef(userRef: UserRef, reg: AnchorRegistration): void {
|
|
118
|
+
if (reg.userRefCleanup) {
|
|
119
|
+
try {
|
|
120
|
+
reg.userRefCleanup();
|
|
121
|
+
} catch {
|
|
122
|
+
// App cleanup must not break unmount.
|
|
123
|
+
}
|
|
124
|
+
reg.userRefCleanup = null;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
attachUserRef(userRef, null);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function teardownRegistration(entry: AnchorEntry, reg: AnchorRegistration): void {
|
|
131
|
+
detachUserRef(entry.userRef, reg);
|
|
132
|
+
reg.dispose();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function isRefLike(value: unknown): value is Ref<HostInstance> {
|
|
136
|
+
return (
|
|
137
|
+
typeof value === 'function' ||
|
|
138
|
+
(typeof value === 'object' && value !== null && 'current' in value)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isUserRef(value: unknown): value is Ref<HostInstance> | string {
|
|
143
|
+
if (typeof value === 'string') return value.length > 0;
|
|
144
|
+
return isRefLike(value);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function isRuntime(value: unknown): value is AutoAnchorRuntime {
|
|
148
|
+
return typeof value === 'object' && value !== null && !isRefLike(value) && !isHintsInput(value);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function resolveHints(
|
|
152
|
+
raw: HintsInput | null | undefined,
|
|
153
|
+
kind: string | undefined,
|
|
154
|
+
): BuildTimeHints | null | undefined {
|
|
155
|
+
if (raw == null) return raw;
|
|
156
|
+
return expandBuildTimeHints(raw, kind);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function __userflowAutoAnchor(
|
|
160
|
+
id: string,
|
|
161
|
+
hintsOrUserRef?: HintsInput | Ref<HostInstance> | null,
|
|
162
|
+
userRefOrKind?: UserRef | string,
|
|
163
|
+
kindOrRuntime?: string | AutoAnchorRuntime,
|
|
164
|
+
maybeRuntime?: AutoAnchorRuntime,
|
|
165
|
+
): (instance: HostInstance) => void | (() => void) {
|
|
166
|
+
let hints: BuildTimeHints | null | undefined;
|
|
167
|
+
let userRef: UserRef;
|
|
168
|
+
let elementKind: string | undefined;
|
|
169
|
+
let runtime: AutoAnchorRuntime | undefined;
|
|
170
|
+
|
|
171
|
+
if (isHintsInput(hintsOrUserRef)) {
|
|
172
|
+
userRef = isUserRef(userRefOrKind) ? userRefOrKind : null;
|
|
173
|
+
if (typeof kindOrRuntime === 'string') {
|
|
174
|
+
elementKind = kindOrRuntime;
|
|
175
|
+
runtime = maybeRuntime;
|
|
176
|
+
} else if (isRuntime(kindOrRuntime)) {
|
|
177
|
+
runtime = kindOrRuntime;
|
|
178
|
+
}
|
|
179
|
+
hints = resolveHints(hintsOrUserRef, elementKind);
|
|
180
|
+
} else {
|
|
181
|
+
hints = undefined;
|
|
182
|
+
userRef = isUserRef(hintsOrUserRef) ? hintsOrUserRef : null;
|
|
183
|
+
elementKind = typeof userRefOrKind === 'string' ? userRefOrKind : undefined;
|
|
184
|
+
if (isRuntime(kindOrRuntime)) runtime = kindOrRuntime;
|
|
185
|
+
else if (maybeRuntime) runtime = maybeRuntime;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const resolvedId =
|
|
189
|
+
typeof id === 'string' && id.length > 0 ? id : (hints?.nativeId ?? hints?.ufid ?? 'uf_unknown');
|
|
190
|
+
|
|
191
|
+
const scope = runtime?.scope;
|
|
192
|
+
const key = cacheKey(resolvedId, scope);
|
|
193
|
+
const existing = cache.get(key);
|
|
194
|
+
if (existing) {
|
|
195
|
+
existing.userRef = userRef;
|
|
196
|
+
existing.hints = hints;
|
|
197
|
+
existing.kind = elementKind ?? existing.kind;
|
|
198
|
+
existing.runtime = runtime ?? existing.runtime;
|
|
199
|
+
if (existing.registrations.size === 1 && (hints || runtime)) {
|
|
200
|
+
const [reg] = existing.registrations.values();
|
|
201
|
+
const patch: Parameters<(typeof autoAnchorRegistry)['updateInstance']>[1] = {};
|
|
202
|
+
if (runtime?.childText !== undefined) patch.childText = runtime.childText;
|
|
203
|
+
if (runtime?.accessibilityLabel !== undefined) {
|
|
204
|
+
patch.accessibilityLabel = runtime.accessibilityLabel;
|
|
205
|
+
}
|
|
206
|
+
if (runtime?.scope) patch.instanceScope = runtime.scope;
|
|
207
|
+
if (runtime?.userflowId) patch.userflowId = runtime.userflowId;
|
|
208
|
+
if (runtime?.testID) patch.testID = runtime.testID;
|
|
209
|
+
if (runtime?.nativeID) patch.nativeID = runtime.nativeID;
|
|
210
|
+
if (runtime?.manualId || runtime?.userflowId || runtime?.testID) {
|
|
211
|
+
const mid =
|
|
212
|
+
runtime.manualId ?? runtime.userflowId ?? runtime.testID ?? existing.runtime?.manualId;
|
|
213
|
+
if (mid) patch.manualId = mid;
|
|
214
|
+
}
|
|
215
|
+
autoAnchorRegistry.updateInstance(reg!.instanceId, patch);
|
|
216
|
+
}
|
|
217
|
+
return existing.callback;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const entry: AnchorEntry = {
|
|
221
|
+
userRef,
|
|
222
|
+
hints,
|
|
223
|
+
kind: elementKind,
|
|
224
|
+
runtime,
|
|
225
|
+
registrations: new Map(),
|
|
226
|
+
callback: (instance: HostInstance) => {
|
|
227
|
+
if (instance) {
|
|
228
|
+
if (entry.registrations.has(instance)) return undefined;
|
|
229
|
+
|
|
230
|
+
const cleanup = attachUserRef(entry.userRef, instance);
|
|
231
|
+
const holder: { current: HostInstance } = { current: instance };
|
|
232
|
+
const kind = entry.kind ?? 'View';
|
|
233
|
+
const rt = entry.runtime;
|
|
234
|
+
const composedPath =
|
|
235
|
+
rt?.scope && entry.hints?.templatePath
|
|
236
|
+
? `${rt.scope} :: ${entry.hints.templatePath}`
|
|
237
|
+
: (entry.hints?.structuralPath ?? entry.hints?.ufid);
|
|
238
|
+
|
|
239
|
+
const hintsForReg: BuildTimeHints | undefined = entry.hints
|
|
240
|
+
? {
|
|
241
|
+
...entry.hints,
|
|
242
|
+
...(composedPath ? { structuralPath: composedPath, ufid: composedPath } : {}),
|
|
243
|
+
role: entry.hints.role ?? roleForKind(kind),
|
|
244
|
+
}
|
|
245
|
+
: {
|
|
246
|
+
ufid: resolvedId,
|
|
247
|
+
nativeId: resolvedId,
|
|
248
|
+
role: roleForKind(kind),
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const { instanceId, dispose } = autoAnchorRegistry.registerInstance({
|
|
252
|
+
registryKey: resolvedId,
|
|
253
|
+
ref: holder as AutoAnchorRef,
|
|
254
|
+
kind,
|
|
255
|
+
hints: hintsForReg,
|
|
256
|
+
...(rt?.scope ? { instanceScope: rt.scope } : {}),
|
|
257
|
+
runtime: {
|
|
258
|
+
...(rt?.manualId ? { manualId: rt.manualId } : {}),
|
|
259
|
+
...(rt?.userflowId ? { userflowId: rt.userflowId } : {}),
|
|
260
|
+
...(rt?.testID ? { testID: rt.testID } : {}),
|
|
261
|
+
...(rt?.nativeID ? { nativeID: rt.nativeID } : {}),
|
|
262
|
+
...(rt?.childText ? { childText: rt.childText } : {}),
|
|
263
|
+
...(rt?.accessibilityLabel ? { accessibilityLabel: rt.accessibilityLabel } : {}),
|
|
264
|
+
...(rt?.iconName ? { iconName: rt.iconName } : {}),
|
|
265
|
+
...(rt?.imageSrc ? { imageSrc: rt.imageSrc } : {}),
|
|
266
|
+
...(rt?.reactKey ? { reactKey: rt.reactKey } : {}),
|
|
267
|
+
...(!rt?.manualId && !rt?.userflowId && !rt?.testID && !resolvedId.startsWith('uf_')
|
|
268
|
+
? { manualId: resolvedId }
|
|
269
|
+
: {}),
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
const reg: AnchorRegistration = {
|
|
274
|
+
holder,
|
|
275
|
+
instanceId,
|
|
276
|
+
dispose,
|
|
277
|
+
userRefCleanup: typeof cleanup === 'function' ? cleanup : null,
|
|
278
|
+
};
|
|
279
|
+
entry.registrations.set(instance, reg);
|
|
280
|
+
|
|
281
|
+
return () => {
|
|
282
|
+
const r = entry.registrations.get(instance);
|
|
283
|
+
if (!r) return;
|
|
284
|
+
entry.registrations.delete(instance);
|
|
285
|
+
teardownRegistration(entry, r);
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const first = entry.registrations.keys().next();
|
|
290
|
+
if (!first.done) {
|
|
291
|
+
const inst = first.value;
|
|
292
|
+
const r = entry.registrations.get(inst)!;
|
|
293
|
+
entry.registrations.delete(inst);
|
|
294
|
+
teardownRegistration(entry, r);
|
|
295
|
+
}
|
|
296
|
+
return undefined;
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
cache.set(key, entry);
|
|
300
|
+
return entry.callback;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** Test helper — drop factory cache and registry instances. */
|
|
304
|
+
export function __resetAutoAnchorForTests(): void {
|
|
305
|
+
cache.clear();
|
|
306
|
+
autoAnchorRegistry.clear();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
(globalThis as { __userflowAutoAnchor?: typeof __userflowAutoAnchor }).__userflowAutoAnchor =
|
|
310
|
+
__userflowAutoAnchor;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { ConditionEvaluator } from '@userflow-tech/core';
|
|
2
|
+
import type { FlowConditionFragment } from '@userflow-tech/protocol';
|
|
3
|
+
|
|
4
|
+
import { anchorChangeTicker } from './anchorChangeTicker';
|
|
5
|
+
import { resolveAnchorHost } from './resolveAnchorHost';
|
|
6
|
+
import { resolveManualAnchorId } from './resolveManualAnchorId';
|
|
7
|
+
|
|
8
|
+
/** ELEMENT states the mobile SDK can evaluate today. */
|
|
9
|
+
const SUPPORTED_ELEMENT_STATES = new Set(['PRESENT', 'NOT_PRESENT']);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Evaluate ELEMENT client conditions against manual anchors and fiber-resolved
|
|
13
|
+
* `testID` / `nativeID` / `accessibilityLabel` targets.
|
|
14
|
+
*
|
|
15
|
+
* Supports PRESENT / NOT_PRESENT for MANUAL selectors (`css` → anchor id).
|
|
16
|
+
* AUTO / codeless selectors and web-interaction states (CLICK, DISABLED, …)
|
|
17
|
+
* report unknown (`null`) so gated flows stay blocked rather than inventing
|
|
18
|
+
* a truth value.
|
|
19
|
+
*
|
|
20
|
+
* "Present" means `resolveAnchorHost` finds a unique host. That already skips
|
|
21
|
+
* screens covered by another navigator screen, so an id on a pushed-under
|
|
22
|
+
* screen counts as absent. Pixel visibility (off-screen inside a ScrollView,
|
|
23
|
+
* opacity 0, etc.) would need async `measureInWindow` and is out of scope.
|
|
24
|
+
*
|
|
25
|
+
* Note: compares string literals rather than importing protocol enums so Jest
|
|
26
|
+
* (which cannot resolve the ESM-only `@userflow-tech/protocol` package) stays
|
|
27
|
+
* hermetic. Wire values match `FlowConditionElementState` / `FlowSelectorType`.
|
|
28
|
+
*/
|
|
29
|
+
export function createElementConditionEvaluator(
|
|
30
|
+
warn: (message: string) => void = (message) => {
|
|
31
|
+
if (__DEV__) {
|
|
32
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
33
|
+
console.warn(message);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
): ConditionEvaluator {
|
|
37
|
+
const warnedConditionIds = new Set<string>();
|
|
38
|
+
|
|
39
|
+
const warnOnce = (conditionId: string, message: string): void => {
|
|
40
|
+
if (warnedConditionIds.has(conditionId)) return;
|
|
41
|
+
warnedConditionIds.add(conditionId);
|
|
42
|
+
warn(message);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (condition, report) => {
|
|
46
|
+
const evaluate = (): void => {
|
|
47
|
+
const result = evaluateElementCondition(condition, warnOnce);
|
|
48
|
+
report(result);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
evaluate();
|
|
52
|
+
return anchorChangeTicker.subscribe(evaluate);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function evaluateElementCondition(
|
|
57
|
+
condition: FlowConditionFragment,
|
|
58
|
+
warnOnce: (conditionId: string, message: string) => void,
|
|
59
|
+
): boolean | null {
|
|
60
|
+
const elementState = condition.elementState as string | null;
|
|
61
|
+
if (elementState == null || !SUPPORTED_ELEMENT_STATES.has(elementState)) {
|
|
62
|
+
warnOnce(
|
|
63
|
+
condition.id,
|
|
64
|
+
`[Userflow] ELEMENT condition ${condition.id} uses unsupported elementState ` +
|
|
65
|
+
`"${elementState ?? 'null'}" (only PRESENT / NOT_PRESENT are supported); ` +
|
|
66
|
+
'leaving unknown',
|
|
67
|
+
);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const selector = condition.selector;
|
|
72
|
+
if (selector == null) {
|
|
73
|
+
warnOnce(
|
|
74
|
+
condition.id,
|
|
75
|
+
`[Userflow] ELEMENT condition ${condition.id} has no selector; leaving unknown`,
|
|
76
|
+
);
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if ((selector.type as string | null) === 'AUTO') {
|
|
81
|
+
warnOnce(
|
|
82
|
+
condition.id,
|
|
83
|
+
`[Userflow] ELEMENT condition ${condition.id} uses an AUTO (codeless) selector; ` +
|
|
84
|
+
'manual anchors only are supported today — leaving unknown',
|
|
85
|
+
);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const anchorId = resolveManualAnchorId(selector.css);
|
|
90
|
+
if (anchorId == null) {
|
|
91
|
+
warnOnce(
|
|
92
|
+
condition.id,
|
|
93
|
+
`[Userflow] ELEMENT condition ${condition.id} has no resolvable manual anchor id; ` +
|
|
94
|
+
'leaving unknown',
|
|
95
|
+
);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const resolution = resolveAnchorHost(anchorId);
|
|
100
|
+
// Ambiguous counts as not present for PRESENT (fail closed) and as "present"
|
|
101
|
+
// for NOT_PRESENT would be wrong — treat ambiguous as unknown so gated flows
|
|
102
|
+
// stay blocked rather than inventing a truth value.
|
|
103
|
+
if (resolution.status === 'ambiguous') {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const present = resolution.status === 'found';
|
|
107
|
+
return elementState === 'PRESENT' ? present : !present;
|
|
108
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { type AnyFiber, fiberFromPublicInstance, resolveCurrentFiber } from './fiberInternals';
|
|
5
|
+
|
|
6
|
+
type Listener = () => void;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Module singleton holding the fiber under which testID / nativeID /
|
|
10
|
+
* accessibilityLabel scans run. Seeded by {@link FiberScanRoot}.
|
|
11
|
+
*/
|
|
12
|
+
class FiberScanRootStore {
|
|
13
|
+
private instance: unknown = null;
|
|
14
|
+
private readonly listeners = new Set<Listener>();
|
|
15
|
+
|
|
16
|
+
set(instance: unknown): void {
|
|
17
|
+
this.instance = instance;
|
|
18
|
+
this.emit();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
clear(): void {
|
|
22
|
+
this.instance = null;
|
|
23
|
+
this.emit();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Current (resolved) fiber under the scan root, or null when unmounted. */
|
|
27
|
+
getFiber(): AnyFiber | null {
|
|
28
|
+
if (!this.instance) return null;
|
|
29
|
+
const fiber = fiberFromPublicInstance(this.instance);
|
|
30
|
+
if (!fiber) return null;
|
|
31
|
+
return resolveCurrentFiber(fiber);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
subscribe(listener: Listener): () => void {
|
|
35
|
+
this.listeners.add(listener);
|
|
36
|
+
return () => {
|
|
37
|
+
this.listeners.delete(listener);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Test helper. */
|
|
42
|
+
resetForTests(): void {
|
|
43
|
+
this.instance = null;
|
|
44
|
+
this.listeners.clear();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private emit(): void {
|
|
48
|
+
for (const listener of this.listeners) {
|
|
49
|
+
listener();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const fiberScanRoot = new FiberScanRootStore();
|
|
55
|
+
|
|
56
|
+
export interface FiberScanRootProps {
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Class component that publishes its own `_reactInternals` fiber as the scan
|
|
62
|
+
* root for testID-based anchoring. Class instances expose `_reactInternals` in
|
|
63
|
+
* both Paper and Fabric production builds (unlike host refs, which null out
|
|
64
|
+
* `_internalFiberInstanceHandleDEV` on Paper release).
|
|
65
|
+
*
|
|
66
|
+
* Renders the same content-root `View` that {@link UserflowProvider} previously
|
|
67
|
+
* owned so the layout tree is unchanged. The Userflow overlay sits as a
|
|
68
|
+
* *sibling*, so SDK-owned `testID`s never self-match.
|
|
69
|
+
*/
|
|
70
|
+
export class FiberScanRoot extends React.Component<FiberScanRootProps> {
|
|
71
|
+
override componentDidMount(): void {
|
|
72
|
+
fiberScanRoot.set(this);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
override componentDidUpdate(): void {
|
|
76
|
+
// Re-publish after updates so a remount-without-unmount still has a live
|
|
77
|
+
// pointer (defensive; normally the instance identity is stable).
|
|
78
|
+
fiberScanRoot.set(this);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override componentWillUnmount(): void {
|
|
82
|
+
fiberScanRoot.clear();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
override render(): React.ReactElement {
|
|
86
|
+
return (
|
|
87
|
+
<View style={styles.contentRoot} collapsable={false}>
|
|
88
|
+
{this.props.children}
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const styles = StyleSheet.create({
|
|
95
|
+
contentRoot: {
|
|
96
|
+
flex: 1,
|
|
97
|
+
},
|
|
98
|
+
});
|