@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
@@ -1,6 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  import { VIEWPORT_PADDING } from "./inferTooltipPlacement.js";
4
+ /** Pixel slack so a card that sits exactly on the target edge still counts. */
5
+ const ADJACENCY_EPSILON = 0.5;
6
+ function notchCanPointAtTarget(opts) {
7
+ if (opts.notchSize <= 0) return false;
8
+ const {
9
+ placement,
10
+ cx,
11
+ cy,
12
+ bw,
13
+ bh,
14
+ targetRect
15
+ } = opts;
16
+ const targetMidX = targetRect.left + (targetRect.right - targetRect.left) / 2;
17
+ const targetMidY = targetRect.top + (targetRect.bottom - targetRect.top) / 2;
18
+ const reachableX = targetMidX >= cx - ADJACENCY_EPSILON && targetMidX <= cx + bw + ADJACENCY_EPSILON;
19
+ const reachableY = targetMidY >= cy - ADJACENCY_EPSILON && targetMidY <= cy + bh + ADJACENCY_EPSILON;
20
+ switch (placement) {
21
+ case 'BELOW':
22
+ return cy + ADJACENCY_EPSILON >= targetRect.bottom && reachableX;
23
+ case 'ABOVE':
24
+ return cy + bh <= targetRect.top + ADJACENCY_EPSILON && reachableX;
25
+ case 'RIGHT':
26
+ return cx + ADJACENCY_EPSILON >= targetRect.right && reachableY;
27
+ case 'LEFT':
28
+ return cx + bw <= targetRect.left + ADJACENCY_EPSILON && reachableY;
29
+ default:
30
+ return false;
31
+ }
32
+ }
33
+ function resolveViewportInsets(viewportPadding, viewportInsets) {
34
+ return {
35
+ top: viewportInsets?.top ?? viewportPadding,
36
+ right: viewportInsets?.right ?? viewportPadding,
37
+ bottom: viewportInsets?.bottom ?? viewportPadding,
38
+ left: viewportInsets?.left ?? viewportPadding
39
+ };
40
+ }
41
+
4
42
  /**
5
43
  * Side length of the axis-aligned square that, when rotated 45°, yields a
6
44
  * tip that protrudes `notchSize` beyond the card edge (half-diagonal = N).
@@ -24,10 +62,12 @@ export function computeTooltipPosition(opts) {
24
62
  placement,
25
63
  notchSize,
26
64
  backdropPadding = 0,
65
+ outsideHighlightSpread = 0,
27
66
  windowSize,
28
67
  bubbleBorderRadius,
29
68
  bubbleBorderWidth = 0,
30
- viewportPadding = VIEWPORT_PADDING
69
+ viewportPadding = VIEWPORT_PADDING,
70
+ viewportInsets
31
71
  } = opts;
32
72
  const {
33
73
  width: cw,
@@ -37,13 +77,15 @@ export function computeTooltipPosition(opts) {
37
77
  width: bw,
38
78
  height: bh
39
79
  } = bubbleSize;
80
+ const pad = resolveViewportInsets(viewportPadding, viewportInsets);
81
+ const placementPad = backdropPadding + outsideHighlightSpread;
40
82
  const targetRect = {
41
- top: target.y - backdropPadding,
42
- right: target.x + target.width + backdropPadding,
43
- bottom: target.y + target.height + backdropPadding,
44
- left: target.x - backdropPadding,
45
- width: target.width + backdropPadding * 2,
46
- height: target.height + backdropPadding * 2
83
+ top: target.y - placementPad,
84
+ right: target.x + target.width + placementPad,
85
+ bottom: target.y + target.height + placementPad,
86
+ left: target.x - placementPad,
87
+ width: target.width + placementPad * 2,
88
+ height: target.height + placementPad * 2
47
89
  };
48
90
  let cx = 0;
49
91
  let cy = 0;
@@ -53,30 +95,33 @@ export function computeTooltipPosition(opts) {
53
95
  const edgeOffset = -half + Math.max(0, bubbleBorderWidth) + 1;
54
96
  if (placement === 'BELOW' || placement === 'ABOVE') {
55
97
  cx = targetRect.left + targetRect.width / 2 - bw / 2;
56
- cx = Math.max(viewportPadding, Math.min(cw - bw - viewportPadding, cx));
98
+ cx = Math.max(pad.left, Math.min(cw - bw - pad.right, cx));
57
99
  const rawLeft = targetRect.left + targetRect.width / 2 - half - cx;
58
100
  notch.left = Math.max(bubbleBorderRadius, Math.min(bw - bubbleBorderRadius - side, rawLeft));
59
101
  if (placement === 'BELOW') {
60
102
  cy = targetRect.bottom + notchSize;
61
- cy = Math.max(notchSize, Math.min(ch - bh, cy));
103
+ cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
62
104
  notch.top = edgeOffset;
63
105
  } else {
64
106
  cy = targetRect.top - notchSize - bh;
65
- cy = Math.max(0, Math.min(ch - bh - notchSize, cy));
107
+ cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
66
108
  notch.bottom = edgeOffset;
67
109
  }
68
110
  } else {
69
111
  cy = targetRect.top + targetRect.height / 2 - bh / 2;
70
- cy = Math.max(viewportPadding, Math.min(ch - bh - viewportPadding, cy));
112
+ cy = Math.max(pad.top, Math.min(ch - bh - pad.bottom, cy));
71
113
  const rawTop = targetRect.top + targetRect.height / 2 - half - cy;
72
114
  notch.top = Math.max(bubbleBorderRadius, Math.min(bh - bubbleBorderRadius - side, rawTop));
115
+
116
+ // LEFT keeps pad.left; RIGHT used to min at notchSize, which sat inside the
117
+ // screen margin when the target was near the left edge.
73
118
  if (placement === 'RIGHT') {
74
119
  cx = targetRect.right + notchSize;
75
- cx = Math.max(notchSize, Math.min(cw - bw, cx));
120
+ cx = Math.max(pad.left, Math.min(cw - bw - pad.right, cx));
76
121
  notch.left = edgeOffset;
77
122
  } else {
78
123
  cx = targetRect.left - notchSize - bw;
79
- cx = Math.max(0, Math.min(cw - bw - notchSize, cx));
124
+ cx = Math.max(pad.left, Math.min(cw - bw - notchSize, cx));
80
125
  notch.right = edgeOffset;
81
126
  }
82
127
  }
@@ -86,6 +131,15 @@ export function computeTooltipPosition(opts) {
86
131
  y: cy
87
132
  },
88
133
  notchPosition: notch,
134
+ showNotch: notchCanPointAtTarget({
135
+ placement,
136
+ cx,
137
+ cy,
138
+ bw,
139
+ bh,
140
+ targetRect,
141
+ notchSize
142
+ }),
89
143
  targetHighlightRect: {
90
144
  top: target.y - backdropPadding,
91
145
  left: target.x - backdropPadding,
@@ -1 +1 @@
1
- {"version":3,"names":["VIEWPORT_PADDING","tooltipNotchDiamondSide","notchSize","Math","SQRT2","computeTooltipPosition","opts","target","bubbleSize","placement","backdropPadding","windowSize","bubbleBorderRadius","bubbleBorderWidth","viewportPadding","width","cw","height","ch","bw","bh","targetRect","top","y","right","x","bottom","left","cx","cy","notch","side","half","edgeOffset","max","min","rawLeft","rawTop","cardPosition","notchPosition","targetHighlightRect"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/computeTooltipPosition.ts"],"mappings":";;AAOA,SAASA,gBAAgB,QAAQ,4BAAyB;AAgB1D;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,SAAiB,EAAU;EACjE,OAAOA,SAAS,GAAGC,IAAI,CAACC,KAAK;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,IAUtC,EAAiB;EAChB,MAAM;IACJC,MAAM;IACNC,UAAU;IACV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}
1
+ {"version":3,"names":["VIEWPORT_PADDING","ADJACENCY_EPSILON","notchCanPointAtTarget","opts","notchSize","placement","cx","cy","bw","bh","targetRect","targetMidX","left","right","targetMidY","top","bottom","reachableX","reachableY","resolveViewportInsets","viewportPadding","viewportInsets","tooltipNotchDiamondSide","Math","SQRT2","computeTooltipPosition","target","bubbleSize","backdropPadding","outsideHighlightSpread","windowSize","bubbleBorderRadius","bubbleBorderWidth","width","cw","height","ch","pad","placementPad","y","x","notch","side","half","edgeOffset","max","min","rawLeft","rawTop","cardPosition","notchPosition","showNotch","targetHighlightRect"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/computeTooltipPosition.ts"],"mappings":";;AAOA,SAASA,gBAAgB,QAAQ,4BAAyB;AA6B1D;AACA,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,SAASC,qBAAqBA,CAACC,IAQ9B,EAAW;EACV,IAAIA,IAAI,CAACC,SAAS,IAAI,CAAC,EAAE,OAAO,KAAK;EACrC,MAAM;IAAEC,SAAS;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;IAAEC;EAAW,CAAC,GAAGP,IAAI;EACtD,MAAMQ,UAAU,GAAGD,UAAU,CAACE,IAAI,GAAG,CAACF,UAAU,CAACG,KAAK,GAAGH,UAAU,CAACE,IAAI,IAAI,CAAC;EAC7E,MAAME,UAAU,GAAGJ,UAAU,CAACK,GAAG,GAAG,CAACL,UAAU,CAACM,MAAM,GAAGN,UAAU,CAACK,GAAG,IAAI,CAAC;EAC5E,MAAME,UAAU,GACdN,UAAU,IAAIL,EAAE,GAAGL,iBAAiB,IAAIU,UAAU,IAAIL,EAAE,GAAGE,EAAE,GAAGP,iBAAiB;EACnF,MAAMiB,UAAU,GACdJ,UAAU,IAAIP,EAAE,GAAGN,iBAAiB,IAAIa,UAAU,IAAIP,EAAE,GAAGE,EAAE,GAAGR,iBAAiB;EAEnF,QAAQI,SAAS;IACf,KAAK,OAAO;MACV,OAAOE,EAAE,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,EAAEc,MAAM,CAACc,CAAC,GAAGZ,eAAe;MAChCK,KAAK,EAAEP,MAAM,CAACO,KAAK,GAAGL,eAAe,GAAG,CAAC;MACzCO,MAAM,EAAET,MAAM,CAACS,MAAM,GAAGP,eAAe,GAAG;IAC5C;EACF,CAAC;AACH","ignoreList":[]}
@@ -5,9 +5,78 @@
5
5
  import { TOOLTIP_VIEWPORT_PADDING } from "../resolveTooltipLayout.js";
6
6
  export const VIEWPORT_PADDING = TOOLTIP_VIEWPORT_PADDING;
7
7
 
8
+ /** Per-edge screen margin; each omitted edge falls back to `viewportPadding`. */
9
+
10
+ /**
11
+ * Whether `placement` has room beside `target` for `bubbleSize`.
12
+ *
13
+ * Inclusive: a card that exactly fills the remaining gap (LEFT/RIGHT after
14
+ * side-narrowing) still fits. Every side reserves the matching edge margin so
15
+ * this agrees with the clamp in `computeTooltipPosition`; when the two
16
+ * disagree, a placement passes here and is then drawn somewhere else.
17
+ */
18
+ export function tooltipPlacementFits({
19
+ target,
20
+ bubbleSize,
21
+ notchSize,
22
+ windowSize,
23
+ placement,
24
+ viewportPadding = VIEWPORT_PADDING,
25
+ viewportInsets,
26
+ minHeight
27
+ }) {
28
+ const {
29
+ width: cw,
30
+ height: ch
31
+ } = windowSize;
32
+ const {
33
+ width: bw,
34
+ height: bh
35
+ } = bubbleSize;
36
+ const clip = {
37
+ top: 0,
38
+ right: cw,
39
+ bottom: ch,
40
+ left: 0
41
+ };
42
+ const targetRect = {
43
+ top: target.y,
44
+ right: target.x + target.width,
45
+ bottom: target.y + target.height,
46
+ left: target.x,
47
+ width: target.width,
48
+ height: target.height
49
+ };
50
+ const midX = targetRect.left + targetRect.width / 2;
51
+ const midY = targetRect.top + targetRect.height / 2;
52
+ const midXIn = midX >= clip.left && midX <= clip.right;
53
+ const midYIn = midY >= clip.top && midY <= clip.bottom;
54
+ const verticalHeight = minHeight != null && Number.isFinite(minHeight) ? Math.min(bh, Math.max(0, minHeight)) : bh;
55
+ const padTop = viewportInsets?.top ?? viewportPadding;
56
+ const padRight = viewportInsets?.right ?? viewportPadding;
57
+ const padBottom = viewportInsets?.bottom ?? viewportPadding;
58
+ const padLeft = viewportInsets?.left ?? viewportPadding;
59
+ switch (placement) {
60
+ case 'BELOW':
61
+ return ch - targetRect.bottom >= verticalHeight + notchSize + padBottom && midXIn;
62
+ case 'ABOVE':
63
+ return targetRect.top >= verticalHeight + notchSize + padTop && midXIn;
64
+ case 'RIGHT':
65
+ return cw - targetRect.right >= bw + notchSize + padRight && midYIn;
66
+ case 'LEFT':
67
+ return targetRect.left >= bw + notchSize + padLeft && midYIn;
68
+ default:
69
+ return false;
70
+ }
71
+ }
72
+
8
73
  /**
9
74
  * Port of web FlowChrome `inferTooltipPlacement` with distance-sorted flip
10
75
  * (not the prototype's fixed BELOW→ABOVE→RIGHT→LEFT priority).
76
+ *
77
+ * When no side fits, returns `desiredPlacement` (or BELOW) as a last resort —
78
+ * callers must check {@link tooltipPlacementFits} on the result to tell a real
79
+ * fit from that fallback.
11
80
  */
