@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,76 @@
|
|
|
1
|
+
/** React Navigation `options.presentation` values that are overlays, not screens. */
|
|
2
|
+
const OVERLAY_PRESENTATIONS = new Set([
|
|
3
|
+
'modal',
|
|
4
|
+
'transparentModal',
|
|
5
|
+
'containedModal',
|
|
6
|
+
'containedTransparentModal',
|
|
7
|
+
'fullScreenModal',
|
|
8
|
+
'formSheet',
|
|
9
|
+
'pageSheet',
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
/** True when the focused route is a modal / sheet overlay, not a screen navigation. */
|
|
13
|
+
export function isOverlayPresentation(presentation: unknown): boolean {
|
|
14
|
+
return typeof presentation === 'string' && OVERLAY_PRESENTATIONS.has(presentation);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type OptionsHolder = {
|
|
18
|
+
getCurrentOptions?: () => { presentation?: string } | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function presentationFromHolder(holder: unknown): string | undefined {
|
|
22
|
+
if (holder == null || typeof holder !== 'object') return undefined;
|
|
23
|
+
const getCurrentOptions = (holder as OptionsHolder).getCurrentOptions;
|
|
24
|
+
if (typeof getCurrentOptions !== 'function') return undefined;
|
|
25
|
+
try {
|
|
26
|
+
return getCurrentOptions()?.presentation;
|
|
27
|
+
} catch {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Reads `presentation` from a React Navigation container ref.
|
|
34
|
+
* Accepts either a `NavigationContainerRef` or a `NavigationContainerRefWithCurrent`
|
|
35
|
+
* (`ref.current` is checked when the wrapper itself has no `getCurrentOptions`).
|
|
36
|
+
*/
|
|
37
|
+
export function readNavigationPresentation(ref: unknown): string | undefined {
|
|
38
|
+
const fromRef = presentationFromHolder(ref);
|
|
39
|
+
if (fromRef !== undefined) return fromRef;
|
|
40
|
+
if (ref != null && typeof ref === 'object' && 'current' in ref) {
|
|
41
|
+
return presentationFromHolder((ref as { current: unknown }).current);
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type StateListenerHolder = {
|
|
47
|
+
addListener?: (event: string, listener: () => void) => (() => void) | void;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function subscribeHolder(holder: unknown, listener: () => void): (() => void) | undefined {
|
|
51
|
+
if (holder == null || typeof holder !== 'object') return undefined;
|
|
52
|
+
const addListener = (holder as StateListenerHolder).addListener;
|
|
53
|
+
if (typeof addListener !== 'function') return undefined;
|
|
54
|
+
try {
|
|
55
|
+
const unsubscribe = addListener.call(holder, 'state', listener);
|
|
56
|
+
return typeof unsubscribe === 'function' ? unsubscribe : undefined;
|
|
57
|
+
} catch {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Subscribes to React Navigation container `state` events.
|
|
64
|
+
* Accepts a `NavigationContainerRef` or `NavigationContainerRefWithCurrent`.
|
|
65
|
+
*/
|
|
66
|
+
export function subscribeNavigationState(
|
|
67
|
+
ref: unknown,
|
|
68
|
+
listener: () => void,
|
|
69
|
+
): (() => void) | undefined {
|
|
70
|
+
const fromRef = subscribeHolder(ref, listener);
|
|
71
|
+
if (fromRef) return fromRef;
|
|
72
|
+
if (ref != null && typeof ref === 'object' && 'current' in ref) {
|
|
73
|
+
return subscribeHolder((ref as { current: unknown }).current, listener);
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
} from '@userflow-tech/core';
|
|
7
7
|
import { AppState, type AppStateStatus, Linking, Platform } from 'react-native';
|
|
8
8
|
|
|
9
|
+
import { clearFiberAnchorCache } from '../anchors/fiberAnchorCache';
|
|
10
|
+
|
|
9
11
|
import { inspectPairingDeepLink, isPairingAttempt } from './deepLink';
|
|
10
12
|
import {
|
|
11
13
|
defaultPairingLogger,
|
|
@@ -14,9 +16,11 @@ import {
|
|
|
14
16
|
pairingLinkDeferredMessage,
|
|
15
17
|
pairingLinkInitFailedMessage,
|
|
16
18
|
pairingListenerSetupFailedMessage,
|
|
19
|
+
pairingPreviewErrorMessage,
|
|
17
20
|
pairingTokenStoreClearFailedMessage,
|
|
18
21
|
type PairingLogger,
|
|
19
22
|
} from './diagnostics';
|
|
23
|
+
import { bindElementPickerRelay } from './elementPickerRelay';
|
|
20
24
|
import { createPairingTokenStore, type PairingTokenStore } from './tokenStorage';
|
|
21
25
|
|
|
22
26
|
export type PairingControllerListener = (state: PairingEngineState) => void;
|
|
@@ -73,6 +77,7 @@ export class PairingController {
|
|
|
73
77
|
private deferredPairingToken: string | null = null;
|
|
74
78
|
/** Diagnostics already emitted for the current init attempt. */
|
|
75
79
|
private readonly loggedOnce = new Set<string>();
|
|
80
|
+
private relayUnsub: (() => void) | null = null;
|
|
76
81
|
|
|
77
82
|
constructor(options: PairingControllerOptions) {
|
|
78
83
|
this.core = options.core;
|
|
@@ -106,6 +111,8 @@ export class PairingController {
|
|
|
106
111
|
lastError: null,
|
|
107
112
|
needsRescan: false,
|
|
108
113
|
awaitingStartCondition: false,
|
|
114
|
+
canRestartPreview: false,
|
|
115
|
+
previewRestartGeneration: 0,
|
|
109
116
|
}
|
|
110
117
|
);
|
|
111
118
|
}
|
|
@@ -127,6 +134,8 @@ export class PairingController {
|
|
|
127
134
|
}`,
|
|
128
135
|
needsRescan: true,
|
|
129
136
|
awaitingStartCondition: false,
|
|
137
|
+
canRestartPreview: false,
|
|
138
|
+
previewRestartGeneration: 0,
|
|
130
139
|
};
|
|
131
140
|
}
|
|
132
141
|
|
|
@@ -194,6 +203,7 @@ export class PairingController {
|
|
|
194
203
|
this.appStateSub?.remove();
|
|
195
204
|
this.appStateSub = null;
|
|
196
205
|
this.started = false;
|
|
206
|
+
this.unbindRelay();
|
|
197
207
|
void this.exitPreview();
|
|
198
208
|
}
|
|
199
209
|
|
|
@@ -310,6 +320,16 @@ export class PairingController {
|
|
|
310
320
|
this.emit(this.getState());
|
|
311
321
|
}
|
|
312
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Replay the last previewed flow from step 1. No-ops when nothing has been
|
|
325
|
+
* delivered yet (restart control is hidden in that case).
|
|
326
|
+
*/
|
|
327
|
+
async restartPreview(): Promise<boolean> {
|
|
328
|
+
if (!this.engine) return false;
|
|
329
|
+
clearFiberAnchorCache();
|
|
330
|
+
return this.engine.restartPreview();
|
|
331
|
+
}
|
|
332
|
+
|
|
313
333
|
/** Flush queued startFlowWithToken after identify. */
|
|
314
334
|
notifyIdentified(): void {
|
|
315
335
|
this.engine?.notifyIdentified();
|
|
@@ -323,21 +343,30 @@ export class PairingController {
|
|
|
323
343
|
onServerMessage: (handler) => this.core.onServerMessage(handler),
|
|
324
344
|
isIdentified: () => this.core.getUserId() != null,
|
|
325
345
|
pairingOptions: { pairingEndpoint: this.pairingEndpoint },
|
|
326
|
-
deviceMeta: () => ({
|
|
327
|
-
os: Platform.OS,
|
|
328
|
-
}),
|
|
346
|
+
deviceMeta: () => ({ os: Platform.OS }),
|
|
329
347
|
});
|
|
330
348
|
|
|
331
349
|
this.engine.onStateChange((state) => {
|
|
332
350
|
this.emit(state);
|
|
351
|
+
if (state.lastError) {
|
|
352
|
+
this.warnOnce(pairingPreviewErrorMessage(state.lastError));
|
|
353
|
+
}
|
|
333
354
|
if (state.status === 'token_expired' || state.needsRescan) {
|
|
334
355
|
void this.tokenStore.clear();
|
|
335
356
|
}
|
|
336
357
|
});
|
|
337
358
|
|
|
359
|
+
this.unbindRelay();
|
|
360
|
+
this.relayUnsub = bindElementPickerRelay(this.engine);
|
|
361
|
+
|
|
338
362
|
return this.engine;
|
|
339
363
|
}
|
|
340
364
|
|
|
365
|
+
private unbindRelay(): void {
|
|
366
|
+
this.relayUnsub?.();
|
|
367
|
+
this.relayUnsub = null;
|
|
368
|
+
}
|
|
369
|
+
|
|
341
370
|
private emit(state: PairingEngineState): void {
|
|
342
371
|
for (const listener of this.listeners) {
|
|
343
372
|
try {
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import type { PairingEngineState } from '@userflow-tech/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { ChromeBarTransition, useChromeBarMounted } from '../authoring/chrome/ChromeBarTransition';
|
|
6
|
+
import { ChromeButton } from '../authoring/chrome/ChromeButton';
|
|
7
|
+
import { ChromeDialog } from '../authoring/chrome/ChromeDialog';
|
|
8
|
+
import { ChromeTooltip } from '../authoring/chrome/ChromeTooltip';
|
|
9
|
+
import { ChromeTopBar } from '../authoring/chrome/ChromeTopBar';
|
|
10
|
+
import { doubleTapMonitor } from '../authoring/chrome/doubleTapMonitor';
|
|
11
|
+
import { useReportPreviewBannerHeight } from '../surfaces/surfaceLayoutInsets';
|
|
12
|
+
|
|
13
|
+
import { resolvePreviewChrome, type PreviewChrome } from './resolvePreviewChrome';
|
|
14
|
+
|
|
15
|
+
type VisiblePreviewChrome = Extract<PreviewChrome, { visible: true }>;
|
|
16
|
+
type ConfirmingKind = 'exit' | 'restart';
|
|
17
|
+
|
|
18
|
+
const ONBOARDING_COPY = 'Double tap anywhere to access the menu';
|
|
4
19
|
|
|
5
20
|
export interface PreviewModeBannerProps {
|
|
6
21
|
state: PairingEngineState;
|
|
7
22
|
onExit: () => void;
|
|
23
|
+
onRestart?: () => void;
|
|
24
|
+
/** True while a chrome confirm dialog is open, so the provider can trap host a11y. */
|
|
25
|
+
onConfirmingChange?: (open: boolean) => void;
|
|
26
|
+
/** Hide the preview bar while the element picker is using the same top slot. */
|
|
27
|
+
suppressed?: boolean | undefined;
|
|
8
28
|
}
|
|
9
29
|
|
|
10
30
|
/**
|
|
@@ -13,68 +33,234 @@ export interface PreviewModeBannerProps {
|
|
|
13
33
|
export function PreviewModeBanner({
|
|
14
34
|
state,
|
|
15
35
|
onExit,
|
|
36
|
+
onRestart,
|
|
37
|
+
onConfirmingChange,
|
|
38
|
+
suppressed = false,
|
|
16
39
|
}: PreviewModeBannerProps): React.ReactElement | null {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
const setBannerHeight = useReportPreviewBannerHeight();
|
|
41
|
+
const chrome = resolvePreviewChrome(state);
|
|
42
|
+
const [chromeShown, setChromeShown] = React.useState(true);
|
|
43
|
+
const [showOnboarding, setShowOnboarding] = React.useState(false);
|
|
44
|
+
const [barHeight, setBarHeight] = React.useState(0);
|
|
45
|
+
const sessionArmedRef = React.useRef(false);
|
|
46
|
+
const isError = chrome.visible && chrome.tone === 'error';
|
|
47
|
+
const visible = chrome.visible && !suppressed && (chromeShown || isError);
|
|
48
|
+
const [confirming, setConfirming] = React.useState<ConfirmingKind | null>(null);
|
|
49
|
+
const showRestart = Boolean(state.canRestartPreview) && !isError;
|
|
50
|
+
const showDialog = confirming != null && visible && !isError;
|
|
51
|
+
// Keep the bar mounted through its slide-out (double-tap hide, preview end,
|
|
52
|
+
// or picker suppression), rendering the last known chrome while it leaves.
|
|
53
|
+
const barMounted = useChromeBarMounted(visible);
|
|
54
|
+
const lastVisibleChromeRef = React.useRef<VisiblePreviewChrome | null>(null);
|
|
55
|
+
if (chrome.visible) {
|
|
56
|
+
lastVisibleChromeRef.current = chrome;
|
|
25
57
|
}
|
|
58
|
+
const barChrome = chrome.visible ? chrome : lastVisibleChromeRef.current;
|
|
59
|
+
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (!chrome.visible) {
|
|
62
|
+
sessionArmedRef.current = false;
|
|
63
|
+
setChromeShown(true);
|
|
64
|
+
setShowOnboarding(false);
|
|
65
|
+
setBarHeight(0);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (isError) {
|
|
69
|
+
setChromeShown(true);
|
|
70
|
+
setShowOnboarding(false);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!sessionArmedRef.current) {
|
|
74
|
+
sessionArmedRef.current = true;
|
|
75
|
+
setShowOnboarding(true);
|
|
76
|
+
}
|
|
77
|
+
}, [chrome.visible, isError]);
|
|
78
|
+
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
if (!visible || isError) {
|
|
81
|
+
setConfirming(null);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (confirming === 'restart' && !state.canRestartPreview) {
|
|
85
|
+
setConfirming(null);
|
|
86
|
+
}
|
|
87
|
+
}, [confirming, isError, state.canRestartPreview, visible]);
|
|
88
|
+
|
|
89
|
+
React.useEffect(() => {
|
|
90
|
+
if (!chrome.visible) {
|
|
91
|
+
setBannerHeight(0);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (suppressed) return;
|
|
95
|
+
if (!chromeShown && !isError) {
|
|
96
|
+
setBannerHeight(0);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (barHeight > 0) {
|
|
100
|
+
setBannerHeight(barHeight);
|
|
101
|
+
}
|
|
102
|
+
}, [barHeight, chrome.visible, chromeShown, isError, setBannerHeight, suppressed]);
|
|
103
|
+
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
if (!chrome.visible || suppressed || isError) {
|
|
106
|
+
doubleTapMonitor.set(null);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
doubleTapMonitor.set({
|
|
110
|
+
onDoubleTap: () => {
|
|
111
|
+
setShowOnboarding(false);
|
|
112
|
+
setChromeShown((shown) => !shown);
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
return () => {
|
|
116
|
+
doubleTapMonitor.set(null);
|
|
117
|
+
};
|
|
118
|
+
}, [chrome.visible, isError, suppressed]);
|
|
119
|
+
|
|
120
|
+
React.useEffect(() => {
|
|
121
|
+
onConfirmingChange?.(showDialog);
|
|
122
|
+
}, [showDialog, onConfirmingChange]);
|
|
123
|
+
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
return () => {
|
|
126
|
+
onConfirmingChange?.(false);
|
|
127
|
+
};
|
|
128
|
+
}, [onConfirmingChange]);
|
|
129
|
+
|
|
130
|
+
const onMeasureHeight = React.useCallback((height: number) => {
|
|
131
|
+
setBarHeight(Math.max(0, height));
|
|
132
|
+
}, []);
|
|
133
|
+
|
|
134
|
+
const onLeftPress = React.useCallback(() => {
|
|
135
|
+
if (isError) {
|
|
136
|
+
onExit();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
setConfirming('exit');
|
|
140
|
+
}, [isError, onExit]);
|
|
141
|
+
|
|
142
|
+
const onRightPress = React.useCallback(() => {
|
|
143
|
+
if (isError || !state.canRestartPreview) return;
|
|
144
|
+
setConfirming('restart');
|
|
145
|
+
}, [isError, state.canRestartPreview]);
|
|
146
|
+
|
|
147
|
+
const closeDialog = React.useCallback(() => {
|
|
148
|
+
setConfirming(null);
|
|
149
|
+
}, []);
|
|
150
|
+
|
|
151
|
+
const confirmExit = React.useCallback(() => {
|
|
152
|
+
setConfirming(null);
|
|
153
|
+
onExit();
|
|
154
|
+
}, [onExit]);
|
|
155
|
+
|
|
156
|
+
const confirmRestart = React.useCallback(() => {
|
|
157
|
+
setConfirming(null);
|
|
158
|
+
onRestart?.();
|
|
159
|
+
}, [onRestart]);
|
|
26
160
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const neverPaired = state.status === 'error' && !state.previewActive && state.pairingId === null;
|
|
31
|
-
const title = neverPaired
|
|
32
|
-
? 'Preview unavailable'
|
|
33
|
-
: needsRescan
|
|
34
|
-
? 'Pairing ended'
|
|
35
|
-
: 'Preview mode';
|
|
36
|
-
const detail =
|
|
37
|
-
state.lastError ??
|
|
38
|
-
(state.status === 'reconnecting'
|
|
39
|
-
? 'Reconnecting…'
|
|
40
|
-
: state.status === 'connecting'
|
|
41
|
-
? 'Connecting to Builder…'
|
|
42
|
-
: // Mirrors the Builder's own wording. Without this the banner reads
|
|
43
|
-
// "Paired" while the flow is absent, which looks like a broken preview
|
|
44
|
-
// rather than a condition that has not matched yet.
|
|
45
|
-
state.awaitingStartCondition
|
|
46
|
-
? 'Waiting for auto-start condition to trigger…'
|
|
47
|
-
: 'Paired with Userflow Builder');
|
|
161
|
+
if (!barMounted && !showDialog) return null;
|
|
162
|
+
|
|
163
|
+
const tooltipVisible = visible && showOnboarding && !isError && !showDialog;
|
|
48
164
|
|
|
49
165
|
return (
|
|
50
|
-
<View
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
166
|
+
<View
|
|
167
|
+
accessibilityViewIsModal={showDialog}
|
|
168
|
+
pointerEvents="box-none"
|
|
169
|
+
style={[styles.wrap, showDialog ? styles.wrapConfirming : null]}
|
|
170
|
+
testID="userflow-preview-banner"
|
|
171
|
+
>
|
|
172
|
+
{showDialog && confirming === 'exit' ? (
|
|
173
|
+
// Dialog first so its scrim paints under the bar (Figma: Overlay then Button Sheet).
|
|
174
|
+
<ChromeDialog
|
|
175
|
+
body="You will need to pair your device again in Userflow to preview this flow."
|
|
176
|
+
onClose={closeDialog}
|
|
177
|
+
title="Exit preview mode?"
|
|
178
|
+
>
|
|
179
|
+
<ChromeButton
|
|
180
|
+
accessibilityLabel="Cancel"
|
|
181
|
+
flex
|
|
182
|
+
label="Cancel"
|
|
183
|
+
onPress={closeDialog}
|
|
184
|
+
testID="userflow-preview-exit-cancel"
|
|
185
|
+
variant="secondary"
|
|
186
|
+
/>
|
|
187
|
+
<ChromeButton
|
|
61
188
|
accessibilityLabel="Exit preview"
|
|
62
|
-
|
|
63
|
-
|
|
189
|
+
flex
|
|
190
|
+
icon="arrow-left-from-bracket"
|
|
191
|
+
label="Exit"
|
|
192
|
+
onPress={confirmExit}
|
|
193
|
+
testID="userflow-preview-exit-confirm"
|
|
194
|
+
/>
|
|
195
|
+
</ChromeDialog>
|
|
196
|
+
) : null}
|
|
197
|
+
{showDialog && confirming === 'restart' ? (
|
|
198
|
+
<ChromeDialog
|
|
199
|
+
body="This will restart the flow from the first step."
|
|
200
|
+
onClose={closeDialog}
|
|
201
|
+
title="Restart flow?"
|
|
202
|
+
>
|
|
203
|
+
<ChromeButton
|
|
204
|
+
accessibilityLabel="Cancel"
|
|
205
|
+
flex
|
|
206
|
+
label="Cancel"
|
|
207
|
+
onPress={closeDialog}
|
|
208
|
+
testID="userflow-preview-restart-cancel"
|
|
209
|
+
variant="secondary"
|
|
210
|
+
/>
|
|
211
|
+
<ChromeButton
|
|
212
|
+
accessibilityLabel="Restart flow"
|
|
213
|
+
flex
|
|
214
|
+
icon="arrow-rotate-left"
|
|
215
|
+
label="Restart"
|
|
216
|
+
onPress={confirmRestart}
|
|
217
|
+
testID="userflow-preview-restart-confirm"
|
|
218
|
+
/>
|
|
219
|
+
</ChromeDialog>
|
|
220
|
+
) : null}
|
|
221
|
+
{barMounted && barChrome ? (
|
|
222
|
+
<ChromeBarTransition edge="top" pointerEvents="box-none" visible={visible}>
|
|
223
|
+
<ChromeTopBar
|
|
224
|
+
accessibilityElementsHidden={showDialog}
|
|
225
|
+
importantForAccessibility={showDialog ? 'no-hide-descendants' : undefined}
|
|
226
|
+
label={barChrome.label}
|
|
227
|
+
numberOfLines={barChrome.numberOfLines}
|
|
228
|
+
onMeasureHeight={onMeasureHeight}
|
|
229
|
+
tone={barChrome.tone}
|
|
230
|
+
left={
|
|
231
|
+
<ChromeButton
|
|
232
|
+
accessibilityLabel={isError ? 'Dismiss pairing message' : 'Exit preview'}
|
|
233
|
+
icon="arrow-left-from-bracket"
|
|
234
|
+
onPress={onLeftPress}
|
|
235
|
+
testID="userflow-preview-exit"
|
|
236
|
+
variant="icon"
|
|
237
|
+
/>
|
|
238
|
+
}
|
|
239
|
+
right={
|
|
240
|
+
showRestart ? (
|
|
241
|
+
<ChromeButton
|
|
242
|
+
accessibilityLabel="Restart flow"
|
|
243
|
+
icon="arrow-rotate-left"
|
|
244
|
+
onPress={onRightPress}
|
|
245
|
+
testID="userflow-preview-restart"
|
|
246
|
+
variant="icon"
|
|
247
|
+
/>
|
|
248
|
+
) : undefined
|
|
249
|
+
}
|
|
250
|
+
/>
|
|
251
|
+
</ChromeBarTransition>
|
|
252
|
+
) : null}
|
|
253
|
+
{tooltipVisible ? (
|
|
254
|
+
<View pointerEvents="none" style={[styles.tooltip, { top: barHeight }]}>
|
|
255
|
+
<ChromeTooltip
|
|
256
|
+
onDismiss={() => {
|
|
257
|
+
setShowOnboarding(false);
|
|
258
|
+
}}
|
|
64
259
|
>
|
|
65
|
-
|
|
66
|
-
</
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
accessibilityRole="button"
|
|
70
|
-
accessibilityLabel="Dismiss pairing message"
|
|
71
|
-
onPress={onExit}
|
|
72
|
-
style={styles.button}
|
|
73
|
-
>
|
|
74
|
-
<Text style={styles.buttonLabel}>Dismiss</Text>
|
|
75
|
-
</Pressable>
|
|
76
|
-
)}
|
|
77
|
-
</View>
|
|
260
|
+
{ONBOARDING_COPY}
|
|
261
|
+
</ChromeTooltip>
|
|
262
|
+
</View>
|
|
263
|
+
) : null}
|
|
78
264
|
</View>
|
|
79
265
|
);
|
|
80
266
|
}
|
|
@@ -85,46 +271,16 @@ const styles = StyleSheet.create({
|
|
|
85
271
|
top: 0,
|
|
86
272
|
left: 0,
|
|
87
273
|
right: 0,
|
|
274
|
+
bottom: 0,
|
|
88
275
|
zIndex: 1000,
|
|
89
276
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
marginHorizontal: 12,
|
|
93
|
-
borderRadius: 10,
|
|
94
|
-
paddingHorizontal: 12,
|
|
95
|
-
paddingVertical: 10,
|
|
96
|
-
flexDirection: 'row',
|
|
97
|
-
alignItems: 'center',
|
|
98
|
-
gap: 10,
|
|
99
|
-
},
|
|
100
|
-
bannerActive: {
|
|
101
|
-
backgroundColor: 'rgba(17, 24, 39, 0.92)',
|
|
102
|
-
},
|
|
103
|
-
bannerWarn: {
|
|
104
|
-
backgroundColor: 'rgba(127, 29, 29, 0.94)',
|
|
105
|
-
},
|
|
106
|
-
textCol: {
|
|
107
|
-
flex: 1,
|
|
277
|
+
wrapConfirming: {
|
|
278
|
+
zIndex: 1200,
|
|
108
279
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
detail: {
|
|
115
|
-
color: 'rgba(255,255,255,0.85)',
|
|
116
|
-
fontSize: 12,
|
|
117
|
-
marginTop: 2,
|
|
118
|
-
},
|
|
119
|
-
button: {
|
|
120
|
-
paddingHorizontal: 10,
|
|
121
|
-
paddingVertical: 8,
|
|
122
|
-
borderRadius: 8,
|
|
123
|
-
backgroundColor: 'rgba(255,255,255,0.14)',
|
|
124
|
-
},
|
|
125
|
-
buttonLabel: {
|
|
126
|
-
color: '#ffffff',
|
|
127
|
-
fontSize: 12,
|
|
128
|
-
fontWeight: '600',
|
|
280
|
+
tooltip: {
|
|
281
|
+
position: 'absolute',
|
|
282
|
+
left: 0,
|
|
283
|
+
right: 0,
|
|
284
|
+
alignItems: 'center',
|
|
129
285
|
},
|
|
130
286
|
});
|
|
@@ -66,6 +66,14 @@ export function pairingConnectFailedMessage(reason: string): string {
|
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Engine-reported pairing failure (`lastError`). The preview top bar no longer
|
|
71
|
+
* has a second line for this, so it must reach Metro under the `[Userflow]` prefix.
|
|
72
|
+
*/
|
|
73
|
+
export function pairingPreviewErrorMessage(reason: string): string {
|
|
74
|
+
return `${PREFIX} Builder pairing: ${reason}`;
|
|
75
|
+
}
|
|
76
|
+
|
|
69
77
|
/** A pairing link arrived without the `pairing_token` query parameter. */
|
|
70
78
|
export function pairingMissingTokenMessage(url: string): string {
|
|
71
79
|
return (
|
|
@@ -85,7 +93,7 @@ export function pairingForeignSchemeMessage(url: string): string {
|
|
|
85
93
|
`link, but it was opened with a scheme Userflow does not own. Use your ` +
|
|
86
94
|
`environment's scheme_id ("userflow-" followed by digits) exactly as the ` +
|
|
87
95
|
`pairing QR code provides it — do not substitute your app's own scheme. ` +
|
|
88
|
-
`Register it via the @userflow-tech/
|
|
96
|
+
`Register it via the @userflow-tech/react-native plugin ({ schemeId: 'userflow-…' }) and ` +
|
|
89
97
|
`rebuild the native app; a Metro reload is not enough.`
|
|
90
98
|
);
|
|
91
99
|
}
|
|
@@ -130,6 +138,6 @@ export function pairingSchemeShapeMessage(url: string): string {
|
|
|
130
138
|
return (
|
|
131
139
|
`${PREFIX} Ignoring Builder pairing link "${redactPairingToken(url)}": the scheme must be your ` +
|
|
132
140
|
`environment's scheme_id — "userflow-" followed by digits (e.g. userflow-257587). ` +
|
|
133
|
-
`Check the schemeId passed to the @userflow-tech/
|
|
141
|
+
`Check the schemeId passed to the @userflow-tech/react-native plugin.`
|
|
134
142
|
);
|
|
135
143
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { isPairingPushAckTimeout } from '@userflow-tech/core';
|
|
2
|
+
import type { PairingRelayEvent } from '@userflow-tech/protocol';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
elementPickerController,
|
|
6
|
+
type ElementPickerResult,
|
|
7
|
+
} from '../authoring/elementPickerController';
|
|
8
|
+
|
|
9
|
+
export interface ElementPickerRelayEngine {
|
|
10
|
+
onRelay: (handler: (event: PairingRelayEvent, payload: unknown) => void) => () => void;
|
|
11
|
+
sendRelay: (event: PairingRelayEvent, payload: unknown) => Promise<unknown>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function asRecord(payload: unknown): Record<string, unknown> {
|
|
15
|
+
return payload && typeof payload === 'object' ? (payload as Record<string, unknown>) : {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function idempotencyKeyOf(payload: unknown): string | null {
|
|
19
|
+
const key = asRecord(payload)['idempotency_key'];
|
|
20
|
+
return typeof key === 'string' && key.length > 0 ? key : null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function resultPayload(key: string, result: ElementPickerResult): Record<string, unknown> {
|
|
24
|
+
return {
|
|
25
|
+
idempotency_key: key,
|
|
26
|
+
ok: true,
|
|
27
|
+
autoData: result.autoData,
|
|
28
|
+
text: result.text ?? null,
|
|
29
|
+
...(result.screenshot
|
|
30
|
+
? {
|
|
31
|
+
screenshot: {
|
|
32
|
+
dataUrl: result.screenshot.dataUrl,
|
|
33
|
+
width: result.screenshot.width,
|
|
34
|
+
height: result.screenshot.height,
|
|
35
|
+
targetX1: result.screenshot.targetX1,
|
|
36
|
+
targetY1: result.screenshot.targetY1,
|
|
37
|
+
targetX2: result.screenshot.targetX2,
|
|
38
|
+
targetY2: result.screenshot.targetY2,
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
: {}),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Bridge pairing-channel `selectElement*` events onto {@link elementPickerController}.
|
|
47
|
+
* UI-free: the overlay (and QA harness) own the actual picking.
|
|
48
|
+
*/
|
|
49
|
+
export function bindElementPickerRelay(engine: ElementPickerRelayEngine): () => void {
|
|
50
|
+
if (typeof engine.onRelay !== 'function' || typeof engine.sendRelay !== 'function') {
|
|
51
|
+
return () => undefined;
|
|
52
|
+
}
|
|
53
|
+
let ignoreNextCancelSend = false;
|
|
54
|
+
|
|
55
|
+
/** Result delivery: ignore ack timeouts; surface connection failures. */
|
|
56
|
+
const sendResult = async (key: string, result: ElementPickerResult): Promise<void> => {
|
|
57
|
+
try {
|
|
58
|
+
await engine.sendRelay('selectElementResult', resultPayload(key, result));
|
|
59
|
+
} catch (error) {
|
|
60
|
+
if (typeof isPairingPushAckTimeout === 'function' && isPairingPushAckTimeout(error)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** Cancel is best-effort: ignore timeout and disconnect. */
|
|
68
|
+
const sendCancel = (key: string): void => {
|
|
69
|
+
void engine.sendRelay('selectElementCancel', { idempotency_key: key }).catch(() => undefined);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const unsub = engine.onRelay((event, payload) => {
|
|
73
|
+
if (event === 'selectElement') {
|
|
74
|
+
const key = idempotencyKeyOf(payload);
|
|
75
|
+
if (!key) return;
|
|
76
|
+
elementPickerController.beginSelection({
|
|
77
|
+
requestId: key,
|
|
78
|
+
onResult: (result) => sendResult(key, result),
|
|
79
|
+
onCancel: () => {
|
|
80
|
+
if (ignoreNextCancelSend) return;
|
|
81
|
+
sendCancel(key);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (event === 'selectElementCancel') {
|
|
88
|
+
ignoreNextCancelSend = true;
|
|
89
|
+
elementPickerController.cancel();
|
|
90
|
+
ignoreNextCancelSend = false;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return () => {
|
|
95
|
+
unsub();
|
|
96
|
+
ignoreNextCancelSend = true;
|
|
97
|
+
elementPickerController.cancel();
|
|
98
|
+
ignoreNextCancelSend = false;
|
|
99
|
+
};
|
|
100
|
+
}
|