@robertlinde/react-tour-kit 0.8.8 → 1.0.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 (368) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/MIGRATION.md +205 -0
  3. package/README.md +401 -850
  4. package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.d.ts +14 -0
  5. package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.d.ts.map +1 -0
  6. package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.js +21 -0
  7. package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.js.map +1 -0
  8. package/dist/react-native-platform/hooks/use-tour-target.hook.d.ts +15 -0
  9. package/dist/react-native-platform/hooks/use-tour-target.hook.d.ts.map +1 -0
  10. package/dist/react-native-platform/hooks/use-tour-target.hook.js +28 -0
  11. package/dist/react-native-platform/hooks/use-tour-target.hook.js.map +1 -0
  12. package/dist/react-native-platform/host-store.d.ts +24 -0
  13. package/dist/react-native-platform/host-store.d.ts.map +1 -0
  14. package/dist/react-native-platform/host-store.js +63 -0
  15. package/dist/react-native-platform/host-store.js.map +1 -0
  16. package/dist/react-native-platform/insets.util.d.ts +11 -0
  17. package/dist/react-native-platform/insets.util.d.ts.map +1 -0
  18. package/dist/react-native-platform/insets.util.js +31 -0
  19. package/dist/react-native-platform/insets.util.js.map +1 -0
  20. package/dist/react-native-platform/layer/native-renderer.d.ts +7 -0
  21. package/dist/react-native-platform/layer/native-renderer.d.ts.map +1 -0
  22. package/dist/react-native-platform/layer/native-renderer.js +496 -0
  23. package/dist/react-native-platform/layer/native-renderer.js.map +1 -0
  24. package/dist/react-native-platform/layer/tour-host.d.ts +13 -0
  25. package/dist/react-native-platform/layer/tour-host.d.ts.map +1 -0
  26. package/dist/react-native-platform/layer/tour-host.js +70 -0
  27. package/dist/react-native-platform/layer/tour-host.js.map +1 -0
  28. package/dist/react-native-platform/measure.util.d.ts +20 -0
  29. package/dist/react-native-platform/measure.util.d.ts.map +1 -0
  30. package/dist/react-native-platform/measure.util.js +100 -0
  31. package/dist/react-native-platform/measure.util.js.map +1 -0
  32. package/dist/react-native-platform/native-context.d.ts +12 -0
  33. package/dist/react-native-platform/native-context.d.ts.map +1 -0
  34. package/dist/react-native-platform/native-context.js +4 -0
  35. package/dist/react-native-platform/native-context.js.map +1 -0
  36. package/dist/react-native-platform/native-environment.d.ts +14 -0
  37. package/dist/react-native-platform/native-environment.d.ts.map +1 -0
  38. package/dist/react-native-platform/native-environment.js +20 -0
  39. package/dist/react-native-platform/native-environment.js.map +1 -0
  40. package/dist/react-native-platform/native-platform.d.ts +19 -0
  41. package/dist/react-native-platform/native-platform.d.ts.map +1 -0
  42. package/dist/react-native-platform/native-platform.js +265 -0
  43. package/dist/react-native-platform/native-platform.js.map +1 -0
  44. package/dist/react-native-platform/reduced-motion.d.ts +4 -0
  45. package/dist/react-native-platform/reduced-motion.d.ts.map +1 -0
  46. package/dist/react-native-platform/reduced-motion.js +44 -0
  47. package/dist/react-native-platform/reduced-motion.js.map +1 -0
  48. package/dist/react-native-platform/registry.d.ts +18 -0
  49. package/dist/react-native-platform/registry.d.ts.map +1 -0
  50. package/dist/react-native-platform/registry.js +51 -0
  51. package/dist/react-native-platform/registry.js.map +1 -0
  52. package/dist/react-native-platform/tour-provider.d.ts +16 -3
  53. package/dist/react-native-platform/tour-provider.d.ts.map +1 -0
  54. package/dist/react-native-platform/tour-provider.js +92 -211
  55. package/dist/react-native-platform/tour-provider.js.map +1 -1
  56. package/dist/react-native.d.ts +14 -8
  57. package/dist/react-native.d.ts.map +1 -0
  58. package/dist/react-native.js +7 -6
  59. package/dist/react-native.js.map +1 -1
  60. package/dist/react-platform/dom/elements.util.d.ts +35 -0
  61. package/dist/react-platform/dom/elements.util.d.ts.map +1 -0
  62. package/dist/react-platform/dom/elements.util.js +155 -0
  63. package/dist/react-platform/dom/elements.util.js.map +1 -0
  64. package/dist/react-platform/dom/occluders.util.d.ts +13 -0
  65. package/dist/react-platform/dom/occluders.util.d.ts.map +1 -0
  66. package/dist/react-platform/dom/occluders.util.js +75 -0
  67. package/dist/react-platform/dom/occluders.util.js.map +1 -0
  68. package/dist/react-platform/dom/scroll-lock.util.d.ts +13 -0
  69. package/dist/react-platform/dom/scroll-lock.util.d.ts.map +1 -0
  70. package/dist/react-platform/dom/scroll-lock.util.js +219 -0
  71. package/dist/react-platform/dom/scroll-lock.util.js.map +1 -0
  72. package/dist/react-platform/dom/scroll.util.d.ts +44 -0
  73. package/dist/react-platform/dom/scroll.util.d.ts.map +1 -0
  74. package/dist/react-platform/dom/scroll.util.js +250 -0
  75. package/dist/react-platform/dom/scroll.util.js.map +1 -0
  76. package/dist/react-platform/dom/viewport.util.d.ts +16 -0
  77. package/dist/react-platform/dom/viewport.util.d.ts.map +1 -0
  78. package/dist/react-platform/dom/viewport.util.js +65 -0
  79. package/dist/react-platform/dom/viewport.util.js.map +1 -0
  80. package/dist/react-platform/dom/web-platform.d.ts +15 -0
  81. package/dist/react-platform/dom/web-platform.d.ts.map +1 -0
  82. package/dist/react-platform/dom/web-platform.js +169 -0
  83. package/dist/react-platform/dom/web-platform.js.map +1 -0
  84. package/dist/react-platform/layer/styles.d.ts +12 -0
  85. package/dist/react-platform/layer/styles.d.ts.map +1 -0
  86. package/dist/react-platform/layer/styles.js +285 -0
  87. package/dist/react-platform/layer/styles.js.map +1 -0
  88. package/dist/react-platform/layer/web-renderer.d.ts +4 -0
  89. package/dist/react-platform/layer/web-renderer.d.ts.map +1 -0
  90. package/dist/react-platform/layer/web-renderer.js +390 -0
  91. package/dist/react-platform/layer/web-renderer.js.map +1 -0
  92. package/dist/react-platform/tour-provider.d.ts +9 -3
  93. package/dist/react-platform/tour-provider.d.ts.map +1 -0
  94. package/dist/react-platform/tour-provider.js +28 -218
  95. package/dist/react-platform/tour-provider.js.map +1 -1
  96. package/dist/react.d.ts +10 -8
  97. package/dist/react.d.ts.map +1 -0
  98. package/dist/react.js +5 -6
  99. package/dist/react.js.map +1 -1
  100. package/dist/shared/engine/abort.util.d.ts +17 -0
  101. package/dist/shared/engine/abort.util.d.ts.map +1 -0
  102. package/dist/shared/engine/abort.util.js +72 -0
  103. package/dist/shared/engine/abort.util.js.map +1 -0
  104. package/dist/shared/engine/report.util.d.ts +12 -0
  105. package/dist/shared/engine/report.util.d.ts.map +1 -0
  106. package/dist/shared/engine/report.util.js +51 -0
  107. package/dist/shared/engine/report.util.js.map +1 -0
  108. package/dist/shared/engine/tour-adapter.type.d.ts +60 -0
  109. package/dist/shared/engine/tour-adapter.type.d.ts.map +1 -0
  110. package/dist/shared/engine/tour-adapter.type.js +2 -0
  111. package/dist/shared/engine/tour-adapter.type.js.map +1 -0
  112. package/dist/shared/engine/tour-engine.d.ts +92 -0
  113. package/dist/shared/engine/tour-engine.d.ts.map +1 -0
  114. package/dist/shared/engine/tour-engine.js +787 -0
  115. package/dist/shared/engine/tour-engine.js.map +1 -0
  116. package/dist/shared/geometry/box.util.d.ts +39 -0
  117. package/dist/shared/geometry/box.util.d.ts.map +1 -0
  118. package/dist/shared/geometry/box.util.js +146 -0
  119. package/dist/shared/geometry/box.util.js.map +1 -0
  120. package/dist/shared/geometry/compute-tooltip-layout.util.d.ts +60 -0
  121. package/dist/shared/geometry/compute-tooltip-layout.util.d.ts.map +1 -0
  122. package/dist/shared/geometry/compute-tooltip-layout.util.js +148 -0
  123. package/dist/shared/geometry/compute-tooltip-layout.util.js.map +1 -0
  124. package/dist/shared/geometry/geometry.type.d.ts +34 -0
  125. package/dist/shared/geometry/geometry.type.d.ts.map +1 -0
  126. package/dist/shared/geometry/geometry.type.js +2 -0
  127. package/dist/shared/geometry/geometry.type.js.map +1 -0
  128. package/dist/shared/geometry/reveal.util.d.ts +38 -0
  129. package/dist/shared/geometry/reveal.util.d.ts.map +1 -0
  130. package/dist/shared/geometry/reveal.util.js +135 -0
  131. package/dist/shared/geometry/reveal.util.js.map +1 -0
  132. package/dist/shared/geometry/target-visibility.util.d.ts +10 -0
  133. package/dist/shared/geometry/target-visibility.util.d.ts.map +1 -0
  134. package/dist/shared/geometry/target-visibility.util.js +29 -0
  135. package/dist/shared/geometry/target-visibility.util.js.map +1 -0
  136. package/dist/shared/platform/create-tour-adapter.d.ts +9 -0
  137. package/dist/shared/platform/create-tour-adapter.d.ts.map +1 -0
  138. package/dist/shared/platform/create-tour-adapter.js +130 -0
  139. package/dist/shared/platform/create-tour-adapter.js.map +1 -0
  140. package/dist/shared/platform/platform.type.d.ts +77 -0
  141. package/dist/shared/platform/platform.type.d.ts.map +1 -0
  142. package/dist/shared/platform/platform.type.js +2 -0
  143. package/dist/shared/platform/platform.type.js.map +1 -0
  144. package/dist/shared/platform/reveal-in-scroll-containers.d.ts +27 -0
  145. package/dist/shared/platform/reveal-in-scroll-containers.d.ts.map +1 -0
  146. package/dist/shared/platform/reveal-in-scroll-containers.js +49 -0
  147. package/dist/shared/platform/reveal-in-scroll-containers.js.map +1 -0
  148. package/dist/shared/react/tour-context.d.ts +7 -0
  149. package/dist/shared/react/tour-context.d.ts.map +1 -0
  150. package/dist/shared/react/tour-context.js +23 -0
  151. package/dist/shared/react/tour-context.js.map +1 -0
  152. package/dist/shared/react/tour-provider-core.d.ts +41 -0
  153. package/dist/shared/react/tour-provider-core.d.ts.map +1 -0
  154. package/dist/shared/react/tour-provider-core.js +24 -0
  155. package/dist/shared/react/tour-provider-core.js.map +1 -0
  156. package/dist/shared/react/tour-root.d.ts +14 -0
  157. package/dist/shared/react/tour-root.d.ts.map +1 -0
  158. package/dist/shared/react/tour-root.js +22 -0
  159. package/dist/shared/react/tour-root.js.map +1 -0
  160. package/dist/shared/react/use-isomorphic-layout-effect.hook.d.ts +4 -0
  161. package/dist/shared/react/use-isomorphic-layout-effect.hook.d.ts.map +1 -0
  162. package/dist/shared/react/use-isomorphic-layout-effect.hook.js +5 -0
  163. package/dist/shared/react/use-isomorphic-layout-effect.hook.js.map +1 -0
  164. package/dist/shared/react/use-tour-view.hook.d.ts +5 -0
  165. package/dist/shared/react/use-tour-view.hook.d.ts.map +1 -0
  166. package/dist/shared/react/use-tour-view.hook.js +14 -0
  167. package/dist/shared/react/use-tour-view.hook.js.map +1 -0
  168. package/dist/shared/react/use-tour.hook.d.ts +7 -0
  169. package/dist/shared/react/use-tour.hook.d.ts.map +1 -0
  170. package/dist/shared/react/use-tour.hook.js +10 -0
  171. package/dist/shared/react/use-tour.hook.js.map +1 -0
  172. package/dist/shared/renderer/default-tooltip.d.ts +5 -0
  173. package/dist/shared/renderer/default-tooltip.d.ts.map +1 -0
  174. package/dist/shared/renderer/default-tooltip.js +13 -0
  175. package/dist/shared/renderer/default-tooltip.js.map +1 -0
  176. package/dist/shared/renderer/motion.d.ts +29 -0
  177. package/dist/shared/renderer/motion.d.ts.map +1 -0
  178. package/dist/shared/renderer/motion.js +49 -0
  179. package/dist/shared/renderer/motion.js.map +1 -0
  180. package/dist/shared/renderer/renderer-context.d.ts +17 -0
  181. package/dist/shared/renderer/renderer-context.d.ts.map +1 -0
  182. package/dist/shared/renderer/renderer-context.js +16 -0
  183. package/dist/shared/renderer/renderer-context.js.map +1 -0
  184. package/dist/shared/renderer/renderer.type.d.ts +164 -0
  185. package/dist/shared/renderer/renderer.type.d.ts.map +1 -0
  186. package/dist/shared/renderer/renderer.type.js +2 -0
  187. package/dist/shared/renderer/renderer.type.js.map +1 -0
  188. package/dist/shared/renderer/tooltip-model.d.ts +32 -0
  189. package/dist/shared/renderer/tooltip-model.d.ts.map +1 -0
  190. package/dist/shared/renderer/tooltip-model.js +24 -0
  191. package/dist/shared/renderer/tooltip-model.js.map +1 -0
  192. package/dist/shared/renderer/tour-overlay.d.ts +24 -0
  193. package/dist/shared/renderer/tour-overlay.d.ts.map +1 -0
  194. package/dist/shared/renderer/tour-overlay.js +228 -0
  195. package/dist/shared/renderer/tour-overlay.js.map +1 -0
  196. package/dist/shared/types/tour-context.type.d.ts +21 -11
  197. package/dist/shared/types/tour-context.type.d.ts.map +1 -0
  198. package/dist/shared/types/tour-end-info.type.d.ts +19 -2
  199. package/dist/shared/types/tour-end-info.type.d.ts.map +1 -0
  200. package/dist/shared/types/tour-i18n.type.d.ts +8 -0
  201. package/dist/shared/types/tour-i18n.type.d.ts.map +1 -0
  202. package/dist/shared/types/tour-step.type.d.ts +35 -6
  203. package/dist/shared/types/tour-step.type.d.ts.map +1 -0
  204. package/dist/shared/types/tour-theme.type.d.ts +22 -2
  205. package/dist/shared/types/tour-theme.type.d.ts.map +1 -0
  206. package/dist/shared/types/tour-theme.type.js +1 -16
  207. package/dist/shared/types/tour-theme.type.js.map +1 -1
  208. package/dist/shared/types/tour-tooltip-props.type.d.ts +21 -17
  209. package/dist/shared/types/tour-tooltip-props.type.d.ts.map +1 -0
  210. package/dist/shared/utils/frame.util.d.ts +6 -0
  211. package/dist/shared/utils/frame.util.d.ts.map +1 -0
  212. package/dist/shared/utils/frame.util.js +20 -0
  213. package/dist/shared/utils/frame.util.js.map +1 -0
  214. package/dist/shared/utils/get-truncated-dots.util.d.ts +13 -7
  215. package/dist/shared/utils/get-truncated-dots.util.d.ts.map +1 -0
  216. package/dist/shared/utils/get-truncated-dots.util.js +30 -30
  217. package/dist/shared/utils/get-truncated-dots.util.js.map +1 -1
  218. package/dist/shared/utils/i18n.util.d.ts +7 -0
  219. package/dist/shared/utils/i18n.util.d.ts.map +1 -0
  220. package/dist/shared/utils/i18n.util.js +34 -0
  221. package/dist/shared/utils/i18n.util.js.map +1 -0
  222. package/dist/shared/utils/theme.util.d.ts +6 -0
  223. package/dist/shared/utils/theme.util.d.ts.map +1 -0
  224. package/dist/shared/utils/theme.util.js +31 -0
  225. package/dist/shared/utils/theme.util.js.map +1 -0
  226. package/package.json +72 -55
  227. package/src/react-native-platform/hooks/use-tour-scroll-view.hook.ts +24 -0
  228. package/src/react-native-platform/hooks/use-tour-target.hook.ts +30 -0
  229. package/src/react-native-platform/host-store.ts +92 -0
  230. package/src/react-native-platform/insets.util.ts +39 -0
  231. package/src/react-native-platform/layer/native-renderer.tsx +776 -0
  232. package/src/react-native-platform/layer/tour-host.tsx +105 -0
  233. package/src/react-native-platform/measure.util.ts +140 -0
  234. package/src/react-native-platform/native-context.ts +15 -0
  235. package/src/react-native-platform/native-environment.ts +33 -0
  236. package/src/react-native-platform/native-platform.ts +368 -0
  237. package/src/react-native-platform/reduced-motion.ts +47 -0
  238. package/src/react-native-platform/registry.ts +70 -0
  239. package/src/react-native-platform/tour-provider.tsx +148 -0
  240. package/src/react-native.ts +15 -0
  241. package/src/react-platform/dom/elements.util.ts +191 -0
  242. package/src/react-platform/dom/occluders.util.ts +88 -0
  243. package/src/react-platform/dom/scroll-lock.util.ts +261 -0
  244. package/src/react-platform/dom/scroll.util.ts +310 -0
  245. package/src/react-platform/dom/viewport.util.ts +74 -0
  246. package/src/react-platform/dom/web-platform.ts +208 -0
  247. package/src/react-platform/layer/styles.ts +286 -0
  248. package/src/react-platform/layer/web-renderer.tsx +594 -0
  249. package/src/react-platform/tour-provider.tsx +44 -0
  250. package/src/react.ts +13 -0
  251. package/src/shared/engine/abort.util.ts +84 -0
  252. package/src/shared/engine/report.util.ts +58 -0
  253. package/src/shared/engine/tour-adapter.type.ts +62 -0
  254. package/src/shared/engine/tour-engine.ts +1068 -0
  255. package/src/shared/geometry/box.util.ts +185 -0
  256. package/src/shared/geometry/compute-tooltip-layout.util.ts +238 -0
  257. package/src/shared/geometry/geometry.type.ts +38 -0
  258. package/src/shared/geometry/reveal.util.ts +190 -0
  259. package/src/shared/geometry/target-visibility.util.ts +44 -0
  260. package/src/shared/platform/create-tour-adapter.ts +151 -0
  261. package/src/shared/platform/platform.type.ts +81 -0
  262. package/src/shared/platform/reveal-in-scroll-containers.ts +78 -0
  263. package/src/shared/react/tour-context.ts +28 -0
  264. package/src/shared/react/tour-provider-core.ts +67 -0
  265. package/src/shared/react/tour-root.tsx +34 -0
  266. package/src/shared/react/use-isomorphic-layout-effect.hook.ts +7 -0
  267. package/src/shared/react/use-tour-view.hook.ts +17 -0
  268. package/src/shared/react/use-tour.hook.ts +11 -0
  269. package/src/shared/renderer/default-tooltip.tsx +52 -0
  270. package/src/shared/renderer/motion.ts +59 -0
  271. package/src/shared/renderer/renderer-context.ts +33 -0
  272. package/src/shared/renderer/renderer.type.ts +183 -0
  273. package/src/shared/renderer/tooltip-model.ts +44 -0
  274. package/src/shared/renderer/tour-overlay.tsx +453 -0
  275. package/src/shared/types/tour-context.type.ts +23 -0
  276. package/src/shared/types/tour-end-info.type.ts +32 -0
  277. package/src/shared/types/tour-i18n.type.ts +15 -0
  278. package/src/shared/types/tour-step.type.ts +40 -0
  279. package/src/shared/types/tour-theme.type.ts +28 -0
  280. package/src/shared/types/tour-tooltip-props.type.ts +27 -0
  281. package/src/shared/utils/frame.util.ts +21 -0
  282. package/src/shared/utils/get-truncated-dots.util.ts +46 -0
  283. package/src/shared/utils/i18n.util.ts +44 -0
  284. package/src/shared/utils/theme.util.ts +38 -0
  285. package/dist/react-native-platform/components/index.d.ts +0 -2
  286. package/dist/react-native-platform/components/index.js +0 -3
  287. package/dist/react-native-platform/components/index.js.map +0 -1
  288. package/dist/react-native-platform/components/tour-overlay.d.ts +0 -3
  289. package/dist/react-native-platform/components/tour-overlay.js +0 -26
  290. package/dist/react-native-platform/components/tour-overlay.js.map +0 -1
  291. package/dist/react-native-platform/components/tour-tooltip.d.ts +0 -3
  292. package/dist/react-native-platform/components/tour-tooltip.js +0 -167
  293. package/dist/react-native-platform/components/tour-tooltip.js.map +0 -1
  294. package/dist/react-native-platform/hooks/index.d.ts +0 -1
  295. package/dist/react-native-platform/hooks/index.js +0 -2
  296. package/dist/react-native-platform/hooks/index.js.map +0 -1
  297. package/dist/react-native-platform/hooks/use-tour-target.d.ts +0 -2
  298. package/dist/react-native-platform/hooks/use-tour-target.js +0 -13
  299. package/dist/react-native-platform/hooks/use-tour-target.js.map +0 -1
  300. package/dist/react-native-platform/index.d.ts +0 -7
  301. package/dist/react-native-platform/index.js +0 -7
  302. package/dist/react-native-platform/index.js.map +0 -1
  303. package/dist/react-native-platform/platform-adapter.d.ts +0 -2
  304. package/dist/react-native-platform/platform-adapter.js +0 -84
  305. package/dist/react-native-platform/platform-adapter.js.map +0 -1
  306. package/dist/react-native-platform/target-registry.d.ts +0 -10
  307. package/dist/react-native-platform/target-registry.js +0 -17
  308. package/dist/react-native-platform/target-registry.js.map +0 -1
  309. package/dist/react-native-platform/types/tour-provider.props.type.d.ts +0 -12
  310. package/dist/react-native-platform/types/tour-provider.props.type.js +0 -2
  311. package/dist/react-native-platform/types/tour-provider.props.type.js.map +0 -1
  312. package/dist/react-platform/components/index.d.ts +0 -2
  313. package/dist/react-platform/components/index.js +0 -3
  314. package/dist/react-platform/components/index.js.map +0 -1
  315. package/dist/react-platform/components/tour-overlay.d.ts +0 -3
  316. package/dist/react-platform/components/tour-overlay.js +0 -29
  317. package/dist/react-platform/components/tour-overlay.js.map +0 -1
  318. package/dist/react-platform/components/tour-tooltip.d.ts +0 -2
  319. package/dist/react-platform/components/tour-tooltip.js +0 -155
  320. package/dist/react-platform/components/tour-tooltip.js.map +0 -1
  321. package/dist/react-platform/index.d.ts +0 -6
  322. package/dist/react-platform/index.js +0 -6
  323. package/dist/react-platform/index.js.map +0 -1
  324. package/dist/react-platform/platform-adapter.d.ts +0 -2
  325. package/dist/react-platform/platform-adapter.js +0 -101
  326. package/dist/react-platform/platform-adapter.js.map +0 -1
  327. package/dist/react-platform/types/tour-provider.props.type.d.ts +0 -12
  328. package/dist/react-platform/types/tour-provider.props.type.js +0 -2
  329. package/dist/react-platform/types/tour-provider.props.type.js.map +0 -1
  330. package/dist/react-platform/utils/find-visible-element.util.d.ts +0 -1
  331. package/dist/react-platform/utils/find-visible-element.util.js +0 -11
  332. package/dist/react-platform/utils/find-visible-element.util.js.map +0 -1
  333. package/dist/react-platform/utils/index.d.ts +0 -1
  334. package/dist/react-platform/utils/index.js +0 -2
  335. package/dist/react-platform/utils/index.js.map +0 -1
  336. package/dist/shared/context/index.d.ts +0 -1
  337. package/dist/shared/context/index.js +0 -2
  338. package/dist/shared/context/index.js.map +0 -1
  339. package/dist/shared/context/tour-context.d.ts +0 -3
  340. package/dist/shared/context/tour-context.js +0 -14
  341. package/dist/shared/context/tour-context.js.map +0 -1
  342. package/dist/shared/hooks/index.d.ts +0 -1
  343. package/dist/shared/hooks/index.js +0 -2
  344. package/dist/shared/hooks/index.js.map +0 -1
  345. package/dist/shared/hooks/use-tour.hook.d.ts +0 -2
  346. package/dist/shared/hooks/use-tour.hook.js +0 -7
  347. package/dist/shared/hooks/use-tour.hook.js.map +0 -1
  348. package/dist/shared/index.d.ts +0 -5
  349. package/dist/shared/index.js +0 -5
  350. package/dist/shared/index.js.map +0 -1
  351. package/dist/shared/types/index.d.ts +0 -10
  352. package/dist/shared/types/index.js +0 -2
  353. package/dist/shared/types/index.js.map +0 -1
  354. package/dist/shared/types/platform-adapter.type.d.ts +0 -24
  355. package/dist/shared/types/platform-adapter.type.js +0 -2
  356. package/dist/shared/types/platform-adapter.type.js.map +0 -1
  357. package/dist/shared/types/rect.type.d.ts +0 -11
  358. package/dist/shared/types/rect.type.js +0 -2
  359. package/dist/shared/types/rect.type.js.map +0 -1
  360. package/dist/shared/types/tour-overlay-props.type.d.ts +0 -8
  361. package/dist/shared/types/tour-overlay-props.type.js +0 -2
  362. package/dist/shared/types/tour-overlay-props.type.js.map +0 -1
  363. package/dist/shared/utils/calculate-tooltip-position.util.d.ts +0 -14
  364. package/dist/shared/utils/calculate-tooltip-position.util.js +0 -49
  365. package/dist/shared/utils/calculate-tooltip-position.util.js.map +0 -1
  366. package/dist/shared/utils/index.d.ts +0 -3
  367. package/dist/shared/utils/index.js +0 -3
  368. package/dist/shared/utils/index.js.map +0 -1