12
81
  export function inferTooltipPlacement({
13
82
  target,
@@ -15,7 +84,10 @@ export function inferTooltipPlacement({
15
84
  notchSize,
16
85
  windowSize,
17
86
  currentPlacement,
18
- desiredPlacement
87
+ desiredPlacement,
88
+ viewportPadding = VIEWPORT_PADDING,
89
+ viewportInsets,
90
+ minHeight
19
91
  }) {
20
92
  const {
21
93
  width: cw,
@@ -51,24 +123,20 @@ export function inferTooltipPlacement({
51
123
  if (targetRect.left >= clip.right) {
52
124
  return clip.right > bw + notchSize ? 'LEFT' : 'RIGHT';
53
125
  }
54
- const fits = p => {
55
- const midX = targetRect.left + targetRect.width / 2;
56
- const midY = targetRect.top + targetRect.height / 2;
57
- const midXIn = midX >= clip.left && midX <= clip.right;
58
- const midYIn = midY >= clip.top && midY <= clip.bottom;
59
- switch (p) {
60
- case 'BELOW':
61
- return ch - targetRect.bottom > bh + notchSize && midXIn;
62
- case 'ABOVE':
63
- return targetRect.top > bh + notchSize && midXIn;
64
- case 'RIGHT':
65
- return cw - targetRect.right > bw + notchSize && midYIn;
66
- case 'LEFT':
67
- return targetRect.left > bw + notchSize && midYIn;
68
- default:
69
- return false;
70
- }
71
- };
126
+ const fits = p => tooltipPlacementFits({
127
+ target,
128
+ bubbleSize,
129
+ notchSize,
130
+ windowSize,
131
+ placement: p,
132
+ viewportPadding,
133
+ ...(viewportInsets != null ? {
134
+ viewportInsets
135
+ } : {}),
136
+ ...(minHeight != null ? {
137
+ minHeight
138
+ } : {})
139
+ });
72
140
  if (desiredPlacement && fits(desiredPlacement)) return desiredPlacement;
73
141
  if (currentPlacement && fits(currentPlacement)) return currentPlacement;
74
142
  const options = [{
@@ -1 +1 @@
1
- {"version":3,"names":["TOOLTIP_VIEWPORT_PADDING","VIEWPORT_PADDING","inferTooltipPlacement","target","bubbleSize","notchSize","windowSize","currentPlacement","desiredPlacement","width","cw","height","ch","bw","bh","clip","top","right","bottom","left","targetRect","y","x","fits","p","midX","midY","midXIn","midYIn","options","placement","dist","sort","a","b"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/inferTooltipPlacement.ts"],"mappings":";;AAAA;;AAyBA,SAASA,wBAAwB,QAAQ,4BAAyB;AAElE,OAAO,MAAMC,gBAAgB,GAAGD,wBAAwB;;AAExD;AACA;AACA;AACA;AACA,OAAO,SAASE,qBAAqBA,CAAC;EACpCC,MAAM;EACNC,UAAU;EACVC,SAAS;EACTC,UAAU;EACVC,gBAAgB;EAChBC;AAQF,CAAC,EAAwB;EACvB,MAAM;IAAEC,KAAK,EAAEC,EAAE;IAAEC,MAAM,EAAEC;EAAG,CAAC,GAAGN,UAAU;EAC5C,MAAM;IAAEG,KAAK,EAAEI,EAAE;IAAEF,MAAM,EAAEG;EAAG,CAAC,GAAGV,UAAU;EAC5C,MAAMW,IAAI,GAAG;IAAEC,GAAG,EAAE,CAAC;IAAEC,KAAK,EAAEP,EAAE;IAAEQ,MAAM,EAAEN,EAAE;IAAEO,IAAI,EAAE;EAAE,CAAC;EA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;EAAU,CAAC,IAAID,OAAO,EAAE;IACnC,IAAIN,IAAI,CAACO,SAAS,CAAC,EAAE,OAAOA,SAAS;EACvC;EAEA,OAAOtB,gBAAgB,IAAI,OAAO;AACpC","ignoreList":[]}
1
+ {"version":3,"names":["TOOLTIP_VIEWPORT_PADDING","VIEWPORT_PADDING","tooltipPlacementFits","target","bubbleSize","notchSize","windowSize","placement","viewportPadding","viewportInsets","minHeight","width","cw","height","ch","bw","bh","clip","top","right","bottom","left","targetRect","y","x","midX","midY","midXIn","midYIn","verticalHeight","Number","isFinite","Math","min","max","padTop","padRight","padBottom","padLeft","inferTooltipPlacement","currentPlacement","desiredPlacement","fits","p","options","dist","sort","a","b"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/inferTooltipPlacement.ts"],"mappings":";;AAAA;;AAyBA,SAASA,wBAAwB,QAAQ,4BAAyB;AAElE,OAAO,MAAMC,gBAAgB,GAAGD,wBAAwB;;AAExD;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,oBAAoBA,CAAC;EACnCC,MAAM;EACNC,UAAU;EACVC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,eAAe,GAAGP,gBAAgB;EAClCQ,cAAc;EACdC;AACwB,CAAC,EAAW;EACpC,MAAM;IAAEC,KAAK,EAAEC,EAAE;IAAEC,MAAM,EAAEC;EAAG,CAAC,GAAGR,UAAU;EAC5C,MAAM;IAAEK,KAAK,EAAEI,EAAE;IAAEF,MAAM,EAAEG;EAAG,CAAC,GAAGZ,UAAU;EAC5C,MAAMa,IAAI,GAAG;IAAEC,GAAG,EAAE,CAAC;IAAEC,KAAK,EAAEP,EAAE;IAAEQ,MAAM,EAAEN,EAAE;IAAEO,IAAI,EAAE;EAAE,CAAC;EACvD,MAAMC,UAAU,GAAG;IACjBJ,GAAG,EAAEf,MAAM,CAACoB,CAAC;IACbJ,KAAK,EAAEhB,MAAM,CAACqB,CAAC,GAAGrB,MAAM,CAACQ,KAA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AAE,OAAO;IAAEsC,IAAI,EAAEvB,UAAU,CAACD;EAAK,CAAC,EAC7C;IAAEd,SAAS,EAAE,MAAM;IAAEsC,IAAI,EAAEjC,EAAE,GAAGU,UAAU,CAACH;EAAM,CAAC,CACnD;EACDyB,OAAO,CAACE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACF,IAAI,GAAGG,CAAC,CAACH,IAAI,CAAC;EACvC,KAAK,MAAM;IAAEtC;EAAU,CAAC,IAAIqC,OAAO,EAAE;IACnC,IAAIF,IAAI,CAACnC,SAAS,CAAC,EAAE,OAAOA,SAAS;EACvC;EAEA,OAAOkC,gBAAgB,IAAI,OAAO;AACpC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ const PREFIX = '[Userflow]';
4
+
5
+ /** Sink for placement diagnostics. Injected in tests. */
6
+
7
+ export const defaultPlacementLogger = message => {
8
+ // eslint-disable-next-line no-console -- intentional development diagnostic
9
+ console.warn(message);
10
+ };
11
+
12
+ /**
13
+ * A Builder-requested LEFT/RIGHT side could not be drawn at all: the room
14
+ * beside the target is smaller than the card's own chrome, so no width is left
15
+ * to lay content out in. Draft/preview and `__DEV__` only.
16
+ *
17
+ * The caller must not emit this when the side was honored at a reduced width —
18
+ * shrinking is the expected outcome now, and whether it looks good is the
19
+ * author's call — nor for keyboard / off-screen vertical flips, whose cause is
20
+ * not the room beside the target.
21
+ */
22
+ export function tooltipSidePlacementDroppedMessage(opts) {
23
+ const gap = Number.isFinite(opts.availableGap) ? Math.max(0, Math.floor(opts.availableGap)) : 0;
24
+ const minWidth = Number.isFinite(opts.minWidth) ? Math.max(0, Math.ceil(opts.minWidth)) : 0;
25
+ return `${PREFIX} Tooltip placement "${opts.requested}" could not be drawn beside the target ` + `(${gap}pt of room beside it; the card needs ${minWidth}pt for its padding and border). ` + `Placed ${opts.used} instead.`;
26
+ }
27
+ export function warnTooltipSidePlacementDropped(opts, log = defaultPlacementLogger) {
28
+ log(tooltipSidePlacementDroppedMessage(opts));
29
+ }
30
+
31
+ /**
32
+ * No side had room for the card — including the authored LEFT/RIGHT — so
33
+ * {@link inferTooltipPlacement} returned the requested side as a last resort.
34
+ * Draft/preview and `__DEV__` only. Distinct from
35
+ * {@link tooltipSidePlacementDroppedMessage}, which reports a successful flip.
36
+ */
37
+ export function tooltipPlacementUnanchoredMessage(opts) {
38
+ return `${PREFIX} Tooltip placement "${opts.requested}" could not be drawn on any side of the target. ` + `The card is on-screen but the pointer is hidden because it cannot point at the target.`;
39
+ }
40
+ export function warnTooltipPlacementUnanchored(opts, log = defaultPlacementLogger) {
41
+ log(tooltipPlacementUnanchoredMessage(opts));
42
+ }
43
+ //# sourceMappingURL=placementDiagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PREFIX","defaultPlacementLogger","message","console","warn","tooltipSidePlacementDroppedMessage","opts","gap","Number","isFinite","availableGap","Math","max","floor","minWidth","ceil","requested","used","warnTooltipSidePlacementDropped","log","tooltipPlacementUnanchoredMessage","warnTooltipPlacementUnanchored"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/placementDiagnostics.ts"],"mappings":";;AAEA,MAAMA,MAAM,GAAG,YAAY;;AAE3B;;AAGA,OAAO,MAAMC,sBAAuC,GAAIC,OAAO,IAAK;EAClE;EACAC,OAAO,CAACC,IAAI,CAACF,OAAO,CAAC;AACvB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,kCAAkCA,CAACC,IAKlD,EAAU;EACT,MAAMC,GAAG,GAAGC,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACI,YAAY,CAAC,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,KAAK,CAACP,IAAI,CAACI,YAAY,CAAC,CAAC,GAAG,CAAC;EAC/F,MAAMI,QAAQ,GAAGN,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACQ,QAAQ,CAAC,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACI,IAAI,CAACT,IAAI,CAACQ,QAAQ,CAAC,CAAC,GAAG,CAAC;EAC3F,OACE,GAAGd,MAAM,uBAAuBM,IAAI,CAACU,SAAS,yCAAyC,GACvF,IAAIT,GAAG,wCAAwCO,QAAQ,kCAAkC,GACzF,UAAUR,IAAI,CAACW,IAAI,WAAW;AAElC;AAEA,OAAO,SAASC,+BAA+BA,CAC7CZ,IAKC,EACDa,GAAoB,GAAGlB,sBAAsB,EACvC;EACNkB,GAAG,CAACd,kCAAkC,CAACC,IAAI,CAAC,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASc,iCAAiCA,CAACd,IAEjD,EAAU;EACT,OACE,GAAGN,MAAM,uBAAuBM,IAAI,CAACU,SAAS,kDAAkD,GAChG,wFAAwF;AAE5F;AAEA,OAAO,SAASK,8BAA8BA,CAC5Cf,IAAyC,EACzCa,GAAoB,GAAGlB,sBAAsB,EACvC;EACNkB,GAAG,CAACC,iCAAiC,CAACd,IAAI,CAAC,CAAC;AAC9C","ignoreList":[]}
@@ -1,5 +1,16 @@
1
1
  "use strict";
2
2
 
3
+ /** Grow or shrink `rect` by `padding` on every side. */
4
+ export function expandRect(rect, padding) {
5
+ if (padding === 0) return rect;
6
+ return {
7
+ x: rect.x - padding,
8
+ y: rect.y - padding,
9
+ width: rect.width + padding * 2,
10
+ height: rect.height + padding * 2
11
+ };
12
+ }
13
+
3
14
  /** True when two rects are identical (used to avoid redundant setState). */
4
15
  export function rectsEqual(a, b) {
5
16
  if (a === b) return true;
@@ -1 +1 @@
1
- {"version":3,"names":["rectsEqual","a","b","x","y","width","height","isRectOffScreen","rect","windowSize","isRectFullyVisible","viewport","buildEffectiveViewport","insets","top","Math","max","right","bottom","left"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/rect.ts"],"mappings":";;AAEA;AACA,OAAO,SAASA,UAAUA,CAACC,CAAc,EAAEC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M,IAAIK,QAAQ,CAACP,CAAC,GAAGO,QAAQ,CAACL,MAAM;AAExD;;AAEA;AACA,OAAO,SAASM,sBAAsBA,CACpCH,UAAsB,EACtBI,MAAyE,EACtD;EACnB,MAAMC,GAAG,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEC,GAAG,IAAI,CAAC,CAAC;EACzC,MAAMG,KAAK,GAAGF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEI,KAAK,IAAI,CAAC,CAAC;EAC7C,MAAMC,MAAM,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEK,MAAM,IAAI,CAAC,CAAC;EAC/C,MAAMC,IAAI,GAAGJ,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEM,IAAI,IAAI,CAAC,CAAC;EAC3C,OAAO;IACLhB,CAAC,EAAEgB,IAAI;IACPf,CAAC,EAAEU,GAAG;IACNT,KAAK,EAAEU,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEP,UAAU,CAACJ,KAAK,GAAGc,IAAI,GAAGF,KAAK,CAAC;IACnDX,MAAM,EAAES,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEP,UAAU,CAACH,MAAM,GAAGQ,GAAG,GAAGI,MAAM;EACtD,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["expandRect","rect","padding","x","y","width","height","rectsEqual","a","b","isRectOffScreen","windowSize","isRectFullyVisible","viewport","buildEffectiveViewport","insets","top","Math","max","right","bottom","left"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/rect.ts"],"mappings":";;AAEA;AACA,OAAO,SAASA,UAAUA,CAACC,IAAU,EAAEC,OAAe,EAAQ;EAC5D,IAAIA,OAAO,KAAK,CAAC,EAAE,OAAOD,IAAI;EAC9B,OAAO;IACLE,CAAC,EAAEF,IAAI,CAACE,CAAC,GAAGD,OAAO;IACnBE,CAAC,EAAEH,IAAI,CAACG,CAA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,IACpBF,IAAI,CAACG,CAAC,IAAIS,QAAQ,CAACT,CAAC,IACpBH,IAAI,CAACE,CAAC,GAAGF,IAAI,CAACI,KAAK,IAAIQ,QAAQ,CAACV,CAAC,GAAGU,QAAQ,CAACR,KAAK,IAClDJ,IAAI,CAACG,CAAC,GAAGH,IAAI,CAACK,MAAM,IAAIO,QAAQ,CAACT,CAAC,GAAGS,QAAQ,CAACP,MAAM;AAExD;;AAEA;AACA,OAAO,SAASQ,sBAAsBA,CACpCH,UAAsB,EACtBI,MAAyE,EACtD;EACnB,MAAMC,GAAG,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEC,GAAG,IAAI,CAAC,CAAC;EACzC,MAAMG,KAAK,GAAGF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEI,KAAK,IAAI,CAAC,CAAC;EAC7C,MAAMC,MAAM,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEK,MAAM,IAAI,CAAC,CAAC;EAC/C,MAAMC,IAAI,GAAGJ,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,MAAM,EAAEM,IAAI,IAAI,CAAC,CAAC;EAC3C,OAAO;IACLlB,CAAC,EAAEkB,IAAI;IACPjB,CAAC,EAAEY,GAAG;IACNX,KAAK,EAAEY,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEP,UAAU,CAACN,KAAK,GAAGgB,IAAI,GAAGF,KAAK,CAAC;IACnDb,MAAM,EAAEW,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEP,UAAU,CAACL,MAAM,GAAGU,GAAG,GAAGI,MAAM;EACtD,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ import { VIEWPORT_PADDING } from "./inferTooltipPlacement.js";
4
+
5
+ /**
6
+ * Narrowest a side card may get: the width it spends on its own chrome, so
7
+ * content padding on both edges plus the border. Below this there is nothing
8
+ * left to lay text out in, and React Native overflows the card instead of
9
+ * shrinking it — the preview would stop showing the author what ships.
10
+ *
11
+ * Deliberately structural, not a readability judgment. How narrow is *too*
12
+ * narrow to read is the author's call, made against the device preview.
13
+ */
14
+ export function tooltipMinSideCardWidth(opts) {
15
+ const contentPadding = Number.isFinite(opts.contentPadding) ? Math.max(0, opts.contentPadding) : 0;
16
+ const borderWidth = opts.borderWidth != null && Number.isFinite(opts.borderWidth) ? Math.max(0, opts.borderWidth) : 0;
17
+ const chromeWidth = contentPadding * 2 + borderWidth * 2;
18
+ // Never demand more width than the card itself: a 40pt step card can still
19
+ // sit on the side even though its own padding would ask for more.
20
+ if (!Number.isFinite(opts.cardMaxWidth) || opts.cardMaxWidth <= 0) return chromeWidth;
21
+ return Math.min(chromeWidth, opts.cardMaxWidth);
22
+ }
23
+
24
+ /**
25
+ * Horizontal room beside an expanded target for a LEFT/RIGHT tooltip.
26
+ *
27
+ * Reserves `viewportPadding` on the screen edge the card grows toward, matching
28
+ * the LEFT/RIGHT clamp in `computeTooltipPosition`. Web clamps side placements
29
+ * to the raw edge instead; RN keeps the screen margin because an edge-to-edge
30
+ * card reads as broken on a phone-width viewport.
31
+ */
32
+ export function tooltipSideGap(opts) {
33
+ const {
34
+ placement,
35
+ target,
36
+ windowWidth,
37
+ notchSize,
38
+ viewportPadding = VIEWPORT_PADDING
39
+ } = opts;
40
+ if (placement === 'LEFT') {
41
+ return target.x - notchSize - viewportPadding;
42
+ }
43
+ return windowWidth - (target.x + target.width) - notchSize - viewportPadding;
44
+ }
45
+
46
+ /**
47
+ * Width a LEFT/RIGHT tooltip may use: the room beside the target, capped at the
48
+ * theme width. The card takes whatever is left and grows taller to compensate.
49
+ * Null when not even {@link tooltipMinSideCardWidth} fits, so placement falls
50
+ * back to the vertical flip.
51
+ *
52
+ * `target` must already be expanded by backdrop padding and outside highlight
53
+ * spread — the same rect passed to `inferTooltipPlacement`.
54
+ */
55
+ export function resolveTooltipSideCardWidth(opts) {
56
+ const gap = tooltipSideGap(opts);
57
+ const width = Math.min(opts.cardMaxWidth, Math.floor(gap));
58
+ if (!Number.isFinite(width) || width <= 0 || width < opts.minWidth) return null;
59
+ return width;
60
+ }
61
+
62
+ /**
63
+ * Shortest a card may get: the height it spends on its own chrome, so
64
+ * content padding on both edges plus the border. Mirrors
65
+ * {@link tooltipMinSideCardWidth} on the vertical axis.
66
+ */
67
+ export function tooltipMinCardHeight(opts) {
68
+ const contentPadding = Number.isFinite(opts.contentPadding) ? Math.max(0, opts.contentPadding) : 0;
69
+ const borderWidth = opts.borderWidth != null && Number.isFinite(opts.borderWidth) ? Math.max(0, opts.borderWidth) : 0;
70
+ const chromeHeight = contentPadding * 2 + borderWidth * 2;
71
+ if (!Number.isFinite(opts.cardMaxHeight) || opts.cardMaxHeight <= 0) return chromeHeight;
72
+ return Math.min(chromeHeight, opts.cardMaxHeight);
73
+ }
74
+
75
+ /**
76
+ * Vertical room above or below an expanded target for an ABOVE/BELOW tooltip.
77
+ *
78
+ * Reserves the matching viewport inset on the edge the card grows toward,
79
+ * matching the ABOVE/BELOW clamp in `computeTooltipPosition`.
80
+ */
81
+ export function tooltipVerticalGap(opts) {
82
+ const {
83
+ placement,
84
+ target,
85
+ windowHeight,
86
+ notchSize,
87
+ viewportPadding = VIEWPORT_PADDING
88
+ } = opts;
89
+ const top = opts.viewportInsets?.top ?? viewportPadding;
90
+ const bottom = opts.viewportInsets?.bottom ?? viewportPadding;
91
+ if (placement === 'ABOVE') {
92
+ return target.y - notchSize - top;
93
+ }
94
+ return windowHeight - (target.y + target.height) - notchSize - bottom;
95
+ }
96
+ //# sourceMappingURL=resolveSideCardWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["VIEWPORT_PADDING","tooltipMinSideCardWidth","opts","contentPadding","Number","isFinite","Math","max","borderWidth","chromeWidth","cardMaxWidth","min","tooltipSideGap","placement","target","windowWidth","notchSize","viewportPadding","x","width","resolveTooltipSideCardWidth","gap","floor","minWidth","tooltipMinCardHeight","chromeHeight","cardMaxHeight","tooltipVerticalGap","windowHeight","top","viewportInsets","bottom","y","height"],"sourceRoot":"../../../../src","sources":["surfaces/tooltip/resolveSideCardWidth.ts"],"mappings":";;AACA,SAASA,gBAAgB,QAAQ,4BAAyB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,IAIvC,EAAU;EACT,MAAMC,cAAc,GAAGC,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACC,cAAc,CAAC,GACvDG,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,IAAI,CAACC,cAAc,CAAC,GAChC,CAAC;EACL,MAAMK,WAAW,GACfN,IAAI,CAACM,WAAW,IAAI,IAAI,IAAIJ,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACM,WAAW,CAAC,GACzDF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,IAAI,CAACM,WAAW,CAAC,GAC7B,CAAC;EACP,MAAMC,WAAW,GAAGN,cAAc,GAAG,CAAC,GAAGK,WAAW,GAAG,CAAC;EACxD;EACA;EACA,IAAI,CAACJ,MAAM,CAACC,QAAQ,CAACH,IAAI,CAACQ,YAAY,CAAC,IAAIR,IAAI,CAACQ,YAAY,IAAI,CAAC,EAAE,OAAOD,WAAW;EACrF,OAAOH,IAAI,CAACK,GAAG,CAACF,WAAW,EAAEP,IAAI,CAACQ,YAAY,CAAC;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,cAAcA,CAACV,IAM9B,EAAU;EACT,MAAM;IAAEW,SAAS;IAAEC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC,eAAe,GAAGjB;EAAiB,CAAC,GAAGE,IAAI;EAC9F,IAAIW,SAAS,KAAK,MAAM,EAAE;IACxB,OAAOC,MAAM,CAACI,CAAC,GAAGF,SAAS,GAAGC,eAAe;EAC/C;EACA,OAAOF,WAAW,IAAID,MAAM,CAACI,CAAC,GAAGJ,MAAM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A,OAAO,SAASC,kBAAkBA,CAACzB,IAOlC,EAAU;EACT,MAAM;IAAEW,SAAS;IAAEC,MAAM;IAAEc,YAAY;IAAEZ,SAAS;IAAEC,eAAe,GAAGjB;EAAiB,CAAC,GAAGE,IAAI;EAC/F,MAAM2B,GAAG,GAAG3B,IAAI,CAAC4B,cAAc,EAAED,GAAG,IAAIZ,eAAe;EACvD,MAAMc,MAAM,GAAG7B,IAAI,CAAC4B,cAAc,EAAEC,MAAM,IAAId,eAAe;EAC7D,IAAIJ,SAAS,KAAK,OAAO,EAAE;IACzB,OAAOC,MAAM,CAACkB,CAAC,GAAGhB,SAAS,GAAGa,GAAG;EACnC;EACA,OAAOD,YAAY,IAAId,MAAM,CAACkB,CAAC,GAAGlB,MAAM,CAACmB,MAAM,CAAC,GAAGjB,SAAS,GAAGe,MAAM;AACvE","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  /** Generated by scripts/write-version.mjs — do not edit. */
4
- export const SDK_VERSION = '0.1.1';
4
+ export const SDK_VERSION = '0.2.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -80,6 +80,7 @@ export declare class AutoAnchorRegistry {
80
80
  private readonly byRegistryKey;
81
81
  private readonly byManualId;
82
82
  private readonly byTemplatePath;
83
+ private readonly liveContent;
83
84
  private readonly listeners;
84
85
  private notifyScheduled;
85
86
  registerInstance(input: RegisterInstanceInput): {
@@ -97,12 +98,37 @@ export declare class AutoAnchorRegistry {
97
98
  previous: SiblingDescriptor[];
98
99
  next: SiblingDescriptor[];
99
100
  };
101
+ /**
102
+ * Fill `childText` (and live `testID`) from the host fiber. Live content
103
+ * wins when readable; the build-time hint is the fallback.
104
+ *
105
+ * Direct fiber pointers are preferred; the scan-root index is built lazily
106
+ * and only if some instance cannot reach its fiber that way (Paper release
107
+ * builds, mainly), then reused for the rest of the pass.
108
+ *
109
+ * Silent — does not notify listeners.
110
+ */
111
+ refreshLiveContent(instances?: AutoAnchorInstance[]): void;
112
+ private refreshOneLiveContent;
113
+ /**
114
+ * Copy `testID` off the live host so a shared `__userflowAutoAnchor` callback
115
+ * (helper-rendered rows) cannot pin every instance to the last render's bag.
116
+ * Silent — no listener notify.
117
+ */
118
+ private applyLiveIdentity;
100
119
  subscribe(listener: AutoAnchorListener): () => void;
101
120
  isAmbiguousKey(key: string): boolean;
102
121
  /** Test helper — drop every instance and reset ids. */
103
122
  clear(): void;
104
123
  private unregisterInstance;
105
124
  private refreshManualIndexes;
125
+ /**
126
+ * Instances sharing a template path are only twins while they look alike.
127
+ * Four rows from one `field()` helper are indistinguishable at register time
128
+ * and separate once their labels are read, so ambiguity is decided on
129
+ * content, not on the shared path alone. An instance stays ambiguous when it
130
+ * carries no content of its own, or when a peer carries the same content.
131
+ */
106
132
  private recomputeAmbiguity;
107
133
  private addIndex;
108
134
  private removeIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"AutoAnchorRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/anchors/AutoAnchorRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC;AAE5C,8GAA8G;AAC9G,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;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AkB,GAAG,MAAM,IAAI;IAOnD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAOpC,uDAAuD;IACvD,KAAK,IAAI,IAAI;IAUb,OAAO,CAAC,kBAAkB;IA2B1B,OAAO,CAAC,oBAAoB;IAsB5B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,MAAM;CAmBf;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -5,6 +5,7 @@ type Listener = () => void;
5
5
  * Fiber-resolved anchors (testID / nativeID / accessibilityLabel) do not emit
6
6
  * registry events, so we combine:
7
7
  * - {@link anchorRegistry} mount/unmount
8
+ * - {@link autoAnchorRegistry} mount/unmount
8
9
  * - {@link fiberScanRoot} mount/unmount
9
10
  * - screen-change notifications
10
11
  * - a slow interval that only runs while at least one listener is subscribed
@@ -13,6 +14,7 @@ declare class AnchorChangeTicker {
13
14
  private readonly listeners;
14
15
  private intervalHandle;
15
16
  private unsubRegistry;
17
+ private unsubAuto;
16
18
  private unsubScan;
17
19
  /** Poll interval while ELEMENT conditions are tracked (ms). */
18
20
  static readonly INTERVAL_MS = 1000;
@@ -1 +1 @@
1
- {"version":3,"file":"anchorChangeTicker.d.ts","sourceRoot":"","sources":["../../../../../src/anchors/anchorChangeTicker.ts"],"names":[],"mappings":"AAGA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B;;;;;;;;;GASG;AACH,cAAM,kBAAkB;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,SAAS,CAA6B;IAE9C,+DAA+D;IAC/D,MAAM,CAAC,QAAQ,CAAC,WAAW,QAAQ;IAEnC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG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