@m4l/core 1.0.0 → 1.1.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 (82) hide show
  1. package/contexts/AuthContext/AuthContext.d.ts +5 -0
  2. package/contexts/AuthContext/index.717a8c86.js +135 -0
  3. package/contexts/AuthContext/index.d.ts +2 -0
  4. package/contexts/AuthContext/types.d.ts +52 -0
  5. package/contexts/DomainContext/{index.fc9c9f7e.js → index.2ed56159.js} +2 -2
  6. package/contexts/DomainCountryContext/index.3cdf9462.js +46 -0
  7. package/contexts/FlagsContext/index.5b096265.js +41 -0
  8. package/contexts/ModuleDictionaryContext/index.44448b0d.js +71 -0
  9. package/contexts/ModulePrivilegesContext/index.1274092a.js +52 -0
  10. package/contexts/ModuleSkeletonContext/index.9267d86a.js +20 -0
  11. package/{packages/m4l_core/contexts → contexts}/index.d.ts +1 -0
  12. package/{packages/m4l_core/hooks → hooks}/index.d.ts +1 -0
  13. package/hooks/useAuth/index.5356a5e9.js +11 -0
  14. package/hooks/useAuth/index.d.ts +1 -0
  15. package/hooks/useAuth/useAuth.d.ts +2 -0
  16. package/hooks/useDomain/{index.73578fd1.js → index.dd6909f6.js} +2 -2
  17. package/hooks/useFlagsStore/{index.fa8dcf62.js → index.f7c613ac.js} +5 -4
  18. package/hooks/useLocalStorage/{index.48b47dca.js → index.7dbb3411.js} +2 -2
  19. package/hooks/useModuleDictionary/{index.0b2e51cf.js → index.eec95f41.js} +1 -1
  20. package/hooks/useModulePrivileges/{index.3c1155fb.js → index.e93abed8.js} +1 -1
  21. package/hooks/useModuleSkeleton/{index.2b62072e.js → index.a8238d1d.js} +1 -1
  22. package/index.js +77 -71
  23. package/node_modules.04fac7e9.js +401 -0
  24. package/package.json +4 -2
  25. package/utils/{index.6d56ba04.js → index.f9db04a8.js} +10 -14
  26. package/vite-env.d.ts +4 -4
  27. package/contexts/DomainCountryContext/index.2da8b247.js +0 -54
  28. package/contexts/FlagsContext/index.3f08bff3.js +0 -39
  29. package/contexts/ModuleDictionaryContext/index.cc2a5fa3.js +0 -76
  30. package/contexts/ModulePrivilegesContext/index.039085db.js +0 -58
  31. package/contexts/ModuleSkeletonContext/index.334164fc.js +0 -28
  32. package/node_modules.7069706f.js +0 -835
  33. package/packages/m4l_core/vite-env.d.ts +0 -4
  34. package/vendor.3b4bd7d3.js +0 -32
  35. /package/{packages/m4l_core/contexts → contexts}/BaseContext/index.d.ts +0 -0
  36. /package/{packages/m4l_core/contexts → contexts}/BaseContext/types.d.ts +0 -0
  37. /package/{packages/m4l_core/contexts → contexts}/DomainContext/index.d.ts +0 -0
  38. /package/{packages/m4l_core/contexts → contexts}/DomainContext/types.d.ts +0 -0
  39. /package/{packages/m4l_core/contexts → contexts}/DomainCountryContext/index.d.ts +0 -0
  40. /package/{packages/m4l_core/contexts → contexts}/DomainCountryContext/types.d.ts +0 -0
  41. /package/{packages/m4l_core/contexts → contexts}/EnvironmentContext/index.d.ts +0 -0
  42. /package/{packages/m4l_core/contexts → contexts}/EnvironmentContext/types.d.ts +0 -0
  43. /package/{packages/m4l_core/contexts → contexts}/FlagsContext/index.d.ts +0 -0
  44. /package/{packages/m4l_core/contexts → contexts}/FlagsContext/store.d.ts +0 -0
  45. /package/{packages/m4l_core/contexts → contexts}/FlagsContext/types.d.ts +0 -0
  46. /package/{packages/m4l_core/contexts → contexts}/HostToolsContext/index.d.ts +0 -0
  47. /package/{packages/m4l_core/contexts → contexts}/HostToolsContext/types.d.ts +0 -0
  48. /package/{packages/m4l_core/contexts → contexts}/ModuleDictionaryContext/index.d.ts +0 -0
  49. /package/{packages/m4l_core/contexts → contexts}/ModuleDictionaryContext/types.d.ts +0 -0
  50. /package/{packages/m4l_core/contexts → contexts}/ModulePrivilegesContext/index.d.ts +0 -0
  51. /package/{packages/m4l_core/contexts → contexts}/ModulePrivilegesContext/types.d.ts +0 -0
  52. /package/{packages/m4l_core/contexts → contexts}/ModuleSkeletonContext/index.d.ts +0 -0
  53. /package/{packages/m4l_core/contexts → contexts}/ModuleSkeletonContext/types.d.ts +0 -0
  54. /package/{packages/m4l_core/contexts → contexts}/NetworkContext/index.d.ts +0 -0
  55. /package/{packages/m4l_core/contexts → contexts}/NetworkContext/types.d.ts +0 -0
  56. /package/{packages/m4l_core/hooks → hooks}/useBase/index.d.ts +0 -0
  57. /package/{packages/m4l_core/hooks → hooks}/useDomain/index.d.ts +0 -0
  58. /package/{packages/m4l_core/hooks → hooks}/useDomainCountry/index.d.ts +0 -0
  59. /package/{packages/m4l_core/hooks → hooks}/useEnvironment/index.d.ts +0 -0
  60. /package/{packages/m4l_core/hooks → hooks}/useFlagsStore/index.d.ts +0 -0
  61. /package/{packages/m4l_core/hooks → hooks}/useHostTools/index.d.ts +0 -0
  62. /package/{packages/m4l_core/hooks → hooks}/useLocalStorage/index.d.ts +0 -0
  63. /package/{packages/m4l_core/hooks → hooks}/useLocalStorageWithListener/index.d.ts +0 -0
  64. /package/{packages/m4l_core/hooks → hooks}/useModuleDictionary/index.d.ts +0 -0
  65. /package/{packages/m4l_core/hooks → hooks}/useModulePrivileges/index.d.ts +0 -0
  66. /package/{packages/m4l_core/hooks → hooks}/useModuleSkeleton/index.d.ts +0 -0
  67. /package/{packages/m4l_core/hooks → hooks}/useNetwork/index.d.ts +0 -0
  68. /package/{packages/m4l_core/hooks → hooks}/usePaginate/index.d.ts +0 -0
  69. /package/{packages/m4l_core/hooks → hooks}/usePaginate/types.d.ts +0 -0
  70. /package/{packages/m4l_core/hooks → hooks}/usePropageteMF/index.d.ts +0 -0
  71. /package/{packages/m4l_core/hooks → hooks}/usePropageteMF/types.d.ts +0 -0
  72. /package/{packages/m4l_core/index.d.ts → index.d.ts} +0 -0
  73. /package/{packages/m4l_core/types → types}/dictionary.d.ts +0 -0
  74. /package/{packages/m4l_core/types → types}/index.d.ts +0 -0
  75. /package/{packages/m4l_core/utils → utils}/axiosOperation/index.d.ts +0 -0
  76. /package/{packages/m4l_core/utils → utils}/axiosOperation/types.d.ts +0 -0
  77. /package/{packages/m4l_core/utils → utils}/evaluateWithContext/index.d.ts +0 -0
  78. /package/{packages/m4l_core/utils → utils}/getLocalStorage/index.d.ts +0 -0
  79. /package/{packages/m4l_core/utils → utils}/getPropertyByString/index.d.ts +0 -0
  80. /package/{packages/m4l_core/utils → utils}/index.d.ts +0 -0
  81. /package/{packages/m4l_core/utils → utils}/setLocalStorage/index.d.ts +0 -0
  82. /package/{packages/m4l_core/utils → utils}/voidFunction.d.ts +0 -0
