yummies 5.3.1 → 5.4.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 (461) hide show
  1. package/dist/async.cjs +70 -0
  2. package/dist/async.d.ts +28 -0
  3. package/dist/async.d.ts.map +1 -0
  4. package/dist/common.cjs +18 -0
  5. package/dist/common.d.cts +15 -0
  6. package/dist/common.d.cts.map +1 -0
  7. package/{common.d.ts → dist/common.d.ts} +1 -1
  8. package/dist/common.d.ts.map +1 -0
  9. package/dist/complex/counter.cjs +21 -0
  10. package/dist/complex/counter.d.ts +15 -0
  11. package/dist/complex/counter.d.ts.map +1 -0
  12. package/dist/complex/global-config.cjs +46 -0
  13. package/dist/complex/global-config.d.cts +11 -0
  14. package/dist/complex/global-config.d.cts.map +1 -0
  15. package/{complex → dist/complex}/global-config.d.ts +1 -1
  16. package/dist/complex/global-config.d.ts.map +1 -0
  17. package/dist/complex/index.cjs +19 -0
  18. package/dist/complex/index.d.cts +4 -0
  19. package/dist/complex/index.d.cts.map +1 -0
  20. package/dist/complex/index.d.ts +4 -0
  21. package/dist/complex/index.d.ts.map +1 -0
  22. package/dist/complex/index.js +3 -0
  23. package/dist/complex/modules-factory.cjs +50 -0
  24. package/dist/complex/modules-factory.d.cts +49 -0
  25. package/dist/complex/modules-factory.d.cts.map +1 -0
  26. package/{complex → dist/complex}/modules-factory.d.ts +1 -1
  27. package/dist/complex/modules-factory.d.ts.map +1 -0
  28. package/dist/cookie.cjs +13 -0
  29. package/dist/cookie.d.cts +3 -0
  30. package/dist/cookie.d.cts.map +1 -0
  31. package/dist/cookie.d.ts +3 -0
  32. package/{cookie.d.ts.map → dist/cookie.d.ts.map} +1 -1
  33. package/dist/data.cjs +58 -0
  34. package/dist/data.d.ts +4 -0
  35. package/dist/data.d.ts.map +1 -0
  36. package/dist/date-time.cjs +171 -0
  37. package/dist/date-time.d.cts +28 -0
  38. package/dist/date-time.d.cts.map +1 -0
  39. package/{date-time.d.ts → dist/date-time.d.ts} +1 -1
  40. package/dist/date-time.d.ts.map +1 -0
  41. package/{date-time.js → dist/date-time.js} +4 -4
  42. package/dist/device.cjs +28 -0
  43. package/dist/device.d.ts +8 -0
  44. package/dist/device.d.ts.map +1 -0
  45. package/dist/encodings.cjs +270 -0
  46. package/dist/encodings.d.ts +2 -0
  47. package/dist/encodings.d.ts.map +1 -0
  48. package/dist/errors.cjs +34 -0
  49. package/dist/errors.d.cts +19 -0
  50. package/dist/errors.d.cts.map +1 -0
  51. package/{errors.d.ts → dist/errors.d.ts} +1 -1
  52. package/dist/errors.d.ts.map +1 -0
  53. package/{errors.js → dist/errors.js} +1 -1
  54. package/dist/file.cjs +29 -0
  55. package/dist/file.d.ts +3 -0
  56. package/dist/file.d.ts.map +1 -0
  57. package/dist/format/_exports.cjs +20 -0
  58. package/dist/format/_exports.d.cts +5 -0
  59. package/dist/format/_exports.d.cts.map +1 -0
  60. package/dist/format/_exports.d.ts +5 -0
  61. package/dist/format/_exports.d.ts.map +1 -0
  62. package/dist/format/_exports.js +4 -0
  63. package/dist/format/constants.cjs +6 -0
  64. package/dist/format/constants.d.ts +4 -0
  65. package/dist/format/constants.d.ts.map +1 -0
  66. package/dist/format/index.cjs +40 -0
  67. package/dist/format/index.d.cts +3 -0
  68. package/dist/format/index.d.cts.map +1 -0
  69. package/dist/format/index.d.ts +3 -0
  70. package/{format → dist/format}/index.d.ts.map +1 -1
  71. package/{format → dist/format}/index.js +1 -1
  72. package/dist/format/number.cjs +48 -0
  73. package/dist/format/number.d.cts +36 -0
  74. package/dist/format/number.d.cts.map +1 -0
  75. package/{format → dist/format}/number.d.ts +1 -1
  76. package/dist/format/number.d.ts.map +1 -0
  77. package/{format → dist/format}/number.js +3 -3
  78. package/dist/format/percent.cjs +27 -0
  79. package/dist/format/percent.d.cts +15 -0
  80. package/dist/format/percent.d.cts.map +1 -0
  81. package/{format → dist/format}/percent.d.ts +2 -2
  82. package/dist/format/percent.d.ts.map +1 -0
  83. package/{format → dist/format}/percent.js +3 -3
  84. package/dist/format/skip-spaces.cjs +8 -0
  85. package/dist/format/skip-spaces.d.ts +5 -0
  86. package/dist/format/skip-spaces.d.ts.map +1 -0
  87. package/dist/html.cjs +202 -0
  88. package/dist/html.d.cts +44 -0
  89. package/dist/html.d.cts.map +1 -0
  90. package/{html.d.ts → dist/html.d.ts} +1 -1
  91. package/dist/html.d.ts.map +1 -0
  92. package/{html.js → dist/html.js} +1 -1
  93. package/dist/id.cjs +76 -0
  94. package/dist/id.d.ts +63 -0
  95. package/dist/id.d.ts.map +1 -0
  96. package/dist/imports.cjs +45 -0
  97. package/dist/imports.d.ts +15 -0
  98. package/dist/imports.d.ts.map +1 -0
  99. package/{imports.js → dist/imports.js} +1 -1
  100. package/dist/math.cjs +23 -0
  101. package/dist/math.d.cts +13 -0
  102. package/dist/math.d.cts.map +1 -0
  103. package/{math.d.ts → dist/math.d.ts} +1 -1
  104. package/dist/math.d.ts.map +1 -0
  105. package/dist/media.cjs +115 -0
  106. package/dist/media.d.ts +20 -0
  107. package/dist/media.d.ts.map +1 -0
  108. package/{media.js → dist/media.js} +1 -1
  109. package/dist/mobx/apply-observable.cjs +16 -0
  110. package/dist/mobx/apply-observable.d.cts +4 -0
  111. package/dist/mobx/apply-observable.d.cts.map +1 -0
  112. package/{mobx → dist/mobx}/apply-observable.d.ts +1 -1
  113. package/dist/mobx/apply-observable.d.ts.map +1 -0
  114. package/dist/mobx/create-enhanced-atom.cjs +16 -0
  115. package/dist/mobx/create-enhanced-atom.d.cts +11 -0
  116. package/dist/mobx/create-enhanced-atom.d.cts.map +1 -0
  117. package/{mobx → dist/mobx}/create-enhanced-atom.d.ts +1 -1
  118. package/dist/mobx/create-enhanced-atom.d.ts.map +1 -0
  119. package/{mobx → dist/mobx}/create-enhanced-atom.js +2 -2
  120. package/dist/mobx/deep-observable-struct.cjs +61 -0
  121. package/dist/mobx/deep-observable-struct.d.cts +7 -0
  122. package/dist/mobx/deep-observable-struct.d.cts.map +1 -0
  123. package/{mobx → dist/mobx}/deep-observable-struct.d.ts +1 -1
  124. package/dist/mobx/deep-observable-struct.d.ts.map +1 -0
  125. package/{mobx → dist/mobx}/deep-observable-struct.js +1 -1
  126. package/dist/mobx/get-mobx-administration.cjs +6 -0
  127. package/dist/mobx/get-mobx-administration.d.cts +6 -0
  128. package/dist/mobx/get-mobx-administration.d.cts.map +1 -0
  129. package/{mobx → dist/mobx}/get-mobx-administration.d.ts +1 -1
  130. package/dist/mobx/get-mobx-administration.d.ts.map +1 -0
  131. package/dist/mobx/index.cjs +21 -0
  132. package/dist/mobx/index.d.cts +6 -0
  133. package/dist/mobx/index.d.cts.map +1 -0
  134. package/dist/mobx/index.d.ts +6 -0
  135. package/dist/mobx/index.d.ts.map +1 -0
  136. package/dist/mobx/index.js +5 -0
  137. package/dist/mobx/lazy-observe.cjs +47 -0
  138. package/dist/mobx/lazy-observe.d.ts +8 -0
  139. package/dist/mobx/lazy-observe.d.ts.map +1 -0
  140. package/dist/ms.cjs +22 -0
  141. package/dist/ms.d.ts +19 -0
  142. package/dist/ms.d.ts.map +1 -0
  143. package/dist/number.cjs +16 -0
  144. package/dist/number.d.ts +8 -0
  145. package/dist/number.d.ts.map +1 -0
  146. package/dist/parser/_exports.cjs +19 -0
  147. package/dist/parser/_exports.d.cts +4 -0
  148. package/dist/parser/_exports.d.cts.map +1 -0
  149. package/dist/parser/_exports.d.ts +4 -0
  150. package/dist/parser/_exports.d.ts.map +1 -0
  151. package/dist/parser/_exports.js +3 -0
  152. package/dist/parser/index.cjs +40 -0
  153. package/dist/parser/index.d.cts +3 -0
  154. package/dist/parser/index.d.cts.map +1 -0
  155. package/dist/parser/index.d.ts +3 -0
  156. package/{parser → dist/parser}/index.d.ts.map +1 -1
  157. package/{parser → dist/parser}/index.js +1 -1
  158. package/dist/parser/number.cjs +48 -0
  159. package/dist/parser/number.d.cts +21 -0
  160. package/dist/parser/number.d.cts.map +1 -0
  161. package/{parser → dist/parser}/number.d.ts +1 -1
  162. package/dist/parser/number.d.ts.map +1 -0
  163. package/{parser → dist/parser}/number.js +2 -2
  164. package/dist/parser/percent.cjs +8 -0
  165. package/dist/parser/percent.d.cts +4 -0
  166. package/dist/parser/percent.d.cts.map +1 -0
  167. package/{parser → dist/parser}/percent.d.ts +2 -2
  168. package/dist/parser/percent.d.ts.map +1 -0
  169. package/{parser → dist/parser}/percent.js +1 -1
  170. package/dist/parser/string.cjs +18 -0
  171. package/dist/parser/string.d.cts +7 -0
  172. package/dist/parser/string.d.cts.map +1 -0
  173. package/{parser → dist/parser}/string.d.ts +1 -1
  174. package/dist/parser/string.d.ts.map +1 -0
  175. package/{parser → dist/parser}/string.js +1 -1
  176. package/dist/price.cjs +21 -0
  177. package/dist/price.d.ts +6 -0
  178. package/dist/price.d.ts.map +1 -0
  179. package/dist/random.cjs +25 -0
  180. package/dist/random.d.ts +9 -0
  181. package/dist/random.d.ts.map +1 -0
  182. package/dist/react/hooks/index.cjs +37 -0
  183. package/dist/react/hooks/index.d.cts +22 -0
  184. package/dist/react/hooks/index.d.cts.map +1 -0
  185. package/dist/react/hooks/index.d.ts +22 -0
  186. package/dist/react/hooks/index.d.ts.map +1 -0
  187. package/dist/react/hooks/index.js +21 -0
  188. package/dist/react/hooks/use-abort-controller.cjs +15 -0
  189. package/dist/react/hooks/use-abort-controller.d.ts +2 -0
  190. package/dist/react/hooks/use-abort-controller.d.ts.map +1 -0
  191. package/{react → dist/react}/hooks/use-abort-controller.js +1 -1
  192. package/dist/react/hooks/use-abort-signal.cjs +8 -0
  193. package/dist/react/hooks/use-abort-signal.d.ts +2 -0
  194. package/dist/react/hooks/use-abort-signal.d.ts.map +1 -0
  195. package/{react → dist/react}/hooks/use-abort-signal.js +1 -1
  196. package/dist/react/hooks/use-click-outside.cjs +17 -0
  197. package/dist/react/hooks/use-click-outside.d.ts +9 -0
  198. package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
  199. package/{react → dist/react}/hooks/use-click-outside.js +1 -1
  200. package/dist/react/hooks/use-constant.cjs +19 -0
  201. package/dist/react/hooks/use-constant.d.ts +9 -0
  202. package/dist/react/hooks/use-constant.d.ts.map +1 -0
  203. package/dist/react/hooks/use-define-ref.cjs +19 -0
  204. package/dist/react/hooks/use-define-ref.d.ts +10 -0
  205. package/dist/react/hooks/use-define-ref.d.ts.map +1 -0
  206. package/dist/react/hooks/use-element-ref.cjs +12 -0
  207. package/dist/react/hooks/use-element-ref.d.ts +2 -0
  208. package/dist/react/hooks/use-element-ref.d.ts.map +1 -0
  209. package/dist/react/hooks/use-event-listener.cjs +17 -0
  210. package/dist/react/hooks/use-event-listener.d.ts +8 -0
  211. package/dist/react/hooks/use-event-listener.d.ts.map +1 -0
  212. package/{react → dist/react}/hooks/use-event-listener.js +1 -1
  213. package/dist/react/hooks/use-event.cjs +23 -0
  214. package/dist/react/hooks/use-event.d.cts +3 -0
  215. package/dist/react/hooks/use-event.d.cts.map +1 -0
  216. package/dist/react/hooks/use-event.d.ts +3 -0
  217. package/{react → dist/react}/hooks/use-event.d.ts.map +1 -1
  218. package/dist/react/hooks/use-flag.cjs +19 -0
  219. package/dist/react/hooks/use-flag.d.ts +8 -0
  220. package/dist/react/hooks/use-flag.d.ts.map +1 -0
  221. package/dist/react/hooks/use-force-update.cjs +11 -0
  222. package/dist/react/hooks/use-force-update.d.ts +2 -0
  223. package/dist/react/hooks/use-force-update.d.ts.map +1 -0
  224. package/dist/react/hooks/use-initial-height.cjs +15 -0
  225. package/dist/react/hooks/use-initial-height.d.ts +5 -0
  226. package/dist/react/hooks/use-initial-height.d.ts.map +1 -0
  227. package/dist/react/hooks/use-instance.cjs +31 -0
  228. package/dist/react/hooks/use-instance.d.ts +27 -0
  229. package/dist/react/hooks/use-instance.d.ts.map +1 -0
  230. package/{react → dist/react}/hooks/use-instance.js +2 -2
  231. package/dist/react/hooks/use-intersection-observer.cjs +14 -0
  232. package/dist/react/hooks/use-intersection-observer.d.ts +2 -0
  233. package/dist/react/hooks/use-intersection-observer.d.ts.map +1 -0
  234. package/dist/react/hooks/use-last-defined-value.cjs +12 -0
  235. package/dist/react/hooks/use-last-defined-value.d.ts +2 -0
  236. package/dist/react/hooks/use-last-defined-value.d.ts.map +1 -0
  237. package/dist/react/hooks/use-last-value-ref.cjs +12 -0
  238. package/dist/react/hooks/use-last-value-ref.d.ts +2 -0
  239. package/dist/react/hooks/use-last-value-ref.d.ts.map +1 -0
  240. package/dist/react/hooks/use-life-cycle.cjs +14 -0
  241. package/dist/react/hooks/use-life-cycle.d.ts +5 -0
  242. package/dist/react/hooks/use-life-cycle.d.ts.map +1 -0
  243. package/{react → dist/react}/hooks/use-life-cycle.js +1 -1
  244. package/dist/react/hooks/use-resize-observer.cjs +15 -0
  245. package/dist/react/hooks/use-resize-observer.d.ts +2 -0
  246. package/dist/react/hooks/use-resize-observer.d.ts.map +1 -0
  247. package/{react → dist/react}/hooks/use-resize-observer.js +1 -1
  248. package/dist/react/hooks/use-sync-ref.cjs +10 -0
  249. package/dist/react/hooks/use-sync-ref.d.ts +2 -0
  250. package/dist/react/hooks/use-sync-ref.d.ts.map +1 -0
  251. package/dist/react/hooks/use-toggle.cjs +10 -0
  252. package/dist/react/hooks/use-toggle.d.ts +2 -0
  253. package/dist/react/hooks/use-toggle.d.ts.map +1 -0
  254. package/dist/react/hooks/use-value.cjs +12 -0
  255. package/dist/react/hooks/use-value.d.ts +5 -0
  256. package/dist/react/hooks/use-value.d.ts.map +1 -0
  257. package/dist/react/hooks/use-visibility-state.cjs +18 -0
  258. package/dist/react/hooks/use-visibility-state.d.ts +2 -0
  259. package/dist/react/hooks/use-visibility-state.d.ts.map +1 -0
  260. package/dist/react/index.cjs +17 -0
  261. package/dist/react/index.d.cts +2 -0
  262. package/dist/react/index.d.cts.map +1 -0
  263. package/dist/react/index.d.ts +2 -0
  264. package/dist/react/index.d.ts.map +1 -0
  265. package/dist/react/index.js +1 -0
  266. package/dist/sound.cjs +16 -0
  267. package/dist/sound.d.ts +7 -0
  268. package/dist/sound.d.ts.map +1 -0
  269. package/dist/storage.cjs +48 -0
  270. package/dist/storage.d.ts +39 -0
  271. package/dist/storage.d.ts.map +1 -0
  272. package/dist/text.cjs +53 -0
  273. package/dist/text.d.ts +15 -0
  274. package/dist/text.d.ts.map +1 -0
  275. package/dist/type-guard/_exports.cjs +129 -0
  276. package/dist/type-guard/_exports.d.cts +86 -0
  277. package/dist/type-guard/_exports.d.cts.map +1 -0
  278. package/{type-guard → dist/type-guard}/_exports.d.ts +1 -1
  279. package/dist/type-guard/_exports.d.ts.map +1 -0
  280. package/dist/type-guard/index.cjs +40 -0
  281. package/dist/type-guard/index.d.cts +3 -0
  282. package/dist/type-guard/index.d.cts.map +1 -0
  283. package/dist/type-guard/index.d.ts +3 -0
  284. package/{type-guard → dist/type-guard}/index.d.ts.map +1 -1
  285. package/{type-guard → dist/type-guard}/index.js +1 -1
  286. package/dist/utils/types.cjs +2 -0
  287. package/dist/utils/types.d.ts +395 -0
  288. package/dist/utils/types.d.ts.map +1 -0
  289. package/dist/vibrate.cjs +12 -0
  290. package/dist/vibrate.d.ts +5 -0
  291. package/dist/vibrate.d.ts.map +1 -0
  292. package/package.json +149 -356
  293. package/assets/logo.png +0 -0
  294. package/assets/logo.pxz +0 -0
  295. package/common.d.ts.map +0 -1
  296. package/complex/global-config.d.ts.map +0 -1
  297. package/complex/index.d.ts +0 -4
  298. package/complex/index.d.ts.map +0 -1
  299. package/complex/index.js +0 -3
  300. package/complex/modules-factory.d.ts.map +0 -1
  301. package/cookie.d.ts +0 -3
  302. package/css.d.ts +0 -36
  303. package/css.d.ts.map +0 -1
  304. package/css.js +0 -20
  305. package/date-time.d.ts.map +0 -1
  306. package/errors.d.ts.map +0 -1
  307. package/format/_exports.d.ts +0 -5
  308. package/format/_exports.d.ts.map +0 -1
  309. package/format/_exports.js +0 -4
  310. package/format/index.d.ts +0 -3
  311. package/format/number.d.ts.map +0 -1
  312. package/format/percent.d.ts.map +0 -1
  313. package/html.d.ts.map +0 -1
  314. package/math.d.ts.map +0 -1
  315. package/mobx/apply-observable.d.ts.map +0 -1
  316. package/mobx/create-enhanced-atom.d.ts.map +0 -1
  317. package/mobx/deep-observable-struct.d.ts.map +0 -1
  318. package/mobx/get-mobx-administration.d.ts.map +0 -1
  319. package/mobx/index.d.ts +0 -6
  320. package/mobx/index.d.ts.map +0 -1
  321. package/mobx/index.js +0 -5
  322. package/parser/_exports.d.ts +0 -4
  323. package/parser/_exports.d.ts.map +0 -1
  324. package/parser/_exports.js +0 -3
  325. package/parser/index.d.ts +0 -3
  326. package/parser/number.d.ts.map +0 -1
  327. package/parser/percent.d.ts.map +0 -1
  328. package/parser/string.d.ts.map +0 -1
  329. package/react/hooks/index.d.ts +0 -22
  330. package/react/hooks/index.d.ts.map +0 -1
  331. package/react/hooks/index.js +0 -21
  332. package/react/hooks/use-event.d.ts +0 -3
  333. package/react/index.d.ts +0 -2
  334. package/react/index.d.ts.map +0 -1
  335. package/react/index.js +0 -1
  336. package/type-guard/_exports.d.ts.map +0 -1
  337. package/type-guard/index.d.ts +0 -3
  338. /package/{async.d.ts → dist/async.d.cts} +0 -0
  339. /package/{async.d.ts.map → dist/async.d.cts.map} +0 -0
  340. /package/{async.js → dist/async.js} +0 -0
  341. /package/{common.js → dist/common.js} +0 -0
  342. /package/{complex/counter.d.ts → dist/complex/counter.d.cts} +0 -0
  343. /package/{complex/counter.d.ts.map → dist/complex/counter.d.cts.map} +0 -0
  344. /package/{complex → dist/complex}/counter.js +0 -0
  345. /package/{complex → dist/complex}/global-config.js +0 -0
  346. /package/{complex → dist/complex}/modules-factory.js +0 -0
  347. /package/{cookie.js → dist/cookie.js} +0 -0
  348. /package/{data.d.ts → dist/data.d.cts} +0 -0
  349. /package/{data.d.ts.map → dist/data.d.cts.map} +0 -0
  350. /package/{data.js → dist/data.js} +0 -0
  351. /package/{device.d.ts → dist/device.d.cts} +0 -0
  352. /package/{device.d.ts.map → dist/device.d.cts.map} +0 -0
  353. /package/{device.js → dist/device.js} +0 -0
  354. /package/{encodings.d.ts → dist/encodings.d.cts} +0 -0
  355. /package/{encodings.d.ts.map → dist/encodings.d.cts.map} +0 -0
  356. /package/{encodings.js → dist/encodings.js} +0 -0
  357. /package/{file.d.ts → dist/file.d.cts} +0 -0
  358. /package/{file.d.ts.map → dist/file.d.cts.map} +0 -0
  359. /package/{file.js → dist/file.js} +0 -0
  360. /package/{format/constants.d.ts → dist/format/constants.d.cts} +0 -0
  361. /package/{format/constants.d.ts.map → dist/format/constants.d.cts.map} +0 -0
  362. /package/{format → dist/format}/constants.js +0 -0
  363. /package/{format/skip-spaces.d.ts → dist/format/skip-spaces.d.cts} +0 -0
  364. /package/{format/skip-spaces.d.ts.map → dist/format/skip-spaces.d.cts.map} +0 -0
  365. /package/{format → dist/format}/skip-spaces.js +0 -0
  366. /package/{id.d.ts → dist/id.d.cts} +0 -0
  367. /package/{id.d.ts.map → dist/id.d.cts.map} +0 -0
  368. /package/{id.js → dist/id.js} +0 -0
  369. /package/{imports.d.ts → dist/imports.d.cts} +0 -0
  370. /package/{imports.d.ts.map → dist/imports.d.cts.map} +0 -0
  371. /package/{math.js → dist/math.js} +0 -0
  372. /package/{media.d.ts → dist/media.d.cts} +0 -0
  373. /package/{media.d.ts.map → dist/media.d.cts.map} +0 -0
  374. /package/{mobx → dist/mobx}/apply-observable.js +0 -0
  375. /package/{mobx → dist/mobx}/get-mobx-administration.js +0 -0
  376. /package/{mobx/lazy-observe.d.ts → dist/mobx/lazy-observe.d.cts} +0 -0
  377. /package/{mobx/lazy-observe.d.ts.map → dist/mobx/lazy-observe.d.cts.map} +0 -0
  378. /package/{mobx → dist/mobx}/lazy-observe.js +0 -0
  379. /package/{ms.d.ts → dist/ms.d.cts} +0 -0
  380. /package/{ms.d.ts.map → dist/ms.d.cts.map} +0 -0
  381. /package/{ms.js → dist/ms.js} +0 -0
  382. /package/{number.d.ts → dist/number.d.cts} +0 -0
  383. /package/{number.d.ts.map → dist/number.d.cts.map} +0 -0
  384. /package/{number.js → dist/number.js} +0 -0
  385. /package/{price.d.ts → dist/price.d.cts} +0 -0
  386. /package/{price.d.ts.map → dist/price.d.cts.map} +0 -0
  387. /package/{price.js → dist/price.js} +0 -0
  388. /package/{random.d.ts → dist/random.d.cts} +0 -0
  389. /package/{random.d.ts.map → dist/random.d.cts.map} +0 -0
  390. /package/{random.js → dist/random.js} +0 -0
  391. /package/{react/hooks/use-abort-controller.d.ts → dist/react/hooks/use-abort-controller.d.cts} +0 -0
  392. /package/{react/hooks/use-abort-controller.d.ts.map → dist/react/hooks/use-abort-controller.d.cts.map} +0 -0
  393. /package/{react/hooks/use-abort-signal.d.ts → dist/react/hooks/use-abort-signal.d.cts} +0 -0
  394. /package/{react/hooks/use-abort-signal.d.ts.map → dist/react/hooks/use-abort-signal.d.cts.map} +0 -0
  395. /package/{react/hooks/use-click-outside.d.ts → dist/react/hooks/use-click-outside.d.cts} +0 -0
  396. /package/{react/hooks/use-click-outside.d.ts.map → dist/react/hooks/use-click-outside.d.cts.map} +0 -0
  397. /package/{react/hooks/use-constant.d.ts → dist/react/hooks/use-constant.d.cts} +0 -0
  398. /package/{react/hooks/use-constant.d.ts.map → dist/react/hooks/use-constant.d.cts.map} +0 -0
  399. /package/{react → dist/react}/hooks/use-constant.js +0 -0
  400. /package/{react/hooks/use-define-ref.d.ts → dist/react/hooks/use-define-ref.d.cts} +0 -0
  401. /package/{react/hooks/use-define-ref.d.ts.map → dist/react/hooks/use-define-ref.d.cts.map} +0 -0
  402. /package/{react → dist/react}/hooks/use-define-ref.js +0 -0
  403. /package/{react/hooks/use-element-ref.d.ts → dist/react/hooks/use-element-ref.d.cts} +0 -0
  404. /package/{react/hooks/use-element-ref.d.ts.map → dist/react/hooks/use-element-ref.d.cts.map} +0 -0
  405. /package/{react → dist/react}/hooks/use-element-ref.js +0 -0
  406. /package/{react/hooks/use-event-listener.d.ts → dist/react/hooks/use-event-listener.d.cts} +0 -0
  407. /package/{react/hooks/use-event-listener.d.ts.map → dist/react/hooks/use-event-listener.d.cts.map} +0 -0
  408. /package/{react → dist/react}/hooks/use-event.js +0 -0
  409. /package/{react/hooks/use-flag.d.ts → dist/react/hooks/use-flag.d.cts} +0 -0
  410. /package/{react/hooks/use-flag.d.ts.map → dist/react/hooks/use-flag.d.cts.map} +0 -0
  411. /package/{react → dist/react}/hooks/use-flag.js +0 -0
  412. /package/{react/hooks/use-force-update.d.ts → dist/react/hooks/use-force-update.d.cts} +0 -0
  413. /package/{react/hooks/use-force-update.d.ts.map → dist/react/hooks/use-force-update.d.cts.map} +0 -0
  414. /package/{react → dist/react}/hooks/use-force-update.js +0 -0
  415. /package/{react/hooks/use-initial-height.d.ts → dist/react/hooks/use-initial-height.d.cts} +0 -0
  416. /package/{react/hooks/use-initial-height.d.ts.map → dist/react/hooks/use-initial-height.d.cts.map} +0 -0
  417. /package/{react → dist/react}/hooks/use-initial-height.js +0 -0
  418. /package/{react/hooks/use-instance.d.ts → dist/react/hooks/use-instance.d.cts} +0 -0
  419. /package/{react/hooks/use-instance.d.ts.map → dist/react/hooks/use-instance.d.cts.map} +0 -0
  420. /package/{react/hooks/use-intersection-observer.d.ts → dist/react/hooks/use-intersection-observer.d.cts} +0 -0
  421. /package/{react/hooks/use-intersection-observer.d.ts.map → dist/react/hooks/use-intersection-observer.d.cts.map} +0 -0
  422. /package/{react → dist/react}/hooks/use-intersection-observer.js +0 -0
  423. /package/{react/hooks/use-last-defined-value.d.ts → dist/react/hooks/use-last-defined-value.d.cts} +0 -0
  424. /package/{react/hooks/use-last-defined-value.d.ts.map → dist/react/hooks/use-last-defined-value.d.cts.map} +0 -0
  425. /package/{react → dist/react}/hooks/use-last-defined-value.js +0 -0
  426. /package/{react/hooks/use-last-value-ref.d.ts → dist/react/hooks/use-last-value-ref.d.cts} +0 -0
  427. /package/{react/hooks/use-last-value-ref.d.ts.map → dist/react/hooks/use-last-value-ref.d.cts.map} +0 -0
  428. /package/{react → dist/react}/hooks/use-last-value-ref.js +0 -0
  429. /package/{react/hooks/use-life-cycle.d.ts → dist/react/hooks/use-life-cycle.d.cts} +0 -0
  430. /package/{react/hooks/use-life-cycle.d.ts.map → dist/react/hooks/use-life-cycle.d.cts.map} +0 -0
  431. /package/{react/hooks/use-resize-observer.d.ts → dist/react/hooks/use-resize-observer.d.cts} +0 -0
  432. /package/{react/hooks/use-resize-observer.d.ts.map → dist/react/hooks/use-resize-observer.d.cts.map} +0 -0
  433. /package/{react/hooks/use-sync-ref.d.ts → dist/react/hooks/use-sync-ref.d.cts} +0 -0
  434. /package/{react/hooks/use-sync-ref.d.ts.map → dist/react/hooks/use-sync-ref.d.cts.map} +0 -0
  435. /package/{react → dist/react}/hooks/use-sync-ref.js +0 -0
  436. /package/{react/hooks/use-toggle.d.ts → dist/react/hooks/use-toggle.d.cts} +0 -0
  437. /package/{react/hooks/use-toggle.d.ts.map → dist/react/hooks/use-toggle.d.cts.map} +0 -0
  438. /package/{react → dist/react}/hooks/use-toggle.js +0 -0
  439. /package/{react/hooks/use-value.d.ts → dist/react/hooks/use-value.d.cts} +0 -0
  440. /package/{react/hooks/use-value.d.ts.map → dist/react/hooks/use-value.d.cts.map} +0 -0
  441. /package/{react → dist/react}/hooks/use-value.js +0 -0
  442. /package/{react/hooks/use-visibility-state.d.ts → dist/react/hooks/use-visibility-state.d.cts} +0 -0
  443. /package/{react/hooks/use-visibility-state.d.ts.map → dist/react/hooks/use-visibility-state.d.cts.map} +0 -0
  444. /package/{react → dist/react}/hooks/use-visibility-state.js +0 -0
  445. /package/{sound.d.ts → dist/sound.d.cts} +0 -0
  446. /package/{sound.d.ts.map → dist/sound.d.cts.map} +0 -0
  447. /package/{sound.js → dist/sound.js} +0 -0
  448. /package/{storage.d.ts → dist/storage.d.cts} +0 -0
  449. /package/{storage.d.ts.map → dist/storage.d.cts.map} +0 -0
  450. /package/{storage.js → dist/storage.js} +0 -0
  451. /package/{text.d.ts → dist/text.d.cts} +0 -0
  452. /package/{text.d.ts.map → dist/text.d.cts.map} +0 -0
  453. /package/{text.js → dist/text.js} +0 -0
  454. /package/{type-guard → dist/type-guard}/_exports.js +0 -0
  455. /package/{utility-types.d.ts → dist/utility-types.d.ts} +0 -0
  456. /package/{utils/types.d.ts → dist/utils/types.d.cts} +0 -0
  457. /package/{utils/types.d.ts.map → dist/utils/types.d.cts.map} +0 -0
  458. /package/{utils → dist/utils}/types.js +0 -0
  459. /package/{vibrate.d.ts → dist/vibrate.d.cts} +0 -0
  460. /package/{vibrate.d.ts.map → dist/vibrate.d.cts.map} +0 -0
  461. /package/{vibrate.js → dist/vibrate.js} +0 -0
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants.cjs"), exports);
18
+ __exportStar(require("./number.cjs"), exports);
19
+ __exportStar(require("./percent.cjs"), exports);
20
+ __exportStar(require("./skip-spaces.cjs"), exports);
@@ -0,0 +1,5 @@
1
+ export * from "./constants.cjs";
2
+ export * from "./number.cjs";
3
+ export * from "./percent.cjs";
4
+ export * from "./skip-spaces.cjs";
5
+ //# sourceMappingURL=_exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/format/_exports.ts"],"names":[],"mappings":"AAAA,gCAA+B;AAC/B,6BAA4B;AAC5B,8BAA6B;AAC7B,kCAAiC"}
@@ -0,0 +1,5 @@
1
+ export * from "./constants.js";
2
+ export * from "./number.js";
3
+ export * from "./percent.js";
4
+ export * from "./skip-spaces.js";
5
+ //# sourceMappingURL=_exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/format/_exports.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,4BAA4B;AAC5B,6BAA6B;AAC7B,iCAAiC"}
@@ -0,0 +1,4 @@
1
+ export * from "./constants.js";
2
+ export * from "./number.js";
3
+ export * from "./percent.js";
4
+ export * from "./skip-spaces.js";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INFINITY = exports.HYPHEN = exports.NO_VALUE = void 0;
4
+ exports.NO_VALUE = '–'; // en-dash
5
+ exports.HYPHEN = '-';
6
+ exports.INFINITY = '∞';
@@ -0,0 +1,4 @@
1
+ export declare const NO_VALUE = "\u2013";
2
+ export declare const HYPHEN = "-";
3
+ export declare const INFINITY = "\u221E";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/format/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,WAAM,CAAC;AAE5B,eAAO,MAAM,MAAM,MAAM,CAAC;AAE1B,eAAO,MAAM,QAAQ,WAAM,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.format = void 0;
37
+ // This way is more treeshakable than collecting
38
+ // it into one exportable object export const format
39
+ const format = __importStar(require("./_exports.cjs"));
40
+ exports.format = format;
@@ -0,0 +1,3 @@
1
+ import * as format from "./_exports.cjs";
2
+ export { format };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,uBAAsB;AAExC,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import * as format from "./_exports.js";
2
+ export { format };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/format/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,sBAAsB;AAExC,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // This way is more treeshakable than collecting
2
2
  // it into one exportable object export const format
