vevet 3.19.2 → 4.0.0-beta.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 (714) hide show
  1. package/README.md +81 -18
  2. package/lib/cjs/{Application → Vevet}/events/createOnPageLoad/index.js +7 -7
  3. package/lib/cjs/Vevet/events/createOnPageLoad/index.js.map +1 -0
  4. package/lib/cjs/Vevet/events/createOnPageLoad/types.js.map +1 -0
  5. package/lib/cjs/{Application → Vevet}/events/createViewport/index.js +19 -25
  6. package/lib/cjs/Vevet/events/createViewport/index.js.map +1 -0
  7. package/lib/cjs/Vevet/events/createViewport/types.js.map +1 -0
  8. package/lib/cjs/Vevet/exported.js +3 -0
  9. package/lib/cjs/Vevet/exported.js.map +1 -0
  10. package/lib/cjs/Vevet/global.js +3 -0
  11. package/lib/cjs/Vevet/global.js.map +1 -0
  12. package/lib/cjs/Vevet/index.js +94 -0
  13. package/lib/cjs/Vevet/index.js.map +1 -0
  14. package/lib/cjs/{Application → Vevet}/types.js.map +1 -1
  15. package/lib/cjs/{utils/internal → Vevet/utils}/fetchWebpSupport.js +1 -1
  16. package/lib/cjs/Vevet/utils/fetchWebpSupport.js.map +1 -0
  17. package/lib/cjs/Vevet/utils/getDeviceInfo.js.map +1 -0
  18. package/lib/cjs/base/Callbacks/index.js +65 -48
  19. package/lib/cjs/base/Callbacks/index.js.map +1 -1
  20. package/lib/cjs/base/Component/index.js +15 -4
  21. package/lib/cjs/base/Component/index.js.map +1 -1
  22. package/lib/cjs/base/Module/index.js +118 -64
  23. package/lib/cjs/base/Module/index.js.map +1 -1
  24. package/lib/cjs/base/MutableProps/index.js +30 -55
  25. package/lib/cjs/base/MutableProps/index.js.map +1 -1
  26. package/lib/cjs/base/Plugin/index.js +20 -1
  27. package/lib/cjs/base/Plugin/index.js.map +1 -1
  28. package/lib/cjs/components/AnimationFrame/index.js +14 -21
  29. package/lib/cjs/components/AnimationFrame/index.js.map +1 -1
  30. package/lib/cjs/components/Ctx2D/index.js +40 -25
  31. package/lib/cjs/components/Ctx2D/index.js.map +1 -1
  32. package/lib/cjs/components/Ctx2DPrerender/index.js +17 -7
  33. package/lib/cjs/components/Ctx2DPrerender/index.js.map +1 -1
  34. package/lib/cjs/components/CustomCursor/index.js +75 -51
  35. package/lib/cjs/components/CustomCursor/index.js.map +1 -1
  36. package/lib/cjs/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js +2 -2
  37. package/lib/cjs/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js.map +1 -1
  38. package/lib/cjs/components/{SmoothScroll → CustomScroll}/Elements.js +9 -9
  39. package/lib/cjs/components/{SmoothScroll → CustomScroll}/Elements.js.map +1 -1
  40. package/lib/cjs/components/{SmoothScroll → CustomScroll}/index.js +72 -66
  41. package/lib/cjs/components/CustomScroll/index.js.map +1 -0
  42. package/lib/cjs/components/CustomScroll/types.js.map +1 -0
  43. package/lib/cjs/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.js +45 -44
  44. package/lib/cjs/components/CustomScrollDragPlugin/index.js.map +1 -0
  45. package/lib/cjs/components/CustomScrollDragPlugin/types.js.map +1 -0
  46. package/lib/cjs/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.js +51 -47
  47. package/lib/cjs/components/CustomScrollKeyboardPlugin/index.js.map +1 -0
  48. package/lib/cjs/components/CustomScrollKeyboardPlugin/types.js.map +1 -0
  49. package/lib/cjs/components/DraggerBase/index.js +74 -26
  50. package/lib/cjs/components/DraggerBase/index.js.map +1 -1
  51. package/lib/cjs/components/DraggerDirection/index.js +12 -6
  52. package/lib/cjs/components/DraggerDirection/index.js.map +1 -1
  53. package/lib/cjs/components/DraggerMove/index.js +44 -13
  54. package/lib/cjs/components/DraggerMove/index.js.map +1 -1
  55. package/lib/cjs/components/Marquee/index.js +240 -160
  56. package/lib/cjs/components/Marquee/index.js.map +1 -1
  57. package/lib/cjs/components/Preloader/index.js +45 -16
  58. package/lib/cjs/components/Preloader/index.js.map +1 -1
  59. package/lib/cjs/components/ProgressPreloader/index.js +79 -41
  60. package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
  61. package/lib/cjs/components/ProgressPreloader/utils/preloadCustomElement.js +12 -1
  62. package/lib/cjs/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
  63. package/lib/cjs/components/ScrollBar/Bar/index.js +90 -36
  64. package/lib/cjs/components/ScrollBar/Bar/index.js.map +1 -1
  65. package/lib/cjs/components/ScrollBar/index.js +59 -20
  66. package/lib/cjs/components/ScrollBar/index.js.map +1 -1
  67. package/lib/cjs/components/ScrollView/index.js +56 -20
  68. package/lib/cjs/components/ScrollView/index.js.map +1 -1
  69. package/lib/cjs/components/SectionScrollProgress/index.js +68 -31
  70. package/lib/cjs/components/SectionScrollProgress/index.js.map +1 -1
  71. package/lib/cjs/components/SlideProgress/index.js +72 -38
  72. package/lib/cjs/components/SlideProgress/index.js.map +1 -1
  73. package/lib/cjs/components/SplitText/index.js +52 -23
  74. package/lib/cjs/components/SplitText/index.js.map +1 -1
  75. package/lib/cjs/components/SplitText/utils/splitBase.js +6 -1
  76. package/lib/cjs/components/SplitText/utils/splitBase.js.map +1 -1
  77. package/lib/cjs/components/SplitText/utils/wrapLetters.js +11 -3
  78. package/lib/cjs/components/SplitText/utils/wrapLetters.js.map +1 -1
  79. package/lib/cjs/components/SplitText/utils/wrapLines.js +11 -5
  80. package/lib/cjs/components/SplitText/utils/wrapLines.js.map +1 -1
  81. package/lib/cjs/components/SplitText/utils/wrapWords.js +13 -2
  82. package/lib/cjs/components/SplitText/utils/wrapWords.js.map +1 -1
  83. package/lib/cjs/components/Timeline/index.js +77 -21
  84. package/lib/cjs/components/Timeline/index.js.map +1 -1
  85. package/lib/cjs/components/index.js +4 -4
  86. package/lib/cjs/components/index.js.map +1 -1
  87. package/lib/cjs/index.js +10 -3
  88. package/lib/cjs/index.js.map +1 -1
  89. package/lib/cjs/types/index.js +19 -0
  90. package/lib/cjs/types/index.js.map +1 -0
  91. package/lib/cjs/utils/common/PCancelable.js +16 -0
  92. package/lib/cjs/utils/common/PCancelable.js.map +1 -1
  93. package/lib/cjs/utils/common/normalizedTimeoutCallback.js +19 -4
  94. package/lib/cjs/utils/common/normalizedTimeoutCallback.js.map +1 -1
  95. package/lib/cjs/utils/common/objectKeys.js +11 -1
  96. package/lib/cjs/utils/common/objectKeys.js.map +1 -1
  97. package/lib/cjs/utils/common/pickObjectProps.js +14 -2
  98. package/lib/cjs/utils/common/pickObjectProps.js.map +1 -1
  99. package/lib/cjs/utils/common/times.js +12 -3
  100. package/lib/cjs/utils/common/times.js.map +1 -1
  101. package/lib/cjs/utils/common/uid.js +4 -2
  102. package/lib/cjs/utils/common/uid.js.map +1 -1
  103. package/lib/cjs/utils/image/load.js +3 -3
  104. package/lib/cjs/utils/image/load.js.map +1 -1
  105. package/lib/cjs/utils/image/pathsToProps.js +12 -5
  106. package/lib/cjs/utils/image/pathsToProps.js.map +1 -1
  107. package/lib/cjs/utils/image/sizesToSrcSet.js +7 -3
  108. package/lib/cjs/utils/image/sizesToSrcSet.js.map +1 -1
  109. package/lib/cjs/utils/internal/getApp.js +12 -0
  110. package/lib/cjs/utils/internal/getApp.js.map +1 -1
  111. package/lib/cjs/utils/listeners/isIntersectionObserverSupported.js +1 -1
  112. package/lib/cjs/utils/listeners/onResize.js +13 -12
  113. package/lib/cjs/utils/listeners/onResize.js.map +1 -1
  114. package/lib/cjs/utils/math/clamp.js +10 -5
  115. package/lib/cjs/utils/math/clamp.js.map +1 -1
  116. package/lib/cjs/utils/math/clampScope.js +8 -1
  117. package/lib/cjs/utils/math/clampScope.js.map +1 -1
  118. package/lib/cjs/utils/math/easing.js +6 -2
  119. package/lib/cjs/utils/math/easing.js.map +1 -1
  120. package/lib/cjs/utils/math/inScope.js +6 -3
  121. package/lib/cjs/utils/math/inScope.js.map +1 -1
  122. package/lib/cjs/utils/math/lerp.js +11 -3
  123. package/lib/cjs/utils/math/lerp.js.map +1 -1
  124. package/lib/cjs/utils/math/normalizeNestedScope.js +12 -3
  125. package/lib/cjs/utils/math/normalizeNestedScope.js.map +1 -1
  126. package/lib/cjs/utils/math/scoped.js +18 -7
  127. package/lib/cjs/utils/math/scoped.js.map +1 -1
  128. package/lib/cjs/utils/math/spreadScope.js +17 -3
  129. package/lib/cjs/utils/math/spreadScope.js.map +1 -1
  130. package/lib/cjs/utils/math/wrap.js +9 -3
  131. package/lib/cjs/utils/math/wrap.js.map +1 -1
  132. package/lib/cjs/utils/scroll/getScrollValues.js +13 -1
  133. package/lib/cjs/utils/scroll/getScrollValues.js.map +1 -1
  134. package/lib/cjs/utils/scroll/isPageScrolling.js +30 -0
  135. package/lib/cjs/utils/scroll/isPageScrolling.js.map +1 -1
  136. package/lib/cjs/utils/scroll/normalizeWheel.js +7 -2
  137. package/lib/cjs/utils/scroll/normalizeWheel.js.map +1 -1
  138. package/lib/cjs/utils/scroll/onScroll.js +14 -7
  139. package/lib/cjs/utils/scroll/onScroll.js.map +1 -1
  140. package/lib/cjs/utils/scroll/scrollTo.js +8 -7
  141. package/lib/cjs/utils/scroll/scrollTo.js.map +1 -1
  142. package/lib/cjs/utils/scroll/scrollToElement.js +8 -6
  143. package/lib/cjs/utils/scroll/scrollToElement.js.map +1 -1
  144. package/lib/cjs/version.js +1 -1
  145. package/lib/esm/{Application → Vevet}/events/createOnPageLoad/index.js +7 -7
  146. package/lib/esm/Vevet/events/createOnPageLoad/index.js.map +1 -0
  147. package/lib/esm/Vevet/events/createOnPageLoad/types.js.map +1 -0
  148. package/lib/esm/{Application → Vevet}/events/createViewport/index.js +20 -26
  149. package/lib/esm/Vevet/events/createViewport/index.js.map +1 -0
  150. package/lib/esm/Vevet/events/createViewport/types.js.map +1 -0
  151. package/lib/esm/Vevet/exported.js +2 -0
  152. package/lib/esm/Vevet/exported.js.map +1 -0
  153. package/lib/esm/Vevet/global.js +2 -0
  154. package/lib/esm/Vevet/global.js.map +1 -0
  155. package/lib/esm/Vevet/index.js +72 -0
  156. package/lib/esm/Vevet/index.js.map +1 -0
  157. package/lib/esm/{Application → Vevet}/types.js.map +1 -1
  158. package/lib/esm/{utils/internal → Vevet/utils}/fetchWebpSupport.js +1 -1
  159. package/lib/esm/Vevet/utils/fetchWebpSupport.js.map +1 -0
  160. package/lib/esm/Vevet/utils/getDeviceInfo.js.map +1 -0
  161. package/lib/esm/base/Callbacks/index.js +66 -48
  162. package/lib/esm/base/Callbacks/index.js.map +1 -1
  163. package/lib/esm/base/Component/index.js +15 -4
  164. package/lib/esm/base/Component/index.js.map +1 -1
  165. package/lib/esm/base/Module/index.js +119 -65
  166. package/lib/esm/base/Module/index.js.map +1 -1
  167. package/lib/esm/base/MutableProps/index.js +35 -60
  168. package/lib/esm/base/MutableProps/index.js.map +1 -1
  169. package/lib/esm/base/Plugin/index.js +20 -1
  170. package/lib/esm/base/Plugin/index.js.map +1 -1
  171. package/lib/esm/components/AnimationFrame/index.js +14 -21
  172. package/lib/esm/components/AnimationFrame/index.js.map +1 -1
  173. package/lib/esm/components/Ctx2D/index.js +40 -25
  174. package/lib/esm/components/Ctx2D/index.js.map +1 -1
  175. package/lib/esm/components/Ctx2DPrerender/index.js +17 -7
  176. package/lib/esm/components/Ctx2DPrerender/index.js.map +1 -1
  177. package/lib/esm/components/CustomCursor/index.js +75 -51
  178. package/lib/esm/components/CustomCursor/index.js.map +1 -1
  179. package/lib/esm/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js +2 -2
  180. package/lib/esm/components/{SmoothScroll → CustomScroll}/AnimatonFrame.js.map +1 -1
  181. package/lib/esm/components/{SmoothScroll → CustomScroll}/Elements.js +8 -8
  182. package/lib/esm/components/{SmoothScroll → CustomScroll}/Elements.js.map +1 -1
  183. package/lib/esm/components/{SmoothScroll → CustomScroll}/index.js +30 -24
  184. package/lib/esm/components/CustomScroll/index.js.map +1 -0
  185. package/lib/esm/components/CustomScroll/types.js.map +1 -0
  186. package/lib/esm/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.js +28 -27
  187. package/lib/esm/components/CustomScrollDragPlugin/index.js.map +1 -0
  188. package/lib/esm/components/CustomScrollDragPlugin/types.js.map +1 -0
  189. package/lib/esm/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.js +37 -33
  190. package/lib/esm/components/CustomScrollKeyboardPlugin/index.js.map +1 -0
  191. package/lib/esm/components/CustomScrollKeyboardPlugin/types.js.map +1 -0
  192. package/lib/esm/components/DraggerBase/index.js +74 -28
  193. package/lib/esm/components/DraggerBase/index.js.map +1 -1
  194. package/lib/esm/components/DraggerDirection/index.js +12 -6
  195. package/lib/esm/components/DraggerDirection/index.js.map +1 -1
  196. package/lib/esm/components/DraggerMove/index.js +44 -13
  197. package/lib/esm/components/DraggerMove/index.js.map +1 -1
  198. package/lib/esm/components/Marquee/index.js +220 -161
  199. package/lib/esm/components/Marquee/index.js.map +1 -1
  200. package/lib/esm/components/Preloader/index.js +45 -16
  201. package/lib/esm/components/Preloader/index.js.map +1 -1
  202. package/lib/esm/components/ProgressPreloader/index.js +79 -40
  203. package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
  204. package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js +12 -1
  205. package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
  206. package/lib/esm/components/ScrollBar/Bar/index.js +89 -32
  207. package/lib/esm/components/ScrollBar/Bar/index.js.map +1 -1
  208. package/lib/esm/components/ScrollBar/index.js +49 -15
  209. package/lib/esm/components/ScrollBar/index.js.map +1 -1
  210. package/lib/esm/components/ScrollView/index.js +56 -20
  211. package/lib/esm/components/ScrollView/index.js.map +1 -1
  212. package/lib/esm/components/SectionScrollProgress/index.js +68 -31
  213. package/lib/esm/components/SectionScrollProgress/index.js.map +1 -1
  214. package/lib/esm/components/SlideProgress/index.js +72 -38
  215. package/lib/esm/components/SlideProgress/index.js.map +1 -1
  216. package/lib/esm/components/SplitText/index.js +52 -23
  217. package/lib/esm/components/SplitText/index.js.map +1 -1
  218. package/lib/esm/components/SplitText/utils/splitBase.js +6 -1
  219. package/lib/esm/components/SplitText/utils/splitBase.js.map +1 -1
  220. package/lib/esm/components/SplitText/utils/wrapLetters.js +11 -3
  221. package/lib/esm/components/SplitText/utils/wrapLetters.js.map +1 -1
  222. package/lib/esm/components/SplitText/utils/wrapLines.js +11 -5
  223. package/lib/esm/components/SplitText/utils/wrapLines.js.map +1 -1
  224. package/lib/esm/components/SplitText/utils/wrapWords.js +13 -2
  225. package/lib/esm/components/SplitText/utils/wrapWords.js.map +1 -1
  226. package/lib/esm/components/Timeline/index.js +70 -22
  227. package/lib/esm/components/Timeline/index.js.map +1 -1
  228. package/lib/esm/components/index.js +4 -4
  229. package/lib/esm/components/index.js.map +1 -1
  230. package/lib/esm/index.js +9 -3
  231. package/lib/esm/index.js.map +1 -1
  232. package/lib/esm/types/index.js +3 -0
  233. package/lib/esm/types/index.js.map +1 -0
  234. package/lib/esm/utils/common/PCancelable.js +16 -0
  235. package/lib/esm/utils/common/PCancelable.js.map +1 -1
  236. package/lib/esm/utils/common/normalizedTimeoutCallback.js +19 -4
  237. package/lib/esm/utils/common/normalizedTimeoutCallback.js.map +1 -1
  238. package/lib/esm/utils/common/objectKeys.js +11 -1
  239. package/lib/esm/utils/common/objectKeys.js.map +1 -1
  240. package/lib/esm/utils/common/pickObjectProps.js +14 -2
  241. package/lib/esm/utils/common/pickObjectProps.js.map +1 -1
  242. package/lib/esm/utils/common/times.js +12 -3
  243. package/lib/esm/utils/common/times.js.map +1 -1
  244. package/lib/esm/utils/common/uid.js +4 -2
  245. package/lib/esm/utils/common/uid.js.map +1 -1
  246. package/lib/esm/utils/image/load.js +3 -3
  247. package/lib/esm/utils/image/load.js.map +1 -1
  248. package/lib/esm/utils/image/pathsToProps.js +12 -5
  249. package/lib/esm/utils/image/pathsToProps.js.map +1 -1
  250. package/lib/esm/utils/image/sizesToSrcSet.js +7 -3
  251. package/lib/esm/utils/image/sizesToSrcSet.js.map +1 -1
  252. package/lib/esm/utils/internal/getApp.js +12 -0
  253. package/lib/esm/utils/internal/getApp.js.map +1 -1
  254. package/lib/esm/utils/listeners/isIntersectionObserverSupported.js +1 -1
  255. package/lib/esm/utils/listeners/onResize.js +11 -12
  256. package/lib/esm/utils/listeners/onResize.js.map +1 -1
  257. package/lib/esm/utils/math/clamp.js +10 -5
  258. package/lib/esm/utils/math/clamp.js.map +1 -1
  259. package/lib/esm/utils/math/clampScope.js +8 -1
  260. package/lib/esm/utils/math/clampScope.js.map +1 -1
  261. package/lib/esm/utils/math/easing.js +6 -2
  262. package/lib/esm/utils/math/easing.js.map +1 -1
  263. package/lib/esm/utils/math/inScope.js +6 -3
  264. package/lib/esm/utils/math/inScope.js.map +1 -1
  265. package/lib/esm/utils/math/lerp.js +11 -3
  266. package/lib/esm/utils/math/lerp.js.map +1 -1
  267. package/lib/esm/utils/math/normalizeNestedScope.js +12 -3
  268. package/lib/esm/utils/math/normalizeNestedScope.js.map +1 -1
  269. package/lib/esm/utils/math/scoped.js +17 -6
  270. package/lib/esm/utils/math/scoped.js.map +1 -1
  271. package/lib/esm/utils/math/spreadScope.js +17 -3
  272. package/lib/esm/utils/math/spreadScope.js.map +1 -1
  273. package/lib/esm/utils/math/wrap.js +9 -3
  274. package/lib/esm/utils/math/wrap.js.map +1 -1
  275. package/lib/esm/utils/scroll/getScrollValues.js +13 -1
  276. package/lib/esm/utils/scroll/getScrollValues.js.map +1 -1
  277. package/lib/esm/utils/scroll/isPageScrolling.js +30 -0
  278. package/lib/esm/utils/scroll/isPageScrolling.js.map +1 -1
  279. package/lib/esm/utils/scroll/normalizeWheel.js +7 -2
  280. package/lib/esm/utils/scroll/normalizeWheel.js.map +1 -1
  281. package/lib/esm/utils/scroll/onScroll.js +14 -7
  282. package/lib/esm/utils/scroll/onScroll.js.map +1 -1
  283. package/lib/esm/utils/scroll/scrollTo.js +8 -7
  284. package/lib/esm/utils/scroll/scrollTo.js.map +1 -1
  285. package/lib/esm/utils/scroll/scrollToElement.js +8 -6
  286. package/lib/esm/utils/scroll/scrollToElement.js.map +1 -1
  287. package/lib/esm/version.js +1 -1
  288. package/lib/styles/base.scss +0 -2
  289. package/lib/styles/components/CustomCursor.scss +7 -7
  290. package/{src/styles/components/SmoothScroll.scss → lib/styles/components/CustomScroll.scss} +3 -3
  291. package/lib/styles/components/Preloader.scss +1 -1
  292. package/lib/styles/components/ScrollBar.scss +4 -4
  293. package/lib/styles/components/index.scss +1 -1
  294. package/lib/styles/index.scss +0 -1
  295. package/lib/types/Vevet/events/createOnPageLoad/index.d.ts +3 -0
  296. package/lib/types/Vevet/events/createOnPageLoad/index.d.ts.map +1 -0
  297. package/lib/types/Vevet/events/createOnPageLoad/types.d.ts +20 -0
  298. package/lib/types/Vevet/events/createOnPageLoad/types.d.ts.map +1 -0
  299. package/lib/types/Vevet/events/createViewport/index.d.ts +4 -0
  300. package/lib/types/Vevet/events/createViewport/index.d.ts.map +1 -0
  301. package/lib/types/Vevet/events/createViewport/types.d.ts +85 -0
  302. package/lib/types/Vevet/events/createViewport/types.d.ts.map +1 -0
  303. package/lib/types/Vevet/exported.d.ts +6 -0
  304. package/lib/types/Vevet/exported.d.ts.map +1 -0
  305. package/lib/types/Vevet/global.d.ts +51 -0
  306. package/lib/types/Vevet/global.d.ts.map +1 -0
  307. package/lib/types/Vevet/index.d.ts +4 -0
  308. package/lib/types/Vevet/index.d.ts.map +1 -0
  309. package/lib/types/Vevet/types.d.ts +43 -0
  310. package/lib/types/Vevet/types.d.ts.map +1 -0
  311. package/lib/types/Vevet/utils/fetchWebpSupport.d.ts +3 -0
  312. package/lib/types/Vevet/utils/fetchWebpSupport.d.ts.map +1 -0
  313. package/lib/types/Vevet/utils/getDeviceInfo.d.ts.map +1 -0
  314. package/lib/types/base/Callbacks/index.d.ts +67 -46
  315. package/lib/types/base/Callbacks/index.d.ts.map +1 -1
  316. package/lib/types/base/Callbacks/types.d.ts +46 -14
  317. package/lib/types/base/Callbacks/types.d.ts.map +1 -1
  318. package/lib/types/base/Component/index.d.ts +19 -5
  319. package/lib/types/base/Component/index.d.ts.map +1 -1
  320. package/lib/types/base/Component/types.d.ts +15 -3
  321. package/lib/types/base/Component/types.d.ts.map +1 -1
  322. package/lib/types/base/Module/index.d.ts +124 -74
  323. package/lib/types/base/Module/index.d.ts.map +1 -1
  324. package/lib/types/base/Module/types.d.ts +29 -3
  325. package/lib/types/base/Module/types.d.ts.map +1 -1
  326. package/lib/types/base/MutableProps/index.d.ts +34 -77
  327. package/lib/types/base/MutableProps/index.d.ts.map +1 -1
  328. package/lib/types/base/MutableProps/types.d.ts +14 -8
  329. package/lib/types/base/MutableProps/types.d.ts.map +1 -1
  330. package/lib/types/base/Plugin/index.d.ts +24 -1
  331. package/lib/types/base/Plugin/index.d.ts.map +1 -1
  332. package/lib/types/base/Plugin/types.d.ts +11 -0
  333. package/lib/types/base/Plugin/types.d.ts.map +1 -1
  334. package/lib/types/components/AnimationFrame/index.d.ts +20 -18
  335. package/lib/types/components/AnimationFrame/index.d.ts.map +1 -1
  336. package/lib/types/components/AnimationFrame/types.d.ts +18 -3
  337. package/lib/types/components/AnimationFrame/types.d.ts.map +1 -1
  338. package/lib/types/components/Ctx2D/index.d.ts +37 -15
  339. package/lib/types/components/Ctx2D/index.d.ts.map +1 -1
  340. package/lib/types/components/Ctx2D/types.d.ts +40 -13
  341. package/lib/types/components/Ctx2D/types.d.ts.map +1 -1
  342. package/lib/types/components/Ctx2DPrerender/index.d.ts +13 -4
  343. package/lib/types/components/Ctx2DPrerender/index.d.ts.map +1 -1
  344. package/lib/types/components/Ctx2DPrerender/types.d.ts +13 -2
  345. package/lib/types/components/Ctx2DPrerender/types.d.ts.map +1 -1
  346. package/lib/types/components/CustomCursor/index.d.ts +59 -36
  347. package/lib/types/components/CustomCursor/index.d.ts.map +1 -1
  348. package/lib/types/components/CustomCursor/types.d.ts +52 -12
  349. package/lib/types/components/CustomCursor/types.d.ts.map +1 -1
  350. package/lib/types/components/{SmoothScroll → CustomScroll}/AnimatonFrame.d.ts.map +1 -1
  351. package/lib/types/components/{SmoothScroll → CustomScroll}/Elements.d.ts +3 -3
  352. package/lib/types/components/{SmoothScroll → CustomScroll}/Elements.d.ts.map +1 -1
  353. package/lib/types/components/{SmoothScroll → CustomScroll}/index.d.ts +46 -32
  354. package/lib/types/components/CustomScroll/index.d.ts.map +1 -0
  355. package/lib/types/components/CustomScroll/types.d.ts +137 -0
  356. package/lib/types/components/CustomScroll/types.d.ts.map +1 -0
  357. package/lib/types/components/CustomScrollDragPlugin/index.d.ts +62 -0
  358. package/lib/types/components/CustomScrollDragPlugin/index.d.ts.map +1 -0
  359. package/lib/types/components/CustomScrollDragPlugin/types.d.ts +52 -0
  360. package/lib/types/components/CustomScrollDragPlugin/types.d.ts.map +1 -0
  361. package/lib/types/components/CustomScrollKeyboardPlugin/index.d.ts +47 -0
  362. package/lib/types/components/CustomScrollKeyboardPlugin/index.d.ts.map +1 -0
  363. package/lib/types/components/CustomScrollKeyboardPlugin/types.d.ts +16 -0
  364. package/lib/types/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/types.d.ts.map +1 -1
  365. package/lib/types/components/DraggerBase/index.d.ts +93 -28
  366. package/lib/types/components/DraggerBase/index.d.ts.map +1 -1
  367. package/lib/types/components/DraggerBase/types.d.ts +21 -3
  368. package/lib/types/components/DraggerBase/types.d.ts.map +1 -1
  369. package/lib/types/components/DraggerDirection/index.d.ts +6 -2
  370. package/lib/types/components/DraggerDirection/index.d.ts.map +1 -1
  371. package/lib/types/components/DraggerDirection/types.d.ts +15 -1
  372. package/lib/types/components/DraggerDirection/types.d.ts.map +1 -1
  373. package/lib/types/components/DraggerMove/index.d.ts +38 -8
  374. package/lib/types/components/DraggerMove/index.d.ts.map +1 -1
  375. package/lib/types/components/DraggerMove/types.d.ts +15 -2
  376. package/lib/types/components/DraggerMove/types.d.ts.map +1 -1
  377. package/lib/types/components/Marquee/index.d.ts +59 -36
  378. package/lib/types/components/Marquee/index.d.ts.map +1 -1
  379. package/lib/types/components/Marquee/types.d.ts +18 -8
  380. package/lib/types/components/Marquee/types.d.ts.map +1 -1
  381. package/lib/types/components/Preloader/index.d.ts +52 -15
  382. package/lib/types/components/Preloader/index.d.ts.map +1 -1
  383. package/lib/types/components/Preloader/types.d.ts +16 -5
  384. package/lib/types/components/Preloader/types.d.ts.map +1 -1
  385. package/lib/types/components/ProgressPreloader/index.d.ts +85 -25
  386. package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
  387. package/lib/types/components/ProgressPreloader/types.d.ts +51 -14
  388. package/lib/types/components/ProgressPreloader/types.d.ts.map +1 -1
  389. package/lib/types/components/ProgressPreloader/utils/preloadCustomElement.d.ts +3 -0
  390. package/lib/types/components/ProgressPreloader/utils/preloadCustomElement.d.ts.map +1 -1
  391. package/lib/types/components/ScrollBar/Bar/index.d.ts +81 -16
  392. package/lib/types/components/ScrollBar/Bar/index.d.ts.map +1 -1
  393. package/lib/types/components/ScrollBar/Bar/types.d.ts +38 -16
  394. package/lib/types/components/ScrollBar/Bar/types.d.ts.map +1 -1
  395. package/lib/types/components/ScrollBar/index.d.ts +49 -12
  396. package/lib/types/components/ScrollBar/index.d.ts.map +1 -1
  397. package/lib/types/components/ScrollBar/types.d.ts +8 -6
  398. package/lib/types/components/ScrollBar/types.d.ts.map +1 -1
  399. package/lib/types/components/ScrollView/index.d.ts +65 -21
  400. package/lib/types/components/ScrollView/index.d.ts.map +1 -1
  401. package/lib/types/components/SectionScrollProgress/index.d.ts +83 -28
  402. package/lib/types/components/SectionScrollProgress/index.d.ts.map +1 -1
  403. package/lib/types/components/SectionScrollProgress/types.d.ts +15 -6
  404. package/lib/types/components/SectionScrollProgress/types.d.ts.map +1 -1
  405. package/lib/types/components/SlideProgress/index.d.ts +59 -24
  406. package/lib/types/components/SlideProgress/index.d.ts.map +1 -1
  407. package/lib/types/components/SlideProgress/types.d.ts +24 -15
  408. package/lib/types/components/SlideProgress/types.d.ts.map +1 -1
  409. package/lib/types/components/SplitText/index.d.ts +64 -18
  410. package/lib/types/components/SplitText/index.d.ts.map +1 -1
  411. package/lib/types/components/SplitText/types.d.ts +36 -8
  412. package/lib/types/components/SplitText/types.d.ts.map +1 -1
  413. package/lib/types/components/SplitText/utils/splitBase.d.ts +3 -1
  414. package/lib/types/components/SplitText/utils/splitBase.d.ts.map +1 -1
  415. package/lib/types/components/SplitText/utils/wrapLetters.d.ts +3 -1
  416. package/lib/types/components/SplitText/utils/wrapLetters.d.ts.map +1 -1
  417. package/lib/types/components/SplitText/utils/wrapLines.d.ts +3 -1
  418. package/lib/types/components/SplitText/utils/wrapLines.d.ts.map +1 -1
  419. package/lib/types/components/SplitText/utils/wrapWords.d.ts +3 -1
  420. package/lib/types/components/SplitText/utils/wrapWords.d.ts.map +1 -1
  421. package/lib/types/components/Timeline/index.d.ts +69 -21
  422. package/lib/types/components/Timeline/index.d.ts.map +1 -1
  423. package/lib/types/components/Timeline/types.d.ts +32 -7
  424. package/lib/types/components/Timeline/types.d.ts.map +1 -1
  425. package/lib/types/components/index.d.ts +4 -4
  426. package/lib/types/components/index.d.ts.map +1 -1
  427. package/lib/types/index.d.ts +9 -2
  428. package/lib/types/index.d.ts.map +1 -1
  429. package/lib/types/types/index.d.ts +3 -0
  430. package/lib/types/types/index.d.ts.map +1 -0
  431. package/lib/types/types/utility.d.ts +2 -3
  432. package/lib/types/types/utility.d.ts.map +1 -1
  433. package/lib/types/utils/common/PCancelable.d.ts +16 -0
  434. package/lib/types/utils/common/PCancelable.d.ts.map +1 -1
  435. package/lib/types/utils/common/normalizedTimeoutCallback.d.ts +19 -4
  436. package/lib/types/utils/common/normalizedTimeoutCallback.d.ts.map +1 -1
  437. package/lib/types/utils/common/objectKeys.d.ts +11 -1
  438. package/lib/types/utils/common/objectKeys.d.ts.map +1 -1
  439. package/lib/types/utils/common/pickObjectProps.d.ts +14 -2
  440. package/lib/types/utils/common/pickObjectProps.d.ts.map +1 -1
  441. package/lib/types/utils/common/times.d.ts +12 -3
  442. package/lib/types/utils/common/times.d.ts.map +1 -1
  443. package/lib/types/utils/common/uid.d.ts +4 -2
  444. package/lib/types/utils/common/uid.d.ts.map +1 -1
  445. package/lib/types/utils/image/load.d.ts +8 -5
  446. package/lib/types/utils/image/load.d.ts.map +1 -1
  447. package/lib/types/utils/image/pathsToProps.d.ts +10 -4
  448. package/lib/types/utils/image/pathsToProps.d.ts.map +1 -1
  449. package/lib/types/utils/image/sizesToSrcSet.d.ts +7 -3
  450. package/lib/types/utils/image/sizesToSrcSet.d.ts.map +1 -1
  451. package/lib/types/utils/internal/getApp.d.ts +9 -1
  452. package/lib/types/utils/internal/getApp.d.ts.map +1 -1
  453. package/lib/types/utils/listeners/isIntersectionObserverSupported.d.ts +1 -1
  454. package/lib/types/utils/listeners/onResize.d.ts +11 -12
  455. package/lib/types/utils/listeners/onResize.d.ts.map +1 -1
  456. package/lib/types/utils/math/clamp.d.ts +7 -2
  457. package/lib/types/utils/math/clamp.d.ts.map +1 -1
  458. package/lib/types/utils/math/clampScope.d.ts +8 -1
  459. package/lib/types/utils/math/clampScope.d.ts.map +1 -1
  460. package/lib/types/utils/math/easing.d.ts +4 -1
  461. package/lib/types/utils/math/easing.d.ts.map +1 -1
  462. package/lib/types/utils/math/inScope.d.ts +5 -2
  463. package/lib/types/utils/math/inScope.d.ts.map +1 -1
  464. package/lib/types/utils/math/lerp.d.ts +10 -2
  465. package/lib/types/utils/math/lerp.d.ts.map +1 -1
  466. package/lib/types/utils/math/normalizeNestedScope.d.ts +12 -3
  467. package/lib/types/utils/math/normalizeNestedScope.d.ts.map +1 -1
  468. package/lib/types/utils/math/scoped.d.ts +16 -5
  469. package/lib/types/utils/math/scoped.d.ts.map +1 -1
  470. package/lib/types/utils/math/spreadScope.d.ts +17 -3
  471. package/lib/types/utils/math/spreadScope.d.ts.map +1 -1
  472. package/lib/types/utils/math/wrap.d.ts +9 -3
  473. package/lib/types/utils/math/wrap.d.ts.map +1 -1
  474. package/lib/types/utils/scroll/getScrollValues.d.ts +13 -1
  475. package/lib/types/utils/scroll/getScrollValues.d.ts.map +1 -1
  476. package/lib/types/utils/scroll/isPageScrolling.d.ts +20 -0
  477. package/lib/types/utils/scroll/isPageScrolling.d.ts.map +1 -1
  478. package/lib/types/utils/scroll/normalizeWheel.d.ts +10 -2
  479. package/lib/types/utils/scroll/normalizeWheel.d.ts.map +1 -1
  480. package/lib/types/utils/scroll/onScroll.d.ts +10 -5
  481. package/lib/types/utils/scroll/onScroll.d.ts.map +1 -1
  482. package/lib/types/utils/scroll/scrollTo.d.ts +12 -9
  483. package/lib/types/utils/scroll/scrollTo.d.ts.map +1 -1
  484. package/lib/types/utils/scroll/scrollToElement.d.ts +9 -7
  485. package/lib/types/utils/scroll/scrollToElement.d.ts.map +1 -1
  486. package/lib/types/version.d.ts +1 -1
  487. package/package.json +6 -7
  488. package/src/{Application → Vevet}/events/createOnPageLoad/index.ts +8 -8
  489. package/src/Vevet/events/createOnPageLoad/types.ts +21 -0
  490. package/src/{Application → Vevet}/events/createViewport/index.ts +33 -35
  491. package/src/{Application → Vevet}/events/createViewport/stories/index.tsx +7 -5
  492. package/src/Vevet/events/createViewport/types.ts +93 -0
  493. package/src/Vevet/exported.ts +15 -0
  494. package/src/Vevet/global.ts +51 -0
  495. package/src/Vevet/index.ts +98 -0
  496. package/src/{Application → Vevet}/stories/index.tsx +2 -2
  497. package/src/Vevet/types.ts +48 -0
  498. package/src/base/Callbacks/index.ts +70 -51
  499. package/src/base/Callbacks/types.ts +53 -14
  500. package/src/base/Component/index.ts +19 -5
  501. package/src/base/Component/types.ts +15 -3
  502. package/src/base/Module/index.ts +125 -78
  503. package/src/base/Module/types.ts +32 -3
  504. package/src/base/MutableProps/index.ts +44 -73
  505. package/src/base/MutableProps/types.ts +15 -8
  506. package/src/base/Plugin/index.ts +24 -1
  507. package/src/base/Plugin/types.ts +11 -0
  508. package/src/components/AnimationFrame/index.ts +21 -28
  509. package/src/components/AnimationFrame/types.ts +23 -3
  510. package/src/components/Ctx2D/index.ts +46 -34
  511. package/src/components/Ctx2D/types.ts +53 -13
  512. package/src/components/Ctx2DPrerender/index.ts +18 -7
  513. package/src/components/Ctx2DPrerender/types.ts +13 -2
  514. package/src/components/CustomCursor/index.ts +85 -60
  515. package/src/components/CustomCursor/stories/index.tsx +0 -3
  516. package/src/components/CustomCursor/types.ts +63 -12
  517. package/src/components/{SmoothScroll → CustomScroll}/AnimatonFrame.ts +2 -2
  518. package/src/components/{SmoothScroll → CustomScroll}/Elements.ts +14 -14
  519. package/src/components/{SmoothScroll → CustomScroll}/index.ts +61 -44
  520. package/src/components/{SmoothScroll → CustomScroll}/stories/Default.tsx +8 -8
  521. package/src/components/{SmoothScroll → CustomScroll}/stories/WithHorizontal.tsx +9 -9
  522. package/src/components/{SmoothScroll → CustomScroll}/stories/WithInnerLerp.tsx +9 -9
  523. package/src/components/{SmoothScroll → CustomScroll}/stories/index.stories.tsx +1 -1
  524. package/src/components/CustomScroll/types.ts +165 -0
  525. package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/index.ts +41 -41
  526. package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/stories/index.stories.tsx +1 -1
  527. package/src/components/{SmoothScrollDragPlugin → CustomScrollDragPlugin}/stories/index.tsx +10 -10
  528. package/src/components/CustomScrollDragPlugin/types.ts +59 -0
  529. package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/index.ts +47 -43
  530. package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/stories/index.stories.tsx +1 -1
  531. package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/stories/index.tsx +10 -10
  532. package/src/components/{SmoothScrollKeyboardPlugin → CustomScrollKeyboardPlugin}/types.ts +6 -2
  533. package/src/components/DraggerBase/index.ts +101 -37
  534. package/src/components/DraggerBase/types.ts +25 -3
  535. package/src/components/DraggerDirection/index.ts +12 -6
  536. package/src/components/DraggerDirection/types.ts +18 -1
  537. package/src/components/DraggerMove/index.ts +44 -13
  538. package/src/components/DraggerMove/types.ts +17 -2
  539. package/src/components/Marquee/index.ts +255 -186
  540. package/src/components/Marquee/stories/index.tsx +16 -2
  541. package/src/components/Marquee/types.ts +18 -8
  542. package/src/components/Preloader/index.ts +56 -20
  543. package/src/components/Preloader/types.ts +18 -5
  544. package/src/components/ProgressPreloader/index.ts +104 -48
  545. package/src/components/ProgressPreloader/types.ts +65 -14
  546. package/src/components/ProgressPreloader/utils/preloadCustomElement.ts +13 -2
  547. package/src/components/ScrollBar/Bar/index.ts +112 -62
  548. package/src/components/ScrollBar/Bar/types.ts +46 -17
  549. package/src/components/ScrollBar/index.ts +65 -20
  550. package/src/components/ScrollBar/stories/{WithSmoothScrollComponent.tsx → WithCustomScrollComponent.tsx} +5 -5
  551. package/src/components/ScrollBar/stories/index.stories.tsx +3 -3
  552. package/src/components/ScrollBar/types.ts +10 -6
  553. package/src/components/ScrollView/index.ts +73 -27
  554. package/src/components/ScrollView/stories/index.tsx +5 -2
  555. package/src/components/SectionScrollProgress/index.ts +97 -41
  556. package/src/components/SectionScrollProgress/stories/WithCustomScroll.tsx +6 -6
  557. package/src/components/SectionScrollProgress/types.ts +19 -6
  558. package/src/components/SlideProgress/index.ts +78 -45
  559. package/src/components/SlideProgress/types.ts +24 -15
  560. package/src/components/SplitText/index.ts +71 -31
  561. package/src/components/SplitText/types.ts +48 -8
  562. package/src/components/SplitText/utils/splitBase.ts +6 -2
  563. package/src/components/SplitText/utils/wrapLetters.ts +11 -3
  564. package/src/components/SplitText/utils/wrapLines.ts +11 -5
  565. package/src/components/SplitText/utils/wrapWords.ts +14 -3
  566. package/src/components/Timeline/index.ts +98 -26
  567. package/src/components/Timeline/stories/index.stories.tsx +0 -5
  568. package/src/components/Timeline/types.ts +37 -7
  569. package/src/components/index.ts +4 -4
  570. package/src/index.ts +14 -4
  571. package/src/styles/base.scss +0 -2
  572. package/src/styles/components/CustomCursor.scss +7 -7
  573. package/{lib/styles/components/SmoothScroll.scss → src/styles/components/CustomScroll.scss} +3 -3
  574. package/src/styles/components/Preloader.scss +1 -1
  575. package/src/styles/components/ScrollBar.scss +4 -4
  576. package/src/styles/components/index.scss +1 -1
  577. package/src/styles/index.scss +0 -1
  578. package/src/types/index.ts +2 -0
  579. package/src/types/utility.ts +2 -2
  580. package/src/utils/common/PCancelable.ts +17 -0
  581. package/src/utils/common/normalizedTimeoutCallback.ts +19 -4
  582. package/src/utils/common/objectKeys.ts +12 -2
  583. package/src/utils/common/pickObjectProps.ts +16 -4
  584. package/src/utils/common/times.ts +12 -3
  585. package/src/utils/common/uid.ts +5 -3
  586. package/src/utils/image/load.ts +9 -4
  587. package/src/utils/image/pathsToProps.ts +12 -5
  588. package/src/utils/image/sizesToSrcSet.ts +7 -3
  589. package/src/utils/internal/getApp.ts +25 -0
  590. package/src/utils/listeners/isIntersectionObserverSupported.ts +1 -1
  591. package/src/utils/listeners/onResize.ts +16 -21
  592. package/src/utils/math/clamp.ts +10 -5
  593. package/src/utils/math/clampScope.ts +9 -2
  594. package/src/utils/math/easing.ts +6 -2
  595. package/src/utils/math/inScope.ts +6 -3
  596. package/src/utils/math/lerp.ts +11 -3
  597. package/src/utils/math/normalizeNestedScope.ts +12 -3
  598. package/src/utils/math/scoped.ts +17 -6
  599. package/src/utils/math/spreadScope.ts +17 -3
  600. package/src/utils/math/wrap.ts +9 -3
  601. package/src/utils/scroll/getScrollValues.ts +13 -1
  602. package/src/utils/scroll/isPageScrolling.ts +31 -0
  603. package/src/utils/scroll/normalizeWheel.ts +10 -2
  604. package/src/utils/scroll/onScroll.ts +18 -11
  605. package/src/utils/scroll/scrollTo.ts +16 -10
  606. package/src/utils/scroll/scrollToElement.ts +9 -7
  607. package/src/version.ts +1 -1
  608. package/lib/cjs/Application/events/createOnPageLoad/index.js.map +0 -1
  609. package/lib/cjs/Application/events/createOnPageLoad/types.js.map +0 -1
  610. package/lib/cjs/Application/events/createViewport/index.js.map +0 -1
  611. package/lib/cjs/Application/events/createViewport/types.js.map +0 -1
  612. package/lib/cjs/Application/index.js +0 -222
  613. package/lib/cjs/Application/index.js.map +0 -1
  614. package/lib/cjs/components/BaseTimeline/index.js +0 -125
  615. package/lib/cjs/components/BaseTimeline/index.js.map +0 -1
  616. package/lib/cjs/components/BaseTimeline/types.js.map +0 -1
  617. package/lib/cjs/components/SmoothScroll/index.js.map +0 -1
  618. package/lib/cjs/components/SmoothScroll/types.js.map +0 -1
  619. package/lib/cjs/components/SmoothScrollDragPlugin/index.js.map +0 -1
  620. package/lib/cjs/components/SmoothScrollDragPlugin/types.js.map +0 -1
  621. package/lib/cjs/components/SmoothScrollKeyboardPlugin/index.js.map +0 -1
  622. package/lib/cjs/components/SmoothScrollKeyboardPlugin/types.js +0 -3
  623. package/lib/cjs/components/SmoothScrollKeyboardPlugin/types.js.map +0 -1
  624. package/lib/cjs/utils/internal/fetchWebpSupport.js.map +0 -1
  625. package/lib/cjs/utils/internal/getDeviceInfo.js.map +0 -1
  626. package/lib/cjs/vevet.js +0 -6
  627. package/lib/cjs/vevet.js.map +0 -1
  628. package/lib/esm/Application/events/createOnPageLoad/index.js.map +0 -1
  629. package/lib/esm/Application/events/createOnPageLoad/types.js.map +0 -1
  630. package/lib/esm/Application/events/createViewport/index.js.map +0 -1
  631. package/lib/esm/Application/events/createViewport/types.js.map +0 -1
  632. package/lib/esm/Application/index.js +0 -134
  633. package/lib/esm/Application/index.js.map +0 -1
  634. package/lib/esm/components/BaseTimeline/index.js +0 -75
  635. package/lib/esm/components/BaseTimeline/index.js.map +0 -1
  636. package/lib/esm/components/BaseTimeline/types.js.map +0 -1
  637. package/lib/esm/components/SmoothScroll/index.js.map +0 -1
  638. package/lib/esm/components/SmoothScroll/types.js.map +0 -1
  639. package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +0 -1
  640. package/lib/esm/components/SmoothScrollDragPlugin/types.js.map +0 -1
  641. package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +0 -1
  642. package/lib/esm/components/SmoothScrollKeyboardPlugin/types.js +0 -2
  643. package/lib/esm/components/SmoothScrollKeyboardPlugin/types.js.map +0 -1
  644. package/lib/esm/utils/internal/fetchWebpSupport.js.map +0 -1
  645. package/lib/esm/utils/internal/getDeviceInfo.js.map +0 -1
  646. package/lib/esm/vevet.js +0 -3
  647. package/lib/esm/vevet.js.map +0 -1
  648. package/lib/styles/globals/index.scss +0 -18
  649. package/lib/types/Application/events/createOnPageLoad/index.d.ts +0 -5
  650. package/lib/types/Application/events/createOnPageLoad/index.d.ts.map +0 -1
  651. package/lib/types/Application/events/createOnPageLoad/types.d.ts +0 -5
  652. package/lib/types/Application/events/createOnPageLoad/types.d.ts.map +0 -1
  653. package/lib/types/Application/events/createViewport/index.d.ts +0 -20
  654. package/lib/types/Application/events/createViewport/index.d.ts.map +0 -1
  655. package/lib/types/Application/events/createViewport/types.d.ts +0 -52
  656. package/lib/types/Application/events/createViewport/types.d.ts.map +0 -1
  657. package/lib/types/Application/index.d.ts +0 -89
  658. package/lib/types/Application/index.d.ts.map +0 -1
  659. package/lib/types/Application/types.d.ts +0 -41
  660. package/lib/types/Application/types.d.ts.map +0 -1
  661. package/lib/types/components/BaseTimeline/index.d.ts +0 -40
  662. package/lib/types/components/BaseTimeline/index.d.ts.map +0 -1
  663. package/lib/types/components/BaseTimeline/types.d.ts +0 -34
  664. package/lib/types/components/BaseTimeline/types.d.ts.map +0 -1
  665. package/lib/types/components/SmoothScroll/index.d.ts.map +0 -1
  666. package/lib/types/components/SmoothScroll/types.d.ts +0 -105
  667. package/lib/types/components/SmoothScroll/types.d.ts.map +0 -1
  668. package/lib/types/components/SmoothScrollDragPlugin/index.d.ts +0 -50
  669. package/lib/types/components/SmoothScrollDragPlugin/index.d.ts.map +0 -1
  670. package/lib/types/components/SmoothScrollDragPlugin/types.d.ts +0 -39
  671. package/lib/types/components/SmoothScrollDragPlugin/types.d.ts.map +0 -1
  672. package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts +0 -31
  673. package/lib/types/components/SmoothScrollKeyboardPlugin/index.d.ts.map +0 -1
  674. package/lib/types/components/SmoothScrollKeyboardPlugin/types.d.ts +0 -12
  675. package/lib/types/utils/internal/fetchWebpSupport.d.ts +0 -3
  676. package/lib/types/utils/internal/fetchWebpSupport.d.ts.map +0 -1
  677. package/lib/types/utils/internal/getDeviceInfo.d.ts.map +0 -1
  678. package/lib/types/vevet.d.ts +0 -3
  679. package/lib/types/vevet.d.ts.map +0 -1
  680. package/src/Application/events/createOnPageLoad/types.ts +0 -5
  681. package/src/Application/events/createViewport/types.ts +0 -55
  682. package/src/Application/index.ts +0 -204
  683. package/src/Application/types.ts +0 -41
  684. package/src/components/BaseTimeline/index.ts +0 -123
  685. package/src/components/BaseTimeline/stories/Basic.tsx +0 -65
  686. package/src/components/BaseTimeline/stories/Nested.tsx +0 -108
  687. package/src/components/BaseTimeline/stories/index.stories.tsx +0 -16
  688. package/src/components/BaseTimeline/types.ts +0 -36
  689. package/src/components/SmoothScroll/types.ts +0 -114
  690. package/src/components/SmoothScrollDragPlugin/types.ts +0 -40
  691. package/src/components/Timeline/stories/Nested.tsx +0 -135
  692. package/src/styles/globals/index.scss +0 -18
  693. package/src/vevet.ts +0 -4
  694. /package/lib/cjs/{Application → Vevet}/events/createOnPageLoad/types.js +0 -0
  695. /package/lib/cjs/{Application → Vevet}/events/createViewport/types.js +0 -0
  696. /package/lib/cjs/{Application → Vevet}/types.js +0 -0
  697. /package/lib/cjs/{utils/internal → Vevet/utils}/getDeviceInfo.js +0 -0
  698. /package/lib/cjs/components/{BaseTimeline → CustomScroll}/types.js +0 -0
  699. /package/lib/cjs/components/{SmoothScroll → CustomScrollDragPlugin}/types.js +0 -0
  700. /package/lib/cjs/components/{SmoothScrollDragPlugin → CustomScrollKeyboardPlugin}/types.js +0 -0
  701. /package/lib/esm/{Application → Vevet}/events/createOnPageLoad/types.js +0 -0
  702. /package/lib/esm/{Application → Vevet}/events/createViewport/types.js +0 -0
  703. /package/lib/esm/{Application → Vevet}/types.js +0 -0
  704. /package/lib/esm/{utils/internal → Vevet/utils}/getDeviceInfo.js +0 -0
  705. /package/lib/esm/components/{BaseTimeline → CustomScroll}/types.js +0 -0
  706. /package/lib/esm/components/{SmoothScroll → CustomScrollDragPlugin}/types.js +0 -0
  707. /package/lib/esm/components/{SmoothScrollDragPlugin → CustomScrollKeyboardPlugin}/types.js +0 -0
  708. /package/lib/types/{utils/internal → Vevet/utils}/getDeviceInfo.d.ts +0 -0
  709. /package/lib/types/components/{SmoothScroll → CustomScroll}/AnimatonFrame.d.ts +0 -0
  710. /package/src/{Application → Vevet}/events/.eslintrc +0 -0
  711. /package/src/{Application → Vevet}/events/createViewport/stories/index.stories.tsx +0 -0
  712. /package/src/{Application → Vevet}/stories/index.stories.tsx +0 -0
  713. /package/src/{utils/internal → Vevet/utils}/fetchWebpSupport.ts +0 -0
  714. /package/src/{utils/internal → Vevet/utils}/getDeviceInfo.ts +0 -0
