@studiometa/js-toolkit 2.6.0 → 2.6.3

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 (387) hide show
  1. package/Base/index.cjs +41 -41
  2. package/Base/index.cjs.map +7 -0
  3. package/Base/index.js +58 -64
  4. package/Base/index.js.map +7 -0
  5. package/Base/managers/AbstractManager.cjs +6 -10
  6. package/Base/managers/AbstractManager.cjs.map +7 -0
  7. package/Base/managers/AbstractManager.js +6 -11
  8. package/Base/managers/AbstractManager.js.map +7 -0
  9. package/Base/managers/ChildrenManager.cjs +3 -11
  10. package/Base/managers/ChildrenManager.cjs.map +7 -0
  11. package/Base/managers/ChildrenManager.js +3 -12
  12. package/Base/managers/ChildrenManager.js.map +7 -0
  13. package/Base/managers/EventsManager.cjs +57 -61
  14. package/Base/managers/EventsManager.cjs.map +7 -0
  15. package/Base/managers/EventsManager.js +57 -62
  16. package/Base/managers/EventsManager.js.map +7 -0
  17. package/Base/managers/OptionsManager.cjs +8 -14
  18. package/Base/managers/OptionsManager.cjs.map +7 -0
  19. package/Base/managers/OptionsManager.js +8 -15
  20. package/Base/managers/OptionsManager.js.map +7 -0
  21. package/Base/managers/RefsManager.cjs +2 -2
  22. package/Base/managers/RefsManager.cjs.map +7 -0
  23. package/Base/managers/RefsManager.js +2 -2
  24. package/Base/managers/RefsManager.js.map +7 -0
  25. package/Base/managers/ResponsiveOptionsManager.cjs +1 -0
  26. package/Base/managers/ResponsiveOptionsManager.cjs.map +7 -0
  27. package/Base/managers/ResponsiveOptionsManager.js +1 -0
  28. package/Base/managers/ResponsiveOptionsManager.js.map +7 -0
  29. package/Base/managers/ServicesManager.cjs +3 -12
  30. package/Base/managers/ServicesManager.cjs.map +7 -0
  31. package/Base/managers/ServicesManager.js +3 -13
  32. package/Base/managers/ServicesManager.js.map +7 -0
  33. package/Base/types.cjs +1 -0
  34. package/Base/types.cjs.map +7 -0
  35. package/Base/types.js +1 -0
  36. package/Base/types.js.map +7 -0
  37. package/Base/utils.cjs +1 -0
  38. package/Base/utils.cjs.map +7 -0
  39. package/Base/utils.js +1 -0
  40. package/Base/utils.js.map +7 -0
  41. package/decorators/index.cjs +1 -0
  42. package/decorators/index.cjs.map +7 -0
  43. package/decorators/index.js +1 -0
  44. package/decorators/index.js.map +7 -0
  45. package/decorators/withBreakpointManager.cjs +1 -0
  46. package/decorators/withBreakpointManager.cjs.map +7 -0
  47. package/decorators/withBreakpointManager.js +1 -0
  48. package/decorators/withBreakpointManager.js.map +7 -0
  49. package/decorators/withBreakpointObserver.cjs +10 -15
  50. package/decorators/withBreakpointObserver.cjs.map +7 -0
  51. package/decorators/withBreakpointObserver.js +10 -16
  52. package/decorators/withBreakpointObserver.js.map +7 -0
  53. package/decorators/withDrag.cjs +5 -9
  54. package/decorators/withDrag.cjs.map +7 -0
  55. package/decorators/withDrag.js +5 -10
  56. package/decorators/withDrag.js.map +7 -0
  57. package/decorators/withExtraConfig.cjs +2 -6
  58. package/decorators/withExtraConfig.cjs.map +7 -0
  59. package/decorators/withExtraConfig.js +2 -7
  60. package/decorators/withExtraConfig.js.map +7 -0
  61. package/decorators/withFreezedOptions.cjs +2 -9
  62. package/decorators/withFreezedOptions.cjs.map +7 -0
  63. package/decorators/withFreezedOptions.js +2 -10
  64. package/decorators/withFreezedOptions.js.map +7 -0
  65. package/decorators/withIntersectionObserver.cjs +11 -16
  66. package/decorators/withIntersectionObserver.cjs.map +7 -0
  67. package/decorators/withIntersectionObserver.js +11 -17
  68. package/decorators/withIntersectionObserver.js.map +7 -0
  69. package/decorators/withMountWhenInView.cjs +11 -16
  70. package/decorators/withMountWhenInView.cjs.map +7 -0
  71. package/decorators/withMountWhenInView.js +11 -17
  72. package/decorators/withMountWhenInView.js.map +7 -0
  73. package/decorators/withResponsiveOptions.cjs +1 -0
  74. package/decorators/withResponsiveOptions.cjs.map +7 -0
  75. package/decorators/withResponsiveOptions.js +1 -0
  76. package/decorators/withResponsiveOptions.js.map +7 -0
  77. package/decorators/withScrolledInView.cjs +45 -50
  78. package/decorators/withScrolledInView.cjs.map +7 -0
  79. package/decorators/withScrolledInView.js +45 -51
  80. package/decorators/withScrolledInView.js.map +7 -0
  81. package/decorators/withVue2.cjs +9 -15
  82. package/decorators/withVue2.cjs.map +7 -0
  83. package/decorators/withVue2.js +9 -16
  84. package/decorators/withVue2.js.map +7 -0
  85. package/helpers/createApp.cjs +1 -0
  86. package/helpers/createApp.cjs.map +7 -0
  87. package/helpers/createApp.js +1 -0
  88. package/helpers/createApp.js.map +7 -0
  89. package/helpers/getClosestParent.cjs +1 -0
  90. package/helpers/getClosestParent.cjs.map +7 -0
  91. package/helpers/getClosestParent.js +1 -0
  92. package/helpers/getClosestParent.js.map +7 -0
  93. package/helpers/getDirectChildren.cjs +1 -0
  94. package/helpers/getDirectChildren.cjs.map +7 -0
  95. package/helpers/getDirectChildren.js +1 -0
  96. package/helpers/getDirectChildren.js.map +7 -0
  97. package/helpers/getInstanceFromElement.cjs +1 -0
  98. package/helpers/getInstanceFromElement.cjs.map +7 -0
  99. package/helpers/getInstanceFromElement.js +1 -0
  100. package/helpers/getInstanceFromElement.js.map +7 -0
  101. package/helpers/importOnInteraction.cjs +2 -1
  102. package/helpers/importOnInteraction.cjs.map +7 -0
  103. package/helpers/importOnInteraction.js +2 -1
  104. package/helpers/importOnInteraction.js.map +7 -0
  105. package/helpers/importWhenIdle.cjs +1 -0
  106. package/helpers/importWhenIdle.cjs.map +7 -0
  107. package/helpers/importWhenIdle.js +1 -0
  108. package/helpers/importWhenIdle.js.map +7 -0
  109. package/helpers/importWhenVisible.cjs +2 -1
  110. package/helpers/importWhenVisible.cjs.map +7 -0
  111. package/helpers/importWhenVisible.js +2 -1
  112. package/helpers/importWhenVisible.js.map +7 -0
  113. package/helpers/index.cjs +1 -0
  114. package/helpers/index.cjs.map +7 -0
  115. package/helpers/index.js +1 -0
  116. package/helpers/index.js.map +7 -0
  117. package/helpers/utils.cjs +1 -0
  118. package/helpers/utils.cjs.map +7 -0
  119. package/helpers/utils.js +1 -0
  120. package/helpers/utils.js.map +7 -0
  121. package/index.cjs +1 -0
  122. package/index.cjs.map +7 -0
  123. package/index.js +1 -0
  124. package/index.js.map +7 -0
  125. package/package.json +1 -1
  126. package/services/drag.cjs +1 -0
  127. package/services/drag.cjs.map +7 -0
  128. package/services/drag.js +1 -0
  129. package/services/drag.js.map +7 -0
  130. package/services/index.cjs +1 -0
  131. package/services/index.cjs.map +7 -0
  132. package/services/index.js +1 -0
  133. package/services/index.js.map +7 -0
  134. package/services/key.cjs +2 -1
  135. package/services/key.cjs.map +7 -0
  136. package/services/key.js +2 -1
  137. package/services/key.js.map +7 -0
  138. package/services/load.cjs +1 -0
  139. package/services/load.cjs.map +7 -0
  140. package/services/load.js +1 -0
  141. package/services/load.js.map +7 -0
  142. package/services/pointer.cjs +3 -3
  143. package/services/pointer.cjs.map +7 -0
  144. package/services/pointer.js +3 -3
  145. package/services/pointer.js.map +7 -0
  146. package/services/raf.cjs +1 -0
  147. package/services/raf.cjs.map +7 -0
  148. package/services/raf.js +1 -0
  149. package/services/raf.js.map +7 -0
  150. package/services/resize.cjs +1 -0
  151. package/services/resize.cjs.map +7 -0
  152. package/services/resize.js +1 -0
  153. package/services/resize.js.map +7 -0
  154. package/services/scroll.cjs +1 -0
  155. package/services/scroll.cjs.map +7 -0
  156. package/services/scroll.js +1 -0
  157. package/services/scroll.js.map +7 -0
  158. package/services/service.cjs +1 -0
  159. package/services/service.cjs.map +7 -0
  160. package/services/service.js +1 -0
  161. package/services/service.js.map +7 -0
  162. package/utils/collide/boundingRectToCircle.cjs +1 -0
  163. package/utils/collide/boundingRectToCircle.cjs.map +7 -0
  164. package/utils/collide/boundingRectToCircle.js +1 -0
  165. package/utils/collide/boundingRectToCircle.js.map +7 -0
  166. package/utils/collide/collideCircleCircle.cjs +1 -0
  167. package/utils/collide/collideCircleCircle.cjs.map +7 -0
  168. package/utils/collide/collideCircleCircle.js +1 -0
  169. package/utils/collide/collideCircleCircle.js.map +7 -0
  170. package/utils/collide/collideCircleRect.cjs +1 -0
  171. package/utils/collide/collideCircleRect.cjs.map +7 -0
  172. package/utils/collide/collideCircleRect.js +1 -0
  173. package/utils/collide/collideCircleRect.js.map +7 -0
  174. package/utils/collide/collidePointCircle.cjs +1 -0
  175. package/utils/collide/collidePointCircle.cjs.map +7 -0
  176. package/utils/collide/collidePointCircle.js +1 -0
  177. package/utils/collide/collidePointCircle.js.map +7 -0
  178. package/utils/collide/collidePointRect.cjs +1 -0
  179. package/utils/collide/collidePointRect.cjs.map +7 -0
  180. package/utils/collide/collidePointRect.js +1 -0
  181. package/utils/collide/collidePointRect.js.map +7 -0
  182. package/utils/collide/collideRectRect.cjs +1 -0
  183. package/utils/collide/collideRectRect.cjs.map +7 -0
  184. package/utils/collide/collideRectRect.js +1 -0
  185. package/utils/collide/collideRectRect.js.map +7 -0
  186. package/utils/collide/index.cjs +1 -0
  187. package/utils/collide/index.cjs.map +7 -0
  188. package/utils/collide/index.js +1 -0
  189. package/utils/collide/index.js.map +7 -0
  190. package/utils/css/animate.cjs +10 -13
  191. package/utils/css/animate.cjs.map +7 -0
  192. package/utils/css/animate.js +10 -13
  193. package/utils/css/animate.js.map +7 -0
  194. package/utils/css/classes.cjs +2 -1
  195. package/utils/css/classes.cjs.map +7 -0
  196. package/utils/css/classes.js +2 -1
  197. package/utils/css/classes.js.map +7 -0
  198. package/utils/css/getOffsetSizes.cjs +1 -0
  199. package/utils/css/getOffsetSizes.cjs.map +7 -0
  200. package/utils/css/getOffsetSizes.js +1 -0
  201. package/utils/css/getOffsetSizes.js.map +7 -0
  202. package/utils/css/index.cjs +1 -0
  203. package/utils/css/index.cjs.map +7 -0
  204. package/utils/css/index.js +1 -0
  205. package/utils/css/index.js.map +7 -0
  206. package/utils/css/matrix.cjs +2 -2
  207. package/utils/css/matrix.cjs.map +7 -0
  208. package/utils/css/matrix.js +2 -2
  209. package/utils/css/matrix.js.map +7 -0
  210. package/utils/css/styles.cjs +1 -0
  211. package/utils/css/styles.cjs.map +7 -0
  212. package/utils/css/styles.js +1 -0
  213. package/utils/css/styles.js.map +7 -0
  214. package/utils/css/transform.cjs +2 -2
  215. package/utils/css/transform.cjs.map +7 -0
  216. package/utils/css/transform.js +2 -2
  217. package/utils/css/transform.js.map +7 -0
  218. package/utils/css/transition.cjs +3 -7
  219. package/utils/css/transition.cjs.map +7 -0
  220. package/utils/css/transition.js +3 -8
  221. package/utils/css/transition.js.map +7 -0
  222. package/utils/css/utils.cjs +1 -0
  223. package/utils/css/utils.cjs.map +7 -0
  224. package/utils/css/utils.js +1 -0
  225. package/utils/css/utils.js.map +7 -0
  226. package/utils/debounce.cjs +1 -0
  227. package/utils/debounce.cjs.map +7 -0
  228. package/utils/debounce.js +1 -0
  229. package/utils/debounce.js.map +7 -0
  230. package/utils/focusTrap.cjs +1 -0
  231. package/utils/focusTrap.cjs.map +7 -0
  232. package/utils/focusTrap.js +1 -0
  233. package/utils/focusTrap.js.map +7 -0
  234. package/utils/has.cjs +1 -0
  235. package/utils/has.cjs.map +7 -0
  236. package/utils/has.js +1 -0
  237. package/utils/has.js.map +7 -0
  238. package/utils/history.cjs +1 -0
  239. package/utils/history.cjs.map +7 -0
  240. package/utils/history.js +1 -0
  241. package/utils/history.js.map +7 -0
  242. package/utils/index.cjs +1 -0
  243. package/utils/index.cjs.map +7 -0
  244. package/utils/index.js +1 -0
  245. package/utils/index.js.map +7 -0
  246. package/utils/is.cjs +1 -0
  247. package/utils/is.cjs.map +7 -0
  248. package/utils/is.js +1 -0
  249. package/utils/is.js.map +7 -0
  250. package/utils/keyCodes.cjs +1 -0
  251. package/utils/keyCodes.cjs.map +7 -0
  252. package/utils/keyCodes.js +1 -0
  253. package/utils/keyCodes.js.map +7 -0
  254. package/utils/math/clamp.cjs +1 -0
  255. package/utils/math/clamp.cjs.map +7 -0
  256. package/utils/math/clamp.js +1 -0
  257. package/utils/math/clamp.js.map +7 -0
  258. package/utils/math/clamp01.cjs +1 -0
  259. package/utils/math/clamp01.cjs.map +7 -0
  260. package/utils/math/clamp01.js +1 -0
  261. package/utils/math/clamp01.js.map +7 -0
  262. package/utils/math/createEases.cjs +1 -0
  263. package/utils/math/createEases.cjs.map +7 -0
  264. package/utils/math/createEases.js +1 -0
  265. package/utils/math/createEases.js.map +7 -0
  266. package/utils/math/damp.cjs +1 -0
  267. package/utils/math/damp.cjs.map +7 -0
  268. package/utils/math/damp.js +1 -0
  269. package/utils/math/damp.js.map +7 -0
  270. package/utils/math/ease.cjs +1 -0
  271. package/utils/math/ease.cjs.map +7 -0
  272. package/utils/math/ease.js +1 -0
  273. package/utils/math/ease.js.map +7 -0
  274. package/utils/math/index.cjs +1 -0
  275. package/utils/math/index.cjs.map +7 -0
  276. package/utils/math/index.js +1 -0
  277. package/utils/math/index.js.map +7 -0
  278. package/utils/math/inertiaFinalValue.cjs +1 -0
  279. package/utils/math/inertiaFinalValue.cjs.map +7 -0
  280. package/utils/math/inertiaFinalValue.js +1 -0
  281. package/utils/math/inertiaFinalValue.js.map +7 -0
  282. package/utils/math/lerp.cjs +1 -0
  283. package/utils/math/lerp.cjs.map +7 -0
  284. package/utils/math/lerp.js +1 -0
  285. package/utils/math/lerp.js.map +7 -0
  286. package/utils/math/map.cjs +1 -0
  287. package/utils/math/map.cjs.map +7 -0
  288. package/utils/math/map.js +1 -0
  289. package/utils/math/map.js.map +7 -0
  290. package/utils/math/round.cjs +1 -0
  291. package/utils/math/round.cjs.map +7 -0
  292. package/utils/math/round.js +1 -0
  293. package/utils/math/round.js.map +7 -0
  294. package/utils/memoize.cjs +1 -0
  295. package/utils/memoize.cjs.map +7 -0
  296. package/utils/memoize.js +1 -0
  297. package/utils/memoize.js.map +7 -0
  298. package/utils/nextFrame.cjs +1 -0
  299. package/utils/nextFrame.cjs.map +7 -0
  300. package/utils/nextFrame.js +1 -0
  301. package/utils/nextFrame.js.map +7 -0
  302. package/utils/nextMicrotask.cjs +1 -0
  303. package/utils/nextMicrotask.cjs.map +7 -0
  304. package/utils/nextMicrotask.js +1 -0
  305. package/utils/nextMicrotask.js.map +7 -0
  306. package/utils/nextTick.cjs +1 -0
  307. package/utils/nextTick.cjs.map +7 -0
  308. package/utils/nextTick.js +1 -0
  309. package/utils/nextTick.js.map +7 -0
  310. package/utils/noop.cjs +1 -0
  311. package/utils/noop.cjs.map +7 -0
  312. package/utils/noop.js +1 -0
  313. package/utils/noop.js.map +7 -0
  314. package/utils/object/autoBind.cjs +1 -0
  315. package/utils/object/autoBind.cjs.map +7 -0
  316. package/utils/object/autoBind.js +1 -0
  317. package/utils/object/autoBind.js.map +7 -0
  318. package/utils/object/getAllProperties.cjs +1 -0
  319. package/utils/object/getAllProperties.cjs.map +7 -0
  320. package/utils/object/getAllProperties.js +1 -0
  321. package/utils/object/getAllProperties.js.map +7 -0
  322. package/utils/object/index.cjs +1 -0
  323. package/utils/object/index.cjs.map +7 -0
  324. package/utils/object/index.js +1 -0
  325. package/utils/object/index.js.map +7 -0
  326. package/utils/scheduler.cjs +1 -0
  327. package/utils/scheduler.cjs.map +7 -0
  328. package/utils/scheduler.js +1 -0
  329. package/utils/scheduler.js.map +7 -0
  330. package/utils/scrollTo.cjs +1 -0
  331. package/utils/scrollTo.cjs.map +7 -0
  332. package/utils/scrollTo.d.ts +1 -1
  333. package/utils/scrollTo.js +1 -0
  334. package/utils/scrollTo.js.map +7 -0
  335. package/utils/string/index.cjs +1 -0
  336. package/utils/string/index.cjs.map +7 -0
  337. package/utils/string/index.js +1 -0
  338. package/utils/string/index.js.map +7 -0
  339. package/utils/string/withLeadingCharacters.cjs +1 -0
  340. package/utils/string/withLeadingCharacters.cjs.map +7 -0
  341. package/utils/string/withLeadingCharacters.js +1 -0
  342. package/utils/string/withLeadingCharacters.js.map +7 -0
  343. package/utils/string/withLeadingSlash.cjs +1 -0
  344. package/utils/string/withLeadingSlash.cjs.map +7 -0
  345. package/utils/string/withLeadingSlash.js +1 -0
  346. package/utils/string/withLeadingSlash.js.map +7 -0
  347. package/utils/string/withTrailingCharacters.cjs +1 -0
  348. package/utils/string/withTrailingCharacters.cjs.map +7 -0
  349. package/utils/string/withTrailingCharacters.js +1 -0
  350. package/utils/string/withTrailingCharacters.js.map +7 -0
  351. package/utils/string/withTrailingSlash.cjs +1 -0
  352. package/utils/string/withTrailingSlash.cjs.map +7 -0
  353. package/utils/string/withTrailingSlash.js +1 -0
  354. package/utils/string/withTrailingSlash.js.map +7 -0
  355. package/utils/string/withoutLeadingCharacters.cjs +1 -0
  356. package/utils/string/withoutLeadingCharacters.cjs.map +7 -0
  357. package/utils/string/withoutLeadingCharacters.js +1 -0
  358. package/utils/string/withoutLeadingCharacters.js.map +7 -0
  359. package/utils/string/withoutLeadingCharactersRecursive.cjs +1 -0
  360. package/utils/string/withoutLeadingCharactersRecursive.cjs.map +7 -0
  361. package/utils/string/withoutLeadingCharactersRecursive.js +1 -0
  362. package/utils/string/withoutLeadingCharactersRecursive.js.map +7 -0
  363. package/utils/string/withoutLeadingSlash.cjs +1 -0
  364. package/utils/string/withoutLeadingSlash.cjs.map +7 -0
  365. package/utils/string/withoutLeadingSlash.js +1 -0
  366. package/utils/string/withoutLeadingSlash.js.map +7 -0
  367. package/utils/string/withoutTrailingCharacters.cjs +1 -0
  368. package/utils/string/withoutTrailingCharacters.cjs.map +7 -0
  369. package/utils/string/withoutTrailingCharacters.js +1 -0
  370. package/utils/string/withoutTrailingCharacters.js.map +7 -0
  371. package/utils/string/withoutTrailingCharactersRecursive.cjs +1 -0
  372. package/utils/string/withoutTrailingCharactersRecursive.cjs.map +7 -0
  373. package/utils/string/withoutTrailingCharactersRecursive.js +1 -0
  374. package/utils/string/withoutTrailingCharactersRecursive.js.map +7 -0
  375. package/utils/string/withoutTrailingSlash.cjs +1 -0
  376. package/utils/string/withoutTrailingSlash.cjs.map +7 -0
  377. package/utils/string/withoutTrailingSlash.js +1 -0
  378. package/utils/string/withoutTrailingSlash.js.map +7 -0
  379. package/utils/throttle.cjs +1 -0
  380. package/utils/throttle.cjs.map +7 -0
  381. package/utils/throttle.js +1 -0
  382. package/utils/throttle.js.map +7 -0
  383. package/utils/tween.cjs +2 -2
  384. package/utils/tween.cjs.map +7 -0
  385. package/utils/tween.d.ts +7 -1
  386. package/utils/tween.js +2 -2
  387. package/utils/tween.js.map +7 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/damp.js"],
