@userflow-tech/react-native 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (788) hide show
  1. package/README.md +97 -61
  2. package/app.plugin.js +11 -1
  3. package/babel-plugin/index.d.ts +8 -8
  4. package/babel-plugin/index.d.ts.map +1 -1
  5. package/babel-plugin/index.js +17 -9
  6. package/babel-plugin/index.js.map +1 -1
  7. package/babel-plugin.js +13 -0
  8. package/docs/anchoring.md +141 -13
  9. package/docs/deep-linking.md +18 -15
  10. package/docs/theme-mapping.md +44 -15
  11. package/docs/troubleshooting.md +36 -29
  12. package/expo-plugin/withUserflow.js +1 -1
  13. package/expo-plugin/withUserflow.js.map +1 -1
  14. package/lib/commonjs/anchors/AutoAnchorRegistry.js +124 -2
  15. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  16. package/lib/commonjs/anchors/anchorChangeTicker.js +10 -0
  17. package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -1
  18. package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -12
  19. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  20. package/lib/commonjs/anchors/fiber/FiberScanRoot.js +11 -47
  21. package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -1
  22. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +50 -0
  23. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -0
  24. package/lib/commonjs/anchors/fiber/fiberInternals.js +145 -3
  25. package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
  26. package/lib/commonjs/anchors/fiber/indexHostFibers.js +129 -0
  27. package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -0
  28. package/lib/commonjs/anchors/fiber/readHostContent.js +131 -0
  29. package/lib/commonjs/anchors/fiber/readHostContent.js.map +1 -0
  30. package/lib/commonjs/anchors/fiberAnchorCache.js +50 -0
  31. package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -0
  32. package/lib/commonjs/anchors/resolveAnchorHost.js +15 -21
  33. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  34. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +171 -0
  35. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -0
  36. package/lib/commonjs/anchors/semanticMatcher.js +285 -0
  37. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -0
  38. package/lib/commonjs/authoring/ElementPickerOverlay.js +490 -0
  39. package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -0
  40. package/lib/commonjs/authoring/capturePickerScreenshot.js +73 -0
  41. package/lib/commonjs/authoring/capturePickerScreenshot.js.map +1 -0
  42. package/lib/commonjs/authoring/chrome/ChromeBarTransition.js +94 -0
  43. package/lib/commonjs/authoring/chrome/ChromeBarTransition.js.map +1 -0
  44. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +64 -0
  45. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -0
  46. package/lib/commonjs/authoring/chrome/ChromeButton.js +94 -0
  47. package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -0
  48. package/lib/commonjs/authoring/chrome/ChromeDialog.js +131 -0
  49. package/lib/commonjs/authoring/chrome/ChromeDialog.js.map +1 -0
  50. package/lib/commonjs/authoring/chrome/ChromeIcon.js +39 -0
  51. package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -0
  52. package/lib/commonjs/authoring/chrome/ChromeTooltip.js +88 -0
  53. package/lib/commonjs/authoring/chrome/ChromeTooltip.js.map +1 -0
  54. package/lib/commonjs/authoring/chrome/ChromeTopBar.js +110 -0
  55. package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -0
  56. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +57 -0
  57. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -0
  58. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +80 -0
  59. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -0
  60. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  61. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  62. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  63. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  64. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  65. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  66. package/lib/commonjs/authoring/chrome/icons/userflow-logomark.png +0 -0
  67. package/lib/commonjs/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  68. package/lib/commonjs/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  69. package/lib/commonjs/authoring/chrome/icons/xmark.png +0 -0
  70. package/lib/commonjs/authoring/chrome/icons/xmark@2x.png +0 -0
  71. package/lib/commonjs/authoring/chrome/icons/xmark@3x.png +0 -0
  72. package/lib/commonjs/authoring/chrome/tokens.js +150 -0
  73. package/lib/commonjs/authoring/chrome/tokens.js.map +1 -0
  74. package/lib/commonjs/authoring/doubleTap.js +23 -0
  75. package/lib/commonjs/authoring/doubleTap.js.map +1 -0
  76. package/lib/commonjs/authoring/elementPickerController.js +102 -0
  77. package/lib/commonjs/authoring/elementPickerController.js.map +1 -0
  78. package/lib/commonjs/authoring/fingerprintFromInstance.js +195 -0
  79. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -0
  80. package/lib/commonjs/authoring/hitTest.js +106 -0
  81. package/lib/commonjs/authoring/hitTest.js.map +1 -0
  82. package/lib/commonjs/content/RichContentRenderer.js +12 -2
  83. package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
  84. package/lib/commonjs/content/StepButton.js +19 -4
  85. package/lib/commonjs/content/StepButton.js.map +1 -1
  86. package/lib/commonjs/content/resolveStepButtonChrome.js +8 -6
  87. package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -1
  88. package/lib/commonjs/content/themeColor.js +11 -0
  89. package/lib/commonjs/content/themeColor.js.map +1 -1
  90. package/lib/commonjs/deviceContext.js +158 -0
  91. package/lib/commonjs/deviceContext.js.map +1 -0
  92. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +40 -4
  93. package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
  94. package/lib/commonjs/hostAppVersion.js +242 -0
  95. package/lib/commonjs/hostAppVersion.js.map +1 -0
  96. package/lib/commonjs/index.js +118 -5
  97. package/lib/commonjs/index.js.map +1 -1
  98. package/lib/commonjs/lifecycle.js +2 -0
  99. package/lib/commonjs/lifecycle.js.map +1 -1
  100. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +17 -8
  101. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
  102. package/lib/commonjs/navigation/isOverlayPresentation.js +64 -0
  103. package/lib/commonjs/navigation/isOverlayPresentation.js.map +1 -0
  104. package/lib/commonjs/pairing/PairingController.js +29 -2
  105. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  106. package/lib/commonjs/pairing/PreviewModeBanner.js +211 -84
  107. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
  108. package/lib/commonjs/pairing/diagnostics.js +9 -0
  109. package/lib/commonjs/pairing/diagnostics.js.map +1 -1
  110. package/lib/commonjs/pairing/elementPickerRelay.js +91 -0
  111. package/lib/commonjs/pairing/elementPickerRelay.js.map +1 -0
  112. package/lib/commonjs/pairing/resolvePreviewChrome.js +52 -0
  113. package/lib/commonjs/pairing/resolvePreviewChrome.js.map +1 -0
  114. package/lib/commonjs/pairing/tokenStorage.js +25 -2
  115. package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
  116. package/lib/commonjs/pairing/usePairingState.js +3 -1
  117. package/lib/commonjs/pairing/usePairingState.js.map +1 -1
  118. package/lib/commonjs/runtime/FlowRenderer.js +45 -21
  119. package/lib/commonjs/runtime/FlowRenderer.js.map +1 -1
  120. package/lib/commonjs/runtime/FlowSurfaceFade.js +47 -24
  121. package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -1
  122. package/lib/commonjs/runtime/TargetPressBridge.js +13 -44
  123. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  124. package/lib/commonjs/runtime/UserflowProvider.js +74 -20
  125. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  126. package/lib/commonjs/runtime/changedTouchPoints.js +48 -0
  127. package/lib/commonjs/runtime/changedTouchPoints.js.map +1 -0
  128. package/lib/commonjs/runtime/flowEngine.js +3 -1
  129. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  130. package/lib/commonjs/runtime/flowSessionViewState.js +32 -7
  131. package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -1
  132. package/lib/commonjs/runtime/useFlowSessionState.js +2 -1
  133. package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -1
  134. package/lib/commonjs/screenTracker.js +46 -4
  135. package/lib/commonjs/screenTracker.js.map +1 -1
  136. package/lib/commonjs/surfaces/CardFade.js +31 -0
  137. package/lib/commonjs/surfaces/CardFade.js.map +1 -0
  138. package/lib/commonjs/surfaces/CloseButton.js +11 -6
  139. package/lib/commonjs/surfaces/CloseButton.js.map +1 -1
  140. package/lib/commonjs/surfaces/ModalSurface.js +50 -34
  141. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
  142. package/lib/commonjs/surfaces/TooltipSurface.js +366 -87
  143. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  144. package/lib/commonjs/surfaces/cardTransition.js +70 -0
  145. package/lib/commonjs/surfaces/cardTransition.js.map +1 -0
  146. package/lib/commonjs/surfaces/resolveHighlightChrome.js +109 -0
  147. package/lib/commonjs/surfaces/resolveHighlightChrome.js.map +1 -0
  148. package/lib/commonjs/surfaces/resolveModalLayout.js +7 -3
  149. package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -1
  150. package/lib/commonjs/surfaces/resolveTooltipLayout.js +0 -4
  151. package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -1
  152. package/lib/commonjs/surfaces/surfaceInteractionConfig.js +33 -0
  153. package/lib/commonjs/surfaces/surfaceInteractionConfig.js.map +1 -0
  154. package/lib/commonjs/surfaces/surfaceLayoutInsets.js +128 -0
  155. package/lib/commonjs/surfaces/surfaceLayoutInsets.js.map +1 -0
  156. package/lib/commonjs/surfaces/themeChrome.js +4 -1
  157. package/lib/commonjs/surfaces/themeChrome.js.map +1 -1
  158. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +142 -21
  159. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
  160. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +100 -47
  161. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -1
  162. package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js +124 -0
  163. package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js.map +1 -0
  164. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +67 -13
  165. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
  166. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +88 -19
  167. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
  168. package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js +52 -0
  169. package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js.map +1 -0
  170. package/lib/commonjs/surfaces/tooltip/rect.js +12 -0
  171. package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -1
  172. package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js +103 -0
  173. package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
  174. package/lib/commonjs/version.js +1 -1
  175. package/lib/module/anchors/AutoAnchorRegistry.js +125 -2
  176. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  177. package/lib/module/anchors/anchorChangeTicker.js +10 -0
  178. package/lib/module/anchors/anchorChangeTicker.js.map +1 -1
  179. package/lib/module/anchors/elementConditionEvaluator.js +25 -12
  180. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  181. package/lib/module/anchors/fiber/FiberScanRoot.js +2 -43
  182. package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -1
  183. package/lib/module/anchors/fiber/FiberScanRootStore.js +46 -0
  184. package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -0
  185. package/lib/module/anchors/fiber/fiberInternals.js +139 -3
  186. package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
  187. package/lib/module/anchors/fiber/indexHostFibers.js +122 -0
  188. package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -0
  189. package/lib/module/anchors/fiber/readHostContent.js +127 -0
  190. package/lib/module/anchors/fiber/readHostContent.js.map +1 -0
  191. package/lib/module/anchors/fiberAnchorCache.js +40 -0
  192. package/lib/module/anchors/fiberAnchorCache.js.map +1 -0
  193. package/lib/module/anchors/resolveAnchorHost.js +15 -21
  194. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  195. package/lib/module/anchors/resolveAutoAnchorHost.js +167 -0
  196. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -0
  197. package/lib/module/anchors/semanticMatcher.js +280 -0
  198. package/lib/module/anchors/semanticMatcher.js.map +1 -0
  199. package/lib/module/authoring/ElementPickerOverlay.js +485 -0
  200. package/lib/module/authoring/ElementPickerOverlay.js.map +1 -0
  201. package/lib/module/authoring/capturePickerScreenshot.js +68 -0
  202. package/lib/module/authoring/capturePickerScreenshot.js.map +1 -0
  203. package/lib/module/authoring/chrome/ChromeBarTransition.js +88 -0
  204. package/lib/module/authoring/chrome/ChromeBarTransition.js.map +1 -0
  205. package/lib/module/authoring/chrome/ChromeBottomSheet.js +59 -0
  206. package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -0
  207. package/lib/module/authoring/chrome/ChromeButton.js +89 -0
  208. package/lib/module/authoring/chrome/ChromeButton.js.map +1 -0
  209. package/lib/module/authoring/chrome/ChromeDialog.js +126 -0
  210. package/lib/module/authoring/chrome/ChromeDialog.js.map +1 -0
  211. package/lib/module/authoring/chrome/ChromeIcon.js +33 -0
  212. package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -0
  213. package/lib/module/authoring/chrome/ChromeTooltip.js +82 -0
  214. package/lib/module/authoring/chrome/ChromeTooltip.js.map +1 -0
  215. package/lib/module/authoring/chrome/ChromeTopBar.js +104 -0
  216. package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -0
  217. package/lib/module/authoring/chrome/DoubleTapBridge.js +52 -0
  218. package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -0
  219. package/lib/module/authoring/chrome/doubleTapMonitor.js +75 -0
  220. package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -0
  221. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  222. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  223. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  224. package/lib/module/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  225. package/lib/module/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  226. package/lib/module/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  227. package/lib/module/authoring/chrome/icons/userflow-logomark.png +0 -0
  228. package/lib/module/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  229. package/lib/module/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  230. package/lib/module/authoring/chrome/icons/xmark.png +0 -0
  231. package/lib/module/authoring/chrome/icons/xmark@2x.png +0 -0
  232. package/lib/module/authoring/chrome/icons/xmark@3x.png +0 -0
  233. package/lib/module/authoring/chrome/tokens.js +146 -0
  234. package/lib/module/authoring/chrome/tokens.js.map +1 -0
  235. package/lib/module/authoring/doubleTap.js +18 -0
  236. package/lib/module/authoring/doubleTap.js.map +1 -0
  237. package/lib/module/authoring/elementPickerController.js +97 -0
  238. package/lib/module/authoring/elementPickerController.js.map +1 -0
  239. package/lib/module/authoring/fingerprintFromInstance.js +187 -0
  240. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -0
  241. package/lib/module/authoring/hitTest.js +100 -0
  242. package/lib/module/authoring/hitTest.js.map +1 -0
  243. package/lib/module/content/RichContentRenderer.js +12 -2
  244. package/lib/module/content/RichContentRenderer.js.map +1 -1
  245. package/lib/module/content/StepButton.js +19 -4
  246. package/lib/module/content/StepButton.js.map +1 -1
  247. package/lib/module/content/resolveStepButtonChrome.js +8 -6
  248. package/lib/module/content/resolveStepButtonChrome.js.map +1 -1
  249. package/lib/module/content/themeColor.js +10 -0
  250. package/lib/module/content/themeColor.js.map +1 -1
  251. package/lib/module/deviceContext.js +142 -0
  252. package/lib/module/deviceContext.js.map +1 -0
  253. package/lib/module/expo-router/useUserflowExpoRouter.js +42 -6
  254. package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
  255. package/lib/module/hostAppVersion.js +225 -0
  256. package/lib/module/hostAppVersion.js.map +1 -0
  257. package/lib/module/index.js +119 -6
  258. package/lib/module/index.js.map +1 -1
  259. package/lib/module/lifecycle.js +2 -0
  260. package/lib/module/lifecycle.js.map +1 -1
  261. package/lib/module/navigation/WithUserflowReactNavigation.js +18 -9
  262. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
  263. package/lib/module/navigation/isOverlayPresentation.js +58 -0
  264. package/lib/module/navigation/isOverlayPresentation.js.map +1 -0
  265. package/lib/module/pairing/PairingController.js +30 -3
  266. package/lib/module/pairing/PairingController.js.map +1 -1
  267. package/lib/module/pairing/PreviewModeBanner.js +212 -85
  268. package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
  269. package/lib/module/pairing/diagnostics.js +8 -0
  270. package/lib/module/pairing/diagnostics.js.map +1 -1
  271. package/lib/module/pairing/elementPickerRelay.js +87 -0
  272. package/lib/module/pairing/elementPickerRelay.js.map +1 -0
  273. package/lib/module/pairing/resolvePreviewChrome.js +48 -0
  274. package/lib/module/pairing/resolvePreviewChrome.js.map +1 -0
  275. package/lib/module/pairing/tokenStorage.js +24 -2
  276. package/lib/module/pairing/tokenStorage.js.map +1 -1
  277. package/lib/module/pairing/usePairingState.js +3 -1
  278. package/lib/module/pairing/usePairingState.js.map +1 -1
  279. package/lib/module/runtime/FlowRenderer.js +45 -21
  280. package/lib/module/runtime/FlowRenderer.js.map +1 -1
  281. package/lib/module/runtime/FlowSurfaceFade.js +49 -26
  282. package/lib/module/runtime/FlowSurfaceFade.js.map +1 -1
  283. package/lib/module/runtime/TargetPressBridge.js +12 -43
  284. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  285. package/lib/module/runtime/UserflowProvider.js +74 -20
  286. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  287. package/lib/module/runtime/changedTouchPoints.js +43 -0
  288. package/lib/module/runtime/changedTouchPoints.js.map +1 -0
  289. package/lib/module/runtime/flowEngine.js +3 -1
  290. package/lib/module/runtime/flowEngine.js.map +1 -1
  291. package/lib/module/runtime/flowSessionViewState.js +32 -7
  292. package/lib/module/runtime/flowSessionViewState.js.map +1 -1
  293. package/lib/module/runtime/useFlowSessionState.js +2 -1
  294. package/lib/module/runtime/useFlowSessionState.js.map +1 -1
  295. package/lib/module/screenTracker.js +42 -4
  296. package/lib/module/screenTracker.js.map +1 -1
  297. package/lib/module/surfaces/CardFade.js +26 -0
  298. package/lib/module/surfaces/CardFade.js.map +1 -0
  299. package/lib/module/surfaces/CloseButton.js +10 -6
  300. package/lib/module/surfaces/CloseButton.js.map +1 -1
  301. package/lib/module/surfaces/ModalSurface.js +52 -36
  302. package/lib/module/surfaces/ModalSurface.js.map +1 -1
  303. package/lib/module/surfaces/TooltipSurface.js +368 -90
  304. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  305. package/lib/module/surfaces/cardTransition.js +64 -0
  306. package/lib/module/surfaces/cardTransition.js.map +1 -0
  307. package/lib/module/surfaces/resolveHighlightChrome.js +102 -0
  308. package/lib/module/surfaces/resolveHighlightChrome.js.map +1 -0
  309. package/lib/module/surfaces/resolveModalLayout.js +7 -3
  310. package/lib/module/surfaces/resolveModalLayout.js.map +1 -1
  311. package/lib/module/surfaces/resolveTooltipLayout.js +1 -4
  312. package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -1
  313. package/lib/module/surfaces/surfaceInteractionConfig.js +27 -0
  314. package/lib/module/surfaces/surfaceInteractionConfig.js.map +1 -0
  315. package/lib/module/surfaces/surfaceLayoutInsets.js +119 -0
  316. package/lib/module/surfaces/surfaceLayoutInsets.js.map +1 -0
  317. package/lib/module/surfaces/themeChrome.js +3 -1
  318. package/lib/module/surfaces/themeChrome.js.map +1 -1
  319. package/lib/module/surfaces/tooltip/TooltipBubble.js +143 -22
  320. package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
  321. package/lib/module/surfaces/tooltip/TooltipCutout.js +100 -47
  322. package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -1
  323. package/lib/module/surfaces/tooltip/TooltipHighlight.js +118 -0
  324. package/lib/module/surfaces/tooltip/TooltipHighlight.js.map +1 -0
  325. package/lib/module/surfaces/tooltip/computeTooltipPosition.js +67 -13
  326. package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
  327. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +87 -19
  328. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
  329. package/lib/module/surfaces/tooltip/placementDiagnostics.js +43 -0
  330. package/lib/module/surfaces/tooltip/placementDiagnostics.js.map +1 -0
  331. package/lib/module/surfaces/tooltip/rect.js +11 -0
  332. package/lib/module/surfaces/tooltip/rect.js.map +1 -1
  333. package/lib/module/surfaces/tooltip/resolveSideCardWidth.js +96 -0
  334. package/lib/module/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
  335. package/lib/module/version.js +1 -1
  336. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +26 -0
  337. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +2 -0
  339. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -1
  340. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +14 -10
  341. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  342. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
  343. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
  345. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
  346. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +42 -1
  347. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  348. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +42 -0
  349. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
  350. package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts +17 -0
  351. package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts.map +1 -0
  352. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +20 -0
  353. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -0
  354. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +5 -5
  355. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
  357. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
  358. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +48 -0
  359. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -0
  360. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +7 -0
  361. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
  362. package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts +11 -0
  363. package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
  365. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
  366. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
  367. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
  368. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts +20 -0
  369. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts +14 -0
  371. package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +13 -0
  373. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
  375. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
  377. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
  379. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
  381. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +141 -0
  383. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts +14 -0
  385. package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts.map +1 -0
  386. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +59 -0
  387. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +26 -0
  389. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
  390. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +31 -0
  391. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -0
  392. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +6 -1
  393. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
  394. package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -1
  396. package/lib/typescript/commonjs/src/content/themeColor.d.ts +5 -0
  397. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
  398. package/lib/typescript/commonjs/src/deviceContext.d.ts +66 -0
  399. package/lib/typescript/commonjs/src/deviceContext.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  401. package/lib/typescript/commonjs/src/hostAppVersion.d.ts +69 -0
  402. package/lib/typescript/commonjs/src/hostAppVersion.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/index.d.ts +53 -2
  404. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  405. package/lib/typescript/commonjs/src/lifecycle.d.ts +6 -0
  406. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
  407. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  408. package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts +14 -0
  409. package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts.map +1 -0
  410. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +7 -0
  411. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  412. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +6 -1
  413. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  414. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +5 -0
  415. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts +11 -0
  417. package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts +16 -0
  419. package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +2 -0
  421. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
  422. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
  423. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +6 -3
  424. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -1
  425. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +20 -7
  426. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
  427. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +5 -1
  428. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  429. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +6 -4
  430. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  431. package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts +10 -0
  432. package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts.map +1 -0
  433. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  434. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +12 -3
  435. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -1
  436. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +1 -0
  437. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/screenTracker.d.ts +21 -3
  439. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts +12 -0
  441. package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts.map +1 -0
  442. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -2
  443. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -1
  444. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +1 -1
  445. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +1 -1
  446. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +12 -1
  448. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  449. package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts +31 -0
  450. package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts +44 -0
  452. package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
  453. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +1 -1
  454. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +0 -7
  456. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
  458. package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
  459. package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
  460. package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
  461. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +3 -1
  462. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
  464. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
  466. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
  468. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
  470. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
  471. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
  472. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
  473. package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
  474. package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
  475. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +2 -0
  476. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -1
  477. package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
  478. package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
  479. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  480. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +26 -0
  481. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  482. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +2 -0
  483. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -1
  484. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +14 -10
  485. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  486. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
  487. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
  488. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
  489. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
  490. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +42 -1
  491. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  492. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +42 -0
  493. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
  494. package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts +17 -0
  495. package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts.map +1 -0
  496. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +20 -0
  497. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -0
  498. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +5 -5
  499. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  500. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
  501. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
  502. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +48 -0
  503. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -0
  504. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +7 -0
  505. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
  506. package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts +11 -0
  507. package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
  508. package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
  509. package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
  510. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
  511. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
  512. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts +20 -0
  513. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
  514. package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts +14 -0
  515. package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
  516. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +13 -0
  517. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
  518. package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
  519. package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
  520. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
  521. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
  522. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
  523. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
  524. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
  525. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
  526. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +141 -0
  527. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -0
  528. package/lib/typescript/module/src/authoring/doubleTap.d.ts +14 -0
  529. package/lib/typescript/module/src/authoring/doubleTap.d.ts.map +1 -0
  530. package/lib/typescript/module/src/authoring/elementPickerController.d.ts +59 -0
  531. package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -0
  532. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +26 -0
  533. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
  534. package/lib/typescript/module/src/authoring/hitTest.d.ts +31 -0
  535. package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -0
  536. package/lib/typescript/module/src/content/RichContentRenderer.d.ts +6 -1
  537. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
  538. package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
  539. package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -1
  540. package/lib/typescript/module/src/content/themeColor.d.ts +5 -0
  541. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
  542. package/lib/typescript/module/src/deviceContext.d.ts +66 -0
  543. package/lib/typescript/module/src/deviceContext.d.ts.map +1 -0
  544. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  545. package/lib/typescript/module/src/hostAppVersion.d.ts +69 -0
  546. package/lib/typescript/module/src/hostAppVersion.d.ts.map +1 -0
  547. package/lib/typescript/module/src/index.d.ts +53 -2
  548. package/lib/typescript/module/src/index.d.ts.map +1 -1
  549. package/lib/typescript/module/src/lifecycle.d.ts +6 -0
  550. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
  551. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  552. package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts +14 -0
  553. package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts.map +1 -0
  554. package/lib/typescript/module/src/pairing/PairingController.d.ts +7 -0
  555. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  556. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +6 -1
  557. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  558. package/lib/typescript/module/src/pairing/diagnostics.d.ts +5 -0
  559. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
  560. package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts +11 -0
  561. package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts.map +1 -0
  562. package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts +16 -0
  563. package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
  564. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +2 -0
  565. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
  566. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
  567. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +6 -3
  568. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -1
  569. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +20 -7
  570. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
  571. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +5 -1
  572. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  573. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +6 -4
  574. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  575. package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts +10 -0
  576. package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts.map +1 -0
  577. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  578. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +12 -3
  579. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -1
  580. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +1 -0
  581. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -1
  582. package/lib/typescript/module/src/screenTracker.d.ts +21 -3
  583. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  584. package/lib/typescript/module/src/surfaces/CardFade.d.ts +12 -0
  585. package/lib/typescript/module/src/surfaces/CardFade.d.ts.map +1 -0
  586. package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -2
  587. package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -1
  588. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +1 -1
  589. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +1 -1
  590. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -1
  591. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +12 -1
  592. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  593. package/lib/typescript/module/src/surfaces/cardTransition.d.ts +31 -0
  594. package/lib/typescript/module/src/surfaces/cardTransition.d.ts.map +1 -0
  595. package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts +44 -0
  596. package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
  597. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +1 -1
  598. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -1
  599. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +0 -7
  600. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
  601. package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
  602. package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
  603. package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
  604. package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
  605. package/lib/typescript/module/src/surfaces/themeChrome.d.ts +3 -1
  606. package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -1
  607. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
  608. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  609. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
  610. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
  611. package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
  612. package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
  613. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
  614. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
  615. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
  616. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
  617. package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
  618. package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
  619. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +2 -0
  620. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -1
  621. package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
  622. package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
  623. package/lib/typescript/module/src/version.d.ts +1 -1
  624. package/package.json +22 -16
  625. package/src/anchors/AutoAnchorRegistry.ts +139 -2
  626. package/src/anchors/anchorChangeTicker.ts +10 -0
  627. package/src/anchors/elementConditionEvaluator.ts +29 -16
  628. package/src/anchors/fiber/FiberScanRoot.tsx +2 -50
  629. package/src/anchors/fiber/FiberScanRootStore.ts +51 -0
  630. package/src/anchors/fiber/fiberInternals.ts +166 -3
  631. package/src/anchors/fiber/indexHostFibers.ts +136 -0
  632. package/src/anchors/fiber/readHostContent.ts +146 -0
  633. package/src/anchors/fiberAnchorCache.ts +45 -0
  634. package/src/anchors/resolveAnchorHost.ts +23 -23
  635. package/src/anchors/resolveAutoAnchorHost.ts +180 -0
  636. package/src/anchors/semanticMatcher.ts +361 -0
  637. package/src/authoring/ElementPickerOverlay.tsx +553 -0
  638. package/src/authoring/capturePickerScreenshot.ts +90 -0
  639. package/src/authoring/chrome/ChromeBarTransition.tsx +106 -0
  640. package/src/authoring/chrome/ChromeBottomSheet.tsx +69 -0
  641. package/src/authoring/chrome/ChromeButton.tsx +103 -0
  642. package/src/authoring/chrome/ChromeDialog.tsx +121 -0
  643. package/src/authoring/chrome/ChromeIcon.tsx +40 -0
  644. package/src/authoring/chrome/ChromeTooltip.tsx +89 -0
  645. package/src/authoring/chrome/ChromeTopBar.tsx +126 -0
  646. package/src/authoring/chrome/DoubleTapBridge.tsx +60 -0
  647. package/src/authoring/chrome/doubleTapMonitor.ts +80 -0
  648. package/src/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  649. package/src/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  650. package/src/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  651. package/src/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  652. package/src/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  653. package/src/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  654. package/src/authoring/chrome/icons/userflow-logomark.png +0 -0
  655. package/src/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  656. package/src/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  657. package/src/authoring/chrome/icons/xmark.png +0 -0
  658. package/src/authoring/chrome/icons/xmark@2x.png +0 -0
  659. package/src/authoring/chrome/icons/xmark@3x.png +0 -0
  660. package/src/authoring/chrome/tokens.ts +106 -0
  661. package/src/authoring/doubleTap.ts +27 -0
  662. package/src/authoring/elementPickerController.ts +135 -0
  663. package/src/authoring/fingerprintFromInstance.ts +152 -0
  664. package/src/authoring/hitTest.ts +133 -0
  665. package/src/content/RichContentRenderer.tsx +22 -1
  666. package/src/content/StepButton.tsx +17 -2
  667. package/src/content/resolveStepButtonChrome.ts +12 -6
  668. package/src/content/themeColor.ts +10 -0
  669. package/src/deviceContext.ts +168 -0
  670. package/src/expo-router/useUserflowExpoRouter.ts +47 -4
  671. package/src/hostAppVersion.ts +258 -0
  672. package/src/index.ts +148 -4
  673. package/src/lifecycle.ts +8 -0
  674. package/src/navigation/WithUserflowReactNavigation.tsx +23 -7
  675. package/src/navigation/isOverlayPresentation.ts +76 -0
  676. package/src/pairing/PairingController.ts +32 -3
  677. package/src/pairing/PreviewModeBanner.tsx +250 -94
  678. package/src/pairing/diagnostics.ts +8 -0
  679. package/src/pairing/elementPickerRelay.ts +100 -0
  680. package/src/pairing/resolvePreviewChrome.ts +57 -0
  681. package/src/pairing/tokenStorage.ts +31 -2
  682. package/src/pairing/usePairingState.ts +2 -0
  683. package/src/runtime/FlowRenderer.tsx +55 -27
  684. package/src/runtime/FlowSurfaceFade.tsx +51 -30
  685. package/src/runtime/TargetPressBridge.tsx +14 -32
  686. package/src/runtime/UserflowProvider.tsx +76 -13
  687. package/src/runtime/changedTouchPoints.ts +34 -0
  688. package/src/runtime/flowEngine.ts +2 -0
  689. package/src/runtime/flowSessionViewState.ts +42 -4
  690. package/src/runtime/useFlowSessionState.ts +2 -0
  691. package/src/screenTracker.ts +46 -4
  692. package/src/surfaces/CardFade.tsx +18 -0
  693. package/src/surfaces/CloseButton.tsx +17 -7
  694. package/src/surfaces/MadeWithUserflow.tsx +1 -1
  695. package/src/surfaces/ModalSurface.tsx +48 -35
  696. package/src/surfaces/TooltipSurface.tsx +406 -86
  697. package/src/surfaces/cardTransition.ts +67 -0
  698. package/src/surfaces/resolveHighlightChrome.ts +139 -0
  699. package/src/surfaces/resolveModalLayout.ts +16 -8
  700. package/src/surfaces/resolveTooltipLayout.ts +1 -14
  701. package/src/surfaces/surfaceInteractionConfig.ts +25 -0
  702. package/src/surfaces/surfaceLayoutInsets.tsx +135 -0
  703. package/src/surfaces/themeChrome.ts +5 -3
  704. package/src/surfaces/tooltip/TooltipBubble.tsx +154 -19
  705. package/src/surfaces/tooltip/TooltipCutout.tsx +106 -49
  706. package/src/surfaces/tooltip/TooltipHighlight.tsx +144 -0
  707. package/src/surfaces/tooltip/computeTooltipPosition.ts +98 -12
  708. package/src/surfaces/tooltip/inferTooltipPlacement.ts +107 -18
  709. package/src/surfaces/tooltip/placementDiagnostics.ts +70 -0
  710. package/src/surfaces/tooltip/rect.ts +11 -0
  711. package/src/surfaces/tooltip/resolveSideCardWidth.ts +121 -0
  712. package/src/version.ts +1 -1
  713. package/vendor/core/dist/attributes.d.ts +1 -2
  714. package/vendor/core/dist/attributes.d.ts.map +1 -1
  715. package/vendor/core/dist/attributes.js.map +1 -1
  716. package/vendor/core/dist/engine/FlowSessionEngine.d.ts +69 -1
  717. package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -1
  718. package/vendor/core/dist/engine/FlowSessionEngine.js +268 -7
  719. package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -1
  720. package/vendor/core/dist/engine/PairingEngine.d.ts +44 -1
  721. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -1
  722. package/vendor/core/dist/engine/PairingEngine.js +103 -9
  723. package/vendor/core/dist/engine/PairingEngine.js.map +1 -1
  724. package/vendor/core/dist/engine/UserflowCore.d.ts +23 -4
  725. package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -1
  726. package/vendor/core/dist/engine/UserflowCore.js +64 -1
  727. package/vendor/core/dist/engine/UserflowCore.js.map +1 -1
  728. package/vendor/core/dist/engine/conditionOperators.d.ts +16 -0
  729. package/vendor/core/dist/engine/conditionOperators.d.ts.map +1 -0
  730. package/vendor/core/dist/engine/conditionOperators.js +168 -0
  731. package/vendor/core/dist/engine/conditionOperators.js.map +1 -0
  732. package/vendor/core/dist/engine/handleActions.d.ts +27 -4
  733. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -1
  734. package/vendor/core/dist/engine/handleActions.js +140 -13
  735. package/vendor/core/dist/engine/handleActions.js.map +1 -1
  736. package/vendor/core/dist/engine/simpleObservable.d.ts +13 -0
  737. package/vendor/core/dist/engine/simpleObservable.d.ts.map +1 -0
  738. package/vendor/core/dist/engine/simpleObservable.js +29 -0
  739. package/vendor/core/dist/engine/simpleObservable.js.map +1 -0
  740. package/vendor/core/dist/engine/trackCondition.d.ts +25 -0
  741. package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -0
  742. package/vendor/core/dist/engine/trackCondition.js +177 -0
  743. package/vendor/core/dist/engine/trackCondition.js.map +1 -0
  744. package/vendor/core/dist/engine/trackStepTriggers.d.ts +21 -0
  745. package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -0
  746. package/vendor/core/dist/engine/trackStepTriggers.js +49 -0
  747. package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -0
  748. package/vendor/core/dist/index.d.ts +4 -3
  749. package/vendor/core/dist/index.d.ts.map +1 -1
  750. package/vendor/core/dist/index.js +2 -1
  751. package/vendor/core/dist/index.js.map +1 -1
  752. package/vendor/core/dist/normalizeAttributes.d.ts +8 -0
  753. package/vendor/core/dist/normalizeAttributes.d.ts.map +1 -0
  754. package/vendor/core/dist/normalizeAttributes.js +127 -0
  755. package/vendor/core/dist/normalizeAttributes.js.map +1 -0
  756. package/vendor/core/dist/transport/phoenix.d.ts +11 -6
  757. package/vendor/core/dist/transport/phoenix.d.ts.map +1 -1
  758. package/vendor/core/dist/transport/phoenix.js +59 -5
  759. package/vendor/core/dist/transport/phoenix.js.map +1 -1
  760. package/vendor/core/dist/types.d.ts +26 -1
  761. package/vendor/core/dist/types.d.ts.map +1 -1
  762. package/vendor/core/dist/version.d.ts +1 -1
  763. package/vendor/core/dist/version.js +1 -1
  764. package/vendor/core/package.json +1 -1
  765. package/vendor/protocol/dist/attributes.d.ts +43 -0
  766. package/vendor/protocol/dist/attributes.d.ts.map +1 -0
  767. package/vendor/protocol/dist/attributes.js +15 -0
  768. package/vendor/protocol/dist/attributes.js.map +1 -0
  769. package/vendor/protocol/dist/autoData.d.ts +2 -2
  770. package/vendor/protocol/dist/autoData.js +2 -2
  771. package/vendor/protocol/dist/events.d.ts +8 -0
  772. package/vendor/protocol/dist/events.d.ts.map +1 -1
  773. package/vendor/protocol/dist/flows.d.ts +66 -4
  774. package/vendor/protocol/dist/flows.d.ts.map +1 -1
  775. package/vendor/protocol/dist/flows.js +50 -3
  776. package/vendor/protocol/dist/flows.js.map +1 -1
  777. package/vendor/protocol/dist/index.d.ts +1 -0
  778. package/vendor/protocol/dist/index.d.ts.map +1 -1
  779. package/vendor/protocol/dist/index.js +1 -0
  780. package/vendor/protocol/dist/index.js.map +1 -1
  781. package/vendor/protocol/dist/messages.d.ts +25 -4
  782. package/vendor/protocol/dist/messages.d.ts.map +1 -1
  783. package/vendor/protocol/dist/messages.js +4 -0
  784. package/vendor/protocol/dist/messages.js.map +1 -1
  785. package/vendor/protocol/dist/pairing.d.ts +26 -0
  786. package/vendor/protocol/dist/pairing.d.ts.map +1 -1
  787. package/vendor/protocol/dist/pairing.js.map +1 -1
  788. package/vendor/protocol/package.json +1 -1
