@userflow-tech/react-native 0.1.0 → 0.2.0

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