4
+ "sourcesContent": ["/**\n * Get the next damped value for a given factor.\n *\n * @param {number} targetValue The final value.\n * @param {number} currentValue The current value.\n * @param {number} [factor=0.5] The factor used to reach the target value.\n * @param {number} [precision=0.01] The precision used to calculate the latest value.\n * @returns {number} The next value.\n */\nexport default function damp(targetValue, currentValue, factor = 0.5, precision = 0.01) {\n return Math.abs(targetValue - currentValue) < precision\n ? targetValue\n : currentValue + (targetValue - currentValue) * factor;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASe,SAAR,KAAsB,aAAa,cAAc,SAAS,KAAK,YAAY,MAAM;AACtF,SAAO,KAAK,IAAI,cAAc,YAAY,IAAI,YAC1C,cACA,gBAAgB,cAAc,gBAAgB;AACpD;",
6
+ "names": []
7
+ }
@@ -4,3 +4,4 @@ function damp(targetValue, currentValue, factor = 0.5, precision = 0.01) {
4
4
  export {
5
5
  damp as default
6
6
  };
7
+ //# sourceMappingURL=damp.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/damp.js"],
4
+ "sourcesContent": ["/**\n * Get the next damped value for a given factor.\n *\n * @param {number} targetValue The final value.\n * @param {number} currentValue The current value.\n * @param {number} [factor=0.5] The factor used to reach the target value.\n * @param {number} [precision=0.01] The precision used to calculate the latest value.\n * @returns {number} The next value.\n */\nexport default function damp(targetValue, currentValue, factor = 0.5, precision = 0.01) {\n return Math.abs(targetValue - currentValue) < precision\n ? targetValue\n : currentValue + (targetValue - currentValue) * factor;\n}\n"],
5
+ "mappings": "AASe,SAAR,KAAsB,aAAa,cAAc,SAAS,KAAK,YAAY,MAAM;AACtF,SAAO,KAAK,IAAI,cAAc,YAAY,IAAI,YAC1C,cACA,gBAAgB,cAAc,gBAAgB;AACpD;",
6
+ "names": []
7
+ }
@@ -79,3 +79,4 @@ function easeInExpo(progress) {
79
79
  var easeOutExpo = (0, import_createEases.createEaseOut)(easeInExpo);
80
80
  var easeInOutExpo = (0, import_createEases.createEaseInOut)(easeInExpo);
81
81
  if (module.exports.default) module.exports = module.exports.default;
82
+ //# sourceMappingURL=ease.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/ease.js"],
4
+ "sourcesContent": ["import { createEaseOut, createEaseInOut } from './createEases.js';\n\n/**\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuad(progress) {\n return progress ** 2;\n}\n\nexport const easeOutQuad = createEaseOut(easeInQuad);\nexport const easeInOutQuad = createEaseInOut(easeInQuad);\n\n/**\n * Ease in cubic.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCubic(progress) {\n return progress ** 3;\n}\n\nexport const easeOutCubic = createEaseOut(easeInCubic);\nexport const easeInOutCubic = createEaseInOut(easeInCubic);\n\n/**\n * Ease in quart.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuart(progress) {\n return progress ** 4;\n}\n\nexport const easeOutQuart = createEaseOut(easeInQuart);\nexport const easeInOutQuart = createEaseInOut(easeInQuart);\n\n/**\n * Ease in quint.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuint(progress) {\n return progress ** 5;\n}\n\nexport const easeOutQuint = createEaseOut(easeInQuint);\nexport const easeInOutQuint = createEaseInOut(easeInQuint);\n\n/**\n * Ease in sine.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInSine(progress) {\n return progress === 1 ? 1 : -Math.cos((progress * Math.PI) / 2) + 1;\n}\n\nexport const easeOutSine = createEaseOut(easeInSine);\nexport const easeInOutSine = createEaseInOut(easeInSine);\n\n/**\n * Ease in circ.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCirc(progress) {\n return -(Math.sqrt(1 - progress * progress) - 1);\n}\n\nexport const easeOutCirc = createEaseOut(easeInCirc);\nexport const easeInOutCirc = createEaseInOut(easeInCirc);\n\n/**\n * Ease in exponential.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInExpo(progress) {\n return 2 ** (10 * (progress - 1));\n}\n\nexport const easeOutExpo = createEaseOut(easeInExpo);\nexport const easeInOutExpo = createEaseInOut(easeInExpo);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA+C;AAMxC,SAAS,WAAW,UAAU;AACnC,SAAO,YAAY;AACrB;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,YAAY,UAAU;AACpC,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,YAAY,UAAU;AACpC,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,YAAY,UAAU;AACpC,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,WAAW,UAAU;AACnC,SAAO,aAAa,IAAI,IAAI,CAAC,KAAK,IAAK,WAAW,KAAK,KAAM,CAAC,IAAI;AACpE;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,WAAW,UAAU;AACnC,SAAO,EAAE,KAAK,KAAK,IAAI,WAAW,QAAQ,IAAI;AAChD;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,WAAW,UAAU;AACnC,SAAO,MAAM,MAAM,WAAW;AAChC;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;",
6
+ "names": []
7
+ }
@@ -57,3 +57,4 @@ export {
57
57
  easeOutQuint,
58
58
  easeOutSine
59
59
  };
60
+ //# sourceMappingURL=ease.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/ease.js"],
4
+ "sourcesContent": ["import { createEaseOut, createEaseInOut } from './createEases.js';\n\n/**\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuad(progress) {\n return progress ** 2;\n}\n\nexport const easeOutQuad = createEaseOut(easeInQuad);\nexport const easeInOutQuad = createEaseInOut(easeInQuad);\n\n/**\n * Ease in cubic.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCubic(progress) {\n return progress ** 3;\n}\n\nexport const easeOutCubic = createEaseOut(easeInCubic);\nexport const easeInOutCubic = createEaseInOut(easeInCubic);\n\n/**\n * Ease in quart.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuart(progress) {\n return progress ** 4;\n}\n\nexport const easeOutQuart = createEaseOut(easeInQuart);\nexport const easeInOutQuart = createEaseInOut(easeInQuart);\n\n/**\n * Ease in quint.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInQuint(progress) {\n return progress ** 5;\n}\n\nexport const easeOutQuint = createEaseOut(easeInQuint);\nexport const easeInOutQuint = createEaseInOut(easeInQuint);\n\n/**\n * Ease in sine.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInSine(progress) {\n return progress === 1 ? 1 : -Math.cos((progress * Math.PI) / 2) + 1;\n}\n\nexport const easeOutSine = createEaseOut(easeInSine);\nexport const easeInOutSine = createEaseInOut(easeInSine);\n\n/**\n * Ease in circ.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInCirc(progress) {\n return -(Math.sqrt(1 - progress * progress) - 1);\n}\n\nexport const easeOutCirc = createEaseOut(easeInCirc);\nexport const easeInOutCirc = createEaseInOut(easeInCirc);\n\n/**\n * Ease in exponential.\n *\n * @param {number} progress Progress value betwen 0 and 1.\n * @returns {number} Eased value between 0 and 1.\n */\nexport function easeInExpo(progress) {\n return 2 ** (10 * (progress - 1));\n}\n\nexport const easeOutExpo = createEaseOut(easeInExpo);\nexport const easeInOutExpo = createEaseInOut(easeInExpo);\n"],
5
+ "mappings": "AAAA,SAAS,eAAe,uBAAuB;AAMxC,SAAS,WAAW,UAAU;AACnC,SAAO,YAAY;AACrB;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;AAQhD,SAAS,YAAY,UAAU;AACpC,SAAO,YAAY;AACrB;AAEO,MAAM,eAAe,cAAc,WAAW;AAC9C,MAAM,iBAAiB,gBAAgB,WAAW;AAQlD,SAAS,YAAY,UAAU;AACpC,SAAO,YAAY;AACrB;AAEO,MAAM,eAAe,cAAc,WAAW;AAC9C,MAAM,iBAAiB,gBAAgB,WAAW;AAQlD,SAAS,YAAY,UAAU;AACpC,SAAO,YAAY;AACrB;AAEO,MAAM,eAAe,cAAc,WAAW;AAC9C,MAAM,iBAAiB,gBAAgB,WAAW;AAQlD,SAAS,WAAW,UAAU;AACnC,SAAO,aAAa,IAAI,IAAI,CAAC,KAAK,IAAK,WAAW,KAAK,KAAM,CAAC,IAAI;AACpE;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;AAQhD,SAAS,WAAW,UAAU;AACnC,SAAO,EAAE,KAAK,KAAK,IAAI,WAAW,QAAQ,IAAI;AAChD;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;AAQhD,SAAS,WAAW,UAAU;AACnC,SAAO,MAAM,MAAM,WAAW;AAChC;AAEO,MAAM,cAAc,cAAc,UAAU;AAC5C,MAAM,gBAAgB,gBAAgB,UAAU;",
6
+ "names": []
7
+ }
@@ -47,3 +47,4 @@ __reExport(math_exports, require("./ease.cjs"), module.exports);
47
47
  var ease = __toESM(require("./ease.cjs"), 1);
