@m4l/core 2.0.26 → 2.0.27-beta.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/AuthContext/AuthContext.js +52 -48
- package/contexts/AuthContext/constants.js +2 -2
- package/contexts/AuthContext/helpers.js +1 -1
- package/contexts/BaseContext/BaseContext.js +11 -11
- package/contexts/BaseContext/store.js +1 -1
- package/contexts/DomainContext/index.js +23 -23
- package/contexts/DomainCountryContext/index.js +17 -17
- package/contexts/EnvironmentContext/index.js +8 -8
- package/contexts/FlagsContext/index.js +9 -9
- package/contexts/FlagsContext/store.js +4 -4
- package/contexts/HostToolsContext/index.js +7 -7
- package/contexts/ModuleDictionaryContext/index.js +20 -20
- package/contexts/ModulePrivilegesContext/index.js +9 -9
- package/contexts/ModuleSkeletonContext/index.js +8 -8
- package/contexts/NetworkContext/index.js +10 -10
- package/hooks/useAuth/useAuth.js +5 -4
- package/hooks/useBase/useBase.js +10 -9
- package/hooks/useDomain/index.js +8 -7
- package/hooks/useDomainCountry/index.js +2 -2
- package/hooks/useEnvironment/index.js +8 -7
- package/hooks/useFlagsStore/index.js +9 -9
- package/hooks/useHostTools/index.js +3 -2
- package/hooks/useLocalStorage/index.js +4 -4
- package/hooks/useLocalStorageWithListener/index.js +2 -1
- package/hooks/useModuleDictionary/index.js +2 -2
- package/hooks/useModulePrivileges/index.js +3 -3
- package/hooks/useModuleSkeleton/index.js +3 -3
- package/hooks/useNetwork/index.js +3 -2
- package/hooks/usePaginate/index.js +19 -19
- package/hooks/usePaginate/types.js +2 -2
- package/hooks/usePropageteMF/index.js +6 -6
- package/index.js +68 -68
- package/package.json +30 -52
- package/types/index.js +2 -2
- package/utils/axiosOperation/index.js +15 -15
- package/utils/evaluateWithContext/index.js +1 -1
- package/utils/getLocalStorage/index.js +1 -1
- package/utils/getPropertyByString/index.js +4 -4
- package/utils/setLocalStorage/index.js +3 -3
- package/utils/voidFunction.js +1 -1
- package/contexts/AuthContext/AuthContext.d.ts +0 -8
- package/contexts/AuthContext/AuthContext.test.d.ts +0 -1
- package/contexts/AuthContext/constants.d.ts +0 -7
- package/contexts/AuthContext/helpers.d.ts +0 -5
- package/contexts/AuthContext/index.d.ts +0 -2
- package/contexts/AuthContext/index.js +0 -1
- package/contexts/AuthContext/types.d.ts +0 -67
- package/contexts/BaseContext/BaseContext.d.ts +0 -7
- package/contexts/BaseContext/index.d.ts +0 -2
- package/contexts/BaseContext/index.js +0 -1
- package/contexts/BaseContext/index.test.d.ts +0 -1
- package/contexts/BaseContext/store.d.ts +0 -6
- package/contexts/BaseContext/types.d.ts +0 -37
- package/contexts/DomainContext/index.d.ts +0 -7
- package/contexts/DomainContext/index.test.d.ts +0 -1
- package/contexts/DomainContext/types.d.ts +0 -11
- package/contexts/DomainCountryContext/index.d.ts +0 -7
- package/contexts/DomainCountryContext/index.test.d.ts +0 -1
- package/contexts/DomainCountryContext/types.d.ts +0 -15
- package/contexts/EnvironmentContext/index.d.ts +0 -7
- package/contexts/EnvironmentContext/index.test.d.ts +0 -1
- package/contexts/EnvironmentContext/types.d.ts +0 -14
- package/contexts/FlagsContext/index.d.ts +0 -15
- package/contexts/FlagsContext/index.test.d.ts +0 -1
- package/contexts/FlagsContext/store.d.ts +0 -14
- package/contexts/FlagsContext/types.d.ts +0 -46
- package/contexts/HostToolsContext/index.d.ts +0 -8
- package/contexts/HostToolsContext/index.test.d.ts +0 -1
- package/contexts/HostToolsContext/types.d.ts +0 -6
- package/contexts/ModuleDictionaryContext/index.d.ts +0 -7
- package/contexts/ModuleDictionaryContext/index.test.d.ts +0 -1
- package/contexts/ModuleDictionaryContext/types.d.ts +0 -16
- package/contexts/ModulePrivilegesContext/index.d.ts +0 -7
- package/contexts/ModulePrivilegesContext/index.test.d.ts +0 -1
- package/contexts/ModulePrivilegesContext/types.d.ts +0 -9
- package/contexts/ModuleSkeletonContext/index.d.ts +0 -7
- package/contexts/ModuleSkeletonContext/index.test.d.ts +0 -1
- package/contexts/ModuleSkeletonContext/types.d.ts +0 -8
- package/contexts/NetworkContext/index.d.ts +0 -7
- package/contexts/NetworkContext/index.test.d.ts +0 -1
- package/contexts/NetworkContext/types.d.ts +0 -11
- package/contexts/index.d.ts +0 -12
- package/contexts/index.js +0 -1
- package/hooks/index.d.ts +0 -17
- package/hooks/index.js +0 -1
- package/hooks/useAuth/index.d.ts +0 -1
- package/hooks/useAuth/index.js +0 -1
- package/hooks/useAuth/useAuth.d.ts +0 -5
- package/hooks/useAuth/useAuth.test.d.ts +0 -1
- package/hooks/useBase/index.d.ts +0 -1
- package/hooks/useBase/index.js +0 -1
- package/hooks/useBase/index.test.d.ts +0 -1
- package/hooks/useBase/useBase.d.ts +0 -10
- package/hooks/useDomain/index.d.ts +0 -5
- package/hooks/useDomain/index.test.d.ts +0 -1
- package/hooks/useDomainCountry/index.d.ts +0 -4
- package/hooks/useDomainCountry/index.test.d.ts +0 -1
- package/hooks/useEnvironment/index.d.ts +0 -6
- package/hooks/useEnvironment/index.test.d.ts +0 -1
- package/hooks/useFlagsStore/index.d.ts +0 -9
- package/hooks/useFlagsStore/index.test.d.ts +0 -1
- package/hooks/useHostTools/index.d.ts +0 -5
- package/hooks/useHostTools/index.test.d.ts +0 -1
- package/hooks/useLocalStorage/index.d.ts +0 -4
- package/hooks/useLocalStorage/index.test.d.ts +0 -1
- package/hooks/useLocalStorageWithListener/index.d.ts +0 -7
- package/hooks/useLocalStorageWithListener/index.test.d.ts +0 -1
- package/hooks/useModuleDictionary/index.d.ts +0 -4
- package/hooks/useModuleDictionary/index.test.d.ts +0 -1
- package/hooks/useModulePrivileges/index.d.ts +0 -4
- package/hooks/useModulePrivileges/index.test.d.ts +0 -1
- package/hooks/useModuleSkeleton/index.d.ts +0 -4
- package/hooks/useModuleSkeleton/index.test.d.ts +0 -1
- package/hooks/useNetwork/index.d.ts +0 -5
- package/hooks/useNetwork/index.test.d.ts +0 -1
- package/hooks/usePaginate/index.d.ts +0 -14
- package/hooks/usePaginate/index.test.d.ts +0 -1
- package/hooks/usePaginate/types.d.ts +0 -17
- package/hooks/usePropageteMF/index.d.ts +0 -6
- package/hooks/usePropageteMF/types.d.ts +0 -6
- package/index.d.ts +0 -6
- package/test/constants.d.ts +0 -69
- package/test/index.d.ts +0 -3
- package/test/mocks.d.ts +0 -7
- package/test/setup.d.ts +0 -0
- package/test/types.d.ts +0 -4
- package/test/utils.d.ts +0 -9
- package/types/dictionary.d.ts +0 -13
- package/types/index.d.ts +0 -117
- package/utils/axiosOperation/index.d.ts +0 -5
- package/utils/axiosOperation/index.test.d.ts +0 -1
- package/utils/axiosOperation/types.d.ts +0 -9
- package/utils/evaluateWithContext/index.d.ts +0 -7
- package/utils/getLocalStorage/index.d.ts +0 -4
- package/utils/getLocalStorage/index.test.d.ts +0 -1
- package/utils/getPropertyByString/index.d.ts +0 -7
- package/utils/getPropertyByString/index.test.d.ts +0 -1
- package/utils/index.d.ts +0 -7
- package/utils/index.js +0 -1
- package/utils/setLocalStorage/index.d.ts +0 -4
- package/utils/setLocalStorage/index.test.d.ts +0 -1
- package/utils/voidFunction.d.ts +0 -4
- package/vite-env.d.ts +0 -4
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as U } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as _, useReducer as w, useEffect as p, useCallback as m } from "react";
|
|
3
|
+
import { useEnvironment as A } from "../../hooks/useEnvironment/index.js";
|
|
4
|
+
import { useHostTools as I } from "../../hooks/useHostTools/index.js";
|
|
5
|
+
import { useLocalStorageWithListener as L } from "../../hooks/useLocalStorageWithListener/index.js";
|
|
6
|
+
import { useNetwork as P } from "../../hooks/useNetwork/index.js";
|
|
7
|
+
import { initialState as f, EnumTypes as s } from "./constants.js";
|
|
8
|
+
import { getLocalStorage as x } from "../../utils/getLocalStorage/index.js";
|
|
9
|
+
import { setLocalStorage as l } from "../../utils/setLocalStorage/index.js";
|
|
10
|
+
import "axios";
|
|
11
|
+
import "qs";
|
|
12
|
+
import "camelcase-keys";
|
|
13
|
+
import "snakecase-keys";
|
|
14
|
+
import { EmmitEvents as N } from "../../types/index.js";
|
|
15
|
+
import { JWTReducer as k } from "./helpers.js";
|
|
16
|
+
const z = _(null);
|
|
17
|
+
function Q(h) {
|
|
18
|
+
const { children: g, isMicroFrontEnd: r = !1, loggedUser: c } = h, [T, i] = w(k, r ? { ...f, user: c, isAuthenticated: !0, isInitialized: !0 } : f), { events_add_listener: E } = I(), { networkOperation: e } = P(), { domain_token: d } = A(), [y, a] = L(
|
|
15
19
|
// Variable para saber si ha cambiado la session en otro navegador
|
|
16
20
|
"vSession",
|
|
17
21
|
(/* @__PURE__ */ new Date()).getTime() + ""
|
|
18
22
|
);
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
23
|
+
p(() => {
|
|
24
|
+
const t = async () => {
|
|
25
|
+
e({
|
|
22
26
|
method: "GET",
|
|
23
27
|
endPoint: "auth/login",
|
|
24
28
|
parms: { user_data: !0 },
|
|
25
29
|
checkUnAuthorized: !1,
|
|
26
30
|
responseToCamelCase: !0
|
|
27
|
-
}).then((
|
|
28
|
-
|
|
29
|
-
type:
|
|
31
|
+
}).then((o) => {
|
|
32
|
+
i({
|
|
33
|
+
type: s.Initial,
|
|
30
34
|
payload: {
|
|
31
35
|
isAuthenticated: !0,
|
|
32
|
-
user:
|
|
36
|
+
user: o.user
|
|
33
37
|
}
|
|
34
|
-
}),
|
|
35
|
-
email:
|
|
38
|
+
}), x("userData", {
|
|
39
|
+
email: o.user.email,
|
|
36
40
|
remember: !0
|
|
37
|
-
})?.email !==
|
|
41
|
+
})?.email !== o.user.email && l("userData", { email: o.user.email }, !0);
|
|
38
42
|
}).catch(() => {
|
|
39
|
-
|
|
40
|
-
type:
|
|
43
|
+
i({
|
|
44
|
+
type: s.Initial,
|
|
41
45
|
payload: {
|
|
42
46
|
isAuthenticated: !1,
|
|
43
47
|
user: null
|
|
@@ -45,50 +49,50 @@ function b(g) {
|
|
|
45
49
|
});
|
|
46
50
|
});
|
|
47
51
|
};
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
const D =
|
|
51
|
-
await
|
|
52
|
+
r || t();
|
|
53
|
+
}, [e, y, r, c]);
|
|
54
|
+
const D = m(async (t, o, n) => {
|
|
55
|
+
await e({
|
|
52
56
|
endPoint: "auth/login",
|
|
53
57
|
method: "POST",
|
|
54
58
|
data: {
|
|
55
|
-
email:
|
|
56
|
-
password:
|
|
59
|
+
email: t,
|
|
60
|
+
password: o,
|
|
57
61
|
domain_token: d
|
|
58
62
|
},
|
|
59
63
|
responseToCamelCase: !0
|
|
60
64
|
}).then((v) => {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
type:
|
|
65
|
+
const C = v.data;
|
|
66
|
+
n ? l("userData", { email: t, remember: n }) : l("userData", { email: "", remember: n }), i({
|
|
67
|
+
type: s.Login,
|
|
64
68
|
payload: {
|
|
65
|
-
user:
|
|
69
|
+
user: C
|
|
66
70
|
}
|
|
67
|
-
}),
|
|
71
|
+
}), a((/* @__PURE__ */ new Date()).getTime() + "");
|
|
68
72
|
});
|
|
69
|
-
}, [
|
|
70
|
-
|
|
73
|
+
}, [e, a, d]), u = m(async (t) => {
|
|
74
|
+
t && await e({
|
|
71
75
|
endPoint: "auth/logout",
|
|
72
76
|
method: "POST"
|
|
73
|
-
}),
|
|
74
|
-
}, [
|
|
77
|
+
}), i({ type: s.Logout }), a((/* @__PURE__ */ new Date()).getTime() + "");
|
|
78
|
+
}, [e, a]), S = m(() => {
|
|
75
79
|
u(!1);
|
|
76
80
|
}, [u]);
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
}, [
|
|
81
|
+
return p(function() {
|
|
82
|
+
r || E(N.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, S);
|
|
83
|
+
}, [r]), /* @__PURE__ */ U(
|
|
80
84
|
z.Provider,
|
|
81
85
|
{
|
|
82
86
|
value: {
|
|
83
|
-
...
|
|
87
|
+
...T,
|
|
84
88
|
login: D,
|
|
85
89
|
logout: u
|
|
86
90
|
},
|
|
87
|
-
children:
|
|
91
|
+
children: g
|
|
88
92
|
}
|
|
89
93
|
);
|
|
90
94
|
}
|
|
91
95
|
export {
|
|
92
|
-
z as
|
|
93
|
-
|
|
96
|
+
z as AuthContext,
|
|
97
|
+
Q as AuthProvider
|
|
94
98
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as s, useRef as c, useEffect as l } from "react";
|
|
3
|
+
import { createBaseProviderStore as i } from "./store.js";
|
|
4
4
|
import { deepEqual as f } from "fast-equals";
|
|
5
|
-
const d =
|
|
5
|
+
const d = s(null);
|
|
6
6
|
function x(t) {
|
|
7
|
-
const { children: o, value: r, storeId:
|
|
8
|
-
return e.current || (e.current =
|
|
9
|
-
storeId:
|
|
7
|
+
const { children: o, value: r, storeId: n = "general", storeDevtoolsEnabled: a = !1 } = t, e = c(null);
|
|
8
|
+
return e.current || (e.current = i({
|
|
9
|
+
storeId: n,
|
|
10
10
|
value: r
|
|
11
|
-
},
|
|
11
|
+
}, a)), l(() => {
|
|
12
12
|
if (e.current && !f(r, e.current.getState().value)) {
|
|
13
13
|
e.current.getState().actions.setPartialValue(r);
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
}, [r]), /* @__PURE__ */
|
|
16
|
+
}, [r]), /* @__PURE__ */ u(d.Provider, { value: e.current, children: o });
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
|
-
d as
|
|
20
|
-
x as
|
|
19
|
+
d as BaseContext,
|
|
20
|
+
x as BaseProvider
|
|
21
21
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { shallow as
|
|
8
|
-
const $ =
|
|
9
|
-
function
|
|
10
|
-
const { children: e } = r, { domain_token: i, host_static_assets: o, environment_assets: n } =
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as d, useState as u, useEffect as f } from "react";
|
|
3
|
+
import { useFlagsStore as p } from "../../hooks/useFlagsStore/index.js";
|
|
4
|
+
import { useEnvironment as v } from "../../hooks/useEnvironment/index.js";
|
|
5
|
+
import { useNetwork as y } from "../../hooks/useNetwork/index.js";
|
|
6
|
+
import { CommonFlags as l } from "../../types/index.js";
|
|
7
|
+
import { shallow as D } from "zustand/shallow";
|
|
8
|
+
const $ = d(null);
|
|
9
|
+
function L(r) {
|
|
10
|
+
const { children: e } = r, { domain_token: i, host_static_assets: o, environment_assets: n } = v(), a = p((t) => t.flagsActions.addFlag, D), [_, m] = u({
|
|
11
11
|
company_logo_small_url: "",
|
|
12
12
|
company_logo_normal_url: "",
|
|
13
13
|
name: "",
|
|
14
14
|
slogan: ""
|
|
15
|
-
}), { networkOperation: c } =
|
|
15
|
+
}), { networkOperation: c } = y();
|
|
16
16
|
return f(() => {
|
|
17
|
-
let
|
|
17
|
+
let t = !0;
|
|
18
18
|
return c({
|
|
19
19
|
method: "GET",
|
|
20
20
|
endPoint: `na/info/${i}`
|
|
21
|
-
}).then((
|
|
22
|
-
|
|
23
|
-
...
|
|
24
|
-
company_logo_normal_url:
|
|
25
|
-
company_logo_small_url:
|
|
26
|
-
}),
|
|
21
|
+
}).then((s) => {
|
|
22
|
+
t && (m({
|
|
23
|
+
...s.data,
|
|
24
|
+
company_logo_normal_url: s.data.company_logo_normal_url ?? `${o}/${n}/frontend/commons/assets/icons/isologo.svg`,
|
|
25
|
+
company_logo_small_url: s.data.company_logo_small_url ?? `${o}/${n}/frontend/commons/assets/icons/isotipo_m4l.svg`
|
|
26
|
+
}), a(l.FLAG_DOMAIN_LOADED));
|
|
27
27
|
}).catch(() => {
|
|
28
28
|
m({
|
|
29
29
|
company_logo_normal_url: `${o}/${n}/frontend/commons/assets/icons/isologo.svg`,
|
|
30
30
|
company_logo_small_url: `${o}/${n}/frontend/commons/assets/icons/isotipo_m4l.svg`,
|
|
31
31
|
name: "Pending",
|
|
32
32
|
slogan: "Pending"
|
|
33
|
-
}),
|
|
33
|
+
}), a(l.FLAG_DOMAIN_LOADED);
|
|
34
34
|
}).finally(() => {
|
|
35
35
|
}), function() {
|
|
36
|
-
|
|
36
|
+
t = !1;
|
|
37
37
|
};
|
|
38
|
-
}, []), /* @__PURE__ */
|
|
38
|
+
}, []), /* @__PURE__ */ g(
|
|
39
39
|
$.Provider,
|
|
40
40
|
{
|
|
41
41
|
value: {
|
|
@@ -48,6 +48,6 @@ function C(r) {
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
export {
|
|
51
|
-
$ as
|
|
52
|
-
|
|
51
|
+
$ as DomainContext,
|
|
52
|
+
L as DomainProvider
|
|
53
53
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as y, useState as T, useCallback as f } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
3
|
+
import { useHostTools as M } from "../../hooks/useHostTools/index.js";
|
|
4
|
+
import { usePropageteMF as N } from "../../hooks/usePropageteMF/index.js";
|
|
5
|
+
import { EmmitEvents as r } from "../../types/index.js";
|
|
6
|
+
const p = y(null);
|
|
7
7
|
function A(e) {
|
|
8
8
|
const {
|
|
9
|
-
children:
|
|
9
|
+
children: i,
|
|
10
10
|
isMicroFrontEnd: t,
|
|
11
|
-
id:
|
|
12
|
-
currency:
|
|
13
|
-
currency_decimal_digits:
|
|
11
|
+
id: s,
|
|
12
|
+
currency: m,
|
|
13
|
+
currency_decimal_digits: a,
|
|
14
14
|
decimal_symbol: c,
|
|
15
15
|
thousands_symbol: u
|
|
16
|
-
} = e, { events_emit: _ } =
|
|
17
|
-
id:
|
|
18
|
-
currency:
|
|
19
|
-
currency_decimal_digits:
|
|
16
|
+
} = e, { events_emit: _ } = M(), [l, C] = T({
|
|
17
|
+
id: s,
|
|
18
|
+
currency: m,
|
|
19
|
+
currency_decimal_digits: a,
|
|
20
20
|
decimal_symbol: c,
|
|
21
21
|
thousands_symbol: u
|
|
22
22
|
}), n = (o) => {
|
|
23
23
|
C(o);
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
N({
|
|
26
26
|
isMicroFrontEnd: t,
|
|
27
27
|
event: r.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE,
|
|
28
28
|
setHandler: n
|
|
@@ -31,17 +31,17 @@ function A(e) {
|
|
|
31
31
|
t || (n(o), _(r.EMMIT_EVENT_HOST_DOMAIN_COUNTRY_CHANGE, o));
|
|
32
32
|
}, []);
|
|
33
33
|
return /* @__PURE__ */ d(
|
|
34
|
-
|
|
34
|
+
p.Provider,
|
|
35
35
|
{
|
|
36
36
|
value: {
|
|
37
37
|
...l,
|
|
38
38
|
changeDomainCountry: E
|
|
39
39
|
},
|
|
40
|
-
children:
|
|
40
|
+
children: i
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
export {
|
|
45
|
-
|
|
46
|
-
A as
|
|
45
|
+
p as DomainCountryContext,
|
|
46
|
+
A as DomainCountryProvider
|
|
47
47
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as l, useCallback as u, useState as m } from "react";
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { children: o, ...
|
|
3
|
+
const d = l(null);
|
|
4
|
+
function a(e) {
|
|
5
|
+
const { children: o, ...n } = e, s = u((t) => {
|
|
6
6
|
if (e.isIsolatation)
|
|
7
7
|
return `${e.host}/module/assets/icons/${t}`;
|
|
8
8
|
if (e?.isMicroFrontend) {
|
|
@@ -12,12 +12,12 @@ function c(e) {
|
|
|
12
12
|
} else
|
|
13
13
|
return `mf/module/assets/icons/${t}`;
|
|
14
14
|
}, []), [r] = m({
|
|
15
|
-
...
|
|
16
|
-
getModuleUrlIconAsset:
|
|
15
|
+
...n,
|
|
16
|
+
getModuleUrlIconAsset: s
|
|
17
17
|
});
|
|
18
|
-
return /* @__PURE__ */ i(
|
|
18
|
+
return /* @__PURE__ */ i(d.Provider, { value: r, children: o });
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
d as EnvironmentContext,
|
|
22
|
+
a as EnvironmentProvider
|
|
23
23
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as s, useRef as c } from "react";
|
|
3
|
+
import { createFlagsStore as f } from "./store.js";
|
|
4
|
+
const i = s(null);
|
|
5
5
|
function m({ children: e, storeId: t, storeDevtoolsEnabled: o }) {
|
|
6
|
-
const r =
|
|
7
|
-
return r.current || (r.current =
|
|
6
|
+
const r = c(void 0);
|
|
7
|
+
return r.current || (r.current = f({
|
|
8
8
|
flags: [],
|
|
9
9
|
storeId: t
|
|
10
|
-
}, o)), /* @__PURE__ */
|
|
10
|
+
}, o)), /* @__PURE__ */ n(i.Provider, { value: r.current, children: e });
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
m as
|
|
13
|
+
i as FlagsContext,
|
|
14
|
+
m as FlagsProvider
|
|
15
15
|
};
|
|
@@ -21,9 +21,9 @@ const d = (e, o) => {
|
|
|
21
21
|
* Agrega una bandera.
|
|
22
22
|
*/
|
|
23
23
|
addFlag: (s) => {
|
|
24
|
-
r((
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
r((t) => {
|
|
25
|
+
const a = t.flags;
|
|
26
|
+
a.findIndex((l) => l === s) < 0 && (t.flags = [...a, s]);
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -32,5 +32,5 @@ const d = (e, o) => {
|
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
export {
|
|
35
|
-
v as
|
|
35
|
+
v as createFlagsStore
|
|
36
36
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as n, useState as l } from "react";
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { children: t, ...
|
|
6
|
-
return /* @__PURE__ */
|
|
3
|
+
const i = n(null);
|
|
4
|
+
function a(o) {
|
|
5
|
+
const { children: t, ...r } = o, [e] = l(r);
|
|
6
|
+
return /* @__PURE__ */ s(i.Provider, { value: e, children: t });
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
i as HostToolsContext,
|
|
10
|
+
a as HostToolsProvider
|
|
11
11
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { jsx as $ } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as E, useState as l, useMemo as O, useEffect as y, useCallback as v } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { useEnvironment as b } from "../../hooks/useEnvironment/index.js";
|
|
4
|
+
import { useFlagsStore as I } from "../../hooks/useFlagsStore/index.js";
|
|
5
|
+
import { useHostTools as T } from "../../hooks/useHostTools/index.js";
|
|
6
|
+
import { useNetwork as k } from "../../hooks/useNetwork/index.js";
|
|
7
|
+
import { CommonFlags as w } from "../../types/index.js";
|
|
8
8
|
const G = E(null);
|
|
9
9
|
function B(F) {
|
|
10
10
|
const {
|
|
11
11
|
children: L,
|
|
12
|
-
componentsDictionary:
|
|
13
|
-
moduleId:
|
|
14
|
-
moduleNameField:
|
|
15
|
-
currentLang:
|
|
12
|
+
componentsDictionary: s,
|
|
13
|
+
moduleId: d,
|
|
14
|
+
moduleNameField: u = "module_name",
|
|
15
|
+
currentLang: A = "en",
|
|
16
16
|
isAuth: c = !0,
|
|
17
|
-
moduleDictionaryLoaded:
|
|
18
|
-
} = F, m = I((t) => t.flagsActions.addFlag), [n, f] = l(void 0), { domain_token:
|
|
17
|
+
moduleDictionaryLoaded: C
|
|
18
|
+
} = F, m = I((t) => t.flagsActions.addFlag), [n, f] = l(void 0), { domain_token: M } = b(), { startProgress: S, stopProgress: _ } = T(), { networkOperation: x } = k(), [p, N] = l(C), [g, D] = l(!1), h = O(() => s ? s.filter(
|
|
19
19
|
(t, o, e) => e.indexOf(t) === o
|
|
20
|
-
) : [], [
|
|
20
|
+
) : [], [s]);
|
|
21
21
|
y(() => {
|
|
22
22
|
let t = !0;
|
|
23
23
|
return p ? (f({
|
|
24
24
|
...p
|
|
25
25
|
}), N(void 0), D(!0)) : (S(), x({
|
|
26
26
|
method: "GET",
|
|
27
|
-
endPoint: c ? `dictionaries/${
|
|
27
|
+
endPoint: c ? `dictionaries/${d}` : `na/dictionaries/${d}`,
|
|
28
28
|
parms: {
|
|
29
29
|
comps: h,
|
|
30
30
|
// lang: 'en',
|
|
31
|
-
...c ? {} : { domain_token:
|
|
31
|
+
...c ? {} : { domain_token: M }
|
|
32
32
|
}
|
|
33
33
|
// isRemote: false
|
|
34
34
|
}).then((o) => {
|
|
@@ -40,10 +40,10 @@ function B(F) {
|
|
|
40
40
|
})), function() {
|
|
41
41
|
t = !1;
|
|
42
42
|
};
|
|
43
|
-
}, [
|
|
43
|
+
}, [A, h]), y(() => {
|
|
44
44
|
g && m(w.FLAG_DICTIONARY_LOADED);
|
|
45
45
|
}, [m, g]);
|
|
46
|
-
const
|
|
46
|
+
const a = v(
|
|
47
47
|
(t, ...o) => {
|
|
48
48
|
if (n === void 0)
|
|
49
49
|
return "";
|
|
@@ -61,13 +61,13 @@ function B(F) {
|
|
|
61
61
|
return e || `N_D:[${t}]`;
|
|
62
62
|
},
|
|
63
63
|
[n]
|
|
64
|
-
), P = v(() =>
|
|
64
|
+
), P = v(() => a(u), [u, a]);
|
|
65
65
|
return /* @__PURE__ */ $(
|
|
66
66
|
G.Provider,
|
|
67
67
|
{
|
|
68
68
|
value: {
|
|
69
69
|
moduleDictionary: n,
|
|
70
|
-
getLabel:
|
|
70
|
+
getLabel: a,
|
|
71
71
|
getModuleLabel: P
|
|
72
72
|
},
|
|
73
73
|
children: L
|
|
@@ -75,6 +75,6 @@ function B(F) {
|
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
export {
|
|
78
|
-
G as
|
|
79
|
-
B as
|
|
78
|
+
G as ModuleDictionaryContext,
|
|
79
|
+
B as ModuleDictionaryProvider
|
|
80
80
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as d, useState as p, useEffect as P, useCallback as v } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useFlagsStore as E } from "../../hooks/useFlagsStore/index.js";
|
|
4
|
+
import { useHostTools as A } from "../../hooks/useHostTools/index.js";
|
|
5
|
+
import { useNetwork as h } from "../../hooks/useNetwork/index.js";
|
|
6
|
+
import { CommonFlags as i } from "../../types/index.js";
|
|
7
7
|
const F = d(null);
|
|
8
8
|
function S(n) {
|
|
9
|
-
const { children:
|
|
9
|
+
const { children: l, queryPrivileges: o } = n, s = E((e) => e.flagsActions.addFlag), [r, a] = p({}), { startProgress: u, stopProgress: m } = A(), { networkOperation: f } = h();
|
|
10
10
|
P(() => {
|
|
11
11
|
let e = !0;
|
|
12
12
|
if (o.length === 0) {
|
|
@@ -21,7 +21,7 @@ function S(n) {
|
|
|
21
21
|
}
|
|
22
22
|
// isRemote: false
|
|
23
23
|
}).then((t) => {
|
|
24
|
-
e && (
|
|
24
|
+
e && (a({
|
|
25
25
|
...t.data
|
|
26
26
|
}), s(i.FLAG_PRIVILEGES_LOADED));
|
|
27
27
|
}).finally(() => {
|
|
@@ -41,11 +41,11 @@ function S(n) {
|
|
|
41
41
|
hasPrivilege: g,
|
|
42
42
|
privileges: r
|
|
43
43
|
},
|
|
44
|
-
children:
|
|
44
|
+
children: l
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
export {
|
|
49
|
-
F as
|
|
50
|
-
S as
|
|
49
|
+
F as ModulePrivilegesContext,
|
|
50
|
+
S as ModulePrivilegesProvider
|
|
51
51
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const { children: o, flags: t } = e, r = !
|
|
2
|
+
import { createContext as l } from "react";
|
|
3
|
+
import { useFlagsPresent as s } from "../../hooks/useFlagsStore/index.js";
|
|
4
|
+
const i = l(null);
|
|
5
|
+
function d(e) {
|
|
6
|
+
const { children: o, flags: t } = e, r = !s(t);
|
|
7
7
|
return /* @__PURE__ */ n(
|
|
8
|
-
|
|
8
|
+
i.Provider,
|
|
9
9
|
{
|
|
10
10
|
value: {
|
|
11
11
|
isSkeleton: r
|
|
@@ -15,6 +15,6 @@ function m(e) {
|
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
i as ModuleSkeletonContext,
|
|
19
|
+
d as ModuleSkeletonProvider
|
|
20
20
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const p =
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as m, useCallback as a } from "react";
|
|
3
|
+
import { useEnvironment as l } from "../../hooks/useEnvironment/index.js";
|
|
4
|
+
import { useHostTools as u } from "../../hooks/useHostTools/index.js";
|
|
5
|
+
const p = m(null);
|
|
6
6
|
function d(n) {
|
|
7
|
-
const { children: e, axiosOperation: o } = n, t =
|
|
8
|
-
async (
|
|
7
|
+
const { children: e, axiosOperation: o } = n, t = l(), r = u(), s = a(
|
|
8
|
+
async (i) => o(i, t, r),
|
|
9
9
|
[t, o, r]
|
|
10
10
|
);
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
12
|
p.Provider,
|
|
13
13
|
{
|
|
14
14
|
value: {
|
|
@@ -19,6 +19,6 @@ function d(n) {
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
p as
|
|
23
|
-
d as
|
|
22
|
+
p as NetworkContext,
|
|
23
|
+
d as NetworkProvider
|
|
24
24
|
};
|
package/hooks/useAuth/useAuth.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import {
|
|
1
|
+
import { useContext as e } from "react";
|
|
2
|
+
import { AuthContext as o } from "../../contexts/AuthContext/AuthContext.js";
|
|
3
3
|
const n = () => {
|
|
4
|
-
const t = o
|
|
4
|
+
const t = e(o);
|
|
5
5
|
if (!t)
|
|
6
6
|
throw new Error("Auth context must be use inside AuthProvider");
|
|
7
7
|
return t;
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
n as
|
|
10
|
+
n as default,
|
|
11
|
+
n as useAuth
|
|
11
12
|
};
|