@m4l/core 0.1.27 → 0.1.29

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.
@@ -0,0 +1,49 @@
1
+ import { createContext as c, useState as u, useEffect as d } from "react";
2
+ import { u as f } from "../../hooks/useFlags/index.a986729d.js";
3
+ import { u as p } from "../../hooks/useEnvironment/index.04dca988.js";
4
+ import { u as g } from "../../hooks/useNetwork/index.acbf28d5.js";
5
+ import { C as v } from "../../types/index.5f1b0c45.js";
6
+ import { jsx as y } from "react/jsx-runtime";
7
+ const D = c(null);
8
+ function k(m) {
9
+ const {
10
+ children: e
11
+ } = m, {
12
+ domain_token: l,
13
+ host_static_assets: n,
14
+ environment_assets: t
15
+ } = p(), {
16
+ addFlag: r
17
+ } = f(), [a, i] = u({
18
+ company_logo_small_url: "",
19
+ company_logo_normal_url: "",
20
+ name: ""
21
+ }), {
22
+ networkOperation: _
23
+ } = g();
24
+ return console.log("domain values", a), d(() => {
25
+ let s = !0;
26
+ return _({
27
+ method: "GET",
28
+ endPoint: `na/info/${l}`
29
+ }).then((o) => {
30
+ s && (i({
31
+ ...o.data,
32
+ company_logo_normal_url: o.data.company_logo_normal_url ?? `${n}/${t}/frontend/commons/assets/icons/isologo.svg`,
33
+ company_logo_small_url: o.data.company_logo_small_url ?? `${n}/${t}/frontend/commons/assets/icons/isotipo_m4l.svg`
34
+ }), r(v.FLAG_DOMAIN_LOADED));
35
+ }).finally(() => {
36
+ }), function() {
37
+ s = !1;
38
+ };
39
+ }, []), /* @__PURE__ */ y(D.Provider, {
40
+ value: {
41
+ ...a
42
+ },
43
+ children: e
44
+ });
45
+ }
46
+ export {
47
+ D,
48
+ k as a
49
+ };
@@ -3,10 +3,10 @@ import "../../index.js";
3
3
  import "../EnvironmentContext/index.7045c64f.js";
4
4
  import "../FlagsContext/index.5f795859.js";
5
5
  import { u as N } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.d09ee435.js";
7
- import "../ModuleDictionaryContext/index.0c69445f.js";
8
- import "../ModulePrivilegesContext/index.40fc9b6b.js";
9
- import "../ModuleSkeletonContext/index.1f894dc3.js";
6
+ import "../DomainContext/index.8f3b8dbb.js";
7
+ import "../ModuleDictionaryContext/index.dc124e04.js";
8
+ import "../ModulePrivilegesContext/index.b163a7a9.js";
9
+ import "../ModuleSkeletonContext/index.82c9e98f.js";
10
10
  import "../NetworkContext/index.d1dfbc3a.js";
11
11
  import { E as n } from "../../types/index.5f1b0c45.js";
12
12
  import { jsx as f } from "react/jsx-runtime";
@@ -1,50 +1,50 @@
1
- import { createContext as y, useState as L, useEffect as M, useCallback as u } from "react";
1
+ import { createContext as y, useState as F, useEffect as L, useCallback as u } from "react";
2
2
  import "../../index.js";
