@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
@@ -3,35 +3,49 @@
3
3
  import * as React from 'react';
4
4
  import { ActivityIndicator, Dimensions, Keyboard, ScrollView, StyleSheet, Text, View } from 'react-native';
5
5
  import { anchorRegistry } from "../anchors/AnchorRegistry.js";
6
+ import { autoAnchorRegistry } from "../anchors/AutoAnchorRegistry.js";
6
7
  import { addAnimationFrameCallback, removeAnimationFrameCallback } from "../anchors/animationFrame.js";
7
8
  import { fiberScanRoot } from "../anchors/fiber/FiberScanRoot.js";
8
- import { invalidateFiberAnchor, resolveAnchorHost } from "../anchors/resolveAnchorHost.js";
9
+ import { clearFiberAnchorCache, invalidateFiberAnchor, resolveAnchorHost } from "../anchors/resolveAnchorHost.js";
10
+ import { resolveAutoAnchorHost } from "../anchors/resolveAutoAnchorHost.js";
9
11
  import { resolveManualAnchorId } from "../anchors/resolveManualAnchorId.js";
10
12
  import { scrollAnchorIntoView } from "../anchors/scrollAnchorIntoView.js";
11
13
  import { getScrollPadding } from "../anchors/scrollConfig.js";
12
14
  import { targetPressMonitor } from "../anchors/targetPressMonitor.js";
13
15
  import { RichContentRenderer } from "../content/RichContentRenderer.js";
16
+ import { CardFade } from "./CardFade.js";
14
17
  import { CloseButton } from "./CloseButton.js";
15
- import { resolveCloseButtonColor } from "./resolveCloseButtonColor.js";
16
18
  import { MADE_WITH_USERFLOW_GAP, MadeWithUserflow } from "./MadeWithUserflow.js";
17
19
  import { ProgressBar } from "./ProgressBar.js";
18
20
  import { ABSOLUTE_FILL } from "./absoluteFill.js";
21
+ import { useCardTransitionPhase } from "./cardTransition.js";
19
22
  import { parseBackdropOpacity } from "./parseBackdropOpacity.js";
20
23
  import { resolveStepProgress } from "./progress.js";
21
- import { useUserflowSafeAreaInsets } from "./safeArea.js";
24
+ import { resolveCloseButtonColor } from "./resolveCloseButtonColor.js";
25
+ import { outsideHighlightOutset, resolveHighlightChrome } from "./resolveHighlightChrome.js";
26
+ import { resolveModalCardMaxHeight } from "./resolveModalLayout.js";
27
+ import { resolveTooltipButtonsAlign, resolveTooltipCardLayout, resolveTooltipCardMaxWidth } from "./resolveTooltipLayout.js";
28
+ import { paddingAsEdgeInsets, useSurfaceLayoutInsets } from "./surfaceLayoutInsets.js";
22
29
  import { resolveBubbleChrome } from "./themeChrome.js";
23
30
  import { TooltipBubble } from "./tooltip/TooltipBubble.js";
24
31
  import { TooltipCutout } from "./tooltip/TooltipCutout.js";
32
+ import { TooltipHighlight } from "./tooltip/TooltipHighlight.js";
25
33
  import { computeTooltipPosition } from "./tooltip/computeTooltipPosition.js";
26
- import { inferTooltipPlacement } from "./tooltip/inferTooltipPlacement.js";
34
+ import { inferTooltipPlacement, tooltipPlacementFits } from "./tooltip/inferTooltipPlacement.js";
27
35
  import { parseBackdropPadding } from "./tooltip/parseBackdropPadding.js";
28
- import { buildEffectiveViewport, isRectFullyVisible, rectsEqual } from "./tooltip/rect.js";
29
- import { resolveTooltipButtonsAlign, resolveTooltipCardLayout, resolveTooltipCardMaxWidth, resolveTooltipCenterPadding } from "./resolveTooltipLayout.js";
36
+ import { warnTooltipPlacementUnanchored, warnTooltipSidePlacementDropped } from "./tooltip/placementDiagnostics.js";
37
+ import { buildEffectiveViewport, expandRect, isRectFullyVisible, rectsEqual } from "./tooltip/rect.js";
38
+ import { resolveTooltipSideCardWidth, tooltipMinCardHeight, tooltipMinSideCardWidth, tooltipSideGap, tooltipVerticalGap } from "./tooltip/resolveSideCardWidth.js";
30
39
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
31
40
  /** Interval for re-resolving a missing / remounted anchor (not for live measure). */
32
41
  const RESOLVE_MS = 250;
33
42
  /** Slower resolve poll after FLAG/ERROR report so a late-mounting target can recover. */
34
43
  const RESOLVE_SLOW_MS = 1000;