3
- import * as format from './_exports.js';
3
+ import * as format from "./_exports.js";
4
4
  export { format };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.number = void 0;
4
+ const number_js_1 = require("../parser/number.cjs");
5
+ const index_js_1 = require("../type-guard/index.cjs");
6
+ const constants_js_1 = require("./constants.cjs");
7
+ const number = (rawValue, userSettings) => {
8
+ const settings = {
9
+ ...exports.number.defaultSettings,
10
+ ...userSettings,
11
+ };
12
+ const digits = settings.digits ?? 0;
13
+ const cutZeros = settings?.cutZeros ?? false;
14
+ const delimiter = settings.delimiter ?? ' ';
15
+ const postfix = settings.postfix ?? '';
16
+ const emptyText = settings.emptyText ?? constants_js_1.NO_VALUE;
17
+ const digitsOnlyForFloat = settings.digitsOnlyForFloat ?? true;
18
+ let value;
19
+ if (index_js_1.typeGuard.isString(rawValue)) {
20
+ value = (0, number_js_1.number)(value, { fallback: undefined });
21
+ }
22
+ else {
23
+ value = rawValue;
24
+ }
25
+ if (index_js_1.typeGuard.isNumber(value)) {
26
+ let raw = `${value}`;
27
+ if (digits !== false) {
28
+ raw = value.toFixed(digits);
29
+ }
30
+ if (cutZeros) {
31
+ raw = `${+raw}`;
32
+ }
33
+ const [integerPart, decimalPart] = raw.split('.', 2);
34
+ let formattedIntegerPart = integerPart;
35
+ let formattedDecimalPart = '';
36
+ if (decimalPart && (!digitsOnlyForFloat || !/^0+$/.test(decimalPart))) {
37
+ formattedDecimalPart = `.${decimalPart}`;
38
+ }
39
+ const rgx = /(\d+)(\d{3})/;
40
+ while (rgx.test(formattedIntegerPart) && delimiter) {
41
+ formattedIntegerPart = formattedIntegerPart.replace(rgx, `$1${delimiter}$2`);
42
+ }
43
+ return formattedIntegerPart + formattedDecimalPart + postfix;
44
+ }
45
+ return emptyText;
46
+ };
47
+ exports.number = number;
48
+ exports.number.defaultSettings = {};
@@ -0,0 +1,36 @@
1
+ import type { Maybe } from "../utils/types.cjs";
2
+ export interface NumberFormatSettings {
3
+ delimiter?: string;
4
+ /**
5
+ * digitsOnlyForFloat - Show digits after decimal point only if they are not zeros after converting to number.
6
+ * Example: "0.00" -> "0", "0.10" -> "0.1", but "0.003" -> "0.003"
7
+ *
8
+ * @default true
9
+ */
10
+ digitsOnlyForFloat?: boolean;
11
+ /**
12
+ * Text which will be returned if the value is undefined, null, NaN, Infinity or empty string.
13
+ * Example: "–" will be returned if the value is undefined and emptyText is "–".
14
+ */
15
+ emptyText?: string;
16
+ /**
17
+ * Text to append to the end of the formatted number.
18
+ * Example: if value is 1000 and postfix is "₽", result will be "1 000₽".
19
+ */
20
+ postfix?: string;
21
+ /**
22
+ * Fixed number of digits after the decimal point (number.toFixed() method)
23
+ * If set to false, the truncation is ignored!
24
+ */
25
+ digits?: number | false;
26
+ /**
27
+ * Remove trailing zeros from the end of the number
28
+ * Example: 0.010000000000000000000000000000000000000000000 -> 0.01
29
+ */
30
+ cutZeros?: boolean;
31
+ }
32
+ export declare const number: {
33
+ (rawValue: Maybe<string | number>, userSettings?: Maybe<NumberFormatSettings>): string;
34
+ defaultSettings: NumberFormatSettings;
35
+ };
36
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/format/number.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,2BAA0B;AAI/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM;eACP,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,iBACjB,KAAK,CAAC,oBAAoB,CAAC,GACzC,MAAM;;CAqDR,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Maybe } from '../utils/types.js';
1
+ import type { Maybe } from "../utils/types.js";
2
2
  export interface NumberFormatSettings {
3
3
  delimiter?: string;
4
4
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/format/number.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,0BAA0B;AAI/C,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM;eACP,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,iBACjB,KAAK,CAAC,oBAAoB,CAAC,GACzC,MAAM;;CAqDR,CAAC"}
@@ -1,6 +1,6 @@
1
- import { number as toNumber } from '../parser/number.js';
2
- import { typeGuard } from '../type-guard/index.js';
3
- import { NO_VALUE } from './constants.js';
1
+ import { number as toNumber } from "../parser/number.js";
2
+ import { typeGuard } from "../type-guard/index.js";
3
+ import { NO_VALUE } from "./constants.js";
4
4
  export const number = (rawValue, userSettings) => {
5
5
  const settings = {
6
6
  ...number.defaultSettings,
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.percent = void 0;
4
+ const number_js_1 = require("../parser/number.cjs");
5
+ const index_js_1 = require("../type-guard/index.cjs");
6
+ const constants_js_1 = require("./constants.cjs");
7
+ /**
8
+ * 100 -> 100%
9
+ * 99.123214412 -> 99.12%
10
+ * 99.123214412 -> 99,12%
11
+ */
12
+ const percent = (value, settings) => {
13
+ const numericValue = (0, number_js_1.number)(value, {
14
+ ...settings,
15
+ digits: settings?.digits ?? 2,
16
+ fallback: Number.NaN,
17
+ });
18
+ if (index_js_1.typeGuard.isNumber(numericValue)) {
19
+ const divider = settings?.divider ?? '.';
20
+ const formattedPercent = divider === '.' ? numericValue : `${numericValue}`.replace('.', divider);
21
+ return `${formattedPercent}${settings?.delimiter ?? ''}${settings?.symbol ?? '%'}`;
22
+ }
23
+ else {
24
+ return settings?.emptyText ?? constants_js_1.NO_VALUE;
25
+ }
26
+ };
27
+ exports.percent = percent;
@@ -0,0 +1,15 @@
1
+ import { type NumberParserSettings } from "../parser/number.cjs";
2
+ import type { Maybe } from "../utils/types.cjs";
3
+ export interface PercentFormatSettings extends Omit<NumberParserSettings, 'fallback'> {
4
+ divider?: string;
5
+ delimiter?: string;
6
+ symbol?: string;
7
+ emptyText?: string;
8
+ }
9
+ /**
10
+ * 100 -> 100%
11
+ * 99.123214412 -> 99.12%
12
+ * 99.123214412 -> 99,12%
13
+ */
14
+ export declare const percent: (value: Maybe<number | string>, settings?: PercentFormatSettings) => string;
15
+ //# sourceMappingURL=percent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"percent.d.ts","sourceRoot":"","sources":["../../src/format/percent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAU,6BAA4B;AAExE,OAAO,KAAK,EAAE,KAAK,EAAE,2BAA0B;AAI/C,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC7B,WAAW,qBAAqB,WAkBjC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { type NumberParserSettings } from '../parser/number.js';
2
- import type { Maybe } from '../utils/types.js';
1
+ import { type NumberParserSettings } from "../parser/number.js";
2
+ import type { Maybe } from "../utils/types.js";
3
3
  export interface PercentFormatSettings extends Omit<NumberParserSettings, 'fallback'> {
4
4
  divider?: string;
5
5
  delimiter?: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"percent.d.ts","sourceRoot":"","sources":["../../src/format/percent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAU,4BAA4B;AAExE,OAAO,KAAK,EAAE,KAAK,EAAE,0BAA0B;AAI/C,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC7B,WAAW,qBAAqB,WAkBjC,CAAC"}
@@ -1,6 +1,6 @@
1
- import { number } from '../parser/number.js';
2
- import { typeGuard } from '../type-guard/index.js';
3
- import { NO_VALUE } from './constants.js';
1
+ import { number } from "../parser/number.js";
2
+ import { typeGuard } from "../type-guard/index.js";
3
+ import { NO_VALUE } from "./constants.js";
4
4
  /**
5
5
  * 100 -> 100%
6
6
  * 99.123214412 -> 99.12%
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skipSpaces = void 0;
4
+ /**
5
+ * Removes all spaces in string
6
+ */
7
+ const skipSpaces = (value) => value.replaceAll(/\s/g, '');
8
+ exports.skipSpaces = skipSpaces;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Removes all spaces in string
3
+ */
4
+ export declare const skipSpaces: (value: string) => string;
5
+ //# sourceMappingURL=skip-spaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip-spaces.d.ts","sourceRoot":"","sources":["../../src/format/skip-spaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,WAAgC,CAAC"}
package/dist/html.cjs ADDED
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isPrefersLightTheme = exports.isPrefersDarkTheme = exports.calcScrollbarWidth = exports.startViewTransitionSafety = exports.checkElementHasParent = exports.sanitizeHtml = exports.globalScrollIntoViewForY = exports.skipEvent = exports.collectOffsetTop = exports.downloadUsingAnchor = exports.getComputedColor = void 0;
7
+ exports.wrapTextToTagLink = wrapTextToTagLink;
8
+ exports.getElementInnerHeight = getElementInnerHeight;
9
+ exports.getElementInnerWidth = getElementInnerWidth;
10
+ const dompurify_1 = __importDefault(require("dompurify"));
11
+ const media_js_1 = require("./media.cjs");
12
+ /**
13
+ * Вытаскивает RGB из любого цвета
14
+ *
15
+ * Не рекомендуется к использованию так как вызывает reflow
16
+ */
17
+ const getComputedColor = (color) => {
18
+ if (!color)
19
+ return null;
20
+ const d = document.createElement('div');
21
+ d.style.color = color;
22
+ document.body.append(d);
23
+ const rgbcolor = globalThis.getComputedStyle(d).color;
24
+ const match = /rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[.d+]*)*\)/g.exec(rgbcolor);
25
+ d.remove();
26
+ if (!match)
27
+ return null;
28
+ return `${match[1]}, ${match[2]}, ${match[3]}`;
29
+ };
30
+ exports.getComputedColor = getComputedColor;
31
+ const downloadUsingAnchor = (urlOrBlob, fileName) => {
32
+ const url = (0, media_js_1.blobToUrl)(urlOrBlob);
33
+ const a = document.createElement('a');
34
+ a.href = url;
35
+ a.download = fileName ?? 'file';
36
+ a.target = '_blank';
37
+ document.body.append(a);
38
+ a.click();
39
+ a.remove();
40
+ };
41
+ exports.downloadUsingAnchor = downloadUsingAnchor;
42
+ /**
43
+ * Surrounds string in an anchor tag
44
+ */
45
+ function wrapTextToTagLink(link) {
46
+ const descr = String(link).replace(/^(https?:\/{0,2})?(w{3}\.)?/, 'www.');
47
+ if (!/^https?:\/{2}/.test(link))
48
+ link = `http://${link}`;
49
+ return `<a href=${link} target="_blank">${descr}</a>`;
50
+ }
51
+ const collectOffsetTop = (element) => {
52
+ let offsetTop = 0;
53
+ let node = element;
54
+ while (node != null) {
55
+ offsetTop += node.offsetTop;
56
+ node = node.parentElement;
57
+ }
58
+ return offsetTop;
59
+ };
60
+ exports.collectOffsetTop = collectOffsetTop;
61
+ const skipEvent = (e) => {
62
+ e.preventDefault();
63
+ e.stopPropagation();
64
+ return false;
65
+ };
66
+ exports.skipEvent = skipEvent;
67
+ const globalScrollIntoViewForY = (node) => {
68
+ const scrollContainer = document.body;
69
+ const pageHeight = window.innerHeight;
70
+ const nodeBounding = node.getBoundingClientRect();
71
+ const scrollPagesCount = scrollContainer.scrollHeight / pageHeight;
72
+ const scrollPageNumber = Math.min(Math.max(nodeBounding.top / pageHeight, 1), scrollPagesCount);
73
+ window.scroll({
74
+ top: scrollPageNumber * pageHeight,
75
+ behavior: 'smooth',
76
+ });
77
+ };
78
+ exports.globalScrollIntoViewForY = globalScrollIntoViewForY;
79
+ const sanitizeDefaults = {
80
+ ALLOWED_TAGS: [
81
+ 'a',
82
+ 'article',
83
+ 'b',
84
+ 'blockquote',
85
+ 'br',
86
+ 'caption',
87
+ 'code',
88
+ 'del',
89
+ 'details',
90
+ 'div',
91
+ 'em',
92
+ 'h1',
93
+ 'h2',
94
+ 'h3',
95
+ 'h4',
96
+ 'h5',
97
+ 'h6',
98
+ 'hr',
99
+ 'i',
100
+ 'img',
101
+ 'ins',
102
+ 'kbd',
103
+ 'li',
104
+ 'main',
105
+ 'ol',
106
+ 'p',
107
+ 'pre',
108
+ 'section',
109
+ 'span',
110
+ 'strong',
111
+ 'sub',
112
+ 'summary',
113
+ 'sup',
114
+ 'table',
115
+ 'tbody',
116
+ 'td',
117
+ 'th',
118
+ 'thead',
119
+ 'tr',
120
+ 'u',
121
+ 'ul',
122
+ ],
123
+ ALLOWED_ATTR: ['href', 'target', 'name', 'src', 'class'],
124
+ };
125
+ const sanitizeHtml = (html, config) => {
126
+ return dompurify_1.default.sanitize(html || '', {
127
+ ...sanitizeDefaults,
128
+ ...config,
129
+ });
130
+ };
131
+ exports.sanitizeHtml = sanitizeHtml;
132
+ const checkElementHasParent = (element, parent) => {
133
+ let node = element;
134
+ if (!parent)
135
+ return false;
136
+ while (node != null) {
137
+ if (node === parent) {
138
+ return true;
139
+ }
140
+ else {
141
+ node = node.parentElement;
142
+ }
143
+ }
144
+ return false;
145
+ };
146
+ exports.checkElementHasParent = checkElementHasParent;
147
+ /**
148
+ * Executes a function within a view transition if supported by the browser.
149
+ *
150
+ * @param {VoidFunction} fn - The function to be executed.
151
+ * @returns {ViewTransition} - The result of the executed function.
152
+ *
153
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition | MDN: Document.startViewTransition}
154
+ */
155
+ const startViewTransitionSafety = (fn, params) => {
156
+ if (document.startViewTransition && !params?.disabled) {
157
+ return document.startViewTransition(fn);
158
+ }
159
+ fn();
160
+ };
161
+ exports.startViewTransitionSafety = startViewTransitionSafety;
162
+ /**
163
+ * Вычисляет размер скроллбара
164
+ */
165
+ const calcScrollbarWidth = () => {
166
+ const outer = document.createElement('div');
167
+ outer.style.visibility = 'hidden';
168
+ outer.style.width = '100px';
169
+ outer.style.overflow = 'scroll';
170
+ document.body.append(outer);
171
+ const inner = document.createElement('div');
172
+ inner.style.width = '100%';
173
+ outer.append(inner);
174
+ const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
175
+ outer.parentNode?.removeChild(outer);
176
+ return scrollbarWidth;
177
+ };
178
+ exports.calcScrollbarWidth = calcScrollbarWidth;
179
+ /**
180
+ * Calculates the inner height of an HTML element, accounting for padding.
181
+ */
182
+ function getElementInnerHeight(element) {
183
+ const { clientHeight } = element;
184
+ const { paddingTop, paddingBottom } = getComputedStyle(element);
185
+ return (clientHeight -
186
+ Number.parseFloat(paddingTop) -
187
+ Number.parseFloat(paddingBottom));
188
+ }
189
+ /**
190
+ * Calculates the inner width of an HTML element, accounting for padding.
191
+ */
192
+ function getElementInnerWidth(el) {
193
+ const { clientWidth } = el;
194
+ const { paddingLeft, paddingRight } = getComputedStyle(el);
195
+ return (clientWidth -
196
+ Number.parseFloat(paddingLeft) -
197
+ Number.parseFloat(paddingRight));
198
+ }
199
+ const isPrefersDarkTheme = () => !!globalThis.matchMedia?.('(prefers-color-scheme: dark)')?.matches;
200
+ exports.isPrefersDarkTheme = isPrefersDarkTheme;
201
+ const isPrefersLightTheme = () => !!globalThis.matchMedia?.('(prefers-color-scheme: light)')?.matches;
202
+ exports.isPrefersLightTheme = isPrefersLightTheme;
@@ -0,0 +1,44 @@
1
+ import { type Config as DOMPurifyConfig } from 'dompurify';
2
+ import type { Maybe } from "./utils/types.cjs";
3
+ /**
4
+ * Вытаскивает RGB из любого цвета
5
+ *
6
+ * Не рекомендуется к использованию так как вызывает reflow
7
+ */
8
+ export declare const getComputedColor: (color?: string) => string | null;
9
+ export declare const downloadUsingAnchor: (urlOrBlob: string | Blob, fileName?: string) => void;
10
+ /**
11
+ * Surrounds string in an anchor tag
12
+ */
13
+ export declare function wrapTextToTagLink(link: string): string;
14
+ export declare const collectOffsetTop: (element: HTMLElement | null) => number;
15
+ export declare const skipEvent: (e: Event) => boolean;
16
+ export declare const globalScrollIntoViewForY: (node: HTMLElement) => void;
17
+ export declare const sanitizeHtml: (html: Maybe<string>, config?: DOMPurifyConfig) => string;
18
+ export declare const checkElementHasParent: (element: HTMLElement | null, parent: Maybe<HTMLElement>) => boolean;
19
+ /**
20
+ * Executes a function within a view transition if supported by the browser.
21
+ *
22
+ * @param {VoidFunction} fn - The function to be executed.
23
+ * @returns {ViewTransition} - The result of the executed function.
24
+ *
25
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition | MDN: Document.startViewTransition}
26
+ */
27
+ export declare const startViewTransitionSafety: (fn: VoidFunction, params?: {
28
+ disabled?: boolean;
29
+ }) => ViewTransition | undefined;
30
+ /**
31
+ * Вычисляет размер скроллбара
32
+ */
33
+ export declare const calcScrollbarWidth: () => number;
34
+ /**
35
+ * Calculates the inner height of an HTML element, accounting for padding.
36
+ */
37
+ export declare function getElementInnerHeight(element: HTMLElement): number;
38
+ /**
39
+ * Calculates the inner width of an HTML element, accounting for padding.
40
+ */
41
+ export declare function getElementInnerWidth(el: HTMLElement): number;
42
+ export declare const isPrefersDarkTheme: () => boolean;
43
+ export declare const isPrefersLightTheme: () => boolean;
44
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAE,KAAK,MAAM,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AAGtE,OAAO,KAAK,EAAE,KAAK,EAAE,0BAAyB;AAE9C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,GAAG,IAAI,EACxB,WAAW,MAAM,SAgBlB,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAI7C;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,GAAG,IAAI,WAU3D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,GAAG,KAAK,YAKjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,MAAM,WAAW,SAezD,CAAC;AAiDF,eAAO,MAAM,YAAY,GAAI,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,eAAe,WAKzE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,WAAW,GAAG,IAAI,EAC3B,QAAQ,KAAK,CAAC,WAAW,CAAC,YAe3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,IAAI,YAAY,EAChB,SAAS;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,+BAMhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAmB9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,UAQzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,UAQnD;AAED,eAAO,MAAM,kBAAkB,eACqC,CAAC;AAErE,eAAO,MAAM,mBAAmB,eACqC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type Config as DOMPurifyConfig } from 'dompurify';
2
- import type { Maybe } from './utils/types.js';
2
+ import type { Maybe } from "./utils/types.js";
3
3
  /**
4
4
  * Вытаскивает RGB из любого цвета
5
5
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAE,KAAK,MAAM,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AAGtE,OAAO,KAAK,EAAE,KAAK,EAAE,yBAAyB;AAE9C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,GAAG,IAAI,EACxB,WAAW,MAAM,SAgBlB,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAI7C;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,GAAG,IAAI,WAU3D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,GAAG,KAAK,YAKjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,MAAM,WAAW,SAezD,CAAC;AAiDF,eAAO,MAAM,YAAY,GAAI,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,eAAe,WAKzE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,WAAW,GAAG,IAAI,EAC3B,QAAQ,KAAK,CAAC,WAAW,CAAC,YAe3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,IAAI,YAAY,EAChB,SAAS;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,+BAMhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAmB9B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,UAQzD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,UAQnD;AAED,eAAO,MAAM,kBAAkB,eACqC,CAAC;AAErE,eAAO,MAAM,mBAAmB,eACqC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import DOMPurify from 'dompurify';
2
- import { blobToUrl } from './media.js';
2
+ import { blobToUrl } from "./media.js";
3
3
  /**
4
4
  * Вытаскивает RGB из любого цвета
5
5
  *