@userflow-tech/react-native 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (788) hide show
  1. package/README.md +97 -61
  2. package/app.plugin.js +11 -1
  3. package/babel-plugin/index.d.ts +8 -8
  4. package/babel-plugin/index.d.ts.map +1 -1
  5. package/babel-plugin/index.js +17 -9
  6. package/babel-plugin/index.js.map +1 -1
  7. package/babel-plugin.js +13 -0
  8. package/docs/anchoring.md +141 -13
  9. package/docs/deep-linking.md +18 -15
  10. package/docs/theme-mapping.md +44 -15
  11. package/docs/troubleshooting.md +36 -29
  12. package/expo-plugin/withUserflow.js +1 -1
  13. package/expo-plugin/withUserflow.js.map +1 -1
  14. package/lib/commonjs/anchors/AutoAnchorRegistry.js +124 -2
  15. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  16. package/lib/commonjs/anchors/anchorChangeTicker.js +10 -0
  17. package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -1
  18. package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -12
  19. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  20. package/lib/commonjs/anchors/fiber/FiberScanRoot.js +11 -47
  21. package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -1
  22. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +50 -0
  23. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -0
  24. package/lib/commonjs/anchors/fiber/fiberInternals.js +145 -3
  25. package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
  26. package/lib/commonjs/anchors/fiber/indexHostFibers.js +129 -0
  27. package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -0
  28. package/lib/commonjs/anchors/fiber/readHostContent.js +131 -0
  29. package/lib/commonjs/anchors/fiber/readHostContent.js.map +1 -0
  30. package/lib/commonjs/anchors/fiberAnchorCache.js +50 -0
  31. package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -0
  32. package/lib/commonjs/anchors/resolveAnchorHost.js +15 -21
  33. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  34. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +171 -0
  35. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -0
  36. package/lib/commonjs/anchors/semanticMatcher.js +285 -0
  37. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -0
  38. package/lib/commonjs/authoring/ElementPickerOverlay.js +490 -0
  39. package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -0
  40. package/lib/commonjs/authoring/capturePickerScreenshot.js +73 -0
  41. package/lib/commonjs/authoring/capturePickerScreenshot.js.map +1 -0
  42. package/lib/commonjs/authoring/chrome/ChromeBarTransition.js +94 -0
  43. package/lib/commonjs/authoring/chrome/ChromeBarTransition.js.map +1 -0
  44. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +64 -0
  45. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -0
  46. package/lib/commonjs/authoring/chrome/ChromeButton.js +94 -0
  47. package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -0
  48. package/lib/commonjs/authoring/chrome/ChromeDialog.js +131 -0
  49. package/lib/commonjs/authoring/chrome/ChromeDialog.js.map +1 -0
  50. package/lib/commonjs/authoring/chrome/ChromeIcon.js +39 -0
  51. package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -0
  52. package/lib/commonjs/authoring/chrome/ChromeTooltip.js +88 -0
  53. package/lib/commonjs/authoring/chrome/ChromeTooltip.js.map +1 -0
  54. package/lib/commonjs/authoring/chrome/ChromeTopBar.js +110 -0
  55. package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -0
  56. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +57 -0
  57. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -0
  58. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +80 -0
  59. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -0
  60. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  61. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  62. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  63. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  64. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  65. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  66. package/lib/commonjs/authoring/chrome/icons/userflow-logomark.png +0 -0
  67. package/lib/commonjs/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  68. package/lib/commonjs/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  69. package/lib/commonjs/authoring/chrome/icons/xmark.png +0 -0
  70. package/lib/commonjs/authoring/chrome/icons/xmark@2x.png +0 -0
  71. package/lib/commonjs/authoring/chrome/icons/xmark@3x.png +0 -0
  72. package/lib/commonjs/authoring/chrome/tokens.js +150 -0
  73. package/lib/commonjs/authoring/chrome/tokens.js.map +1 -0
  74. package/lib/commonjs/authoring/doubleTap.js +23 -0
  75. package/lib/commonjs/authoring/doubleTap.js.map +1 -0
  76. package/lib/commonjs/authoring/elementPickerController.js +102 -0
  77. package/lib/commonjs/authoring/elementPickerController.js.map +1 -0
  78. package/lib/commonjs/authoring/fingerprintFromInstance.js +195 -0
  79. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -0
  80. package/lib/commonjs/authoring/hitTest.js +106 -0
  81. package/lib/commonjs/authoring/hitTest.js.map +1 -0
  82. package/lib/commonjs/content/RichContentRenderer.js +12 -2
  83. package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
  84. package/lib/commonjs/content/StepButton.js +19 -4
  85. package/lib/commonjs/content/StepButton.js.map +1 -1
  86. package/lib/commonjs/content/resolveStepButtonChrome.js +8 -6
  87. package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -1
  88. package/lib/commonjs/content/themeColor.js +11 -0
  89. package/lib/commonjs/content/themeColor.js.map +1 -1
  90. package/lib/commonjs/deviceContext.js +158 -0
  91. package/lib/commonjs/deviceContext.js.map +1 -0
  92. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +40 -4
  93. package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
  94. package/lib/commonjs/hostAppVersion.js +242 -0
  95. package/lib/commonjs/hostAppVersion.js.map +1 -0
  96. package/lib/commonjs/index.js +118 -5
  97. package/lib/commonjs/index.js.map +1 -1
  98. package/lib/commonjs/lifecycle.js +2 -0
  99. package/lib/commonjs/lifecycle.js.map +1 -1
  100. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +17 -8
  101. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
  102. package/lib/commonjs/navigation/isOverlayPresentation.js +64 -0
  103. package/lib/commonjs/navigation/isOverlayPresentation.js.map +1 -0
  104. package/lib/commonjs/pairing/PairingController.js +29 -2
  105. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  106. package/lib/commonjs/pairing/PreviewModeBanner.js +211 -84
  107. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
  108. package/lib/commonjs/pairing/diagnostics.js +9 -0
  109. package/lib/commonjs/pairing/diagnostics.js.map +1 -1
  110. package/lib/commonjs/pairing/elementPickerRelay.js +91 -0
  111. package/lib/commonjs/pairing/elementPickerRelay.js.map +1 -0
  112. package/lib/commonjs/pairing/resolvePreviewChrome.js +52 -0
  113. package/lib/commonjs/pairing/resolvePreviewChrome.js.map +1 -0
  114. package/lib/commonjs/pairing/tokenStorage.js +25 -2
  115. package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
  116. package/lib/commonjs/pairing/usePairingState.js +3 -1
  117. package/lib/commonjs/pairing/usePairingState.js.map +1 -1
  118. package/lib/commonjs/runtime/FlowRenderer.js +45 -21
  119. package/lib/commonjs/runtime/FlowRenderer.js.map +1 -1
  120. package/lib/commonjs/runtime/FlowSurfaceFade.js +47 -24
  121. package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -1
  122. package/lib/commonjs/runtime/TargetPressBridge.js +13 -44
  123. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  124. package/lib/commonjs/runtime/UserflowProvider.js +74 -20
  125. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  126. package/lib/commonjs/runtime/changedTouchPoints.js +48 -0
  127. package/lib/commonjs/runtime/changedTouchPoints.js.map +1 -0
  128. package/lib/commonjs/runtime/flowEngine.js +3 -1
  129. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  130. package/lib/commonjs/runtime/flowSessionViewState.js +32 -7
  131. package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -1
  132. package/lib/commonjs/runtime/useFlowSessionState.js +2 -1
  133. package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -1
  134. package/lib/commonjs/screenTracker.js +46 -4
  135. package/lib/commonjs/screenTracker.js.map +1 -1
  136. package/lib/commonjs/surfaces/CardFade.js +31 -0
  137. package/lib/commonjs/surfaces/CardFade.js.map +1 -0
  138. package/lib/commonjs/surfaces/CloseButton.js +11 -6
  139. package/lib/commonjs/surfaces/CloseButton.js.map +1 -1
  140. package/lib/commonjs/surfaces/ModalSurface.js +50 -34
  141. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
  142. package/lib/commonjs/surfaces/TooltipSurface.js +366 -87
  143. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  144. package/lib/commonjs/surfaces/cardTransition.js +70 -0
  145. package/lib/commonjs/surfaces/cardTransition.js.map +1 -0
  146. package/lib/commonjs/surfaces/resolveHighlightChrome.js +109 -0
  147. package/lib/commonjs/surfaces/resolveHighlightChrome.js.map +1 -0
  148. package/lib/commonjs/surfaces/resolveModalLayout.js +7 -3
  149. package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -1
  150. package/lib/commonjs/surfaces/resolveTooltipLayout.js +0 -4
  151. package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -1
  152. package/lib/commonjs/surfaces/surfaceInteractionConfig.js +33 -0
  153. package/lib/commonjs/surfaces/surfaceInteractionConfig.js.map +1 -0
  154. package/lib/commonjs/surfaces/surfaceLayoutInsets.js +128 -0
  155. package/lib/commonjs/surfaces/surfaceLayoutInsets.js.map +1 -0
  156. package/lib/commonjs/surfaces/themeChrome.js +4 -1
  157. package/lib/commonjs/surfaces/themeChrome.js.map +1 -1
  158. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +142 -21
  159. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
  160. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +100 -47
  161. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -1
  162. package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js +124 -0
  163. package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js.map +1 -0
  164. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +67 -13
  165. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
  166. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +88 -19
  167. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
  168. package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js +52 -0
  169. package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js.map +1 -0
  170. package/lib/commonjs/surfaces/tooltip/rect.js +12 -0
  171. package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -1
  172. package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js +103 -0
  173. package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
  174. package/lib/commonjs/version.js +1 -1
  175. package/lib/module/anchors/AutoAnchorRegistry.js +125 -2
  176. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  177. package/lib/module/anchors/anchorChangeTicker.js +10 -0
  178. package/lib/module/anchors/anchorChangeTicker.js.map +1 -1
  179. package/lib/module/anchors/elementConditionEvaluator.js +25 -12
  180. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  181. package/lib/module/anchors/fiber/FiberScanRoot.js +2 -43
  182. package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -1
  183. package/lib/module/anchors/fiber/FiberScanRootStore.js +46 -0
  184. package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -0
  185. package/lib/module/anchors/fiber/fiberInternals.js +139 -3
  186. package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
  187. package/lib/module/anchors/fiber/indexHostFibers.js +122 -0
  188. package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -0
  189. package/lib/module/anchors/fiber/readHostContent.js +127 -0
  190. package/lib/module/anchors/fiber/readHostContent.js.map +1 -0
  191. package/lib/module/anchors/fiberAnchorCache.js +40 -0
  192. package/lib/module/anchors/fiberAnchorCache.js.map +1 -0
  193. package/lib/module/anchors/resolveAnchorHost.js +15 -21
  194. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  195. package/lib/module/anchors/resolveAutoAnchorHost.js +167 -0
  196. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -0
  197. package/lib/module/anchors/semanticMatcher.js +280 -0
  198. package/lib/module/anchors/semanticMatcher.js.map +1 -0
  199. package/lib/module/authoring/ElementPickerOverlay.js +485 -0
  200. package/lib/module/authoring/ElementPickerOverlay.js.map +1 -0
  201. package/lib/module/authoring/capturePickerScreenshot.js +68 -0
  202. package/lib/module/authoring/capturePickerScreenshot.js.map +1 -0
  203. package/lib/module/authoring/chrome/ChromeBarTransition.js +88 -0
  204. package/lib/module/authoring/chrome/ChromeBarTransition.js.map +1 -0
  205. package/lib/module/authoring/chrome/ChromeBottomSheet.js +59 -0
  206. package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -0
  207. package/lib/module/authoring/chrome/ChromeButton.js +89 -0
  208. package/lib/module/authoring/chrome/ChromeButton.js.map +1 -0
  209. package/lib/module/authoring/chrome/ChromeDialog.js +126 -0
  210. package/lib/module/authoring/chrome/ChromeDialog.js.map +1 -0
  211. package/lib/module/authoring/chrome/ChromeIcon.js +33 -0
  212. package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -0
  213. package/lib/module/authoring/chrome/ChromeTooltip.js +82 -0
  214. package/lib/module/authoring/chrome/ChromeTooltip.js.map +1 -0
  215. package/lib/module/authoring/chrome/ChromeTopBar.js +104 -0
  216. package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -0
  217. package/lib/module/authoring/chrome/DoubleTapBridge.js +52 -0
  218. package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -0
  219. package/lib/module/authoring/chrome/doubleTapMonitor.js +75 -0
  220. package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -0
  221. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  222. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  223. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  224. package/lib/module/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  225. package/lib/module/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  226. package/lib/module/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  227. package/lib/module/authoring/chrome/icons/userflow-logomark.png +0 -0
  228. package/lib/module/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  229. package/lib/module/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  230. package/lib/module/authoring/chrome/icons/xmark.png +0 -0
  231. package/lib/module/authoring/chrome/icons/xmark@2x.png +0 -0
  232. package/lib/module/authoring/chrome/icons/xmark@3x.png +0 -0
  233. package/lib/module/authoring/chrome/tokens.js +146 -0
  234. package/lib/module/authoring/chrome/tokens.js.map +1 -0
  235. package/lib/module/authoring/doubleTap.js +18 -0
  236. package/lib/module/authoring/doubleTap.js.map +1 -0
  237. package/lib/module/authoring/elementPickerController.js +97 -0
  238. package/lib/module/authoring/elementPickerController.js.map +1 -0
  239. package/lib/module/authoring/fingerprintFromInstance.js +187 -0
  240. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -0
  241. package/lib/module/authoring/hitTest.js +100 -0
  242. package/lib/module/authoring/hitTest.js.map +1 -0
  243. package/lib/module/content/RichContentRenderer.js +12 -2
  244. package/lib/module/content/RichContentRenderer.js.map +1 -1
  245. package/lib/module/content/StepButton.js +19 -4
  246. package/lib/module/content/StepButton.js.map +1 -1
  247. package/lib/module/content/resolveStepButtonChrome.js +8 -6
  248. package/lib/module/content/resolveStepButtonChrome.js.map +1 -1
  249. package/lib/module/content/themeColor.js +10 -0
  250. package/lib/module/content/themeColor.js.map +1 -1
  251. package/lib/module/deviceContext.js +142 -0
  252. package/lib/module/deviceContext.js.map +1 -0
  253. package/lib/module/expo-router/useUserflowExpoRouter.js +42 -6
  254. package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
  255. package/lib/module/hostAppVersion.js +225 -0
  256. package/lib/module/hostAppVersion.js.map +1 -0
  257. package/lib/module/index.js +119 -6
  258. package/lib/module/index.js.map +1 -1
  259. package/lib/module/lifecycle.js +2 -0
  260. package/lib/module/lifecycle.js.map +1 -1
  261. package/lib/module/navigation/WithUserflowReactNavigation.js +18 -9
  262. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
  263. package/lib/module/navigation/isOverlayPresentation.js +58 -0
  264. package/lib/module/navigation/isOverlayPresentation.js.map +1 -0
  265. package/lib/module/pairing/PairingController.js +30 -3
  266. package/lib/module/pairing/PairingController.js.map +1 -1
  267. package/lib/module/pairing/PreviewModeBanner.js +212 -85
  268. package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
  269. package/lib/module/pairing/diagnostics.js +8 -0
  270. package/lib/module/pairing/diagnostics.js.map +1 -1
  271. package/lib/module/pairing/elementPickerRelay.js +87 -0
  272. package/lib/module/pairing/elementPickerRelay.js.map +1 -0
  273. package/lib/module/pairing/resolvePreviewChrome.js +48 -0
  274. package/lib/module/pairing/resolvePreviewChrome.js.map +1 -0
  275. package/lib/module/pairing/tokenStorage.js +24 -2
  276. package/lib/module/pairing/tokenStorage.js.map +1 -1
  277. package/lib/module/pairing/usePairingState.js +3 -1
  278. package/lib/module/pairing/usePairingState.js.map +1 -1
  279. package/lib/module/runtime/FlowRenderer.js +45 -21
  280. package/lib/module/runtime/FlowRenderer.js.map +1 -1
  281. package/lib/module/runtime/FlowSurfaceFade.js +49 -26
  282. package/lib/module/runtime/FlowSurfaceFade.js.map +1 -1
  283. package/lib/module/runtime/TargetPressBridge.js +12 -43
  284. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  285. package/lib/module/runtime/UserflowProvider.js +74 -20
  286. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  287. package/lib/module/runtime/changedTouchPoints.js +43 -0
  288. package/lib/module/runtime/changedTouchPoints.js.map +1 -0
  289. package/lib/module/runtime/flowEngine.js +3 -1
  290. package/lib/module/runtime/flowEngine.js.map +1 -1
  291. package/lib/module/runtime/flowSessionViewState.js +32 -7
  292. package/lib/module/runtime/flowSessionViewState.js.map +1 -1
  293. package/lib/module/runtime/useFlowSessionState.js +2 -1
  294. package/lib/module/runtime/useFlowSessionState.js.map +1 -1
  295. package/lib/module/screenTracker.js +42 -4
  296. package/lib/module/screenTracker.js.map +1 -1
  297. package/lib/module/surfaces/CardFade.js +26 -0
  298. package/lib/module/surfaces/CardFade.js.map +1 -0
  299. package/lib/module/surfaces/CloseButton.js +10 -6
  300. package/lib/module/surfaces/CloseButton.js.map +1 -1
  301. package/lib/module/surfaces/ModalSurface.js +52 -36
  302. package/lib/module/surfaces/ModalSurface.js.map +1 -1
  303. package/lib/module/surfaces/TooltipSurface.js +368 -90
  304. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  305. package/lib/module/surfaces/cardTransition.js +64 -0
  306. package/lib/module/surfaces/cardTransition.js.map +1 -0
  307. package/lib/module/surfaces/resolveHighlightChrome.js +102 -0
  308. package/lib/module/surfaces/resolveHighlightChrome.js.map +1 -0
  309. package/lib/module/surfaces/resolveModalLayout.js +7 -3
  310. package/lib/module/surfaces/resolveModalLayout.js.map +1 -1
  311. package/lib/module/surfaces/resolveTooltipLayout.js +1 -4
  312. package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -1
  313. package/lib/module/surfaces/surfaceInteractionConfig.js +27 -0
  314. package/lib/module/surfaces/surfaceInteractionConfig.js.map +1 -0
  315. package/lib/module/surfaces/surfaceLayoutInsets.js +119 -0
  316. package/lib/module/surfaces/surfaceLayoutInsets.js.map +1 -0
  317. package/lib/module/surfaces/themeChrome.js +3 -1
  318. package/lib/module/surfaces/themeChrome.js.map +1 -1
  319. package/lib/module/surfaces/tooltip/TooltipBubble.js +143 -22
  320. package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
  321. package/lib/module/surfaces/tooltip/TooltipCutout.js +100 -47
  322. package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -1
  323. package/lib/module/surfaces/tooltip/TooltipHighlight.js +118 -0
  324. package/lib/module/surfaces/tooltip/TooltipHighlight.js.map +1 -0
  325. package/lib/module/surfaces/tooltip/computeTooltipPosition.js +67 -13
  326. package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
  327. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +87 -19
  328. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
  329. package/lib/module/surfaces/tooltip/placementDiagnostics.js +43 -0
  330. package/lib/module/surfaces/tooltip/placementDiagnostics.js.map +1 -0
  331. package/lib/module/surfaces/tooltip/rect.js +11 -0
  332. package/lib/module/surfaces/tooltip/rect.js.map +1 -1
  333. package/lib/module/surfaces/tooltip/resolveSideCardWidth.js +96 -0
  334. package/lib/module/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
  335. package/lib/module/version.js +1 -1
  336. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +26 -0
  337. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +2 -0
  339. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -1
  340. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +14 -10
  341. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  342. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
  343. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
  345. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
  346. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +42 -1
  347. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  348. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +42 -0
  349. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
  350. package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts +17 -0
  351. package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts.map +1 -0
  352. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +20 -0
  353. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -0
  354. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +5 -5
  355. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
  357. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
  358. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +48 -0
  359. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -0
  360. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +7 -0
  361. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
  362. package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts +11 -0
  363. package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
  365. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
  366. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
  367. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
  368. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts +20 -0
  369. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts +14 -0
  371. package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +13 -0
  373. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
  375. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
  377. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
  379. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
  381. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +141 -0
  383. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts +14 -0
  385. package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts.map +1 -0
  386. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +59 -0
  387. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +26 -0
  389. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
  390. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +31 -0
  391. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -0
  392. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +6 -1
  393. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
  394. package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -1
  396. package/lib/typescript/commonjs/src/content/themeColor.d.ts +5 -0
  397. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
  398. package/lib/typescript/commonjs/src/deviceContext.d.ts +66 -0
  399. package/lib/typescript/commonjs/src/deviceContext.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  401. package/lib/typescript/commonjs/src/hostAppVersion.d.ts +69 -0
  402. package/lib/typescript/commonjs/src/hostAppVersion.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/index.d.ts +53 -2
  404. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  405. package/lib/typescript/commonjs/src/lifecycle.d.ts +6 -0
  406. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
  407. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  408. package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts +14 -0
  409. package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts.map +1 -0
  410. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +7 -0
  411. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  412. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +6 -1
  413. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  414. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +5 -0
  415. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts +11 -0
  417. package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts +16 -0
  419. package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +2 -0
  421. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
  422. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
  423. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +6 -3
  424. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -1
  425. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +20 -7
  426. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
  427. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +5 -1
  428. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  429. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +6 -4
  430. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  431. package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts +10 -0
  432. package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts.map +1 -0
  433. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  434. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +12 -3
  435. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -1
  436. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +1 -0
  437. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/screenTracker.d.ts +21 -3
  439. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts +12 -0
  441. package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts.map +1 -0
  442. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -2
  443. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -1
  444. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +1 -1
  445. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +1 -1
  446. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +12 -1
  448. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  449. package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts +31 -0
  450. package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts +44 -0
  452. package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
  453. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +1 -1
  454. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +0 -7
  456. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
  458. package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
  459. package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
  460. package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
  461. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +3 -1
  462. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
  464. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
  466. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
  468. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
  470. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
  471. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
  472. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
  473. package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
  474. package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +2 -0
  476. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -1
  477. package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
  478. package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
  479. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  480. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +26 -0
  481. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  482. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +2 -0
  483. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -1
  484. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +14 -10
  485. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  486. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
  487. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
  488. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
  489. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
  490. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +42 -1
  491. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  492. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +42 -0
  493. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
  494. package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts +17 -0
  495. package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts.map +1 -0
  496. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +20 -0
  497. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -0
  498. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +5 -5
  499. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  500. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
  501. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
  502. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +48 -0
  503. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -0
  504. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +7 -0
  505. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
  506. package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts +11 -0
  507. package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
  508. package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
  509. package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
  510. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
  511. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
  512. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts +20 -0
  513. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
  514. package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts +14 -0
  515. package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
  516. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +13 -0
  517. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
  518. package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
  519. package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
  520. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
  521. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
  522. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
  523. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
  524. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
  525. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
  526. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +141 -0
  527. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -0
  528. package/lib/typescript/module/src/authoring/doubleTap.d.ts +14 -0
  529. package/lib/typescript/module/src/authoring/doubleTap.d.ts.map +1 -0
  530. package/lib/typescript/module/src/authoring/elementPickerController.d.ts +59 -0
  531. package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -0
  532. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +26 -0
  533. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
  534. package/lib/typescript/module/src/authoring/hitTest.d.ts +31 -0
  535. package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -0
  536. package/lib/typescript/module/src/content/RichContentRenderer.d.ts +6 -1
  537. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
  538. package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
  539. package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -1
  540. package/lib/typescript/module/src/content/themeColor.d.ts +5 -0
  541. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
  542. package/lib/typescript/module/src/deviceContext.d.ts +66 -0
  543. package/lib/typescript/module/src/deviceContext.d.ts.map +1 -0
  544. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  545. package/lib/typescript/module/src/hostAppVersion.d.ts +69 -0
  546. package/lib/typescript/module/src/hostAppVersion.d.ts.map +1 -0
  547. package/lib/typescript/module/src/index.d.ts +53 -2
  548. package/lib/typescript/module/src/index.d.ts.map +1 -1
  549. package/lib/typescript/module/src/lifecycle.d.ts +6 -0
  550. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
  551. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  552. package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts +14 -0
  553. package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts.map +1 -0
  554. package/lib/typescript/module/src/pairing/PairingController.d.ts +7 -0
  555. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  556. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +6 -1
  557. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  558. package/lib/typescript/module/src/pairing/diagnostics.d.ts +5 -0
  559. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
  560. package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts +11 -0
  561. package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts.map +1 -0
  562. package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts +16 -0
  563. package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
  564. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +2 -0
  565. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
  566. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
  567. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +6 -3
  568. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -1
  569. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +20 -7
  570. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
  571. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +5 -1
  572. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  573. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +6 -4
  574. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  575. package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts +10 -0
  576. package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts.map +1 -0
  577. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  578. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +12 -3
  579. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -1
  580. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +1 -0
  581. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -1
  582. package/lib/typescript/module/src/screenTracker.d.ts +21 -3
  583. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  584. package/lib/typescript/module/src/surfaces/CardFade.d.ts +12 -0
  585. package/lib/typescript/module/src/surfaces/CardFade.d.ts.map +1 -0
  586. package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -2
  587. package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -1
  588. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +1 -1
  589. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +1 -1
  590. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -1
  591. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +12 -1
  592. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  593. package/lib/typescript/module/src/surfaces/cardTransition.d.ts +31 -0
  594. package/lib/typescript/module/src/surfaces/cardTransition.d.ts.map +1 -0
  595. package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts +44 -0
  596. package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
  597. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +1 -1
  598. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -1
  599. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +0 -7
  600. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
  601. package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
  602. package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
  603. package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
  604. package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
  605. package/lib/typescript/module/src/surfaces/themeChrome.d.ts +3 -1
  606. package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -1
  607. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
  608. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  609. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
  610. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
  611. package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
  612. package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
  613. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
  614. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
  615. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
  616. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
  617. package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
  618. package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
  619. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +2 -0
  620. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -1
  621. package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
  622. package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
  623. package/lib/typescript/module/src/version.d.ts +1 -1
  624. package/package.json +22 -16
  625. package/src/anchors/AutoAnchorRegistry.ts +139 -2
  626. package/src/anchors/anchorChangeTicker.ts +10 -0
  627. package/src/anchors/elementConditionEvaluator.ts +29 -16
  628. package/src/anchors/fiber/FiberScanRoot.tsx +2 -50
  629. package/src/anchors/fiber/FiberScanRootStore.ts +51 -0
  630. package/src/anchors/fiber/fiberInternals.ts +166 -3
  631. package/src/anchors/fiber/indexHostFibers.ts +136 -0
  632. package/src/anchors/fiber/readHostContent.ts +146 -0
  633. package/src/anchors/fiberAnchorCache.ts +45 -0
  634. package/src/anchors/resolveAnchorHost.ts +23 -23
  635. package/src/anchors/resolveAutoAnchorHost.ts +180 -0
  636. package/src/anchors/semanticMatcher.ts +361 -0
  637. package/src/authoring/ElementPickerOverlay.tsx +553 -0
  638. package/src/authoring/capturePickerScreenshot.ts +90 -0
  639. package/src/authoring/chrome/ChromeBarTransition.tsx +106 -0
  640. package/src/authoring/chrome/ChromeBottomSheet.tsx +69 -0
  641. package/src/authoring/chrome/ChromeButton.tsx +103 -0
  642. package/src/authoring/chrome/ChromeDialog.tsx +121 -0
  643. package/src/authoring/chrome/ChromeIcon.tsx +40 -0
  644. package/src/authoring/chrome/ChromeTooltip.tsx +89 -0
  645. package/src/authoring/chrome/ChromeTopBar.tsx +126 -0
  646. package/src/authoring/chrome/DoubleTapBridge.tsx +60 -0
  647. package/src/authoring/chrome/doubleTapMonitor.ts +80 -0
  648. package/src/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  649. package/src/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  650. package/src/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  651. package/src/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  652. package/src/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  653. package/src/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  654. package/src/authoring/chrome/icons/userflow-logomark.png +0 -0
  655. package/src/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  656. package/src/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  657. package/src/authoring/chrome/icons/xmark.png +0 -0
  658. package/src/authoring/chrome/icons/xmark@2x.png +0 -0
  659. package/src/authoring/chrome/icons/xmark@3x.png +0 -0
  660. package/src/authoring/chrome/tokens.ts +106 -0
  661. package/src/authoring/doubleTap.ts +27 -0
  662. package/src/authoring/elementPickerController.ts +135 -0
  663. package/src/authoring/fingerprintFromInstance.ts +152 -0
  664. package/src/authoring/hitTest.ts +133 -0
  665. package/src/content/RichContentRenderer.tsx +22 -1
  666. package/src/content/StepButton.tsx +17 -2
  667. package/src/content/resolveStepButtonChrome.ts +12 -6
  668. package/src/content/themeColor.ts +10 -0
  669. package/src/deviceContext.ts +168 -0
  670. package/src/expo-router/useUserflowExpoRouter.ts +47 -4
  671. package/src/hostAppVersion.ts +258 -0
  672. package/src/index.ts +148 -4
  673. package/src/lifecycle.ts +8 -0
  674. package/src/navigation/WithUserflowReactNavigation.tsx +23 -7
  675. package/src/navigation/isOverlayPresentation.ts +76 -0
  676. package/src/pairing/PairingController.ts +32 -3
  677. package/src/pairing/PreviewModeBanner.tsx +250 -94
  678. package/src/pairing/diagnostics.ts +8 -0
  679. package/src/pairing/elementPickerRelay.ts +100 -0
  680. package/src/pairing/resolvePreviewChrome.ts +57 -0
  681. package/src/pairing/tokenStorage.ts +31 -2
  682. package/src/pairing/usePairingState.ts +2 -0
  683. package/src/runtime/FlowRenderer.tsx +55 -27
  684. package/src/runtime/FlowSurfaceFade.tsx +51 -30
  685. package/src/runtime/TargetPressBridge.tsx +14 -32
  686. package/src/runtime/UserflowProvider.tsx +76 -13
  687. package/src/runtime/changedTouchPoints.ts +34 -0
  688. package/src/runtime/flowEngine.ts +2 -0
  689. package/src/runtime/flowSessionViewState.ts +42 -4
  690. package/src/runtime/useFlowSessionState.ts +2 -0
  691. package/src/screenTracker.ts +46 -4
  692. package/src/surfaces/CardFade.tsx +18 -0
  693. package/src/surfaces/CloseButton.tsx +17 -7
  694. package/src/surfaces/MadeWithUserflow.tsx +1 -1
  695. package/src/surfaces/ModalSurface.tsx +48 -35
  696. package/src/surfaces/TooltipSurface.tsx +406 -86
  697. package/src/surfaces/cardTransition.ts +67 -0
  698. package/src/surfaces/resolveHighlightChrome.ts +139 -0
  699. package/src/surfaces/resolveModalLayout.ts +16 -8
  700. package/src/surfaces/resolveTooltipLayout.ts +1 -14
  701. package/src/surfaces/surfaceInteractionConfig.ts +25 -0
  702. package/src/surfaces/surfaceLayoutInsets.tsx +135 -0
  703. package/src/surfaces/themeChrome.ts +5 -3
  704. package/src/surfaces/tooltip/TooltipBubble.tsx +154 -19
  705. package/src/surfaces/tooltip/TooltipCutout.tsx +106 -49
  706. package/src/surfaces/tooltip/TooltipHighlight.tsx +144 -0
  707. package/src/surfaces/tooltip/computeTooltipPosition.ts +98 -12
  708. package/src/surfaces/tooltip/inferTooltipPlacement.ts +107 -18
  709. package/src/surfaces/tooltip/placementDiagnostics.ts +70 -0
  710. package/src/surfaces/tooltip/rect.ts +11 -0
  711. package/src/surfaces/tooltip/resolveSideCardWidth.ts +121 -0
  712. package/src/version.ts +1 -1
  713. package/vendor/core/dist/attributes.d.ts +1 -2
  714. package/vendor/core/dist/attributes.d.ts.map +1 -1
  715. package/vendor/core/dist/attributes.js.map +1 -1
  716. package/vendor/core/dist/engine/FlowSessionEngine.d.ts +69 -1
  717. package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
  718. package/vendor/core/dist/engine/FlowSessionEngine.js +268 -7
  719. package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
  720. package/vendor/core/dist/engine/PairingEngine.d.ts +44 -1
  721. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  722. package/vendor/core/dist/engine/PairingEngine.js +103 -9
  723. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  724. package/vendor/core/dist/engine/UserflowCore.d.ts +23 -4
  725. package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
  726. package/vendor/core/dist/engine/UserflowCore.js +64 -1
  727. package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
  728. package/vendor/core/dist/engine/conditionOperators.d.ts +16 -0
  729. package/vendor/core/dist/engine/conditionOperators.d.ts.map +1 -0
  730. package/vendor/core/dist/engine/conditionOperators.js +168 -0
  731. package/vendor/core/dist/engine/conditionOperators.js.map +1 -0
  732. package/vendor/core/dist/engine/handleActions.d.ts +27 -4
  733. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  734. package/vendor/core/dist/engine/handleActions.js +140 -13
  735. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  736. package/vendor/core/dist/engine/simpleObservable.d.ts +13 -0
  737. package/vendor/core/dist/engine/simpleObservable.d.ts.map +1 -0
  738. package/vendor/core/dist/engine/simpleObservable.js +29 -0
  739. package/vendor/core/dist/engine/simpleObservable.js.map +1 -0
  740. package/vendor/core/dist/engine/trackCondition.d.ts +25 -0
  741. package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -0
  742. package/vendor/core/dist/engine/trackCondition.js +177 -0
  743. package/vendor/core/dist/engine/trackCondition.js.map +1 -0
  744. package/vendor/core/dist/engine/trackStepTriggers.d.ts +21 -0
  745. package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -0
  746. package/vendor/core/dist/engine/trackStepTriggers.js +49 -0
  747. package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -0
  748. package/vendor/core/dist/index.d.ts +4 -3
  749. package/vendor/core/dist/index.d.ts.map +1 -1
  750. package/vendor/core/dist/index.js +2 -1
  751. package/vendor/core/dist/index.js.map +1 -1
  752. package/vendor/core/dist/normalizeAttributes.d.ts +8 -0
  753. package/vendor/core/dist/normalizeAttributes.d.ts.map +1 -0
  754. package/vendor/core/dist/normalizeAttributes.js +127 -0
  755. package/vendor/core/dist/normalizeAttributes.js.map +1 -0
  756. package/vendor/core/dist/transport/phoenix.d.ts +11 -6
  757. package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
  758. package/vendor/core/dist/transport/phoenix.js +59 -5
  759. package/vendor/core/dist/transport/phoenix.js.map +1 -1
  760. package/vendor/core/dist/types.d.ts +26 -1
  761. package/vendor/core/dist/types.d.ts.map +1 -1
  762. package/vendor/core/dist/version.d.ts +1 -1
  763. package/vendor/core/dist/version.js +1 -1
  764. package/vendor/core/package.json +1 -1
  765. package/vendor/protocol/dist/attributes.d.ts +43 -0
  766. package/vendor/protocol/dist/attributes.d.ts.map +1 -0
  767. package/vendor/protocol/dist/attributes.js +15 -0
  768. package/vendor/protocol/dist/attributes.js.map +1 -0
  769. package/vendor/protocol/dist/autoData.d.ts +2 -2
  770. package/vendor/protocol/dist/autoData.js +2 -2
  771. package/vendor/protocol/dist/events.d.ts +8 -0
  772. package/vendor/protocol/dist/events.d.ts.map +1 -1
  773. package/vendor/protocol/dist/flows.d.ts +66 -4
  774. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  775. package/vendor/protocol/dist/flows.js +50 -3
  776. package/vendor/protocol/dist/flows.js.map +1 -1
  777. package/vendor/protocol/dist/index.d.ts +1 -0
  778. package/vendor/protocol/dist/index.d.ts.map +1 -1
  779. package/vendor/protocol/dist/index.js +1 -0
  780. package/vendor/protocol/dist/index.js.map +1 -1
  781. package/vendor/protocol/dist/messages.d.ts +25 -4
  782. package/vendor/protocol/dist/messages.d.ts.map +1 -1
  783. package/vendor/protocol/dist/messages.js +4 -0
  784. package/vendor/protocol/dist/messages.js.map +1 -1
  785. package/vendor/protocol/dist/pairing.d.ts +26 -0
  786. package/vendor/protocol/dist/pairing.d.ts.map +1 -1
  787. package/vendor/protocol/dist/pairing.js.map +1 -1
  788. package/vendor/protocol/package.json +1 -1
