@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
|
@@ -5,30 +5,37 @@ import { isFiberMounted } from './fiber/fiberInternals';
|
|
|
5
5
|
import { findAnchorFiber } from './fiber/findAnchorFiber';
|
|
6
6
|
import { createFiberMeasureInWindow } from './fiber/measureHostFiber';
|
|
7
7
|
import { isFiberOnVisibleScreen } from './fiber/visibleScreens';
|
|
8
|
+
import {
|
|
9
|
+
clearFiberAnchorCache as clearCache,
|
|
10
|
+
deleteCachedFiberAnchor,
|
|
11
|
+
getCachedFiberAnchor,
|
|
12
|
+
getFiberAnchorScreenKey,
|
|
13
|
+
invalidateFiberAnchor as dropCachedFiberAnchor,
|
|
14
|
+
notifyAnchorScreenChange as onAnchorScreenChange,
|
|
15
|
+
setCachedFiberAnchor,
|
|
16
|
+
} from './fiberAnchorCache';
|
|
8
17
|
|
|
9
18
|
export type AnchorResolution =
|
|
10
19
|
| { status: 'found'; host: AnchorHost; fiber?: AnyFiber }
|
|
11
20
|
| { status: 'ambiguous' }
|
|
12
21
|
| { status: 'missing' };
|
|
13
22
|
|
|
14
|
-
interface FiberCacheEntry {
|
|
15
|
-
fiber: AnyFiber;
|
|
16
|
-
screenKey: string | null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const fiberCache = new Map<string, FiberCacheEntry>();
|
|
20
|
-
let currentScreenKey: string | null = null;
|
|
21
|
-
|
|
22
23
|
/** Invalidate fiber-resolved anchors when the active screen changes. */
|
|
23
24
|
export function notifyAnchorScreenChange(screenKey: string | null): void {
|
|
24
|
-
|
|
25
|
-
currentScreenKey = screenKey;
|
|
26
|
-
fiberCache.clear();
|
|
25
|
+
onAnchorScreenChange(screenKey);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
/** Test helper — drop the fiber cache. */
|
|
30
29
|
export function clearFiberAnchorCache(): void {
|
|
31
|
-
|
|
30
|
+
clearCache();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Drop a cached fiber entry after a zero-size measure so the next resolve
|
|
35
|
+
* re-scans (the host may have remounted under a new fiber).
|
|
36
|
+
*/
|
|
37
|
+
export function invalidateFiberAnchor(id: string): void {
|
|
38
|
+
dropCachedFiberAnchor(id);
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
/**
|
|
@@ -55,7 +62,8 @@ export function resolveAnchorHost(id: string): AnchorResolution {
|
|
|
55
62
|
|
|
56
63
|
// Cached fiber still mounted, on the same screen, and not covered by a screen
|
|
57
64
|
// pushed on top since it was cached?
|
|
58
|
-
const cached =
|
|
65
|
+
const cached = getCachedFiberAnchor(id);
|
|
66
|
+
const currentScreenKey = getFiberAnchorScreenKey();
|
|
59
67
|
if (
|
|
60
68
|
cached &&
|
|
61
69
|
cached.screenKey === currentScreenKey &&
|
|
@@ -69,7 +77,7 @@ export function resolveAnchorHost(id: string): AnchorResolution {
|
|
|
69
77
|
};
|
|
70
78
|
}
|
|
71
79
|
if (cached) {
|
|
72
|
-
|
|
80
|
+
deleteCachedFiberAnchor(id);
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
const root = fiberScanRoot.getFiber();
|
|
@@ -85,18 +93,10 @@ export function resolveAnchorHost(id: string): AnchorResolution {
|
|
|
85
93
|
return { status: 'missing' };
|
|
86
94
|
}
|
|
87
95
|
|
|
88
|
-
|
|
96
|
+
setCachedFiberAnchor(id, result.fiber);
|
|
89
97
|
return {
|
|
90
98
|
status: 'found',
|
|
91
99
|
host: { measureInWindow: createFiberMeasureInWindow(result.fiber) },
|
|
92
100
|
fiber: result.fiber,
|
|
93
101
|
};
|
|
94
102
|
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Drop a cached fiber entry after a zero-size measure so the next resolve
|
|
98
|
-
* re-scans (the host may have remounted under a new fiber).
|
|
99
|
-
*/
|
|
100
|
-
export function invalidateFiberAnchor(id: string): void {
|
|
101
|
-
fiberCache.delete(id);
|
|
102
|
-
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeMobileAutoData,
|
|
3
|
+
type MobileAutoData,
|
|
4
|
+
type MobileFingerprint,
|
|
5
|
+
} from '@userflow-tech/protocol';
|
|
6
|
+
|
|
7
|
+
import type { AnchorHost } from './AnchorRegistry';
|
|
8
|
+
import type { AutoAnchorInstance } from './AutoAnchorRegistry';
|
|
9
|
+
import type { AnyFiber } from './fiber/fiberInternals';
|
|
10
|
+
import { fiberFromPublicInstance } from './fiber/fiberInternals';
|
|
11
|
+
import { createFiberMeasureInWindow } from './fiber/measureHostFiber';
|
|
12
|
+
import { isFiberOnVisibleScreen } from './fiber/visibleScreens';
|
|
13
|
+
import { resolveAnchorHost } from './resolveAnchorHost';
|
|
14
|
+
import { matchFingerprint, type MatchResult } from './semanticMatcher';
|
|
15
|
+
|
|
16
|
+
export type AutoAnchorResolution =
|
|
17
|
+
| {
|
|
18
|
+
status: 'found';
|
|
19
|
+
host: AnchorHost;
|
|
20
|
+
fiber?: AnyFiber;
|
|
21
|
+
/**
|
|
22
|
+
* Id to pass to `invalidateFiberAnchor` after a zero-size measure.
|
|
23
|
+
* Set on the exact-id fast path, where the host came from the fiber cache.
|
|
24
|
+
*/
|
|
25
|
+
fiberCacheId?: string;
|
|
26
|
+
match?: MatchResult;
|
|
27
|
+
}
|
|
28
|
+
| { status: 'ambiguous'; match?: MatchResult }
|
|
29
|
+
| { status: 'absent'; match?: MatchResult }
|
|
30
|
+
| { status: 'unknown'; match?: MatchResult };
|
|
31
|
+
|
|
32
|
+
type MeasureInWindowCallback = (x: number, y: number, width: number, height: number) => void;
|
|
33
|
+
|
|
34
|
+
interface MeasurableNode {
|
|
35
|
+
measureInWindow: (callback: MeasureInWindowCallback) => void;
|
|
36
|
+
scrollIntoView?: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isMeasurableNode(value: unknown): value is MeasurableNode {
|
|
40
|
+
return (
|
|
41
|
+
typeof value === 'object' &&
|
|
42
|
+
value !== null &&
|
|
43
|
+
typeof (value as { measureInWindow?: unknown }).measureInWindow === 'function'
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Wrap a live auto-anchor instance into an {@link AnchorHost}. Returns null when
|
|
49
|
+
* the instance is unmounted or its node cannot be measured.
|
|
50
|
+
*/
|
|
51
|
+
function hostFromInstance(inst: AutoAnchorInstance): AnchorHost | null {
|
|
52
|
+
const node = inst.ref.current;
|
|
53
|
+
if (isMeasurableNode(node)) {
|
|
54
|
+
return {
|
|
55
|
+
measureInWindow: (callback) => {
|
|
56
|
+
node.measureInWindow(callback);
|
|
57
|
+
},
|
|
58
|
+
...(typeof node.scrollIntoView === 'function'
|
|
59
|
+
? {
|
|
60
|
+
scrollIntoView: () => {
|
|
61
|
+
node.scrollIntoView?.();
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
: {}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const fiber = fiberFromInstance(inst);
|
|
68
|
+
if (!fiber) return null;
|
|
69
|
+
return { measureInWindow: createFiberMeasureInWindow(fiber) };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function fiberFromInstance(inst: AutoAnchorInstance): AnyFiber | null {
|
|
73
|
+
return fiberFromPublicInstance(inst.ref.current);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether a scored instance is on a screen the user can see.
|
|
78
|
+
*
|
|
79
|
+
* No fiber pointer means we cannot prove the host is covered (tests, and hosts
|
|
80
|
+
* whose public instance has no internals link) — same fail-open as apps without
|
|
81
|
+
* react-native-screens.
|
|
82
|
+
*/
|
|
83
|
+
function isInstanceOnVisibleScreen(inst: AutoAnchorInstance): boolean {
|
|
84
|
+
const fiber = fiberFromInstance(inst);
|
|
85
|
+
if (!fiber) return true;
|
|
86
|
+
return isFiberOnVisibleScreen(fiber);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Authoritative id that the existing fiber / manual resolver can look up. */
|
|
90
|
+
function exactIdFromFingerprint(fp: MobileFingerprint): string | null {
|
|
91
|
+
if (fp.userflowId) return fp.userflowId;
|
|
92
|
+
if (fp.testID) return fp.testID;
|
|
93
|
+
if (fp.nativeID && !fp.nativeID.startsWith('uf_')) return fp.nativeID;
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function decodeInput(autoData: string | MobileAutoData | null | undefined): MobileAutoData | null {
|
|
98
|
+
if (autoData == null) return null;
|
|
99
|
+
if (typeof autoData === 'string') {
|
|
100
|
+
if (!autoData.trim()) return null;
|
|
101
|
+
return decodeMobileAutoData(autoData);
|
|
102
|
+
}
|
|
103
|
+
return autoData;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function mapMatch(match: MatchResult): AutoAnchorResolution {
|
|
107
|
+
if (match.instance) {
|
|
108
|
+
const host = hostFromInstance(match.instance);
|
|
109
|
+
if (!host) return { status: 'unknown', match };
|
|
110
|
+
const fiber = fiberFromInstance(match.instance);
|
|
111
|
+
return { status: 'found', host, match, ...(fiber ? { fiber } : {}) };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
switch (match.reason) {
|
|
115
|
+
case 'ambiguous-explicit-id':
|
|
116
|
+
return { status: 'ambiguous', match };
|
|
117
|
+
case 'all-contradicted':
|
|
118
|
+
return { status: 'absent', match };
|
|
119
|
+
default:
|
|
120
|
+
// no-candidates / no-fingerprint / below-threshold / not-unique / unset
|
|
121
|
+
return { status: 'unknown', match };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Score visible-screen instances first so a covered look-alike cannot steal
|
|
127
|
+
* uniqueness or win over a host the user can actually see. If nothing visible
|
|
128
|
+
* scored and the unfiltered pool still has a hit, that hit is on a covered
|
|
129
|
+
* screen — `absent`, matching MANUAL covered-screen semantics.
|
|
130
|
+
*/
|
|
131
|
+
function mapScored(fp: MobileFingerprint): AutoAnchorResolution {
|
|
132
|
+
const visible = matchFingerprint(fp, { instanceFilter: isInstanceOnVisibleScreen });
|
|
133
|
+
if (visible.instance) return mapMatch(visible);
|
|
134
|
+
|
|
135
|
+
if (visible.reason === 'no-candidates') {
|
|
136
|
+
const any = matchFingerprint(fp);
|
|
137
|
+
if (any.instance) return { status: 'absent', match: any };
|
|
138
|
+
if (any.reason === 'all-contradicted') return mapMatch(any);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return mapMatch(visible);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Resolve an AUTO (codeless) selector against the live UI.
|
|
146
|
+
*
|
|
147
|
+
* Exact-id fast path reuses {@link resolveAnchorHost} so a fingerprint that
|
|
148
|
+
* carries a real `testID` / `userflowId` / non-`uf_` `nativeID` still resolves
|
|
149
|
+
* under Babel `stampOnly: true` (no auto-registry population).
|
|
150
|
+
*
|
|
151
|
+
* Scored matches run over `autoAnchorRegistry` and fail closed: weak or
|
|
152
|
+
* non-unique evidence is `unknown`, not `absent`, so ELEMENT gates stay blocked
|
|
153
|
+
* rather than inventing a truth value. Hosts on a covered navigator screen
|
|
154
|
+
* are skipped the same way the fiber scan skips them.
|
|
155
|
+
*/
|
|
156
|
+
export function resolveAutoAnchorHost(
|
|
157
|
+
autoData: string | MobileAutoData | null | undefined,
|
|
158
|
+
): AutoAnchorResolution {
|
|
159
|
+
const decoded = decodeInput(autoData);
|
|
160
|
+
const fp = decoded?.fingerprint;
|
|
161
|
+
if (!fp) return { status: 'unknown' };
|
|
162
|
+
|
|
163
|
+
const exactId = exactIdFromFingerprint(fp);
|
|
164
|
+
if (exactId) {
|
|
165
|
+
const exact = resolveAnchorHost(exactId);
|
|
166
|
+
if (exact.status === 'found') {
|
|
167
|
+
return {
|
|
168
|
+
status: 'found',
|
|
169
|
+
host: exact.host,
|
|
170
|
+
fiberCacheId: exactId,
|
|
171
|
+
...(exact.fiber ? { fiber: exact.fiber } : {}),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (exact.status === 'ambiguous') {
|
|
175
|
+
return { status: 'ambiguous' };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return mapScored(fp);
|
|
180
|
+
}
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeMobileAutoData,
|
|
3
|
+
type IdentityStrength,
|
|
4
|
+
type MobileAutoData,
|
|
5
|
+
type MobileFingerprint,
|
|
6
|
+
type SemanticSegment,
|
|
7
|
+
type SiblingDescriptor,
|
|
8
|
+
} from '@userflow-tech/protocol';
|
|
9
|
+
|
|
10
|
+
import { autoAnchorRegistry, type AutoAnchorInstance } from './AutoAnchorRegistry';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Scored semantic matcher (rn-v3).
|
|
14
|
+
*
|
|
15
|
+
* Ranks live {@link autoAnchorRegistry} instances against a recorded
|
|
16
|
+
* fingerprint. Explicit IDs are authoritative. Absolute ordinals are not
|
|
17
|
+
* scored. Accepts only when the best score clears a threshold and beats the
|
|
18
|
+
* runner-up by a margin.
|
|
19
|
+
*
|
|
20
|
+
* Play-time AUTO resolution goes through `resolveAutoAnchorHost`, which
|
|
21
|
+
* maps a hit into a measurable host.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export type MatchMissReason =
|
|
25
|
+
| 'no-candidates'
|
|
26
|
+
| 'all-contradicted'
|
|
27
|
+
| 'below-threshold'
|
|
28
|
+
| 'not-unique'
|
|
29
|
+
| 'ambiguous-explicit-id'
|
|
30
|
+
| 'no-fingerprint';
|
|
31
|
+
|
|
32
|
+
export interface MatchResult {
|
|
33
|
+
instance: AutoAnchorInstance | null;
|
|
34
|
+
score: number;
|
|
35
|
+
secondScore: number;
|
|
36
|
+
reason?: MatchMissReason;
|
|
37
|
+
/** Strongest signal the recorded fingerprint rests on (telemetry / author guidance). */
|
|
38
|
+
identityStrength?: IdentityStrength;
|
|
39
|
+
/**
|
|
40
|
+
* True when the match was won even though the live text is not byte-identical
|
|
41
|
+
* to the recorded `childText`. Covers both a benign counter tick
|
|
42
|
+
* (`Count: 0` → `Count: 1`, which normalization forgives) and a real rename
|
|
43
|
+
* that an icon/shape/structure vouched for. Raw inequality, not the fatal
|
|
44
|
+
* check — a fatal mismatch never reaches a won match.
|
|
45
|
+
*/
|
|
46
|
+
textDisagreed?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const MATCH_MIN_SCORE = 40;
|
|
50
|
+
export const MATCH_UNIQUENESS_MARGIN = 12;
|
|
51
|
+
/** Max contribution of structural-path similarity — matches the previous flat weight. */
|
|
52
|
+
const STRUCTURAL_PATH_MAX = 35;
|
|
53
|
+
|
|
54
|
+
function pathSegments(path: string): string[] {
|
|
55
|
+
return path.split(' > ');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Kind (name) prefix of a canonical segment, before any `{…}` / `#ordinal`. */
|
|
59
|
+
function segmentKind(seg: string): string {
|
|
60
|
+
const m = /^([A-Za-z_][\w.]*)/.exec(seg);
|
|
61
|
+
return m ? m[1]! : seg;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The `{k=v}` identity token of a segment (id or text), or null for ordinal-only. */
|
|
65
|
+
function segmentLabel(seg: string): string | null {
|
|
66
|
+
const i = seg.indexOf('{');
|
|
67
|
+
return i >= 0 && seg.endsWith('}') ? seg.slice(i) : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Graded structural-path similarity (replaces all-or-nothing exact match).
|
|
72
|
+
*
|
|
73
|
+
* Scores by aligned segments from the root: matching id/text-bearing segments
|
|
74
|
+
* count strongly, matching kinds lightly, and a *pure ordinal* difference in an
|
|
75
|
+
* otherwise same-kind segment is tolerated (no penalty) instead of zeroing the
|
|
76
|
+
* whole signal. A kind divergence stops deeper credit.
|
|
77
|
+
*/
|
|
78
|
+
function scoreStructuralPath(
|
|
79
|
+
fpPath: string | undefined,
|
|
80
|
+
instPath: string | undefined,
|
|
81
|
+
max = STRUCTURAL_PATH_MAX,
|
|
82
|
+
): number {
|
|
83
|
+
if (!fpPath || !instPath) return 0;
|
|
84
|
+
if (fpPath === instPath) return max;
|
|
85
|
+
|
|
86
|
+
const a = pathSegments(fpPath);
|
|
87
|
+
const b = pathSegments(instPath);
|
|
88
|
+
const n = Math.min(a.length, b.length);
|
|
89
|
+
let matchedLabeled = 0;
|
|
90
|
+
let kindAligned = 0;
|
|
91
|
+
|
|
92
|
+
for (let i = 0; i < n; i += 1) {
|
|
93
|
+
const sa = a[i]!;
|
|
94
|
+
const sb = b[i]!;
|
|
95
|
+
if (segmentKind(sa) !== segmentKind(sb)) break;
|
|
96
|
+
kindAligned += 1;
|
|
97
|
+
const la = segmentLabel(sa);
|
|
98
|
+
const lb = segmentLabel(sb);
|
|
99
|
+
if (la !== null && la === lb) matchedLabeled += 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const score = matchedLabeled * 12 + kindAligned * 2 + (a.length === b.length ? 3 : 0);
|
|
103
|
+
return Math.min(max, Math.round(score * (max / STRUCTURAL_PATH_MAX)));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function scoreSiblingWindow(expected: SiblingDescriptor[], actual: SiblingDescriptor[]): number {
|
|
107
|
+
if (expected.length === 0) return 0;
|
|
108
|
+
let score = 0;
|
|
109
|
+
const len = Math.min(expected.length, actual.length);
|
|
110
|
+
for (let i = 0; i < len; i += 1) {
|
|
111
|
+
const e = expected[expected.length - 1 - i]!;
|
|
112
|
+
const a = actual[actual.length - 1 - i]!;
|
|
113
|
+
if (e.kind === a.kind) score += 4;
|
|
114
|
+
if (e.role && a.role && e.role === a.role) score += 2;
|
|
115
|
+
if (e.userflowId && a.userflowId && e.userflowId === a.userflowId) score += 10;
|
|
116
|
+
if (e.testID && a.testID && e.testID === a.testID) score += 8;
|
|
117
|
+
if (e.text && a.text && textsAgree(e.text, a.text)) score += 6;
|
|
118
|
+
}
|
|
119
|
+
score -= Math.abs(expected.length - actual.length) * 2;
|
|
120
|
+
return Math.max(0, score);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function scoreAncestors(expected: SemanticSegment[], actual: SemanticSegment[]): number {
|
|
124
|
+
if (expected.length === 0) return 0;
|
|
125
|
+
let score = 0;
|
|
126
|
+
const eTail = expected.slice(-4);
|
|
127
|
+
const aTail = actual.slice(-4);
|
|
128
|
+
const len = Math.min(eTail.length, aTail.length);
|
|
129
|
+
for (let i = 0; i < len; i += 1) {
|
|
130
|
+
const e = eTail[eTail.length - 1 - i]!;
|
|
131
|
+
const a = aTail[aTail.length - 1 - i]!;
|
|
132
|
+
if (e.kind === a.kind) score += 5;
|
|
133
|
+
if (e.role && a.role && e.role === a.role) score += 3;
|
|
134
|
+
if (e.userflowId && a.userflowId && e.userflowId === a.userflowId) score += 15;
|
|
135
|
+
if (e.testID && a.testID && e.testID === a.testID) score += 12;
|
|
136
|
+
}
|
|
137
|
+
return score;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function contradictsStrong(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
|
|
141
|
+
if (fp.userflowId && inst.userflowId && fp.userflowId !== inst.userflowId) return true;
|
|
142
|
+
if (fp.testID && inst.testID && fp.testID !== inst.testID) return true;
|
|
143
|
+
if (fp.manualId && inst.manualId && fp.manualId !== inst.manualId) return true;
|
|
144
|
+
if (fp.kind && inst.kind && fp.kind !== inst.kind) return true;
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** True when an authoritative id in the fingerprint matches the live instance. */
|
|
149
|
+
function idAgrees(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
|
|
150
|
+
return (
|
|
151
|
+
(!!fp.manualId && inst.manualId === fp.manualId) ||
|
|
152
|
+
(!!fp.userflowId && inst.userflowId === fp.userflowId) ||
|
|
153
|
+
(!!fp.testID && inst.testID === fp.testID) ||
|
|
154
|
+
(!!fp.nativeID && inst.nativeID === fp.nativeID && !fp.nativeID.startsWith('uf_'))
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Collapse digit runs so `Count: 0` and `Count: 1` compare as the same template. */
|
|
159
|
+
function normalizeText(value: string): string {
|
|
160
|
+
return value.trim().replace(/\d+/g, '#').replace(/\s+/g, ' ');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function textsAgree(a: string | undefined, b: string | undefined): boolean {
|
|
164
|
+
if (!a || !b) return false;
|
|
165
|
+
return a === b || normalizeText(a) === normalizeText(b);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Recorded and live raw text both present but disagree (a rename / translation). */
|
|
169
|
+
function childTextRawDiffers(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
|
|
170
|
+
return !!fp.childText && !!inst.childText && fp.childText !== inst.childText;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Fatal text mismatch: raw strings differ *and* the digit-normalized forms
|
|
175
|
+
* differ. `Count: 0` vs `Count: 1` is not fatal; `Save` vs `Cancelar` is.
|
|
176
|
+
*/
|
|
177
|
+
function childTextDisagrees(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
|
|
178
|
+
return childTextRawDiffers(fp, inst) && !textsAgree(fp.childText, inst.childText);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* A text-independent intrinsic signal agrees: a matching icon or image. These
|
|
183
|
+
* survive translation/relabeling. (accessibilityLabel is excluded — it is
|
|
184
|
+
* typically localized too.)
|
|
185
|
+
*/
|
|
186
|
+
function intrinsicNonTextAgrees(fp: MobileFingerprint, inst: AutoAnchorInstance): boolean {
|
|
187
|
+
return (
|
|
188
|
+
(!!fp.iconName && inst.iconName === fp.iconName) ||
|
|
189
|
+
(!!fp.imageSrc && inst.imageSrc === fp.imageSrc)
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function scoreInstance(fp: MobileFingerprint, inst: AutoAnchorInstance): number {
|
|
194
|
+
if (contradictsStrong(fp, inst)) return -Infinity;
|
|
195
|
+
|
|
196
|
+
// A childText disagreement is disqualifying unless a text-independent identity
|
|
197
|
+
// vouches for the element (authoritative id, or matching icon/image).
|
|
198
|
+
if (childTextDisagrees(fp, inst) && !idAgrees(fp, inst) && !intrinsicNonTextAgrees(fp, inst)) {
|
|
199
|
+
return -Infinity;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
let score = 0;
|
|
203
|
+
|
|
204
|
+
if (fp.manualId && inst.manualId === fp.manualId) score += 100;
|
|
205
|
+
if (fp.userflowId && inst.userflowId === fp.userflowId) score += 100;
|
|
206
|
+
if (fp.testID && inst.testID === fp.testID) score += 90;
|
|
207
|
+
if (fp.nativeID && inst.nativeID === fp.nativeID && !fp.nativeID.startsWith('uf_')) {
|
|
208
|
+
score += 80;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (fp.kind === inst.kind) score += 20;
|
|
212
|
+
if (fp.role === inst.role) score += 10;
|
|
213
|
+
if (fp.isPressable === true && inst.isPressable) score += 5;
|
|
214
|
+
|
|
215
|
+
score += scoreStructuralPath(fp.structuralPath, inst.structuralPath, STRUCTURAL_PATH_MAX);
|
|
216
|
+
score += scoreStructuralPath(fp.templatePath, inst.templatePath, 15);
|
|
217
|
+
if (fp.instanceScope && inst.instanceScope === fp.instanceScope) score += 30;
|
|
218
|
+
|
|
219
|
+
if (fp.childText && inst.childText === fp.childText) score += 40;
|
|
220
|
+
else if (fp.childText && inst.childText && textsAgree(fp.childText, inst.childText)) score += 18;
|
|
221
|
+
if (fp.accessibilityLabel && inst.accessibilityLabel === fp.accessibilityLabel) {
|
|
222
|
+
score += 25;
|
|
223
|
+
}
|
|
224
|
+
if (fp.iconName && inst.iconName) score += fp.iconName === inst.iconName ? 45 : -30;
|
|
225
|
+
if (fp.imageSrc && inst.imageSrc) score += fp.imageSrc === inst.imageSrc ? 45 : -30;
|
|
226
|
+
if (fp.childShape && inst.childShape === fp.childShape) score += 15;
|
|
227
|
+
|
|
228
|
+
score += scoreAncestors(fp.ancestors ?? [], inst.ancestors ?? []);
|
|
229
|
+
|
|
230
|
+
const window = autoAnchorRegistry.siblingWindow(inst.instanceId, 2);
|
|
231
|
+
score += scoreSiblingWindow(fp.previousSiblings ?? [], window.previous);
|
|
232
|
+
// Score next siblings once. The POC added a reversed pass *and* a direct pass,
|
|
233
|
+
// which double-counted the next window.
|
|
234
|
+
score += scoreSiblingWindow(fp.nextSiblings ?? [], window.next);
|
|
235
|
+
|
|
236
|
+
if (inst.ambiguous && !inst.manualId) score -= 40;
|
|
237
|
+
|
|
238
|
+
return score;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
type InstanceFilter = (inst: AutoAnchorInstance) => boolean;
|
|
242
|
+
|
|
243
|
+
function candidatePool(
|
|
244
|
+
fp: MobileFingerprint,
|
|
245
|
+
instanceFilter?: InstanceFilter,
|
|
246
|
+
): AutoAnchorInstance[] {
|
|
247
|
+
// Explicit ids are authoritative: a miss is no-candidates, not a full-registry search.
|
|
248
|
+
let pool: AutoAnchorInstance[];
|
|
249
|
+
if (fp.manualId) {
|
|
250
|
+
pool = autoAnchorRegistry.getInstancesByManualId(fp.manualId);
|
|
251
|
+
} else if (fp.userflowId) {
|
|
252
|
+
pool = autoAnchorRegistry.getInstancesByManualId(fp.userflowId);
|
|
253
|
+
} else if (fp.testID) {
|
|
254
|
+
pool = autoAnchorRegistry.getInstancesByManualId(fp.testID);
|
|
255
|
+
} else {
|
|
256
|
+
pool = autoAnchorRegistry.allInstances();
|
|
257
|
+
if (fp.role) {
|
|
258
|
+
const filtered = pool.filter((i) => i.role === fp.role);
|
|
259
|
+
if (filtered.length > 0) pool = filtered;
|
|
260
|
+
} else if (fp.kind) {
|
|
261
|
+
const filtered = pool.filter((i) => i.kind === fp.kind);
|
|
262
|
+
if (filtered.length > 0) pool = filtered;
|
|
263
|
+
}
|
|
264
|
+
if (fp.isPressable) {
|
|
265
|
+
const filtered = pool.filter((i) => i.isPressable);
|
|
266
|
+
if (filtered.length > 0) pool = filtered;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return instanceFilter ? pool.filter(instanceFilter) : pool;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function miss(reason: MatchMissReason, score = 0, secondScore = 0): MatchResult {
|
|
273
|
+
return { instance: null, score, secondScore, reason };
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function matchFingerprintCore(fp: MobileFingerprint, instanceFilter?: InstanceFilter): MatchResult {
|
|
277
|
+
// Live text / testID must be applied *before* pooling. A shared Babel helper
|
|
278
|
+
// (`const field = () => <TextInput testID={id} />`) reuses one auto-anchor
|
|
279
|
+
// callback, so the runtime bag is last-writer-wins until we read the host.
|
|
280
|
+
const broad = instanceFilter
|
|
281
|
+
? autoAnchorRegistry.allInstances().filter(instanceFilter)
|
|
282
|
+
: autoAnchorRegistry.allInstances();
|
|
283
|
+
if (broad.length > 0) {
|
|
284
|
+
autoAnchorRegistry.refreshLiveContent(broad);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const pool = candidatePool(fp, instanceFilter);
|
|
288
|
+
if (pool.length === 0) {
|
|
289
|
+
return miss('no-candidates');
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const scored = pool
|
|
293
|
+
.map((inst) => ({ inst, score: scoreInstance(fp, inst) }))
|
|
294
|
+
.filter((s) => s.score > -Infinity)
|
|
295
|
+
.sort((a, b) => b.score - a.score);
|
|
296
|
+
|
|
297
|
+
if (scored.length === 0) {
|
|
298
|
+
return miss('all-contradicted');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const best = scored[0]!;
|
|
302
|
+
const second = scored[1];
|
|
303
|
+
const secondScore = second?.score ?? 0;
|
|
304
|
+
|
|
305
|
+
if (
|
|
306
|
+
(fp.manualId || fp.userflowId || fp.testID) &&
|
|
307
|
+
best.score >= 90 &&
|
|
308
|
+
(!second || best.score - secondScore >= MATCH_UNIQUENESS_MARGIN)
|
|
309
|
+
) {
|
|
310
|
+
if (best.inst.ambiguous) {
|
|
311
|
+
return miss('ambiguous-explicit-id', best.score, secondScore);
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
instance: best.inst,
|
|
315
|
+
score: best.score,
|
|
316
|
+
secondScore,
|
|
317
|
+
textDisagreed: childTextRawDiffers(fp, best.inst),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (best.score < MATCH_MIN_SCORE) {
|
|
322
|
+
return miss('below-threshold', best.score, secondScore);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (best.score - secondScore < MATCH_UNIQUENESS_MARGIN) {
|
|
326
|
+
return miss('not-unique', best.score, secondScore);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return {
|
|
330
|
+
instance: best.inst,
|
|
331
|
+
score: best.score,
|
|
332
|
+
secondScore,
|
|
333
|
+
textDisagreed: childTextRawDiffers(fp, best.inst),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Resolve a recorded fingerprint against the live auto-anchor registry.
|
|
339
|
+
* Surfaces the recorded `identityStrength` on every result so callers/telemetry
|
|
340
|
+
* can flag weak (`structural`) targets.
|
|
341
|
+
*/
|
|
342
|
+
export function matchFingerprint(
|
|
343
|
+
fp: MobileFingerprint,
|
|
344
|
+
opts?: { instanceFilter?: InstanceFilter },
|
|
345
|
+
): MatchResult {
|
|
346
|
+
const result = matchFingerprintCore(fp, opts?.instanceFilter);
|
|
347
|
+
if (fp.identityStrength) result.identityStrength = fp.identityStrength;
|
|
348
|
+
return result;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Decode an `autoData` envelope (or accept an already-decoded one) and score
|
|
353
|
+
* its fingerprint. Missing / malformed envelopes fail closed.
|
|
354
|
+
*/
|
|
355
|
+
export function matchAutoData(input: MobileAutoData | string): MatchResult {
|
|
356
|
+
const decoded = typeof input === 'string' ? decodeMobileAutoData(input) : input;
|
|
357
|
+
if (!decoded?.fingerprint) {
|
|
358
|
+
return miss('no-fingerprint');
|
|
359
|
+
}
|
|
360
|
+
return matchFingerprint(decoded.fingerprint);
|
|
361
|
+
}
|