48
48
  __reExport(math_exports, require("./createEases.cjs"), module.exports);
49
49
  if (module.exports.default) module.exports = module.exports.default;
50
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/index.js"],
4
+ "sourcesContent": ["export { default as clamp } from './clamp.js';\nexport { default as clamp01 } from './clamp01.js';\nexport { default as damp } from './damp.js';\nexport { default as inertiaFinalValue } from './inertiaFinalValue.js';\nexport { default as lerp } from './lerp.js';\nexport { default as map } from './map.js';\nexport { default as round } from './round.js';\nexport * from './ease.js';\nexport * as ease from './ease.js';\nexport * from './createEases.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,qBAAmC;AACnC,kBAAgC;AAChC,+BAA6C;AAC7C,kBAAgC;AAChC,iBAA+B;AAC/B,mBAAiC;AACjC,yBAAc,uBAPd;AAQA,WAAsB;AACtB,yBAAc,8BATd;",
6
+ "names": []
7
+ }
@@ -18,3 +18,4 @@ export {
18
18
  default7 as map,
19
19
  default8 as round
20
20
  };
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/index.js"],
4
+ "sourcesContent": ["export { default as clamp } from './clamp.js';\nexport { default as clamp01 } from './clamp01.js';\nexport { default as damp } from './damp.js';\nexport { default as inertiaFinalValue } from './inertiaFinalValue.js';\nexport { default as lerp } from './lerp.js';\nexport { default as map } from './map.js';\nexport { default as round } from './round.js';\nexport * from './ease.js';\nexport * as ease from './ease.js';\nexport * from './createEases.js';\n"],
5
+ "mappings": "AAAA,SAAoB,WAAXA,gBAAwB;AACjC,SAAoB,WAAXA,gBAA0B;AACnC,SAAoB,WAAXA,gBAAuB;AAChC,SAAoB,WAAXA,gBAAoC;AAC7C,SAAoB,WAAXA,gBAAuB;AAChC,SAAoB,WAAXA,gBAAsB;AAC/B,SAAoB,WAAXA,gBAAwB;AACjC,cAAc;AACd,YAAY,UAAU;AACtB,cAAc;",
6
+ "names": ["default"]
7
+ }
@@ -40,3 +40,4 @@ function inertiaFinalValue(initialValue, initialDelta, dampFactor = 0.85) {
40
40
  return finalValue;
41
41
  }
