@studiometa/js-toolkit 2.6.4 → 2.7.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 (315) hide show
  1. package/Base/features.cjs +29 -0
  2. package/Base/features.cjs.map +7 -0
  3. package/Base/features.d.ts +2 -0
  4. package/Base/features.js +7 -0
  5. package/Base/features.js.map +7 -0
  6. package/Base/index.cjs +12 -15
  7. package/Base/index.cjs.map +2 -2
  8. package/Base/index.d.ts +1 -5
  9. package/Base/index.js +10 -6
  10. package/Base/index.js.map +2 -2
  11. package/Base/managers/AsyncChildrenManager.cjs +61 -0
  12. package/Base/managers/AsyncChildrenManager.cjs.map +7 -0
  13. package/Base/managers/AsyncChildrenManager.d.ts +18 -0
  14. package/Base/managers/AsyncChildrenManager.js +39 -0
  15. package/Base/managers/AsyncChildrenManager.js.map +7 -0
  16. package/Base/managers/ChildrenManager.cjs +32 -29
  17. package/Base/managers/ChildrenManager.cjs.map +2 -2
  18. package/Base/managers/ChildrenManager.d.ts +21 -1
  19. package/Base/managers/ChildrenManager.js +32 -29
  20. package/Base/managers/ChildrenManager.js.map +2 -2
  21. package/Base/managers/EventsManager.cjs.map +2 -2
  22. package/Base/managers/EventsManager.js.map +2 -2
  23. package/Base/managers/RefsManager.cjs.map +2 -2
  24. package/Base/managers/RefsManager.js.map +2 -2
  25. package/Base/managers/index.cjs +41 -0
  26. package/Base/managers/index.cjs.map +7 -0
  27. package/Base/managers/index.d.ts +8 -0
  28. package/Base/managers/index.js +19 -0
  29. package/Base/managers/index.js.map +7 -0
  30. package/Base/types.cjs.map +1 -1
  31. package/Base/utils.cjs.map +2 -2
  32. package/Base/utils.d.ts +1 -0
  33. package/Base/utils.js.map +2 -2
  34. package/decorators/withBreakpointManager.cjs.map +2 -2
  35. package/decorators/withBreakpointManager.js.map +2 -2
  36. package/decorators/withBreakpointObserver.cjs.map +2 -2
  37. package/decorators/withBreakpointObserver.js.map +2 -2
  38. package/decorators/withDrag.cjs.map +2 -2
  39. package/decorators/withDrag.js.map +2 -2
  40. package/decorators/withMountWhenInView.cjs.map +2 -2
  41. package/decorators/withMountWhenInView.js.map +2 -2
  42. package/decorators/withResponsiveOptions.cjs.map +2 -2
  43. package/decorators/withResponsiveOptions.js.map +2 -2
  44. package/decorators/withScrolledInView.cjs +4 -1
  45. package/decorators/withScrolledInView.cjs.map +2 -2
  46. package/decorators/withScrolledInView.js +4 -1
  47. package/decorators/withScrolledInView.js.map +2 -2
  48. package/decorators/withVue2.cjs.map +2 -2
  49. package/decorators/withVue2.js.map +2 -2
  50. package/helpers/createApp.cjs +23 -19
  51. package/helpers/createApp.cjs.map +2 -2
  52. package/helpers/createApp.d.ts +6 -1
  53. package/helpers/createApp.js +23 -19
  54. package/helpers/createApp.js.map +2 -2
  55. package/helpers/getClosestParent.cjs.map +2 -2
  56. package/helpers/getClosestParent.js.map +2 -2
  57. package/helpers/getInstanceFromElement.cjs.map +2 -2
  58. package/helpers/getInstanceFromElement.js.map +2 -2
  59. package/helpers/importOnInteraction.cjs.map +2 -2
  60. package/helpers/importOnInteraction.js.map +2 -2
  61. package/helpers/importWhenIdle.cjs.map +2 -2
  62. package/helpers/importWhenIdle.js.map +2 -2
  63. package/index.cjs.map +1 -1
  64. package/index.d.ts +1 -1
  65. package/index.js.map +1 -1
  66. package/package.json +1 -1
  67. package/services/drag.cjs +1 -1
  68. package/services/drag.cjs.map +3 -3
  69. package/services/drag.d.ts +21 -24
  70. package/services/drag.js.map +3 -3
  71. package/services/key.cjs +1 -1
  72. package/services/key.cjs.map +3 -3
  73. package/services/key.d.ts +8 -9
  74. package/services/key.js.map +3 -3
  75. package/services/load.cjs +1 -1
  76. package/services/load.cjs.map +3 -3
  77. package/services/load.d.ts +6 -5
  78. package/services/load.js.map +3 -3
  79. package/services/pointer.cjs +1 -1
  80. package/services/pointer.cjs.map +3 -3
  81. package/services/pointer.d.ts +10 -10
  82. package/services/pointer.js.map +3 -3
  83. package/services/raf.cjs +4 -4
  84. package/services/raf.cjs.map +3 -3
  85. package/services/raf.d.ts +6 -7
  86. package/services/raf.js +3 -3
  87. package/services/raf.js.map +3 -3
  88. package/services/resize.cjs +1 -1
  89. package/services/resize.cjs.map +3 -3
  90. package/services/resize.d.ts +8 -9
  91. package/services/resize.js.map +3 -3
  92. package/services/scroll.cjs +1 -1
  93. package/services/scroll.cjs.map +3 -3
  94. package/services/scroll.d.ts +16 -17
  95. package/services/scroll.js.map +3 -3
  96. package/services/service.cjs +2 -2
  97. package/services/service.cjs.map +3 -3
  98. package/services/service.d.ts +12 -14
  99. package/services/service.js +1 -1
  100. package/services/service.js.map +3 -3
  101. package/utils/Queue.cjs +60 -0
  102. package/utils/Queue.cjs.map +7 -0
  103. package/utils/Queue.d.ts +44 -0
  104. package/utils/Queue.js +38 -0
  105. package/utils/Queue.js.map +7 -0
  106. package/utils/collide/boundingRectToCircle.cjs +3 -2
  107. package/utils/collide/boundingRectToCircle.cjs.map +3 -3
  108. package/utils/collide/boundingRectToCircle.d.ts +8 -13
  109. package/utils/collide/boundingRectToCircle.js +2 -1
  110. package/utils/collide/boundingRectToCircle.js.map +3 -3
  111. package/utils/collide/collideCircleCircle.cjs +1 -1
  112. package/utils/collide/collideCircleCircle.cjs.map +1 -1
  113. package/utils/collide/collideCircleCircle.d.ts +1 -15
  114. package/utils/collide/collideCircleCircle.js.map +1 -1
  115. package/utils/collide/collideCircleRect.cjs +1 -1
  116. package/utils/collide/collideCircleRect.cjs.map +1 -1
  117. package/utils/collide/collideCircleRect.d.ts +1 -33
  118. package/utils/collide/collideCircleRect.js.map +1 -1
  119. package/utils/collide/collidePointCircle.cjs +1 -1
  120. package/utils/collide/collidePointCircle.cjs.map +1 -1
  121. package/utils/collide/collidePointCircle.d.ts +1 -25
  122. package/utils/collide/collidePointCircle.js.map +1 -1
  123. package/utils/collide/collidePointRect.cjs +1 -1
  124. package/utils/collide/collidePointRect.cjs.map +1 -1
  125. package/utils/collide/collidePointRect.d.ts +1 -29
  126. package/utils/collide/collidePointRect.js.map +1 -1
  127. package/utils/collide/collideRectRect.cjs +1 -1
  128. package/utils/collide/collideRectRect.cjs.map +1 -1
  129. package/utils/collide/collideRectRect.d.ts +1 -19
  130. package/utils/collide/collideRectRect.js.map +1 -1
  131. package/utils/collide/index.cjs +1 -1
  132. package/utils/collide/index.cjs.map +1 -1
  133. package/utils/collide/index.d.ts +9 -6
  134. package/utils/collide/index.js.map +1 -1
  135. package/utils/css/animate.cjs +14 -15
  136. package/utils/css/animate.cjs.map +3 -3
  137. package/utils/css/animate.d.ts +12 -14
  138. package/utils/css/animate.js +13 -14
  139. package/utils/css/animate.js.map +3 -3
  140. package/utils/css/classes.cjs +1 -1
  141. package/utils/css/classes.cjs.map +3 -3
  142. package/utils/css/classes.d.ts +3 -16
  143. package/utils/css/classes.js.map +3 -3
  144. package/utils/css/getOffsetSizes.cjs +1 -1
  145. package/utils/css/getOffsetSizes.cjs.map +3 -3
  146. package/utils/css/getOffsetSizes.d.ts +0 -2
  147. package/utils/css/getOffsetSizes.js.map +3 -3
  148. package/utils/css/matrix.cjs +1 -1
  149. package/utils/css/matrix.cjs.map +3 -3
  150. package/utils/css/matrix.d.ts +10 -8
  151. package/utils/css/matrix.js.map +3 -3
  152. package/utils/css/styles.cjs +1 -1
  153. package/utils/css/styles.cjs.map +3 -3
  154. package/utils/css/styles.d.ts +2 -10
  155. package/utils/css/styles.js.map +3 -3
  156. package/utils/css/transform.cjs +1 -1
  157. package/utils/css/transform.cjs.map +3 -3
  158. package/utils/css/transform.d.ts +6 -28
  159. package/utils/css/transform.js.map +3 -3
  160. package/utils/css/transition.cjs +2 -2
  161. package/utils/css/transition.cjs.map +3 -3
  162. package/utils/css/transition.d.ts +11 -15
  163. package/utils/css/transition.js +1 -1
  164. package/utils/css/transition.js.map +3 -3
  165. package/utils/debounce.cjs +1 -1
  166. package/utils/debounce.cjs.map +3 -3
  167. package/utils/debounce.d.ts +3 -3
  168. package/utils/debounce.js.map +3 -3
  169. package/utils/focusTrap.cjs +4 -2
  170. package/utils/focusTrap.cjs.map +3 -3
  171. package/utils/focusTrap.d.ts +3 -4
  172. package/utils/focusTrap.js +3 -1
  173. package/utils/focusTrap.js.map +3 -3
  174. package/utils/has.cjs +1 -1
  175. package/utils/has.cjs.map +3 -3
  176. package/utils/has.d.ts +1 -3
  177. package/utils/has.js.map +3 -3
  178. package/utils/history.cjs +1 -1
  179. package/utils/history.cjs.map +3 -3
  180. package/utils/history.d.ts +10 -10
  181. package/utils/history.js.map +3 -3
  182. package/utils/index.cjs +2 -0
  183. package/utils/index.cjs.map +2 -2
  184. package/utils/index.d.ts +1 -0
  185. package/utils/index.js +2 -0
  186. package/utils/index.js.map +2 -2
  187. package/utils/is.cjs +1 -1
  188. package/utils/is.cjs.map +3 -3
  189. package/utils/is.d.ts +26 -8
  190. package/utils/is.js.map +3 -3
  191. package/utils/keyCodes.cjs +1 -1
  192. package/utils/keyCodes.cjs.map +2 -2
  193. package/utils/keyCodes.d.ts +10 -10
  194. package/utils/keyCodes.js.map +2 -2
  195. package/utils/math/clamp.cjs +1 -1
  196. package/utils/math/clamp.cjs.map +3 -3
  197. package/utils/math/clamp.js.map +3 -3
  198. package/utils/math/clamp01.cjs +1 -1
  199. package/utils/math/clamp01.cjs.map +3 -3
  200. package/utils/math/clamp01.js.map +3 -3
  201. package/utils/math/createEases.cjs +1 -1
  202. package/utils/math/createEases.cjs.map +3 -3
  203. package/utils/math/createEases.d.ts +3 -6
  204. package/utils/math/createEases.js.map +3 -3
  205. package/utils/math/damp.cjs +1 -1
  206. package/utils/math/damp.cjs.map +3 -3
  207. package/utils/math/damp.js.map +3 -3
  208. package/utils/math/ease.cjs +1 -1
  209. package/utils/math/ease.cjs.map +3 -3
  210. package/utils/math/ease.d.ts +21 -21
  211. package/utils/math/ease.js.map +3 -3
  212. package/utils/math/index.cjs +1 -1
  213. package/utils/math/index.cjs.map +1 -1
  214. package/utils/math/index.d.ts +10 -10
  215. package/utils/math/index.js.map +1 -1
  216. package/utils/math/inertiaFinalValue.cjs +1 -1
  217. package/utils/math/inertiaFinalValue.cjs.map +3 -3
  218. package/utils/math/inertiaFinalValue.js.map +3 -3
  219. package/utils/math/lerp.cjs +1 -1
  220. package/utils/math/lerp.cjs.map +3 -3
  221. package/utils/math/lerp.js.map +3 -3
  222. package/utils/math/map.cjs +1 -1
  223. package/utils/math/map.cjs.map +3 -3
  224. package/utils/math/map.js.map +3 -3
  225. package/utils/math/round.cjs +1 -1
  226. package/utils/math/round.cjs.map +3 -3
  227. package/utils/math/round.js.map +3 -3
  228. package/utils/memoize.cjs +6 -2
  229. package/utils/memoize.cjs.map +3 -3
  230. package/utils/memoize.d.ts +18 -28
  231. package/utils/memoize.js +5 -1
  232. package/utils/memoize.js.map +3 -3
  233. package/utils/nextFrame.cjs +1 -1
  234. package/utils/nextFrame.cjs.map +3 -3
  235. package/utils/nextFrame.d.ts +3 -6
  236. package/utils/nextFrame.js.map +3 -3
  237. package/utils/nextMicrotask.cjs +1 -1
  238. package/utils/nextMicrotask.cjs.map +3 -3
  239. package/utils/nextMicrotask.d.ts +1 -5
  240. package/utils/nextMicrotask.js.map +3 -3
  241. package/utils/nextTick.cjs +5 -5
  242. package/utils/nextTick.cjs.map +3 -3
  243. package/utils/nextTick.d.ts +1 -5
  244. package/utils/nextTick.js +4 -4
  245. package/utils/nextTick.js.map +3 -3
  246. package/utils/noop.cjs +1 -1
  247. package/utils/noop.cjs.map +3 -3
  248. package/utils/noop.d.ts +2 -5
  249. package/utils/noop.js.map +3 -3
  250. package/utils/object/autoBind.cjs +1 -1
  251. package/utils/object/autoBind.cjs.map +3 -3
  252. package/utils/object/autoBind.d.ts +5 -4
  253. package/utils/object/autoBind.js.map +3 -3
  254. package/utils/object/getAllProperties.cjs +3 -3
  255. package/utils/object/getAllProperties.cjs.map +3 -3
  256. package/utils/object/getAllProperties.d.ts +1 -1
  257. package/utils/object/getAllProperties.js +2 -2
  258. package/utils/object/getAllProperties.js.map +3 -3
  259. package/utils/object/index.cjs +1 -1
  260. package/utils/object/index.cjs.map +1 -1
  261. package/utils/object/index.d.ts +2 -2
  262. package/utils/object/index.js.map +1 -1
  263. package/utils/scheduler.cjs +2 -2
  264. package/utils/scheduler.cjs.map +3 -3
  265. package/utils/scheduler.d.ts +4 -13
  266. package/utils/scheduler.js +1 -1
  267. package/utils/scheduler.js.map +3 -3
  268. package/utils/scrollTo.cjs +1 -1
  269. package/utils/scrollTo.cjs.map +3 -3
  270. package/utils/scrollTo.d.ts +0 -3
  271. package/utils/scrollTo.js.map +3 -3
  272. package/utils/string/index.cjs +1 -1
  273. package/utils/string/index.cjs.map +1 -1
  274. package/utils/string/index.d.ts +10 -10
  275. package/utils/string/index.js.map +1 -1
  276. package/utils/string/withLeadingCharacters.cjs +1 -1
  277. package/utils/string/withLeadingCharacters.cjs.map +3 -3
  278. package/utils/string/withLeadingCharacters.js.map +3 -3
  279. package/utils/string/withLeadingSlash.cjs +1 -1
  280. package/utils/string/withLeadingSlash.cjs.map +3 -3
  281. package/utils/string/withLeadingSlash.js.map +3 -3
  282. package/utils/string/withTrailingCharacters.cjs +1 -1
  283. package/utils/string/withTrailingCharacters.cjs.map +3 -3
  284. package/utils/string/withTrailingCharacters.js.map +3 -3
  285. package/utils/string/withTrailingSlash.cjs +1 -1
  286. package/utils/string/withTrailingSlash.cjs.map +3 -3
  287. package/utils/string/withTrailingSlash.js.map +3 -3
  288. package/utils/string/withoutLeadingCharacters.cjs +1 -1
  289. package/utils/string/withoutLeadingCharacters.cjs.map +3 -3
  290. package/utils/string/withoutLeadingCharacters.js.map +3 -3
  291. package/utils/string/withoutLeadingCharactersRecursive.cjs +1 -1
  292. package/utils/string/withoutLeadingCharactersRecursive.cjs.map +3 -3
  293. package/utils/string/withoutLeadingCharactersRecursive.js.map +3 -3
  294. package/utils/string/withoutLeadingSlash.cjs +1 -1
  295. package/utils/string/withoutLeadingSlash.cjs.map +3 -3
  296. package/utils/string/withoutLeadingSlash.js.map +3 -3
  297. package/utils/string/withoutTrailingCharacters.cjs +1 -1
  298. package/utils/string/withoutTrailingCharacters.cjs.map +3 -3
  299. package/utils/string/withoutTrailingCharacters.js.map +3 -3
  300. package/utils/string/withoutTrailingCharactersRecursive.cjs +1 -1
  301. package/utils/string/withoutTrailingCharactersRecursive.cjs.map +3 -3
  302. package/utils/string/withoutTrailingCharactersRecursive.js.map +3 -3
  303. package/utils/string/withoutTrailingSlash.cjs +1 -1
  304. package/utils/string/withoutTrailingSlash.cjs.map +3 -3
  305. package/utils/string/withoutTrailingSlash.js.map +3 -3
  306. package/utils/throttle.cjs +2 -2
  307. package/utils/throttle.cjs.map +3 -3
  308. package/utils/throttle.d.ts +1 -1
  309. package/utils/throttle.js +1 -1
  310. package/utils/throttle.js.map +3 -3
  311. package/utils/tween.cjs +2 -2
  312. package/utils/tween.cjs.map +3 -3
  313. package/utils/tween.d.ts +16 -24
  314. package/utils/tween.js +1 -1
  315. package/utils/tween.js.map +3 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/history.js"],
