@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.
Files changed (143) hide show
  1. package/contexts/AuthContext/AuthContext.js +52 -48
  2. package/contexts/AuthContext/constants.js +2 -2
  3. package/contexts/AuthContext/helpers.js +1 -1
  4. package/contexts/BaseContext/BaseContext.js +11 -11
  5. package/contexts/BaseContext/store.js +1 -1
  6. package/contexts/DomainContext/index.js +23 -23
  7. package/contexts/DomainCountryContext/index.js +17 -17
  8. package/contexts/EnvironmentContext/index.js +8 -8
  9. package/contexts/FlagsContext/index.js +9 -9
  10. package/contexts/FlagsContext/store.js +4 -4
  11. package/contexts/HostToolsContext/index.js +7 -7
  12. package/contexts/ModuleDictionaryContext/index.js +20 -20
  13. package/contexts/ModulePrivilegesContext/index.js +9 -9
  14. package/contexts/ModuleSkeletonContext/index.js +8 -8
  15. package/contexts/NetworkContext/index.js +10 -10
  16. package/hooks/useAuth/useAuth.js +5 -4
  17. package/hooks/useBase/useBase.js +10 -9
  18. package/hooks/useDomain/index.js +8 -7
  19. package/hooks/useDomainCountry/index.js +2 -2
  20. package/hooks/useEnvironment/index.js +8 -7
  21. package/hooks/useFlagsStore/index.js +9 -9
  22. package/hooks/useHostTools/index.js +3 -2
  23. package/hooks/useLocalStorage/index.js +4 -4
  24. package/hooks/useLocalStorageWithListener/index.js +2 -1
  25. package/hooks/useModuleDictionary/index.js +2 -2
  26. package/hooks/useModulePrivileges/index.js +3 -3
  27. package/hooks/useModuleSkeleton/index.js +3 -3
  28. package/hooks/useNetwork/index.js +3 -2
  29. package/hooks/usePaginate/index.js +19 -19
  30. package/hooks/usePaginate/types.js +2 -2
  31. package/hooks/usePropageteMF/index.js +6 -6
  32. package/index.js +68 -68
  33. package/package.json +30 -52
  34. package/types/index.js +2 -2
  35. package/utils/axiosOperation/index.js +15 -15
  36. package/utils/evaluateWithContext/index.js +1 -1
  37. package/utils/getLocalStorage/index.js +1 -1
  38. package/utils/getPropertyByString/index.js +4 -4
  39. package/utils/setLocalStorage/index.js +3 -3
  40. package/utils/voidFunction.js +1 -1
  41. package/contexts/AuthContext/AuthContext.d.ts +0 -8
  42. package/contexts/AuthContext/AuthContext.test.d.ts +0 -1
  43. package/contexts/AuthContext/constants.d.ts +0 -7
  44. package/contexts/AuthContext/helpers.d.ts +0 -5
  45. package/contexts/AuthContext/index.d.ts +0 -2
  46. package/contexts/AuthContext/index.js +0 -1
  47. package/contexts/AuthContext/types.d.ts +0 -67
  48. package/contexts/BaseContext/BaseContext.d.ts +0 -7
  49. package/contexts/BaseContext/index.d.ts +0 -2
  50. package/contexts/BaseContext/index.js +0 -1
  51. package/contexts/BaseContext/index.test.d.ts +0 -1
  52. package/contexts/BaseContext/store.d.ts +0 -6
  53. package/contexts/BaseContext/types.d.ts +0 -37
  54. package/contexts/DomainContext/index.d.ts +0 -7
  55. package/contexts/DomainContext/index.test.d.ts +0 -1
  56. package/contexts/DomainContext/types.d.ts +0 -11
  57. package/contexts/DomainCountryContext/index.d.ts +0 -7
  58. package/contexts/DomainCountryContext/index.test.d.ts +0 -1
  59. package/contexts/DomainCountryContext/types.d.ts +0 -15
  60. package/contexts/EnvironmentContext/index.d.ts +0 -7
  61. package/contexts/EnvironmentContext/index.test.d.ts +0 -1
  62. package/contexts/EnvironmentContext/types.d.ts +0 -14
  63. package/contexts/FlagsContext/index.d.ts +0 -15
  64. package/contexts/FlagsContext/index.test.d.ts +0 -1
  65. package/contexts/FlagsContext/store.d.ts +0 -14
  66. package/contexts/FlagsContext/types.d.ts +0 -46
  67. package/contexts/HostToolsContext/index.d.ts +0 -8
  68. package/contexts/HostToolsContext/index.test.d.ts +0 -1
  69. package/contexts/HostToolsContext/types.d.ts +0 -6
  70. package/contexts/ModuleDictionaryContext/index.d.ts +0 -7
  71. package/contexts/ModuleDictionaryContext/index.test.d.ts +0 -1
  72. package/contexts/ModuleDictionaryContext/types.d.ts +0 -16
  73. package/contexts/ModulePrivilegesContext/index.d.ts +0 -7
  74. package/contexts/ModulePrivilegesContext/index.test.d.ts +0 -1
  75. package/contexts/ModulePrivilegesContext/types.d.ts +0 -9
  76. package/contexts/ModuleSkeletonContext/index.d.ts +0 -7
  77. package/contexts/ModuleSkeletonContext/index.test.d.ts +0 -1
  78. package/contexts/ModuleSkeletonContext/types.d.ts +0 -8
  79. package/contexts/NetworkContext/index.d.ts +0 -7
  80. package/contexts/NetworkContext/index.test.d.ts +0 -1
  81. package/contexts/NetworkContext/types.d.ts +0 -11
  82. package/contexts/index.d.ts +0 -12
  83. package/contexts/index.js +0 -1
  84. package/hooks/index.d.ts +0 -17
  85. package/hooks/index.js +0 -1
  86. package/hooks/useAuth/index.d.ts +0 -1
  87. package/hooks/useAuth/index.js +0 -1
  88. package/hooks/useAuth/useAuth.d.ts +0 -5
  89. package/hooks/useAuth/useAuth.test.d.ts +0 -1
  90. package/hooks/useBase/index.d.ts +0 -1
  91. package/hooks/useBase/index.js +0 -1
  92. package/hooks/useBase/index.test.d.ts +0 -1
  93. package/hooks/useBase/useBase.d.ts +0 -10
  94. package/hooks/useDomain/index.d.ts +0 -5
  95. package/hooks/useDomain/index.test.d.ts +0 -1
  96. package/hooks/useDomainCountry/index.d.ts +0 -4
  97. package/hooks/useDomainCountry/index.test.d.ts +0 -1
  98. package/hooks/useEnvironment/index.d.ts +0 -6
  99. package/hooks/useEnvironment/index.test.d.ts +0 -1
  100. package/hooks/useFlagsStore/index.d.ts +0 -9
  101. package/hooks/useFlagsStore/index.test.d.ts +0 -1
  102. package/hooks/useHostTools/index.d.ts +0 -5
  103. package/hooks/useHostTools/index.test.d.ts +0 -1
  104. package/hooks/useLocalStorage/index.d.ts +0 -4
  105. package/hooks/useLocalStorage/index.test.d.ts +0 -1
  106. package/hooks/useLocalStorageWithListener/index.d.ts +0 -7
  107. package/hooks/useLocalStorageWithListener/index.test.d.ts +0 -1
  108. package/hooks/useModuleDictionary/index.d.ts +0 -4
  109. package/hooks/useModuleDictionary/index.test.d.ts +0 -1
  110. package/hooks/useModulePrivileges/index.d.ts +0 -4
  111. package/hooks/useModulePrivileges/index.test.d.ts +0 -1
  112. package/hooks/useModuleSkeleton/index.d.ts +0 -4
  113. package/hooks/useModuleSkeleton/index.test.d.ts +0 -1
  114. package/hooks/useNetwork/index.d.ts +0 -5
  115. package/hooks/useNetwork/index.test.d.ts +0 -1
  116. package/hooks/usePaginate/index.d.ts +0 -14
  117. package/hooks/usePaginate/index.test.d.ts +0 -1
  118. package/hooks/usePaginate/types.d.ts +0 -17
  119. package/hooks/usePropageteMF/index.d.ts +0 -6
  120. package/hooks/usePropageteMF/types.d.ts +0 -6
  121. package/index.d.ts +0 -6
  122. package/test/constants.d.ts +0 -69
  123. package/test/index.d.ts +0 -3
  124. package/test/mocks.d.ts +0 -7
  125. package/test/setup.d.ts +0 -0
  126. package/test/types.d.ts +0 -4
  127. package/test/utils.d.ts +0 -9
  128. package/types/dictionary.d.ts +0 -13
  129. package/types/index.d.ts +0 -117
  130. package/utils/axiosOperation/index.d.ts +0 -5
  131. package/utils/axiosOperation/index.test.d.ts +0 -1
  132. package/utils/axiosOperation/types.d.ts +0 -9
  133. package/utils/evaluateWithContext/index.d.ts +0 -7
  134. package/utils/getLocalStorage/index.d.ts +0 -4
  135. package/utils/getLocalStorage/index.test.d.ts +0 -1
  136. package/utils/getPropertyByString/index.d.ts +0 -7
  137. package/utils/getPropertyByString/index.test.d.ts +0 -1
  138. package/utils/index.d.ts +0 -7
  139. package/utils/index.js +0 -1
  140. package/utils/setLocalStorage/index.d.ts +0 -4
  141. package/utils/setLocalStorage/index.test.d.ts +0 -1
  142. package/utils/voidFunction.d.ts +0 -4
  143. package/vite-env.d.ts +0 -4