package/index.js CHANGED
@@ -1,79 +1,85 @@
1
- import { B as x, a as p } from "./contexts/BaseContext/index.f9cdc955.js";
2
- import { E as f, a as d } from "./contexts/EnvironmentContext/index.b33784cd.js";
3
- import { H as g, a as P } from "./contexts/HostToolsContext/index.499db832.js";
4
- import { N as M, a as D } from "./contexts/NetworkContext/index.ec7405cd.js";
5
- import { F as c, a as y } from "./contexts/FlagsContext/index.3f08bff3.js";
6
- import { D as E, a as k } from "./contexts/DomainContext/index.fc9c9f7e.js";
7
- import { M as L, a as H } from "./contexts/ModuleDictionaryContext/index.cc2a5fa3.js";
8
- import { M as w, a as T } from "./contexts/ModulePrivilegesContext/index.039085db.js";
9
- import { M as W, a as O } from "./contexts/ModuleSkeletonContext/index.334164fc.js";
10
- import { D as j, a as q } from "./contexts/DomainCountryContext/index.2da8b247.js";
11
- import { u as A } from "./hooks/useBase/index.4375dcef.js";
12
- import { u as I } from "./hooks/useEnvironment/index.25f83176.js";
13
- import { a as K, u as Q } from "./hooks/useFlagsStore/index.fa8dcf62.js";
14
- import { u as U } from "./hooks/useHostTools/index.66d9a667.js";
15
- import { u as X, a as Y } from "./hooks/useDomain/index.73578fd1.js";
16
- import { u as _, a as $ } from "./hooks/useLocalStorage/index.48b47dca.js";
17
- import { u as eo } from "./hooks/useModuleDictionary/index.0b2e51cf.js";
18
- import { u as to } from "./hooks/useModulePrivileges/index.3c1155fb.js";
19
- import { u as so } from "./hooks/useModuleSkeleton/index.2b62072e.js";
20
- import { u as mo } from "./hooks/useNetwork/index.3d79002b.js";
21
- import { i as uo, u as xo } from "./hooks/usePaginate/index.1306b0de.js";
22
- import { u as lo } from "./hooks/usePropageteMF/index.c440b829.js";
23
- import { C as vo, E as go } from "./types/index.42c24946.js";
24
- import { e as Co, a as Mo, g as Do, s as So, v as co } from "./utils/index.6d56ba04.js";
25
- import { a as Fo } from "./utils/axiosOperation.ce4250d4.js";
1
+ import { C as p, E as l } from "./types/index.42c24946.js";
2
+ import { B as d, a as v } from "./contexts/BaseContext/index.f9cdc955.js";
3
+ import { E as P, a as C } from "./contexts/EnvironmentContext/index.b33784cd.js";
4
+ import { H as D, a as S } from "./contexts/HostToolsContext/index.499db832.js";
5
+ import { N as y, a as F } from "./contexts/NetworkContext/index.ec7405cd.js";
6
+ import { A as k, a as h } from "./contexts/AuthContext/index.717a8c86.js";
7
+ import { F as L, a as A } from "./contexts/FlagsContext/index.5b096265.js";
8
+ import { D as N, a as w } from "./contexts/DomainContext/index.2ed56159.js";
9
+ import { M as W, a as O } from "./contexts/ModuleDictionaryContext/index.44448b0d.js";
10
+ import { M as j, a as q } from "./contexts/ModulePrivilegesContext/index.1274092a.js";
11
+ import { M as G, a as I } from "./contexts/ModuleSkeletonContext/index.9267d86a.js";
12
+ import { D as K, a as Q } from "./contexts/DomainCountryContext/index.3cdf9462.js";
13
+ import { u as U } from "./hooks/useBase/index.4375dcef.js";
14
+ import { u as X } from "./hooks/useEnvironment/index.25f83176.js";
15
+ import { a as Z, u as _ } from "./hooks/useFlagsStore/index.f7c613ac.js";
16
+ import { u as oo } from "./hooks/useHostTools/index.66d9a667.js";
17
+ import { u as ro, a as to } from "./hooks/useDomain/index.dd6909f6.js";
18
+ import { a as so, u as io } from "./hooks/useLocalStorage/index.7dbb3411.js";
19
+ import { u as no } from "./hooks/useModuleDictionary/index.eec95f41.js";
20
+ import { u as xo } from "./hooks/useModulePrivileges/index.e93abed8.js";
21
+ import { u as lo } from "./hooks/useModuleSkeleton/index.a8238d1d.js";
22
+ import { u as vo } from "./hooks/useNetwork/index.3d79002b.js";
23
+ import { i as Po, u as Co } from "./hooks/usePaginate/index.1306b0de.js";
24
+ import { u as Do } from "./hooks/usePropageteMF/index.c440b829.js";
25
+ import { u as co } from "./hooks/useAuth/index.5356a5e9.js";
26
+ import { e as Fo, g as Eo, a as ko, s as ho, v as Bo } from "./utils/index.f9db04a8.js";
27
+ import { a as Ao } from "./utils/axiosOperation.ce4250d4.js";
26
28
  import "react";
