@userflow-tech/react-native 0.1.0 → 0.2.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/README.md +114 -68
- package/app.plugin.js +13 -0
- package/babel-plugin/index.d.ts +43 -0
- package/babel-plugin/index.d.ts.map +1 -0
- package/babel-plugin/index.js +862 -0
- package/babel-plugin/index.js.map +1 -0
- package/babel-plugin.js +13 -0
- package/docs/anchoring.md +141 -13
- package/docs/deep-linking.md +20 -17
- package/docs/theme-mapping.md +44 -15
- package/docs/troubleshooting.md +37 -30
- package/expo-plugin/withUserflow.d.ts +17 -0
- package/expo-plugin/withUserflow.d.ts.map +1 -0
- package/expo-plugin/withUserflow.js +99 -0
- package/expo-plugin/withUserflow.js.map +1 -0
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +125 -3
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/commonjs/anchors/anchorChangeTicker.js +10 -0
- package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -1
- package/lib/commonjs/anchors/autoAnchor.js +1 -1
- package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -12
- package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js +11 -47
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +50 -0
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js +145 -3
- package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/commonjs/anchors/fiber/indexHostFibers.js +129 -0
- package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -0
- package/lib/commonjs/anchors/fiber/readHostContent.js +131 -0
- package/lib/commonjs/anchors/fiber/readHostContent.js.map +1 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js +50 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -0
- package/lib/commonjs/anchors/hintsCodec.js +1 -1
- package/lib/commonjs/anchors/resolveAnchorHost.js +15 -21
- package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js +171 -0
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -0
- package/lib/commonjs/anchors/semanticMatcher.js +285 -0
- package/lib/commonjs/anchors/semanticMatcher.js.map +1 -0
- package/lib/commonjs/authoring/ElementPickerOverlay.js +490 -0
- package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -0
- package/lib/commonjs/authoring/capturePickerScreenshot.js +73 -0
- package/lib/commonjs/authoring/capturePickerScreenshot.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeBarTransition.js +94 -0
- package/lib/commonjs/authoring/chrome/ChromeBarTransition.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +64 -0
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeButton.js +94 -0
- package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeDialog.js +131 -0
- package/lib/commonjs/authoring/chrome/ChromeDialog.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js +39 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeTooltip.js +88 -0
- package/lib/commonjs/authoring/chrome/ChromeTooltip.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js +110 -0
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -0
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +57 -0
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +80 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/tokens.js +150 -0
- package/lib/commonjs/authoring/chrome/tokens.js.map +1 -0
- package/lib/commonjs/authoring/doubleTap.js +23 -0
- package/lib/commonjs/authoring/doubleTap.js.map +1 -0
- package/lib/commonjs/authoring/elementPickerController.js +102 -0
- package/lib/commonjs/authoring/elementPickerController.js.map +1 -0
- package/lib/commonjs/authoring/fingerprintFromInstance.js +195 -0
- package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -0
- package/lib/commonjs/authoring/hitTest.js +106 -0
- package/lib/commonjs/authoring/hitTest.js.map +1 -0
- package/lib/commonjs/content/RichContentRenderer.js +12 -2
- package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
- package/lib/commonjs/content/StepButton.js +19 -4
- package/lib/commonjs/content/StepButton.js.map +1 -1
- package/lib/commonjs/content/resolveStepButtonChrome.js +8 -6
- package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -1
- package/lib/commonjs/content/themeColor.js +11 -0
- package/lib/commonjs/content/themeColor.js.map +1 -1
- package/lib/commonjs/deviceContext.js +158 -0
- package/lib/commonjs/deviceContext.js.map +1 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +40 -4
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/commonjs/hostAppVersion.js +242 -0
- package/lib/commonjs/hostAppVersion.js.map +1 -0
- package/lib/commonjs/index.js +118 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lifecycle.js +2 -0
- package/lib/commonjs/lifecycle.js.map +1 -1
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js +17 -8
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/commonjs/navigation/isOverlayPresentation.js +64 -0
- package/lib/commonjs/navigation/isOverlayPresentation.js.map +1 -0
- package/lib/commonjs/pairing/PairingController.js +29 -2
- package/lib/commonjs/pairing/PairingController.js.map +1 -1
- package/lib/commonjs/pairing/PreviewModeBanner.js +211 -84
- package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/commonjs/pairing/diagnostics.js +11 -2
- package/lib/commonjs/pairing/diagnostics.js.map +1 -1
- package/lib/commonjs/pairing/elementPickerRelay.js +91 -0
- package/lib/commonjs/pairing/elementPickerRelay.js.map +1 -0
- package/lib/commonjs/pairing/resolvePreviewChrome.js +52 -0
- package/lib/commonjs/pairing/resolvePreviewChrome.js.map +1 -0
- package/lib/commonjs/pairing/tokenStorage.js +25 -2
- package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
- package/lib/commonjs/pairing/usePairingState.js +3 -1
- package/lib/commonjs/pairing/usePairingState.js.map +1 -1
- package/lib/commonjs/runtime/FlowRenderer.js +45 -21
- package/lib/commonjs/runtime/FlowRenderer.js.map +1 -1
- package/lib/commonjs/runtime/FlowSurfaceFade.js +47 -24
- package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -1
- package/lib/commonjs/runtime/TargetPressBridge.js +13 -44
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
- package/lib/commonjs/runtime/UserflowProvider.js +74 -20
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
- package/lib/commonjs/runtime/changedTouchPoints.js +48 -0
- package/lib/commonjs/runtime/changedTouchPoints.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +3 -1
- package/lib/commonjs/runtime/flowEngine.js.map +1 -1
- package/lib/commonjs/runtime/flowSessionViewState.js +32 -7
- package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -1
- package/lib/commonjs/runtime/useFlowSessionState.js +2 -1
- package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -1
- package/lib/commonjs/screenTracker.js +46 -4
- package/lib/commonjs/screenTracker.js.map +1 -1
- package/lib/commonjs/surfaces/CardFade.js +31 -0
- package/lib/commonjs/surfaces/CardFade.js.map +1 -0
- package/lib/commonjs/surfaces/CloseButton.js +11 -6
- package/lib/commonjs/surfaces/CloseButton.js.map +1 -1
- package/lib/commonjs/surfaces/ModalSurface.js +50 -34
- package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
- package/lib/commonjs/surfaces/TooltipSurface.js +366 -87
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
- package/lib/commonjs/surfaces/cardTransition.js +70 -0
- package/lib/commonjs/surfaces/cardTransition.js.map +1 -0
- package/lib/commonjs/surfaces/resolveHighlightChrome.js +109 -0
- package/lib/commonjs/surfaces/resolveHighlightChrome.js.map +1 -0
- package/lib/commonjs/surfaces/resolveModalLayout.js +7 -3
- package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -1
- package/lib/commonjs/surfaces/resolveTooltipLayout.js +0 -4
- package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -1
- package/lib/commonjs/surfaces/surfaceInteractionConfig.js +33 -0
- package/lib/commonjs/surfaces/surfaceInteractionConfig.js.map +1 -0
- package/lib/commonjs/surfaces/surfaceLayoutInsets.js +128 -0
- package/lib/commonjs/surfaces/surfaceLayoutInsets.js.map +1 -0
- package/lib/commonjs/surfaces/themeChrome.js +4 -1
- package/lib/commonjs/surfaces/themeChrome.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +142 -21
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +100 -47
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js +124 -0
- package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +67 -13
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +88 -19
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js +52 -0
- package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/rect.js +12 -0
- package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js +103 -0
- package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/anchors/AutoAnchorRegistry.js +126 -3
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/module/anchors/anchorChangeTicker.js +10 -0
- package/lib/module/anchors/anchorChangeTicker.js.map +1 -1
- package/lib/module/anchors/autoAnchor.js +1 -1
- package/lib/module/anchors/elementConditionEvaluator.js +25 -12
- package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRoot.js +2 -43
- package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRootStore.js +46 -0
- package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -0
- package/lib/module/anchors/fiber/fiberInternals.js +139 -3
- package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/module/anchors/fiber/indexHostFibers.js +122 -0
- package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -0
- package/lib/module/anchors/fiber/readHostContent.js +127 -0
- package/lib/module/anchors/fiber/readHostContent.js.map +1 -0
- package/lib/module/anchors/fiberAnchorCache.js +40 -0
- package/lib/module/anchors/fiberAnchorCache.js.map +1 -0
- package/lib/module/anchors/hintsCodec.js +1 -1
- package/lib/module/anchors/resolveAnchorHost.js +15 -21
- package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveAutoAnchorHost.js +167 -0
- package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -0
- package/lib/module/anchors/semanticMatcher.js +280 -0
- package/lib/module/anchors/semanticMatcher.js.map +1 -0
- package/lib/module/authoring/ElementPickerOverlay.js +485 -0
- package/lib/module/authoring/ElementPickerOverlay.js.map +1 -0
- package/lib/module/authoring/capturePickerScreenshot.js +68 -0
- package/lib/module/authoring/capturePickerScreenshot.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeBarTransition.js +88 -0
- package/lib/module/authoring/chrome/ChromeBarTransition.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeBottomSheet.js +59 -0
- package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeButton.js +89 -0
- package/lib/module/authoring/chrome/ChromeButton.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeDialog.js +126 -0
- package/lib/module/authoring/chrome/ChromeDialog.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeIcon.js +33 -0
- package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeTooltip.js +82 -0
- package/lib/module/authoring/chrome/ChromeTooltip.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeTopBar.js +104 -0
- package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -0
- package/lib/module/authoring/chrome/DoubleTapBridge.js +52 -0
- package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js +75 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark@3x.png +0 -0
- package/lib/module/authoring/chrome/tokens.js +146 -0
- package/lib/module/authoring/chrome/tokens.js.map +1 -0
- package/lib/module/authoring/doubleTap.js +18 -0
- package/lib/module/authoring/doubleTap.js.map +1 -0
- package/lib/module/authoring/elementPickerController.js +97 -0
- package/lib/module/authoring/elementPickerController.js.map +1 -0
- package/lib/module/authoring/fingerprintFromInstance.js +187 -0
- package/lib/module/authoring/fingerprintFromInstance.js.map +1 -0
- package/lib/module/authoring/hitTest.js +100 -0
- package/lib/module/authoring/hitTest.js.map +1 -0
- package/lib/module/content/RichContentRenderer.js +12 -2
- package/lib/module/content/RichContentRenderer.js.map +1 -1
- package/lib/module/content/StepButton.js +19 -4
- package/lib/module/content/StepButton.js.map +1 -1
- package/lib/module/content/resolveStepButtonChrome.js +8 -6
- package/lib/module/content/resolveStepButtonChrome.js.map +1 -1
- package/lib/module/content/themeColor.js +10 -0
- package/lib/module/content/themeColor.js.map +1 -1
- package/lib/module/deviceContext.js +142 -0
- package/lib/module/deviceContext.js.map +1 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js +42 -6
- package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/module/hostAppVersion.js +225 -0
- package/lib/module/hostAppVersion.js.map +1 -0
- package/lib/module/index.js +119 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/lifecycle.js +2 -0
- package/lib/module/lifecycle.js.map +1 -1
- package/lib/module/navigation/WithUserflowReactNavigation.js +18 -9
- package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/module/navigation/isOverlayPresentation.js +58 -0
- package/lib/module/navigation/isOverlayPresentation.js.map +1 -0
- package/lib/module/pairing/PairingController.js +30 -3
- package/lib/module/pairing/PairingController.js.map +1 -1
- package/lib/module/pairing/PreviewModeBanner.js +212 -85
- package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/module/pairing/diagnostics.js +10 -2
- package/lib/module/pairing/diagnostics.js.map +1 -1
- package/lib/module/pairing/elementPickerRelay.js +87 -0
- package/lib/module/pairing/elementPickerRelay.js.map +1 -0
- package/lib/module/pairing/resolvePreviewChrome.js +48 -0
- package/lib/module/pairing/resolvePreviewChrome.js.map +1 -0
- package/lib/module/pairing/tokenStorage.js +24 -2
- package/lib/module/pairing/tokenStorage.js.map +1 -1
- package/lib/module/pairing/usePairingState.js +3 -1
- package/lib/module/pairing/usePairingState.js.map +1 -1
- package/lib/module/runtime/FlowRenderer.js +45 -21
- package/lib/module/runtime/FlowRenderer.js.map +1 -1
- package/lib/module/runtime/FlowSurfaceFade.js +49 -26
- package/lib/module/runtime/FlowSurfaceFade.js.map +1 -1
- package/lib/module/runtime/TargetPressBridge.js +12 -43
- package/lib/module/runtime/TargetPressBridge.js.map +1 -1
- package/lib/module/runtime/UserflowProvider.js +74 -20
- package/lib/module/runtime/UserflowProvider.js.map +1 -1
- package/lib/module/runtime/changedTouchPoints.js +43 -0
- package/lib/module/runtime/changedTouchPoints.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +3 -1
- package/lib/module/runtime/flowEngine.js.map +1 -1
- package/lib/module/runtime/flowSessionViewState.js +32 -7
- package/lib/module/runtime/flowSessionViewState.js.map +1 -1
- package/lib/module/runtime/useFlowSessionState.js +2 -1
- package/lib/module/runtime/useFlowSessionState.js.map +1 -1
- package/lib/module/screenTracker.js +42 -4
- package/lib/module/screenTracker.js.map +1 -1
- package/lib/module/surfaces/CardFade.js +26 -0
- package/lib/module/surfaces/CardFade.js.map +1 -0
- package/lib/module/surfaces/CloseButton.js +10 -6
- package/lib/module/surfaces/CloseButton.js.map +1 -1
- package/lib/module/surfaces/ModalSurface.js +52 -36
- package/lib/module/surfaces/ModalSurface.js.map +1 -1
- package/lib/module/surfaces/TooltipSurface.js +368 -90
- package/lib/module/surfaces/TooltipSurface.js.map +1 -1
- package/lib/module/surfaces/cardTransition.js +64 -0
- package/lib/module/surfaces/cardTransition.js.map +1 -0
- package/lib/module/surfaces/resolveHighlightChrome.js +102 -0
- package/lib/module/surfaces/resolveHighlightChrome.js.map +1 -0
- package/lib/module/surfaces/resolveModalLayout.js +7 -3
- package/lib/module/surfaces/resolveModalLayout.js.map +1 -1
- package/lib/module/surfaces/resolveTooltipLayout.js +1 -4
- package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -1
- package/lib/module/surfaces/surfaceInteractionConfig.js +27 -0
- package/lib/module/surfaces/surfaceInteractionConfig.js.map +1 -0
- package/lib/module/surfaces/surfaceLayoutInsets.js +119 -0
- package/lib/module/surfaces/surfaceLayoutInsets.js.map +1 -0
- package/lib/module/surfaces/themeChrome.js +3 -1
- package/lib/module/surfaces/themeChrome.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipBubble.js +143 -22
- package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipCutout.js +100 -47
- package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipHighlight.js +118 -0
- package/lib/module/surfaces/tooltip/TooltipHighlight.js.map +1 -0
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js +67 -13
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +87 -19
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
- package/lib/module/surfaces/tooltip/placementDiagnostics.js +43 -0
- package/lib/module/surfaces/tooltip/placementDiagnostics.js.map +1 -0
- package/lib/module/surfaces/tooltip/rect.js +11 -0
- package/lib/module/surfaces/tooltip/rect.js.map +1 -1
- package/lib/module/surfaces/tooltip/resolveSideCardWidth.js +96 -0
- package/lib/module/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +27 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +2 -0
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts +1 -1
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +14 -10
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +42 -1
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +42 -0
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts +17 -0
- package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +20 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +5 -5
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +48 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +7 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts +11 -0
- package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts +20 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts +14 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +13 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +141 -0
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts +14 -0
- package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +59 -0
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +26 -0
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +31 -0
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +6 -1
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/themeColor.d.ts +5 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/deviceContext.d.ts +66 -0
- package/lib/typescript/commonjs/src/deviceContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hostAppVersion.d.ts +69 -0
- package/lib/typescript/commonjs/src/hostAppVersion.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +53 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/lifecycle.d.ts +6 -0
- package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts +14 -0
- package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +7 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +6 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +5 -0
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts +11 -0
- package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts +16 -0
- package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +2 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +6 -3
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +20 -7
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +5 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +6 -4
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts +10 -0
- package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +12 -3
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +1 -0
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/screenTracker.d.ts +21 -3
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts +12 -0
- package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -2
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +12 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts +31 -0
- package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts +44 -0
- package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +0 -7
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +2 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +27 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +2 -0
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/autoAnchor.d.ts +1 -1
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +14 -10
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +42 -1
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +42 -0
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts +17 -0
- package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +20 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/hintsCodec.d.ts +1 -1
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +5 -5
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +48 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +7 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts +11 -0
- package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts +20 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts +14 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +13 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +141 -0
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/doubleTap.d.ts +14 -0
- package/lib/typescript/module/src/authoring/doubleTap.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts +59 -0
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +26 -0
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/hitTest.d.ts +31 -0
- package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -0
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts +6 -1
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -1
- package/lib/typescript/module/src/content/themeColor.d.ts +5 -0
- package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/module/src/deviceContext.d.ts +66 -0
- package/lib/typescript/module/src/deviceContext.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/src/hostAppVersion.d.ts +69 -0
- package/lib/typescript/module/src/hostAppVersion.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +53 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/lifecycle.d.ts +6 -0
- package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts +14 -0
- package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts +7 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +6 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/diagnostics.d.ts +5 -0
- package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts +11 -0
- package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts +16 -0
- package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts +2 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +6 -3
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +20 -7
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +5 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +6 -4
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts +10 -0
- package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +12 -3
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +1 -0
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -1
- package/lib/typescript/module/src/screenTracker.d.ts +21 -3
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/CardFade.d.ts +12 -0
- package/lib/typescript/module/src/surfaces/CardFade.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -2
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +12 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/cardTransition.d.ts +31 -0
- package/lib/typescript/module/src/surfaces/cardTransition.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts +44 -0
- package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +0 -7
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
- package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
- package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
- package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +2 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
- package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +32 -18
- package/src/anchors/AutoAnchorRegistry.ts +140 -3
- package/src/anchors/anchorChangeTicker.ts +10 -0
- package/src/anchors/autoAnchor.ts +1 -1
- package/src/anchors/elementConditionEvaluator.ts +29 -16
- package/src/anchors/fiber/FiberScanRoot.tsx +2 -50
- package/src/anchors/fiber/FiberScanRootStore.ts +51 -0
- package/src/anchors/fiber/fiberInternals.ts +166 -3
- package/src/anchors/fiber/indexHostFibers.ts +136 -0
- package/src/anchors/fiber/readHostContent.ts +146 -0
- package/src/anchors/fiberAnchorCache.ts +45 -0
- package/src/anchors/hintsCodec.ts +1 -1
- package/src/anchors/resolveAnchorHost.ts +23 -23
- package/src/anchors/resolveAutoAnchorHost.ts +180 -0
- package/src/anchors/semanticMatcher.ts +361 -0
- package/src/authoring/ElementPickerOverlay.tsx +553 -0
- package/src/authoring/capturePickerScreenshot.ts +90 -0
- package/src/authoring/chrome/ChromeBarTransition.tsx +106 -0
- package/src/authoring/chrome/ChromeBottomSheet.tsx +69 -0
- package/src/authoring/chrome/ChromeButton.tsx +103 -0
- package/src/authoring/chrome/ChromeDialog.tsx +121 -0
- package/src/authoring/chrome/ChromeIcon.tsx +40 -0
- package/src/authoring/chrome/ChromeTooltip.tsx +89 -0
- package/src/authoring/chrome/ChromeTopBar.tsx +126 -0
- package/src/authoring/chrome/DoubleTapBridge.tsx +60 -0
- package/src/authoring/chrome/doubleTapMonitor.ts +80 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/src/authoring/chrome/icons/xmark.png +0 -0
- package/src/authoring/chrome/icons/xmark@2x.png +0 -0
- package/src/authoring/chrome/icons/xmark@3x.png +0 -0
- package/src/authoring/chrome/tokens.ts +106 -0
- package/src/authoring/doubleTap.ts +27 -0
- package/src/authoring/elementPickerController.ts +135 -0
- package/src/authoring/fingerprintFromInstance.ts +152 -0
- package/src/authoring/hitTest.ts +133 -0
- package/src/content/RichContentRenderer.tsx +22 -1
- package/src/content/StepButton.tsx +17 -2
- package/src/content/resolveStepButtonChrome.ts +12 -6
- package/src/content/themeColor.ts +10 -0
- package/src/deviceContext.ts +168 -0
- package/src/expo-router/useUserflowExpoRouter.ts +47 -4
- package/src/hostAppVersion.ts +258 -0
- package/src/index.ts +148 -4
- package/src/lifecycle.ts +8 -0
- package/src/navigation/WithUserflowReactNavigation.tsx +23 -7
- package/src/navigation/isOverlayPresentation.ts +76 -0
- package/src/pairing/PairingController.ts +32 -3
- package/src/pairing/PreviewModeBanner.tsx +250 -94
- package/src/pairing/diagnostics.ts +10 -2
- package/src/pairing/elementPickerRelay.ts +100 -0
- package/src/pairing/resolvePreviewChrome.ts +57 -0
- package/src/pairing/tokenStorage.ts +31 -2
- package/src/pairing/usePairingState.ts +2 -0
- package/src/runtime/FlowRenderer.tsx +55 -27
- package/src/runtime/FlowSurfaceFade.tsx +51 -30
- package/src/runtime/TargetPressBridge.tsx +14 -32
- package/src/runtime/UserflowProvider.tsx +76 -13
- package/src/runtime/changedTouchPoints.ts +34 -0
- package/src/runtime/flowEngine.ts +2 -0
- package/src/runtime/flowSessionViewState.ts +42 -4
- package/src/runtime/useFlowSessionState.ts +2 -0
- package/src/screenTracker.ts +46 -4
- package/src/surfaces/CardFade.tsx +18 -0
- package/src/surfaces/CloseButton.tsx +17 -7
- package/src/surfaces/MadeWithUserflow.tsx +1 -1
- package/src/surfaces/ModalSurface.tsx +48 -35
- package/src/surfaces/TooltipSurface.tsx +406 -86
- package/src/surfaces/cardTransition.ts +67 -0
- package/src/surfaces/resolveHighlightChrome.ts +139 -0
- package/src/surfaces/resolveModalLayout.ts +16 -8
- package/src/surfaces/resolveTooltipLayout.ts +1 -14
- package/src/surfaces/surfaceInteractionConfig.ts +25 -0
- package/src/surfaces/surfaceLayoutInsets.tsx +135 -0
- package/src/surfaces/themeChrome.ts +5 -3
- package/src/surfaces/tooltip/TooltipBubble.tsx +154 -19
- package/src/surfaces/tooltip/TooltipCutout.tsx +106 -49
- package/src/surfaces/tooltip/TooltipHighlight.tsx +144 -0
- package/src/surfaces/tooltip/computeTooltipPosition.ts +98 -12
- package/src/surfaces/tooltip/inferTooltipPlacement.ts +107 -18
- package/src/surfaces/tooltip/placementDiagnostics.ts +70 -0
- package/src/surfaces/tooltip/rect.ts +11 -0
- package/src/surfaces/tooltip/resolveSideCardWidth.ts +121 -0
- package/src/version.ts +1 -1
- package/vendor/core/LICENSE +76 -0
- package/vendor/core/README.md +9 -0
- package/vendor/core/dist/attributes.d.ts +15 -0
- package/vendor/core/dist/attributes.d.ts.map +1 -0
- package/vendor/core/dist/attributes.js +55 -0
- package/vendor/core/dist/attributes.js.map +1 -0
- package/vendor/core/dist/constants.d.ts +21 -0
- package/vendor/core/dist/constants.d.ts.map +1 -0
- package/vendor/core/dist/constants.js +21 -0
- package/vendor/core/dist/constants.js.map +1 -0
- package/vendor/core/dist/engine/ClientConditionEngine.d.ts +68 -0
- package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/ClientConditionEngine.js +197 -0
- package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -0
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts +160 -0
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/FlowSessionEngine.js +571 -0
- package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -0
- package/vendor/core/dist/engine/PairingEngine.d.ts +135 -0
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/PairingEngine.js +396 -0
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -0
- package/vendor/core/dist/engine/UserflowCore.d.ts +145 -0
- package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -0
- package/vendor/core/dist/engine/UserflowCore.js +329 -0
- package/vendor/core/dist/engine/UserflowCore.js.map +1 -0
- package/vendor/core/dist/engine/conditionOperators.d.ts +16 -0
- package/vendor/core/dist/engine/conditionOperators.d.ts.map +1 -0
- package/vendor/core/dist/engine/conditionOperators.js +168 -0
- package/vendor/core/dist/engine/conditionOperators.js.map +1 -0
- package/vendor/core/dist/engine/handleActions.d.ts +42 -0
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -0
- package/vendor/core/dist/engine/handleActions.js +198 -0
- package/vendor/core/dist/engine/handleActions.js.map +1 -0
- package/vendor/core/dist/engine/interpolateSessionData.d.ts +7 -0
- package/vendor/core/dist/engine/interpolateSessionData.d.ts.map +1 -0
- package/vendor/core/dist/engine/interpolateSessionData.js +29 -0
- package/vendor/core/dist/engine/interpolateSessionData.js.map +1 -0
- package/vendor/core/dist/engine/simpleObservable.d.ts +13 -0
- package/vendor/core/dist/engine/simpleObservable.d.ts.map +1 -0
- package/vendor/core/dist/engine/simpleObservable.js +29 -0
- package/vendor/core/dist/engine/simpleObservable.js.map +1 -0
- package/vendor/core/dist/engine/trackCondition.d.ts +25 -0
- package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -0
- package/vendor/core/dist/engine/trackCondition.js +177 -0
- package/vendor/core/dist/engine/trackCondition.js.map +1 -0
- package/vendor/core/dist/engine/trackStepTriggers.d.ts +21 -0
- package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -0
- package/vendor/core/dist/engine/trackStepTriggers.js +49 -0
- package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -0
- package/vendor/core/dist/errors.d.ts +9 -0
- package/vendor/core/dist/errors.d.ts.map +1 -0
- package/vendor/core/dist/errors.js +15 -0
- package/vendor/core/dist/errors.js.map +1 -0
- package/vendor/core/dist/eventAttributes.d.ts +7 -0
- package/vendor/core/dist/eventAttributes.d.ts.map +1 -0
- package/vendor/core/dist/eventAttributes.js +31 -0
- package/vendor/core/dist/eventAttributes.js.map +1 -0
- package/vendor/core/dist/index.d.ts +31 -0
- package/vendor/core/dist/index.d.ts.map +1 -0
- package/vendor/core/dist/index.js +22 -0
- package/vendor/core/dist/index.js.map +1 -0
- package/vendor/core/dist/normalizeAttributes.d.ts +8 -0
- package/vendor/core/dist/normalizeAttributes.d.ts.map +1 -0
- package/vendor/core/dist/normalizeAttributes.js +127 -0
- package/vendor/core/dist/normalizeAttributes.js.map +1 -0
- package/vendor/core/dist/transport/backoff.d.ts +11 -0
- package/vendor/core/dist/transport/backoff.d.ts.map +1 -0
- package/vendor/core/dist/transport/backoff.js +17 -0
- package/vendor/core/dist/transport/backoff.js.map +1 -0
- package/vendor/core/dist/transport/pairing.d.ts +121 -0
- package/vendor/core/dist/transport/pairing.d.ts.map +1 -0
- package/vendor/core/dist/transport/pairing.js +551 -0
- package/vendor/core/dist/transport/pairing.js.map +1 -0
- package/vendor/core/dist/transport/phoenix.d.ts +228 -0
- package/vendor/core/dist/transport/phoenix.d.ts.map +1 -0
- package/vendor/core/dist/transport/phoenix.js +811 -0
- package/vendor/core/dist/transport/phoenix.js.map +1 -0
- package/vendor/core/dist/transport/rateLimiter.d.ts +17 -0
- package/vendor/core/dist/transport/rateLimiter.d.ts.map +1 -0
- package/vendor/core/dist/transport/rateLimiter.js +30 -0
- package/vendor/core/dist/transport/rateLimiter.js.map +1 -0
- package/vendor/core/dist/transport/scheduler.d.ts +12 -0
- package/vendor/core/dist/transport/scheduler.d.ts.map +1 -0
- package/vendor/core/dist/transport/scheduler.js +11 -0
- package/vendor/core/dist/transport/scheduler.js.map +1 -0
- package/vendor/core/dist/types.d.ts +60 -0
- package/vendor/core/dist/types.d.ts.map +1 -0
- package/vendor/core/dist/types.js +2 -0
- package/vendor/core/dist/types.js.map +1 -0
- package/vendor/core/dist/version.d.ts +3 -0
- package/vendor/core/dist/version.d.ts.map +1 -0
- package/vendor/core/dist/version.js +3 -0
- package/vendor/core/dist/version.js.map +1 -0
- package/vendor/core/package.json +20 -0
- package/vendor/protocol/LICENSE +76 -0
- package/vendor/protocol/README.md +8 -0
- package/vendor/protocol/dist/attributes.d.ts +43 -0
- package/vendor/protocol/dist/attributes.d.ts.map +1 -0
- package/vendor/protocol/dist/attributes.js +15 -0
- package/vendor/protocol/dist/attributes.js.map +1 -0
- package/vendor/protocol/dist/autoData.d.ts +232 -0
- package/vendor/protocol/dist/autoData.d.ts.map +1 -0
- package/vendor/protocol/dist/autoData.js +78 -0
- package/vendor/protocol/dist/autoData.js.map +1 -0
- package/vendor/protocol/dist/events.d.ts +24 -0
- package/vendor/protocol/dist/events.d.ts.map +1 -0
- package/vendor/protocol/dist/events.js +8 -0
- package/vendor/protocol/dist/events.js.map +1 -0
- package/vendor/protocol/dist/flows.d.ts +360 -0
- package/vendor/protocol/dist/flows.d.ts.map +1 -0
- package/vendor/protocol/dist/flows.js +201 -0
- package/vendor/protocol/dist/flows.js.map +1 -0
- package/vendor/protocol/dist/index.d.ts +25 -0
- package/vendor/protocol/dist/index.d.ts.map +1 -0
- package/vendor/protocol/dist/index.js +17 -0
- package/vendor/protocol/dist/index.js.map +1 -0
- package/vendor/protocol/dist/messages.d.ts +187 -0
- package/vendor/protocol/dist/messages.d.ts.map +1 -0
- package/vendor/protocol/dist/messages.js +61 -0
- package/vendor/protocol/dist/messages.js.map +1 -0
- package/vendor/protocol/dist/pairing.d.ts +82 -0
- package/vendor/protocol/dist/pairing.d.ts.map +1 -0
- package/vendor/protocol/dist/pairing.js +146 -0
- package/vendor/protocol/dist/pairing.js.map +1 -0
- package/vendor/protocol/package.json +17 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the host app's native marketing version (store version), not the
|
|
3
|
+
* SDK package version. React Native does not expose the store version on
|
|
4
|
+
* `Platform`; Expo hosts may use optional expo modules; bare RN reads
|
|
5
|
+
* `NativeModules.RNDeviceInfo` constants from the bundled device-info native
|
|
6
|
+
* module (after autolink + rebuild). The OS name is `Platform.OS`.
|
|
7
|
+
*
|
|
8
|
+
* Do not `require('react-native-device-info')` — that package throws at import
|
|
9
|
+
* when the native module is missing, and Metro/Hermes may surface it as uncaught
|
|
10
|
+
* even inside try/catch.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export type HostAppVersionSource =
|
|
14
|
+
| 'expo-application'
|
|
15
|
+
| 'expo-constants'
|
|
16
|
+
| 'react-native-device-info'
|
|
17
|
+
| 'init-override';
|
|
18
|
+
|
|
19
|
+
export interface HostAppVersion {
|
|
20
|
+
version: string;
|
|
21
|
+
build?: string;
|
|
22
|
+
source: HostAppVersionSource;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface RNDeviceInfoConstants {
|
|
26
|
+
appVersion?: string;
|
|
27
|
+
buildNumber?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function nonEmptyString(value: unknown): string | undefined {
|
|
31
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function unwrapModule(mod: unknown): Record<string, unknown> | null {
|
|
35
|
+
if (typeof mod !== 'object' || mod === null) return null;
|
|
36
|
+
const record = mod as Record<string, unknown>;
|
|
37
|
+
const nested = record['default'];
|
|
38
|
+
if (typeof nested === 'object' && nested !== null) {
|
|
39
|
+
return { ...record, ...(nested as Record<string, unknown>) };
|
|
40
|
+
}
|
|
41
|
+
return record;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function tryRequireExpoApplication(): unknown {
|
|
45
|
+
try {
|
|
46
|
+
// Optional on bare RN — Metro requires a string literal.
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
48
|
+
return require('expo-application');
|
|
49
|
+
} catch {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function tryRequireExpoConstants(): unknown {
|
|
55
|
+
try {
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
57
|
+
return require('expo-constants');
|
|
58
|
+
} catch {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function loadLinkedDeviceInfoNativeModule(): RNDeviceInfoConstants | null {
|
|
64
|
+
try {
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
66
|
+
const { NativeModules } = require('react-native') as {
|
|
67
|
+
NativeModules: { RNDeviceInfo?: RNDeviceInfoConstants };
|
|
68
|
+
};
|
|
69
|
+
return NativeModules.RNDeviceInfo ?? null;
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Visible for tests: map an `expo-application` module shape to a version. */
|
|
76
|
+
export function readExpoApplication(mod: unknown): HostAppVersion | null {
|
|
77
|
+
const record = unwrapModule(mod);
|
|
78
|
+
if (!record) return null;
|
|
79
|
+
const version = nonEmptyString(record['nativeApplicationVersion']);
|
|
80
|
+
if (!version) return null;
|
|
81
|
+
const build = nonEmptyString(record['nativeBuildVersion']);
|
|
82
|
+
return { version, source: 'expo-application', ...(build ? { build } : {}) };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Visible for tests: map an `expo-constants` module shape to a version. */
|
|
86
|
+
export function readExpoConstants(mod: unknown): HostAppVersion | null {
|
|
87
|
+
const record = unwrapModule(mod);
|
|
88
|
+
if (!record) return null;
|
|
89
|
+
const expoConfig = record['expoConfig'];
|
|
90
|
+
const configVersion =
|
|
91
|
+
typeof expoConfig === 'object' && expoConfig !== null
|
|
92
|
+
? nonEmptyString((expoConfig as Record<string, unknown>)['version'])
|
|
93
|
+
: undefined;
|
|
94
|
+
const version = nonEmptyString(record['nativeAppVersion']) ?? configVersion;
|
|
95
|
+
if (!version) return null;
|
|
96
|
+
const build = nonEmptyString(record['nativeBuildVersion']);
|
|
97
|
+
return { version, source: 'expo-constants', ...(build ? { build } : {}) };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Visible for tests: map linked RNDeviceInfo native constants to a version. */
|
|
101
|
+
export function readDeviceInfoFromNativeModule(
|
|
102
|
+
module: RNDeviceInfoConstants | null | undefined,
|
|
103
|
+
): HostAppVersion | null {
|
|
104
|
+
if (!module) return null;
|
|
105
|
+
const version = nonEmptyString(module.appVersion);
|
|
106
|
+
if (!version || version === 'unknown') return null;
|
|
107
|
+
const build = nonEmptyString(module.buildNumber);
|
|
108
|
+
return {
|
|
109
|
+
version,
|
|
110
|
+
source: 'react-native-device-info',
|
|
111
|
+
...(build && build !== 'unknown' ? { build } : {}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Visible for tests: first non-null reader wins (Expo modules, then RNDeviceInfo). */
|
|
116
|
+
export function resolveHostAppVersionFromSources(sources: {
|
|
117
|
+
expoApplication?: unknown;
|
|
118
|
+
expoConstants?: unknown;
|
|
119
|
+
deviceInfoNative?: RNDeviceInfoConstants | null;
|
|
120
|
+
}): HostAppVersion | null {
|
|
121
|
+
return (
|
|
122
|
+
readExpoApplication(sources.expoApplication) ??
|
|
123
|
+
readExpoConstants(sources.expoConstants) ??
|
|
124
|
+
readDeviceInfoFromNativeModule(sources.deviceInfoNative)
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function resolveHostAppVersion(): HostAppVersion | null {
|
|
129
|
+
return resolveHostAppVersionFromSources({
|
|
130
|
+
expoApplication: tryRequireExpoApplication(),
|
|
131
|
+
expoConstants: tryRequireExpoConstants(),
|
|
132
|
+
deviceInfoNative: loadLinkedDeviceInfoNativeModule(),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface HostAppVersionInitOptions {
|
|
137
|
+
/** When set, overrides auto-detection for the lifetime of this init. */
|
|
138
|
+
appVersion?: string;
|
|
139
|
+
appBuild?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Visible for tests: resolve version for init, honoring an optional client override. */
|
|
143
|
+
export function resolveHostAppVersionForInit(
|
|
144
|
+
options: HostAppVersionInitOptions = {},
|
|
145
|
+
): HostAppVersion | null {
|
|
146
|
+
const overrideVersion = nonEmptyString(options.appVersion);
|
|
147
|
+
if (overrideVersion) {
|
|
148
|
+
const build = nonEmptyString(options.appBuild);
|
|
149
|
+
return {
|
|
150
|
+
version: overrideVersion,
|
|
151
|
+
source: 'init-override',
|
|
152
|
+
...(build ? { build } : {}),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return resolveHostAppVersion();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** `undefined` until the first {@link cacheHostAppVersionAtInit}; then resolved or null. */
|
|
159
|
+
let cachedHostAppVersion: HostAppVersion | null | undefined;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Resolve and cache the host app version during {@link Userflow.init}.
|
|
163
|
+
* Re-running init replaces the cache.
|
|
164
|
+
*/
|
|
165
|
+
export function cacheHostAppVersionAtInit(
|
|
166
|
+
options: HostAppVersionInitOptions = {},
|
|
167
|
+
): HostAppVersion | null {
|
|
168
|
+
cachedHostAppVersion = resolveHostAppVersionForInit(options);
|
|
169
|
+
return cachedHostAppVersion;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Returns the version cached at init, or `null` before init or when unavailable. */
|
|
173
|
+
export function getCachedHostAppVersion(): HostAppVersion | null {
|
|
174
|
+
return cachedHostAppVersion ?? null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** User attribute keys for the host app's native store version. */
|
|
178
|
+
export const HOST_APP_VERSION_USER_ATTRIBUTE = 'app_version';
|
|
179
|
+
export const HOST_APP_BUILD_USER_ATTRIBUTE = 'app_build';
|
|
180
|
+
|
|
181
|
+
/** Returns cached host version fields for UpsertUser, or `{}` when unavailable. */
|
|
182
|
+
export function hostAppVersionUserAttributes(): Record<string, string> {
|
|
183
|
+
const cached = getCachedHostAppVersion();
|
|
184
|
+
if (!cached) return {};
|
|
185
|
+
return {
|
|
186
|
+
[HOST_APP_VERSION_USER_ATTRIBUTE]: cached.version,
|
|
187
|
+
...(cached.build ? { [HOST_APP_BUILD_USER_ATTRIBUTE]: cached.build } : {}),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Optional user-attribute keys added by {@link mergeHostAppVersionUserAttributes}. */
|
|
192
|
+
export type HostAppVersionUserAttributeMap = Partial<{
|
|
193
|
+
[HOST_APP_VERSION_USER_ATTRIBUTE]: string;
|
|
194
|
+
[HOST_APP_BUILD_USER_ATTRIBUTE]: string;
|
|
195
|
+
}>;
|
|
196
|
+
|
|
197
|
+
/** Merges cached host version attrs into identify attributes; caller values win on key conflicts. */
|
|
198
|
+
export function mergeHostAppVersionUserAttributes<T extends Record<string, unknown>>(
|
|
199
|
+
attributes?: T,
|
|
200
|
+
): (T & HostAppVersionUserAttributeMap) | undefined {
|
|
201
|
+
const system = hostAppVersionUserAttributes();
|
|
202
|
+
if (Object.keys(system).length === 0) {
|
|
203
|
+
return attributes as (T & HostAppVersionUserAttributeMap) | undefined;
|
|
204
|
+
}
|
|
205
|
+
return { ...system, ...(attributes ?? {}) } as T & HostAppVersionUserAttributeMap;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** @internal Resets init cache between tests. */
|
|
209
|
+
export function resetCachedHostAppVersionForTests(): void {
|
|
210
|
+
cachedHostAppVersion = undefined;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function readPlatformOS(): string {
|
|
214
|
+
try {
|
|
215
|
+
// Lazy require so Node unit tests can format messages without loading RN.
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
217
|
+
const os = (require('react-native') as { Platform?: { OS?: string } }).Platform?.OS;
|
|
218
|
+
return typeof os === 'string' && os.length > 0 ? os : 'unknown';
|
|
219
|
+
} catch {
|
|
220
|
+
return 'unknown';
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function formatHostAppVersionLog(
|
|
225
|
+
resolved: HostAppVersion | null,
|
|
226
|
+
os: string,
|
|
227
|
+
): {
|
|
228
|
+
level: 'log' | 'warn';
|
|
229
|
+
message: string;
|
|
230
|
+
} {
|
|
231
|
+
if (!resolved) {
|
|
232
|
+
return {
|
|
233
|
+
level: 'warn',
|
|
234
|
+
message:
|
|
235
|
+
`[Userflow] host app version is unavailable on ${os}. Rebuild the native app ` +
|
|
236
|
+
'(for example `cd ios && pod install`) so the bundled version module is linked.',
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
const build = resolved.build ? ` (build ${resolved.build})` : '';
|
|
240
|
+
return {
|
|
241
|
+
level: 'log',
|
|
242
|
+
message: `[Userflow] host app version ${resolved.version}${build} on ${os}`,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** Log the host app's native version and platform OS to the console. */
|
|
247
|
+
export function logHostAppVersion(): void {
|
|
248
|
+
const resolved =
|
|
249
|
+
cachedHostAppVersion !== undefined ? cachedHostAppVersion : resolveHostAppVersion();
|
|
250
|
+
const { level, message } = formatHostAppVersionLog(resolved, readPlatformOS());
|
|
251
|
+
if (level === 'warn') {
|
|
252
|
+
// eslint-disable-next-line no-console -- public logHostAppVersion()
|
|
253
|
+
console.warn(message);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
// eslint-disable-next-line no-console -- public logHostAppVersion()
|
|
257
|
+
console.log(message);
|
|
258
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
|
+
PublicAttributes,
|
|
12
13
|
UserflowAttributes,
|
|
13
14
|
UserflowConfig,
|
|
14
15
|
UserflowEventAttributes,
|
|
@@ -16,6 +17,7 @@ import type {
|
|
|
16
17
|
UserflowIdentifyOptions,
|
|
17
18
|
UserflowInitOptions,
|
|
18
19
|
UserflowTrackOptions,
|
|
20
|
+
UserflowUpdateGroupOptions,
|
|
19
21
|
} from '@userflow-tech/core';
|
|
20
22
|
|
|
21
23
|
import './anchors/autoAnchor';
|
|
@@ -27,6 +29,7 @@ import {
|
|
|
27
29
|
type CustomScrollIntoView,
|
|
28
30
|
type ScrollPadding,
|
|
29
31
|
} from './anchors/scrollConfig';
|
|
32
|
+
import { setSurfaceInteractionBlocking as setSurfaceInteractionBlockingConfig } from './surfaces/surfaceInteractionConfig';
|
|
30
33
|
import { clearAnonymousId, getOrCreateAnonymousId } from './anonymousId';
|
|
31
34
|
import {
|
|
32
35
|
didHandleURL,
|
|
@@ -34,6 +37,20 @@ import {
|
|
|
34
37
|
startDeepLinking,
|
|
35
38
|
stopDeepLinking,
|
|
36
39
|
} from './deepLinking';
|
|
40
|
+
import {
|
|
41
|
+
cacheDeviceContextAtInit,
|
|
42
|
+
getCachedDeviceContext,
|
|
43
|
+
logDeviceContext as logDeviceContextToConsole,
|
|
44
|
+
mergeDeviceContextUserAttributes,
|
|
45
|
+
type DeviceContext,
|
|
46
|
+
} from './deviceContext';
|
|
47
|
+
import {
|
|
48
|
+
cacheHostAppVersionAtInit,
|
|
49
|
+
getCachedHostAppVersion,
|
|
50
|
+
logHostAppVersion as logHostAppVersionToConsole,
|
|
51
|
+
mergeHostAppVersionUserAttributes,
|
|
52
|
+
type HostAppVersion,
|
|
53
|
+
} from './hostAppVersion';
|
|
37
54
|
import { LifecycleController } from './lifecycle';
|
|
38
55
|
import { setHostOnNavigate, type FlowNavigateHandler } from './navigation/openFlowNavigateUrl';
|
|
39
56
|
import { NetworkController } from './network';
|
|
@@ -53,11 +70,17 @@ import { getUserflowCore } from './runtime/userflowCore';
|
|
|
53
70
|
import {
|
|
54
71
|
disableScreenTracking,
|
|
55
72
|
enableScreenTracking,
|
|
73
|
+
getCurrentScreenLocation,
|
|
56
74
|
handleScreenChange,
|
|
75
|
+
reportCurrentScreen,
|
|
76
|
+
SCREEN_VIEWED_EVENT,
|
|
77
|
+
screenViewedAttributes,
|
|
57
78
|
setScreenChangeReporter,
|
|
58
79
|
} from './screenTracker';
|
|
59
80
|
|
|
60
81
|
export { SDK_VERSION } from './version';
|
|
82
|
+
export type { DeviceContext, DeviceOs, DeviceType, SdkPlatform } from './deviceContext';
|
|
83
|
+
export type { HostAppVersion, HostAppVersionSource } from './hostAppVersion';
|
|
61
84
|
export { UserflowProvider, useUserflow } from './runtime/UserflowProvider';
|
|
62
85
|
export type { UserflowProviderProps, UserflowContextValue } from './runtime/UserflowProvider';
|
|
63
86
|
export { useFlowSessionState } from './runtime/useFlowSessionState';
|
|
@@ -103,9 +126,18 @@ export type UserflowInitConfig = UserflowInitOptions & {
|
|
|
103
126
|
* Defaults to `https://e.userflow.com`.
|
|
104
127
|
*/
|
|
105
128
|
pairingEndpoint?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Override auto-detected native store version. When omitted, the SDK reads
|
|
131
|
+
* the host app's marketing version at init (Expo modules or native constants).
|
|
132
|
+
*/
|
|
133
|
+
appVersion?: string;
|
|
134
|
+
/** Optional build number paired with {@link appVersion}. */
|
|
135
|
+
appBuild?: string;
|
|
106
136
|
};
|
|
107
137
|
|
|
108
138
|
export type {
|
|
139
|
+
PublicAttributeChange,
|
|
140
|
+
PublicAttributes,
|
|
109
141
|
UserflowAttributes,
|
|
110
142
|
UserflowConfig,
|
|
111
143
|
UserflowEventAttributes,
|
|
@@ -113,6 +145,7 @@ export type {
|
|
|
113
145
|
UserflowIdentifyOptions,
|
|
114
146
|
UserflowInitOptions,
|
|
115
147
|
UserflowTrackOptions,
|
|
148
|
+
UserflowUpdateGroupOptions,
|
|
116
149
|
} from '@userflow-tech/core';
|
|
117
150
|
|
|
118
151
|
const core = getUserflowCore();
|
|
@@ -131,6 +164,9 @@ const lifecycle = new LifecycleController({
|
|
|
131
164
|
},
|
|
132
165
|
ensureAlive: () => core.ensureAlive(),
|
|
133
166
|
hasActiveSession: () => hasActiveFlowSession(),
|
|
167
|
+
onScreenResume: () => {
|
|
168
|
+
reportCurrentScreen();
|
|
169
|
+
},
|
|
134
170
|
});
|
|
135
171
|
|
|
136
172
|
const network = new NetworkController({
|
|
@@ -138,14 +174,23 @@ const network = new NetworkController({
|
|
|
138
174
|
ensureAlive: () => core.ensureAlive(),
|
|
139
175
|
});
|
|
140
176
|
|
|
177
|
+
/** True when a screen was reported before identify, so first identify should emit `screen_viewed`. */
|
|
178
|
+
let screenViewedAwaitingIdentify = false;
|
|
179
|
+
|
|
180
|
+
function armScreenViewedForNextIdentify(): void {
|
|
181
|
+
if (getCurrentScreenLocation() != null) {
|
|
182
|
+
screenViewedAwaitingIdentify = true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
141
186
|
function wireScreenChangeReporter(): void {
|
|
142
187
|
setScreenChangeReporter((location) => {
|
|
143
188
|
lifecycle.reportActivity();
|
|
144
189
|
const screenKey = 'path' in location ? `path:${location.path}` : `screen:${location.screen}`;
|
|
145
190
|
notifyAnchorScreenChange(screenKey);
|
|
146
191
|
anchorChangeTicker.notify();
|
|
192
|
+
const identified = core.getUserId() != null;
|
|
147
193
|
if (__DEV__) {
|
|
148
|
-
const identified = core.getUserId() != null;
|
|
149
194
|
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
150
195
|
console.log(
|
|
151
196
|
'[Userflow] updateScreen',
|
|
@@ -155,9 +200,34 @@ function wireScreenChangeReporter(): void {
|
|
|
155
200
|
}
|
|
156
201
|
// Mirrors web: only pushes UpdateClientContext after identify; before that the
|
|
157
202
|
// location is remembered and included on the next end-user channel join.
|
|
158
|
-
void core.updateScreen(location).catch(() => {
|
|
203
|
+
void core.updateScreen(location).catch((error: unknown) => {
|
|
159
204
|
// Screen updates are best-effort; connection drops / rate limits should not
|
|
160
205
|
// surface to the host app's navigation path.
|
|
206
|
+
if (__DEV__) {
|
|
207
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
208
|
+
console.warn('[Userflow] updateScreen failed', error);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
const attrs = screenViewedAttributes(location);
|
|
213
|
+
if (!attrs) return;
|
|
214
|
+
if (!identified) {
|
|
215
|
+
screenViewedAwaitingIdentify = true;
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
screenViewedAwaitingIdentify = false;
|
|
219
|
+
if (__DEV__) {
|
|
220
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
221
|
+
console.log('[Userflow] track', SCREEN_VIEWED_EVENT, attrs);
|
|
222
|
+
}
|
|
223
|
+
void core.track(SCREEN_VIEWED_EVENT, attrs).catch((error: unknown) => {
|
|
224
|
+
// Screen views are best-effort; connection drops / rate limits should not
|
|
225
|
+
// surface to the host app's navigation path. Each accepted screen sends
|
|
226
|
+
// UpdateClientContext + TrackEvent (two slots of the 100/min cap).
|
|
227
|
+
if (__DEV__) {
|
|
228
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
229
|
+
console.warn('[Userflow] track', SCREEN_VIEWED_EVENT, 'failed', error);
|
|
230
|
+
}
|
|
161
231
|
});
|
|
162
232
|
});
|
|
163
233
|
}
|
|
@@ -171,11 +241,20 @@ function wireDeepLinking(): void {
|
|
|
171
241
|
});
|
|
172
242
|
}
|
|
173
243
|
|
|
244
|
+
function mergeSystemUserAttributes<T extends Record<string, unknown>>(
|
|
245
|
+
attributes?: T,
|
|
246
|
+
): (T & Record<string, unknown>) | undefined {
|
|
247
|
+
return mergeDeviceContextUserAttributes(mergeHostAppVersionUserAttributes(attributes));
|
|
248
|
+
}
|
|
249
|
+
|
|
174
250
|
async function afterIdentify(): Promise<void> {
|
|
175
251
|
attachFlowSessionEngine(core);
|
|
176
252
|
attachClientConditionEngine(core);
|
|
177
253
|
getPairingController(core).notifyIdentified();
|
|
178
254
|
lifecycle.reportActivity();
|
|
255
|
+
if (screenViewedAwaitingIdentify) {
|
|
256
|
+
reportCurrentScreen();
|
|
257
|
+
}
|
|
179
258
|
try {
|
|
180
259
|
await flushPendingPreviewToken();
|
|
181
260
|
} catch {
|
|
@@ -190,6 +269,11 @@ async function afterIdentify(): Promise<void> {
|
|
|
190
269
|
export const Userflow = {
|
|
191
270
|
/** Validate credentials, store configuration, and wire app-lifecycle handling. */
|
|
192
271
|
init(config: UserflowInitConfig): Promise<UserflowConfig> {
|
|
272
|
+
cacheHostAppVersionAtInit({
|
|
273
|
+
...(config.appVersion !== undefined ? { appVersion: config.appVersion } : {}),
|
|
274
|
+
...(config.appBuild !== undefined ? { appBuild: config.appBuild } : {}),
|
|
275
|
+
});
|
|
276
|
+
cacheDeviceContextAtInit();
|
|
193
277
|
setHostOnNavigate(config.onNavigate);
|
|
194
278
|
lifecycle.start();
|
|
195
279
|
network.start();
|
|
@@ -255,8 +339,9 @@ export const Userflow = {
|
|
|
255
339
|
resetClientConditionEngine();
|
|
256
340
|
core.setClientConditions([]);
|
|
257
341
|
await clearAnonymousId();
|
|
342
|
+
armScreenViewedForNextIdentify();
|
|
258
343
|
}
|
|
259
|
-
await core.identify(userId, attributes, options);
|
|
344
|
+
await core.identify(userId, mergeSystemUserAttributes(attributes), options);
|
|
260
345
|
await afterIdentify();
|
|
261
346
|
},
|
|
262
347
|
/** Identify an anonymous user with a stable auto-generated id stored on device. */
|
|
@@ -269,8 +354,9 @@ export const Userflow = {
|
|
|
269
354
|
if (previousId != null && previousId !== anonymousId) {
|
|
270
355
|
resetClientConditionEngine();
|
|
271
356
|
core.setClientConditions([]);
|
|
357
|
+
armScreenViewedForNextIdentify();
|
|
272
358
|
}
|
|
273
|
-
await core.identify(anonymousId, attributes, options);
|
|
359
|
+
await core.identify(anonymousId, mergeSystemUserAttributes(attributes), options);
|
|
274
360
|
await afterIdentify();
|
|
275
361
|
},
|
|
276
362
|
/**
|
|
@@ -291,6 +377,23 @@ export const Userflow = {
|
|
|
291
377
|
lifecycle.reportActivity();
|
|
292
378
|
return core.group(groupId, attributes, options);
|
|
293
379
|
},
|
|
380
|
+
/**
|
|
381
|
+
* Upsert attributes for the current user without re-identifying.
|
|
382
|
+
* Requires a prior {@link identify}. Flow button "Set user attribute" actions
|
|
383
|
+
* use this path.
|
|
384
|
+
*/
|
|
385
|
+
updateUser(attributes?: PublicAttributes): Promise<void> {
|
|
386
|
+
lifecycle.reportActivity();
|
|
387
|
+
return core.updateUser(attributes);
|
|
388
|
+
},
|
|
389
|
+
/**
|
|
390
|
+
* Upsert attributes for the current group / membership without re-grouping.
|
|
391
|
+
* Requires a prior {@link group}.
|
|
392
|
+
*/
|
|
393
|
+
updateGroup(attributes?: PublicAttributes, options?: UserflowUpdateGroupOptions): Promise<void> {
|
|
394
|
+
lifecycle.reportActivity();
|
|
395
|
+
return core.updateGroup(attributes, options);
|
|
396
|
+
},
|
|
294
397
|
/** Record a custom analytics event for the current user (and group, unless `userOnly`). */
|
|
295
398
|
track(
|
|
296
399
|
name: string,
|
|
@@ -308,6 +411,20 @@ export const Userflow = {
|
|
|
308
411
|
getAttributes(): UserflowAttributes {
|
|
309
412
|
return core.getAttributes();
|
|
310
413
|
},
|
|
414
|
+
/**
|
|
415
|
+
* Host app marketing version cached during {@link init}, or `null` before init
|
|
416
|
+
* or when auto-detection and any init override are unavailable.
|
|
417
|
+
*/
|
|
418
|
+
getHostAppVersion(): HostAppVersion | null {
|
|
419
|
+
return getCachedHostAppVersion();
|
|
420
|
+
},
|
|
421
|
+
/**
|
|
422
|
+
* Platform metadata cached during {@link init} (`sdk`, `deviceOs`, `deviceType`),
|
|
423
|
+
* or `null` before init.
|
|
424
|
+
*/
|
|
425
|
+
getDeviceContext(): DeviceContext | null {
|
|
426
|
+
return getCachedDeviceContext();
|
|
427
|
+
},
|
|
311
428
|
/** The flow session engine (created lazily; attach runs after identify). */
|
|
312
429
|
getFlowSessionEngine() {
|
|
313
430
|
return getFlowSessionEngine(core);
|
|
@@ -317,6 +434,7 @@ export const Userflow = {
|
|
|
317
434
|
resetClientConditionEngine();
|
|
318
435
|
resetFlowSessionEngine();
|
|
319
436
|
core.reset();
|
|
437
|
+
armScreenViewedForNextIdentify();
|
|
320
438
|
await clearAnonymousId();
|
|
321
439
|
},
|
|
322
440
|
/** Remove app-lifecycle, network, and deep-link subscriptions (call on unmount / teardown). */
|
|
@@ -325,6 +443,7 @@ export const Userflow = {
|
|
|
325
443
|
lifecycle.stop();
|
|
326
444
|
network.stop();
|
|
327
445
|
disableScreenTracking();
|
|
446
|
+
screenViewedAwaitingIdentify = false;
|
|
328
447
|
stopDeepLinking();
|
|
329
448
|
},
|
|
330
449
|
/**
|
|
@@ -359,4 +478,29 @@ export const Userflow = {
|
|
|
359
478
|
setCustomScrollIntoView(fn: CustomScrollIntoView | null | undefined): void {
|
|
360
479
|
setCustomScrollIntoViewConfig(fn);
|
|
361
480
|
},
|
|
481
|
+
/**
|
|
482
|
+
* When true (default), tooltip cutout bands and step-transition exit block
|
|
483
|
+
* taps on the host app underneath. Pass `false` to restore legacy pass-through
|
|
484
|
+
* tooltip backdrop behavior (dim bands only; `tooltipTargetBlocked` hole seal
|
|
485
|
+
* is unchanged). Modals always block. Takes effect on the next surface re-render.
|
|
486
|
+
*/
|
|
487
|
+
setSurfaceInteractionBlocking(enabled: boolean | null | undefined): void {
|
|
488
|
+
setSurfaceInteractionBlockingConfig(enabled);
|
|
489
|
+
},
|
|
490
|
+
/**
|
|
491
|
+
* Log the host app's native marketing version (store version), not
|
|
492
|
+
* {@link SDK_VERSION}, and the platform OS (`ios` / `android` / …).
|
|
493
|
+
* Prefers `expo-application` / `expo-constants` when present; otherwise reads
|
|
494
|
+
* `NativeModules.RNDeviceInfo` from the bundled device-info native module.
|
|
495
|
+
*/
|
|
496
|
+
logHostAppVersion(): void {
|
|
497
|
+
logHostAppVersionToConsole();
|
|
498
|
+
},
|
|
499
|
+
/**
|
|
500
|
+
* Log cached user-attribute values (`sdk`, `device_os`, `device_type`).
|
|
501
|
+
* Requires {@link init}; before init, logs that init is required.
|
|
502
|
+
*/
|
|
503
|
+
logDeviceContext(): void {
|
|
504
|
+
logDeviceContextToConsole();
|
|
505
|
+
},
|
|
362
506
|
};
|
package/src/lifecycle.ts
CHANGED
|
@@ -51,6 +51,11 @@ export interface LifecycleControllerDeps {
|
|
|
51
51
|
ensureAlive: () => void;
|
|
52
52
|
/** True while any mid-flow session (live or draft/preview) is on screen. */
|
|
53
53
|
hasActiveSession: () => boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Re-fire the current screen view after a real background (away past grace).
|
|
56
|
+
* Not called for Control Center / biometric blurs inside the grace window.
|
|
57
|
+
*/
|
|
58
|
+
onScreenResume?: () => void;
|
|
54
59
|
scheduler?: LifecycleScheduler;
|
|
55
60
|
now?: () => number;
|
|
56
61
|
/** Override for tests; defaults to {@link SUSPEND_GRACE_MS}. */
|
|
@@ -82,6 +87,7 @@ export class LifecycleController {
|
|
|
82
87
|
private readonly clearLocalSession: () => void;
|
|
83
88
|
private readonly ensureAlive: () => void;
|
|
84
89
|
private readonly hasActiveSession: () => boolean;
|
|
90
|
+
private readonly onScreenResume: (() => void) | undefined;
|
|
85
91
|
private readonly scheduler: LifecycleScheduler;
|
|
86
92
|
private readonly now: () => number;
|
|
87
93
|
private readonly suspendGraceMs: number;
|
|
@@ -103,6 +109,7 @@ export class LifecycleController {
|
|
|
103
109
|
this.clearLocalSession = deps.clearLocalSession;
|
|
104
110
|
this.ensureAlive = deps.ensureAlive;
|
|
105
111
|
this.hasActiveSession = deps.hasActiveSession;
|
|
112
|
+
this.onScreenResume = deps.onScreenResume;
|
|
106
113
|
this.scheduler = deps.scheduler ?? defaultScheduler;
|
|
107
114
|
this.now = deps.now ?? (() => Date.now());
|
|
108
115
|
this.suspendGraceMs = deps.suspendGraceMs ?? SUSPEND_GRACE_MS;
|
|
@@ -210,6 +217,7 @@ export class LifecycleController {
|
|
|
210
217
|
this.resume();
|
|
211
218
|
this.suspended = false;
|
|
212
219
|
this.scheduleIdleTimer();
|
|
220
|
+
this.onScreenResume?.();
|
|
213
221
|
}
|
|
214
222
|
|
|
215
223
|
private scheduleGraceTimer(): void {
|
|
@@ -4,13 +4,14 @@ import type {
|
|
|
4
4
|
NavigationState,
|
|
5
5
|
ParamListBase,
|
|
6
6
|
} from '@react-navigation/native';
|
|
7
|
-
import { cloneElement, isValidElement, useCallback, useEffect } from 'react';
|
|
7
|
+
import { cloneElement, isValidElement, useCallback, useEffect, useRef } from 'react';
|
|
8
8
|
import type React from 'react';
|
|
9
9
|
|
|
10
10
|
import { handleScreenChange } from '../screenTracker';
|
|
11
11
|
|
|
12
12
|
import { chainCallbacks } from './chainCallbacks';
|
|
13
13
|
import { getActiveRouteName } from './getActiveRouteName';
|
|
14
|
+
import { isOverlayPresentation, readNavigationPresentation } from './isOverlayPresentation';
|
|
14
15
|
import { setReactNavigationRef } from './openFlowNavigateUrl';
|
|
15
16
|
|
|
16
17
|
type NavigationContainerChildProps = {
|
|
@@ -51,6 +52,7 @@ export function WithUserflowReactNavigation({
|
|
|
51
52
|
children,
|
|
52
53
|
}: WithUserflowReactNavigationProps): React.ReactElement {
|
|
53
54
|
const navigationRef = useNavigationContainerRef<ParamListBase>();
|
|
55
|
+
const overlayWasFocusedRef = useRef(false);
|
|
54
56
|
|
|
55
57
|
useEffect(() => {
|
|
56
58
|
setReactNavigationRef(navigationRef);
|
|
@@ -59,18 +61,32 @@ export function WithUserflowReactNavigation({
|
|
|
59
61
|
};
|
|
60
62
|
}, [navigationRef]);
|
|
61
63
|
|
|
64
|
+
const reportFocusedScreen = useCallback(
|
|
65
|
+
(state?: NavigationState) => {
|
|
66
|
+
if (isOverlayPresentation(readNavigationPresentation(navigationRef))) {
|
|
67
|
+
overlayWasFocusedRef.current = true;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const name = getActiveRouteName(state ?? navigationRef.getRootState());
|
|
71
|
+
handleScreenChange(
|
|
72
|
+
name ? { screen: name } : undefined,
|
|
73
|
+
overlayWasFocusedRef.current ? { force: true } : undefined,
|
|
74
|
+
);
|
|
75
|
+
overlayWasFocusedRef.current = false;
|
|
76
|
+
},
|
|
77
|
+
[navigationRef],
|
|
78
|
+
);
|
|
79
|
+
|
|
62
80
|
const handleReady = useCallback(() => {
|
|
63
81
|
setReactNavigationRef(navigationRef);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, [navigationRef]);
|
|
82
|
+
reportFocusedScreen();
|
|
83
|
+
}, [navigationRef, reportFocusedScreen]);
|
|
67
84
|
|
|
68
85
|
const handleStateChange = useCallback(
|
|
69
86
|
(state?: NavigationState) => {
|
|
70
|
-
|
|
71
|
-
handleScreenChange(name ? { screen: name } : undefined);
|
|
87
|
+
reportFocusedScreen(state);
|
|
72
88
|
},
|
|
73
|
-
[
|
|
89
|
+
[reportFocusedScreen],
|
|
74
90
|
);
|
|
75
91
|
|
|
76
92
|
if (!isValidElement(children)) {
|