@@ -1,43 +1,47 @@
1
- import { jsx as C } from "react/jsx-runtime";
2
- import { createContext as U, useReducer as _, useEffect as f, useCallback as l } from "react";
3
- import { i as p, E as n } from "./constants.js";
4
- import { E as w } from "../../types/index.js";
5
- import { J as I } from "./helpers.js";
6
- import { u as L } from "../../hooks/useHostTools/index.js";
7
- import { u as P } from "../../hooks/useNetwork/index.js";
8
- import { u as x } from "../../hooks/useEnvironment/index.js";
9
- import { u as N } from "../../hooks/useLocalStorageWithListener/index.js";
10
- import { s as m } from "../../utils/setLocalStorage/index.js";
11
- import { g as k } from "../../utils/getLocalStorage/index.js";
12
- const z = U(null);
13
- function b(g) {
14
- const { children: h, isMicroFrontEnd: o = !1, loggedUser: c } = g, [E, s] = _(I, o ? { ...p, user: c, isAuthenticated: !0, isInitialized: !0 } : p), { events_add_listener: T } = L(), { networkOperation: t } = P(), { domain_token: d } = x(), [y, r] = N(
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
- f(() => {
20
- const e = async () => {
21
- t({
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((a) => {
28
- s({
29
- type: n.Initial,
31
+ }).then((o) => {
32
+ i({
33
+ type: s.Initial,
30
34
  payload: {
31
35
  isAuthenticated: !0,
32
- user: a.user
36
+ user: o.user
33
37
  }
34
- }), k("userData", {
35
- email: a.user.email,
38
+ }), x("userData", {
39
+ email: o.user.email,
36
40
  remember: !0
37
- })?.email !== a.user.email && m("userData", { email: a.user.email }, !0);
41
+ })?.email !== o.user.email && l("userData", { email: o.user.email }, !0);
38
42
  }).catch(() => {
39
- s({
40
- type: n.Initial,
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
- o || e();
49
- }, [t, y, o, c]);
50
- const D = l(async (e, a, i) => {
51
- await t({
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: e,
56
- password: a,
59
+ email: t,
60
+ password: o,
57
61
  domain_token: d
58
62
  },
59
63
  responseToCamelCase: !0
60
64
  }).then((v) => {
61
- const A = v.data;
62
- i ? m("userData", { email: e, remember: i }) : m("userData", { email: "", remember: i }), s({
63
- type: n.Login,
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: A
69
+ user: C
66
70
  }
67
- }), r((/* @__PURE__ */ new Date()).getTime() + "");
71
+ }), a((/* @__PURE__ */ new Date()).getTime() + "");
68
72
  });
69
- }, [t, r, d]), u = l(async (e) => {
70
- e && await t({
73
+ }, [e, a, d]), u = m(async (t) => {
74
+ t && await e({
71
75
  endPoint: "auth/logout",
72
76
  method: "POST"
73
- }), s({ type: n.Logout }), r((/* @__PURE__ */ new Date()).getTime() + "");
74
- }, [t, r]), S = l(() => {
77
+ }), i({ type: s.Logout }), a((/* @__PURE__ */ new Date()).getTime() + "");
78
+ }, [e, a]), S = m(() => {
75
79
  u(!1);
76
80
  }, [u]);
77
- return f(function() {
78
- o || T(w.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, S);
79
- }, [o]), /* @__PURE__ */ C(
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
- ...E,
87
+ ...T,
84
88
  login: D,
85
89
  logout: u
86
90
  },
87
- children: h
91
+ children: g
88
92
  }
89
93
  );
90
94
  }
91
95
  export {
92
- z as A,
93
- b as a
96
+ z as AuthContext,
97
+ Q as AuthProvider
94
98
  };
@@ -5,6 +5,6 @@ const a = {
5
5
  user: null
6
6
  };
7
7
  export {
8
- t as E,
9
- a as i
8
+ t as EnumTypes,
9
+ a as initialState
10
10
  };
@@ -23,5 +23,5 @@ const r = (u, e) => {
23
23
  }
24
24
  };
25
25
  export {
26
- r as J
26
+ r as JWTReducer
27
27
  };
@@ -1,21 +1,21 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { createContext as u, useRef as c, useEffect as i } from "react";
3
- import { c as l } from "./store.js";
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 = u(null);
5
+ const d = s(null);
6
6
  function x(t) {
7
- const { children: o, value: r, storeId: a = "general", storeDevtoolsEnabled: n = !1 } = t, e = c();
8
- return e.current || (e.current = l({
9
- storeId: a,
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
- }, n)), i(() => {
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__ */ s(d.Provider, { value: e.current, children: o });
16
+ }, [r]), /* @__PURE__ */ u(d.Provider, { value: e.current, children: o });
17
17
  }
18
18
  export {
19
- d as B,
20
- x as a
19
+ d as BaseContext,
20
+ x as BaseProvider
21
21
  };
@@ -46,5 +46,5 @@ function V(e, o = !1) {
46
46
  );
47
47
  }
