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.
- package/async.cjs +2 -70
- package/async.cjs.map +1 -0
- package/async.js +26 -59
- package/async.js.map +1 -0
- package/common.cjs +2 -18
- package/common.cjs.map +1 -0
- package/common.d.ts +1 -1
- package/common.d.ts.map +1 -1
- package/common.js +5 -13
- package/common.js.map +1 -0
- package/complex/global-config.d.ts +1 -1
- package/complex/global-config.d.ts.map +1 -1
- package/complex/index.d.ts +3 -3
- package/complex/index.d.ts.map +1 -1
- package/complex/modules-factory.d.ts +1 -1
- package/complex/modules-factory.d.ts.map +1 -1
- package/complex.cjs +2 -0
- package/complex.cjs.map +1 -0
- package/complex.js +66 -0
- package/complex.js.map +1 -0
- package/cookie.cjs +2 -13
- package/cookie.cjs.map +1 -0
- package/cookie.d.ts +1 -1
- package/cookie.d.ts.map +1 -1
- package/cookie.js +4 -8
- package/cookie.js.map +1 -0
- package/css.cjs +2 -64
- package/css.cjs.map +1 -0
- package/css.d.ts +1 -1
- package/css.js +24 -54
- package/css.js.map +1 -0
- package/data.cjs +2 -58
- package/data.cjs.map +1 -0
- package/data.js +32 -50
- package/data.js.map +1 -0
- package/date-time.cjs +2 -171
- package/date-time.cjs.map +1 -0
- package/date-time.d.ts +2 -3
- package/date-time.d.ts.map +1 -1
- package/date-time.js +311 -156
- package/date-time.js.map +1 -0
- package/device.cjs +2 -28
- package/device.cjs.map +1 -0
- package/device.js +23 -20
- package/device.js.map +1 -0
- package/encodings.cjs +2 -270
- package/encodings.cjs.map +1 -0
- package/encodings.js +269 -265
- package/encodings.js.map +1 -0
- package/errors.cjs +2 -34
- package/errors.cjs.map +1 -0
- package/errors.d.ts +1 -1
- package/errors.d.ts.map +1 -1
- package/errors.js +8 -29
- package/errors.js.map +1 -0
- package/file.cjs +2 -29
- package/file.cjs.map +1 -0
- package/file.js +19 -23
- package/file.js.map +1 -0
- package/format/_exports.d.ts +4 -4
- package/format/_exports.d.ts.map +1 -1
- package/format/index.d.ts +1 -1
- package/format/index.d.ts.map +1 -1
- package/format/number.d.ts +1 -1
- package/format/number.d.ts.map +1 -1
- package/format/percent.d.ts +2 -2
- package/format/percent.d.ts.map +1 -1
- package/format.cjs +2 -0
- package/format.cjs.map +1 -0
- package/format.js +27 -0
- package/format.js.map +1 -0
- package/html.cjs +2 -202
- package/html.cjs.map +1 -0
- package/html.d.ts +2 -2
- package/html.d.ts.map +1 -1
- package/html.js +120 -177
- package/html.js.map +1 -0
- package/id.cjs +3 -76
- package/id.cjs.map +1 -0
- package/id.js +15 -70
- package/id.js.map +1 -0
- package/imports.cjs +2 -45
- package/imports.cjs.map +1 -0
- package/imports.js +22 -37
- package/imports.js.map +1 -0
- package/math.cjs +2 -23
- package/math.cjs.map +1 -0
- package/math.d.ts +1 -1
- package/math.d.ts.map +1 -1
- package/math.js +10 -14
- package/math.js.map +1 -0
- package/media.cjs +2 -115
- package/media.cjs.map +1 -0
- package/media.js +54 -96
- package/media.js.map +1 -0
- package/mobx/apply-observable.d.ts +1 -1
- package/mobx/apply-observable.d.ts.map +1 -1
- package/mobx/create-enhanced-atom.d.ts +2 -2
- package/mobx/create-enhanced-atom.d.ts.map +1 -1
- package/mobx/deep-observable-struct.d.ts +1 -1
- package/mobx/deep-observable-struct.d.ts.map +1 -1
- package/mobx/get-mobx-administration.d.ts +2 -2
- package/mobx/get-mobx-administration.d.ts.map +1 -1
- package/mobx/index.d.ts +5 -5
- package/mobx/index.d.ts.map +1 -1
- package/mobx.cjs +2 -0
- package/mobx.cjs.map +1 -0
- package/mobx.js +89 -0
- package/mobx.js.map +1 -0
- package/ms.cjs +2 -22
- package/ms.cjs.map +1 -0
- package/ms.js +12 -17
- package/ms.js.map +1 -0
- package/number.cjs +2 -16
- package/number.cjs.map +1 -0
- package/number.js +9 -12
- package/number.js.map +1 -0
- package/package.json +101 -70
- package/parser/_exports.d.ts +3 -3
- package/parser/_exports.d.ts.map +1 -1
- package/parser/index.d.ts +1 -1
- package/parser/index.d.ts.map +1 -1
- package/parser/number.d.ts +1 -1
- package/parser/number.d.ts.map +1 -1
- package/parser/percent.d.ts +2 -2
- package/parser/percent.d.ts.map +1 -1
- package/parser/string.d.ts +1 -1
- package/parser/string.d.ts.map +1 -1
- package/parser.cjs +2 -0
- package/parser.cjs.map +1 -0
- package/parser.js +15 -0
- package/parser.js.map +1 -0
- package/price.cjs +2 -21
- package/price.cjs.map +1 -0
- package/price.js +13 -16
- package/price.js.map +1 -0
- package/random.cjs +2 -25
- package/random.cjs.map +1 -0
- package/random.js +11 -13
- package/random.js.map +1 -0
- package/react/hooks/index.d.ts +21 -21
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/use-click-outside.d.ts +1 -1
- package/react/hooks/use-define-ref.d.ts +1 -1
- package/react/hooks/use-element-ref.d.ts +1 -1
- package/react/hooks/use-event.d.ts +1 -1
- package/react/hooks/use-event.d.ts.map +1 -1
- package/react/hooks/use-initial-height.d.ts +1 -1
- package/react/hooks/use-last-value-ref.d.ts +1 -1
- package/react/hooks/use-resize-observer.d.ts +1 -1
- package/react/hooks/use-sync-ref.d.ts +1 -1
- package/react/hooks/use-toggle.d.ts +1 -1
- package/react/hooks/use-value.d.ts +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.d.ts.map +1 -1
- package/react.cjs +2 -0
- package/react.cjs.map +1 -0
- package/react.js +152 -0
- package/react.js.map +1 -0
- package/sound.cjs +2 -16
- package/sound.cjs.map +1 -0
- package/sound.js +7 -11
- package/sound.js.map +1 -0
- package/text.cjs +2 -53
- package/text.cjs.map +1 -0
- package/text.js +20 -46
- package/text.js.map +1 -0
- package/type-guard/_exports.d.ts +1 -1
- package/type-guard/_exports.d.ts.map +1 -1
- package/type-guard/index.d.ts +1 -1
- package/type-guard/index.d.ts.map +1 -1
- package/type-guard.cjs +2 -0
- package/type-guard.cjs.map +1 -0
- package/type-guard.js +5 -0
- package/type-guard.js.map +1 -0
- package/utility-types.cjs +2 -0
- package/utility-types.cjs.map +1 -0
- package/utility-types.d.ts.map +1 -0
- package/utility-types.js +2 -0
- package/utility-types.js.map +1 -0
- package/utils/types.cjs +1 -1
- package/utils/types.cjs.map +1 -0
- package/utils/types.js +2 -1
- package/utils/types.js.map +1 -0
- package/vibrate.cjs +2 -12
- package/vibrate.cjs.map +1 -0
- package/vibrate.js +6 -7
- package/vibrate.js.map +1 -0
- package/~index-C3wKHvHr.js +80 -0
- package/~index-C3wKHvHr.js.map +1 -0
- package/~index-PKNbSTT-.js +2 -0
- package/~index-PKNbSTT-.js.map +1 -0
- package/~number-B1MpW9GU.js +2 -0
- package/~number-B1MpW9GU.js.map +1 -0
- package/~number-DX076ykA.js +2 -0
- package/~number-DX076ykA.js.map +1 -0
- package/~number-EWff2XI6.js +25 -0
- package/~number-EWff2XI6.js.map +1 -0
- package/~number-baxVnzrJ.js +32 -0
- package/~number-baxVnzrJ.js.map +1 -0
- package/async.d.cts +0 -28
- package/async.d.cts.map +0 -1
- package/common.d.cts +0 -15
- package/common.d.cts.map +0 -1
- package/complex/counter.cjs +0 -21
- package/complex/counter.d.cts +0 -15
- package/complex/counter.d.cts.map +0 -1
- package/complex/counter.js +0 -17
- package/complex/global-config.cjs +0 -46
- package/complex/global-config.d.cts +0 -11
- package/complex/global-config.d.cts.map +0 -1
- package/complex/global-config.js +0 -41
- package/complex/index.cjs +0 -19
- package/complex/index.d.cts +0 -4
- package/complex/index.d.cts.map +0 -1
- package/complex/index.js +0 -3
- package/complex/modules-factory.cjs +0 -50
- package/complex/modules-factory.d.cts +0 -49
- package/complex/modules-factory.d.cts.map +0 -1
- package/complex/modules-factory.js +0 -46
- package/cookie.d.cts +0 -3
- package/cookie.d.cts.map +0 -1
- package/css.d.cts +0 -42
- package/css.d.cts.map +0 -1
- package/data.d.cts +0 -4
- package/data.d.cts.map +0 -1
- package/date-time.d.cts +0 -28
- package/date-time.d.cts.map +0 -1
- package/device.d.cts +0 -8
- package/device.d.cts.map +0 -1
- package/encodings.d.cts +0 -2
- package/encodings.d.cts.map +0 -1
- package/errors.d.cts +0 -19
- package/errors.d.cts.map +0 -1
- package/file.d.cts +0 -3
- package/file.d.cts.map +0 -1
- package/format/_exports.cjs +0 -20
- package/format/_exports.d.cts +0 -5
- package/format/_exports.d.cts.map +0 -1
- package/format/_exports.js +0 -4
- package/format/constants.cjs +0 -6
- package/format/constants.d.cts +0 -4
- package/format/constants.d.cts.map +0 -1
- package/format/constants.js +0 -3
- package/format/index.cjs +0 -40
- package/format/index.d.cts +0 -3
- package/format/index.d.cts.map +0 -1
- package/format/index.js +0 -4
- package/format/number.cjs +0 -48
- package/format/number.d.cts +0 -36
- package/format/number.d.cts.map +0 -1
- package/format/number.js +0 -44
- package/format/percent.cjs +0 -27
- package/format/percent.d.cts +0 -15
- package/format/percent.d.cts.map +0 -1
- package/format/percent.js +0 -23
- package/format/skip-spaces.cjs +0 -8
- package/format/skip-spaces.d.cts +0 -5
- package/format/skip-spaces.d.cts.map +0 -1
- package/format/skip-spaces.js +0 -4
- package/html.d.cts +0 -44
- package/html.d.cts.map +0 -1
- package/id.d.cts +0 -63
- package/id.d.cts.map +0 -1
- package/imports.d.cts +0 -15
- package/imports.d.cts.map +0 -1
- package/math.d.cts +0 -13
- package/math.d.cts.map +0 -1
- package/media.d.cts +0 -20
- package/media.d.cts.map +0 -1
- package/mobx/apply-observable.cjs +0 -16
- package/mobx/apply-observable.d.cts +0 -4
- package/mobx/apply-observable.d.cts.map +0 -1
- package/mobx/apply-observable.js +0 -12
- package/mobx/create-enhanced-atom.cjs +0 -16
- package/mobx/create-enhanced-atom.d.cts +0 -11
- package/mobx/create-enhanced-atom.d.cts.map +0 -1
- package/mobx/create-enhanced-atom.js +0 -12
- package/mobx/deep-observable-struct.cjs +0 -61
- package/mobx/deep-observable-struct.d.cts +0 -7
- package/mobx/deep-observable-struct.d.cts.map +0 -1
- package/mobx/deep-observable-struct.js +0 -57
- package/mobx/get-mobx-administration.cjs +0 -6
- package/mobx/get-mobx-administration.d.cts +0 -6
- package/mobx/get-mobx-administration.d.cts.map +0 -1
- package/mobx/get-mobx-administration.js +0 -2
- package/mobx/index.cjs +0 -21
- package/mobx/index.d.cts +0 -6
- package/mobx/index.d.cts.map +0 -1
- package/mobx/index.js +0 -5
- package/mobx/lazy-observe.cjs +0 -66
- package/mobx/lazy-observe.d.cts +0 -14
- package/mobx/lazy-observe.d.cts.map +0 -1
- package/mobx/lazy-observe.js +0 -62
- package/ms.d.cts +0 -19
- package/ms.d.cts.map +0 -1
- package/number.d.cts +0 -8
- package/number.d.cts.map +0 -1
- package/parser/_exports.cjs +0 -19
- package/parser/_exports.d.cts +0 -4
- package/parser/_exports.d.cts.map +0 -1
- package/parser/_exports.js +0 -3
- package/parser/index.cjs +0 -40
- package/parser/index.d.cts +0 -3
- package/parser/index.d.cts.map +0 -1
- package/parser/index.js +0 -4
- package/parser/number.cjs +0 -48
- package/parser/number.d.cts +0 -21
- package/parser/number.d.cts.map +0 -1
- package/parser/number.js +0 -44
- package/parser/percent.cjs +0 -8
- package/parser/percent.d.cts +0 -4
- package/parser/percent.d.cts.map +0 -1
- package/parser/percent.js +0 -4
- package/parser/string.cjs +0 -18
- package/parser/string.d.cts +0 -7
- package/parser/string.d.cts.map +0 -1
- package/parser/string.js +0 -14
- package/price.d.cts +0 -6
- package/price.d.cts.map +0 -1
- package/random.d.cts +0 -9
- package/random.d.cts.map +0 -1
- package/react/hooks/index.cjs +0 -37
- package/react/hooks/index.d.cts +0 -22
- package/react/hooks/index.d.cts.map +0 -1
- package/react/hooks/index.js +0 -21
- package/react/hooks/use-abort-controller.cjs +0 -15
- package/react/hooks/use-abort-controller.d.cts +0 -2
- package/react/hooks/use-abort-controller.d.cts.map +0 -1
- package/react/hooks/use-abort-controller.js +0 -11
- package/react/hooks/use-abort-signal.cjs +0 -8
- package/react/hooks/use-abort-signal.d.cts +0 -2
- package/react/hooks/use-abort-signal.d.cts.map +0 -1
- package/react/hooks/use-abort-signal.js +0 -4
- package/react/hooks/use-click-outside.cjs +0 -17
- package/react/hooks/use-click-outside.d.cts +0 -9
- package/react/hooks/use-click-outside.d.cts.map +0 -1
- package/react/hooks/use-click-outside.js +0 -13
- package/react/hooks/use-constant.cjs +0 -19
- package/react/hooks/use-constant.d.cts +0 -9
- package/react/hooks/use-constant.d.cts.map +0 -1
- package/react/hooks/use-constant.js +0 -15
- package/react/hooks/use-define-ref.cjs +0 -19
- package/react/hooks/use-define-ref.d.cts +0 -10
- package/react/hooks/use-define-ref.d.cts.map +0 -1
- package/react/hooks/use-define-ref.js +0 -15
- package/react/hooks/use-element-ref.cjs +0 -12
- package/react/hooks/use-element-ref.d.cts +0 -2
- package/react/hooks/use-element-ref.d.cts.map +0 -1
- package/react/hooks/use-element-ref.js +0 -8
- package/react/hooks/use-event-listener.cjs +0 -17
- package/react/hooks/use-event-listener.d.cts +0 -8
- package/react/hooks/use-event-listener.d.cts.map +0 -1
- package/react/hooks/use-event-listener.js +0 -13
- package/react/hooks/use-event.cjs +0 -23
- package/react/hooks/use-event.d.cts +0 -3
- package/react/hooks/use-event.d.cts.map +0 -1
- package/react/hooks/use-event.js +0 -19
- package/react/hooks/use-flag.cjs +0 -19
- package/react/hooks/use-flag.d.cts +0 -8
- package/react/hooks/use-flag.d.cts.map +0 -1
- package/react/hooks/use-flag.js +0 -15
- package/react/hooks/use-force-update.cjs +0 -11
- package/react/hooks/use-force-update.d.cts +0 -2
- package/react/hooks/use-force-update.d.cts.map +0 -1
- package/react/hooks/use-force-update.js +0 -7
- package/react/hooks/use-initial-height.cjs +0 -15
- package/react/hooks/use-initial-height.d.cts +0 -5
- package/react/hooks/use-initial-height.d.cts.map +0 -1
- package/react/hooks/use-initial-height.js +0 -11
- package/react/hooks/use-instance.cjs +0 -31
- package/react/hooks/use-instance.d.cts +0 -27
- package/react/hooks/use-instance.d.cts.map +0 -1
- package/react/hooks/use-instance.js +0 -27
- package/react/hooks/use-intersection-observer.cjs +0 -14
- package/react/hooks/use-intersection-observer.d.cts +0 -2
- package/react/hooks/use-intersection-observer.d.cts.map +0 -1
- package/react/hooks/use-intersection-observer.js +0 -10
- package/react/hooks/use-last-defined-value.cjs +0 -12
- package/react/hooks/use-last-defined-value.d.cts +0 -2
- package/react/hooks/use-last-defined-value.d.cts.map +0 -1
- package/react/hooks/use-last-defined-value.js +0 -8
- package/react/hooks/use-last-value-ref.cjs +0 -12
- package/react/hooks/use-last-value-ref.d.cts +0 -2
- package/react/hooks/use-last-value-ref.d.cts.map +0 -1
- package/react/hooks/use-last-value-ref.js +0 -8
- package/react/hooks/use-life-cycle.cjs +0 -14
- package/react/hooks/use-life-cycle.d.cts +0 -5
- package/react/hooks/use-life-cycle.d.cts.map +0 -1
- package/react/hooks/use-life-cycle.js +0 -10
- package/react/hooks/use-resize-observer.cjs +0 -15
- package/react/hooks/use-resize-observer.d.cts +0 -2
- package/react/hooks/use-resize-observer.d.cts.map +0 -1
- package/react/hooks/use-resize-observer.js +0 -11
- package/react/hooks/use-sync-ref.cjs +0 -10
- package/react/hooks/use-sync-ref.d.cts +0 -2
- package/react/hooks/use-sync-ref.d.cts.map +0 -1
- package/react/hooks/use-sync-ref.js +0 -6
- package/react/hooks/use-toggle.cjs +0 -10
- package/react/hooks/use-toggle.d.cts +0 -2
- package/react/hooks/use-toggle.d.cts.map +0 -1
- package/react/hooks/use-toggle.js +0 -6
- package/react/hooks/use-value.cjs +0 -12
- package/react/hooks/use-value.d.cts +0 -5
- package/react/hooks/use-value.d.cts.map +0 -1
- package/react/hooks/use-value.js +0 -8
- package/react/hooks/use-visibility-state.cjs +0 -18
- package/react/hooks/use-visibility-state.d.cts +0 -2
- package/react/hooks/use-visibility-state.d.cts.map +0 -1
- package/react/hooks/use-visibility-state.js +0 -14
- package/react/index.cjs +0 -17
- package/react/index.d.cts +0 -2
- package/react/index.d.cts.map +0 -1
- package/react/index.js +0 -1
- package/sound.d.cts +0 -7
- package/sound.d.cts.map +0 -1
- package/storage.cjs +0 -48
- package/storage.d.cts +0 -39
- package/storage.d.cts.map +0 -1
- package/storage.js +0 -43
- package/text.d.cts +0 -15
- package/text.d.cts.map +0 -1
- package/type-guard/_exports.cjs +0 -129
- package/type-guard/_exports.d.cts +0 -86
- package/type-guard/_exports.d.cts.map +0 -1
- package/type-guard/_exports.js +0 -125
- package/type-guard/index.cjs +0 -40
- package/type-guard/index.d.cts +0 -3
- package/type-guard/index.d.cts.map +0 -1
- package/type-guard/index.js +0 -4
- package/utils/types.d.cts +0 -395
- package/utils/types.d.cts.map +0 -1
- package/vibrate.d.cts +0 -5
- package/vibrate.d.cts.map +0 -1
package/format/skip-spaces.cjs
DELETED
package/format/skip-spaces.d.cts
DELETED
|
@@ -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"}
|
package/format/skip-spaces.js
DELETED
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"}
|
package/mobx/apply-observable.js
DELETED
|
@@ -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 +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"}
|
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
package/mobx/index.d.cts.map
DELETED
|
@@ -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
package/mobx/lazy-observe.cjs
DELETED
|
@@ -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;
|
package/mobx/lazy-observe.d.cts
DELETED
|
@@ -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"}
|
package/mobx/lazy-observe.js
DELETED
|
@@ -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
|
-
};
|