@@ -46,6 +46,136 @@ export function getMemoizedProps(fiber) {
46
46
  const p = fiber?.memoizedProps;
47
47
  return p && typeof p === 'object' ? p : undefined;
48
48
  }
49
+
50
+ /**
51
+ * React fiber `tag` values are a small enum (ClassComponent = 1,
52
+ * HostComponent = 5, HostText = 6, …). Generous ceiling so a future React tag
53
+ * is not rejected; note this bound alone proves nothing, because Fabric native
54
+ * view tags also start small (2, 4, 6, …). The structural and negative checks
55
+ * below are what actually discriminate.
56
+ */
57
+ const MAX_REACT_FIBER_TAG = 60;
58
+
59
+ /** Fields only a fiber carries. */
60
+ const FIBER_STRUCTURAL_KEYS = ['child', 'return', 'sibling', 'stateNode', 'memoizedProps', 'alternate'];
61
+
62
+ /** Fields that mark a host node / public instance rather than a fiber. */
63
+ function looksLikeHostNode(value) {
64
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
+ const v = value;
66
+ return typeof v.__nativeTag === 'number' || typeof v._nativeTag === 'number' || '__viewConfig' in value || 'viewConfig' in value || 'node' in value && 'canonical' in value;
67
+ }
68
+
69
+ /**
70
+ * True when `value` looks like a JS React fiber, and not a Fabric shadow node,
71
+ * `stateNode`, or public instance. Never throws.
72
+ *
73
+ * Fabric on current RN stores the real fiber on `__internalInstanceHandle`, so
74
+ * this normally passes on the first try. It exists so a renderer that stores
75
+ * something else there degrades to the native-tag lookup instead of silently
76
+ * walking a non-fiber object and reading nothing.
77
+ */
78
+ export function isReactFiber(value) {
79
+ if (!value || typeof value !== 'object') return false;
80
+ try {
81
+ const tag = value.tag;
82
+ if (typeof tag !== 'number' || !Number.isInteger(tag) || tag < 0 || tag > MAX_REACT_FIBER_TAG) {
83
+ return false;
84
+ }
85
+ if (looksLikeHostNode(value)) return false;
86
+ return FIBER_STRUCTURAL_KEYS.some(key => key in value);
87
+ } catch {
88
+ return false;
89
+ }
90
+ }
91
+
92
+ /**
93
+ * If `value` is a fiber, return it. If it is a host `stateNode` that carries a
94
+ * fiber (Fabric `{ node, canonical: { internalInstanceHandle } }`, or the older
95
+ * `canonical._internalInstanceHandle`), unwrap to the fiber.
96
+ */
97
+ export function coerceToFiber(value) {
98
+ if (isReactFiber(value)) return value;
99
+ if (!value || typeof value !== 'object') return null;
100
+ try {
101
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
+ const v = value;
103
+ const candidates = [v.canonical?.internalInstanceHandle, v.canonical?._internalInstanceHandle, v.internalInstanceHandle];
104
+ for (const candidate of candidates) {
105
+ if (isReactFiber(candidate)) return candidate;
106
+ }
107
+ } catch {
108
+ // Feature-detection must itself never throw.
109
+ }
110
+ return null;
111
+ }
112
+
113
+ /**
114
+ * Native view tag on a public instance or host `stateNode`, across renderers:
115
+ *
116
+ * - `__nativeTag` — Fabric `ReactNativeElement` (RN 0.74+)
117
+ * - `_nativeTag` — Paper `ReactNativeFiberHostComponent`, older Fabric canonical
118
+ * - `canonical.nativeTag` / `canonical._nativeTag` — Fabric `stateNode`
119
+ */
120
+ export function nativeTagFromNode(value) {
121
+ if (!value || typeof value !== 'object') return undefined;
122
+ try {
123
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
124
+ const v = value;
125
+ const tag = v.__nativeTag ?? v._nativeTag ?? v.nativeTag ?? v.canonical?.nativeTag ?? v.canonical?._nativeTag;
126
+ if (typeof tag === 'number' && Number.isFinite(tag)) return tag;
127
+ } catch {
128
+ // Best-effort.
129
+ }
130
+ return undefined;
131
+ }
132
+ export function nativeTagFromHostFiber(fiber) {
133
+ return nativeTagFromNode(getStateNode(fiber)) ?? nativeTagFromNode(fiber);
134
+ }
135
+
136
+ /**
137
+ * Public host instance for a host fiber, if one exists. Covers, in order:
138
+ * materialized Fabric `canonical.publicInstance`, the older Fabric
139
+ * `canonical` host component, and the Paper `stateNode` itself (which *is*
140
+ * the object an app `ref` receives).
141
+ */
142
+ export function publicInstanceFromHostFiber(fiber) {
143
+ try {
144
+ const node = getStateNode(fiber);
145
+ if (!node || typeof node !== 'object') return null;
146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
147
+ const n = node;
148
+ const pub = n.canonical?.publicInstance;
149
+ if (pub && typeof pub === 'object') return pub;
150
+ const canonical = n.canonical;
151
+ if (canonical && typeof canonical === 'object' && nativeTagFromNode(canonical) !== undefined) {
152
+ return canonical;
153
+ }
154
+ if (typeof n.measureInWindow === 'function' || typeof n.measure === 'function' || nativeTagFromNode(n) !== undefined) {
155
+ return n;
156
+ }
157
+ } catch {
158
+ // Best-effort.
159
+ }
160
+ return null;
161
+ }
162
+
163
+ /**
164
+ * Host props for content reads. Prefers `memoizedProps`; Fabric also keeps the
165
+ * last committed props on `stateNode.canonical.currentProps`.
166
+ */
167
+ export function getLiveHostProps(fiber) {
168
+ const memo = getMemoizedProps(fiber);
169
+ if (memo) return memo;
170
+ try {
171
+ const node = getStateNode(fiber);
172
+ const current = node?.canonical?.currentProps;
173
+ if (current && typeof current === 'object') return current;
174
+ } catch {
175
+ // Best-effort.
176
+ }
177
+ return undefined;
178
+ }
49
179
  export function getStateNode(fiber) {
50
180
  return fiber?.stateNode ?? null;
51
181
  }
