yummies 5.4.5 → 5.4.7

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 (466) hide show
  1. package/assets/logo.png +0 -0
  2. package/assets/logo.pxz +0 -0
  3. package/{dist/common.d.ts → common.d.ts} +1 -1
  4. package/common.d.ts.map +1 -0
  5. package/{dist/complex → complex}/global-config.d.ts +1 -1
  6. package/complex/global-config.d.ts.map +1 -0
  7. package/complex/index.d.ts +4 -0
  8. package/complex/index.d.ts.map +1 -0
  9. package/complex/index.js +3 -0
  10. package/{dist/complex → complex}/modules-factory.d.ts +1 -1
  11. package/complex/modules-factory.d.ts.map +1 -0
  12. package/cookie.d.ts +3 -0
  13. package/{dist/cookie.d.ts.map → cookie.d.ts.map} +1 -1
  14. package/{dist/date-time.d.ts → date-time.d.ts} +1 -1
  15. package/date-time.d.ts.map +1 -0
  16. package/{dist/date-time.js → date-time.js} +4 -4
  17. package/{dist/errors.d.ts → errors.d.ts} +1 -1
  18. package/errors.d.ts.map +1 -0
  19. package/{dist/errors.js → errors.js} +1 -1
  20. package/format/_exports.d.ts +5 -0
  21. package/format/_exports.d.ts.map +1 -0
  22. package/format/_exports.js +4 -0
  23. package/format/index.d.ts +3 -0
  24. package/{dist/format → format}/index.d.ts.map +1 -1
  25. package/{dist/format → format}/index.js +1 -1
  26. package/{dist/format → format}/number.d.ts +1 -1
  27. package/format/number.d.ts.map +1 -0
  28. package/{dist/format → format}/number.js +3 -3
  29. package/{dist/format → format}/percent.d.ts +2 -2
  30. package/format/percent.d.ts.map +1 -0
  31. package/{dist/format → format}/percent.js +3 -3
  32. package/{dist/html.d.ts → html.d.ts} +1 -1
  33. package/html.d.ts.map +1 -0
  34. package/{dist/html.js → html.js} +1 -1
  35. package/{dist/imports.js → imports.js} +1 -1
  36. package/{dist/math.d.ts → math.d.ts} +1 -1
  37. package/math.d.ts.map +1 -0
  38. package/{dist/media.js → media.js} +1 -1
  39. package/{dist/mobx → mobx}/apply-observable.d.ts +1 -1
  40. package/mobx/apply-observable.d.ts.map +1 -0
  41. package/{dist/mobx → mobx}/create-enhanced-atom.d.ts +1 -1
  42. package/mobx/create-enhanced-atom.d.ts.map +1 -0
  43. package/{dist/mobx → mobx}/deep-observable-struct.d.ts +1 -1
  44. package/mobx/deep-observable-struct.d.ts.map +1 -0
  45. package/{dist/mobx → mobx}/deep-observable-struct.js +1 -1
  46. package/{dist/mobx → mobx}/get-mobx-administration.d.ts +1 -1
  47. package/mobx/get-mobx-administration.d.ts.map +1 -0
  48. package/mobx/index.d.ts +6 -0
  49. package/mobx/index.d.ts.map +1 -0
  50. package/mobx/index.js +5 -0
  51. package/package.json +350 -340
  52. package/parser/_exports.d.ts +4 -0
  53. package/parser/_exports.d.ts.map +1 -0
  54. package/parser/_exports.js +3 -0
  55. package/parser/index.d.ts +3 -0
  56. package/{dist/parser → parser}/index.d.ts.map +1 -1
  57. package/{dist/parser → parser}/index.js +1 -1
  58. package/{dist/parser → parser}/number.d.ts +1 -1
  59. package/parser/number.d.ts.map +1 -0
  60. package/{dist/parser → parser}/number.js +2 -2
  61. package/{dist/parser → parser}/percent.d.ts +2 -2
  62. package/parser/percent.d.ts.map +1 -0
  63. package/{dist/parser → parser}/percent.js +1 -1
  64. package/{dist/parser → parser}/string.d.ts +1 -1
  65. package/parser/string.d.ts.map +1 -0
  66. package/{dist/parser → parser}/string.js +1 -1
  67. package/react/hooks/index.d.ts +22 -0
  68. package/react/hooks/index.d.ts.map +1 -0
  69. package/react/hooks/index.js +21 -0
  70. package/{dist/react → react}/hooks/use-abort-controller.js +1 -1
  71. package/{dist/react → react}/hooks/use-abort-signal.js +1 -1
  72. package/{dist/react → react}/hooks/use-click-outside.js +1 -1
  73. package/{dist/react → react}/hooks/use-event-listener.js +1 -1
  74. package/react/hooks/use-event.d.ts +3 -0
  75. package/{dist/react → react}/hooks/use-event.d.ts.map +1 -1
  76. package/{dist/react → react}/hooks/use-instance.js +2 -2
  77. package/{dist/react → react}/hooks/use-life-cycle.js +1 -1
  78. package/{dist/react → react}/hooks/use-resize-observer.js +1 -1
  79. package/react/index.d.ts +2 -0
  80. package/react/index.d.ts.map +1 -0
  81. package/react/index.js +1 -0
  82. package/{dist/type-guard → type-guard}/_exports.d.ts +1 -1
  83. package/type-guard/_exports.d.ts.map +1 -0
  84. package/type-guard/index.d.ts +3 -0
  85. package/{dist/type-guard → type-guard}/index.d.ts.map +1 -1
  86. package/{dist/type-guard → type-guard}/index.js +1 -1
  87. package/dist/async.cjs +0 -70
  88. package/dist/async.d.cts +0 -28
  89. package/dist/async.d.cts.map +0 -1
  90. package/dist/common.cjs +0 -18
  91. package/dist/common.d.cts +0 -15
  92. package/dist/common.d.cts.map +0 -1
  93. package/dist/common.d.ts.map +0 -1
  94. package/dist/complex/counter.cjs +0 -21
  95. package/dist/complex/counter.d.cts +0 -15
  96. package/dist/complex/counter.d.cts.map +0 -1
  97. package/dist/complex/global-config.cjs +0 -46
  98. package/dist/complex/global-config.d.cts +0 -11
  99. package/dist/complex/global-config.d.cts.map +0 -1
  100. package/dist/complex/global-config.d.ts.map +0 -1
  101. package/dist/complex/index.cjs +0 -19
  102. package/dist/complex/index.d.cts +0 -4
  103. package/dist/complex/index.d.cts.map +0 -1
  104. package/dist/complex/index.d.ts +0 -4
  105. package/dist/complex/index.d.ts.map +0 -1
  106. package/dist/complex/index.js +0 -3
  107. package/dist/complex/modules-factory.cjs +0 -50
  108. package/dist/complex/modules-factory.d.cts +0 -49
  109. package/dist/complex/modules-factory.d.cts.map +0 -1
  110. package/dist/complex/modules-factory.d.ts.map +0 -1
  111. package/dist/cookie.cjs +0 -13
  112. package/dist/cookie.d.cts +0 -3
  113. package/dist/cookie.d.cts.map +0 -1
  114. package/dist/cookie.d.ts +0 -3
  115. package/dist/css.cjs +0 -28
  116. package/dist/css.d.cts +0 -36
  117. package/dist/css.d.cts.map +0 -1
  118. package/dist/data.cjs +0 -58
  119. package/dist/data.d.cts +0 -4
  120. package/dist/data.d.cts.map +0 -1
  121. package/dist/date-time.cjs +0 -171
  122. package/dist/date-time.d.cts +0 -28
  123. package/dist/date-time.d.cts.map +0 -1
  124. package/dist/date-time.d.ts.map +0 -1
  125. package/dist/device.cjs +0 -28
  126. package/dist/device.d.cts +0 -8
  127. package/dist/device.d.cts.map +0 -1
  128. package/dist/encodings.cjs +0 -270
  129. package/dist/encodings.d.cts +0 -2
  130. package/dist/encodings.d.cts.map +0 -1
  131. package/dist/errors.cjs +0 -34
  132. package/dist/errors.d.cts +0 -19
  133. package/dist/errors.d.cts.map +0 -1
  134. package/dist/errors.d.ts.map +0 -1
  135. package/dist/file.cjs +0 -29
  136. package/dist/file.d.cts +0 -3
  137. package/dist/file.d.cts.map +0 -1
  138. package/dist/format/_exports.cjs +0 -20
  139. package/dist/format/_exports.d.cts +0 -5
  140. package/dist/format/_exports.d.cts.map +0 -1
  141. package/dist/format/_exports.d.ts +0 -5
  142. package/dist/format/_exports.d.ts.map +0 -1
  143. package/dist/format/_exports.js +0 -4
  144. package/dist/format/constants.cjs +0 -6
  145. package/dist/format/constants.d.cts +0 -4
  146. package/dist/format/constants.d.cts.map +0 -1
  147. package/dist/format/index.cjs +0 -40
  148. package/dist/format/index.d.cts +0 -3
  149. package/dist/format/index.d.cts.map +0 -1
  150. package/dist/format/index.d.ts +0 -3
  151. package/dist/format/number.cjs +0 -48
  152. package/dist/format/number.d.cts +0 -36
  153. package/dist/format/number.d.cts.map +0 -1
  154. package/dist/format/number.d.ts.map +0 -1
  155. package/dist/format/percent.cjs +0 -27
  156. package/dist/format/percent.d.cts +0 -15
  157. package/dist/format/percent.d.cts.map +0 -1
  158. package/dist/format/percent.d.ts.map +0 -1
  159. package/dist/format/skip-spaces.cjs +0 -8
  160. package/dist/format/skip-spaces.d.cts +0 -5
  161. package/dist/format/skip-spaces.d.cts.map +0 -1
  162. package/dist/html.cjs +0 -202
  163. package/dist/html.d.cts +0 -44
  164. package/dist/html.d.cts.map +0 -1
  165. package/dist/html.d.ts.map +0 -1
  166. package/dist/id.cjs +0 -76
  167. package/dist/id.d.cts +0 -63
  168. package/dist/id.d.cts.map +0 -1
  169. package/dist/imports.cjs +0 -45
  170. package/dist/imports.d.cts +0 -15
  171. package/dist/imports.d.cts.map +0 -1
  172. package/dist/math.cjs +0 -23
  173. package/dist/math.d.cts +0 -13
  174. package/dist/math.d.cts.map +0 -1
  175. package/dist/math.d.ts.map +0 -1
  176. package/dist/media.cjs +0 -115
  177. package/dist/media.d.cts +0 -20
  178. package/dist/media.d.cts.map +0 -1
  179. package/dist/mobx/apply-observable.cjs +0 -16
  180. package/dist/mobx/apply-observable.d.cts +0 -4
  181. package/dist/mobx/apply-observable.d.cts.map +0 -1
  182. package/dist/mobx/apply-observable.d.ts.map +0 -1
  183. package/dist/mobx/create-enhanced-atom.cjs +0 -16
  184. package/dist/mobx/create-enhanced-atom.d.cts +0 -11
  185. package/dist/mobx/create-enhanced-atom.d.cts.map +0 -1
  186. package/dist/mobx/create-enhanced-atom.d.ts.map +0 -1
  187. package/dist/mobx/deep-observable-struct.cjs +0 -61
  188. package/dist/mobx/deep-observable-struct.d.cts +0 -7
  189. package/dist/mobx/deep-observable-struct.d.cts.map +0 -1
  190. package/dist/mobx/deep-observable-struct.d.ts.map +0 -1
  191. package/dist/mobx/get-mobx-administration.cjs +0 -6
  192. package/dist/mobx/get-mobx-administration.d.cts +0 -6
  193. package/dist/mobx/get-mobx-administration.d.cts.map +0 -1
  194. package/dist/mobx/get-mobx-administration.d.ts.map +0 -1
  195. package/dist/mobx/index.cjs +0 -21
  196. package/dist/mobx/index.d.cts +0 -6
  197. package/dist/mobx/index.d.cts.map +0 -1
  198. package/dist/mobx/index.d.ts +0 -6
  199. package/dist/mobx/index.d.ts.map +0 -1
  200. package/dist/mobx/index.js +0 -5
  201. package/dist/mobx/lazy-observe.cjs +0 -47
  202. package/dist/mobx/lazy-observe.d.cts +0 -8
  203. package/dist/mobx/lazy-observe.d.cts.map +0 -1
  204. package/dist/ms.cjs +0 -22
  205. package/dist/ms.d.cts +0 -19
  206. package/dist/ms.d.cts.map +0 -1
  207. package/dist/number.cjs +0 -16
  208. package/dist/number.d.cts +0 -8
  209. package/dist/number.d.cts.map +0 -1
  210. package/dist/parser/_exports.cjs +0 -19
  211. package/dist/parser/_exports.d.cts +0 -4
  212. package/dist/parser/_exports.d.cts.map +0 -1
  213. package/dist/parser/_exports.d.ts +0 -4
  214. package/dist/parser/_exports.d.ts.map +0 -1
  215. package/dist/parser/_exports.js +0 -3
  216. package/dist/parser/index.cjs +0 -40
  217. package/dist/parser/index.d.cts +0 -3
  218. package/dist/parser/index.d.cts.map +0 -1
  219. package/dist/parser/index.d.ts +0 -3
  220. package/dist/parser/number.cjs +0 -48
  221. package/dist/parser/number.d.cts +0 -21
  222. package/dist/parser/number.d.cts.map +0 -1
  223. package/dist/parser/number.d.ts.map +0 -1
  224. package/dist/parser/percent.cjs +0 -8
  225. package/dist/parser/percent.d.cts +0 -4
  226. package/dist/parser/percent.d.cts.map +0 -1
  227. package/dist/parser/percent.d.ts.map +0 -1
  228. package/dist/parser/string.cjs +0 -18
  229. package/dist/parser/string.d.cts +0 -7
  230. package/dist/parser/string.d.cts.map +0 -1
  231. package/dist/parser/string.d.ts.map +0 -1
  232. package/dist/price.cjs +0 -21
  233. package/dist/price.d.cts +0 -6
  234. package/dist/price.d.cts.map +0 -1
  235. package/dist/random.cjs +0 -25
  236. package/dist/random.d.cts +0 -9
  237. package/dist/random.d.cts.map +0 -1
  238. package/dist/react/hooks/index.cjs +0 -37
  239. package/dist/react/hooks/index.d.cts +0 -22
  240. package/dist/react/hooks/index.d.cts.map +0 -1
  241. package/dist/react/hooks/index.d.ts +0 -22
  242. package/dist/react/hooks/index.d.ts.map +0 -1
  243. package/dist/react/hooks/index.js +0 -21
  244. package/dist/react/hooks/use-abort-controller.cjs +0 -15
  245. package/dist/react/hooks/use-abort-controller.d.cts +0 -2
  246. package/dist/react/hooks/use-abort-controller.d.cts.map +0 -1
  247. package/dist/react/hooks/use-abort-signal.cjs +0 -8
  248. package/dist/react/hooks/use-abort-signal.d.cts +0 -2
  249. package/dist/react/hooks/use-abort-signal.d.cts.map +0 -1
  250. package/dist/react/hooks/use-click-outside.cjs +0 -17
  251. package/dist/react/hooks/use-click-outside.d.cts +0 -9
  252. package/dist/react/hooks/use-click-outside.d.cts.map +0 -1
  253. package/dist/react/hooks/use-constant.cjs +0 -19
  254. package/dist/react/hooks/use-constant.d.cts +0 -9
  255. package/dist/react/hooks/use-constant.d.cts.map +0 -1
  256. package/dist/react/hooks/use-define-ref.cjs +0 -19
  257. package/dist/react/hooks/use-define-ref.d.cts +0 -10
  258. package/dist/react/hooks/use-define-ref.d.cts.map +0 -1
  259. package/dist/react/hooks/use-element-ref.cjs +0 -12
  260. package/dist/react/hooks/use-element-ref.d.cts +0 -2
  261. package/dist/react/hooks/use-element-ref.d.cts.map +0 -1
  262. package/dist/react/hooks/use-event-listener.cjs +0 -17
  263. package/dist/react/hooks/use-event-listener.d.cts +0 -8
  264. package/dist/react/hooks/use-event-listener.d.cts.map +0 -1
  265. package/dist/react/hooks/use-event.cjs +0 -23
  266. package/dist/react/hooks/use-event.d.cts +0 -3
  267. package/dist/react/hooks/use-event.d.cts.map +0 -1
  268. package/dist/react/hooks/use-event.d.ts +0 -3
  269. package/dist/react/hooks/use-flag.cjs +0 -19
  270. package/dist/react/hooks/use-flag.d.cts +0 -8
  271. package/dist/react/hooks/use-flag.d.cts.map +0 -1
  272. package/dist/react/hooks/use-force-update.cjs +0 -11
  273. package/dist/react/hooks/use-force-update.d.cts +0 -2
  274. package/dist/react/hooks/use-force-update.d.cts.map +0 -1
  275. package/dist/react/hooks/use-initial-height.cjs +0 -15
  276. package/dist/react/hooks/use-initial-height.d.cts +0 -5
  277. package/dist/react/hooks/use-initial-height.d.cts.map +0 -1
  278. package/dist/react/hooks/use-instance.cjs +0 -31
  279. package/dist/react/hooks/use-instance.d.cts +0 -27
  280. package/dist/react/hooks/use-instance.d.cts.map +0 -1
  281. package/dist/react/hooks/use-intersection-observer.cjs +0 -14
  282. package/dist/react/hooks/use-intersection-observer.d.cts +0 -2
  283. package/dist/react/hooks/use-intersection-observer.d.cts.map +0 -1
  284. package/dist/react/hooks/use-last-defined-value.cjs +0 -12
  285. package/dist/react/hooks/use-last-defined-value.d.cts +0 -2
  286. package/dist/react/hooks/use-last-defined-value.d.cts.map +0 -1
  287. package/dist/react/hooks/use-last-value-ref.cjs +0 -12
  288. package/dist/react/hooks/use-last-value-ref.d.cts +0 -2
  289. package/dist/react/hooks/use-last-value-ref.d.cts.map +0 -1
  290. package/dist/react/hooks/use-life-cycle.cjs +0 -14
  291. package/dist/react/hooks/use-life-cycle.d.cts +0 -5
  292. package/dist/react/hooks/use-life-cycle.d.cts.map +0 -1
  293. package/dist/react/hooks/use-resize-observer.cjs +0 -15
  294. package/dist/react/hooks/use-resize-observer.d.cts +0 -2
  295. package/dist/react/hooks/use-resize-observer.d.cts.map +0 -1
  296. package/dist/react/hooks/use-sync-ref.cjs +0 -10
  297. package/dist/react/hooks/use-sync-ref.d.cts +0 -2
  298. package/dist/react/hooks/use-sync-ref.d.cts.map +0 -1
  299. package/dist/react/hooks/use-toggle.cjs +0 -10
  300. package/dist/react/hooks/use-toggle.d.cts +0 -2
  301. package/dist/react/hooks/use-toggle.d.cts.map +0 -1
  302. package/dist/react/hooks/use-value.cjs +0 -12
  303. package/dist/react/hooks/use-value.d.cts +0 -5
  304. package/dist/react/hooks/use-value.d.cts.map +0 -1
  305. package/dist/react/hooks/use-visibility-state.cjs +0 -18
  306. package/dist/react/hooks/use-visibility-state.d.cts +0 -2
  307. package/dist/react/hooks/use-visibility-state.d.cts.map +0 -1
  308. package/dist/react/index.cjs +0 -17
  309. package/dist/react/index.d.cts +0 -2
  310. package/dist/react/index.d.cts.map +0 -1
  311. package/dist/react/index.d.ts +0 -2
  312. package/dist/react/index.d.ts.map +0 -1
  313. package/dist/react/index.js +0 -1
  314. package/dist/sound.cjs +0 -16
  315. package/dist/sound.d.cts +0 -7
  316. package/dist/sound.d.cts.map +0 -1
  317. package/dist/storage.cjs +0 -48
  318. package/dist/storage.d.cts +0 -39
  319. package/dist/storage.d.cts.map +0 -1
  320. package/dist/text.cjs +0 -53
  321. package/dist/text.d.cts +0 -15
  322. package/dist/text.d.cts.map +0 -1
  323. package/dist/type-guard/_exports.cjs +0 -129
  324. package/dist/type-guard/_exports.d.cts +0 -86
  325. package/dist/type-guard/_exports.d.cts.map +0 -1
  326. package/dist/type-guard/_exports.d.ts.map +0 -1
  327. package/dist/type-guard/index.cjs +0 -40
  328. package/dist/type-guard/index.d.cts +0 -3
  329. package/dist/type-guard/index.d.cts.map +0 -1
  330. package/dist/type-guard/index.d.ts +0 -3
  331. package/dist/utils/types.cjs +0 -2
  332. package/dist/utils/types.d.cts +0 -395
  333. package/dist/utils/types.d.cts.map +0 -1
  334. package/dist/utils/types.d.ts +0 -395
  335. package/dist/utils/types.d.ts.map +0 -1
  336. package/dist/utils/types.js +0 -1
  337. package/dist/vibrate.cjs +0 -12
  338. package/dist/vibrate.d.cts +0 -5
  339. package/dist/vibrate.d.cts.map +0 -1
  340. package/utils/types.cjs +0 -2
  341. package/utils/types.d.cts +0 -395
  342. package/utils/types.d.cts.map +0 -1
  343. /package/{dist/async.d.ts → async.d.ts} +0 -0
  344. /package/{dist/async.d.ts.map → async.d.ts.map} +0 -0
  345. /package/{dist/async.js → async.js} +0 -0
  346. /package/{dist/common.js → common.js} +0 -0
  347. /package/{dist/complex → complex}/counter.d.ts +0 -0
  348. /package/{dist/complex → complex}/counter.d.ts.map +0 -0
  349. /package/{dist/complex → complex}/counter.js +0 -0
  350. /package/{dist/complex → complex}/global-config.js +0 -0
  351. /package/{dist/complex → complex}/modules-factory.js +0 -0
  352. /package/{dist/cookie.js → cookie.js} +0 -0
  353. /package/{dist/css.d.ts → css.d.ts} +0 -0
  354. /package/{dist/css.d.ts.map → css.d.ts.map} +0 -0
  355. /package/{dist/css.js → css.js} +0 -0
  356. /package/{dist/data.d.ts → data.d.ts} +0 -0
  357. /package/{dist/data.d.ts.map → data.d.ts.map} +0 -0
  358. /package/{dist/data.js → data.js} +0 -0
  359. /package/{dist/device.d.ts → device.d.ts} +0 -0
  360. /package/{dist/device.d.ts.map → device.d.ts.map} +0 -0
  361. /package/{dist/device.js → device.js} +0 -0
  362. /package/{dist/encodings.d.ts → encodings.d.ts} +0 -0
  363. /package/{dist/encodings.d.ts.map → encodings.d.ts.map} +0 -0
  364. /package/{dist/encodings.js → encodings.js} +0 -0
  365. /package/{dist/file.d.ts → file.d.ts} +0 -0
  366. /package/{dist/file.d.ts.map → file.d.ts.map} +0 -0
  367. /package/{dist/file.js → file.js} +0 -0
  368. /package/{dist/format → format}/constants.d.ts +0 -0
  369. /package/{dist/format → format}/constants.d.ts.map +0 -0
  370. /package/{dist/format → format}/constants.js +0 -0
  371. /package/{dist/format → format}/skip-spaces.d.ts +0 -0
  372. /package/{dist/format → format}/skip-spaces.d.ts.map +0 -0
  373. /package/{dist/format → format}/skip-spaces.js +0 -0
  374. /package/{dist/id.d.ts → id.d.ts} +0 -0
  375. /package/{dist/id.d.ts.map → id.d.ts.map} +0 -0
  376. /package/{dist/id.js → id.js} +0 -0
  377. /package/{dist/imports.d.ts → imports.d.ts} +0 -0
  378. /package/{dist/imports.d.ts.map → imports.d.ts.map} +0 -0
  379. /package/{dist/math.js → math.js} +0 -0
  380. /package/{dist/media.d.ts → media.d.ts} +0 -0
  381. /package/{dist/media.d.ts.map → media.d.ts.map} +0 -0
  382. /package/{dist/mobx → mobx}/apply-observable.js +0 -0
  383. /package/{dist/mobx → mobx}/create-enhanced-atom.js +0 -0
  384. /package/{dist/mobx → mobx}/get-mobx-administration.js +0 -0
  385. /package/{dist/mobx → mobx}/lazy-observe.d.ts +0 -0
  386. /package/{dist/mobx → mobx}/lazy-observe.d.ts.map +0 -0
  387. /package/{dist/mobx → mobx}/lazy-observe.js +0 -0
  388. /package/{dist/ms.d.ts → ms.d.ts} +0 -0
  389. /package/{dist/ms.d.ts.map → ms.d.ts.map} +0 -0
  390. /package/{dist/ms.js → ms.js} +0 -0
  391. /package/{dist/number.d.ts → number.d.ts} +0 -0
  392. /package/{dist/number.d.ts.map → number.d.ts.map} +0 -0
  393. /package/{dist/number.js → number.js} +0 -0
  394. /package/{dist/price.d.ts → price.d.ts} +0 -0
  395. /package/{dist/price.d.ts.map → price.d.ts.map} +0 -0
  396. /package/{dist/price.js → price.js} +0 -0
  397. /package/{dist/random.d.ts → random.d.ts} +0 -0
  398. /package/{dist/random.d.ts.map → random.d.ts.map} +0 -0
  399. /package/{dist/random.js → random.js} +0 -0
  400. /package/{dist/react → react}/hooks/use-abort-controller.d.ts +0 -0
  401. /package/{dist/react → react}/hooks/use-abort-controller.d.ts.map +0 -0
  402. /package/{dist/react → react}/hooks/use-abort-signal.d.ts +0 -0
  403. /package/{dist/react → react}/hooks/use-abort-signal.d.ts.map +0 -0
  404. /package/{dist/react → react}/hooks/use-click-outside.d.ts +0 -0
  405. /package/{dist/react → react}/hooks/use-click-outside.d.ts.map +0 -0
  406. /package/{dist/react → react}/hooks/use-constant.d.ts +0 -0
  407. /package/{dist/react → react}/hooks/use-constant.d.ts.map +0 -0
  408. /package/{dist/react → react}/hooks/use-constant.js +0 -0
  409. /package/{dist/react → react}/hooks/use-define-ref.d.ts +0 -0
  410. /package/{dist/react → react}/hooks/use-define-ref.d.ts.map +0 -0
  411. /package/{dist/react → react}/hooks/use-define-ref.js +0 -0
  412. /package/{dist/react → react}/hooks/use-element-ref.d.ts +0 -0
  413. /package/{dist/react → react}/hooks/use-element-ref.d.ts.map +0 -0
  414. /package/{dist/react → react}/hooks/use-element-ref.js +0 -0
  415. /package/{dist/react → react}/hooks/use-event-listener.d.ts +0 -0
  416. /package/{dist/react → react}/hooks/use-event-listener.d.ts.map +0 -0
  417. /package/{dist/react → react}/hooks/use-event.js +0 -0
  418. /package/{dist/react → react}/hooks/use-flag.d.ts +0 -0
  419. /package/{dist/react → react}/hooks/use-flag.d.ts.map +0 -0
  420. /package/{dist/react → react}/hooks/use-flag.js +0 -0
  421. /package/{dist/react → react}/hooks/use-force-update.d.ts +0 -0
  422. /package/{dist/react → react}/hooks/use-force-update.d.ts.map +0 -0
  423. /package/{dist/react → react}/hooks/use-force-update.js +0 -0
  424. /package/{dist/react → react}/hooks/use-initial-height.d.ts +0 -0
  425. /package/{dist/react → react}/hooks/use-initial-height.d.ts.map +0 -0
  426. /package/{dist/react → react}/hooks/use-initial-height.js +0 -0
  427. /package/{dist/react → react}/hooks/use-instance.d.ts +0 -0
  428. /package/{dist/react → react}/hooks/use-instance.d.ts.map +0 -0
  429. /package/{dist/react → react}/hooks/use-intersection-observer.d.ts +0 -0
  430. /package/{dist/react → react}/hooks/use-intersection-observer.d.ts.map +0 -0
  431. /package/{dist/react → react}/hooks/use-intersection-observer.js +0 -0
  432. /package/{dist/react → react}/hooks/use-last-defined-value.d.ts +0 -0
  433. /package/{dist/react → react}/hooks/use-last-defined-value.d.ts.map +0 -0
  434. /package/{dist/react → react}/hooks/use-last-defined-value.js +0 -0
  435. /package/{dist/react → react}/hooks/use-last-value-ref.d.ts +0 -0
  436. /package/{dist/react → react}/hooks/use-last-value-ref.d.ts.map +0 -0
  437. /package/{dist/react → react}/hooks/use-last-value-ref.js +0 -0
  438. /package/{dist/react → react}/hooks/use-life-cycle.d.ts +0 -0
  439. /package/{dist/react → react}/hooks/use-life-cycle.d.ts.map +0 -0
  440. /package/{dist/react → react}/hooks/use-resize-observer.d.ts +0 -0
  441. /package/{dist/react → react}/hooks/use-resize-observer.d.ts.map +0 -0
  442. /package/{dist/react → react}/hooks/use-sync-ref.d.ts +0 -0
  443. /package/{dist/react → react}/hooks/use-sync-ref.d.ts.map +0 -0
  444. /package/{dist/react → react}/hooks/use-sync-ref.js +0 -0
  445. /package/{dist/react → react}/hooks/use-toggle.d.ts +0 -0
  446. /package/{dist/react → react}/hooks/use-toggle.d.ts.map +0 -0
  447. /package/{dist/react → react}/hooks/use-toggle.js +0 -0
  448. /package/{dist/react → react}/hooks/use-value.d.ts +0 -0
  449. /package/{dist/react → react}/hooks/use-value.d.ts.map +0 -0
  450. /package/{dist/react → react}/hooks/use-value.js +0 -0
  451. /package/{dist/react → react}/hooks/use-visibility-state.d.ts +0 -0
  452. /package/{dist/react → react}/hooks/use-visibility-state.d.ts.map +0 -0
  453. /package/{dist/react → react}/hooks/use-visibility-state.js +0 -0
  454. /package/{dist/sound.d.ts → sound.d.ts} +0 -0
  455. /package/{dist/sound.d.ts.map → sound.d.ts.map} +0 -0
  456. /package/{dist/sound.js → sound.js} +0 -0
  457. /package/{dist/storage.d.ts → storage.d.ts} +0 -0
  458. /package/{dist/storage.d.ts.map → storage.d.ts.map} +0 -0
  459. /package/{dist/storage.js → storage.js} +0 -0
  460. /package/{dist/text.d.ts → text.d.ts} +0 -0
  461. /package/{dist/text.d.ts.map → text.d.ts.map} +0 -0
  462. /package/{dist/text.js → text.js} +0 -0
  463. /package/{dist/type-guard → type-guard}/_exports.js +0 -0
  464. /package/{dist/vibrate.d.ts → vibrate.d.ts} +0 -0
  465. /package/{dist/vibrate.d.ts.map → vibrate.d.ts.map} +0 -0
  466. /package/{dist/vibrate.js → vibrate.js} +0 -0
