@userflow-tech/react-native 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (850) hide show
  1. package/README.md +114 -68
  2. package/app.plugin.js +13 -0
  3. package/babel-plugin/index.d.ts +43 -0
  4. package/babel-plugin/index.d.ts.map +1 -0
  5. package/babel-plugin/index.js +862 -0
  6. package/babel-plugin/index.js.map +1 -0
  7. package/babel-plugin.js +13 -0
  8. package/docs/anchoring.md +141 -13
  9. package/docs/deep-linking.md +20 -17
  10. package/docs/theme-mapping.md +44 -15
  11. package/docs/troubleshooting.md +37 -30
  12. package/expo-plugin/withUserflow.d.ts +17 -0
  13. package/expo-plugin/withUserflow.d.ts.map +1 -0
  14. package/expo-plugin/withUserflow.js +99 -0
  15. package/expo-plugin/withUserflow.js.map +1 -0
  16. package/lib/commonjs/anchors/AutoAnchorRegistry.js +125 -3
  17. package/lib/commonjs/anchors/AutoAnchorRegistry.js.map +1 -1
  18. package/lib/commonjs/anchors/anchorChangeTicker.js +10 -0
  19. package/lib/commonjs/anchors/anchorChangeTicker.js.map +1 -1
  20. package/lib/commonjs/anchors/autoAnchor.js +1 -1
  21. package/lib/commonjs/anchors/elementConditionEvaluator.js +25 -12
  22. package/lib/commonjs/anchors/elementConditionEvaluator.js.map +1 -1
  23. package/lib/commonjs/anchors/fiber/FiberScanRoot.js +11 -47
  24. package/lib/commonjs/anchors/fiber/FiberScanRoot.js.map +1 -1
  25. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js +50 -0
  26. package/lib/commonjs/anchors/fiber/FiberScanRootStore.js.map +1 -0
  27. package/lib/commonjs/anchors/fiber/fiberInternals.js +145 -3
  28. package/lib/commonjs/anchors/fiber/fiberInternals.js.map +1 -1
  29. package/lib/commonjs/anchors/fiber/indexHostFibers.js +129 -0
  30. package/lib/commonjs/anchors/fiber/indexHostFibers.js.map +1 -0
  31. package/lib/commonjs/anchors/fiber/readHostContent.js +131 -0
  32. package/lib/commonjs/anchors/fiber/readHostContent.js.map +1 -0
  33. package/lib/commonjs/anchors/fiberAnchorCache.js +50 -0
  34. package/lib/commonjs/anchors/fiberAnchorCache.js.map +1 -0
  35. package/lib/commonjs/anchors/hintsCodec.js +1 -1
  36. package/lib/commonjs/anchors/resolveAnchorHost.js +15 -21
  37. package/lib/commonjs/anchors/resolveAnchorHost.js.map +1 -1
  38. package/lib/commonjs/anchors/resolveAutoAnchorHost.js +171 -0
  39. package/lib/commonjs/anchors/resolveAutoAnchorHost.js.map +1 -0
  40. package/lib/commonjs/anchors/semanticMatcher.js +285 -0
  41. package/lib/commonjs/anchors/semanticMatcher.js.map +1 -0
  42. package/lib/commonjs/authoring/ElementPickerOverlay.js +490 -0
  43. package/lib/commonjs/authoring/ElementPickerOverlay.js.map +1 -0
  44. package/lib/commonjs/authoring/capturePickerScreenshot.js +73 -0
  45. package/lib/commonjs/authoring/capturePickerScreenshot.js.map +1 -0
  46. package/lib/commonjs/authoring/chrome/ChromeBarTransition.js +94 -0
  47. package/lib/commonjs/authoring/chrome/ChromeBarTransition.js.map +1 -0
  48. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js +64 -0
  49. package/lib/commonjs/authoring/chrome/ChromeBottomSheet.js.map +1 -0
  50. package/lib/commonjs/authoring/chrome/ChromeButton.js +94 -0
  51. package/lib/commonjs/authoring/chrome/ChromeButton.js.map +1 -0
  52. package/lib/commonjs/authoring/chrome/ChromeDialog.js +131 -0
  53. package/lib/commonjs/authoring/chrome/ChromeDialog.js.map +1 -0
  54. package/lib/commonjs/authoring/chrome/ChromeIcon.js +39 -0
  55. package/lib/commonjs/authoring/chrome/ChromeIcon.js.map +1 -0
  56. package/lib/commonjs/authoring/chrome/ChromeTooltip.js +88 -0
  57. package/lib/commonjs/authoring/chrome/ChromeTooltip.js.map +1 -0
  58. package/lib/commonjs/authoring/chrome/ChromeTopBar.js +110 -0
  59. package/lib/commonjs/authoring/chrome/ChromeTopBar.js.map +1 -0
  60. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js +57 -0
  61. package/lib/commonjs/authoring/chrome/DoubleTapBridge.js.map +1 -0
  62. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js +80 -0
  63. package/lib/commonjs/authoring/chrome/doubleTapMonitor.js.map +1 -0
  64. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  65. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  66. package/lib/commonjs/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  67. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  68. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  69. package/lib/commonjs/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  70. package/lib/commonjs/authoring/chrome/icons/userflow-logomark.png +0 -0
  71. package/lib/commonjs/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  72. package/lib/commonjs/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  73. package/lib/commonjs/authoring/chrome/icons/xmark.png +0 -0
  74. package/lib/commonjs/authoring/chrome/icons/xmark@2x.png +0 -0
  75. package/lib/commonjs/authoring/chrome/icons/xmark@3x.png +0 -0
  76. package/lib/commonjs/authoring/chrome/tokens.js +150 -0
  77. package/lib/commonjs/authoring/chrome/tokens.js.map +1 -0
  78. package/lib/commonjs/authoring/doubleTap.js +23 -0
  79. package/lib/commonjs/authoring/doubleTap.js.map +1 -0
  80. package/lib/commonjs/authoring/elementPickerController.js +102 -0
  81. package/lib/commonjs/authoring/elementPickerController.js.map +1 -0
  82. package/lib/commonjs/authoring/fingerprintFromInstance.js +195 -0
  83. package/lib/commonjs/authoring/fingerprintFromInstance.js.map +1 -0
  84. package/lib/commonjs/authoring/hitTest.js +106 -0
  85. package/lib/commonjs/authoring/hitTest.js.map +1 -0
  86. package/lib/commonjs/content/RichContentRenderer.js +12 -2
  87. package/lib/commonjs/content/RichContentRenderer.js.map +1 -1
  88. package/lib/commonjs/content/StepButton.js +19 -4
  89. package/lib/commonjs/content/StepButton.js.map +1 -1
  90. package/lib/commonjs/content/resolveStepButtonChrome.js +8 -6
  91. package/lib/commonjs/content/resolveStepButtonChrome.js.map +1 -1
  92. package/lib/commonjs/content/themeColor.js +11 -0
  93. package/lib/commonjs/content/themeColor.js.map +1 -1
  94. package/lib/commonjs/deviceContext.js +158 -0
  95. package/lib/commonjs/deviceContext.js.map +1 -0
  96. package/lib/commonjs/expo-router/useUserflowExpoRouter.js +40 -4
  97. package/lib/commonjs/expo-router/useUserflowExpoRouter.js.map +1 -1
  98. package/lib/commonjs/hostAppVersion.js +242 -0
  99. package/lib/commonjs/hostAppVersion.js.map +1 -0
  100. package/lib/commonjs/index.js +118 -5
  101. package/lib/commonjs/index.js.map +1 -1
  102. package/lib/commonjs/lifecycle.js +2 -0
  103. package/lib/commonjs/lifecycle.js.map +1 -1
  104. package/lib/commonjs/navigation/WithUserflowReactNavigation.js +17 -8
  105. package/lib/commonjs/navigation/WithUserflowReactNavigation.js.map +1 -1
  106. package/lib/commonjs/navigation/isOverlayPresentation.js +64 -0
  107. package/lib/commonjs/navigation/isOverlayPresentation.js.map +1 -0
  108. package/lib/commonjs/pairing/PairingController.js +29 -2
  109. package/lib/commonjs/pairing/PairingController.js.map +1 -1
  110. package/lib/commonjs/pairing/PreviewModeBanner.js +211 -84
  111. package/lib/commonjs/pairing/PreviewModeBanner.js.map +1 -1
  112. package/lib/commonjs/pairing/diagnostics.js +11 -2
  113. package/lib/commonjs/pairing/diagnostics.js.map +1 -1
  114. package/lib/commonjs/pairing/elementPickerRelay.js +91 -0
  115. package/lib/commonjs/pairing/elementPickerRelay.js.map +1 -0
  116. package/lib/commonjs/pairing/resolvePreviewChrome.js +52 -0
  117. package/lib/commonjs/pairing/resolvePreviewChrome.js.map +1 -0
  118. package/lib/commonjs/pairing/tokenStorage.js +25 -2
  119. package/lib/commonjs/pairing/tokenStorage.js.map +1 -1
  120. package/lib/commonjs/pairing/usePairingState.js +3 -1
  121. package/lib/commonjs/pairing/usePairingState.js.map +1 -1
  122. package/lib/commonjs/runtime/FlowRenderer.js +45 -21
  123. package/lib/commonjs/runtime/FlowRenderer.js.map +1 -1
  124. package/lib/commonjs/runtime/FlowSurfaceFade.js +47 -24
  125. package/lib/commonjs/runtime/FlowSurfaceFade.js.map +1 -1
  126. package/lib/commonjs/runtime/TargetPressBridge.js +13 -44
  127. package/lib/commonjs/runtime/TargetPressBridge.js.map +1 -1
  128. package/lib/commonjs/runtime/UserflowProvider.js +74 -20
  129. package/lib/commonjs/runtime/UserflowProvider.js.map +1 -1
  130. package/lib/commonjs/runtime/changedTouchPoints.js +48 -0
  131. package/lib/commonjs/runtime/changedTouchPoints.js.map +1 -0
  132. package/lib/commonjs/runtime/flowEngine.js +3 -1
  133. package/lib/commonjs/runtime/flowEngine.js.map +1 -1
  134. package/lib/commonjs/runtime/flowSessionViewState.js +32 -7
  135. package/lib/commonjs/runtime/flowSessionViewState.js.map +1 -1
  136. package/lib/commonjs/runtime/useFlowSessionState.js +2 -1
  137. package/lib/commonjs/runtime/useFlowSessionState.js.map +1 -1
  138. package/lib/commonjs/screenTracker.js +46 -4
  139. package/lib/commonjs/screenTracker.js.map +1 -1
  140. package/lib/commonjs/surfaces/CardFade.js +31 -0
  141. package/lib/commonjs/surfaces/CardFade.js.map +1 -0
  142. package/lib/commonjs/surfaces/CloseButton.js +11 -6
  143. package/lib/commonjs/surfaces/CloseButton.js.map +1 -1
  144. package/lib/commonjs/surfaces/ModalSurface.js +50 -34
  145. package/lib/commonjs/surfaces/ModalSurface.js.map +1 -1
  146. package/lib/commonjs/surfaces/TooltipSurface.js +366 -87
  147. package/lib/commonjs/surfaces/TooltipSurface.js.map +1 -1
  148. package/lib/commonjs/surfaces/cardTransition.js +70 -0
  149. package/lib/commonjs/surfaces/cardTransition.js.map +1 -0
  150. package/lib/commonjs/surfaces/resolveHighlightChrome.js +109 -0
  151. package/lib/commonjs/surfaces/resolveHighlightChrome.js.map +1 -0
  152. package/lib/commonjs/surfaces/resolveModalLayout.js +7 -3
  153. package/lib/commonjs/surfaces/resolveModalLayout.js.map +1 -1
  154. package/lib/commonjs/surfaces/resolveTooltipLayout.js +0 -4
  155. package/lib/commonjs/surfaces/resolveTooltipLayout.js.map +1 -1
  156. package/lib/commonjs/surfaces/surfaceInteractionConfig.js +33 -0
  157. package/lib/commonjs/surfaces/surfaceInteractionConfig.js.map +1 -0
  158. package/lib/commonjs/surfaces/surfaceLayoutInsets.js +128 -0
  159. package/lib/commonjs/surfaces/surfaceLayoutInsets.js.map +1 -0
  160. package/lib/commonjs/surfaces/themeChrome.js +4 -1
  161. package/lib/commonjs/surfaces/themeChrome.js.map +1 -1
  162. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js +142 -21
  163. package/lib/commonjs/surfaces/tooltip/TooltipBubble.js.map +1 -1
  164. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js +100 -47
  165. package/lib/commonjs/surfaces/tooltip/TooltipCutout.js.map +1 -1
  166. package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js +124 -0
  167. package/lib/commonjs/surfaces/tooltip/TooltipHighlight.js.map +1 -0
  168. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js +67 -13
  169. package/lib/commonjs/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
  170. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js +88 -19
  171. package/lib/commonjs/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
  172. package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js +52 -0
  173. package/lib/commonjs/surfaces/tooltip/placementDiagnostics.js.map +1 -0
  174. package/lib/commonjs/surfaces/tooltip/rect.js +12 -0
  175. package/lib/commonjs/surfaces/tooltip/rect.js.map +1 -1
  176. package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js +103 -0
  177. package/lib/commonjs/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
  178. package/lib/commonjs/version.js +1 -1
  179. package/lib/module/anchors/AutoAnchorRegistry.js +126 -3
  180. package/lib/module/anchors/AutoAnchorRegistry.js.map +1 -1
  181. package/lib/module/anchors/anchorChangeTicker.js +10 -0
  182. package/lib/module/anchors/anchorChangeTicker.js.map +1 -1
  183. package/lib/module/anchors/autoAnchor.js +1 -1
  184. package/lib/module/anchors/elementConditionEvaluator.js +25 -12
  185. package/lib/module/anchors/elementConditionEvaluator.js.map +1 -1
  186. package/lib/module/anchors/fiber/FiberScanRoot.js +2 -43
  187. package/lib/module/anchors/fiber/FiberScanRoot.js.map +1 -1
  188. package/lib/module/anchors/fiber/FiberScanRootStore.js +46 -0
  189. package/lib/module/anchors/fiber/FiberScanRootStore.js.map +1 -0
  190. package/lib/module/anchors/fiber/fiberInternals.js +139 -3
  191. package/lib/module/anchors/fiber/fiberInternals.js.map +1 -1
  192. package/lib/module/anchors/fiber/indexHostFibers.js +122 -0
  193. package/lib/module/anchors/fiber/indexHostFibers.js.map +1 -0
  194. package/lib/module/anchors/fiber/readHostContent.js +127 -0
  195. package/lib/module/anchors/fiber/readHostContent.js.map +1 -0
  196. package/lib/module/anchors/fiberAnchorCache.js +40 -0
  197. package/lib/module/anchors/fiberAnchorCache.js.map +1 -0
  198. package/lib/module/anchors/hintsCodec.js +1 -1
  199. package/lib/module/anchors/resolveAnchorHost.js +15 -21
  200. package/lib/module/anchors/resolveAnchorHost.js.map +1 -1
  201. package/lib/module/anchors/resolveAutoAnchorHost.js +167 -0
  202. package/lib/module/anchors/resolveAutoAnchorHost.js.map +1 -0
  203. package/lib/module/anchors/semanticMatcher.js +280 -0
  204. package/lib/module/anchors/semanticMatcher.js.map +1 -0
  205. package/lib/module/authoring/ElementPickerOverlay.js +485 -0
  206. package/lib/module/authoring/ElementPickerOverlay.js.map +1 -0
  207. package/lib/module/authoring/capturePickerScreenshot.js +68 -0
  208. package/lib/module/authoring/capturePickerScreenshot.js.map +1 -0
  209. package/lib/module/authoring/chrome/ChromeBarTransition.js +88 -0
  210. package/lib/module/authoring/chrome/ChromeBarTransition.js.map +1 -0
  211. package/lib/module/authoring/chrome/ChromeBottomSheet.js +59 -0
  212. package/lib/module/authoring/chrome/ChromeBottomSheet.js.map +1 -0
  213. package/lib/module/authoring/chrome/ChromeButton.js +89 -0
  214. package/lib/module/authoring/chrome/ChromeButton.js.map +1 -0
  215. package/lib/module/authoring/chrome/ChromeDialog.js +126 -0
  216. package/lib/module/authoring/chrome/ChromeDialog.js.map +1 -0
  217. package/lib/module/authoring/chrome/ChromeIcon.js +33 -0
  218. package/lib/module/authoring/chrome/ChromeIcon.js.map +1 -0
  219. package/lib/module/authoring/chrome/ChromeTooltip.js +82 -0
  220. package/lib/module/authoring/chrome/ChromeTooltip.js.map +1 -0
  221. package/lib/module/authoring/chrome/ChromeTopBar.js +104 -0
  222. package/lib/module/authoring/chrome/ChromeTopBar.js.map +1 -0
  223. package/lib/module/authoring/chrome/DoubleTapBridge.js +52 -0
  224. package/lib/module/authoring/chrome/DoubleTapBridge.js.map +1 -0
  225. package/lib/module/authoring/chrome/doubleTapMonitor.js +75 -0
  226. package/lib/module/authoring/chrome/doubleTapMonitor.js.map +1 -0
  227. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  228. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  229. package/lib/module/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  230. package/lib/module/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  231. package/lib/module/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  232. package/lib/module/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  233. package/lib/module/authoring/chrome/icons/userflow-logomark.png +0 -0
  234. package/lib/module/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  235. package/lib/module/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  236. package/lib/module/authoring/chrome/icons/xmark.png +0 -0
  237. package/lib/module/authoring/chrome/icons/xmark@2x.png +0 -0
  238. package/lib/module/authoring/chrome/icons/xmark@3x.png +0 -0
  239. package/lib/module/authoring/chrome/tokens.js +146 -0
  240. package/lib/module/authoring/chrome/tokens.js.map +1 -0
  241. package/lib/module/authoring/doubleTap.js +18 -0
  242. package/lib/module/authoring/doubleTap.js.map +1 -0
  243. package/lib/module/authoring/elementPickerController.js +97 -0
  244. package/lib/module/authoring/elementPickerController.js.map +1 -0
  245. package/lib/module/authoring/fingerprintFromInstance.js +187 -0
  246. package/lib/module/authoring/fingerprintFromInstance.js.map +1 -0
  247. package/lib/module/authoring/hitTest.js +100 -0
  248. package/lib/module/authoring/hitTest.js.map +1 -0
  249. package/lib/module/content/RichContentRenderer.js +12 -2
  250. package/lib/module/content/RichContentRenderer.js.map +1 -1
  251. package/lib/module/content/StepButton.js +19 -4
  252. package/lib/module/content/StepButton.js.map +1 -1
  253. package/lib/module/content/resolveStepButtonChrome.js +8 -6
  254. package/lib/module/content/resolveStepButtonChrome.js.map +1 -1
  255. package/lib/module/content/themeColor.js +10 -0
  256. package/lib/module/content/themeColor.js.map +1 -1
  257. package/lib/module/deviceContext.js +142 -0
  258. package/lib/module/deviceContext.js.map +1 -0
  259. package/lib/module/expo-router/useUserflowExpoRouter.js +42 -6
  260. package/lib/module/expo-router/useUserflowExpoRouter.js.map +1 -1
  261. package/lib/module/hostAppVersion.js +225 -0
  262. package/lib/module/hostAppVersion.js.map +1 -0
  263. package/lib/module/index.js +119 -6
  264. package/lib/module/index.js.map +1 -1
  265. package/lib/module/lifecycle.js +2 -0
  266. package/lib/module/lifecycle.js.map +1 -1
  267. package/lib/module/navigation/WithUserflowReactNavigation.js +18 -9
  268. package/lib/module/navigation/WithUserflowReactNavigation.js.map +1 -1
  269. package/lib/module/navigation/isOverlayPresentation.js +58 -0
  270. package/lib/module/navigation/isOverlayPresentation.js.map +1 -0
  271. package/lib/module/pairing/PairingController.js +30 -3
  272. package/lib/module/pairing/PairingController.js.map +1 -1
  273. package/lib/module/pairing/PreviewModeBanner.js +212 -85
  274. package/lib/module/pairing/PreviewModeBanner.js.map +1 -1
  275. package/lib/module/pairing/diagnostics.js +10 -2
  276. package/lib/module/pairing/diagnostics.js.map +1 -1
  277. package/lib/module/pairing/elementPickerRelay.js +87 -0
  278. package/lib/module/pairing/elementPickerRelay.js.map +1 -0
  279. package/lib/module/pairing/resolvePreviewChrome.js +48 -0
  280. package/lib/module/pairing/resolvePreviewChrome.js.map +1 -0
  281. package/lib/module/pairing/tokenStorage.js +24 -2
  282. package/lib/module/pairing/tokenStorage.js.map +1 -1
  283. package/lib/module/pairing/usePairingState.js +3 -1
  284. package/lib/module/pairing/usePairingState.js.map +1 -1
  285. package/lib/module/runtime/FlowRenderer.js +45 -21
  286. package/lib/module/runtime/FlowRenderer.js.map +1 -1
  287. package/lib/module/runtime/FlowSurfaceFade.js +49 -26
  288. package/lib/module/runtime/FlowSurfaceFade.js.map +1 -1
  289. package/lib/module/runtime/TargetPressBridge.js +12 -43
  290. package/lib/module/runtime/TargetPressBridge.js.map +1 -1
  291. package/lib/module/runtime/UserflowProvider.js +74 -20
  292. package/lib/module/runtime/UserflowProvider.js.map +1 -1
  293. package/lib/module/runtime/changedTouchPoints.js +43 -0
  294. package/lib/module/runtime/changedTouchPoints.js.map +1 -0
  295. package/lib/module/runtime/flowEngine.js +3 -1
  296. package/lib/module/runtime/flowEngine.js.map +1 -1
  297. package/lib/module/runtime/flowSessionViewState.js +32 -7
  298. package/lib/module/runtime/flowSessionViewState.js.map +1 -1
  299. package/lib/module/runtime/useFlowSessionState.js +2 -1
  300. package/lib/module/runtime/useFlowSessionState.js.map +1 -1
  301. package/lib/module/screenTracker.js +42 -4
  302. package/lib/module/screenTracker.js.map +1 -1
  303. package/lib/module/surfaces/CardFade.js +26 -0
  304. package/lib/module/surfaces/CardFade.js.map +1 -0
  305. package/lib/module/surfaces/CloseButton.js +10 -6
  306. package/lib/module/surfaces/CloseButton.js.map +1 -1
  307. package/lib/module/surfaces/ModalSurface.js +52 -36
  308. package/lib/module/surfaces/ModalSurface.js.map +1 -1
  309. package/lib/module/surfaces/TooltipSurface.js +368 -90
  310. package/lib/module/surfaces/TooltipSurface.js.map +1 -1
  311. package/lib/module/surfaces/cardTransition.js +64 -0
  312. package/lib/module/surfaces/cardTransition.js.map +1 -0
  313. package/lib/module/surfaces/resolveHighlightChrome.js +102 -0
  314. package/lib/module/surfaces/resolveHighlightChrome.js.map +1 -0
  315. package/lib/module/surfaces/resolveModalLayout.js +7 -3
  316. package/lib/module/surfaces/resolveModalLayout.js.map +1 -1
  317. package/lib/module/surfaces/resolveTooltipLayout.js +1 -4
  318. package/lib/module/surfaces/resolveTooltipLayout.js.map +1 -1
  319. package/lib/module/surfaces/surfaceInteractionConfig.js +27 -0
  320. package/lib/module/surfaces/surfaceInteractionConfig.js.map +1 -0
  321. package/lib/module/surfaces/surfaceLayoutInsets.js +119 -0
  322. package/lib/module/surfaces/surfaceLayoutInsets.js.map +1 -0
  323. package/lib/module/surfaces/themeChrome.js +3 -1
  324. package/lib/module/surfaces/themeChrome.js.map +1 -1
  325. package/lib/module/surfaces/tooltip/TooltipBubble.js +143 -22
  326. package/lib/module/surfaces/tooltip/TooltipBubble.js.map +1 -1
  327. package/lib/module/surfaces/tooltip/TooltipCutout.js +100 -47
  328. package/lib/module/surfaces/tooltip/TooltipCutout.js.map +1 -1
  329. package/lib/module/surfaces/tooltip/TooltipHighlight.js +118 -0
  330. package/lib/module/surfaces/tooltip/TooltipHighlight.js.map +1 -0
  331. package/lib/module/surfaces/tooltip/computeTooltipPosition.js +67 -13
  332. package/lib/module/surfaces/tooltip/computeTooltipPosition.js.map +1 -1
  333. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js +87 -19
  334. package/lib/module/surfaces/tooltip/inferTooltipPlacement.js.map +1 -1
  335. package/lib/module/surfaces/tooltip/placementDiagnostics.js +43 -0
  336. package/lib/module/surfaces/tooltip/placementDiagnostics.js.map +1 -0
  337. package/lib/module/surfaces/tooltip/rect.js +11 -0
  338. package/lib/module/surfaces/tooltip/rect.js.map +1 -1
  339. package/lib/module/surfaces/tooltip/resolveSideCardWidth.js +96 -0
  340. package/lib/module/surfaces/tooltip/resolveSideCardWidth.js.map +1 -0
  341. package/lib/module/version.js +1 -1
  342. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts +27 -1
  343. package/lib/typescript/commonjs/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts +2 -0
  345. package/lib/typescript/commonjs/src/anchors/anchorChangeTicker.d.ts.map +1 -1
  346. package/lib/typescript/commonjs/src/anchors/autoAnchor.d.ts +1 -1
  347. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts +14 -10
  348. package/lib/typescript/commonjs/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
  350. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
  352. package/lib/typescript/commonjs/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts +42 -1
  354. package/lib/typescript/commonjs/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts +42 -0
  356. package/lib/typescript/commonjs/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts +17 -0
  358. package/lib/typescript/commonjs/src/anchors/fiber/readHostContent.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts +20 -0
  360. package/lib/typescript/commonjs/src/anchors/fiberAnchorCache.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/anchors/hintsCodec.d.ts +1 -1
  362. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts +5 -5
  363. package/lib/typescript/commonjs/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
  365. package/lib/typescript/commonjs/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
  366. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts +48 -0
  367. package/lib/typescript/commonjs/src/anchors/semanticMatcher.d.ts.map +1 -0
  368. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts +7 -0
  369. package/lib/typescript/commonjs/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts +11 -0
  371. package/lib/typescript/commonjs/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
  373. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
  375. package/lib/typescript/commonjs/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts +20 -0
  377. package/lib/typescript/commonjs/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts +14 -0
  379. package/lib/typescript/commonjs/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts +13 -0
  381. package/lib/typescript/commonjs/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
  383. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
  385. package/lib/typescript/commonjs/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
  386. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
  387. package/lib/typescript/commonjs/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
  389. package/lib/typescript/commonjs/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
  390. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts +141 -0
  391. package/lib/typescript/commonjs/src/authoring/chrome/tokens.d.ts.map +1 -0
  392. package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts +14 -0
  393. package/lib/typescript/commonjs/src/authoring/doubleTap.d.ts.map +1 -0
  394. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts +59 -0
  395. package/lib/typescript/commonjs/src/authoring/elementPickerController.d.ts.map +1 -0
  396. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts +26 -0
  397. package/lib/typescript/commonjs/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
  398. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts +31 -0
  399. package/lib/typescript/commonjs/src/authoring/hitTest.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts +6 -1
  401. package/lib/typescript/commonjs/src/content/RichContentRenderer.d.ts.map +1 -1
  402. package/lib/typescript/commonjs/src/content/StepButton.d.ts.map +1 -1
  403. package/lib/typescript/commonjs/src/content/resolveStepButtonChrome.d.ts.map +1 -1
  404. package/lib/typescript/commonjs/src/content/themeColor.d.ts +5 -0
  405. package/lib/typescript/commonjs/src/content/themeColor.d.ts.map +1 -1
  406. package/lib/typescript/commonjs/src/deviceContext.d.ts +66 -0
  407. package/lib/typescript/commonjs/src/deviceContext.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/hostAppVersion.d.ts +69 -0
  410. package/lib/typescript/commonjs/src/hostAppVersion.d.ts.map +1 -0
  411. package/lib/typescript/commonjs/src/index.d.ts +53 -2
  412. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  413. package/lib/typescript/commonjs/src/lifecycle.d.ts +6 -0
  414. package/lib/typescript/commonjs/src/lifecycle.d.ts.map +1 -1
  415. package/lib/typescript/commonjs/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts +14 -0
  417. package/lib/typescript/commonjs/src/navigation/isOverlayPresentation.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts +7 -0
  419. package/lib/typescript/commonjs/src/pairing/PairingController.d.ts.map +1 -1
  420. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts +6 -1
  421. package/lib/typescript/commonjs/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  422. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts +5 -0
  423. package/lib/typescript/commonjs/src/pairing/diagnostics.d.ts.map +1 -1
  424. package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts +11 -0
  425. package/lib/typescript/commonjs/src/pairing/elementPickerRelay.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts +16 -0
  427. package/lib/typescript/commonjs/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
  428. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts +2 -0
  429. package/lib/typescript/commonjs/src/pairing/tokenStorage.d.ts.map +1 -1
  430. package/lib/typescript/commonjs/src/pairing/usePairingState.d.ts.map +1 -1
  431. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts +6 -3
  432. package/lib/typescript/commonjs/src/runtime/FlowRenderer.d.ts.map +1 -1
  433. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts +20 -7
  434. package/lib/typescript/commonjs/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
  435. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts +5 -1
  436. package/lib/typescript/commonjs/src/runtime/TargetPressBridge.d.ts.map +1 -1
  437. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts +6 -4
  438. package/lib/typescript/commonjs/src/runtime/UserflowProvider.d.ts.map +1 -1
  439. package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts +10 -0
  440. package/lib/typescript/commonjs/src/runtime/changedTouchPoints.d.ts.map +1 -0
  441. package/lib/typescript/commonjs/src/runtime/flowEngine.d.ts.map +1 -1
  442. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts +12 -3
  443. package/lib/typescript/commonjs/src/runtime/flowSessionViewState.d.ts.map +1 -1
  444. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts +1 -0
  445. package/lib/typescript/commonjs/src/runtime/useFlowSessionState.d.ts.map +1 -1
  446. package/lib/typescript/commonjs/src/screenTracker.d.ts +21 -3
  447. package/lib/typescript/commonjs/src/screenTracker.d.ts.map +1 -1
  448. package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts +12 -0
  449. package/lib/typescript/commonjs/src/surfaces/CardFade.d.ts.map +1 -0
  450. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts +8 -2
  451. package/lib/typescript/commonjs/src/surfaces/CloseButton.d.ts.map +1 -1
  452. package/lib/typescript/commonjs/src/surfaces/MadeWithUserflow.d.ts +1 -1
  453. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts +1 -1
  454. package/lib/typescript/commonjs/src/surfaces/ModalSurface.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts +12 -1
  456. package/lib/typescript/commonjs/src/surfaces/TooltipSurface.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts +31 -0
  458. package/lib/typescript/commonjs/src/surfaces/cardTransition.d.ts.map +1 -0
  459. package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts +44 -0
  460. package/lib/typescript/commonjs/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
  461. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts +1 -1
  462. package/lib/typescript/commonjs/src/surfaces/resolveModalLayout.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts +0 -7
  464. package/lib/typescript/commonjs/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
  466. package/lib/typescript/commonjs/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
  467. package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
  468. package/lib/typescript/commonjs/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
  469. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts +3 -1
  470. package/lib/typescript/commonjs/src/surfaces/themeChrome.d.ts.map +1 -1
  471. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
  472. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  473. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
  474. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
  475. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
  476. package/lib/typescript/commonjs/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
  477. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
  478. package/lib/typescript/commonjs/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
  479. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
  480. package/lib/typescript/commonjs/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
  481. package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
  482. package/lib/typescript/commonjs/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
  483. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts +2 -0
  484. package/lib/typescript/commonjs/src/surfaces/tooltip/rect.d.ts.map +1 -1
  485. package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
  486. package/lib/typescript/commonjs/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
  487. package/lib/typescript/commonjs/src/version.d.ts +1 -1
  488. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts +27 -1
  489. package/lib/typescript/module/src/anchors/AutoAnchorRegistry.d.ts.map +1 -1
  490. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts +2 -0
  491. package/lib/typescript/module/src/anchors/anchorChangeTicker.d.ts.map +1 -1
  492. package/lib/typescript/module/src/anchors/autoAnchor.d.ts +1 -1
  493. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts +14 -10
  494. package/lib/typescript/module/src/anchors/elementConditionEvaluator.d.ts.map +1 -1
  495. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts +1 -20
  496. package/lib/typescript/module/src/anchors/fiber/FiberScanRoot.d.ts.map +1 -1
  497. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts +21 -0
  498. package/lib/typescript/module/src/anchors/fiber/FiberScanRootStore.d.ts.map +1 -0
  499. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts +42 -1
  500. package/lib/typescript/module/src/anchors/fiber/fiberInternals.d.ts.map +1 -1
  501. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts +42 -0
  502. package/lib/typescript/module/src/anchors/fiber/indexHostFibers.d.ts.map +1 -0
  503. package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts +17 -0
  504. package/lib/typescript/module/src/anchors/fiber/readHostContent.d.ts.map +1 -0
  505. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts +20 -0
  506. package/lib/typescript/module/src/anchors/fiberAnchorCache.d.ts.map +1 -0
  507. package/lib/typescript/module/src/anchors/hintsCodec.d.ts +1 -1
  508. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts +5 -5
  509. package/lib/typescript/module/src/anchors/resolveAnchorHost.d.ts.map +1 -1
  510. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts +38 -0
  511. package/lib/typescript/module/src/anchors/resolveAutoAnchorHost.d.ts.map +1 -0
  512. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts +48 -0
  513. package/lib/typescript/module/src/anchors/semanticMatcher.d.ts.map +1 -0
  514. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts +7 -0
  515. package/lib/typescript/module/src/authoring/ElementPickerOverlay.d.ts.map +1 -0
  516. package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts +11 -0
  517. package/lib/typescript/module/src/authoring/capturePickerScreenshot.d.ts.map +1 -0
  518. package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts +32 -0
  519. package/lib/typescript/module/src/authoring/chrome/ChromeBarTransition.d.ts.map +1 -0
  520. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts +13 -0
  521. package/lib/typescript/module/src/authoring/chrome/ChromeBottomSheet.d.ts.map +1 -0
  522. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts +20 -0
  523. package/lib/typescript/module/src/authoring/chrome/ChromeButton.d.ts.map +1 -0
  524. package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts +14 -0
  525. package/lib/typescript/module/src/authoring/chrome/ChromeDialog.d.ts.map +1 -0
  526. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts +13 -0
  527. package/lib/typescript/module/src/authoring/chrome/ChromeIcon.d.ts.map +1 -0
  528. package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts +17 -0
  529. package/lib/typescript/module/src/authoring/chrome/ChromeTooltip.d.ts.map +1 -0
  530. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts +25 -0
  531. package/lib/typescript/module/src/authoring/chrome/ChromeTopBar.d.ts.map +1 -0
  532. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts +12 -0
  533. package/lib/typescript/module/src/authoring/chrome/DoubleTapBridge.d.ts.map +1 -0
  534. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts +26 -0
  535. package/lib/typescript/module/src/authoring/chrome/doubleTapMonitor.d.ts.map +1 -0
  536. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts +141 -0
  537. package/lib/typescript/module/src/authoring/chrome/tokens.d.ts.map +1 -0
  538. package/lib/typescript/module/src/authoring/doubleTap.d.ts +14 -0
  539. package/lib/typescript/module/src/authoring/doubleTap.d.ts.map +1 -0
  540. package/lib/typescript/module/src/authoring/elementPickerController.d.ts +59 -0
  541. package/lib/typescript/module/src/authoring/elementPickerController.d.ts.map +1 -0
  542. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts +26 -0
  543. package/lib/typescript/module/src/authoring/fingerprintFromInstance.d.ts.map +1 -0
  544. package/lib/typescript/module/src/authoring/hitTest.d.ts +31 -0
  545. package/lib/typescript/module/src/authoring/hitTest.d.ts.map +1 -0
  546. package/lib/typescript/module/src/content/RichContentRenderer.d.ts +6 -1
  547. package/lib/typescript/module/src/content/RichContentRenderer.d.ts.map +1 -1
  548. package/lib/typescript/module/src/content/StepButton.d.ts.map +1 -1
  549. package/lib/typescript/module/src/content/resolveStepButtonChrome.d.ts.map +1 -1
  550. package/lib/typescript/module/src/content/themeColor.d.ts +5 -0
  551. package/lib/typescript/module/src/content/themeColor.d.ts.map +1 -1
  552. package/lib/typescript/module/src/deviceContext.d.ts +66 -0
  553. package/lib/typescript/module/src/deviceContext.d.ts.map +1 -0
  554. package/lib/typescript/module/src/expo-router/useUserflowExpoRouter.d.ts.map +1 -1
  555. package/lib/typescript/module/src/hostAppVersion.d.ts +69 -0
  556. package/lib/typescript/module/src/hostAppVersion.d.ts.map +1 -0
  557. package/lib/typescript/module/src/index.d.ts +53 -2
  558. package/lib/typescript/module/src/index.d.ts.map +1 -1
  559. package/lib/typescript/module/src/lifecycle.d.ts +6 -0
  560. package/lib/typescript/module/src/lifecycle.d.ts.map +1 -1
  561. package/lib/typescript/module/src/navigation/WithUserflowReactNavigation.d.ts.map +1 -1
  562. package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts +14 -0
  563. package/lib/typescript/module/src/navigation/isOverlayPresentation.d.ts.map +1 -0
  564. package/lib/typescript/module/src/pairing/PairingController.d.ts +7 -0
  565. package/lib/typescript/module/src/pairing/PairingController.d.ts.map +1 -1
  566. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts +6 -1
  567. package/lib/typescript/module/src/pairing/PreviewModeBanner.d.ts.map +1 -1
  568. package/lib/typescript/module/src/pairing/diagnostics.d.ts +5 -0
  569. package/lib/typescript/module/src/pairing/diagnostics.d.ts.map +1 -1
  570. package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts +11 -0
  571. package/lib/typescript/module/src/pairing/elementPickerRelay.d.ts.map +1 -0
  572. package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts +16 -0
  573. package/lib/typescript/module/src/pairing/resolvePreviewChrome.d.ts.map +1 -0
  574. package/lib/typescript/module/src/pairing/tokenStorage.d.ts +2 -0
  575. package/lib/typescript/module/src/pairing/tokenStorage.d.ts.map +1 -1
  576. package/lib/typescript/module/src/pairing/usePairingState.d.ts.map +1 -1
  577. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts +6 -3
  578. package/lib/typescript/module/src/runtime/FlowRenderer.d.ts.map +1 -1
  579. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts +20 -7
  580. package/lib/typescript/module/src/runtime/FlowSurfaceFade.d.ts.map +1 -1
  581. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts +5 -1
  582. package/lib/typescript/module/src/runtime/TargetPressBridge.d.ts.map +1 -1
  583. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts +6 -4
  584. package/lib/typescript/module/src/runtime/UserflowProvider.d.ts.map +1 -1
  585. package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts +10 -0
  586. package/lib/typescript/module/src/runtime/changedTouchPoints.d.ts.map +1 -0
  587. package/lib/typescript/module/src/runtime/flowEngine.d.ts.map +1 -1
  588. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts +12 -3
  589. package/lib/typescript/module/src/runtime/flowSessionViewState.d.ts.map +1 -1
  590. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts +1 -0
  591. package/lib/typescript/module/src/runtime/useFlowSessionState.d.ts.map +1 -1
  592. package/lib/typescript/module/src/screenTracker.d.ts +21 -3
  593. package/lib/typescript/module/src/screenTracker.d.ts.map +1 -1
  594. package/lib/typescript/module/src/surfaces/CardFade.d.ts +12 -0
  595. package/lib/typescript/module/src/surfaces/CardFade.d.ts.map +1 -0
  596. package/lib/typescript/module/src/surfaces/CloseButton.d.ts +8 -2
  597. package/lib/typescript/module/src/surfaces/CloseButton.d.ts.map +1 -1
  598. package/lib/typescript/module/src/surfaces/MadeWithUserflow.d.ts +1 -1
  599. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts +1 -1
  600. package/lib/typescript/module/src/surfaces/ModalSurface.d.ts.map +1 -1
  601. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts +12 -1
  602. package/lib/typescript/module/src/surfaces/TooltipSurface.d.ts.map +1 -1
  603. package/lib/typescript/module/src/surfaces/cardTransition.d.ts +31 -0
  604. package/lib/typescript/module/src/surfaces/cardTransition.d.ts.map +1 -0
  605. package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts +44 -0
  606. package/lib/typescript/module/src/surfaces/resolveHighlightChrome.d.ts.map +1 -0
  607. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts +1 -1
  608. package/lib/typescript/module/src/surfaces/resolveModalLayout.d.ts.map +1 -1
  609. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts +0 -7
  610. package/lib/typescript/module/src/surfaces/resolveTooltipLayout.d.ts.map +1 -1
  611. package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts +15 -0
  612. package/lib/typescript/module/src/surfaces/surfaceInteractionConfig.d.ts.map +1 -0
  613. package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts +38 -0
  614. package/lib/typescript/module/src/surfaces/surfaceLayoutInsets.d.ts.map +1 -0
  615. package/lib/typescript/module/src/surfaces/themeChrome.d.ts +3 -1
  616. package/lib/typescript/module/src/surfaces/themeChrome.d.ts.map +1 -1
  617. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts +21 -6
  618. package/lib/typescript/module/src/surfaces/tooltip/TooltipBubble.d.ts.map +1 -1
  619. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts +18 -10
  620. package/lib/typescript/module/src/surfaces/tooltip/TooltipCutout.d.ts.map +1 -1
  621. package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts +25 -0
  622. package/lib/typescript/module/src/surfaces/tooltip/TooltipHighlight.d.ts.map +1 -0
  623. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts +23 -0
  624. package/lib/typescript/module/src/surfaces/tooltip/computeTooltipPosition.d.ts.map +1 -1
  625. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts +47 -1
  626. package/lib/typescript/module/src/surfaces/tooltip/inferTooltipPlacement.d.ts.map +1 -1
  627. package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts +39 -0
  628. package/lib/typescript/module/src/surfaces/tooltip/placementDiagnostics.d.ts.map +1 -0
  629. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts +2 -0
  630. package/lib/typescript/module/src/surfaces/tooltip/rect.d.ts.map +1 -1
  631. package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts +76 -0
  632. package/lib/typescript/module/src/surfaces/tooltip/resolveSideCardWidth.d.ts.map +1 -0
  633. package/lib/typescript/module/src/version.d.ts +1 -1
  634. package/package.json +32 -18
  635. package/src/anchors/AutoAnchorRegistry.ts +140 -3
  636. package/src/anchors/anchorChangeTicker.ts +10 -0
  637. package/src/anchors/autoAnchor.ts +1 -1
  638. package/src/anchors/elementConditionEvaluator.ts +29 -16
  639. package/src/anchors/fiber/FiberScanRoot.tsx +2 -50
  640. package/src/anchors/fiber/FiberScanRootStore.ts +51 -0
  641. package/src/anchors/fiber/fiberInternals.ts +166 -3
  642. package/src/anchors/fiber/indexHostFibers.ts +136 -0
  643. package/src/anchors/fiber/readHostContent.ts +146 -0
  644. package/src/anchors/fiberAnchorCache.ts +45 -0
  645. package/src/anchors/hintsCodec.ts +1 -1
  646. package/src/anchors/resolveAnchorHost.ts +23 -23
  647. package/src/anchors/resolveAutoAnchorHost.ts +180 -0
  648. package/src/anchors/semanticMatcher.ts +361 -0
  649. package/src/authoring/ElementPickerOverlay.tsx +553 -0
  650. package/src/authoring/capturePickerScreenshot.ts +90 -0
  651. package/src/authoring/chrome/ChromeBarTransition.tsx +106 -0
  652. package/src/authoring/chrome/ChromeBottomSheet.tsx +69 -0
  653. package/src/authoring/chrome/ChromeButton.tsx +103 -0
  654. package/src/authoring/chrome/ChromeDialog.tsx +121 -0
  655. package/src/authoring/chrome/ChromeIcon.tsx +40 -0
  656. package/src/authoring/chrome/ChromeTooltip.tsx +89 -0
  657. package/src/authoring/chrome/ChromeTopBar.tsx +126 -0
  658. package/src/authoring/chrome/DoubleTapBridge.tsx +60 -0
  659. package/src/authoring/chrome/doubleTapMonitor.ts +80 -0
  660. package/src/authoring/chrome/icons/arrow-left-from-bracket.png +0 -0
  661. package/src/authoring/chrome/icons/arrow-left-from-bracket@2x.png +0 -0
  662. package/src/authoring/chrome/icons/arrow-left-from-bracket@3x.png +0 -0
  663. package/src/authoring/chrome/icons/arrow-rotate-left.png +0 -0
  664. package/src/authoring/chrome/icons/arrow-rotate-left@2x.png +0 -0
  665. package/src/authoring/chrome/icons/arrow-rotate-left@3x.png +0 -0
  666. package/src/authoring/chrome/icons/userflow-logomark.png +0 -0
  667. package/src/authoring/chrome/icons/userflow-logomark@2x.png +0 -0
  668. package/src/authoring/chrome/icons/userflow-logomark@3x.png +0 -0
  669. package/src/authoring/chrome/icons/xmark.png +0 -0
  670. package/src/authoring/chrome/icons/xmark@2x.png +0 -0
  671. package/src/authoring/chrome/icons/xmark@3x.png +0 -0
  672. package/src/authoring/chrome/tokens.ts +106 -0
  673. package/src/authoring/doubleTap.ts +27 -0
  674. package/src/authoring/elementPickerController.ts +135 -0
  675. package/src/authoring/fingerprintFromInstance.ts +152 -0
  676. package/src/authoring/hitTest.ts +133 -0
  677. package/src/content/RichContentRenderer.tsx +22 -1
  678. package/src/content/StepButton.tsx +17 -2
  679. package/src/content/resolveStepButtonChrome.ts +12 -6
  680. package/src/content/themeColor.ts +10 -0
  681. package/src/deviceContext.ts +168 -0
  682. package/src/expo-router/useUserflowExpoRouter.ts +47 -4
  683. package/src/hostAppVersion.ts +258 -0
  684. package/src/index.ts +148 -4
  685. package/src/lifecycle.ts +8 -0
  686. package/src/navigation/WithUserflowReactNavigation.tsx +23 -7
  687. package/src/navigation/isOverlayPresentation.ts +76 -0
  688. package/src/pairing/PairingController.ts +32 -3
  689. package/src/pairing/PreviewModeBanner.tsx +250 -94
  690. package/src/pairing/diagnostics.ts +10 -2
  691. package/src/pairing/elementPickerRelay.ts +100 -0
  692. package/src/pairing/resolvePreviewChrome.ts +57 -0
  693. package/src/pairing/tokenStorage.ts +31 -2
  694. package/src/pairing/usePairingState.ts +2 -0
  695. package/src/runtime/FlowRenderer.tsx +55 -27
  696. package/src/runtime/FlowSurfaceFade.tsx +51 -30
  697. package/src/runtime/TargetPressBridge.tsx +14 -32
  698. package/src/runtime/UserflowProvider.tsx +76 -13
  699. package/src/runtime/changedTouchPoints.ts +34 -0
  700. package/src/runtime/flowEngine.ts +2 -0
  701. package/src/runtime/flowSessionViewState.ts +42 -4
  702. package/src/runtime/useFlowSessionState.ts +2 -0
  703. package/src/screenTracker.ts +46 -4
  704. package/src/surfaces/CardFade.tsx +18 -0
  705. package/src/surfaces/CloseButton.tsx +17 -7
  706. package/src/surfaces/MadeWithUserflow.tsx +1 -1
  707. package/src/surfaces/ModalSurface.tsx +48 -35
  708. package/src/surfaces/TooltipSurface.tsx +406 -86
  709. package/src/surfaces/cardTransition.ts +67 -0
  710. package/src/surfaces/resolveHighlightChrome.ts +139 -0
  711. package/src/surfaces/resolveModalLayout.ts +16 -8
  712. package/src/surfaces/resolveTooltipLayout.ts +1 -14
  713. package/src/surfaces/surfaceInteractionConfig.ts +25 -0
  714. package/src/surfaces/surfaceLayoutInsets.tsx +135 -0
  715. package/src/surfaces/themeChrome.ts +5 -3
  716. package/src/surfaces/tooltip/TooltipBubble.tsx +154 -19
  717. package/src/surfaces/tooltip/TooltipCutout.tsx +106 -49
  718. package/src/surfaces/tooltip/TooltipHighlight.tsx +144 -0
  719. package/src/surfaces/tooltip/computeTooltipPosition.ts +98 -12
  720. package/src/surfaces/tooltip/inferTooltipPlacement.ts +107 -18
  721. package/src/surfaces/tooltip/placementDiagnostics.ts +70 -0
  722. package/src/surfaces/tooltip/rect.ts +11 -0
  723. package/src/surfaces/tooltip/resolveSideCardWidth.ts +121 -0
  724. package/src/version.ts +1 -1
  725. package/vendor/core/LICENSE +76 -0
  726. package/vendor/core/README.md +9 -0
  727. package/vendor/core/dist/attributes.d.ts +15 -0
  728. package/vendor/core/dist/attributes.d.ts.map +1 -0
  729. package/vendor/core/dist/attributes.js +55 -0
  730. package/vendor/core/dist/attributes.js.map +1 -0
  731. package/vendor/core/dist/constants.d.ts +21 -0
  732. package/vendor/core/dist/constants.d.ts.map +1 -0
  733. package/vendor/core/dist/constants.js +21 -0
  734. package/vendor/core/dist/constants.js.map +1 -0
  735. package/vendor/core/dist/engine/ClientConditionEngine.d.ts +68 -0
  736. package/vendor/core/dist/engine/ClientConditionEngine.d.ts.map +1 -0
  737. package/vendor/core/dist/engine/ClientConditionEngine.js +197 -0
  738. package/vendor/core/dist/engine/ClientConditionEngine.js.map +1 -0
  739. package/vendor/core/dist/engine/FlowSessionEngine.d.ts +160 -0
  740. package/vendor/core/dist/engine/FlowSessionEngine.d.ts.map +1 -0
  741. package/vendor/core/dist/engine/FlowSessionEngine.js +571 -0
  742. package/vendor/core/dist/engine/FlowSessionEngine.js.map +1 -0
  743. package/vendor/core/dist/engine/PairingEngine.d.ts +135 -0
  744. package/vendor/core/dist/engine/PairingEngine.d.ts.map +1 -0
  745. package/vendor/core/dist/engine/PairingEngine.js +396 -0
  746. package/vendor/core/dist/engine/PairingEngine.js.map +1 -0
  747. package/vendor/core/dist/engine/UserflowCore.d.ts +145 -0
  748. package/vendor/core/dist/engine/UserflowCore.d.ts.map +1 -0
  749. package/vendor/core/dist/engine/UserflowCore.js +329 -0
  750. package/vendor/core/dist/engine/UserflowCore.js.map +1 -0
  751. package/vendor/core/dist/engine/conditionOperators.d.ts +16 -0
  752. package/vendor/core/dist/engine/conditionOperators.d.ts.map +1 -0
  753. package/vendor/core/dist/engine/conditionOperators.js +168 -0
  754. package/vendor/core/dist/engine/conditionOperators.js.map +1 -0
  755. package/vendor/core/dist/engine/handleActions.d.ts +42 -0
  756. package/vendor/core/dist/engine/handleActions.d.ts.map +1 -0
  757. package/vendor/core/dist/engine/handleActions.js +198 -0
  758. package/vendor/core/dist/engine/handleActions.js.map +1 -0
  759. package/vendor/core/dist/engine/interpolateSessionData.d.ts +7 -0
  760. package/vendor/core/dist/engine/interpolateSessionData.d.ts.map +1 -0
  761. package/vendor/core/dist/engine/interpolateSessionData.js +29 -0
  762. package/vendor/core/dist/engine/interpolateSessionData.js.map +1 -0
  763. package/vendor/core/dist/engine/simpleObservable.d.ts +13 -0
  764. package/vendor/core/dist/engine/simpleObservable.d.ts.map +1 -0
  765. package/vendor/core/dist/engine/simpleObservable.js +29 -0
  766. package/vendor/core/dist/engine/simpleObservable.js.map +1 -0
  767. package/vendor/core/dist/engine/trackCondition.d.ts +25 -0
  768. package/vendor/core/dist/engine/trackCondition.d.ts.map +1 -0
  769. package/vendor/core/dist/engine/trackCondition.js +177 -0
  770. package/vendor/core/dist/engine/trackCondition.js.map +1 -0
  771. package/vendor/core/dist/engine/trackStepTriggers.d.ts +21 -0
  772. package/vendor/core/dist/engine/trackStepTriggers.d.ts.map +1 -0
  773. package/vendor/core/dist/engine/trackStepTriggers.js +49 -0
  774. package/vendor/core/dist/engine/trackStepTriggers.js.map +1 -0
  775. package/vendor/core/dist/errors.d.ts +9 -0
  776. package/vendor/core/dist/errors.d.ts.map +1 -0
  777. package/vendor/core/dist/errors.js +15 -0
  778. package/vendor/core/dist/errors.js.map +1 -0
  779. package/vendor/core/dist/eventAttributes.d.ts +7 -0
  780. package/vendor/core/dist/eventAttributes.d.ts.map +1 -0
  781. package/vendor/core/dist/eventAttributes.js +31 -0
  782. package/vendor/core/dist/eventAttributes.js.map +1 -0
  783. package/vendor/core/dist/index.d.ts +31 -0
  784. package/vendor/core/dist/index.d.ts.map +1 -0
  785. package/vendor/core/dist/index.js +22 -0
  786. package/vendor/core/dist/index.js.map +1 -0
  787. package/vendor/core/dist/normalizeAttributes.d.ts +8 -0
  788. package/vendor/core/dist/normalizeAttributes.d.ts.map +1 -0
  789. package/vendor/core/dist/normalizeAttributes.js +127 -0
  790. package/vendor/core/dist/normalizeAttributes.js.map +1 -0
  791. package/vendor/core/dist/transport/backoff.d.ts +11 -0
  792. package/vendor/core/dist/transport/backoff.d.ts.map +1 -0
  793. package/vendor/core/dist/transport/backoff.js +17 -0
  794. package/vendor/core/dist/transport/backoff.js.map +1 -0
  795. package/vendor/core/dist/transport/pairing.d.ts +121 -0
  796. package/vendor/core/dist/transport/pairing.d.ts.map +1 -0
  797. package/vendor/core/dist/transport/pairing.js +551 -0
  798. package/vendor/core/dist/transport/pairing.js.map +1 -0
  799. package/vendor/core/dist/transport/phoenix.d.ts +228 -0
  800. package/vendor/core/dist/transport/phoenix.d.ts.map +1 -0
  801. package/vendor/core/dist/transport/phoenix.js +811 -0
  802. package/vendor/core/dist/transport/phoenix.js.map +1 -0
  803. package/vendor/core/dist/transport/rateLimiter.d.ts +17 -0
  804. package/vendor/core/dist/transport/rateLimiter.d.ts.map +1 -0
  805. package/vendor/core/dist/transport/rateLimiter.js +30 -0
  806. package/vendor/core/dist/transport/rateLimiter.js.map +1 -0
  807. package/vendor/core/dist/transport/scheduler.d.ts +12 -0
  808. package/vendor/core/dist/transport/scheduler.d.ts.map +1 -0
  809. package/vendor/core/dist/transport/scheduler.js +11 -0
  810. package/vendor/core/dist/transport/scheduler.js.map +1 -0
  811. package/vendor/core/dist/types.d.ts +60 -0
  812. package/vendor/core/dist/types.d.ts.map +1 -0
  813. package/vendor/core/dist/types.js +2 -0
  814. package/vendor/core/dist/types.js.map +1 -0
  815. package/vendor/core/dist/version.d.ts +3 -0
  816. package/vendor/core/dist/version.d.ts.map +1 -0
  817. package/vendor/core/dist/version.js +3 -0
  818. package/vendor/core/dist/version.js.map +1 -0
  819. package/vendor/core/package.json +20 -0
  820. package/vendor/protocol/LICENSE +76 -0
  821. package/vendor/protocol/README.md +8 -0
  822. package/vendor/protocol/dist/attributes.d.ts +43 -0
  823. package/vendor/protocol/dist/attributes.d.ts.map +1 -0
  824. package/vendor/protocol/dist/attributes.js +15 -0
  825. package/vendor/protocol/dist/attributes.js.map +1 -0
  826. package/vendor/protocol/dist/autoData.d.ts +232 -0
  827. package/vendor/protocol/dist/autoData.d.ts.map +1 -0
  828. package/vendor/protocol/dist/autoData.js +78 -0
  829. package/vendor/protocol/dist/autoData.js.map +1 -0
  830. package/vendor/protocol/dist/events.d.ts +24 -0
  831. package/vendor/protocol/dist/events.d.ts.map +1 -0
  832. package/vendor/protocol/dist/events.js +8 -0
  833. package/vendor/protocol/dist/events.js.map +1 -0
  834. package/vendor/protocol/dist/flows.d.ts +360 -0
  835. package/vendor/protocol/dist/flows.d.ts.map +1 -0
  836. package/vendor/protocol/dist/flows.js +201 -0
  837. package/vendor/protocol/dist/flows.js.map +1 -0
  838. package/vendor/protocol/dist/index.d.ts +25 -0
  839. package/vendor/protocol/dist/index.d.ts.map +1 -0
  840. package/vendor/protocol/dist/index.js +17 -0
  841. package/vendor/protocol/dist/index.js.map +1 -0
  842. package/vendor/protocol/dist/messages.d.ts +187 -0
  843. package/vendor/protocol/dist/messages.d.ts.map +1 -0
  844. package/vendor/protocol/dist/messages.js +61 -0
  845. package/vendor/protocol/dist/messages.js.map +1 -0
  846. package/vendor/protocol/dist/pairing.d.ts +82 -0
  847. package/vendor/protocol/dist/pairing.d.ts.map +1 -0
  848. package/vendor/protocol/dist/pairing.js +146 -0
  849. package/vendor/protocol/dist/pairing.js.map +1 -0
  850. package/vendor/protocol/package.json +17 -0