42
42
  if (module.exports.default) module.exports = module.exports.default;
43
+ //# sourceMappingURL=inertiaFinalValue.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/inertiaFinalValue.js"],
4
+ "sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Get the final damped value for a given factor.\n *\n * @param {number} initialValue The final value.\n * @param {number} initialDelta The current value.\n * @param {number} [dampFactor=0.85] The speed to reach the target value.\n * @returns {number} The next value.\n */\nexport default function inertiaFinalValue(initialValue, initialDelta, dampFactor = 0.85) {\n // eslint-disable-next-line no-param-reassign\n dampFactor = clamp(dampFactor, 0.00001, 0.99999);\n let delta = initialDelta;\n let finalValue = initialValue;\n\n while (Math.abs(delta) > 0.1) {\n finalValue += delta;\n delta *= dampFactor;\n }\n\n return finalValue;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAUH,SAAR,kBAAmC,cAAc,cAAc,aAAa,MAAM;AAEvF,mBAAa,aAAAA,SAAM,YAAY,MAAS,OAAO;AAC/C,MAAI,QAAQ;AACZ,MAAI,aAAa;AAEjB,SAAO,KAAK,IAAI,KAAK,IAAI,KAAK;AAC5B,kBAAc;AACd,aAAS;AAAA,EACX;AAEA,SAAO;AACT;",
6
+ "names": ["clamp"]
7
+ }
@@ -12,3 +12,4 @@ function inertiaFinalValue(initialValue, initialDelta, dampFactor = 0.85) {
12
12
  export {
13
13
  inertiaFinalValue as default
14
14
  };
15
+ //# sourceMappingURL=inertiaFinalValue.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/inertiaFinalValue.js"],
4
+ "sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Get the final damped value for a given factor.\n *\n * @param {number} initialValue The final value.\n * @param {number} initialDelta The current value.\n * @param {number} [dampFactor=0.85] The speed to reach the target value.\n * @returns {number} The next value.\n */\nexport default function inertiaFinalValue(initialValue, initialDelta, dampFactor = 0.85) {\n // eslint-disable-next-line no-param-reassign\n dampFactor = clamp(dampFactor, 0.00001, 0.99999);\n let delta = initialDelta;\n let finalValue = initialValue;\n\n while (Math.abs(delta) > 0.1) {\n finalValue += delta;\n delta *= dampFactor;\n }\n\n return finalValue;\n}\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAUH,SAAR,kBAAmC,cAAc,cAAc,aAAa,MAAM;AAEvF,eAAa,MAAM,YAAY,MAAS,OAAO;AAC/C,MAAI,QAAQ;AACZ,MAAI,aAAa;AAEjB,SAAO,KAAK,IAAI,KAAK,IAAI,KAAK;AAC5B,kBAAc;AACd,aAAS;AAAA,EACX;AAEA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -26,3 +26,4 @@ function lerp(min, max, ratio) {
26
26
  return (1 - ratio) * min + ratio * max;
27
27
  }
28
28
  if (module.exports.default) module.exports = module.exports.default;
29
+ //# sourceMappingURL=lerp.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/lerp.js"],
4
+ "sourcesContent": ["/**\n * Interpolate the ratio between a given interval.\n *\n * @param {number} min The interval minimum value.\n * @param {number} max The inverval maximum value.\n * @param {number} ratio The ratio to get.\n * @returns {number} The value between min and max corresponding to ratio.\n */\nexport default function lerp(min, max, ratio) {\n return (1 - ratio) * min + ratio * max;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQe,SAAR,KAAsB,KAAK,KAAK,OAAO;AAC5C,UAAQ,IAAI,SAAS,MAAM,QAAQ;AACrC;",
6
+ "names": []
7
+ }
@@ -4,3 +4,4 @@ function lerp(min, max, ratio) {
4
4
  export {
5
5
  lerp as default
6
6
  };
7
+ //# sourceMappingURL=lerp.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/lerp.js"],
4
+ "sourcesContent": ["/**\n * Interpolate the ratio between a given interval.\n *\n * @param {number} min The interval minimum value.\n * @param {number} max The inverval maximum value.\n * @param {number} ratio The ratio to get.\n * @returns {number} The value between min and max corresponding to ratio.\n */\nexport default function lerp(min, max, ratio) {\n return (1 - ratio) * min + ratio * max;\n}\n"],
5
+ "mappings": "AAQe,SAAR,KAAsB,KAAK,KAAK,OAAO;AAC5C,UAAQ,IAAI,SAAS,MAAM,QAAQ;AACrC;",
6
+ "names": []
7
+ }
@@ -26,3 +26,4 @@ function map(value, inputMin, inputMax, outputMin, outputMax) {
26
26
  return (value - inputMin) * (outputMax - outputMin) / (inputMax - inputMin) + outputMin;
27
27
  }
28
28
  if (module.exports.default) module.exports = module.exports.default;
29
+ //# sourceMappingURL=map.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/map.js"],
4
+ "sourcesContent": ["/**\n * Maps the value from one range of [inputMin..inputMax] to another range of [outputMin..outputMax].\n *\n * @param {number} value The value to map.\n * @param {number} inputMin The input's minimum value.\n * @param {number} inputMax The input's maximum value.\n * @param {number} outputMin The output's minimum value.\n * @param {number} outputMax The output's maximum value.\n * @returns {number} The input value mapped to the output range.\n */\nexport default function map(value, inputMin, inputMax, outputMin, outputMax) {\n return ((value - inputMin) * (outputMax - outputMin)) / (inputMax - inputMin) + outputMin;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUe,SAAR,IAAqB,OAAO,UAAU,UAAU,WAAW,WAAW;AAC3E,UAAS,QAAQ,aAAa,YAAY,cAAe,WAAW,YAAY;AAClF;",
6
+ "names": []
7
+ }
package/utils/math/map.js CHANGED
@@ -4,3 +4,4 @@ function map(value, inputMin, inputMax, outputMin, outputMax) {
4
4
  export {
5
5
  map as default
6
6
  };
7
+ //# sourceMappingURL=map.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/map.js"],
4
+ "sourcesContent": ["/**\n * Maps the value from one range of [inputMin..inputMax] to another range of [outputMin..outputMax].\n *\n * @param {number} value The value to map.\n * @param {number} inputMin The input's minimum value.\n * @param {number} inputMax The input's maximum value.\n * @param {number} outputMin The output's minimum value.\n * @param {number} outputMax The output's maximum value.\n * @returns {number} The input value mapped to the output range.\n */\nexport default function map(value, inputMin, inputMax, outputMin, outputMax) {\n return ((value - inputMin) * (outputMax - outputMin)) / (inputMax - inputMin) + outputMin;\n}\n"],
5
+ "mappings": "AAUe,SAAR,IAAqB,OAAO,UAAU,UAAU,WAAW,WAAW;AAC3E,UAAS,QAAQ,aAAa,YAAY,cAAe,WAAW,YAAY;AAClF;",
6
+ "names": []
7
+ }
@@ -26,3 +26,4 @@ function round(value, decimals = 0) {
26
26
  return Number(value.toFixed(decimals));
27
27
  }
28
28
  if (module.exports.default) module.exports = module.exports.default;
29
+ //# sourceMappingURL=round.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/round.js"],
4
+ "sourcesContent": ["/**\n * Round a value with a given number of decimals.\n *\n * @param {number} value The number to round.\n * @param {number} [decimals=0] The number of decimals to keep.\n * @returns {number} A rounded number to the given decimals length.\n */\nexport default function round(value, decimals = 0) {\n return Number(value.toFixed(decimals));\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,MAAuB,OAAO,WAAW,GAAG;AACjD,SAAO,OAAO,MAAM,QAAQ,QAAQ,CAAC;AACvC;",
6
+ "names": []
7
+ }
@@ -4,3 +4,4 @@ function round(value, decimals = 0) {
4
4
  export {
5
5
  round as default
6
6
  };
7
+ //# sourceMappingURL=round.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/math/round.js"],
4
+ "sourcesContent": ["/**\n * Round a value with a given number of decimals.\n *\n * @param {number} value The number to round.\n * @param {number} [decimals=0] The number of decimals to keep.\n * @returns {number} A rounded number to the given decimals length.\n */\nexport default function round(value, decimals = 0) {\n return Number(value.toFixed(decimals));\n}\n"],
5
+ "mappings": "AAOe,SAAR,MAAuB,OAAO,WAAW,GAAG;AACjD,SAAO,OAAO,MAAM,QAAQ,QAAQ,CAAC;AACvC;",
6
+ "names": []
7
+ }
package/utils/memoize.cjs CHANGED
@@ -41,3 +41,4 @@ function memoize(fn, { maxAge = Number.POSITIVE_INFINITY, cacheKey = JSON.string
41
41
  };
42
42
  }