3
- import { u as N } from "../../hooks/useEnvironment/index.04dca988.js";
4
- import { u as P } from "../../hooks/useFlags/index.a986729d.js";
5
- import { u as _ } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.d09ee435.js";
7
- import "../ModulePrivilegesContext/index.40fc9b6b.js";
8
- import "../ModuleSkeletonContext/index.1f894dc3.js";
9
- import { u as x } from "../../hooks/useNetwork/index.acbf28d5.js";
10
- import "../DomainCountryContext/index.de35d791.js";
11
- import { C as A } from "../../types/index.5f1b0c45.js";
12
- import { jsx as E } from "react/jsx-runtime";
13
- const F = y(null);
3
+ import { u as M } from "../../hooks/useEnvironment/index.04dca988.js";
4
+ import { u as N } from "../../hooks/useFlags/index.a986729d.js";
5
+ import { u as P } from "../../hooks/useHostTools/index.66d9a667.js";
6
+ import "../DomainContext/index.8f3b8dbb.js";
7
+ import "../ModulePrivilegesContext/index.b163a7a9.js";
8
+ import "../ModuleSkeletonContext/index.82c9e98f.js";
9
+ import { u as _ } from "../../hooks/useNetwork/index.acbf28d5.js";
10
+ import "../DomainCountryContext/index.0a8be64d.js";
11
+ import { C as x } from "../../types/index.5f1b0c45.js";
12
+ import { jsx as A } from "react/jsx-runtime";
13
+ const E = y(null);
14
14
  function Y(l) {
15
15
  const {
16
16
  children: c,
17
17
  componentsDictionary: d,
18
18
  moduleId: i,
19
- moduleName: s = "module_name",
19
+ moduleNameField: s = "module_name",
20
20
  currentLang: a = "en",
21
21
  isAuth: m = !0
22
22
  } = l, {
23
23
  addFlag: p
24
- } = P(), [r, f] = L(void 0), {
24
+ } = N(), [r, f] = F(void 0), {
25
25
  domain_token: g
26
- } = N(), {
26
+ } = M(), {
27
27
  startProgress: D,
28
28
  stopProgress: h
29
- } = _(), {
29
+ } = P(), {
30
30
  networkOperation: v
31
- } = x();
32
- M(() => {
31
+ } = _();
32
+ L(() => {
33
33
  let t = !0;
34
34
  return D(), v({
35
35
  method: "GET",
36
36
  endPoint: m ? `dictionaries/${i}` : `na/dictionaries/${i}`,
37
37
  parms: {
38
38
  comps: d,
39
+ lang: a,
39
40
  ...m ? {} : {
40
- domain_token: g,
41
- lang: a
41
+ domain_token: g
42
42
  }
43
43
  }
44
44
  }).then((o) => {
45
45
  t && (f({
46
46
  ...o
47
- }), p(A.FLAG_DICTIONARY_LOADED));
47
+ }), p(x.FLAG_DICTIONARY_LOADED));
48
48
  }).finally(() => {
49
49
  h();
50
50
  }), function() {
@@ -64,7 +64,7 @@ function Y(l) {
64
64
  }
65
65
  return o || `N_D:[${t}]`;
66
66
  }, [r]), C = u(() => n(s), [s, n]);