44
+ /**
45
+ * One-frame delay before the first resolve after a step/reset so dialog
46
+ * teardown cannot arm the missing-target timer with a 0-size measure.
47
+ */
48
+ export const FIRST_RESOLVE_DELAY_MS = 16;
35
49
  /**
36
50
  * Max scroll-into-view attempts per step while the target stays partially
37
51
  * clipped. Only a safety net for targets that can never become fully visible —
@@ -55,6 +69,19 @@ function missingBehavior(theme) {
55
69
  return String(theme.tooltipMissingBehavior ?? 'FLAG').toUpperCase();
56
70
  }
57
71
 
72
+ /** Dim with no card yet, for the frames between mount and the first measure. */
73
+ function backdropOnly(blocker) {
74
+ if (blocker == null) {
75
+ return null;
76
+ }
77
+ return /*#__PURE__*/_jsx(View, {
78
+ style: styles.root,
79
+ testID: "userflow-tooltip-surface",
80
+ pointerEvents: "box-none",
81
+ children: blocker
82
+ });
83
+ }
84
+
58
85
  /**
59
86
  * Anchored tooltip chrome: measure manual / fiber anchor, place with web flip/shift,
60
87
  * optional cutout backdrop, missing-target report + theme fallbacks.
@@ -64,7 +91,8 @@ export function TooltipSurface({
64
91
  session,
65
92
  currentStep,
66
93
  theme,
67
- lookupAttribute
94
+ lookupAttribute,
95
+ resetNonce = 0
68
96
  }) {
69
97
  const version = session.version;
70
98
  const chrome = resolveBubbleChrome(theme, 'tooltip');
@@ -72,13 +100,32 @@ export function TooltipSurface({
72
100
  const showClose = !version.closeDisabled;
73
101
  const backdropOpacity = parseBackdropOpacity(theme.backdropOpacity);
74
102
  const backdropPadding = parseBackdropPadding(currentStep.backdropPadding);
75
- const anchorId = resolveManualAnchorId(currentStep.selector?.css);
103
+ const selector = currentStep.selector;
104
+ const isAuto = selector?.type === 'AUTO';
105
+ const autoData = selector?.autoData ?? null;
106
+ const anchorId = isAuto ? null : resolveManualAnchorId(selector?.css);
107
+ const targetKey = isAuto ? `auto:${autoData ?? ''}` : anchorId ?? '';
108
+ const highlight = currentStep.backdrop ? resolveHighlightChrome(theme, backdropPadding) : null;
109
+ const outsideHighlightSpread = highlight ? outsideHighlightOutset(highlight) : 0;
76
110
  const desiredPlacement = normalizePlacement(currentStep.tooltipPlacement);
77
111
  const behavior = missingBehavior(theme);
78
- const insets = useUserflowSafeAreaInsets();
79
- const centerPaddingStyle = resolveTooltipCenterPadding(insets);
112
+ /**
113
+ * An exiting card stays mounted for the fade, so anything it fires belongs to
114
+ * a step the user already left. Mirrored into a ref for the callbacks that run
115
+ * outside render (native touches, measure callbacks, timers).
116
+ */
117
+ const isExiting = useCardTransitionPhase() === 'exiting';
118
+ const exitingRef = React.useRef(isExiting);
119
+ exitingRef.current = isExiting;
120
+ const layoutInsets = useSurfaceLayoutInsets();
121
+ const centerPaddingStyle = layoutInsets;
80
122
  const [keyboardBottomInset, setKeyboardBottomInset] = React.useState(0);
81
123
  const [target, setTarget] = React.useState(null);