@@ -18,10 +18,16 @@ import {
18
18
  } from 'react-native';
19
19
 
20
20
  import { anchorRegistry } from '../anchors/AnchorRegistry';
21
+ import { autoAnchorRegistry } from '../anchors/AutoAnchorRegistry';
21
22
  import { addAnimationFrameCallback, removeAnimationFrameCallback } from '../anchors/animationFrame';
22
23
  import { fiberScanRoot } from '../anchors/fiber/FiberScanRoot';
23
24
  import type { AnyFiber } from '../anchors/fiber/fiberInternals';
24
- import { invalidateFiberAnchor, resolveAnchorHost } from '../anchors/resolveAnchorHost';
25
+ import {
26
+ clearFiberAnchorCache,
27
+ invalidateFiberAnchor,
28
+ resolveAnchorHost,
29
+ } from '../anchors/resolveAnchorHost';
30
+ import { resolveAutoAnchorHost } from '../anchors/resolveAutoAnchorHost';
25
31
  import { resolveManualAnchorId } from '../anchors/resolveManualAnchorId';
26
32
  import { scrollAnchorIntoView } from '../anchors/scrollAnchorIntoView';
27
33
  import { getScrollPadding } from '../anchors/scrollConfig';
@@ -29,31 +35,47 @@ import { targetPressMonitor } from '../anchors/targetPressMonitor';
29
35
  import { RichContentRenderer } from '../content/RichContentRenderer';