@@ -0,0 +1,571 @@
1
+ import { EndFlowReasonInput, TooltipMissingBehavior } from '@userflow-tech/protocol';
2
+ import { UserflowAuthError, UserflowRateLimitError } from '../errors.js';
3
+ import { defaultScheduler } from '../transport/scheduler.js';
4
+ import { handleActions } from './handleActions.js';
5
+ import { SimpleObservable } from './simpleObservable.js';
6
+ import { trackStepTriggers } from './trackStepTriggers.js';
7
+ /** Cap for in-memory client-message retry after transport failure. */
8
+ const MAX_PENDING_SENDS = 20;
9
+ function isValidFlowSession(session) {
10
+ if (session == null || typeof session !== 'object')
11
+ return false;
12
+ const candidate = session;
13
+ if (typeof candidate.id !== 'string' || candidate.id.length === 0)
14
+ return false;
15
+ if (candidate.version == null || typeof candidate.version !== 'object')
16
+ return false;
17
+ if (!Array.isArray(candidate.version.steps))
18
+ return false;
19
+ if (candidate.currentStep == null || typeof candidate.currentStep !== 'object')
20
+ return false;
21
+ if (typeof candidate.currentStep.id !== 'string' || candidate.currentStep.id.length === 0) {
22
+ return false;
23
+ }
24
+ return true;
25
+ }
26
+ /**
27
+ * Framework-agnostic flow session state machine (Phase 3 WS2).
28
+ *
29
+ * Ports web `userflow-client` session/clock/wait-timer semantics onto the
30
+ * Phoenix transport seam. Call {@link attach} after identify.
31
+ */
32
+ export class FlowSessionEngine {
33
+ constructor(deps) {
34
+ this.clientClock = 1;
35
+ this.serverClock = 1;
36
+ this.flowSessionClock = 0;
37
+ this.flowSession = null;
38
+ this.listeners = new Set();
39
+ this.conditionWaitTimers = new Map();
40
+ this.pendingSends = [];
41
+ this.flushingPending = false;
42
+ this.inBatch = false;
43
+ /** EndBatch failed to send; must land before another BeginBatch. */
44
+ this.pendingEndBatch = false;
45
+ /** >0 while a BeginBatch is open, so a mid-op flush cannot close the batch. */
46
+ this.batchOpDepth = 0;
47
+ this.unsubscribeServerMessages = null;
48
+ /** Step whose triggers are currently tracked (may differ from currentStep on ForceGoToStep). */
49
+ this.displayedStepId = null;
50
+ this.triggerTrackingKey = null;
51
+ this.triggerUntrack = null;
52
+ this.applyingTriggers = false;
53
+ this.triggersDirty = false;
54
+ this.triggerSessionData = null;
55
+ /** Keys visited during the current trigger-driven auto-advance chain. */
56
+ this.triggerCycleVisited = new Set();
57
+ /** >0 while a step trigger's handleActions is in flight (including awaits). */
58
+ this.triggerActionDepth = 0;
59
+ this.transport = deps.transport;
60
+ this.onOpenExternalUrl = deps.onOpenExternalUrl;
61
+ this.updateUserImpl = deps.updateUser;
62
+ this.updateGroupImpl = deps.updateGroup;
63
+ this.warn = deps.warn ?? ((message) => console.warn(message));
64
+ this.scheduler = deps.scheduler ?? defaultScheduler;
65
+ }
66
+ /** Subscribe to inbound server messages. Must be called after identify. */
67
+ attach() {
68
+ this.detach();
69
+ this.unsubscribeServerMessages = this.transport.onServerMessage((message) => {
70
+ this.handleServerMessage(message);
71
+ });
72
+ void this.flushPendingSends();
73
+ return () => this.detach();
74
+ }
75
+ /**
76
+ * Unsubscribe from server messages and clear wait timers (keeps session state).
77
+ * Note: in-flight condition wait timers are dropped and not restarted on
78
+ * re-attach; the server must send StartConditionWaitTimer again if needed.
79
+ */
80
+ detach() {
81
+ this.unsubscribeServerMessages?.();
82
+ this.unsubscribeServerMessages = null;
83
+ this.clearConditionWaitTimers();
84
+ }
85
+ on(listener) {
86
+ this.listeners.add(listener);
87
+ return () => {
88
+ this.listeners.delete(listener);
89
+ };
90
+ }
91
+ getFlowSession() {
92
+ return this.flowSession;
93
+ }
94
+ getCurrentStep() {
95
+ const session = this.flowSession;
96
+ if (!session)
97
+ return null;
98
+ const stepId = this.displayedStepId ?? session.currentStep?.id;
99
+ if (!stepId)
100
+ return null;
101
+ return session.version.steps.find((step) => step.id === stepId) ?? null;
102
+ }
103
+ /** Visible for tests / advanced callers; prefer {@link attach}. */
104
+ handleServerMessage(message) {
105
+ switch (message.kind) {
106
+ case 'SetFlowSession': {
107
+ if (!isValidFlowSession(message.session)) {
108
+ this.warn('Userflow: ignoring malformed SetFlowSession (missing id/version.steps/currentStep)');
109
+ return;
110
+ }
111
+ if (this.flowSessionClock <= this.serverClock ||
112
+ this.flowSession?.id === message.session.id) {
113
+ this.setFlowSession(message.session, this.serverClock);
114
+ }
115
+ return;
116
+ }
117
+ case 'UnsetFlowSession': {
118
+ if (this.flowSessionClock > this.serverClock)
119
+ return;
120
+ if (this.flowSession?.id === message.sessionId) {
121
+ this.setFlowSession(null, this.serverClock);
122
+ }
123
+ return;
124
+ }
125
+ case 'ForceGoToStep': {
126
+ // Matches web: emit only — does not update session.currentStep.
127
+ // getCurrentStep() stays stale until a later SetFlowSession; UI must
128
+ // resolve the step from this event (or wait for SetFlowSession).
129
+ if (this.flowSessionClock > this.serverClock)
130
+ return;
131
+ if (this.flowSession?.id === message.sessionId) {
132
+ this.displayedStepId = message.stepId;
133
+ this.emit({
134
+ type: 'goToStep',
135
+ sessionId: message.sessionId,
136
+ stepId: message.stepId,
137
+ });
138
+ this.syncStepTriggers();
139
+ }
140
+ return;
141
+ }
142
+ case 'StartConditionWaitTimer': {
143
+ this.startConditionWaitTimer(message.conditionId, message.waitTime);
144
+ return;
145
+ }
146
+ case 'CancelConditionWaitTimer': {
147
+ this.cancelConditionWaitTimer(message.conditionId);
148
+ return;
149
+ }
150
+ case 'TrackClientCondition':
151
+ case 'UntrackClientCondition':
152
+ // Handled by ClientConditionEngine (separate subscriber).
153
+ return;
154
+ }
155
+ }
156
+ async goToStep(step) {
157
+ const session = this.requireFlowSession();
158
+ const promise = this.sendTracked({
159
+ kind: 'GoToStep',
160
+ sessionId: session.id,
161
+ stepId: step.id,
162
+ });
163
+ // Mutates the live session object already emitted via sessionChange.
164
+ // Listeners that hold that reference and only re-render on sessionChange
165
+ // will not see this update — they must also handle the goToStep event
166
+ // (or we should clone before mutating in a later pass).
167
+ session.currentStep = { id: step.id, crossVersionId: step.crossVersionId };
168
+ this.displayedStepId = step.id;
169
+ this.emit({ type: 'goToStep', sessionId: session.id, stepId: step.id });
170
+ this.syncStepTriggers();
171
+ await promise;
172
+ }
173
+ async endFlow(endReason) {
174
+ const session = this.requireFlowSession();
175
+ const sessionId = session.id;
176
+ const flowId = session.flow.id;
177
+ this.optimisticClockUIUpdate(() => {
178
+ if (this.flowSession?.id === sessionId) {
179
+ this.setFlowSession(null, this.clientClock);
180
+ }
181
+ });
182
+ this.emit({ type: 'flowEnded', flowId, endReason });
183
+ await this.sendTracked({
184
+ kind: 'EndFlow',
185
+ sessionId,
186
+ endReason,
187
+ });
188
+ }
189
+ async reportTooltipTargetMissing(stepId) {
190
+ const session = this.requireFlowSession();
191
+ await this.sendTracked({
192
+ kind: 'ReportTooltipTargetMissing',
193
+ sessionId: session.id,
194
+ stepId,
195
+ });
196
+ const theme = session.version.theme;
197
+ if (theme.tooltipMissingBehavior === TooltipMissingBehavior.END && !session.draftMode) {
198
+ await this.endFlow(EndFlowReasonInput.TOOLTIP_TARGET_MISSING);
199
+ }
200
+ }
201
+ handleActions(actions) {
202
+ const session = this.requireFlowSession();
203
+ return handleActions(session, actions, {
204
+ engine: this,
205
+ ...(this.onOpenExternalUrl !== undefined
206
+ ? { onOpenExternalUrl: this.onOpenExternalUrl }
207
+ : {}),
208
+ warn: this.warn,
209
+ }).catch((error) => {
210
+ const detail = error instanceof Error ? error.message : String(error);
211
+ this.warn(`Userflow: flow actions failed: ${detail}`);
212
+ });
213
+ }
214
+ async trackButtonEvent(eventName, token, stepCvid, sessionId) {
215
+ await this.sendTracked({
216
+ kind: 'TrackButtonEvent',
217
+ eventName,
218
+ token,
219
+ stepCvid,
220
+ sessionId,
221
+ });
222
+ }
223
+ async updateUser(attributes) {
224
+ if (!this.updateUserImpl) {
225
+ this.warn('Userflow: SET_ATTRIBUTE requires an identified user');
226
+ return;
227
+ }
228
+ try {
229
+ await this.updateUserImpl(attributes);
230
+ }
231
+ catch (error) {
232
+ this.warnSetAttributeFailure(error);
233
+ }
234
+ }
235
+ async updateGroup(attributes, options) {
236
+ if (!this.updateGroupImpl) {
237
+ this.warn('Userflow: SET_ATTRIBUTE on a group requires a prior group() call');
238
+ return;
239
+ }
240
+ try {
241
+ await this.updateGroupImpl(attributes, options);
242
+ }
243
+ catch (error) {
244
+ this.warnSetAttributeFailure(error);
245
+ }
246
+ }
247
+ /** Button SET_ATTRIBUTE must not abort sibling close/next/navigate. */
248
+ warnSetAttributeFailure(error) {
249
+ if (error instanceof UserflowAuthError || error instanceof UserflowRateLimitError) {
250
+ this.warn(`Userflow: SET_ATTRIBUTE failed: ${error.message}`);
251
+ return;
252
+ }
253
+ throw error;
254
+ }
255
+ async startFlow(options) {
256
+ // Batch EndFlow+StartFlow so the server defers check_sessions until both
257
+ // land. Without this, ending the current flow can promote an already-active
258
+ // next flow into the slot — the UI then hides flow A over a flow B that
259
+ // was already running (web `startFlow` uses the same BeginBatch/EndBatch).
260
+ const replacing = options.replaceCurrent && this.flowSession != null;
261
+ if (replacing) {
262
+ await this.beginBatch();
263
+ }
264
+ try {
265
+ if (replacing) {
266
+ await this.endFlow(EndFlowReasonInput.REPLACED);
267
+ }
268
+ await this.sendTracked({
269
+ kind: 'StartFlow',
270
+ flowId: options.flowId,
271
+ stepCvid: options.stepCvid,
272
+ startReason: options.startReason,
273
+ once: false,
274
+ });
275
+ }
276
+ finally {
277
+ if (replacing) {
278
+ await this.endBatch();
279
+ }
280
+ }
281
+ }
282
+ /**
283
+ * Clear the local flow session and join resume id without detaching from
284
+ * server messages. Used when a long background makes mid-flow resume stale.
285
+ */
286
+ clearLocalSession() {
287
+ this.clearConditionWaitTimers();
288
+ this.displayedStepId = null;
289
+ this.untrackStepTriggers();
290
+ if (this.flowSession !== null) {
291
+ this.flowSession = null;
292
+ this.transport.setFlowSessionId(null);
293
+ this.emit({ type: 'sessionChange', session: null });
294
+ }
295
+ else {
296
+ this.transport.setFlowSessionId(null);
297
+ }
298
+ }
299
+ /** Clear session, clocks, timers, pending sends, and join resume id; detach from transport. */
300
+ reset() {
301
+ this.detach();
302
+ this.clientClock = 1;
303
+ this.serverClock = 1;
304
+ this.flowSessionClock = 0;
305
+ this.pendingSends.length = 0;
306
+ this.inBatch = false;
307
+ this.pendingEndBatch = false;
308
+ this.batchOpDepth = 0;
309
+ this.clearLocalSession();
310
+ }
311
+ /**
312
+ * Flush client messages queued after transport failure.
313
+ * Call after reconnect / lifecycle resume (`ensureConnected` path).
314
+ */
315
+ async flushPendingSends() {
316
+ if (this.flushingPending || this.pendingSends.length === 0)
317
+ return;
318
+ this.flushingPending = true;
319
+ try {
320
+ while (this.pendingSends.length > 0) {
321
+ const message = this.pendingSends[0];
322
+ try {
323
+ await this.transport.send(message);
324
+ this.pendingSends.shift();
325
+ }
326
+ catch {
327
+ // Keep the head (and rest) queued until the next successful reconnect.
328
+ return;
329
+ }
330
+ }
331
+ if (this.pendingEndBatch && this.batchOpDepth === 0) {
332
+ await this.sendEndBatch();
333
+ }
334
+ }
335
+ finally {
336
+ this.flushingPending = false;
337
+ }
338
+ }
339
+ /** @internal Test helper. */
340
+ getPendingSendCountForTests() {
341
+ return this.pendingSends.length + (this.pendingEndBatch ? 1 : 0);
342
+ }
343
+ setFlowSession(session, clock) {
344
+ const applied = this.applyLocalStepToSession(session);
345
+ this.flowSession = applied;
346
+ this.flowSessionClock = clock;
347
+ this.transport.setFlowSessionId(applied?.id ?? null);
348
+ this.displayedStepId = applied?.currentStep?.id ?? null;
349
+ // Track triggers before sessionChange so ALWAYS_TRUE go-to-next can
350
+ // advance currentStep before the first UI paint (web useLayoutEffect).
351
+ this.syncStepTriggers();
352
+ this.emit({ type: 'sessionChange', session: this.flowSession });
353
+ }
354
+ /**
355
+ * Same-session SetFlowSession must not wipe a local goToStep. Tracking a
356
+ * button event enqueues `check_sessions`, which can still report the old
357
+ * current step. Web FlowApp `updateSession` keeps the local step for the
358
+ * same session id.
359
+ */
360
+ applyLocalStepToSession(session) {
361
+ if (session == null || this.flowSession?.id !== session.id || this.displayedStepId == null) {
362
+ return session;
363
+ }
364
+ const displayedStepId = this.displayedStepId;
365
+ const previous = this.flowSession.version.steps.find((step) => step.id === displayedStepId);
366
+ const kept = session.version.steps.find((step) => step.id === displayedStepId) ??
367
+ (previous == null
368
+ ? undefined
369
+ : session.version.steps.find((step) => step.crossVersionId === previous.crossVersionId));
370
+ if (!kept || session.currentStep?.id === kept.id) {
371
+ return session;
372
+ }
373
+ return {
374
+ ...session,
375
+ currentStep: { id: kept.id, crossVersionId: kept.crossVersionId },
376
+ };
377
+ }
378
+ /**
379
+ * Start/stop client-side step triggers to match the displayed step. Nested
380
+ * calls (a trigger's GO_TO_STEP) mark dirty and let the outer loop apply the
381
+ * new step. handleActions awaits, so GO_TO_STEP can also start a new sync
382
+ * after this returns; triggerActionDepth keeps the visited set across those
383
+ * hops so ALWAYS_TRUE cycles still stop.
384
+ */
385
+ syncStepTriggers() {
386
+ if (this.applyingTriggers) {
387
+ this.triggersDirty = true;
388
+ return;
389
+ }
390
+ // User/server-driven step changes start a new auto-advance chain.
391
+ if (this.triggerActionDepth === 0) {
392
+ this.triggerCycleVisited.clear();
393
+ }
394
+ this.applyingTriggers = true;
395
+ try {
396
+ do {
397
+ this.triggersDirty = false;
398
+ const session = this.flowSession;
399
+ const stepId = this.displayedStepId;
400
+ const key = session && stepId ? `${session.id}:${stepId}` : null;
401
+ if (key === this.triggerTrackingKey) {
402
+ if (session) {
403
+ this.triggerSessionData?.update(session.data);
404
+ }
405
+ continue;
406
+ }
407
+ if (key !== null && this.triggerCycleVisited.has(key)) {
408
+ this.warn('Userflow: step trigger cycle detected; stopping auto-advance');
409
+ // Untrack the previous step so its remaining triggers cannot fire
410
+ // while a different step is displayed. Pin the key so a later
411
+ // same-step sync does not immediately re-enter the cycle.
412
+ this.untrackStepTriggers();
413
+ this.triggerTrackingKey = key;
414
+ break;
415
+ }
416
+ this.untrackStepTriggers();
417
+ this.triggerTrackingKey = key;
418
+ if (key !== null) {
419
+ this.triggerCycleVisited.add(key);
420
+ }
421
+ if (!session || !stepId) {
422
+ break;
423
+ }
424
+ const step = session.version.steps.find((candidate) => candidate.id === stepId);
425
+ if (!step) {
426
+ break;
427
+ }
428
+ this.triggerSessionData = new SimpleObservable(session.data);
429
+ this.triggerUntrack = trackStepTriggers(step.triggers ?? [], session, {
430
+ engine: this,
431
+ scheduler: this.scheduler,
432
+ sessionData: this.triggerSessionData,
433
+ getSession: () => this.flowSession,
434
+ enterTriggerActions: () => {
435
+ this.triggerActionDepth += 1;
436
+ },
437
+ leaveTriggerActions: () => {
438
+ this.triggerActionDepth = Math.max(0, this.triggerActionDepth - 1);
439
+ },
440
+ ...(this.onOpenExternalUrl !== undefined
441
+ ? { onOpenExternalUrl: this.onOpenExternalUrl }
442
+ : {}),
443
+ warn: this.warn,
444
+ });
445
+ } while (this.triggersDirty);
446
+ }
447
+ finally {
448
+ this.applyingTriggers = false;
449
+ }
450
+ }
451
+ untrackStepTriggers() {
452
+ this.triggerUntrack?.();
453
+ this.triggerUntrack = null;
454
+ this.triggerTrackingKey = null;
455
+ this.triggerSessionData = null;
456
+ }
457
+ /**
458
+ * Open a server batch. Nested / overlapping callers share one BeginBatch;
459
+ * `check_sessions` stays deferred until the matching {@link endBatch} at
460
+ * depth 0. `inBatch` is set before the send (web `{batch: true}`) so a
461
+ * second click cannot send another BeginBatch while the first is in flight.
462
+ */
463
+ async beginBatch() {
464
+ if (this.pendingEndBatch) {
465
+ await this.sendEndBatch();
466
+ }
467
+ this.batchOpDepth += 1;
468
+ if (this.inBatch)
469
+ return;
470
+ this.inBatch = true;
471
+ try {
472
+ await this.transport.send({ kind: 'BeginBatch' });
473
+ }
474
+ catch {
475
+ this.warn('Userflow: failed to send BeginBatch');
476
+ }
477
+ }
478
+ /** Close a batch opened by {@link beginBatch}. Nested closes are no-ops until depth 0. */
479
+ async endBatch() {
480
+ if (this.batchOpDepth > 0) {
481
+ this.batchOpDepth -= 1;
482
+ }
483
+ if (this.batchOpDepth > 0)
484
+ return;
485
+ if (!this.inBatch && !this.pendingEndBatch)
486
+ return;
487
+ await this.sendEndBatch();
488
+ }
489
+ /**
490
+ * Close the server batch. `inBatch` stays true until EndBatch is acked so a
491
+ * later replace cannot send BeginBatch while a close is still queued.
492
+ */
493
+ async sendEndBatch() {
494
+ try {
495
+ await this.transport.send({ kind: 'EndBatch' });
496
+ this.inBatch = false;
497
+ this.pendingEndBatch = false;
498
+ }
499
+ catch {
500
+ this.pendingEndBatch = true;
501
+ this.warn('Userflow: failed to send EndBatch; queued for retry on reconnect');
502
+ }
503
+ }
504
+ optimisticClockUIUpdate(callback) {
505
+ this.clientClock += 1;
506
+ callback();
507
+ }
508
+ enqueuePendingSend(message) {
509
+ if (this.pendingSends.length >= MAX_PENDING_SENDS) {
510
+ this.pendingSends.shift();
511
+ }
512
+ this.pendingSends.push(message);
513
+ }
514
+ async sendTracked(message) {
515
+ const clock = this.clientClock;
516
+ try {
517
+ await this.transport.send(message);
518
+ void this.flushPendingSends();
519
+ }
520
+ catch {
521
+ this.enqueuePendingSend(message);
522
+ this.warn(`Userflow: failed to send ${message.kind}; queued for retry on reconnect`);
523
+ }
524
+ finally {
525
+ this.serverClock = clock;
526
+ }
527
+ }
528
+ startConditionWaitTimer(conditionId, waitTime) {
529
+ if (this.conditionWaitTimers.has(conditionId))
530
+ return;
531
+ const ms = parseFloat(waitTime) * 1000;
532
+ const handle = this.scheduler.setTimeout(() => {
533
+ this.conditionWaitTimers.delete(conditionId);
534
+ void this.sendTracked({
535
+ kind: 'FireConditionWaitTimer',
536
+ conditionId,
537
+ });
538
+ }, Number.isFinite(ms) ? Math.max(0, ms) : 0);
539
+ this.conditionWaitTimers.set(conditionId, handle);
540
+ }
541
+ cancelConditionWaitTimer(conditionId) {
542
+ const handle = this.conditionWaitTimers.get(conditionId);
543
+ if (handle === undefined)
544
+ return;
545
+ this.scheduler.clearTimeout(handle);
546
+ this.conditionWaitTimers.delete(conditionId);
547
+ }
548
+ clearConditionWaitTimers() {
549
+ for (const handle of this.conditionWaitTimers.values()) {
550
+ this.scheduler.clearTimeout(handle);
551
+ }
552
+ this.conditionWaitTimers.clear();
553
+ }
554
+ requireFlowSession() {
555
+ if (!this.flowSession) {
556
+ throw new UserflowAuthError('No active flow session');
557
+ }
558
+ return this.flowSession;
559
+ }
560
+ emit(event) {
561
+ for (const listener of this.listeners) {
562
+ try {
563
+ listener(event);
564
+ }
565
+ catch {
566
+ // Never let a subscriber break the engine.
567
+ }
568
+ }
569
+ }
570
+ }
571
+ //# sourceMappingURL=FlowSessionEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowSessionEngine.js","sourceRoot":"","sources":["../../src/engine/FlowSessionEngine.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAoC,MAAM,2BAA2B,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAA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