@userflow-tech/react-native 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -68
- package/app.plugin.js +13 -0
- package/babel-plugin/index.d.ts +43 -0
- package/babel-plugin/index.d.ts.map +1 -0
- package/babel-plugin/index.js +862 -0
- package/babel-plugin/index.js.map +1 -0
- package/babel-plugin.js +13 -0
- package/docs/anchoring.md +141 -13
- package/docs/deep-linking.md +20 -17
- package/docs/theme-mapping.md +44 -15
- package/docs/troubleshooting.md +37 -30
- package/expo-plugin/withUserflow.d.ts +17 -0
- package/expo-plugin/withUserflow.d.ts.map +1 -0
- package/expo-plugin/withUserflow.js +99 -0
- package/expo-plugin/withUserflow.js.map +1 -0
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +125 -3
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/commonjs/anchors/anchorChangeTicker.js +10 -0
- package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -1
- package/lib/commonjs/anchors/autoAnchor.js +1 -1
- package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -12
- package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js +11 -47
- package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -1
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +50 -0
- package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js +145 -3
- package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/commonjs/anchors/fiber/indexHostFibers.js +129 -0
- package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -0
- package/lib/commonjs/anchors/fiber/readHostContent.js +131 -0
- package/lib/commonjs/anchors/fiber/readHostContent.js.map +1 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js +50 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -0
- package/lib/commonjs/anchors/hintsCodec.js +1 -1
- package/lib/commonjs/anchors/resolveAnchorHost.js +15 -21
- package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js +171 -0
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -0
- package/lib/commonjs/anchors/semanticMatcher.js +285 -0
- package/lib/commonjs/anchors/semanticMatcher.js.map +1 -0
- package/lib/commonjs/authoring/ElementPickerOverlay.js +490 -0
- package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -0
- package/lib/commonjs/authoring/capturePickerScreenshot.js +73 -0
- package/lib/commonjs/authoring/capturePickerScreenshot.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeBarTransition.js +94 -0
- package/lib/commonjs/authoring/chrome/ChromeBarTransition.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +64 -0
- package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeButton.js +94 -0
- package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeDialog.js +131 -0
- package/lib/commonjs/authoring/chrome/ChromeDialog.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js +39 -0
- package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeTooltip.js +88 -0
- package/lib/commonjs/authoring/chrome/ChromeTooltip.js.map +1 -0
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js +110 -0
- package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -0
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +57 -0
- package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +80 -0
- package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark@2x.png +0 -0
- package/lib/commonjs/authoring/chrome/icons/xmark@3x.png +0 -0
- package/lib/commonjs/authoring/chrome/tokens.js +150 -0
- package/lib/commonjs/authoring/chrome/tokens.js.map +1 -0
- package/lib/commonjs/authoring/doubleTap.js +23 -0
- package/lib/commonjs/authoring/doubleTap.js.map +1 -0
- package/lib/commonjs/authoring/elementPickerController.js +102 -0
- package/lib/commonjs/authoring/elementPickerController.js.map +1 -0
- package/lib/commonjs/authoring/fingerprintFromInstance.js +195 -0
- package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -0
- package/lib/commonjs/authoring/hitTest.js +106 -0
- package/lib/commonjs/authoring/hitTest.js.map +1 -0
- package/lib/commonjs/content/RichContentRenderer.js +12 -2
- package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
- package/lib/commonjs/content/StepButton.js +19 -4
- package/lib/commonjs/content/StepButton.js.map +1 -1
- package/lib/commonjs/content/resolveStepButtonChrome.js +8 -6
- package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -1
- package/lib/commonjs/content/themeColor.js +11 -0
- package/lib/commonjs/content/themeColor.js.map +1 -1
- package/lib/commonjs/deviceContext.js +158 -0
- package/lib/commonjs/deviceContext.js.map +1 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +40 -4
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/commonjs/hostAppVersion.js +242 -0
- package/lib/commonjs/hostAppVersion.js.map +1 -0
- package/lib/commonjs/index.js +118 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lifecycle.js +2 -0
- package/lib/commonjs/lifecycle.js.map +1 -1
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js +17 -8
- package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/commonjs/navigation/isOverlayPresentation.js +64 -0
- package/lib/commonjs/navigation/isOverlayPresentation.js.map +1 -0
- package/lib/commonjs/pairing/PairingController.js +29 -2
- package/lib/commonjs/pairing/PairingController.js.map +1 -1
- package/lib/commonjs/pairing/PreviewModeBanner.js +211 -84
- package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/commonjs/pairing/diagnostics.js +11 -2
- package/lib/commonjs/pairing/diagnostics.js.map +1 -1
- package/lib/commonjs/pairing/elementPickerRelay.js +91 -0
- package/lib/commonjs/pairing/elementPickerRelay.js.map +1 -0
- package/lib/commonjs/pairing/resolvePreviewChrome.js +52 -0
- package/lib/commonjs/pairing/resolvePreviewChrome.js.map +1 -0
- package/lib/commonjs/pairing/tokenStorage.js +25 -2
- package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
- package/lib/commonjs/pairing/usePairingState.js +3 -1
- package/lib/commonjs/pairing/usePairingState.js.map +1 -1
- package/lib/commonjs/runtime/FlowRenderer.js +45 -21
- package/lib/commonjs/runtime/FlowRenderer.js.map +1 -1
- package/lib/commonjs/runtime/FlowSurfaceFade.js +47 -24
- package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -1
- package/lib/commonjs/runtime/TargetPressBridge.js +13 -44
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
- package/lib/commonjs/runtime/UserflowProvider.js +74 -20
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
- package/lib/commonjs/runtime/changedTouchPoints.js +48 -0
- package/lib/commonjs/runtime/changedTouchPoints.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +3 -1
- package/lib/commonjs/runtime/flowEngine.js.map +1 -1
- package/lib/commonjs/runtime/flowSessionViewState.js +32 -7
- package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -1
- package/lib/commonjs/runtime/useFlowSessionState.js +2 -1
- package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -1
- package/lib/commonjs/screenTracker.js +46 -4
- package/lib/commonjs/screenTracker.js.map +1 -1
- package/lib/commonjs/surfaces/CardFade.js +31 -0
- package/lib/commonjs/surfaces/CardFade.js.map +1 -0
- package/lib/commonjs/surfaces/CloseButton.js +11 -6
- package/lib/commonjs/surfaces/CloseButton.js.map +1 -1
- package/lib/commonjs/surfaces/ModalSurface.js +50 -34
- package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
- package/lib/commonjs/surfaces/TooltipSurface.js +366 -87
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
- package/lib/commonjs/surfaces/cardTransition.js +70 -0
- package/lib/commonjs/surfaces/cardTransition.js.map +1 -0
- package/lib/commonjs/surfaces/resolveHighlightChrome.js +109 -0
- package/lib/commonjs/surfaces/resolveHighlightChrome.js.map +1 -0
- package/lib/commonjs/surfaces/resolveModalLayout.js +7 -3
- package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -1
- package/lib/commonjs/surfaces/resolveTooltipLayout.js +0 -4
- package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -1
- package/lib/commonjs/surfaces/surfaceInteractionConfig.js +33 -0
- package/lib/commonjs/surfaces/surfaceInteractionConfig.js.map +1 -0
- package/lib/commonjs/surfaces/surfaceLayoutInsets.js +128 -0
- package/lib/commonjs/surfaces/surfaceLayoutInsets.js.map +1 -0
- package/lib/commonjs/surfaces/themeChrome.js +4 -1
- package/lib/commonjs/surfaces/themeChrome.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +142 -21
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +100 -47
- package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js +124 -0
- package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +67 -13
- package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +88 -19
- package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js +52 -0
- package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js.map +1 -0
- package/lib/commonjs/surfaces/tooltip/rect.js +12 -0
- package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js +103 -0
- package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/anchors/AutoAnchorRegistry.js +126 -3
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/module/anchors/anchorChangeTicker.js +10 -0
- package/lib/module/anchors/anchorChangeTicker.js.map +1 -1
- package/lib/module/anchors/autoAnchor.js +1 -1
- package/lib/module/anchors/elementConditionEvaluator.js +25 -12
- package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRoot.js +2 -43
- package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -1
- package/lib/module/anchors/fiber/FiberScanRootStore.js +46 -0
- package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -0
- package/lib/module/anchors/fiber/fiberInternals.js +139 -3
- package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/module/anchors/fiber/indexHostFibers.js +122 -0
- package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -0
- package/lib/module/anchors/fiber/readHostContent.js +127 -0
- package/lib/module/anchors/fiber/readHostContent.js.map +1 -0
- package/lib/module/anchors/fiberAnchorCache.js +40 -0
- package/lib/module/anchors/fiberAnchorCache.js.map +1 -0
- package/lib/module/anchors/hintsCodec.js +1 -1
- package/lib/module/anchors/resolveAnchorHost.js +15 -21
- package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveAutoAnchorHost.js +167 -0
- package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -0
- package/lib/module/anchors/semanticMatcher.js +280 -0
- package/lib/module/anchors/semanticMatcher.js.map +1 -0
- package/lib/module/authoring/ElementPickerOverlay.js +485 -0
- package/lib/module/authoring/ElementPickerOverlay.js.map +1 -0
- package/lib/module/authoring/capturePickerScreenshot.js +68 -0
- package/lib/module/authoring/capturePickerScreenshot.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeBarTransition.js +88 -0
- package/lib/module/authoring/chrome/ChromeBarTransition.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeBottomSheet.js +59 -0
- package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeButton.js +89 -0
- package/lib/module/authoring/chrome/ChromeButton.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeDialog.js +126 -0
- package/lib/module/authoring/chrome/ChromeDialog.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeIcon.js +33 -0
- package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeTooltip.js +82 -0
- package/lib/module/authoring/chrome/ChromeTooltip.js.map +1 -0
- package/lib/module/authoring/chrome/ChromeTopBar.js +104 -0
- package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -0
- package/lib/module/authoring/chrome/DoubleTapBridge.js +52 -0
- package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js +75 -0
- package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark@2x.png +0 -0
- package/lib/module/authoring/chrome/icons/xmark@3x.png +0 -0
- package/lib/module/authoring/chrome/tokens.js +146 -0
- package/lib/module/authoring/chrome/tokens.js.map +1 -0
- package/lib/module/authoring/doubleTap.js +18 -0
- package/lib/module/authoring/doubleTap.js.map +1 -0
- package/lib/module/authoring/elementPickerController.js +97 -0
- package/lib/module/authoring/elementPickerController.js.map +1 -0
- package/lib/module/authoring/fingerprintFromInstance.js +187 -0
- package/lib/module/authoring/fingerprintFromInstance.js.map +1 -0
- package/lib/module/authoring/hitTest.js +100 -0
- package/lib/module/authoring/hitTest.js.map +1 -0
- package/lib/module/content/RichContentRenderer.js +12 -2
- package/lib/module/content/RichContentRenderer.js.map +1 -1
- package/lib/module/content/StepButton.js +19 -4
- package/lib/module/content/StepButton.js.map +1 -1
- package/lib/module/content/resolveStepButtonChrome.js +8 -6
- package/lib/module/content/resolveStepButtonChrome.js.map +1 -1
- package/lib/module/content/themeColor.js +10 -0
- package/lib/module/content/themeColor.js.map +1 -1
- package/lib/module/deviceContext.js +142 -0
- package/lib/module/deviceContext.js.map +1 -0
- package/lib/module/expo-router/useUserflowExpoRouter.js +42 -6
- package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/module/hostAppVersion.js +225 -0
- package/lib/module/hostAppVersion.js.map +1 -0
- package/lib/module/index.js +119 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/lifecycle.js +2 -0
- package/lib/module/lifecycle.js.map +1 -1
- package/lib/module/navigation/WithUserflowReactNavigation.js +18 -9
- package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
- package/lib/module/navigation/isOverlayPresentation.js +58 -0
- package/lib/module/navigation/isOverlayPresentation.js.map +1 -0
- package/lib/module/pairing/PairingController.js +30 -3
- package/lib/module/pairing/PairingController.js.map +1 -1
- package/lib/module/pairing/PreviewModeBanner.js +212 -85
- package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
- package/lib/module/pairing/diagnostics.js +10 -2
- package/lib/module/pairing/diagnostics.js.map +1 -1
- package/lib/module/pairing/elementPickerRelay.js +87 -0
- package/lib/module/pairing/elementPickerRelay.js.map +1 -0
- package/lib/module/pairing/resolvePreviewChrome.js +48 -0
- package/lib/module/pairing/resolvePreviewChrome.js.map +1 -0
- package/lib/module/pairing/tokenStorage.js +24 -2
- package/lib/module/pairing/tokenStorage.js.map +1 -1
- package/lib/module/pairing/usePairingState.js +3 -1
- package/lib/module/pairing/usePairingState.js.map +1 -1
- package/lib/module/runtime/FlowRenderer.js +45 -21
- package/lib/module/runtime/FlowRenderer.js.map +1 -1
- package/lib/module/runtime/FlowSurfaceFade.js +49 -26
- package/lib/module/runtime/FlowSurfaceFade.js.map +1 -1
- package/lib/module/runtime/TargetPressBridge.js +12 -43
- package/lib/module/runtime/TargetPressBridge.js.map +1 -1
- package/lib/module/runtime/UserflowProvider.js +74 -20
- package/lib/module/runtime/UserflowProvider.js.map +1 -1
- package/lib/module/runtime/changedTouchPoints.js +43 -0
- package/lib/module/runtime/changedTouchPoints.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +3 -1
- package/lib/module/runtime/flowEngine.js.map +1 -1
- package/lib/module/runtime/flowSessionViewState.js +32 -7
- package/lib/module/runtime/flowSessionViewState.js.map +1 -1
- package/lib/module/runtime/useFlowSessionState.js +2 -1
- package/lib/module/runtime/useFlowSessionState.js.map +1 -1
- package/lib/module/screenTracker.js +42 -4
- package/lib/module/screenTracker.js.map +1 -1
- package/lib/module/surfaces/CardFade.js +26 -0
- package/lib/module/surfaces/CardFade.js.map +1 -0
- package/lib/module/surfaces/CloseButton.js +10 -6
- package/lib/module/surfaces/CloseButton.js.map +1 -1
- package/lib/module/surfaces/ModalSurface.js +52 -36
- package/lib/module/surfaces/ModalSurface.js.map +1 -1
- package/lib/module/surfaces/TooltipSurface.js +368 -90
- package/lib/module/surfaces/TooltipSurface.js.map +1 -1
- package/lib/module/surfaces/cardTransition.js +64 -0
- package/lib/module/surfaces/cardTransition.js.map +1 -0
- package/lib/module/surfaces/resolveHighlightChrome.js +102 -0
- package/lib/module/surfaces/resolveHighlightChrome.js.map +1 -0
- package/lib/module/surfaces/resolveModalLayout.js +7 -3
- package/lib/module/surfaces/resolveModalLayout.js.map +1 -1
- package/lib/module/surfaces/resolveTooltipLayout.js +1 -4
- package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -1
- package/lib/module/surfaces/surfaceInteractionConfig.js +27 -0
- package/lib/module/surfaces/surfaceInteractionConfig.js.map +1 -0
- package/lib/module/surfaces/surfaceLayoutInsets.js +119 -0
- package/lib/module/surfaces/surfaceLayoutInsets.js.map +1 -0
- package/lib/module/surfaces/themeChrome.js +3 -1
- package/lib/module/surfaces/themeChrome.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipBubble.js +143 -22
- package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipCutout.js +100 -47
- package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipHighlight.js +118 -0
- package/lib/module/surfaces/tooltip/TooltipHighlight.js.map +1 -0
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js +67 -13
- package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +87 -19
- package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
- package/lib/module/surfaces/tooltip/placementDiagnostics.js +43 -0
- package/lib/module/surfaces/tooltip/placementDiagnostics.js.map +1 -0
- package/lib/module/surfaces/tooltip/rect.js +11 -0
- package/lib/module/surfaces/tooltip/rect.js.map +1 -1
- package/lib/module/surfaces/tooltip/resolveSideCardWidth.js +96 -0
- package/lib/module/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +27 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +2 -0
- package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts +1 -1
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +14 -10
- package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
- package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +42 -1
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +42 -0
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts +17 -0
- package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +20 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +5 -5
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +48 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +7 -0
- package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts +11 -0
- package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts +20 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts +14 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +13 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
- package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
- package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
- package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +141 -0
- package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts +14 -0
- package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +59 -0
- package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +26 -0
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +31 -0
- package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +6 -1
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/themeColor.d.ts +5 -0
- package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/deviceContext.d.ts +66 -0
- package/lib/typescript/commonjs/src/deviceContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hostAppVersion.d.ts +69 -0
- package/lib/typescript/commonjs/src/hostAppVersion.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +53 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/lifecycle.d.ts +6 -0
- package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts +14 -0
- package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +7 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +6 -1
- package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +5 -0
- package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts +11 -0
- package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts +16 -0
- package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +2 -0
- package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +6 -3
- package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +20 -7
- package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +5 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +6 -4
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts +10 -0
- package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +12 -3
- package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +1 -0
- package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/screenTracker.d.ts +21 -3
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts +12 -0
- package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -2
- package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +12 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts +31 -0
- package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts +44 -0
- package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +0 -7
- package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
- package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +2 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +27 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +2 -0
- package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/autoAnchor.d.ts +1 -1
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +14 -10
- package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
- package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
- package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +42 -1
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +42 -0
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts +17 -0
- package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +20 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/hintsCodec.d.ts +1 -1
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +5 -5
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +48 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +7 -0
- package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts +11 -0
- package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts +20 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts +14 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +13 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
- package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
- package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
- package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +141 -0
- package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/doubleTap.d.ts +14 -0
- package/lib/typescript/module/src/authoring/doubleTap.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts +59 -0
- package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +26 -0
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
- package/lib/typescript/module/src/authoring/hitTest.d.ts +31 -0
- package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -0
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts +6 -1
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
- package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -1
- package/lib/typescript/module/src/content/themeColor.d.ts +5 -0
- package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
- package/lib/typescript/module/src/deviceContext.d.ts +66 -0
- package/lib/typescript/module/src/deviceContext.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/src/hostAppVersion.d.ts +69 -0
- package/lib/typescript/module/src/hostAppVersion.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +53 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/lifecycle.d.ts +6 -0
- package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts +14 -0
- package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts +7 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +6 -1
- package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/diagnostics.d.ts +5 -0
- package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts +11 -0
- package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts +16 -0
- package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts +2 -0
- package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +6 -3
- package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +20 -7
- package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +5 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +6 -4
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts +10 -0
- package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +12 -3
- package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +1 -0
- package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -1
- package/lib/typescript/module/src/screenTracker.d.ts +21 -3
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/CardFade.d.ts +12 -0
- package/lib/typescript/module/src/surfaces/CardFade.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -2
- package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +12 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/cardTransition.d.ts +31 -0
- package/lib/typescript/module/src/surfaces/cardTransition.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts +44 -0
- package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +0 -7
- package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
- package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
- package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
- package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
- package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
- package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
- package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
- package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +2 -0
- package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
- package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +32 -18
- package/src/anchors/AutoAnchorRegistry.ts +140 -3
- package/src/anchors/anchorChangeTicker.ts +10 -0
- package/src/anchors/autoAnchor.ts +1 -1
- package/src/anchors/elementConditionEvaluator.ts +29 -16
- package/src/anchors/fiber/FiberScanRoot.tsx +2 -50
- package/src/anchors/fiber/FiberScanRootStore.ts +51 -0
- package/src/anchors/fiber/fiberInternals.ts +166 -3
- package/src/anchors/fiber/indexHostFibers.ts +136 -0
- package/src/anchors/fiber/readHostContent.ts +146 -0
- package/src/anchors/fiberAnchorCache.ts +45 -0
- package/src/anchors/hintsCodec.ts +1 -1
- package/src/anchors/resolveAnchorHost.ts +23 -23
- package/src/anchors/resolveAutoAnchorHost.ts +180 -0
- package/src/anchors/semanticMatcher.ts +361 -0
- package/src/authoring/ElementPickerOverlay.tsx +553 -0
- package/src/authoring/capturePickerScreenshot.ts +90 -0
- package/src/authoring/chrome/ChromeBarTransition.tsx +106 -0
- package/src/authoring/chrome/ChromeBottomSheet.tsx +69 -0
- package/src/authoring/chrome/ChromeButton.tsx +103 -0
- package/src/authoring/chrome/ChromeDialog.tsx +121 -0
- package/src/authoring/chrome/ChromeIcon.tsx +40 -0
- package/src/authoring/chrome/ChromeTooltip.tsx +89 -0
- package/src/authoring/chrome/ChromeTopBar.tsx +126 -0
- package/src/authoring/chrome/DoubleTapBridge.tsx +60 -0
- package/src/authoring/chrome/doubleTapMonitor.ts +80 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
- package/src/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
- package/src/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
- package/src/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
- package/src/authoring/chrome/icons/xmark.png +0 -0
- package/src/authoring/chrome/icons/xmark@2x.png +0 -0
- package/src/authoring/chrome/icons/xmark@3x.png +0 -0
- package/src/authoring/chrome/tokens.ts +106 -0
- package/src/authoring/doubleTap.ts +27 -0
- package/src/authoring/elementPickerController.ts +135 -0
- package/src/authoring/fingerprintFromInstance.ts +152 -0
- package/src/authoring/hitTest.ts +133 -0
- package/src/content/RichContentRenderer.tsx +22 -1
- package/src/content/StepButton.tsx +17 -2
- package/src/content/resolveStepButtonChrome.ts +12 -6
- package/src/content/themeColor.ts +10 -0
- package/src/deviceContext.ts +168 -0
- package/src/expo-router/useUserflowExpoRouter.ts +47 -4
- package/src/hostAppVersion.ts +258 -0
- package/src/index.ts +148 -4
- package/src/lifecycle.ts +8 -0
- package/src/navigation/WithUserflowReactNavigation.tsx +23 -7
- package/src/navigation/isOverlayPresentation.ts +76 -0
- package/src/pairing/PairingController.ts +32 -3
- package/src/pairing/PreviewModeBanner.tsx +250 -94
- package/src/pairing/diagnostics.ts +10 -2
- package/src/pairing/elementPickerRelay.ts +100 -0
- package/src/pairing/resolvePreviewChrome.ts +57 -0
- package/src/pairing/tokenStorage.ts +31 -2
- package/src/pairing/usePairingState.ts +2 -0
- package/src/runtime/FlowRenderer.tsx +55 -27
- package/src/runtime/FlowSurfaceFade.tsx +51 -30
- package/src/runtime/TargetPressBridge.tsx +14 -32
- package/src/runtime/UserflowProvider.tsx +76 -13
- package/src/runtime/changedTouchPoints.ts +34 -0
- package/src/runtime/flowEngine.ts +2 -0
- package/src/runtime/flowSessionViewState.ts +42 -4
- package/src/runtime/useFlowSessionState.ts +2 -0
- package/src/screenTracker.ts +46 -4
- package/src/surfaces/CardFade.tsx +18 -0
- package/src/surfaces/CloseButton.tsx +17 -7
- package/src/surfaces/MadeWithUserflow.tsx +1 -1
- package/src/surfaces/ModalSurface.tsx +48 -35
- package/src/surfaces/TooltipSurface.tsx +406 -86
- package/src/surfaces/cardTransition.ts +67 -0
- package/src/surfaces/resolveHighlightChrome.ts +139 -0
- package/src/surfaces/resolveModalLayout.ts +16 -8
- package/src/surfaces/resolveTooltipLayout.ts +1 -14
- package/src/surfaces/surfaceInteractionConfig.ts +25 -0
- package/src/surfaces/surfaceLayoutInsets.tsx +135 -0
- package/src/surfaces/themeChrome.ts +5 -3
- package/src/surfaces/tooltip/TooltipBubble.tsx +154 -19
- package/src/surfaces/tooltip/TooltipCutout.tsx +106 -49
- package/src/surfaces/tooltip/TooltipHighlight.tsx +144 -0
- package/src/surfaces/tooltip/computeTooltipPosition.ts +98 -12
- package/src/surfaces/tooltip/inferTooltipPlacement.ts +107 -18
- package/src/surfaces/tooltip/placementDiagnostics.ts +70 -0
- package/src/surfaces/tooltip/rect.ts +11 -0
- package/src/surfaces/tooltip/resolveSideCardWidth.ts +121 -0
- package/src/version.ts +1 -1
- package/vendor/core/LICENSE +76 -0
- package/vendor/core/README.md +9 -0
- package/vendor/core/dist/attributes.d.ts +15 -0
- package/vendor/core/dist/attributes.d.ts.map +1 -0
- package/vendor/core/dist/attributes.js +55 -0
- package/vendor/core/dist/attributes.js.map +1 -0
- package/vendor/core/dist/constants.d.ts +21 -0
- package/vendor/core/dist/constants.d.ts.map +1 -0
- package/vendor/core/dist/constants.js +21 -0
- package/vendor/core/dist/constants.js.map +1 -0
- package/vendor/core/dist/engine/ClientConditionEngine.d.ts +68 -0
- package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/ClientConditionEngine.js +197 -0
- package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -0
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts +160 -0
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/FlowSessionEngine.js +571 -0
- package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -0
- package/vendor/core/dist/engine/PairingEngine.d.ts +135 -0
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -0
- package/vendor/core/dist/engine/PairingEngine.js +396 -0
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -0
- package/vendor/core/dist/engine/UserflowCore.d.ts +145 -0
- package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -0
- package/vendor/core/dist/engine/UserflowCore.js +329 -0
- package/vendor/core/dist/engine/UserflowCore.js.map +1 -0
- package/vendor/core/dist/engine/conditionOperators.d.ts +16 -0
- package/vendor/core/dist/engine/conditionOperators.d.ts.map +1 -0
- package/vendor/core/dist/engine/conditionOperators.js +168 -0
- package/vendor/core/dist/engine/conditionOperators.js.map +1 -0
- package/vendor/core/dist/engine/handleActions.d.ts +42 -0
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -0
- package/vendor/core/dist/engine/handleActions.js +198 -0
- package/vendor/core/dist/engine/handleActions.js.map +1 -0
- package/vendor/core/dist/engine/interpolateSessionData.d.ts +7 -0
- package/vendor/core/dist/engine/interpolateSessionData.d.ts.map +1 -0
- package/vendor/core/dist/engine/interpolateSessionData.js +29 -0
- package/vendor/core/dist/engine/interpolateSessionData.js.map +1 -0
- package/vendor/core/dist/engine/simpleObservable.d.ts +13 -0
- package/vendor/core/dist/engine/simpleObservable.d.ts.map +1 -0
- package/vendor/core/dist/engine/simpleObservable.js +29 -0
- package/vendor/core/dist/engine/simpleObservable.js.map +1 -0
- package/vendor/core/dist/engine/trackCondition.d.ts +25 -0
- package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -0
- package/vendor/core/dist/engine/trackCondition.js +177 -0
- package/vendor/core/dist/engine/trackCondition.js.map +1 -0
- package/vendor/core/dist/engine/trackStepTriggers.d.ts +21 -0
- package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -0
- package/vendor/core/dist/engine/trackStepTriggers.js +49 -0
- package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -0
- package/vendor/core/dist/errors.d.ts +9 -0
- package/vendor/core/dist/errors.d.ts.map +1 -0
- package/vendor/core/dist/errors.js +15 -0
- package/vendor/core/dist/errors.js.map +1 -0
- package/vendor/core/dist/eventAttributes.d.ts +7 -0
- package/vendor/core/dist/eventAttributes.d.ts.map +1 -0
- package/vendor/core/dist/eventAttributes.js +31 -0
- package/vendor/core/dist/eventAttributes.js.map +1 -0
- package/vendor/core/dist/index.d.ts +31 -0
- package/vendor/core/dist/index.d.ts.map +1 -0
- package/vendor/core/dist/index.js +22 -0
- package/vendor/core/dist/index.js.map +1 -0
- package/vendor/core/dist/normalizeAttributes.d.ts +8 -0
- package/vendor/core/dist/normalizeAttributes.d.ts.map +1 -0
- package/vendor/core/dist/normalizeAttributes.js +127 -0
- package/vendor/core/dist/normalizeAttributes.js.map +1 -0
- package/vendor/core/dist/transport/backoff.d.ts +11 -0
- package/vendor/core/dist/transport/backoff.d.ts.map +1 -0
- package/vendor/core/dist/transport/backoff.js +17 -0
- package/vendor/core/dist/transport/backoff.js.map +1 -0
- package/vendor/core/dist/transport/pairing.d.ts +121 -0
- package/vendor/core/dist/transport/pairing.d.ts.map +1 -0
- package/vendor/core/dist/transport/pairing.js +551 -0
- package/vendor/core/dist/transport/pairing.js.map +1 -0
- package/vendor/core/dist/transport/phoenix.d.ts +228 -0
- package/vendor/core/dist/transport/phoenix.d.ts.map +1 -0
- package/vendor/core/dist/transport/phoenix.js +811 -0
- package/vendor/core/dist/transport/phoenix.js.map +1 -0
- package/vendor/core/dist/transport/rateLimiter.d.ts +17 -0
- package/vendor/core/dist/transport/rateLimiter.d.ts.map +1 -0
- package/vendor/core/dist/transport/rateLimiter.js +30 -0
- package/vendor/core/dist/transport/rateLimiter.js.map +1 -0
- package/vendor/core/dist/transport/scheduler.d.ts +12 -0
- package/vendor/core/dist/transport/scheduler.d.ts.map +1 -0
- package/vendor/core/dist/transport/scheduler.js +11 -0
- package/vendor/core/dist/transport/scheduler.js.map +1 -0
- package/vendor/core/dist/types.d.ts +60 -0
- package/vendor/core/dist/types.d.ts.map +1 -0
- package/vendor/core/dist/types.js +2 -0
- package/vendor/core/dist/types.js.map +1 -0
- package/vendor/core/dist/version.d.ts +3 -0
- package/vendor/core/dist/version.d.ts.map +1 -0
- package/vendor/core/dist/version.js +3 -0
- package/vendor/core/dist/version.js.map +1 -0
- package/vendor/core/package.json +20 -0
- package/vendor/protocol/LICENSE +76 -0
- package/vendor/protocol/README.md +8 -0
- package/vendor/protocol/dist/attributes.d.ts +43 -0
- package/vendor/protocol/dist/attributes.d.ts.map +1 -0
- package/vendor/protocol/dist/attributes.js +15 -0
- package/vendor/protocol/dist/attributes.js.map +1 -0
- package/vendor/protocol/dist/autoData.d.ts +232 -0
- package/vendor/protocol/dist/autoData.d.ts.map +1 -0
- package/vendor/protocol/dist/autoData.js +78 -0
- package/vendor/protocol/dist/autoData.js.map +1 -0
- package/vendor/protocol/dist/events.d.ts +24 -0
- package/vendor/protocol/dist/events.d.ts.map +1 -0
- package/vendor/protocol/dist/events.js +8 -0
- package/vendor/protocol/dist/events.js.map +1 -0
- package/vendor/protocol/dist/flows.d.ts +360 -0
- package/vendor/protocol/dist/flows.d.ts.map +1 -0
- package/vendor/protocol/dist/flows.js +201 -0
- package/vendor/protocol/dist/flows.js.map +1 -0
- package/vendor/protocol/dist/index.d.ts +25 -0
- package/vendor/protocol/dist/index.d.ts.map +1 -0
- package/vendor/protocol/dist/index.js +17 -0
- package/vendor/protocol/dist/index.js.map +1 -0
- package/vendor/protocol/dist/messages.d.ts +187 -0
- package/vendor/protocol/dist/messages.d.ts.map +1 -0
- package/vendor/protocol/dist/messages.js +61 -0
- package/vendor/protocol/dist/messages.js.map +1 -0
- package/vendor/protocol/dist/pairing.d.ts +82 -0
- package/vendor/protocol/dist/pairing.d.ts.map +1 -0
- package/vendor/protocol/dist/pairing.js +146 -0
- package/vendor/protocol/dist/pairing.js.map +1 -0
- package/vendor/protocol/package.json +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_resolveHighlightChrome","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TooltipHighlight","targetRect","chrome","isHighlightVisible","rings","buildHighlightRings","length","jsx","View","pointerEvents","testID","children","map","ring","style","rect","width","height","inset","type","consumed","strokeWidth","frame","ringFrame","borderRadius","push","styles","borderWidth","borderColor","color","strokeGlow","radius","glowColor","blur","Math","max","glow","shadowColor","shadowOffset","shadowOpacity","min","opacity","shadowRadius","Platform","OS","boxShadow","alreadyConsumed","cornerRadius","top","left","nextWidth","nextHeight","outset","StyleSheet","create","position","backgroundColor","overflow"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/TooltipHighlight.tsx"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,uBAAA,GAAAF,OAAA;AAAqF,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAA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,GAAGoC,MAAM,GAAG,CAAC;IACzBnC,MAAM,EAAEA,MAAM,GAAGmC,MAAM,GAAG,CAAC;IAC3B5B,YAAY,EAAEuB,YAAY,GAAGK;EAC/B,CAAC;AACH;AAEA,MAAM1B,MAAM,GAAG2B,uBAAU,CAACC,MAAM,CAAC;EAC/BzC,IAAI,EAAE;IACJ0C,QAAQ,EAAE,UAAU;IACpBC,eAAe,EAAE,aAAa;IAC9BC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.computeTooltipPosition = computeTooltipPosition;
|
|
7
7
|
exports.tooltipNotchDiamondSide = tooltipNotchDiamondSide;
|
|
8
8
|
var _inferTooltipPlacement = require("./inferTooltipPlacement.js");
|
|
9
|
+
/** Pixel slack so a card that sits exactly on the target edge still counts. */
|
|
10
|
+
const ADJACENCY_EPSILON = 0.5;
|
|
11
|
+
function notchCanPointAtTarget(opts) {
|
|
12
|
+
if (opts.notchSize <= 0) return false;
|
|
13
|
+
const {
|
|
14
|
+
placement,
|
|
15
|
+
cx,
|
|
16
|
+
cy,
|
|
17
|
+
bw,
|
|
18
|
+
bh,
|
|
19
|
+
targetRect
|
|
20
|
+
} = opts;
|
|
21
|
+
const targetMidX = targetRect.left + (targetRect.right - targetRect.left) / 2;
|
|
22
|
+
const targetMidY = targetRect.top + (targetRect.bottom - targetRect.top) / 2;
|
|
23
|
+
const reachableX = targetMidX >= cx - ADJACENCY_EPSILON && targetMidX <= cx + bw + ADJACENCY_EPSILON;
|
|
24
|
+
const reachableY = targetMidY >= cy - ADJACENCY_EPSILON && targetMidY <= cy + bh + ADJACENCY_EPSILON;
|
|
25
|
+
switch (placement) {
|
|
26
|
+
case 'BELOW':
|
|
27
|
+
return cy + ADJACENCY_EPSILON >= targetRect.bottom && reachableX;
|
|
28
|
+
case 'ABOVE':
|
|
29
|
+
return cy + bh <= targetRect.top + ADJACENCY_EPSILON && reachableX;
|
|
30
|
+
case 'RIGHT':
|
|
31
|
+
return cx + ADJACENCY_EPSILON >= targetRect.right && reachableY;
|
|
32
|
+
case 'LEFT':
|
|
33
|
+
return cx + bw <= targetRect.left + ADJACENCY_EPSILON && reachableY;
|
|
34
|
+
default:
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function resolveViewportInsets(viewportPadding, viewportInsets) {
|
|
39
|
+
return {
|
|
40
|
+
top: viewportInsets?.top ?? viewportPadding,
|
|
41
|
+
right: viewportInsets?.right ?? viewportPadding,
|
|
42
|
+
bottom: viewportInsets?.bottom ?? viewportPadding,
|
|
43
|
+
left: viewportInsets?.left ?? viewportPadding
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
9
47
|
/**
|
|
10
48
|
* Side length of the axis-aligned square that, when rotated 45°, yields a
|
|
11
49
|
* tip that protrudes `notchSize` beyond the card edge (half-diagonal = N).
|
|
@@ -29,10 +67,12 @@ function computeTooltipPosition(opts) {
|
|
|
29
67
|
placement,
|
|
30
68
|
notchSize,
|
|
31
69
|
backdropPadding = 0,
|
|
70
|
+
outsideHighlightSpread = 0,
|
|
32
71
|
windowSize,
|
|
33
72
|
bubbleBorderRadius,
|
|
34
73
|
bubbleBorderWidth = 0,
|
|
35
|
-
viewportPadding = _inferTooltipPlacement.VIEWPORT_PADDING
|
|
74
|
+
viewportPadding = _inferTooltipPlacement.VIEWPORT_PADDING,
|
|
75
|
+
viewportInsets
|
|
36
76
|
} = opts;
|
|
37
77
|
const {
|
|
38
78
|
width: cw,
|
|
@@ -42,13 +82,15 @@ function computeTooltipPosition(opts) {
|
|
|
42
82
|
width: bw,
|
|
43
83
|
height: bh
|
|
44
84
|
} = bubbleSize;
|
|
85
|
+
const pad = resolveViewportInsets(viewportPadding, viewportInsets);
|
|
86
|
+
const placementPad = backdropPadding + outsideHighlightSpread;
|
|
45
87
|
const targetRect = {
|
|
46
|
-
top: target.y -
|
|
47
|
-
right: target.x + target.width +
|
|
48
|
-
bottom: target.y + target.height +
|
|
49
|
-
left: target.x -
|
|
50
|
-
width: target.width +
|
|
51
|
-
height: target.height +
|
|
88
|
+
top: target.y - placementPad,
|
|
89
|
+
right: target.x + target.width + placementPad,
|
|
90
|
+
bottom: target.y + target.height + placementPad,
|
|
91
|
+
left: target.x - placementPad,
|
|
92
|
+
width: target.width + placementPad * 2,
|
|
93
|
+
height: target.height + placementPad * 2
|
|
52
94
|
};
|
|
53
95
|
let cx = 0;
|
|
54
96
|
let cy = 0;
|
|
@@ -58,30 +100,33 @@ function computeTooltipPosition(opts) {
|
|
|
58
100
|
const edgeOffset = -half + Math.max(0, bubbleBorderWidth) + 1;
|
|
59
101
|
if (placement === 'BELOW' || placement === 'ABOVE') {
|
|
60
102
|
cx = targetRect.left + targetRect.width / 2 - bw / 2;
|
|
61
|
-
cx = Math.max(
|
|
103
|
+
cx = Math.max(pad.left, Math.min(cw - bw - pad.right, cx));
|
|
62
104
|
const rawLeft = targetRect.left + targetRect.width / 2 - half - cx;
|
|
63
105
|
notch.left = Math.max(bubbleBorderRadius, Math.min(bw - bubbleBorderRadius - side, rawLeft));
|
|
64
106
|
if (placement === 'BELOW') {
|
|
65
107
|
cy = targetRect.bottom + notchSize;
|
|
66
|
-
cy = Math.max(
|
|
108
|
+
cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
|
|
67
109
|
notch.top = edgeOffset;
|
|
68
110
|
} else {
|
|
69
111
|
cy = targetRect.top - notchSize - bh;
|
|
70
|
-
cy = Math.max(
|
|
112
|
+
cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
|
|
71
113
|
notch.bottom = edgeOffset;
|
|
72
114
|
}
|
|
73
115
|
} else {
|
|
74
116
|
cy = targetRect.top + targetRect.height / 2 - bh / 2;
|
|
75
|
-
cy = Math.max(
|
|
117
|
+
cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
|
|
76
118
|
const rawTop = targetRect.top + targetRect.height / 2 - half - cy;
|
|
77
119
|
notch.top = Math.max(bubbleBorderRadius, Math.min(bh - bubbleBorderRadius - side, rawTop));
|
|
120
|
+
|
|
121
|
+
// LEFT keeps pad.left; RIGHT used to min at notchSize, which sat inside the
|
|
122
|
+
// screen margin when the target was near the left edge.
|
|
78
123
|
if (placement === 'RIGHT') {
|
|
79
124
|
cx = targetRect.right + notchSize;
|
|
80
|
-
cx = Math.max(
|
|
125
|
+
cx = Math.max(pad.left, Math.min(cw - bw - pad.right, cx));
|
|
81
126
|
notch.left = edgeOffset;
|
|
82
127
|
} else {
|
|
83
128
|
cx = targetRect.left - notchSize - bw;
|
|
84
|
-
cx = Math.max(
|
|
129
|
+
cx = Math.max(pad.left, Math.min(cw - bw - notchSize, cx));
|
|
85
130
|
notch.right = edgeOffset;
|
|
86
131
|
}
|
|
87
132
|
}
|
|
@@ -91,6 +136,15 @@ function computeTooltipPosition(opts) {
|
|
|
91
136
|
y: cy
|
|
92
137
|
},
|
|
93
138
|
notchPosition: notch,
|
|
139
|
+
showNotch: notchCanPointAtTarget({
|
|
140
|
+
placement,
|
|
141
|
+
cx,
|
|
142
|
+
cy,
|
|
143
|
+
bw,
|
|
144
|
+
bh,
|
|
145
|
+
targetRect,
|
|
146
|
+
notchSize
|
|
147
|
+
}),
|
|
94
148
|
targetHighlightRect: {
|
|
95
149
|
top: target.y - backdropPadding,
|
|
96
150
|
left: target.x - backdropPadding,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_inferTooltipPlacement","require","
|
|
1
|
+
{"version":3,"names":["_inferTooltipPlacement","require","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","VIEWPORT_PADDING","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,IAAAA,sBAAA,GAAAC,OAAA;AA6BA;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,GAAG,CAACL,UAAU,CAACM,MAAM,GAAGN,UAAU,CAACK,GAAG,IAAI,CAAC;EAC5E,MAAME,UAAU,GACdN,UAAU,IAAIL,EAAE,GAAGL,iBAAiB,IAAIU,UAAU,IAAIL,EAAE,GAAGE,EAAE,GAAGP,iBAAiB;EACnF,MAAMiB,UAAU,GACdJ,UAAU,IAAIP,EAAE,GAAGN,iBAAiB,IAAIa,UAAU,IAAIP,EAAE,GAAGE,EAAE,GAAGR,iBAAiB;EAEnF,QAAQI,SAAS;IACf,KAAK,OAAO;MACV,OAAOE,EAAE,GAAGN,iBAAiB,IAAIS,UAAU,CAACM,MAAM,IAAIC,UAAU;IAClE,KAAK,OAAO;MACV,OAAOV,EAAE,GAAGE,EAAE,IAAIC,UAAU,CAACK,GAAG,GAAGd,iBAAiB,IAAIgB,UAAU;IACpE,KAAK,OAAO;MACV,OAAOX,EAAE,GAAGL,iBAAiB,IAAIS,UAAU,CAACG,KAAK,IAAIK,UAAU;IACjE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
|
});
|
|
6
6
|
exports.VIEWPORT_PADDING = void 0;
|
|
7
7
|
exports.inferTooltipPlacement = inferTooltipPlacement;
|
|
8
|
+
exports.tooltipPlacementFits = tooltipPlacementFits;
|
|
8
9
|
var _resolveTooltipLayout = require("../resolveTooltipLayout.js");
|
|
9
10
|
/** Placement sides — string union so Jest protocol mocks stay empty. */
|
|
10
11
|
|
|
11
12
|
const VIEWPORT_PADDING = exports.VIEWPORT_PADDING = _resolveTooltipLayout.TOOLTIP_VIEWPORT_PADDING;
|
|
12
13
|
|
|
14
|
+
/** Per-edge screen margin; each omitted edge falls back to `viewportPadding`. */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Whether `placement` has room beside `target` for `bubbleSize`.
|
|
18
|
+
*
|
|
19
|
+
* Inclusive: a card that exactly fills the remaining gap (LEFT/RIGHT after
|
|
20
|
+
* side-narrowing) still fits. Every side reserves the matching edge margin so
|
|
21
|
+
* this agrees with the clamp in `computeTooltipPosition`; when the two
|
|
22
|
+
* disagree, a placement passes here and is then drawn somewhere else.
|
|
23
|
+
*/
|
|
24
|
+
function tooltipPlacementFits({
|
|
25
|
+
target,
|
|
26
|
+
bubbleSize,
|
|
27
|
+
notchSize,
|
|
28
|
+
windowSize,
|
|
29
|
+
placement,
|
|
30
|
+
viewportPadding = VIEWPORT_PADDING,
|
|
31
|
+
viewportInsets,
|
|
32
|
+
minHeight
|
|
33
|
+
}) {
|
|
34
|
+
const {
|
|
35
|
+
width: cw,
|
|
36
|
+
height: ch
|
|
37
|
+
} = windowSize;
|
|
38
|
+
const {
|
|
39
|
+
width: bw,
|
|
40
|
+
height: bh
|
|
41
|
+
} = bubbleSize;
|
|
42
|
+
const clip = {
|
|
43
|
+
top: 0,
|
|
44
|
+
right: cw,
|
|
45
|
+
bottom: ch,
|
|
46
|
+
left: 0
|
|
47
|
+
};
|
|
48
|
+
const targetRect = {
|
|
49
|
+
top: target.y,
|
|
50
|
+
right: target.x + target.width,
|
|
51
|
+
bottom: target.y + target.height,
|
|
52
|
+
left: target.x,
|
|
53
|
+
width: target.width,
|
|
54
|
+
height: target.height
|
|
55
|
+
};
|
|
56
|
+
const midX = targetRect.left + targetRect.width / 2;
|
|
57
|
+
const midY = targetRect.top + targetRect.height / 2;
|
|
58
|
+
const midXIn = midX >= clip.left && midX <= clip.right;
|
|
59
|
+
const midYIn = midY >= clip.top && midY <= clip.bottom;
|
|
60
|
+
const verticalHeight = minHeight != null && Number.isFinite(minHeight) ? Math.min(bh, Math.max(0, minHeight)) : bh;
|
|
61
|
+
const padTop = viewportInsets?.top ?? viewportPadding;
|
|
62
|
+
const padRight = viewportInsets?.right ?? viewportPadding;
|
|
63
|
+
const padBottom = viewportInsets?.bottom ?? viewportPadding;
|
|
64
|
+
const padLeft = viewportInsets?.left ?? viewportPadding;
|
|
65
|
+
switch (placement) {
|
|
66
|
+
case 'BELOW':
|
|
67
|
+
return ch - targetRect.bottom >= verticalHeight + notchSize + padBottom && midXIn;
|
|
68
|
+
case 'ABOVE':
|
|
69
|
+
return targetRect.top >= verticalHeight + notchSize + padTop && midXIn;
|
|
70
|
+
case 'RIGHT':
|
|
71
|
+
return cw - targetRect.right >= bw + notchSize + padRight && midYIn;
|
|
72
|
+
case 'LEFT':
|
|
73
|
+
return targetRect.left >= bw + notchSize + padLeft && midYIn;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
13
79
|
/**
|
|
14
80
|
* Port of web FlowChrome `inferTooltipPlacement` with distance-sorted flip
|
|
15
81
|
* (not the prototype's fixed BELOW→ABOVE→RIGHT→LEFT priority).
|
|
82
|
+
*
|
|
83
|
+
* When no side fits, returns `desiredPlacement` (or BELOW) as a last resort —
|
|
84
|
+
* callers must check {@link tooltipPlacementFits} on the result to tell a real
|
|
85
|
+
* fit from that fallback.
|
|
16
86
|
*/
|
|
17
87
|
function inferTooltipPlacement({
|
|
18
88
|
target,
|
|
@@ -20,7 +90,10 @@ function inferTooltipPlacement({
|
|
|
20
90
|
notchSize,
|
|
21
91
|
windowSize,
|
|
22
92
|
currentPlacement,
|
|
23
|
-
desiredPlacement
|
|
93
|
+
desiredPlacement,
|
|
94
|
+
viewportPadding = VIEWPORT_PADDING,
|
|
95
|
+
viewportInsets,
|
|
96
|
+
minHeight
|
|
24
97
|
}) {
|
|
25
98
|
const {
|
|
26
99
|
width: cw,
|
|
@@ -56,24 +129,20 @@ function inferTooltipPlacement({
|
|
|
56
129
|
if (targetRect.left >= clip.right) {
|
|
57
130
|
return clip.right > bw + notchSize ? 'LEFT' : 'RIGHT';
|
|
58
131
|
}
|
|
59
|
-
const fits = p => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
default:
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
132
|
+
const fits = p => tooltipPlacementFits({
|
|
133
|
+
target,
|
|
134
|
+
bubbleSize,
|
|
135
|
+
notchSize,
|
|
136
|
+
windowSize,
|
|
137
|
+
placement: p,
|
|
138
|
+
viewportPadding,
|
|
139
|
+
...(viewportInsets != null ? {
|
|
140
|
+
viewportInsets
|
|
141
|
+
} : {}),
|
|
142
|
+
...(minHeight != null ? {
|
|
143
|
+
minHeight
|
|
144
|
+
} : {})
|
|
145
|
+
});
|
|
77
146
|
if (desiredPlacement && fits(desiredPlacement)) return desiredPlacement;
|
|
78
147
|
if (currentPlacement && fits(currentPlacement)) return currentPlacement;
|
|
79
148
|
const options = [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_resolveTooltipLayout","require","VIEWPORT_PADDING","exports","TOOLTIP_VIEWPORT_PADDING","
|
|
1
|
+
{"version":3,"names":["_resolveTooltipLayout","require","VIEWPORT_PADDING","exports","TOOLTIP_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":";;;;;;;;AAyBA,IAAAA,qBAAA,GAAAC,OAAA;AAzBA;;AA2BO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,8CAAwB;;AAExD;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAC;EACnCC,MAAM;EACNC,UAAU;EACVC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,eAAe,GAAGT,gBAAgB;EAClCU,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;EACvD,MAAMC,UAAU,GAAG;IACjBJ,GAAG,EAAEf,MAAM,CAACoB,CAAC;IACbJ,KAAK,EAAEhB,MAAM,CAACqB,CAAC,GAAGrB,MAAM,CAACQ,KAAK;IAC9BS,MAAM,EAAEjB,MAAM,CAACoB,CAAC,GAAGpB,MAAM,CAACU,MAAM;IAChCQ,IAAI,EAAElB,MAAM,CAACqB,CAAC;IACdb,KAAK,EAAER,MAAM,CAACQ,KAAK;IACnBE,MAAM,EAAEV,MAAM,CA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C,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,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultPlacementLogger = void 0;
|
|
7
|
+
exports.tooltipPlacementUnanchoredMessage = tooltipPlacementUnanchoredMessage;
|
|
8
|
+
exports.tooltipSidePlacementDroppedMessage = tooltipSidePlacementDroppedMessage;
|
|
9
|
+
exports.warnTooltipPlacementUnanchored = warnTooltipPlacementUnanchored;
|
|
10
|
+
exports.warnTooltipSidePlacementDropped = warnTooltipSidePlacementDropped;
|
|
11
|
+
const PREFIX = '[Userflow]';
|
|
12
|
+
|
|
13
|
+
/** Sink for placement diagnostics. Injected in tests. */
|
|
14
|
+
|
|
15
|
+
const defaultPlacementLogger = message => {
|
|
16
|
+
// eslint-disable-next-line no-console -- intentional development diagnostic
|
|
17
|
+
console.warn(message);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A Builder-requested LEFT/RIGHT side could not be drawn at all: the room
|
|
22
|
+
* beside the target is smaller than the card's own chrome, so no width is left
|
|
23
|
+
* to lay content out in. Draft/preview and `__DEV__` only.
|
|
24
|
+
*
|
|
25
|
+
* The caller must not emit this when the side was honored at a reduced width —
|
|
26
|
+
* shrinking is the expected outcome now, and whether it looks good is the
|
|
27
|
+
* author's call — nor for keyboard / off-screen vertical flips, whose cause is
|
|
28
|
+
* not the room beside the target.
|
|
29
|
+
*/
|
|
30
|
+
exports.defaultPlacementLogger = defaultPlacementLogger;
|
|
31
|
+
function tooltipSidePlacementDroppedMessage(opts) {
|
|
32
|
+
const gap = Number.isFinite(opts.availableGap) ? Math.max(0, Math.floor(opts.availableGap)) : 0;
|
|
33
|
+
const minWidth = Number.isFinite(opts.minWidth) ? Math.max(0, Math.ceil(opts.minWidth)) : 0;
|
|
34
|
+
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.`;
|
|
35
|
+
}
|
|
36
|
+
function warnTooltipSidePlacementDropped(opts, log = defaultPlacementLogger) {
|
|
37
|
+
log(tooltipSidePlacementDroppedMessage(opts));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* No side had room for the card — including the authored LEFT/RIGHT — so
|
|
42
|
+
* {@link inferTooltipPlacement} returned the requested side as a last resort.
|
|
43
|
+
* Draft/preview and `__DEV__` only. Distinct from
|
|
44
|
+
* {@link tooltipSidePlacementDroppedMessage}, which reports a successful flip.
|
|
45
|
+
*/
|
|
46
|
+
function tooltipPlacementUnanchoredMessage(opts) {
|
|
47
|
+
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.`;
|
|
48
|
+
}
|
|
49
|
+
function warnTooltipPlacementUnanchored(opts, log = defaultPlacementLogger) {
|
|
50
|
+
log(tooltipPlacementUnanchoredMessage(opts));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=placementDiagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PREFIX","defaultPlacementLogger","message","console","warn","exports","tooltipSidePlacementDroppedMessage","opts","gap","Number","isFinite","availableGap","Math","max","floor","minWidth","ceil","requested","used","warnTooltipSidePlacementDropped","log","tooltipPlacementUnanchoredMessage","warnTooltipPlacementUnanchored"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/placementDiagnostics.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;AAC9C","ignoreList":[]}
|
|
@@ -4,9 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.buildEffectiveViewport = buildEffectiveViewport;
|
|
7
|
+
exports.expandRect = expandRect;
|
|
7
8
|
exports.isRectFullyVisible = isRectFullyVisible;
|
|
8
9
|
exports.isRectOffScreen = isRectOffScreen;
|
|
9
10
|
exports.rectsEqual = rectsEqual;
|
|
11
|
+
/** Grow or shrink `rect` by `padding` on every side. */
|
|
12
|
+
function expandRect(rect, padding) {
|
|
13
|
+
if (padding === 0) return rect;
|
|
14
|
+
return {
|
|
15
|
+
x: rect.x - padding,
|
|
16
|
+
y: rect.y - padding,
|
|
17
|
+
width: rect.width + padding * 2,
|
|
18
|
+
height: rect.height + padding * 2
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
/** True when two rects are identical (used to avoid redundant setState). */
|
|
11
23
|
function rectsEqual(a, b) {
|
|
12
24
|
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;AACO,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;EA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DJ,IAAI,CAACG,CAAC,GAAGH,IAAI,CAACK,MAAM,IAAIO,QAAQ,CAACT,CAAC,GAAGS,QAAQ,CAACP,MAAM;AAExD;;AAEA;AACO,SAASQ,sBAAsBA,CACpCH,UAAsB,EACtBI,MAAyE,EACtD;EACnB,MAAMC,GAAG,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEC,GAAG,IAAI,CAAC,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,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resolveTooltipSideCardWidth = resolveTooltipSideCardWidth;
|
|
7
|
+
exports.tooltipMinCardHeight = tooltipMinCardHeight;
|
|
8
|
+
exports.tooltipMinSideCardWidth = tooltipMinSideCardWidth;
|
|
9
|
+
exports.tooltipSideGap = tooltipSideGap;
|
|
10
|
+
exports.tooltipVerticalGap = tooltipVerticalGap;
|
|
11
|
+
var _inferTooltipPlacement = require("./inferTooltipPlacement.js");
|
|
12
|
+
/**
|
|
13
|
+
* Narrowest a side card may get: the width it spends on its own chrome, so
|
|
14
|
+
* content padding on both edges plus the border. Below this there is nothing
|
|
15
|
+
* left to lay text out in, and React Native overflows the card instead of
|
|
16
|
+
* shrinking it — the preview would stop showing the author what ships.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately structural, not a readability judgment. How narrow is *too*
|
|
19
|
+
* narrow to read is the author's call, made against the device preview.
|
|
20
|
+
*/
|
|
21
|
+
function tooltipMinSideCardWidth(opts) {
|
|
22
|
+
const contentPadding = Number.isFinite(opts.contentPadding) ? Math.max(0, opts.contentPadding) : 0;
|
|
23
|
+
const borderWidth = opts.borderWidth != null && Number.isFinite(opts.borderWidth) ? Math.max(0, opts.borderWidth) : 0;
|
|
24
|
+
const chromeWidth = contentPadding * 2 + borderWidth * 2;
|
|
25
|
+
// Never demand more width than the card itself: a 40pt step card can still
|
|
26
|
+
// sit on the side even though its own padding would ask for more.
|
|
27
|
+
if (!Number.isFinite(opts.cardMaxWidth) || opts.cardMaxWidth <= 0) return chromeWidth;
|
|
28
|
+
return Math.min(chromeWidth, opts.cardMaxWidth);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Horizontal room beside an expanded target for a LEFT/RIGHT tooltip.
|
|
33
|
+
*
|
|
34
|
+
* Reserves `viewportPadding` on the screen edge the card grows toward, matching
|
|
35
|
+
* the LEFT/RIGHT clamp in `computeTooltipPosition`. Web clamps side placements
|
|
36
|
+
* to the raw edge instead; RN keeps the screen margin because an edge-to-edge
|
|
37
|
+
* card reads as broken on a phone-width viewport.
|
|
38
|
+
*/
|
|
39
|
+
function tooltipSideGap(opts) {
|
|
40
|
+
const {
|
|
41
|
+
placement,
|
|
42
|
+
target,
|
|
43
|
+
windowWidth,
|
|
44
|
+
notchSize,
|
|
45
|
+
viewportPadding = _inferTooltipPlacement.VIEWPORT_PADDING
|
|
46
|
+
} = opts;
|
|
47
|
+
if (placement === 'LEFT') {
|
|
48
|
+
return target.x - notchSize - viewportPadding;
|
|
49
|
+
}
|
|
50
|
+
return windowWidth - (target.x + target.width) - notchSize - viewportPadding;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Width a LEFT/RIGHT tooltip may use: the room beside the target, capped at the
|
|
55
|
+
* theme width. The card takes whatever is left and grows taller to compensate.
|
|
56
|
+
* Null when not even {@link tooltipMinSideCardWidth} fits, so placement falls
|
|
57
|
+
* back to the vertical flip.
|
|
58
|
+
*
|
|
59
|
+
* `target` must already be expanded by backdrop padding and outside highlight
|
|
60
|
+
* spread — the same rect passed to `inferTooltipPlacement`.
|
|
61
|
+
*/
|
|
62
|
+
function resolveTooltipSideCardWidth(opts) {
|
|
63
|
+
const gap = tooltipSideGap(opts);
|
|
64
|
+
const width = Math.min(opts.cardMaxWidth, Math.floor(gap));
|
|
65
|
+
if (!Number.isFinite(width) || width <= 0 || width < opts.minWidth) return null;
|
|
66
|
+
return width;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Shortest a card may get: the height it spends on its own chrome, so
|
|
71
|
+
* content padding on both edges plus the border. Mirrors
|
|
72
|
+
* {@link tooltipMinSideCardWidth} on the vertical axis.
|
|
73
|
+
*/
|
|
74
|
+
function tooltipMinCardHeight(opts) {
|
|
75
|
+
const contentPadding = Number.isFinite(opts.contentPadding) ? Math.max(0, opts.contentPadding) : 0;
|
|
76
|
+
const borderWidth = opts.borderWidth != null && Number.isFinite(opts.borderWidth) ? Math.max(0, opts.borderWidth) : 0;
|
|
77
|
+
const chromeHeight = contentPadding * 2 + borderWidth * 2;
|
|
78
|
+
if (!Number.isFinite(opts.cardMaxHeight) || opts.cardMaxHeight <= 0) return chromeHeight;
|
|
79
|
+
return Math.min(chromeHeight, opts.cardMaxHeight);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Vertical room above or below an expanded target for an ABOVE/BELOW tooltip.
|
|
84
|
+
*
|
|
85
|
+
* Reserves the matching viewport inset on the edge the card grows toward,
|
|
86
|
+
* matching the ABOVE/BELOW clamp in `computeTooltipPosition`.
|
|
87
|
+
*/
|
|
88
|
+
function tooltipVerticalGap(opts) {
|
|
89
|
+
const {
|
|
90
|
+
placement,
|
|
91
|
+
target,
|
|
92
|
+
windowHeight,
|
|
93
|
+
notchSize,
|
|
94
|
+
viewportPadding = _inferTooltipPlacement.VIEWPORT_PADDING
|
|
95
|
+
} = opts;
|
|
96
|
+
const top = opts.viewportInsets?.top ?? viewportPadding;
|
|
97
|
+
const bottom = opts.viewportInsets?.bottom ?? viewportPadding;
|
|
98
|
+
if (placement === 'ABOVE') {
|
|
99
|
+
return target.y - notchSize - top;
|
|
100
|
+
}
|
|
101
|
+
return windowHeight - (target.y + target.height) - notchSize - bottom;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=resolveSideCardWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_inferTooltipPlacement","require","tooltipMinSideCardWidth","opts","contentPadding","Number","isFinite","Math","max","borderWidth","chromeWidth","cardMaxWidth","min","tooltipSideGap","placement","target","windowWidth","notchSize","viewportPadding","VIEWPORT_PADDING","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,IAAAA,sBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAACC,IAIvC,EAAU;EACT,MAAMC,cAAc,GAAGC,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACC,cAAc,CAAC,GACvDG,IAAI,CAACC,GAAG,CAAC,CAAC,EAA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AAGjB,SAAS,GAAGc,GAAG;EACnC;EACA,OAAOD,YAAY,IAAIf,MAAM,CAACmB,CAAC,GAAGnB,MAAM,CAACoB,MAAM,CAAC,GAAGlB,SAAS,GAAGgB,MAAM;AACvE","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SDK_VERSION = void 0;
|
|
7
7
|
/** Generated by scripts/write-version.mjs — do not edit. */
|
|
8
|
-
const SDK_VERSION = exports.SDK_VERSION = '0.
|
|
8
|
+
const SDK_VERSION = exports.SDK_VERSION = '0.2.0';
|
|
9
9
|
//# sourceMappingURL=version.js.map
|