@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,862 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.default = userflowAutoStamp;
|
|
37
|
+
const nodePath = __importStar(require("node:path"));
|
|
38
|
+
/**
|
|
39
|
+
* @userflow-tech/react-native/babel-plugin — semantic auto-stamp + auto-register (rn-v2).
|
|
40
|
+
*
|
|
41
|
+
* Stamps allowlisted host elements with:
|
|
42
|
+
* 1. Canonical structural path where explicit IDs replace ordinals
|
|
43
|
+
* 2. Compact hints wire (v1: n/p/ct/…) expanded at runtime
|
|
44
|
+
* 3. Runtime bag (dynamic ids/labels + inherited `__ufScope` when captured)
|
|
45
|
+
* 4. Call-site `__ufScope` on first-party custom components
|
|
46
|
+
*
|
|
47
|
+
* Full mode (the default) also injects `__userflowAutoAnchor`, a `__ufRef`
|
|
48
|
+
* helper, ref wrapping, and `__ufScope` capture so scored AUTO matching can
|
|
49
|
+
* populate the auto-anchor registry. Set `stampOnly: true` to stamp only
|
|
50
|
+
* `nativeID` and `collapsable` — enough for the fiber scanner, but the
|
|
51
|
+
* in-app picker and scored AUTO matches stay empty.
|
|
52
|
+
*
|
|
53
|
+
* Existing app props are composed, never replaced: `ref` (callback, object,
|
|
54
|
+
* legacy string, or single `{...props}.ref`), `nativeID`, and `collapsable`
|
|
55
|
+
* are preserved when the developer already set them.
|
|
56
|
+
*/
|
|
57
|
+
const STRUCTURAL_PATH_MAX_DEPTH = 12;
|
|
58
|
+
const DEFAULT_ALLOWLIST = [
|
|
59
|
+
'Pressable',
|
|
60
|
+
'TouchableOpacity',
|
|
61
|
+
'TouchableHighlight',
|
|
62
|
+
'TouchableWithoutFeedback',
|
|
63
|
+
'TouchableNativeFeedback',
|
|
64
|
+
'View',
|
|
65
|
+
'Text',
|
|
66
|
+
'TextInput',
|
|
67
|
+
'Image',
|
|
68
|
+
];
|
|
69
|
+
const COLLAPSABLE_NAMES = new Set([
|
|
70
|
+
'Pressable',
|
|
71
|
+
'TouchableOpacity',
|
|
72
|
+
'TouchableHighlight',
|
|
73
|
+
'TouchableWithoutFeedback',
|
|
74
|
+
'TouchableNativeFeedback',
|
|
75
|
+
'View',
|
|
76
|
+
'Text',
|
|
77
|
+
]);
|
|
78
|
+
const MANUAL_ID_ATTRS = ['userflowId', 'testID', 'nativeID'];
|
|
79
|
+
const REF_HELPER = '__ufRef';
|
|
80
|
+
const UFID_PROP = '__ufid';
|
|
81
|
+
const UF_MANUAL_PROP = '__ufManual';
|
|
82
|
+
const UF_SCOPE_PROP = '__ufScope';
|
|
83
|
+
function hashId(input) {
|
|
84
|
+
let h = 5381;
|
|
85
|
+
for (let i = 0; i < input.length; i += 1) {
|
|
86
|
+
h = (h * 33) ^ input.charCodeAt(i);
|
|
87
|
+
}
|
|
88
|
+
return (h >>> 0).toString(36);
|
|
89
|
+
}
|
|
90
|
+
function stringLiteralFromJsxAttr(t, attr) {
|
|
91
|
+
if (!attr?.value)
|
|
92
|
+
return undefined;
|
|
93
|
+
if (t.isStringLiteral(attr.value))
|
|
94
|
+
return attr.value.value;
|
|
95
|
+
if (t.isJSXExpressionContainer(attr.value) && t.isStringLiteral(attr.value.expression)) {
|
|
96
|
+
return attr.value.expression.value;
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
function expressionFromJsxAttr(t, attr) {
|
|
101
|
+
if (!attr?.value)
|
|
102
|
+
return undefined;
|
|
103
|
+
if (t.isStringLiteral(attr.value))
|
|
104
|
+
return t.stringLiteral(attr.value.value);
|
|
105
|
+
if (t.isJSXExpressionContainer(attr.value) && t.isExpression(attr.value.expression)) {
|
|
106
|
+
return t.cloneNode(attr.value.expression);
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
function firstStaticStringInJsx(t, node, depth = 0) {
|
|
111
|
+
if (!node || depth > 4)
|
|
112
|
+
return undefined;
|
|
113
|
+
if (t.isStringLiteral(node)) {
|
|
114
|
+
const s = node.value.trim();
|
|
115
|
+
return s || undefined;
|
|
116
|
+
}
|
|
117
|
+
if (t.isJSXText(node)) {
|
|
118
|
+
const s = node.value.replace(/\s+/g, ' ').trim();
|
|
119
|
+
return s || undefined;
|
|
120
|
+
}
|
|
121
|
+
if (t.isJSXExpressionContainer(node) && t.isStringLiteral(node.expression)) {
|
|
122
|
+
const s = node.expression.value.trim();
|
|
123
|
+
return s || undefined;
|
|
124
|
+
}
|
|
125
|
+
if (t.isJSXFragment(node)) {
|
|
126
|
+
for (const child of node.children) {
|
|
127
|
+
const found = firstStaticStringInJsx(t, child, depth + 1);
|
|
128
|
+
if (found)
|
|
129
|
+
return found;
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
if (t.isJSXElement(node)) {
|
|
134
|
+
for (const child of node.children) {
|
|
135
|
+
if (t.isJSXElement(child) || t.isJSXText(child) || t.isJSXExpressionContainer(child)) {
|
|
136
|
+
const found = firstStaticStringInJsx(t, child, depth + 1);
|
|
137
|
+
if (found)
|
|
138
|
+
return found;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
function jsxElementTypeName(t, el) {
|
|
145
|
+
const n = el.openingElement.name;
|
|
146
|
+
return t.isJSXIdentifier(n) ? n.name : undefined;
|
|
147
|
+
}
|
|
148
|
+
function directChildShape(t, el) {
|
|
149
|
+
const name = jsxElementTypeName(t, el);
|
|
150
|
+
if (!name)
|
|
151
|
+
return undefined;
|
|
152
|
+
const nested = el.children.filter((c) => t.isJSXElement(c));
|
|
153
|
+
const onlyChild = nested.length === 1 ? nested[0] : undefined;
|
|
154
|
+
if (onlyChild) {
|
|
155
|
+
const inner = jsxElementTypeName(t, onlyChild);
|
|
156
|
+
if (inner)
|
|
157
|
+
return `${name}>${inner}`;
|
|
158
|
+
}
|
|
159
|
+
return name;
|
|
160
|
+
}
|
|
161
|
+
function childShapeFromJsx(t, openingPath) {
|
|
162
|
+
const parent = openingPath.parentPath;
|
|
163
|
+
if (!parent?.isJSXElement())
|
|
164
|
+
return undefined;
|
|
165
|
+
const segments = [];
|
|
166
|
+
for (const child of parent.node.children) {
|
|
167
|
+
if (!t.isJSXElement(child))
|
|
168
|
+
continue;
|
|
169
|
+
const seg = directChildShape(t, child);
|
|
170
|
+
if (seg)
|
|
171
|
+
segments.push(seg);
|
|
172
|
+
}
|
|
173
|
+
return segments.length > 0 ? segments.join(',') : undefined;
|
|
174
|
+
}
|
|
175
|
+
function childTextFromJsx(t, openingPath) {
|
|
176
|
+
const parent = openingPath.parentPath;
|
|
177
|
+
if (!parent?.isJSXElement())
|
|
178
|
+
return undefined;
|
|
179
|
+
return firstStaticStringInJsx(t, parent.node);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Static intrinsic identity signals — position-independent and present in a
|
|
183
|
+
* release Hermes bundle (no fiber walk, no `toString`). Read from the stamped
|
|
184
|
+
* element *and its subtree* because the real icon-button pattern nests the
|
|
185
|
+
* signal: `<Pressable><Icon name="settings" /></Pressable>` /
|
|
186
|
+
* `<Pressable><Image source={{ uri: '…' }} /></Pressable>` — mirroring how
|
|
187
|
+
* `childText` descends to find a label.
|
|
188
|
+
*/
|
|
189
|
+
const INTRINSIC_SCAN_MAX_DEPTH = 4;
|
|
190
|
+
/** Read a string-literal `name` prop off an opening element. */
|
|
191
|
+
function stringNameAttr(t, opening) {
|
|
192
|
+
const attr = opening.attributes.find((a) => t.isJSXAttribute(a) && t.isJSXIdentifier(a.name) && a.name.name === 'name');
|
|
193
|
+
return attr ? stringLiteralFromJsxAttr(t, attr) : undefined;
|
|
194
|
+
}
|
|
195
|
+
/** Read a literal image `source` uri (string or `{ uri: '…' }`) off an opening element. */
|
|
196
|
+
function imageSourceUri(t, opening) {
|
|
197
|
+
const attr = opening.attributes.find((a) => t.isJSXAttribute(a) && t.isJSXIdentifier(a.name) && a.name.name === 'source');
|
|
198
|
+
if (!attr)
|
|
199
|
+
return undefined;
|
|
200
|
+
const literal = stringLiteralFromJsxAttr(t, attr);
|
|
201
|
+
if (literal)
|
|
202
|
+
return literal;
|
|
203
|
+
const value = attr.value;
|
|
204
|
+
if (!value || !t.isJSXExpressionContainer(value) || !t.isObjectExpression(value.expression)) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
for (const prop of value.expression.properties) {
|
|
208
|
+
if (t.isObjectProperty(prop) &&
|
|
209
|
+
((t.isIdentifier(prop.key) && prop.key.name === 'uri') ||
|
|
210
|
+
(t.isStringLiteral(prop.key) && prop.key.value === 'uri')) &&
|
|
211
|
+
t.isStringLiteral(prop.value)) {
|
|
212
|
+
return prop.value.value;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
/** Depth-first search over the stamped element + its subtree for the first hit of `read`. */
|
|
218
|
+
function scanSubtree(t, openingPath, read) {
|
|
219
|
+
const root = openingPath.parentPath;
|
|
220
|
+
if (!root?.isJSXElement())
|
|
221
|
+
return undefined;
|
|
222
|
+
const visit = (el, depth) => {
|
|
223
|
+
const hit = read(el.openingElement);
|
|
224
|
+
if (hit)
|
|
225
|
+
return hit;
|
|
226
|
+
if (depth >= INTRINSIC_SCAN_MAX_DEPTH)
|
|
227
|
+
return undefined;
|
|
228
|
+
for (const child of el.children) {
|
|
229
|
+
if (t.isJSXElement(child)) {
|
|
230
|
+
const r = visit(child, depth + 1);
|
|
231
|
+
if (r)
|
|
232
|
+
return r;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return undefined;
|
|
236
|
+
};
|
|
237
|
+
return visit(root.node, 0);
|
|
238
|
+
}
|
|
239
|
+
function staticIconName(t, openingPath) {
|
|
240
|
+
return scanSubtree(t, openingPath, (o) => stringNameAttr(t, o));
|
|
241
|
+
}
|
|
242
|
+
function staticImageUri(t, openingPath) {
|
|
243
|
+
return scanSubtree(t, openingPath, (o) => imageSourceUri(t, o));
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Normalize static text for use inside a canonical `{text=…}` segment: strip the
|
|
247
|
+
* path delimiters (` > `, `{`, `}`) and control chars, collapse whitespace, cap
|
|
248
|
+
* length. Deterministic so record-time and resolve-time paths agree.
|
|
249
|
+
*/
|
|
250
|
+
function pathText(raw) {
|
|
251
|
+
return raw
|
|
252
|
+
.replace(/[\r\n\t]+/g, ' ')
|
|
253
|
+
.replace(/[>{}]/g, ' ')
|
|
254
|
+
.replace(/\s+/g, ' ')
|
|
255
|
+
.trim()
|
|
256
|
+
.slice(0, 40);
|
|
257
|
+
}
|
|
258
|
+
/** Leaf kinds whose static text *is* their identity — safe to anchor on `{text=…}`. */
|
|
259
|
+
const TEXT_ANCHOR_KINDS = new Set([
|
|
260
|
+
'Pressable',
|
|
261
|
+
'TouchableOpacity',
|
|
262
|
+
'TouchableHighlight',
|
|
263
|
+
'TouchableWithoutFeedback',
|
|
264
|
+
'TouchableNativeFeedback',
|
|
265
|
+
'Text',
|
|
266
|
+
]);
|
|
267
|
+
/** Canonical segment: ID replaces ordinal when present; static text anchors the leaf. */
|
|
268
|
+
function formatSegment(s) {
|
|
269
|
+
if (s.userflowId)
|
|
270
|
+
return `${s.name}{userflowId=${s.userflowId}}`;
|
|
271
|
+
if (s.testID)
|
|
272
|
+
return `${s.name}{testID=${s.testID}}`;
|
|
273
|
+
if (s.nativeID && !s.nativeID.startsWith('uf_'))
|
|
274
|
+
return `${s.name}{nativeID=${s.nativeID}}`;
|
|
275
|
+
if (s.key)
|
|
276
|
+
return `${s.name}{key=${s.key}}`;
|
|
277
|
+
if (s.childText)
|
|
278
|
+
return `${s.name}{text=${s.childText}}`;
|
|
279
|
+
return `${s.name}#${s.ordinal}`;
|
|
280
|
+
}
|
|
281
|
+
function idsFromOpening(t, opening) {
|
|
282
|
+
const findAttr = (attrName) => opening.attributes.find((a) => t.isJSXAttribute(a) && t.isJSXIdentifier(a.name) && a.name.name === attrName);
|
|
283
|
+
const userflowId = stringLiteralFromJsxAttr(t, findAttr('userflowId'));
|
|
284
|
+
const testID = stringLiteralFromJsxAttr(t, findAttr('testID'));
|
|
285
|
+
let nativeID = stringLiteralFromJsxAttr(t, findAttr('nativeID'));
|
|
286
|
+
if (nativeID?.startsWith('uf_'))
|
|
287
|
+
nativeID = undefined;
|
|
288
|
+
const key = stringLiteralFromJsxAttr(t, findAttr('key'));
|
|
289
|
+
return {
|
|
290
|
+
...(userflowId ? { userflowId } : {}),
|
|
291
|
+
...(testID ? { testID } : {}),
|
|
292
|
+
...(nativeID ? { nativeID } : {}),
|
|
293
|
+
...(key ? { key } : {}),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Parent-scoped ordinal: count same-named siblings under the immediate JSX parent.
|
|
298
|
+
*/
|
|
299
|
+
function parentScopedOrdinal(t, openingPath, elementName) {
|
|
300
|
+
const jsxEl = openingPath.parentPath;
|
|
301
|
+
if (!jsxEl?.isJSXElement())
|
|
302
|
+
return { ordinal: 0, siblingIndex: 0 };
|
|
303
|
+
const container = jsxEl.parentPath;
|
|
304
|
+
let children = [];
|
|
305
|
+
if (container?.isJSXElement()) {
|
|
306
|
+
children = container.node.children;
|
|
307
|
+
}
|
|
308
|
+
else if (container?.isJSXFragment()) {
|
|
309
|
+
children = container.node.children;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
return { ordinal: 0, siblingIndex: 0 };
|
|
313
|
+
}
|
|
314
|
+
let ordinal = 0;
|
|
315
|
+
let siblingIndex = 0;
|
|
316
|
+
let seen = 0;
|
|
317
|
+
for (const child of children) {
|
|
318
|
+
if (!t.isJSXElement(child))
|
|
319
|
+
continue;
|
|
320
|
+
if (child.openingElement === openingPath.node) {
|
|
321
|
+
siblingIndex = seen;
|
|
322
|
+
return { ordinal, siblingIndex };
|
|
323
|
+
}
|
|
324
|
+
const childName = jsxElementTypeName(t, child);
|
|
325
|
+
if (childName === elementName)
|
|
326
|
+
ordinal += 1;
|
|
327
|
+
seen += 1;
|
|
328
|
+
}
|
|
329
|
+
return { ordinal: 0, siblingIndex: 0 };
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Host allowlist elements always participate in the path. First-party custom
|
|
333
|
+
* components (PascalCase) also participate so siblings under different
|
|
334
|
+
* `<Section>` / layout wrappers do not collapse to the same `uf_<hash>`.
|
|
335
|
+
* Skipping them caused AnchorRegistry cache collisions: only one of several
|
|
336
|
+
* same-path Pressables stayed registered, and taps fell through to the parent View.
|
|
337
|
+
*/
|
|
338
|
+
function shouldIncludeInSemanticPath(name, allowlist) {
|
|
339
|
+
if (allowlist.includes(name))
|
|
340
|
+
return true;
|
|
341
|
+
// PascalCase / uppercase → custom component (same rule as call-site scope).
|
|
342
|
+
return /^[A-Z]/.test(name);
|
|
343
|
+
}
|
|
344
|
+
function buildSemanticPath(t, openingPath, moduleRel, component, allowlist, ordinals,
|
|
345
|
+
/**
|
|
346
|
+
* When false, leaf segments stay on ordinals even if static child text is
|
|
347
|
+
* present. stampOnly mode needs this: without a scored matcher, two "OK"
|
|
348
|
+
* buttons under the same parent would otherwise share one `uf_` hash and
|
|
349
|
+
* resolve as ambiguous.
|
|
350
|
+
*/
|
|
351
|
+
allowTextAnchor = true) {
|
|
352
|
+
const chain = [];
|
|
353
|
+
let cur = openingPath;
|
|
354
|
+
let depth = 0;
|
|
355
|
+
while (cur && depth < STRUCTURAL_PATH_MAX_DEPTH) {
|
|
356
|
+
depth += 1;
|
|
357
|
+
const nameNode = cur.node.name;
|
|
358
|
+
if (t.isJSXIdentifier(nameNode) && shouldIncludeInSemanticPath(nameNode.name, allowlist)) {
|
|
359
|
+
// Prefer the pristine-tree ordinal; fall back to a live scan when absent
|
|
360
|
+
// (e.g. a synthetic node the pre-pass never saw).
|
|
361
|
+
const { ordinal, siblingIndex } = ordinals?.get(cur.node) ?? parentScopedOrdinal(t, cur, nameNode.name);
|
|
362
|
+
const ids = idsFromOpening(t, cur.node);
|
|
363
|
+
// Anchor the leaf (first pushed = innermost) to its static text so its
|
|
364
|
+
// segment survives sibling inserts/reorders. Only for content leaves
|
|
365
|
+
// (pressables / Text) whose text *is* their identity — not containers,
|
|
366
|
+
// where `firstStaticStringInJsx` would greedily grab a descendant's label,
|
|
367
|
+
// nor ancestors (kept on ordinals; WS3 tolerates ancestor ordinal shifts).
|
|
368
|
+
const isLeaf = chain.length === 0;
|
|
369
|
+
let childText;
|
|
370
|
+
if (allowTextAnchor &&
|
|
371
|
+
isLeaf &&
|
|
372
|
+
TEXT_ANCHOR_KINDS.has(nameNode.name) &&
|
|
373
|
+
!ids.userflowId &&
|
|
374
|
+
!ids.testID &&
|
|
375
|
+
!ids.nativeID &&
|
|
376
|
+
!ids.key) {
|
|
377
|
+
const raw = childTextFromJsx(t, cur);
|
|
378
|
+
const cleaned = raw ? pathText(raw) : '';
|
|
379
|
+
if (cleaned)
|
|
380
|
+
childText = cleaned;
|
|
381
|
+
}
|
|
382
|
+
chain.push({
|
|
383
|
+
name: nameNode.name,
|
|
384
|
+
ordinal,
|
|
385
|
+
siblingIndex,
|
|
386
|
+
...ids,
|
|
387
|
+
...(childText ? { childText } : {}),
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
const jsxEl = cur.parentPath;
|
|
391
|
+
if (!jsxEl?.isJSXElement())
|
|
392
|
+
break;
|
|
393
|
+
const parent = jsxEl.parentPath;
|
|
394
|
+
if (parent?.isJSXElement()) {
|
|
395
|
+
cur = parent.get('openingElement');
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
chain.reverse();
|
|
402
|
+
const self = chain[chain.length - 1];
|
|
403
|
+
const ancestors = chain.slice(0, -1);
|
|
404
|
+
const segments = chain.map(formatSegment);
|
|
405
|
+
const path = segments.length === 0
|
|
406
|
+
? `${moduleRel}::${component}`
|
|
407
|
+
: `${moduleRel}::${component} > ${segments.join(' > ')}`;
|
|
408
|
+
return { path, ancestors, self };
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Compact hints wire format (v1). Runtime expands via `expandBuildTimeHints`.
|
|
412
|
+
* Single path `p` replaces ufid/structuralPath/templatePath; role/ancestors
|
|
413
|
+
* are derived at expand time from `kind` + path.
|
|
414
|
+
*/
|
|
415
|
+
function buildCompactHintsObjectExpression(t, fields) {
|
|
416
|
+
const props = [
|
|
417
|
+
t.objectProperty(t.identifier('v'), t.numericLiteral(1)),
|
|
418
|
+
t.objectProperty(t.identifier('n'), t.stringLiteral(fields.nativeId)),
|
|
419
|
+
t.objectProperty(t.identifier('p'), t.stringLiteral(fields.path)),
|
|
420
|
+
];
|
|
421
|
+
if (fields.childText) {
|
|
422
|
+
props.push(t.objectProperty(t.identifier('ct'), t.stringLiteral(fields.childText)));
|
|
423
|
+
}
|
|
424
|
+
if (fields.childShape) {
|
|
425
|
+
props.push(t.objectProperty(t.identifier('cs'), t.stringLiteral(fields.childShape)));
|
|
426
|
+
}
|
|
427
|
+
if (fields.iconName) {
|
|
428
|
+
props.push(t.objectProperty(t.identifier('icn'), t.stringLiteral(fields.iconName)));
|
|
429
|
+
}
|
|
430
|
+
if (fields.imageSrc) {
|
|
431
|
+
props.push(t.objectProperty(t.identifier('img'), t.stringLiteral(fields.imageSrc)));
|
|
432
|
+
}
|
|
433
|
+
if (fields.ordinal !== undefined && fields.ordinal !== 0) {
|
|
434
|
+
props.push(t.objectProperty(t.identifier('o'), t.numericLiteral(fields.ordinal)));
|
|
435
|
+
}
|
|
436
|
+
if (fields.siblingIndex !== undefined && fields.siblingIndex !== 0) {
|
|
437
|
+
props.push(t.objectProperty(t.identifier('si'), t.numericLiteral(fields.siblingIndex)));
|
|
438
|
+
}
|
|
439
|
+
if (fields.literalTestId) {
|
|
440
|
+
props.push(t.objectProperty(t.identifier('tid'), t.stringLiteral(fields.literalTestId)));
|
|
441
|
+
}
|
|
442
|
+
if (fields.literalUserflowId) {
|
|
443
|
+
props.push(t.objectProperty(t.identifier('uid'), t.stringLiteral(fields.literalUserflowId)));
|
|
444
|
+
}
|
|
445
|
+
if (fields.literalLabel) {
|
|
446
|
+
props.push(t.objectProperty(t.identifier('lid'), t.stringLiteral(fields.literalLabel)));
|
|
447
|
+
}
|
|
448
|
+
return t.objectExpression(props);
|
|
449
|
+
}
|
|
450
|
+
function functionDeclaresIncomingScope(t, fnPath) {
|
|
451
|
+
if (!fnPath)
|
|
452
|
+
return false;
|
|
453
|
+
const body = fnPath.get('body');
|
|
454
|
+
if (!body.isBlockStatement())
|
|
455
|
+
return false;
|
|
456
|
+
return body.node.body.some((s) => t.isVariableDeclaration(s) &&
|
|
457
|
+
s.declarations.some((d) => t.isIdentifier(d.id) && d.id.name === '__ufIncomingScope'));
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Runtime bag passed to __ufRef. Only emits keys that exist; `scope` only when
|
|
461
|
+
* the enclosing function captured `__ufIncomingScope`.
|
|
462
|
+
*/
|
|
463
|
+
function buildRuntimeExpr(t, findAttr, includeScope) {
|
|
464
|
+
const props = [];
|
|
465
|
+
const pushAttr = (runtimeKey, attrName) => {
|
|
466
|
+
const expr = expressionFromJsxAttr(t, findAttr(attrName));
|
|
467
|
+
if (!expr)
|
|
468
|
+
return;
|
|
469
|
+
if (attrName === 'nativeID' && t.isStringLiteral(expr) && expr.value.startsWith('uf_'))
|
|
470
|
+
return;
|
|
471
|
+
props.push(t.objectProperty(t.identifier(runtimeKey), expr));
|
|
472
|
+
};
|
|
473
|
+
pushAttr('userflowId', 'userflowId');
|
|
474
|
+
pushAttr('testID', 'testID');
|
|
475
|
+
pushAttr('nativeID', 'nativeID');
|
|
476
|
+
pushAttr('accessibilityLabel', 'accessibilityLabel');
|
|
477
|
+
// Dynamic intrinsic identity: icon name (`<Icon name={x}>`) survives reorders.
|
|
478
|
+
pushAttr('iconName', 'name');
|
|
479
|
+
if (includeScope) {
|
|
480
|
+
props.push(t.objectProperty(t.identifier('scope'), t.conditionalExpression(t.binaryExpression('!==', t.unaryExpression('typeof', t.identifier('__ufIncomingScope')), t.stringLiteral('undefined')), t.identifier('__ufIncomingScope'), t.identifier('undefined'))));
|
|
481
|
+
}
|
|
482
|
+
return t.objectExpression(props);
|
|
483
|
+
}
|
|
484
|
+
function isStampOnly(opts) {
|
|
485
|
+
return opts.stampOnly === true;
|
|
486
|
+
}
|
|
487
|
+
function enclosingComponentName(t, openingPath, filename) {
|
|
488
|
+
let fn = openingPath.getFunctionParent();
|
|
489
|
+
let sawDefaultExport = false;
|
|
490
|
+
while (fn) {
|
|
491
|
+
const node = fn.node;
|
|
492
|
+
if ((t.isFunctionDeclaration(node) || t.isFunctionExpression(node)) && node.id?.name) {
|
|
493
|
+
return node.id.name;
|
|
494
|
+
}
|
|
495
|
+
if (t.isClassMethod(node) || t.isClassPrivateMethod(node)) {
|
|
496
|
+
const cls = fn.findParent((p) => t.isClassDeclaration(p.node) || t.isClassExpression(p.node));
|
|
497
|
+
const clsNode = cls?.node;
|
|
498
|
+
if (clsNode?.id?.name)
|
|
499
|
+
return clsNode.id.name;
|
|
500
|
+
}
|
|
501
|
+
if (t.isObjectMethod(node) && t.isIdentifier(node.key)) {
|
|
502
|
+
return node.key.name;
|
|
503
|
+
}
|
|
504
|
+
const declarator = fn.findParent((p) => t.isVariableDeclarator(p.node));
|
|
505
|
+
const declId = declarator?.node?.id;
|
|
506
|
+
if (declId && t.isIdentifier(declId)) {
|
|
507
|
+
return declId.name;
|
|
508
|
+
}
|
|
509
|
+
if (t.isExportDefaultDeclaration(fn.parentPath?.node)) {
|
|
510
|
+
sawDefaultExport = true;
|
|
511
|
+
}
|
|
512
|
+
fn = fn.getFunctionParent();
|
|
513
|
+
}
|
|
514
|
+
if (sawDefaultExport)
|
|
515
|
+
return 'default';
|
|
516
|
+
const base = nodePath.basename(filename);
|
|
517
|
+
return base.replace(/\.[^.]+$/, '') || 'Module';
|
|
518
|
+
}
|
|
519
|
+
function isCustomComponentName(name, allowlist) {
|
|
520
|
+
if (allowlist.includes(name))
|
|
521
|
+
return false;
|
|
522
|
+
// PascalCase / uppercase start → custom component
|
|
523
|
+
return /^[A-Z]/.test(name);
|
|
524
|
+
}
|
|
525
|
+
function formatCallSiteScope(moduleRel, component, childName, ordinal, ids) {
|
|
526
|
+
let seg = childName;
|
|
527
|
+
if (ids.userflowId)
|
|
528
|
+
seg = `${childName}{userflowId=${ids.userflowId}}`;
|
|
529
|
+
else if (ids.testID)
|
|
530
|
+
seg = `${childName}{testID=${ids.testID}}`;
|
|
531
|
+
else if (ids.key)
|
|
532
|
+
seg = `${childName}{key=${ids.key}}`;
|
|
533
|
+
else
|
|
534
|
+
seg = `${childName}#${ordinal}`;
|
|
535
|
+
return `${moduleRel}::${component} > ${seg}`;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Inject `const __ufIncomingScope = props?.__ufScope` at the start of a
|
|
539
|
+
* function component that has a `props` param (or first param).
|
|
540
|
+
*/
|
|
541
|
+
function ensureScopeCapture(t, fnPath) {
|
|
542
|
+
const body = fnPath.get('body');
|
|
543
|
+
if (!body.isBlockStatement())
|
|
544
|
+
return;
|
|
545
|
+
const already = body.node.body.some((s) => t.isVariableDeclaration(s) &&
|
|
546
|
+
s.declarations.some((d) => t.isIdentifier(d.id) && d.id.name === '__ufIncomingScope'));
|
|
547
|
+
if (already)
|
|
548
|
+
return;
|
|
549
|
+
const params = fnPath.node.params;
|
|
550
|
+
if (params.length === 0)
|
|
551
|
+
return;
|
|
552
|
+
const first = params[0];
|
|
553
|
+
let propsAccess;
|
|
554
|
+
if (t.isIdentifier(first)) {
|
|
555
|
+
// Optional: helpers like `envelope(fp)` and type predicates also match
|
|
556
|
+
// `Function` enter. A missing first arg must not throw at module init.
|
|
557
|
+
propsAccess = t.optionalMemberExpression(first, t.identifier(UF_SCOPE_PROP), false, true);
|
|
558
|
+
}
|
|
559
|
+
else if (t.isObjectPattern(first)) {
|
|
560
|
+
// Look for __ufScope in pattern or add member via rest — skip if complex
|
|
561
|
+
const hasScope = first.properties.some((p) => t.isObjectProperty(p) &&
|
|
562
|
+
((t.isIdentifier(p.key) && p.key.name === UF_SCOPE_PROP) ||
|
|
563
|
+
(t.isStringLiteral(p.key) && p.key.value === UF_SCOPE_PROP)));
|
|
564
|
+
if (hasScope) {
|
|
565
|
+
propsAccess = t.identifier(UF_SCOPE_PROP);
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
// Inject __ufScope into the pattern
|
|
569
|
+
first.properties.unshift(t.objectProperty(t.identifier(UF_SCOPE_PROP), t.identifier('__ufScopeProp'), false, true));
|
|
570
|
+
propsAccess = t.identifier('__ufScopeProp');
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
body.unshiftContainer('body', t.variableDeclaration('var', [
|
|
577
|
+
t.variableDeclarator(t.identifier('__ufIncomingScope'), propsAccess),
|
|
578
|
+
]));
|
|
579
|
+
}
|
|
580
|
+
function userflowAutoStamp(api) {
|
|
581
|
+
const t = api.types;
|
|
582
|
+
const isProduction = (typeof api.env === 'function' && api.env('production')) ||
|
|
583
|
+
process.env['NODE_ENV'] === 'production';
|
|
584
|
+
return {
|
|
585
|
+
name: '@userflow-tech/react-native/babel-plugin',
|
|
586
|
+
pre() {
|
|
587
|
+
this.ufCallSiteCounters = new Map();
|
|
588
|
+
},
|
|
589
|
+
visitor: {
|
|
590
|
+
Program: {
|
|
591
|
+
enter(programPath, state) {
|
|
592
|
+
// Precompute parent-scoped ordinals on the still-pristine JSX tree.
|
|
593
|
+
// Running here (plugin Program.enter fires before preset-react) means
|
|
594
|
+
// no `<El>` has been rewritten to `_jsx(El, …)` yet, so sibling counts
|
|
595
|
+
// are accurate. Reading them lazily in the main visitor would instead
|
|
596
|
+
// race the JSX transform and mis-count every element as `#0`.
|
|
597
|
+
const ordinals = (state.ufOrdinals = new WeakMap());
|
|
598
|
+
programPath.traverse({
|
|
599
|
+
JSXOpeningElement(p) {
|
|
600
|
+
const nameNode = p.node.name;
|
|
601
|
+
if (!t.isJSXIdentifier(nameNode))
|
|
602
|
+
return;
|
|
603
|
+
ordinals.set(p.node, parentScopedOrdinal(t, p, nameNode.name));
|
|
604
|
+
},
|
|
605
|
+
});
|
|
606
|
+
},
|
|
607
|
+
exit(programPath, state) {
|
|
608
|
+
if (!state.ufStamped)
|
|
609
|
+
return;
|
|
610
|
+
const opts = (state.opts ?? {});
|
|
611
|
+
// stampOnly never wraps refs, so there is nothing to import or helper.
|
|
612
|
+
if (isStampOnly(opts))
|
|
613
|
+
return;
|
|
614
|
+
// Bind the runtime installer into every stamped module so production
|
|
615
|
+
// tree-shaking cannot drop `globalThis.__userflowAutoAnchor` when the
|
|
616
|
+
// app never names the export. Falls back to globalThis for tests /
|
|
617
|
+
// older SDK versions.
|
|
618
|
+
const importName = '__userflowAutoAnchor';
|
|
619
|
+
const packageName = '@userflow-tech/react-native';
|
|
620
|
+
let hasImport = false;
|
|
621
|
+
for (const stmt of programPath.node.body) {
|
|
622
|
+
if (!t.isImportDeclaration(stmt))
|
|
623
|
+
continue;
|
|
624
|
+
if (stmt.source.value !== packageName)
|
|
625
|
+
continue;
|
|
626
|
+
const already = stmt.specifiers.some((s) => t.isImportSpecifier(s) &&
|
|
627
|
+
t.isIdentifier(s.imported) &&
|
|
628
|
+
s.imported.name === importName);
|
|
629
|
+
if (!already) {
|
|
630
|
+
stmt.specifiers.push(t.importSpecifier(t.identifier(importName), t.identifier(importName)));
|
|
631
|
+
}
|
|
632
|
+
hasImport = true;
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
if (!hasImport) {
|
|
636
|
+
programPath.unshiftContainer('body', t.importDeclaration([t.importSpecifier(t.identifier(importName), t.identifier(importName))], t.stringLiteral(packageName)));
|
|
637
|
+
}
|
|
638
|
+
const helper = api.template.statement(`
|
|
639
|
+
function ${REF_HELPER}(id, hints, userRef, kind, runtime) {
|
|
640
|
+
var f = typeof ${importName} === "function"
|
|
641
|
+
? ${importName}
|
|
642
|
+
: globalThis.__userflowAutoAnchor;
|
|
643
|
+
var resolved = (id != null && id !== "") ? id : (hints && (hints.n || hints.nativeId));
|
|
644
|
+
return f ? f(resolved, hints, userRef, kind, runtime) : userRef;
|
|
645
|
+
}
|
|
646
|
+
`)();
|
|
647
|
+
// Place helper after imports (unshift would put it above the import).
|
|
648
|
+
const body = programPath.get('body');
|
|
649
|
+
let insertAt = 0;
|
|
650
|
+
for (let i = 0; i < body.length; i += 1) {
|
|
651
|
+
if (body[i].isImportDeclaration())
|
|
652
|
+
insertAt = i + 1;
|
|
653
|
+
else
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
if (insertAt < body.length) {
|
|
657
|
+
body[insertAt].insertBefore(helper);
|
|
658
|
+
}
|
|
659
|
+
else if (insertAt > 0) {
|
|
660
|
+
body[insertAt - 1].insertAfter(helper);
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
programPath.unshiftContainer('body', helper);
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
},
|
|
667
|
+
Function: {
|
|
668
|
+
enter(fnPath, state) {
|
|
669
|
+
const opts = (state.opts ?? {});
|
|
670
|
+
if (isStampOnly(opts))
|
|
671
|
+
return;
|
|
672
|
+
const filename = state.filename ?? state.file.opts.filename ?? '';
|
|
673
|
+
if (!filename || filename.includes('node_modules'))
|
|
674
|
+
return;
|
|
675
|
+
if (opts.exclude?.some((frag) => filename.includes(frag)))
|
|
676
|
+
return;
|
|
677
|
+
// Do not pollute the injected `__ufRef` helper (Program.exit re-visits it).
|
|
678
|
+
if ((fnPath.isFunctionDeclaration() || fnPath.isFunctionExpression()) &&
|
|
679
|
+
t.isIdentifier(fnPath.node.id) &&
|
|
680
|
+
fnPath.node.id.name === REF_HELPER) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
// Capture incoming scope for any function that may stamp hosts.
|
|
684
|
+
ensureScopeCapture(t, fnPath);
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
JSXOpeningElement(openingPath, state) {
|
|
688
|
+
const opts = (state.opts ?? {});
|
|
689
|
+
const nameNode = openingPath.node.name;
|
|
690
|
+
if (!t.isJSXIdentifier(nameNode))
|
|
691
|
+
return;
|
|
692
|
+
const name = nameNode.name;
|
|
693
|
+
const allowlist = opts.allowlist ?? DEFAULT_ALLOWLIST;
|
|
694
|
+
// Default false — full mode populates the auto-anchor registry.
|
|
695
|
+
const stampOnly = isStampOnly(opts);
|
|
696
|
+
const filename = state.filename ?? state.file.opts.filename ?? '';
|
|
697
|
+
if (!filename || filename.includes('node_modules'))
|
|
698
|
+
return;
|
|
699
|
+
if (opts.exclude?.some((frag) => filename.includes(frag)))
|
|
700
|
+
return;
|
|
701
|
+
const rootDir = opts.rootDir ?? state.cwd ?? process.cwd();
|
|
702
|
+
const rel = nodePath.relative(rootDir, filename).split(nodePath.sep).join('/') || filename;
|
|
703
|
+
const component = enclosingComponentName(t, openingPath, filename);
|
|
704
|
+
const attrs = openingPath.node.attributes;
|
|
705
|
+
const findAttr = (attrName) => attrs.find((a) => t.isJSXAttribute(a) && t.isJSXIdentifier(a.name) && a.name.name === attrName);
|
|
706
|
+
// --- Custom component call-site scope ---
|
|
707
|
+
// stampOnly has no runtime scope consumer, so skip this entirely.
|
|
708
|
+
if (isCustomComponentName(name, allowlist)) {
|
|
709
|
+
if (stampOnly)
|
|
710
|
+
return;
|
|
711
|
+
if (findAttr(UF_SCOPE_PROP))
|
|
712
|
+
return;
|
|
713
|
+
const counters = (state.ufCallSiteCounters ?? (state.ufCallSiteCounters = new Map()));
|
|
714
|
+
let byComp = counters.get(component);
|
|
715
|
+
if (!byComp) {
|
|
716
|
+
byComp = new Map();
|
|
717
|
+
counters.set(component, byComp);
|
|
718
|
+
}
|
|
719
|
+
const ordinal = byComp.get(name) ?? 0;
|
|
720
|
+
byComp.set(name, ordinal + 1);
|
|
721
|
+
const ufId = stringLiteralFromJsxAttr(t, findAttr('userflowId'));
|
|
722
|
+
const tId = stringLiteralFromJsxAttr(t, findAttr('testID'));
|
|
723
|
+
const kId = stringLiteralFromJsxAttr(t, findAttr('key'));
|
|
724
|
+
const ids = {
|
|
725
|
+
...(ufId ? { userflowId: ufId } : {}),
|
|
726
|
+
...(tId ? { testID: tId } : {}),
|
|
727
|
+
...(kId ? { key: kId } : {}),
|
|
728
|
+
};
|
|
729
|
+
const scope = formatCallSiteScope(rel, component, name, ordinal, ids);
|
|
730
|
+
attrs.push(t.jsxAttribute(t.jsxIdentifier(UF_SCOPE_PROP), t.stringLiteral(scope)));
|
|
731
|
+
state.ufStamped = true;
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
if (!allowlist.includes(name))
|
|
735
|
+
return;
|
|
736
|
+
// Idempotency
|
|
737
|
+
if (findAttr(UFID_PROP))
|
|
738
|
+
return;
|
|
739
|
+
if (stampOnly && findAttr('nativeID')) {
|
|
740
|
+
const existing = stringLiteralFromJsxAttr(t, findAttr('nativeID'));
|
|
741
|
+
if (existing?.startsWith('uf_'))
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
const { path: structuralPath, self } = buildSemanticPath(t, openingPath, rel, component, allowlist, state.ufOrdinals,
|
|
745
|
+
// stampOnly has no scored matcher — keep leaf ordinals unique even when
|
|
746
|
+
// sibling hosts share the same static label.
|
|
747
|
+
!stampOnly);
|
|
748
|
+
const hashedKey = `uf_${hashId(structuralPath)}`;
|
|
749
|
+
let manualIdExpr = null;
|
|
750
|
+
for (const attrName of MANUAL_ID_ATTRS) {
|
|
751
|
+
const attr = findAttr(attrName);
|
|
752
|
+
if (!attr)
|
|
753
|
+
continue;
|
|
754
|
+
const value = attr.value;
|
|
755
|
+
if (t.isStringLiteral(value)) {
|
|
756
|
+
if (attrName === 'nativeID' && value.value.startsWith('uf_'))
|
|
757
|
+
continue;
|
|
758
|
+
manualIdExpr = t.stringLiteral(value.value);
|
|
759
|
+
break;
|
|
760
|
+
}
|
|
761
|
+
if (t.isJSXExpressionContainer(value) && t.isExpression(value.expression)) {
|
|
762
|
+
manualIdExpr = t.cloneNode(value.expression);
|
|
763
|
+
break;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
if (COLLAPSABLE_NAMES.has(name) && !findAttr('collapsable')) {
|
|
767
|
+
attrs.push(t.jsxAttribute(t.jsxIdentifier('collapsable'), t.jsxExpressionContainer(t.booleanLiteral(false))));
|
|
768
|
+
}
|
|
769
|
+
if (stampOnly) {
|
|
770
|
+
if (!manualIdExpr && !findAttr('nativeID')) {
|
|
771
|
+
attrs.push(t.jsxAttribute(t.jsxIdentifier('nativeID'), t.stringLiteral(hashedKey)));
|
|
772
|
+
}
|
|
773
|
+
state.ufStamped = true;
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
const literalTestId = stringLiteralFromJsxAttr(t, findAttr('testID'));
|
|
777
|
+
const literalLabel = stringLiteralFromJsxAttr(t, findAttr('accessibilityLabel'));
|
|
778
|
+
const literalUserflowId = stringLiteralFromJsxAttr(t, findAttr('userflowId'));
|
|
779
|
+
const childText = childTextFromJsx(t, openingPath);
|
|
780
|
+
const childShape = childShapeFromJsx(t, openingPath);
|
|
781
|
+
const iconName = staticIconName(t, openingPath);
|
|
782
|
+
const imageSrc = staticImageUri(t, openingPath);
|
|
783
|
+
const hintsExpr = buildCompactHintsObjectExpression(t, {
|
|
784
|
+
nativeId: hashedKey,
|
|
785
|
+
path: structuralPath,
|
|
786
|
+
...(literalTestId ? { literalTestId } : {}),
|
|
787
|
+
...(literalLabel ? { literalLabel } : {}),
|
|
788
|
+
...(literalUserflowId ? { literalUserflowId } : {}),
|
|
789
|
+
...(childText ? { childText } : {}),
|
|
790
|
+
...(childShape ? { childShape } : {}),
|
|
791
|
+
...(iconName ? { iconName } : {}),
|
|
792
|
+
...(imageSrc ? { imageSrc } : {}),
|
|
793
|
+
ordinal: self.ordinal,
|
|
794
|
+
siblingIndex: self.siblingIndex,
|
|
795
|
+
});
|
|
796
|
+
// Dev: inject __ufid for fiber/debug. Production default: omit (bundle size).
|
|
797
|
+
const injectUfid = opts.injectUfidProp !== undefined ? opts.injectUfidProp : !isProduction;
|
|
798
|
+
if (injectUfid) {
|
|
799
|
+
attrs.push(t.jsxAttribute(t.jsxIdentifier(UFID_PROP), t.stringLiteral(structuralPath)));
|
|
800
|
+
}
|
|
801
|
+
if (manualIdExpr) {
|
|
802
|
+
attrs.push(t.jsxAttribute(t.jsxIdentifier(UF_MANUAL_PROP), t.stringLiteral('true')));
|
|
803
|
+
}
|
|
804
|
+
// Compose with whatever ref the app already has — never drop it.
|
|
805
|
+
// Supports: ref={expr}, ref="legacyString", and a single {...props}.ref.
|
|
806
|
+
const existingRefIdx = attrs.findIndex((a) => t.isJSXAttribute(a) && t.isJSXIdentifier(a.name) && a.name.name === 'ref');
|
|
807
|
+
let userRefExpr = t.nullLiteral();
|
|
808
|
+
if (existingRefIdx >= 0) {
|
|
809
|
+
const existing = attrs[existingRefIdx];
|
|
810
|
+
if (t.isStringLiteral(existing.value)) {
|
|
811
|
+
// Legacy string refs: pass through so runtime can assign owner.refs[name].
|
|
812
|
+
userRefExpr = t.stringLiteral(existing.value.value);
|
|
813
|
+
}
|
|
814
|
+
else if (t.isJSXExpressionContainer(existing.value)) {
|
|
815
|
+
const inner = existing.value.expression;
|
|
816
|
+
if (t.isExpression(inner)) {
|
|
817
|
+
if (t.isCallExpression(inner) &&
|
|
818
|
+
t.isIdentifier(inner.callee) &&
|
|
819
|
+
inner.callee.name === REF_HELPER) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
userRefExpr = inner;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
// No explicit ref attribute — if the element only has one object spread
|
|
828
|
+
// (e.g. {...props}), compose with that object's `.ref` so we don't
|
|
829
|
+
// clobber a ref that arrives via spread (JSX later-attrs-win).
|
|
830
|
+
const spreads = attrs.filter((a) => t.isJSXSpreadAttribute(a));
|
|
831
|
+
if (spreads.length === 1 && t.isIdentifier(spreads[0].argument)) {
|
|
832
|
+
userRefExpr = t.memberExpression(spreads[0].argument, t.identifier('ref'));
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
const fnParent = openingPath.getFunctionParent();
|
|
836
|
+
const includeScope = functionDeclaresIncomingScope(t, fnParent);
|
|
837
|
+
const runtimeExpr = buildRuntimeExpr(t, findAttr, includeScope);
|
|
838
|
+
const refCall = t.callExpression(t.identifier(REF_HELPER), [
|
|
839
|
+
manualIdExpr ?? t.stringLiteral(hashedKey),
|
|
840
|
+
hintsExpr,
|
|
841
|
+
userRefExpr,
|
|
842
|
+
t.stringLiteral(name),
|
|
843
|
+
runtimeExpr,
|
|
844
|
+
]);
|
|
845
|
+
const refAttr = t.jsxAttribute(t.jsxIdentifier('ref'), t.jsxExpressionContainer(refCall));
|
|
846
|
+
if (existingRefIdx >= 0) {
|
|
847
|
+
attrs[existingRefIdx] = refAttr;
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
attrs.push(refAttr);
|
|
851
|
+
}
|
|
852
|
+
if (!manualIdExpr && !findAttr('nativeID')) {
|
|
853
|
+
attrs.push(t.jsxAttribute(t.jsxIdentifier('nativeID'), t.stringLiteral(hashedKey)));
|
|
854
|
+
}
|
|
855
|
+
state.ufStamped = true;
|
|
856
|
+
},
|
|
857
|
+
},
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
module.exports = userflowAutoStamp;
|
|
861
|
+
module.exports.default = userflowAutoStamp;
|
|
862
|
+
//# sourceMappingURL=index.js.map
|