@@ -9,14 +9,46 @@ import { MutableProps, NMutableProps } from '../MutableProps';
9
9
  import { Callbacks, NCallbacks } from '../Callbacks';
10
10
  import { TRequiredModuleProp } from '@/types/utility';
11
11
  import { getApp } from '@/utils/internal/getApp';
12
- import { createViewport } from '@/src/Application/events/createViewport';
12
+ import { createViewport } from '@/src/Vevet/events/createViewport';
13
13
 
14
14
  export type { NModule };
15
15
 
16
16
  type TViewportAdd = ReturnType<typeof createViewport>['callbacks']['add'];
17
17
 
18
18
  /**
19
- * Module base
19
+ * A base class for modules that handle responsive properties, event listeners, and custom callbacks.
20
+ * This class provides a structure for modules that can dynamically respond to viewport changes, property mutations, and various lifecycle events.
21
+ *
22
+ * @example
23
+ *
24
+ * interface IStaticProps extends NModule.IStaticProps {
25
+ * staticName: 'My name';
26
+ * }
27
+ *
28
+ * interface IChangeableProps extends NModule.IChangeableProps {
29
+ * weight: number;
30
+ * height: number;
31
+ * }
32
+ *
33
+ * interface ICallbacks extends NModule.ICallbacksTypes {}
34
+ *
35
+ * const module = new Module<IStaticProps, IChangeableProps, ICallbacks>({
36
+ * staticName: 'My name',
37
+ * weight: 70,
38
+ * height: 175,
39
+ * }, false);
40
+ *
41
+ * module.addResponsiveProps({
42
+ * breakpoint: 'viewport_phone',
43
+ * settings: {
44
+ * weight: 80,
45
+ * },
46
+ * });
47
+ *
48
+ * module.init();
49
+ *
50
+ * module.addCallback('propsMutate', () => console.log('mutate props'));
51
+ * module.addCallback('destroy', () => console.log('destroy'));
20
52
  */