43
43
  if (module.exports.default) module.exports = module.exports.default;
44
+ //# sourceMappingURL=memoize.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/memoize.js"],
4
+ "sourcesContent": ["/**\n * @typedef {Object} MemorizeCache\n * @property {(key:any) => boolean} has\n * @property {(key:any, value:any) => MemorizeCache} set\n * @property {(key:any) => any} get\n */\n\n/**\n * @typedef {Object} MemorizeOptions\n * @property {number} [maxAge]\n * @property {(...args:any) => any} [cacheKey]\n * @property {MemorizeCache} [cache]\n */\n\n/**\n * Memorize the output of a function.\n * @template {(...args:any) => any} T\n * @param {T} fn\n * @param {MemorizeOptions} options\n * @returns {(...args:Parameters<T>) => ReturnType<T>}\n */\nexport default function memoize(\n fn,\n { maxAge = Number.POSITIVE_INFINITY, cacheKey = JSON.stringify, cache = new Map() } = {},\n) {\n return function memoized(...args) {\n const key = cacheKey(args);\n const date = Date.now();\n\n if (cache.has(key)) {\n const cached = cache.get(key);\n\n if (date - cached.date < maxAge) {\n return cached.data;\n }\n }\n\n // @ts-ignore\n const data = fn(...args);\n\n cache.set(key, {\n data,\n date: Date.now(),\n });\n\n return data;\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBe,SAAR,QACL,IACA,EAAE,SAAS,OAAO,mBAAmB,WAAW,KAAK,WAAW,QAAQ,oBAAI,IAAI,EAAE,IAAI,CAAC,GACvF;AACA,SAAO,SAAS,YAAY,MAAM;AAChC,UAAM,MAAM,SAAS,IAAI;AACzB,UAAM,OAAO,KAAK,IAAI;AAEtB,QAAI,MAAM,IAAI,GAAG,GAAG;AAClB,YAAM,SAAS,MAAM,IAAI,GAAG;AAE5B,UAAI,OAAO,OAAO,OAAO,QAAQ;AAC/B,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAGA,UAAM,OAAO,GAAG,GAAG,IAAI;AAEvB,UAAM,IAAI,KAAK;AAAA,MACb;AAAA,MACA,MAAM,KAAK,IAAI;AAAA,IACjB,CAAC;AAED,WAAO;AAAA,EACT;AACF;",
6
+ "names": []
7
+ }
package/utils/memoize.js CHANGED
@@ -19,3 +19,4 @@ function memoize(fn, { maxAge = Number.POSITIVE_INFINITY, cacheKey = JSON.string
19
19
  export {
20
20
  memoize as default
21
21
  };
22
+ //# sourceMappingURL=memoize.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/memoize.js"],
4
+ "sourcesContent": ["/**\n * @typedef {Object} MemorizeCache\n * @property {(key:any) => boolean} has\n * @property {(key:any, value:any) => MemorizeCache} set\n * @property {(key:any) => any} get\n */\n\n/**\n * @typedef {Object} MemorizeOptions\n * @property {number} [maxAge]\n * @property {(...args:any) => any} [cacheKey]\n * @property {MemorizeCache} [cache]\n */\n\n/**\n * Memorize the output of a function.\n * @template {(...args:any) => any} T\n * @param {T} fn\n * @param {MemorizeOptions} options\n * @returns {(...args:Parameters<T>) => ReturnType<T>}\n */\nexport default function memoize(\n fn,\n { maxAge = Number.POSITIVE_INFINITY, cacheKey = JSON.stringify, cache = new Map() } = {},\n) {\n return function memoized(...args) {\n const key = cacheKey(args);\n const date = Date.now();\n\n if (cache.has(key)) {\n const cached = cache.get(key);\n\n if (date - cached.date < maxAge) {\n return cached.data;\n }\n }\n\n // @ts-ignore\n const data = fn(...args);\n\n cache.set(key, {\n data,\n date: Date.now(),\n });\n\n return data;\n };\n}\n"],
5
+ "mappings": "AAqBe,SAAR,QACL,IACA,EAAE,SAAS,OAAO,mBAAmB,WAAW,KAAK,WAAW,QAAQ,oBAAI,IAAI,EAAE,IAAI,CAAC,GACvF;AACA,SAAO,SAAS,YAAY,MAAM;AAChC,UAAM,MAAM,SAAS,IAAI;AACzB,UAAM,OAAO,KAAK,IAAI;AAEtB,QAAI,MAAM,IAAI,GAAG,GAAG;AAClB,YAAM,SAAS,MAAM,IAAI,GAAG;AAE5B,UAAI,OAAO,OAAO,OAAO,QAAQ;AAC/B,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAGA,UAAM,OAAO,GAAG,GAAG,IAAI;AAEvB,UAAM,IAAI,KAAK;AAAA,MACb;AAAA,MACA,MAAM,KAAK,IAAI;AAAA,IACjB,CAAC;AAED,WAAO;AAAA,EACT;AACF;",
6
+ "names": []
7
+ }
@@ -38,3 +38,4 @@ function nextFrame(fn) {
38
38
  });
39
39
  }
40
40
  if (module.exports.default) module.exports = module.exports.default;
41
+ //# sourceMappingURL=nextFrame.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/nextFrame.js"],
4
+ "sourcesContent": ["import { isFunction } from './is.js';\nimport { hasWindow } from './has.js';\n\n/**\n * RequestAnimation frame polyfill.\n * @see https://github.com/vuejs/vue/blob/ec78fc8b6d03e59da669be1adf4b4b5abf670a34/dist/vue.runtime.esm.js#L7355\n * @returns {(handler: Function) => number}\n */\nexport function getRaf() {\n return hasWindow() && window.requestAnimationFrame\n ? window.requestAnimationFrame.bind(window)\n : setTimeout;\n}\n\n/**\n * Get a function to cancel the method returned by `getRaf()`.\n *\n * @returns {(id:number) => void}\n */\nexport function getCancelRaf() {\n return hasWindow() && window.cancelAnimationFrame\n ? window.cancelAnimationFrame.bind(window)\n : clearTimeout;\n}\n\n/**\n * Wait for the next frame to execute a function.\n *\n * @template {() => any} T\n * @param {T} [fn] The callback function to execute.\n * @returns {Promise<T extends Function ? ReturnType<T> : undefined>} A Promise resolving when the next frame is reached.\n * @example\n * ```js\n * nextFrame(() => console.log('hello world'));\n *\n * await nextFrame();\n * console.log('hello world');\n * ```\n */\nexport function nextFrame(fn) {\n return new Promise((resolve) => {\n getRaf()(() => resolve(isFunction(fn) && fn()));\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAC3B,iBAA0B;AAOnB,SAAS,SAAS;AACvB,aAAO,sBAAU,KAAK,OAAO,wBACzB,OAAO,sBAAsB,KAAK,MAAM,IACxC;AACN;AAOO,SAAS,eAAe;AAC7B,aAAO,sBAAU,KAAK,OAAO,uBACzB,OAAO,qBAAqB,KAAK,MAAM,IACvC;AACN;AAgBO,SAAS,UAAU,IAAI;AAC5B,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,WAAO,EAAE,MAAM,YAAQ,sBAAW,EAAE,KAAK,GAAG,CAAC,CAAC;AAAA,EAChD,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -16,3 +16,4 @@ export {
16
16
  getRaf,
17
17
  nextFrame
18
18
  };
19
+ //# sourceMappingURL=nextFrame.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/nextFrame.js"],
4
+ "sourcesContent": ["import { isFunction } from './is.js';\nimport { hasWindow } from './has.js';\n\n/**\n * RequestAnimation frame polyfill.\n * @see https://github.com/vuejs/vue/blob/ec78fc8b6d03e59da669be1adf4b4b5abf670a34/dist/vue.runtime.esm.js#L7355\n * @returns {(handler: Function) => number}\n */\nexport function getRaf() {\n return hasWindow() && window.requestAnimationFrame\n ? window.requestAnimationFrame.bind(window)\n : setTimeout;\n}\n\n/**\n * Get a function to cancel the method returned by `getRaf()`.\n *\n * @returns {(id:number) => void}\n */\nexport function getCancelRaf() {\n return hasWindow() && window.cancelAnimationFrame\n ? window.cancelAnimationFrame.bind(window)\n : clearTimeout;\n}\n\n/**\n * Wait for the next frame to execute a function.\n *\n * @template {() => any} T\n * @param {T} [fn] The callback function to execute.\n * @returns {Promise<T extends Function ? ReturnType<T> : undefined>} A Promise resolving when the next frame is reached.\n * @example\n * ```js\n * nextFrame(() => console.log('hello world'));\n *\n * await nextFrame();\n * console.log('hello world');\n * ```\n */\nexport function nextFrame(fn) {\n return new Promise((resolve) => {\n getRaf()(() => resolve(isFunction(fn) && fn()));\n });\n}\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAOnB,SAAS,SAAS;AACvB,SAAO,UAAU,KAAK,OAAO,wBACzB,OAAO,sBAAsB,KAAK,MAAM,IACxC;AACN;AAOO,SAAS,eAAe;AAC7B,SAAO,UAAU,KAAK,OAAO,uBACzB,OAAO,qBAAqB,KAAK,MAAM,IACvC;AACN;AAgBO,SAAS,UAAU,IAAI;AAC5B,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,WAAO,EAAE,MAAM,QAAQ,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC;AAAA,EAChD,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -27,3 +27,4 @@ async function nextMicrotask(fn) {
27
27
  return Promise.resolve().then(() => (0, import_is.isFunction)(fn) && fn());
28
28
  }
29
29
  if (module.exports.default) module.exports = module.exports.default;
