@m4l/core 1.0.0 → 1.0.1
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/contexts/DomainContext/{index.fc9c9f7e.js → index.2ed56159.js} +2 -2
- package/contexts/DomainCountryContext/{index.2da8b247.js → index.e7a82641.js} +8 -7
- package/contexts/FlagsContext/index.5b096265.js +41 -0
- package/contexts/ModuleDictionaryContext/{index.cc2a5fa3.js → index.011db031.js} +5 -5
- package/contexts/ModulePrivilegesContext/{index.039085db.js → index.a45d4cf7.js} +5 -5
- package/contexts/ModuleSkeletonContext/{index.334164fc.js → index.2cd78f14.js} +5 -5
- package/hooks/useDomain/{index.73578fd1.js → index.b743be01.js} +2 -2
- package/hooks/useFlagsStore/{index.fa8dcf62.js → index.f7c613ac.js} +5 -4
- package/hooks/useModuleDictionary/{index.0b2e51cf.js → index.0a0998b6.js} +1 -1
- package/hooks/useModulePrivileges/{index.3c1155fb.js → index.24c10523.js} +1 -1
- package/hooks/useModuleSkeleton/{index.2b62072e.js → index.12ff3650.js} +1 -1
- package/index.js +70 -69
- package/node_modules.04fac7e9.js +401 -0
- package/package.json +4 -2
- package/contexts/FlagsContext/index.3f08bff3.js +0 -39
- package/node_modules.7069706f.js +0 -835
- package/packages/m4l_core/vite-env.d.ts +0 -4
- package/vendor.3b4bd7d3.js +0 -32
- /package/{packages/m4l_core/contexts → contexts}/BaseContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/BaseContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/DomainContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/DomainContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/DomainCountryContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/DomainCountryContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/EnvironmentContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/EnvironmentContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/FlagsContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/FlagsContext/store.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/FlagsContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/HostToolsContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/HostToolsContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/ModuleDictionaryContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/ModuleDictionaryContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/ModulePrivilegesContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/ModulePrivilegesContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/ModuleSkeletonContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/ModuleSkeletonContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/NetworkContext/index.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/NetworkContext/types.d.ts +0 -0
- /package/{packages/m4l_core/contexts → contexts}/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useBase/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useDomain/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useDomainCountry/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useEnvironment/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useFlagsStore/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useHostTools/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useLocalStorage/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useLocalStorageWithListener/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useModuleDictionary/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useModulePrivileges/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useModuleSkeleton/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/useNetwork/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/usePaginate/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/usePaginate/types.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/usePropageteMF/index.d.ts +0 -0
- /package/{packages/m4l_core/hooks → hooks}/usePropageteMF/types.d.ts +0 -0
- /package/{packages/m4l_core/index.d.ts → index.d.ts} +0 -0
- /package/{packages/m4l_core/types → types}/dictionary.d.ts +0 -0
- /package/{packages/m4l_core/types → types}/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/axiosOperation/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/axiosOperation/types.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/evaluateWithContext/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/getLocalStorage/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/getPropertyByString/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/setLocalStorage/index.d.ts +0 -0
- /package/{packages/m4l_core/utils → utils}/voidFunction.d.ts +0 -0
|
@@ -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.
|
|
3
|
+
"version": "1.0.1",
|
|
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,39 +0,0 @@
|
|
|
1
|
-
import { createContext as l, useRef as n } from "react";
|
|
2
|
-
import { c, d as f, i } from "../../node_modules.7069706f.js";
|
|
3
|
-
import { jsx as g } from "react/jsx-runtime";
|
|
4
|
-
const d = (o) => c(
|
|
5
|
-
f(
|
|
6
|
-
i((r) => ({
|
|
7
|
-
...o,
|
|
8
|
-
flagsActions: {
|
|
9
|
-
clearFlags: () => {
|
|
10
|
-
r((e) => {
|
|
11
|
-
e.flags = [];
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
addFlag: (e) => {
|
|
15
|
-
r((t) => {
|
|
16
|
-
const a = t.flags;
|
|
17
|
-
a.findIndex((s) => s === e) < 0 && (t.flags = [...a, e]);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
})),
|
|
22
|
-
{ name: "FlagsStore" }
|
|
23
|
-
)
|
|
24
|
-
), m = l(null);
|
|
25
|
-
function p({
|
|
26
|
-
children: o
|
|
27
|
-
}) {
|
|
28
|
-
const r = n();
|
|
29
|
-
return r.current || (r.current = d({
|
|
30
|
-
flags: []
|
|
31
|
-
})), /* @__PURE__ */ g(m.Provider, {
|
|
32
|
-
value: r.current,
|
|
33
|
-
children: o
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
m as F,
|
|
38
|
-
p as a
|
|
39
|
-
};
|