package/dist/html.cjs DELETED
@@ -1,202 +0,0 @@
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;
package/dist/html.d.cts DELETED
@@ -1,44 +0,0 @@
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
@@ -1 +0,0 @@
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 +0,0 @@
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"}
package/dist/id.cjs DELETED
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateStackBasedId = exports.generateLinearNumericId = exports.createLinearNumericIdGenerator = exports.generateNumericShortId = exports.generateNumericId = exports.generateShortId = exports.generateId = void 0;
4
- const nanoid_1 = require("nanoid");
5
- const DIGITS = '0123456789';
6
- const LATIN_CHARS = 'abcdefghijklmnopqrstuvwxyz';
7
- const ALPHABET = `${LATIN_CHARS}${DIGITS}`;
8
- /**
9
- * Использует алфавит abcdefghijklmnopqrstuvwxyz0123456789
10
- * Размер 6
11
- */
12
- exports.generateId = (0, nanoid_1.customAlphabet)(ALPHABET, 6);
13
- /**
14
- * Использует алфавит abcdefghijklmnopqrstuvwxyz0123456789
15
- * Размер 4
16
- */
17
- exports.generateShortId = (0, nanoid_1.customAlphabet)(ALPHABET, 4);
18
- /**
19
- * Использует алфавит 0123456789
20
- * Размер 6
21
- */
22
- exports.generateNumericId = (0, nanoid_1.customAlphabet)(DIGITS, 6);
23
- /**
24
- * Использует алфавит 0123456789
25
- * Размер 4
26
- */
27
- exports.generateNumericShortId = (0, nanoid_1.customAlphabet)(DIGITS, 4);
28
- /**
29
- * Создает функцию, которая будет создавать уникальную строку, уникальность которой основана на порядке вызова этой функции
30
- *
31
- * @example
32
- * ```ts
33
- * generateLinearNumericId = createLinearNumericIdGenerator(6);
34
- * generateLinearNumericId() // '000000'
35
- * generateLinearNumericId() // '000001'
36
- * ...
37
- * generateLinearNumericId() // '999999'
38
- * generateLinearNumericId() // '1000000'
39
- * ...
40
- * generateLinearNumericId() // '9999999'
41
- * generateLinearNumericId() // '10000000'
42
- * ```
43
- *
44
- * @param size размер
45
- * @returns {()=>string}
46
- */
47
- const createLinearNumericIdGenerator = (size = 9) => {
48
- let lastCount = 0;
49
- return () => {
50
- return (lastCount++).toString().padStart(size, '0');
51
- };
52
- };
53
- exports.createLinearNumericIdGenerator = createLinearNumericIdGenerator;
54
- /**
55
- *
56
- * @example
57
- * ```ts
58
- * generateLinearNumericId() // '000000000'
59
- * generateLinearNumericId() // '000000001'
60
- * ...
61
- * generateLinearNumericId() // '999999999'
62
- * generateLinearNumericId() // '1000000000'
63
- * ...
64
- * generateLinearNumericId() // '9999999999'
65
- * generateLinearNumericId() // '10000000000'
66
- * ```
67
- *
68
- */
69
- exports.generateLinearNumericId = (0, exports.createLinearNumericIdGenerator)();
70
- /**
71
- * Is not recommended to use.
72
- *
73
- * Generates execution stack based pseudo-id (just sliced string from error stack)
74
- */
75
- const generateStackBasedId = () => new Error().stack.split('\n').slice(1, 4).join('');
76
- exports.generateStackBasedId = generateStackBasedId;
package/dist/id.d.cts DELETED
@@ -1,63 +0,0 @@
1
- /**
2
- * Использует алфавит abcdefghijklmnopqrstuvwxyz0123456789
3
- * Размер 6
4
- */
5
- export declare const generateId: (size?: number) => string;
6
- /**
7
- * Использует алфавит abcdefghijklmnopqrstuvwxyz0123456789
8
- * Размер 4
9
- */
10
- export declare const generateShortId: (size?: number) => string;
11
- /**
12
- * Использует алфавит 0123456789
13
- * Размер 6
14
- */
15
- export declare const generateNumericId: (size?: number) => string;
16
- /**
17
- * Использует алфавит 0123456789
18
- * Размер 4
19
- */
20
- export declare const generateNumericShortId: (size?: number) => string;
21
- /**
22
- * Создает функцию, которая будет создавать уникальную строку, уникальность которой основана на порядке вызова этой функции
23
- *
24
- * @example
25
- * ```ts
26
- * generateLinearNumericId = createLinearNumericIdGenerator(6);
27
- * generateLinearNumericId() // '000000'
28
- * generateLinearNumericId() // '000001'
29
- * ...
30
- * generateLinearNumericId() // '999999'
31
- * generateLinearNumericId() // '1000000'
32
- * ...
33
- * generateLinearNumericId() // '9999999'
34
- * generateLinearNumericId() // '10000000'
35
- * ```
36
- *
37
- * @param size размер
38
- * @returns {()=>string}
39
- */
40
- export declare const createLinearNumericIdGenerator: (size?: number) => () => string;
41
- /**
42
- *
43
- * @example
44
- * ```ts
45
- * generateLinearNumericId() // '000000000'
46
- * generateLinearNumericId() // '000000001'
47
- * ...
48
- * generateLinearNumericId() // '999999999'
49
- * generateLinearNumericId() // '1000000000'
50
- * ...
51
- * generateLinearNumericId() // '9999999999'
52
- * generateLinearNumericId() // '10000000000'
53
- * ```
54
- *
55
- */
56
- export declare const generateLinearNumericId: () => string;
57
- /**
58
- * Is not recommended to use.
59
- *
60
- * Generates execution stack based pseudo-id (just sliced string from error stack)
61
- */
62
- export declare const generateStackBasedId: () => string;
63
- //# sourceMappingURL=id.d.ts.map
package/dist/id.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../src/id.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,UAAU,2BAA8B,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,eAAe,2BAA8B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,2BAA4B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,2BAA4B,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,8BAA8B,GAAI,OAAM,MAAU,iBAK9D,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,cAAmC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,cACoB,CAAC"}
package/dist/imports.cjs DELETED
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unpackAsyncModule = exports.fetchLazyModule = void 0;
4
- const async_js_1 = require("./async.cjs");
5
- /**
6
- * Функция ленивой загрузки модуля, с возможностью вызова доп. попыток
7
- * @example
8
- * ```ts
9
- * fetchLazyModule(() => import("./test.ts"), 3) // начнет загрузку test.ts
10
- * // Произошла ошибка загрузки test.ts, тогда fetchLazyModule повторно вызовет fn()
11
- * // Вызывать будет столько раз сколько указано attempts (по умолчанию 3)
12
- * ```
13
- */
14
- const fetchLazyModule = async (fetchModule, attempts = 3, delay = 1000) => {
15
- const attemptsArray = Array.from({
16
- length: attempts,
17
- }).fill(fetchModule);
18
- let lastError = null;
19
- for await (const attempt of attemptsArray) {
20
- try {
21
- if (lastError !== null) {
22
- await (0, async_js_1.sleep)(delay);
23
- }
24
- return await attempt();
25
- }
26
- catch (error) {
27
- lastError = error;
28
- }
29
- }
30
- throw lastError;
31
- };
32
- exports.fetchLazyModule = fetchLazyModule;
33
- const unpackAsyncModule = async (maybeModule) => {
34
- if (maybeModule instanceof Promise) {
35
- const data = (await maybeModule);
36
- if (data.default) {
37
- return data.default;
38
- }
39
- else {
40
- return data;
41
- }
42
- }
43
- return maybeModule;
44
- };
45
- exports.unpackAsyncModule = unpackAsyncModule;
@@ -1,15 +0,0 @@
1
- /**
2
- * Функция ленивой загрузки модуля, с возможностью вызова доп. попыток
3
- * @example
4
- * ```ts
5
- * fetchLazyModule(() => import("./test.ts"), 3) // начнет загрузку test.ts
6
- * // Произошла ошибка загрузки test.ts, тогда fetchLazyModule повторно вызовет fn()
7
- * // Вызывать будет столько раз сколько указано attempts (по умолчанию 3)
8
- * ```
9
- */
10
- export declare const fetchLazyModule: <T>(fetchModule: () => Promise<T>, attempts?: number, delay?: number) => Promise<T>;
11
- export type PackedAsyncModule<T> = Promise<T | {
12
- default: T;
13
- }>;
14
- export declare const unpackAsyncModule: <T>(maybeModule: T | PackedAsyncModule<T>) => Promise<T>;
15
- //# sourceMappingURL=imports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../src/imports.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,EACrC,aAAa,MAAM,OAAO,CAAC,CAAC,CAAC,EAC7B,iBAAY,EACZ,cAAY,KACX,OAAO,CAAC,CAAC,CAkBX,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAE/D,eAAO,MAAM,iBAAiB,GAAU,CAAC,EACvC,aAAa,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,KACpC,OAAO,CAAC,CAAC,CAYX,CAAC"}
package/dist/math.cjs DELETED
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.percentFrom = void 0;
4
- exports.degToRad = degToRad;
5
- exports.radToDeg = radToDeg;
6
- function degToRad(deg) {
7
- return deg * (Math.PI / 180);
8
- }
9
- function radToDeg(rad) {
10
- return rad * (180 / Math.PI);
11
- }
12
- /**
13
- * Получить процент от числа
14
- * @example
15
- * ```ts
16
- * percentFrom(500, 2000) // 25
17
- * percentFrom(1000, 2000) // 50
18
- * ```
19
- */
20
- const percentFrom = (value, from) => {
21
- return ((value ?? 0) / (from ?? 0)) * 100 || 0;
22
- };
23
- exports.percentFrom = percentFrom;
package/dist/math.d.cts DELETED
@@ -1,13 +0,0 @@
1
- import type { Maybe } from "./utils/types.cjs";
2
- export declare function degToRad(deg: number): number;
3
- export declare function radToDeg(rad: number): number;
4
- /**
5
- * Получить процент от числа
6
- * @example
7
- * ```ts
8
- * percentFrom(500, 2000) // 25
9
- * percentFrom(1000, 2000) // 50
10
- * ```
11
- */
12
- export declare const percentFrom: (value: Maybe<number>, from: Maybe<number>) => number;
13
- //# sourceMappingURL=math.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../src/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,0BAAyB;AAE9C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,UAEnC;AACD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,UAEnC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,WAEpE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../src/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,yBAAyB;AAE9C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,UAEnC;AACD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,UAEnC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,WAEpE,CAAC"}
package/dist/media.cjs DELETED
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBase64Image = exports.isHttpUrl = exports.rotateImage = exports.renderImage = exports.imageToBlob = exports.fileToBlob = exports.blobToUrl = void 0;
4
- exports.blobToBase64 = blobToBase64;
5
- exports.decodeDataUrl = decodeDataUrl;
6
- const math_js_1 = require("./math.cjs");
7
- function blobToBase64(blob) {
8
- return new Promise((resolve, reject) => {
9
- const reader = new FileReader();
10
- reader.onloadend = () => resolve(reader.result);
11
- reader.onerror = reject;
12
- reader.readAsDataURL(blob);
13
- });
14
- }
15
- const blobToUrl = (urlOrBlob) => urlOrBlob instanceof Blob ? URL.createObjectURL(urlOrBlob) : urlOrBlob;
16
- exports.blobToUrl = blobToUrl;
17
- const fileToBlob = (file) => {
18
- return new Blob([file], { type: file.type });
19
- };
20
- exports.fileToBlob = fileToBlob;
21
- const imageToBlob = (imageElement, mimeType = 'image/png') => {
22
- const canvas = document.createElement('canvas');
23
- canvas.width = imageElement.naturalWidth || 300;
24
- canvas.height = imageElement.naturalHeight || 300;
25
- canvas.getContext('2d').drawImage(imageElement, 0, 0);
26
- const dataUri = canvas.toDataURL(mimeType, 1);
27
- const base64data = dataUri.split(',')[1];
28
- const base64MimeType = dataUri.split(';')[0].slice(5);
29
- const bytes = globalThis.atob(base64data);
30
- const buf = new ArrayBuffer(bytes.length);
31
- const array = new Uint8Array(buf);
32
- for (let index = 0; index < bytes.length; index++) {
33
- array[index] = bytes.charCodeAt(index);
34
- }
35
- const blob = new Blob([array], { type: base64MimeType });
36
- return blob;
37
- };
38
- exports.imageToBlob = imageToBlob;
39
- /**
40
- * Загружает и отрисовывает изображение с использованием Image
41
- *
42
- * @returns {Promise<HTMLImageElement>}
43
- */
44
- const renderImage = (urlOrBlob) => new Promise((resolve, reject) => {
45
- const image = new Image();
46
- image.src = (0, exports.blobToUrl)(urlOrBlob);
47
- image.onload = () => resolve(image);
48
- image.onerror = () => reject();
49
- });
50
- exports.renderImage = renderImage;
51
- function cropImageFromCanvas(context) {
52
- const canvas = context.canvas;
53
- let w = canvas.width;
54
- let h = canvas.height;
55
- const pix = { x: [], y: [] };
56
- const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
57
- let x;
58
- let y;
59
- let index;
60
- for (y = 0; y < h; y++) {
61
- for (x = 0; x < w; x++) {
62
- index = (y * w + x) * 4;
63
- if (imageData.data[index + 3] > 0) {
64
- pix.x.push(x);
65
- pix.y.push(y);
66
- }
67
- }
68
- }
69
- pix.x.sort((a, b) => a - b);
70
- pix.y.sort((a, b) => a - b);
71
- const n = pix.x.length - 1;
72
- w = 1 + pix.x[n] - pix.x[0];
73
- h = 1 + pix.y[n] - pix.y[0];
74
- const cut = context.getImageData(pix.x[0], pix.y[0], w, h);
75
- canvas.width = w;
76
- canvas.height = h;
77
- context.putImageData(cut, 0, 0);
78
- return canvas;
79
- }
80
- // TODO: ломает iphone с огромными изображениями
81
- const rotateImage = (image, angle) => {
82
- const maxSize = Math.max(image.width, image.height);
83
- const canvas = document.createElement('canvas');
84
- canvas.width = maxSize;
85
- canvas.height = maxSize;
86
- const context = canvas.getContext('2d');
87
- context.save();
88
- context.translate(canvas.width / 2, canvas.height / 2);
89
- context.rotate((0, math_js_1.degToRad)(angle));
90
- context.drawImage(image, -image.width / 2, -image.height / 2);
91
- context.restore();
92
- cropImageFromCanvas(context);
93
- return (0, exports.renderImage)(canvas.toDataURL('image/png'));
94
- };
95
- exports.rotateImage = rotateImage;
96
- /*
97
- * Returning object which contains base64 data and mime type of passed data url string.
98
- * */
99
- function decodeDataUrl(url) {
100
- const regex = /^data:(.*);base64,\s?(.*)$/;
101
- const matches = new RegExp(regex).exec(url);
102
- return {
103
- mimeType: matches?.[1],
104
- data: matches?.[2],
105
- };
106
- }
107
- const isHttpUrl = (url) => {
108
- return url.startsWith('https://') || url.startsWith('http://');
109
- };
110
- exports.isHttpUrl = isHttpUrl;
111
- const isBase64Image = (str) => {
112
- const { mimeType, data } = decodeDataUrl(str);
113
- return !!(data && mimeType?.startsWith('image/'));
114
- };
115
- exports.isBase64Image = isBase64Image;
package/dist/media.d.cts DELETED
@@ -1,20 +0,0 @@
1
- export declare function blobToBase64(blob: Blob): Promise<string>;
2
- export declare const blobToUrl: (urlOrBlob: string | Blob) => string;
3
- export declare const fileToBlob: (file: File) => Blob;
4
- export declare const imageToBlob: (imageElement: HTMLImageElement, mimeType?: string) => Blob;
5
- /**
6
- * Загружает и отрисовывает изображение с использованием Image
7
- *
8
- * @returns {Promise<HTMLImageElement>}
9
- */
10
- export declare const renderImage: (urlOrBlob: Blob | string) => Promise<HTMLImageElement>;
11
- export declare const rotateImage: (image: HTMLImageElement, angle: number) => Promise<HTMLImageElement>;
12
- interface DecodedDataUrl {
13
- mimeType?: string;
14
- data?: string;
15
- }
16
- export declare function decodeDataUrl(url: string): DecodedDataUrl;
17
- export declare const isHttpUrl: (url: string) => boolean;
18
- export declare const isBase64Image: (str: string) => boolean;
19
- export {};
20
- //# sourceMappingURL=media.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxD;AAED,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,GAAG,IAAI,WACsB,CAAC;AAEzE,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,SAEpC,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,cAAc,gBAAgB,EAC9B,WAAU,MAAoB,SAwB/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,WAAW,IAAI,GAAG,MAAM,8BAMhD,CAAC;AAoCL,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,EAAE,OAAO,MAAM,8BAajE,CAAC;AAEF,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAKD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAQzD;AAED,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,KAAG,OAEvC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,OAG3C,CAAC"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyObservable = void 0;
4
- const mobx_1 = require("mobx");
5
- const applyObservable = (context, annotationsArray, useDecorators) => {
6
- if (useDecorators) {
7
- annotationsArray.forEach(([field, annotation]) => {
8
- annotation(context, field);
9
- });
10
- (0, mobx_1.makeObservable)(context);
11
- }
12
- else {
13
- (0, mobx_1.makeObservable)(context, Object.fromEntries(annotationsArray));
14
- }
15
- };
16
- exports.applyObservable = applyObservable;
@@ -1,4 +0,0 @@
1
- import type { AnyObject } from "../utils/types.cjs";
2
- export type ObservableAnnotationsArray = [string, any][];
3
- export declare const applyObservable: (context: AnyObject, annotationsArray: ObservableAnnotationsArray, useDecorators?: boolean) => void;
4
- //# sourceMappingURL=apply-observable.d.ts.map