yummies 5.7.1 → 5.8.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 (391) hide show
  1. package/async.js +26 -59
  2. package/async.js.map +1 -0
  3. package/common.d.ts +1 -1
  4. package/common.d.ts.map +1 -1
  5. package/common.js +5 -13
  6. package/common.js.map +1 -0
  7. package/complex/global-config.d.ts +1 -1
  8. package/complex/global-config.d.ts.map +1 -1
  9. package/complex/index.d.ts +3 -3
  10. package/complex/index.d.ts.map +1 -1
  11. package/complex/modules-factory.d.ts +1 -1
  12. package/complex/modules-factory.d.ts.map +1 -1
  13. package/complex.js +66 -0
  14. package/complex.js.map +1 -0
  15. package/cookie.d.ts +1 -1
  16. package/cookie.d.ts.map +1 -1
  17. package/cookie.js +4 -8
  18. package/cookie.js.map +1 -0
  19. package/css.d.ts +1 -1
  20. package/css.js +2780 -49
  21. package/css.js.map +1 -0
  22. package/data.js +32 -50
  23. package/data.js.map +1 -0
  24. package/date-time.d.ts +2 -3
  25. package/date-time.d.ts.map +1 -1
  26. package/date-time.js +588 -154
  27. package/date-time.js.map +1 -0
  28. package/device.js +23 -20
  29. package/device.js.map +1 -0
  30. package/encodings.js +269 -265
  31. package/encodings.js.map +1 -0
  32. package/errors.d.ts +1 -1
  33. package/errors.d.ts.map +1 -1
  34. package/errors.js +8 -29
  35. package/errors.js.map +1 -0
  36. package/file.js +19 -23
  37. package/file.js.map +1 -0
  38. package/format/_exports.d.ts +4 -4
  39. package/format/_exports.d.ts.map +1 -1
  40. package/format/index.d.ts +1 -1
  41. package/format/index.d.ts.map +1 -1
  42. package/format/number.d.ts +1 -1
  43. package/format/number.d.ts.map +1 -1
  44. package/format/percent.d.ts +2 -2
  45. package/format/percent.d.ts.map +1 -1
  46. package/format.js +27 -0
  47. package/format.js.map +1 -0
  48. package/html.d.ts +2 -2
  49. package/html.d.ts.map +1 -1
  50. package/html.js +636 -169
  51. package/html.js.map +1 -0
  52. package/id.js +25 -70
  53. package/id.js.map +1 -0
  54. package/imports.js +22 -37
  55. package/imports.js.map +1 -0
  56. package/math.d.ts +1 -1
  57. package/math.d.ts.map +1 -1
  58. package/math.js +10 -14
  59. package/math.js.map +1 -0
  60. package/media.js +54 -96
  61. package/media.js.map +1 -0
  62. package/mobx/apply-observable.d.ts +1 -1
  63. package/mobx/apply-observable.d.ts.map +1 -1
  64. package/mobx/create-enhanced-atom.d.ts +2 -2
  65. package/mobx/create-enhanced-atom.d.ts.map +1 -1
  66. package/mobx/deep-observable-struct.d.ts +1 -1
  67. package/mobx/deep-observable-struct.d.ts.map +1 -1
  68. package/mobx/get-mobx-administration.d.ts +2 -2
  69. package/mobx/get-mobx-administration.d.ts.map +1 -1
  70. package/mobx/index.d.ts +5 -5
  71. package/mobx/index.d.ts.map +1 -1
  72. package/mobx.js +89 -0
  73. package/mobx.js.map +1 -0
  74. package/ms.js +12 -17
  75. package/ms.js.map +1 -0
  76. package/number.js +9 -12
  77. package/number.js.map +1 -0
  78. package/package.json +93 -92
  79. package/parser/_exports.d.ts +3 -3
  80. package/parser/_exports.d.ts.map +1 -1
  81. package/parser/index.d.ts +1 -1
  82. package/parser/index.d.ts.map +1 -1
  83. package/parser/number.d.ts +1 -1
  84. package/parser/number.d.ts.map +1 -1
  85. package/parser/percent.d.ts +2 -2
  86. package/parser/percent.d.ts.map +1 -1
  87. package/parser/string.d.ts +1 -1
  88. package/parser/string.d.ts.map +1 -1
  89. package/parser.js +15 -0
  90. package/parser.js.map +1 -0
  91. package/price.js +13 -16
  92. package/price.js.map +1 -0
  93. package/random.js +11 -13
  94. package/random.js.map +1 -0
  95. package/react/hooks/index.d.ts +21 -21
  96. package/react/hooks/index.d.ts.map +1 -1
  97. package/react/hooks/use-click-outside.d.ts +1 -1
  98. package/react/hooks/use-define-ref.d.ts +1 -1
  99. package/react/hooks/use-element-ref.d.ts +1 -1
  100. package/react/hooks/use-event.d.ts +1 -1
  101. package/react/hooks/use-event.d.ts.map +1 -1
  102. package/react/hooks/use-initial-height.d.ts +1 -1
  103. package/react/hooks/use-last-value-ref.d.ts +1 -1
  104. package/react/hooks/use-resize-observer.d.ts +1 -1
  105. package/react/hooks/use-sync-ref.d.ts +1 -1
  106. package/react/hooks/use-toggle.d.ts +1 -1
  107. package/react/hooks/use-value.d.ts +1 -1
  108. package/react/index.d.ts +1 -1
  109. package/react/index.d.ts.map +1 -1
  110. package/react.js +152 -0
  111. package/react.js.map +1 -0
  112. package/sound.js +7 -11
  113. package/sound.js.map +1 -0
  114. package/text.js +20 -46
  115. package/text.js.map +1 -0
  116. package/type-guard/_exports.d.ts +1 -1
  117. package/type-guard/_exports.d.ts.map +1 -1
  118. package/type-guard/index.d.ts +1 -1
  119. package/type-guard/index.d.ts.map +1 -1
  120. package/type-guard.js +5 -0
  121. package/type-guard.js.map +1 -0
  122. package/utility-types.d.ts.map +1 -0
  123. package/utility-types.js +2 -0
  124. package/utility-types.js.map +1 -0
  125. package/utils/types.js +2 -1
  126. package/utils/types.js.map +1 -0
  127. package/vibrate.js +6 -7
  128. package/vibrate.js.map +1 -0
  129. package/~index-C3wKHvHr.js +80 -0
  130. package/~index-C3wKHvHr.js.map +1 -0
  131. package/~number-EWff2XI6.js +25 -0
  132. package/~number-EWff2XI6.js.map +1 -0
  133. package/~number-baxVnzrJ.js +32 -0
  134. package/~number-baxVnzrJ.js.map +1 -0
  135. package/async.cjs +0 -70
  136. package/async.d.cts +0 -28
  137. package/async.d.cts.map +0 -1
  138. package/common.cjs +0 -18
  139. package/common.d.cts +0 -15
  140. package/common.d.cts.map +0 -1
  141. package/complex/counter.cjs +0 -21
  142. package/complex/counter.d.cts +0 -15
  143. package/complex/counter.d.cts.map +0 -1
  144. package/complex/counter.js +0 -17
  145. package/complex/global-config.cjs +0 -46
  146. package/complex/global-config.d.cts +0 -11
  147. package/complex/global-config.d.cts.map +0 -1
  148. package/complex/global-config.js +0 -41
  149. package/complex/index.cjs +0 -19
  150. package/complex/index.d.cts +0 -4
  151. package/complex/index.d.cts.map +0 -1
  152. package/complex/index.js +0 -3
  153. package/complex/modules-factory.cjs +0 -50
  154. package/complex/modules-factory.d.cts +0 -49
  155. package/complex/modules-factory.d.cts.map +0 -1
  156. package/complex/modules-factory.js +0 -46
  157. package/cookie.cjs +0 -13
  158. package/cookie.d.cts +0 -3
  159. package/cookie.d.cts.map +0 -1
  160. package/css.cjs +0 -64
  161. package/css.d.cts +0 -42
  162. package/css.d.cts.map +0 -1
  163. package/data.cjs +0 -58
  164. package/data.d.cts +0 -4
  165. package/data.d.cts.map +0 -1
  166. package/date-time.cjs +0 -171
  167. package/date-time.d.cts +0 -28
  168. package/date-time.d.cts.map +0 -1
  169. package/device.cjs +0 -28
  170. package/device.d.cts +0 -8
  171. package/device.d.cts.map +0 -1
  172. package/encodings.cjs +0 -270
  173. package/encodings.d.cts +0 -2
  174. package/encodings.d.cts.map +0 -1
  175. package/errors.cjs +0 -34
  176. package/errors.d.cts +0 -19
  177. package/errors.d.cts.map +0 -1
  178. package/file.cjs +0 -29
  179. package/file.d.cts +0 -3
  180. package/file.d.cts.map +0 -1
  181. package/format/_exports.cjs +0 -20
  182. package/format/_exports.d.cts +0 -5
  183. package/format/_exports.d.cts.map +0 -1
  184. package/format/_exports.js +0 -4
  185. package/format/constants.cjs +0 -6
  186. package/format/constants.d.cts +0 -4
  187. package/format/constants.d.cts.map +0 -1
  188. package/format/constants.js +0 -3
  189. package/format/index.cjs +0 -40
  190. package/format/index.d.cts +0 -3
  191. package/format/index.d.cts.map +0 -1
  192. package/format/index.js +0 -4
  193. package/format/number.cjs +0 -48
  194. package/format/number.d.cts +0 -36
  195. package/format/number.d.cts.map +0 -1
  196. package/format/number.js +0 -44
  197. package/format/percent.cjs +0 -27
  198. package/format/percent.d.cts +0 -15
  199. package/format/percent.d.cts.map +0 -1
  200. package/format/percent.js +0 -23
  201. package/format/skip-spaces.cjs +0 -8
  202. package/format/skip-spaces.d.cts +0 -5
  203. package/format/skip-spaces.d.cts.map +0 -1
  204. package/format/skip-spaces.js +0 -4
  205. package/html.cjs +0 -202
  206. package/html.d.cts +0 -44
  207. package/html.d.cts.map +0 -1
  208. package/id.cjs +0 -76
  209. package/id.d.cts +0 -63
  210. package/id.d.cts.map +0 -1
  211. package/imports.cjs +0 -45
  212. package/imports.d.cts +0 -15
  213. package/imports.d.cts.map +0 -1
  214. package/math.cjs +0 -23
  215. package/math.d.cts +0 -13
  216. package/math.d.cts.map +0 -1
  217. package/media.cjs +0 -115
  218. package/media.d.cts +0 -20
  219. package/media.d.cts.map +0 -1
  220. package/mobx/apply-observable.cjs +0 -16
  221. package/mobx/apply-observable.d.cts +0 -4
  222. package/mobx/apply-observable.d.cts.map +0 -1
  223. package/mobx/apply-observable.js +0 -12
  224. package/mobx/create-enhanced-atom.cjs +0 -16
  225. package/mobx/create-enhanced-atom.d.cts +0 -11
  226. package/mobx/create-enhanced-atom.d.cts.map +0 -1
  227. package/mobx/create-enhanced-atom.js +0 -12
  228. package/mobx/deep-observable-struct.cjs +0 -61
  229. package/mobx/deep-observable-struct.d.cts +0 -7
  230. package/mobx/deep-observable-struct.d.cts.map +0 -1
  231. package/mobx/deep-observable-struct.js +0 -57
  232. package/mobx/get-mobx-administration.cjs +0 -6
  233. package/mobx/get-mobx-administration.d.cts +0 -6
  234. package/mobx/get-mobx-administration.d.cts.map +0 -1
  235. package/mobx/get-mobx-administration.js +0 -2
  236. package/mobx/index.cjs +0 -21
  237. package/mobx/index.d.cts +0 -6
  238. package/mobx/index.d.cts.map +0 -1
  239. package/mobx/index.js +0 -5
  240. package/mobx/lazy-observe.cjs +0 -66
  241. package/mobx/lazy-observe.d.cts +0 -14
  242. package/mobx/lazy-observe.d.cts.map +0 -1
  243. package/mobx/lazy-observe.js +0 -62
  244. package/ms.cjs +0 -22
  245. package/ms.d.cts +0 -19
  246. package/ms.d.cts.map +0 -1
  247. package/number.cjs +0 -16
  248. package/number.d.cts +0 -8
  249. package/number.d.cts.map +0 -1
  250. package/parser/_exports.cjs +0 -19
  251. package/parser/_exports.d.cts +0 -4
  252. package/parser/_exports.d.cts.map +0 -1
  253. package/parser/_exports.js +0 -3
  254. package/parser/index.cjs +0 -40
  255. package/parser/index.d.cts +0 -3
  256. package/parser/index.d.cts.map +0 -1
  257. package/parser/index.js +0 -4
  258. package/parser/number.cjs +0 -48
  259. package/parser/number.d.cts +0 -21
  260. package/parser/number.d.cts.map +0 -1
  261. package/parser/number.js +0 -44
  262. package/parser/percent.cjs +0 -8
  263. package/parser/percent.d.cts +0 -4
  264. package/parser/percent.d.cts.map +0 -1
  265. package/parser/percent.js +0 -4
  266. package/parser/string.cjs +0 -18
  267. package/parser/string.d.cts +0 -7
  268. package/parser/string.d.cts.map +0 -1
  269. package/parser/string.js +0 -14
  270. package/price.cjs +0 -21
  271. package/price.d.cts +0 -6
  272. package/price.d.cts.map +0 -1
  273. package/random.cjs +0 -25
  274. package/random.d.cts +0 -9
  275. package/random.d.cts.map +0 -1
  276. package/react/hooks/index.cjs +0 -37
  277. package/react/hooks/index.d.cts +0 -22
  278. package/react/hooks/index.d.cts.map +0 -1
  279. package/react/hooks/index.js +0 -21
  280. package/react/hooks/use-abort-controller.cjs +0 -15
  281. package/react/hooks/use-abort-controller.d.cts +0 -2
  282. package/react/hooks/use-abort-controller.d.cts.map +0 -1
  283. package/react/hooks/use-abort-controller.js +0 -11
  284. package/react/hooks/use-abort-signal.cjs +0 -8
  285. package/react/hooks/use-abort-signal.d.cts +0 -2
  286. package/react/hooks/use-abort-signal.d.cts.map +0 -1
  287. package/react/hooks/use-abort-signal.js +0 -4
  288. package/react/hooks/use-click-outside.cjs +0 -17
  289. package/react/hooks/use-click-outside.d.cts +0 -9
  290. package/react/hooks/use-click-outside.d.cts.map +0 -1
  291. package/react/hooks/use-click-outside.js +0 -13
  292. package/react/hooks/use-constant.cjs +0 -19
  293. package/react/hooks/use-constant.d.cts +0 -9
  294. package/react/hooks/use-constant.d.cts.map +0 -1
  295. package/react/hooks/use-constant.js +0 -15
  296. package/react/hooks/use-define-ref.cjs +0 -19
  297. package/react/hooks/use-define-ref.d.cts +0 -10
  298. package/react/hooks/use-define-ref.d.cts.map +0 -1
  299. package/react/hooks/use-define-ref.js +0 -15
  300. package/react/hooks/use-element-ref.cjs +0 -12
  301. package/react/hooks/use-element-ref.d.cts +0 -2
  302. package/react/hooks/use-element-ref.d.cts.map +0 -1
  303. package/react/hooks/use-element-ref.js +0 -8
  304. package/react/hooks/use-event-listener.cjs +0 -17
  305. package/react/hooks/use-event-listener.d.cts +0 -8
  306. package/react/hooks/use-event-listener.d.cts.map +0 -1
  307. package/react/hooks/use-event-listener.js +0 -13
  308. package/react/hooks/use-event.cjs +0 -23
  309. package/react/hooks/use-event.d.cts +0 -3
  310. package/react/hooks/use-event.d.cts.map +0 -1
  311. package/react/hooks/use-event.js +0 -19
  312. package/react/hooks/use-flag.cjs +0 -19
  313. package/react/hooks/use-flag.d.cts +0 -8
  314. package/react/hooks/use-flag.d.cts.map +0 -1
  315. package/react/hooks/use-flag.js +0 -15
  316. package/react/hooks/use-force-update.cjs +0 -11
  317. package/react/hooks/use-force-update.d.cts +0 -2
  318. package/react/hooks/use-force-update.d.cts.map +0 -1
  319. package/react/hooks/use-force-update.js +0 -7
  320. package/react/hooks/use-initial-height.cjs +0 -15
  321. package/react/hooks/use-initial-height.d.cts +0 -5
  322. package/react/hooks/use-initial-height.d.cts.map +0 -1
  323. package/react/hooks/use-initial-height.js +0 -11
  324. package/react/hooks/use-instance.cjs +0 -31
  325. package/react/hooks/use-instance.d.cts +0 -27
  326. package/react/hooks/use-instance.d.cts.map +0 -1
  327. package/react/hooks/use-instance.js +0 -27
  328. package/react/hooks/use-intersection-observer.cjs +0 -14
  329. package/react/hooks/use-intersection-observer.d.cts +0 -2
  330. package/react/hooks/use-intersection-observer.d.cts.map +0 -1
  331. package/react/hooks/use-intersection-observer.js +0 -10
  332. package/react/hooks/use-last-defined-value.cjs +0 -12
  333. package/react/hooks/use-last-defined-value.d.cts +0 -2
  334. package/react/hooks/use-last-defined-value.d.cts.map +0 -1
  335. package/react/hooks/use-last-defined-value.js +0 -8
  336. package/react/hooks/use-last-value-ref.cjs +0 -12
  337. package/react/hooks/use-last-value-ref.d.cts +0 -2
  338. package/react/hooks/use-last-value-ref.d.cts.map +0 -1
  339. package/react/hooks/use-last-value-ref.js +0 -8
  340. package/react/hooks/use-life-cycle.cjs +0 -14
  341. package/react/hooks/use-life-cycle.d.cts +0 -5
  342. package/react/hooks/use-life-cycle.d.cts.map +0 -1
  343. package/react/hooks/use-life-cycle.js +0 -10
  344. package/react/hooks/use-resize-observer.cjs +0 -15
  345. package/react/hooks/use-resize-observer.d.cts +0 -2
  346. package/react/hooks/use-resize-observer.d.cts.map +0 -1
  347. package/react/hooks/use-resize-observer.js +0 -11
  348. package/react/hooks/use-sync-ref.cjs +0 -10
  349. package/react/hooks/use-sync-ref.d.cts +0 -2
  350. package/react/hooks/use-sync-ref.d.cts.map +0 -1
  351. package/react/hooks/use-sync-ref.js +0 -6
  352. package/react/hooks/use-toggle.cjs +0 -10
  353. package/react/hooks/use-toggle.d.cts +0 -2
  354. package/react/hooks/use-toggle.d.cts.map +0 -1
  355. package/react/hooks/use-toggle.js +0 -6
  356. package/react/hooks/use-value.cjs +0 -12
  357. package/react/hooks/use-value.d.cts +0 -5
  358. package/react/hooks/use-value.d.cts.map +0 -1
  359. package/react/hooks/use-value.js +0 -8
  360. package/react/hooks/use-visibility-state.cjs +0 -18
  361. package/react/hooks/use-visibility-state.d.cts +0 -2
  362. package/react/hooks/use-visibility-state.d.cts.map +0 -1
  363. package/react/hooks/use-visibility-state.js +0 -14
  364. package/react/index.cjs +0 -17
  365. package/react/index.d.cts +0 -2
  366. package/react/index.d.cts.map +0 -1
  367. package/react/index.js +0 -1
  368. package/sound.cjs +0 -16
  369. package/sound.d.cts +0 -7
  370. package/sound.d.cts.map +0 -1
  371. package/storage.cjs +0 -48
  372. package/storage.d.cts +0 -39
  373. package/storage.d.cts.map +0 -1
  374. package/storage.js +0 -43
  375. package/text.cjs +0 -53
  376. package/text.d.cts +0 -15
  377. package/text.d.cts.map +0 -1
  378. package/type-guard/_exports.cjs +0 -129
  379. package/type-guard/_exports.d.cts +0 -86
  380. package/type-guard/_exports.d.cts.map +0 -1
  381. package/type-guard/_exports.js +0 -125
  382. package/type-guard/index.cjs +0 -40
  383. package/type-guard/index.d.cts +0 -3
  384. package/type-guard/index.d.cts.map +0 -1
  385. package/type-guard/index.js +0 -4
  386. package/utils/types.cjs +0 -2
  387. package/utils/types.d.cts +0 -395
  388. package/utils/types.d.cts.map +0 -1
  389. package/vibrate.cjs +0 -12
  390. package/vibrate.d.cts +0 -5
  391. package/vibrate.d.cts.map +0 -1
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLastDefinedValue = void 0;
4
- const react_1 = require("react");
5
- const useLastDefinedValue = (value) => {
6
- const ref = (0, react_1.useRef)(value);
7
- if (value != null) {
8
- ref.current = value;
9
- }
10
- return ref.current;
11
- };
12
- exports.useLastDefinedValue = useLastDefinedValue;
@@ -1,2 +0,0 @@
1
- export declare const useLastDefinedValue: <T>(value: T) => T;
2
- //# sourceMappingURL=use-last-defined-value.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-last-defined-value.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-last-defined-value.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAE,OAAO,CAAC,MAM9C,CAAC"}
@@ -1,8 +0,0 @@
1
- import { useRef } from 'react';
2
- export const useLastDefinedValue = (value) => {
3
- const ref = useRef(value);
4
- if (value != null) {
5
- ref.current = value;
6
- }
7
- return ref.current;
8
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLastValueRef = void 0;
4
- const react_1 = require("react");
5
- const useLastValueRef = (value) => {
6
- const ref = (0, react_1.useRef)(value);
7
- if (value != null) {
8
- ref.current = value;
9
- }
10
- return ref;
11
- };
12
- exports.useLastValueRef = useLastValueRef;
@@ -1,2 +0,0 @@
1
- export declare const useLastValueRef: <T>(value: T | null | undefined) => import("react").MutableRefObject<T | null | undefined>;
2
- //# sourceMappingURL=use-last-value-ref.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-last-value-ref.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-last-value-ref.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,2DAQ7D,CAAC"}
@@ -1,8 +0,0 @@
1
- import { useRef } from 'react';
2
- export const useLastValueRef = (value) => {
3
- const ref = useRef(value);
4
- if (value != null) {
5
- ref.current = value;
6
- }
7
- return ref;
8
- };
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLifeCycle = void 0;
4
- const react_1 = require("react");
5
- const use_sync_ref_js_1 = require("./use-sync-ref.cjs");
6
- const useLifeCycle = (fn) => {
7
- const fnRef = (0, use_sync_ref_js_1.useSyncRef)(fn);
8
- (0, react_1.useEffect)(() => {
9
- const fnOperation = fnRef.current();
10
- fnOperation.mount?.();
11
- return fnOperation.unmount?.();
12
- }, []);
13
- };
14
- exports.useLifeCycle = useLifeCycle;
@@ -1,5 +0,0 @@
1
- export declare const useLifeCycle: (fn: () => {
2
- mount?: VoidFunction;
3
- unmount?: VoidFunction;
4
- }) => void;
5
- //# sourceMappingURL=use-life-cycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-life-cycle.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-life-cycle.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,GACvB,IAAI,MAAM;IACR,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB,SASF,CAAC"}
@@ -1,10 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useSyncRef } from "./use-sync-ref.js";
3
- export const useLifeCycle = (fn) => {
4
- const fnRef = useSyncRef(fn);
5
- useEffect(() => {
6
- const fnOperation = fnRef.current();
7
- fnOperation.mount?.();
8
- return fnOperation.unmount?.();
9
- }, []);
10
- };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useResizeObserver = void 0;
4
- const react_1 = require("react");
5
- const use_define_ref_js_1 = require("./use-define-ref.cjs");
6
- const useResizeObserver = (callback) => {
7
- const resizeObserverRef = (0, use_define_ref_js_1.useDefineRef)(() => new ResizeObserver(callback));
8
- (0, react_1.useLayoutEffect)(() => {
9
- return () => {
10
- resizeObserverRef.current.disconnect();
11
- };
12
- }, []);
13
- return resizeObserverRef;
14
- };
15
- exports.useResizeObserver = useResizeObserver;
@@ -1,2 +0,0 @@
1
- export declare const useResizeObserver: (callback: ResizeObserverCallback) => import("react").MutableRefObject<ResizeObserver>;
2
- //# sourceMappingURL=use-resize-observer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-resize-observer.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-resize-observer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,GAAI,UAAU,sBAAsB,qDAUjE,CAAC"}
@@ -1,11 +0,0 @@
1
- import { useLayoutEffect } from 'react';
2
- import { useDefineRef } from "./use-define-ref.js";
3
- export const useResizeObserver = (callback) => {
4
- const resizeObserverRef = useDefineRef(() => new ResizeObserver(callback));
5
- useLayoutEffect(() => {
6
- return () => {
7
- resizeObserverRef.current.disconnect();
8
- };
9
- }, []);
10
- return resizeObserverRef;
11
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSyncRef = void 0;
4
- const react_1 = require("react");
5
- const useSyncRef = (value) => {
6
- const ref = (0, react_1.useRef)(value);
7
- ref.current = value;
8
- return ref;
9
- };
10
- exports.useSyncRef = useSyncRef;
@@ -1,2 +0,0 @@
1
- export declare const useSyncRef: <T>(value: T) => import("react").MutableRefObject<T>;
2
- //# sourceMappingURL=use-sync-ref.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-sync-ref.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-sync-ref.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,OAAO,CAAC,wCAIrC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { useRef } from 'react';
2
- export const useSyncRef = (value) => {
3
- const ref = useRef(value);
4
- ref.current = value;
5
- return ref;
6
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useToggle = void 0;
4
- const react_1 = require("react");
5
- const useToggle = (initialState) => {
6
- const [toggled, setToggled] = (0, react_1.useState)(!!initialState);
7
- const toggle = (0, react_1.useCallback)(() => setToggled((toggled) => !toggled), []);
8
- return [toggled, toggle, setToggled];
9
- };
10
- exports.useToggle = useToggle;
@@ -1,2 +0,0 @@
1
- export declare const useToggle: (initialState?: boolean) => readonly [boolean, () => void, import("react").Dispatch<import("react").SetStateAction<boolean>>];
2
- //# sourceMappingURL=use-toggle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-toggle.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-toggle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,eAAe,OAAO,sGAM/C,CAAC"}
@@ -1,6 +0,0 @@
1
- import { useCallback, useState } from 'react';
2
- export const useToggle = (initialState) => {
3
- const [toggled, setToggled] = useState(!!initialState);
4
- const toggle = useCallback(() => setToggled((toggled) => !toggled), []);
5
- return [toggled, toggle, setToggled];
6
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useValue = void 0;
4
- const react_1 = require("react");
5
- const useValue = (defaults) => {
6
- const [value, setValue] = (0, react_1.useState)(defaults);
7
- return {
8
- value,
9
- set: setValue,
10
- };
11
- };
12
- exports.useValue = useValue;
@@ -1,5 +0,0 @@
1
- export declare const useValue: <T>(defaults: T | (() => T)) => {
2
- value: T;
3
- set: import("react").Dispatch<import("react").SetStateAction<T>>;
4
- };
5
- //# sourceMappingURL=use-value.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-value.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-value.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;;;CAOlD,CAAC"}
@@ -1,8 +0,0 @@
1
- import { useState } from 'react';
2
- export const useValue = (defaults) => {
3
- const [value, setValue] = useState(defaults);
4
- return {
5
- value,
6
- set: setValue,
7
- };
8
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useVisibilityState = void 0;
4
- const react_1 = require("react");
5
- const useVisibilityState = () => {
6
- const [state, setState] = (0, react_1.useState)();
7
- (0, react_1.useEffect)(() => {
8
- const handleVisibilityChange = () => {
9
- setState(document.visibilityState);
10
- };
11
- document.addEventListener('visibilitychange', handleVisibilityChange);
12
- return () => {
13
- document.removeEventListener('visibilitychange', handleVisibilityChange);
14
- };
15
- }, []);
16
- return state;
17
- };
18
- exports.useVisibilityState = useVisibilityState;
@@ -1,2 +0,0 @@
1
- export declare const useVisibilityState: () => DocumentVisibilityState | undefined;
2
- //# sourceMappingURL=use-visibility-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-visibility-state.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-visibility-state.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,2CAgB9B,CAAC"}
@@ -1,14 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- export const useVisibilityState = () => {
3
- const [state, setState] = useState();
4
- useEffect(() => {
5
- const handleVisibilityChange = () => {
6
- setState(document.visibilityState);
7
- };
8
- document.addEventListener('visibilitychange', handleVisibilityChange);
9
- return () => {
10
- document.removeEventListener('visibilitychange', handleVisibilityChange);
11
- };
12
- }, []);
13
- return state;
14
- };
package/react/index.cjs DELETED
@@ -1,17 +0,0 @@
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("./hooks/index.cjs"), exports);
package/react/index.d.cts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./hooks/index.cjs";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,kCAAiC"}
package/react/index.js DELETED
@@ -1 +0,0 @@
1
- export * from "./hooks/index.js";
package/sound.cjs DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.playSound = void 0;
4
- /**
5
- * Воспроизводит звук из файла
6
- */
7
- const playSound = async (file, { volume = 1 } = {}) => {
8
- let audio = new Audio(file);
9
- audio.volume = volume;
10
- audio.muted = !volume;
11
- await audio.play();
12
- audio.remove();
13
- // @ts-expect-error
14
- audio = null;
15
- };
16
- exports.playSound = playSound;
package/sound.d.cts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Воспроизводит звук из файла
3
- */
4
- export declare const playSound: (file: string, { volume }?: {
5
- volume?: number;
6
- }) => Promise<void>;
7
- //# sourceMappingURL=sound.d.ts.map
package/sound.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../src/sound.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,aAAgB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,kBASzC,CAAC"}
package/storage.cjs DELETED
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createStorageKey = void 0;
4
- exports.createStorage = createStorage;
5
- const storages = {
6
- session: sessionStorage,
7
- local: localStorage,
8
- };
9
- const createStorageKey = (prefix, key, namespace) => `${prefix}${namespace ? `/${namespace}` : ''}/${key}`;
10
- exports.createStorageKey = createStorageKey;
11
- const parseStorageValue = (value) => {
12
- if (typeof value !== 'string') {
13
- return value;
14
- }
15
- try {
16
- const parsed = JSON.parse(value);
17
- return parsed;
18
- }
19
- catch {
20
- return null;
21
- }
22
- };
23
- const formatValueToStorage = (value) => {
24
- return JSON.stringify(value);
25
- };
26
- /**
27
- * Создает интерфейс для работы с хранилищем (localStorage, sessionStorage)
28
- */
29
- function createStorage(storageConfig) {
30
- return {
31
- set: (cfg) => {
32
- const config = cfg;
33
- const storageType = (config.type ?? storageConfig.type);
34
- const storagePrefix = (config.prefix ?? storageConfig.prefix);
35
- const storage = storages[storageType];
36
- storage.setItem((0, exports.createStorageKey)(storagePrefix, config.key, config.namespace), formatValueToStorage(config.value));
37
- },
38
- get: (cfg) => {
39
- const config = cfg;
40
- const storageType = (config.type ?? storageConfig.type);
41
- const storagePrefix = (config.prefix ?? storageConfig.prefix);
42
- const storage = storages[storageType];
43
- return (parseStorageValue(storage.getItem((0, exports.createStorageKey)(storagePrefix, config.key, config.namespace))) ??
44
- config.fallback ??
45
- null);
46
- },
47
- };
48
- }
package/storage.d.cts DELETED
@@ -1,39 +0,0 @@
1
- export type StorageType = 'session' | 'local';
2
- export declare const createStorageKey: (prefix: string, key: string, namespace?: string) => string;
3
- export interface SetToStorageConfig<V> extends Omit<GetFromStorageConfig<V>, 'fallback'> {
4
- value: V;
5
- }
6
- export interface GetFromStorageConfig<V> {
7
- /**
8
- * Ключ по которому можно получить значение из хранилища (имя ключа не полное, оно дополняется неймпспейсом проекта)
9
- */
10
- key: string;
11
- /**
12
- * Тип хранилища
13
- */
14
- type: StorageType;
15
- /**
16
- * дефолтное значение, которое будет использоваться если значения нет в хранилище
17
- */
18
- fallback?: V;
19
- /**
20
- * Доп. делитель в ключ/utils/types'е
21
- */
22
- namespace?: string;
23
- /**
24
- * Доп. делитель
25
- */
26
- prefix?: string;
27
- }
28
- export type SetToStorageWrappedConfig<V, BaseConfig extends StorageConfigBase> = Omit<SetToStorageConfig<V>, Extract<keyof SetToStorageConfig<V>, keyof BaseConfig>> & Partial<Pick<SetToStorageConfig<V>, Extract<keyof SetToStorageConfig<V>, keyof BaseConfig>>> & Pick<BaseConfig, Exclude<keyof BaseConfig, keyof SetToStorageConfig<V>>>;
29
- export type GetFromStorageWrappedConfig<V, BaseConfig extends StorageConfigBase> = Omit<GetFromStorageConfig<V>, Extract<keyof GetFromStorageConfig<V>, keyof BaseConfig>> & Partial<Pick<GetFromStorageConfig<V>, Extract<keyof GetFromStorageConfig<V>, keyof BaseConfig>>> & Pick<BaseConfig, Exclude<keyof BaseConfig, keyof GetFromStorageConfig<V>>>;
30
- export type StorageConfigBase = Partial<Pick<GetFromStorageConfig<any>, 'prefix' | 'type'>>;
31
- export interface StorageApi<BaseConfig extends StorageConfigBase> {
32
- set<Value>(config: SetToStorageWrappedConfig<Value, BaseConfig>): void;
33
- get<Value>(config: GetFromStorageWrappedConfig<Value, BaseConfig>): Value | null;
34
- }
35
- /**
36
- * Создает интерфейс для работы с хранилищем (localStorage, sessionStorage)
37
- */
38
- export declare function createStorage<BaseConfig extends StorageConfigBase>(storageConfig: BaseConfig): StorageApi<BaseConfig>;
39
- //# sourceMappingURL=storage.d.ts.map
package/storage.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAO9C,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,YAAY,MAAM,WACsC,CAAC;AAmB3D,MAAM,WAAW,kBAAkB,CAAC,CAAC,CACnC,SAAQ,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC;CACV;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,yBAAyB,CACnC,CAAC,EACD,UAAU,SAAS,iBAAiB,IAClC,IAAI,CACN,kBAAkB,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,MAAM,kBAAkB,CAAC,CAAC,CAAC,EAAE,MAAM,UAAU,CAAC,CACvD,GACC,OAAO,CACL,IAAI,CACF,kBAAkB,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,MAAM,kBAAkB,CAAC,CAAC,CAAC,EAAE,MAAM,UAAU,CAAC,CACvD,CACF,GACD,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,UAAU,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,2BAA2B,CACrC,CAAC,EACD,UAAU,SAAS,iBAAiB,IAClC,IAAI,CACN,oBAAoB,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,EAAE,MAAM,UAAU,CAAC,CACzD,GACC,OAAO,CACL,IAAI,CACF,oBAAoB,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,EAAE,MAAM,UAAU,CAAC,CACzD,CACF,GACD,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,UAAU,EAAE,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,CACnD,CAAC;AAEF,MAAM,WAAW,UAAU,CAAC,UAAU,SAAS,iBAAiB;IAC9D,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,yBAAyB,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IACvE,GAAG,CAAC,KAAK,EACP,MAAM,EAAE,2BAA2B,CAAC,KAAK,EAAE,UAAU,CAAC,GACrD,KAAK,GAAG,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,SAAS,iBAAiB,EAChE,aAAa,EAAE,UAAU,GACxB,UAAU,CAAC,UAAU,CAAC,CAgCxB"}
package/storage.js DELETED
@@ -1,43 +0,0 @@
1
- const storages = {
2
- session: sessionStorage,
3
- local: localStorage,
4
- };
5
- export const createStorageKey = (prefix, key, namespace) => `${prefix}${namespace ? `/${namespace}` : ''}/${key}`;
6
- const parseStorageValue = (value) => {
7
- if (typeof value !== 'string') {
8
- return value;
9
- }
10
- try {
11
- const parsed = JSON.parse(value);
12
- return parsed;
13
- }
14
- catch {
15
- return null;
16
- }
17
- };
18
- const formatValueToStorage = (value) => {
19
- return JSON.stringify(value);
20
- };
21
- /**
22
- * Создает интерфейс для работы с хранилищем (localStorage, sessionStorage)
23
- */
24
- export function createStorage(storageConfig) {
25
- return {
26
- set: (cfg) => {
27
- const config = cfg;
28
- const storageType = (config.type ?? storageConfig.type);
29
- const storagePrefix = (config.prefix ?? storageConfig.prefix);
30
- const storage = storages[storageType];
31
- storage.setItem(createStorageKey(storagePrefix, config.key, config.namespace), formatValueToStorage(config.value));
32
- },
33
- get: (cfg) => {
34
- const config = cfg;
35
- const storageType = (config.type ?? storageConfig.type);
36
- const storagePrefix = (config.prefix ?? storageConfig.prefix);
37
- const storage = storages[storageType];
38
- return (parseStorageValue(storage.getItem(createStorageKey(storagePrefix, config.key, config.namespace))) ??
39
- config.fallback ??
40
- null);
41
- },
42
- };
43
- }
package/text.cjs DELETED
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitTextByLines = exports.declension = void 0;
4
- /**
5
- * Склонение слова в зависимости от количества
6
- * @example
7
- * declension(1, ['слово', 'слова', 'слов']) // 'слово'
8
- * @example
9
- * declension(2, ['слово', 'слова', 'слов']) // 'слова'
10
- * @example
11
- * declension(5, ['слово', 'слова', 'слов']) // 'слов'
12
- */
13
- const declension = (count, txt, cases = [2, 0, 1, 1, 1, 2]) => txt[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];
14
- exports.declension = declension;
15
- /**
16
- * Разбиение текста на линии
17
- */
18
- const splitTextByLines = (text, lineLingth = 60) => {
19
- const words = text.split(/\s+/).filter((word) => word !== '');
20
- const lines = [];
21
- let currentLine = '';
22
- for (const word of words) {
23
- if (word.length > lineLingth) {
24
- if (currentLine !== '') {
25
- lines.push(currentLine);
26
- currentLine = '';
27
- }
28
- let start = 0;
29
- while (start < word.length) {
30
- const chunk = word.slice(start, start + lineLingth);
31
- lines.push(chunk);
32
- start += lineLingth;
33
- }
34
- continue;
35
- }
36
- // Проверка возможности добавления слова в текущую строку
37
- if (currentLine === '') {
38
- currentLine = word;
39
- }
40
- else if (currentLine.length + 1 + word.length <= lineLingth) {
41
- currentLine += ` ${word}`;
42
- }
43
- else {
44
- lines.push(currentLine);
45
- currentLine = word;
46
- }
47
- }
48
- if (currentLine !== '' || lines.length === 0) {
49
- lines.push(currentLine);
50
- }
51
- return lines;
52
- };
53
- exports.splitTextByLines = splitTextByLines;
package/text.d.cts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Склонение слова в зависимости от количества
3
- * @example
4
- * declension(1, ['слово', 'слова', 'слов']) // 'слово'
5
- * @example
6
- * declension(2, ['слово', 'слова', 'слов']) // 'слова'
7
- * @example
8
- * declension(5, ['слово', 'слова', 'слов']) // 'слов'
9
- */
10
- export declare const declension: (count: number, txt: readonly [one: string, two: string, five: string], cases?: number[]) => string;
11
- /**
12
- * Разбиение текста на линии
13
- */
14
- export declare const splitTextByLines: (text: string, lineLingth?: number) => string[];
15
- //# sourceMappingURL=text.d.ts.map
package/text.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,MAAM,EACb,KAAK,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,EACtD,gBAA0B,WAEmD,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,aAAY,MAAW,KACtB,MAAM,EAqCR,CAAC"}