30
36
  import type { LookupAttribute } from '../content/types';
31
37
 
38
+ import { CardFade } from './CardFade';
32
39
  import { CloseButton } from './CloseButton';
33
- import { resolveCloseButtonColor } from './resolveCloseButtonColor';
34
40
  import { MADE_WITH_USERFLOW_GAP, MadeWithUserflow } from './MadeWithUserflow';
35
41
  import { ProgressBar } from './ProgressBar';
36
42
  import { ABSOLUTE_FILL } from './absoluteFill';
43
+ import { useCardTransitionPhase } from './cardTransition';
37
44
  import { parseBackdropOpacity } from './parseBackdropOpacity';
38
45
  import { resolveStepProgress } from './progress';
39
- import { useUserflowSafeAreaInsets } from './safeArea';
46
+ import { resolveCloseButtonColor } from './resolveCloseButtonColor';
47
+ import { outsideHighlightOutset, resolveHighlightChrome } from './resolveHighlightChrome';
48
+ import { resolveModalCardMaxHeight } from './resolveModalLayout';
49
+ import {
50
+ resolveTooltipButtonsAlign,
51
+ resolveTooltipCardLayout,
52
+ resolveTooltipCardMaxWidth,
53
+ } from './resolveTooltipLayout';
54
+ import { paddingAsEdgeInsets, useSurfaceLayoutInsets } from './surfaceLayoutInsets';
40
55
  import { resolveBubbleChrome } from './themeChrome';