124
+ /**
125
+ * Placeholder until the card's first `onLayout`. A narrowed LEFT/RIGHT can
126
+ * leave a 2–3× smaller/taller measurement here; that must not leak into the
127
+ * next step's `fits()` (see the reset on `currentStep.id`).
128
+ */
82
129
  const [bubbleSize, setBubbleSize] = React.useState({
83
130
  width: 280,
84
131
  height: 160
@@ -88,9 +135,21 @@ export function TooltipSurface({
88
135
  const [registryTick, setRegistryTick] = React.useState(0);
89
136
  /** True after at least one *failed* measure for the current step/anchor. */
90
137
  const [measureAttempted, setMeasureAttempted] = React.useState(false);
138
+ /**
139
+ * False only after a same-step `resetNonce` bump (preview restart) until one
140
+ * frame has passed, so dialog teardown cannot 0-size FLAG.
141
+ */
142
+ const [resolveArmed, setResolveArmed] = React.useState(true);
143
+ const targetingIdentityRef = React.useRef({
144
+ stepId: currentStep.id,
145
+ targetKey,
146
+ resetNonce
147
+ });
91
148
  const reportedRef = React.useRef(false);
92
149
  const placementRef = React.useRef(placement);
93
150
  placementRef.current = placement;
151
+ const desiredPlacementRef = React.useRef(desiredPlacement);
152
+ desiredPlacementRef.current = desiredPlacement;
94
153
  const mountedRef = React.useRef(true);
95
154
  const targetRef = React.useRef(null);
96
155
  /** Bounded scroll-into-view attempts for the current step. */
@@ -103,14 +162,33 @@ export function TooltipSurface({
103
162
  const scrollSettledRef = React.useRef(false);
104
163
  /** In-flight measureInWindow guard for the rAF loop. */
105
164
  const measureInFlightRef = React.useRef(false);
165
+ /**
166
+ * Bumped whenever the resolved host is dropped. `measureInWindow` is async, so
167
+ * a measurement dispatched before the drop can still land after it — without
168
+ * this guard it re-anchors a target the resolver has already rejected, and the
169
+ * tooltip flip-flops between anchored and "looking for target".
170
+ */
171
+ const resolveEpochRef = React.useRef(0);
106
172
  /** Latest resolved host fiber (for scroll-ancestor walk + rAF remeasure). */
107
173
  const hostFiberRef = React.useRef(null);
108
174
  const hostMeasureRef = React.useRef(null);
109
175
  const hostScrollIntoViewRef = React.useRef(undefined);
176
+ /** Fiber-cache key for the current host; AUTO exact-id path sets this even when `anchorId` is null. */
177
+ const fiberCacheIdRef = React.useRef(null);
178
+ /** Step id we already warned about for a dropped LEFT/RIGHT placement. */
179
+ const warnedSidePlacementStepRef = React.useRef(null);
180
+ const currentStepIdRef = React.useRef(currentStep.id);
181
+ currentStepIdRef.current = currentStep.id;
182
+ /**
183
+ * Step the current `target` rect was measured for. A step advance re-renders
184
+ * with the new step before the reset effect clears `target`, so for one commit
185
+ * the new step's placement is evaluated against the previous target.
186
+ */
187
+ const targetStepIdRef = React.useRef(null);
110
188
  const keyboardBottomInsetRef = React.useRef(keyboardBottomInset);
111
189
  keyboardBottomInsetRef.current = keyboardBottomInset;
112
- const insetsRef = React.useRef(insets);
113
- insetsRef.current = insets;
190
+ const insetsRef = React.useRef(layoutInsets);
191
+ insetsRef.current = layoutInsets;
114
192
  const missingModeRef = React.useRef(missingMode);
115
193
  missingModeRef.current = missingMode;
116
194
  const behaviorRef = React.useRef(behavior);
@@ -129,9 +207,11 @@ export function TooltipSurface({
129
207
  React.useEffect(() => {
130
208
  const bump = () => setRegistryTick(n => n + 1);
131
209
  const unsubRegistry = anchorRegistry.subscribe(bump);
210
+ const unsubAuto = autoAnchorRegistry.subscribe(bump);
132
211
  const unsubScan = fiberScanRoot.subscribe(bump);
133
212
  return () => {
134
213
  unsubRegistry();
214
+ unsubAuto();
135
215
  unsubScan();
136
216
  };
137
217
  }, []);
@@ -140,16 +220,49 @@ export function TooltipSurface({
140
220
  scrollAttemptsRef.current = 0;
141
221
  scrollSettledRef.current = false;
142
222
  measureInFlightRef.current = false;
223
+ resolveEpochRef.current += 1;
143
224
  hostFiberRef.current = null;
144
225
  hostMeasureRef.current = null;
145
226
  hostScrollIntoViewRef.current = undefined;
227
+ fiberCacheIdRef.current = null;
228
+ warnedSidePlacementStepRef.current = null;
229
+ targetStepIdRef.current = null;
146
230
  targetRef.current = null;
231
+ // Drop the previous card's measured size and side so the next step does not
232
+ // inherit a wrapped 115×400 LEFT into `fits(currentPlacement)`.
233
+ const nextPlacement = desiredPlacementRef.current ?? 'BELOW';
234
+ placementRef.current = nextPlacement;
235
+ setPlacement(nextPlacement);
236
+ setBubbleSize({
237
+ width: 280,
238
+ height: 160
239
+ });
147
240
  setMissingMode('waiting');
148
241
  setMeasureAttempted(false);
149
242
  setTarget(null);
150
- }, [currentStep.id, anchorId]);
243
+ const prev = targetingIdentityRef.current;
244
+ const sameIdentity = prev.stepId === currentStep.id && prev.targetKey === targetKey;
245
+ const nonceBumped = prev.resetNonce !== resetNonce;
246
+ targetingIdentityRef.current = {
247
+ stepId: currentStep.id,
248
+ targetKey,
249
+ resetNonce
250
+ };
251
+ // Defer only a same-step restart bootstrap. A real step/target change
252
+ // should resolve on the first paint.
253
+ setResolveArmed(!(sameIdentity && nonceBumped));
254
+ clearFiberAnchorCache();
255
+ }, [currentStep.id, targetKey, resetNonce]);
256
+ React.useEffect(() => {
257
+ if (resolveArmed) return;
258
+ const handle = setTimeout(() => {
259
+ if (mountedRef.current) setResolveArmed(true);
260
+ }, FIRST_RESOLVE_DELAY_MS);
261
+ return () => clearTimeout(handle);
262
+ }, [resolveArmed]);
151
263
  const applyTarget = React.useCallback(next => {
152
264
  if (!mountedRef.current) return;
265
+ targetStepIdRef.current = next == null ? null : currentStepIdRef.current;
153
266
  if (rectsEqual(targetRef.current, next)) return;
154
267
  if (next == null) {
155
268
  // The anchor went away (unmount / navigation), so whatever scroll position
@@ -165,20 +278,40 @@ export function TooltipSurface({
165
278
  if (!mountedRef.current) return;
166
279
  setMeasureAttempted(prev => prev ? prev : true);
167
280
  }, []);
281
+
282
+ /**
283
+ * Forget the resolved host and report the target as gone. Bumping the epoch
284
+ * voids any measurement still in flight for it, and releasing the in-flight
285
+ * guard lets the next resolve measure immediately instead of waiting on a
286
+ * callback that no longer means anything.
287
+ */
288
+ const dropHost = React.useCallback(() => {
289
+ resolveEpochRef.current += 1;
290
+ measureInFlightRef.current = false;
291
+ hostFiberRef.current = null;
292
+ hostMeasureRef.current = null;
293
+ hostScrollIntoViewRef.current = undefined;
294
+ fiberCacheIdRef.current = null;
295
+ markMeasureAttempted();
296
+ applyTarget(null);
297
+ }, [applyTarget, markMeasureAttempted]);
168
298
  const effectiveViewport = React.useCallback(() => {
169
299
  const windowSize = Dimensions.get('window');
170
300
  const scrollPadding = getScrollPadding();
301
+ const layoutPad = paddingAsEdgeInsets(insetsRef.current);
171
302
  return buildEffectiveViewport({
172
303
  width: windowSize.width,
173
304
  height: Math.max(0, windowSize.height - keyboardBottomInsetRef.current)
174
305
  }, {
175
- top: (insetsRef.current.top ?? 0) + (scrollPadding?.top ?? 0),
176
- right: (insetsRef.current.right ?? 0) + (scrollPadding?.right ?? 0),
177
- bottom: (insetsRef.current.bottom ?? 0) + (scrollPadding?.bottom ?? 0),
178
- left: (insetsRef.current.left ?? 0) + (scrollPadding?.left ?? 0)
306
+ top: layoutPad.top + (scrollPadding?.top ?? 0),
307
+ right: layoutPad.right + (scrollPadding?.right ?? 0),
308
+ bottom: layoutPad.bottom + (scrollPadding?.bottom ?? 0),
309
+ left: layoutPad.left + (scrollPadding?.left ?? 0)
179
310
  });
180
311
  }, []);
181
312
  const maybeScrollIntoView = React.useCallback(rect => {
313
+ // Scrolling the app to reveal a target we are fading away from is visible.
314
+ if (exitingRef.current) return;
182
315
  if (scrollSettledRef.current) return;
183
316
  if (isRectFullyVisible(rect, effectiveViewport())) {
184
317
  scrollSettledRef.current = true;
@@ -211,40 +344,32 @@ export function TooltipSurface({
211
344
  */
212
345
  const resolveTarget = React.useCallback(() => {
213
346
  if (!mountedRef.current) return;
214
- if (!anchorId) {
215
- hostFiberRef.current = null;
216
- hostMeasureRef.current = null;
217
- hostScrollIntoViewRef.current = undefined;
218
- markMeasureAttempted();
219
- applyTarget(null);
220
- return;
221
- }
222
- const resolution = resolveAnchorHost(anchorId);
223
- if (resolution.status !== 'found') {
224
- hostFiberRef.current = null;
225
- hostMeasureRef.current = null;
226
- hostScrollIntoViewRef.current = undefined;
227
- markMeasureAttempted();
228
- applyTarget(null);
347
+ const resolution = isAuto ? resolveAutoAnchorHost(autoData) : anchorId ? resolveAnchorHost(anchorId) : null;
348
+ if (!resolution || resolution.status !== 'found') {
349
+ dropHost();
229
350
  return;
230
351
  }
231
352
  hostFiberRef.current = resolution.fiber ?? null;
232
353
  hostMeasureRef.current = resolution.host.measureInWindow;
233
354
  hostScrollIntoViewRef.current = resolution.host.scrollIntoView;
355
+ fiberCacheIdRef.current = 'fiberCacheId' in resolution && typeof resolution.fiberCacheId === 'string' ? resolution.fiberCacheId : anchorId ?? null;
234
356
 
235
357
  // Kick an immediate measure after resolve so the first paint isn't waiting
236
358
  // on the next rAF (and so missing targets still mark attempted).
237
359
  if (measureInFlightRef.current) return;
360
+ const epoch = resolveEpochRef.current;
238
361
  measureInFlightRef.current = true;
239
362
  resolution.host.measureInWindow((x, y, width, height) => {
363
+ if (resolveEpochRef.current !== epoch) {
364
+ measureInFlightRef.current = false;
365
+ return;
366
+ }
240
367
  measureInFlightRef.current = false;
241
368
  if (!mountedRef.current) return;
242
369
  if (width <= 0 || height <= 0) {
243
- invalidateFiberAnchor(anchorId);
244
- hostFiberRef.current = null;
245
- hostMeasureRef.current = null;
246
- markMeasureAttempted();
247
- applyTarget(null);
370
+ const cacheId = fiberCacheIdRef.current;
371
+ if (cacheId) invalidateFiberAnchor(cacheId);
372
+ dropHost();
248
373
  return;
249
374
  }
250
375
  const rect = {
@@ -256,7 +381,7 @@ export function TooltipSurface({
256
381
  maybeScrollIntoView(rect);
257
382
  applyTarget(rect);
258
383
  });
259
- }, [anchorId, applyTarget, markMeasureAttempted, maybeScrollIntoView]);
384
+ }, [anchorId, applyTarget, autoData, dropHost, isAuto, maybeScrollIntoView]);
260
385
 
261
386
  /**
262
387
  * Live re-measure of an already-resolved host. Driven by the shared rAF hub
@@ -267,16 +392,19 @@ export function TooltipSurface({
267
392
  if (measureInFlightRef.current) return;
268
393
  const measure = hostMeasureRef.current;
269
394
  if (!measure) return;
395
+ const epoch = resolveEpochRef.current;
270
396
  measureInFlightRef.current = true;
271
397
  measure((x, y, width, height) => {
398
+ if (resolveEpochRef.current !== epoch) {
399
+ measureInFlightRef.current = false;
400
+ return;
401
+ }
272
402
  measureInFlightRef.current = false;
273
403
  if (!mountedRef.current) return;
274
404
  if (width <= 0 || height <= 0) {
275
- if (anchorId) invalidateFiberAnchor(anchorId);
276
- hostFiberRef.current = null;
277
- hostMeasureRef.current = null;
278
- markMeasureAttempted();
279
- applyTarget(null);
405
+ const cacheId = fiberCacheIdRef.current;
406
+ if (cacheId) invalidateFiberAnchor(cacheId);
407
+ dropHost();
280
408
  return;
281
409
  }
282
410
  const rect = {
@@ -288,13 +416,17 @@ export function TooltipSurface({
288
416
  maybeScrollIntoView(rect);
289
417
  applyTarget(rect);
290
418
  });
291
- }, [anchorId, applyTarget, markMeasureAttempted, maybeScrollIntoView]);
419
+ }, [applyTarget, dropHost, maybeScrollIntoView]);
292
420
  React.useEffect(() => {
421
+ if (!resolveArmed) return;
293
422
  resolveTarget();
294
- }, [resolveTarget, registryTick]);
423
+ }, [resolveTarget, registryTick, resolveArmed]);
295
424
 
296
425
  // Resolve poll: recover missing / remounted anchors. Live measurement is on rAF.
297
426
  React.useEffect(() => {
427
+ if (!resolveArmed) {
428
+ return;
429
+ }
298
430
  const allowsRecovery = behavior === 'FLAG' || behavior === 'ERROR' || behavior === 'END' && session.draftMode;
299
431
  const pauseAfterReport = missingMode === 'reported' && !allowsRecovery;
300
432
  if (pauseAfterReport) {
@@ -320,7 +452,7 @@ export function TooltipSurface({
320
452
  kbShow.remove();
321
453
  kbHide.remove();
322
454
  };
323
- }, [resolveTarget, missingMode, behavior, session.draftMode]);
455
+ }, [resolveTarget, missingMode, behavior, session.draftMode, resolveArmed]);
324
456
 
325
457
  // rAF tracking while a host is resolved (and we are not paused after report).
326
458
  React.useEffect(() => {
@@ -354,7 +486,7 @@ export function TooltipSurface({
354
486
  }
355
487
  const ms = parseToleranceMs(theme.tooltipMissingToleranceSeconds);
356
488
  const timer = setTimeout(() => {
357
- if (!mountedRef.current || reportedRef.current) return;
489
+ if (!mountedRef.current || exitingRef.current || reportedRef.current) return;
358
490
  reportedRef.current = true;
359
491
  setMissingMode('reported');
360
492
  void engine.reportTooltipTargetMissing(currentStep.id);
@@ -381,7 +513,31 @@ export function TooltipSurface({
381
513
  height: Math.max(0, windowDims.height - keyboardBottomInset)
382
514
  }), [windowDims.width, windowDims.height, keyboardBottomInset]);
383
515
  const cardMaxWidth = resolveTooltipCardMaxWidth(theme, currentStep.width, windowSize.width);
384
- const cardLayoutStyle = resolveTooltipCardLayout(cardMaxWidth, windowSize.width);
516
+ const viewportMaxHeight = resolveModalCardMaxHeight(windowSize.height, layoutInsets);
517
+ const minCardHeight = tooltipMinCardHeight({
518
+ contentPadding: chrome.contentPadding,
519
+ borderWidth: chrome.borderWidth,
520
+ cardMaxHeight: viewportMaxHeight
521
+ });
522
+ const minSideCardWidth = tooltipMinSideCardWidth({
523
+ contentPadding: chrome.contentPadding,
524
+ borderWidth: chrome.borderWidth,
525
+ cardMaxWidth
526
+ });
527
+ const sideCardWidth = React.useMemo(() => {
528
+ if (!target) return null;
529
+ if (desiredPlacement !== 'LEFT' && desiredPlacement !== 'RIGHT') return null;
530
+ const placementTarget = expandRect(target, backdropPadding + outsideHighlightSpread);
531
+ return resolveTooltipSideCardWidth({
532
+ placement: desiredPlacement,
533
+ target: placementTarget,
534
+ windowWidth: windowSize.width,
535
+ notchSize: chrome.notchSize,
536
+ cardMaxWidth,
537
+ minWidth: minSideCardWidth
538
+ });
539
+ }, [target, desiredPlacement, backdropPadding, outsideHighlightSpread, windowSize.width, chrome.notchSize, cardMaxWidth, minSideCardWidth]);
540
+ const defaultCardLayoutStyle = resolveTooltipCardLayout(cardMaxWidth, windowSize.width);
385
541
  const buttonsAlign = resolveTooltipButtonsAlign(theme);
386
542
  const progressBarProps = {
387
543
  enabled: theme.progressBarEnabled,
@@ -398,102 +554,220 @@ export function TooltipSurface({
398
554
  const showWaitingUi = isMissing && missingMode === 'waiting' && measureAttempted;
399
555
  const layout = React.useMemo(() => {
400
556
  if (!target) return null;
557
+ // A target left over from the previous step belongs to that step's
558
+ // measurement; placing against it would also reuse that step's card size.
559
+ if (targetStepIdRef.current !== currentStep.id) return null;
560
+ const placementTarget = expandRect(target, backdropPadding + outsideHighlightSpread);
561
+ const viewportInsets = paddingAsEdgeInsets(layoutInsets);
562
+ const height = Math.min(bubbleSize.height, viewportMaxHeight);
563
+ const inferSize = sideCardWidth != null ? {
564
+ width: sideCardWidth,
565
+ height
566
+ } : {
567
+ width: cardMaxWidth,
568
+ height
569
+ };
401
570
  const nextPlacement = inferTooltipPlacement({
402
- target,
403
- bubbleSize,
571
+ target: placementTarget,
572
+ bubbleSize: inferSize,
404
573
  notchSize: chrome.notchSize,
405
574
  windowSize,
406
575
  currentPlacement: placementRef.current,
407
- desiredPlacement
576
+ desiredPlacement,
577
+ viewportInsets,
578
+ minHeight: minCardHeight
408
579
  });
580
+ const honorSide = sideCardWidth != null && nextPlacement === desiredPlacement && (nextPlacement === 'LEFT' || nextPlacement === 'RIGHT');
581
+ const fitted = tooltipPlacementFits({
582
+ target: placementTarget,
583
+ bubbleSize: inferSize,
584
+ notchSize: chrome.notchSize,
585
+ windowSize,
586
+ placement: nextPlacement,
587
+ viewportInsets,
588
+ minHeight: minCardHeight
589
+ });
590
+ let maxCardHeight = viewportMaxHeight;
591
+ if (nextPlacement === 'ABOVE' || nextPlacement === 'BELOW') {
592
+ const gap = tooltipVerticalGap({
593
+ placement: nextPlacement,
594
+ target: placementTarget,
595
+ windowHeight: windowSize.height,
596
+ notchSize: chrome.notchSize,
597
+ viewportInsets
598
+ });
599
+ const budget = Math.floor(gap);
600
+ if (Number.isFinite(budget) && budget > 0) {
601
+ maxCardHeight = Math.max(minCardHeight, Math.min(viewportMaxHeight, budget));
602
+ }
603
+ }
604
+ const positionHeight = Math.min(height, maxCardHeight);
605
+ const positionSize = honorSide ? {
606
+ width: sideCardWidth,
607
+ height: positionHeight
608
+ } : {
609
+ width: cardMaxWidth,
610
+ height: positionHeight
611
+ };
409
612
  return {
410
613
  placement: nextPlacement,
614
+ honorSide,
615
+ fitted,
616
+ maxCardHeight,
411
617
  ...computeTooltipPosition({
412
618
  target,
413
- bubbleSize,
619
+ bubbleSize: positionSize,
414
620
  placement: nextPlacement,
415
621
  notchSize: chrome.notchSize,
416
622
  backdropPadding,
623
+ outsideHighlightSpread,
417
624
  windowSize,
418
625
  bubbleBorderRadius: chrome.borderRadius,
419
- bubbleBorderWidth: chrome.borderWidth
626
+ bubbleBorderWidth: chrome.borderWidth,
627
+ viewportInsets
420
628
  })
421
629
  };
422
- }, [target, bubbleSize, chrome.notchSize, chrome.borderRadius, chrome.borderWidth, windowSize, desiredPlacement, backdropPadding]);
630
+ }, [target, bubbleSize, sideCardWidth, cardMaxWidth, viewportMaxHeight, minCardHeight, currentStep.id, chrome.notchSize, chrome.borderRadius, chrome.borderWidth, windowSize, desiredPlacement, backdropPadding, outsideHighlightSpread, layoutInsets]);
631
+ const cardLayoutStyle = layout?.honorSide && sideCardWidth != null ? {
632
+ width: sideCardWidth,
633
+ maxWidth: sideCardWidth
634
+ } : defaultCardLayoutStyle;
423
635
  React.useEffect(() => {
424
636
  if (layout && layout.placement !== placement) {
425
637
  setPlacement(layout.placement);
426
638
  }
427
639
  }, [layout, placement]);
640
+ React.useEffect(() => {
641
+ if (!layout || !target) return;
642
+ if (desiredPlacement !== 'LEFT' && desiredPlacement !== 'RIGHT') return;
643
+ // A target left over from the previous step says nothing about this one.
644
+ if (targetStepIdRef.current !== currentStep.id) return;
645
+ if (!(session.draftMode || __DEV__)) return;
646
+ if (warnedSidePlacementStepRef.current === currentStep.id) return;
647
+ if (layout.placement === desiredPlacement) {
648
+ // Last-resort return of the authored side: nothing actually fit.
649
+ if (layout.fitted) return;
650
+ warnedSidePlacementStepRef.current = currentStep.id;
651
+ warnTooltipPlacementUnanchored({
652
+ requested: desiredPlacement
653
+ });
654
+ return;
655
+ }
656
+ // Only the structural floor — not keyboard / off-screen flips. A resolved
657
+ // width means the room was there and something else moved the card.
658
+ if (sideCardWidth != null) return;
659
+ warnedSidePlacementStepRef.current = currentStep.id;
660
+ const placementTarget = expandRect(target, backdropPadding + outsideHighlightSpread);
661
+ warnTooltipSidePlacementDropped({
662
+ requested: desiredPlacement,
663
+ used: layout.placement,
664
+ availableGap: tooltipSideGap({
665
+ placement: desiredPlacement,
666
+ target: placementTarget,
667
+ windowWidth: windowSize.width,
668
+ notchSize: chrome.notchSize
669
+ }),
670
+ minWidth: minSideCardWidth
671
+ });
672
+ }, [layout, target, desiredPlacement, sideCardWidth, session.draftMode, currentStep.id, backdropPadding, outsideHighlightSpread, windowSize.width, chrome.notchSize, minSideCardWidth]);
428
673
 
429
674
  // Web parity: "When target element is clicked" → step.actions.
430
675
  // Observe taps via TargetPressBridge (pass-through); do not steal the press.
431
676
  const hasTarget = target != null;
432
677
  const targetActions = currentStep.actions;
433
678
  React.useEffect(() => {
434
- if (!hasTarget || currentStep.tooltipTargetBlocked || targetActions.length === 0) {
679
+ // Release the monitor while exiting: it is a singleton, and a tap landing on
680
+ // the old target would run the departing step's actions.
681
+ if (isExiting || !hasTarget || currentStep.tooltipTargetBlocked || targetActions.length === 0) {
435
682
  targetPressMonitor.clear();
436
683
  return;
437
684
  }
438
685
  targetPressMonitor.set({
439
686
  getRect: () => targetRef.current,
440
687
  onPress: () => {
688
+ // Native touches are async relative to commits, so re-check the phase.
689
+ if (exitingRef.current) return;
441
690
  void engine.handleActions(targetActions);
442
691
  }
443
692
  });
444
693
  return () => {
445
694
  targetPressMonitor.clear();
446
695
  };
447
- }, [hasTarget, currentStep.tooltipTargetBlocked, targetActions, engine]);
696
+ }, [hasTarget, currentStep.tooltipTargetBlocked, targetActions, engine, isExiting]);
697
+
698
+ // Painted from mount rather than once the target lands, so a modal → tooltip
699
+ // swap keeps the dim continuous instead of blinking it off for the frames the
700
+ // anchor takes to measure. The hole opens when `layout` arrives.
701
+ // Always mount the cutout: when `backdrop` is off the dim opacity is 0 but
702
+ // the bands still block host taps (unless interaction blocking is disabled).
703
+ const interactionBlocker = /*#__PURE__*/_jsx(TooltipCutout, {
704
+ targetRect: layout?.targetHighlightRect ?? null,
705
+ backdropColor: theme.backdropColor,
706
+ backdropOpacity: currentStep.backdrop ? backdropOpacity : 0,
707
+ targetBlocked: currentStep.tooltipTargetBlocked
708
+ });
448
709
  if (hideAfterEnd) {
449
710
  return null;
450
711
  }
712
+ const showBranding = session.flow.company.flowBranding;
713
+ const contentPadding = chrome.contentPadding;
451
714
 
452
- // Still pending the first measure attempt — stay invisible briefly.
715
+ // Still pending the first measure attempt — only the blocker shows.
453
716
  if (isMissing && missingMode === 'waiting' && !measureAttempted) {
454
- return null;
717
+ return backdropOnly(interactionBlocker);
455
718
  }
456
719
  if (showWaitingUi) {
457
- return /*#__PURE__*/_jsx(View, {
720
+ return /*#__PURE__*/_jsxs(View, {
458
721
  style: styles.root,
459
722
  testID: "userflow-tooltip-surface",
460
723
  pointerEvents: "box-none",
461
- children: /*#__PURE__*/_jsx(View, {
724
+ children: [interactionBlocker, /*#__PURE__*/_jsx(View, {
462
725
  style: [styles.center, centerPaddingStyle],
463
726
  pointerEvents: "box-none",
464
- children: /*#__PURE__*/_jsx(View, {
727
+ children: /*#__PURE__*/_jsx(CardFade, {
465
728
  testID: "userflow-tooltip-waiting",
466
729
  accessibilityViewIsModal: true,
467
730
  pointerEvents: "auto",
468
731
  style: [chrome.shadowStyle, styles.waitingCard, cardLayoutStyle, {
469
732
  borderRadius: chrome.borderRadius,
470
- backgroundColor: chrome.backgroundColor
733
+ backgroundColor: chrome.backgroundColor,
734
+ maxHeight: viewportMaxHeight
471
735
  }],
472
736
  children: /*#__PURE__*/_jsxs(View, {
473
737
  style: [chrome.fillStyle, {
474
- padding: chrome.contentPadding,
475
- alignItems: 'center'
738
+ maxHeight: viewportMaxHeight,
739
+ minHeight: 0
476
740
  }],
477
- children: [/*#__PURE__*/_jsx(ActivityIndicator, {
478
- color: theme.fontColor
479
- }), /*#__PURE__*/_jsx(Text, {
741
+ children: [/*#__PURE__*/_jsxs(View, {
480
742
  style: {
481
- color: theme.fontColor,
482
- fontSize: theme.fontSize,
483
- marginTop: 12,
484
- textAlign: 'center'
743
+ paddingHorizontal: contentPadding,
744
+ paddingTop: contentPadding,
745
+ paddingBottom: showBranding ? MADE_WITH_USERFLOW_GAP : contentPadding,
746
+ alignItems: 'center'
485
747
  },
486
- children: "Looking for target\u2026"
748
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
749
+ color: theme.fontColor
750
+ }), /*#__PURE__*/_jsx(Text, {
751
+ style: {
752
+ color: theme.fontColor,
753
+ fontSize: theme.fontSize,
754
+ marginTop: 12,
755
+ textAlign: 'center'
756
+ },
757
+ children: "Looking for target\u2026"
758
+ })]
759
+ }), /*#__PURE__*/_jsx(MadeWithUserflow, {
760
+ company: session.flow.company,
761
+ color: theme.fontColor,
762
+ contentPadding: contentPadding
487
763
  })]
488
764
  })
489
765
  })
490
- })
766
+ })]
491
767
  });
492
768
  }
493
769
  const progressTop = theme.progressBarEnabled && theme.progressBarPosition === 'TOP';
494
770
  const progressBottom = theme.progressBarEnabled && theme.progressBarPosition === 'BOTTOM';
495
- const showBranding = session.flow.company.flowBranding;
496
- const contentPadding = chrome.contentPadding;
497
771
  const cardBody = /*#__PURE__*/_jsxs(_Fragment, {
498
772
  children: [showClose ? /*#__PURE__*/_jsx(CloseButton, {
499
773
  onPress: endAsUserClosed,
@@ -549,46 +823,49 @@ export function TooltipSurface({
549
823
  })]
550
824
  });
551
825
  if (showAsBubbleFallback || showMissingUi) {
552
- return /*#__PURE__*/_jsx(View, {
826
+ return /*#__PURE__*/_jsxs(View, {
553
827
  style: styles.root,
554
828
  testID: "userflow-tooltip-surface",
555
829
  pointerEvents: "box-none",
556
- children: /*#__PURE__*/_jsx(View, {
830
+ children: [interactionBlocker, /*#__PURE__*/_jsx(View, {
557
831
  style: [styles.center, centerPaddingStyle],
558
832
  pointerEvents: "box-none",
559
- children: /*#__PURE__*/_jsx(View, {
833
+ children: /*#__PURE__*/_jsx(CardFade, {
560
834
  testID: "userflow-tooltip-card",
561
835
  accessibilityViewIsModal: true,
562
836
  pointerEvents: "auto",
563
837
  onLayout: onCardLayout,
564
838
  style: [chrome.shadowStyle, styles.fallbackCard, cardLayoutStyle, {
565
839
  borderRadius: chrome.borderRadius,
566
- backgroundColor: chrome.backgroundColor
840
+ backgroundColor: chrome.backgroundColor,
841
+ maxHeight: viewportMaxHeight
567
842
  }],
568
843
  children: /*#__PURE__*/_jsx(View, {
569
- style: [chrome.fillStyle, styles.fallbackFill],
844
+ style: [chrome.fillStyle, styles.fallbackFill, {
845
+ maxHeight: viewportMaxHeight
846
+ }],
570
847
  children: cardBody
571
848
  })
572
849
  })
573
- })
850
+ })]
574
851
  });
575
852
  }
576
853
  if (!layout || !target) {
577
- return null;
854
+ return backdropOnly(interactionBlocker);
578
855
  }
579
856
  return /*#__PURE__*/_jsxs(View, {
580
857
  style: styles.root,
581
858
  testID: "userflow-tooltip-surface",
582
859
  pointerEvents: "box-none",
583
- children: [currentStep.backdrop ? /*#__PURE__*/_jsx(TooltipCutout, {
860
+ children: [interactionBlocker, highlight ? /*#__PURE__*/_jsx(TooltipHighlight, {
584
861
  targetRect: layout.targetHighlightRect,
585
- backdropColor: theme.backdropColor,
586
- backdropOpacity: backdropOpacity,
587
- targetBlocked: currentStep.tooltipTargetBlocked
862
+ chrome: highlight
588
863
  }) : null, /*#__PURE__*/_jsx(TooltipBubble, {
589
864
  chrome: chrome,
590
865
  notchPosition: layout.notchPosition,
591
866
  onLayout: onCardLayout,
867
+ maxHeight: layout.maxCardHeight,
868
+ showNotch: layout.showNotch,
592
869
  style: {
593
870
  position: 'absolute',
594
871
  left: layout.cardPosition.x,
@@ -609,18 +886,19 @@ const styles = StyleSheet.create({
609
886
  alignItems: 'center'
610
887
  },
611
888
  fallbackCard: {
612
- maxHeight: '80%',
613
889
  flexShrink: 1
614
890
  },
615
891
  fallbackFill: {
616
- flexShrink: 1
892
+ flexShrink: 1,
893
+ minHeight: 0
617
894
  },
618
895
  waitingCard: {
619
896
  width: '100%'
620
897
  },
621
898
  scroll: {
622
- flexGrow: 0,
623
- flexShrink: 1
899
+ flexGrow: 1,
900
+ flexShrink: 1,
901
+ minHeight: 0
624
902
  },
625
903
  scrollContent: {
626
904
  flexGrow: 1