30
+ //# sourceMappingURL=nextMicrotask.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/nextMicrotask.js"],
4
+ "sourcesContent": ["import { isFunction } from './is.js';\n\n/**\n * Wait for the next microtask.\n *\n * @template {() => any} T\n * @param {T} [fn]\n * @returns {Promise<T extends Function ? ReturnType<T> : undefined>}\n */\nexport default async function nextMicrotask(fn) {\n return Promise.resolve().then(() => isFunction(fn) && fn());\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAS3B,eAAO,cAAqC,IAAI;AAC9C,SAAO,QAAQ,QAAQ,EAAE,KAAK,UAAM,sBAAW,EAAE,KAAK,GAAG,CAAC;AAC5D;",
6
+ "names": []
7
+ }
@@ -5,3 +5,4 @@ async function nextMicrotask(fn) {
5
5
  export {
6
6
  nextMicrotask as default
7
7
  };
8
+ //# sourceMappingURL=nextMicrotask.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/nextMicrotask.js"],
4
+ "sourcesContent": ["import { isFunction } from './is.js';\n\n/**\n * Wait for the next microtask.\n *\n * @template {() => any} T\n * @param {T} [fn]\n * @returns {Promise<T extends Function ? ReturnType<T> : undefined>}\n */\nexport default async function nextMicrotask(fn) {\n return Promise.resolve().then(() => isFunction(fn) && fn());\n}\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAS3B,eAAO,cAAqC,IAAI;AAC9C,SAAO,QAAQ,QAAQ,EAAE,KAAK,MAAM,WAAW,EAAE,KAAK,GAAG,CAAC;AAC5D;",
6
+ "names": []
7
+ }
@@ -31,3 +31,4 @@ async function nextTick(fn) {
31
31
  );
32
32
  }
33
33
  if (module.exports.default) module.exports = module.exports.default;
34
+ //# sourceMappingURL=nextTick.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/nextTick.js"],
4
+ "sourcesContent": ["import { isFunction } from './is.js';\n\n/**\n * Wait for the next tick.\n *\n * @template {() => any} T\n * @param {T} [fn]\n * @returns {Promise<T extends Function ? ReturnType<T> : undefined>}\n */\nexport default async function nextTick(fn) {\n return new Promise((resolve) =>\n // eslint-disable-next-line no-promise-executor-return\n setTimeout(() => {\n resolve(isFunction(fn) && fn());\n }, 0),\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAS3B,eAAO,SAAgC,IAAI;AACzC,SAAO,IAAI;AAAA,IAAQ,CAAC,YAElB,WAAW,MAAM;AACf,kBAAQ,sBAAW,EAAE,KAAK,GAAG,CAAC;AAAA,IAChC,GAAG,CAAC;AAAA,EACN;AACF;",
6
+ "names": []
7
+ }
package/utils/nextTick.js CHANGED
@@ -9,3 +9,4 @@ async function nextTick(fn) {
9
9
  export {
10
10
  nextTick as default
11
11
  };
12
+ //# sourceMappingURL=nextTick.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/nextTick.js"],
4
+ "sourcesContent": ["import { isFunction } from './is.js';\n\n/**\n * Wait for the next tick.\n *\n * @template {() => any} T\n * @param {T} [fn]\n * @returns {Promise<T extends Function ? ReturnType<T> : undefined>}\n */\nexport default async function nextTick(fn) {\n return new Promise((resolve) =>\n // eslint-disable-next-line no-promise-executor-return\n setTimeout(() => {\n resolve(isFunction(fn) && fn());\n }, 0),\n );\n}\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAS3B,eAAO,SAAgC,IAAI;AACzC,SAAO,IAAI;AAAA,IAAQ,CAAC,YAElB,WAAW,MAAM;AACf,cAAQ,WAAW,EAAE,KAAK,GAAG,CAAC;AAAA,IAChC,GAAG,CAAC;AAAA,EACN;AACF;",
6
+ "names": []
7
+ }
package/utils/noop.cjs CHANGED
@@ -29,3 +29,4 @@ function noopValue(value) {
29
29
  return value;
30
30
  }
31
31
  if (module.exports.default) module.exports = module.exports.default;
32
+ //# sourceMappingURL=noop.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/noop.js"],
4
+ "sourcesContent": ["/**\n * No operation function.\n * @returns {void}\n */\nexport function noop() {}\n\n/**\n * No operation function which return the given value unaltered.\n * @template {any} T\n * @param {T} value\n * @returns {T}\n */\nexport function noopValue(value) {\n return value;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,OAAO;AAAC;AAQjB,SAAS,UAAU,OAAO;AAC/B,SAAO;AACT;",
6
+ "names": []
7
+ }
package/utils/noop.js CHANGED
@@ -7,3 +7,4 @@ export {
7
7
  noop,
8
8
  noopValue
9
9
  };
10
+ //# sourceMappingURL=noop.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/noop.js"],
4
+ "sourcesContent": ["/**\n * No operation function.\n * @returns {void}\n */\nexport function noop() {}\n\n/**\n * No operation function which return the given value unaltered.\n * @template {any} T\n * @param {T} value\n * @returns {T}\n */\nexport function noopValue(value) {\n return value;\n}\n"],
5
+ "mappings": "AAIO,SAAS,OAAO;AAAC;AAQjB,SAAS,UAAU,OAAO;AAC/B,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -51,3 +51,4 @@ function autoBind(instance, options) {
51
51
  return instance;
52
52
  }
53
53
  if (module.exports.default) module.exports = module.exports.default;
54
+ //# sourceMappingURL=autoBind.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/object/autoBind.js"],
4
+ "sourcesContent": ["import getAllProperties from './getAllProperties.js';\nimport { isString, isFunction } from '../is.js';\n\n/**\n * Auto-bind methods to an instance.\n *\n * @param {Object} instance The instance.\n * @param {Object} options Define specific methods to include or exlude.\n * @param {Array<string | RegExp>} [options.include] Methods to include.\n * @param {Array<string | RegExp>} [options.exclude] Methods to exclude.\n * @returns {Object} The instance.\n */\nexport default function autoBind(instance, options) {\n const { exclude, include } = options || {};\n const filter = (key) => {\n const match = (pattern) => (isString(pattern) ? key === pattern : pattern.test(key));\n\n if (include) {\n return include.some(match);\n }\n\n if (exclude) {\n return !exclude.some(match);\n }\n\n return true;\n };\n\n getAllProperties(instance)\n .filter(([key]) => key !== 'constructor' && filter(key))\n .forEach(([key, object]) => {\n const descriptor = Object.getOwnPropertyDescriptor(object, key);\n if (descriptor && isFunction(descriptor.value)) {\n instance[key] = instance[key].bind(instance);\n }\n });\n\n return instance;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA6B;AAC7B,gBAAqC;AAWtB,SAAR,SAA0B,UAAU,SAAS;AAClD,QAAM,EAAE,SAAS,QAAQ,IAAI,WAAW,CAAC;AACzC,QAAM,SAAS,CAAC,QAAQ;AACtB,UAAM,QAAQ,CAAC,gBAAa,oBAAS,OAAO,IAAI,QAAQ,UAAU,QAAQ,KAAK,GAAG;AAElF,QAAI,SAAS;AACX,aAAO,QAAQ,KAAK,KAAK;AAAA,IAC3B;AAEA,QAAI,SAAS;AACX,aAAO,CAAC,QAAQ,KAAK,KAAK;AAAA,IAC5B;AAEA,WAAO;AAAA,EACT;AAEA,8BAAAA,SAAiB,QAAQ,EACtB,OAAO,CAAC,CAAC,GAAG,MAAM,QAAQ,iBAAiB,OAAO,GAAG,CAAC,EACtD,QAAQ,CAAC,CAAC,KAAK,MAAM,MAAM;AAC1B,UAAM,aAAa,OAAO,yBAAyB,QAAQ,GAAG;AAC9D,QAAI,kBAAc,sBAAW,WAAW,KAAK,GAAG;AAC9C,eAAS,OAAO,SAAS,KAAK,KAAK,QAAQ;AAAA,IAC7C;AAAA,EACF,CAAC;AAEH,SAAO;AACT;",
6
+ "names": ["getAllProperties"]
7
+ }
@@ -23,3 +23,4 @@ function autoBind(instance, options) {
23
23
  export {
24
24
  autoBind as default
25
25
  };
26
+ //# sourceMappingURL=autoBind.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/object/autoBind.js"],
4
+ "sourcesContent": ["import getAllProperties from './getAllProperties.js';\nimport { isString, isFunction } from '../is.js';\n\n/**\n * Auto-bind methods to an instance.\n *\n * @param {Object} instance The instance.\n * @param {Object} options Define specific methods to include or exlude.\n * @param {Array<string | RegExp>} [options.include] Methods to include.\n * @param {Array<string | RegExp>} [options.exclude] Methods to exclude.\n * @returns {Object} The instance.\n */\nexport default function autoBind(instance, options) {\n const { exclude, include } = options || {};\n const filter = (key) => {\n const match = (pattern) => (isString(pattern) ? key === pattern : pattern.test(key));\n\n if (include) {\n return include.some(match);\n }\n\n if (exclude) {\n return !exclude.some(match);\n }\n\n return true;\n };\n\n getAllProperties(instance)\n .filter(([key]) => key !== 'constructor' && filter(key))\n .forEach(([key, object]) => {\n const descriptor = Object.getOwnPropertyDescriptor(object, key);\n if (descriptor && isFunction(descriptor.value)) {\n instance[key] = instance[key].bind(instance);\n }\n });\n\n return instance;\n}\n"],
5
+ "mappings": "AAAA,OAAO,sBAAsB;AAC7B,SAAS,UAAU,kBAAkB;AAWtB,SAAR,SAA0B,UAAU,SAAS;AAClD,QAAM,EAAE,SAAS,QAAQ,IAAI,WAAW,CAAC;AACzC,QAAM,SAAS,CAAC,QAAQ;AACtB,UAAM,QAAQ,CAAC,YAAa,SAAS,OAAO,IAAI,QAAQ,UAAU,QAAQ,KAAK,GAAG;AAElF,QAAI,SAAS;AACX,aAAO,QAAQ,KAAK,KAAK;AAAA,IAC3B;AAEA,QAAI,SAAS;AACX,aAAO,CAAC,QAAQ,KAAK,KAAK;AAAA,IAC5B;AAEA,WAAO;AAAA,EACT;AAEA,mBAAiB,QAAQ,EACtB,OAAO,CAAC,CAAC,GAAG,MAAM,QAAQ,iBAAiB,OAAO,GAAG,CAAC,EACtD,QAAQ,CAAC,CAAC,KAAK,MAAM,MAAM;AAC1B,UAAM,aAAa,OAAO,yBAAyB,QAAQ,GAAG;AAC9D,QAAI,cAAc,WAAW,WAAW,KAAK,GAAG;AAC9C,eAAS,OAAO,SAAS,KAAK,KAAK,QAAQ;AAAA,IAC7C;AAAA,EACF,CAAC;AAEH,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -36,3 +36,4 @@ function getAllProperties(object, props = [], testFn = null) {
36
36
  return getAllProperties(proto, foundProps, testFn);
37
37
  }