41
56
  import { TooltipBubble } from './tooltip/TooltipBubble';
42
57
  import { TooltipCutout } from './tooltip/TooltipCutout';
58
+ import { TooltipHighlight } from './tooltip/TooltipHighlight';
43
59
  import { computeTooltipPosition } from './tooltip/computeTooltipPosition';
44
60
  import {
45
61
  inferTooltipPlacement,
62
+ tooltipPlacementFits,
46
63
  type Rect,
47
64
  type TooltipPlacementSide,
48
65
  } from './tooltip/inferTooltipPlacement';
49
66
  import { parseBackdropPadding } from './tooltip/parseBackdropPadding';
50
- import { buildEffectiveViewport, isRectFullyVisible, rectsEqual } from './tooltip/rect';
51
67
  import {
52
- resolveTooltipButtonsAlign,
53
- resolveTooltipCardLayout,
54
- resolveTooltipCardMaxWidth,
55
- resolveTooltipCenterPadding,
56
- } from './resolveTooltipLayout';
68
+ warnTooltipPlacementUnanchored,
69
+ warnTooltipSidePlacementDropped,
70
+ } from './tooltip/placementDiagnostics';
71
+ import { buildEffectiveViewport, expandRect, isRectFullyVisible, rectsEqual } from './tooltip/rect';
72
+ import {
73
+ resolveTooltipSideCardWidth,
74
+ tooltipMinCardHeight,
75
+ tooltipMinSideCardWidth,
76
+ tooltipSideGap,
77
+ tooltipVerticalGap,
78
+ } from './tooltip/resolveSideCardWidth';
57
79
 