67
- return /* @__PURE__ */ E(F.Provider, {
67
+ return /* @__PURE__ */ A(E.Provider, {
68
68
  value: {
69
69
  moduleDictionary: r,
70
70
  getLabel: n,
@@ -74,6 +74,6 @@ function Y(l) {
74
74
  });
75
75
  }
76
76
  export {
77
- F as M,
77
+ E as M,
78
78
  Y as a
79
79
  };
@@ -4,7 +4,7 @@ export interface ModuleDictionaryProviderProps {
4
4
  currentLang?: string;
5
5
  isAuth?: boolean;
6
6
  moduleId: string;
7
- moduleName?: string;
7
+ moduleNameField?: string;
8
8
  componentsDictionary: string[];
9
9
  children: ReactNode;
10
10
  }
@@ -3,11 +3,11 @@ import "../../index.js";
3
3
  import "../EnvironmentContext/index.7045c64f.js";
4
4
  import { u as v } from "../../hooks/useFlags/index.a986729d.js";
5
5
  import { u as E } from "../../hooks/useHostTools/index.66d9a667.js";
6
- import "../DomainContext/index.d09ee435.js";
7
- import "../ModuleDictionaryContext/index.0c69445f.js";
8
- import "../ModuleSkeletonContext/index.1f894dc3.js";
6
+ import "../DomainContext/index.8f3b8dbb.js";
7
+ import "../ModuleDictionaryContext/index.dc124e04.js";
8
+ import "../ModuleSkeletonContext/index.82c9e98f.js";
9
9
  import { u as h } from "../../hooks/useNetwork/index.acbf28d5.js";
10
- import "../DomainCountryContext/index.de35d791.js";
10
+ import "../DomainCountryContext/index.0a8be64d.js";
11
11
  import { C as i } from "../../types/index.5f1b0c45.js";
12
12
  import { jsx as L } from "react/jsx-runtime";
13
13
  const C = f(null);
@@ -3,11 +3,11 @@ import "../../index.js";
3
3
  import "../EnvironmentContext/index.7045c64f.js";
4
4
  import { a as m } from "../../hooks/useFlags/index.a986729d.js";
5
5
  import "../HostToolsContext/index.499db832.js";
6
- import "../DomainContext/index.d09ee435.js";
7
- import "../ModuleDictionaryContext/index.0c69445f.js";
8
- import "../ModulePrivilegesContext/index.40fc9b6b.js";
6
+ import "../DomainContext/index.8f3b8dbb.js";
7
+ import "../ModuleDictionaryContext/index.dc124e04.js";
8
+ import "../ModulePrivilegesContext/index.b163a7a9.js";
9
9
  import "../NetworkContext/index.d1dfbc3a.js";
10
- import "../DomainCountryContext/index.de35d791.js";
10
+ import "../DomainCountryContext/index.0a8be64d.js";
11
11
  import { jsx as n } from "react/jsx-runtime";
12
12
  const p = i(null);
13
13
  function P(o) {
@@ -1,6 +1,6 @@
1
1
  import { useContext as t } from "react";
2
- import { D as n } from "../../contexts/DomainContext/index.d09ee435.js";
3
- import { D as e } from "../../contexts/DomainCountryContext/index.de35d791.js";
2
+ import { D as n } from "../../contexts/DomainContext/index.8f3b8dbb.js";
3
+ import { D as e } from "../../contexts/DomainCountryContext/index.0a8be64d.js";
4
4
  const m = () => {
5
5
  const o = t(n);
6
6
  if (!o)
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../contexts/ModuleDictionaryContext/index.0c69445f.js";
2
+ import { M as e } from "../../contexts/ModuleDictionaryContext/index.dc124e04.js";
3
3
  const n = () => {
4
4
  const o = t(e);
5
5
  if (!o)
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { M as t } from "../../contexts/ModulePrivilegesContext/index.40fc9b6b.js";
2
+ import { M as t } from "../../contexts/ModulePrivilegesContext/index.b163a7a9.js";
3
3
  const i = () => {
4
4
  const e = o(t);
5
5
  if (!e)
@@ -1,5 +1,5 @@
1
1
  import { useState as n, useContext as s, useEffect as u } from "react";
2
- import { M as r } from "../../contexts/ModuleSkeletonContext/index.1f894dc3.js";
2
+ import { M as r } from "../../contexts/ModuleSkeletonContext/index.82c9e98f.js";
3
3
  const S = () => {
4
4
  const [t, o] = n(!0), e = s(r);
5
5
  if (!e)
package/index.js CHANGED
@@ -2,21 +2,21 @@ import { createContext as a, useContext as s } from "react";
2
2
  import { E as g, a as C } from "./contexts/EnvironmentContext/index.7045c64f.js";
3
3
  import { F as c, a as M } from "./contexts/FlagsContext/index.5f795859.js";
4
4
  import { H as S, a as y } from "./contexts/HostToolsContext/index.499db832.js";
5
- import { D as F, a as k } from "./contexts/DomainContext/index.d09ee435.js";
6
- import { M as w, a as L } from "./contexts/ModuleDictionaryContext/index.0c69445f.js";
7
- import { M as N, a as h } from "./contexts/ModulePrivilegesContext/index.40fc9b6b.js";
8
- import { M as b, a as j } from "./contexts/ModuleSkeletonContext/index.1f894dc3.js";
5
+ import { D as F, a as k } from "./contexts/DomainContext/index.8f3b8dbb.js";
6
+ import { M as w, a as L } from "./contexts/ModuleDictionaryContext/index.dc124e04.js";
7
+ import { M as N, a as h } from "./contexts/ModulePrivilegesContext/index.b163a7a9.js";
8
+ import { M as b, a as j } from "./contexts/ModuleSkeletonContext/index.82c9e98f.js";
9
9
  import { N as W, a as q } from "./contexts/NetworkContext/index.d1dfbc3a.js";
10
- import { D as A, a as G } from "./contexts/DomainCountryContext/index.de35d791.js";
10
+ import { D as A, a as G } from "./contexts/DomainCountryContext/index.0a8be64d.js";
11
11
  import { jsx as n } from "react/jsx-runtime";
12
12
  import { u as J } from "./hooks/useEnvironment/index.04dca988.js";
13
13
  import { u as Q, a as R } from "./hooks/useFlags/index.a986729d.js";
14
14
  import { u as V } from "./hooks/useHostTools/index.66d9a667.js";
15
- import { u as Y, a as Z } from "./hooks/useDomain/index.1971480c.js";
15
+ import { u as Y, a as Z } from "./hooks/useDomain/index.41602da4.js";
16
16
  import { u as $, a as oo } from "./hooks/useLocalStorage/index.281b7ae8.js";
17
- import { u as ro } from "./hooks/useModuleDictionary/index.2dc80b62.js";
18
- import { u as ao } from "./hooks/useModulePrivileges/index.f1272511.js";
19
- import { u as no } from "./hooks/useModuleSkeleton/index.c1c6e2cc.js";
17
+ import { u as ro } from "./hooks/useModuleDictionary/index.3fb05525.js";
18
+ import { u as ao } from "./hooks/useModulePrivileges/index.f250cb2d.js";
19
+ import { u as no } from "./hooks/useModuleSkeleton/index.73b1f9d4.js";
20
20
  import { u as uo } from "./hooks/useNetwork/index.acbf28d5.js";
21
21
  import { i as xo, u as lo } from "./hooks/usePaginate/index.7cb17527.js";
22
22
  import { C as fo, E as vo } from "./types/index.5f1b0c45.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/core",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "peerDependencies": {
@@ -1,45 +0,0 @@
1
- import { createContext as l, useState as u, useEffect as c } from "react";
2
- import { u as f } from "../../hooks/useFlags/index.a986729d.js";
3
- import { u as d } from "../../hooks/useEnvironment/index.04dca988.js";
4
- import { u as p } from "../../hooks/useNetwork/index.acbf28d5.js";
5
- import { C as _ } from "../../types/index.5f1b0c45.js";
6
- import { jsx as D } from "react/jsx-runtime";
7
- const g = l(null);
8
- function k(t) {
9
- const {
10
- children: e
11
- } = t, {
12
- domain_token: a
13
- } = d(), {
14
- addFlag: r
15
- } = f(), [m, s] = u({
16
- company_logo_small_url: "",
17
- company_logo_normal_url: "",
18
- name: ""
19
- }), {
20
- networkOperation: i
21
- } = p();
22
- return c(() => {
23
- let o = !0;
24
- return i({
25
- method: "GET",
26
- endPoint: `na/info/${a}`
27
- }).then((n) => {
28
- o && (s({
29
- ...n.data
30
- }), r(_.FLAG_DOMAIN_LOADED));
31
- }).finally(() => {
32
- }), function() {
33
- o = !1;
34
- };
35
- }, []), /* @__PURE__ */ D(g.Provider, {
36
- value: {
37
- ...m
38
- },
39
- children: e
40
- });
41
- }
42
- export {
43
- g as D,
44
- k as a
45
- };