38
38
  if (module.exports.default) module.exports = module.exports.default;
39
+ //# sourceMappingURL=getAllProperties.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/object/getAllProperties.js"],
4
+ "sourcesContent": ["import { isFunction } from '../is.js';\n\n/**\n * Gets all non-builtin properties up the prototype chain.\n *\n * @param {Object} object\n * The object to get the propeties from.\n * @param {Array} [props=[]]\n * The already existing properties.\n * @param {(name:string, proto:any) => boolean} testFn\n * @returns {Array<[string, Object]>} An array of properties and the prototype they belong to.\n */\nexport default function getAllProperties(object, props = [], testFn = null) {\n const proto = Object.getPrototypeOf(object);\n\n if (proto === Object.prototype || proto === null) {\n return props;\n }\n\n let foundProps = Object.getOwnPropertyNames(proto);\n\n if (isFunction(testFn)) {\n foundProps = foundProps.filter((name) => testFn(name, proto));\n }\n\n foundProps = foundProps.map((name) => [name, proto]).reduce((acc, val) => [...acc, val], props);\n\n return getAllProperties(proto, foundProps, testFn);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAYZ,SAAR,iBAAkC,QAAQ,QAAQ,CAAC,GAAG,SAAS,MAAM;AAC1E,QAAM,QAAQ,OAAO,eAAe,MAAM;AAE1C,MAAI,UAAU,OAAO,aAAa,UAAU,MAAM;AAChD,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,OAAO,oBAAoB,KAAK;AAEjD,UAAI,sBAAW,MAAM,GAAG;AACtB,iBAAa,WAAW,OAAO,CAAC,SAAS,OAAO,MAAM,KAAK,CAAC;AAAA,EAC9D;AAEA,eAAa,WAAW,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,GAAG,GAAG,KAAK;AAE9F,SAAO,iBAAiB,OAAO,YAAY,MAAM;AACnD;",
6
+ "names": []
7
+ }
@@ -14,3 +14,4 @@ function getAllProperties(object, props = [], testFn = null) {
14
14
  export {
15
15
  getAllProperties as default
16
16
  };
17
+ //# sourceMappingURL=getAllProperties.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/object/getAllProperties.js"],
4
+ "sourcesContent": ["import { isFunction } from '../is.js';\n\n/**\n * Gets all non-builtin properties up the prototype chain.\n *\n * @param {Object} object\n * The object to get the propeties from.\n * @param {Array} [props=[]]\n * The already existing properties.\n * @param {(name:string, proto:any) => boolean} testFn\n * @returns {Array<[string, Object]>} An array of properties and the prototype they belong to.\n */\nexport default function getAllProperties(object, props = [], testFn = null) {\n const proto = Object.getPrototypeOf(object);\n\n if (proto === Object.prototype || proto === null) {\n return props;\n }\n\n let foundProps = Object.getOwnPropertyNames(proto);\n\n if (isFunction(testFn)) {\n foundProps = foundProps.filter((name) => testFn(name, proto));\n }\n\n foundProps = foundProps.map((name) => [name, proto]).reduce((acc, val) => [...acc, val], props);\n\n return getAllProperties(proto, foundProps, testFn);\n}\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;AAYZ,SAAR,iBAAkC,QAAQ,QAAQ,CAAC,GAAG,SAAS,MAAM;AAC1E,QAAM,QAAQ,OAAO,eAAe,MAAM;AAE1C,MAAI,UAAU,OAAO,aAAa,UAAU,MAAM;AAChD,WAAO;AAAA,EACT;AAEA,MAAI,aAAa,OAAO,oBAAoB,KAAK;AAEjD,MAAI,WAAW,MAAM,GAAG;AACtB,iBAAa,WAAW,OAAO,CAAC,SAAS,OAAO,MAAM,KAAK,CAAC;AAAA,EAC9D;AAEA,eAAa,WAAW,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,GAAG,GAAG,KAAK;AAE9F,SAAO,iBAAiB,OAAO,YAAY,MAAM;AACnD;",
6
+ "names": []
7
+ }
@@ -32,3 +32,4 @@ module.exports = __toCommonJS(object_exports);
32
32
  var import_autoBind = __toESM(require("./autoBind.cjs"), 1);
33
33
  var import_getAllProperties = __toESM(require("./getAllProperties.cjs"), 1);
34
34
  if (module.exports.default) module.exports = module.exports.default;
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/object/index.js"],
4
+ "sourcesContent": ["export { default as autoBind } from './autoBind.js';\nexport { default as getAllProperties } from './getAllProperties.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoC;AACpC,8BAA4C;",
6
+ "names": []
7
+ }
@@ -4,3 +4,4 @@ export {
4
4
  default2 as autoBind,
5
5
  default3 as getAllProperties
6
6
  };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/js-toolkit/utils/object/index.js"],
4
+ "sourcesContent": ["export { default as autoBind } from './autoBind.js';\nexport { default as getAllProperties } from './getAllProperties.js';\n"],
5
+ "mappings": "AAAA,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAAmC;",
6
+ "names": ["default"]
7
+ }
@@ -72,3 +72,4 @@ function useScheduler(steps = domSchedulerSteps) {
72
72
  }
73
73
  var domScheduler = useScheduler(domSchedulerSteps);
74
74
  if (module.exports.default) module.exports = module.exports.default;
75
+ //# sourceMappingURL=scheduler.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/scheduler.js"],
4
+ "sourcesContent": ["/**\n * Generate a scheduler.\n * @typedef {string} T\n * @param {T[]} steps\n * @returns {Record<T, (fn: () => void) => void>}\n */\nfunction getScheduler(steps) {\n /** @type {Record<T, Array<() => void>>} */\n const stepsFns = {};\n /** @type {Record<T, (fn: () => void) => void>} */\n const api = {};\n\n let isScheduled = false;\n\n const resolvedPromise = Promise.resolve();\n\n /**\n * Execute the given list of tasks.\n *\n * @param {Array<() => void>} tasks\n * @returns {void}\n */\n function run(tasks) {\n let task;\n // eslint-disable-next-line no-cond-assign\n while ((task = tasks.shift())) {\n task();\n }\n }\n\n /**\n * Flush registered tasks and schedule the next run if needed.\n * @returns {void}\n */\n function flush() {\n steps.forEach(function runStep(step) {\n run(stepsFns[step]);\n });\n isScheduled = false;\n\n if (steps.reduce((length, step) => length + stepsFns[step].length, 0) > 0) {\n // eslint-disable-next-line no-use-before-define\n scheduleFlush();\n }\n }\n\n /**\n * Schedule the next flush of tasks.\n * @returns {void}\n */\n function scheduleFlush() {\n if (isScheduled) {\n return;\n }\n\n isScheduled = true;\n resolvedPromise.then(flush);\n }\n\n steps.forEach((step) => {\n stepsFns[step] = [];\n api[step] = function add(fn) {\n stepsFns[step].push(fn);\n scheduleFlush();\n };\n });\n\n return api;\n}\n\nconst instances = new Map();\n\nconst domSchedulerSteps = ['read', 'write', 'afterWrite'];\n\n/**\n * Use a scheduler based on the given steps.\n * @param {string[]} steps\n * @returns {ReturnType<getScheduler>}\n */\nexport function useScheduler(steps = domSchedulerSteps) {\n const key = steps.join('-');\n\n if (instances.has(key)) {\n return instances.get(key);\n }\n\n const scheduler = getScheduler(steps);\n instances.set(key, scheduler);\n\n return scheduler;\n}\n\nexport const domScheduler = useScheduler(domSchedulerSteps);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,SAAS,aAAa,OAAO;AAE3B,QAAM,WAAW,CAAC;AAElB,QAAM,MAAM,CAAC;AAEb,MAAI,cAAc;AAElB,QAAM,kBAAkB,QAAQ,QAAQ;AAQxC,WAAS,IAAI,OAAO;AAClB,QAAI;AAEJ,WAAQ,OAAO,MAAM,MAAM,GAAI;AAC7B,WAAK;AAAA,IACP;AAAA,EACF;AAMA,WAAS,QAAQ;AACf,UAAM,QAAQ,SAAS,QAAQ,MAAM;AACnC,UAAI,SAAS,KAAK;AAAA,IACpB,CAAC;AACD,kBAAc;AAEd,QAAI,MAAM,OAAO,CAAC,QAAQ,SAAS,SAAS,SAAS,MAAM,QAAQ,CAAC,IAAI,GAAG;AAEzE,oBAAc;AAAA,IAChB;AAAA,EACF;AAMA,WAAS,gBAAgB;AACvB,QAAI,aAAa;AACf;AAAA,IACF;AAEA,kBAAc;AACd,oBAAgB,KAAK,KAAK;AAAA,EAC5B;AAEA,QAAM,QAAQ,CAAC,SAAS;AACtB,aAAS,QAAQ,CAAC;AAClB,QAAI,QAAQ,SAAS,IAAI,IAAI;AAC3B,eAAS,MAAM,KAAK,EAAE;AACtB,oBAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,IAAM,YAAY,oBAAI,IAAI;AAE1B,IAAM,oBAAoB,CAAC,QAAQ,SAAS,YAAY;AAOjD,SAAS,aAAa,QAAQ,mBAAmB;AACtD,QAAM,MAAM,MAAM,KAAK,GAAG;AAE1B,MAAI,UAAU,IAAI,GAAG,GAAG;AACtB,WAAO,UAAU,IAAI,GAAG;AAAA,EAC1B;AAEA,QAAM,YAAY,aAAa,KAAK;AACpC,YAAU,IAAI,KAAK,SAAS;AAE5B,SAAO;AACT;AAEO,IAAM,eAAe,aAAa,iBAAiB;",
6
+ "names": []
7
+ }
@@ -50,3 +50,4 @@ export {
50
50
  domScheduler,
51
51
  useScheduler
52
52
  };
