@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
@@ -1,84 +0,0 @@
1
- import { targetRegistry } from './target-registry';
2
- function resolveTarget(target) {
3
- if (typeof target === 'string') {
4
- return targetRegistry.get(target);
5
- }
6
- return target;
7
- }
8
- async function measureNativeElement(ref) {
9
- return new Promise((resolve) => {
10
- const component = ref.current;
11
- if (!component) {
12
- resolve(undefined);
13
- return;
14
- }
15
- const measureable = component;
16
- if (typeof measureable.measure !== 'function') {
17
- resolve(undefined);
18
- return;
19
- }
20
- measureable.measure((_x, _y, width, height, pageX, pageY) => {
21
- resolve({
22
- top: pageY,
23
- left: pageX,
24
- width,
25
- height,
26
- bottom: pageY + height,
27
- right: pageX + width,
28
- });
29
- });
30
- });
31
- }
32
- export const nativePlatformAdapter = {
33
- async measureElement(target) {
34
- const ref = resolveTarget(target);
35
- if (!ref) {
36
- return undefined;
37
- }
38
- return measureNativeElement(ref);
39
- },
40
- measureTooltip() {
41
- return { width: 0, height: 0 };
42
- },
43
- getViewportDimensions() {
44
- const { Dimensions } = require('react-native');
45
- const { width, height } = Dimensions.get('window');
46
- return { width, height };
47
- },
48
- async scrollToElement(_target, _placement, _tooltipHeight) {
49
- await Promise.resolve();
50
- },
51
- subscribeToKeyboard(handlers) {
52
- const { BackHandler, Platform } = require('react-native');
53
- if (Platform.OS === 'android') {
54
- const backHandler = () => {
55
- handlers.onEscape();
56
- return true;
57
- };
58
- const subscription = BackHandler.addEventListener('hardwareBackPress', backHandler);
59
- return () => {
60
- subscription.remove();
61
- };
62
- }
63
- return () => {
64
- };
65
- },
66
- subscribeToLayout(callback) {
67
- const { Dimensions } = require('react-native');
68
- const subscription = Dimensions.addEventListener('change', callback);
69
- return () => {
70
- subscription.remove();
71
- };
72
- },
73
- scheduleFrame(callback) {
74
- return requestAnimationFrame(callback);
75
- },
76
- cancelFrame(id) {
77
- cancelAnimationFrame(id);
78
- },
79
- findElement(target) {
80
- const ref = resolveTarget(target);
81
- return ref?.current ?? undefined;
82
- },
83
- };
84
- //# sourceMappingURL=platform-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-adapter.js","sourceRoot":"","sources":["../../src/react-native-platform/platform-adapter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAMjD,SAAS,aAAa,CAAC,MAA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C,CAAC;IAED,WAAW,CAAC,EAAU;QACpB,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,WAAW,CAAC,MAAkB;QAC5B,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,GAAG,EAAE,OAAO,IAAI,SAAS,CAAC;IACnC,CAAC;CACF,CAAC"}
@@ -1,10 +0,0 @@
1
- import { type RefObject } from 'react';
2
- declare class TargetRegistry {
3
- private readonly targets;
4
- register(id: string, ref: RefObject<unknown>): void;
5
- unregister(id: string): void;
6
- get(id: string): RefObject<unknown> | undefined;
7
- clear(): void;
8
- }
9
- export declare const targetRegistry: TargetRegistry;
10
- export {};
@@ -1,17 +0,0 @@
1
- class TargetRegistry {
2
- targets = new Map();
3
- register(id, ref) {
4
- this.targets.set(id, ref);
5
- }
6
- unregister(id) {
7
- this.targets.delete(id);
8
- }
9
- get(id) {
10
- return this.targets.get(id);
11
- }
12
- clear() {
13
- this.targets.clear();
14
- }
15
- }
16
- export const targetRegistry = new TargetRegistry();
17
- //# sourceMappingURL=target-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"target-registry.js","sourceRoot":"","sources":["../../src/react-native-platform/target-registry.ts"],"names":[],"mappings":"AAMA,MAAM,cAAc;IACD,OAAO,GAAG,IAAI,GAAG,EAA8B,CAAC;IAOjE,QAAQ,CAAC,EAAU,EAAE,GAAuB;QAC1C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;IAMD,UAAU,CAAC,EAAU;QACnB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAOD,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAKD,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF;AAMD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -1,12 +0,0 @@
1
- import { type ComponentType, type ReactNode } from 'react';
2
- import { type PlatformAdapter, type TourEndCallback, type TourI18n, type TourOverlayProps, type TourTheme, type TourTooltipProps } from '../../shared';
3
- export type TourProviderProps = {
4
- readonly children: ReactNode;
5
- readonly TooltipComponent?: ComponentType<TourTooltipProps>;
6
- readonly OverlayComponent?: ComponentType<TourOverlayProps>;
7
- readonly onTourEnd?: TourEndCallback;
8
- readonly theme?: TourTheme;
9
- readonly platform?: PlatformAdapter;
10
- readonly i18n?: TourI18n;
11
- readonly closeOnOverlayClick?: boolean;
12
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tour-provider.props.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tour-provider.props.type.js","sourceRoot":"","sources":["../../../src/react-native-platform/types/tour-provider.props.type.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { TourOverlay } from './tour-overlay';
2
- export { TourTooltip } from './tour-tooltip';
@@ -1,3 +0,0 @@
1
- export { TourOverlay } from './tour-overlay';
2
- export { TourTooltip } from './tour-tooltip';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react-platform/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type JSX } from 'react';
2
- import { type TourOverlayProps } from '../../shared';
3
- export declare function TourOverlay({ highlightRect, onClose, theme, closeOnOverlayClick }: TourOverlayProps): JSX.Element;
@@ -1,29 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- const highlightPadding = 8;
4
- const borderRadius = 8;
5
- export function TourOverlay({ highlightRect, onClose, theme, closeOnOverlayClick }) {
6
- const primaryColorRgba = `${theme.primaryColor}4D`;
7
- return (_jsxs("div", { style: {
8
- position: 'fixed',
9
- inset: 0,
10
- zIndex: 9998,
11
- cursor: closeOnOverlayClick ? 'pointer' : 'default',
12
- }, onClick: closeOnOverlayClick ? onClose : undefined, children: [_jsxs("svg", { style: {
13
- position: 'absolute',
14
- inset: 0,
15
- height: '100%',
16
- width: '100%',
17
- }, children: [_jsx("defs", { children: _jsxs("mask", { id: "tour-mask", children: [_jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }), _jsx("rect", { x: highlightRect.left - highlightPadding, y: highlightRect.top - highlightPadding, width: highlightRect.width + highlightPadding * 2, height: highlightRect.height + highlightPadding * 2, rx: borderRadius, fill: "black" })] }) }), _jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: theme.overlayColor, mask: "url(#tour-mask)" })] }), _jsx("div", { style: {
18
- position: 'absolute',
19
- borderRadius: '8px',
20
- border: `2px solid ${theme.primaryColor}`,
21
- boxShadow: `0 0 0 4px ${primaryColorRgba}`,
22
- pointerEvents: 'none',
23
- top: highlightRect.top - highlightPadding,
24
- left: highlightRect.left - highlightPadding,
25
- width: highlightRect.width + highlightPadding * 2,
26
- height: highlightRect.height + highlightPadding * 2,
27
- } })] }));
28
- }
29
- //# sourceMappingURL=tour-overlay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tour-overlay.js","sourceRoot":"","sources":["../../../src/react-platform/components/tour-overlay.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,MAAM,UAAU,WAAW,CAAC,EAAC,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAmB;IAEhG,MAAM,gBAAgB,GAAG,GAAG,KAAK,CAAC,YAAY,IAAI,CAAC;IAEnD,OAAO,CACL,eAC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G,GAAG,gBAAgB;oBACzC,IAAI,EAAE,aAAa,CAAC,IAAI,GAAG,gBAAgB;oBAC3C,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,gBAAgB,GAAG,CAAC;oBACjD,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,gBAAgB,GAAG,CAAC;iBACpD,GACD,IACE,CACP,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type TourTooltipProps } from '../../shared';
2
- export declare const TourTooltip: import("react").ForwardRefExoticComponent<TourTooltipProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,155 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef } from 'react';
4
- import { getTruncatedDots, DOTS_CONTAINER_WIDTH, DOT_SIZE, DOT_GAP } from '../../shared/utils';
5
- const defaultI18n = {
6
- nextLabel: 'Next',
7
- prevLabel: 'Back',
8
- finishLabel: 'Finish',
9
- stepCounterTemplate: '{current} / {total}',
10
- closeAriaLabel: 'Close tour',
11
- dotAriaLabelTemplate: 'Go to step {step}',
12
- };
13
- function TourTooltipComponent({ title, content, currentStep, totalSteps, position, isPositioned, onClose, onNext, onPrev, onGoToStep, theme, i18n, }, ref) {
14
- const { nextLabel, prevLabel, finishLabel, stepCounterTemplate, closeAriaLabel, dotAriaLabelTemplate } = {
15
- ...defaultI18n,
16
- ...i18n,
17
- };
18
- const isLastStep = currentStep === totalSteps - 1;
19
- const isFirstStep = currentStep === 0;
20
- const styles = {
21
- container: {
22
- position: 'fixed',
23
- zIndex: 9999,
24
- width: '400px',
25
- maxWidth: 'calc(100vw - 2rem)',
26
- },
27
- card: {
28
- backgroundColor: theme.tooltipBackground,
29
- borderRadius: '8px',
30
- boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
31
- overflow: 'hidden',
32
- },
33
- header: {
34
- display: 'flex',
35
- alignItems: 'center',
36
- justifyContent: 'space-between',
37
- padding: '16px 16px 0 16px',
38
- },
39
- stepTag: {
40
- backgroundColor: theme.primaryColor,
41
- color: 'white',
42
- padding: '4px 8px',
43
- borderRadius: '4px',
44
- fontSize: '12px',
45
- fontWeight: 600,
46
- },
47
- closeButton: {
48
- background: 'none',
49
- border: 'none',
50
- cursor: 'pointer',
51
- padding: '8px',
52
- borderRadius: '50%',
53
- color: theme.contentColor,
54
- fontSize: '16px',
55
- },
56
- body: {
57
- padding: '16px',
58
- },
59
- title: {
60
- margin: '0 0 8px 0',
61
- fontSize: '18px',
62
- fontWeight: 600,
63
- color: theme.titleColor,
64
- },
65
- content: {
66
- margin: 0,
67
- fontSize: '14px',
68
- color: theme.contentColor,
69
- lineHeight: 1.5,
70
- },
71
- footer: {
72
- display: 'flex',
73
- alignItems: 'center',
74
- justifyContent: 'space-between',
75
- padding: '0 16px 16px 16px',
76
- },
77
- navButton: {
78
- background: 'none',
79
- border: 'none',
80
- cursor: 'pointer',
81
- padding: '8px 16px',
82
- borderRadius: '4px',
83
- fontSize: '14px',
84
- color: theme.contentColor,
85
- },
86
- navButtonDisabled: {
87
- opacity: 0.5,
88
- cursor: 'not-allowed',
89
- },
90
- nextButton: {
91
- backgroundColor: theme.primaryColor,
92
- color: 'white',
93
- border: 'none',
94
- cursor: 'pointer',
95
- padding: '8px 16px',
96
- borderRadius: '4px',
97
- fontSize: '14px',
98
- fontWeight: 500,
99
- },
100
- dotsContainer: {
101
- display: 'flex',
102
- gap: `${DOT_GAP}px`,
103
- width: `${DOTS_CONTAINER_WIDTH}px`,
104
- justifyContent: 'center',
105
- alignItems: 'center',
106
- },
107
- dot: {
108
- width: `${DOT_SIZE}px`,
109
- height: `${DOT_SIZE}px`,
110
- borderRadius: '50%',
111
- border: 'none',
112
- cursor: 'pointer',
113
- padding: 0,
114
- flexShrink: 0,
115
- },
116
- dotActive: {
117
- backgroundColor: theme.primaryColor,
118
- },
119
- dotInactive: {
120
- backgroundColor: '#d1d5db',
121
- },
122
- ellipsis: {
123
- width: `${DOT_SIZE}px`,
124
- height: `${DOT_SIZE}px`,
125
- display: 'flex',
126
- alignItems: 'center',
127
- justifyContent: 'center',
128
- gap: '2px',
129
- flexShrink: 0,
130
- },
131
- ellipsisDot: {
132
- width: '3px',
133
- height: '3px',
134
- borderRadius: '50%',
135
- backgroundColor: '#d1d5db',
136
- },
137
- };
138
- return (_jsx("div", { ref: ref, style: {
139
- ...styles.container,
140
- top: `${position.top}px`,
141
- left: `${position.left}px`,
142
- opacity: isPositioned ? 1 : 0,
143
- pointerEvents: isPositioned ? 'auto' : 'none',
144
- }, children: _jsxs("div", { style: styles.card, children: [_jsxs("div", { style: styles.header, children: [_jsx("span", { style: styles.stepTag, children: stepCounterTemplate.replace('{current}', String(currentStep + 1)).replace('{total}', String(totalSteps)) }), _jsx("button", { type: "button", style: styles.closeButton, "aria-label": closeAriaLabel, onClick: onClose, children: "\u2715" })] }), _jsxs("div", { style: styles.body, children: [_jsx("h3", { style: styles.title, children: title }), _jsx("p", { style: styles.content, children: content })] }), _jsxs("div", { style: styles.footer, children: [_jsx("button", { type: "button", style: {
145
- ...styles.navButton,
146
- ...(isFirstStep ? styles.navButtonDisabled : {}),
147
- }, disabled: isFirstStep, onClick: onPrev, children: prevLabel }), _jsx("div", { style: styles.dotsContainer, children: getTruncatedDots(currentStep, totalSteps).map((item, i) => item.type === 'ellipsis' ? (_jsxs("span", { style: styles.ellipsis, children: [_jsx("span", { style: styles.ellipsisDot }), _jsx("span", { style: styles.ellipsisDot })] }, `ellipsis-${i}`)) : (_jsx("button", { type: "button", style: {
148
- ...styles.dot,
149
- ...(item.index === currentStep ? styles.dotActive : styles.dotInactive),
150
- }, "aria-label": dotAriaLabelTemplate.replace('{step}', String(item.index + 1)), onClick: () => {
151
- onGoToStep(item.index);
152
- } }, `step-${item.index}`))) }), _jsx("button", { type: "button", style: styles.nextButton, onClick: onNext, children: isLastStep ? finishLabel : nextLabel })] })] }) }));
153
- }
154
- export const TourTooltip = forwardRef(TourTooltipComponent);
155
- //# sourceMappingURL=tour-tooltip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tour-tooltip.js","sourceRoot":"","sources":["../../../src/react-platform/components/tour-tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAA8B,UAAU,EAAC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE7F,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,QAAQ;IACrB,mBAAmB,EAAE,qBAAqB;IAC1C,cAAc,EAAE,YAAY;IAC5B,oBAAoB,EAAE,mBAAmB;CAC1C,CAAC;AAEF,SAAS,oBAAoB,CAC3B,EACE,KAAK,EACL,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,MAAM,EACN,MAAM,EACN,UAAU,EACV,KAAK,EACL,IAAI,GACa,EACnB,GAAiC;IAEjC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAC,GAAG;QACrG,GAAG,WAAW;QACd,GAAG,IAAI;KACR,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,KAAK,UAAU,GAAG,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,WAAW,KAAK,CAAC,CAAC;IAEtC,MAAM,MAAM,GAAG;QACb,SAAS,EAAE;YACT,QAAQ,EAAE,OAAgB;YAC1B,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,oBAAoB;SAC/B;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,KAAK,CAAC,iBAAiB;YACxC,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,uCAAuC;YAClD,QAAQ,EAAE,QAAQ;SACnB;QACD,MAAM,EAAE;YACN,OAAO,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M,CAAC,WAAW,GAAI,EACnC,eAAM,KAAK,EAAE,MAAM,CAAC,WAAW,GAAI,KAF1B,YAAY,CAAC,EAAE,CAGnB,CACR,CAAC,CAAC,CAAC,CACF,iBAEE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE;oCACL,GAAG,MAAM,CAAC,GAAG;oCACb,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;iCACxE,gBACW,oBAAoB,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAC1E,OAAO,EAAE,GAAG,EAAE;oCACZ,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gCACzB,CAAC,IATI,QAAQ,IAAI,CAAC,KAAK,EAAE,CAUzB,CACH,CACF,GACG,EAEN,iBAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,YAC5D,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,GAC9B,IACL,IACF,GACF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export { TourProvider } from './tour-provider';
2
- export type { TourProviderProps } from './types/tour-provider.props.type';
3
- export { TourOverlay } from './components/tour-overlay';
4
- export { TourTooltip } from './components/tour-tooltip';
5
- export { webPlatformAdapter } from './platform-adapter';
6
- export { findVisibleElement } from './utils';
@@ -1,6 +0,0 @@
1
- export { TourProvider } from './tour-provider';
2
- export { TourOverlay } from './components/tour-overlay';
3
- export { TourTooltip } from './components/tour-tooltip';
4
- export { webPlatformAdapter } from './platform-adapter';
5
- export { findVisibleElement } from './utils';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-platform/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAItD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type PlatformAdapter } from '../shared';
2
- export declare const webPlatformAdapter: PlatformAdapter;
@@ -1,101 +0,0 @@
1
- import { findVisibleElement } from './utils';
2
- function domRectToRect(domRect) {
3
- return {
4
- top: domRect.top,
5
- left: domRect.left,
6
- width: domRect.width,
7
- height: domRect.height,
8
- bottom: domRect.bottom,
9
- right: domRect.right,
10
- };
11
- }
12
- export const webPlatformAdapter = {
13
- async measureElement(target) {
14
- if (typeof target !== 'string') {
15
- const element = target.current;
16
- if (!element) {
17
- return undefined;
18
- }
19
- return domRectToRect(element.getBoundingClientRect());
20
- }
21
- const element = findVisibleElement(target);
22
- if (!element) {
23
- return undefined;
24
- }
25
- return domRectToRect(element.getBoundingClientRect());
26
- },
27
- measureTooltip(ref) {
28
- const element = ref.current;
29
- return {
30
- width: element?.offsetWidth ?? 0,
31
- height: element?.offsetHeight ?? 0,
32
- };
33
- },
34
- getViewportDimensions() {
35
- return {
36
- width: window.innerWidth,
37
- height: window.innerHeight,
38
- };
39
- },
40
- async scrollToElement(target, placement, tooltipHeight) {
41
- const element = typeof target === 'string' ? findVisibleElement(target) : target.current;
42
- if (element) {
43
- const rect = element.getBoundingClientRect();
44
- const padding = 16;
45
- const tooltipSpace = (tooltipHeight ?? 200) + padding * 2;
46
- const targetScrollY = placement === 'top' || placement === 'left' || placement === 'right'
47
- ? window.scrollY + rect.top - tooltipSpace
48
- : window.scrollY + rect.top - padding;
49
- window.scrollTo({
50
- top: Math.max(0, targetScrollY),
51
- behavior: 'smooth',
52
- });
53
- }
54
- },
55
- subscribeToKeyboard(handlers) {
56
- const handleKeyDown = (event) => {
57
- switch (event.key) {
58
- case 'Escape': {
59
- handlers.onEscape();
60
- break;
61
- }
62
- case 'ArrowRight': {
63
- handlers.onNext();
64
- break;
65
- }
66
- case 'ArrowLeft': {
67
- handlers.onPrev();
68
- break;
69
- }
70
- default: {
71
- break;
72
- }
73
- }
74
- };
75
- globalThis.addEventListener('keydown', handleKeyDown);
76
- return () => {
77
- globalThis.removeEventListener('keydown', handleKeyDown);
78
- };
79
- },
80
- subscribeToLayout(callback) {
81
- window.addEventListener('resize', callback);
82
- window.addEventListener('scroll', callback, true);
83
- return () => {
84
- window.removeEventListener('resize', callback);
85
- window.removeEventListener('scroll', callback, true);
86
- };
87
- },
88
- scheduleFrame(callback) {
89
- return requestAnimationFrame(callback);
90
- },
91
- cancelFrame(id) {
92
- cancelAnimationFrame(id);
93
- },
94
- findElement(target) {
95
- if (typeof target === 'string') {
96
- return findVisibleElement(target);
97
- }
98
- return target.current ?? undefined;
99
- },
100
- };
101
- //# sourceMappingURL=platform-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-adapter.js","sourceRoot":"","sources":["../../src/react-platform/platform-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAK3C,SAAS,aAAa,CAAC,OAAgB;IACrC,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC;AAKD,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,KAAK,CAAC,cA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AAC;QAElD,OAAO,GAAS,EAAE;YAChB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC/C,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,QAAoB;QAChC,OAAO,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,EAAU;QACpB,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,WAAW,CAAC,MAAkB;QAC5B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAGD,OAAQ,MAA6B,CAAC,OAAO,IAAI,SAAS,CAAC;IAC7D,CAAC;CACF,CAAC"}
@@ -1,12 +0,0 @@
1
- import { type ComponentType, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from 'react';
2
- import { type PlatformAdapter, type TourEndCallback, type TourI18n, type TourOverlayProps, type TourTheme, type TourTooltipProps } from '../../shared';
3
- export type TourProviderProps = {
4
- readonly children: ReactNode;
5
- readonly TooltipComponent?: ForwardRefExoticComponent<TourTooltipProps & RefAttributes<HTMLDivElement>>;
6
- readonly OverlayComponent?: ComponentType<TourOverlayProps>;
7
- readonly onTourEnd?: TourEndCallback;
8
- readonly theme?: TourTheme;
9
- readonly platform?: PlatformAdapter;
10
- readonly i18n?: TourI18n;
11
- readonly closeOnOverlayClick?: boolean;
12
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tour-provider.props.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tour-provider.props.type.js","sourceRoot":"","sources":["../../../src/react-platform/types/tour-provider.props.type.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export declare function findVisibleElement(selector: string): Element | undefined;
@@ -1,11 +0,0 @@
1
- export function findVisibleElement(selector) {
2
- const allMatches = document.querySelectorAll(selector);
3
- for (const element of allMatches) {
4
- const rect = element.getBoundingClientRect();
5
- if (rect.width > 0 && rect.height > 0) {
6
- return element;
7
- }
8
- }
9
- return allMatches[0] ?? null;
10
- }
11
- //# sourceMappingURL=find-visible-element.util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-visible-element.util.js","sourceRoot":"","sources":["../../../src/react-platform/utils/find-visible-element.util.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,MAAM,UAAU,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEvD,KAAK,MAAM,OAAO,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC/B,CAAC"}
@@ -1 +0,0 @@
1
- export { findVisibleElement } from './find-visible-element.util';
@@ -1,2 +0,0 @@
1
- export { findVisibleElement } from './find-visible-element.util';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react-platform/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC"}
@@ -1 +0,0 @@
1
- export { TourContext, defaultTourContext } from './tour-context';
@@ -1,2 +0,0 @@
1
- export { TourContext, defaultTourContext } from './tour-context';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type TourContextType } from '../types';
2
- export declare const defaultTourContext: TourContextType;
3
- export declare const TourContext: import("react").Context<TourContextType>;
@@ -1,14 +0,0 @@
1
- import { createContext } from 'react';
2
- export const defaultTourContext = {
3
- isActive: false,
4
- currentStep: 0,
5
- steps: [],
6
- currentTourId: undefined,
7
- startTour() { },
8
- endTour() { },
9
- nextStep() { },
10
- prevStep() { },
11
- goToStep() { },
12
- };
13
- export const TourContext = createContext(defaultTourContext);
14
- //# sourceMappingURL=tour-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tour-context.js","sourceRoot":"","sources":["../../../src/shared/context/tour-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAOpC,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,CAAC;IACd,KAAK,EAAE,EAAE;IACT,aAAa,EAAE,SAAS;IAExB,SAAS,KAAI,CAAC;IAEd,OAAO,KAAI,CAAC;IAEZ,QAAQ,KAAI,CAAC;IAEb,QAAQ,KAAI,CAAC;IAEb,QAAQ,KAAI,CAAC;CACd,CAAC;AAOF,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export { useTour } from './use-tour.hook';
@@ -1,2 +0,0 @@
1
- export { useTour } from './use-tour.hook';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type TourContextType } from '../types';
2
- export declare function useTour(): TourContextType;
@@ -1,7 +0,0 @@
1
- 'use client';
2
- import { use } from 'react';
3
- import { TourContext } from '../context';
4
- export function useTour() {
5
- return use(TourContext);
6
- }
7
- //# sourceMappingURL=use-tour.hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-tour.hook.js","sourceRoot":"","sources":["../../../src/shared/hooks/use-tour.hook.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AAGvC,MAAM,UAAU,OAAO;IACrB,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,7 +0,0 @@
1
- export type { Rect, TourTarget, Placement, PlatformAdapter, KeyboardHandlers, TourTheme, TourStep, TourContextType, TourOverlayProps, TourTooltipProps, TourI18n, TourEndReason, TourEndInfo, TourEndCallback, StartTourOptions, } from './types';
2
- export { defaultTheme, resolveTheme } from './types';
3
- export { TourContext, defaultTourContext } from './context';
4
- export { useTour } from './hooks';
5
- export { calculateTooltipPosition } from './utils';
6
- export { getTruncatedDots, MAX_VISIBLE_DOTS, DOT_SIZE, DOT_GAP, DOTS_CONTAINER_WIDTH } from './utils';
7
- export type { DotItem } from './utils';