@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,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fiberScanRoot = void 0;
|
|
7
|
+
var _fiberInternals = require("./fiberInternals.js");
|
|
8
|
+
/**
|
|
9
|
+
* Module singleton holding the fiber under which testID / nativeID /
|
|
10
|
+
* accessibilityLabel scans run. Seeded by {@link FiberScanRoot}.
|
|
11
|
+
*/
|
|
12
|
+
class FiberScanRootStore {
|
|
13
|
+
instance = null;
|
|
14
|
+
listeners = new Set();
|
|
15
|
+
set(instance) {
|
|
16
|
+
this.instance = instance;
|
|
17
|
+
this.emit();
|
|
18
|
+
}
|
|
19
|
+
clear() {
|
|
20
|
+
this.instance = null;
|
|
21
|
+
this.emit();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Current (resolved) fiber under the scan root, or null when unmounted. */
|
|
25
|
+
getFiber() {
|
|
26
|
+
if (!this.instance) return null;
|
|
27
|
+
const fiber = (0, _fiberInternals.fiberFromPublicInstance)(this.instance);
|
|
28
|
+
if (!fiber) return null;
|
|
29
|
+
return (0, _fiberInternals.resolveCurrentFiber)(fiber);
|
|
30
|
+
}
|
|
31
|
+
subscribe(listener) {
|
|
32
|
+
this.listeners.add(listener);
|
|
33
|
+
return () => {
|
|
34
|
+
this.listeners.delete(listener);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Test helper. */
|
|
39
|
+
resetForTests() {
|
|
40
|
+
this.instance = null;
|
|
41
|
+
this.listeners.clear();
|
|
42
|
+
}
|
|
43
|
+
emit() {
|
|
44
|
+
for (const listener of this.listeners) {
|
|
45
|
+
listener();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const fiberScanRoot = exports.fiberScanRoot = new FiberScanRootStore();
|
|
50
|
+
//# sourceMappingURL=FiberScanRootStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fiberInternals","require","FiberScanRootStore","instance","listeners","Set","set","emit","clear","getFiber","fiber","fiberFromPublicInstance","resolveCurrentFiber","subscribe","listener","add","delete","resetForTests","fiberScanRoot","exports"],"sourceRoot":"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ty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MAX_ANCESTOR_WALK = void 0;
|
|
7
|
+
exports.coerceToFiber = coerceToFiber;
|
|
7
8
|
exports.fiberFromPublicInstance = fiberFromPublicInstance;
|
|
8
9
|
exports.getAlternate = getAlternate;
|
|
9
10
|
exports.getChild = getChild;
|
|
10
11
|
exports.getFiberTag = getFiberTag;
|
|
11
12
|
exports.getHostTypeName = getHostTypeName;
|
|
13
|
+
exports.getLiveHostProps = getLiveHostProps;
|
|
12
14
|
exports.getMemoizedProps = getMemoizedProps;
|
|
13
15
|
exports.getReturn = getReturn;
|
|
14
16
|
exports.getSibling = getSibling;
|
|
15
17
|
exports.getStateNode = getStateNode;
|
|
16
18
|
exports.isFiberMounted = isFiberMounted;
|
|
17
19
|
exports.isHostFiber = isHostFiber;
|
|
20
|
+
exports.isReactFiber = isReactFiber;
|
|
21
|
+
exports.nativeTagFromHostFiber = nativeTagFromHostFiber;
|
|
22
|
+
exports.nativeTagFromNode = nativeTagFromNode;
|
|
23
|
+
exports.publicInstanceFromHostFiber = publicInstanceFromHostFiber;
|
|
18
24
|
exports.resolveCurrentFiber = resolveCurrentFiber;
|
|
19
25
|
/**
|
|
20
26
|
* Compatibility layer for the React Native / React **internals** that
|
|
@@ -62,6 +68,136 @@ function getMemoizedProps(fiber) {
|
|
|
62
68
|
const p = fiber?.memoizedProps;
|
|
63
69
|
return p && typeof p === 'object' ? p : undefined;
|
|
64
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* React fiber `tag` values are a small enum (ClassComponent = 1,
|
|
74
|
+
* HostComponent = 5, HostText = 6, …). Generous ceiling so a future React tag
|
|
75
|
+
* is not rejected; note this bound alone proves nothing, because Fabric native
|
|
76
|
+
* view tags also start small (2, 4, 6, …). The structural and negative checks
|
|
77
|
+
* below are what actually discriminate.
|
|
78
|
+
*/
|
|
79
|
+
const MAX_REACT_FIBER_TAG = 60;
|
|
80
|
+
|
|
81
|
+
/** Fields only a fiber carries. */
|
|
82
|
+
const FIBER_STRUCTURAL_KEYS = ['child', 'return', 'sibling', 'stateNode', 'memoizedProps', 'alternate'];
|
|
83
|
+
|
|
84
|
+
/** Fields that mark a host node / public instance rather than a fiber. */
|
|
85
|
+
function looksLikeHostNode(value) {
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
+
const v = value;
|
|
88
|
+
return typeof v.__nativeTag === 'number' || typeof v._nativeTag === 'number' || '__viewConfig' in value || 'viewConfig' in value || 'node' in value && 'canonical' in value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* True when `value` looks like a JS React fiber, and not a Fabric shadow node,
|
|
93
|
+
* `stateNode`, or public instance. Never throws.
|
|
94
|
+
*
|
|
95
|
+
* Fabric on current RN stores the real fiber on `__internalInstanceHandle`, so
|
|
96
|
+
* this normally passes on the first try. It exists so a renderer that stores
|
|
97
|
+
* something else there degrades to the native-tag lookup instead of silently
|
|
98
|
+
* walking a non-fiber object and reading nothing.
|
|
99
|
+
*/
|
|
100
|
+
function isReactFiber(value) {
|
|
101
|
+
if (!value || typeof value !== 'object') return false;
|
|
102
|
+
try {
|
|
103
|
+
const tag = value.tag;
|
|
104
|
+
if (typeof tag !== 'number' || !Number.isInteger(tag) || tag < 0 || tag > MAX_REACT_FIBER_TAG) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
if (looksLikeHostNode(value)) return false;
|
|
108
|
+
return FIBER_STRUCTURAL_KEYS.some(key => key in value);
|
|
109
|
+
} catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* If `value` is a fiber, return it. If it is a host `stateNode` that carries a
|
|
116
|
+
* fiber (Fabric `{ node, canonical: { internalInstanceHandle } }`, or the older
|
|
117
|
+
* `canonical._internalInstanceHandle`), unwrap to the fiber.
|
|
118
|
+
*/
|
|
119
|
+
function coerceToFiber(value) {
|
|
120
|
+
if (isReactFiber(value)) return value;
|
|
121
|
+
if (!value || typeof value !== 'object') return null;
|
|
122
|
+
try {
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
124
|
+
const v = value;
|
|
125
|
+
const candidates = [v.canonical?.internalInstanceHandle, v.canonical?._internalInstanceHandle, v.internalInstanceHandle];
|
|
126
|
+
for (const candidate of candidates) {
|
|
127
|
+
if (isReactFiber(candidate)) return candidate;
|
|
128
|
+
}
|
|
129
|
+
} catch {
|
|
130
|
+
// Feature-detection must itself never throw.
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Native view tag on a public instance or host `stateNode`, across renderers:
|
|
137
|
+
*
|
|
138
|
+
* - `__nativeTag` — Fabric `ReactNativeElement` (RN 0.74+)
|
|
139
|
+
* - `_nativeTag` — Paper `ReactNativeFiberHostComponent`, older Fabric canonical
|
|
140
|
+
* - `canonical.nativeTag` / `canonical._nativeTag` — Fabric `stateNode`
|
|
141
|
+
*/
|
|
142
|
+
function nativeTagFromNode(value) {
|
|
143
|
+
if (!value || typeof value !== 'object') return undefined;
|
|
144
|
+
try {
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
146
|
+
const v = value;
|
|
147
|
+
const tag = v.__nativeTag ?? v._nativeTag ?? v.nativeTag ?? v.canonical?.nativeTag ?? v.canonical?._nativeTag;
|
|
148
|
+
if (typeof tag === 'number' && Number.isFinite(tag)) return tag;
|
|
149
|
+
} catch {
|
|
150
|
+
// Best-effort.
|
|
151
|
+
}
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
function nativeTagFromHostFiber(fiber) {
|
|
155
|
+
return nativeTagFromNode(getStateNode(fiber)) ?? nativeTagFromNode(fiber);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Public host instance for a host fiber, if one exists. Covers, in order:
|
|
160
|
+
* materialized Fabric `canonical.publicInstance`, the older Fabric
|
|
161
|
+
* `canonical` host component, and the Paper `stateNode` itself (which *is*
|
|
162
|
+
* the object an app `ref` receives).
|
|
163
|
+
*/
|
|
164
|
+
function publicInstanceFromHostFiber(fiber) {
|
|
165
|
+
try {
|
|
166
|
+
const node = getStateNode(fiber);
|
|
167
|
+
if (!node || typeof node !== 'object') return null;
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
|
+
const n = node;
|
|
170
|
+
const pub = n.canonical?.publicInstance;
|
|
171
|
+
if (pub && typeof pub === 'object') return pub;
|
|
172
|
+
const canonical = n.canonical;
|
|
173
|
+
if (canonical && typeof canonical === 'object' && nativeTagFromNode(canonical) !== undefined) {
|
|
174
|
+
return canonical;
|
|
175
|
+
}
|
|
176
|
+
if (typeof n.measureInWindow === 'function' || typeof n.measure === 'function' || nativeTagFromNode(n) !== undefined) {
|
|
177
|
+
return n;
|
|
178
|
+
}
|
|
179
|
+
} catch {
|
|
180
|
+
// Best-effort.
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Host props for content reads. Prefers `memoizedProps`; Fabric also keeps the
|
|
187
|
+
* last committed props on `stateNode.canonical.currentProps`.
|
|
188
|
+
*/
|
|
189
|
+
function getLiveHostProps(fiber) {
|
|
190
|
+
const memo = getMemoizedProps(fiber);
|
|
191
|
+
if (memo) return memo;
|
|
192
|
+
try {
|
|
193
|
+
const node = getStateNode(fiber);
|
|
194
|
+
const current = node?.canonical?.currentProps;
|
|
195
|
+
if (current && typeof current === 'object') return current;
|
|
196
|
+
} catch {
|
|
197
|
+
// Best-effort.
|
|
198
|
+
}
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
65
201
|
function getStateNode(fiber) {
|
|
66
202
|
return fiber?.stateNode ?? null;
|
|
67
203
|
}
|
|
@@ -109,16 +245,22 @@ const INSTANCE_FIBER_KEYS = ['_reactInternals',
|
|
|
109
245
|
'_internalInstanceHandle' // older Fabric / Paper bridge
|
|
110
246
|
];
|
|
111
247
|
|
|
112
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* Resolve a fiber from a class or host public instance. Returns null when
|
|
250
|
+
* unavailable, and also when the stored handle is a Fabric shadow node rather
|
|
251
|
+
* than a JS fiber (callers then look up by native tag under FiberScanRoot).
|
|
252
|
+
*/
|
|
113
253
|
function fiberFromPublicInstance(instance) {
|
|
114
254
|
if (!instance || typeof instance !== 'object') return null;
|
|
115
255
|
try {
|
|
116
256
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
257
|
const inst = instance;
|
|
118
258
|
for (const key of INSTANCE_FIBER_KEYS) {
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
259
|
+
const fiber = coerceToFiber(inst[key]);
|
|
260
|
+
if (fiber) return fiber;
|
|
121
261
|
}
|
|
262
|
+
const fromCanonical = coerceToFiber(inst.canonical?.internalInstanceHandle);
|
|
263
|
+
if (fromCanonical) return fromCanonical;
|
|
122
264
|
} catch {
|
|
123
265
|
// Feature-detection must itself never throw.
|
|
124
266
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HOST_COMPONENT_TAG","HOST_ROOT_TAG","MAX_ANCESTOR_WALK","exports","HOST_STATE_NODE_KEYS","getChild","fiber","child","getSibling","sibling","getReturn","return","getAlternate","alternate","getMemoizedProps","p","memoizedProps","undefined","
|
|
1
|
+
{"version":3,"names":["HOST_COMPONENT_TAG","HOST_ROOT_TAG","MAX_ANCESTOR_WALK","exports","HOST_STATE_NODE_KEYS","getChild","fiber","child","getSibling","sibling","getReturn","return","getAlternate","alternate","getMemoizedProps","p","memoizedProps","undefined","MAX_REACT_FIBER_TAG","FIBER_STRUCTURAL_KEYS","looksLikeHostNode","value","v","__nativeTag","_nativeTag","isReactFiber","tag","Number","isInteger","some","key","coerceToFiber","candidates","canonical","internalInstanceHandle","_internalInstanceHandle","candidate","nativeTagFromNode","nativeTag","isFinite","nativeTagFromHostFiber","getStateNode","publicInstanceFromHostFiber","node","n","pub","publicInstance","measureInWindow","measure","getLiveHostProps","memo","current","currentProps","stateNode","getFiberTag","t","getHostTypeName","type","isHostFiber","k","measureLayout","INSTANCE_FIBER_KEYS","fiberFromPublicInstance","instance","inst","fromCanonical","resolveCurrentFiber","cur","depth","rootState","currentRoot","isInTree","root","isFiberMounted"],"sourceRoot":"../../../../src","sources":["anchors/fiber/fiberInternals.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAGA;AACA,MAAMA,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,aAAa,GAAG,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,MAAM;;AAEvC;AACA,MAAME,oBAAoB,GAAG,CAC3B,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,yBAAyB,EACzB,MAAM,EACN,WAAW,CACH;AAEH,SAASC,QAAQA,CAACC,KAAe,EAAmB;EACzD,OAAOA,KAAK,EAAEC,KAAK,IAAI,IAAI;AAC7B;AAEO,SAASC,UAAUA,CAACF,KAAe,EAAmB;EAC3D,OAAOA,KAAK,EAAEG,OAAO,IAAI,IAAI;AAC/B;AAEO,SAASC,SAASA,CAACJ,KAAe,EAAmB;EAC1D,OAAOA,KAAK,EAAEK,MAAM,IAAI,IAAI;AAC9B;AAEO,SAASC,YAAYA,CAACN,KAAe,EAAmB;EAC7D,OAAOA,KAAK,EAAEO,SAAS,IAAI,IAAI;AACjC;AAEO,SAASC,gBAAgBA,CAACR,KAAe,EAAuC;EACrF,MAAMS,CAAC,GAAGT,KAAK,EAAEU,aAAa;EAC9B,OAAOD,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,GAAI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AAG,CAAC,EAAED,GAAG,IAAIC,KAAK,GAAGlE,iBAAiB,EAAEkE,KAAK,IAAI,CAAC,EAAE;IAChE,IAAID,GAAG,KAAKK,IAAI,EAAE,OAAO,IAAI;IAC7BL,GAAG,GAAGzD,SAAS,CAACyD,GAAG,CAAC;EACtB;EACA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACO,SAASM,cAAcA,CAACnE,KAAe,EAAW;EACvD,IAAI,CAACA,KAAK,EAAE,OAAO,KAAK;EACxB,IAAI;IACF,IAAIgD,WAAW,CAAChD,KAAK,CAAC,KAAKL,aAAa,EAAE,OAAO,IAAI;IACrD;IACA,OAAOS,SAAS,CAACJ,KAAK,CAAC,IAAI,IAAI;EACjC,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createHostFiberIndex = createHostFiberIndex;
|
|
7
|
+
exports.createLazyHostFiberIndex = createLazyHostFiberIndex;
|
|
8
|
+
exports.emptyHostFiberIndex = emptyHostFiberIndex;
|
|
9
|
+
exports.indexLiveHostFibers = indexLiveHostFibers;
|
|
10
|
+
exports.lookupHostFiber = lookupHostFiber;
|
|
11
|
+
var _FiberScanRootStore = require("./FiberScanRootStore.js");
|
|
12
|
+
var _fiberInternals = require("./fiberInternals.js");
|
|
13
|
+
/**
|
|
14
|
+
* Reverse index: public instance / native tag → host fiber.
|
|
15
|
+
*
|
|
16
|
+
* Renderers disagree on whether a host ref can reach its fiber at all:
|
|
17
|
+
*
|
|
18
|
+
* - Fabric (RN 0.74+) stores the fiber on `__internalInstanceHandle`, and
|
|
19
|
+
* older Fabric on `_internalInstanceHandle` — the direct pointer works.
|
|
20
|
+
* - Paper **release** builds null out `_internalFiberInstanceHandleDEV`, so a
|
|
21
|
+
* host ref has no route to its fiber at all.
|
|
22
|
+
*
|
|
23
|
+
* The index closes that gap: `FiberScanRoot` is a class component, and
|
|
24
|
+
* `_reactInternals` is present on class instances in every renderer and build
|
|
25
|
+
* type, so we can always walk down from there and match on native tag or
|
|
26
|
+
* instance identity. This is the version-independent path; the direct pointer
|
|
27
|
+
* is the fast path.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** Same bound as {@link findAnchorFiber} so a dense tree is fully indexed. */
|
|
31
|
+
const MAX_INDEX_NODES = 60_000;
|
|
32
|
+
function emptyHostFiberIndex() {
|
|
33
|
+
return {
|
|
34
|
+
byNativeTag: new Map(),
|
|
35
|
+
byInstance: new WeakMap()
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Walk `root`'s descendants (not `root.sibling`, so the Userflow overlay stays
|
|
41
|
+
* out of the index). First host fiber per native tag wins.
|
|
42
|
+
*/
|
|
43
|
+
function createHostFiberIndex(root) {
|
|
44
|
+
const index = emptyHostFiberIndex();
|
|
45
|
+
if (!root) return index;
|
|
46
|
+
try {
|
|
47
|
+
const stack = [root];
|
|
48
|
+
let visited = 0;
|
|
49
|
+
while (stack.length > 0 && visited < MAX_INDEX_NODES) {
|
|
50
|
+
const fiber = stack.pop();
|
|
51
|
+
if (!fiber) continue;
|
|
52
|
+
visited += 1;
|
|
53
|
+
if ((0, _fiberInternals.isHostFiber)(fiber)) {
|
|
54
|
+
const tag = (0, _fiberInternals.nativeTagFromHostFiber)(fiber);
|
|
55
|
+
if (tag !== undefined && !index.byNativeTag.has(tag)) {
|
|
56
|
+
index.byNativeTag.set(tag, fiber);
|
|
57
|
+
}
|
|
58
|
+
const pub = (0, _fiberInternals.publicInstanceFromHostFiber)(fiber);
|
|
59
|
+
if (pub) {
|
|
60
|
+
try {
|
|
61
|
+
index.byInstance.set(pub, fiber);
|
|
62
|
+
} catch {
|
|
63
|
+
// WeakMap rejects non-objects; ignore.
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (fiber !== root) {
|
|
68
|
+
const sibling = (0, _fiberInternals.getSibling)(fiber);
|
|
69
|
+
if (sibling) stack.push(sibling);
|
|
70
|
+
}
|
|
71
|
+
const child = (0, _fiberInternals.getChild)(fiber);
|
|
72
|
+
if (child) stack.push(child);
|
|
73
|
+
}
|
|
74
|
+
} catch {
|
|
75
|
+
// Best-effort — a partial index is still useful.
|
|
76
|
+
}
|
|
77
|
+
return index;
|
|
78
|
+
}
|
|
79
|
+
function indexLiveHostFibers() {
|
|
80
|
+
return createHostFiberIndex(_FiberScanRootStore.fiberScanRoot.getFiber());
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** An index, or a thunk that builds one on first use. */
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Defers the tree walk until something actually misses the direct pointer, and
|
|
87
|
+
* reuses the result for the rest of the pass. On renderers where refs reach
|
|
88
|
+
* their fiber (Fabric, Paper DEV) the walk never happens.
|
|
89
|
+
*/
|
|
90
|
+
function createLazyHostFiberIndex(build = indexLiveHostFibers) {
|
|
91
|
+
let cached = null;
|
|
92
|
+
return () => {
|
|
93
|
+
if (!cached) {
|
|
94
|
+
try {
|
|
95
|
+
cached = build();
|
|
96
|
+
} catch {
|
|
97
|
+
cached = emptyHostFiberIndex();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return cached;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Fiber for a public instance: direct pointer first, then the scan-root index
|
|
106
|
+
* by identity / native tag.
|
|
107
|
+
*/
|
|
108
|
+
function lookupHostFiber(index, instance) {
|
|
109
|
+
const direct = (0, _fiberInternals.fiberFromPublicInstance)(instance);
|
|
110
|
+
if (direct) {
|
|
111
|
+
try {
|
|
112
|
+
return (0, _fiberInternals.resolveCurrentFiber)(direct);
|
|
113
|
+
} catch {
|
|
114
|
+
return direct;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (!instance || typeof instance !== 'object') return null;
|
|
118
|
+
try {
|
|
119
|
+
const resolved = typeof index === 'function' ? index() : index;
|
|
120
|
+
const fromMap = resolved.byInstance.get(instance);
|
|
121
|
+
if (fromMap) return fromMap;
|
|
122
|
+
const tag = (0, _fiberInternals.nativeTagFromNode)(instance);
|
|
123
|
+
if (tag !== undefined) return resolved.byNativeTag.get(tag) ?? null;
|
|
124
|
+
} catch {
|
|
125
|
+
// Best-effort.
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=indexHostFibers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_FiberScanRootStore","require","_fiberInternals","MAX_INDEX_NODES","emptyHostFiberIndex","byNativeTag","Map","byInstance","WeakMap","createHostFiberIndex","root","index","stack","visited","length","fiber","pop","isHostFiber","tag","nativeTagFromHostFiber","undefined","has","set","pub","publicInstanceFromHostFiber","sibling","getSibling","push","child","getChild","indexLiveHostFibers","fiberScanRoot","getFiber","createLazyHostFiberIndex","build","cached","lookupHostFiber","instance","direct","fiberFromPublicInstance","resolveCurrentFiber","resolved","fromMap","get","nativeTagFromNode"],"sourceRoot":"../../../../src","sources":["anchors/fiber/indexHostFibers.ts"],"mappings":";;;;;;;;;;AAiBA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA,MAAME,eAAe,GAAG,MAAM;AAOvB,SAASC,mBAAmBA,CAAA,EAAmB;EACpD,OAAO;IAAEC,WAAW,EAAE,IAAIC,GAAG,CAAC,CAAC;IAAEC,UAAU,EAAE,IAAIC,OAAO,CAAC;EAAE,CAAC;AAC9D;;AAEA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAACC,IAAiC,EAAkB;EACtF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}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.readHostPlaceholder = readHostPlaceholder;
|
|
7
|
+
exports.readHostText = readHostText;
|
|
8
|
+
var _fiberInternals = require("./fiberInternals.js");
|
|
9
|
+
/**
|
|
10
|
+
* Live host-content reads from a public instance's fiber. Used at AUTO capture
|
|
11
|
+
* and match time so dynamic `{label}` / `{t(...)}` / `placeholder={…}` show up
|
|
12
|
+
* as `childText` even though Babel only stamps static literals.
|
|
13
|
+
*
|
|
14
|
+
* Same never-throws contract as the rest of the fiber layer.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** React reconciler `HostComponent` / `HostText` fiber tags. */
|
|
18
|
+
const HOST_COMPONENT_TAG = 5;
|
|
19
|
+
const HOST_TEXT_TAG = 6;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Mirrors Babel `childTextFromJsx` depth — but counted in **host** levels, not
|
|
23
|
+
* fibers. See {@link isHostLevel}.
|
|
24
|
+
*/
|
|
25
|
+
const DEFAULT_MAX_DEPTH = 4;
|
|
26
|
+
|
|
27
|
+
/** Soft cap so a dense subtree cannot stall the JS thread. */
|
|
28
|
+
const DEFAULT_MAX_NODES = 2_000;
|
|
29
|
+
function coerceText(value) {
|
|
30
|
+
if (typeof value === 'string') {
|
|
31
|
+
const trimmed = value.trim();
|
|
32
|
+
return trimmed || undefined;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
35
|
+
return String(value);
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Concatenate the string/number fragments of a split label, in order.
|
|
42
|
+
*
|
|
43
|
+
* `<Text>{count} items</Text>` reaches us as `[3, ' items']`. Keeping only the
|
|
44
|
+
* first fragment would record `3`, which digit-normalization then collapses to
|
|
45
|
+
* `#` — agreeing with every other numeric label and costing the fail-closed
|
|
46
|
+
* guarantee. Joining keeps `3 items`, which normalizes to `# items`. Fragments
|
|
47
|
+
* are concatenated raw so `['Hello, ', name, '!']` stays `Hello, Dan!`; only
|
|
48
|
+
* the result is trimmed. Non-text children (nested elements) are skipped.
|
|
49
|
+
*/
|
|
50
|
+
function joinTextFragments(children) {
|
|
51
|
+
let joined = '';
|
|
52
|
+
for (const child of children) {
|
|
53
|
+
if (typeof child === 'string') joined += child;else if (typeof child === 'number' && Number.isFinite(child)) joined += String(child);
|
|
54
|
+
}
|
|
55
|
+
return coerceText(joined);
|
|
56
|
+
}
|
|
57
|
+
function textFromMemoizedProps(fiber) {
|
|
58
|
+
// A HostText fiber (`tag === 6`) carries the string itself as its props.
|
|
59
|
+
const fromRaw = coerceText(fiber?.memoizedProps);
|
|
60
|
+
if (fromRaw) return fromRaw;
|
|
61
|
+
const props = (0, _fiberInternals.getLiveHostProps)(fiber) ?? (0, _fiberInternals.getMemoizedProps)(fiber);
|
|
62
|
+
if (!props) return undefined;
|
|
63
|
+
const fromChildren = coerceText(props.children);
|
|
64
|
+
if (fromChildren) return fromChildren;
|
|
65
|
+
if (Array.isArray(props.children)) {
|
|
66
|
+
const joined = joinTextFragments(props.children);
|
|
67
|
+
if (joined) return joined;
|
|
68
|
+
}
|
|
69
|
+
const fromText = coerceText(props.text);
|
|
70
|
+
if (fromText) return fromText;
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* First visible text under `fiber`, bounded by depth and node count. Reads a
|
|
76
|
+
* string/number `children` prop, the joined fragments of a split label, a
|
|
77
|
+
* native `text` prop, or the string a HostText fiber holds as its props.
|
|
78
|
+
*/
|
|
79
|
+
function readHostText(fiber, maxDepth = DEFAULT_MAX_DEPTH) {
|
|
80
|
+
try {
|
|
81
|
+
const budget = {
|
|
82
|
+
remaining: DEFAULT_MAX_NODES
|
|
83
|
+
};
|
|
84
|
+
return walkText(fiber, 0, maxDepth, budget);
|
|
85
|
+
} catch {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Only host fibers count toward depth.
|
|
92
|
+
*
|
|
93
|
+
* The JSX `<View><Text>{label}</Text></View>` that Babel sees as two levels is
|
|
94
|
+
* many more fibers at runtime: the composite, its `forwardRef` inner, context
|
|
95
|
+
* providers, then the native host and its text child. How many wrappers sit in
|
|
96
|
+
* between is an RN implementation detail that changes between versions, so
|
|
97
|
+
* counting fibers would make the depth limit mean something different on every
|
|
98
|
+
* release — and would cut the walk short before reaching the text. Counting
|
|
99
|
+
* host levels matches what Babel counted, on any RN version. The node budget,
|
|
100
|
+
* not the depth, is what bounds cost.
|
|
101
|
+
*/
|
|
102
|
+
function isHostLevel(fiber) {
|
|
103
|
+
const tag = (0, _fiberInternals.getFiberTag)(fiber);
|
|
104
|
+
if (tag === HOST_COMPONENT_TAG || tag === HOST_TEXT_TAG) return true;
|
|
105
|
+
return (0, _fiberInternals.isHostFiber)(fiber);
|
|
106
|
+
}
|
|
107
|
+
function walkText(fiber, depth, maxDepth, budget) {
|
|
108
|
+
if (!fiber || depth > maxDepth || budget.remaining <= 0) return undefined;
|
|
109
|
+
budget.remaining -= 1;
|
|
110
|
+
const own = textFromMemoizedProps(fiber);
|
|
111
|
+
if (own) return own;
|
|
112
|
+
let child = (0, _fiberInternals.getChild)(fiber);
|
|
113
|
+
while (child) {
|
|
114
|
+
const nextDepth = isHostLevel(child) ? depth + 1 : depth;
|
|
115
|
+
const found = walkText(child, nextDepth, maxDepth, budget);
|
|
116
|
+
if (found) return found;
|
|
117
|
+
child = (0, _fiberInternals.getSibling)(child);
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** `placeholder` on this fiber (TextInput). Does not walk descendants. */
|
|
123
|
+
function readHostPlaceholder(fiber) {
|
|
124
|
+
try {
|
|
125
|
+
const props = (0, _fiberInternals.getLiveHostProps)(fiber) ?? (0, _fiberInternals.getMemoizedProps)(fiber);
|
|
126
|
+
return coerceText(props?.placeholder);
|
|
127
|
+
} catch {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=readHostContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fiberInternals","require","HOST_COMPONENT_TAG","HOST_TEXT_TAG","DEFAULT_MAX_DEPTH","DEFAULT_MAX_NODES","coerceText","value","trimmed","trim","undefined","Number","isFinite","String","joinTextFragments","children","joined","child","textFromMemoizedProps","fiber","fromRaw","memoizedProps","props","getLiveHostProps","getMemoizedProps","fromChildren","Array","isArray","fromText","text","readHostText","maxDepth","budget","remaining","walkText","isHostLevel","tag","getFiberTag","isHostFiber","depth","own","getChild","nextDepth","found","getSibling","readHostPlaceholder","placeholder"],"sourceRoot":"../../../../src","sources":["anchors/fiber/readHostContent.ts"],"mappings":";;;;;;;AAQA,IAAAA,eAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA,MAAMC,kBAAkB,GAAG,CAAC;AAC5B,MAAMC,aAAa,GAAG,CAAC;;AAEvB;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,CAAC;;AAE3B;AACA,MAAMC,iBAAiB,GAAG,KAAK;AAE/B,SAASC,UAAUA,CAACC,KAAc,EAAsB;EACtD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAMC,OAAO,GAAGD,KAAK,CAACE,IAAI,CAAC,CAAC;IAC5B,OAAOD,OAAO,IAAIE,SAAS;EAC7B;EACA,IAAI,OAAOH,KAAK,KAAK,QAAQ,IAAII,MAAM,CAACC,QAAQ,CAACL,KAAK,CAAC,EAAE;IACvD,OAAOM,MAAM,CAACN,KAAK,CAAC;EACtB;EACA,OAAOG,S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AClB;;AAEA;AACO,SAASmC,mBAAmBA,CAAC1B,KAAe,EAAsB;EACvE,IAAI;IACF,MAAMG,KAAK,GAAG,IAAAC,gCAAgB,EAACJ,KAAK,CAAC,IAAI,IAAAK,gCAAgB,EAACL,KAAK,CAAC;IAChE,OAAOb,UAAU,CAACgB,KAAK,EAAEwB,WAAW,CAAC;EACvC,CAAC,CAAC,MAAM;IACN,OAAOpC,SAAS;EAClB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearFiberAnchorCache = clearFiberAnchorCache;
|
|
7
|
+
exports.deleteCachedFiberAnchor = deleteCachedFiberAnchor;
|
|
8
|
+
exports.getCachedFiberAnchor = getCachedFiberAnchor;
|
|
9
|
+
exports.getFiberAnchorScreenKey = getFiberAnchorScreenKey;
|
|
10
|
+
exports.invalidateFiberAnchor = invalidateFiberAnchor;
|
|
11
|
+
exports.notifyAnchorScreenChange = notifyAnchorScreenChange;
|
|
12
|
+
exports.setCachedFiberAnchor = setCachedFiberAnchor;
|
|
13
|
+
const fiberCache = new Map();
|
|
14
|
+
let currentScreenKey = null;
|
|
15
|
+
function getFiberAnchorScreenKey() {
|
|
16
|
+
return currentScreenKey;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Invalidate fiber-resolved anchors when the active screen changes. */
|
|
20
|
+
function notifyAnchorScreenChange(screenKey) {
|
|
21
|
+
if (screenKey === currentScreenKey) return;
|
|
22
|
+
currentScreenKey = screenKey;
|
|
23
|
+
fiberCache.clear();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Drop the fiber cache (preview restart / tests). */
|
|
27
|
+
function clearFiberAnchorCache() {
|
|
28
|
+
fiberCache.clear();
|
|
29
|
+
}
|
|
30
|
+
function getCachedFiberAnchor(id) {
|
|
31
|
+
return fiberCache.get(id);
|
|
32
|
+
}
|
|
33
|
+
function setCachedFiberAnchor(id, fiber) {
|
|
34
|
+
fiberCache.set(id, {
|
|
35
|
+
fiber,
|
|
36
|
+
screenKey: currentScreenKey
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function deleteCachedFiberAnchor(id) {
|
|
40
|
+
fiberCache.delete(id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Drop a cached fiber entry after a zero-size measure so the next resolve
|
|
45
|
+
* re-scans (the host may have remounted under a new fiber).
|
|
46
|
+
*/
|
|
47
|
+
function invalidateFiberAnchor(id) {
|
|
48
|
+
fiberCache.delete(id);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=fiberAnchorCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fiberCache","Map","currentScreenKey","getFiberAnchorScreenKey","notifyAnchorScreenChange","screenKey","clear","clearFiberAnchorCache","getCachedFiberAnchor","id","get","setCachedFiberAnchor","fiber","set","deleteCachedFiberAnchor","delete","invalidateFiberAnchor"],"sourceRoot":"../../../src","sources":["anchors/fiberAnchorCache.ts"],"mappings":";;;;;;;;;;;;AAOA,MAAMA,UAAU,GAAG,IAAIC,GAAG,CAA0B,CAAC;AACrD,IAAIC,gBAA+B,GAAG,IAAI;AAEnC,SAASC,uBAAuBA,CAAA,EAAkB;EACvD,OAAOD,gBAAgB;AACzB;;AAEA;AACO,SAASE,wBAAwBA,CAACC,SAAwB,EAAQ;EACvE,IAAIA,SAAS,KAAKH,gBAAgB,EAAE;EACpCA,gBAAgB,GAAGG,SAAS;EAC5BL,UAAU,CAACM,KAAK,CAAC,CAAC;AACpB;;AAEA;AACO,SAASC,qBAAqBA,CAAA,EAAS;EAC5CP,UAAU,CAACM,KAAK,CAAC,CAAC;AACpB;AAEO,SAASE,oBAAoBA,CAACC,EAAU,EAA+B;EAC5E,OAAOT,UAAU,CAACU,GAAG,CAACD,EAAE,CAAC;AAC3B;AAEO,SAASE,oBAAoBA,CAACF,EAAU,EAAEG,KAAe,EAAQ;EACtEZ,UAAU,CAACa,GAAG,CAACJ,EAAE,EAAE;IAAEG,KAAK;IAAEP,SAAS,EAAEH;EAAiB,CAAC,CAAC;AAC5D;AAEO,SAASY,uBAAuBA,CAACL,EAAU,EAAQ;EACxDT,UAAU,CAACe,MAAM,CAACN,EAAE,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACO,SAASO,qBAAqBA,CAACP,EAAU,EAAQ;EACtDT,UAAU,CAACe,MAAM,CAACN,EAAE,CAAC;AACvB","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ exports.parseAncestorsFromPath = parseAncestorsFromPath;
|
|
|
12
12
|
exports.parsePathSegment = parsePathSegment;
|
|
13
13
|
var _AutoAnchorRegistry = require("./AutoAnchorRegistry.js");
|
|
14
14
|
/**
|
|
15
|
-
* Compact build-time hints wire format (v1) emitted by `@userflow-tech/babel-plugin`.
|
|
15
|
+
* Compact build-time hints wire format (v1) emitted by `@userflow-tech/react-native/babel-plugin`.
|
|
16
16
|
* Expanded once at register time so the auto-anchor registry still sees full paths.
|
|
17
17
|
*/
|
|
18
18
|
const COMPACT_HINTS_VERSION = exports.COMPACT_HINTS_VERSION = 1;
|