27
29
  import "react/jsx-runtime";
28
- import "./node_modules.7069706f.js";
29
- import "./vendor.3b4bd7d3.js";
30
+ import "zustand";
31
+ import "zustand/middleware";
32
+ import "./node_modules.04fac7e9.js";
30
33
  import "axios";
31
34
  import "qs";
32
35
  import "camelcase-keys";
33
36
  import "snakecase-keys";
34
37
  export {
35
- x as BaseContext,
36
- p as BaseProvider,
37
- vo as CommonFlags,
38
- E as DomainContext,
39
- j as DomainCountryContext,
40
- q as DomainCountryProvider,
41
- k as DomainProvider,
42
- go as EmitEvents,
43
- f as EnvironmentContext,
44
- d as EnvironmentProvider,
45
- c as FlagsContext,
46
- y as FlagsProvider,
47
- g as HostToolsContext,
48
- P as HostToolsProvider,
49
- L as ModuleDictionaryContext,
50
- H as ModuleDictionaryProvider,
51
- w as ModulePrivilegesContext,
52
- T as ModulePrivilegesProvider,
53
- W as ModuleSkeletonContext,
54
- O as ModuleSkeletonProvider,
55
- M as NetworkContext,
56
- D as NetworkProvider,
57
- Fo as axiosOperation,
58
- Co as evaluateWithContext,
59
- Mo as getLocalStorage,
60
- Do as getPropertyByString,
61
- uo as initialPagerState,
62
- So as setLocalStorage,
63
- A as useBase,
64
- X as useDomain,
65
- Y as useDomainCountry,
66
- I as useEnvironment,
67
- K as useFlagsPresent,
68
- Q as useFlagsStore,
69
- U as useHostTools,
70
- _ as useLocalStorage,
71
- $ as useLocalStorageWithListener,
72
- eo as useModuleDictionary,
73
- to as useModulePrivileges,
74
- so as useModuleSkeleton,
75
- mo as useNetwork,
76
- xo as usePaginate,
77
- lo as usePropageteMF,
78
- co as voidFunction
38
+ k as AuthContext,
39
+ h as AuthProvider,
40
+ d as BaseContext,
41
+ v as BaseProvider,
42
+ p as CommonFlags,
43
+ N as DomainContext,
44
+ K as DomainCountryContext,
45
+ Q as DomainCountryProvider,
46
+ w as DomainProvider,
47
+ l as EmitEvents,
48
+ P as EnvironmentContext,
49
+ C as EnvironmentProvider,
50
+ L as FlagsContext,
51
+ A as FlagsProvider,
52
+ D as HostToolsContext,
53
+ S as HostToolsProvider,
54
+ W as ModuleDictionaryContext,
55
+ O as ModuleDictionaryProvider,
56
+ j as ModulePrivilegesContext,
57
+ q as ModulePrivilegesProvider,
58
+ G as ModuleSkeletonContext,
59
+ I as ModuleSkeletonProvider,
60
+ y as NetworkContext,
61
+ F as NetworkProvider,
62
+ Ao as axiosOperation,
63
+ Fo as evaluateWithContext,
64
+ Eo as getLocalStorage,
65
+ ko as getPropertyByString,
66
+ Po as initialPagerState,
67
+ ho as setLocalStorage,
68
+ co as useAuth,
69
+ U as useBase,
70
+ ro as useDomain,
71
+ to as useDomainCountry,
72
+ X as useEnvironment,
73
+ Z as useFlagsPresent,
74
+ _ as useFlagsStore,
75
+ oo as useHostTools,
76
+ so as useLocalStorage,
77
+ io as useLocalStorageWithListener,
78
+ no as useModuleDictionary,
79
+ xo as useModulePrivileges,
80
+ lo as useModuleSkeleton,
81
+ vo as useNetwork,
82
+ Co as usePaginate,
83
+ Do as usePropageteMF,
84
+ Bo as voidFunction
79
85
  };
