@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
@@ -0,0 +1,485 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { pointInRect, TARGET_PRESS_TAP_SLOP } from "../anchors/targetPressMonitor.js";
6
+ import { ABSOLUTE_FILL } from "../surfaces/absoluteFill.js";
7
+ import { useReportAuthoringBottomHeight, useReportPreviewBannerHeight } from "../surfaces/surfaceLayoutInsets.js";
8
+ import { TooltipCutout } from "../surfaces/tooltip/TooltipCutout.js";
9
+ import { capturePickerScreenshot } from "./capturePickerScreenshot.js";
10
+ import { ChromeBarTransition, useChromeBarMounted } from "./chrome/ChromeBarTransition.js";
11
+ import { ChromeBottomSheet } from "./chrome/ChromeBottomSheet.js";
12
+ import { ChromeButton } from "./chrome/ChromeButton.js";
13
+ import { ChromeTooltip } from "./chrome/ChromeTooltip.js";
14
+ import { ChromeTopBar } from "./chrome/ChromeTopBar.js";
15
+ import { chromeColors, chromeOverlay, chromeRadius } from "./chrome/tokens.js";
16
+ import { DOUBLE_TAP_WINDOW_MS, isDoubleTap } from "./doubleTap.js";
17
+ import { elementPickerController } from "./elementPickerController.js";
18
+ import { validatePickerFingerprint } from "./fingerprintFromInstance.js";
19
+ import { hitTestAt, nextContainingIndex } from "./hitTest.js";
20
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
21
+ function statusForValidationFailure(reason) {
22
+ if (reason === 'not-unique' || reason === 'ambiguous-explicit-id') {
23
+ return 'This element is not uniquely identifiable — add a testID or userflowId, or it may match the wrong item at play time.';
24
+ }
25
+ if (reason === 'wrong-instance') {
26
+ return 'That fingerprint matches a different element — pick again or add a testID.';
27
+ }
28
+ return 'Could not uniquely match that element at play time.';
29
+ }
30
+ const CONFIRM_HELPER = 'Navigate back to the Userflow app after confirming';
31
+ const ONBOARDING_COPY = 'Double tap anywhere to access the menu';
32
+
33
+ /** Yield until chrome has left the native tree so captureScreen cannot include it. */
34
+ function waitForCapturePaint() {
35
+ return new Promise(resolve => {
36
+ const raf = globalThis.requestAnimationFrame;
37
+ if (typeof raf === 'function') {
38
+ raf.call(globalThis, () => {
39
+ raf.call(globalThis, () => resolve());
40
+ });
41
+ return;
42
+ }
43
+ setTimeout(resolve, 0);
44
+ });
45
+ }
46
+ function ringStyle(rect, inset) {
47
+ return {
48
+ position: 'absolute',
49
+ left: rect.x - inset,
50
+ top: rect.y - inset,
51
+ width: rect.width + inset * 2,
52
+ height: rect.height + inset * 2,
53
+ borderRadius: chromeRadius.lg
54
+ };
55
+ }
56
+
57
+ /**
58
+ * Overlay chrome for in-app element picking. Mounted by UserflowProvider;
59
+ * renders nothing until {@link elementPickerController.beginSelection}.
60
+ */
61
+ export function ElementPickerOverlay() {
62
+ const [state, setState] = React.useState(() => elementPickerController.getState());
63
+ const [mode, setMode] = React.useState('select');
64
+ const [candidates, setCandidates] = React.useState([]);
65
+ const [index, setIndex] = React.useState(0);
66
+ const [busy, setBusy] = React.useState(false);
67
+ const [status, setStatus] = React.useState(null);
68
+ const [chromeVisible, setChromeVisible] = React.useState(true);
69
+ const [hidingForCapture, setHidingForCapture] = React.useState(false);
70
+ const [showOnboarding, setShowOnboarding] = React.useState(false);
71
+ const [barHeight, setBarHeight] = React.useState(0);
72
+ const [sheetHeight, setSheetHeight] = React.useState(0);
73
+ const tapStartRef = React.useRef(null);
74
+ const lastTapRef = React.useRef(null);
75
+ const tapGenRef = React.useRef(0);
76
+ const applyTimerRef = React.useRef(null);
77
+ const applyResolveRef = React.useRef(null);
78
+ const modeRef = React.useRef('select');
79
+ const armedRequestIdRef = React.useRef(undefined);
80
+ const setBannerHeight = useReportPreviewBannerHeight('picker');
81
+ const setBottomHeight = useReportAuthoringBottomHeight('picker');
82
+ const cancelPendingSelection = React.useCallback(() => {
83
+ tapGenRef.current += 1;
84
+ if (applyTimerRef.current != null) {
85
+ clearTimeout(applyTimerRef.current);
86
+ applyTimerRef.current = null;
87
+ }
88
+ const resolveWait = applyResolveRef.current;
89
+ applyResolveRef.current = null;
90
+ resolveWait?.();
91
+ setBusy(false);
92
+ }, []);
93
+ const resetTransient = React.useCallback(options => {
94
+ cancelPendingSelection();
95
+ lastTapRef.current = null;
96
+ setMode('select');
97
+ setCandidates([]);
98
+ setIndex(0);
99
+ setBusy(false);
100
+ setStatus(null);
101
+ setChromeVisible(true);
102
+ setBarHeight(0);
103
+ setSheetHeight(0);
104
+ modeRef.current = 'select';
105
+ if (options?.resetCaptureHide !== false) {
106
+ setHidingForCapture(false);
107
+ }
108
+ }, [cancelPendingSelection]);
109
+ React.useEffect(() => {
110
+ return elementPickerController.subscribe(next => {
111
+ setState(next);
112
+ if (!next.active) {
113
+ armedRequestIdRef.current = undefined;
114
+ resetTransient({
115
+ resetCaptureHide: false
116
+ });
117
+ setShowOnboarding(false);
118
+ return;
119
+ }
120
+ // Successful confirm leaves hidingForCapture true so chrome does not
121
+ // flash back during teardown. Clear it with the new session's setState
122
+ // so the first paint of this pick has bars.
123
+ if (armedRequestIdRef.current !== next.requestId) {
124
+ setHidingForCapture(false);
125
+ }
126
+ });
127
+ }, [resetTransient]);
128
+ React.useEffect(() => {
129
+ if (!state.active || state.requestId == null) return;
130
+ if (armedRequestIdRef.current === state.requestId) return;
131
+ armedRequestIdRef.current = state.requestId;
132
+ resetTransient();
133
+ setShowOnboarding(true);
134
+ }, [resetTransient, state.active, state.requestId]);
135
+ React.useEffect(() => {
136
+ return () => {
137
+ cancelPendingSelection();
138
+ };
139
+ }, [cancelPendingSelection]);
140
+ React.useEffect(() => {
141
+ if (!state.active) {
142
+ setBannerHeight(0);
143
+ return;
144
+ }
145
+ if (hidingForCapture) {
146
+ return;
147
+ }
148
+ if (!chromeVisible) {
149
+ setBannerHeight(0);
150
+ return;
151
+ }
152
+ if (barHeight > 0) {
153
+ setBannerHeight(barHeight);
154
+ }
155
+ }, [barHeight, chromeVisible, hidingForCapture, setBannerHeight, state.active]);
156
+ React.useEffect(() => {
157
+ if (!state.active) {
158
+ setBottomHeight(0);
159
+ return;
160
+ }
161
+ if (hidingForCapture) {
162
+ return;
163
+ }
164
+ if (!chromeVisible) {
165
+ setBottomHeight(0);
166
+ return;
167
+ }
168
+ if (sheetHeight > 0) {
169
+ setBottomHeight(sheetHeight);
170
+ }
171
+ }, [chromeVisible, hidingForCapture, setBottomHeight, sheetHeight, state.active]);
172
+ const onMeasureHeight = React.useCallback(height => {
173
+ setBarHeight(Math.max(0, height));
174
+ }, []);
175
+ const onMeasureSheetHeight = React.useCallback(height => {
176
+ setSheetHeight(Math.max(0, height));
177
+ }, []);
178
+ const selected = candidates[index] ?? null;
179
+ const phase = selected ? 'selected' : mode === 'select' ? 'selecting' : 'navigating';
180
+ modeRef.current = mode;
181
+
182
+ // Bars slide/fade in with the picker, out on double-tap hide, and out again
183
+ // on teardown. Keep them mounted through the exit even after the picker goes
184
+ // inactive; the dim, capture, and spotlight below drop immediately instead.
185
+ const chromeBarsVisible = state.active && chromeVisible && !hidingForCapture;
186
+ const chromeBarsMounted = useChromeBarMounted(chromeBarsVisible);
187
+ const showChromeBars = hidingForCapture ? false : chromeBarsMounted;
188
+ React.useEffect(() => {
189
+ if (phase !== 'selecting') {
190
+ setShowOnboarding(false);
191
+ }
192
+ }, [phase]);
193
+ const applyHits = React.useCallback(hits => {
194
+ if (modeRef.current !== 'select') return;
195
+ lastTapRef.current = null;
196
+ setChromeVisible(true);
197
+ if (hits.length === 0) {
198
+ setCandidates([]);
199
+ setIndex(0);
200
+ setStatus('No stamped element under that tap.');
201
+ return;
202
+ }
203
+ setCandidates(hits);
204
+ setIndex(0);
205
+ setStatus(null);
206
+ }, []);
207
+ const scheduleSelection = React.useCallback((pageX, pageY) => {
208
+ cancelPendingSelection();
209
+ const gen = tapGenRef.current;
210
+ setBusy(true);
211
+ setStatus(null);
212
+ const hitsPromise = hitTestAt(pageX, pageY);
213
+ const wait = new Promise(resolve => {
214
+ applyResolveRef.current = resolve;
215
+ applyTimerRef.current = setTimeout(() => {
216
+ applyTimerRef.current = null;
217
+ applyResolveRef.current = null;
218
+ resolve();
219
+ }, DOUBLE_TAP_WINDOW_MS);
220
+ });
221
+ void (async () => {
222
+ try {
223
+ const [hits] = await Promise.all([hitsPromise, wait]);
224
+ if (tapGenRef.current !== gen) return;
225
+ applyHits(hits);
226
+ } finally {
227
+ if (tapGenRef.current === gen) setBusy(false);
228
+ }
229
+ })();
230
+ }, [applyHits, cancelPendingSelection]);
231
+ const onTap = React.useCallback(async (pageX, pageY) => {
232
+ if (selected && candidates.length > 1 && pointInRect(pageX, pageY, selected.rect)) {
233
+ setIndex(current => nextContainingIndex(candidates, current));
234
+ setStatus(null);
235
+ return;
236
+ }
237
+ setBusy(true);
238
+ setStatus(null);
239
+ try {
240
+ const hits = await hitTestAt(pageX, pageY);
241
+ if (hits.length === 0) {
242
+ setCandidates([]);
243
+ setIndex(0);
244
+ setStatus('No stamped element under that tap.');
245
+ return;
246
+ }
247
+ setCandidates(hits);
248
+ setIndex(0);
249
+ } finally {
250
+ setBusy(false);
251
+ }
252
+ }, [candidates, selected]);
253
+ const onGrant = React.useCallback(event => {
254
+ const {
255
+ pageX,
256
+ pageY
257
+ } = event.nativeEvent;
258
+ tapStartRef.current = {
259
+ pageX,
260
+ pageY
261
+ };
262
+ }, []);
263
+ const onRelease = React.useCallback(event => {
264
+ const start = tapStartRef.current;
265
+ tapStartRef.current = null;
266
+ if (!start) return;
267
+ const {
268
+ pageX,
269
+ pageY
270
+ } = event.nativeEvent;
271
+ const dx = pageX - start.pageX;
272
+ const dy = pageY - start.pageY;
273
+ if (dx * dx + dy * dy > TARGET_PRESS_TAP_SLOP * TARGET_PRESS_TAP_SLOP) return;
274
+ const sample = {
275
+ pageX,
276
+ pageY,
277
+ timestamp: Date.now()
278
+ };
279
+ if (!selected && isDoubleTap(lastTapRef.current, sample)) {
280
+ cancelPendingSelection();
281
+ lastTapRef.current = null;
282
+ setShowOnboarding(false);
283
+ setChromeVisible(visible => !visible);
284
+ return;
285
+ }
286
+ lastTapRef.current = sample;
287
+ if (selected) {
288
+ void onTap(pageX, pageY);
289
+ return;
290
+ }
291
+ scheduleSelection(pageX, pageY);
292
+ }, [cancelPendingSelection, onTap, scheduleSelection, selected]);
293
+ const deselect = React.useCallback(() => {
294
+ setCandidates([]);
295
+ setIndex(0);
296
+ setStatus(null);
297
+ setChromeVisible(true);
298
+ }, []);
299
+ const confirm = React.useCallback(async () => {
300
+ if (!selected) return;
301
+ const requestId = elementPickerController.getState().requestId;
302
+ if (!requestId) return;
303
+ setBusy(true);
304
+ setStatus(null);
305
+ try {
306
+ const validated = validatePickerFingerprint(selected.instance);
307
+ if (!validated.ok) {
308
+ setStatus(statusForValidationFailure(validated.reason));
309
+ return;
310
+ }
311
+ setHidingForCapture(true);
312
+ await waitForCapturePaint();
313
+ const screenshot = await capturePickerScreenshot(selected.rect);
314
+ const delivered = await elementPickerController.commit({
315
+ instance: selected.instance,
316
+ autoData: validated.autoData,
317
+ text: selected.instance.childText ?? selected.instance.accessibilityLabel ?? null,
318
+ rect: selected.rect,
319
+ ...(screenshot ? {
320
+ screenshot
321
+ } : {})
322
+ }, requestId);
323
+ if (!delivered && elementPickerController.getState().requestId === requestId) {
324
+ setHidingForCapture(false);
325
+ setStatus("Couldn't send to Builder");
326
+ }
327
+ } catch {
328
+ setHidingForCapture(false);
329
+ setStatus('Could not serialize that element.');
330
+ } finally {
331
+ setBusy(false);
332
+ }
333
+ }, [selected]);
334
+ if (!state.active && !chromeBarsMounted) return null;
335
+ const barLabel = phase === 'selected' ? 'Confirm selected element' : phase === 'selecting' ? 'Tap an element to select it' : 'Navigate screens';
336
+ const helperText = status ?? (phase === 'selected' ? CONFIRM_HELPER : undefined);
337
+ const tooltipVisible = state.active && showOnboarding && chromeVisible && phase === 'selecting';
338
+ return /*#__PURE__*/_jsxs(View, {
339
+ pointerEvents: "box-none",
340
+ style: styles.root,
341
+ testID: "userflow-element-picker",
342
+ children: [state.active && phase === 'selecting' ? /*#__PURE__*/_jsx(View, {
343
+ pointerEvents: "none",
344
+ style: styles.dim,
345
+ testID: "userflow-element-picker-dim"
346
+ }) : null, state.active && selected ? /*#__PURE__*/_jsxs(_Fragment, {
347
+ children: [/*#__PURE__*/_jsx(TooltipCutout, {
348
+ backdropColor: chromeOverlay.color,
349
+ backdropOpacity: chromeOverlay.opacity,
350
+ targetBlocked: false,
351
+ targetRect: {
352
+ top: selected.rect.y,
353
+ left: selected.rect.x,
354
+ width: selected.rect.width,
355
+ height: selected.rect.height
356
+ }
357
+ }), /*#__PURE__*/_jsx(View, {
358
+ pointerEvents: "none",
359
+ style: [ringStyle(selected.rect, 5), {
360
+ borderWidth: 4,
361
+ borderColor: chromeColors.focusRing
362
+ }],
363
+ testID: "userflow-element-picker-focus-ring"
364
+ }), /*#__PURE__*/_jsx(View, {
365
+ pointerEvents: "none",
366
+ style: [ringStyle(selected.rect, 1), {
367
+ borderWidth: 1,
368
+ borderColor: chromeColors.white
369
+ }],
370
+ testID: "userflow-element-picker-focus-ring-inner"
371
+ })]
372
+ }) : null, state.active && mode === 'select' ? /*#__PURE__*/_jsx(View, {
373
+ testID: "userflow-element-picker-capture",
374
+ style: styles.capture,
375
+ onStartShouldSetResponder: () => true,
376
+ onResponderGrant: onGrant,
377
+ onResponderRelease: onRelease
378
+ }) : null, showChromeBars ? /*#__PURE__*/_jsx(ChromeBarTransition, {
379
+ edge: "top",
380
+ pointerEvents: "box-none",
381
+ style: styles.top,
382
+ visible: chromeBarsVisible,
383
+ children: /*#__PURE__*/_jsx(ChromeTopBar, {
384
+ label: barLabel,
385
+ onMeasureHeight: onMeasureHeight
386
+ })
387
+ }) : null, tooltipVisible ? /*#__PURE__*/_jsx(View, {
388
+ pointerEvents: "none",
389
+ style: [styles.tooltip, {
390
+ top: barHeight
391
+ }],
392
+ children: /*#__PURE__*/_jsx(ChromeTooltip, {
393
+ onDismiss: () => {
394
+ setShowOnboarding(false);
395
+ },
396
+ children: ONBOARDING_COPY
397
+ })
398
+ }) : null, showChromeBars ? /*#__PURE__*/_jsx(ChromeBarTransition, {
399
+ edge: "bottom",
400
+ pointerEvents: "box-none",
401
+ style: styles.bottom,
402
+ visible: chromeBarsVisible,
403
+ children: /*#__PURE__*/_jsx(ChromeBottomSheet, {
404
+ helperText: helperText,
405
+ onMeasureHeight: onMeasureSheetHeight,
406
+ children: phase === 'selected' ? /*#__PURE__*/_jsxs(_Fragment, {
407
+ children: [/*#__PURE__*/_jsx(ChromeButton, {
408
+ accessibilityLabel: "Deselect",
409
+ label: "Deselect",
410
+ onPress: deselect,
411
+ testID: "userflow-element-picker-deselect",
412
+ variant: "secondary"
413
+ }), /*#__PURE__*/_jsx(ChromeButton, {
414
+ accessibilityLabel: "Confirm element",
415
+ disabled: busy,
416
+ label: "Confirm element",
417
+ onPress: () => {
418
+ void confirm();
419
+ },
420
+ testID: "userflow-element-picker-confirm"
421
+ })]
422
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
423
+ children: [/*#__PURE__*/_jsx(ChromeButton, {
424
+ accessibilityLabel: "Cancel element selection",
425
+ label: "Cancel",
426
+ onPress: () => elementPickerController.cancel(),
427
+ testID: "userflow-element-picker-cancel",
428
+ variant: "secondary"
429
+ }), phase === 'selecting' ? /*#__PURE__*/_jsx(ChromeButton, {
430
+ accessibilityLabel: "Navigate screens",
431
+ label: "Navigate screens",
432
+ onPress: () => {
433
+ cancelPendingSelection();
434
+ lastTapRef.current = null;
435
+ setStatus(null);
436
+ setMode('navigate');
437
+ },
438
+ testID: "userflow-element-picker-navigate"
439
+ }) : /*#__PURE__*/_jsx(ChromeButton, {
440
+ accessibilityLabel: "Select element here",
441
+ label: "Select element here",
442
+ onPress: () => {
443
+ setStatus(null);
444
+ setMode('select');
445
+ },
446
+ testID: "userflow-element-picker-select-here"
447
+ })]
448
+ })
449
+ })
450
+ }) : null]
451
+ });
452
+ }
453
+ const styles = StyleSheet.create({
454
+ root: {
455
+ ...ABSOLUTE_FILL,
456
+ zIndex: 1100
457
+ },
458
+ dim: {
459
+ ...ABSOLUTE_FILL,
460
+ backgroundColor: chromeOverlay.color,
461
+ opacity: chromeOverlay.opacity
462
+ },
463
+ capture: {
464
+ ...ABSOLUTE_FILL
465
+ },
466
+ top: {
467
+ position: 'absolute',
468
+ top: 0,
469
+ left: 0,
470
+ right: 0
471
+ },
472
+ tooltip: {
473
+ position: 'absolute',
474
+ left: 0,
475
+ right: 0,
476
+ alignItems: 'center'
477
+ },
478
+ bottom: {
479
+ position: 'absolute',
480
+ bottom: 0,
481
+ left: 0,
482
+ right: 0
483
+ }
484
+ });
485
+ //# sourceMappingURL=ElementPickerOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","pointInRect","TARGET_PRESS_TAP_SLOP","ABSOLUTE_FILL","useReportAuthoringBottomHeight","useReportPreviewBannerHeight","TooltipCutout","capturePickerScreenshot","ChromeBarTransition","useChromeBarMounted","ChromeBottomSheet","ChromeButton","ChromeTooltip","ChromeTopBar","chromeColors","chromeOverlay","chromeRadius","DOUBLE_TAP_WINDOW_MS","isDoubleTap","elementPickerController","validatePickerFingerprint","hitTestAt","nextContainingIndex","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","statusForValidationFailure","reason","CONFIRM_HELPER","ONBOARDING_COPY","waitForCapturePaint","Promise","resolve","raf","globalThis","requestAnimationFrame","call","setTimeout","ringStyle","rect","inset","position","left","x","top","y","width","height","borderRadius","lg","ElementPickerOverlay","state","setState","useState","getState","mode","setMode","candidates","setCandidates","index","setIndex","busy","setBusy","status","setStatus","chromeVisible","setChromeVisible","hidingForCapture","setHidingForCapture","showOnboarding","setShowOnboarding","barHeight","setBarHeight","sheetHeight","setSheetHeight","tapStartRef","useRef","lastTapRef","tapGenRef","applyTimerRef","applyResolveRef","modeRef","armedRequestIdRef","undefined","setBannerHeight","setBottomHeight","cancelPendingSelection","useCallback","current","clearTimeout","resolveWait","resetTransient","options","resetCaptureHide","useEffect","subscribe","next","active","requestId","onMeasureHeight","Math","max","onMeasureSheetHeight","selected","phase","chromeBarsVisible","chromeBarsMounted","showChromeBars","applyHits","hits","length","scheduleSelection","pageX","pageY","gen","hitsPromise","wait","all","onTap","onGrant","event","nativeEvent","onRelease","start","dx","dy","sample","timestamp","Date","now","visible","deselect","confirm","validated","instance","ok","screenshot","delivered","commit","autoData","text","childText","accessibilityLabel","barLabel","helperText","tooltipVisible","pointerEvents","style","styles","root","testID","children","dim","backdropColor","color","backdropOpacity","opacity","targetBlocked","targetRect","borderWidth","borderColor","focusRing","white","capture","onStartShouldSetResponder","onResponderGrant","onResponderRelease","edge","label","tooltip","onDismiss","bottom","onPress","variant","disabled","cancel","create","zIndex","backgroundColor","right","alignItems"],"sourceRoot":"../../../src","sources":["authoring/ElementPickerOverlay.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAoD,cAAc;AAE3F,SAASC,WAAW,EAAEC,qBAAqB,QAAQ,kCAA+B;AAClF,SAASC,aAAa,QAAQ,6BAA0B;AACxD,SACEC,8BAA8B,EAC9BC,4BAA4B,QACvB,oCAAiC;AACxC,SAASC,aAAa,QAAQ,sCAAmC;AAEjE,SAASC,uBAAuB,QAAQ,8BAA2B;AACnE,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,iCAA8B;AACvF,SAASC,iBAAiB,QAAQ,+BAA4B;AAC9D,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,aAAa,QAAQ,2BAAwB;AACtD,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,YAAY,EAAEC,aAAa,EAAEC,YAAY,QAAQ,oBAAiB;AAC3E,SAASC,oBAAoB,EAAEC,WAAW,QAAwB,gBAAa;AAC/E,SAASC,uBAAuB,QAAiC,8BAA2B;AAC5F,SACEC,yBAAyB,QAEpB,8BAA2B;AAClC,SAASC,SAAS,EAAEC,mBAAmB,QAAyC,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE5F,SAASC,0BAA0BA,CAACC,MAA0C,EAAU;EACtF,IAAIA,MAAM,KAAK,YAAY,IAAIA,MAAM,KAAK,uBAAuB,EAAE;IACjE,OAAO,sHAAsH;EAC/H;EACA,IAAIA,MAAM,KAAK,gBAAgB,EAAE;IAC/B,OAAO,4EAA4E;EACrF;EACA,OAAO,qDAAqD;AAC9D;AAKA,MAAMC,cAAc,GAAG,oDAAoD;AAC3E,MAAMC,eAAe,GAAG,wCAAwC;;AAEhE;AACA,SAASC,mBAAmBA,CAAA,EAAkB;EAC5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B,IAAI,EAAE;IACJ,GAAGrJ,aAAa;IAChBiL,MAAM,EAAE;EACV,CAAC;EACDzB,GAAG,EAAE;IACH,GAAGxJ,aAAa;IAChBkL,eAAe,EAAEtK,aAAa,CAAC8I,KAAK;IACpCE,OAAO,EAAEhJ,aAAa,CAACgJ;EACzB,CAAC;EACDO,OAAO,EAAE;IACP,GAAGnK;EACL,CAAC;EACD4C,GAAG,EAAE;IACHH,QAAQ,EAAE,UAAU;IACpBG,GAAG,EAAE,CAAC;IACNF,IAAI,EAAE,CAAC;IACPyI,KAAK,EAAE;EACT,CAAC;EACDV,OAAO,EAAE;IACPhI,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPyI,KAAK,EAAE,CAAC;IACRC,UAAU,EAAE;EACd,CAAC;EACDT,MAAM,EAAE;IACNlI,QAAQ,EAAE,UAAU;IACpBkI,MAAM,EAAE,CAAC;IACTjI,IAAI,EAAE,CAAC;IACPyI,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ import { Dimensions } from 'react-native';
4
+ const MAX_CAPTURE_WIDTH = 480;
5
+ const MISSING_VIEW_SHOT_WARNING = '[Userflow] Required peer react-native-view-shot is not installed; ' + 'skipping picker screenshot. Install react-native-view-shot (>=5.0.0) and rebuild native.';
6
+ let didWarnMissingViewShot = false;
7
+ function warnMissingViewShot() {
8
+ if (didWarnMissingViewShot) return;
9
+ didWarnMissingViewShot = true;
10
+ if (__DEV__) {
11
+ // eslint-disable-next-line no-console -- intentional missing-required-peer diagnostic
12
+ console.warn(MISSING_VIEW_SHOT_WARNING);
13
+ }
14
+ }
15
+ function loadViewShot() {
16
+ try {
17
+ // Required peer; degrade if unlinked or the JS package is missing.
18
+ // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
19
+ return require('react-native-view-shot');
20
+ } catch {
21
+ warnMissingViewShot();
22
+ return null;
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Capture a downscaled JPEG of the current screen and map `rect` (window DIP)
28
+ * onto the captured pixel grid. Returns null when the native module is missing
29
+ * or capture fails.
30
+ */
31
+ export async function capturePickerScreenshot(rect) {
32
+ const viewShot = loadViewShot();
33
+ if (!viewShot?.captureScreen) return null;
34
+ try {
35
+ const window = Dimensions.get('window');
36
+ const winW = window.width || 1;
37
+ const winH = window.height || 1;
38
+ const captureWidth = Math.min(Math.round(winW), MAX_CAPTURE_WIDTH);
39
+ const captureHeight = Math.max(1, Math.round(winH * (captureWidth / winW)));
40
+ const dataUrl = await viewShot.captureScreen({
41
+ format: 'jpg',
42
+ quality: 0.55,
43
+ result: 'data-uri',
44
+ width: captureWidth,
45
+ height: captureHeight
46
+ });
47
+ if (typeof dataUrl !== 'string' || dataUrl.length === 0) return null;
48
+ const sx = captureWidth / winW;
49
+ const sy = captureHeight / winH;
50
+ return {
51
+ dataUrl,
52
+ width: captureWidth,
53
+ height: captureHeight,
54
+ targetX1: Math.round(rect.x * sx),
55
+ targetY1: Math.round(rect.y * sy),
56
+ targetX2: Math.round((rect.x + rect.width) * sx),
57
+ targetY2: Math.round((rect.y + rect.height) * sy)
58
+ };
59
+ } catch {
60
+ return null;
61
+ }
62
+ }
63
+
64
+ /** @internal */
65
+ export function resetViewShotWarningForTests() {
66
+ didWarnMissingViewShot = false;
67
+ }
68
+ //# sourceMappingURL=capturePickerScreenshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Dimensions","MAX_CAPTURE_WIDTH","MISSING_VIEW_SHOT_WARNING","didWarnMissingViewShot","warnMissingViewShot","__DEV__","console","warn","loadViewShot","require","capturePickerScreenshot","rect","viewShot","captureScreen","window","get","winW","width","winH","height","captureWidth","Math","min","round","captureHeight","max","dataUrl","format","quality","result","length","sx","sy","targetX1","x","targetY1","y","targetX2","targetY2","resetViewShotWarningForTests"],"sourceRoot":"../../../src","sources":["authoring/capturePickerScreenshot.ts"],"mappings":";;AAAA,SAASA,UAA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