@@ -0,0 +1,135 @@
1
+ import { bottom, right, zeroInsets } from './box.util.js';
2
+ const fitSlack = 1e-6;
3
+ /**
4
+ * How far a container has to scroll (positive: further down/right) so that the target plus a
5
+ * margin is inside `area` and clear of `obstacles` (elements that stay put while the content
6
+ * scrolls: sticky headers, floating buttons, cookie banners, any number of them).
7
+ *
8
+ * Per axis, the obstacles in the target's column (row) cut the area into free gaps. The target is
9
+ * moved into the gap that needs the least scrolling, so scrolling up and down behave the same. The
10
+ * first margin that fits is used (preferring one that fits on both axes). A target that only fits
11
+ * without margin is centred in the nearest gap that can hold it; a target that fits in no gap is
12
+ * aligned to the start of the largest one, keeping the smallest margin.
13
+ */
14
+ export function computeRevealDelta(target, area, margins, obstacles = []) {
15
+ const candidates = margins.length > 0 ? margins : [zeroInsets];
16
+ const smallest = candidates.at(-1) ?? zeroInsets;
17
+ // Pages scroll vertically: the vertical gaps depend on the obstacles in the target's column, the
18
+ // horizontal ones on the obstacles in the row the target ends up in.
19
+ const ySegments = freeSegments(area.y, bottom(area), obstacles.filter((o) => o.x < right(target) && right(o) > target.x).map((o) => [o.y, bottom(o)]));
20
+ const xSegmentsAfter = (dy) => freeSegments(area.x, right(area), obstacles
21
+ .filter((o) => o.y < bottom(target) - dy && bottom(o) > target.y - dy)
22
+ .map((o) => [o.x, right(o)]));
23
+ const yAxis = { start: target.y, size: target.height };
24
+ const xAxis = { start: target.x, size: target.width };
25
+ // The first margin that fits on both axes (it may leave room for the tooltip on one side).
26
+ for (const margin of candidates) {
27
+ const y = fitDelta(yAxis, ySegments, [margin.top, margin.bottom]);
28
+ const x = y === undefined ? undefined : fitDelta(xAxis, xSegmentsAfter(y), [margin.left, margin.right]);
29
+ if (y !== undefined && x !== undefined) {
30
+ return { x, y };
31
+ }
32
+ }
33
+ // Otherwise each axis on its own.
34
+ const y = firstDefined(candidates, (m) => fitDelta(yAxis, ySegments, [m.top, m.bottom])) ??
35
+ fallbackDelta(yAxis, ySegments, smallest.top);
36
+ const xSegments = xSegmentsAfter(y);
37
+ const x = firstDefined(candidates, (m) => fitDelta(xAxis, xSegments, [m.left, m.right])) ??
38
+ fallbackDelta(xAxis, xSegments, smallest.left);
39
+ return { x, y };
40
+ }
41
+ function firstDefined(items, map) {
42
+ for (const item of items) {
43
+ const value = map(item);
44
+ if (value !== undefined) {
45
+ return value;
46
+ }
47
+ }
48
+ return undefined;
49
+ }
50
+ /** The parts of `[from, to]` not covered by `blocked`. Fully blocked: the whole range (nothing can be avoided). */
51
+ export function freeSegments(from, to, blocked) {
52
+ const sorted = [...blocked]
53
+ .map(([a, b]) => [Math.max(a, from), Math.min(b, to)])
54
+ .filter(([a, b]) => b > a)
55
+ // eslint-disable-next-line unicorn/no-array-sort -- sorting a fresh copy (ES2023 `toSorted` is not available on every supported React Native version)
56
+ .sort((a, b) => a[0] - b[0]);
57
+ const segments = [];
58
+ let cursor = from;
59
+ for (const [a, b] of sorted) {
60
+ if (a > cursor) {
61
+ segments.push({ from: cursor, to: a });
62
+ }
63
+ cursor = Math.max(cursor, b);
64
+ }
65
+ if (to > cursor) {
66
+ segments.push({ from: cursor, to });
67
+ }
68
+ return segments.length > 0 ? segments : [{ from, to }];
69
+ }
70
+ /** Smallest movement that puts `[from, to]` inside `segment`. */
71
+ function deltaInto(from, to, segment) {
72
+ if (from < segment.from) {
73
+ return from - segment.from;
74
+ }
75
+ return to > segment.to ? to - segment.to : 0;
76
+ }
77
+ function smallestBy(items, score) {
78
+ let best;
79
+ let bestScore = Number.POSITIVE_INFINITY;
80
+ for (const item of items) {
81
+ const value = score(item);
82
+ if (value < bestScore) {
83
+ best = item;
84
+ bestScore = value;
85
+ }
86
+ }
87
+ return best;
88
+ }
89
+ /** The smallest movement that puts the target plus margin into a gap that can hold it, if any. */
90
+ function fitDelta({ start, size }, segments, [before, after]) {
91
+ const from = start - before;
92
+ const to = start + size + after;
93
+ // Sub-pixel slack: gap widths computed from coordinates lose their last bits of precision.
94
+ const fitting = segments.filter((segment) => segment.to - segment.from >= to - from - fitSlack);
95
+ const best = smallestBy(fitting, (segment) => Math.abs(deltaInto(from, to, segment)));
96
+ return best ? deltaInto(from, to, best) : undefined;
97
+ }
98
+ /**
99
+ * When no margin fits: centre the target in the nearest gap that can hold it, or align it to the
100
+ * start of the largest gap (keeping `leadingMargin`) when it fits nowhere.
101
+ */
102
+ function fallbackDelta({ start, size }, segments, leadingMargin) {
103
+ const centreDelta = (segment) => start + size / 2 - (segment.from + segment.to) / 2;
104
+ const holding = segments.filter((segment) => segment.to - segment.from >= size);
105
+ const nearest = smallestBy(holding, (segment) => Math.abs(centreDelta(segment)));
106
+ if (nearest) {
107
+ return centreDelta(nearest);
108
+ }
109
+ const largest = smallestBy(segments, (segment) => -(segment.to - segment.from)) ?? { from: start, to: start };
110
+ return start - Math.min(leadingMargin, (largest.to - largest.from) / 2) - largest.from;
111
+ }
112
+ /**
113
+ * Margins to keep around the target while scrolling it into view. The first entry also leaves
114
+ * room for the tooltip on the first side (in the given order) where target and tooltip fit on
115
+ * screen together. The last entry only keeps the highlight padding and viewport padding.
116
+ */
117
+ export function buildRevealMargins(input) {
118
+ const base = input.highlightPadding + input.viewportPadding;
119
+ const baseMargin = { top: base, right: base, bottom: base, left: base };
120
+ for (const side of input.sides) {
121
+ const vertical = side === 'top' || side === 'bottom';
122
+ const room = input.gap + (vertical ? input.tooltip.height : input.tooltip.width);
123
+ const mainFits = vertical
124
+ ? input.target.height + base * 2 + room <= input.area.height
125
+ : input.target.width + base * 2 + room <= input.area.width;
126
+ const crossFits = vertical
127
+ ? input.tooltip.width + input.viewportPadding * 2 <= input.area.width
128
+ : input.tooltip.height + input.viewportPadding * 2 <= input.area.height;
129
+ if (mainFits && crossFits) {
130
+ return [{ ...baseMargin, [side]: base + room }, baseMargin];
131
+ }
132
+ }
133
+ return [baseMargin];
134
+ }
135
+ //# sourceMappingURL=reveal.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal.util.js","sourceRoot":"","sources":["../../../src/shared/geometry/reveal.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGxD,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kB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AAK,CAAC,IAAI,CAAC,KAAK;YACrE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,eAAe,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QAC1E,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,EAAC,GAAG,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,EAAC,EAAE,UAAU,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,CAAC;AACtB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Box } from './geometry.type.js';
2
+ /**
3
+ * How much of a target the user can see:
4
+ * - `full`: the whole target is visible, or, for targets larger than the area, it covers the area.
5
+ * - `partial`: at least half of what could be visible is visible on both axes.
6
+ * - `none`: anything less.
7
+ */
8
+ export type TargetVisibility = 'full' | 'partial' | 'none';
9
+ export declare function getTargetVisibility(target: Box, area: Box): TargetVisibility;
10
+ //# sourceMappingURL=target-visibility.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-visibility.util.d.ts","sourceRoot":"","sources":["../../../src/shared/geometry/target-visibility.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,oBAAoB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AA2B3D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,gBAAgB,CAQ5E"}
@@ -0,0 +1,29 @@
1
+ function axisVisibility(start, size, areaStart, areaSize) {
2
+ const end = start + size;
3
+ const areaEnd = areaStart + areaSize;
4
+ if (areaSize <= 0) {
5
+ return 'none';
6
+ }
7
+ if (size === 0) {
8
+ return start >= areaStart && start <= areaEnd ? 'full' : 'none';
9
+ }
10
+ const fullyInside = start >= areaStart && end <= areaEnd;
11
+ const covers = start <= areaStart && end >= areaEnd;
12
+ if (size <= areaSize ? fullyInside : covers) {
13
+ return 'full';
14
+ }
15
+ const visible = Math.max(0, Math.min(end, areaEnd) - Math.max(start, areaStart));
16
+ if (visible === 0 || visible < Math.min(size, areaSize) / 2) {
17
+ return 'none';
18
+ }
19
+ return 'partial';
20
+ }
21
+ export function getTargetVisibility(target, area) {
22
+ const horizontal = axisVisibility(target.x, target.width, area.x, area.width);
23
+ const vertical = axisVisibility(target.y, target.height, area.y, area.height);
24
+ if (horizontal === 'none' || vertical === 'none') {
25
+ return 'none';
26
+ }
27
+ return horizontal === 'full' && vertical === 'full' ? 'full' : 'partial';
28
+ }
29
+ //# sourceMappingURL=target-visibility.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-visibility.util.js","sourceRoot":"","sources":["../../../src/shared/geometry/target-visibility.util.ts"],"names":[],"mappings":"AAUA,SAAS,cAAc,CAAC,KAAa,EAAE,IAAY,EAAE,SAAiB,EAAE,QAAgB;IACtF,MAAM,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC;IACzB,MAAM,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrC,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAClE,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,IAAI,SAAS,IAAI,GAAG,IAAI,OAAO,CAAC;IACzD,MAAM,MAAM,GAAG,KAAK,IAAI,SAAS,IAAI,GAAG,IAAI,OAAO,CAAC;IACpD,IAAI,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IACjF,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAW,EAAE,IAAS;IACxD,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9E,IAAI,UAAU,KAAK,MAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACjD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,UAAU,KAAK,MAAM,IAAI,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { TourAdapter } from '../engine/tour-adapter.type.js';
2
+ import type { PlatformAdapter } from './platform.type.js';
3
+ /**
4
+ * The tour's behaviour on top of a platform: waiting for targets, following them, and scrolling
5
+ * them into view. Shared by every platform, so they behave the same; platforms only provide the
6
+ * raw facts ({@link PlatformAdapter}).
7
+ */
8
+ export declare function createTourAdapter(platform: PlatformAdapter): TourAdapter;
9
+ //# sourceMappingURL=create-tour-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-tour-adapter.d.ts","sourceRoot":"","sources":["../../../src/shared/platform/create-tour-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAKnF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAYxD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,WAAW,CA+HxE"}
@@ -0,0 +1,130 @@
1
+ import { nextFrame, nextFrameOrAfter } from '../engine/abort.util.js';
2
+ import { boxesEqual } from '../geometry/box.util.js';
3
+ import { requestFrame } from '../utils/frame.util.js';
4
+ import { revealInScrollContainers } from './reveal-in-scroll-containers.js';
5
+ /** A found target counts as settled once it has not moved for this many frames (screens slide in, drawers expand)... */
6
+ const stableFramesNeeded = 2;
7
+ /** ...or after this many frames, so a target that never stops moving (a pulsing button) is still shown... */
8
+ const maxSettleFrames = 12;
9
+ /** ...or after this long: frames stop in background tabs, timers only slow down. */
10
+ const maxSettleMs = 300;
11
+ /** Longest wait for a frame while settling, for the same reason. */
12
+ const settleFrameMs = 50;
13
+ /**
14
+ * The tour's behaviour on top of a platform: waiting for targets, following them, and scrolling
15
+ * them into view. Shared by every platform, so they behave the same; platforms only provide the
16
+ * raw facts ({@link PlatformAdapter}).
17
+ */
18
+ export function createTourAdapter(platform) {
19
+ return {
20
+ measure: platform.measure,
21
+ async waitForTarget(target, signal) {
22
+ // Subscribed for the whole wait, so a change between measuring and waiting is never missed.
23
+ let hasChanged = false;
24
+ let wake;
25
+ const unsubscribe = platform.subscribe(target, () => {
26
+ hasChanged = true;
27
+ wake?.();
28
+ });
29
+ const onAbort = () => {
30
+ wake?.();
31
+ };
32
+ const sleepUntilChange = async () => new Promise((resolve) => {
33
+ wake = resolve;
34
+ });
35
+ signal.addEventListener('abort', onAbort);
36
+ try {
37
+ let previous;
38
+ let stableFrames = 0;
39
+ let settleFrames = 0;
40
+ let firstSeenAt = 0;
41
+ while (!signal.aborted) {
42
+ hasChanged = false;
43
+ // eslint-disable-next-line no-await-in-loop -- measuring until the target is there and settled
44
+ const current = await platform.measure(target);
45
+ if (signal.aborted) {
46
+ return undefined;
47
+ }
48
+ if (current) {
49
+ stableFrames = previous && boxesEqual(current.rect, previous, 0.5) ? stableFrames + 1 : 0;
50
+ firstSeenAt = settleFrames === 0 ? Date.now() : firstSeenAt;
51
+ settleFrames++;
52
+ const isSettled = stableFrames >= stableFramesNeeded ||
53
+ settleFrames > maxSettleFrames ||
54
+ Date.now() - firstSeenAt >= maxSettleMs;
55
+ if (isSettled) {
56
+ return current;
57
+ }
58
+ previous = current.rect;
59
+ // eslint-disable-next-line no-await-in-loop -- see above
60
+ await nextFrameOrAfter(signal, settleFrameMs);
61
+ continue;
62
+ }
63
+ previous = undefined;
64
+ stableFrames = 0;
65
+ settleFrames = 0;
66
+ if (platform.isAwaitingLayout(target)) {
67
+ // eslint-disable-next-line no-await-in-loop -- see above
68
+ await nextFrame(signal);
69
+ }
70
+ else if (!hasChanged) {
71
+ // Not there yet: sleep until something changes instead of polling.
72
+ // eslint-disable-next-line no-await-in-loop -- see above
73
+ await sleepUntilChange();
74
+ wake = undefined;
75
+ }
76
+ }
77
+ return undefined;
78
+ }
79
+ finally {
80
+ signal.removeEventListener('abort', onAbort);
81
+ unsubscribe();
82
+ }
83
+ },
84
+ getViewport: platform.getViewport,
85
+ measuresWhileScrolling: platform.measuresWhileScrolling,
86
+ async reveal(target, request) {
87
+ const containers = await platform.scrollContainers(target);
88
+ if (request.signal.aborted) {
89
+ return;
90
+ }
91
+ await revealInScrollContainers({
92
+ containers,
93
+ async measureTarget() {
94
+ const measurement = await platform.measure(target);
95
+ return measurement?.rect;
96
+ },
97
+ margins: request.margins,
98
+ animated: request.behavior === 'smooth' && !platform.reducedMotion.get(),
99
+ signal: request.signal,
100
+ onScrollStart: request.onScrollStart,
101
+ });
102
+ },
103
+ observe(target, onChange, signal) {
104
+ if (signal.aborted) {
105
+ return;
106
+ }
107
+ // At most one call per frame, however many events arrive.
108
+ let cancelFrame;
109
+ const schedule = () => {
110
+ if (cancelFrame !== undefined || signal.aborted) {
111
+ return;
112
+ }
113
+ cancelFrame = requestFrame(() => {
114
+ cancelFrame = undefined;
115
+ if (!signal.aborted) {
116
+ onChange();
117
+ }
118
+ });
119
+ };
120
+ const unsubscribe = platform.subscribe(target, schedule);
121
+ signal.addEventListener('abort', () => {
122
+ cancelFrame?.();
123
+ unsubscribe();
124
+ });
125
+ },
126
+ getPixelRatio: platform.getPixelRatio,
127
+ nextFrame,
128
+ };
129
+ }
130
+ //# sourceMappingURL=create-tour-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-tour-adapter.js","sourceRoot":"","sources":["../../../src/shared/platform/create-tour-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAGnD,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAC,wBAAwB,EAAC,MAAM,kCAAkC,CAAC;AAE1E,wHAAwH;AACxH,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,6GAA6G;AAC7G,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,oFAAoF;AACpF,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,oEAAoE;AACpE,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAyB;IACzD,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QAEzB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;YAChC,4FAA4F;YAC5F,IAAI,UAAU,GAAG,KAAK,CAAC;YACvB,IAAI,IAA8B,CAAC;YACnC,MAAM,WAAW,G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,OAAO,CAAC,MAAM,CAAC,CAAC;oBACnD,OAAO,WAAW,EAAE,IAAI,CAAC;gBAC3B,CAAC;gBACD,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE;gBACxE,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CAAC,MAA8B,EAAE,QAAQ,EAAE,MAAM;YACtD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,OAAO;YACT,CAAC;YAED,0DAA0D;YAC1D,IAAI,WAAqC,CAAC;YAC1C,MAAM,QAAQ,GAAG,GAAS,EAAE;gBAC1B,IAAI,WAAW,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBAChD,OAAO;gBACT,CAAC;gBAED,WAAW,GAAG,YAAY,CAAC,GAAG,EAAE;oBAC9B,WAAW,GAAG,SAAS,CAAC;oBACxB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACpB,QAAQ,EAAE,CAAC;oBACb,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;YAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACzD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;gBACpC,WAAW,EAAE,EAAE,CAAC;gBAChB,WAAW,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC;QAED,aAAa,EAAE,QAAQ,CAAC,aAAa;QAErC,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,77 @@
1
+ import type { TargetMeasurement } from '../engine/tour-adapter.type.js';
2
+ import type { Box, Point, Viewport } from '../geometry/geometry.type.js';
3
+ import type { TourTarget } from '../types/tour-step.type.js';
4
+ /**
5
+ * What the tour needs from a platform (web, React Native): raw facts about the screen and the
6
+ * app's views, and nothing else. Everything built on them — waiting for targets, following them,
7
+ * scrolling them into view, deciding when scrolling has finished — is shared (see
8
+ * `createTourAdapter`), so it behaves the same everywhere.
9
+ *
10
+ * Every member is required: a platform that lacks one does not compile.
11
+ */
12
+ export type PlatformAdapter = {
13
+ /** Where the target is, in the tour layer's coordinates, or `undefined` when it is not rendered. */
14
+ readonly measure: (target: TourTarget) => Promise<TargetMeasurement | undefined>;
15
+ /**
16
+ * Calls `onChange` whenever the target, the layout around it or the viewport may have changed.
17
+ * Event-driven: no calls while nothing changes. Calling too often is fine (calls are coalesced
18
+ * per frame and results compared). Returns the unsubscribe function.
19
+ */
20
+ readonly subscribe: (target: TourTarget | undefined, onChange: () => void) => () => void;
21
+ /**
22
+ * True when the target exists but cannot be measured yet, and no event will announce when it
23
+ * can (React Native: registered, but not laid out yet). The tour then checks every frame.
24
+ */
25
+ readonly isAwaitingLayout: (target: TourTarget) => boolean;
26
+ /** The scroll containers around the target, innermost first, including the page where it scrolls. */
27
+ readonly scrollContainers: (target: TourTarget) => Promise<readonly ScrollContainer[]>;
28
+ /**
29
+ * The visible area of the tour layer and what covers its edges (safe areas, the on-screen
30
+ * keyboard). Pass the step's target so that a bar containing it does not count as covering it.
31
+ */
32
+ readonly getViewport: (target?: TourTarget) => Viewport;
33
+ /** Whether the user asked the system to reduce motion. */
34
+ readonly reducedMotion: ExternalValue<boolean>;
35
+ /**
36
+ * Whether `measure` sees targets move while a scroll animation runs. When it does not (React
37
+ * Native: on the New Architecture, measurements only catch up once a scroll has finished), the
38
+ * highlight moves straight to where the target will end up instead of following it.
39
+ */
40
+ readonly measuresWhileScrolling: boolean;
41
+ /** Device pixel ratio, used to place the tooltip on whole device pixels. */
42
+ readonly getPixelRatio: () => number;
43
+ };
44
+ /** A value that can change outside React (a system setting), readable with `useSyncExternalStore`. */
45
+ export type ExternalValue<T> = {
46
+ readonly get: () => T;
47
+ readonly subscribe: (listener: () => void) => () => void;
48
+ };
49
+ /** One scrollable area between the target and the screen (a nested scroller, a list, or the page itself). */
50
+ export type ScrollContainer = {
51
+ /** Current geometry, or `undefined` when the container is not rendered. */
52
+ readonly measure: () => Promise<ScrollContainerMetrics | undefined>;
53
+ /**
54
+ * Scrolls to `offset` and resolves once this container has finished scrolling (or cannot get
55
+ * further). Stops waiting as soon as `signal` is aborted.
56
+ */
57
+ readonly scrollTo: (offset: Point, options: ScrollOptions) => Promise<void>;
58
+ };
59
+ export type ScrollOptions = {
60
+ readonly animated: boolean;
61
+ readonly signal: AbortSignal;
62
+ };
63
+ export type ScrollContainerMetrics = {
64
+ /** The part of the container's viewport content should be revealed in (scroll-padding already applied), in layer coordinates. */
65
+ readonly area: Box;
66
+ readonly offset: Point;
67
+ /**
68
+ * The range the tour may scroll in, per axis. Usually `0` to the end of the content; on an axis
69
+ * the tour must not scroll (the app's own `overflow: hidden`), both are the current offset. Offsets
70
+ * can be negative at rest (content insets, centred content).
71
+ */
72
+ readonly minOffset: Point;
73
+ readonly maxOffset: Point;
74
+ /** Elements over this area that do not scroll with its content (sticky headers, floating buttons), in layer coordinates. */
75
+ readonly obstacles?: readonly Box[];
76
+ };
77
+ //# sourceMappingURL=platform.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.type.d.ts","sourceRoot":"","sources":["../../../src/shared/platform/platform.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,oGAAoG;IACpG,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OA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AAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,iIAAiI;IACjI,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,4HAA4H;IAC5H,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;CACrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=platform.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.type.js","sourceRoot":"","sources":["../../../src/shared/platform/platform.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import type { Box, Insets } from '../geometry/geometry.type.js';
2
+ import type { ScrollContainer } from './platform.type.js';
3
+ export type RevealOptions = {
4
+ /** Innermost container first. */
5
+ readonly containers: readonly ScrollContainer[];
6
+ readonly measureTarget: () => Promise<Box | undefined>;
7
+ /** Space to keep around the target, most generous first (see `buildRevealMargins`). */
8
+ readonly margins: readonly Insets[];
9
+ readonly animated: boolean;
10
+ readonly signal: AbortSignal;
11
+ /**
12
+ * Called once, right before the first container scrolls, with where the target will be once
13
+ * everything has scrolled. Not called if nothing needs to scroll.
14
+ */
15
+ readonly onScrollStart?: (destination: Box) => void;
16
+ };
17
+ /** Safety cap: a scroll that never reports finishing (interrupted, snapped elsewhere) does not hold the tour up longer. */
18
+ export declare const settleTimeoutMs = 1500;
19
+ /**
20
+ * Scrolls every container around the target just enough to bring it (plus margin) into view, all
21
+ * at once: each container's scroll is computed innermost first, on the position the target will
22
+ * have after the inner containers have scrolled (an inner scroll moves the target by exactly the
23
+ * scrolled distance), and then all containers scroll together as one movement. Resolves once every
24
+ * container has finished scrolling.
25
+ */
26
+ export declare function revealInScrollContainers(options: RevealOptions): Promise<boolean>;
27
+ //# sourceMappingURL=reveal-in-scroll-containers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal-in-scroll-containers.d.ts","sourceRoot":"","sources":["../../../src/shared/platform/reveal-in-scroll-containers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,GAAG,EAAE,MAAM,EAAQ,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;IACvD,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,KAAK,IAAI,CAAC;CACrD,CAAC;AAGF,2HAA2H;AAC3H,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CA6CvF"}
@@ -0,0 +1,49 @@
1
+ import { withTimeout } from '../engine/abort.util.js';
2
+ import { clamp } from '../geometry/box.util.js';
3
+ import { computeRevealDelta } from '../geometry/reveal.util.js';
4
+ const minimumScroll = 0.5;
5
+ /** Safety cap: a scroll that never reports finishing (interrupted, snapped elsewhere) does not hold the tour up longer. */
6
+ export const settleTimeoutMs = 1500;
7
+ /**
8
+ * Scrolls every container around the target just enough to bring it (plus margin) into view, all
9
+ * at once: each container's scroll is computed innermost first, on the position the target will
10
+ * have after the inner containers have scrolled (an inner scroll moves the target by exactly the
11
+ * scrolled distance), and then all containers scroll together as one movement. Resolves once every
12
+ * container has finished scrolling.
13
+ */
14
+ export async function revealInScrollContainers(options) {
15
+ const metrics = await Promise.all(options.containers.map(async (container) => container.measure()));
16
+ let predicted = await options.measureTarget();
17
+ if (options.signal.aborted || !predicted) {
18
+ return false;
19
+ }
20
+ const moves = [];
21
+ for (const [index, container] of options.containers.entries()) {
22
+ const current = metrics[index];
23
+ if (!current) {
24
+ continue;
25
+ }
26
+ const delta = computeRevealDelta(predicted, current.area, options.margins, current.obstacles);
27
+ const offset = {
28
+ x: clamp(current.offset.x + delta.x, current.minOffset.x, Math.max(current.minOffset.x, current.maxOffset.x)),
29
+ y: clamp(current.offset.y + delta.y, current.minOffset.y, Math.max(current.minOffset.y, current.maxOffset.y)),
30
+ };
31
+ const applied = { x: offset.x - current.offset.x, y: offset.y - current.offset.y };
32
+ if (Math.abs(applied.x) < minimumScroll && Math.abs(applied.y) < minimumScroll) {
33
+ continue;
34
+ }
35
+ moves.push({ container, offset });
36
+ // Scrolling by `applied` moves the content (and the target) the other way.
37
+ predicted = { ...predicted, x: predicted.x - applied.x, y: predicted.y - applied.y };
38
+ }
39
+ if (moves.length === 0) {
40
+ return false;
41
+ }
42
+ options.onScrollStart?.(predicted);
43
+ await withTimeout(async (signal) => {
44
+ await Promise.all(moves.map(async (move) => move.container.scrollTo(move.offset, { animated: options.animated, signal })));
45
+ return true;
46
+ }, options.signal, settleTimeoutMs);
47
+ return true;
48
+ }
49
+ //# sourceMappingURL=reveal-in-scroll-containers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal-in-scroll-containers.js","sourceRoot":"","sources":["../../../src/shared/platform/reveal-in-scroll-containers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,KAAK,EAAC,M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AQ,EAAE,MAAM,EAAC,CAAC,CAAC,CACtG,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,EACD,OAAO,CAAC,MAAM,EACd,eAAe,CAChB,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { TourEngine } from '../engine/tour-engine.js';
2
+ import type { TourContextType } from '../types/tour-context.type.js';
3
+ /** Public tour state and actions (what `useTour()` returns). */
4
+ export declare const TourContext: import("react").Context<TourContextType>;
5
+ /** The engine, for the built-in renderer and platform hooks. Not part of the public API. */
6
+ export declare const TourEngineContext: import("react").Context<TourEngine | undefined>;
7
+ //# sourceMappingURL=tour-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tour-context.d.ts","sourceRoot":"","sources":["../../../src/shared/react/tour-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAkBnE,gEAAgE;AAChE,eAAO,MAAM,WAAW,0CAAoC,CAAC;AAG7D,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,iDAAmD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { createContext } from 'react';
2
+ import { devWarn } from '../engine/report.util.js';
3
+ function outsideProvider() {
4
+ devWarn('useTour() was called outside of <TourProvider>; the call has no effect.');
5
+ }
6
+ const defaultTourContext = {
7
+ isActive: false,
8
+ currentStep: 0,
9
+ steps: [],
10
+ currentTourId: undefined,
11
+ startTour: outsideProvider,
12
+ endTour: outsideProvider,
13
+ nextStep: outsideProvider,
14
+ prevStep: outsideProvider,
15
+ goToStep: outsideProvider,
16
+ };
17
+ /** Public tour state and actions (what `useTour()` returns). */
18
+ export const TourContext = createContext(defaultTourContext);
19
+ TourContext.displayName = 'TourContext';
20
+ /** The engine, for the built-in renderer and platform hooks. Not part of the public API. */
21
+ export const TourEngineContext = createContext(undefined);
22
+ TourEngineContext.displayName = 'TourEngineContext';
23
+ //# sourceMappingURL=tour-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tour-context.js","sourceRoot":"","sources":["../../../src/shared/react/tour-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACpC,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AAIjD,SAAS,eAAe;IACtB,OAAO,CAAC,yEAAyE,CAAC,CAAC;AACrF,CAAC;AAED,MAAM,kBAAkB,GAAoB;IAC1C,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,CAAC;IACd,KAAK,EAAE,EAAE;IACT,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,eAAe;IACxB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;CAC1B,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAC7D,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAyB,SAAS,CAAC,CAAC;AAClF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import type { TourEngine } from '../engine/tour-engine.js';
3
+ import type { PlatformAdapter } from '../platform/platform.type.js';
4
+ import type { TourRenderer } from '../renderer/renderer.type.js';
5
+ import type { TourOverlayProps } from '../renderer/tour-overlay.js';
6
+ import type { TourEndCallback } from '../types/tour-end-info.type.js';
7
+ import type { TourI18n } from '../types/tour-i18n.type.js';
8
+ import type { TourTheme } from '../types/tour-theme.type.js';
9
+ import type { TourTooltipProps } from '../types/tour-tooltip-props.type.js';
10
+ /** Props of `TourProvider` on every platform. Platforms may add their own (React Native: `insets`). */
11
+ export type TourProviderBaseProps = {
12
+ readonly children?: ReactNode;
13
+ /** Colours of the built-in tooltip and overlay. */
14
+ readonly theme?: TourTheme;
15
+ /** Texts of the built-in tooltip. */
16
+ readonly i18n?: TourI18n;
17
+ /** Called once whenever a tour ends, after the tour's own `onTourEnd`. */
18
+ readonly onTourEnd?: TourEndCallback;
19
+ /**
20
+ * Whether clicking or tapping the dimmed area ends the tour (with the reason `'blur'`).
21
+ * @defaultValue `true`
22
+ */
23
+ readonly closeOnOverlayClick?: boolean;
24
+ /**
25
+ * Replaces the content of the tooltip card. The tour still measures, positions, animates and
26
+ * focuses it, and keeps it on screen.
27
+ */
28
+ readonly TooltipComponent?: ComponentType<TourTooltipProps>;
29
+ };
30
+ export type TourCore = {
31
+ readonly engine: TourEngine;
32
+ /** Everything the overlay needs; the platform renders `<TourOverlay {...overlay} />` where the tour is drawn. */
33
+ readonly overlay: TourOverlayProps;
34
+ };
35
+ /**
36
+ * What every `TourProvider` does, whatever the platform: creates the engine on top of the
37
+ * platform's facts, resolves theme and texts, and prepares the overlay. `platform` and `renderer`
38
+ * must keep their identity for the lifetime of the provider.
39
+ */
40
+ export declare function useTourCore(props: TourProviderBaseProps, platform: PlatformAdapter, renderer: TourRenderer): TourCore;
41
+ //# sourceMappingURL=tour-provider-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tour-provider-core.d.ts","sourceRoot":"","sources":["../../../src/shared/react/tour-provider-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,aAAa,EAAE,KAAK,SAAS,EAA0C,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;A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