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