58
80
  export interface TooltipSurfaceProps {
59
81
  engine: FlowSessionEngine;
@@ -61,6 +83,12 @@ export interface TooltipSurfaceProps {
61
83
  currentStep: FlowStepFragment;
62
84
  theme: ThemeFragment;
63
85
  lookupAttribute: LookupAttribute;
86
+ /**
87
+ * Bumped on preview restart and every goToStep, including a ForceGoToStep
88
+ * back to the current step, so targeting re-bootstraps when session/step
89
+ * identity is unchanged.
90
+ */
91
+ resetNonce?: number;
64
92
  }
65
93
 
66
94
  type MissingMode = 'waiting' | 'reported';
@@ -69,6 +97,11 @@ type MissingMode = 'waiting' | 'reported';
69
97
  const RESOLVE_MS = 250;
70
98
  /** Slower resolve poll after FLAG/ERROR report so a late-mounting target can recover. */
71
99
  const RESOLVE_SLOW_MS = 1000;
100
+ /**
101
+ * One-frame delay before the first resolve after a step/reset so dialog
102
+ * teardown cannot arm the missing-target timer with a 0-size measure.
103
+ */
104
+ export const FIRST_RESOLVE_DELAY_MS = 16;
72
105
  /**
73
106
  * Max scroll-into-view attempts per step while the target stays partially
74
107
  * clipped. Only a safety net for targets that can never become fully visible —
@@ -95,6 +128,18 @@ function missingBehavior(theme: ThemeFragment): string {
95
128
  return String(theme.tooltipMissingBehavior ?? 'FLAG').toUpperCase();
96
129
  }
97
130
 
131
+ /** Dim with no card yet, for the frames between mount and the first measure. */
132
+ function backdropOnly(blocker: React.ReactNode): React.ReactElement | null {
133
+ if (blocker == null) {
134
+ return null;
135
+ }
136
+ return (
137
+ <View style={styles.root} testID="userflow-tooltip-surface" pointerEvents="box-none">
138
+ {blocker}
139
+ </View>
140
+ );
141
+ }
142
+
98
143
  /**
99
144
  * Anchored tooltip chrome: measure manual / fiber anchor, place with web flip/shift,
100
145
  * optional cutout backdrop, missing-target report + theme fallbacks.
@@ -105,6 +150,7 @@ export function TooltipSurface({
105
150
  currentStep,
106
151
  theme,
107
152
  lookupAttribute,
153
+ resetNonce = 0,
108
154
  }: TooltipSurfaceProps): React.ReactElement | null {
109
155
  const version = session.version;
110
156
  const chrome = resolveBubbleChrome(theme, 'tooltip');
@@ -112,14 +158,33 @@ export function TooltipSurface({
112
158
  const showClose = !version.closeDisabled;
113
159
  const backdropOpacity = parseBackdropOpacity(theme.backdropOpacity);
114
160
  const backdropPadding = parseBackdropPadding(currentStep.backdropPadding);
115
- const anchorId = resolveManualAnchorId(currentStep.selector?.css);
161
+ const selector = currentStep.selector;
162
+ const isAuto = (selector?.type as string | null) === 'AUTO';
163
+ const autoData = selector?.autoData ?? null;
164
+ const anchorId = isAuto ? null : resolveManualAnchorId(selector?.css);
165
+ const targetKey = isAuto ? `auto:${autoData ?? ''}` : (anchorId ?? '');
166
+ const highlight = currentStep.backdrop ? resolveHighlightChrome(theme, backdropPadding) : null;
167
+ const outsideHighlightSpread = highlight ? outsideHighlightOutset(highlight) : 0;
116
168
  const desiredPlacement = normalizePlacement(currentStep.tooltipPlacement);
117
169
  const behavior = missingBehavior(theme);
118
- const insets = useUserflowSafeAreaInsets();
119
- const centerPaddingStyle = resolveTooltipCenterPadding(insets);
170
+ /**
171
+ * An exiting card stays mounted for the fade, so anything it fires belongs to
172
+ * a step the user already left. Mirrored into a ref for the callbacks that run
173
+ * outside render (native touches, measure callbacks, timers).
174
+ */
175
+ const isExiting = useCardTransitionPhase() === 'exiting';
176
+ const exitingRef = React.useRef(isExiting);
177
+ exitingRef.current = isExiting;
178
+ const layoutInsets = useSurfaceLayoutInsets();
179
+ const centerPaddingStyle = layoutInsets;
120
180
 
121
181
  const [keyboardBottomInset, setKeyboardBottomInset] = React.useState(0);
122
182
  const [target, setTarget] = React.useState<Rect | null>(null);
183
+ /**
184
+ * Placeholder until the card's first `onLayout`. A narrowed LEFT/RIGHT can
185
+ * leave a 2–3× smaller/taller measurement here; that must not leak into the
186
+ * next step's `fits()` (see the reset on `currentStep.id`).
187
+ */
123
188
  const [bubbleSize, setBubbleSize] = React.useState({ width: 280, height: 160 });
124
189
  const [placement, setPlacement] = React.useState<TooltipPlacementSide>(
125
190
  desiredPlacement ?? 'BELOW',
@@ -128,10 +193,22 @@ export function TooltipSurface({
128
193
  const [registryTick, setRegistryTick] = React.useState(0);
129
194
  /** True after at least one *failed* measure for the current step/anchor. */
130
195
  const [measureAttempted, setMeasureAttempted] = React.useState(false);
196
+ /**
197
+ * False only after a same-step `resetNonce` bump (preview restart) until one
198
+ * frame has passed, so dialog teardown cannot 0-size FLAG.
199
+ */
200
+ const [resolveArmed, setResolveArmed] = React.useState(true);
201
+ const targetingIdentityRef = React.useRef({
202
+ stepId: currentStep.id,
203
+ targetKey,
204
+ resetNonce,
205
+ });
131
206
 
132
207
  const reportedRef = React.useRef(false);
133
208
  const placementRef = React.useRef(placement);
134
209
  placementRef.current = placement;
210
+ const desiredPlacementRef = React.useRef(desiredPlacement);
211
+ desiredPlacementRef.current = desiredPlacement;
135
212
  const mountedRef = React.useRef(true);
136
213
  const targetRef = React.useRef<Rect | null>(null);
137
214
  /** Bounded scroll-into-view attempts for the current step. */
@@ -144,16 +221,35 @@ export function TooltipSurface({
144
221
  const scrollSettledRef = React.useRef(false);
145
222
  /** In-flight measureInWindow guard for the rAF loop. */
146
223
  const measureInFlightRef = React.useRef(false);
224
+ /**
225
+ * Bumped whenever the resolved host is dropped. `measureInWindow` is async, so
226
+ * a measurement dispatched before the drop can still land after it — without
227
+ * this guard it re-anchors a target the resolver has already rejected, and the
228
+ * tooltip flip-flops between anchored and "looking for target".
229
+ */
230
+ const resolveEpochRef = React.useRef(0);
147
231
  /** Latest resolved host fiber (for scroll-ancestor walk + rAF remeasure). */
148
232
  const hostFiberRef = React.useRef<AnyFiber | null>(null);
149
233
  const hostMeasureRef = React.useRef<
150
234
  ((callback: (x: number, y: number, width: number, height: number) => void) => void) | null
151
235
  >(null);
152
236
  const hostScrollIntoViewRef = React.useRef<(() => void) | undefined>(undefined);
237
+ /** Fiber-cache key for the current host; AUTO exact-id path sets this even when `anchorId` is null. */
238
+ const fiberCacheIdRef = React.useRef<string | null>(null);
239
+ /** Step id we already warned about for a dropped LEFT/RIGHT placement. */
240
+ const warnedSidePlacementStepRef = React.useRef<string | null>(null);
241
+ const currentStepIdRef = React.useRef(currentStep.id);
242
+ currentStepIdRef.current = currentStep.id;
243
+ /**
244
+ * Step the current `target` rect was measured for. A step advance re-renders
245
+ * with the new step before the reset effect clears `target`, so for one commit
246
+ * the new step's placement is evaluated against the previous target.
247
+ */
248
+ const targetStepIdRef = React.useRef<string | null>(null);
153
249
  const keyboardBottomInsetRef = React.useRef(keyboardBottomInset);
154
250
  keyboardBottomInsetRef.current = keyboardBottomInset;
155
- const insetsRef = React.useRef(insets);
156
- insetsRef.current = insets;
251
+ const insetsRef = React.useRef(layoutInsets);
252
+ insetsRef.current = layoutInsets;
157
253
  const missingModeRef = React.useRef(missingMode);
158
254
  missingModeRef.current = missingMode;
159
255
  const behaviorRef = React.useRef(behavior);
@@ -175,9 +271,11 @@ export function TooltipSurface({
175
271
  React.useEffect(() => {
176
272
  const bump = () => setRegistryTick((n) => n + 1);
177
273
  const unsubRegistry = anchorRegistry.subscribe(bump);
274
+ const unsubAuto = autoAnchorRegistry.subscribe(bump);
178
275
  const unsubScan = fiberScanRoot.subscribe(bump);
179
276
  return () => {
180
277
  unsubRegistry();
278
+ unsubAuto();
181
279
  unsubScan();
182
280
  };
183
281
  }, []);
@@ -187,17 +285,44 @@ export function TooltipSurface({
187
285
  scrollAttemptsRef.current = 0;
188
286
  scrollSettledRef.current = false;
189
287
  measureInFlightRef.current = false;
288
+ resolveEpochRef.current += 1;
190
289
  hostFiberRef.current = null;
191
290
  hostMeasureRef.current = null;
192
291
  hostScrollIntoViewRef.current = undefined;
292
+ fiberCacheIdRef.current = null;
293
+ warnedSidePlacementStepRef.current = null;
294
+ targetStepIdRef.current = null;
193
295
  targetRef.current = null;
296
+ // Drop the previous card's measured size and side so the next step does not
297
+ // inherit a wrapped 115×400 LEFT into `fits(currentPlacement)`.
298
+ const nextPlacement = desiredPlacementRef.current ?? 'BELOW';
299
+ placementRef.current = nextPlacement;
300
+ setPlacement(nextPlacement);
301
+ setBubbleSize({ width: 280, height: 160 });
194
302
  setMissingMode('waiting');
195
303
  setMeasureAttempted(false);
196
304
  setTarget(null);
197
- }, [currentStep.id, anchorId]);
305
+ const prev = targetingIdentityRef.current;
306
+ const sameIdentity = prev.stepId === currentStep.id && prev.targetKey === targetKey;
307
+ const nonceBumped = prev.resetNonce !== resetNonce;
308
+ targetingIdentityRef.current = { stepId: currentStep.id, targetKey, resetNonce };
309
+ // Defer only a same-step restart bootstrap. A real step/target change
310
+ // should resolve on the first paint.
311
+ setResolveArmed(!(sameIdentity && nonceBumped));
312
+ clearFiberAnchorCache();
313
+ }, [currentStep.id, targetKey, resetNonce]);
314
+
315
+ React.useEffect(() => {
316
+ if (resolveArmed) return;
317
+ const handle = setTimeout(() => {
318
+ if (mountedRef.current) setResolveArmed(true);
319
+ }, FIRST_RESOLVE_DELAY_MS);
320
+ return () => clearTimeout(handle);
321
+ }, [resolveArmed]);
198
322
 
199
323
  const applyTarget = React.useCallback((next: Rect | null) => {
200
324
  if (!mountedRef.current) return;
325
+ targetStepIdRef.current = next == null ? null : currentStepIdRef.current;
201
326
  if (rectsEqual(targetRef.current, next)) return;
202
327
  if (next == null) {
203
328
  // The anchor went away (unmount / navigation), so whatever scroll position
@@ -215,25 +340,45 @@ export function TooltipSurface({
215
340
  setMeasureAttempted((prev) => (prev ? prev : true));
216
341
  }, []);
217
342
 
343
+ /**
344
+ * Forget the resolved host and report the target as gone. Bumping the epoch
345
+ * voids any measurement still in flight for it, and releasing the in-flight
346
+ * guard lets the next resolve measure immediately instead of waiting on a
347
+ * callback that no longer means anything.
348
+ */
349
+ const dropHost = React.useCallback(() => {
350
+ resolveEpochRef.current += 1;
351
+ measureInFlightRef.current = false;
352
+ hostFiberRef.current = null;
353
+ hostMeasureRef.current = null;
354
+ hostScrollIntoViewRef.current = undefined;
355
+ fiberCacheIdRef.current = null;
356
+ markMeasureAttempted();
357
+ applyTarget(null);
358
+ }, [applyTarget, markMeasureAttempted]);
359
+
218
360
  const effectiveViewport = React.useCallback(() => {
219
361
  const windowSize = Dimensions.get('window');
220
362
  const scrollPadding = getScrollPadding();
363
+ const layoutPad = paddingAsEdgeInsets(insetsRef.current);
221
364
  return buildEffectiveViewport(
222
365
  {
223
366
  width: windowSize.width,
224
367
  height: Math.max(0, windowSize.height - keyboardBottomInsetRef.current),
225
368
  },
226
369
  {
227
- top: (insetsRef.current.top ?? 0) + (scrollPadding?.top ?? 0),
228
- right: (insetsRef.current.right ?? 0) + (scrollPadding?.right ?? 0),
229
- bottom: (insetsRef.current.bottom ?? 0) + (scrollPadding?.bottom ?? 0),
230
- left: (insetsRef.current.left ?? 0) + (scrollPadding?.left ?? 0),
370
+ top: layoutPad.top + (scrollPadding?.top ?? 0),
371
+ right: layoutPad.right + (scrollPadding?.right ?? 0),
372
+ bottom: layoutPad.bottom + (scrollPadding?.bottom ?? 0),
373
+ left: layoutPad.left + (scrollPadding?.left ?? 0),
231
374
  },
232
375
  );
233
376
  }, []);
234
377
 
235
378
  const maybeScrollIntoView = React.useCallback(
236
379
  (rect: Rect) => {
380
+ // Scrolling the app to reveal a target we are fading away from is visible.
381
+ if (exitingRef.current) return;
237
382
  if (scrollSettledRef.current) return;
238
383
  if (isRectFullyVisible(rect, effectiveViewport())) {
239
384
  scrollSettledRef.current = true;
@@ -271,43 +416,41 @@ export function TooltipSurface({
271
416
  const resolveTarget = React.useCallback(() => {
272
417
  if (!mountedRef.current) return;
273
418
 
274
- if (!anchorId) {
275
- hostFiberRef.current = null;
276
- hostMeasureRef.current = null;
277
- hostScrollIntoViewRef.current = undefined;
278
- markMeasureAttempted();
279
- applyTarget(null);
280
- return;
281
- }
282
-
283
- const resolution = resolveAnchorHost(anchorId);
284
- if (resolution.status !== 'found') {
285
- hostFiberRef.current = null;
286
- hostMeasureRef.current = null;
287
- hostScrollIntoViewRef.current = undefined;
288
- markMeasureAttempted();
289
- applyTarget(null);
419
+ const resolution = isAuto
420
+ ? resolveAutoAnchorHost(autoData)
421
+ : anchorId
422
+ ? resolveAnchorHost(anchorId)
423
+ : null;
424
+ if (!resolution || resolution.status !== 'found') {
425
+ dropHost();
290
426
  return;
291
427
  }
292
428
 
293
429
  hostFiberRef.current = resolution.fiber ?? null;
294
430
  hostMeasureRef.current = resolution.host.measureInWindow;
295
431
  hostScrollIntoViewRef.current = resolution.host.scrollIntoView;
432
+ fiberCacheIdRef.current =
433
+ 'fiberCacheId' in resolution && typeof resolution.fiberCacheId === 'string'
434
+ ? resolution.fiberCacheId
435
+ : (anchorId ?? null);
296
436
 
297
437
  // Kick an immediate measure after resolve so the first paint isn't waiting
298
438
  // on the next rAF (and so missing targets still mark attempted).
299
439
  if (measureInFlightRef.current) return;
440
+ const epoch = resolveEpochRef.current;
300
441
  measureInFlightRef.current = true;
301
442
  resolution.host.measureInWindow((x, y, width, height) => {
443
+ if (resolveEpochRef.current !== epoch) {
444
+ measureInFlightRef.current = false;
445
+ return;
446
+ }
302
447
  measureInFlightRef.current = false;
303
448
  if (!mountedRef.current) return;
304
449
 
305
450
  if (width <= 0 || height <= 0) {
306
- invalidateFiberAnchor(anchorId);
307
- hostFiberRef.current = null;
308
- hostMeasureRef.current = null;
309
- markMeasureAttempted();
310
- applyTarget(null);
451
+ const cacheId = fiberCacheIdRef.current;
452
+ if (cacheId) invalidateFiberAnchor(cacheId);
453
+ dropHost();
311
454
  return;
312
455
  }
313
456
 
@@ -315,7 +458,7 @@ export function TooltipSurface({
315
458
  maybeScrollIntoView(rect);
316
459
  applyTarget(rect);
317
460
  });
318
- }, [anchorId, applyTarget, markMeasureAttempted, maybeScrollIntoView]);
461
+ }, [anchorId, applyTarget, autoData, dropHost, isAuto, maybeScrollIntoView]);
319
462
 
320
463
  /**
321
464
  * Live re-measure of an already-resolved host. Driven by the shared rAF hub
@@ -327,17 +470,20 @@ export function TooltipSurface({
327
470
  const measure = hostMeasureRef.current;
328
471
  if (!measure) return;
329
472
 
473
+ const epoch = resolveEpochRef.current;
330
474
  measureInFlightRef.current = true;
331
475
  measure((x, y, width, height) => {
476
+ if (resolveEpochRef.current !== epoch) {
477
+ measureInFlightRef.current = false;
478
+ return;
479
+ }
332
480
  measureInFlightRef.current = false;
333
481
  if (!mountedRef.current) return;
334
482
 
335
483
  if (width <= 0 || height <= 0) {
336
- if (anchorId) invalidateFiberAnchor(anchorId);
337
- hostFiberRef.current = null;
338
- hostMeasureRef.current = null;
339
- markMeasureAttempted();
340
- applyTarget(null);
484
+ const cacheId = fiberCacheIdRef.current;
485
+ if (cacheId) invalidateFiberAnchor(cacheId);
486
+ dropHost();
341
487
  return;
342
488
  }
343
489
 
@@ -345,14 +491,18 @@ export function TooltipSurface({
345
491
  maybeScrollIntoView(rect);
346
492
  applyTarget(rect);
347
493
  });
348
- }, [anchorId, applyTarget, markMeasureAttempted, maybeScrollIntoView]);
494
+ }, [applyTarget, dropHost, maybeScrollIntoView]);
349
495
 
350
496
  React.useEffect(() => {
497
+ if (!resolveArmed) return;
351
498
  resolveTarget();
352
- }, [resolveTarget, registryTick]);
499
+ }, [resolveTarget, registryTick, resolveArmed]);
353
500
 
354
501
  // Resolve poll: recover missing / remounted anchors. Live measurement is on rAF.
355
502
  React.useEffect(() => {
503
+ if (!resolveArmed) {
504
+ return;
505
+ }
356
506
  const allowsRecovery =
357
507
  behavior === 'FLAG' || behavior === 'ERROR' || (behavior === 'END' && session.draftMode);
358
508
  const pauseAfterReport = missingMode === 'reported' && !allowsRecovery;
@@ -381,7 +531,7 @@ export function TooltipSurface({
381
531
  kbShow.remove();
382
532
  kbHide.remove();
383
533
  };
384
- }, [resolveTarget, missingMode, behavior, session.draftMode]);
534
+ }, [resolveTarget, missingMode, behavior, session.draftMode, resolveArmed]);
385
535
 
386
536
  // rAF tracking while a host is resolved (and we are not paused after report).
387
537
  React.useEffect(() => {
@@ -422,7 +572,7 @@ export function TooltipSurface({
422
572
 
423
573
  const ms = parseToleranceMs(theme.tooltipMissingToleranceSeconds);
424
574
  const timer = setTimeout(() => {
425
- if (!mountedRef.current || reportedRef.current) return;
575
+ if (!mountedRef.current || exitingRef.current || reportedRef.current) return;
426
576
  reportedRef.current = true;
427
577
  setMissingMode('reported');
428
578
  void engine.reportTooltipTargetMissing(currentStep.id);
@@ -458,7 +608,40 @@ export function TooltipSurface({
458
608
  [windowDims.width, windowDims.height, keyboardBottomInset],
459
609
  );
460
610
  const cardMaxWidth = resolveTooltipCardMaxWidth(theme, currentStep.width, windowSize.width);
461
- const cardLayoutStyle = resolveTooltipCardLayout(cardMaxWidth, windowSize.width);
611
+ const viewportMaxHeight = resolveModalCardMaxHeight(windowSize.height, layoutInsets);
612
+ const minCardHeight = tooltipMinCardHeight({
613
+ contentPadding: chrome.contentPadding,
614
+ borderWidth: chrome.borderWidth,
615
+ cardMaxHeight: viewportMaxHeight,
616
+ });
617
+ const minSideCardWidth = tooltipMinSideCardWidth({
618
+ contentPadding: chrome.contentPadding,
619
+ borderWidth: chrome.borderWidth,
620
+ cardMaxWidth,
621
+ });
622
+ const sideCardWidth = React.useMemo(() => {
623
+ if (!target) return null;
624
+ if (desiredPlacement !== 'LEFT' && desiredPlacement !== 'RIGHT') return null;
625
+ const placementTarget = expandRect(target, backdropPadding + outsideHighlightSpread);
626
+ return resolveTooltipSideCardWidth({
627
+ placement: desiredPlacement,
628
+ target: placementTarget,
629
+ windowWidth: windowSize.width,
630
+ notchSize: chrome.notchSize,
631
+ cardMaxWidth,
632
+ minWidth: minSideCardWidth,
633
+ });
634
+ }, [
635
+ target,
636
+ desiredPlacement,
637
+ backdropPadding,
638
+ outsideHighlightSpread,
639
+ windowSize.width,
640
+ chrome.notchSize,
641
+ cardMaxWidth,
642
+ minSideCardWidth,
643
+ ]);
644
+ const defaultCardLayoutStyle = resolveTooltipCardLayout(cardMaxWidth, windowSize.width);
462
645
  const buttonsAlign = resolveTooltipButtonsAlign(theme);
463
646
  const progressBarProps = {
464
647
  enabled: theme.progressBarEnabled,
@@ -480,37 +663,94 @@ export function TooltipSurface({
480
663
 
481
664
  const layout = React.useMemo(() => {
482
665
  if (!target) return null;
666
+ // A target left over from the previous step belongs to that step's
667
+ // measurement; placing against it would also reuse that step's card size.
668
+ if (targetStepIdRef.current !== currentStep.id) return null;
669
+ const placementTarget = expandRect(target, backdropPadding + outsideHighlightSpread);
670
+ const viewportInsets = paddingAsEdgeInsets(layoutInsets);
671
+ const height = Math.min(bubbleSize.height, viewportMaxHeight);
672
+ const inferSize =
673
+ sideCardWidth != null ? { width: sideCardWidth, height } : { width: cardMaxWidth, height };
483
674
  const nextPlacement = inferTooltipPlacement({
484
- target,
485
- bubbleSize,
675
+ target: placementTarget,
676
+ bubbleSize: inferSize,
486
677
  notchSize: chrome.notchSize,
487
678
  windowSize,
488
679
  currentPlacement: placementRef.current,
489
680
  desiredPlacement,
681
+ viewportInsets,
682
+ minHeight: minCardHeight,
490
683
  });
684
+ const honorSide =
685
+ sideCardWidth != null &&
686
+ nextPlacement === desiredPlacement &&
687
+ (nextPlacement === 'LEFT' || nextPlacement === 'RIGHT');
688
+ const fitted = tooltipPlacementFits({
689
+ target: placementTarget,
690
+ bubbleSize: inferSize,
691
+ notchSize: chrome.notchSize,
692
+ windowSize,
693
+ placement: nextPlacement,
694
+ viewportInsets,
695
+ minHeight: minCardHeight,
696
+ });
697
+ let maxCardHeight = viewportMaxHeight;
698
+ if (nextPlacement === 'ABOVE' || nextPlacement === 'BELOW') {
699
+ const gap = tooltipVerticalGap({
700
+ placement: nextPlacement,
701
+ target: placementTarget,
702
+ windowHeight: windowSize.height,
703
+ notchSize: chrome.notchSize,
704
+ viewportInsets,
705
+ });
706
+ const budget = Math.floor(gap);
707
+ if (Number.isFinite(budget) && budget > 0) {
708
+ maxCardHeight = Math.max(minCardHeight, Math.min(viewportMaxHeight, budget));
709
+ }
710
+ }
711
+ const positionHeight = Math.min(height, maxCardHeight);
712
+ const positionSize = honorSide
713
+ ? { width: sideCardWidth, height: positionHeight }
714
+ : { width: cardMaxWidth, height: positionHeight };
491
715
  return {
492
716
  placement: nextPlacement,
717
+ honorSide,
718
+ fitted,
719
+ maxCardHeight,
493
720
  ...computeTooltipPosition({
494
721
  target,
495
- bubbleSize,
722
+ bubbleSize: positionSize,
496
723
  placement: nextPlacement,
497
724
  notchSize: chrome.notchSize,
498
725
  backdropPadding,
726
+ outsideHighlightSpread,
499
727
  windowSize,
500
728
  bubbleBorderRadius: chrome.borderRadius,
501
729
  bubbleBorderWidth: chrome.borderWidth,
730
+ viewportInsets,
502
731
  }),
503
732
  };
504
733
  }, [
505
734
  target,
506
735
  bubbleSize,
736
+ sideCardWidth,
737
+ cardMaxWidth,
738
+ viewportMaxHeight,
739
+ minCardHeight,
740
+ currentStep.id,
507
741
  chrome.notchSize,
508
742
  chrome.borderRadius,
509
743
  chrome.borderWidth,
510
744
  windowSize,
511
745
  desiredPlacement,
512
746
  backdropPadding,
747
+ outsideHighlightSpread,
748
+ layoutInsets,
513
749
  ]);
750
+ const cardLayoutStyle =
751
+ layout?.honorSide && sideCardWidth != null
752
+ ? { width: sideCardWidth, maxWidth: sideCardWidth }
753
+ : defaultCardLayoutStyle;
514
754
 
515
755
  React.useEffect(() => {
516
756
  if (layout && layout.placement !== placement) {
@@ -518,12 +758,58 @@ export function TooltipSurface({
518
758
  }
519
759
  }, [layout, placement]);
520
760
 
761
+ React.useEffect(() => {
762
+ if (!layout || !target) return;
763
+ if (desiredPlacement !== 'LEFT' && desiredPlacement !== 'RIGHT') return;
764
+ // A target left over from the previous step says nothing about this one.
765
+ if (targetStepIdRef.current !== currentStep.id) return;
766
+ if (!(session.draftMode || __DEV__)) return;
767
+ if (warnedSidePlacementStepRef.current === currentStep.id) return;
768
+ if (layout.placement === desiredPlacement) {
769
+ // Last-resort return of the authored side: nothing actually fit.
770
+ if (layout.fitted) return;
771
+ warnedSidePlacementStepRef.current = currentStep.id;
772
+ warnTooltipPlacementUnanchored({ requested: desiredPlacement });
773
+ return;
774
+ }
775
+ // Only the structural floor — not keyboard / off-screen flips. A resolved
776
+ // width means the room was there and something else moved the card.
777
+ if (sideCardWidth != null) return;
778
+ warnedSidePlacementStepRef.current = currentStep.id;
779
+ const placementTarget = expandRect(target, backdropPadding + outsideHighlightSpread);
780
+ warnTooltipSidePlacementDropped({
781
+ requested: desiredPlacement,
782
+ used: layout.placement,
783
+ availableGap: tooltipSideGap({
784
+ placement: desiredPlacement,
785
+ target: placementTarget,
786
+ windowWidth: windowSize.width,
787
+ notchSize: chrome.notchSize,
788
+ }),
789
+ minWidth: minSideCardWidth,
790
+ });
791
+ }, [
792
+ layout,
793
+ target,
794
+ desiredPlacement,
795
+ sideCardWidth,
796
+ session.draftMode,
797
+ currentStep.id,
798
+ backdropPadding,
799
+ outsideHighlightSpread,
800
+ windowSize.width,
801
+ chrome.notchSize,
802
+ minSideCardWidth,
803
+ ]);
804
+
521
805
  // Web parity: "When target element is clicked" → step.actions.
522
806
  // Observe taps via TargetPressBridge (pass-through); do not steal the press.
523
807
  const hasTarget = target != null;
524
808
  const targetActions = currentStep.actions;
525
809
  React.useEffect(() => {
526
- if (!hasTarget || currentStep.tooltipTargetBlocked || targetActions.length === 0) {
810
+ // Release the monitor while exiting: it is a singleton, and a tap landing on
811
+ // the old target would run the departing step's actions.
812
+ if (isExiting || !hasTarget || currentStep.tooltipTargetBlocked || targetActions.length === 0) {
527
813
  targetPressMonitor.clear();
528
814
  return;
529
815
  }
@@ -531,6 +817,8 @@ export function TooltipSurface({
531
817
  targetPressMonitor.set({
532
818
  getRect: () => targetRef.current,
533
819
  onPress: () => {
820
+ // Native touches are async relative to commits, so re-check the phase.
821
+ if (exitingRef.current) return;
534
822
  void engine.handleActions(targetActions);
535
823
  },
536
824
  });
@@ -538,22 +826,40 @@ export function TooltipSurface({
538
826
  return () => {
539
827
  targetPressMonitor.clear();
540
828
  };
541
- }, [hasTarget, currentStep.tooltipTargetBlocked, targetActions, engine]);
829
+ }, [hasTarget, currentStep.tooltipTargetBlocked, targetActions, engine, isExiting]);
830
+
831
+ // Painted from mount rather than once the target lands, so a modal → tooltip
832
+ // swap keeps the dim continuous instead of blinking it off for the frames the
833
+ // anchor takes to measure. The hole opens when `layout` arrives.
834
+ // Always mount the cutout: when `backdrop` is off the dim opacity is 0 but
835
+ // the bands still block host taps (unless interaction blocking is disabled).
836
+ const interactionBlocker = (
837
+ <TooltipCutout
838
+ targetRect={layout?.targetHighlightRect ?? null}
839
+ backdropColor={theme.backdropColor}
840
+ backdropOpacity={currentStep.backdrop ? backdropOpacity : 0}
841
+ targetBlocked={currentStep.tooltipTargetBlocked}
842
+ />
843
+ );
542
844
 
543
845
  if (hideAfterEnd) {
544
846
  return null;
545
847
  }
546
848
 
547
- // Still pending the first measure attempt — stay invisible briefly.
849
+ const showBranding = session.flow.company.flowBranding;
850
+ const contentPadding = chrome.contentPadding;
851
+
852
+ // Still pending the first measure attempt — only the blocker shows.
548
853
  if (isMissing && missingMode === 'waiting' && !measureAttempted) {
549
- return null;
854
+ return backdropOnly(interactionBlocker);
550
855
  }
551
856
 
552
857
  if (showWaitingUi) {
553
858
  return (
554
859
  <View style={styles.root} testID="userflow-tooltip-surface" pointerEvents="box-none">
860
+ {interactionBlocker}
555
861
  <View style={[styles.center, centerPaddingStyle]} pointerEvents="box-none">
556
- <View
862
+ <CardFade
557
863
  testID="userflow-tooltip-waiting"
558
864
  accessibilityViewIsModal
559
865
  pointerEvents="auto"
@@ -564,26 +870,39 @@ export function TooltipSurface({
564
870
  {
565
871
  borderRadius: chrome.borderRadius,
566
872
  backgroundColor: chrome.backgroundColor,
873
+ maxHeight: viewportMaxHeight,
567
874
  },
568
875
  ]}
569
876
  >
570
877
  {/* Shadow on the outer shell — fill clips and iOS would clip the shadow. */}
571
- <View
572
- style={[chrome.fillStyle, { padding: chrome.contentPadding, alignItems: 'center' }]}
573
- >
574
- <ActivityIndicator color={theme.fontColor} />
575
- <Text
878
+ <View style={[chrome.fillStyle, { maxHeight: viewportMaxHeight, minHeight: 0 }]}>
879
+ <View
576
880
  style={{
577
- color: theme.fontColor,
578
- fontSize: theme.fontSize,
579
- marginTop: 12,
580
- textAlign: 'center',
881
+ paddingHorizontal: contentPadding,
882
+ paddingTop: contentPadding,
883
+ paddingBottom: showBranding ? MADE_WITH_USERFLOW_GAP : contentPadding,
884
+ alignItems: 'center',
581
885
  }}
582
886
  >
583
- Looking for target…
584
- </Text>
887
+ <ActivityIndicator color={theme.fontColor} />
888
+ <Text
889
+ style={{
890
+ color: theme.fontColor,
891
+ fontSize: theme.fontSize,
892
+ marginTop: 12,
893
+ textAlign: 'center',
894
+ }}
895
+ >
896
+ Looking for target…
897
+ </Text>
898
+ </View>
899
+ <MadeWithUserflow
900
+ company={session.flow.company}
901
+ color={theme.fontColor}
902
+ contentPadding={contentPadding}
903
+ />
585
904
  </View>
586
- </View>
905
+ </CardFade>
587
906
  </View>
588
907
  </View>
589
908
  );
@@ -591,8 +910,6 @@ export function TooltipSurface({
591
910
 
592
911
  const progressTop = theme.progressBarEnabled && theme.progressBarPosition === 'TOP';
593
912
  const progressBottom = theme.progressBarEnabled && theme.progressBarPosition === 'BOTTOM';
594
- const showBranding = session.flow.company.flowBranding;
595
- const contentPadding = chrome.contentPadding;
596
913
 
597
914
  const cardBody = (
598
915
  <>
@@ -653,8 +970,9 @@ export function TooltipSurface({
653
970
  if (showAsBubbleFallback || showMissingUi) {
654
971
  return (
655
972
  <View style={styles.root} testID="userflow-tooltip-surface" pointerEvents="box-none">
973
+ {interactionBlocker}
656
974
  <View style={[styles.center, centerPaddingStyle]} pointerEvents="box-none">
657
- <View
975
+ <CardFade
658
976
  testID="userflow-tooltip-card"
659
977
  accessibilityViewIsModal
660
978
  pointerEvents="auto"
@@ -666,37 +984,38 @@ export function TooltipSurface({
666
984
  {
667
985
  borderRadius: chrome.borderRadius,
668
986
  backgroundColor: chrome.backgroundColor,
987
+ maxHeight: viewportMaxHeight,
669
988
  },
670
989
  ]}
671
990
  >
672
991
  {/* Shadow lives on the outer layer: the fill clips its content and
673
992
  iOS clips the shadow with it. */}
674
- <View style={[chrome.fillStyle, styles.fallbackFill]}>{cardBody}</View>
675
- </View>
993
+ <View style={[chrome.fillStyle, styles.fallbackFill, { maxHeight: viewportMaxHeight }]}>
994
+ {cardBody}
995
+ </View>
996
+ </CardFade>
676
997
  </View>
677
998
  </View>
678
999
  );
679
1000
  }
680
1001
 
681
1002
  if (!layout || !target) {
682
- return null;
1003
+ return backdropOnly(interactionBlocker);
683
1004
  }
684
1005
 
685
1006
  return (
686
1007
  <View style={styles.root} testID="userflow-tooltip-surface" pointerEvents="box-none">
687
- {currentStep.backdrop ? (
688
- <TooltipCutout
689
- targetRect={layout.targetHighlightRect}
690
- backdropColor={theme.backdropColor}
691
- backdropOpacity={backdropOpacity}
692
- targetBlocked={currentStep.tooltipTargetBlocked}
693
- />
1008
+ {interactionBlocker}
1009
+ {highlight ? (
1010
+ <TooltipHighlight targetRect={layout.targetHighlightRect} chrome={highlight} />
694
1011
  ) : null}
695
1012
 
696
1013
  <TooltipBubble
697
1014
  chrome={chrome}
698
1015
  notchPosition={layout.notchPosition}
699
1016
  onLayout={onCardLayout}
1017
+ maxHeight={layout.maxCardHeight}
1018
+ showNotch={layout.showNotch}
700
1019
  style={{
701
1020
  position: 'absolute',
702
1021
  left: layout.cardPosition.x,
@@ -720,18 +1039,19 @@ const styles = StyleSheet.create({
720
1039
  alignItems: 'center',
721
1040
  },
722
1041
  fallbackCard: {
723
- maxHeight: '80%',
724
1042
  flexShrink: 1,
725
1043
  },
726
1044
  fallbackFill: {
727
1045
  flexShrink: 1,
1046
+ minHeight: 0,
728
1047
  },
729
1048
  waitingCard: {
730
1049
  width: '100%',
731
1050
  },
732
1051
  scroll: {
733
- flexGrow: 0,
1052
+ flexGrow: 1,
734
1053
  flexShrink: 1,
1054
+ minHeight: 0,
735
1055
  },
736
1056
  scrollContent: {
737
1057
  flexGrow: 1,