21
53
  export class Module<
22
54
  StaticProps extends NModule.IStaticProps = NModule.IStaticProps,
@@ -24,118 +56,83 @@ export class Module<
24
56
  CallbacksTypes extends NModule.ICallbacksTypes = NModule.ICallbacksTypes,
25
57
  > {
26
58
  /**
27
- * Get Default properties (should be extended)
59
+ * Retrieves the default properties for the module. This method is intended to be overridden in subclasses to provide default values for the module's properties.
28
60
  */
29
61
  protected _getDefaultProps() {
30
62
  return {};
31
63
  }
32
64
 
33
- /** Current properties */
65
+ /**
66
+ * The current properties of the module, which include both static and changeable properties.
67
+ * These can be retrieved dynamically during the module's lifecycle.
68
+ */
34
69
  get props() {
35
70
  return this._mutableProps.props as TRequiredModuleProp<
36
71
  StaticProps & ChangeableProps
37
72
  >;
38
73
  }
39
74
 
40
- /** Responsive properties */
75
+ /** Manages the module's mutable properties */
41
76
  private _mutableProps: MutableProps<StaticProps, ChangeableProps>;
42
77
 
43
- /** Module Callbacks */
78
+ /** Manages the module's callbacks */
44
79
  private _callbacks: Callbacks<CallbacksTypes>;
45
80
 
46
- /** Module Callbacks */
81
+ /**
82
+ * Retrieves the module's registered callbacks.
83
+ */
47
84
  get callbacks() {
48
85
  return this._callbacks;
49
86
  }
50
87
 
51
- /** Module listeners */
88
+ /** Holds the list of event listeners added to the module */
52
89
  private _listeners: IAddEventListener[];
53
90
 
54
- /**
55
- * Destroyable actions
56
- */
91
+ /** Stores actions that need to be executed when the module is destroyed */
57
92
  private _destroyableActions: (() => void)[];
58
93
 
59
- /**
60
- * Classnames to remove
61
- */
94
+ /** Stores the class names to be removed when the module is destroyed */
62
95
  private _classNamesToRemove: NModule.IClassNamesToRemove[];
63
96
 
64
- /** Module name */
97
+ /** The name of the module, derived from the class name */
65
98
  get name() {
66
99
  return this.constructor.name;
67
100
  }
68
101
 
69
- /** Module prefix */
102
+ /** Optional prefix for class names used by the module */
70
103
  get prefix() {
71
104
  return '';
72
105
  }
73
106
 
74
- /** The module is initialized */
107
+ /** Tracks whether the module has been initialized */
75
108
  private _isInitialized = false;
76
109
 
77
- /** The module is initialized */
110
+ /**
111
+ * Checks if the module has been initialized.
112
+ */
78
113
  get isInitialized() {
79
114
  return this._isInitialized;
80
115
  }
81
116
 
82
- /** The module is destroyed */
117
+ /** Tracks whether the module has been destroyed */
83
118
  private _isDestroyed = false;
84
119
 
85
- /** The module is destroyed */
120
+ /**
121
+ * Checks if the module has been destroyed.
122
+ */
86
123
  get isDestroyed() {
87
124
  return this._isDestroyed;
88
125
  }
89
126
 
90
127
  /**
91
- * @example
92
- *
93
- * interface IStaticProps extends NModule.IStaticProps {
94
- * staticName: 'My name';
95
- * }
96
-
97
- * interface IChangeableProps extends NModule.IChangeableProps {
98
- * weight: number;
99
- * height: number;
100
- * }
101
-
102
- * interface ICallbacks extends NModule.ICallbacksTypes {}
103
-
104
- * const module = new Module<IStaticProps, IChangeableProps, ICallbacks>(
105
- * {
106
- * staticName: 'My name',
107
- * weight: 70,
108
- * height: 175,
109
- * },
110
- * false
111
- * );
112
-
113
- * module.addResponsiveProps({
114
- * breakpoint: 'viewport_phone',
115
- * settings: {
116
- * weight: 80,
117
- * },
118
- * });
119
-
120
- * module.init();
121
-
122
- * module.addCallback('propsMutate', () => console.log('mutate props'));
123
-
124
- * module.addCallback('destroy', () => console.log('destroy'));
128
+ * Creates a new instance of the Module class.
129
+ *
130
+ * @param initialProps - The initial static and changeable properties to be used by the module.
131
+ * @param canInit - Whether to automatically initialize the module after construction. Set this to `false` if you want to add responsive properties before initializing.
125
132
  */
126
- constructor(
127
- /** Initial properties */
128
- initialProps?: StaticProps & ChangeableProps,
129
- /**
130
- * Defines if you need to call {@linkcode Module.init} at the constructor's end.
131
- * If you want to add responsive properties, set this parameter to `false`.
132
- */
133
- canInit = true,
134
- ) {
133
+ constructor(initialProps?: StaticProps & ChangeableProps, canInit = true) {
135
134
  if (!getApp()) {
136
- throw new Error(
137
- 'Vevet.Application does not exist yet. Call "new Vevet.Application()" before using all the stuff',
138
- );
135
+ throw new Error('Vevet.Application does not exist yet');
139
136
  }
140
137
 
141
138
  this._callbacks = new Callbacks<CallbacksTypes>();
@@ -159,7 +156,11 @@ export class Module<
159
156
  }
160
157
  }
161
158
 
162
- /** Add responsive rules */
159
+ /**
160
+ * Adds responsive property rules to the module. This must be done before initialization.
161
+ *
162
+ * @param rules - The responsive property rules to be added.
163
+ */
163
164
  public addResponsiveProps(rules: NMutableProps.IResponsive<ChangeableProps>) {
164
165
  if (this.isInitialized) {
165
166
  throw new Error(
@@ -170,7 +171,11 @@ export class Module<
170
171
  }
171
172
  }
172
173
 
173
- /** Change module properties */
174
+ /**
175
+ * Updates the changeable properties of the module.
176
+ *
177
+ * @param props - The properties to be updated.
178
+ */
174
179
  public changeProps(props: Partial<ChangeableProps>) {
175
180
  if (this.isDestroyed) {
176
181
  return;
@@ -182,13 +187,15 @@ export class Module<
182
187
  }
183
188
 
184
189
  /**
185
- * This method is called on properties change
190
+ * This method is called internally when the module's properties change.
186
191
  */
187
192
  protected _onPropsMutate() {
188
193
  this._callbacks.tbt('propsMutate', undefined);
189
194
  }
190
195
 
191
- /** Initializes the class */
196
+ /**
197
+ * Initializes the module. Calls the internal `_init` method and marks the module as initialized.
198
+ */
192
199
  public init() {
193
200
  if (this.isInitialized) {
194
201
  return;
@@ -199,16 +206,26 @@ export class Module<
199
206
  this._init();
200
207
  }
201
208
 
202
- /** Inner extra initialization */
209
+ /**
210
+ * Additional initialization logic that can be overridden in subclasses.
211
+ */
203
212
  protected _init() {}
204
213
 
205
- /** Add destroyable actions */
214
+ /**
215
+ * Adds an action to the list of actions to be executed when the module is destroyed.
216
+ *
217
+ * @param action - The function to execute during destruction.
218
+ */
206
219
  protected addDestroyableAction(action: () => void) {
207
220
  this._destroyableActions.push(action);
208
221
  }
209
222
 
210
223
  /**
211
- * Add a viewport callback that will be removed on class destroy
224
+ * Adds a viewport callback that will be automatically removed when the module is destroyed.
225
+ *
226
+ * @param target - The viewport target (e.g., width or height).
227
+ * @param action - The callback function to execute when the viewport target changes.
228
+ * @param data - Additional data for the callback.
212
229
  */
213
230
  public addViewportCallback(
214
231
  target: Parameters<TViewportAdd>[0],
@@ -223,7 +240,13 @@ export class Module<
223
240
  this.addDestroyableAction(() => callback.remove());
224
241
  }
225
242
 
226
- /** Add a module callback */
243
+ /**
244
+ * Adds a custom callback to the module.
245
+ *
246
+ * @param target - The event type to listen for (e.g., 'propsChange', 'destroy').
247
+ * @param action - The function to execute when the event is triggered.
248
+ * @param settings - Additional settings for the callback.
249
+ */
227
250
  public addCallback<T extends keyof CallbacksTypes>(
228
251
  target: T,
229
252
  action: NCallbacks.TAction<CallbacksTypes[T]>,
@@ -232,7 +255,14 @@ export class Module<
232
255
  return this.callbacks.add(target, action, settings);
233
256
  }
234
257
 
235
- /** Add a DOM event listener */
258
+ /**
259
+ * Adds a DOM event listener that will be automatically removed when the module is destroyed.
260
+ *
261
+ * @param el - The target element for the event listener.
262
+ * @param target - The event type to listen for (e.g., 'click', 'resize').
263
+ * @param callback - The callback function to execute when the event is triggered.
264
+ * @param options - Additional options for the event listener.
265
+ */
236
266
  public addEventListener<
237
267
  El extends ListenerElement,
238
268
  Target extends keyof HTMLElementEventMap,
@@ -258,11 +288,23 @@ export class Module<
258
288
  };
259
289
  }
260
290
 
291
+ /**
292
+ * Helper function to generate class names with the module's prefix.
293
+ *
294
+ * @param classNames - The class names to generate.
295
+ * @returns A string of class names with the module's prefix applied.
296
+ */
261
297
  protected className(...classNames: string[]) {
262
298
  return classNames.map((value) => `${this.prefix}${value}`).join(' ');
263
299
  }
264
300
 
265
- /** Toggle classList */
301
+ /**
302
+ * Toggles a class name on an element, and keeps track of it for removal when the module is destroyed.
303
+ *
304
+ * @param element - The target DOM element.
305
+ * @param className - The class name to toggle.
306
+ * @param isActive - Whether the class should be added or removed.
307
+ */
266
308
  protected toggleClassName(
267
309
  element: Element,
268
310
  className: string,
@@ -277,7 +319,9 @@ export class Module<
277
319
  }
278
320
  }
279
321
 
280
- /** Destroy the module */
322
+ /**
323
+ * Destroys the module, cleaning up resources, callbacks, and event listeners.
324
+ */
281
325
  public destroy() {
282
326
  if (this.isDestroyed) {
283
327
  return;
@@ -286,7 +330,10 @@ export class Module<
286
330
  this._destroy();
287
331
  }
288
332
 
289
- /** Destroy the module */
333
+ /**
334
+ * Internal method to handle the destruction of the module.
335
+ * It removes all callbacks, destroys properties, and cleans up event listeners and class names.
336
+ */
290
337
  protected _destroy() {
291
338
  this._callbacks.tbt('destroy', undefined);
292
339
  this._callbacks.destroy();
@@ -2,26 +2,55 @@ import { NCallbacks } from '../Callbacks/types';
2
2
 
3
3
  export namespace NModule {
4
4
  /**
5
- * Mutable Properties (may change on window resize or through {@linkcode Module.changeProps})
5
+ * Interface representing the properties that can change dynamically.
6
+ * These properties may be updated during window resize events or through
7
+ * the {@linkcode Module.changeProps} method.
6
8
  */
7
9
  export interface IChangeableProps {
8
10
  __fixHelperChangeableProps?: any;
9
11
  }
10
12
 
11
- /** Static properties */
13
+ /**
14
+ * Interface representing static properties that remain constant and do not change
15
+ * after initialization.
16
+ */
12
17
  export interface IStaticProps {
13
18
  __fixHelperStaticProps?: any;
14
19
  }
15
20
 
16
- /** Available callbacks */
21
+ /**
22
+ * Defines the available callback types for the module.
23
+ * These callbacks allow interaction with specific module events.
24
+ */
17
25
  export interface ICallbacksTypes extends NCallbacks.ITypes {
26
+ /**
27
+ * Triggered when the module is destroyed.
28
+ */
18
29
  destroy: undefined;
30
+
31
+ /**
32
+ * Triggered when module properties are manually changed.
33
+ */
19
34
  propsChange: undefined;
35
+
36
+ /**
37
+ * Triggered when module properties mutate due to responsive settings or other updates.
38
+ */
20
39
  propsMutate: undefined;
21
40
  }
22
41
 
42
+ /**
43
+ * Represents the class names to be removed from an element when the module is destroyed.
44
+ */
23
45
  export interface IClassNamesToRemove {
46
+ /**
47
+ * The DOM element from which the class name should be removed.
48
+ */
24
49
  element: Element;
50
+
51
+ /**
52
+ * The class name that should be removed from the element.
53
+ */
25
54
  className: string;
26
55
  }
27
56
  }
@@ -5,133 +5,102 @@ import { NMutableProps } from './types';
5
5
  export type { NMutableProps };
6
6
 
7
7
  /**
8
- * A class for creating mutable properties that can change on window resize. <br><br>
9
- *
10
- * There are two ways to change properties:
11
- * - To set a resize-listener on window (or use {@linkcode Viewport}).
12
- * When the window is resized, change the properties with the help of
13
- * {@linkcode MutableProps.changeProps}
14
- *
15
- * - The second way is to use the MutableProps and add responsive properties
16
- * with help of {@linkcode MutableProps.addResponsiveProps}.
8
+ * A class for managing mutable properties that can change based on window size (responsive design).
9
+ * This allows certain properties to update dynamically when the window is resized or in response to manual changes.
17
10
  *
18
11
  * @example
19
- *
12
+ *
20
13
  * interface IStatic {
21
14
  * static: string;
22
15
  * }
23
-
16
+ *
24
17
  * interface IChangeable {
25
18
  * changeable: string;
26
19
  * }
27
-
20
+ *
28
21
  * const props = new MutableProps<IStatic, IChangeable>({
29
22
  * static: '',
30
23
  * changeable: 'something',
31
24
  * });
32
-
25
+ *
33
26
  * props.addResponsiveProps({
34
27
  * breakpoint: 'viewport_phone',
35
28
  * settings: {
36
29
  * changeable: 'phone',
37
30
  * },
38
31
  * });
39
-
32
+ *
40
33
  * props.changeProps({ changeable: 'changed' });
41
34
  */
42
35
  export class MutableProps<
43
- /**
44
- * Static Properties (they never change)
45
- */
46
36
  StaticProps extends Record<string, any>,
47
- /**
48
- * Mutable Properties
49
- * (may change on window resize or through {@linkcode MutableProps.changeProps})
50
- */
51
37
  ChangeableProps extends Record<string, any>,
52
38
  > {
53
39
  /**
54
- * Reference properties.
55
- * These properties may change only through {@linkcode MutableProps.changeProps}.
40
+ * A reference to the original properties (both static and changeable).
41
+ * These properties are only updated manually via {@linkcode changeProps}.
56
42
  */
57
43
  private _refProps: StaticProps & ChangeableProps;
58
44
 
59
45
  /**
60
- * Current properties.
61
- * These properties may change both on {@linkcode MutableProps.changeProps} and resize.
46
+ * The current active properties. These can be updated through both window resizing
47
+ * (via responsive rules) and manual changes through {@linkcode changeProps}.
62
48
  */
63
49
  private _props: StaticProps & ChangeableProps;
64
50
 
65
51
  /**
66
- * A set of responsive rules
52
+ * A set of responsive rules defining how properties should change based on viewport size or device type.
53
+ * Each rule is defined by a breakpoint and corresponding property settings.
67
54
  */
68
55
  private _responsiveRules: NMutableProps.IResponsive<ChangeableProps>[] = [];
69
56
 
70
57
  /**
71
- * Get current properties
58
+ * The active breakpoints currently applied to the properties.
72
59
  */
73
- get props() {
74
- return this._props;
75
- }
60
+ private _activeBreakpoints: (string | number)[];
76
61
 
77
62
  /**
78
- * Viewport callback
63
+ * A callback used to update properties when the viewport size changes.
79
64
  */
80
65
  private _viewportCallback?: NCallbacks.IAddedCallback;
81
66
 
82
67
  /**
83
- * Active breakpoints used to define if properties have changed
84
- */
85
- private _activeBreakpoints: (string | number)[];
86
-
87
- /**
88
- * @example
68
+ * Initializes the `MutableProps` instance with static and changeable properties,
69
+ * and sets up a mutation callback to be called when properties change.
89
70
  *
90
- * const static = {
91
- * myProp: true,
92
- * };
93
- *
94
- * const responsive = [
95
- * {
96
- * breakpoint: 'm',
97
- * settings: {
98
- * myProp: false
99
- * }
100
- * }
101
- * ];
102
- *
103
- * const props = new MutableProps(static, responsive);
71
+ * @param initProps - Initial properties, including both static and changeable properties.
72
+ * @param _onMutate - Callback function triggered whenever the properties change.
73
+ * @param _name - The name used to identify the set of responsive properties.
104
74
  */
105
75
  constructor(
106
- /**
107
- * The properties that were set while initialization.
108
- * These properties will nevet change.
109
- */
110
- private _initProps: StaticProps & ChangeableProps,
111
- /**
112
- * A callback that is launched when properties are changed
113
- */
76
+ initProps: StaticProps & ChangeableProps,
114
77
  private _onMutate: () => void = () => {},
115
- /**
116
- * Name of the responsive properties.
117
- */
118
78
  private _name = 'Responsive Props',
119
79
  ) {
120
- this._refProps = { ..._initProps };
121
- this._props = { ..._initProps };
122
-
80
+ this._refProps = { ...initProps };
81
+ this._props = { ...initProps };
123
82
  this._activeBreakpoints = [];
124
83
  }
125
84
 
126
85
  /**
127
- * Add responsive rules
86
+ * Retrieves the current properties.
87
+ * These may change either due to responsive rules or through manual updates.
88
+ */
89
+ get props() {
90
+ return this._props;
91
+ }
92
+
93
+ /**
94
+ * Adds responsive rules that define how the properties should change based on viewport breakpoints.
95
+ *
96
+ * @param rules - Responsive rules specifying breakpoints and corresponding property settings.
128
97
  */
129
98
  public addResponsiveProps(rules: NMutableProps.IResponsive<ChangeableProps>) {
130
99
  this._responsiveRules.push(rules);
131
100
 
132
101
  this._responseProps();
133
102
 
134
- if (typeof this._viewportCallback !== 'undefined') {
103
+ if (this._viewportCallback) {
135
104
  return;
136
105
  }
137
106
 
@@ -143,7 +112,8 @@ export class MutableProps<
143
112
  }
144
113
 
145
114
  /**
146
- * Change properties according to the "responsive" settings
115
+ * Handles updating the properties based on the current viewport size.
116
+ * It checks all responsive rules and applies the appropriate settings for active breakpoints.
147
117
  */
148
118
  private _responseProps() {
149
119
  const app = getApp();
@@ -155,8 +125,7 @@ export class MutableProps<
155
125
  const prevActiveBreakpointsString = [...this._activeBreakpoints].join('_');
156
126
  this._activeBreakpoints = [];
157
127
 
158
- // go through all breakpoints
159
- // and check if a proper breakpoint exists
128
+ // Evaluate each responsive rule to see if it should be applied
160
129
  this._responsiveRules.forEach(({ settings, breakpoint }) => {
161
130
  if (typeof breakpoint === 'number') {
162
131
  if (viewport.width <= breakpoint) {
@@ -199,14 +168,16 @@ export class MutableProps<
199
168
  this._props = { ...this._props, ...(newProps as any) };
200
169
  }
201
170
 
202
- // callback
171
+ // Call the mutation callback if properties have changed
203
172
  if (isPropsChanged) {
204
173
  this._onMutate();
205
174
  }
206
175
  }
207
176
 
208
177
  /**
209
- * This method allows you to change the properties manually.
178
+ * Manually changes the properties. The updated properties persist and trigger the mutation callback.
179
+ *
180
+ * @param props - A partial set of changeable properties to be updated.
210
181
  */
211
182
  public changeProps(props: Partial<ChangeableProps>) {
212
183
  this._props = { ...this._props, ...props };
@@ -216,7 +187,7 @@ export class MutableProps<
216
187
  }
217
188
 
218
189
  /**
219
- * Destroy the responsive properties.
190
+ * Cleans up and destroys the responsive properties.
220
191
  */
221
192
  public destroy() {
222
193
  if (this._viewportCallback) {
@@ -1,16 +1,19 @@
1
1
  export namespace NMutableProps {
2
2
  export interface IResponsive<S> {
3
3
  /**
4
- * The breakpoint at which properties will change.
4
+ * Defines the breakpoint at which the properties should change.
5
+ * The `breakpoint` can represent either a specific screen width (in pixels)
6
+ * or a predefined device type or viewport size.
7
+ *
5
8
  * Available breakpoints:
6
9
  * <ul>
7
- * <li>any number - width breakpoint</li>
8
- * <li>'d' - for desktop size</li>
9
- * <li>'t' - for tablet size</li>
10
- * <li>'p' - for phone size</li>
11
- * <li>'phone' - for phone devices</li>
12
- * <li>'tablet' - for tablet devices</li>
13
- * <li>'mobile' - for phone or tablet devices</li>
10
+ * <li><code>number</code> - Width breakpoint in pixels, e.g., 768 for tablets or 1024 for desktops.</li>
11
+ * <li><code>'viewport_desktop'</code> - When the viewport width is categorized as desktop size.</li>
12
+ * <li><code>'viewport_tablet'</code> - When the viewport width is categorized as tablet size.</li>
13
+ * <li><code>'viewport_phone'</code> - When the viewport width is categorized as phone size.</li>
14
+ * <li><code>'device_phone'</code> - When the user is on a phone device, regardless of viewport size.</li>
15
+ * <li><code>'device_tablet'</code> - When the user is on a tablet device, regardless of viewport size.</li>
16
+ * <li><code>'device_mobile'</code> - When the user is on any mobile device (either phone or tablet).</li>
14
17
  * </ul>
15
18
  */
16
19
  breakpoint:
@@ -21,6 +24,10 @@ export namespace NMutableProps {
21
24
  | 'device_phone'
22
25
  | 'device_tablet'
23
26
  | 'device_mobile';
27
+
28
+ /**
29
+ * The property settings that should be applied when the defined breakpoint is matched.
30
+ */
24
31
  settings: Partial<S>;
25
32
  }
26
33
  }