@robertlinde/react-tour-kit 0.8.9 → 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 -10
  57. package/dist/react-native.d.ts.map +1 -0
  58. package/dist/react-native.js +7 -7
  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 -10
  97. package/dist/react.d.ts.map +1 -0
  98. package/dist/react.js +5 -7
  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 -7
  349. package/dist/shared/index.js +0 -6
  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,250 @@
1
+ import { deflate, narrowClip } from '../../shared/geometry/box.util.js';
2
+ import { requestFrame } from '../../shared/utils/frame.util.js';
3
+ import { pageDirection, parentOf } from './elements.util.js';
4
+ import { occludersOver } from './occluders.util.js';
5
+ import { readViewport } from './viewport.util.js';
6
+ const clippingOverflow = new Set(['hidden', 'scroll', 'auto', 'overlay', 'clip']);
7
+ /**
8
+ * Overflow the user can scroll. `hidden` only clips: what it shows is up to the app (carousels,
9
+ * sliders, off-canvas menus), so the tour never scrolls it.
10
+ */
11
+ const userScrollable = new Set(['scroll', 'auto', 'overlay']);
12
+ /**
13
+ * True for elements whose overflow is the page's (CSS overflow propagation): `<html>`, and `<body>`
14
+ * unless `<html>` has an overflow of its own (then `<body>` is a scroll container like any other).
15
+ */
16
+ function holdsPageOverflow(element) {
17
+ if (element === document.documentElement) {
18
+ return true;
19
+ }
20
+ return element === document.body && getComputedStyle(document.documentElement).overflowY === 'visible';
21
+ }
22
+ /** The page's own overflow per axis (from `<html>`, or from `<body>` when `<html>` has none). */
23
+ export function readPageOverflow() {
24
+ const root = getComputedStyle(document.documentElement);
25
+ const style = root.overflowY === 'visible' && document.body ? getComputedStyle(document.body) : root;
26
+ return { x: style.overflowX, y: style.overflowY };
27
+ }
28
+ function isSet(value) {
29
+ return value !== '' && value !== 'none';
30
+ }
31
+ /**
32
+ * True when an element with `style` is the containing block of `position: absolute` (or `fixed`)
33
+ * descendants: their position, clipping and scrolling come from it, not from the elements between.
34
+ */
35
+ function isContainingBlock(style, of) {
36
+ if (of === 'absolute' && style.position !== 'static') {
37
+ return true;
38
+ }
39
+ return (['transform', 'translate', 'rotate', 'scale', 'perspective', 'filter', 'backdrop-filter'].some((property) => isSet(style.getPropertyValue(property))) ||
40
+ /layout|paint|strict|content/u.test(style.getPropertyValue('contain')) ||
41
+ /transform|translate|rotate|scale|perspective|filter/u.test(style.getPropertyValue('will-change')) ||
42
+ !['', 'normal'].includes(style.getPropertyValue('container-type')) ||
43
+ style.getPropertyValue('content-visibility') === 'auto');
44
+ }
45
+ function escapeOf(position) {
46
+ return position === 'absolute' || position === 'fixed' ? position : undefined;
47
+ }
48
+ function paddingBox(element) {
49
+ const rect = element.getBoundingClientRect();
50
+ return {
51
+ x: rect.left + element.clientLeft,
52
+ y: rect.top + element.clientTop,
53
+ width: element.clientWidth,
54
+ height: element.clientHeight,
55
+ };
56
+ }
57
+ /** A computed length (`20px`, `10%`, `calc(10% + 20px)`) in pixels; percentages refer to `basis`. */
58
+ export function resolveLength(value, basis) {
59
+ const expression = value.startsWith('calc(') && value.endsWith(')') ? value.slice(5, -1) : value;
60
+ let total = 0;
61
+ let sign = 1;
62
+ for (const token of expression.trim().split(/\s+/u)) {
63
+ if (token === '+' || token === '-') {
64
+ sign = token === '-' ? -1 : 1;
65
+ continue;
66
+ }
67
+ const match = /^(-?[\d.]+(?:e[+-]?\d+)?)(px|%)$/iu.exec(token);
68
+ if (!match?.[1]) {
69
+ // `auto`, or an expression this does not understand.
70
+ return Number.parseFloat(value) || 0;
71
+ }
72
+ const amount = Number(match[1]);
73
+ total += sign * (match[2] === '%' ? (amount / 100) * basis : amount);
74
+ }
75
+ return Number.isFinite(total) ? total : 0;
76
+ }
77
+ function scrollPadding(element, size) {
78
+ const style = getComputedStyle(element);
79
+ return {
80
+ top: resolveLength(style.scrollPaddingTop, size.height),
81
+ right: resolveLength(style.scrollPaddingRight, size.width),
82
+ bottom: resolveLength(style.scrollPaddingBottom, size.height),
83
+ left: resolveLength(style.scrollPaddingLeft, size.width),
84
+ };
85
+ }
86
+ /**
87
+ * Walks up from `element`, collecting the scroll containers and clipping that apply to it. An
88
+ * absolutely positioned element escapes the overflow of the ancestors between it and its
89
+ * containing block (a dropdown sticking out of a navigation bar); a fixed one escapes everything
90
+ * up to the page.
91
+ */
92
+ export function inspectAncestors(element) {
93
+ const scrollers = [];
94
+ let clip;
95
+ let escaping = escapeOf(getComputedStyle(element).position);
96
+ for (let current = parentOf(element); current && current !== document.documentElement; current = parentOf(current)) {
97
+ if (holdsPageOverflow(current)) {
98
+ continue;
99
+ }
100
+ const style = getComputedStyle(current);
101
+ if (escaping) {
102
+ if (!isContainingBlock(style, escaping)) {
103
+ continue;
104
+ }
105
+ escaping = undefined;
106
+ }
107
+ const clips = clippingOverflow.has(style.overflowX) || clippingOverflow.has(style.overflowY);
108
+ // `display: contents` elements have no box, so their overflow does nothing.
109
+ if (clips && style.display !== 'contents') {
110
+ clip = narrowClip(clip, paddingBox(current));
111
+ const axes = {
112
+ x: userScrollable.has(style.overflowX) && current.scrollWidth > current.clientWidth + 1,
113
+ y: userScrollable.has(style.overflowY) && current.scrollHeight > current.clientHeight + 1,
114
+ };
115
+ if (axes.x || axes.y) {
116
+ scrollers.push({ element: current, axes });
117
+ }
118
+ }
119
+ escaping = escapeOf(style.position);
120
+ }
121
+ return { scrollers, clip, fixed: escaping === 'fixed' };
122
+ }
123
+ function isRtl(element) {
124
+ return getComputedStyle(element).direction === 'rtl';
125
+ }
126
+ /** Where the tour may scroll on each axis: from 0 to the end where it may, nowhere where it must not. */
127
+ function scrollRange(offset, max, axes) {
128
+ return {
129
+ minOffset: { x: axes.x ? 0 : offset.x, y: axes.y ? 0 : offset.y },
130
+ maxOffset: { x: axes.x ? max.x : offset.x, y: axes.y ? max.y : offset.y },
131
+ };
132
+ }
133
+ /** A nested scroll container. Horizontal offsets are normalised to [0, max] in right-to-left containers too. */
134
+ export function elementContainer(element, axes, occluders) {
135
+ const maxX = () => Math.max(0, element.scrollWidth - element.clientWidth);
136
+ const read = () => ({
137
+ x: isRtl(element) ? element.scrollLeft + maxX() : element.scrollLeft,
138
+ y: element.scrollTop,
139
+ });
140
+ return {
141
+ async measure() {
142
+ if (!element.isConnected) {
143
+ return undefined;
144
+ }
145
+ const box = paddingBox(element);
146
+ const area = deflate(box, scrollPadding(element, box));
147
+ const offset = read();
148
+ return {
149
+ area,
150
+ obstacles: occludersOver(area, occluders()),
151
+ offset,
152
+ ...scrollRange(offset, { x: maxX(), y: Math.max(0, element.scrollHeight - element.clientHeight) }, axes),
153
+ };
154
+ },
155
+ async scrollTo(offset, options) {
156
+ element.scrollTo({
157
+ left: isRtl(element) ? offset.x - maxX() : offset.x,
158
+ top: offset.y,
159
+ behavior: options.animated ? 'smooth' : 'instant',
160
+ });
161
+ await waitForScrollEnd(element, read, offset, options);
162
+ },
163
+ };
164
+ }
165
+ /**
166
+ * The page itself; its visible area is the visual viewport minus safe areas and the page's
167
+ * scroll-padding. `overflow` is the page's own (see `readPageOverflow`), not the tour's scroll lock.
168
+ */
169
+ export function pageContainer(occluders, overflow) {
170
+ const root = () => document.scrollingElement ?? document.documentElement;
171
+ const maxX = () => Math.max(0, root().scrollWidth - root().clientWidth);
172
+ const read = () => ({
173
+ x: pageDirection() === 'rtl' ? globalThis.scrollX + maxX() : globalThis.scrollX,
174
+ y: globalThis.scrollY,
175
+ });
176
+ // The page scrolls unless the app keeps an axis from scrolling (`overflow-x: hidden` against
177
+ // stray horizontal overflow, off-canvas menus): then the tour leaves that axis alone too.
178
+ const axes = { x: !['hidden', 'clip'].includes(overflow.x), y: !['hidden', 'clip'].includes(overflow.y) };
179
+ return {
180
+ async measure() {
181
+ const viewport = readViewport();
182
+ const visible = deflate(viewport.rect, viewport.insets);
183
+ const size = { width: document.documentElement.clientWidth, height: document.documentElement.clientHeight };
184
+ const offset = read();
185
+ return {
186
+ area: deflate(visible, scrollPadding(document.documentElement, size)),
187
+ // Sticky headers, floating buttons, banners: the target is scrolled clear of them where possible.
188
+ obstacles: occluders(),
189
+ offset,
190
+ ...scrollRange(offset, { x: maxX(), y: Math.max(0, root().scrollHeight - root().clientHeight) }, axes),
191
+ };
192
+ },
193
+ async scrollTo(offset, options) {
194
+ globalThis.scrollTo({
195
+ left: pageDirection() === 'rtl' ? offset.x - maxX() : offset.x,
196
+ top: offset.y,
197
+ behavior: options.animated ? 'smooth' : 'instant',
198
+ });
199
+ await waitForScrollEnd(globalThis, read, offset, options);
200
+ },
201
+ };
202
+ }
203
+ /** Frames without movement after which a smooth scroll counts as finished (it moved, or it never started). */
204
+ const stillFramesAfterMoving = 3;
205
+ const stillFramesWithoutMoving = 8;
206
+ /**
207
+ * Resolves once a scroll of `scroller` has finished: at `scrollend` where browsers support it, or
208
+ * once the offset has reached `requested`, or has stopped changing (scroll snapping can end the
209
+ * scroll elsewhere). Instant scrolls finish on the next frame.
210
+ */
211
+ async function waitForScrollEnd(scroller, read, requested, { animated, signal }) {
212
+ if (signal.aborted) {
213
+ return;
214
+ }
215
+ await new Promise((resolve) => {
216
+ let cancelFrame;
217
+ let previous = read();
218
+ let stillFrames = 0;
219
+ let hasMoved = false;
220
+ const finish = () => {
221
+ cancelFrame();
222
+ scroller.removeEventListener('scrollend', finish);
223
+ signal.removeEventListener('abort', finish);
224
+ resolve();
225
+ };
226
+ const tick = () => {
227
+ const current = read();
228
+ const isStill = Math.abs(current.x - previous.x) < 0.5 && Math.abs(current.y - previous.y) < 0.5;
229
+ hasMoved ||= !isStill;
230
+ stillFrames = isStill ? stillFrames + 1 : 0;
231
+ previous = current;
232
+ const hasArrived = Math.abs(current.x - requested.x) <= 1 && Math.abs(current.y - requested.y) <= 1;
233
+ const isDone = !animated ||
234
+ (hasArrived && isStill) ||
235
+ stillFrames >= (hasMoved ? stillFramesAfterMoving : stillFramesWithoutMoving);
236
+ if (isDone) {
237
+ finish();
238
+ }
239
+ else {
240
+ cancelFrame = requestFrame(tick);
241
+ }
242
+ };
243
+ if (animated) {
244
+ scroller.addEventListener('scrollend', finish);
245
+ }
246
+ signal.addEventListener('abort', finish);
247
+ cancelFrame = requestFrame(tick);
248
+ });
249
+ }
250
+ //# sourceMappingURL=scroll.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll.util.js","sourceRoot":"","sources":["../../../src/react-platform/dom/scroll.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAC,MAAM,mCAAmC,CAAC;AAGtE,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,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C,CAAC;YACpG,MAAM,MAAM,GACV,CAAC,QAAQ;gBACT,CAAC,UAAU,IAAI,OAAO,CAAC;gBACvB,WAAW,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC;YAChF,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,EAAE,CAAC;YACX,CAAC;iBAAM,CAAC;gBACN,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACzC,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Box, Insets, Viewport } from '../../shared/geometry/geometry.type.js';
2
+ /**
3
+ * Safe-area insets (notch, home indicator) via `env(safe-area-inset-*)`. They are only non-zero
4
+ * when the page opts in with `viewport-fit=cover`.
5
+ */
6
+ export declare function readSafeAreaInsets(): Insets;
7
+ /** Registers a user of the safe-area probe; the returned function releases it and removes the probe when unused. */
8
+ export declare function acquireSafeAreaProbe(): () => void;
9
+ /**
10
+ * The part of the page the user sees, in the coordinate space of `position: fixed` elements
11
+ * (the layout viewport): the visual viewport (pinch-zoom, on-screen keyboard), without scrollbars.
12
+ */
13
+ export declare function readVisibleRect(): Box;
14
+ /** The visible area and its safe-area insets (notch, home indicator). */
15
+ export declare function readViewport(): Viewport;
16
+ //# sourceMappingURL=viewport.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.util.d.ts","sourceRoot":"","sources":["../../../src/react-platform/dom/viewport.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,wCAAwC,CAAC;AAIlF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAsB3C;AAID,oHAAoH;AACpH,wBAAgB,oBAAoB,IAAI,MAAM,IAAI,CASjD;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,GAAG,CAiBrC;AAED,yEAAyE;AACzE,wBAAgB,YAAY,IAAI,QAAQ,CAEvC"}
@@ -0,0 +1,65 @@
1
+ import { zeroInsets } from '../../shared/geometry/box.util.js';
2
+ let probe;
3
+ /**
4
+ * Safe-area insets (notch, home indicator) via `env(safe-area-inset-*)`. They are only non-zero
5
+ * when the page opts in with `viewport-fit=cover`.
6
+ */
7
+ export function readSafeAreaInsets() {
8
+ if (typeof document === 'undefined' || !document.body) {
9
+ return zeroInsets;
10
+ }
11
+ if (!probe?.isConnected) {
12
+ probe = document.createElement('div');
13
+ probe.setAttribute('aria-hidden', 'true');
14
+ probe.dataset.rtkProbe = '';
15
+ probe.style.cssText =
16
+ 'position:fixed;top:0;left:0;width:0;height:0;visibility:hidden;pointer-events:none;' +
17
+ 'padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)';
18
+ document.body.append(probe);
19
+ }
20
+ const style = getComputedStyle(probe);
21
+ return {
22
+ top: Number.parseFloat(style.paddingTop) || 0,
23
+ right: Number.parseFloat(style.paddingRight) || 0,
24
+ bottom: Number.parseFloat(style.paddingBottom) || 0,
25
+ left: Number.parseFloat(style.paddingLeft) || 0,
26
+ };
27
+ }
28
+ let probeUsers = 0;
29
+ /** Registers a user of the safe-area probe; the returned function releases it and removes the probe when unused. */
30
+ export function acquireSafeAreaProbe() {
31
+ probeUsers++;
32
+ return () => {
33
+ probeUsers--;
34
+ if (probeUsers === 0) {
35
+ probe?.remove();
36
+ probe = undefined;
37
+ }
38
+ };
39
+ }
40
+ /**
41
+ * The part of the page the user sees, in the coordinate space of `position: fixed` elements
42
+ * (the layout viewport): the visual viewport (pinch-zoom, on-screen keyboard), without scrollbars.
43
+ */
44
+ export function readVisibleRect() {
45
+ const root = document.documentElement;
46
+ const layoutWidth = root.clientWidth || window.innerWidth;
47
+ const layoutHeight = root.clientHeight || window.innerHeight;
48
+ const visual = window.visualViewport;
49
+ if (!visual) {
50
+ return { x: 0, y: 0, width: layoutWidth, height: layoutHeight };
51
+ }
52
+ const x = Math.max(0, visual.offsetLeft);
53
+ const y = Math.max(0, visual.offsetTop);
54
+ return {
55
+ x,
56
+ y,
57
+ width: Math.max(0, Math.min(visual.width, layoutWidth - x)),
58
+ height: Math.max(0, Math.min(visual.height, layoutHeight - y)),
59
+ };
60
+ }
61
+ /** The visible area and its safe-area insets (notch, home indicator). */
62
+ export function readViewport() {
63
+ return { rect: readVisibleRect(), insets: readSafeAreaInsets() };
64
+ }
65
+ //# sourceMappingURL=viewport.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport.util.js","sourceRoot":"","sources":["../../../src/react-platform/dom/viewport.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,mCAAmC,CAAC;AAG7D,IAAI,KAA8B,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC;QACxB,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC1C,KAAK,CAAC,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;QAC5B,KAAK,CAAC,KAAK,CAAC,OAAO;YACjB,qFAAqF;gBACrF,mIAAmI,CAAC;QACtI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC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C,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACzC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,OAAO;QACL,CAAC;QACD,CAAC;QACD,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;QAC3D,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,YAAY;IAC1B,OAAO,EAAC,IAAI,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { PlatformAdapter } from '../../shared/platform/platform.type.js';
2
+ export type WebPlatform = PlatformAdapter & {
3
+ /**
4
+ * Adds the element the tour is drawn into at the end of `<body>`. Its changes are ignored, it is
5
+ * skipped when looking for elements covering the target, and its pointer, focus and key events
6
+ * stay inside it. Returns the element to render into and the cleanup.
7
+ */
8
+ readonly mountHost: () => {
9
+ readonly container: HTMLElement;
10
+ readonly unmount: () => void;
11
+ };
12
+ };
13
+ /** The web's raw facts for the tour: measuring elements, layout events, scroll containers, the visible area. */
14
+ export declare function createWebPlatform(): WebPlatform;
15
+ //# sourceMappingURL=web-platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-platform.d.ts","sourceRoot":"","sources":["../../../src/react-platform/dom/web-platform.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,eAAe,EAAkB,MAAM,wCAAwC,CAAC;AAQ5G,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM;QAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAC,CAAC;CAC3F,CAAC;AAwDF,gHAAgH;AAChH,wBAAgB,iBAAiB,IAAI,WAAW,CAsI/C"}
@@ -0,0 +1,169 @@
1
+ import { hasLayout, isRendered, resolveTarget, toBox } from './elements.util.js';
2
+ import { clearOccluderCache, findOccluders, occludersOver } from './occluders.util.js';
3
+ import { pageOverflow } from './scroll-lock.util.js';
4
+ import { elementContainer, inspectAncestors, pageContainer } from './scroll.util.js';
5
+ import { readViewport } from './viewport.util.js';
6
+ /**
7
+ * Events that must not reach the app's listeners on `<body>`, `document` or `window`: "click
8
+ * outside" handlers of menus and popovers (which would close the menu a step highlights), focus
9
+ * traps of the app's own dialogs, and keyboard shortcuts. The page is inert while the tour is
10
+ * open, so nothing in it expects them.
11
+ */
12
+ const isolatedEvents = [
13
+ 'pointerdown',
14
+ 'pointerup',
15
+ 'mousedown',
16
+ 'mouseup',
17
+ 'touchstart',
18
+ 'touchend',
19
+ 'click',
20
+ 'dblclick',
21
+ 'auxclick',
22
+ 'contextmenu',
23
+ 'focusin',
24
+ 'focusout',
25
+ 'keydown',
26
+ 'keyup',
27
+ ];
28
+ /** Where a target is reported in documents without layout (jsdom), so tours still run in tests: at the top of the screen. */
29
+ const placeholderRect = { x: 0, y: 0, width: 1, height: 1 };
30
+ function measureElement(element, host) {
31
+ if (!element.isConnected || !isRendered(element)) {
32
+ return undefined;
33
+ }
34
+ if (!hasLayout()) {
35
+ return { rect: placeholderRect, clip: undefined, occluders: [] };
36
+ }
37
+ const rect = toBox(element.getBoundingClientRect());
38
+ return { rect, clip: inspectAncestors(element).clip, occluders: occludersOver(rect, findOccluders(element, host)) };
39
+ }
40
+ /** `prefers-reduced-motion`, live. */
41
+ function reducedMotionQuery() {
42
+ const query = typeof globalThis.matchMedia === 'function' ? globalThis.matchMedia('(prefers-reduced-motion: reduce)') : undefined;
43
+ return {
44
+ get: () => query?.matches ?? false,
45
+ subscribe(listener) {
46
+ query?.addEventListener('change', listener);
47
+ return () => {
48
+ query?.removeEventListener('change', listener);
49
+ };
50
+ },
51
+ };
52
+ }
53
+ /** The web's raw facts for the tour: measuring elements, layout events, scroll containers, the visible area. */
54
+ export function createWebPlatform() {
55
+ let host;
56
+ const isOwnNode = (node) => host?.contains(node) ?? false;
57
+ const measureTarget = (target) => {
58
+ const element = resolveTarget(target);
59
+ return element ? measureElement(element, host) : undefined;
60
+ };
61
+ return {
62
+ async measure(target) {
63
+ return measureTarget(target);
64
+ },
65
+ subscribe(target, onChange) {
66
+ // Size changes of the page and of the target (also elements that exist but have no size yet:
67
+ // expanding drawers, entrance transitions). Selector targets can be replaced by a new element.
68
+ const resize = typeof ResizeObserver === 'function'
69
+ ? new ResizeObserver(() => {
70
+ onChange();
71
+ })
72
+ : undefined;
73
+ resize?.observe(document.documentElement);
74
+ let observed;
75
+ const follow = () => {
76
+ const next = target === undefined ? undefined : resolveTarget(target);
77
+ if (next !== observed) {
78
+ if (observed) {
79
+ resize?.unobserve(observed);
80
+ }
81
+ observed = next;
82
+ if (next) {
83
+ resize?.observe(next);
84
+ }
85
+ }
86
+ };
87
+ const notify = () => {
88
+ follow();
89
+ onChange();
90
+ };
91
+ follow();
92
+ // Content inserted, removed or restyled anywhere (except the tour itself) can move the target.
93
+ const mutations = new MutationObserver((records) => {
94
+ if (records.some((record) => !isOwnNode(record.target))) {
95
+ notify();
96
+ }
97
+ });
98
+ mutations.observe(document.documentElement, { childList: true, subtree: true, attributes: true });
99
+ const visual = globalThis.visualViewport;
100
+ globalThis.addEventListener('scroll', notify, { capture: true, passive: true });
101
+ globalThis.addEventListener('resize', notify, { passive: true });
102
+ visual?.addEventListener('resize', notify, { passive: true });
103
+ visual?.addEventListener('scroll', notify, { passive: true });
104
+ document.addEventListener('transitionend', notify, true);
105
+ document.addEventListener('animationend', notify, true);
106
+ return () => {
107
+ resize?.disconnect();
108
+ mutations.disconnect();
109
+ globalThis.removeEventListener('scroll', notify, { capture: true });
110
+ globalThis.removeEventListener('resize', notify);
111
+ visual?.removeEventListener('resize', notify);
112
+ visual?.removeEventListener('scroll', notify);
113
+ document.removeEventListener('transitionend', notify, true);
114
+ document.removeEventListener('animationend', notify, true);
115
+ clearOccluderCache();
116
+ };
117
+ },
118
+ // Layout is always announced: by the ResizeObserver above (or, without one, by the other events).
119
+ isAwaitingLayout: () => false,
120
+ async scrollContainers(target) {
121
+ const element = resolveTarget(target);
122
+ if (!element || !hasLayout()) {
123
+ return [];
124
+ }
125
+ const occluders = () => findOccluders(element, host);
126
+ const ancestors = inspectAncestors(element);
127
+ const containers = ancestors.scrollers.map((scroller) => elementContainer(scroller.element, scroller.axes, occluders));
128
+ // Inside a `position: fixed` element, scrolling the page does not move the target.
129
+ return ancestors.fixed ? containers : [...containers, pageContainer(occluders, pageOverflow())];
130
+ },
131
+ getViewport: readViewport,
132
+ reducedMotion: reducedMotionQuery(),
133
+ measuresWhileScrolling: true,
134
+ getPixelRatio: () => globalThis.devicePixelRatio || 1,
135
+ mountHost() {
136
+ const element = document.createElement('div');
137
+ element.dataset.rtkHost = '';
138
+ // No box of its own: the page's layout (flex or grid `<body>`, `:last-child` rules) stays as it is.
139
+ element.style.display = 'contents';
140
+ // React listens for events on the element it renders into: keep that one inside, so the tour's
141
+ // own handlers run before the events are stopped here.
142
+ const container = document.createElement('div');
143
+ container.style.display = 'contents';
144
+ element.append(container);
145
+ const stop = (event) => {
146
+ event.stopPropagation();
147
+ };
148
+ for (const type of isolatedEvents) {
149
+ element.addEventListener(type, stop);
150
+ }
151
+ document.body.append(element);
152
+ host = element;
153
+ return {
154
+ container,
155
+ unmount() {
156
+ for (const type of isolatedEvents) {
157
+ element.removeEventListener(type, stop);
158
+ }
159
+ element.remove();
160
+ if (host === element) {
161
+ host = undefined;
162
+ }
163
+ clearOccluderCache();
164
+ },
165
+ };
166
+ },
167
+ };
168
+ }
169
+ //# sourceMappingURL=web-platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-platform.js","sourceRoot":"","sources":["../../../src/react-platform/dom/web-platform.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAC,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAWhD;;;;;GAKG;AACH,MAAM,cAAc,GAAG;IACrB,aAAa;IACb,WAAW;IACX,WAAW;IACX,SAAS;IACT,YAAY;IACZ,UAAU;IACV,OAAO;IACP,UAAU;IACV,UAAU;IACV,aAAa;IACb,SAAS;IACT,UAAU;IACV,SAAS;IACT,OAAO;CACC,CAAC;AAEX,6HAA6H;AAC7H,MAAM,eAAe,GAAG,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC,CAAC;AAE1D,SAAS,cAAc,CAAC,OAAgB,EAAE,IAAyB;IACjE,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACjB,OAAO,EAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAC,CAAC;IACjE,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACpD,OAAO,EA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;YAChD,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC;YACrC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC1B,MAAM,IAAI,GAAG,CAAC,KAAY,EAAQ,EAAE;gBAClC,KAAK,CAAC,eAAe,EAAE,CAAC;YAC1B,CAAC,CAAC;YAEF,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;gBAClC,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACvC,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC9B,IAAI,GAAG,OAAO,CAAC;YACf,OAAO;gBACL,SAAS;gBACT,OAAO;oBACL,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;wBAClC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBAC1C,CAAC;oBAED,OAAO,CAAC,MAAM,EAAE,CAAC;oBACjB,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;wBACrB,IAAI,GAAG,SAAS,CAAC;oBACnB,CAAC;oBAED,kBAAkB,EAAE,CAAC;gBACvB,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Styles of the web tour layer. Everything is scoped to `rtk-` classes. Theme values arrive as
3
+ * CSS variables set on `.rtk-root`. All rules live in a cascade layer, so the app's own CSS wins
4
+ * over them without `!important` — except for the few properties marked `!important` here: what
5
+ * keeps the tour in place, clickable and readable, which global resets (Tailwind's preflight,
6
+ * normalize.css, Bootstrap, `dialog {…}` or `button {…}` rules) would otherwise change. Those
7
+ * still follow the CSS variables.
8
+ */
9
+ export declare const tourCss = "\n@layer react-tour-kit {\n:where(.rtk-root) {\n --rtk-primary: #2563eb;\n --rtk-on-primary: #ffffff;\n --rtk-bg: #ffffff;\n --rtk-title: #111827;\n --rtk-text: #4b5563;\n --rtk-overlay: rgba(0, 0, 0, 0.5);\n --rtk-radius: 12px;\n --rtk-spotlight-radius: 8px;\n --rtk-ease: cubic-bezier(0.2, 0, 0, 1);\n --rtk-z-index: 2147483000;\n}\n\n.rtk-root {\n position: fixed !important;\n inset: 0 !important;\n box-sizing: border-box !important;\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n background: transparent !important;\n color: var(--rtk-text);\n overflow: visible !important;\n outline: none;\n transform: none !important;\n filter: none !important;\n /* The page may have disabled pointer events on <body> (modal libraries do while open). */\n pointer-events: auto !important;\n z-index: var(--rtk-z-index) !important;\n opacity: 0 !important;\n transition: opacity var(--rtk-fade-duration, 200ms) var(--rtk-ease);\n}\n.rtk-root::backdrop { background: transparent !important; backdrop-filter: none !important; }\n.rtk-root[data-visible] { opacity: 1 !important; }\n\n.rtk-backdrop { position: fixed !important; inset: 0 !important; touch-action: pinch-zoom; }\n.rtk-backdrop[data-closable] { cursor: pointer; }\n\n.rtk-spotlight {\n /* Its geometry is set inline, which an `!important` rule here would override. */\n position: fixed !important;\n right: auto;\n bottom: auto;\n margin: 0 !important;\n box-sizing: border-box !important;\n padding: 0 !important;\n border: 0 !important;\n pointer-events: none !important;\n border-radius: var(--rtk-spotlight-radius);\n box-shadow: 0 0 0 2px var(--rtk-primary), 0 0 0 200vmax var(--rtk-overlay);\n box-shadow: 0 0 0 2px var(--rtk-primary), 0 0 0 6px color-mix(in srgb, var(--rtk-primary) 30%, transparent), 0 0 0 200vmax var(--rtk-overlay);\n}\n.rtk-spotlight[data-collapsed] { box-shadow: 0 0 0 200vmax var(--rtk-overlay); }\n\n.rtk-tooltip {\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n box-sizing: border-box;\n display: flow-root;\n outline: none;\n overflow: visible;\n transform-origin: var(--rtk-origin, center);\n}\n.rtk-tooltip[data-overflowing] { overflow: auto; overscroll-behavior: contain; }\n.rtk-tooltip[data-hidden] { visibility: hidden; }\n.rtk-tooltip[data-entering] {\n animation: rtk-enter var(--rtk-enter-duration, 200ms) var(--rtk-ease) var(--rtk-enter-delay, 0ms) both;\n}\n.rtk-measure {\n position: fixed !important;\n top: 0 !important;\n left: 0 !important;\n visibility: hidden !important;\n pointer-events: none !important;\n box-sizing: border-box;\n display: flow-root;\n}\n\n.rtk-card {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 380px;\n max-width: 100%;\n max-height: var(--rtk-max-height, none);\n border-radius: var(--rtk-radius);\n background: var(--rtk-bg);\n color: var(--rtk-text);\n box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.35), 0 4px 12px -6px rgba(15, 23, 42, 0.2);\n font-size: 14px;\n line-height: 1.5;\n text-align: start;\n}\n.rtk-arrow {\n position: absolute;\n width: 10px;\n height: 10px;\n background: var(--rtk-bg);\n transform: rotate(45deg);\n}\n.rtk-arrow[data-side=\"bottom\"] { top: -5px; left: calc(var(--rtk-arrow-offset) - 5px); }\n.rtk-arrow[data-side=\"top\"] { bottom: -5px; left: calc(var(--rtk-arrow-offset) - 5px); }\n.rtk-arrow[data-side=\"right\"] { left: -5px; top: calc(var(--rtk-arrow-offset) - 5px); }\n.rtk-arrow[data-side=\"left\"] { right: -5px; top: calc(var(--rtk-arrow-offset) - 5px); }\n\n.rtk-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 12px 8px 0 16px;\n}\n.rtk-counter {\n border-radius: 999px;\n padding: 2px 10px;\n background: var(--rtk-primary);\n color: var(--rtk-on-primary);\n font-size: 12px;\n font-weight: 600;\n line-height: 1.6;\n font-variant-numeric: tabular-nums;\n}\n.rtk-close {\n position: relative;\n display: grid;\n place-items: center;\n box-sizing: border-box !important;\n width: 32px !important;\n height: 32px !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n border-radius: 8px;\n background: transparent !important;\n color: var(--rtk-text) !important;\n cursor: pointer;\n}\n.rtk-close::before, .rtk-button--prev::before {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: inherit;\n background: currentColor;\n opacity: 0;\n transition: opacity 120ms;\n}\n.rtk-close:hover::before { opacity: 0.1; }\n.rtk-body {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n padding: 8px 16px 16px;\n}\n.rtk-title { margin: 0 0 4px; color: var(--rtk-title); font-size: 17px; font-weight: 600; line-height: 1.35; }\n.rtk-content { margin: 0; overflow-wrap: anywhere; }\n.rtk-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 0 16px 16px;\n}\n.rtk-button {\n position: relative;\n box-sizing: border-box !important;\n min-height: 36px !important;\n margin: 0 !important;\n padding: 8px 14px !important;\n border: 0 !important;\n border-radius: 8px;\n font-family: inherit;\n font-size: 14px !important;\n font-weight: 500 !important;\n line-height: 1.4 !important;\n cursor: pointer;\n white-space: nowrap;\n}\n.rtk-button--prev { background: transparent !important; color: var(--rtk-text) !important; }\n.rtk-button--prev::before { opacity: 0.08; }\n.rtk-button--prev:hover:not(:disabled)::before { opacity: 0.14; }\n.rtk-button--next { background: var(--rtk-primary) !important; color: var(--rtk-on-primary) !important; }\n.rtk-button--next:hover { filter: brightness(1.08); }\n.rtk-button:disabled { cursor: default; opacity: 0.4; }\n.rtk-dots { display: flex; align-items: center; justify-content: center; min-width: 0; }\n.rtk-dot, .rtk-ellipsis {\n position: relative;\n display: grid;\n place-items: center;\n box-sizing: border-box !important;\n width: 24px !important;\n height: 24px !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n background: transparent !important;\n color: var(--rtk-text) !important;\n}\n.rtk-dot { cursor: pointer; border-radius: 50%; }\n.rtk-dot::before {\n content: '';\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.3;\n transition: opacity 150ms, transform 150ms;\n}\n.rtk-dot[aria-current=\"step\"] { color: var(--rtk-primary) !important; }\n.rtk-dot[aria-current=\"step\"]::before { opacity: 1; transform: scale(1.15); }\n.rtk-ellipsis::before { content: '\u2026'; opacity: 0.5; font-size: 12px; letter-spacing: 1px; }\n.rtk-close:focus-visible, .rtk-button:focus-visible, .rtk-dot:focus-visible {\n outline: 2px solid var(--rtk-primary);\n outline-offset: 2px;\n}\n.rtk-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* Position uses the individual `translate` property (applied first), the entrance uses `transform`,\n so scaling happens around the tooltip's own centre and never moves its position. Durations,\n offsets and reduced motion come from the shared motion settings, as variables. */\n@keyframes rtk-enter {\n from {\n opacity: 0;\n transform: translate(var(--rtk-enter-x, 0), var(--rtk-enter-y, 0)) scale(var(--rtk-enter-scale, 1));\n }\n}\n\n@media (forced-colors: active) {\n .rtk-spotlight { outline: 3px solid Highlight; }\n .rtk-card { border: 1px solid CanvasText; }\n /* Without backgrounds, a border is what shows a button is one. */\n .rtk-button { border: 1px solid ButtonText !important; }\n .rtk-button:disabled { border-color: GrayText !important; }\n .rtk-dot::before { background: CanvasText; }\n .rtk-dot[aria-current=\"step\"]::before { background: Highlight; }\n}\n}\n";
10
+ /** Adds the stylesheet to a document once. Constructable stylesheets are not subject to CSP `style-src` restrictions. */
11
+ export declare function injectTourStyles(document_: Document): void;
12
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/react-platform/layer/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,i+PAgQnB,CAAC;AAIF,yHAAyH;AACzH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,QAAQ,GAAG,IAAI,CAgB1D"}