4
- "sourcesContent": ["import { isArray, isObject } from './is.js';\nimport { hasWindow } from './has.js';\n\n/**\n * @typedef {Object} HistoryOptions\n * @property {string} [path]\n * @property {URLSearchParams|{ [key:string]: unknown }} [search]\n * @property {string} [hash]\n */\n\n/**\n * Set a param in a URLSearchParam instance.\n * @param {URLSearchParams} params The params to update.\n * @param {string} name The name of the param to update.\n * @param {string|number|boolean|Array|Object} value The value for this param.\n * @returns {URLSearchParams} The updated URLSearchParams instance.\n */\nfunction updateUrlSearchParam(params, name, value) {\n if (value === '' || value === null || value === undefined) {\n if (params.has(name)) {\n params.delete(name);\n }\n return params;\n }\n\n if (isArray(value)) {\n value.forEach((val, index) => {\n const arrayName = `${name}[${index}]`;\n updateUrlSearchParam(params, arrayName, val);\n });\n return params;\n }\n\n if (isObject(value)) {\n Object.entries(value).forEach(([key, val]) => {\n const objectName = `${name}[${key}]`;\n updateUrlSearchParam(params, objectName, val);\n });\n return params;\n }\n\n params.set(name, value);\n return params;\n}\n\n/**\n * Transform an object to an URLSearchParams instance.\n *\n * @param {Object} obj The object to convert.\n * @param {string} defaultSearch A string of defaults search params.\n * @returns {URLSearchParams}\n */\nexport function objectToURLSearchParams(\n obj,\n defaultSearch = hasWindow() ? window.location.search : '',\n) {\n return Object.entries(obj).reduce(\n (urlSearchParams, [name, value]) => updateUrlSearchParam(urlSearchParams, name, value),\n new URLSearchParams(defaultSearch),\n );\n}\n\n/**\n * Update the history with a new state.\n * @param {string} mode\n * @param {HistoryOptions} options\n * @param {Object} [data]\n * @param {string} [title]\n * @returns {void}\n */\nfunction updateHistory(mode, options, data = {}, title = '') {\n if (!window.history) {\n return;\n }\n\n /** @type {HistoryOptions} */\n const { path, search, hash } = {\n path: window.location.pathname,\n search: new URLSearchParams(window.location.search),\n hash: window.location.hash,\n ...options,\n };\n\n let url = path;\n\n const mergedSearch = search instanceof URLSearchParams ? search : objectToURLSearchParams(search);\n\n if (mergedSearch.toString()) {\n url += `?${mergedSearch.toString()}`;\n }\n\n if (hash) {\n if (hash.startsWith('#')) {\n url += hash;\n } else {\n url += `#${hash}`;\n }\n }\n\n const method = `${mode}State`;\n window.history[method](data, title, url);\n}\n\n/**\n * Push a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function push(options, data = {}, title = '') {\n updateHistory('push', options, data, title);\n}\n\n/**\n * Replace a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function replace(options, data = {}, title = '') {\n updateHistory('replace', options, data, title);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkC;AAClC,iBAA0B;AAgB1B,SAAS,qBAAqB,QAAQ,MAAM,OAAO;AACjD,MAAI,UAAU,MAAM,UAAU,QAAQ,UAAU,QAAW;AACzD,QAAI,OAAO,IAAI,IAAI,GAAG;AACpB,aAAO,OAAO,IAAI;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAEA,UAAI,mBAAQ,KAAK,GAAG;AAClB,UAAM,QAAQ,CAAC,KAAK,UAAU;AAC5B,YAAM,YAAY,GAAG,QAAQ;AAC7B,2BAAqB,QAAQ,WAAW,GAAG;AAAA,IAC7C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,UAAI,oBAAS,KAAK,GAAG;AACnB,WAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AAC5C,YAAM,aAAa,GAAG,QAAQ;AAC9B,2BAAqB,QAAQ,YAAY,GAAG;AAAA,IAC9C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,KAAK;AACtB,SAAO;AACT;AASO,SAAS,wBACd,KACA,oBAAgB,sBAAU,IAAI,OAAO,SAAS,SAAS,IACvD;AACA,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IACzB,CAAC,iBAAiB,CAAC,MAAM,KAAK,MAAM,qBAAqB,iBAAiB,MAAM,KAAK;AAAA,IACrF,IAAI,gBAAgB,aAAa;AAAA,EACnC;AACF;AAUA,SAAS,cAAc,MAAM,SAAS,OAAO,CAAC,GAAG,QAAQ,IAAI;AAC3D,MAAI,CAAC,OAAO,SAAS;AACnB;AAAA,EACF;AAGA,QAAM,EAAE,MAAM,QAAQ,KAAK,IAAI;AAAA,IAC7B,MAAM,OAAO,SAAS;AAAA,IACtB,QAAQ,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAAA,IAClD,MAAM,OAAO,SAAS;AAAA,IACtB,GAAG;AAAA,EACL;AAEA,MAAI,MAAM;AAEV,QAAM,eAAe,kBAAkB,kBAAkB,SAAS,wBAAwB,MAAM;AAEhG,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,IAAI,aAAa,SAAS;AAAA,EACnC;AAEA,MAAI,MAAM;AACR,QAAI,KAAK,WAAW,GAAG,GAAG;AACxB,aAAO;AAAA,IACT,OAAO;AACL,aAAO,IAAI;AAAA,IACb;AAAA,EACF;AAEA,QAAM,SAAS,GAAG;AAClB,SAAO,QAAQ,QAAQ,MAAM,OAAO,GAAG;AACzC;AAUO,SAAS,KAAK,SAAS,OAAO,CAAC,GAAG,QAAQ,IAAI;AACnD,gBAAc,QAAQ,SAAS,MAAM,KAAK;AAC5C;AAUO,SAAS,QAAQ,SAAS,OAAO,CAAC,GAAG,QAAQ,IAAI;AACtD,gBAAc,WAAW,SAAS,MAAM,KAAK;AAC/C;",
3
+ "sources": ["../../packages/js-toolkit/utils/history.ts"],
4
+ "sourcesContent": ["import { isArray, isObject } from './is.js';\nimport { hasWindow } from './has.js';\n\nexport interface HistoryOptions {\n path?: string;\n search?: URLSearchParams | { [key: string]: unknown };\n hash?: string;\n}\n\n/**\n * Set a param in a URLSearchParam instance.\n * @param {URLSearchParams} params The params to update.\n * @param {string} name The name of the param to update.\n * @param {string|number|boolean|Array|Object} value The value for this param.\n * @returns {URLSearchParams} The updated URLSearchParams instance.\n */\nfunction updateUrlSearchParam(\n params: URLSearchParams,\n name: string,\n value: string | number | boolean | Array<unknown> | Record<string, unknown>,\n): URLSearchParams {\n if (value === '' || value === null || value === undefined) {\n if (params.has(name)) {\n params.delete(name);\n }\n return params;\n }\n\n if (isArray(value)) {\n value.forEach((val, index) => {\n const arrayName = `${name}[${index}]`;\n updateUrlSearchParam(params, arrayName, val);\n });\n return params;\n }\n\n if (isObject(value)) {\n Object.entries(value).forEach(([key, val]) => {\n const objectName = `${name}[${key}]`;\n updateUrlSearchParam(params, objectName, val);\n });\n return params;\n }\n\n params.set(name, value as string);\n return params;\n}\n\n/**\n * Transform an object to an URLSearchParams instance.\n *\n * @param {Object} obj The object to convert.\n * @param {string} defaultSearch A string of defaults search params.\n * @returns {URLSearchParams}\n */\nexport function objectToURLSearchParams(\n obj: unknown,\n defaultSearch = hasWindow() ? window.location.search : '',\n): URLSearchParams {\n return Object.entries(obj).reduce(\n (urlSearchParams: URLSearchParams, [name, value]) =>\n updateUrlSearchParam(urlSearchParams, name, value),\n new URLSearchParams(defaultSearch),\n ) as URLSearchParams;\n}\n\n/**\n * Update the history with a new state.\n * @param {string} mode\n * @param {HistoryOptions} options\n * @param {Object} [data]\n * @param {string} [title]\n * @returns {void}\n */\nfunction updateHistory(\n mode: 'push' | 'replace',\n options: HistoryOptions,\n data: unknown = {},\n title = '',\n) {\n if (!window.history) {\n return;\n }\n\n const { path, search, hash }: HistoryOptions = {\n path: window.location.pathname,\n search: new URLSearchParams(window.location.search),\n hash: window.location.hash,\n ...options,\n };\n\n let url = path;\n\n const mergedSearch = search instanceof URLSearchParams ? search : objectToURLSearchParams(search);\n\n if (mergedSearch.toString()) {\n url += `?${mergedSearch.toString()}`;\n }\n\n if (hash) {\n if (hash.startsWith('#')) {\n url += hash;\n } else {\n url += `#${hash}`;\n }\n }\n\n const method = `${mode}State`;\n window.history[method](data, title, url);\n}\n\n/**\n * Push a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function push(options: HistoryOptions, data: unknown = {}, title = '') {\n updateHistory('push', options, data, title);\n}\n\n/**\n * Replace a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function replace(options: HistoryOptions, data: unknown = {}, title = '') {\n updateHistory('replace', options, data, title);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkC;AAClC,iBAA0B;AAe1B,SAAS,qBACP,QACA,MACA,OACiB;AACjB,MAAI,UAAU,MAAM,UAAU,QAAQ,UAAU,QAAW;AACzD,QAAI,OAAO,IAAI,IAAI,GAAG;AACpB,aAAO,OAAO,IAAI;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAEA,UAAI,mBAAQ,KAAK,GAAG;AAClB,UAAM,QAAQ,CAAC,KAAK,UAAU;AAC5B,YAAM,YAAY,GAAG,QAAQ;AAC7B,2BAAqB,QAAQ,WAAW,GAAG;AAAA,IAC7C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,UAAI,oBAAS,KAAK,GAAG;AACnB,WAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AAC5C,YAAM,aAAa,GAAG,QAAQ;AAC9B,2BAAqB,QAAQ,YAAY,GAAG;AAAA,IAC9C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,KAAe;AAChC,SAAO;AACT;AASO,SAAS,wBACd,KACA,oBAAgB,sBAAU,IAAI,OAAO,SAAS,SAAS,IACtC;AACjB,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IACzB,CAAC,iBAAkC,CAAC,MAAM,KAAK,MAC7C,qBAAqB,iBAAiB,MAAM,KAAK;AAAA,IACnD,IAAI,gBAAgB,aAAa;AAAA,EACnC;AACF;AAUA,SAAS,cACP,MACA,SACA,OAAgB,CAAC,GACjB,QAAQ,IACR;AACA,MAAI,CAAC,OAAO,SAAS;AACnB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,QAAQ,KAAK,IAAoB;AAAA,IAC7C,MAAM,OAAO,SAAS;AAAA,IACtB,QAAQ,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAAA,IAClD,MAAM,OAAO,SAAS;AAAA,IACtB,GAAG;AAAA,EACL;AAEA,MAAI,MAAM;AAEV,QAAM,eAAe,kBAAkB,kBAAkB,SAAS,wBAAwB,MAAM;AAEhG,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,IAAI,aAAa,SAAS;AAAA,EACnC;AAEA,MAAI,MAAM;AACR,QAAI,KAAK,WAAW,GAAG,GAAG;AACxB,aAAO;AAAA,IACT,OAAO;AACL,aAAO,IAAI;AAAA,IACb;AAAA,EACF;AAEA,QAAM,SAAS,GAAG;AAClB,SAAO,QAAQ,QAAQ,MAAM,OAAO,GAAG;AACzC;AAUO,SAAS,KAAK,SAAyB,OAAgB,CAAC,GAAG,QAAQ,IAAI;AAC5E,gBAAc,QAAQ,SAAS,MAAM,KAAK;AAC5C;AAUO,SAAS,QAAQ,SAAyB,OAAgB,CAAC,GAAG,QAAQ,IAAI;AAC/E,gBAAc,WAAW,SAAS,MAAM,KAAK;AAC/C;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,10 @@
1
+ export interface HistoryOptions {
2
+ path?: string;
3
+ search?: URLSearchParams | {
4
+ [key: string]: unknown;
5
+ };
6
+ hash?: string;
7
+ }
1
8
  /**
2
9
  * Transform an object to an URLSearchParams instance.
3
10
  *
@@ -5,7 +12,7 @@
5
12
  * @param {string} defaultSearch A string of defaults search params.
6
13
  * @returns {URLSearchParams}
7
14
  */
8
- export function objectToURLSearchParams(obj: any, defaultSearch?: string): URLSearchParams;
15
+ export declare function objectToURLSearchParams(obj: unknown, defaultSearch?: string): URLSearchParams;
9
16
  /**
10
17
  * Push a new state.
11
18
  *
@@ -14,7 +21,7 @@ export function objectToURLSearchParams(obj: any, defaultSearch?: string): URLSe
14
21
  * @param {string} [title] The title for the new state.
15
22
  * @returns {void}
16
23
  */
17
- export function push(options: HistoryOptions, data?: any, title?: string): void;
24
+ export declare function push(options: HistoryOptions, data?: unknown, title?: string): void;
18
25
  /**
19
26
  * Replace a new state.
20
27
  *
@@ -23,11 +30,4 @@ export function push(options: HistoryOptions, data?: any, title?: string): void;
23
30
  * @param {string} [title] The title for the new state.
24
31
  * @returns {void}
25
32
  */
26
- export function replace(options: HistoryOptions, data?: any, title?: string): void;
27
- export type HistoryOptions = {
28
- path?: string;
29
- search?: URLSearchParams | {
30
- [key: string]: unknown;
31
- };
32
- hash?: string;
33
- };
33
+ export declare function replace(options: HistoryOptions, data?: unknown, title?: string): void;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/history.js"],
4
- "sourcesContent": ["import { isArray, isObject } from './is.js';\nimport { hasWindow } from './has.js';\n\n/**\n * @typedef {Object} HistoryOptions\n * @property {string} [path]\n * @property {URLSearchParams|{ [key:string]: unknown }} [search]\n * @property {string} [hash]\n */\n\n/**\n * Set a param in a URLSearchParam instance.\n * @param {URLSearchParams} params The params to update.\n * @param {string} name The name of the param to update.\n * @param {string|number|boolean|Array|Object} value The value for this param.\n * @returns {URLSearchParams} The updated URLSearchParams instance.\n */\nfunction updateUrlSearchParam(params, name, value) {\n if (value === '' || value === null || value === undefined) {\n if (params.has(name)) {\n params.delete(name);\n }\n return params;\n }\n\n if (isArray(value)) {\n value.forEach((val, index) => {\n const arrayName = `${name}[${index}]`;\n updateUrlSearchParam(params, arrayName, val);\n });\n return params;\n }\n\n if (isObject(value)) {\n Object.entries(value).forEach(([key, val]) => {\n const objectName = `${name}[${key}]`;\n updateUrlSearchParam(params, objectName, val);\n });\n return params;\n }\n\n params.set(name, value);\n return params;\n}\n\n/**\n * Transform an object to an URLSearchParams instance.\n *\n * @param {Object} obj The object to convert.\n * @param {string} defaultSearch A string of defaults search params.\n * @returns {URLSearchParams}\n */\nexport function objectToURLSearchParams(\n obj,\n defaultSearch = hasWindow() ? window.location.search : '',\n) {\n return Object.entries(obj).reduce(\n (urlSearchParams, [name, value]) => updateUrlSearchParam(urlSearchParams, name, value),\n new URLSearchParams(defaultSearch),\n );\n}\n\n/**\n * Update the history with a new state.\n * @param {string} mode\n * @param {HistoryOptions} options\n * @param {Object} [data]\n * @param {string} [title]\n * @returns {void}\n */\nfunction updateHistory(mode, options, data = {}, title = '') {\n if (!window.history) {\n return;\n }\n\n /** @type {HistoryOptions} */\n const { path, search, hash } = {\n path: window.location.pathname,\n search: new URLSearchParams(window.location.search),\n hash: window.location.hash,\n ...options,\n };\n\n let url = path;\n\n const mergedSearch = search instanceof URLSearchParams ? search : objectToURLSearchParams(search);\n\n if (mergedSearch.toString()) {\n url += `?${mergedSearch.toString()}`;\n }\n\n if (hash) {\n if (hash.startsWith('#')) {\n url += hash;\n } else {\n url += `#${hash}`;\n }\n }\n\n const method = `${mode}State`;\n window.history[method](data, title, url);\n}\n\n/**\n * Push a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function push(options, data = {}, title = '') {\n updateHistory('push', options, data, title);\n}\n\n/**\n * Replace a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function replace(options, data = {}, title = '') {\n updateHistory('replace', options, data, title);\n}\n"],
5
- "mappings": "AAAA,SAAS,SAAS,gBAAgB;AAClC,SAAS,iBAAiB;AAgB1B,SAAS,qBAAqB,QAAQ,MAAM,OAAO;AACjD,MAAI,UAAU,MAAM,UAAU,QAAQ,UAAU,QAAW;AACzD,QAAI,OAAO,IAAI,IAAI,GAAG;AACpB,aAAO,OAAO,IAAI;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,KAAK,GAAG;AAClB,UAAM,QAAQ,CAAC,KAAK,UAAU;AAC5B,YAAM,YAAY,GAAG,QAAQ;AAC7B,2BAAqB,QAAQ,WAAW,GAAG;AAAA,IAC7C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,KAAK,GAAG;AACnB,WAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AAC5C,YAAM,aAAa,GAAG,QAAQ;AAC9B,2BAAqB,QAAQ,YAAY,GAAG;AAAA,IAC9C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,KAAK;AACtB,SAAO;AACT;AASO,SAAS,wBACd,KACA,gBAAgB,UAAU,IAAI,OAAO,SAAS,SAAS,IACvD;AACA,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IACzB,CAAC,iBAAiB,CAAC,MAAM,KAAK,MAAM,qBAAqB,iBAAiB,MAAM,KAAK;AAAA,IACrF,IAAI,gBAAgB,aAAa;AAAA,EACnC;AACF;AAUA,SAAS,cAAc,MAAM,SAAS,OAAO,CAAC,GAAG,QAAQ,IAAI;AAC3D,MAAI,CAAC,OAAO,SAAS;AACnB;AAAA,EACF;AAGA,QAAM,EAAE,MAAM,QAAQ,KAAK,IAAI;AAAA,IAC7B,MAAM,OAAO,SAAS;AAAA,IACtB,QAAQ,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAAA,IAClD,MAAM,OAAO,SAAS;AAAA,IACtB,GAAG;AAAA,EACL;AAEA,MAAI,MAAM;AAEV,QAAM,eAAe,kBAAkB,kBAAkB,SAAS,wBAAwB,MAAM;AAEhG,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,IAAI,aAAa,SAAS;AAAA,EACnC;AAEA,MAAI,MAAM;AACR,QAAI,KAAK,WAAW,GAAG,GAAG;AACxB,aAAO;AAAA,IACT,OAAO;AACL,aAAO,IAAI;AAAA,IACb;AAAA,EACF;AAEA,QAAM,SAAS,GAAG;AAClB,SAAO,QAAQ,QAAQ,MAAM,OAAO,GAAG;AACzC;AAUO,SAAS,KAAK,SAAS,OAAO,CAAC,GAAG,QAAQ,IAAI;AACnD,gBAAc,QAAQ,SAAS,MAAM,KAAK;AAC5C;AAUO,SAAS,QAAQ,SAAS,OAAO,CAAC,GAAG,QAAQ,IAAI;AACtD,gBAAc,WAAW,SAAS,MAAM,KAAK;AAC/C;",
3
+ "sources": ["../../packages/js-toolkit/utils/history.ts"],
4
+ "sourcesContent": ["import { isArray, isObject } from './is.js';\nimport { hasWindow } from './has.js';\n\nexport interface HistoryOptions {\n path?: string;\n search?: URLSearchParams | { [key: string]: unknown };\n hash?: string;\n}\n\n/**\n * Set a param in a URLSearchParam instance.\n * @param {URLSearchParams} params The params to update.\n * @param {string} name The name of the param to update.\n * @param {string|number|boolean|Array|Object} value The value for this param.\n * @returns {URLSearchParams} The updated URLSearchParams instance.\n */\nfunction updateUrlSearchParam(\n params: URLSearchParams,\n name: string,\n value: string | number | boolean | Array<unknown> | Record<string, unknown>,\n): URLSearchParams {\n if (value === '' || value === null || value === undefined) {\n if (params.has(name)) {\n params.delete(name);\n }\n return params;\n }\n\n if (isArray(value)) {\n value.forEach((val, index) => {\n const arrayName = `${name}[${index}]`;\n updateUrlSearchParam(params, arrayName, val);\n });\n return params;\n }\n\n if (isObject(value)) {\n Object.entries(value).forEach(([key, val]) => {\n const objectName = `${name}[${key}]`;\n updateUrlSearchParam(params, objectName, val);\n });\n return params;\n }\n\n params.set(name, value as string);\n return params;\n}\n\n/**\n * Transform an object to an URLSearchParams instance.\n *\n * @param {Object} obj The object to convert.\n * @param {string} defaultSearch A string of defaults search params.\n * @returns {URLSearchParams}\n */\nexport function objectToURLSearchParams(\n obj: unknown,\n defaultSearch = hasWindow() ? window.location.search : '',\n): URLSearchParams {\n return Object.entries(obj).reduce(\n (urlSearchParams: URLSearchParams, [name, value]) =>\n updateUrlSearchParam(urlSearchParams, name, value),\n new URLSearchParams(defaultSearch),\n ) as URLSearchParams;\n}\n\n/**\n * Update the history with a new state.\n * @param {string} mode\n * @param {HistoryOptions} options\n * @param {Object} [data]\n * @param {string} [title]\n * @returns {void}\n */\nfunction updateHistory(\n mode: 'push' | 'replace',\n options: HistoryOptions,\n data: unknown = {},\n title = '',\n) {\n if (!window.history) {\n return;\n }\n\n const { path, search, hash }: HistoryOptions = {\n path: window.location.pathname,\n search: new URLSearchParams(window.location.search),\n hash: window.location.hash,\n ...options,\n };\n\n let url = path;\n\n const mergedSearch = search instanceof URLSearchParams ? search : objectToURLSearchParams(search);\n\n if (mergedSearch.toString()) {\n url += `?${mergedSearch.toString()}`;\n }\n\n if (hash) {\n if (hash.startsWith('#')) {\n url += hash;\n } else {\n url += `#${hash}`;\n }\n }\n\n const method = `${mode}State`;\n window.history[method](data, title, url);\n}\n\n/**\n * Push a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function push(options: HistoryOptions, data: unknown = {}, title = '') {\n updateHistory('push', options, data, title);\n}\n\n/**\n * Replace a new state.\n *\n * @param {HistoryOptions} options The new state.\n * @param {Object} [data] The data for the new state.\n * @param {string} [title] The title for the new state.\n * @returns {void}\n */\nexport function replace(options: HistoryOptions, data: unknown = {}, title = '') {\n updateHistory('replace', options, data, title);\n}\n"],
5
+ "mappings": "AAAA,SAAS,SAAS,gBAAgB;AAClC,SAAS,iBAAiB;AAe1B,SAAS,qBACP,QACA,MACA,OACiB;AACjB,MAAI,UAAU,MAAM,UAAU,QAAQ,UAAU,QAAW;AACzD,QAAI,OAAO,IAAI,IAAI,GAAG;AACpB,aAAO,OAAO,IAAI;AAAA,IACpB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,KAAK,GAAG;AAClB,UAAM,QAAQ,CAAC,KAAK,UAAU;AAC5B,YAAM,YAAY,GAAG,QAAQ;AAC7B,2BAAqB,QAAQ,WAAW,GAAG;AAAA,IAC7C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,KAAK,GAAG;AACnB,WAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AAC5C,YAAM,aAAa,GAAG,QAAQ;AAC9B,2BAAqB,QAAQ,YAAY,GAAG;AAAA,IAC9C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,MAAM,KAAe;AAChC,SAAO;AACT;AASO,SAAS,wBACd,KACA,gBAAgB,UAAU,IAAI,OAAO,SAAS,SAAS,IACtC;AACjB,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IACzB,CAAC,iBAAkC,CAAC,MAAM,KAAK,MAC7C,qBAAqB,iBAAiB,MAAM,KAAK;AAAA,IACnD,IAAI,gBAAgB,aAAa;AAAA,EACnC;AACF;AAUA,SAAS,cACP,MACA,SACA,OAAgB,CAAC,GACjB,QAAQ,IACR;AACA,MAAI,CAAC,OAAO,SAAS;AACnB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,QAAQ,KAAK,IAAoB;AAAA,IAC7C,MAAM,OAAO,SAAS;AAAA,IACtB,QAAQ,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAAA,IAClD,MAAM,OAAO,SAAS;AAAA,IACtB,GAAG;AAAA,EACL;AAEA,MAAI,MAAM;AAEV,QAAM,eAAe,kBAAkB,kBAAkB,SAAS,wBAAwB,MAAM;AAEhG,MAAI,aAAa,SAAS,GAAG;AAC3B,WAAO,IAAI,aAAa,SAAS;AAAA,EACnC;AAEA,MAAI,MAAM;AACR,QAAI,KAAK,WAAW,GAAG,GAAG;AACxB,aAAO;AAAA,IACT,OAAO;AACL,aAAO,IAAI;AAAA,IACb;AAAA,EACF;AAEA,QAAM,SAAS,GAAG;AAClB,SAAO,QAAQ,QAAQ,MAAM,OAAO,GAAG;AACzC;AAUO,SAAS,KAAK,SAAyB,OAAgB,CAAC,GAAG,QAAQ,IAAI;AAC5E,gBAAc,QAAQ,SAAS,MAAM,KAAK;AAC5C;AAUO,SAAS,QAAQ,SAAyB,OAAgB,CAAC,GAAG,QAAQ,IAAI;AAC/E,gBAAc,WAAW,SAAS,MAAM,KAAK;AAC/C;",
6
6
  "names": []
7
7
  }
package/utils/index.cjs CHANGED
@@ -26,6 +26,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
26
26
  // packages/js-toolkit/utils/index.ts
27
27
  var utils_exports = {};
28
28
  __export(utils_exports, {
29
+ Queue: () => import_Queue.Queue,
29
30
  debounce: () => import_debounce.default,
30
31
  focusTrap: () => import_focusTrap.default,
31
32
  historyPush: () => import_history.push,
@@ -60,5 +61,6 @@ __reExport(utils_exports, require("./string/index.cjs"), module.exports);
60
61
  __reExport(utils_exports, require("./scheduler.cjs"), module.exports);
61
62
  __reExport(utils_exports, require("./noop.cjs"), module.exports);
62
63
  var import_tween = require("./tween.cjs");
64
+ var import_Queue = require("./Queue.cjs");
63
65
  if (module.exports.default) module.exports = module.exports.default;
64
66
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/utils/index.ts"],
4
- "sourcesContent": ["export { default as debounce } from './debounce.js';\nexport { default as focusTrap } from './focusTrap.js';\nexport { default as keyCodes } from './keyCodes.js';\nexport { default as memoize } from './memoize.js';\nexport { nextFrame } from './nextFrame.js';\nexport { default as nextTick } from './nextTick.js';\nexport { default as nextMicrotask } from './nextMicrotask.js';\nexport { default as throttle } from './throttle.js';\nexport { default as scrollTo } from './scrollTo.js';\nexport * from './is.js';\nexport * from './has.js';\n// eslint-disable-next-line import/extensions\nexport * from './css/index.js';\nexport {\n objectToURLSearchParams,\n push as historyPush,\n replace as historyReplace,\n} from './history.js';\nexport * from './collide/index.js';\nexport * from './math/index.js';\nexport * from './string/index.js';\nexport * from './scheduler.js';\nexport * from './noop.js';\nexport { tween } from './tween.js';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoC;AACpC,uBAAqC;AACrC,sBAAoC;AACpC,qBAAmC;AACnC,uBAA0B;AAC1B,sBAAoC;AACpC,2BAAyC;AACzC,sBAAoC;AACpC,sBAAoC;AACpC,0BAAc,qBATd;AAUA,0BAAc,sBAVd;AAYA,0BAAc,4BAZd;AAaA,qBAIO;AACP,0BAAc,gCAlBd;AAmBA,0BAAc,6BAnBd;AAoBA,0BAAc,+BApBd;AAqBA,0BAAc,4BArBd;AAsBA,0BAAc,uBAtBd;AAuBA,mBAAsB;",
4
+ "sourcesContent": ["export { default as debounce } from './debounce.js';\nexport { default as focusTrap } from './focusTrap.js';\nexport { default as keyCodes } from './keyCodes.js';\nexport { default as memoize } from './memoize.js';\nexport { nextFrame } from './nextFrame.js';\nexport { default as nextTick } from './nextTick.js';\nexport { default as nextMicrotask } from './nextMicrotask.js';\nexport { default as throttle } from './throttle.js';\nexport { default as scrollTo } from './scrollTo.js';\nexport * from './is.js';\nexport * from './has.js';\n// eslint-disable-next-line import/extensions\nexport * from './css/index.js';\nexport {\n objectToURLSearchParams,\n push as historyPush,\n replace as historyReplace,\n} from './history.js';\nexport * from './collide/index.js';\nexport * from './math/index.js';\nexport * from './string/index.js';\nexport * from './scheduler.js';\nexport * from './noop.js';\nexport { tween } from './tween.js';\nexport { Queue } from './Queue.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoC;AACpC,uBAAqC;AACrC,sBAAoC;AACpC,qBAAmC;AACnC,uBAA0B;AAC1B,sBAAoC;AACpC,2BAAyC;AACzC,sBAAoC;AACpC,sBAAoC;AACpC,0BAAc,qBATd;AAUA,0BAAc,sBAVd;AAYA,0BAAc,4BAZd;AAaA,qBAIO;AACP,0BAAc,gCAlBd;AAmBA,0BAAc,6BAnBd;AAoBA,0BAAc,+BApBd;AAqBA,0BAAc,4BArBd;AAsBA,0BAAc,uBAtBd;AAuBA,mBAAsB;AACtB,mBAAsB;",
6
6
  "names": []
7
7
  }
package/utils/index.d.ts CHANGED
@@ -17,3 +17,4 @@ export * from './string/index.js';
17
17
  export * from './scheduler.js';
18
18
  export * from './noop.js';
19
19
  export { tween } from './tween.js';
20
+ export { Queue } from './Queue.js';
package/utils/index.js CHANGED
@@ -21,7 +21,9 @@ export * from "./string/index.js";
21
21
  export * from "./scheduler.js";
22
22
  export * from "./noop.js";
23
23
  import { tween } from "./tween.js";
24
+ import { Queue } from "./Queue.js";
24
25
  export {
26
+ Queue,
25
27
  default2 as debounce,
26
28
  default3 as focusTrap,
27
29
  push as historyPush,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/js-toolkit/utils/index.ts"],
4
- "sourcesContent": ["export { default as debounce } from './debounce.js';\nexport { default as focusTrap } from './focusTrap.js';\nexport { default as keyCodes } from './keyCodes.js';\nexport { default as memoize } from './memoize.js';\nexport { nextFrame } from './nextFrame.js';\nexport { default as nextTick } from './nextTick.js';\nexport { default as nextMicrotask } from './nextMicrotask.js';\nexport { default as throttle } from './throttle.js';\nexport { default as scrollTo } from './scrollTo.js';\nexport * from './is.js';\nexport * from './has.js';\n// eslint-disable-next-line import/extensions\nexport * from './css/index.js';\nexport {\n objectToURLSearchParams,\n push as historyPush,\n replace as historyReplace,\n} from './history.js';\nexport * from './collide/index.js';\nexport * from './math/index.js';\nexport * from './string/index.js';\nexport * from './scheduler.js';\nexport * from './noop.js';\nexport { tween } from './tween.js';\n"],
5
- "mappings": "AAAA,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAA4B;AACrC,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAAgC;AACzC,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAA2B;AACpC,cAAc;AACd,cAAc;AAEd,cAAc;AACd;AAAA,EACE;AAAA,EACQ;AAAA,EACG;AAAA,OACN;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,aAAa;",
4
+ "sourcesContent": ["export { default as debounce } from './debounce.js';\nexport { default as focusTrap } from './focusTrap.js';\nexport { default as keyCodes } from './keyCodes.js';\nexport { default as memoize } from './memoize.js';\nexport { nextFrame } from './nextFrame.js';\nexport { default as nextTick } from './nextTick.js';\nexport { default as nextMicrotask } from './nextMicrotask.js';\nexport { default as throttle } from './throttle.js';\nexport { default as scrollTo } from './scrollTo.js';\nexport * from './is.js';\nexport * from './has.js';\n// eslint-disable-next-line import/extensions\nexport * from './css/index.js';\nexport {\n objectToURLSearchParams,\n push as historyPush,\n replace as historyReplace,\n} from './history.js';\nexport * from './collide/index.js';\nexport * from './math/index.js';\nexport * from './string/index.js';\nexport * from './scheduler.js';\nexport * from './noop.js';\nexport { tween } from './tween.js';\nexport { Queue } from './Queue.js';\n"],
5
+ "mappings": "AAAA,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAA4B;AACrC,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAAgC;AACzC,SAAoB,WAAXA,gBAA2B;AACpC,SAAoB,WAAXA,gBAA2B;AACpC,cAAc;AACd,cAAc;AAEd,cAAc;AACd;AAAA,EACE;AAAA,EACQ;AAAA,EACG;AAAA,OACN;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,aAAa;AACtB,SAAS,aAAa;",
6
6
  "names": ["default"]
7
7
  }
package/utils/is.cjs CHANGED
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // packages/js-toolkit/utils/is.js
19
+ // packages/js-toolkit/utils/is.ts
20
20
  var is_exports = {};
21
21
  __export(is_exports, {
22
22
  isArray: () => isArray,
package/utils/is.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/is.js"],
4
- "sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n *\n * @param {unknown} value\n * @returns {value is Function}\n */\nexport const isFunction = (value) => typeof value === 'function';\n\n/**\n * Test if a value is defined or not.\n *\n * @param {unknown} value\n * @returns {boolean}\n */\nexport const isDefined = (value) => typeof value !== 'undefined';\n\n/**\n * Test if value is a string.\n * @param {unknown} value\n * @returns {value is string}\n */\nexport const isString = (value) => typeof value === 'string';\n\n/**\n * Test if the given value is an object.\n *\n * @param {unknown} value\n * @returns {boolean}\n */\nexport const isObject = (value) =>\n typeof value === 'object' && !!value && value.toString() === '[object Object]';\n\n/**\n * Test if a given value is a number.\n *\n * @param {unknown} value\n * @returns {value is number}\n */\nexport const isNumber = (value) => typeof value === 'number';\n\n/**\n * Test if a given value is a boolean.\n * @param {unknown} value\n * @returns {value is boolean}\n */\nexport const isBoolean = (value) => typeof value === 'boolean';\n\n// eslint-disable-next-line prefer-destructuring\nexport const isArray = Array.isArray;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAM,QAAQ,OAAO,YAAY,eAAe;AAQhD,IAAM,aAAa,CAAC,UAAU,OAAO,UAAU;AAQ/C,IAAM,YAAY,CAAC,UAAU,OAAO,UAAU;AAO9C,IAAM,WAAW,CAAC,UAAU,OAAO,UAAU;AAQ7C,IAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM;AAQxD,IAAM,WAAW,CAAC,UAAU,OAAO,UAAU;AAO7C,IAAM,YAAY,CAAC,UAAU,OAAO,UAAU;AAG9C,IAAM,UAAU,MAAM;",
3
+ "sources": ["../../packages/js-toolkit/utils/is.ts"],
4
+ "sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = (value: unknown): value is Function => typeof value === 'function';\n\n/**\n * Test if a value is defined or not.\n */\nexport const isDefined = (value: unknown): boolean => typeof value !== 'undefined';\n\n/**\n * Test if value is a string.\n */\nexport const isString = (value: unknown): value is string => typeof value === 'string';\n\n/**\n * Test if the given value is an object.\n */\nexport const isObject = (value: unknown): boolean =>\n typeof value === 'object' && !!value && value.toString() === '[object Object]';\n\n/**\n * Test if a given value is a number.\n */\nexport const isNumber = (value: unknown): value is number => typeof value === 'number';\n\n/**\n * Test if a given value is a boolean.\n */\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\n\n// eslint-disable-next-line prefer-destructuring\nexport const isArray = Array.isArray;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAM,QAAQ,OAAO,YAAY,eAAe;AAMhD,IAAM,aAAa,CAAC,UAAsC,OAAO,UAAU;AAK3E,IAAM,YAAY,CAAC,UAA4B,OAAO,UAAU;AAKhE,IAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AAKvE,IAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM;AAKxD,IAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AAKvE,IAAM,YAAY,CAAC,UAAqC,OAAO,UAAU;AAGzE,IAAM,UAAU,MAAM;",
6
6
  "names": []
7
7
  }
package/utils/is.d.ts CHANGED
@@ -1,8 +1,26 @@
1
- export const isDev: boolean;
2
- export function isFunction(value: unknown): value is Function;
3
- export function isDefined(value: unknown): boolean;
4
- export function isString(value: unknown): value is string;
5
- export function isObject(value: unknown): boolean;
6
- export function isNumber(value: unknown): value is number;
7
- export function isBoolean(value: unknown): value is boolean;
8
- export const isArray: (arg: any) => arg is any[];
1
+ export declare const isDev: boolean;
2
+ /**
3
+ * Test if the given value is a function.
4
+ */
5
+ export declare const isFunction: (value: unknown) => value is Function;
6
+ /**
7
+ * Test if a value is defined or not.
8
+ */
9
+ export declare const isDefined: (value: unknown) => boolean;
10
+ /**
11
+ * Test if value is a string.
12
+ */
13
+ export declare const isString: (value: unknown) => value is string;
14
+ /**
15
+ * Test if the given value is an object.
16
+ */
17
+ export declare const isObject: (value: unknown) => boolean;
18
+ /**
19
+ * Test if a given value is a number.
20
+ */
21
+ export declare const isNumber: (value: unknown) => value is number;
22
+ /**
23
+ * Test if a given value is a boolean.
24
+ */
25
+ export declare const isBoolean: (value: unknown) => value is boolean;
26
+ export declare const isArray: (arg: any) => arg is any[];
package/utils/is.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/is.js"],
4
- "sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n *\n * @param {unknown} value\n * @returns {value is Function}\n */\nexport const isFunction = (value) => typeof value === 'function';\n\n/**\n * Test if a value is defined or not.\n *\n * @param {unknown} value\n * @returns {boolean}\n */\nexport const isDefined = (value) => typeof value !== 'undefined';\n\n/**\n * Test if value is a string.\n * @param {unknown} value\n * @returns {value is string}\n */\nexport const isString = (value) => typeof value === 'string';\n\n/**\n * Test if the given value is an object.\n *\n * @param {unknown} value\n * @returns {boolean}\n */\nexport const isObject = (value) =>\n typeof value === 'object' && !!value && value.toString() === '[object Object]';\n\n/**\n * Test if a given value is a number.\n *\n * @param {unknown} value\n * @returns {value is number}\n */\nexport const isNumber = (value) => typeof value === 'number';\n\n/**\n * Test if a given value is a boolean.\n * @param {unknown} value\n * @returns {value is boolean}\n */\nexport const isBoolean = (value) => typeof value === 'boolean';\n\n// eslint-disable-next-line prefer-destructuring\nexport const isArray = Array.isArray;\n"],
5
- "mappings": "AACO,MAAM,QAAQ,OAAO,YAAY,eAAe;AAQhD,MAAM,aAAa,CAAC,UAAU,OAAO,UAAU;AAQ/C,MAAM,YAAY,CAAC,UAAU,OAAO,UAAU;AAO9C,MAAM,WAAW,CAAC,UAAU,OAAO,UAAU;AAQ7C,MAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM;AAQxD,MAAM,WAAW,CAAC,UAAU,OAAO,UAAU;AAO7C,MAAM,YAAY,CAAC,UAAU,OAAO,UAAU;AAG9C,MAAM,UAAU,MAAM;",
3
+ "sources": ["../../packages/js-toolkit/utils/is.ts"],
4
+ "sourcesContent": ["// eslint-disable-next-line no-undef\nexport const isDev = typeof __DEV__ !== 'undefined' && __DEV__;\n\n/**\n * Test if the given value is a function.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = (value: unknown): value is Function => typeof value === 'function';\n\n/**\n * Test if a value is defined or not.\n */\nexport const isDefined = (value: unknown): boolean => typeof value !== 'undefined';\n\n/**\n * Test if value is a string.\n */\nexport const isString = (value: unknown): value is string => typeof value === 'string';\n\n/**\n * Test if the given value is an object.\n */\nexport const isObject = (value: unknown): boolean =>\n typeof value === 'object' && !!value && value.toString() === '[object Object]';\n\n/**\n * Test if a given value is a number.\n */\nexport const isNumber = (value: unknown): value is number => typeof value === 'number';\n\n/**\n * Test if a given value is a boolean.\n */\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\n\n// eslint-disable-next-line prefer-destructuring\nexport const isArray = Array.isArray;\n"],
5
+ "mappings": "AACO,MAAM,QAAQ,OAAO,YAAY,eAAe;AAMhD,MAAM,aAAa,CAAC,UAAsC,OAAO,UAAU;AAK3E,MAAM,YAAY,CAAC,UAA4B,OAAO,UAAU;AAKhE,MAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AAKvE,MAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM;AAKxD,MAAM,WAAW,CAAC,UAAoC,OAAO,UAAU;AAKvE,MAAM,YAAY,CAAC,UAAqC,OAAO,UAAU;AAGzE,MAAM,UAAU,MAAM;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // packages/js-toolkit/utils/keyCodes.js
19
+ // packages/js-toolkit/utils/keyCodes.ts
20
20
  var keyCodes_exports = {};
21
21
  __export(keyCodes_exports, {
22
22
  default: () => keyCodes_default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/keyCodes.js"],
4
- "sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n};\n"],
3
+ "sources": ["../../packages/js-toolkit/utils/keyCodes.ts"],
4
+ "sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n} as const;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,mBAAQ;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,11 @@
1
- declare namespace _default {
2
- const ENTER: number;
3
- const SPACE: number;
4
- const TAB: number;
5
- const ESC: number;
6
- const LEFT: number;
7
- const UP: number;
8
- const RIGHT: number;
9
- const DOWN: number;
10
- }
1
+ declare const _default: {
2
+ readonly ENTER: 13;
3
+ readonly SPACE: 32;
4
+ readonly TAB: 9;
5
+ readonly ESC: 27;
6
+ readonly LEFT: 37;
7
+ readonly UP: 38;
8
+ readonly RIGHT: 39;
9
+ readonly DOWN: 40;
10
+ };
11
11
  export default _default;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../packages/js-toolkit/utils/keyCodes.js"],
4
- "sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n};\n"],
3
+ "sources": ["../../packages/js-toolkit/utils/keyCodes.ts"],
4
+ "sourcesContent": ["export default {\n ENTER: 13,\n SPACE: 32,\n TAB: 9,\n ESC: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n} as const;\n"],
5
5
  "mappings": "AAAA,IAAO,mBAAQ;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // packages/js-toolkit/utils/math/clamp.js
19
+ // packages/js-toolkit/utils/math/clamp.ts
20
20
  var clamp_exports = {};
21
21
  __export(clamp_exports, {
22
22
  default: () => clamp
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../packages/js-toolkit/utils/math/clamp.js"],
4
- "sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value, min, max) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,MAAuB,OAAO,KAAK,KAAK;AAE7C,SAAO,MAAM,MACT,QAAQ,MACN,MACA,QAAQ,MACR,MACA,QACF,QAAQ,MACR,MACA,QAAQ,MACR,MACA;AAEN;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/clamp.ts"],
4
+ "sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value: number, min: number, max: number) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOe,SAAR,MAAuB,OAAe,KAAa,KAAa;AAErE,SAAO,MAAM,MACT,QAAQ,MACN,MACA,QAAQ,MACR,MACA,QACF,QAAQ,MACR,MACA,QAAQ,MACR,MACA;AAEN;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../packages/js-toolkit/utils/math/clamp.js"],
4
- "sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value, min, max) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
5
- "mappings": "AAOe,SAAR,MAAuB,OAAO,KAAK,KAAK;AAE7C,SAAO,MAAM,MACT,QAAQ,MACN,MACA,QAAQ,MACR,MACA,QACF,QAAQ,MACR,MACA,QAAQ,MACR,MACA;AAEN;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/clamp.ts"],
4
+ "sourcesContent": ["/**\n * Clamp a value in a given range.\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @returns {number}\n */\nexport default function clamp(value: number, min: number, max: number) {\n /* eslint-disable no-nested-ternary */\n return min < max\n ? value < min\n ? min\n : value > max\n ? max\n : value\n : value < max\n ? max\n : value > min\n ? min\n : value;\n /* eslint-enable no-nested-ternary */\n}\n"],
5
+ "mappings": "AAOe,SAAR,MAAuB,OAAe,KAAa,KAAa;AAErE,SAAO,MAAM,MACT,QAAQ,MACN,MACA,QAAQ,MACR,MACA,QACF,QAAQ,MACR,MACA,QAAQ,MACR,MACA;AAEN;",
6
6
  "names": []
7
7
  }
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  ));
23
23
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
24
 
