@userflow-tech/react-native 0.1.1 → 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 +97 -61
- package/app.plugin.js +11 -1
- package/babel-plugin/index.d.ts +8 -8
- package/babel-plugin/index.d.ts.map +1 -1
- package/babel-plugin/index.js +17 -9
- package/babel-plugin/index.js.map +1 -1
- package/babel-plugin.js +13 -0
- package/docs/anchoring.md +141 -13
- package/docs/deep-linking.md +18 -15
- package/docs/theme-mapping.md +44 -15
- package/docs/troubleshooting.md +36 -29
- package/expo-plugin/withUserflow.js +1 -1
- package/expo-plugin/withUserflow.js.map +1 -1
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +124 -2
- 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/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/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 +9 -0
- 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 +125 -2
- 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/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/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 +8 -0
- 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 +26 -0
- 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/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/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 +26 -0
- 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/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/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 +22 -16
- package/src/anchors/AutoAnchorRegistry.ts +139 -2
- package/src/anchors/anchorChangeTicker.ts +10 -0
- 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/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 +8 -0
- 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/dist/attributes.d.ts +1 -2
- package/vendor/core/dist/attributes.d.ts.map +1 -1
- package/vendor/core/dist/attributes.js.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts +69 -1
- package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/FlowSessionEngine.js +268 -7
- package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts +44 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.js +103 -9
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.d.ts +23 -4
- package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
- package/vendor/core/dist/engine/UserflowCore.js +64 -1
- package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
- 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 +27 -4
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
- package/vendor/core/dist/engine/handleActions.js +140 -13
- package/vendor/core/dist/engine/handleActions.js.map +1 -1
- 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/index.d.ts +4 -3
- package/vendor/core/dist/index.d.ts.map +1 -1
- package/vendor/core/dist/index.js +2 -1
- package/vendor/core/dist/index.js.map +1 -1
- 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/phoenix.d.ts +11 -6
- package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
- package/vendor/core/dist/transport/phoenix.js +59 -5
- package/vendor/core/dist/transport/phoenix.js.map +1 -1
- package/vendor/core/dist/types.d.ts +26 -1
- package/vendor/core/dist/types.d.ts.map +1 -1
- package/vendor/core/dist/version.d.ts +1 -1
- package/vendor/core/dist/version.js +1 -1
- package/vendor/core/package.json +1 -1
- 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 +2 -2
- package/vendor/protocol/dist/autoData.js +2 -2
- package/vendor/protocol/dist/events.d.ts +8 -0
- package/vendor/protocol/dist/events.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.d.ts +66 -4
- package/vendor/protocol/dist/flows.d.ts.map +1 -1
- package/vendor/protocol/dist/flows.js +50 -3
- package/vendor/protocol/dist/flows.js.map +1 -1
- package/vendor/protocol/dist/index.d.ts +1 -0
- package/vendor/protocol/dist/index.d.ts.map +1 -1
- package/vendor/protocol/dist/index.js +1 -0
- package/vendor/protocol/dist/index.js.map +1 -1
- package/vendor/protocol/dist/messages.d.ts +25 -4
- package/vendor/protocol/dist/messages.d.ts.map +1 -1
- package/vendor/protocol/dist/messages.js +4 -0
- package/vendor/protocol/dist/messages.js.map +1 -1
- package/vendor/protocol/dist/pairing.d.ts +26 -0
- package/vendor/protocol/dist/pairing.d.ts.map +1 -1
- package/vendor/protocol/dist/pairing.js.map +1 -1
- package/vendor/protocol/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Rect } from './inferTooltipPlacement';
|
|
2
|
+
/**
|
|
3
|
+
* Narrowest a side card may get: the width it spends on its own chrome, so
|
|
4
|
+
* content padding on both edges plus the border. Below this there is nothing
|
|
5
|
+
* left to lay text out in, and React Native overflows the card instead of
|
|
6
|
+
* shrinking it — the preview would stop showing the author what ships.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately structural, not a readability judgment. How narrow is *too*
|
|
9
|
+
* narrow to read is the author's call, made against the device preview.
|
|
10
|
+
*/
|
|
11
|
+
export declare function tooltipMinSideCardWidth(opts: {
|
|
12
|
+
contentPadding: number;
|
|
13
|
+
borderWidth?: number;
|
|
14
|
+
cardMaxWidth: number;
|
|
15
|
+
}): number;
|
|
16
|
+
/**
|
|
17
|
+
* Horizontal room beside an expanded target for a LEFT/RIGHT tooltip.
|
|
18
|
+
*
|
|
19
|
+
* Reserves `viewportPadding` on the screen edge the card grows toward, matching
|
|
20
|
+
* the LEFT/RIGHT clamp in `computeTooltipPosition`. Web clamps side placements
|
|
21
|
+
* to the raw edge instead; RN keeps the screen margin because an edge-to-edge
|
|
22
|
+
* card reads as broken on a phone-width viewport.
|
|
23
|
+
*/
|
|
24
|
+
export declare function tooltipSideGap(opts: {
|
|
25
|
+
placement: 'LEFT' | 'RIGHT';
|
|
26
|
+
target: Rect;
|
|
27
|
+
windowWidth: number;
|
|
28
|
+
notchSize: number;
|
|
29
|
+
viewportPadding?: number;
|
|
30
|
+
}): number;
|
|
31
|
+
/**
|
|
32
|
+
* Width a LEFT/RIGHT tooltip may use: the room beside the target, capped at the
|
|
33
|
+
* theme width. The card takes whatever is left and grows taller to compensate.
|
|
34
|
+
* Null when not even {@link tooltipMinSideCardWidth} fits, so placement falls
|
|
35
|
+
* back to the vertical flip.
|
|
36
|
+
*
|
|
37
|
+
* `target` must already be expanded by backdrop padding and outside highlight
|
|
38
|
+
* spread — the same rect passed to `inferTooltipPlacement`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveTooltipSideCardWidth(opts: {
|
|
41
|
+
placement: 'LEFT' | 'RIGHT';
|
|
42
|
+
target: Rect;
|
|
43
|
+
windowWidth: number;
|
|
44
|
+
notchSize: number;
|
|
45
|
+
cardMaxWidth: number;
|
|
46
|
+
minWidth: number;
|
|
47
|
+
viewportPadding?: number;
|
|
48
|
+
}): number | null;
|
|
49
|
+
/**
|
|
50
|
+
* Shortest a card may get: the height it spends on its own chrome, so
|
|
51
|
+
* content padding on both edges plus the border. Mirrors
|
|
52
|
+
* {@link tooltipMinSideCardWidth} on the vertical axis.
|
|
53
|
+
*/
|
|
54
|
+
export declare function tooltipMinCardHeight(opts: {
|
|
55
|
+
contentPadding: number;
|
|
56
|
+
borderWidth?: number;
|
|
57
|
+
cardMaxHeight: number;
|
|
58
|
+
}): number;
|
|
59
|
+
/**
|
|
60
|
+
* Vertical room above or below an expanded target for an ABOVE/BELOW tooltip.
|
|
61
|
+
*
|
|
62
|
+
* Reserves the matching viewport inset on the edge the card grows toward,
|
|
63
|
+
* matching the ABOVE/BELOW clamp in `computeTooltipPosition`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function tooltipVerticalGap(opts: {
|
|
66
|
+
placement: 'ABOVE' | 'BELOW';
|
|
67
|
+
target: Rect;
|
|
68
|
+
windowHeight: number;
|
|
69
|
+
notchSize: number;
|
|
70
|
+
viewportPadding?: number;
|
|
71
|
+
viewportInsets?: {
|
|
72
|
+
top?: number;
|
|
73
|
+
bottom?: number;
|
|
74
|
+
};
|
|
75
|
+
}): number;
|
|
76
|
+
//# sourceMappingURL=resolveSideCardWidth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSideCardWidth.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/tooltip/resolveSideCardWidth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAaT;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,IAAI,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,CAMT;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,IAAI,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,GAAG,IAAI,CAKhB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAWT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD,GAAG,MAAM,CAQT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@userflow-tech/react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Userflow SDK for React Native — onboarding flows, tooltips, and modals.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -44,8 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"./babel-plugin": {
|
|
46
46
|
"types": "./babel-plugin/index.d.ts",
|
|
47
|
-
"default": "./babel-plugin
|
|
47
|
+
"default": "./babel-plugin.js"
|
|
48
48
|
},
|
|
49
|
+
"./app.plugin": "./app.plugin.js",
|
|
50
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
49
51
|
"./package.json": "./package.json"
|
|
50
52
|
},
|
|
51
53
|
"files": [
|
|
@@ -55,11 +57,22 @@
|
|
|
55
57
|
"vendor",
|
|
56
58
|
"expo-plugin",
|
|
57
59
|
"babel-plugin",
|
|
60
|
+
"babel-plugin.js",
|
|
58
61
|
"app.plugin.js",
|
|
59
62
|
"!**/__tests__",
|
|
60
63
|
"!**/*.test.*",
|
|
61
64
|
"LICENSE"
|
|
62
65
|
],
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "node ../../scripts/write-version.mjs SDK_VERSION && bob build",
|
|
68
|
+
"test": "jest",
|
|
69
|
+
"lint": "eslint src",
|
|
70
|
+
"typecheck": "tsc --noEmit",
|
|
71
|
+
"pretest": "node ../../scripts/write-version.mjs SDK_VERSION",
|
|
72
|
+
"prepack": "node ../../scripts/prepare-sdk-pack.mjs",
|
|
73
|
+
"postpack": "node ../../scripts/restore-sdk-pack.mjs",
|
|
74
|
+
"clean": "rimraf lib vendor expo-plugin babel-plugin"
|
|
75
|
+
},
|
|
63
76
|
"peerDependencies": {
|
|
64
77
|
"@react-native-community/netinfo": ">=11.0.0",
|
|
65
78
|
"@react-navigation/native": ">=6.0.0",
|
|
@@ -67,7 +80,8 @@
|
|
|
67
80
|
"expo-secure-store": ">=13.0.0",
|
|
68
81
|
"react": ">=18.2.0",
|
|
69
82
|
"react-native": ">=0.74.0",
|
|
70
|
-
"react-native-safe-area-context": ">=4.0.0"
|
|
83
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
84
|
+
"react-native-view-shot": ">=5.0.0"
|
|
71
85
|
},
|
|
72
86
|
"peerDependenciesMeta": {
|
|
73
87
|
"@react-native-community/netinfo": {
|
|
@@ -93,13 +107,14 @@
|
|
|
93
107
|
},
|
|
94
108
|
"devDependencies": {
|
|
95
109
|
"@babel/core": "^7.25.0",
|
|
96
|
-
"@react-native-async-storage/async-storage": "^2.1.2",
|
|
97
110
|
"@react-native-community/netinfo": "^11.4.1",
|
|
98
111
|
"@react-native/babel-preset": "^0.81.5",
|
|
99
112
|
"@react-navigation/native": "^7.1.6",
|
|
100
113
|
"@types/jest": "^29.5.12",
|
|
101
114
|
"@types/react": "~19.1.10",
|
|
102
115
|
"@types/react-test-renderer": "^19.1.0",
|
|
116
|
+
"@userflow-tech/eslint-config": "workspace:*",
|
|
117
|
+
"@userflow-tech/tsconfig": "workspace:*",
|
|
103
118
|
"babel-jest": "^29.7.0",
|
|
104
119
|
"expo-router": "^5.1.0",
|
|
105
120
|
"jest": "^29.7.0",
|
|
@@ -108,11 +123,10 @@
|
|
|
108
123
|
"react-native-builder-bob": "^0.30.0",
|
|
109
124
|
"react-native-safe-area-context": "~5.6.0",
|
|
110
125
|
"react-native-screens": "~4.16.0",
|
|
126
|
+
"react-native-view-shot": "^5.1.1",
|
|
111
127
|
"react-test-renderer": "19.1.0",
|
|
112
128
|
"rimraf": "^5.0.5",
|
|
113
|
-
"typescript": "^5.4.0"
|
|
114
|
-
"@userflow-tech/eslint-config": "0.0.0",
|
|
115
|
-
"@userflow-tech/tsconfig": "0.0.0"
|
|
129
|
+
"typescript": "^5.4.0"
|
|
116
130
|
},
|
|
117
131
|
"react-native-builder-bob": {
|
|
118
132
|
"source": "src",
|
|
@@ -140,13 +154,5 @@
|
|
|
140
154
|
},
|
|
141
155
|
"publishConfig": {
|
|
142
156
|
"access": "restricted"
|
|
143
|
-
},
|
|
144
|
-
"scripts": {
|
|
145
|
-
"build": "node ../../scripts/write-version.mjs SDK_VERSION && bob build",
|
|
146
|
-
"test": "jest",
|
|
147
|
-
"lint": "eslint src",
|
|
148
|
-
"typecheck": "tsc --noEmit",
|
|
149
|
-
"pretest": "node ../../scripts/write-version.mjs SDK_VERSION",
|
|
150
|
-
"clean": "rimraf lib vendor expo-plugin babel-plugin"
|
|
151
157
|
}
|
|
152
|
-
}
|
|
158
|
+
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { SemanticRole, SemanticSegment, SiblingDescriptor } from '@userflow-tech/protocol';
|
|
2
2
|
import type { MutableRefObject, RefObject } from 'react';
|
|
3
3
|
|
|
4
|
+
import { getLiveHostProps, type AnyFiber } from './fiber/fiberInternals';
|
|
5
|
+
import {
|
|
6
|
+
createLazyHostFiberIndex,
|
|
7
|
+
lookupHostFiber,
|
|
8
|
+
type HostFiberIndex,
|
|
9
|
+
} from './fiber/indexHostFibers';
|
|
10
|
+
import { readHostPlaceholder, readHostText } from './fiber/readHostContent';
|
|
11
|
+
|
|
4
12
|
/**
|
|
5
13
|
* Multi-instance auto-anchor registry for Stage 3.
|
|
6
14
|
*
|
|
@@ -113,11 +121,31 @@ function siblingGroupKey(inst: AutoAnchorInstance): string {
|
|
|
113
121
|
return idx === -1 ? path : path.slice(0, idx);
|
|
114
122
|
}
|
|
115
123
|
|
|
124
|
+
/**
|
|
125
|
+
* What an author can see that tells this instance apart from a lookalike.
|
|
126
|
+
* Same signals `deriveIdentityStrength` calls `content`. Undefined when the
|
|
127
|
+
* instance shows nothing of its own.
|
|
128
|
+
*/
|
|
129
|
+
function contentSignature(inst: AutoAnchorInstance): string | undefined {
|
|
130
|
+
const parts = [inst.childText, inst.accessibilityLabel, inst.iconName, inst.imageSrc].filter(
|
|
131
|
+
(part): part is string => !!part,
|
|
132
|
+
);
|
|
133
|
+
return parts.length > 0 ? parts.join('\u0000') : undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface LiveContentCache {
|
|
137
|
+
fiber: AnyFiber;
|
|
138
|
+
/** Props object identity — React replaces it on every render. */
|
|
139
|
+
props: Record<string, unknown> | undefined;
|
|
140
|
+
childText: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
116
143
|
export class AutoAnchorRegistry {
|
|
117
144
|
private readonly instances = new Map<string, AutoAnchorInstance>();
|
|
118
145
|
private readonly byRegistryKey = new Map<string, Set<string>>();
|
|
119
146
|
private readonly byManualId = new Map<string, Set<string>>();
|
|
120
147
|
private readonly byTemplatePath = new Map<string, Set<string>>();
|
|
148
|
+
private readonly liveContent = new Map<string, LiveContentCache>();
|
|
121
149
|
private readonly listeners = new Set<AutoAnchorListener>();
|
|
122
150
|
private notifyScheduled = false;
|
|
123
151
|
|
|
@@ -301,6 +329,97 @@ export class AutoAnchorRegistry {
|
|
|
301
329
|
};
|
|
302
330
|
}
|
|
303
331
|
|
|
332
|
+
/**
|
|
333
|
+
* Fill `childText` (and live `testID`) from the host fiber. Live content
|
|
334
|
+
* wins when readable; the build-time hint is the fallback.
|
|
335
|
+
*
|
|
336
|
+
* Direct fiber pointers are preferred; the scan-root index is built lazily
|
|
337
|
+
* and only if some instance cannot reach its fiber that way (Paper release
|
|
338
|
+
* builds, mainly), then reused for the rest of the pass.
|
|
339
|
+
*
|
|
340
|
+
* Silent — does not notify listeners.
|
|
341
|
+
*/
|
|
342
|
+
refreshLiveContent(instances?: AutoAnchorInstance[]): void {
|
|
343
|
+
const list = instances ?? this.allInstances();
|
|
344
|
+
const getIndex = createLazyHostFiberIndex();
|
|
345
|
+
const seen = new Set<string>();
|
|
346
|
+
for (const inst of list) {
|
|
347
|
+
if (seen.has(inst.instanceId)) continue;
|
|
348
|
+
seen.add(inst.instanceId);
|
|
349
|
+
this.refreshOneLiveContent(inst, getIndex);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
private refreshOneLiveContent(inst: AutoAnchorInstance, getIndex: () => HostFiberIndex): void {
|
|
354
|
+
let fiber: AnyFiber | null = null;
|
|
355
|
+
try {
|
|
356
|
+
fiber = lookupHostFiber(getIndex, inst.ref.current);
|
|
357
|
+
} catch {
|
|
358
|
+
fiber = null;
|
|
359
|
+
}
|
|
360
|
+
if (!fiber) return;
|
|
361
|
+
|
|
362
|
+
let props: Record<string, unknown> | undefined;
|
|
363
|
+
try {
|
|
364
|
+
props = getLiveHostProps(fiber);
|
|
365
|
+
} catch {
|
|
366
|
+
props = undefined;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const cached = this.liveContent.get(inst.instanceId);
|
|
370
|
+
// Same fiber and same props object means no re-render since the last read,
|
|
371
|
+
// so the subtree walk would return what we already have. Matters because
|
|
372
|
+
// resolution polls this for every registered instance.
|
|
373
|
+
if (cached && cached.fiber === fiber && props !== undefined && cached.props === props) {
|
|
374
|
+
inst.childText = cached.childText;
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (props) this.applyLiveIdentity(inst, props);
|
|
379
|
+
|
|
380
|
+
let live: string | undefined;
|
|
381
|
+
try {
|
|
382
|
+
live =
|
|
383
|
+
inst.role === 'Input'
|
|
384
|
+
? (readHostPlaceholder(fiber) ?? readHostText(fiber))
|
|
385
|
+
: readHostText(fiber);
|
|
386
|
+
} catch {
|
|
387
|
+
live = undefined;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (live) {
|
|
391
|
+
const changed = inst.childText !== live;
|
|
392
|
+
inst.childText = live;
|
|
393
|
+
this.liveContent.set(inst.instanceId, { fiber, props, childText: live });
|
|
394
|
+
// Text is what separates helper-rendered twins, so the group's ambiguity
|
|
395
|
+
// verdict is only trustworthy once it has been read.
|
|
396
|
+
if (changed) this.recomputeAmbiguity(inst.registryKey, inst.templatePath, inst.manualId);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (cached && cached.fiber !== fiber) {
|
|
400
|
+
this.liveContent.delete(inst.instanceId);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Copy `testID` off the live host so a shared `__userflowAutoAnchor` callback
|
|
406
|
+
* (helper-rendered rows) cannot pin every instance to the last render's bag.
|
|
407
|
+
* Silent — no listener notify.
|
|
408
|
+
*/
|
|
409
|
+
private applyLiveIdentity(inst: AutoAnchorInstance, props: Record<string, unknown>): void {
|
|
410
|
+
const raw = props.testID;
|
|
411
|
+
const liveTestID = typeof raw === 'string' && raw.trim() ? raw.trim() : undefined;
|
|
412
|
+
if (!liveTestID || liveTestID === inst.testID) return;
|
|
413
|
+
|
|
414
|
+
const prev = { manualId: inst.manualId, userflowId: inst.userflowId, testID: inst.testID };
|
|
415
|
+
inst.testID = liveTestID;
|
|
416
|
+
if (!inst.userflowId && (!inst.manualId || inst.manualId === prev.testID)) {
|
|
417
|
+
inst.manualId = liveTestID;
|
|
418
|
+
}
|
|
419
|
+
this.refreshManualIndexes(inst, prev);
|
|
420
|
+
this.recomputeAmbiguity(inst.registryKey, inst.templatePath, inst.manualId);
|
|
421
|
+
}
|
|
422
|
+
|
|
304
423
|
subscribe(listener: AutoAnchorListener): () => void {
|
|
305
424
|
this.listeners.add(listener);
|
|
306
425
|
return () => {
|
|
@@ -321,6 +440,7 @@ export class AutoAnchorRegistry {
|
|
|
321
440
|
this.byRegistryKey.clear();
|
|
322
441
|
this.byManualId.clear();
|
|
323
442
|
this.byTemplatePath.clear();
|
|
443
|
+
this.liveContent.clear();
|
|
324
444
|
this.notifyScheduled = false;
|
|
325
445
|
nextInstanceSeq = 1;
|
|
326
446
|
}
|
|
@@ -341,6 +461,7 @@ export class AutoAnchorRegistry {
|
|
|
341
461
|
}
|
|
342
462
|
|
|
343
463
|
this.instances.delete(instanceId);
|
|
464
|
+
this.liveContent.delete(instanceId);
|
|
344
465
|
this.removeIndex(this.byRegistryKey, inst.registryKey, instanceId);
|
|
345
466
|
this.removeIndex(this.byTemplatePath, inst.templatePath, instanceId);
|
|
346
467
|
if (inst.manualId) this.removeIndex(this.byManualId, inst.manualId, instanceId);
|
|
@@ -373,12 +494,28 @@ export class AutoAnchorRegistry {
|
|
|
373
494
|
}
|
|
374
495
|
}
|
|
375
496
|
|
|
497
|
+
/**
|
|
498
|
+
* Instances sharing a template path are only twins while they look alike.
|
|
499
|
+
* Four rows from one `field()` helper are indistinguishable at register time
|
|
500
|
+
* and separate once their labels are read, so ambiguity is decided on
|
|
501
|
+
* content, not on the shared path alone. An instance stays ambiguous when it
|
|
502
|
+
* carries no content of its own, or when a peer carries the same content.
|
|
503
|
+
*/
|
|
376
504
|
private recomputeAmbiguity(registryKey: string, templatePath: string, manualId?: string): void {
|
|
377
505
|
const mark = (list: AutoAnchorInstance[]) => {
|
|
378
|
-
const
|
|
506
|
+
const unlabelled = list.length > 1 && list.every((i) => !i.manualId);
|
|
507
|
+
const shared = new Map<string, number>();
|
|
508
|
+
if (unlabelled) {
|
|
509
|
+
for (const i of list) {
|
|
510
|
+
const sig = contentSignature(i);
|
|
511
|
+
if (sig) shared.set(sig, (shared.get(sig) ?? 0) + 1);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
379
514
|
for (const i of list) {
|
|
515
|
+
const sig = unlabelled ? contentSignature(i) : undefined;
|
|
516
|
+
const twins = unlabelled && (!sig || (shared.get(sig) ?? 0) > 1);
|
|
380
517
|
i.ambiguous =
|
|
381
|
-
|
|
518
|
+
twins || (i.manualId ? this.getInstancesByManualId(i.manualId).length > 1 : false);
|
|
382
519
|
}
|
|
383
520
|
};
|
|
384
521
|
mark(this.getInstancesByRegistryKey(registryKey));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { anchorRegistry } from './AnchorRegistry';
|
|
2
|
+
import { autoAnchorRegistry } from './AutoAnchorRegistry';
|
|
2
3
|
import { fiberScanRoot } from './fiber/FiberScanRoot';
|
|
3
4
|
|
|
4
5
|
type Listener = () => void;
|
|
@@ -9,6 +10,7 @@ type Listener = () => void;
|
|
|
9
10
|
* Fiber-resolved anchors (testID / nativeID / accessibilityLabel) do not emit
|
|
10
11
|
* registry events, so we combine:
|
|
11
12
|
* - {@link anchorRegistry} mount/unmount
|
|
13
|
+
* - {@link autoAnchorRegistry} mount/unmount
|
|
12
14
|
* - {@link fiberScanRoot} mount/unmount
|
|
13
15
|
* - screen-change notifications
|
|
14
16
|
* - a slow interval that only runs while at least one listener is subscribed
|
|
@@ -17,6 +19,7 @@ class AnchorChangeTicker {
|
|
|
17
19
|
private readonly listeners = new Set<Listener>();
|
|
18
20
|
private intervalHandle: ReturnType<typeof setInterval> | null = null;
|
|
19
21
|
private unsubRegistry: (() => void) | null = null;
|
|
22
|
+
private unsubAuto: (() => void) | null = null;
|
|
20
23
|
private unsubScan: (() => void) | null = null;
|
|
21
24
|
|
|
22
25
|
/** Poll interval while ELEMENT conditions are tracked (ms). */
|
|
@@ -51,6 +54,9 @@ class AnchorChangeTicker {
|
|
|
51
54
|
if (!this.unsubRegistry) {
|
|
52
55
|
this.unsubRegistry = anchorRegistry.subscribe(() => this.emit());
|
|
53
56
|
}
|
|
57
|
+
if (!this.unsubAuto) {
|
|
58
|
+
this.unsubAuto = autoAnchorRegistry.subscribe(() => this.emit());
|
|
59
|
+
}
|
|
54
60
|
if (!this.unsubScan) {
|
|
55
61
|
this.unsubScan = fiberScanRoot.subscribe(() => this.emit());
|
|
56
62
|
}
|
|
@@ -68,6 +74,10 @@ class AnchorChangeTicker {
|
|
|
68
74
|
this.unsubRegistry();
|
|
69
75
|
this.unsubRegistry = null;
|
|
70
76
|
}
|
|
77
|
+
if (this.unsubAuto) {
|
|
78
|
+
this.unsubAuto();
|
|
79
|
+
this.unsubAuto = null;
|
|
80
|
+
}
|
|
71
81
|
if (this.unsubScan) {
|
|
72
82
|
this.unsubScan();
|
|
73
83
|
this.unsubScan = null;
|
|
@@ -3,24 +3,29 @@ import type { FlowConditionFragment } from '@userflow-tech/protocol';
|
|
|
3
3
|
|
|
4
4
|
import { anchorChangeTicker } from './anchorChangeTicker';
|
|
5
5
|
import { resolveAnchorHost } from './resolveAnchorHost';
|
|
6
|
+
import { resolveAutoAnchorHost } from './resolveAutoAnchorHost';
|
|
6
7
|
import { resolveManualAnchorId } from './resolveManualAnchorId';
|
|
7
8
|
|
|
8
9
|
/** ELEMENT states the mobile SDK can evaluate today. */
|
|
9
10
|
const SUPPORTED_ELEMENT_STATES = new Set(['PRESENT', 'NOT_PRESENT']);
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
|
-
* Evaluate ELEMENT client conditions against manual anchors
|
|
13
|
-
* `testID` / `nativeID` / `accessibilityLabel` targets
|
|
13
|
+
* Evaluate ELEMENT client conditions against manual anchors, fiber-resolved
|
|
14
|
+
* `testID` / `nativeID` / `accessibilityLabel` targets, and AUTO (codeless)
|
|
15
|
+
* selectors.
|
|
14
16
|
*
|
|
15
|
-
* Supports PRESENT / NOT_PRESENT for MANUAL selectors (`css` → anchor id)
|
|
16
|
-
* AUTO
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Supports PRESENT / NOT_PRESENT for MANUAL selectors (`css` → anchor id) and
|
|
18
|
+
* AUTO selectors (`autoData` → {@link resolveAutoAnchorHost}). AUTO fails
|
|
19
|
+
* closed: `unknown` / `ambiguous` stay `null` so a gated flow never starts
|
|
20
|
+
* just because the auto-anchor registry is empty. Web-interaction states
|
|
21
|
+
* (CLICK, DISABLED, …) still report unknown.
|
|
19
22
|
*
|
|
20
|
-
* "Present" means
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
23
|
+
* "Present" means a unique host on a **visible** navigator screen. MANUAL
|
|
24
|
+
* goes through `resolveAnchorHost`; AUTO through `resolveAutoAnchorHost`.
|
|
25
|
+
* Both skip screens covered by another navigator screen, so an id on a
|
|
26
|
+
* pushed-under screen counts as absent. Pixel visibility (off-screen inside a
|
|
27
|
+
* ScrollView, opacity 0, etc.) would need async `measureInWindow` and is out
|
|
28
|
+
* of scope.
|
|
24
29
|
*
|
|
25
30
|
* Note: compares string literals rather than importing protocol enums so Jest
|
|
26
31
|
* (which cannot resolve the ESM-only `@userflow-tech/protocol` package) stays
|
|
@@ -78,12 +83,20 @@ function evaluateElementCondition(
|
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
if ((selector.type as string | null) === 'AUTO') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
const resolution = resolveAutoAnchorHost(selector.autoData);
|
|
87
|
+
if (resolution.status === 'unknown') {
|
|
88
|
+
warnOnce(
|
|
89
|
+
condition.id,
|
|
90
|
+
`[Userflow] ELEMENT condition ${condition.id} uses an AUTO (codeless) selector ` +
|
|
91
|
+
'that could not be resolved; leaving unknown',
|
|
92
|
+
);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
if (resolution.status === 'ambiguous') {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const present = resolution.status === 'found';
|
|
99
|
+
return elementState === 'PRESENT' ? present : !present;
|
|
87
100
|
}
|
|
88
101
|
|
|
89
102
|
const anchorId = resolveManualAnchorId(selector.css);
|
|
@@ -1,57 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { fiberScanRoot } from './FiberScanRootStore';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Module singleton holding the fiber under which testID / nativeID /
|
|
10
|
-
* accessibilityLabel scans run. Seeded by {@link FiberScanRoot}.
|
|
11
|
-
*/
|
|
12
|
-
class FiberScanRootStore {
|
|
13
|
-
private instance: unknown = null;
|
|
14
|
-
private readonly listeners = new Set<Listener>();
|
|
15
|
-
|
|
16
|
-
set(instance: unknown): void {
|
|
17
|
-
this.instance = instance;
|
|
18
|
-
this.emit();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
clear(): void {
|
|
22
|
-
this.instance = null;
|
|
23
|
-
this.emit();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Current (resolved) fiber under the scan root, or null when unmounted. */
|
|
27
|
-
getFiber(): AnyFiber | null {
|
|
28
|
-
if (!this.instance) return null;
|
|
29
|
-
const fiber = fiberFromPublicInstance(this.instance);
|
|
30
|
-
if (!fiber) return null;
|
|
31
|
-
return resolveCurrentFiber(fiber);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
subscribe(listener: Listener): () => void {
|
|
35
|
-
this.listeners.add(listener);
|
|
36
|
-
return () => {
|
|
37
|
-
this.listeners.delete(listener);
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Test helper. */
|
|
42
|
-
resetForTests(): void {
|
|
43
|
-
this.instance = null;
|
|
44
|
-
this.listeners.clear();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private emit(): void {
|
|
48
|
-
for (const listener of this.listeners) {
|
|
49
|
-
listener();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const fiberScanRoot = new FiberScanRootStore();
|
|
6
|
+
export { fiberScanRoot } from './FiberScanRootStore';
|
|
55
7
|
|
|
56
8
|
export interface FiberScanRootProps {
|
|
57
9
|
children: React.ReactNode;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type AnyFiber, fiberFromPublicInstance, resolveCurrentFiber } from './fiberInternals';
|
|
2
|
+
|
|
3
|
+
type Listener = () => void;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Module singleton holding the fiber under which testID / nativeID /
|
|
7
|
+
* accessibilityLabel scans run. Seeded by {@link FiberScanRoot}.
|
|
8
|
+
*/
|
|
9
|
+
class FiberScanRootStore {
|
|
10
|
+
private instance: unknown = null;
|
|
11
|
+
private readonly listeners = new Set<Listener>();
|
|
12
|
+
|
|
13
|
+
set(instance: unknown): void {
|
|
14
|
+
this.instance = instance;
|
|
15
|
+
this.emit();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
clear(): void {
|
|
19
|
+
this.instance = null;
|
|
20
|
+
this.emit();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Current (resolved) fiber under the scan root, or null when unmounted. */
|
|
24
|
+
getFiber(): AnyFiber | null {
|
|
25
|
+
if (!this.instance) return null;
|
|
26
|
+
const fiber = fiberFromPublicInstance(this.instance);
|
|
27
|
+
if (!fiber) return null;
|
|
28
|
+
return resolveCurrentFiber(fiber);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
subscribe(listener: Listener): () => void {
|
|
32
|
+
this.listeners.add(listener);
|
|
33
|
+
return () => {
|
|
34
|
+
this.listeners.delete(listener);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Test helper. */
|
|
39
|
+
resetForTests(): void {
|
|
40
|
+
this.instance = null;
|
|
41
|
+
this.listeners.clear();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private emit(): void {
|
|
45
|
+
for (const listener of this.listeners) {
|
|
46
|
+
listener();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const fiberScanRoot = new FiberScanRootStore();
|