@m4l/core 2.0.1 → 2.0.2
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/AuthContext/index.db46edbc.js +150 -0
- package/contexts/DomainContext/{index-D24R5afH.js → index.2ed56159.js} +5 -7
- package/contexts/DomainCountryContext/index.506456a3.js +57 -0
- package/contexts/FlagsContext/{index-DcIX8FKd.js → index.5b096265.js} +1 -1
- package/contexts/ModuleDictionaryContext/index.a64207d4.js +81 -0
- package/contexts/ModulePrivilegesContext/index.79c3cc04.js +62 -0
- package/contexts/ModuleSkeletonContext/index.f6150fb9.js +30 -0
- package/contexts/NetworkContext/{index-C8wX3ESG.js → index.ec7405cd.js} +2 -2
- package/hooks/useAuth/index.4154d394.js +21 -0
- package/hooks/useBase/index.4375dcef.js +11 -0
- package/hooks/useDomain/{index-Bct5KNcv.js → index.be2722d9.js} +4 -3
- package/hooks/useEnvironment/index.25f83176.js +11 -0
- package/hooks/useFlagsStore/{index-EagkUnqK.js → index.f7c613ac.js} +4 -3
- package/hooks/useHostTools/index.66d9a667.js +11 -0
- package/hooks/useModuleDictionary/{index-C1BKVxpe.js → index.9004a259.js} +1 -1
- package/hooks/useModulePrivileges/{index-D14YH0TD.js → index.6ebd7c42.js} +1 -1
- package/hooks/useModuleSkeleton/{index-CBPHGKDR.js → index.1cdf5081.js} +1 -1
- package/hooks/useNetwork/index.3d79002b.js +11 -0
- package/hooks/usePaginate/{index-CUbw1Kpb.js → index.1306b0de.js} +2 -3
- package/hooks/usePropageteMF/{index-DEVKsg4w.js → index.c440b829.js} +1 -1
- package/index.js +75 -66
- package/{node_modules-C59GSzS1.js → node_modules.04fac7e9.js} +60 -36
- package/package.json +1 -1
- package/utils/{axiosOperation-CEky_K0E.js → axiosOperation.ac6c8eef.js} +1 -1
- package/utils/{index-BNOjc4WT.js → index.2f5ce5aa.js} +14 -10
- package/contexts/AuthContext/index-cvUlEja1.js +0 -136
- package/contexts/DomainCountryContext/index-Gjy6Za6i.js +0 -46
- package/contexts/ModuleDictionaryContext/index-kBzBlTUI.js +0 -71
- package/contexts/ModulePrivilegesContext/index-DsoWo0kK.js +0 -53
- package/contexts/ModuleSkeletonContext/index-CkhzuYKp.js +0 -20
- package/hooks/useAuth/index-BmbX0ftD.js +0 -10
- package/hooks/useBase/index-gThCdRe-.js +0 -10
- package/hooks/useEnvironment/index-D1xRKaoe.js +0 -10
- package/hooks/useHostTools/index-CL3d7qFm.js +0 -10
- package/hooks/useNetwork/index--IzMsMJ2.js +0 -10
- /package/contexts/BaseContext/{index-BZehLjuv.js → index.f9cdc955.js} +0 -0
- /package/contexts/EnvironmentContext/{index-CQz-FvKh.js → index.b33784cd.js} +0 -0
- /package/contexts/HostToolsContext/{index-DikGcxz8.js → index.499db832.js} +0 -0
- /package/hooks/useLocalStorage/{index-CsLmjbAr.js → index.91bc0791.js} +0 -0
- /package/types/{index-TbOJOhBX.js → index.42c24946.js} +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { createContext as f, useState as d, useEffect as p, useCallback as P } from "react";
|
|
2
|
-
import { C as i } from "../../types/index-TbOJOhBX.js";
|
|
3
|
-
import { jsx as v } from "react/jsx-runtime";
|
|
4
|
-
import { u as E } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
|
|
5
|
-
import { u as h } from "../../hooks/useHostTools/index-CL3d7qFm.js";
|
|
6
|
-
import { u as F } from "../../hooks/useNetwork/index--IzMsMJ2.js";
|
|
7
|
-
const L = f(null);
|
|
8
|
-
function S(n) {
|
|
9
|
-
const {
|
|
10
|
-
children: a,
|
|
11
|
-
queryPrivileges: r
|
|
12
|
-
} = n, o = E((e) => e.flagsActions.addFlag), [t, l] = d({}), {
|
|
13
|
-
startProgress: u,
|
|
14
|
-
stopProgress: m
|
|
15
|
-
} = h(), {
|
|
16
|
-
networkOperation: g
|
|
17
|
-
} = F();
|
|
18
|
-
p(() => {
|
|
19
|
-
let e = !0;
|
|
20
|
-
if (r.length === 0) {
|
|
21
|
-
o(i.FLAG_PRIVILEGES_LOADED);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
return u(), g({
|
|
25
|
-
method: "GET",
|
|
26
|
-
endPoint: "auth/login",
|
|
27
|
-
parms: {
|
|
28
|
-
privileges: r
|
|
29
|
-
}
|
|
30
|
-
// isRemote: false
|
|
31
|
-
}).then((s) => {
|
|
32
|
-
e && (l({
|
|
33
|
-
...s.data
|
|
34
|
-
}), o(i.FLAG_PRIVILEGES_LOADED));
|
|
35
|
-
}).finally(() => {
|
|
36
|
-
m();
|
|
37
|
-
}), function() {
|
|
38
|
-
e = !1;
|
|
39
|
-
};
|
|
40
|
-
}, []);
|
|
41
|
-
const c = P((e) => e in t, [t]);
|
|
42
|
-
return /* @__PURE__ */ v(L.Provider, {
|
|
43
|
-
value: {
|
|
44
|
-
hasPrivilege: c,
|
|
45
|
-
privileges: t
|
|
46
|
-
},
|
|
47
|
-
children: a
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
L as M,
|
|
52
|
-
S as a
|
|
53
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createContext as n } from "react";
|
|
2
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import { a as l } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
|
|
4
|
-
const a = n(null);
|
|
5
|
-
function m(e) {
|
|
6
|
-
const {
|
|
7
|
-
children: o,
|
|
8
|
-
flags: t
|
|
9
|
-
} = e, r = !l(t);
|
|
10
|
-
return /* @__PURE__ */ s(a.Provider, {
|
|
11
|
-
value: {
|
|
12
|
-
isSkeleton: r
|
|
13
|
-
},
|
|
14
|
-
children: o
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
a as M,
|
|
19
|
-
m as a
|
|
20
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext as o } from "react";
|
|
2
|
-
import { A as e } from "../../contexts/AuthContext/index-cvUlEja1.js";
|
|
3
|
-
const n = () => {
|
|
4
|
-
const t = o(e);
|
|
5
|
-
if (!t) throw new Error("Auth context must be use inside AuthProvider");
|
|
6
|
-
return t;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
n as u
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext as t } from "react";
|
|
2
|
-
import { B as o } from "../../contexts/BaseContext/index-BZehLjuv.js";
|
|
3
|
-
function r() {
|
|
4
|
-
const e = t(o);
|
|
5
|
-
if (!e) throw new Error("useBase context must be use inside BaseContext");
|
|
6
|
-
return e;
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
r as u
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext as t } from "react";
|
|
2
|
-
import { E as e } from "../../contexts/EnvironmentContext/index-CQz-FvKh.js";
|
|
3
|
-
const s = () => {
|
|
4
|
-
const n = t(e);
|
|
5
|
-
if (!n) throw new Error("useEnvironment context must be use inside EnvironmentContext");
|
|
6
|
-
return n;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
s as u
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext as t } from "react";
|
|
2
|
-
import { H as s } from "../../contexts/HostToolsContext/index-DikGcxz8.js";
|
|
3
|
-
const n = () => {
|
|
4
|
-
const o = t(s);
|
|
5
|
-
if (!o) throw new Error("useHostTools context must be use inside HostToolsContext");
|
|
6
|
-
return o;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
n as u
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useContext as e } from "react";
|
|
2
|
-
import { N as o } from "../../contexts/NetworkContext/index-C8wX3ESG.js";
|
|
3
|
-
const s = () => {
|
|
4
|
-
const t = e(o);
|
|
5
|
-
if (!t) throw new Error("useNetwork context must be use inside NetworkContext");
|
|
6
|
-
return t;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
s as u
|
|
10
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|