25
- // packages/js-toolkit/utils/math/clamp01.js
25
+ // packages/js-toolkit/utils/math/clamp01.ts
26
26
  var clamp01_exports = {};
27
27
  __export(clamp01_exports, {
28
28
  default: () => clamp01
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../packages/js-toolkit/utils/math/clamp01.js"],
4
- "sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value) {\n return clamp(value, 0, 1);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAOH,SAAR,QAAyB,OAAO;AACrC,aAAO,aAAAA,SAAM,OAAO,GAAG,CAAC;AAC1B;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/clamp01.ts"],
4
+ "sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value: number) {\n return clamp(value, 0, 1);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAOH,SAAR,QAAyB,OAAe;AAC7C,aAAO,aAAAA,SAAM,OAAO,GAAG,CAAC;AAC1B;",
6
6
  "names": ["clamp"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../packages/js-toolkit/utils/math/clamp01.js"],
4
- "sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value) {\n return clamp(value, 0, 1);\n}\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAOH,SAAR,QAAyB,OAAO;AACrC,SAAO,MAAM,OAAO,GAAG,CAAC;AAC1B;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/clamp01.ts"],
4
+ "sourcesContent": ["import clamp from './clamp.js';\n\n/**\n * Clamp a value in the 0\u20131 range.\n * @param {number} value\n * @returns {number}\n */\nexport default function clamp01(value: number) {\n return clamp(value, 0, 1);\n}\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAOH,SAAR,QAAyB,OAAe;AAC7C,SAAO,MAAM,OAAO,GAAG,CAAC;AAC1B;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // packages/js-toolkit/utils/math/createEases.js
19
+ // packages/js-toolkit/utils/math/createEases.ts
20
20
  var createEases_exports = {};
21
21
  __export(createEases_exports, {
22
22
  createEaseInOut: () => createEaseInOut,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../packages/js-toolkit/utils/math/createEases.js"],
4
- "sourcesContent": ["/**\n * @typedef {(progress: number) => number} EasingFunction\n */\n\n/**\n * Create an out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The out function.\n */\nexport function createEaseOut(easeIn) {\n return (progress) => 1 - easeIn(1 - progress);\n}\n\n/**\n * Create an in-out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The in-out function.\n */\nexport function createEaseInOut(easeIn) {\n /* eslint-disable no-nested-ternary */\n return (progress) =>\n progress === 0\n ? 0\n : progress === 1\n ? 1\n : progress < 0.5\n ? easeIn(progress * 2) / 2\n : 1 - easeIn((1 - progress) * 2) / 2;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,cAAc,QAAQ;AACpC,SAAO,CAAC,aAAa,IAAI,OAAO,IAAI,QAAQ;AAC9C;AAQO,SAAS,gBAAgB,QAAQ;AAEtC,SAAO,CAAC,aACN,aAAa,IACT,IACA,aAAa,IACb,IACA,WAAW,MACX,OAAO,WAAW,CAAC,IAAI,IACvB,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI;AACzC;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/createEases.ts"],
4
+ "sourcesContent": ["export type EasingFunction = (progress: number) => number;\n\n/**\n * Create an out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The out function.\n */\nexport function createEaseOut(easeIn: EasingFunction): EasingFunction {\n return (progress) => 1 - easeIn(1 - progress);\n}\n\n/**\n * Create an in-out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The in-out function.\n */\nexport function createEaseInOut(easeIn: EasingFunction): EasingFunction {\n /* eslint-disable no-nested-ternary */\n // eslint-disable-next-line no-confusing-arrow\n return (progress) =>\n progress === 0\n ? 0\n : progress === 1\n ? 1\n : progress < 0.5\n ? easeIn(progress * 2) / 2\n : 1 - easeIn((1 - progress) * 2) / 2;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,cAAc,QAAwC;AACpE,SAAO,CAAC,aAAa,IAAI,OAAO,IAAI,QAAQ;AAC9C;AAQO,SAAS,gBAAgB,QAAwC;AAGtE,SAAO,CAAC,aACN,aAAa,IACT,IACA,aAAa,IACb,IACA,WAAW,MACX,OAAO,WAAW,CAAC,IAAI,IACvB,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI;AACzC;",
6
6
  "names": []
7
7
  }
@@ -1,18 +1,15 @@
1
- /**
2
- * @typedef {(progress: number) => number} EasingFunction
3
- */
1
+ export declare type EasingFunction = (progress: number) => number;
4
2
  /**
5
3
  * Create an out easing function.
6
4
  *
7
5
  * @param {EasingFunction} easeIn The ease in function.
8
6
  * @returns {EasingFunction} The out function.
9
7
  */
10
- export function createEaseOut(easeIn: EasingFunction): EasingFunction;
8
+ export declare function createEaseOut(easeIn: EasingFunction): EasingFunction;
11
9
  /**
12
10
  * Create an in-out easing function.
13
11
  *
14
12
  * @param {EasingFunction} easeIn The ease in function.
15
13
  * @returns {EasingFunction} The in-out function.
16
14
  */
17
- export function createEaseInOut(easeIn: EasingFunction): EasingFunction;
18
- export type EasingFunction = (progress: number) => number;
15
+ export declare function createEaseInOut(easeIn: EasingFunction): EasingFunction;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../packages/js-toolkit/utils/math/createEases.js"],
4
- "sourcesContent": ["/**\n * @typedef {(progress: number) => number} EasingFunction\n */\n\n/**\n * Create an out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The out function.\n */\nexport function createEaseOut(easeIn) {\n return (progress) => 1 - easeIn(1 - progress);\n}\n\n/**\n * Create an in-out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The in-out function.\n */\nexport function createEaseInOut(easeIn) {\n /* eslint-disable no-nested-ternary */\n return (progress) =>\n progress === 0\n ? 0\n : progress === 1\n ? 1\n : progress < 0.5\n ? easeIn(progress * 2) / 2\n : 1 - easeIn((1 - progress) * 2) / 2;\n}\n"],
5
- "mappings": "AAUO,SAAS,cAAc,QAAQ;AACpC,SAAO,CAAC,aAAa,IAAI,OAAO,IAAI,QAAQ;AAC9C;AAQO,SAAS,gBAAgB,QAAQ;AAEtC,SAAO,CAAC,aACN,aAAa,IACT,IACA,aAAa,IACb,IACA,WAAW,MACX,OAAO,WAAW,CAAC,IAAI,IACvB,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI;AACzC;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/createEases.ts"],
4
+ "sourcesContent": ["export type EasingFunction = (progress: number) => number;\n\n/**\n * Create an out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The out function.\n */\nexport function createEaseOut(easeIn: EasingFunction): EasingFunction {\n return (progress) => 1 - easeIn(1 - progress);\n}\n\n/**\n * Create an in-out easing function.\n *\n * @param {EasingFunction} easeIn The ease in function.\n * @returns {EasingFunction} The in-out function.\n */\nexport function createEaseInOut(easeIn: EasingFunction): EasingFunction {\n /* eslint-disable no-nested-ternary */\n // eslint-disable-next-line no-confusing-arrow\n return (progress) =>\n progress === 0\n ? 0\n : progress === 1\n ? 1\n : progress < 0.5\n ? easeIn(progress * 2) / 2\n : 1 - easeIn((1 - progress) * 2) / 2;\n}\n"],
5
+ "mappings": "AAQO,SAAS,cAAc,QAAwC;AACpE,SAAO,CAAC,aAAa,IAAI,OAAO,IAAI,QAAQ;AAC9C;AAQO,SAAS,gBAAgB,QAAwC;AAGtE,SAAO,CAAC,aACN,aAAa,IACT,IACA,aAAa,IACb,IACA,WAAW,MACX,OAAO,WAAW,CAAC,IAAI,IACvB,IAAI,QAAQ,IAAI,YAAY,CAAC,IAAI;AACzC;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // packages/js-toolkit/utils/math/damp.js
19
+ // packages/js-toolkit/utils/math/damp.ts
20
20
  var damp_exports = {};
21
21
  __export(damp_exports, {
22
22
  default: () => damp
@@ -1,7 +1,7 @@
1
1
  {
2
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;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/damp.ts"],
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(\n targetValue: number,\n currentValue: number,\n factor = 0.5,\n precision = 0.01,\n) {\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,KACL,aACA,cACA,SAAS,KACT,YAAY,MACZ;AACA,SAAO,KAAK,IAAI,cAAc,YAAY,IAAI,YAC1C,cACA,gBAAgB,cAAc,gBAAgB;AACpD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
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;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/damp.ts"],
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(\n targetValue: number,\n currentValue: number,\n factor = 0.5,\n precision = 0.01,\n) {\n return Math.abs(targetValue - currentValue) < precision\n ? targetValue\n : currentValue + (targetValue - currentValue) * factor;\n}\n"],
5
+ "mappings": "AASe,SAAR,KACL,aACA,cACA,SAAS,KACT,YAAY,MACZ;AACA,SAAO,KAAK,IAAI,cAAc,YAAY,IAAI,YAC1C,cACA,gBAAgB,cAAc,gBAAgB;AACpD;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // packages/js-toolkit/utils/math/ease.js
19
+ // packages/js-toolkit/utils/math/ease.ts
20
20
  var ease_exports = {};
21
21
  __export(ease_exports, {
22
22
  easeInCirc: () => easeInCirc,
@@ -1,7 +1,7 @@
1
1
  {
2
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;",
3
+ "sources": ["../../../packages/js-toolkit/utils/math/ease.ts"],
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: number) {\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: number) {\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: number) {\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: number) {\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: number) {\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: number) {\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: number) {\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,UAAkB;AAC3C,SAAO,YAAY;AACrB;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,YAAY,UAAkB;AAC5C,SAAO,YAAY;AACrB;AAEO,IAAM,mBAAe,kCAAc,WAAW;AAC9C,IAAM,qBAAiB,oCAAgB,WAAW;AAQlD,SAAS,WAAW,UAAkB;AAC3C,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,UAAkB;AAC3C,SAAO,EAAE,KAAK,KAAK,IAAI,WAAW,QAAQ,IAAI;AAChD;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;AAQhD,SAAS,WAAW,UAAkB;AAC3C,SAAO,MAAM,MAAM,WAAW;AAChC;AAEO,IAAM,kBAAc,kCAAc,UAAU;AAC5C,IAAM,oBAAgB,oCAAgB,UAAU;",
6
6
  "names": []
7
7
  }