@@ -93,16 +223,22 @@ const INSTANCE_FIBER_KEYS = ['_reactInternals',
93
223
  '_internalInstanceHandle' // older Fabric / Paper bridge
94
224
  ];
95
225
 
96
- /** Resolve a fiber from a class or host public instance. Returns null when unavailable. */
226
+ /**
227
+ * Resolve a fiber from a class or host public instance. Returns null when
228
+ * unavailable, and also when the stored handle is a Fabric shadow node rather
229
+ * than a JS fiber (callers then look up by native tag under FiberScanRoot).
230
+ */
97
231
  export function fiberFromPublicInstance(instance) {
98
232
  if (!instance || typeof instance !== 'object') return null;
99
233
  try {
100
234
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
235
  const inst = instance;
102
236
  for (const key of INSTANCE_FIBER_KEYS) {
103
- const handle = inst[key];
104
- if (handle) return handle;
237
+ const fiber = coerceToFiber(inst[key]);
238
+ if (fiber) return fiber;
105
239
  }
240
+ const fromCanonical = coerceToFiber(inst.canonical?.internalInstanceHandle);
241
+ if (fromCanonical) return fromCanonical;
106
242
  } catch {
107
243
  // Feature-detection must itself never throw.
108
244
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HOST_COMPONENT_TAG","HOST_ROOT_TAG","MAX_ANCESTOR_WALK","HOST_STATE_NODE_KEYS","getChild","fiber","child","getSibling","sibling","getReturn","return","getAlternate","alternate","getMemoizedProps","p","memoizedProps","undefined","getStateNode","stateNode","getFiberTag","t","tag","getHostTypeName","type","isHostFiber","node","n","k","measure","measureInWindow","measureLayout","INSTANCE_FIBER_KEYS","fiberFromPublicInstance","instance","inst","key","handle","resolveCurrentFiber","cur","depth","rootState","currentRoot","current","isInTree","root","isFiberMounted"],"sourceRoot":"../../../../src","sources":["anchors/fiber/fiberInternals.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAGA;AACA,MAAMA,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,aAAa,GAAG,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG,MAAM;;AAEvC;AACA,MAAMC,oBAAoB,GAAG,CAC3B,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,yBAAyB,EACzB,MAAM,EACN,WAAW,CACH;AAEV,OAAO,SAASC,QAAQA,CAACC,KAAe,EAAmB;EACzD,OAAOA,KAAK,EAAEC,KAAK,IAAI,IAAI;AAC7B;AAEA,OAAO,SAASC,UAAUA,CAACF,KAAe,EAAmB;EAC3D,OAAOA,KAAK,EAAEG,OAAO,IAAI,IAAI;AAC/B;AAEA,OAAO,SAASC,SAASA,CAACJ,KAAe,EAAmB;EAC1D,OAAOA,KAAK,EAAEK,MAAM,IAAI,IAAI;AAC9B;AAEA,OAAO,SAASC,YAAYA,CAACN,KAAe,EAAmB;EAC7D,OAAOA,KAAK,EAAEO,SAAS,IAAI,IAAI;AACjC;AAEA,OAAO,SAASC,gBAAgBA,CAACR,KAAe,EAAuC;EACrF,MAAMS,CAAC,GAAGT,KAAK,EAAEU,aAAa;EAC9B,OAAOD,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,GAAIA,CAAC,GAA+BE,SAAS;AAChF;AAEA,OAAO,SAASC,YAAYA,CAACZ,KAAe,EAAW;EACrD,OAAOA,KAAK,EAAEa,SAAS,IAAI,IAAI;AACjC;AAEA,OAAO,SAASC,WAAWA,CAACd,KAAe,EAAsB;EAC/D,MAAMe,CAAC,GAAGf,KAAK,EAAEgB,GAAG;EACpB,OAAO,OAAOD,CAAC,KAA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CAAC;EACtB;EACA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASO,cAAcA,CAACxC,KAAe,EAAW;EACvD,IAAI,CAACA,KAAK,EAAE,OAAO,KAAK;EACxB,IAAI;IACF,IAAIc,WAAW,CAACd,KAAK,CAAC,KAAKJ,aAAa,EAAE,OAAO,IAAI;IACrD;IACA,OAAOQ,SAAS,CAACJ,KAAK,CAAC,IAAI,IAAI;EACjC,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF","ignoreList":[]}
1
+ {"version":3,"names":["HOST_COMPONENT_TAG","HOST_ROOT_TAG","MAX_ANCESTOR_WALK","HOST_STATE_NODE_KEYS","getChild","fiber","child","getSibling","sibling","getReturn","return","getAlternate","alternate","getMemoizedProps","p","memoizedProps","undefined","MAX_REACT_FIBER_TAG","FIBER_STRUCTURAL_KEYS","looksLikeHostNode","value","v","__nativeTag","_nativeTag","isReactFiber","tag","Number","isInteger","some","key","coerceToFiber","candidates","canonical","internalInstanceHandle","_internalInstanceHandle","candidate","nativeTagFromNode","nativeTag","isFinite","nativeTagFromHostFiber","getStateNode","publicInstanceFromHostFiber","node","n","pub","publicInstance","measureInWindow","measure","getLiveHostProps","memo","current","currentProps","stateNode","getFiberTag","t","getHostTypeName","type","isHostFiber","k","measureLayout","INSTANCE_FIBER_KEYS","fiberFromPublicInstance","instance","inst","fromCanonical","resolveCurrentFiber","cur","depth","rootState","currentRoot","isInTree","root","isFiberMounted"],"sourceRoot":"../../../../src","sources":["anchors/fiber/fiberInternals.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAGA;AACA,MAAMA,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,aAAa,GAAG,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG,MAAM;;AAEvC;AACA,MAAMC,oBAAoB,GAAG,CAC3B,YAAY,E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ict";
2
+
3
+ /**
4
+ * Reverse index: public instance / native tag → host fiber.
5
+ *
6
+ * Renderers disagree on whether a host ref can reach its fiber at all:
7
+ *
8
+ * - Fabric (RN 0.74+) stores the fiber on `__internalInstanceHandle`, and
9
+ * older Fabric on `_internalInstanceHandle` — the direct pointer works.
10
+ * - Paper **release** builds null out `_internalFiberInstanceHandleDEV`, so a
11
+ * host ref has no route to its fiber at all.
12
+ *
13
+ * The index closes that gap: `FiberScanRoot` is a class component, and
14
+ * `_reactInternals` is present on class instances in every renderer and build
15
+ * type, so we can always walk down from there and match on native tag or
16
+ * instance identity. This is the version-independent path; the direct pointer
17
+ * is the fast path.
18
+ */
19
+
20
+ import { fiberScanRoot } from "./FiberScanRootStore.js";
21
+ import { fiberFromPublicInstance, getChild, getSibling, isHostFiber, nativeTagFromHostFiber, nativeTagFromNode, publicInstanceFromHostFiber, resolveCurrentFiber } from "./fiberInternals.js";
22
+
23
+ /** Same bound as {@link findAnchorFiber} so a dense tree is fully indexed. */
24
+ const MAX_INDEX_NODES = 60_000;
25
+ export function emptyHostFiberIndex() {
26
+ return {
27
+ byNativeTag: new Map(),
28
+ byInstance: new WeakMap()
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Walk `root`'s descendants (not `root.sibling`, so the Userflow overlay stays
34
+ * out of the index). First host fiber per native tag wins.
35
+ */
36
+ export function createHostFiberIndex(root) {
37
+ const index = emptyHostFiberIndex();
38
+ if (!root) return index;
39
+ try {
40
+ const stack = [root];
41
+ let visited = 0;
42
+ while (stack.length > 0 && visited < MAX_INDEX_NODES) {
43
+ const fiber = stack.pop();
44
+ if (!fiber) continue;
45
+ visited += 1;
46
+ if (isHostFiber(fiber)) {
47
+ const tag = nativeTagFromHostFiber(fiber);
48
+ if (tag !== undefined && !index.byNativeTag.has(tag)) {
49
+ index.byNativeTag.set(tag, fiber);
50
+ }
51
+ const pub = publicInstanceFromHostFiber(fiber);
52
+ if (pub) {
53
+ try {
54
+ index.byInstance.set(pub, fiber);
55
+ } catch {
56
+ // WeakMap rejects non-objects; ignore.
57
+ }
58
+ }
59
+ }
60
+ if (fiber !== root) {
61
+ const sibling = getSibling(fiber);
62
+ if (sibling) stack.push(sibling);
63
+ }
64
+ const child = getChild(fiber);
65
+ if (child) stack.push(child);
66
+ }
67
+ } catch {
68
+ // Best-effort — a partial index is still useful.
69
+ }
70
+ return index;
71
+ }
72
+ export function indexLiveHostFibers() {
73
+ return createHostFiberIndex(fiberScanRoot.getFiber());
74
+ }
75
+
76
+ /** An index, or a thunk that builds one on first use. */
77
+
78
+ /**
79
+ * Defers the tree walk until something actually misses the direct pointer, and
80
+ * reuses the result for the rest of the pass. On renderers where refs reach
81
+ * their fiber (Fabric, Paper DEV) the walk never happens.
82
+ */
83
+ export function createLazyHostFiberIndex(build = indexLiveHostFibers) {
84
+ let cached = null;
85
+ return () => {
86
+ if (!cached) {
87
+ try {
88
+ cached = build();
89
+ } catch {
90
+ cached = emptyHostFiberIndex();
91
+ }
92
+ }
93
+ return cached;
94
+ };
95
+ }
96
+
97
+ /**
98
+ * Fiber for a public instance: direct pointer first, then the scan-root index
99
+ * by identity / native tag.
100
+ */
101
+ export function lookupHostFiber(index, instance) {
102
+ const direct = fiberFromPublicInstance(instance);
103
+ if (direct) {
104
+ try {
105
+ return resolveCurrentFiber(direct);
106
+ } catch {
107
+ return direct;
108
+ }
109
+ }
110
+ if (!instance || typeof instance !== 'object') return null;
111
+ try {
112
+ const resolved = typeof index === 'function' ? index() : index;
113
+ const fromMap = resolved.byInstance.get(instance);
114
+ if (fromMap) return fromMap;
115
+ const tag = nativeTagFromNode(instance);
116
+ if (tag !== undefined) return resolved.byNativeTag.get(tag) ?? null;
117
+ } catch {
118
+ // Best-effort.
119
+ }
120
+ return null;
121
+ }
122
+ //# sourceMappingURL=indexHostFibers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fiberScanRoot","fiberFromPublicInstance","getChild","getSibling","isHostFiber","nativeTagFromHostFiber","nativeTagFromNode","publicInstanceFromHostFiber","resolveCurrentFiber","MAX_INDEX_NODES","emptyHostFiberIndex","byNativeTag","Map","byInstance","WeakMap","createHostFiberIndex","root","index","stack","visited","length","fiber","pop","tag","undefined","has","set","pub","sibling","push","child","indexLiveHostFibers","getFiber","createLazyHostFiberIndex","build","cached","lookupHostFiber","instance","direct","resolved","fromMap","get"],"sourceRoot":"../../../../src","sources":["anchors/fiber/indexHostFibers.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAsB;AACpD,SAEEC,uBAAuB,EACvBC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,sBAAsB,EACtBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,mBAAmB,QACd,qBAAkB;;AAEzB;AACA,MAAMC,eAAe,GAAG,MAAM;AAO9B,OAAO,SAASC,mBAAmBA,CAAA,EAAmB;EACpD,OAAO;IAAEC,WAAW,EAAE,IAAIC,GAAG,CAAC,CAAC;IAAEC,UAAU,EAAE,IAAIC,OAAO,CAAC;EAAE,CAAC;AAC9D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,IAAiC,EAAkB;EACtF,MAAMC,KAAK,GAAGP,mBAAmB,CAAC,CAAC;EACnC,IAAI,CAACM,IAAI,EAAE,OAAOC,KAAK;EACvB,IAAI;IACF,MAAMC,KAAiB,GAAG,CAACF,IAAI,CAAC;IAChC,IAAIG,OAAO,GAAG,CAAC;IACf,OAAOD,KAAK,CAACE,MAAM,GAAG,CAAC,IAAID,OAAO,GAAGV,eAAe,EAAE;MACpD,MAAMY,KAAK,GAAGH,KAAK,CAACI,GAAG,CAAC,CAAC;MACzB,IAAI,CAACD,KAAK,EAAE;MACZF,OAAO,IAAI,CAAC;MACZ,IAAIf,WAAW,CAACiB,KAAK,CAAC,EAAE;QACtB,MAAME,GAAG,GAAGlB,sBAAsB,CAACgB,K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KAA2B,EAAEoB,QAAiB,EAAmB;EAC/F,MAAMC,MAAM,GAAGrC,uBAAuB,CAACoC,QAAQ,CAAC;EAChD,IAAIC,MAAM,EAAE;IACV,IAAI;MACF,OAAO9B,mBAAmB,CAAC8B,MAAM,CAAC;IACpC,CAAC,CAAC,MAAM;MACN,OAAOA,MAAM;IACf;EACF;EACA,IAAI,CAACD,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE,OAAO,IAAI;EAC1D,IAAI;IACF,MAAME,QAAQ,GAAG,OAAOtB,KAAK,KAAK,UAAU,GAAGA,KAAK,CAAC,CAAC,GAAGA,KAAK;IAC9D,MAAMuB,OAAO,GAAGD,QAAQ,CAAC1B,UAAU,CAAC4B,GAAG,CAACJ,QAAQ,CAAC;IACjD,IAAIG,OAAO,EAAE,OAAOA,OAAO;IAC3B,MAAMjB,GAAG,GAAGjB,iBAAiB,CAAC+B,QAAQ,CAAC;IACvC,IAAId,GAAG,KAAKC,SAAS,EAAE,OAAOe,QAAQ,CAAC5B,WAAW,CAAC8B,GAAG,CAAClB,GAAG,CAAC,IAAI,IAAI;EACrE,CAAC,CAAC,MAAM;IACN;EAAA;EAEF,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Live host-content reads from a public instance's fiber. Used at AUTO capture
5
+ * and match time so dynamic `{label}` / `{t(...)}` / `placeholder={…}` show up
6
+ * as `childText` even though Babel only stamps static literals.
7
+ *
8
+ * Same never-throws contract as the rest of the fiber layer.
9
+ */
10
+
11
+ import { getChild, getFiberTag, getLiveHostProps, getMemoizedProps, getSibling, isHostFiber } from "./fiberInternals.js";
12
+
13
+ /** React reconciler `HostComponent` / `HostText` fiber tags. */
14
+ const HOST_COMPONENT_TAG = 5;
15
+ const HOST_TEXT_TAG = 6;
16
+
17
+ /**
18
+ * Mirrors Babel `childTextFromJsx` depth — but counted in **host** levels, not
19
+ * fibers. See {@link isHostLevel}.
20
+ */
21
+ const DEFAULT_MAX_DEPTH = 4;
22
+
23
+ /** Soft cap so a dense subtree cannot stall the JS thread. */
24
+ const DEFAULT_MAX_NODES = 2_000;
25
+ function coerceText(value) {
26
+ if (typeof value === 'string') {
27
+ const trimmed = value.trim();
28
+ return trimmed || undefined;
29
+ }
30
+ if (typeof value === 'number' && Number.isFinite(value)) {
31
+ return String(value);
32
+ }
33
+ return undefined;
34
+ }
35
+
36
+ /**
37
+ * Concatenate the string/number fragments of a split label, in order.
38
+ *
39
+ * `<Text>{count} items</Text>` reaches us as `[3, ' items']`. Keeping only the
40
+ * first fragment would record `3`, which digit-normalization then collapses to
41
+ * `#` — agreeing with every other numeric label and costing the fail-closed
42
+ * guarantee. Joining keeps `3 items`, which normalizes to `# items`. Fragments
43
+ * are concatenated raw so `['Hello, ', name, '!']` stays `Hello, Dan!`; only
44
+ * the result is trimmed. Non-text children (nested elements) are skipped.
45
+ */
46
+ function joinTextFragments(children) {
47
+ let joined = '';
48
+ for (const child of children) {
49
+ if (typeof child === 'string') joined += child;else if (typeof child === 'number' && Number.isFinite(child)) joined += String(child);
50
+ }
51
+ return coerceText(joined);
52
+ }
53
+ function textFromMemoizedProps(fiber) {
54
+ // A HostText fiber (`tag === 6`) carries the string itself as its props.
55
+ const fromRaw = coerceText(fiber?.memoizedProps);
56
+ if (fromRaw) return fromRaw;
57
+ const props = getLiveHostProps(fiber) ?? getMemoizedProps(fiber);
58
+ if (!props) return undefined;
59
+ const fromChildren = coerceText(props.children);
60
+ if (fromChildren) return fromChildren;
61
+ if (Array.isArray(props.children)) {
62
+ const joined = joinTextFragments(props.children);
63
+ if (joined) return joined;
64
+ }
65
+ const fromText = coerceText(props.text);
66
+ if (fromText) return fromText;
67
+ return undefined;
68
+ }
69
+
70
+ /**
71
+ * First visible text under `fiber`, bounded by depth and node count. Reads a
72
+ * string/number `children` prop, the joined fragments of a split label, a
73
+ * native `text` prop, or the string a HostText fiber holds as its props.
74
+ */
75
+ export function readHostText(fiber, maxDepth = DEFAULT_MAX_DEPTH) {
76
+ try {
77
+ const budget = {
78
+ remaining: DEFAULT_MAX_NODES
79
+ };
80
+ return walkText(fiber, 0, maxDepth, budget);
81
+ } catch {
82
+ return undefined;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Only host fibers count toward depth.
88
+ *
89
+ * The JSX `<View><Text>{label}</Text></View>` that Babel sees as two levels is
90
+ * many more fibers at runtime: the composite, its `forwardRef` inner, context
91
+ * providers, then the native host and its text child. How many wrappers sit in
92
+ * between is an RN implementation detail that changes between versions, so
93
+ * counting fibers would make the depth limit mean something different on every
94
+ * release — and would cut the walk short before reaching the text. Counting
95
+ * host levels matches what Babel counted, on any RN version. The node budget,
96
+ * not the depth, is what bounds cost.
97
+ */
98
+ function isHostLevel(fiber) {
99
+ const tag = getFiberTag(fiber);
100
+ if (tag === HOST_COMPONENT_TAG || tag === HOST_TEXT_TAG) return true;
101
+ return isHostFiber(fiber);
102
+ }
103
+ function walkText(fiber, depth, maxDepth, budget) {
104
+ if (!fiber || depth > maxDepth || budget.remaining <= 0) return undefined;
105
+ budget.remaining -= 1;
106
+ const own = textFromMemoizedProps(fiber);
107
+ if (own) return own;
108
+ let child = getChild(fiber);
109
+ while (child) {
110
+ const nextDepth = isHostLevel(child) ? depth + 1 : depth;
111
+ const found = walkText(child, nextDepth, maxDepth, budget);
112
+ if (found) return found;
113
+ child = getSibling(child);
114
+ }
115
+ return undefined;
116
+ }
117
+
118
+ /** `placeholder` on this fiber (TextInput). Does not walk descendants. */
119
+ export function readHostPlaceholder(fiber) {
120
+ try {
121
+ const props = getLiveHostProps(fiber) ?? getMemoizedProps(fiber);
122
+ return coerceText(props?.placeholder);
123
+ } catch {
124
+ return undefined;
125
+ }
126
+ }
127
+ //# sourceMappingURL=readHostContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getChild","getFiberTag","getLiveHostProps","getMemoizedProps","getSibling","isHostFiber","HOST_COMPONENT_TAG","HOST_TEXT_TAG","DEFAULT_MAX_DEPTH","DEFAULT_MAX_NODES","coerceText","value","trimmed","trim","undefined","Number","isFinite","String","joinTextFragments","children","joined","child","textFromMemoizedProps","fiber","fromRaw","memoizedProps","props","fromChildren","Array","isArray","fromText","text","readHostText","maxDepth","budget","remaining","walkText","isHostLevel","tag","depth","own","nextDepth","found","readHostPlaceholder","placeholder"],"sourceRoot":"../../../../src","sources":["anchors/fiber/readHostContent.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEEA,QAAQ,EACRC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,UAAU,EACVC,WAAW,QACN,qBAAkB;;AAEzB;AACA,MAAMC,kBAAkB,GAAG,CAAC;AAC5B,MAAMC,aAAa,GAAG,CAAC;;AAEvB;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,CAAC;;AAE3B;AACA,MAAMC,iBAAiB,GAAG,KAAK;AAE/B,SAASC,UAAUA,CAACC,KAAc,EAAsB;EACtD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAMC,OAAO,GAAGD,KAAK,CAACE,IAAI,CAAC,CAAC;IAC5B,OAAOD,OAAO,IAAIE,SAAS;EAC7B;EACA,IAAI,OAAOH,KAAK,KAAK,QAAQ,IAAII,MAAM,CAACC,QAAQ,CAACL,KAAK,CAAC,EAAE;IACvD,OAAOM,MAAM,CAACN,KAAK,CAAC;EACtB;EACA,OAAOG,SAAS;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,iBAAiBA,CAACC,QAAmB,EAAsB;EAClE,IAAIC,MAAM,GAAG,EAAE;EACf,KAAK,MAAMC,KAAK,IAAIF,QAAQ,EAAE;IAC5B,IAAI,OAAOE,KAAK,KAAK,QAAQ,EAAED,MAAM,IAAIC,KAAK,CAAC,KAC1C,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIN,MAAM,CAACC,QAAQ,CAACK,KAAK,C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function getFiberAnchorScreenKey() {
6
+ return currentScreenKey;
7
+ }
8
+
9
+ /** Invalidate fiber-resolved anchors when the active screen changes. */
10
+ export function notifyAnchorScreenChange(screenKey) {
11
+ if (screenKey === currentScreenKey) return;
12
+ currentScreenKey = screenKey;
13
+ fiberCache.clear();
14
+ }
15
+
16
+ /** Drop the fiber cache (preview restart / tests). */
17
+ export function clearFiberAnchorCache() {
18
+ fiberCache.clear();
19
+ }
20
+ export function getCachedFiberAnchor(id) {
21
+ return fiberCache.get(id);
22
+ }
23
+ export function setCachedFiberAnchor(id, fiber) {
24
+ fiberCache.set(id, {
25
+ fiber,
26
+ screenKey: currentScreenKey
27
+ });
28
+ }
29
+ export function deleteCachedFiberAnchor(id) {
30
+ fiberCache.delete(id);
31
+ }
32
+
33
+ /**
34
+ * Drop a cached fiber entry after a zero-size measure so the next resolve
35
+ * re-scans (the host may have remounted under a new fiber).
36
+ */
37
+ export function invalidateFiberAnchor(id) {
38
+ fiberCache.delete(id);
39
+ }
40
+ //# sourceMappingURL=fiberAnchorCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["fiberCache","Map","currentScreenKey","getFiberAnchorScreenKey","notifyAnchorScreenChange","screenKey","clear","clearFiberAnchorCache","getCachedFiberAnchor","id","get","setCachedFiberAnchor","fiber","set","deleteCachedFiberAnchor","delete","invalidateFiberAnchor"],"sourceRoot":"../../../src","sources":["anchors/fiberAnchorCache.ts"],"mappings":";;AAOA,MAAMA,UAAU,GAAG,IAAIC,GAAG,CAA0B,CAAC;AACrD,IAAIC,gBAA+B,GAAG,IAAI;AAE1C,OAAO,SAASC,uBAAuBA,CAAA,EAAkB;EACvD,OAAOD,gBAAgB;AACzB;;AAEA;AACA,OAAO,SAASE,wBAAwBA,CAACC,SAAwB,EAAQ;EACvE,IAAIA,SAAS,KAAKH,gBAAgB,EAAE;EACpCA,gBAAgB,GAAGG,SAAS;EAC5BL,UAAU,CAACM,KAAK,CAAC,CAAC;AACpB;;AAEA;AACA,OAAO,SAASC,qBAAqBA,CAAA,EAAS;EAC5CP,UAAU,CAACM,KAAK,CAAC,CAAC;AACpB;AAEA,OAAO,SAASE,oBAAoBA,CAACC,EAAU,EAA+B;EAC5E,OAAOT,UAAU,CAACU,GAAG,CAACD,EAAE,CAAC;AAC3B;AAEA,OAAO,SAASE,oBAAoBA,CAACF,EAAU,EAAEG,KAAe,EAAQ;EACtEZ,UAAU,CAACa,GAAG,CAACJ,EAAE,EAAE;IAAEG,KAAK;IAAEP,SAAS,EAAEH;EAAiB,CAAC,CAAC;AAC5D;AAEA,OAAO,SAASY,uBAAuBA,CAACL,EAAU,EAAQ;EACxDT,UAAU,CAACe,MAAM,CAACN,EAAE,CAAC;AACvB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASO,qBAAqBA,CAACP,EAAU,EAAQ;EACtDT,UAAU,CAACe,MAAM,CAACN,EAAE,CAAC;AACvB","ignoreList":[]}
@@ -6,19 +6,23 @@ import { isFiberMounted } from "./fiber/fiberInternals.js";
6
6
  import { findAnchorFiber } from "./fiber/findAnchorFiber.js";
7
7
  import { createFiberMeasureInWindow } from "./fiber/measureHostFiber.js";
8
8
  import { isFiberOnVisibleScreen } from "./fiber/visibleScreens.js";
9
- const fiberCache = new Map();
10
- let currentScreenKey = null;
11
-
9
+ import { clearFiberAnchorCache as clearCache, deleteCachedFiberAnchor, getCachedFiberAnchor, getFiberAnchorScreenKey, invalidateFiberAnchor as dropCachedFiberAnchor, notifyAnchorScreenChange as onAnchorScreenChange, setCachedFiberAnchor } from "./fiberAnchorCache.js";
12
10
  /** Invalidate fiber-resolved anchors when the active screen changes. */
13
11
  export function notifyAnchorScreenChange(screenKey) {
14
- if (screenKey === currentScreenKey) return;
15
- currentScreenKey = screenKey;
16
- fiberCache.clear();
12
+ onAnchorScreenChange(screenKey);
17
13
  }
18
14
 
19
15
  /** Test helper — drop the fiber cache. */
20
16
  export function clearFiberAnchorCache() {
21
- fiberCache.clear();
17
+ clearCache();
18
+ }
19
+
20
+ /**
21
+ * Drop a cached fiber entry after a zero-size measure so the next resolve
22
+ * re-scans (the host may have remounted under a new fiber).
23
+ */
24
+ export function invalidateFiberAnchor(id) {
25
+ dropCachedFiberAnchor(id);
22
26
  }
23
27
 
24
28
  /**
@@ -52,7 +56,8 @@ export function resolveAnchorHost(id) {
52
56
 
53
57
  // Cached fiber still mounted, on the same screen, and not covered by a screen
54
58
  // pushed on top since it was cached?
55
- const cached = fiberCache.get(id);
59
+ const cached = getCachedFiberAnchor(id);
60
+ const currentScreenKey = getFiberAnchorScreenKey();
56
61
  if (cached && cached.screenKey === currentScreenKey && isFiberMounted(cached.fiber) && isFiberOnVisibleScreen(cached.fiber)) {
57
62
  return {
58
63
  status: 'found',
@@ -63,7 +68,7 @@ export function resolveAnchorHost(id) {
63
68
  };
64
69
  }
65
70
  if (cached) {
66
- fiberCache.delete(id);
71
+ deleteCachedFiberAnchor(id);
67
72
  }
68
73
  const root = fiberScanRoot.getFiber();
69
74
  if (!root) {
@@ -82,10 +87,7 @@ export function resolveAnchorHost(id) {
82
87
  status: 'missing'
83
88
  };
84
89
  }
85
- fiberCache.set(id, {
86
- fiber: result.fiber,
87
- screenKey: currentScreenKey
88
- });
90
+ setCachedFiberAnchor(id, result.fiber);
89
91
  return {
90
92
  status: 'found',
91
93
  host: {
@@ -94,12 +96,4 @@ export function resolveAnchorHost(id) {
94
96
  fiber: result.fiber
95
97
  };
96
98
  }
97
-
98
- /**
99
- * Drop a cached fiber entry after a zero-size measure so the next resolve
100
- * re-scans (the host may have remounted under a new fiber).
101
- */
102
- export function invalidateFiberAnchor(id) {
103
- fiberCache.delete(id);
104
- }
105
99
  //# sourceMappingURL=resolveAnchorHost.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["anchorRegistry","fiberScanRoot","isFiberMounted","findAnchorFiber","createFiberMeasureInWindow","isFiberOnVisibleScreen","fiberCache","Map","currentScreenKey","notifyAnchorScreenChange","screenKey","clear","clearFiberAnchorCache","resolveAnchorHost","id","status","isAmbiguous","registered","get","host","cached","fiber","measureInWindow","delete","root","getFiber","result","set","invalidateFiberAnchor"],"sourceRoot":"../../../src","sources":["anchors/resolveAnchorHost.ts"],"mappings":";;AAAA,SAA0BA,cAAc,QAAQ,qBAAkB;AAClE,SAASC,aAAa,QAAQ,0BAAuB;AAErD,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,eAAe,QAAQ,4BAAyB;AACzD,SAASC,0BAA0B,QAAQ,6BAA0B;AACrE,SAASC,sBAAsB,QAAQ,2BAAwB;AAY/D,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA0B,CAAC;AACrD,IAAIC,gBAA+B,GAAG,IAAI;;AAE1C;AACA,OAAO,SAASC,wBAAwBA,CAACC,SAAwB,EAAQ;EACvE,IAAIA,SAAS,KAAKF,gBAAgB,EAAE;EACpCA,gBAAgB,GAAGE,SAAS;EAC5BJ,UAAU,CAACK,KAAK,CAAC,CAAC;AACpB;;AAEA;AACA,OAAO,SAASC,qBAAqBA,CAAA,EAAS;EAC5CN,UAAU,CAACK,KAAK,CAAC,CAAC;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiBA,CAACC,EAAU,EAAoB;EAC9D,IAAI,CAACA,EAAE,EAAE,OAAO;IAAEC,MAAM,EAAE;EAAU,CAAC;;EAErC;EACA,IAAIf,cAAc,CAACgB,WAAW,CAACF,EAAE,CAAC,EAAE;IAClC,OAAO;MAAEC,MAAM,EAAE;IAAY,CAAC;EAChC;EACA,MAAME,UAAU,GAAGjB,cAAc,CAACkB,GAAG,CAACJ,EAAE,CAAC;EACzC,IAAIG,UAAU,EAAE;IACd,OAAO;MAAEF,MAAM,EAAE,OAAO;MAAEI,IAAI,EAAEF;IAAW,CAAC;EAC9C;;EAEA;EACA;EACA,MAAMG,MAAM,GAAGd,UAAU,CAACY,GAAG,CAACJ,EAAE,CAAC;EACjC,IACEM,MAAM,IACNA,MAAM,CAACV,SAAS,KAAKF,gBAAgB,IACrCN,cAAc,CAACkB,MAAM,CAACC,KAAK,CAAC,IAC5BhB,sBAAsB,CAACe,MAAM,CAACC,KAAK,CAAC,EACpC;IACA,OAAO;MACLN,MAAM,EAAE,OAAO;MACfI,IAAI,EAAE;QAAEG,eAAe,EAAElB,0BAA0B,CAACgB,MAAM,CAACC,KAAK;MAAE,CAAC;MACnEA,KAAK,EAAED,MAAM,CAACC;IAChB,CAAC;EACH;EACA,IAAID,MAAM,EAAE;IACVd,UAAU,CAACiB,MAAM,CAACT,EAAE,CAAC;EACvB;EAEA,MAAMU,IAAI,GAAGvB,aAAa,CAACwB,QAAQ,CAAC,CAAC;EACrC,IAAI,CAACD,IAAI,EAAE;IACT,OAAO;MAAET,MAAM,EAAE;IAAU,CAAC;EAC9B;EAEA,MAAMW,MAAM,GAAGvB,eAAe,CAACqB,IAAI,EAAEV,EAAE,CAAC;EACxC,IAAIY,MAAM,CAACX,MAAM,KAAK,WAAW,EAAE;IACjC,OAAO;MAAEA,MAAM,EAAE;IAAY,CAAC;EAChC;EACA,IAAIW,MAAM,CAACX,MAAM,KAAK,SAAS,EAAE;IAC/B,OAAO;MAAEA,MAAM,EAAE;IAAU,CAAC;EAC9B;EAEAT,UAAU,CAACqB,GAAG,CAACb,EAAE,EAAE;IAAEO,KAAK,EAAEK,MAAM,CAACL,KAAK;IAAEX,SAAS,EAAEF;EAAiB,CAAC,CAAC;EACxE,OAAO;IACLO,MAAM,EAAE,OAAO;IACfI,IAAI,EAAE;MAAEG,eAAe,EAAElB,0BAA0B,CAACsB,MAAM,CAACL,KAAK;IAAE,CAAC;IACnEA,KAAK,EAAEK,MAAM,CAACL;EAChB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASO,qBAAqBA,CAACd,EAAU,EAAQ;EACtDR,UAAU,CAACiB,MAAM,CAACT,EAAE,CAAC;AACvB","ignoreList":[]}
1
+ {"version":3,"names":["anchorRegistry","fiberScanRoot","isFiberMounted","findAnchorFiber","createFiberMeasureInWindow","isFiberOnVisibleScreen","clearFiberAnchorCache","clearCache","deleteCachedFiberAnchor","getCachedFiberAnchor","getFiberAnchorScreenKey","invalidateFiberAnchor","dropCachedFiberAnchor","notifyAnchorScreenChange","onAnchorScreenChange","setCachedFiberAnchor","screenKey","id","resolveAnchorHost","status","isAmbiguous","registered","get","host","cached","currentScreenKey","fiber","measureInWindow","root","getFiber","result"],"sourceRoot":"../../../src","sources":["anchors/resolveAnchorHost.ts"],"mappings":";;AAAA,SAA0BA,cAAc,QAAQ,qBAAkB;AAClE,SAASC,aAAa,QAAQ,0BAAuB;AAErD,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,eAAe,QAAQ,4BAAyB;AACzD,SAASC,0BAA0B,QAAQ,6BAA0B;AACrE,SAASC,sBAAsB,QAAQ,2BAAwB;AAC/D,SACEC,qBAAqB,IAAIC,UAAU,EACnCC,uBAAuB,EACvBC,oBAAoB,EACpBC,uBAAuB,EACvBC,qBAAqB,IAAIC,qBAAqB,EAC9CC,wBAAwB,IAAIC,oBAAoB,EAChDC,oBAAoB,QACf,uBAAoB;AAO3B;AACA,OAAO,SAASF,wBAAwBA,CAACG,SAAwB,EAAQ;EACvEF,oBAAoB,CAACE,SAAS,CAAC;AACjC;;AAEA;AACA,OAAO,SAASV,qBAAqBA,CAAA,EAAS;EAC5CC,UAAU,CAAC,CAAC;AACd;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,qBAAqBA,CAACM,EAAU,EAAQ;EACtDL,qBAAqB,CAACK,EAAE,CAAC;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACD,EAAU,EAAoB;EAC9D,IAAI,CAACA,EAAE,EAAE,OAAO;IAAEE,MAAM,EAAE;EAAU,CAAC;;EAErC;EACA,IAAInB,cAAc,CAACoB,WAAW,CAACH,EAAE,CAAC,EAAE;IAClC,OAAO;MAAEE,MAAM,EA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