yummies 5.7.1 → 5.9.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 (434) hide show
  1. package/async.cjs +2 -70
  2. package/async.cjs.map +1 -0
  3. package/async.js +26 -59
  4. package/async.js.map +1 -0
  5. package/common.cjs +2 -18
  6. package/common.cjs.map +1 -0
  7. package/common.d.ts +1 -1
  8. package/common.d.ts.map +1 -1
  9. package/common.js +5 -13
  10. package/common.js.map +1 -0
  11. package/complex/global-config.d.ts +1 -1
  12. package/complex/global-config.d.ts.map +1 -1
  13. package/complex/index.d.ts +3 -3
  14. package/complex/index.d.ts.map +1 -1
  15. package/complex/modules-factory.d.ts +1 -1
  16. package/complex/modules-factory.d.ts.map +1 -1
  17. package/complex.cjs +2 -0
  18. package/complex.cjs.map +1 -0
  19. package/complex.js +66 -0
  20. package/complex.js.map +1 -0
  21. package/cookie.cjs +2 -13
  22. package/cookie.cjs.map +1 -0
  23. package/cookie.d.ts +1 -1
  24. package/cookie.d.ts.map +1 -1
  25. package/cookie.js +4 -8
  26. package/cookie.js.map +1 -0
  27. package/css.cjs +2 -64
  28. package/css.cjs.map +1 -0
  29. package/css.d.ts +1 -1
  30. package/css.js +24 -54
  31. package/css.js.map +1 -0
  32. package/data.cjs +2 -58
  33. package/data.cjs.map +1 -0
  34. package/data.js +32 -50
  35. package/data.js.map +1 -0
  36. package/date-time.cjs +2 -171
  37. package/date-time.cjs.map +1 -0
  38. package/date-time.d.ts +2 -3
  39. package/date-time.d.ts.map +1 -1
  40. package/date-time.js +311 -156
  41. package/date-time.js.map +1 -0
  42. package/device.cjs +2 -28
  43. package/device.cjs.map +1 -0
  44. package/device.js +23 -20
  45. package/device.js.map +1 -0
  46. package/encodings.cjs +2 -270
  47. package/encodings.cjs.map +1 -0
  48. package/encodings.js +269 -265
  49. package/encodings.js.map +1 -0
  50. package/errors.cjs +2 -34
  51. package/errors.cjs.map +1 -0
  52. package/errors.d.ts +1 -1
  53. package/errors.d.ts.map +1 -1
  54. package/errors.js +8 -29
  55. package/errors.js.map +1 -0
  56. package/file.cjs +2 -29
  57. package/file.cjs.map +1 -0
  58. package/file.js +19 -23
  59. package/file.js.map +1 -0
  60. package/format/_exports.d.ts +4 -4
  61. package/format/_exports.d.ts.map +1 -1
  62. package/format/index.d.ts +1 -1
  63. package/format/index.d.ts.map +1 -1
  64. package/format/number.d.ts +1 -1
  65. package/format/number.d.ts.map +1 -1
  66. package/format/percent.d.ts +2 -2
  67. package/format/percent.d.ts.map +1 -1
  68. package/format.cjs +2 -0
  69. package/format.cjs.map +1 -0
  70. package/format.js +27 -0
  71. package/format.js.map +1 -0
  72. package/html.cjs +2 -202
  73. package/html.cjs.map +1 -0
  74. package/html.d.ts +2 -2
  75. package/html.d.ts.map +1 -1
  76. package/html.js +120 -177
  77. package/html.js.map +1 -0
  78. package/id.cjs +3 -76
  79. package/id.cjs.map +1 -0
  80. package/id.js +15 -70
  81. package/id.js.map +1 -0
  82. package/imports.cjs +2 -45
  83. package/imports.cjs.map +1 -0
  84. package/imports.js +22 -37
  85. package/imports.js.map +1 -0
  86. package/math.cjs +2 -23
  87. package/math.cjs.map +1 -0
  88. package/math.d.ts +1 -1
  89. package/math.d.ts.map +1 -1
  90. package/math.js +10 -14
  91. package/math.js.map +1 -0
  92. package/media.cjs +2 -115
  93. package/media.cjs.map +1 -0
  94. package/media.js +54 -96
  95. package/media.js.map +1 -0
  96. package/mobx/apply-observable.d.ts +1 -1
  97. package/mobx/apply-observable.d.ts.map +1 -1
  98. package/mobx/create-enhanced-atom.d.ts +2 -2
  99. package/mobx/create-enhanced-atom.d.ts.map +1 -1
  100. package/mobx/deep-observable-struct.d.ts +1 -1
  101. package/mobx/deep-observable-struct.d.ts.map +1 -1
  102. package/mobx/get-mobx-administration.d.ts +2 -2
  103. package/mobx/get-mobx-administration.d.ts.map +1 -1
  104. package/mobx/index.d.ts +5 -5
  105. package/mobx/index.d.ts.map +1 -1
  106. package/mobx.cjs +2 -0
  107. package/mobx.cjs.map +1 -0
  108. package/mobx.js +89 -0
  109. package/mobx.js.map +1 -0
  110. package/ms.cjs +2 -22
  111. package/ms.cjs.map +1 -0
  112. package/ms.js +12 -17
  113. package/ms.js.map +1 -0
  114. package/number.cjs +2 -16
  115. package/number.cjs.map +1 -0
  116. package/number.js +9 -12
  117. package/number.js.map +1 -0
  118. package/package.json +101 -70
  119. package/parser/_exports.d.ts +3 -3
  120. package/parser/_exports.d.ts.map +1 -1
  121. package/parser/index.d.ts +1 -1
  122. package/parser/index.d.ts.map +1 -1
  123. package/parser/number.d.ts +1 -1
  124. package/parser/number.d.ts.map +1 -1
  125. package/parser/percent.d.ts +2 -2
  126. package/parser/percent.d.ts.map +1 -1
  127. package/parser/string.d.ts +1 -1
  128. package/parser/string.d.ts.map +1 -1
  129. package/parser.cjs +2 -0
  130. package/parser.cjs.map +1 -0
  131. package/parser.js +15 -0
  132. package/parser.js.map +1 -0
  133. package/price.cjs +2 -21
  134. package/price.cjs.map +1 -0
  135. package/price.js +13 -16
  136. package/price.js.map +1 -0
  137. package/random.cjs +2 -25
  138. package/random.cjs.map +1 -0
  139. package/random.js +11 -13
  140. package/random.js.map +1 -0
  141. package/react/hooks/index.d.ts +21 -21
  142. package/react/hooks/index.d.ts.map +1 -1
  143. package/react/hooks/use-click-outside.d.ts +1 -1
  144. package/react/hooks/use-define-ref.d.ts +1 -1
  145. package/react/hooks/use-element-ref.d.ts +1 -1
  146. package/react/hooks/use-event.d.ts +1 -1
  147. package/react/hooks/use-event.d.ts.map +1 -1
  148. package/react/hooks/use-initial-height.d.ts +1 -1
  149. package/react/hooks/use-last-value-ref.d.ts +1 -1
  150. package/react/hooks/use-resize-observer.d.ts +1 -1
  151. package/react/hooks/use-sync-ref.d.ts +1 -1
  152. package/react/hooks/use-toggle.d.ts +1 -1
  153. package/react/hooks/use-value.d.ts +1 -1
  154. package/react/index.d.ts +1 -1
  155. package/react/index.d.ts.map +1 -1
  156. package/react.cjs +2 -0
  157. package/react.cjs.map +1 -0
  158. package/react.js +152 -0
  159. package/react.js.map +1 -0
  160. package/sound.cjs +2 -16
  161. package/sound.cjs.map +1 -0
  162. package/sound.js +7 -11
  163. package/sound.js.map +1 -0
  164. package/text.cjs +2 -53
  165. package/text.cjs.map +1 -0
  166. package/text.js +20 -46
  167. package/text.js.map +1 -0
  168. package/type-guard/_exports.d.ts +1 -1
  169. package/type-guard/_exports.d.ts.map +1 -1
  170. package/type-guard/index.d.ts +1 -1
  171. package/type-guard/index.d.ts.map +1 -1
  172. package/type-guard.cjs +2 -0
  173. package/type-guard.cjs.map +1 -0
  174. package/type-guard.js +5 -0
  175. package/type-guard.js.map +1 -0
  176. package/utility-types.cjs +2 -0
  177. package/utility-types.cjs.map +1 -0
  178. package/utility-types.d.ts.map +1 -0
  179. package/utility-types.js +2 -0
  180. package/utility-types.js.map +1 -0
  181. package/utils/types.cjs +1 -1
  182. package/utils/types.cjs.map +1 -0
  183. package/utils/types.js +2 -1
  184. package/utils/types.js.map +1 -0
  185. package/vibrate.cjs +2 -12
  186. package/vibrate.cjs.map +1 -0
  187. package/vibrate.js +6 -7
  188. package/vibrate.js.map +1 -0
  189. package/~index-C3wKHvHr.js +80 -0
  190. package/~index-C3wKHvHr.js.map +1 -0
  191. package/~index-PKNbSTT-.js +2 -0
  192. package/~index-PKNbSTT-.js.map +1 -0
  193. package/~number-B1MpW9GU.js +2 -0
  194. package/~number-B1MpW9GU.js.map +1 -0
  195. package/~number-DX076ykA.js +2 -0
  196. package/~number-DX076ykA.js.map +1 -0
  197. package/~number-EWff2XI6.js +25 -0
  198. package/~number-EWff2XI6.js.map +1 -0
  199. package/~number-baxVnzrJ.js +32 -0
  200. package/~number-baxVnzrJ.js.map +1 -0
  201. package/async.d.cts +0 -28
  202. package/async.d.cts.map +0 -1
  203. package/common.d.cts +0 -15
  204. package/common.d.cts.map +0 -1
  205. package/complex/counter.cjs +0 -21
  206. package/complex/counter.d.cts +0 -15
  207. package/complex/counter.d.cts.map +0 -1
  208. package/complex/counter.js +0 -17
  209. package/complex/global-config.cjs +0 -46
  210. package/complex/global-config.d.cts +0 -11
  211. package/complex/global-config.d.cts.map +0 -1
  212. package/complex/global-config.js +0 -41
  213. package/complex/index.cjs +0 -19
  214. package/complex/index.d.cts +0 -4
  215. package/complex/index.d.cts.map +0 -1
  216. package/complex/index.js +0 -3
  217. package/complex/modules-factory.cjs +0 -50
  218. package/complex/modules-factory.d.cts +0 -49
  219. package/complex/modules-factory.d.cts.map +0 -1
  220. package/complex/modules-factory.js +0 -46
  221. package/cookie.d.cts +0 -3
  222. package/cookie.d.cts.map +0 -1
  223. package/css.d.cts +0 -42
  224. package/css.d.cts.map +0 -1
  225. package/data.d.cts +0 -4
  226. package/data.d.cts.map +0 -1
  227. package/date-time.d.cts +0 -28
  228. package/date-time.d.cts.map +0 -1
  229. package/device.d.cts +0 -8
  230. package/device.d.cts.map +0 -1
  231. package/encodings.d.cts +0 -2
  232. package/encodings.d.cts.map +0 -1
  233. package/errors.d.cts +0 -19
  234. package/errors.d.cts.map +0 -1
  235. package/file.d.cts +0 -3
  236. package/file.d.cts.map +0 -1
  237. package/format/_exports.cjs +0 -20
  238. package/format/_exports.d.cts +0 -5
  239. package/format/_exports.d.cts.map +0 -1
  240. package/format/_exports.js +0 -4
  241. package/format/constants.cjs +0 -6
  242. package/format/constants.d.cts +0 -4
  243. package/format/constants.d.cts.map +0 -1
  244. package/format/constants.js +0 -3
  245. package/format/index.cjs +0 -40
  246. package/format/index.d.cts +0 -3
  247. package/format/index.d.cts.map +0 -1
  248. package/format/index.js +0 -4
  249. package/format/number.cjs +0 -48
  250. package/format/number.d.cts +0 -36
  251. package/format/number.d.cts.map +0 -1
  252. package/format/number.js +0 -44
  253. package/format/percent.cjs +0 -27
  254. package/format/percent.d.cts +0 -15
  255. package/format/percent.d.cts.map +0 -1
  256. package/format/percent.js +0 -23
  257. package/format/skip-spaces.cjs +0 -8
  258. package/format/skip-spaces.d.cts +0 -5
  259. package/format/skip-spaces.d.cts.map +0 -1
  260. package/format/skip-spaces.js +0 -4
  261. package/html.d.cts +0 -44
  262. package/html.d.cts.map +0 -1
  263. package/id.d.cts +0 -63
  264. package/id.d.cts.map +0 -1
  265. package/imports.d.cts +0 -15
  266. package/imports.d.cts.map +0 -1
  267. package/math.d.cts +0 -13
  268. package/math.d.cts.map +0 -1
  269. package/media.d.cts +0 -20
  270. package/media.d.cts.map +0 -1
  271. package/mobx/apply-observable.cjs +0 -16
  272. package/mobx/apply-observable.d.cts +0 -4
  273. package/mobx/apply-observable.d.cts.map +0 -1
  274. package/mobx/apply-observable.js +0 -12
  275. package/mobx/create-enhanced-atom.cjs +0 -16
  276. package/mobx/create-enhanced-atom.d.cts +0 -11
  277. package/mobx/create-enhanced-atom.d.cts.map +0 -1
  278. package/mobx/create-enhanced-atom.js +0 -12
  279. package/mobx/deep-observable-struct.cjs +0 -61
  280. package/mobx/deep-observable-struct.d.cts +0 -7
  281. package/mobx/deep-observable-struct.d.cts.map +0 -1
  282. package/mobx/deep-observable-struct.js +0 -57
  283. package/mobx/get-mobx-administration.cjs +0 -6
  284. package/mobx/get-mobx-administration.d.cts +0 -6
  285. package/mobx/get-mobx-administration.d.cts.map +0 -1
  286. package/mobx/get-mobx-administration.js +0 -2
  287. package/mobx/index.cjs +0 -21
  288. package/mobx/index.d.cts +0 -6
  289. package/mobx/index.d.cts.map +0 -1
  290. package/mobx/index.js +0 -5
  291. package/mobx/lazy-observe.cjs +0 -66
  292. package/mobx/lazy-observe.d.cts +0 -14
  293. package/mobx/lazy-observe.d.cts.map +0 -1
  294. package/mobx/lazy-observe.js +0 -62
  295. package/ms.d.cts +0 -19
  296. package/ms.d.cts.map +0 -1
  297. package/number.d.cts +0 -8
  298. package/number.d.cts.map +0 -1
  299. package/parser/_exports.cjs +0 -19
  300. package/parser/_exports.d.cts +0 -4
  301. package/parser/_exports.d.cts.map +0 -1
  302. package/parser/_exports.js +0 -3
  303. package/parser/index.cjs +0 -40
  304. package/parser/index.d.cts +0 -3
  305. package/parser/index.d.cts.map +0 -1
  306. package/parser/index.js +0 -4
  307. package/parser/number.cjs +0 -48
  308. package/parser/number.d.cts +0 -21
  309. package/parser/number.d.cts.map +0 -1
  310. package/parser/number.js +0 -44
  311. package/parser/percent.cjs +0 -8
  312. package/parser/percent.d.cts +0 -4
  313. package/parser/percent.d.cts.map +0 -1
  314. package/parser/percent.js +0 -4
  315. package/parser/string.cjs +0 -18
  316. package/parser/string.d.cts +0 -7
  317. package/parser/string.d.cts.map +0 -1
  318. package/parser/string.js +0 -14
  319. package/price.d.cts +0 -6
  320. package/price.d.cts.map +0 -1
  321. package/random.d.cts +0 -9
  322. package/random.d.cts.map +0 -1
  323. package/react/hooks/index.cjs +0 -37
  324. package/react/hooks/index.d.cts +0 -22
  325. package/react/hooks/index.d.cts.map +0 -1
  326. package/react/hooks/index.js +0 -21
  327. package/react/hooks/use-abort-controller.cjs +0 -15
  328. package/react/hooks/use-abort-controller.d.cts +0 -2
  329. package/react/hooks/use-abort-controller.d.cts.map +0 -1
  330. package/react/hooks/use-abort-controller.js +0 -11
  331. package/react/hooks/use-abort-signal.cjs +0 -8
  332. package/react/hooks/use-abort-signal.d.cts +0 -2
  333. package/react/hooks/use-abort-signal.d.cts.map +0 -1
  334. package/react/hooks/use-abort-signal.js +0 -4
  335. package/react/hooks/use-click-outside.cjs +0 -17
  336. package/react/hooks/use-click-outside.d.cts +0 -9
  337. package/react/hooks/use-click-outside.d.cts.map +0 -1
  338. package/react/hooks/use-click-outside.js +0 -13
  339. package/react/hooks/use-constant.cjs +0 -19
  340. package/react/hooks/use-constant.d.cts +0 -9
  341. package/react/hooks/use-constant.d.cts.map +0 -1
  342. package/react/hooks/use-constant.js +0 -15
  343. package/react/hooks/use-define-ref.cjs +0 -19
  344. package/react/hooks/use-define-ref.d.cts +0 -10
  345. package/react/hooks/use-define-ref.d.cts.map +0 -1
  346. package/react/hooks/use-define-ref.js +0 -15
  347. package/react/hooks/use-element-ref.cjs +0 -12
  348. package/react/hooks/use-element-ref.d.cts +0 -2
  349. package/react/hooks/use-element-ref.d.cts.map +0 -1
  350. package/react/hooks/use-element-ref.js +0 -8
  351. package/react/hooks/use-event-listener.cjs +0 -17
  352. package/react/hooks/use-event-listener.d.cts +0 -8
  353. package/react/hooks/use-event-listener.d.cts.map +0 -1
  354. package/react/hooks/use-event-listener.js +0 -13
  355. package/react/hooks/use-event.cjs +0 -23
  356. package/react/hooks/use-event.d.cts +0 -3
  357. package/react/hooks/use-event.d.cts.map +0 -1
  358. package/react/hooks/use-event.js +0 -19
  359. package/react/hooks/use-flag.cjs +0 -19
  360. package/react/hooks/use-flag.d.cts +0 -8
  361. package/react/hooks/use-flag.d.cts.map +0 -1
  362. package/react/hooks/use-flag.js +0 -15
  363. package/react/hooks/use-force-update.cjs +0 -11
  364. package/react/hooks/use-force-update.d.cts +0 -2
  365. package/react/hooks/use-force-update.d.cts.map +0 -1
  366. package/react/hooks/use-force-update.js +0 -7
  367. package/react/hooks/use-initial-height.cjs +0 -15
  368. package/react/hooks/use-initial-height.d.cts +0 -5
  369. package/react/hooks/use-initial-height.d.cts.map +0 -1
  370. package/react/hooks/use-initial-height.js +0 -11
  371. package/react/hooks/use-instance.cjs +0 -31
  372. package/react/hooks/use-instance.d.cts +0 -27
  373. package/react/hooks/use-instance.d.cts.map +0 -1
  374. package/react/hooks/use-instance.js +0 -27
  375. package/react/hooks/use-intersection-observer.cjs +0 -14
  376. package/react/hooks/use-intersection-observer.d.cts +0 -2
  377. package/react/hooks/use-intersection-observer.d.cts.map +0 -1
  378. package/react/hooks/use-intersection-observer.js +0 -10
  379. package/react/hooks/use-last-defined-value.cjs +0 -12
  380. package/react/hooks/use-last-defined-value.d.cts +0 -2
  381. package/react/hooks/use-last-defined-value.d.cts.map +0 -1
  382. package/react/hooks/use-last-defined-value.js +0 -8
  383. package/react/hooks/use-last-value-ref.cjs +0 -12
  384. package/react/hooks/use-last-value-ref.d.cts +0 -2
  385. package/react/hooks/use-last-value-ref.d.cts.map +0 -1
  386. package/react/hooks/use-last-value-ref.js +0 -8
  387. package/react/hooks/use-life-cycle.cjs +0 -14
  388. package/react/hooks/use-life-cycle.d.cts +0 -5
  389. package/react/hooks/use-life-cycle.d.cts.map +0 -1
  390. package/react/hooks/use-life-cycle.js +0 -10
  391. package/react/hooks/use-resize-observer.cjs +0 -15
  392. package/react/hooks/use-resize-observer.d.cts +0 -2
  393. package/react/hooks/use-resize-observer.d.cts.map +0 -1
  394. package/react/hooks/use-resize-observer.js +0 -11
  395. package/react/hooks/use-sync-ref.cjs +0 -10
  396. package/react/hooks/use-sync-ref.d.cts +0 -2
  397. package/react/hooks/use-sync-ref.d.cts.map +0 -1
  398. package/react/hooks/use-sync-ref.js +0 -6
  399. package/react/hooks/use-toggle.cjs +0 -10
  400. package/react/hooks/use-toggle.d.cts +0 -2
  401. package/react/hooks/use-toggle.d.cts.map +0 -1
  402. package/react/hooks/use-toggle.js +0 -6
  403. package/react/hooks/use-value.cjs +0 -12
  404. package/react/hooks/use-value.d.cts +0 -5
  405. package/react/hooks/use-value.d.cts.map +0 -1
  406. package/react/hooks/use-value.js +0 -8
  407. package/react/hooks/use-visibility-state.cjs +0 -18
  408. package/react/hooks/use-visibility-state.d.cts +0 -2
  409. package/react/hooks/use-visibility-state.d.cts.map +0 -1
  410. package/react/hooks/use-visibility-state.js +0 -14
  411. package/react/index.cjs +0 -17
  412. package/react/index.d.cts +0 -2
  413. package/react/index.d.cts.map +0 -1
  414. package/react/index.js +0 -1
  415. package/sound.d.cts +0 -7
  416. package/sound.d.cts.map +0 -1
  417. package/storage.cjs +0 -48
  418. package/storage.d.cts +0 -39
  419. package/storage.d.cts.map +0 -1
  420. package/storage.js +0 -43
  421. package/text.d.cts +0 -15
  422. package/text.d.cts.map +0 -1
  423. package/type-guard/_exports.cjs +0 -129
  424. package/type-guard/_exports.d.cts +0 -86
  425. package/type-guard/_exports.d.cts.map +0 -1
  426. package/type-guard/_exports.js +0 -125
  427. package/type-guard/index.cjs +0 -40
  428. package/type-guard/index.d.cts +0 -3
  429. package/type-guard/index.d.cts.map +0 -1
  430. package/type-guard/index.js +0 -4
  431. package/utils/types.d.cts +0 -395
  432. package/utils/types.d.cts.map +0 -1
  433. package/vibrate.d.cts +0 -5
  434. package/vibrate.d.cts.map +0 -1
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.skipSpaces = void 0;
4
- /**
5
- * Removes all spaces in string
6
- */
7
- const skipSpaces = (value) => value.replaceAll(/\s/g, '');
8
- exports.skipSpaces = skipSpaces;
@@ -1,5 +0,0 @@
1
- /**
2
- * Removes all spaces in string
3
- */
4
- export declare const skipSpaces: (value: string) => string;
5
- //# sourceMappingURL=skip-spaces.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skip-spaces.d.ts","sourceRoot":"","sources":["../../src/format/skip-spaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,WAAgC,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Removes all spaces in string
3
- */
4
- export const skipSpaces = (value) => value.replaceAll(/\s/g, '');
package/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
package/html.d.cts.map DELETED
@@ -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"}
package/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/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/imports.d.cts DELETED
@@ -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
package/imports.d.cts.map DELETED
@@ -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/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
package/math.d.cts.map DELETED
@@ -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"}
package/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
package/media.d.cts.map DELETED
@@ -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
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-observable.d.ts","sourceRoot":"","sources":["../../src/mobx/apply-observable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,2BAA0B;AAEnD,MAAM,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;AAEzD,eAAO,MAAM,eAAe,GAC1B,SAAS,SAAS,EAClB,kBAAkB,0BAA0B,EAC5C,gBAAgB,OAAO,SAWxB,CAAC"}
@@ -1,12 +0,0 @@
1
- import { makeObservable } from 'mobx';
2
- export const applyObservable = (context, annotationsArray, useDecorators) => {
3
- if (useDecorators) {
4
- annotationsArray.forEach(([field, annotation]) => {
5
- annotation(context, field);
6
- });
7
- makeObservable(context);
8
- }
9
- else {
10
- makeObservable(context, Object.fromEntries(annotationsArray));
11
- }
12
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createEnhancedAtom = void 0;
4
- const mobx_1 = require("mobx");
5
- /**
6
- * Creates an enhanced atom with meta data
7
- * And bind `reportChanged` and `reportObserved` method to the atom
8
- */
9
- const createEnhancedAtom = (name, onBecomeObservedHandler, onBecomeUnobservedHandler, meta) => {
10
- const atom = (0, mobx_1.createAtom)(name, onBecomeObservedHandler && (() => onBecomeObservedHandler?.(atom)), onBecomeUnobservedHandler && (() => onBecomeUnobservedHandler?.(atom)));
11
- atom.meta = meta ?? {};
12
- atom.reportChanged = atom.reportChanged.bind(atom);
13
- atom.reportObserved = atom.reportObserved.bind(atom);
14
- return atom;
15
- };
16
- exports.createEnhancedAtom = createEnhancedAtom;
@@ -1,11 +0,0 @@
1
- import { type IAtom } from 'mobx';
2
- import type { AnyObject } from "../utils/types.cjs";
3
- export interface IEnhancedAtom<TMeta extends AnyObject = AnyObject> extends IAtom {
4
- meta: TMeta;
5
- }
6
- /**
7
- * Creates an enhanced atom with meta data
8
- * And bind `reportChanged` and `reportObserved` method to the atom
9
- */
10
- export declare const createEnhancedAtom: <TMeta extends AnyObject>(name: string, onBecomeObservedHandler?: (atom: IEnhancedAtom<TMeta>) => void, onBecomeUnobservedHandler?: (atom: IEnhancedAtom<TMeta>) => void, meta?: TMeta) => IEnhancedAtom<TMeta>;
11
- //# sourceMappingURL=create-enhanced-atom.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-enhanced-atom.d.ts","sourceRoot":"","sources":["../../src/mobx/create-enhanced-atom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,2BAA0B;AAEnD,MAAM,WAAW,aAAa,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,CAChE,SAAQ,KAAK;IACb,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,SAAS,SAAS,EACxD,MAAM,MAAM,EACZ,0BAA0B,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,IAAI,EAC9D,4BAA4B,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,IAAI,EAChE,OAAO,KAAK,KACX,aAAa,CAAC,KAAK,CAUrB,CAAC"}
@@ -1,12 +0,0 @@
1
- import { createAtom } from 'mobx';
2
- /**
3
- * Creates an enhanced atom with meta data
4
- * And bind `reportChanged` and `reportObserved` method to the atom
5
- */
6
- export const createEnhancedAtom = (name, onBecomeObservedHandler, onBecomeUnobservedHandler, meta) => {
7
- const atom = createAtom(name, onBecomeObservedHandler && (() => onBecomeObservedHandler?.(atom)), onBecomeUnobservedHandler && (() => onBecomeUnobservedHandler?.(atom)));
8
- atom.meta = meta ?? {};
9
- atom.reportChanged = atom.reportChanged.bind(atom);
10
- atom.reportObserved = atom.reportObserved.bind(atom);
11
- return atom;
12
- };
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeepObservableStruct = void 0;
4
- const mobx_1 = require("mobx");
5
- const index_js_1 = require("../type-guard/index.cjs");
6
- class DeepObservableStruct {
7
- data;
8
- constructor(data) {
9
- this.data = data;
10
- (0, mobx_1.makeObservable)(this, {
11
- data: mobx_1.observable.deep,
12
- set: mobx_1.action,
13
- });
14
- }
15
- set(newData) {
16
- const stack = Object.keys(this.data).map((key) => [
17
- key,
18
- this.data,
19
- newData,
20
- ]);
21
- let currentIndex = 0;
22
- let stackLength = stack.length;
23
- while (currentIndex < stackLength) {
24
- const [key, currObservableData, newData] = stack[currentIndex];
25
- const newValue = newData[key];
26
- const currValue = currObservableData[key];
27
- currentIndex++;
28
- if (key in newData) {
29
- if (index_js_1.typeGuard.isObject(newValue) && index_js_1.typeGuard.isObject(currValue)) {
30
- const newValueKeys = Object.keys(newValue);
31
- Object.keys(currValue).forEach((childKey) => {
32
- if (!(childKey in newValue)) {
33
- delete currObservableData[key][childKey];
34
- }
35
- });
36
- newValueKeys.forEach((childKey) => {
37
- const length = stack.push([
38
- childKey,
39
- currObservableData[key],
40
- newValue,
41
- ]);
42
- stackLength = length;
43
- });
44
- }
45
- else if (newValue !== currValue) {
46
- currObservableData[key] = newValue;
47
- }
48
- }
49
- else {
50
- delete currObservableData[key];
51
- }
52
- }
53
- Object.keys(newData).forEach((newDataKey) => {
54
- if (!this.data[newDataKey]) {
55
- // @ts-expect-error
56
- this.data[newDataKey] = newData[newDataKey];
57
- }
58
- });
59
- }
60
- }
61
- exports.DeepObservableStruct = DeepObservableStruct;
@@ -1,7 +0,0 @@
1
- import type { AnyObject } from "../utils/types.cjs";
2
- export declare class DeepObservableStruct<TData extends AnyObject> {
3
- data: TData;
4
- constructor(data: TData);
5
- set(newData: Partial<TData>): void;
6
- }
7
- //# sourceMappingURL=deep-observable-struct.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deep-observable-struct.d.ts","sourceRoot":"","sources":["../../src/mobx/deep-observable-struct.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,2BAA0B;AAEnD,qBAAa,oBAAoB,CAAC,KAAK,SAAS,SAAS;IACvD,IAAI,EAAE,KAAK,CAAC;gBAEA,IAAI,EAAE,KAAK;IASvB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAoD5B"}
@@ -1,57 +0,0 @@
1
- import { action, makeObservable, observable } from 'mobx';
2
- import { typeGuard } from "../type-guard/index.js";
3
- export class DeepObservableStruct {
4
- data;
5
- constructor(data) {
6
- this.data = data;
7
- makeObservable(this, {
8
- data: observable.deep,
9
- set: action,
10
- });
11
- }
12
- set(newData) {
13
- const stack = Object.keys(this.data).map((key) => [
14
- key,
15
- this.data,
16
- newData,
17
- ]);
18
- let currentIndex = 0;
19
- let stackLength = stack.length;
20
- while (currentIndex < stackLength) {
21
- const [key, currObservableData, newData] = stack[currentIndex];
22
- const newValue = newData[key];
23
- const currValue = currObservableData[key];
24
- currentIndex++;
25
- if (key in newData) {
26
- if (typeGuard.isObject(newValue) && typeGuard.isObject(currValue)) {
27
- const newValueKeys = Object.keys(newValue);
28
- Object.keys(currValue).forEach((childKey) => {
29
- if (!(childKey in newValue)) {
30
- delete currObservableData[key][childKey];
31
- }
32
- });
33
- newValueKeys.forEach((childKey) => {
34
- const length = stack.push([
35
- childKey,
36
- currObservableData[key],
37
- newValue,
38
- ]);
39
- stackLength = length;
40
- });
41
- }
42
- else if (newValue !== currValue) {
43
- currObservableData[key] = newValue;
44
- }
45
- }
46
- else {
47
- delete currObservableData[key];
48
- }
49
- }
50
- Object.keys(newData).forEach((newDataKey) => {
51
- if (!this.data[newDataKey]) {
52
- // @ts-expect-error
53
- this.data[newDataKey] = newData[newDataKey];
54
- }
55
- });
56
- }
57
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMobxAdministration = void 0;
4
- const mobx_1 = require("mobx");
5
- const getMobxAdministration = (context) => context[mobx_1.$mobx];
6
- exports.getMobxAdministration = getMobxAdministration;
@@ -1,6 +0,0 @@
1
- import { type AnnotationMapEntry } from 'mobx';
2
- import type { AnyObject } from "../utils/types.cjs";
3
- type ObservableObjectAdministration = Parameters<Exclude<AnnotationMapEntry, boolean>['make_']>[0];
4
- export declare const getMobxAdministration: (context: AnyObject) => ObservableObjectAdministration;
5
- export {};
6
- //# sourceMappingURL=get-mobx-administration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-mobx-administration.d.ts","sourceRoot":"","sources":["../../src/mobx/get-mobx-administration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,kBAAkB,EAAE,MAAM,MAAM,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,2BAA0B;AAEnD,KAAK,8BAA8B,GAAG,UAAU,CAC9C,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAC9C,CAAC,CAAC,CAAC,CAAC;AAEL,eAAO,MAAM,qBAAqB,GAChC,SAAS,SAAS,KACjB,8BAAgD,CAAC"}
@@ -1,2 +0,0 @@
1
- import { $mobx } from 'mobx';
2
- export const getMobxAdministration = (context) => context[$mobx];
package/mobx/index.cjs DELETED
@@ -1,21 +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("./apply-observable.cjs"), exports);
18
- __exportStar(require("./create-enhanced-atom.cjs"), exports);
19
- __exportStar(require("./deep-observable-struct.cjs"), exports);
20
- __exportStar(require("./get-mobx-administration.cjs"), exports);
21
- __exportStar(require("./lazy-observe.cjs"), exports);
package/mobx/index.d.cts DELETED
@@ -1,6 +0,0 @@
1
- export * from "./apply-observable.cjs";
2
- export * from "./create-enhanced-atom.cjs";
3
- export * from "./deep-observable-struct.cjs";
4
- export * from "./get-mobx-administration.cjs";
5
- export * from "./lazy-observe.cjs";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mobx/index.ts"],"names":[],"mappings":"AAAA,uCAAsC;AACtC,2CAA0C;AAC1C,6CAA4C;AAC5C,8CAA6C;AAC7C,mCAAkC"}
package/mobx/index.js DELETED
@@ -1,5 +0,0 @@
1
- export * from "./apply-observable.js";
2
- export * from "./create-enhanced-atom.js";
3
- export * from "./deep-observable-struct.js";
4
- export * from "./get-mobx-administration.js";
5
- export * from "./lazy-observe.js";
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lazyObserve = void 0;
4
- const mobx_1 = require("mobx");
5
- /**
6
- * When ONE OF the properties is becomes observed then `onStart` function is called.
7
- * WHen ALL properties are unobserved then `onEnd` function is called with the `metaData` that was returned by `onStart`.
8
- *
9
- * It uses `onBecomeObserved` and `onBecomeUnobserved` mobx hooks to perform lazy observation.
10
- */
11
- const lazyObserve = ({ context, property, onStart, onEnd, endDelay = false, }) => {
12
- let timeoutId;
13
- let metaData;
14
- const observingProps = new Set();
15
- const properties = Array.isArray(property) ? property : [property];
16
- const cleanup = () => {
17
- observingProps.clear();
18
- if (endDelay === false) {
19
- onEnd?.(metaData, cleanup);
20
- metaData = undefined;
21
- return;
22
- }
23
- if (timeoutId) {
24
- clearTimeout(timeoutId);
25
- timeoutId = undefined;
26
- }
27
- timeoutId = setTimeout(() => {
28
- onEnd?.(metaData, cleanup);
29
- timeoutId = undefined;
30
- metaData = undefined;
31
- }, endDelay);
32
- };
33
- const start = (property) => {
34
- const isAlreadyObserving = observingProps.size > 0;
35
- observingProps.add(property);
36
- if (isAlreadyObserving) {
37
- return;
38
- }
39
- if (timeoutId) {
40
- clearTimeout(timeoutId);
41
- timeoutId = undefined;
42
- }
43
- metaData = onStart?.();
44
- };
45
- const stop = (property) => {
46
- const isAlreadyNotObserving = !observingProps.size;
47
- observingProps.delete(property);
48
- const isObserving = observingProps.size > 0;
49
- if (isAlreadyNotObserving || isObserving) {
50
- return;
51
- }
52
- cleanup();
53
- };
54
- properties.forEach((property) => {
55
- if (context) {
56
- (0, mobx_1.onBecomeObserved)(context, property, () => start(property));
57
- (0, mobx_1.onBecomeUnobserved)(context, property, () => stop(property));
58
- }
59
- else {
60
- (0, mobx_1.onBecomeObserved)(property, () => start(property));
61
- (0, mobx_1.onBecomeUnobserved)(property, () => stop(property));
62
- }
63
- });
64
- return cleanup;
65
- };
66
- exports.lazyObserve = lazyObserve;
@@ -1,14 +0,0 @@
1
- /**
2
- * When ONE OF the properties is becomes observed then `onStart` function is called.
3
- * WHen ALL properties are unobserved then `onEnd` function is called with the `metaData` that was returned by `onStart`.
4
- *
5
- * It uses `onBecomeObserved` and `onBecomeUnobserved` mobx hooks to perform lazy observation.
6
- */
7
- export declare const lazyObserve: <TMetaData = void>({ context, property, onStart, onEnd, endDelay, }: {
8
- context?: any;
9
- property: any | any[];
10
- onStart?: () => TMetaData;
11
- onEnd?: (metaData: TMetaData, cleanupFn: VoidFunction) => void;
12
- endDelay?: number | false;
13
- }) => () => void;
14
- //# sourceMappingURL=lazy-observe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lazy-observe.d.ts","sourceRoot":"","sources":["../../src/mobx/lazy-observe.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,GAAG,IAAI,EAAE,kDAM3C;IACD,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC3B,eAoEA,CAAC"}
@@ -1,62 +0,0 @@
1
- import { onBecomeObserved, onBecomeUnobserved } from 'mobx';
2
- /**
3
- * When ONE OF the properties is becomes observed then `onStart` function is called.
4
- * WHen ALL properties are unobserved then `onEnd` function is called with the `metaData` that was returned by `onStart`.
5
- *
6
- * It uses `onBecomeObserved` and `onBecomeUnobserved` mobx hooks to perform lazy observation.
7
- */
8
- export const lazyObserve = ({ context, property, onStart, onEnd, endDelay = false, }) => {
9
- let timeoutId;
10
- let metaData;
11
- const observingProps = new Set();
12
- const properties = Array.isArray(property) ? property : [property];
13
- const cleanup = () => {
14
- observingProps.clear();
15
- if (endDelay === false) {
16
- onEnd?.(metaData, cleanup);
17
- metaData = undefined;
18
- return;
19
- }
20
- if (timeoutId) {
21
- clearTimeout(timeoutId);
22
- timeoutId = undefined;
23
- }
24
- timeoutId = setTimeout(() => {
25
- onEnd?.(metaData, cleanup);
26
- timeoutId = undefined;
27
- metaData = undefined;
28
- }, endDelay);
29
- };
30
- const start = (property) => {
31
- const isAlreadyObserving = observingProps.size > 0;
32
- observingProps.add(property);
33
- if (isAlreadyObserving) {
34
- return;
35
- }
36
- if (timeoutId) {
37
- clearTimeout(timeoutId);
38
- timeoutId = undefined;
39
- }
40
- metaData = onStart?.();
41
- };
42
- const stop = (property) => {
43
- const isAlreadyNotObserving = !observingProps.size;
44
- observingProps.delete(property);
45
- const isObserving = observingProps.size > 0;
46
- if (isAlreadyNotObserving || isObserving) {
47
- return;
48
- }
49
- cleanup();
50
- };
51
- properties.forEach((property) => {
52
- if (context) {
53
- onBecomeObserved(context, property, () => start(property));
54
- onBecomeUnobserved(context, property, () => stop(property));
55
- }
56
- else {
57
- onBecomeObserved(property, () => start(property));
58
- onBecomeUnobserved(property, () => stop(property));
59
- }
60
- });
61
- return cleanup;
62
- };