@@ -0,0 +1,401 @@
1
+ function s(e) {
2
+ for (var t = arguments.length, r = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
3
+ r[n - 1] = arguments[n];
4
+ if (process.env.NODE_ENV !== "production") {
5
+ var o = ve[e], i = o ? typeof o == "function" ? o.apply(null, r) : o : "unknown error nr: " + e;
6
+ throw Error("[Immer] " + i);
7
+ }
8
+ throw Error("[Immer] minified error nr: " + e + (r.length ? " " + r.map(function(u) {
9
+ return "'" + u + "'";
10
+ }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
11
+ }
12
+ function O(e) {
13
+ return !!e && !!e[p];
14
+ }
15
+ function b(e) {
16
+ var t;
17
+ return !!e && (function(r) {
18
+ if (!r || typeof r != "object")
19
+ return !1;
20
+ var n = Object.getPrototypeOf(r);
21
+ if (n === null)
22
+ return !0;
23
+ var o = Object.hasOwnProperty.call(n, "constructor") && n.constructor;
24
+ return o === Object || typeof o == "function" && Function.toString.call(o) === he;
25
+ }(e) || Array.isArray(e) || !!e[ne] || !!(!((t = e.constructor) === null || t === void 0) && t[ne]) || V(e) || U(e));
26
+ }
27
+ function S(e, t, r) {
28
+ r === void 0 && (r = !1), w(e) === 0 ? (r ? Object.keys : q)(e).forEach(function(n) {
29
+ r && typeof n == "symbol" || t(n, e[n], e);
30
+ }) : e.forEach(function(n, o) {
31
+ return t(o, n, e);
32
+ });
33
+ }
34
+ function w(e) {
35
+ var t = e[p];
36
+ return t ? t.i > 3 ? t.i - 4 : t.i : Array.isArray(e) ? 1 : V(e) ? 2 : U(e) ? 3 : 0;
37
+ }
38
+ function F(e, t) {
39
+ return w(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
40
+ }
41
+ function fe(e, t) {
42
+ return w(e) === 2 ? e.get(t) : e[t];
43
+ }
44
+ function oe(e, t, r) {
45
+ var n = w(e);
46
+ n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
47
+ }
48
+ function ce(e, t) {
49
+ return e === t ? e !== 0 || 1 / e == 1 / t : e != e && t != t;
50
+ }
51
+ function V(e) {
52
+ return de && e instanceof Map;
53
+ }
54
+ function U(e) {
55
+ return ye && e instanceof Set;
56
+ }
57
+ function m(e) {
58
+ return e.o || e.t;
59
+ }
60
+ function W(e) {
61
+ if (Array.isArray(e))
62
+ return Array.prototype.slice.call(e);
63
+ var t = me(e);
64
+ delete t[p];
65
+ for (var r = q(t), n = 0; n < r.length; n++) {
66
+ var o = r[n], i = t[o];
67
+ i.writable === !1 && (i.writable = !0, i.configurable = !0), (i.get || i.set) && (t[o] = { configurable: !0, writable: !0, enumerable: i.enumerable, value: e[o] });
68
+ }
69
+ return Object.create(Object.getPrototypeOf(e), t);
70
+ }
71
+ function $(e, t) {
72
+ return t === void 0 && (t = !1), G(e) || O(e) || !b(e) || (w(e) > 1 && (e.set = e.add = e.clear = e.delete = se), Object.freeze(e), t && S(e, function(r, n) {
73
+ return $(n, !0);
74
+ }, !0)), e;
75
+ }
76
+ function se() {
77
+ s(2);
78
+ }
79
+ function G(e) {
80
+ return e == null || typeof e != "object" || Object.isFrozen(e);
81
+ }
82
+ function v(e) {
83
+ var t = be[e];
84
+ return t || s(18, e), t;
85
+ }
86
+ function Q() {
87
+ return process.env.NODE_ENV === "production" || P || s(0), P;
88
+ }
89
+ function k(e, t) {
90
+ t && (v("Patches"), e.u = [], e.s = [], e.v = t);
91
+ }
92
+ function j(e) {
93
+ M(e), e.p.forEach(le), e.p = null;
94
+ }
95
+ function M(e) {
96
+ e === P && (P = e.l);
97
+ }
98
+ function Y(e) {
99
+ return P = { p: [], l: P, h: e, m: !0, _: 0 };
100
+ }
101
+ function le(e) {
102
+ var t = e[p];
103
+ t.i === 0 || t.i === 1 ? t.j() : t.g = !0;
104
+ }
105
+ function A(e, t) {
106
+ t._ = t.p.length;
107
+ var r = t.p[0], n = e !== void 0 && e !== r;
108
+ return t.h.O || v("ES5").S(t, e, n), n ? (r[p].P && (j(t), s(4)), b(e) && (e = I(t, e), t.l || _(t, e)), t.u && v("Patches").M(r[p].t, e, t.u, t.s)) : e = I(t, r, []), j(t), t.u && t.v(t.u, t.s), e !== ie ? e : void 0;
109
+ }
110
+ function I(e, t, r) {
111
+ if (G(t))
112
+ return t;
113
+ var n = t[p];
114
+ if (!n)
115
+ return S(t, function(a, c) {
116
+ return Z(e, n, t, a, c, r);
117
+ }, !0), t;
118
+ if (n.A !== e)
119
+ return t;
120
+ if (!n.P)
121
+ return _(e, n.t, !0), n.t;
122
+ if (!n.I) {
123
+ n.I = !0, n.A._--;
124
+ var o = n.i === 4 || n.i === 5 ? n.o = W(n.k) : n.o, i = o, u = !1;
125
+ n.i === 3 && (i = new Set(o), o.clear(), u = !0), S(i, function(a, c) {
126
+ return Z(e, n, o, a, c, r, u);
127
+ }), _(e, o, !1), r && e.u && v("Patches").N(n, r, e.u, e.s);
128
+ }
129
+ return n.o;
130
+ }
131
+ function Z(e, t, r, n, o, i, u) {
132
+ if (process.env.NODE_ENV !== "production" && o === r && s(5), O(o)) {
133
+ var a = I(e, o, i && t && t.i !== 3 && !F(t.R, n) ? i.concat(n) : void 0);
134
+ if (oe(r, n, a), !O(a))
135
+ return;
136
+ e.m = !1;
137
+ } else
138
+ u && r.add(o);
139
+ if (b(o) && !G(o)) {
140
+ if (!e.h.D && e._ < 1)
141
+ return;
142
+ I(e, o), t && t.A.l || _(e, o);
143
+ }
144
+ }
145
+ function _(e, t, r) {
146
+ r === void 0 && (r = !1), !e.l && e.h.D && e.m && $(t, r);
147
+ }
148
+ function z(e, t) {
149
+ var r = e[p];
150
+ return (r ? m(r) : e)[t];
151
+ }
152
+ function B(e, t) {
153
+ if (t in e)
154
+ for (var r = Object.getPrototypeOf(e); r; ) {
155
+ var n = Object.getOwnPropertyDescriptor(r, t);
156
+ if (n)
157
+ return n;
158
+ r = Object.getPrototypeOf(r);
159
+ }
160
+ }
161
+ function T(e) {
162
+ e.P || (e.P = !0, e.l && T(e.l));
163
+ }
164
+ function R(e) {
165
+ e.o || (e.o = W(e.t));
166
+ }
167
+ function C(e, t, r) {
168
+ var n = V(t) ? v("MapSet").F(t, r) : U(t) ? v("MapSet").T(t, r) : e.O ? function(o, i) {
169
+ var u = Array.isArray(o), a = { i: u ? 1 : 0, A: i ? i.A : Q(), P: !1, I: !1, R: {}, l: i, t: o, k: null, o: null, j: null, C: !1 }, c = a, f = K;
170
+ u && (c = [a], f = N);
171
+ var l = Proxy.revocable(c, f), g = l.revoke, y = l.proxy;
172
+ return a.k = y, a.j = g, y;
173
+ }(t, r) : v("ES5").J(t, r);
174
+ return (r ? r.A : Q()).p.push(n), n;
175
+ }
176
+ function pe(e) {
177
+ return O(e) || s(22, e), function t(r) {
178
+ if (!b(r))
179
+ return r;
180
+ var n, o = r[p], i = w(r);
181
+ if (o) {
182
+ if (!o.P && (o.i < 4 || !v("ES5").K(o)))
183
+ return o.t;
184
+ o.I = !0, n = ee(r, i), o.I = !1;
185
+ } else
186
+ n = ee(r, i);
187
+ return S(n, function(u, a) {
188
+ o && fe(o.t, u) === a || oe(n, u, t(a));
189
+ }), i === 3 ? new Set(n) : n;
190
+ }(e);
191
+ }
192
+ function ee(e, t) {
193
+ switch (t) {
194
+ case 2:
195
+ return new Map(e);
196
+ case 3:
197
+ return Array.from(e);
198
+ }
199
+ return W(e);
200
+ }
201
+ var te, P, X = typeof Symbol < "u" && typeof Symbol("x") == "symbol", de = typeof Map < "u", ye = typeof Set < "u", re = typeof Proxy < "u" && Proxy.revocable !== void 0 && typeof Reflect < "u", ie = X ? Symbol.for("immer-nothing") : ((te = {})["immer-nothing"] = !0, te), ne = X ? Symbol.for("immer-draftable") : "__$immer_draftable", p = X ? Symbol.for("immer-state") : "__$immer_state", ve = { 0: "Illegal state", 1: "Immer drafts cannot have computed properties", 2: "This object has been frozen and should not be mutated", 3: function(e) {
202
+ return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
203
+ }, 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", 5: "Immer forbids circular references", 6: "The first or second argument to `produce` must be a function", 7: "The third argument to `produce` must be a function or undefined", 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", 9: "First argument to `finishDraft` must be a draft returned by `createDraft`", 10: "The given draft is already finalized", 11: "Object.defineProperty() cannot be used on an Immer draft", 12: "Object.setPrototypeOf() cannot be used on an Immer draft", 13: "Immer only supports deleting array indices", 14: "Immer only supports setting array indices and the 'length' property", 15: function(e) {
204
+ return "Cannot apply patch, path doesn't resolve: " + e;
205
+ }, 16: 'Sets cannot have "replace" patches.', 17: function(e) {
206
+ return "Unsupported patch operation: " + e;
207
+ }, 18: function(e) {
208
+ return "The plugin for '" + e + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + e + "()` when initializing your application.";
209
+ }, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(e) {
210
+ return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '" + e + "'";
211
+ }, 22: function(e) {
212
+ return "'current' expects a draft, got: " + e;
213
+ }, 23: function(e) {
214
+ return "'original' expects a draft, got: " + e;
215
+ }, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" }, he = "" + Object.prototype.constructor, q = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(e) {
216
+ return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
217
+ } : Object.getOwnPropertyNames, me = Object.getOwnPropertyDescriptors || function(e) {
218
+ var t = {};
219
+ return q(e).forEach(function(r) {
220
+ t[r] = Object.getOwnPropertyDescriptor(e, r);
221
+ }), t;
222
+ }, be = {}, K = { get: function(e, t) {
223
+ if (t === p)
224
+ return e;
225
+ var r = m(e);
226
+ if (!F(r, t))
227
+ return function(o, i, u) {
228
+ var a, c = B(i, u);
229
+ return c ? "value" in c ? c.value : (a = c.get) === null || a === void 0 ? void 0 : a.call(o.k) : void 0;
230
+ }(e, r, t);
231
+ var n = r[t];
232
+ return e.I || !b(n) ? n : n === z(e.t, t) ? (R(e), e.o[t] = C(e.A.h, n, e)) : n;
233
+ }, has: function(e, t) {
234
+ return t in m(e);
235
+ }, ownKeys: function(e) {
236
+ return Reflect.ownKeys(m(e));
237
+ }, set: function(e, t, r) {
238
+ var n = B(m(e), t);
239
+ if (n?.set)
240
+ return n.set.call(e.k, r), !0;
241
+ if (!e.P) {
242
+ var o = z(m(e), t), i = o?.[p];
243
+ if (i && i.t === r)
244
+ return e.o[t] = r, e.R[t] = !1, !0;
245
+ if (ce(r, o) && (r !== void 0 || F(e.t, t)))
246
+ return !0;
247
+ R(e), T(e);
248
+ }
249
+ return e.o[t] === r && (r !== void 0 || t in e.o) || Number.isNaN(r) && Number.isNaN(e.o[t]) || (e.o[t] = r, e.R[t] = !0), !0;
250
+ }, deleteProperty: function(e, t) {
251
+ return z(e.t, t) !== void 0 || t in e.t ? (e.R[t] = !1, R(e), T(e)) : delete e.R[t], e.o && delete e.o[t], !0;
252
+ }, getOwnPropertyDescriptor: function(e, t) {
253
+ var r = m(e), n = Reflect.getOwnPropertyDescriptor(r, t);
254
+ return n && { writable: !0, configurable: e.i !== 1 || t !== "length", enumerable: n.enumerable, value: r[t] };
255
+ }, defineProperty: function() {
256
+ s(11);
257
+ }, getPrototypeOf: function(e) {
258
+ return Object.getPrototypeOf(e.t);
259
+ }, setPrototypeOf: function() {
260
+ s(12);
261
+ } }, N = {};
262
+ S(K, function(e, t) {
263
+ N[e] = function() {
264
+ return arguments[0] = arguments[0][0], t.apply(this, arguments);
265
+ };
266
+ }), N.deleteProperty = function(e, t) {
267
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && s(13), N.set.call(this, e, t, void 0);
268
+ }, N.set = function(e, t, r) {
269
+ return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && s(14), K.set.call(this, e[0], t, r, e[0]);
270
+ };
271
+ var ge = function() {
272
+ function e(r) {
273
+ var n = this;
274
+ this.O = re, this.D = !0, this.produce = function(o, i, u) {
275
+ if (typeof o == "function" && typeof i != "function") {
276
+ var a = i;
277
+ i = o;
278
+ var c = n;
279
+ return function(h) {
280
+ var ue = this;
281
+ h === void 0 && (h = a);
282
+ for (var x = arguments.length, J = Array(x > 1 ? x - 1 : 0), E = 1; E < x; E++)
283
+ J[E - 1] = arguments[E];
284
+ return c.produce(h, function(ae) {
285
+ var L;
286
+ return (L = i).call.apply(L, [ue, ae].concat(J));
287
+ });
288
+ };
289
+ }
290
+ var f;
291
+ if (typeof i != "function" && s(6), u !== void 0 && typeof u != "function" && s(7), b(o)) {
292
+ var l = Y(n), g = C(n, o, void 0), y = !0;
293
+ try {
294
+ f = i(g), y = !1;
295
+ } finally {
296
+ y ? j(l) : M(l);
297
+ }
298
+ return typeof Promise < "u" && f instanceof Promise ? f.then(function(h) {
299
+ return k(l, u), A(h, l);
300
+ }, function(h) {
301
+ throw j(l), h;
302
+ }) : (k(l, u), A(f, l));
303
+ }
304
+ if (!o || typeof o != "object") {
305
+ if ((f = i(o)) === void 0 && (f = o), f === ie && (f = void 0), n.D && $(f, !0), u) {
306
+ var D = [], H = [];
307
+ v("Patches").M(o, f, D, H), u(D, H);
308
+ }
309
+ return f;
310
+ }
311
+ s(21, o);
312
+ }, this.produceWithPatches = function(o, i) {
313
+ if (typeof o == "function")
314
+ return function(f) {
315
+ for (var l = arguments.length, g = Array(l > 1 ? l - 1 : 0), y = 1; y < l; y++)
316
+ g[y - 1] = arguments[y];
317
+ return n.produceWithPatches(f, function(D) {
318
+ return o.apply(void 0, [D].concat(g));
319
+ });
320
+ };
321
+ var u, a, c = n.produce(o, i, function(f, l) {
322
+ u = f, a = l;
323
+ });
324
+ return typeof Promise < "u" && c instanceof Promise ? c.then(function(f) {
325
+ return [f, u, a];
326
+ }) : [c, u, a];
327
+ }, typeof r?.useProxies == "boolean" && this.setUseProxies(r.useProxies), typeof r?.autoFreeze == "boolean" && this.setAutoFreeze(r.autoFreeze);
328
+ }
329
+ var t = e.prototype;
330
+ return t.createDraft = function(r) {
331
+ b(r) || s(8), O(r) && (r = pe(r));
332
+ var n = Y(this), o = C(this, r, void 0);
333
+ return o[p].C = !0, M(n), o;
334
+ }, t.finishDraft = function(r, n) {
335
+ var o = r && r[p];
336
+ process.env.NODE_ENV !== "production" && (o && o.C || s(9), o.I && s(10));
337
+ var i = o.A;
338
+ return k(i, n), A(void 0, i);
339
+ }, t.setAutoFreeze = function(r) {
340
+ this.D = r;
341
+ }, t.setUseProxies = function(r) {
342
+ r && !re && s(20), this.O = r;
343
+ }, t.applyPatches = function(r, n) {
344
+ var o;
345
+ for (o = n.length - 1; o >= 0; o--) {
346
+ var i = n[o];
347
+ if (i.path.length === 0 && i.op === "replace") {
348
+ r = i.value;
349
+ break;
350
+ }
351
+ }
352
+ o > -1 && (n = n.slice(o + 1));
353
+ var u = v("Patches").$;
354
+ return O(r) ? u(r, n) : this.produce(r, function(a) {
355
+ return u(a, n);
356
+ });
357
+ }, e;
358
+ }(), d = new ge(), Oe = d.produce;
359
+ d.produceWithPatches.bind(d);
360
+ d.setAutoFreeze.bind(d);
361
+ d.setUseProxies.bind(d);
362
+ d.applyPatches.bind(d);
363
+ d.createDraft.bind(d);
364
+ d.finishDraft.bind(d);
365
+ const Pe = (e) => (t, r, n) => (n.setState = (o, i, ...u) => {
366
+ const a = typeof o == "function" ? Oe(o) : o;
367
+ return t(a, i, ...u);
368
+ }, e(n.setState, r, n)), we = Pe;
369
+ function Ne(e, t) {
370
+ if (Object.is(e, t))
371
+ return !0;
372
+ if (typeof e != "object" || e === null || typeof t != "object" || t === null)
373
+ return !1;
374
+ if (e instanceof Map && t instanceof Map) {
375
+ if (e.size !== t.size)
376
+ return !1;
377
+ for (const [n, o] of e)
378
+ if (!Object.is(o, t.get(n)))
379
+ return !1;
380
+ return !0;
381
+ }
382
+ if (e instanceof Set && t instanceof Set) {
383
+ if (e.size !== t.size)
384
+ return !1;
385
+ for (const n of e)
386
+ if (!t.has(n))
387
+ return !1;
388
+ return !0;
389
+ }
390
+ const r = Object.keys(e);
391
+ if (r.length !== Object.keys(t).length)
392
+ return !1;
393
+ for (let n = 0; n < r.length; n++)
394
+ if (!Object.prototype.hasOwnProperty.call(t, r[n]) || !Object.is(e[r[n]], t[r[n]]))
395
+ return !1;
396
+ return !0;
397
+ }
398
+ export {
399
+ we as i,
400
+ Ne as s
401
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/core",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "private": false,
@@ -31,6 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "camelcase-keys": "^7.0.1",
34
- "snakecase-keys": "5.1.2"
34
+ "snakecase-keys": "5.1.2",
35
+ "zustand": "4.3.6",
36
+ "immer": "^9.0.21"
35
37
  }
36
38
  }
@@ -1,10 +1,6 @@
1
- import "axios";
2
- import "qs";
3
- import "camelcase-keys";
4
- import "snakecase-keys";
5
- function y() {
1
+ function l() {
6
2
  }
7
- function p(n, e) {
3
+ function u(n, e) {
8
4
  const r = e.split(".");
9
5
  let t = n;
10
6
  for (const o of r) {
@@ -27,7 +23,7 @@ function p(n, e) {
27
23
  }
28
24
  return t;
29
25
  }
30
- function d(n, e) {
26
+ function g(n, e) {
31
27
  try {
32
28
  const t = new Function(...Object.keys(n), `return \`${e}\``)(...Object.values(n));
33
29
  return String(t).replace(/`/g, "");
@@ -35,7 +31,7 @@ function d(n, e) {
35
31
  return console.error(`Error evaluating expression: ${r}`), "";
36
32
  }
37
33
  }
38
- function m(n, e) {
34
+ function f(n, e) {
39
35
  try {
40
36
  const r = window.localStorage.getItem(n);
41
37
  return r !== null ? typeof e == "string" ? r : JSON.parse(r) : e;
@@ -43,7 +39,7 @@ function m(n, e) {
43
39
  return e;
44
40
  }
45
41
  }
46
- function v(n, e, r = !1) {
42
+ function y(n, e, r = !1) {
47
43
  try {
48
44
  let t = null;
49
45
  if (typeof e == "string") {
@@ -57,9 +53,9 @@ function v(n, e, r = !1) {
57
53
  }
58
54
  }
59
55
  export {
60
- m as a,
61
- d as e,
62
- p as g,
63
- v as s,
64
- y as v
56
+ u as a,
57
+ g as e,
58
+ f as g,
59
+ y as s,
60
+ l as v
65
61
  };
package/vite-env.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference types="vite/client" />
2
- /// <reference types="vitest" />
3
- /// <reference types="vitest/globals" />
4
- /// <reference types="vitest/importMeta" />
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vitest" />
3
+ /// <reference types="vitest/globals" />
4
+ /// <reference types="vitest/importMeta" />