48
48
  export {
49
- V as c
49
+ V as createBaseProviderStore
50
50
  };
@@ -1,41 +1,41 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { createContext as g, useState as d, useEffect as f } from "react";
3
- import { u as p } from "../../hooks/useFlagsStore/index.js";
4
- import { u as D } from "../../hooks/useEnvironment/index.js";
5
- import { u as v } from "../../hooks/useNetwork/index.js";
6
- import { C as l } from "../../types/index.js";
7
- import { shallow as y } from "zustand/shallow";
8
- const $ = g(null);
9
- function C(r) {
10
- const { children: e } = r, { domain_token: i, host_static_assets: o, environment_assets: n } = D(), t = p((s) => s.flagsActions.addFlag, y), [_, m] = d({
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 } = v();
15
+ }), { networkOperation: c } = y();
16
16
  return f(() => {
17
- let s = !0;
17
+ let t = !0;
18
18
  return c({
19
19
  method: "GET",
20
20
  endPoint: `na/info/${i}`
21
- }).then((a) => {
22
- s && (m({
23
- ...a.data,
24
- company_logo_normal_url: a.data.company_logo_normal_url ?? `${o}/${n}/frontend/commons/assets/icons/isologo.svg`,
25
- company_logo_small_url: a.data.company_logo_small_url ?? `${o}/${n}/frontend/commons/assets/icons/isotipo_m4l.svg`
26
- }), t(l.FLAG_DOMAIN_LOADED));
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
- }), t(l.FLAG_DOMAIN_LOADED);
33
+ }), a(l.FLAG_DOMAIN_LOADED);
34
34
  }).finally(() => {
35
35
  }), function() {
36
- s = !1;
36
+ t = !1;
37
37
  };
