@userflow-tech/react-native 0.4.5 → 0.5.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 +7 -2
- package/docs/anchoring.md +6 -1
- package/docs/troubleshooting.md +26 -0
- package/lib/commonjs/anchors/AutoAnchorRegistry.js +144 -34
- package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/commonjs/anchors/animationFrame.js +29 -1
- package/lib/commonjs/anchors/animationFrame.js.map +1 -1
- package/lib/commonjs/anchors/appActive.js +61 -0
- package/lib/commonjs/anchors/appActive.js.map +1 -0
- package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -8
- package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/commonjs/anchors/elementTapMonitor.js +67 -12
- package/lib/commonjs/anchors/elementTapMonitor.js.map +1 -1
- package/lib/commonjs/anchors/elementTargetMatch.js +33 -7
- package/lib/commonjs/anchors/elementTargetMatch.js.map +1 -1
- package/lib/commonjs/anchors/fiber/fiberInternals.js +66 -0
- package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/commonjs/anchors/fiber/indexHostFibers.js +4 -3
- package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -1
- package/lib/commonjs/anchors/fiber/resolveFiberPath.js +30 -15
- package/lib/commonjs/anchors/fiber/resolveFiberPath.js.map +1 -1
- package/lib/commonjs/anchors/fiberAnchorCache.js +20 -0
- package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -1
- package/lib/commonjs/anchors/gestureHandlerHandoff.js +304 -0
- package/lib/commonjs/anchors/gestureHandlerHandoff.js.map +1 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js +6 -0
- package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js +11 -6
- package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -1
- package/lib/commonjs/anchors/resolveElementTargets.js +63 -8
- package/lib/commonjs/anchors/resolveElementTargets.js.map +1 -1
- package/lib/commonjs/anchors/semanticMatcher.js +43 -21
- package/lib/commonjs/anchors/semanticMatcher.js.map +1 -1
- package/lib/commonjs/anchors/tapSlop.js +16 -0
- package/lib/commonjs/anchors/tapSlop.js.map +1 -0
- package/lib/commonjs/anchors/targetPressMonitor.js +66 -12
- package/lib/commonjs/anchors/targetPressMonitor.js.map +1 -1
- package/lib/commonjs/authoring/fingerprintFromInstance.js +5 -9
- package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -1
- package/lib/commonjs/content/RichContentRenderer.js +3 -3
- package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
- package/lib/commonjs/content/openSafeUrl.js +3 -1
- package/lib/commonjs/content/openSafeUrl.js.map +1 -1
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js +6 -0
- package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/commonjs/index.js +19 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigation/navigateUrlUtils.js +105 -0
- package/lib/commonjs/navigation/navigateUrlUtils.js.map +1 -0
- package/lib/commonjs/navigation/openExternalNavigateUrl.js +14 -0
- package/lib/commonjs/navigation/openExternalNavigateUrl.js.map +1 -0
- package/lib/commonjs/navigation/openFlowNavigateUrl.js +47 -41
- package/lib/commonjs/navigation/openFlowNavigateUrl.js.map +1 -1
- package/lib/commonjs/pairing/PairingController.js +3 -1
- package/lib/commonjs/pairing/PairingController.js.map +1 -1
- package/lib/commonjs/runtime/BannerHost.js +38 -29
- package/lib/commonjs/runtime/BannerHost.js.map +1 -1
- package/lib/commonjs/runtime/TargetPressBridge.js +55 -7
- package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
- package/lib/commonjs/runtime/UserflowOverlay.js +5 -11
- package/lib/commonjs/runtime/UserflowOverlay.js.map +1 -1
- package/lib/commonjs/runtime/UserflowProvider.js +66 -40
- package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
- package/lib/commonjs/runtime/bannerEngine.js +8 -2
- package/lib/commonjs/runtime/bannerEngine.js.map +1 -1
- package/lib/commonjs/runtime/bannerFlowSpacer.js +71 -0
- package/lib/commonjs/runtime/bannerFlowSpacer.js.map +1 -0
- package/lib/commonjs/runtime/flowEngine.js +11 -0
- package/lib/commonjs/runtime/flowEngine.js.map +1 -1
- package/lib/commonjs/runtime/previewStart.js +39 -0
- package/lib/commonjs/runtime/previewStart.js.map +1 -0
- package/lib/commonjs/runtime/pushBannerLayoutContext.js +98 -0
- package/lib/commonjs/runtime/pushBannerLayoutContext.js.map +1 -0
- package/lib/commonjs/screenTracker.js +12 -0
- package/lib/commonjs/screenTracker.js.map +1 -1
- package/lib/commonjs/surfaces/BannerBar.js +79 -61
- package/lib/commonjs/surfaces/BannerBar.js.map +1 -1
- package/lib/commonjs/surfaces/BannerSurface.js +26 -0
- package/lib/commonjs/surfaces/BannerSurface.js.map +1 -1
- package/lib/commonjs/surfaces/TooltipSurface.js +43 -41
- package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
- package/lib/commonjs/surfaces/bannerBarLayout.js +77 -10
- package/lib/commonjs/surfaces/bannerBarLayout.js.map +1 -1
- package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js +112 -63
- package/lib/commonjs/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
- package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js +59 -11
- package/lib/commonjs/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
- package/lib/commonjs/surfaces/hostAccessibilityTrap.js +28 -0
- package/lib/commonjs/surfaces/hostAccessibilityTrap.js.map +1 -0
- package/lib/commonjs/surfaces/resolveBannerTheme.js +6 -3
- package/lib/commonjs/surfaces/resolveBannerTheme.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +3 -2
- package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js +134 -0
- package/lib/commonjs/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/anchors/AutoAnchorRegistry.js +145 -35
- package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
- package/lib/module/anchors/animationFrame.js +29 -2
- package/lib/module/anchors/animationFrame.js.map +1 -1
- package/lib/module/anchors/appActive.js +57 -0
- package/lib/module/anchors/appActive.js.map +1 -0
- package/lib/module/anchors/elementConditionEvaluator.js +26 -9
- package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
- package/lib/module/anchors/elementTapMonitor.js +67 -12
- package/lib/module/anchors/elementTapMonitor.js.map +1 -1
- package/lib/module/anchors/elementTargetMatch.js +32 -7
- package/lib/module/anchors/elementTargetMatch.js.map +1 -1
- package/lib/module/anchors/fiber/fiberInternals.js +65 -0
- package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
- package/lib/module/anchors/fiber/indexHostFibers.js +4 -3
- package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -1
- package/lib/module/anchors/fiber/resolveFiberPath.js +30 -15
- package/lib/module/anchors/fiber/resolveFiberPath.js.map +1 -1
- package/lib/module/anchors/fiberAnchorCache.js +19 -0
- package/lib/module/anchors/fiberAnchorCache.js.map +1 -1
- package/lib/module/anchors/gestureHandlerHandoff.js +298 -0
- package/lib/module/anchors/gestureHandlerHandoff.js.map +1 -0
- package/lib/module/anchors/resolveAnchorHost.js +1 -0
- package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveAutoAnchorHost.js +11 -6
- package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -1
- package/lib/module/anchors/resolveElementTargets.js +63 -8
- package/lib/module/anchors/resolveElementTargets.js.map +1 -1
- package/lib/module/anchors/semanticMatcher.js +43 -21
- package/lib/module/anchors/semanticMatcher.js.map +1 -1
- package/lib/module/anchors/tapSlop.js +11 -0
- package/lib/module/anchors/tapSlop.js.map +1 -0
- package/lib/module/anchors/targetPressMonitor.js +53 -8
- package/lib/module/anchors/targetPressMonitor.js.map +1 -1
- package/lib/module/authoring/fingerprintFromInstance.js +6 -10
- package/lib/module/authoring/fingerprintFromInstance.js.map +1 -1
- package/lib/module/content/RichContentRenderer.js +3 -3
- package/lib/module/content/RichContentRenderer.js.map +1 -1
- package/lib/module/content/openSafeUrl.js +3 -1
- package/lib/module/content/openSafeUrl.js.map +1 -1
- package/lib/module/expo-router/useUserflowExpoRouter.js +7 -1
- package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
- package/lib/module/index.js +22 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/navigateUrlUtils.js +94 -0
- package/lib/module/navigation/navigateUrlUtils.js.map +1 -0
- package/lib/module/navigation/openExternalNavigateUrl.js +11 -0
- package/lib/module/navigation/openExternalNavigateUrl.js.map +1 -0
- package/lib/module/navigation/openFlowNavigateUrl.js +22 -36
- package/lib/module/navigation/openFlowNavigateUrl.js.map +1 -1
- package/lib/module/pairing/PairingController.js +3 -1
- package/lib/module/pairing/PairingController.js.map +1 -1
- package/lib/module/runtime/BannerHost.js +38 -29
- package/lib/module/runtime/BannerHost.js.map +1 -1
- package/lib/module/runtime/TargetPressBridge.js +56 -8
- package/lib/module/runtime/TargetPressBridge.js.map +1 -1
- package/lib/module/runtime/UserflowOverlay.js +5 -11
- package/lib/module/runtime/UserflowOverlay.js.map +1 -1
- package/lib/module/runtime/UserflowProvider.js +66 -40
- package/lib/module/runtime/UserflowProvider.js.map +1 -1
- package/lib/module/runtime/bannerEngine.js +7 -2
- package/lib/module/runtime/bannerEngine.js.map +1 -1
- package/lib/module/runtime/bannerFlowSpacer.js +65 -0
- package/lib/module/runtime/bannerFlowSpacer.js.map +1 -0
- package/lib/module/runtime/flowEngine.js +11 -0
- package/lib/module/runtime/flowEngine.js.map +1 -1
- package/lib/module/runtime/previewStart.js +35 -0
- package/lib/module/runtime/previewStart.js.map +1 -0
- package/lib/module/runtime/pushBannerLayoutContext.js +91 -0
- package/lib/module/runtime/pushBannerLayoutContext.js.map +1 -0
- package/lib/module/screenTracker.js +11 -0
- package/lib/module/screenTracker.js.map +1 -1
- package/lib/module/surfaces/BannerBar.js +80 -62
- package/lib/module/surfaces/BannerBar.js.map +1 -1
- package/lib/module/surfaces/BannerSurface.js +26 -0
- package/lib/module/surfaces/BannerSurface.js.map +1 -1
- package/lib/module/surfaces/TooltipSurface.js +44 -42
- package/lib/module/surfaces/TooltipSurface.js.map +1 -1
- package/lib/module/surfaces/bannerBarLayout.js +72 -11
- package/lib/module/surfaces/bannerBarLayout.js.map +1 -1
- package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js +113 -64
- package/lib/module/surfaces/bannerWebView/BannerWebViewBar.js.map +1 -1
- package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js +59 -11
- package/lib/module/surfaces/bannerWebView/buildCustomBannerHtml.js.map +1 -1
- package/lib/module/surfaces/hostAccessibilityTrap.js +24 -0
- package/lib/module/surfaces/hostAccessibilityTrap.js.map +1 -0
- package/lib/module/surfaces/resolveBannerTheme.js +6 -3
- package/lib/module/surfaces/resolveBannerTheme.js.map +1 -1
- package/lib/module/surfaces/tooltip/TooltipBubble.js +3 -2
- package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
- package/lib/module/surfaces/tooltip/targetSearchSchedule.js +128 -0
- package/lib/module/surfaces/tooltip/targetSearchSchedule.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +36 -2
- package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts +0 -4
- package/lib/typescript/commonjs/src/anchors/animationFrame.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/appActive.d.ts +8 -0
- package/lib/typescript/commonjs/src/anchors/appActive.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts +17 -0
- package/lib/typescript/commonjs/src/anchors/elementTapMonitor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts +7 -0
- package/lib/typescript/commonjs/src/anchors/elementTargetMatch.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +7 -0
- package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +3 -2
- package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
- package/lib/typescript/commonjs/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +5 -0
- package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts +70 -0
- package/lib/typescript/commonjs/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +1 -0
- package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
- package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/resolveElementTargets.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +2 -0
- package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts +9 -0
- package/lib/typescript/commonjs/src/anchors/tapSlop.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts +13 -8
- package/lib/typescript/commonjs/src/anchors/targetPressMonitor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/content/openSafeUrl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +6 -5
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts +15 -0
- package/lib/typescript/commonjs/src/navigation/navigateUrlUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts +3 -0
- package/lib/typescript/commonjs/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts +2 -5
- package/lib/typescript/commonjs/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +6 -0
- package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/BannerHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +3 -0
- package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowOverlay.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts +5 -1
- package/lib/typescript/commonjs/src/runtime/bannerEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts +15 -0
- package/lib/typescript/commonjs/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/runtime/previewStart.d.ts +13 -0
- package/lib/typescript/commonjs/src/runtime/previewStart.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts +17 -0
- package/lib/typescript/commonjs/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts +6 -0
- package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/BannerBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts +5 -1
- package/lib/typescript/commonjs/src/surfaces/BannerSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +1 -1
- package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts +17 -0
- package/lib/typescript/commonjs/src/surfaces/bannerBarLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
- package/lib/typescript/commonjs/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts +4 -1
- package/lib/typescript/commonjs/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
- package/lib/typescript/commonjs/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +36 -2
- package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/animationFrame.d.ts +0 -4
- package/lib/typescript/module/src/anchors/animationFrame.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/appActive.d.ts +8 -0
- package/lib/typescript/module/src/anchors/appActive.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts +17 -0
- package/lib/typescript/module/src/anchors/elementTapMonitor.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts +7 -0
- package/lib/typescript/module/src/anchors/elementTargetMatch.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +7 -0
- package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +3 -2
- package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts +3 -0
- package/lib/typescript/module/src/anchors/fiber/resolveFiberPath.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +5 -0
- package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts +70 -0
- package/lib/typescript/module/src/anchors/gestureHandlerHandoff.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +1 -0
- package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +11 -4
- package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/resolveElementTargets.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +2 -0
- package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -1
- package/lib/typescript/module/src/anchors/tapSlop.d.ts +9 -0
- package/lib/typescript/module/src/anchors/tapSlop.d.ts.map +1 -0
- package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts +13 -8
- package/lib/typescript/module/src/anchors/targetPressMonitor.d.ts.map +1 -1
- package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -1
- package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
- package/lib/typescript/module/src/content/openSafeUrl.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +6 -5
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts +15 -0
- package/lib/typescript/module/src/navigation/navigateUrlUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts +3 -0
- package/lib/typescript/module/src/navigation/openExternalNavigateUrl.d.ts.map +1 -0
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts +2 -5
- package/lib/typescript/module/src/navigation/openFlowNavigateUrl.d.ts.map +1 -1
- package/lib/typescript/module/src/pairing/PairingController.d.ts +6 -0
- package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/BannerHost.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +3 -0
- package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowOverlay.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/bannerEngine.d.ts +5 -1
- package/lib/typescript/module/src/runtime/bannerEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts +15 -0
- package/lib/typescript/module/src/runtime/bannerFlowSpacer.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
- package/lib/typescript/module/src/runtime/previewStart.d.ts +13 -0
- package/lib/typescript/module/src/runtime/previewStart.d.ts.map +1 -0
- package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts +17 -0
- package/lib/typescript/module/src/runtime/pushBannerLayoutContext.d.ts.map +1 -0
- package/lib/typescript/module/src/screenTracker.d.ts +6 -0
- package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/BannerBar.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/BannerBar.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/BannerSurface.d.ts +5 -1
- package/lib/typescript/module/src/surfaces/BannerSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +1 -1
- package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts +17 -0
- package/lib/typescript/module/src/surfaces/bannerBarLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts +3 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/BannerWebViewBar.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/bannerWebView/buildCustomBannerHtml.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts +14 -0
- package/lib/typescript/module/src/surfaces/hostAccessibilityTrap.d.ts.map +1 -0
- package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts +4 -1
- package/lib/typescript/module/src/surfaces/resolveBannerTheme.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +7 -1
- package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
- package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts +60 -0
- package/lib/typescript/module/src/surfaces/tooltip/targetSearchSchedule.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/anchors/AutoAnchorRegistry.ts +166 -35
- package/src/anchors/animationFrame.ts +31 -1
- package/src/anchors/appActive.ts +63 -0
- package/src/anchors/elementConditionEvaluator.ts +29 -12
- package/src/anchors/elementTapMonitor.ts +68 -10
- package/src/anchors/elementTargetMatch.ts +34 -7
- package/src/anchors/fiber/fiberInternals.ts +68 -0
- package/src/anchors/fiber/indexHostFibers.ts +8 -3
- package/src/anchors/fiber/resolveFiberPath.ts +25 -16
- package/src/anchors/fiberAnchorCache.ts +19 -0
- package/src/anchors/gestureHandlerHandoff.ts +356 -0
- package/src/anchors/resolveAnchorHost.ts +2 -0
- package/src/anchors/resolveAutoAnchorHost.ts +18 -8
- package/src/anchors/resolveElementTargets.ts +64 -7
- package/src/anchors/semanticMatcher.ts +48 -27
- package/src/anchors/tapSlop.ts +18 -0
- package/src/anchors/targetPressMonitor.ts +56 -19
- package/src/authoring/fingerprintFromInstance.ts +4 -5
- package/src/content/RichContentRenderer.tsx +4 -3
- package/src/content/openSafeUrl.ts +3 -1
- package/src/expo-router/useUserflowExpoRouter.ts +10 -1
- package/src/index.ts +20 -9
- package/src/navigation/navigateUrlUtils.ts +100 -0
- package/src/navigation/openExternalNavigateUrl.ts +9 -0
- package/src/navigation/openFlowNavigateUrl.ts +36 -36
- package/src/pairing/PairingController.ts +9 -1
- package/src/runtime/BannerHost.tsx +41 -23
- package/src/runtime/TargetPressBridge.tsx +66 -9
- package/src/runtime/UserflowOverlay.tsx +7 -9
- package/src/runtime/UserflowProvider.tsx +56 -32
- package/src/runtime/bannerEngine.ts +10 -2
- package/src/runtime/bannerFlowSpacer.tsx +70 -0
- package/src/runtime/flowEngine.ts +11 -0
- package/src/runtime/previewStart.ts +49 -0
- package/src/runtime/pushBannerLayoutContext.tsx +121 -0
- package/src/screenTracker.ts +11 -0
- package/src/surfaces/BannerBar.tsx +93 -55
- package/src/surfaces/BannerSurface.tsx +59 -3
- package/src/surfaces/TooltipSurface.tsx +63 -51
- package/src/surfaces/bannerBarLayout.ts +80 -7
- package/src/surfaces/bannerWebView/BannerWebViewBar.tsx +149 -57
- package/src/surfaces/bannerWebView/buildCustomBannerHtml.ts +63 -11
- package/src/surfaces/hostAccessibilityTrap.ts +25 -0
- package/src/surfaces/resolveBannerTheme.ts +14 -3
- package/src/surfaces/tooltip/TooltipBubble.tsx +8 -1
- package/src/surfaces/tooltip/targetSearchSchedule.ts +140 -0
- package/src/version.ts +1 -1
- package/vendor/core/dist/engine/BannerSessionEngine.d.ts +29 -2
- package/vendor/core/dist/engine/BannerSessionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/BannerSessionEngine.js +87 -6
- package/vendor/core/dist/engine/BannerSessionEngine.js.map +1 -1
- package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/ClientConditionEngine.js +30 -7
- package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts +6 -1
- package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
- package/vendor/core/dist/engine/PairingEngine.js +23 -3
- package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
- package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
- package/vendor/core/dist/engine/handleActions.js +67 -2
- package/vendor/core/dist/engine/handleActions.js.map +1 -1
- package/vendor/core/dist/version.d.ts +1 -1
- package/vendor/core/dist/version.js +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/protocol/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.stepTrapsHostAccessibility = stepTrapsHostAccessibility;
|
|
7
|
+
/**
|
|
8
|
+
* Whether a step hides host app content from the accessibility tree.
|
|
9
|
+
*
|
|
10
|
+
* Modals always do. A tooltip does only when `tooltipTargetBlocked` seals its
|
|
11
|
+
* target too — otherwise the target is the control the step asks the user to
|
|
12
|
+
* press, so a screen reader has to be able to reach it.
|
|
13
|
+
*
|
|
14
|
+
* `UserflowOverlay` traps the host with this, and tooltip cards gate
|
|
15
|
+
* `accessibilityViewIsModal` on it: on iOS that flag alone drops the host app,
|
|
16
|
+
* target included, out of VoiceOver's reach.
|
|
17
|
+
*/
|
|
18
|
+
function stepTrapsHostAccessibility(step) {
|
|
19
|
+
const appearance = String(step.appearance).toUpperCase();
|
|
20
|
+
if (appearance === 'HIDDEN') {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (appearance !== 'TOOLTIP') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return step.tooltipTargetBlocked;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=hostAccessibilityTrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stepTrapsHostAccessibility","step","appearance","String","toUpperCase","tooltipTargetBlocked"],"sourceRoot":"../../../src","sources":["surfaces/hostAccessibilityTrap.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,0BAA0BA,CACxCC,IAAmE,EAC1D;EACT,MAAMC,UAAU,GAAGC,MAAM,CAACF,IAAI,CAACC,UAAU,CAAC,CAACE,WAAW,CAAC,CAAC;EACxD,IAAIF,UAAU,KAAK,QAAQ,EAAE;IAC3B,OAAO,KAAK;EACd;EACA,IAAIA,UAAU,KAAK,SAAS,EAAE;IAC5B,OAAO,IAAI;EACb;EACA,OAAOD,IAAI,CAACI,oBAAoB;AAClC","ignoreList":[]}
|
|
@@ -6,7 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.DEFAULT_BANNER_FOREGROUND_COLOR = exports.DEFAULT_BANNER_BACKGROUND_COLOR = void 0;
|
|
7
7
|
exports.resolveBannerBackgroundColor = resolveBannerBackgroundColor;
|
|
8
8
|
exports.resolveBannerForegroundColor = resolveBannerForegroundColor;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Last-resort banner chrome when neither banner nor brand tokens are set on the
|
|
11
|
+
* wire (web `applyThemeDefaults` falls back to brand first).
|
|
12
|
+
*/
|
|
10
13
|
const DEFAULT_BANNER_BACKGROUND_COLOR = exports.DEFAULT_BANNER_BACKGROUND_COLOR = '#0A1A24';
|
|
11
14
|
const DEFAULT_BANNER_FOREGROUND_COLOR = exports.DEFAULT_BANNER_FOREGROUND_COLOR = '#FFFFFF';
|
|
12
15
|
function readThemeColor(theme, key) {
|
|
@@ -14,9 +17,9 @@ function readThemeColor(theme, key) {
|
|
|
14
17
|
return typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined;
|
|
15
18
|
}
|
|
16
19
|
function resolveBannerBackgroundColor(theme) {
|
|
17
|
-
return readThemeColor(theme, 'bannerBackgroundColor') ?? DEFAULT_BANNER_BACKGROUND_COLOR;
|
|
20
|
+
return readThemeColor(theme, 'bannerBackgroundColor') ?? readThemeColor(theme, 'brandBackgroundColor') ?? DEFAULT_BANNER_BACKGROUND_COLOR;
|
|
18
21
|
}
|
|
19
22
|
function resolveBannerForegroundColor(theme) {
|
|
20
|
-
return readThemeColor(theme, 'bannerForegroundColor') ?? DEFAULT_BANNER_FOREGROUND_COLOR;
|
|
23
|
+
return readThemeColor(theme, 'bannerForegroundColor') ?? readThemeColor(theme, 'brandForegroundColor') ?? DEFAULT_BANNER_FOREGROUND_COLOR;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=resolveBannerTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_BANNER_BACKGROUND_COLOR","exports","DEFAULT_BANNER_FOREGROUND_COLOR","readThemeColor","theme","key","value","trim","length","undefined","resolveBannerBackgroundColor","resolveBannerForegroundColor"],"sourceRoot":"../../../src","sources":["surfaces/resolveBannerTheme.ts"],"mappings":";;;;;;;;AAEA;AACO,MAAMA,+BAA+B,GAAAC,OAAA,CAAAD,+BAAA,GAAG,SAAS;AACjD,MAAME,+BAA+B,GAAAD,OAAA,CAAAC,+BAAA,GAAG,SAAS;AAExD,SAASC,cAAcA,CAACC,KAAoB,EAAEC,GAAW,EAAsB;EAC7E,MAAMC,KAAK,GAAGF,KAAK,CAACC,GAAG,CAAC;EACxB,OAAO,OAAOC,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,GAAGF,KAAK,CAACC,IAAI,CAAC,CAAC,GAAGE,SAAS;AACxF;AAEO,SAASC,4BAA4BA,CAACN,KAAoB,EAAU;EACzE,
|
|
1
|
+
{"version":3,"names":["DEFAULT_BANNER_BACKGROUND_COLOR","exports","DEFAULT_BANNER_FOREGROUND_COLOR","readThemeColor","theme","key","value","trim","length","undefined","resolveBannerBackgroundColor","resolveBannerForegroundColor"],"sourceRoot":"../../../src","sources":["surfaces/resolveBannerTheme.ts"],"mappings":";;;;;;;;AAEA;AACA;AACA;AACA;AACO,MAAMA,+BAA+B,GAAAC,OAAA,CAAAD,+BAAA,GAAG,SAAS;AACjD,MAAME,+BAA+B,GAAAD,OAAA,CAAAC,+BAAA,GAAG,SAAS;AAExD,SAASC,cAAcA,CAACC,KAAoB,EAAEC,GAAW,EAAsB;EAC7E,MAAMC,KAAK,GAAGF,KAAK,CAACC,GAAG,CAAC;EACxB,OAAO,OAAOC,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,GAAGF,KAAK,CAACC,IAAI,CAAC,CAAC,GAAGE,SAAS;AACxF;AAEO,SAASC,4BAA4BA,CAACN,KAAoB,EAAU;EACzE,OACED,cAAc,CAACC,KAAK,EAAE,uBAAuB,CAAC,IAC9CD,cAAc,CAACC,KAAK,EAAE,sBAAsB,CAAC,IAC7CJ,+BAA+B;AAEnC;AAEO,SAASW,4BAA4BA,CAACP,KAAoB,EAAU;EACzE,OACED,cAAc,CAACC,KAAK,EAAE,uBAAuB,CAAC,IAC9CD,cAAc,CAACC,KAAK,EAAE,sBAAsB,CAAC,IAC7CF,+BAA+B;AAEnC","ignoreList":[]}
|
|
@@ -36,7 +36,8 @@ function TooltipBubble({
|
|
|
36
36
|
onLayout,
|
|
37
37
|
children,
|
|
38
38
|
maxHeight,
|
|
39
|
-
showNotch: showNotchProp = true
|
|
39
|
+
showNotch: showNotchProp = true,
|
|
40
|
+
accessibilityViewIsModal = false
|
|
40
41
|
}) {
|
|
41
42
|
const showNotch = showNotchProp && chrome.notchSize > 0;
|
|
42
43
|
const bordered = chrome.borderWidth > 0;
|
|
@@ -92,7 +93,7 @@ function TooltipBubble({
|
|
|
92
93
|
};
|
|
93
94
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CardFade.CardFade, {
|
|
94
95
|
testID: "userflow-tooltip-card",
|
|
95
|
-
accessibilityViewIsModal:
|
|
96
|
+
accessibilityViewIsModal: accessibilityViewIsModal,
|
|
96
97
|
pointerEvents: "auto",
|
|
97
98
|
onLayout: onLayout,
|
|
98
99
|
style: [styles.shell, style],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_CardFade","_absoluteFill","_TooltipNotch","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TooltipBubble","chrome","notchPosition","style","onLayout","children","maxHeight","showNotch","showNotchProp","notchSize","bordered","borderWidth","showSeamCover","notchEdge","protrudingNotchEdge","notchColor","borderColor","backgroundColor","elevation","shadowStyle","raisedSilent","shadowColor","notchShadow","Platform","OS","shadowOffset","shadowOpacity","shadowRadius","notchProps","top","undefined","bottom","left","right","jsxs","CardFade","testID","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_CardFade","_absoluteFill","_TooltipNotch","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","TooltipBubble","chrome","notchPosition","style","onLayout","children","maxHeight","showNotch","showNotchProp","accessibilityViewIsModal","notchSize","bordered","borderWidth","showSeamCover","notchEdge","protrudingNotchEdge","notchColor","borderColor","backgroundColor","elevation","shadowStyle","raisedSilent","shadowColor","notchShadow","Platform","OS","shadowOffset","shadowOpacity","shadowRadius","notchProps","top","undefined","bottom","left","right","jsxs","CardFade","testID","pointerEvents","styles","shell","jsx","View","cardShadow","borderRadius","TooltipNotch","notchLayer","fillStyle","fill","fillSkin","fillClip","notchSeamCover","edgeCapStyle","inset","Math","max","EDGE_CAP_THICKNESS","position","edge","along","height","width","StyleSheet","create","overflow","flexShrink","ABSOLUTE_FILL","zIndex","minHeight"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/TooltipBubble.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAGA,IAAAI,aAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA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nB,IAAI,EAAE;IACJmB,MAAM,EAAE,CAAC;IACTC,SAAS,EAAE,CAAC;IACZH,UAAU,EAAE;EACd,CAAC;EACDhB,QAAQ,EAAE;IACRe,QAAQ,EAAE;EACZ,CAAC;EACDd,QAAQ,EAAE;IACRc,QAAQ,EAAE,QAAQ;IAClBI,SAAS,EAAE,CAAC;IACZH,UAAU,EAAE;IACZ;IACA;EACF,CAAC;EACDd,cAAc,EAAE;IACdgB,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TargetSearchSchedule = exports.MISSING_TRIGGER_GAP_MS = exports.MISSING_BACKOFF_MAX_MS = exports.MISSING_BACKOFF_BASE_MS = exports.ANCHORED_POLL_MS = void 0;
|
|
7
|
+
exports.missingBackoffDelay = missingBackoffDelay;
|
|
8
|
+
/**
|
|
9
|
+
* When TooltipSurface looks for its target.
|
|
10
|
+
*
|
|
11
|
+
* - Anchored: a steady poll, so a covered or remounted host is noticed quickly.
|
|
12
|
+
* Each search is a cache hit for the resolved host.
|
|
13
|
+
* - Missing: exponential backoff. A miss walks the tree and scores registered
|
|
14
|
+
* hosts, so a target on another screen must not cost a full search every
|
|
15
|
+
* second for as long as the flow stays open.
|
|
16
|
+
* - Registry churn (list rows mounting while the user scrolls) pulls the next
|
|
17
|
+
* missing search forward, never closer than {@link MISSING_TRIGGER_GAP_MS}
|
|
18
|
+
* to the previous one.
|
|
19
|
+
* - A screen change or a return to the foreground starts the backoff over.
|
|
20
|
+
* - Nothing runs while paused (app not active).
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Poll while the target is anchored. */
|
|
24
|
+
const ANCHORED_POLL_MS = exports.ANCHORED_POLL_MS = 250;
|
|
25
|
+
/** First retry after a miss; doubles per consecutive miss. */
|
|
26
|
+
const MISSING_BACKOFF_BASE_MS = exports.MISSING_BACKOFF_BASE_MS = 250;
|
|
27
|
+
/** Ceiling for the missing-target backoff. */
|
|
28
|
+
const MISSING_BACKOFF_MAX_MS = exports.MISSING_BACKOFF_MAX_MS = 4000;
|
|
29
|
+
/** Closest a registry change can pull a missing search to the previous one. */
|
|
30
|
+
const MISSING_TRIGGER_GAP_MS = exports.MISSING_TRIGGER_GAP_MS = 500;
|
|
31
|
+
const defaultClock = {
|
|
32
|
+
now: () => Date.now(),
|
|
33
|
+
setTimeout: (handler, ms) => setTimeout(handler, ms),
|
|
34
|
+
clearTimeout: handle => clearTimeout(handle)
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Delay before the next search after `misses` consecutive missing searches. */
|
|
38
|
+
function missingBackoffDelay(misses) {
|
|
39
|
+
const exponent = Math.max(0, misses - 1);
|
|
40
|
+
return Math.min(MISSING_BACKOFF_MAX_MS, MISSING_BACKOFF_BASE_MS * 2 ** exponent);
|
|
41
|
+
}
|
|
42
|
+
class TargetSearchSchedule {
|
|
43
|
+
mode = 'missing';
|
|
44
|
+
/** Searches run since the target was last anchored (or the backoff restarted). */
|
|
45
|
+
misses = 0;
|
|
46
|
+
lastRunAt = Number.NEGATIVE_INFINITY;
|
|
47
|
+
handle = null;
|
|
48
|
+
dueAt = Number.POSITIVE_INFINITY;
|
|
49
|
+
paused = false;
|
|
50
|
+
disposed = false;
|
|
51
|
+
constructor(search, clock = defaultClock) {
|
|
52
|
+
this.search = search;
|
|
53
|
+
this.clock = clock;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Search now and schedule the next one. No-op while paused. */
|
|
57
|
+
runNow() {
|
|
58
|
+
if (this.disposed || this.paused) return;
|
|
59
|
+
this.cancel();
|
|
60
|
+
this.lastRunAt = this.clock.now();
|
|
61
|
+
if (this.mode === 'missing') this.misses += 1;
|
|
62
|
+
try {
|
|
63
|
+
this.search();
|
|
64
|
+
} finally {
|
|
65
|
+
if (!this.disposed && !this.paused && this.handle == null) {
|
|
66
|
+
this.scheduleIn(this.nextDelay());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The target was found or lost. Starts the matching cadence from now. */
|
|
72
|
+
setMode(mode) {
|
|
73
|
+
if (this.disposed || mode === this.mode) return;
|
|
74
|
+
this.mode = mode;
|
|
75
|
+
this.misses = 0;
|
|
76
|
+
if (this.paused) return;
|
|
77
|
+
this.scheduleIn(mode === 'anchored' ? ANCHORED_POLL_MS : MISSING_BACKOFF_BASE_MS);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Something the target may depend on changed (a registry mount / unmount). */
|
|
81
|
+
trigger() {
|
|
82
|
+
if (this.disposed || this.paused || this.mode !== 'missing') return;
|
|
83
|
+
const now = this.clock.now();
|
|
84
|
+
const dueAt = Math.max(now, this.lastRunAt + MISSING_TRIGGER_GAP_MS);
|
|
85
|
+
if (dueAt >= this.dueAt) return;
|
|
86
|
+
this.scheduleIn(dueAt - now);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Restart the backoff and search now (screen change, foreground). */
|
|
90
|
+
rearm() {
|
|
91
|
+
if (this.disposed) return;
|
|
92
|
+
this.misses = 0;
|
|
93
|
+
this.runNow();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Stop searching until {@link resume}. */
|
|
97
|
+
pause() {
|
|
98
|
+
if (this.disposed || this.paused) return;
|
|
99
|
+
this.paused = true;
|
|
100
|
+
this.cancel();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Leave the paused state and search right away. */
|
|
104
|
+
resume() {
|
|
105
|
+
if (this.disposed || !this.paused) return;
|
|
106
|
+
this.paused = false;
|
|
107
|
+
this.rearm();
|
|
108
|
+
}
|
|
109
|
+
dispose() {
|
|
110
|
+
this.cancel();
|
|
111
|
+
this.disposed = true;
|
|
112
|
+
}
|
|
113
|
+
nextDelay() {
|
|
114
|
+
return this.mode === 'anchored' ? ANCHORED_POLL_MS : missingBackoffDelay(this.misses);
|
|
115
|
+
}
|
|
116
|
+
scheduleIn(ms) {
|
|
117
|
+
this.cancel();
|
|
118
|
+
this.dueAt = this.clock.now() + ms;
|
|
119
|
+
this.handle = this.clock.setTimeout(() => {
|
|
120
|
+
this.handle = null;
|
|
121
|
+
this.dueAt = Number.POSITIVE_INFINITY;
|
|
122
|
+
this.runNow();
|
|
123
|
+
}, ms);
|
|
124
|
+
}
|
|
125
|
+
cancel() {
|
|
126
|
+
if (this.handle != null) {
|
|
127
|
+
this.clock.clearTimeout(this.handle);
|
|
128
|
+
this.handle = null;
|
|
129
|
+
}
|
|
130
|
+
this.dueAt = Number.POSITIVE_INFINITY;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.TargetSearchSchedule = TargetSearchSchedule;
|
|
134
|
+
//# sourceMappingURL=targetSearchSchedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ANCHORED_POLL_MS","exports","MISSING_BACKOFF_BASE_MS","MISSING_BACKOFF_MAX_MS","MISSING_TRIGGER_GAP_MS","defaultClock","now","Date","setTimeout","handler","ms","clearTimeout","handle","missingBackoffDelay","misses","exponent","Math","max","min","TargetSearchSchedule","mode","lastRunAt","Number","NEGATIVE_INFINITY","dueAt","POSITIVE_INFINITY","paused","disposed","constructor","search","clock","runNow","cancel","scheduleIn","nextDelay","setMode","trigger","rearm","pause","resume","dispose"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/targetSearchSchedule.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,GAAG;AACnC;AACO,MAAME,uBAAuB,GAAAD,OAAA,CAAAC,uBAAA,GAAG,GAAG;AAC1C;AACO,MAAMC,sBAAsB,GAAAF,OAAA,CAAAE,sBA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5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SDK_VERSION = void 0;
|
|
7
7
|
/** Generated by scripts/write-version.mjs — do not edit. */
|
|
8
|
-
const SDK_VERSION = exports.SDK_VERSION = '0.
|
|
8
|
+
const SDK_VERSION = exports.SDK_VERSION = '0.5.0';
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { getLiveHostProps } from "./fiber/fiberInternals.js";
|
|
3
|
+
import { createCurrentFiberResolver, getLiveHostProps } from "./fiber/fiberInternals.js";
|
|
4
4
|
import { createLazyHostFiberIndex, lookupHostFiber } from "./fiber/indexHostFibers.js";
|
|
5
5
|
import { readHostPlaceholder, readHostText } from "./fiber/readHostContent.js";
|
|
6
6
|
|
|
@@ -46,6 +46,9 @@ function contentSignature(inst) {
|
|
|
46
46
|
const parts = [inst.childText, inst.accessibilityLabel, inst.iconName, inst.imageSrc].filter(part => !!part);
|
|
47
47
|
return parts.length > 0 ? parts.join('\u0000') : undefined;
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
/** Twin evidence for one registry group, computed once per settle. */
|
|
51
|
+
|
|
49
52
|
export class AutoAnchorRegistry {
|
|
50
53
|
instances = new Map();
|
|
51
54
|
byRegistryKey = new Map();
|
|
@@ -54,6 +57,22 @@ export class AutoAnchorRegistry {
|
|
|
54
57
|
liveContent = new Map();
|
|
55
58
|
listeners = new Set();
|
|
56
59
|
notifyScheduled = false;
|
|
60
|
+
/** Settled {@link AutoAnchorInstance.ambiguous} verdicts by instance id. */
|
|
61
|
+
ambiguity = new Map();
|
|
62
|
+
/**
|
|
63
|
+
* Groups whose verdicts are out of date: `r:` registry key, `t:` template
|
|
64
|
+
* path, `m:` manual id. Mounting a list or reading changed row labels marks
|
|
65
|
+
* a group once; it is settled once, on the next read of a verdict, instead
|
|
66
|
+
* of being recomputed for every member that changed.
|
|
67
|
+
*/
|
|
68
|
+
staleGroups = new Set();
|
|
69
|
+
/**
|
|
70
|
+
* Set instead of {@link staleGroups} once that outgrows the registry: with
|
|
71
|
+
* no flow or element condition reading verdicts, marks from list mounts
|
|
72
|
+
* would otherwise pile up for the whole session.
|
|
73
|
+
*/
|
|
74
|
+
allStale = false;
|
|
75
|
+
settling = false;
|
|
57
76
|
registerInstance(input) {
|
|
58
77
|
const instanceId = mintInstanceId();
|
|
59
78
|
const hints = input.hints ?? undefined;
|
|
@@ -122,6 +141,7 @@ export class AutoAnchorRegistry {
|
|
|
122
141
|
childInstanceIds: [],
|
|
123
142
|
ambiguous: false
|
|
124
143
|
};
|
|
144
|
+
this.defineAmbiguity(instance);
|
|
125
145
|
this.instances.set(instanceId, instance);
|
|
126
146
|
this.addIndex(this.byRegistryKey, input.registryKey, instanceId);
|
|
127
147
|
this.addIndex(this.byTemplatePath, templatePath, instanceId);
|
|
@@ -132,7 +152,7 @@ export class AutoAnchorRegistry {
|
|
|
132
152
|
const parent = this.instances.get(input.parentInstanceId);
|
|
133
153
|
if (parent) parent.childInstanceIds.push(instanceId);
|
|
134
154
|
}
|
|
135
|
-
this.
|
|
155
|
+
this.markStale(instance);
|
|
136
156
|
this.notify();
|
|
137
157
|
return {
|
|
138
158
|
instanceId,
|
|
@@ -159,7 +179,7 @@ export class AutoAnchorRegistry {
|
|
|
159
179
|
if (nextManual) inst.manualId = nextManual;else delete inst.manualId;
|
|
160
180
|
}
|
|
161
181
|
this.refreshManualIndexes(inst, prevIds);
|
|
162
|
-
this.
|
|
182
|
+
this.markStale(inst, prevIds.manualId, prevIds.userflowId, prevIds.testID);
|
|
163
183
|
this.notify();
|
|
164
184
|
}
|
|
165
185
|
getInstance(instanceId) {
|
|
@@ -220,24 +240,27 @@ export class AutoAnchorRegistry {
|
|
|
220
240
|
*
|
|
221
241
|
* Direct fiber pointers are preferred; the scan-root index is built lazily
|
|
222
242
|
* and only if some instance cannot reach its fiber that way (Paper release
|
|
223
|
-
* builds, mainly), then reused for the rest of the pass.
|
|
243
|
+
* builds, mainly), then reused for the rest of the pass. Finding which fiber
|
|
244
|
+
* of each pair is committed walks to the root; the pass shares one walk per
|
|
245
|
+
* ancestor across every instance.
|
|
224
246
|
*
|
|
225
247
|
* Silent — does not notify listeners.
|
|
226
248
|
*/
|
|
227
249
|
refreshLiveContent(instances) {
|
|
228
250
|
const list = instances ?? this.allInstances();
|
|
229
251
|
const getIndex = createLazyHostFiberIndex();
|
|
252
|
+
const resolveCurrent = createCurrentFiberResolver();
|
|
230
253
|
const seen = new Set();
|
|
231
254
|
for (const inst of list) {
|
|
232
255
|
if (seen.has(inst.instanceId)) continue;
|
|
233
256
|
seen.add(inst.instanceId);
|
|
234
|
-
this.refreshOneLiveContent(inst, getIndex);
|
|
257
|
+
this.refreshOneLiveContent(inst, getIndex, resolveCurrent);
|
|
235
258
|
}
|
|
236
259
|
}
|
|
237
|
-
refreshOneLiveContent(inst, getIndex) {
|
|
260
|
+
refreshOneLiveContent(inst, getIndex, resolveCurrent) {
|
|
238
261
|
let fiber = null;
|
|
239
262
|
try {
|
|
240
|
-
fiber = lookupHostFiber(getIndex, inst.ref.current);
|
|
263
|
+
fiber = lookupHostFiber(getIndex, inst.ref.current, resolveCurrent);
|
|
241
264
|
} catch {
|
|
242
265
|
fiber = null;
|
|
243
266
|
}
|
|
@@ -248,12 +271,18 @@ export class AutoAnchorRegistry {
|
|
|
248
271
|
} catch {
|
|
249
272
|
props = undefined;
|
|
250
273
|
}
|
|
274
|
+
|
|
275
|
+
// Same committed fiber and same props object means nothing was committed
|
|
276
|
+
// here since the last read, so the subtree walk would return what we
|
|
277
|
+
// already have. A commit that re-renders this host or anything inside it
|
|
278
|
+
// makes the other fiber of the pair current, even when the host keeps its
|
|
279
|
+
// props object. Both only change at commit, unlike Fabric's
|
|
280
|
+
// `canonical.currentProps`, which is written during render and stays the
|
|
281
|
+
// same object when only a child changed. Matters because resolution polls
|
|
282
|
+
// this for every registered instance.
|
|
251
283
|
const cached = this.liveContent.get(inst.instanceId);
|
|
252
|
-
// Same fiber and same props object means no re-render since the last read,
|
|
253
|
-
// so the subtree walk would return what we already have. Matters because
|
|
254
|
-
// resolution polls this for every registered instance.
|
|
255
284
|
if (cached && cached.fiber === fiber && props !== undefined && cached.props === props) {
|
|
256
|
-
inst.childText = cached.childText;
|
|
285
|
+
if (cached.childText !== undefined) inst.childText = cached.childText;
|
|
257
286
|
return;
|
|
258
287
|
}
|
|
259
288
|
if (props) this.applyLiveIdentity(inst, props);
|
|
@@ -263,21 +292,19 @@ export class AutoAnchorRegistry {
|
|
|
263
292
|
} catch {
|
|
264
293
|
live = undefined;
|
|
265
294
|
}
|
|
266
|
-
|
|
267
|
-
|
|
295
|
+
|
|
296
|
+
// A host with no readable text is cached too, so it is not walked again
|
|
297
|
+
// until it re-renders; its build-time hint stays.
|
|
298
|
+
this.liveContent.set(inst.instanceId, {
|
|
299
|
+
fiber,
|
|
300
|
+
props,
|
|
301
|
+
childText: live
|
|
302
|
+
});
|
|
303
|
+
if (live && inst.childText !== live) {
|
|
268
304
|
inst.childText = live;
|
|
269
|
-
this.liveContent.set(inst.instanceId, {
|
|
270
|
-
fiber,
|
|
271
|
-
props,
|
|
272
|
-
childText: live
|
|
273
|
-
});
|
|
274
305
|
// Text is what separates helper-rendered twins, so the group's ambiguity
|
|
275
306
|
// verdict is only trustworthy once it has been read.
|
|
276
|
-
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
if (cached && cached.fiber !== fiber) {
|
|
280
|
-
this.liveContent.delete(inst.instanceId);
|
|
307
|
+
this.markStale(inst);
|
|
281
308
|
}
|
|
282
309
|
}
|
|
283
310
|
|
|
@@ -300,7 +327,7 @@ export class AutoAnchorRegistry {
|
|
|
300
327
|
inst.manualId = liveTestID;
|
|
301
328
|
}
|
|
302
329
|
this.refreshManualIndexes(inst, prev);
|
|
303
|
-
this.
|
|
330
|
+
this.markStale(inst, prev.manualId, prev.userflowId, prev.testID);
|
|
304
331
|
}
|
|
305
332
|
subscribe(listener) {
|
|
306
333
|
this.listeners.add(listener);
|
|
@@ -336,6 +363,9 @@ export class AutoAnchorRegistry {
|
|
|
336
363
|
this.byManualId.clear();
|
|
337
364
|
this.byTemplatePath.clear();
|
|
338
365
|
this.liveContent.clear();
|
|
366
|
+
this.ambiguity.clear();
|
|
367
|
+
this.staleGroups.clear();
|
|
368
|
+
this.allStale = false;
|
|
339
369
|
this.notifyScheduled = false;
|
|
340
370
|
nextInstanceSeq = 1;
|
|
341
371
|
}
|
|
@@ -354,12 +384,13 @@ export class AutoAnchorRegistry {
|
|
|
354
384
|
}
|
|
355
385
|
this.instances.delete(instanceId);
|
|
356
386
|
this.liveContent.delete(instanceId);
|
|
387
|
+
this.ambiguity.delete(instanceId);
|
|
357
388
|
this.removeIndex(this.byRegistryKey, inst.registryKey, instanceId);
|
|
358
389
|
this.removeIndex(this.byTemplatePath, inst.templatePath, instanceId);
|
|
359
390
|
if (inst.manualId) this.removeIndex(this.byManualId, inst.manualId, instanceId);
|
|
360
391
|
if (inst.userflowId) this.removeIndex(this.byManualId, inst.userflowId, instanceId);
|
|
361
392
|
if (inst.testID) this.removeIndex(this.byManualId, inst.testID, instanceId);
|
|
362
|
-
this.
|
|
393
|
+
this.markStale(inst);
|
|
363
394
|
this.notify();
|
|
364
395
|
}
|
|
365
396
|
refreshManualIndexes(inst, prev) {
|
|
@@ -391,25 +422,104 @@ export class AutoAnchorRegistry {
|
|
|
391
422
|
return false;
|
|
392
423
|
}
|
|
393
424
|
|
|
425
|
+
/**
|
|
426
|
+
* Back {@link AutoAnchorInstance.ambiguous} with a verdict that is settled on
|
|
427
|
+
* read, so callers holding an instance always see the current value.
|
|
428
|
+
*/
|
|
429
|
+
defineAmbiguity(inst) {
|
|
430
|
+
const id = inst.instanceId;
|
|
431
|
+
Object.defineProperty(inst, 'ambiguous', {
|
|
432
|
+
configurable: true,
|
|
433
|
+
enumerable: true,
|
|
434
|
+
get: () => {
|
|
435
|
+
this.settleAmbiguity();
|
|
436
|
+
return this.ambiguity.get(id) ?? false;
|
|
437
|
+
},
|
|
438
|
+
set: value => {
|
|
439
|
+
this.ambiguity.set(id, value);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/** Every group `inst` belongs to, plus ids it was indexed under before a change. */
|
|
445
|
+
markStale(inst, ...previousIds) {
|
|
446
|
+
if (this.allStale) return;
|
|
447
|
+
this.staleGroups.add(`r:${inst.registryKey}`);
|
|
448
|
+
this.staleGroups.add(`t:${inst.templatePath}`);
|
|
449
|
+
for (const id of [inst.manualId, inst.userflowId, inst.testID, ...previousIds]) {
|
|
450
|
+
if (id) this.staleGroups.add(`m:${id}`);
|
|
451
|
+
}
|
|
452
|
+
// Settling every instance is linear in the registry, so past this size
|
|
453
|
+
// tracking groups no longer saves work.
|
|
454
|
+
if (this.staleGroups.size > this.instances.size) {
|
|
455
|
+
this.allStale = true;
|
|
456
|
+
this.staleGroups.clear();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
groupIds(groupKey) {
|
|
460
|
+
const value = groupKey.slice(2);
|
|
461
|
+
if (groupKey.startsWith('r:')) return this.byRegistryKey.get(value);
|
|
462
|
+
if (groupKey.startsWith('t:')) return this.byTemplatePath.get(value);
|
|
463
|
+
return this.byManualId.get(value);
|
|
464
|
+
}
|
|
465
|
+
|
|
394
466
|
/**
|
|
395
467
|
* Instances sharing a template path are only twins while they look alike.
|
|
396
468
|
* Four rows from one `field()` helper are indistinguishable at register time
|
|
397
469
|
* and separate once their labels are read, so ambiguity is decided on
|
|
398
470
|
* content, not on the shared path alone. An instance stays ambiguous when it
|
|
399
471
|
* carries no content of its own, or when a peer carries the same content.
|
|
472
|
+
* An instance with a manual id is ambiguous only when another shares the id.
|
|
473
|
+
*
|
|
474
|
+
* Each stale group is settled once, in time linear in its size: recomputing
|
|
475
|
+
* a whole group for every member that changed made a list whose labels all
|
|
476
|
+
* changed cost the cube of its length.
|
|
400
477
|
*/
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
478
|
+
settleAmbiguity() {
|
|
479
|
+
if (this.staleGroups.size === 0 && !this.allStale || this.settling) return;
|
|
480
|
+
this.settling = true;
|
|
481
|
+
try {
|
|
482
|
+
const affected = new Set(this.allStale ? this.instances.keys() : []);
|
|
483
|
+
for (const groupKey of this.staleGroups) {
|
|
484
|
+
const ids = this.groupIds(groupKey);
|
|
485
|
+
if (ids) for (const id of ids) affected.add(id);
|
|
405
486
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
487
|
+
this.staleGroups.clear();
|
|
488
|
+
this.allStale = false;
|
|
489
|
+
const twinGroups = new Map();
|
|
490
|
+
for (const id of affected) {
|
|
491
|
+
const inst = this.instances.get(id);
|
|
492
|
+
if (!inst) continue;
|
|
493
|
+
this.ambiguity.set(id, this.computeAmbiguous(inst, twinGroups));
|
|
494
|
+
}
|
|
495
|
+
} finally {
|
|
496
|
+
this.settling = false;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
computeAmbiguous(inst, twinGroups) {
|
|
500
|
+
if (inst.manualId) return (this.byManualId.get(inst.manualId)?.size ?? 0) > 1;
|
|
501
|
+
return this.isTwinInGroup(inst, `r:${inst.registryKey}`, twinGroups) || this.isTwinInGroup(inst, `t:${inst.templatePath}`, twinGroups);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/** {@link isTwinWithin} against a whole registry group, with the group's evidence memoized. */
|
|
505
|
+
isTwinInGroup(inst, groupKey, twinGroups) {
|
|
506
|
+
let group = twinGroups.get(groupKey);
|
|
507
|
+
if (!group) {
|
|
508
|
+
const members = this.idsToInstances(this.groupIds(groupKey));
|
|
509
|
+
const signatures = new Map();
|
|
510
|
+
for (const member of members) {
|
|
511
|
+
const sig = contentSignature(member);
|
|
512
|
+
if (sig) signatures.set(sig, (signatures.get(sig) ?? 0) + 1);
|
|
513
|
+
}
|
|
514
|
+
group = {
|
|
515
|
+
unlabelled: members.length > 1 && members.every(member => !member.manualId),
|
|
516
|
+
signatures
|
|
517
|
+
};
|
|
518
|
+
twinGroups.set(groupKey, group);
|
|
412
519
|
}
|
|
520
|
+
if (!group.unlabelled) return false;
|
|
521
|
+
const sig = contentSignature(inst);
|
|
522
|
+
return !sig || (group.signatures.get(sig) ?? 0) > 1;
|
|
413
523
|
}
|
|
414
524
|
addIndex(map, key, instanceId) {
|
|
415
525
|
let set = map.get(key);
|