53
+ //# sourceMappingURL=scheduler.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/scheduler.js"],
4
+ "sourcesContent": ["/**\n * Generate a scheduler.\n * @typedef {string} T\n * @param {T[]} steps\n * @returns {Record<T, (fn: () => void) => void>}\n */\nfunction getScheduler(steps) {\n /** @type {Record<T, Array<() => void>>} */\n const stepsFns = {};\n /** @type {Record<T, (fn: () => void) => void>} */\n const api = {};\n\n let isScheduled = false;\n\n const resolvedPromise = Promise.resolve();\n\n /**\n * Execute the given list of tasks.\n *\n * @param {Array<() => void>} tasks\n * @returns {void}\n */\n function run(tasks) {\n let task;\n // eslint-disable-next-line no-cond-assign\n while ((task = tasks.shift())) {\n task();\n }\n }\n\n /**\n * Flush registered tasks and schedule the next run if needed.\n * @returns {void}\n */\n function flush() {\n steps.forEach(function runStep(step) {\n run(stepsFns[step]);\n });\n isScheduled = false;\n\n if (steps.reduce((length, step) => length + stepsFns[step].length, 0) > 0) {\n // eslint-disable-next-line no-use-before-define\n scheduleFlush();\n }\n }\n\n /**\n * Schedule the next flush of tasks.\n * @returns {void}\n */\n function scheduleFlush() {\n if (isScheduled) {\n return;\n }\n\n isScheduled = true;\n resolvedPromise.then(flush);\n }\n\n steps.forEach((step) => {\n stepsFns[step] = [];\n api[step] = function add(fn) {\n stepsFns[step].push(fn);\n scheduleFlush();\n };\n });\n\n return api;\n}\n\nconst instances = new Map();\n\nconst domSchedulerSteps = ['read', 'write', 'afterWrite'];\n\n/**\n * Use a scheduler based on the given steps.\n * @param {string[]} steps\n * @returns {ReturnType<getScheduler>}\n */\nexport function useScheduler(steps = domSchedulerSteps) {\n const key = steps.join('-');\n\n if (instances.has(key)) {\n return instances.get(key);\n }\n\n const scheduler = getScheduler(steps);\n instances.set(key, scheduler);\n\n return scheduler;\n}\n\nexport const domScheduler = useScheduler(domSchedulerSteps);\n"],
5
+ "mappings": "AAMA,SAAS,aAAa,OAAO;AAE3B,QAAM,WAAW,CAAC;AAElB,QAAM,MAAM,CAAC;AAEb,MAAI,cAAc;AAElB,QAAM,kBAAkB,QAAQ,QAAQ;AAQxC,WAAS,IAAI,OAAO;AAClB,QAAI;AAEJ,WAAQ,OAAO,MAAM,MAAM,GAAI;AAC7B,WAAK;AAAA,IACP;AAAA,EACF;AAMA,WAAS,QAAQ;AACf,UAAM,QAAQ,SAAS,QAAQ,MAAM;AACnC,UAAI,SAAS,KAAK;AAAA,IACpB,CAAC;AACD,kBAAc;AAEd,QAAI,MAAM,OAAO,CAAC,QAAQ,SAAS,SAAS,SAAS,MAAM,QAAQ,CAAC,IAAI,GAAG;AAEzE,oBAAc;AAAA,IAChB;AAAA,EACF;AAMA,WAAS,gBAAgB;AACvB,QAAI,aAAa;AACf;AAAA,IACF;AAEA,kBAAc;AACd,oBAAgB,KAAK,KAAK;AAAA,EAC5B;AAEA,QAAM,QAAQ,CAAC,SAAS;AACtB,aAAS,QAAQ,CAAC;AAClB,QAAI,QAAQ,SAAS,IAAI,IAAI;AAC3B,eAAS,MAAM,KAAK,EAAE;AACtB,oBAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,MAAM,YAAY,oBAAI,IAAI;AAE1B,MAAM,oBAAoB,CAAC,QAAQ,SAAS,YAAY;AAOjD,SAAS,aAAa,QAAQ,mBAAmB;AACtD,QAAM,MAAM,MAAM,KAAK,GAAG;AAE1B,MAAI,UAAU,IAAI,GAAG,GAAG;AACtB,WAAO,UAAU,IAAI,GAAG;AAAA,EAC1B;AAEA,QAAM,YAAY,aAAa,KAAK;AACpC,YAAU,IAAI,KAAK,SAAS;AAE5B,SAAO;AACT;AAEO,MAAM,eAAe,aAAa,iBAAiB;",
6
+ "names": []
7
+ }
@@ -81,3 +81,4 @@ function scrollTo(selectorElement, { offset = 0, dampFactor = 0.2 } = {}) {
81
81
  });
82
82
  }
83
83
  if (module.exports.default) module.exports = module.exports.default;
84
+ //# sourceMappingURL=scrollTo.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/js-toolkit/utils/scrollTo.js"],
4
+ "sourcesContent": ["import damp from './math/damp.js';\n\n/**\n * Handler for the click event on anchor links\n *\n * @param {HTMLElement|string} selectorElement The target element.\n * @param {{ offset?: number, dampFactor?: number }} options Options for the scroll.\n * @returns {Promise<number>} A promising resolving with the target scroll position.\n */\nexport default function scrollTo(selectorElement, { offset = 0, dampFactor = 0.2 } = {}) {\n let targetElement = null;\n\n if (selectorElement instanceof HTMLElement) {\n targetElement = selectorElement;\n } else {\n targetElement = document.querySelector(selectorElement);\n }\n\n if (!targetElement) {\n return Promise.resolve(window.pageYOffset);\n }\n\n const sizes = targetElement.getBoundingClientRect();\n const scrollMargin = getComputedStyle(targetElement).scrollMarginTop || '0';\n const max = document.documentElement.scrollHeight - window.innerHeight;\n let scrollTarget = sizes.top + window.pageYOffset - Number.parseInt(scrollMargin, 10) - offset;\n\n // Make sure to not scroll more than the max scroll allowed\n if (scrollTarget > max) {\n scrollTarget = max;\n }\n\n return new Promise((resolve) => {\n let isScrolling = false;\n let scroll = window.pageYOffset;\n let dampScroll = window.pageYOffset;\n\n /**\n * Handler for the wheel event\n * Is used to cancel the programmatic scroll animation\n */\n function eventHandler() {\n isScrolling = false;\n }\n\n /**\n * Scroll animation end's hook\n */\n function end() {\n window.removeEventListener('wheel', eventHandler);\n window.removeEventListener('touchmove', eventHandler);\n resolve(window.pageYOffset);\n }\n\n /**\n * Scroll animation's loop\n * @returns {void|number}\n */\n function loop() {\n if (!isScrolling) {\n return end();\n }\n\n dampScroll = damp(scroll, dampScroll, dampFactor);\n window.scrollTo({ top: dampScroll });\n\n if (dampScroll === scroll) {\n isScrolling = false;\n }\n\n return requestAnimationFrame(loop);\n }\n\n /**\n * Start the scroll animation\n * @param {number} target The target scroll\n */\n function start(target) {\n // Update vars\n isScrolling = true;\n dampScroll = window.pageYOffset;\n scroll = target;\n\n // Bind wheel event to stop the animation if\n // the user wants to scroll manually\n window.addEventListener('wheel', eventHandler, { passive: true });\n window.addEventListener('touchmove', eventHandler, { passive: true });\n\n // Init the loop\n loop();\n }\n\n // Start the scroll\n start(scrollTarget);\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AASF,SAAR,SAA0B,iBAAiB,EAAE,SAAS,GAAG,aAAa,IAAI,IAAI,CAAC,GAAG;AACvF,MAAI,gBAAgB;AAEpB,MAAI,2BAA2B,aAAa;AAC1C,oBAAgB;AAAA,EAClB,OAAO;AACL,oBAAgB,SAAS,cAAc,eAAe;AAAA,EACxD;AAEA,MAAI,CAAC,eAAe;AAClB,WAAO,QAAQ,QAAQ,OAAO,WAAW;AAAA,EAC3C;AAEA,QAAM,QAAQ,cAAc,sBAAsB;AAClD,QAAM,eAAe,iBAAiB,aAAa,EAAE,mBAAmB;AACxE,QAAM,MAAM,SAAS,gBAAgB,eAAe,OAAO;AAC3D,MAAI,eAAe,MAAM,MAAM,OAAO,cAAc,OAAO,SAAS,cAAc,EAAE,IAAI;AAGxF,MAAI,eAAe,KAAK;AACtB,mBAAe;AAAA,EACjB;AAEA,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,QAAI,cAAc;AAClB,QAAI,SAAS,OAAO;AACpB,QAAI,aAAa,OAAO;AAMxB,aAAS,eAAe;AACtB,oBAAc;AAAA,IAChB;AAKA,aAAS,MAAM;AACb,aAAO,oBAAoB,SAAS,YAAY;AAChD,aAAO,oBAAoB,aAAa,YAAY;AACpD,cAAQ,OAAO,WAAW;AAAA,IAC5B;AAMA,aAAS,OAAO;AACd,UAAI,CAAC,aAAa;AAChB,eAAO,IAAI;AAAA,MACb;AAEA,uBAAa,YAAAA,SAAK,QAAQ,YAAY,UAAU;AAChD,aAAO,SAAS,EAAE,KAAK,WAAW,CAAC;AAEnC,UAAI,eAAe,QAAQ;AACzB,sBAAc;AAAA,MAChB;AAEA,aAAO,sBAAsB,IAAI;AAAA,IACnC;AAMA,aAAS,MAAM,QAAQ;AAErB,oBAAc;AACd,mBAAa,OAAO;AACpB,eAAS;AAIT,aAAO,iBAAiB,SAAS,cAAc,EAAE,SAAS,KAAK,CAAC;AAChE,aAAO,iBAAiB,aAAa,cAAc,EAAE,SAAS,KAAK,CAAC;AAGpE,WAAK;AAAA,IACP;AAGA,UAAM,YAAY;AAAA,EACpB,CAAC;AACH;",
6
+ "names": ["damp"]
7
+ }
@@ -2,7 +2,7 @@
2
2
  * Handler for the click event on anchor links
3
3
  *
4
4
  * @param {HTMLElement|string} selectorElement The target element.
5
- * @param {{ offset?: number, dampFactor?: number }} [options] Options for the scroll.
5
+ * @param {{ offset?: number, dampFactor?: number }} options Options for the scroll.
6
6
  * @returns {Promise<number>} A promising resolving with the target scroll position.
7
7
  */
8
8
  export default function scrollTo(selectorElement: HTMLElement | string, { offset, dampFactor }?: {
package/utils/scrollTo.js CHANGED
@@ -53,3 +53,4 @@ function scrollTo(selectorElement, { offset = 0, dampFactor = 0.2 } = {}) {
53
53
  export {
54
54
  scrollTo as default
55
55
  };
56
+ //# sourceMappingURL=scrollTo.js.map