@userflow-tech/react-native 0.1.1 → 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 +97 -61
- package/app.plugin.js +11 -1
- package/babel-plugin/index.d.ts +8 -8
- package/babel-plugin/index.d.ts.map +1 -1
- package/babel-plugin/index.js +17 -9
- package/babel-plugin/index.js.map +1 -1
- package/babel-plugin.js +13 -0
- package/docs/anchoring.md +141 -13
- package/docs/deep-linking.md +18 -15
- package/docs/theme-mapping.md +44 -15
- package/docs/troubleshooting.md +36 -29
- package/expo-plugin/withUserflow.js +1 -1
- package/expo-plugin/withUserflow.js.map +1 -1
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +124 -2
- 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/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/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 +9 -0
- 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 +125 -2
- 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/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/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 +8 -0
- 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 +26 -0
- 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/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/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 +26 -0
- 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/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/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 +22 -16
- package/src/anchors/AutoAnchorRegistry.ts +139 -2
- package/src/anchors/anchorChangeTicker.ts +10 -0
- 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/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 +8 -0
- 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/dist/attributes.d.ts +1 -2
- package/vendor/core/dist/attributes.d.ts.map +1 -1
- package/vendor/core/dist/attributes.js.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts +69 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.js +268 -7
- package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts +44 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.js +103 -9
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.d.ts +23 -4
- package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.js +64 -1
- package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
- 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 +27 -4
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
- package/vendor/core/dist/engine/handleActions.js +140 -13
- package/vendor/core/dist/engine/handleActions.js.map +1 -1
- 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/index.d.ts +4 -3
- package/vendor/core/dist/index.d.ts.map +1 -1
- package/vendor/core/dist/index.js +2 -1
- package/vendor/core/dist/index.js.map +1 -1
- 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/phoenix.d.ts +11 -6
- package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
- package/vendor/core/dist/transport/phoenix.js +59 -5
- package/vendor/core/dist/transport/phoenix.js.map +1 -1
- package/vendor/core/dist/types.d.ts +26 -1
- package/vendor/core/dist/types.d.ts.map +1 -1
- package/vendor/core/dist/version.d.ts +1 -1
- package/vendor/core/dist/version.js +1 -1
- package/vendor/core/package.json +1 -1
- 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 +2 -2
- package/vendor/protocol/dist/autoData.js +2 -2
- package/vendor/protocol/dist/events.d.ts +8 -0
- package/vendor/protocol/dist/events.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.d.ts +66 -4
- package/vendor/protocol/dist/flows.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.js +50 -3
- package/vendor/protocol/dist/flows.js.map +1 -1
- package/vendor/protocol/dist/index.d.ts +1 -0
- package/vendor/protocol/dist/index.d.ts.map +1 -1
- package/vendor/protocol/dist/index.js +1 -0
- package/vendor/protocol/dist/index.js.map +1 -1
- package/vendor/protocol/dist/messages.d.ts +25 -4
- package/vendor/protocol/dist/messages.d.ts.map +1 -1
- package/vendor/protocol/dist/messages.js +4 -0
- package/vendor/protocol/dist/messages.js.map +1 -1
- package/vendor/protocol/dist/pairing.d.ts +26 -0
- package/vendor/protocol/dist/pairing.d.ts.map +1 -1
- package/vendor/protocol/dist/pairing.js.map +1 -1
- package/vendor/protocol/package.json +1 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read the host app's native marketing version (store version), not the
|
|
5
|
+
* SDK package version. React Native does not expose the store version on
|
|
6
|
+
* `Platform`; Expo hosts may use optional expo modules; bare RN reads
|
|
7
|
+
* `NativeModules.RNDeviceInfo` constants from the bundled device-info native
|
|
8
|
+
* module (after autolink + rebuild). The OS name is `Platform.OS`.
|
|
9
|
+
*
|
|
10
|
+
* Do not `require('react-native-device-info')` — that package throws at import
|
|
11
|
+
* when the native module is missing, and Metro/Hermes may surface it as uncaught
|
|
12
|
+
* even inside try/catch.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function nonEmptyString(value) {
|
|
16
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
17
|
+
}
|
|
18
|
+
function unwrapModule(mod) {
|
|
19
|
+
if (typeof mod !== 'object' || mod === null) return null;
|
|
20
|
+
const record = mod;
|
|
21
|
+
const nested = record['default'];
|
|
22
|
+
if (typeof nested === 'object' && nested !== null) {
|
|
23
|
+
return {
|
|
24
|
+
...record,
|
|
25
|
+
...nested
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return record;
|
|
29
|
+
}
|
|
30
|
+
function tryRequireExpoApplication() {
|
|
31
|
+
try {
|
|
32
|
+
// Optional on bare RN — Metro requires a string literal.
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
34
|
+
return require('expo-application');
|
|
35
|
+
} catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function tryRequireExpoConstants() {
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
42
|
+
return require('expo-constants');
|
|
43
|
+
} catch {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function loadLinkedDeviceInfoNativeModule() {
|
|
48
|
+
try {
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
50
|
+
const {
|
|
51
|
+
NativeModules
|
|
52
|
+
} = require('react-native');
|
|
53
|
+
return NativeModules.RNDeviceInfo ?? null;
|
|
54
|
+
} catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Visible for tests: map an `expo-application` module shape to a version. */
|
|
60
|
+
export function readExpoApplication(mod) {
|
|
61
|
+
const record = unwrapModule(mod);
|
|
62
|
+
if (!record) return null;
|
|
63
|
+
const version = nonEmptyString(record['nativeApplicationVersion']);
|
|
64
|
+
if (!version) return null;
|
|
65
|
+
const build = nonEmptyString(record['nativeBuildVersion']);
|
|
66
|
+
return {
|
|
67
|
+
version,
|
|
68
|
+
source: 'expo-application',
|
|
69
|
+
...(build ? {
|
|
70
|
+
build
|
|
71
|
+
} : {})
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Visible for tests: map an `expo-constants` module shape to a version. */
|
|
76
|
+
export function readExpoConstants(mod) {
|
|
77
|
+
const record = unwrapModule(mod);
|
|
78
|
+
if (!record) return null;
|
|
79
|
+
const expoConfig = record['expoConfig'];
|
|
80
|
+
const configVersion = typeof expoConfig === 'object' && expoConfig !== null ? nonEmptyString(expoConfig['version']) : undefined;
|
|
81
|
+
const version = nonEmptyString(record['nativeAppVersion']) ?? configVersion;
|
|
82
|
+
if (!version) return null;
|
|
83
|
+
const build = nonEmptyString(record['nativeBuildVersion']);
|
|
84
|
+
return {
|
|
85
|
+
version,
|
|
86
|
+
source: 'expo-constants',
|
|
87
|
+
...(build ? {
|
|
88
|
+
build
|
|
89
|
+
} : {})
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Visible for tests: map linked RNDeviceInfo native constants to a version. */
|
|
94
|
+
export function readDeviceInfoFromNativeModule(module) {
|
|
95
|
+
if (!module) return null;
|
|
96
|
+
const version = nonEmptyString(module.appVersion);
|
|
97
|
+
if (!version || version === 'unknown') return null;
|
|
98
|
+
const build = nonEmptyString(module.buildNumber);
|
|
99
|
+
return {
|
|
100
|
+
version,
|
|
101
|
+
source: 'react-native-device-info',
|
|
102
|
+
...(build && build !== 'unknown' ? {
|
|
103
|
+
build
|
|
104
|
+
} : {})
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Visible for tests: first non-null reader wins (Expo modules, then RNDeviceInfo). */
|
|
109
|
+
export function resolveHostAppVersionFromSources(sources) {
|
|
110
|
+
return readExpoApplication(sources.expoApplication) ?? readExpoConstants(sources.expoConstants) ?? readDeviceInfoFromNativeModule(sources.deviceInfoNative);
|
|
111
|
+
}
|
|
112
|
+
export function resolveHostAppVersion() {
|
|
113
|
+
return resolveHostAppVersionFromSources({
|
|
114
|
+
expoApplication: tryRequireExpoApplication(),
|
|
115
|
+
expoConstants: tryRequireExpoConstants(),
|
|
116
|
+
deviceInfoNative: loadLinkedDeviceInfoNativeModule()
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/** Visible for tests: resolve version for init, honoring an optional client override. */
|
|
120
|
+
export function resolveHostAppVersionForInit(options = {}) {
|
|
121
|
+
const overrideVersion = nonEmptyString(options.appVersion);
|
|
122
|
+
if (overrideVersion) {
|
|
123
|
+
const build = nonEmptyString(options.appBuild);
|
|
124
|
+
return {
|
|
125
|
+
version: overrideVersion,
|
|
126
|
+
source: 'init-override',
|
|
127
|
+
...(build ? {
|
|
128
|
+
build
|
|
129
|
+
} : {})
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return resolveHostAppVersion();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** `undefined` until the first {@link cacheHostAppVersionAtInit}; then resolved or null. */
|
|
136
|
+
let cachedHostAppVersion;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Resolve and cache the host app version during {@link Userflow.init}.
|
|
140
|
+
* Re-running init replaces the cache.
|
|
141
|
+
*/
|
|
142
|
+
export function cacheHostAppVersionAtInit(options = {}) {
|
|
143
|
+
cachedHostAppVersion = resolveHostAppVersionForInit(options);
|
|
144
|
+
return cachedHostAppVersion;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Returns the version cached at init, or `null` before init or when unavailable. */
|
|
148
|
+
export function getCachedHostAppVersion() {
|
|
149
|
+
return cachedHostAppVersion ?? null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** User attribute keys for the host app's native store version. */
|
|
153
|
+
export const HOST_APP_VERSION_USER_ATTRIBUTE = 'app_version';
|
|
154
|
+
export const HOST_APP_BUILD_USER_ATTRIBUTE = 'app_build';
|
|
155
|
+
|
|
156
|
+
/** Returns cached host version fields for UpsertUser, or `{}` when unavailable. */
|
|
157
|
+
export function hostAppVersionUserAttributes() {
|
|
158
|
+
const cached = getCachedHostAppVersion();
|
|
159
|
+
if (!cached) return {};
|
|
160
|
+
return {
|
|
161
|
+
[HOST_APP_VERSION_USER_ATTRIBUTE]: cached.version,
|
|
162
|
+
...(cached.build ? {
|
|
163
|
+
[HOST_APP_BUILD_USER_ATTRIBUTE]: cached.build
|
|
164
|
+
} : {})
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Optional user-attribute keys added by {@link mergeHostAppVersionUserAttributes}. */
|
|
169
|
+
|
|
170
|
+
/** Merges cached host version attrs into identify attributes; caller values win on key conflicts. */
|
|
171
|
+
export function mergeHostAppVersionUserAttributes(attributes) {
|
|
172
|
+
const system = hostAppVersionUserAttributes();
|
|
173
|
+
if (Object.keys(system).length === 0) {
|
|
174
|
+
return attributes;
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
...system,
|
|
178
|
+
...(attributes ?? {})
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** @internal Resets init cache between tests. */
|
|
183
|
+
export function resetCachedHostAppVersionForTests() {
|
|
184
|
+
cachedHostAppVersion = undefined;
|
|
185
|
+
}
|
|
186
|
+
function readPlatformOS() {
|
|
187
|
+
try {
|
|
188
|
+
// Lazy require so Node unit tests can format messages without loading RN.
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
190
|
+
const os = require('react-native').Platform?.OS;
|
|
191
|
+
return typeof os === 'string' && os.length > 0 ? os : 'unknown';
|
|
192
|
+
} catch {
|
|
193
|
+
return 'unknown';
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
export function formatHostAppVersionLog(resolved, os) {
|
|
197
|
+
if (!resolved) {
|
|
198
|
+
return {
|
|
199
|
+
level: 'warn',
|
|
200
|
+
message: `[Userflow] host app version is unavailable on ${os}. Rebuild the native app ` + '(for example `cd ios && pod install`) so the bundled version module is linked.'
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const build = resolved.build ? ` (build ${resolved.build})` : '';
|
|
204
|
+
return {
|
|
205
|
+
level: 'log',
|
|
206
|
+
message: `[Userflow] host app version ${resolved.version}${build} on ${os}`
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Log the host app's native version and platform OS to the console. */
|
|
211
|
+
export function logHostAppVersion() {
|
|
212
|
+
const resolved = cachedHostAppVersion !== undefined ? cachedHostAppVersion : resolveHostAppVersion();
|
|
213
|
+
const {
|
|
214
|
+
level,
|
|
215
|
+
message
|
|
216
|
+
} = formatHostAppVersionLog(resolved, readPlatformOS());
|
|
217
|
+
if (level === 'warn') {
|
|
218
|
+
// eslint-disable-next-line no-console -- public logHostAppVersion()
|
|
219
|
+
console.warn(message);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
// eslint-disable-next-line no-console -- public logHostAppVersion()
|
|
223
|
+
console.log(message);
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=hostAppVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nonEmptyString","value","length","undefined","unwrapModule","mod","record","nested","tryRequireExpoApplication","require","tryRequireExpoConstants","loadLinkedDeviceInfoNativeModule","NativeModules","RNDeviceInfo","readExpoApplication","version","build","source","readExpoConstants","expoConfig","configVersion","readDeviceInfoFromNativeModule","module","appVersion","buildNumber","resolveHostAppVersionFromSources","sources","expoApplication","expoConstants","deviceInfoNative","resolveHostAppVersion","resolveHostAppVersionForInit","options","overrideVersion","appBuild","cachedHostAppVersion","cacheHostAppVersionAtInit","getCachedHostAppVersion","HOST_APP_VERSION_USER_ATTRIBUTE","HOST_APP_BUILD_USER_ATTRIBUTE","hostAppVersionUserAttributes","cached","mergeHostAppVersionUserAttributes","attributes","system","Object","keys","resetCachedHostAppVersionForTests","readPlatformOS","os","Platform","OS","formatHostAppVersionLog","resolved","level","message","logHostAppVersion","console","warn","log"],"sourceRoot":"../../src","sources":["hostAppVersion.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA,SAASA,cAAcA,CAACC,KAAc,EAAsB;EAC1D,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,MAAM,GAAG,CAAC,GAAGD,KAAK,GAAGE,SAAS;AAC1E;AAEA,SAASC,YAAYA,CAACC,GAAY,EAAkC;EAClE,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIA,GAAG,KAAK,IAAI,EAAE,OAAO,IAAI;EACxD,MAAMC,MAAM,GAAGD,GAA8B;EAC7C,MAAME,MAAM,GAAGD,MAAM,CAAC,SAAS,CAAC;EAChC,IAAI,OAA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EACxC,MAAMH,QAAQ,GACZlB,oBAAoB,KAAKhC,SAAS,GAAGgC,oBAAoB,GAAGL,qBAAqB,CAAC,CAAC;EACrF,MAAM;IAAEwB,KAAK;IAAEC;EAAQ,CAAC,GAAGH,uBAAuB,CAACC,QAAQ,EAAEL,cAAc,CAAC,CAAC,CAAC;EAC9E,IAAIM,KAAK,KAAK,MAAM,EAAE;IACpB;IACAG,OAAO,CAACC,IAAI,CAACH,OAAO,CAAC;IACrB;EACF;EACA;EACAE,OAAO,CAACE,GAAG,CAACJ,OAAO,CAAC;AACtB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -14,8 +14,11 @@ import "./anchors/autoAnchor.js";
|
|
|
14
14
|
import { anchorChangeTicker } from "./anchors/anchorChangeTicker.js";
|
|
15
15
|
import { notifyAnchorScreenChange } from "./anchors/resolveAnchorHost.js";
|
|
16
16
|
import { setCustomScrollIntoView as setCustomScrollIntoViewConfig, setScrollPadding as setScrollPaddingConfig } from "./anchors/scrollConfig.js";
|
|
17
|
+
import { setSurfaceInteractionBlocking as setSurfaceInteractionBlockingConfig } from "./surfaces/surfaceInteractionConfig.js";
|
|
17
18
|
import { clearAnonymousId, getOrCreateAnonymousId } from "./anonymousId.js";
|
|
18
19
|
import { didHandleURL, flushPendingPreviewToken, startDeepLinking, stopDeepLinking } from "./deepLinking.js";
|
|
20
|
+
import { cacheDeviceContextAtInit, getCachedDeviceContext, logDeviceContext as logDeviceContextToConsole, mergeDeviceContextUserAttributes } from "./deviceContext.js";
|
|
21
|
+
import { cacheHostAppVersionAtInit, getCachedHostAppVersion, logHostAppVersion as logHostAppVersionToConsole, mergeHostAppVersionUserAttributes } from "./hostAppVersion.js";
|
|
19
22
|
import { LifecycleController } from "./lifecycle.js";
|
|
20
23
|
import { setHostOnNavigate } from "./navigation/openFlowNavigateUrl.js";
|
|
21
24
|
import { NetworkController } from "./network.js";
|
|
@@ -23,7 +26,7 @@ import { getPairingController, installPairingController } from "./pairing/pairin
|
|
|
23
26
|
import { attachClientConditionEngine, resetClientConditionEngine } from "./runtime/clientConditions.js";
|
|
24
27
|
import { attachFlowSessionEngine, clearFlowSessionEngineLocalSession, getFlowSessionEngine, hasActiveFlowSession, resetFlowSessionEngine } from "./runtime/flowEngine.js";
|
|
25
28
|
import { getUserflowCore } from "./runtime/userflowCore.js";
|
|
26
|
-
import { disableScreenTracking, enableScreenTracking, handleScreenChange, setScreenChangeReporter } from "./screenTracker.js";
|
|
29
|
+
import { disableScreenTracking, enableScreenTracking, getCurrentScreenLocation, handleScreenChange, reportCurrentScreen, SCREEN_VIEWED_EVENT, screenViewedAttributes, setScreenChangeReporter } from "./screenTracker.js";
|
|
27
30
|
export { SDK_VERSION } from "./version.js";
|
|
28
31
|
export { UserflowProvider, useUserflow } from "./runtime/UserflowProvider.js";
|
|
29
32
|
export { useFlowSessionState } from "./runtime/useFlowSessionState.js";
|
|
@@ -50,28 +53,63 @@ const lifecycle = new LifecycleController({
|
|
|
50
53
|
core.setFlowSessionId(null);
|
|
51
54
|
},
|
|
52
55
|
ensureAlive: () => core.ensureAlive(),
|
|
53
|
-
hasActiveSession: () => hasActiveFlowSession()
|
|
56
|
+
hasActiveSession: () => hasActiveFlowSession(),
|
|
57
|
+
onScreenResume: () => {
|
|
58
|
+
reportCurrentScreen();
|
|
59
|
+
}
|
|
54
60
|
});
|
|
55
61
|
const network = new NetworkController({
|
|
56
62
|
// Probe if still "connected" (half-open) or reconnect eagerly if already dropped.
|
|
57
63
|
ensureAlive: () => core.ensureAlive()
|
|
58
64
|
});
|
|
65
|
+
|
|
66
|
+
/** True when a screen was reported before identify, so first identify should emit `screen_viewed`. */
|
|
67
|
+
let screenViewedAwaitingIdentify = false;
|
|
68
|
+
function armScreenViewedForNextIdentify() {
|
|
69
|
+
if (getCurrentScreenLocation() != null) {
|
|
70
|
+
screenViewedAwaitingIdentify = true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
59
73
|
function wireScreenChangeReporter() {
|
|
60
74
|
setScreenChangeReporter(location => {
|
|
61
75
|
lifecycle.reportActivity();
|
|
62
76
|
const screenKey = 'path' in location ? `path:${location.path}` : `screen:${location.screen}`;
|
|
63
77
|
notifyAnchorScreenChange(screenKey);
|
|
64
78
|
anchorChangeTicker.notify();
|
|
79
|
+
const identified = core.getUserId() != null;
|
|
65
80
|
if (__DEV__) {
|
|
66
|
-
const identified = core.getUserId() != null;
|
|
67
81
|
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
68
82
|
console.log('[Userflow] updateScreen', location, identified ? '(push UpdateClientContext)' : '(buffered until identify)');
|
|
69
83
|
}
|
|
70
84
|
// Mirrors web: only pushes UpdateClientContext after identify; before that the
|
|
71
85
|
// location is remembered and included on the next end-user channel join.
|
|
72
|
-
void core.updateScreen(location).catch(
|
|
86
|
+
void core.updateScreen(location).catch(error => {
|
|
73
87
|
// Screen updates are best-effort; connection drops / rate limits should not
|
|
74
88
|
// surface to the host app's navigation path.
|
|
89
|
+
if (__DEV__) {
|
|
90
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
91
|
+
console.warn('[Userflow] updateScreen failed', error);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const attrs = screenViewedAttributes(location);
|
|
95
|
+
if (!attrs) return;
|
|
96
|
+
if (!identified) {
|
|
97
|
+
screenViewedAwaitingIdentify = true;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
screenViewedAwaitingIdentify = false;
|
|
101
|
+
if (__DEV__) {
|
|
102
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
103
|
+
console.log('[Userflow] track', SCREEN_VIEWED_EVENT, attrs);
|
|
104
|
+
}
|
|
105
|
+
void core.track(SCREEN_VIEWED_EVENT, attrs).catch(error => {
|
|
106
|
+
// Screen views are best-effort; connection drops / rate limits should not
|
|
107
|
+
// surface to the host app's navigation path. Each accepted screen sends
|
|
108
|
+
// UpdateClientContext + TrackEvent (two slots of the 100/min cap).
|
|
109
|
+
if (__DEV__) {
|
|
110
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
111
|
+
console.warn('[Userflow] track', SCREEN_VIEWED_EVENT, 'failed', error);
|
|
112
|
+
}
|
|
75
113
|
});
|
|
76
114
|
});
|
|
77
115
|
}
|
|
@@ -82,11 +120,17 @@ function wireDeepLinking() {
|
|
|
82
120
|
startFlowWithToken: token => core.startFlowWithToken(token)
|
|
83
121
|
});
|
|
84
122
|
}
|
|
123
|
+
function mergeSystemUserAttributes(attributes) {
|
|
124
|
+
return mergeDeviceContextUserAttributes(mergeHostAppVersionUserAttributes(attributes));
|
|
125
|
+
}
|
|
85
126
|
async function afterIdentify() {
|
|
86
127
|
attachFlowSessionEngine(core);
|
|
87
128
|
attachClientConditionEngine(core);
|
|
88
129
|
getPairingController(core).notifyIdentified();
|
|
89
130
|
lifecycle.reportActivity();
|
|
131
|
+
if (screenViewedAwaitingIdentify) {
|
|
132
|
+
reportCurrentScreen();
|
|
133
|
+
}
|
|
90
134
|
try {
|
|
91
135
|
await flushPendingPreviewToken();
|
|
92
136
|
} catch {
|
|
@@ -101,6 +145,15 @@ async function afterIdentify() {
|
|
|
101
145
|
export const Userflow = {
|
|
102
146
|
/** Validate credentials, store configuration, and wire app-lifecycle handling. */
|
|
103
147
|
init(config) {
|
|
148
|
+
cacheHostAppVersionAtInit({
|
|
149
|
+
...(config.appVersion !== undefined ? {
|
|
150
|
+
appVersion: config.appVersion
|
|
151
|
+
} : {}),
|
|
152
|
+
...(config.appBuild !== undefined ? {
|
|
153
|
+
appBuild: config.appBuild
|
|
154
|
+
} : {})
|
|
155
|
+
});
|
|
156
|
+
cacheDeviceContextAtInit();
|
|
104
157
|
setHostOnNavigate(config.onNavigate);
|
|
105
158
|
lifecycle.start();
|
|
106
159
|
network.start();
|
|
@@ -160,8 +213,9 @@ export const Userflow = {
|
|
|
160
213
|
resetClientConditionEngine();
|
|
161
214
|
core.setClientConditions([]);
|
|
162
215
|
await clearAnonymousId();
|
|
216
|
+
armScreenViewedForNextIdentify();
|
|
163
217
|
}
|
|
164
|
-
await core.identify(userId, attributes, options);
|
|
218
|
+
await core.identify(userId, mergeSystemUserAttributes(attributes), options);
|
|
165
219
|
await afterIdentify();
|
|
166
220
|
},
|
|
167
221
|
/** Identify an anonymous user with a stable auto-generated id stored on device. */
|
|
@@ -171,8 +225,9 @@ export const Userflow = {
|
|
|
171
225
|
if (previousId != null && previousId !== anonymousId) {
|
|
172
226
|
resetClientConditionEngine();
|
|
173
227
|
core.setClientConditions([]);
|
|
228
|
+
armScreenViewedForNextIdentify();
|
|
174
229
|
}
|
|
175
|
-
await core.identify(anonymousId, attributes, options);
|
|
230
|
+
await core.identify(anonymousId, mergeSystemUserAttributes(attributes), options);
|
|
176
231
|
await afterIdentify();
|
|
177
232
|
},
|
|
178
233
|
/**
|
|
@@ -189,6 +244,23 @@ export const Userflow = {
|
|
|
189
244
|
lifecycle.reportActivity();
|
|
190
245
|
return core.group(groupId, attributes, options);
|
|
191
246
|
},
|
|
247
|
+
/**
|
|
248
|
+
* Upsert attributes for the current user without re-identifying.
|
|
249
|
+
* Requires a prior {@link identify}. Flow button "Set user attribute" actions
|
|
250
|
+
* use this path.
|
|
251
|
+
*/
|
|
252
|
+
updateUser(attributes) {
|
|
253
|
+
lifecycle.reportActivity();
|
|
254
|
+
return core.updateUser(attributes);
|
|
255
|
+
},
|
|
256
|
+
/**
|
|
257
|
+
* Upsert attributes for the current group / membership without re-grouping.
|
|
258
|
+
* Requires a prior {@link group}.
|
|
259
|
+
*/
|
|
260
|
+
updateGroup(attributes, options) {
|
|
261
|
+
lifecycle.reportActivity();
|
|
262
|
+
return core.updateGroup(attributes, options);
|
|
263
|
+
},
|
|
192
264
|
/** Record a custom analytics event for the current user (and group, unless `userOnly`). */
|
|
193
265
|
track(name, attributes, options) {
|
|
194
266
|
lifecycle.reportActivity();
|
|
@@ -202,6 +274,20 @@ export const Userflow = {
|
|
|
202
274
|
getAttributes() {
|
|
203
275
|
return core.getAttributes();
|
|
204
276
|
},
|
|
277
|
+
/**
|
|
278
|
+
* Host app marketing version cached during {@link init}, or `null` before init
|
|
279
|
+
* or when auto-detection and any init override are unavailable.
|
|
280
|
+
*/
|
|
281
|
+
getHostAppVersion() {
|
|
282
|
+
return getCachedHostAppVersion();
|
|
283
|
+
},
|
|
284
|
+
/**
|
|
285
|
+
* Platform metadata cached during {@link init} (`sdk`, `deviceOs`, `deviceType`),
|
|
286
|
+
* or `null` before init.
|
|
287
|
+
*/
|
|
288
|
+
getDeviceContext() {
|
|
289
|
+
return getCachedDeviceContext();
|
|
290
|
+
},
|
|
205
291
|
/** The flow session engine (created lazily; attach runs after identify). */
|
|
206
292
|
getFlowSessionEngine() {
|
|
207
293
|
return getFlowSessionEngine(core);
|
|
@@ -211,6 +297,7 @@ export const Userflow = {
|
|
|
211
297
|
resetClientConditionEngine();
|
|
212
298
|
resetFlowSessionEngine();
|
|
213
299
|
core.reset();
|
|
300
|
+
armScreenViewedForNextIdentify();
|
|
214
301
|
await clearAnonymousId();
|
|
215
302
|
},
|
|
216
303
|
/** Remove app-lifecycle, network, and deep-link subscriptions (call on unmount / teardown). */
|
|
@@ -219,6 +306,7 @@ export const Userflow = {
|
|
|
219
306
|
lifecycle.stop();
|
|
220
307
|
network.stop();
|
|
221
308
|
disableScreenTracking();
|
|
309
|
+
screenViewedAwaitingIdentify = false;
|
|
222
310
|
stopDeepLinking();
|
|
223
311
|
},
|
|
224
312
|
/**
|
|
@@ -254,6 +342,31 @@ export const Userflow = {
|
|
|
254
342
|
*/
|
|
255
343
|
setCustomScrollIntoView(fn) {
|
|
256
344
|
setCustomScrollIntoViewConfig(fn);
|
|
345
|
+
},
|
|
346
|
+
/**
|
|
347
|
+
* When true (default), tooltip cutout bands and step-transition exit block
|
|
348
|
+
* taps on the host app underneath. Pass `false` to restore legacy pass-through
|
|
349
|
+
* tooltip backdrop behavior (dim bands only; `tooltipTargetBlocked` hole seal
|
|
350
|
+
* is unchanged). Modals always block. Takes effect on the next surface re-render.
|
|
351
|
+
*/
|
|
352
|
+
setSurfaceInteractionBlocking(enabled) {
|
|
353
|
+
setSurfaceInteractionBlockingConfig(enabled);
|
|
354
|
+
},
|
|
355
|
+
/**
|
|
356
|
+
* Log the host app's native marketing version (store version), not
|
|
357
|
+
* {@link SDK_VERSION}, and the platform OS (`ios` / `android` / …).
|
|
358
|
+
* Prefers `expo-application` / `expo-constants` when present; otherwise reads
|
|
359
|
+
* `NativeModules.RNDeviceInfo` from the bundled device-info native module.
|
|
360
|
+
*/
|
|
361
|
+
logHostAppVersion() {
|
|
362
|
+
logHostAppVersionToConsole();
|
|
363
|
+
},
|
|
364
|
+
/**
|
|
365
|
+
* Log cached user-attribute values (`sdk`, `device_os`, `device_type`).
|
|
366
|
+
* Requires {@link init}; before init, logs that init is required.
|
|
367
|
+
*/
|
|
368
|
+
logDeviceContext() {
|
|
369
|
+
logDeviceContextToConsole();
|
|
257
370
|
}
|
|
258
371
|
};
|
|
259
372
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["anchorChangeTicker","notifyAnchorScreenChange","setCustomScrollIntoView","setCustomScrollIntoViewConfig","setScrollPadding","setScrollPaddingConfig","clearAnonymousId","getOrCreateAnonymousId","didHandleURL","flushPendingPreviewToken","startDeepLinking","stopDeepLinking","LifecycleController","setHostOnNavigate","NetworkController","getPairingController","installPairingController","attachClientConditionEngine","resetClientConditionEngine","attachFlowSessionEngine","clearFlowSessionEngineLocalSession","getFlowSessionEngine","hasActiveFlowSession","resetFlowSessionEngine","getUserflowCore","disableScreenTracking","enableScreenTracking","handleScreenChange","setScreenChangeReporter","SDK_VERSION","UserflowProvider","useUserflow","useFlowSessionState","useUserflowScreen","useUserflowAnchor","__userflowAutoAnchor","useUserflowScrollContainer","INACTIVITY_TIMEOUT_MS","SESSION_STALE_AFTER_BACKGROUND_MS","SUSPEND_GRACE_MS","inspectPairingDeepLink","isPairingAttempt","parsePairingDeepLink","isUserflowPairingUrl","PreviewModeBanner","core","lifecycle","suspend","resume","flushPendingSends","clearLocalSession","setFlowSessionId","ensureAlive","hasActiveSession","network","wireScreenChangeReporter","location","reportActivity","screenKey","path","screen","notify","__DEV__","identified","getUserId","console","log","updateScreen","catch","wireDeepLinking","isIdentified","startFlowWithToken","token","afterIdentify","notifyIdentified","Userflow","init","config","onNavigate","start","pairing","pairingEndpoint","undefined","notifyInitStarted","then","resolved","notifyInitialized","error","notifyInitFailed","handlePairingUrl","url","handleUrl","exitPreview","setOnNavigate","handler","identify","userId","attributes","options","previousId","setClientConditions","identifyAnonymous","anonymousId","group","groupId","track","name","getAttributes","reset","teardown","stop","screenName","padding","fn"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,OAAO,yBAAsB;AAC7B,SAASA,kBAAkB,QAAQ,iCAA8B;AACjE,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SACEC,uBAAuB,IAAIC,6BAA6B,EACxDC,gBAAgB,IAAIC,sBAAsB,QAGrC,2BAAwB;AAC/B,SAASC,gBAAgB,EAAEC,sBAAsB,QAAQ,kBAAe;AACxE,SACEC,YAAY,EACZC,wBAAwB,EACxBC,gBAAgB,EAChBC,eAAe,QACV,kBAAe;AACtB,SAASC,mBAAmB,QAAQ,gBAAa;AACjD,SAASC,iBAAiB,QAAkC,qCAAkC;AAC9F,SAASC,iBAAiB,QAAQ,cAAW;AAC7C,SAASC,oBAAoB,EAAEC,wBAAwB,QAAQ,6BAA0B;AACzF,SACEC,2BAA2B,EAC3BC,0BAA0B,QACrB,+BAA4B;AACnC,SACEC,uBAAuB,EACvBC,kCAAkC,EAClCC,oBAAoB,EACpBC,oBAAoB,EACpBC,sBAAsB,QACjB,yBAAsB;AAC7B,SAASC,eAAe,QAAQ,2BAAwB;AACxD,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,kBAAkB,EAClBC,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;AACA;EACE9E,gBAAgBA,CAAC4G,OAAyC,EAAQ;IAChE3G,sBAAsB,CAAC2G,OAAO,CAAC;EACjC,CAAC;EACD;AACF;AACA;AACA;EACE9G,uBAAuBA,CAAC+G,EAA2C,EAAQ;IACzE9G,6BAA6B,CAAC8G,EAAE,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["anchorChangeTicker","notifyAnchorScreenChange","setCustomScrollIntoView","setCustomScrollIntoViewConfig","setScrollPadding","setScrollPaddingConfig","setSurfaceInteractionBlocking","setSurfaceInteractionBlockingConfig","clearAnonymousId","getOrCreateAnonymousId","didHandleURL","flushPendingPreviewToken","startDeepLinking","stopDeepLinking","cacheDeviceContextAtInit","getCachedDeviceContext","logDeviceContext","logDeviceContextToConsole","mergeDeviceContextUserAttributes","cacheHostAppVersionAtInit","getCachedHostAppVersion","logHostAppVersion","logHostAppVersionToConsole","mergeHostAppVersionUserAttributes","LifecycleController","setHostOnNavigate","NetworkController","getPairingController","installPairingController","attachClientConditionEngine","resetClientConditionEngine","attachFlowSessionEngine","clearFlowSessionEngineLocalSession","getFlowSessionEngine","hasActiveFlowSession","resetFlowSessionEngine","getUserflowCore","disableScreenTracking","enableScreenTracking","getCurrentScreenLocation","handleScreenChange","reportCurrentScreen","SCREEN_VIEWED_EVENT","screenViewedAttributes","setScreenChangeReporter","SDK_VERSION","UserflowProvider","useUserflow","useFlowSessionState","useUserflowScreen","useUserflowAnchor","__userflowAutoAnchor","useUserflowScrollContainer","INACTIVITY_TIMEOUT_MS","SESSION_STALE_AFTER_BACKGROUND_MS","SUSPEND_GRACE_MS","inspectPairingDeepLink","isPairingAttempt","parsePairingDeepLink","isUserflowPairingUrl","PreviewModeBanner","core","lifecycle","suspend","resume","flushPendingSends","clearLocalSession","setFlowSessionId","ensureAlive","hasActiveSession","onScreenResume","network","screenViewedAwaitingIdentify","armScreenViewedForNextIdentify","wireScreenChangeReporter","location","reportActivity","screenKey","path","screen","notify","identified","getUserId","__DEV__","console","log","updateScreen","catch","error","warn","attrs","track","wireDeepLinking","isIdentified","startFlowWithToken","token","mergeSystemUserAttributes","attributes","afterIdentify","notifyIdentified","Userflow","init","config","appVersion","undefined","appBuild","onNavigate","start","pairing","pairingEndpoint","notifyInitStarted","then","resolved","notifyInitialized","notifyInitFailed","handlePairingUrl","url","handleUrl","exitPreview","setOnNavigate","handler","identify","userId","options","previousId","setClientConditions","identifyAnonymous","anonymousId","group","groupId","updateUser","updateGroup","name","getAttributes","getHostAppVersion","getDeviceContext","reset","teardown","stop","screenName","padding","fn","enabled"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,OAAO,yBAAsB;AAC7B,SAASA,kBAAkB,QAAQ,iCAA8B;AACjE,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SACEC,uBAAuB,IAAIC,6BAA6B,EACxDC,gBAAgB,IAAIC,sBAAsB,QAGrC,2BAAwB;AAC/B,SAASC,6BAA6B,IAAIC,mCAAmC,QAAQ,wCAAqC;AAC1H,SAASC,gBAAgB,EAAEC,sBAAsB,QAAQ,kBAAe;AACxE,SACEC,YAAY,EACZC,wBAAwB,EACxBC,gBAAgB,EAChBC,eAAe,QACV,kBAAe;AACtB,SACEC,wBAAwB,EACxBC,sBAAsB,EACtBC,gBAAgB,IAAIC,yBAAyB,EAC7CC,gCAAgC,QAE3B,oBAAiB;AACxB,SACEC,yBAAyB,EACzBC,uBAAuB,EACvBC,iBAAiB,IAAIC,0BAA0B,EAC/CC,iCAAiC,QAE5B,qBAAkB;AACzB,SAASC,mBAAmB,QAAQ,gBAAa;AACjD,SAASC,iBAAiB,QAAkC,qCAAkC;AAC9F,SAASC,iBAAiB,QAAQ,cAAW;AAC7C,SAASC,oBAAoB,EAAEC,wBAAwB,QAAQ,6BAA0B;AACzF,SACEC,2BAA2B,EAC3BC,0BAA0B,QACrB,+BAA4B;AACnC,SACEC,uBAAuB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,EAA2C,EAAQ;IACzE1I,6BAA6B,CAAC0I,EAAE,CAAC;EACnC,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEvI,6BAA6BA,CAACwI,OAAmC,EAAQ;IACvEvI,mCAAmC,CAACuI,OAAO,CAAC;EAC9C,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;EACEzH,iBAAiBA,CAAA,EAAS;IACxBC,0BAA0B,CAAC,CAAC;EAC9B,CAAC;EACD;AACF;AACA;AACA;EACEN,gBAAgBA,CAAA,EAAS;IACvBC,yBAAyB,CAAC,CAAC;EAC7B;AACF,CAAC","ignoreList":[]}
|
package/lib/module/lifecycle.js
CHANGED
|
@@ -59,6 +59,7 @@ export class LifecycleController {
|
|
|
59
59
|
this.clearLocalSession = deps.clearLocalSession;
|
|
60
60
|
this.ensureAlive = deps.ensureAlive;
|
|
61
61
|
this.hasActiveSession = deps.hasActiveSession;
|
|
62
|
+
this.onScreenResume = deps.onScreenResume;
|
|
62
63
|
this.scheduler = deps.scheduler ?? defaultScheduler;
|
|
63
64
|
this.now = deps.now ?? (() => Date.now());
|
|
64
65
|
this.suspendGraceMs = deps.suspendGraceMs ?? SUSPEND_GRACE_MS;
|
|
@@ -155,6 +156,7 @@ export class LifecycleController {
|
|
|
155
156
|
this.resume();
|
|
156
157
|
this.suspended = false;
|
|
157
158
|
this.scheduleIdleTimer();
|
|
159
|
+
this.onScreenResume?.();
|
|
158
160
|
}
|
|
159
161
|
scheduleGraceTimer() {
|
|
160
162
|
this.clearGraceTimer();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AppState","INACTIVITY_TIMEOUT_MS","SESSION_STALE_AFTER_BACKGROUND_MS","SUSPEND_GRACE_MS","defaultScheduler","setTimeout","handler","ms","clearTimeout","handle","defaultSubscribeAppState","subscription","addEventListener","remove","LifecycleController","unsubscribeAppState","idleTimer","graceTimer","backgroundedAt","appIsActive","started","suspended","constructor","deps","suspend","resume","clearLocalSession","ensureAlive","hasActiveSession","scheduler","now","Date","suspendGraceMs","getCurrentAppState","currentState","subscribeAppState","start","status","handleAppStateChange","scheduleIdleTimer","stop","clearIdleTimer","clearGraceTimer","reportActivity","onForeground","onBackground","scheduleGraceTimer","awayMs"],"sourceRoot":"../../src","sources":["lifecycle.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AAGvC;AACA,OAAO,MAAMC,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAElD;AACA,OAAO,MAAMC,iCAAiC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAE9D;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,KAAK;
|
|
1
|
+
{"version":3,"names":["AppState","INACTIVITY_TIMEOUT_MS","SESSION_STALE_AFTER_BACKGROUND_MS","SUSPEND_GRACE_MS","defaultScheduler","setTimeout","handler","ms","clearTimeout","handle","defaultSubscribeAppState","subscription","addEventListener","remove","LifecycleController","unsubscribeAppState","idleTimer","graceTimer","backgroundedAt","appIsActive","started","suspended","constructor","deps","suspend","resume","clearLocalSession","ensureAlive","hasActiveSession","onScreenResume","scheduler","now","Date","suspendGraceMs","getCurrentAppState","currentState","subscribeAppState","start","status","handleAppStateChange","scheduleIdleTimer","stop","clearIdleTimer","clearGraceTimer","reportActivity","onForeground","onBackground","scheduleGraceTimer","awayMs"],"sourceRoot":"../../src","sources":["lifecycle.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AAGvC;AACA,OAAO,MAAMC,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAElD;AACA,OAAO,MAAMC,iCAAiC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;AAE9D;AAC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C3B,IAAI,CAACY,iBAAiB,CAAC,CAAC;QACxB;MACF;MACA,IAAI,CAAChB,OAAO,CAAC,CAAC;MACd,IAAI,CAACH,SAAS,GAAG,IAAI;IACvB,CAAC,EAAEpB,qBAAqB,CAAC;EAC3B;EAEQyC,cAAcA,CAAA,EAAS;IAC7B,IAAI,IAAI,CAAC1B,SAAS,IAAI,IAAI,EAAE;MAC1B,IAAI,CAACc,SAAS,CAACtB,YAAY,CAAC,IAAI,CAACQ,SAAS,CAAC;MAC3C,IAAI,CAACA,SAAS,GAAG,IAAI;IACvB;EACF;AACF","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useNavigationContainerRef } from '@react-navigation/native';
|
|
4
|
-
import { cloneElement, isValidElement, useCallback, useEffect } from 'react';
|
|
4
|
+
import { cloneElement, isValidElement, useCallback, useEffect, useRef } from 'react';
|
|
5
5
|
import { handleScreenChange } from "../screenTracker.js";
|
|
6
6
|
import { chainCallbacks } from "./chainCallbacks.js";
|
|
7
7
|
import { getActiveRouteName } from "./getActiveRouteName.js";
|
|
8
|
+
import { isOverlayPresentation, readNavigationPresentation } from "./isOverlayPresentation.js";
|
|
8
9
|
import { setReactNavigationRef } from "./openFlowNavigateUrl.js";
|
|
9
10
|
function assignRef(ref, value) {
|
|
10
11
|
if (typeof ref === 'function') {
|
|
@@ -33,25 +34,33 @@ export function WithUserflowReactNavigation({
|
|
|
33
34
|
children
|
|
34
35
|
}) {
|
|
35
36
|
const navigationRef = useNavigationContainerRef();
|
|
37
|
+
const overlayWasFocusedRef = useRef(false);
|
|
36
38
|
useEffect(() => {
|
|
37
39
|
setReactNavigationRef(navigationRef);
|
|
38
40
|
return () => {
|
|
39
41
|
setReactNavigationRef(null);
|
|
40
42
|
};
|
|
41
43
|
}, [navigationRef]);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} : undefined);
|
|
48
|
-
}, [navigationRef]);
|
|
49
|
-
const handleStateChange = useCallback(state => {
|
|
44
|
+
const reportFocusedScreen = useCallback(state => {
|
|
45
|
+
if (isOverlayPresentation(readNavigationPresentation(navigationRef))) {
|
|
46
|
+
overlayWasFocusedRef.current = true;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
50
49
|
const name = getActiveRouteName(state ?? navigationRef.getRootState());
|
|
51
50
|
handleScreenChange(name ? {
|
|
52
51
|
screen: name
|
|
52
|
+
} : undefined, overlayWasFocusedRef.current ? {
|
|
53
|
+
force: true
|
|
53
54
|
} : undefined);
|
|
55
|
+
overlayWasFocusedRef.current = false;
|
|
54
56
|
}, [navigationRef]);
|
|
57
|
+
const handleReady = useCallback(() => {
|
|
58
|
+
setReactNavigationRef(navigationRef);
|
|
59
|
+
reportFocusedScreen();
|
|
60
|
+
}, [navigationRef, reportFocusedScreen]);
|
|
61
|
+
const handleStateChange = useCallback(state => {
|
|
62
|
+
reportFocusedScreen(state);
|
|
63
|
+
}, [reportFocusedScreen]);
|
|
55
64
|
if (! /*#__PURE__*/isValidElement(children)) {
|
|
56
65
|
throw new Error('WithUserflowReactNavigation expects a single React element child.');
|
|
57
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useNavigationContainerRef","cloneElement","isValidElement","useCallback","useEffect","handleScreenChange","chainCallbacks","getActiveRouteName","setReactNavigationRef","assignRef","ref","value","current","mergeRefs","refs","WithUserflowReactNavigation","children","navigationRef","
|
|
1
|
+
{"version":3,"names":["useNavigationContainerRef","cloneElement","isValidElement","useCallback","useEffect","useRef","handleScreenChange","chainCallbacks","getActiveRouteName","isOverlayPresentation","readNavigationPresentation","setReactNavigationRef","assignRef","ref","value","current","mergeRefs","refs","WithUserflowReactNavigation","children","navigationRef","overlayWasFocusedRef","reportFocusedScreen","state","name","getRootState","screen","undefined","force","handleReady","handleStateChange","Error","childProps","props","onReady","onStateChange"],"sourceRoot":"../../../src","sources":["navigation/With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