@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
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { VIEWPORT_PADDING } from "./inferTooltipPlacement.js";
|
|
4
|
+
/** Pixel slack so a card that sits exactly on the target edge still counts. */
|
|
5
|
+
const ADJACENCY_EPSILON = 0.5;
|
|
6
|
+
function notchCanPointAtTarget(opts) {
|
|
7
|
+
if (opts.notchSize <= 0) return false;
|
|
8
|
+
const {
|
|
9
|
+
placement,
|
|
10
|
+
cx,
|
|
11
|
+
cy,
|
|
12
|
+
bw,
|
|
13
|
+
bh,
|
|
14
|
+
targetRect
|
|
15
|
+
} = opts;
|
|
16
|
+
const targetMidX = targetRect.left + (targetRect.right - targetRect.left) / 2;
|
|
17
|
+
const targetMidY = targetRect.top + (targetRect.bottom - targetRect.top) / 2;
|
|
18
|
+
const reachableX = targetMidX >= cx - ADJACENCY_EPSILON && targetMidX <= cx + bw + ADJACENCY_EPSILON;
|
|
19
|
+
const reachableY = targetMidY >= cy - ADJACENCY_EPSILON && targetMidY <= cy + bh + ADJACENCY_EPSILON;
|
|
20
|
+
switch (placement) {
|
|
21
|
+
case 'BELOW':
|
|
22
|
+
return cy + ADJACENCY_EPSILON >= targetRect.bottom && reachableX;
|
|
23
|
+
case 'ABOVE':
|
|
24
|
+
return cy + bh <= targetRect.top + ADJACENCY_EPSILON && reachableX;
|
|
25
|
+
case 'RIGHT':
|
|
26
|
+
return cx + ADJACENCY_EPSILON >= targetRect.right && reachableY;
|
|
27
|
+
case 'LEFT':
|
|
28
|
+
return cx + bw <= targetRect.left + ADJACENCY_EPSILON && reachableY;
|
|
29
|
+
default:
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function resolveViewportInsets(viewportPadding, viewportInsets) {
|
|
34
|
+
return {
|
|
35
|
+
top: viewportInsets?.top ?? viewportPadding,
|
|
36
|
+
right: viewportInsets?.right ?? viewportPadding,
|
|
37
|
+
bottom: viewportInsets?.bottom ?? viewportPadding,
|
|
38
|
+
left: viewportInsets?.left ?? viewportPadding
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
4
42
|
/**
|
|
5
43
|
* Side length of the axis-aligned square that, when rotated 45°, yields a
|
|
6
44
|
* tip that protrudes `notchSize` beyond the card edge (half-diagonal = N).
|
|
@@ -24,10 +62,12 @@ export function computeTooltipPosition(opts) {
|
|
|
24
62
|
placement,
|
|
25
63
|
notchSize,
|
|
26
64
|
backdropPadding = 0,
|
|
65
|
+
outsideHighlightSpread = 0,
|
|
27
66
|
windowSize,
|
|
28
67
|
bubbleBorderRadius,
|
|
29
68
|
bubbleBorderWidth = 0,
|
|
30
|
-
viewportPadding = VIEWPORT_PADDING
|
|
69
|
+
viewportPadding = VIEWPORT_PADDING,
|
|
70
|
+
viewportInsets
|
|
31
71
|
} = opts;
|
|
32
72
|
const {
|
|
33
73
|
width: cw,
|
|
@@ -37,13 +77,15 @@ export function computeTooltipPosition(opts) {
|
|
|
37
77
|
width: bw,
|
|
38
78
|
height: bh
|
|
39
79
|
} = bubbleSize;
|
|
80
|
+
const pad = resolveViewportInsets(viewportPadding, viewportInsets);
|
|
81
|
+
const placementPad = backdropPadding + outsideHighlightSpread;
|
|
40
82
|
const targetRect = {
|
|
41
|
-
top: target.y -
|
|
42
|
-
right: target.x + target.width +
|
|
43
|
-
bottom: target.y + target.height +
|
|
44
|
-
left: target.x -
|
|
45
|
-
width: target.width +
|
|
46
|
-
height: target.height +
|
|
83
|
+
top: target.y - placementPad,
|
|
84
|
+
right: target.x + target.width + placementPad,
|
|
85
|
+
bottom: target.y + target.height + placementPad,
|
|
86
|
+
left: target.x - placementPad,
|
|
87
|
+
width: target.width + placementPad * 2,
|
|
88
|
+
height: target.height + placementPad * 2
|
|
47
89
|
};
|
|
48
90
|
let cx = 0;
|
|
49
91
|
let cy = 0;
|
|
@@ -53,30 +95,33 @@ export function computeTooltipPosition(opts) {
|
|
|
53
95
|
const edgeOffset = -half + Math.max(0, bubbleBorderWidth) + 1;
|
|
54
96
|
if (placement === 'BELOW' || placement === 'ABOVE') {
|
|
55
97
|
cx = targetRect.left + targetRect.width / 2 - bw / 2;
|
|
56
|
-
cx = Math.max(
|
|
98
|
+
cx = Math.max(pad.left, Math.min(cw - bw - pad.right, cx));
|
|
57
99
|
const rawLeft = targetRect.left + targetRect.width / 2 - half - cx;
|
|
58
100
|
notch.left = Math.max(bubbleBorderRadius, Math.min(bw - bubbleBorderRadius - side, rawLeft));
|
|
59
101
|
if (placement === 'BELOW') {
|
|
60
102
|
cy = targetRect.bottom + notchSize;
|
|
61
|
-
cy = Math.max(
|
|
103
|
+
cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
|
|
62
104
|
notch.top = edgeOffset;
|
|
63
105
|
} else {
|
|
64
106
|
cy = targetRect.top - notchSize - bh;
|
|
65
|
-
cy = Math.max(
|
|
107
|
+
cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
|
|
66
108
|
notch.bottom = edgeOffset;
|
|
67
109
|
}
|
|
68
110
|
} else {
|
|
69
111
|
cy = targetRect.top + targetRect.height / 2 - bh / 2;
|
|
70
|
-
cy = Math.max(
|
|
112
|
+
cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
|
|
71
113
|
const rawTop = targetRect.top + targetRect.height / 2 - half - cy;
|
|
72
114
|
notch.top = Math.max(bubbleBorderRadius, Math.min(bh - bubbleBorderRadius - side, rawTop));
|
|
115
|
+
|
|
116
|
+
// LEFT keeps pad.left; RIGHT used to min at notchSize, which sat inside the
|
|
117
|
+
// screen margin when the target was near the left edge.
|
|
73
118
|
if (placement === 'RIGHT') {
|
|
74
119
|
cx = targetRect.right + notchSize;
|
|
75
|
-
cx = Math.max(
|
|
120
|
+
cx = Math.max(pad.left, Math.min(cw - bw - pad.right, cx));
|
|
76
121
|
notch.left = edgeOffset;
|
|
77
122
|
} else {
|
|
78
123
|
cx = targetRect.left - notchSize - bw;
|
|
79
|
-
cx = Math.max(
|
|
124
|
+
cx = Math.max(pad.left, Math.min(cw - bw - notchSize, cx));
|
|
80
125
|
notch.right = edgeOffset;
|
|
81
126
|
}
|
|
82
127
|
}
|
|
@@ -86,6 +131,15 @@ export function computeTooltipPosition(opts) {
|
|
|
86
131
|
y: cy
|
|
87
132
|
},
|
|
88
133
|
notchPosition: notch,
|
|
134
|
+
showNotch: notchCanPointAtTarget({
|
|
135
|
+
placement,
|
|
136
|
+
cx,
|
|
137
|
+
cy,
|
|
138
|
+
bw,
|
|
139
|
+
bh,
|
|
140
|
+
targetRect,
|
|
141
|
+
notchSize
|
|
142
|
+
}),
|
|
89
143
|
targetHighlightRect: {
|
|
90
144
|
top: target.y - backdropPadding,
|
|
91
145
|
left: target.x - backdropPadding,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VIEWPORT_PADDING","
|
|
1
|
+
{"version":3,"names":["VIEWPORT_PADDING","ADJACENCY_EPSILON","notchCanPointAtTarget","opts","notchSize","placement","cx","cy","bw","bh","targetRect","targetMidX","left","right","targetMidY","top","bottom","reachableX","reachableY","resolveViewportInsets","viewportPadding","viewportInsets","tooltipNotchDiamondSide","Math","SQRT2","computeTooltipPosition","target","bubbleSize","backdropPadding","outsideHighlightSpread","windowSize","bubbleBorderRadius","bubbleBorderWidth","width","cw","height","ch","pad","placementPad","y","x","notch","side","half","edgeOffset","max","min","rawLeft","rawTop","cardPosition","notchPosition","showNotch","targetHighlightRect"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/computeTooltipPosition.ts"],"mappings":";;AAOA,SAASA,gBAAgB,QAAQ,4BAAyB;AA6B1D;AACA,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,SAASC,qBAAqBA,CAACC,IAQ9B,EAAW;EACV,IAAIA,IAAI,CAACC,SAAS,IAAI,CAAC,EAAE,OAAO,KAAK;EACrC,MAAM;IAAEC,SAAS;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;IAAEC;EAAW,CAAC,GAAGP,IAAI;EACtD,MAAMQ,UAAU,GAAGD,UAAU,CAACE,IAAI,GAAG,CAACF,UAAU,CAACG,KAAK,GAAGH,UAAU,CAACE,IAAI,IAAI,CAAC;EAC7E,MAAME,UAAU,GAAGJ,UAAU,CAACK,GAAG,GA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;IAC1B;EACF;EAEA,OAAO;IACLK,YAAY,EAAE;MAAET,CAAC,EAAElC,EAAE;MAAEiC,CAAC,EAAEhC;IAAG,CAAC;IAC9B2C,aAAa,EAAET,KAAK;IACpBU,SAAS,EAAEjD,qBAAqB,CAAC;MAC/BG,SAAS;MACTC,EAAE;MACFC,EAAE;MACFC,EAAE;MACFC,EAAE;MACFC,UAAU;MACVN;IACF,CAAC,CAAC;IACFgD,mBAAmB,EAAE;MACnBrC,GAAG,EAAEW,MAAM,CAACa,CAAC,GAAGX,eAAe;MAC/BhB,IAAI,EAAEc,MAAM,CAACc,CAAC,GAAGZ,eAAe;MAChCK,KAAK,EAAEP,MAAM,CAACO,KAAK,GAAGL,eAAe,GAAG,CAAC;MACzCO,MAAM,EAAET,MAAM,CAACS,MAAM,GAAGP,eAAe,GAAG;IAC5C;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -5,9 +5,78 @@
|
|
|
5
5
|
import { TOOLTIP_VIEWPORT_PADDING } from "../resolveTooltipLayout.js";
|
|
6
6
|
export const VIEWPORT_PADDING = TOOLTIP_VIEWPORT_PADDING;
|
|
7
7
|
|
|
8
|
+
/** Per-edge screen margin; each omitted edge falls back to `viewportPadding`. */
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Whether `placement` has room beside `target` for `bubbleSize`.
|
|
12
|
+
*
|
|
13
|
+
* Inclusive: a card that exactly fills the remaining gap (LEFT/RIGHT after
|
|
14
|
+
* side-narrowing) still fits. Every side reserves the matching edge margin so
|
|
15
|
+
* this agrees with the clamp in `computeTooltipPosition`; when the two
|
|
16
|
+
* disagree, a placement passes here and is then drawn somewhere else.
|
|
17
|
+
*/
|
|
18
|
+
export function tooltipPlacementFits({
|
|
19
|
+
target,
|
|
20
|
+
bubbleSize,
|
|
21
|
+
notchSize,
|
|
22
|
+
windowSize,
|
|
23
|
+
placement,
|
|
24
|
+
viewportPadding = VIEWPORT_PADDING,
|
|
25
|
+
viewportInsets,
|
|
26
|
+
minHeight
|
|
27
|
+
}) {
|
|
28
|
+
const {
|
|
29
|
+
width: cw,
|
|
30
|
+
height: ch
|
|
31
|
+
} = windowSize;
|
|
32
|
+
const {
|
|
33
|
+
width: bw,
|
|
34
|
+
height: bh
|
|
35
|
+
} = bubbleSize;
|
|
36
|
+
const clip = {
|
|
37
|
+
top: 0,
|
|
38
|
+
right: cw,
|
|
39
|
+
bottom: ch,
|
|
40
|
+
left: 0
|
|
41
|
+
};
|
|
42
|
+
const targetRect = {
|
|
43
|
+
top: target.y,
|
|
44
|
+
right: target.x + target.width,
|
|
45
|
+
bottom: target.y + target.height,
|
|
46
|
+
left: target.x,
|
|
47
|
+
width: target.width,
|
|
48
|
+
height: target.height
|
|
49
|
+
};
|
|
50
|
+
const midX = targetRect.left + targetRect.width / 2;
|
|
51
|
+
const midY = targetRect.top + targetRect.height / 2;
|
|
52
|
+
const midXIn = midX >= clip.left && midX <= clip.right;
|
|
53
|
+
const midYIn = midY >= clip.top && midY <= clip.bottom;
|
|
54
|
+
const verticalHeight = minHeight != null && Number.isFinite(minHeight) ? Math.min(bh, Math.max(0, minHeight)) : bh;
|
|
55
|
+
const padTop = viewportInsets?.top ?? viewportPadding;
|
|
56
|
+
const padRight = viewportInsets?.right ?? viewportPadding;
|
|
57
|
+
const padBottom = viewportInsets?.bottom ?? viewportPadding;
|
|
58
|
+
const padLeft = viewportInsets?.left ?? viewportPadding;
|
|
59
|
+
switch (placement) {
|
|
60
|
+
case 'BELOW':
|
|
61
|
+
return ch - targetRect.bottom >= verticalHeight + notchSize + padBottom && midXIn;
|
|
62
|
+
case 'ABOVE':
|
|
63
|
+
return targetRect.top >= verticalHeight + notchSize + padTop && midXIn;
|
|
64
|
+
case 'RIGHT':
|
|
65
|
+
return cw - targetRect.right >= bw + notchSize + padRight && midYIn;
|
|
66
|
+
case 'LEFT':
|
|
67
|
+
return targetRect.left >= bw + notchSize + padLeft && midYIn;
|
|
68
|
+
default:
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
8
73
|
/**
|
|
9
74
|
* Port of web FlowChrome `inferTooltipPlacement` with distance-sorted flip
|
|
10
75
|
* (not the prototype's fixed BELOW→ABOVE→RIGHT→LEFT priority).
|
|
76
|
+
*
|
|
77
|
+
* When no side fits, returns `desiredPlacement` (or BELOW) as a last resort —
|
|
78
|
+
* callers must check {@link tooltipPlacementFits} on the result to tell a real
|
|
79
|
+
* fit from that fallback.
|
|
11
80
|
*/
|
|
12
81
|
export function inferTooltipPlacement({
|
|
13
82
|
target,
|
|
@@ -15,7 +84,10 @@ export function inferTooltipPlacement({
|
|
|
15
84
|
notchSize,
|
|
16
85
|
windowSize,
|
|
17
86
|
currentPlacement,
|
|
18
|
-
desiredPlacement
|
|
87
|
+
desiredPlacement,
|
|
88
|
+
viewportPadding = VIEWPORT_PADDING,
|
|
89
|
+
viewportInsets,
|
|
90
|
+
minHeight
|
|
19
91
|
}) {
|
|
20
92
|
const {
|
|
21
93
|
width: cw,
|
|
@@ -51,24 +123,20 @@ export function inferTooltipPlacement({
|
|
|
51
123
|
if (targetRect.left >= clip.right) {
|
|
52
124
|
return clip.right > bw + notchSize ? 'LEFT' : 'RIGHT';
|
|
53
125
|
}
|
|
54
|
-
const fits = p => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
default:
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
126
|
+
const fits = p => tooltipPlacementFits({
|
|
127
|
+
target,
|
|
128
|
+
bubbleSize,
|
|
129
|
+
notchSize,
|
|
130
|
+
windowSize,
|
|
131
|
+
placement: p,
|
|
132
|
+
viewportPadding,
|
|
133
|
+
...(viewportInsets != null ? {
|
|
134
|
+
viewportInsets
|
|
135
|
+
} : {}),
|
|
136
|
+
...(minHeight != null ? {
|
|
137
|
+
minHeight
|
|
138
|
+
} : {})
|
|
139
|
+
});
|
|
72
140
|
if (desiredPlacement && fits(desiredPlacement)) return desiredPlacement;
|
|
73
141
|
if (currentPlacement && fits(currentPlacement)) return currentPlacement;
|
|
74
142
|
const options = [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TOOLTIP_VIEWPORT_PADDING","VIEWPORT_PADDING","
|
|
1
|
+
{"version":3,"names":["TOOLTIP_VIEWPORT_PADDING","VIEWPORT_PADDING","tooltipPlacementFits","target","bubbleSize","notchSize","windowSize","placement","viewportPadding","viewportInsets","minHeight","width","cw","height","ch","bw","bh","clip","top","right","bottom","left","targetRect","y","x","midX","midY","midXIn","midYIn","verticalHeight","Number","isFinite","Math","min","max","padTop","padRight","padBottom","padLeft","inferTooltipPlacement","currentPlacement","desiredPlacement","fits","p","options","dist","sort","a","b"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/inferTooltipPlacement.ts"],"mappings":";;AAAA;;AAyBA,SAASA,wBAAwB,QAAQ,4BAAyB;AAElE,OAAO,MAAMC,gBAAgB,GAAGD,wBAAwB;;AAExD;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,oBAAoBA,CAAC;EACnCC,MAAM;EACNC,UAAU;EACVC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,eAAe,GAAGP,gBAAgB;EAClCQ,cAAc;EACdC;AACwB,CAAC,EAAW;EACpC,MAAM;IAAEC,KAAK,EAAEC,EAAE;IAAEC,MAAM,EAAEC;EAAG,CAAC,GAAGR,UAAU;EAC5C,MAAM;IAAEK,KAAK,EAAEI,EAAE;IAAEF,MAAM,EAAEG;EAAG,CAAC,GAAGZ,UAAU;EAC5C,MAAMa,IAAI,GAAG;IAAEC,GAAG,EAAE,CAAC;IAAEC,KAAK,EAAEP,EAAE;IAAEQ,MAAM,EAAEN,EAAE;IAAEO,IAAI,EAAE;EAAE,CAAC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CAACJ;EAAI,CAAC,EAC5C;IAAEX,SAAS,EAAE,OAAO;IAAEsC,IAAI,EAAE/B,EAAE,GAAGQ,UAAU,CAACF;EAAO,CAAC,EACpD;IAAEb,SAAS,EAAE,OAAO;IAAEsC,IAAI,EAAEvB,UAAU,CAACD;EAAK,CAAC,EAC7C;IAAEd,SAAS,EAAE,MAAM;IAAEsC,IAAI,EAAEjC,EAAE,GAAGU,UAAU,CAACH;EAAM,CAAC,CACnD;EACDyB,OAAO,CAACE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACF,IAAI,GAAGG,CAAC,CAACH,IAAI,CAAC;EACvC,KAAK,MAAM;IAAEtC;EAAU,CAAC,IAAIqC,OAAO,EAAE;IACnC,IAAIF,IAAI,CAACnC,SAAS,CAAC,EAAE,OAAOA,SAAS;EACvC;EAEA,OAAOkC,gBAAgB,IAAI,OAAO;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const PREFIX = '[Userflow]';
|
|
4
|
+
|
|
5
|
+
/** Sink for placement diagnostics. Injected in tests. */
|
|
6
|
+
|
|
7
|
+
export const defaultPlacementLogger = message => {
|
|
8
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
9
|
+
console.warn(message);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A Builder-requested LEFT/RIGHT side could not be drawn at all: the room
|
|
14
|
+
* beside the target is smaller than the card's own chrome, so no width is left
|
|
15
|
+
* to lay content out in. Draft/preview and `__DEV__` only.
|
|
16
|
+
*
|
|
17
|
+
* The caller must not emit this when the side was honored at a reduced width —
|
|
18
|
+
* shrinking is the expected outcome now, and whether it looks good is the
|
|
19
|
+
* author's call — nor for keyboard / off-screen vertical flips, whose cause is
|
|
20
|
+
* not the room beside the target.
|
|
21
|
+
*/
|
|
22
|
+
export function tooltipSidePlacementDroppedMessage(opts) {
|
|
23
|
+
const gap = Number.isFinite(opts.availableGap) ? Math.max(0, Math.floor(opts.availableGap)) : 0;
|
|
24
|
+
const minWidth = Number.isFinite(opts.minWidth) ? Math.max(0, Math.ceil(opts.minWidth)) : 0;
|
|
25
|
+
return `${PREFIX} Tooltip placement "${opts.requested}" could not be drawn beside the target ` + `(${gap}pt of room beside it; the card needs ${minWidth}pt for its padding and border). ` + `Placed ${opts.used} instead.`;
|
|
26
|
+
}
|
|
27
|
+
export function warnTooltipSidePlacementDropped(opts, log = defaultPlacementLogger) {
|
|
28
|
+
log(tooltipSidePlacementDroppedMessage(opts));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* No side had room for the card — including the authored LEFT/RIGHT — so
|
|
33
|
+
* {@link inferTooltipPlacement} returned the requested side as a last resort.
|
|
34
|
+
* Draft/preview and `__DEV__` only. Distinct from
|
|
35
|
+
* {@link tooltipSidePlacementDroppedMessage}, which reports a successful flip.
|
|
36
|
+
*/
|
|
37
|
+
export function tooltipPlacementUnanchoredMessage(opts) {
|
|
38
|
+
return `${PREFIX} Tooltip placement "${opts.requested}" could not be drawn on any side of the target. ` + `The card is on-screen but the pointer is hidden because it cannot point at the target.`;
|
|
39
|
+
}
|
|
40
|
+
export function warnTooltipPlacementUnanchored(opts, log = defaultPlacementLogger) {
|
|
41
|
+
log(tooltipPlacementUnanchoredMessage(opts));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=placementDiagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PREFIX","defaultPlacementLogger","message","console","warn","tooltipSidePlacementDroppedMessage","opts","gap","Number","isFinite","availableGap","Math","max","floor","minWidth","ceil","requested","used","warnTooltipSidePlacementDropped","log","tooltipPlacementUnanchoredMessage","warnTooltipPlacementUnanchored"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/placementDiagnostics.ts"],"mappings":";;AAEA,MAAMA,MAAM,GAAG,YAAY;;AAE3B;;AA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|
|
3
|
+
/** Grow or shrink `rect` by `padding` on every side. */
|
|
4
|
+
export function expandRect(rect, padding) {
|
|
5
|
+
if (padding === 0) return rect;
|
|
6
|
+
return {
|
|
7
|
+
x: rect.x - padding,
|
|
8
|
+
y: rect.y - padding,
|
|
9
|
+
width: rect.width + padding * 2,
|
|
10
|
+
height: rect.height + padding * 2
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
/** True when two rects are identical (used to avoid redundant setState). */
|
|
4
15
|
export function rectsEqual(a, b) {
|
|
5
16
|
if (a === b) return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["expandRect","rect","padding","x","y","width","height","rectsEqual","a","b","isRectOffScreen","windowSize","isRectFullyVisible","viewport","buildEffectiveViewport","insets","top","Math","max","right","bottom","left"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/rect.ts"],"mappings":";;AAEA;AACA,OAAO,SAASA,UAAUA,CAACC,IAAU,EAAEC,OAAe,EAAQ;EAC5D,IAAIA,OAAO,KAAK,CAAC,EAAE,OAAOD,IAAI;EAC9B,OAAO;IACLE,CAAC,EAAEF,IAAI,CAACE,CAAC,GAAGD,OAAO;IACnBE,CAAC,EAAEH,IAAI,CAACG,CAAC,GAAGF,OAAO;IACnBG,KAAK,EAAEJ,IAAI,CAACI,KAAK,GAAGH,OAAO,GAAG,CAAC;IAC/BI,MAAM,EAAEL,IAAI,CAACK,MAAM,GAAGJ,OAAO,GAAG;EAClC,CAAC;AACH;;AAEA;AACA,OAAO,SAASK,UAAUA,CAACC,CAAc,EAAEC,CAAc,EAAW;EAClE,IAAID,CAAC,KAAKC,CAAC,EAAE,OAAO,IAAI;EACxB,IAAID,CAAC,IAAI,IAAI,IAAIC,CAAC,IAAI,IAAI,EAAE,OAAO,KAAK;EACxC,OAAOD,CAAC,CAACL,CAAC,KAAKM,CAAC,CAACN,CAAC,IAAIK,CAAC,CAACJ,CAAC,KAAKK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,CAAC;EACzC,MAAMG,KAAK,GAAGF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEI,KAAK,IAAI,CAAC,CAAC;EAC7C,MAAMC,MAAM,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEK,MAAM,IAAI,CAAC,CAAC;EAC/C,MAAMC,IAAI,GAAGJ,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEM,IAAI,IAAI,CAAC,CAAC;EAC3C,OAAO;IACLlB,CAAC,EAAEkB,IAAI;IACPjB,CAAC,EAAEY,GAAG;IACNX,KAAK,EAAEY,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEP,UAAU,CAACN,KAAK,GAAGgB,IAAI,GAAGF,KAAK,CAAC;IACnDb,MAAM,EAAEW,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEP,UAAU,CAACL,MAAM,GAAGU,GAAG,GAAGI,MAAM;EACtD,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { VIEWPORT_PADDING } from "./inferTooltipPlacement.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Narrowest a side card may get: the width it spends on its own chrome, so
|
|
7
|
+
* content padding on both edges plus the border. Below this there is nothing
|
|
8
|
+
* left to lay text out in, and React Native overflows the card instead of
|
|
9
|
+
* shrinking it — the preview would stop showing the author what ships.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately structural, not a readability judgment. How narrow is *too*
|
|
12
|
+
* narrow to read is the author's call, made against the device preview.
|
|
13
|
+
*/
|
|
14
|
+
export function tooltipMinSideCardWidth(opts) {
|
|
15
|
+
const contentPadding = Number.isFinite(opts.contentPadding) ? Math.max(0, opts.contentPadding) : 0;
|
|
16
|
+
const borderWidth = opts.borderWidth != null && Number.isFinite(opts.borderWidth) ? Math.max(0, opts.borderWidth) : 0;
|
|
17
|
+
const chromeWidth = contentPadding * 2 + borderWidth * 2;
|
|
18
|
+
// Never demand more width than the card itself: a 40pt step card can still
|
|
19
|
+
// sit on the side even though its own padding would ask for more.
|
|
20
|
+
if (!Number.isFinite(opts.cardMaxWidth) || opts.cardMaxWidth <= 0) return chromeWidth;
|
|
21
|
+
return Math.min(chromeWidth, opts.cardMaxWidth);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Horizontal room beside an expanded target for a LEFT/RIGHT tooltip.
|
|
26
|
+
*
|
|
27
|
+
* Reserves `viewportPadding` on the screen edge the card grows toward, matching
|
|
28
|
+
* the LEFT/RIGHT clamp in `computeTooltipPosition`. Web clamps side placements
|
|
29
|
+
* to the raw edge instead; RN keeps the screen margin because an edge-to-edge
|
|
30
|
+
* card reads as broken on a phone-width viewport.
|
|
31
|
+
*/
|
|
32
|
+
export function tooltipSideGap(opts) {
|
|
33
|
+
const {
|
|
34
|
+
placement,
|
|
35
|
+
target,
|
|
36
|
+
windowWidth,
|
|
37
|
+
notchSize,
|
|
38
|
+
viewportPadding = VIEWPORT_PADDING
|
|
39
|
+
} = opts;
|
|
40
|
+
if (placement === 'LEFT') {
|
|
41
|
+
return target.x - notchSize - viewportPadding;
|
|
42
|
+
}
|
|
43
|
+
return windowWidth - (target.x + target.width) - notchSize - viewportPadding;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Width a LEFT/RIGHT tooltip may use: the room beside the target, capped at the
|
|
48
|
+
* theme width. The card takes whatever is left and grows taller to compensate.
|
|
49
|
+
* Null when not even {@link tooltipMinSideCardWidth} fits, so placement falls
|
|
50
|
+
* back to the vertical flip.
|
|
51
|
+
*
|
|
52
|
+
* `target` must already be expanded by backdrop padding and outside highlight
|
|
53
|
+
* spread — the same rect passed to `inferTooltipPlacement`.
|
|
54
|
+
*/
|
|
55
|
+
export function resolveTooltipSideCardWidth(opts) {
|
|
56
|
+
const gap = tooltipSideGap(opts);
|
|
57
|
+
const width = Math.min(opts.cardMaxWidth, Math.floor(gap));
|
|
58
|
+
if (!Number.isFinite(width) || width <= 0 || width < opts.minWidth) return null;
|
|
59
|
+
return width;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Shortest a card may get: the height it spends on its own chrome, so
|
|
64
|
+
* content padding on both edges plus the border. Mirrors
|
|
65
|
+
* {@link tooltipMinSideCardWidth} on the vertical axis.
|
|
66
|
+
*/
|
|
67
|
+
export function tooltipMinCardHeight(opts) {
|
|
68
|
+
const contentPadding = Number.isFinite(opts.contentPadding) ? Math.max(0, opts.contentPadding) : 0;
|
|
69
|
+
const borderWidth = opts.borderWidth != null && Number.isFinite(opts.borderWidth) ? Math.max(0, opts.borderWidth) : 0;
|
|
70
|
+
const chromeHeight = contentPadding * 2 + borderWidth * 2;
|
|
71
|
+
if (!Number.isFinite(opts.cardMaxHeight) || opts.cardMaxHeight <= 0) return chromeHeight;
|
|
72
|
+
return Math.min(chromeHeight, opts.cardMaxHeight);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Vertical room above or below an expanded target for an ABOVE/BELOW tooltip.
|
|
77
|
+
*
|
|
78
|
+
* Reserves the matching viewport inset on the edge the card grows toward,
|
|
79
|
+
* matching the ABOVE/BELOW clamp in `computeTooltipPosition`.
|
|
80
|
+
*/
|
|
81
|
+
export function tooltipVerticalGap(opts) {
|
|
82
|
+
const {
|
|
83
|
+
placement,
|
|
84
|
+
target,
|
|
85
|
+
windowHeight,
|
|
86
|
+
notchSize,
|
|
87
|
+
viewportPadding = VIEWPORT_PADDING
|
|
88
|
+
} = opts;
|
|
89
|
+
const top = opts.viewportInsets?.top ?? viewportPadding;
|
|
90
|
+
const bottom = opts.viewportInsets?.bottom ?? viewportPadding;
|
|
91
|
+
if (placement === 'ABOVE') {
|
|
92
|
+
return target.y - notchSize - top;
|
|
93
|
+
}
|
|
94
|
+
return windowHeight - (target.y + target.height) - notchSize - bottom;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=resolveSideCardWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["VIEWPORT_PADDING","tooltipMinSideCardWidth","opts","contentPadding","Number","isFinite","Math","max","borderWidth","chromeWidth","cardMaxWidth","min","tooltipSideGap","placement","target","windowWidth","notchSize","viewportPadding","x","width","resolveTooltipSideCardWidth","gap","floor","minWidth","tooltipMinCardHeight","chromeHeight","cardMaxHeight","tooltipVerticalGap","windowHeight","top","viewportInsets","bottom","y","height"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/resolveSideCardWidth.ts"],"mappings":";;AACA,SAASA,gBAAgB,QAAQ,4BAAyB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,IAIvC,EAAU;EACT,MAAMC,cAAc,GAAGC,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACC,cAAc,CAAC,GACvDG,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,IAAI,CAACC,cAAc,CAAC,GAChC,CAAC;EACL,MAAMK,WAAW,GACfN,IAAI,CAACM,WAAW,IAAI,IAAI,IAAIJ,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACM,WAAW,CAAC,GACzDF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,IAAI,CAACM,WAAW,CAAC,GAC7B,CAAC;EACP,MAAMC,WAAW,GAAGN,cAAc,GAAG,CAAC,GAAGK,WAAW,GAAG,CAAC;EACxD;EACA;EACA,IAAI,CAACJ,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACQ,YAAY,CAAC,IAAIR,IAAI,CAACQ,YAAY,IAAI,CAAC,EAAE,OAAOD,WAAW;EACrF,OAAOH,IAAI,CAACK,GAAG,CAACF,WAAW,EAAEP,IAAI,CAACQ,YAAY,CAAC;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,cAAcA,C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AAc,GAAG,CAAC,GAAGK,WAAW,GAAG,CAAC;EACzD,IAAI,CAACJ,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACwB,aAAa,CAAC,IAAIxB,IAAI,CAACwB,aAAa,IAAI,CAAC,EAAE,OAAOD,YAAY;EACxF,OAAOnB,IAAI,CAACK,GAAG,CAACc,YAAY,EAAEvB,IAAI,CAACwB,aAAa,CAAC;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACzB,IAOlC,EAAU;EACT,MAAM;IAAEW,SAAS;IAAEC,MAAM;IAAEc,YAAY;IAAEZ,SAAS;IAAEC,eAAe,GAAGjB;EAAiB,CAAC,GAAGE,IAAI;EAC/F,MAAM2B,GAAG,GAAG3B,IAAI,CAAC4B,cAAc,EAAED,GAAG,IAAIZ,eAAe;EACvD,MAAMc,MAAM,GAAG7B,IAAI,CAAC4B,cAAc,EAAEC,MAAM,IAAId,eAAe;EAC7D,IAAIJ,SAAS,KAAK,OAAO,EAAE;IACzB,OAAOC,MAAM,CAACkB,CAAC,GAAGhB,SAAS,GAAGa,GAAG;EACnC;EACA,OAAOD,YAAY,IAAId,MAAM,CAACkB,CAAC,GAAGlB,MAAM,CAACmB,MAAM,CAAC,GAAGjB,SAAS,GAAGe,MAAM;AACvE","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -9,7 +9,7 @@ import type { MutableRefObject, RefObject } from 'react';
|
|
|
9
9
|
*/
|
|
10
10
|
export type AutoAnchorRef = RefObject<unknown> | MutableRefObject<unknown>;
|
|
11
11
|
export type AutoAnchorListener = () => void;
|
|
12
|
-
/** Build-time descriptor stamped by `@userflow-tech/babel-plugin` (full or expanded compact). */
|
|
12
|
+
/** Build-time descriptor stamped by `@userflow-tech/react-native/babel-plugin` (full or expanded compact). */
|
|
13
13
|
export interface BuildTimeHints {
|
|
14
14
|
/** Canonical structural path (IDs replace ordinals when present). */
|
|
15
15
|
ufid: string;
|
|
@@ -80,6 +80,7 @@ export declare class AutoAnchorRegistry {
|
|
|
80
80
|
private readonly byRegistryKey;
|
|
81
81
|
private readonly byManualId;
|
|
82
82
|
private readonly byTemplatePath;
|
|
83
|
+
private readonly liveContent;
|
|
83
84
|
private readonly listeners;
|
|
84
85
|
private notifyScheduled;
|
|
85
86
|
registerInstance(input: RegisterInstanceInput): {
|
|
@@ -97,12 +98,37 @@ export declare class AutoAnchorRegistry {
|
|
|
97
98
|
previous: SiblingDescriptor[];
|
|
98
99
|
next: SiblingDescriptor[];
|
|
99
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Fill `childText` (and live `testID`) from the host fiber. Live content
|
|
103
|
+
* wins when readable; the build-time hint is the fallback.
|
|
104
|
+
*
|
|
105
|
+
* Direct fiber pointers are preferred; the scan-root index is built lazily
|
|
106
|
+
* and only if some instance cannot reach its fiber that way (Paper release
|
|
107
|
+
* builds, mainly), then reused for the rest of the pass.
|
|
108
|
+
*
|
|
109
|
+
* Silent — does not notify listeners.
|
|
110
|
+
*/
|
|
111
|
+
refreshLiveContent(instances?: AutoAnchorInstance[]): void;
|
|
112
|
+
private refreshOneLiveContent;
|
|
113
|
+
/**
|
|
114
|
+
* Copy `testID` off the live host so a shared `__userflowAutoAnchor` callback
|
|
115
|
+
* (helper-rendered rows) cannot pin every instance to the last render's bag.
|
|
116
|
+
* Silent — no listener notify.
|
|
117
|
+
*/
|
|
118
|
+
private applyLiveIdentity;
|
|
100
119
|
subscribe(listener: AutoAnchorListener): () => void;
|
|
101
120
|
isAmbiguousKey(key: string): boolean;
|
|
102
121
|
/** Test helper — drop every instance and reset ids. */
|
|
103
122
|
clear(): void;
|
|
104
123
|
private unregisterInstance;
|
|
105
124
|
private refreshManualIndexes;
|
|
125
|
+
/**
|
|
126
|
+
* Instances sharing a template path are only twins while they look alike.
|
|
127
|
+
* Four rows from one `field()` helper are indistinguishable at register time
|
|
128
|
+
* and separate once their labels are read, so ambiguity is decided on
|
|
129
|
+
* content, not on the shared path alone. An instance stays ambiguous when it
|
|
130
|
+
* carries no content of its own, or when a peer carries the same content.
|
|
131
|
+
*/
|
|
106
132
|
private recomputeAmbiguity;
|
|
107
133
|
private addIndex;
|
|
108
134
|
private removeIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoAnchorRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/anchors/AutoAnchorRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AutoAnchorRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/anchors/AutoAnchorRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUzD;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC;AAE5C,8GAA8G;AAC9G,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,Y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ACrB,CACF,GACA,IAAI;IA4BP,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI/D,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAI5D,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAIxD,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAI9D,YAAY,IAAI,kBAAkB,EAAE;IAIpC,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAiBtE,aAAa,CACX,UAAU,EAAE,MAAM,EAClB,UAAU,SAAI,GACb;QAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;QAAC,IAAI,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAiB/D;;;;;;;;;OASG;IACH,kBAAkB,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,GAAG,IAAI;IAW1D,OAAO,CAAC,qBAAqB;IAmD7B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,IAAI;IAOnD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAOpC,uDAAuD;IACvD,KAAK,IAAI,IAAI;IAUb,OAAO,CAAC,kBAAkB;IA2B1B,OAAO,CAAC,oBAAoB;IAsB5B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,MAAM;CAmBf;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -5,6 +5,7 @@ type Listener = () => void;
|
|
|
5
5
|
* Fiber-resolved anchors (testID / nativeID / accessibilityLabel) do not emit
|
|
6
6
|
* registry events, so we combine:
|
|
7
7
|
* - {@link anchorRegistry} mount/unmount
|
|
8
|
+
* - {@link autoAnchorRegistry} mount/unmount
|
|
8
9
|
* - {@link fiberScanRoot} mount/unmount
|
|
9
10
|
* - screen-change notifications
|
|
10
11
|
* - a slow interval that only runs while at least one listener is subscribed
|
|
@@ -13,6 +14,7 @@ declare class AnchorChangeTicker {
|
|
|
13
14
|
private readonly listeners;
|
|
14
15
|
private intervalHandle;
|
|
15
16
|
private unsubRegistry;
|
|
17
|
+
private unsubAuto;
|
|
16
18
|
private unsubScan;
|
|
17
19
|
/** Poll interval while ELEMENT conditions are tracked (ms). */
|
|
18
20
|
static readonly INTERVAL_MS = 1000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchorChangeTicker.d.ts","sourceRoot":"","sources":["../../../../../src/anchors/anchorChangeTicker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"anchorChangeTicker.d.ts","sourceRoot":"","sources":["../../../../../src/anchors/anchorChangeTicker.ts"],"names":[],"mappings":"AAIA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B;;;;;;;;;;GAUG;AACH,cAAM,kBAAkB;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,SAAS,CAA6B;IAE9C,+DAA+D;IAC/D,MAAM,CAAC,QAAQ,CAAC,WAAW,QAAQ;IAEnC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IAczC,2DAA2D;IAC3D,MAAM,IAAI,IAAI;IAId,mBAAmB;IACnB,aAAa,IAAI,IAAI;IAKrB,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,IAAI;IAmBZ,OAAO,CAAC,IAAI;CAKb;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|