38
- }, []), /* @__PURE__ */ u(
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 D,
52
- C as a
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 { E as r } from "../../types/index.js";
4
- import { u as D } from "../../hooks/useHostTools/index.js";
5
- import { u as M } from "../../hooks/usePropageteMF/index.js";
6
- const N = y(null);
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: s,
9
+ children: i,
10
10
  isMicroFrontEnd: t,
11
- id: i,
12
- currency: a,
13
- currency_decimal_digits: m,
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: _ } = D(), [l, C] = T({
17
- id: i,
18
- currency: a,
19
- currency_decimal_digits: m,
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
- M({
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
- N.Provider,
34
+ p.Provider,
35
35
  {
36
36
  value: {
37
37
  ...l,
38
38
  changeDomainCountry: E
39
39
  },
40
- children: s
40
+ children: i
41
41
  }
42
42
  );
43
43
  }
44
44
  export {
45
- N as D,
46
- A as a
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 a = l(null);
4
- function c(e) {
5
- const { children: o, ...s } = e, n = u((t) => {
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
- ...s,
16
- getModuleUrlIconAsset: n
15
+ ...n,
16
+ getModuleUrlIconAsset: s
17
17
  });
18
- return /* @__PURE__ */ i(a.Provider, { value: r, children: o });
18
+ return /* @__PURE__ */ i(d.Provider, { value: r, children: o });
19
19
  }
20
20
  export {
21
- a as E,
22
- c as a
21
+ d as EnvironmentContext,
22
+ a as EnvironmentProvider
23
23
  };
@@ -1,15 +1,15 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { createContext as a, useRef as n } from "react";
3
- import { c } from "./store.js";
4
- const f = a(null);
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 = n();
7
- return r.current || (r.current = c({
6
+ const r = c(void 0);
7
+ return r.current || (r.current = f({
8
8
  flags: [],
9
9
  storeId: t
10
- }, o)), /* @__PURE__ */ s(f.Provider, { value: r.current, children: e });
10
+ }, o)), /* @__PURE__ */ n(i.Provider, { value: r.current, children: e });
11
11
  }
12
12
  export {
13
- f as F,
14
- m as a
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((a) => {
25
- const t = a.flags;
26
- t.findIndex((l) => l === s) < 0 && (a.flags = [...t, s]);
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 c
35
+ v as createFlagsStore
36
36
  };
@@ -1,11 +1,11 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
2
  import { createContext as n, useState as l } from "react";
3
- const a = n(null);
4
- function u(o) {
5
- const { children: t, ...s } = o, [r] = l(s);
6
- return /* @__PURE__ */ e(a.Provider, { value: r, children: t });
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
- a as H,
10
- u as a
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 { u as b } from "../../hooks/useEnvironment/index.js";
4
- import { u as I } from "../../hooks/useFlagsStore/index.js";
5
- import { u as T } from "../../hooks/useHostTools/index.js";
6
- import { u as k } from "../../hooks/useNetwork/index.js";
7
- import { C as w } from "../../types/index.js";
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: a,
13
- moduleId: u,
14
- moduleNameField: d = "module_name",
15
- currentLang: C = "en",
12
+ componentsDictionary: s,
13
+ moduleId: d,
14
+ moduleNameField: u = "module_name",
15
+ currentLang: A = "en",
16
16
  isAuth: c = !0,
17
- moduleDictionaryLoaded: M
18
- } = F, m = I((t) => t.flagsActions.addFlag), [n, f] = l(void 0), { domain_token: A } = b(), { startProgress: S, stopProgress: _ } = T(), { networkOperation: x } = k(), [p, N] = l(M), [g, D] = l(!1), h = O(() => a ? a.filter(
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
- ) : [], [a]);
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/${u}` : `na/dictionaries/${u}`,
27
+ endPoint: c ? `dictionaries/${d}` : `na/dictionaries/${d}`,
28
28
  parms: {
29
29
  comps: h,
30
30
  // lang: 'en',
31
- ...c ? {} : { domain_token: A }
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
- }, [C, h]), y(() => {
43
+ }, [A, h]), y(() => {
44
44
  g && m(w.FLAG_DICTIONARY_LOADED);
45
45
  }, [m, g]);
46
- const s = v(
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(() => s(d), [d, s]);
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: s,
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 M,
79
- B as a
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 { C as i } from "../../types/index.js";
4
- import { u as E } from "../../hooks/useFlagsStore/index.js";
5
- import { u as A } from "../../hooks/useHostTools/index.js";
6
- import { u as h } from "../../hooks/useNetwork/index.js";
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: a, queryPrivileges: o } = n, s = E((e) => e.flagsActions.addFlag), [r, l] = p({}), { startProgress: u, stopProgress: m } = A(), { networkOperation: f } = h();
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 && (l({
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: a
44
+ children: l
45
45
  }
46
46
  );
47
47
  }
48
48
  export {
49
- F as M,
50
- S as a
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 s } from "react";
3
- import { a as l } from "../../hooks/useFlagsStore/index.js";
4
- const a = s(null);
5
- function m(e) {
6
- const { children: o, flags: t } = e, r = !l(t);
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
- a.Provider,
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
- a as M,
19
- m as a
18
+ i as ModuleSkeletonContext,
19
+ d as ModuleSkeletonProvider
20
20
  };
@@ -1,14 +1,14 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createContext as c, useCallback as m } from "react";
3
- import { u } from "../../hooks/useEnvironment/index.js";
4
- import { u as l } from "../../hooks/useHostTools/index.js";
5
- const p = c(null);
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 = u(), r = l(), s = m(
8
- async (a) => o(a, t, r),
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__ */ i(
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 N,
23
- d as a
22
+ p as NetworkContext,
23
+ d as NetworkProvider
24
24
  };
@@ -1,11 +1,12 @@
1
- import { useContext as o } from "react";
2
- import { A as e } from "../../contexts/AuthContext/AuthContext.js";
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(e);
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 u
10
+ n as default,
11
+ n as useAuth
11
12
  };