@m4l/core 2.0.3 → 2.0.4

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 (58) hide show
  1. package/contexts/AuthContext/constants.d.ts +5 -0
  2. package/contexts/AuthContext/index.d.ts +1 -1
  3. package/contexts/AuthContext/index.dd2ed9e6.js +137 -0
  4. package/contexts/AuthContext/types.d.ts +17 -18
  5. package/contexts/BaseContext/index.d.ts +1 -0
  6. package/contexts/DomainContext/{index-D24R5afH.js → index.2ed56159.js} +5 -7
  7. package/contexts/DomainContext/index.d.ts +1 -0
  8. package/contexts/DomainCountryContext/{index-Gjy6Za6i.js → index.3cdf9462.js} +3 -3
  9. package/contexts/DomainCountryContext/index.d.ts +1 -0
  10. package/contexts/EnvironmentContext/index.d.ts +1 -0
  11. package/contexts/FlagsContext/{index-DcIX8FKd.js → index.5b096265.js} +1 -1
  12. package/contexts/FlagsContext/index.d.ts +1 -0
  13. package/contexts/HostToolsContext/index.d.ts +1 -0
  14. package/contexts/ModuleDictionaryContext/index.63e1dbbd.js +74 -0
  15. package/contexts/ModuleDictionaryContext/index.d.ts +1 -0
  16. package/contexts/ModulePrivilegesContext/{index-DsoWo0kK.js → index.1274092a.js} +4 -5
  17. package/contexts/ModulePrivilegesContext/index.d.ts +1 -0
  18. package/contexts/ModuleSkeletonContext/{index-CkhzuYKp.js → index.9267d86a.js} +1 -1
  19. package/contexts/ModuleSkeletonContext/index.d.ts +1 -0
  20. package/contexts/NetworkContext/index.d.ts +1 -0
  21. package/contexts/NetworkContext/{index-C8wX3ESG.js → index.ec7405cd.js} +2 -2
  22. package/contexts/index.d.ts +1 -1
  23. package/hooks/useAuth/index.94b696a7.js +11 -0
  24. package/hooks/useAuth/useAuth.d.ts +1 -1
  25. package/hooks/useBase/index.4375dcef.js +11 -0
  26. package/hooks/useDomain/{index-Bct5KNcv.js → index.dd6909f6.js} +4 -3
  27. package/hooks/useEnvironment/index.25f83176.js +11 -0
  28. package/hooks/useFlagsStore/{index-EagkUnqK.js → index.f7c613ac.js} +4 -3
  29. package/hooks/useHostTools/index.66d9a667.js +11 -0
  30. package/hooks/useModuleDictionary/{index-C1BKVxpe.js → index.80b52ae5.js} +1 -1
  31. package/hooks/useModulePrivileges/{index-D14YH0TD.js → index.e93abed8.js} +1 -1
  32. package/hooks/useModuleSkeleton/{index-CBPHGKDR.js → index.a8238d1d.js} +1 -1
  33. package/hooks/useNetwork/index.3d79002b.js +11 -0
  34. package/hooks/usePaginate/{index-DOOXkJPW.js → index.0a5d70e5.js} +2 -5
  35. package/hooks/usePaginate/index.d.ts +1 -0
  36. package/hooks/usePropageteMF/{index-DEVKsg4w.js → index.c440b829.js} +1 -1
  37. package/index.js +83 -74
  38. package/{node_modules-C59GSzS1.js → node_modules.04fac7e9.js} +60 -36
  39. package/package.json +1 -1
  40. package/types/dictionary.d.ts +1 -1
  41. package/types/index.d.ts +1 -0
  42. package/utils/{axiosOperation-CEky_K0E.js → axiosOperation.ac6c8eef.js} +1 -1
  43. package/utils/getPropertyByString/index.d.ts +3 -1
  44. package/utils/index.54ccec2f.js +61 -0
  45. package/vite-env.d.ts +4 -4
  46. package/contexts/AuthContext/index-cvUlEja1.js +0 -136
  47. package/contexts/ModuleDictionaryContext/index-kBzBlTUI.js +0 -71
  48. package/hooks/useAuth/index-BmbX0ftD.js +0 -10
  49. package/hooks/useBase/index-gThCdRe-.js +0 -10
  50. package/hooks/useEnvironment/index-D1xRKaoe.js +0 -10
  51. package/hooks/useHostTools/index-CL3d7qFm.js +0 -10
  52. package/hooks/useNetwork/index--IzMsMJ2.js +0 -10
  53. package/utils/index-BNOjc4WT.js +0 -61
  54. /package/contexts/BaseContext/{index-BZehLjuv.js → index.f9cdc955.js} +0 -0
  55. /package/contexts/EnvironmentContext/{index-CQz-FvKh.js → index.b33784cd.js} +0 -0
  56. /package/contexts/HostToolsContext/{index-DikGcxz8.js → index.499db832.js} +0 -0
  57. /package/hooks/useLocalStorage/{index-CsLmjbAr.js → index.91bc0791.js} +0 -0
  58. /package/types/{index-TbOJOhBX.js → index.42c24946.js} +0 -0
@@ -0,0 +1,5 @@
1
+ export declare enum EnumTypes {
2
+ Initial = "INITIALIZE",
3
+ Login = "LOGIN",
4
+ Logout = "LOGOUT"
5
+ }
@@ -1,2 +1,2 @@
1
1
  export * from './AuthContext';
2
- export * from './types';
2
+ export type { UserAuth, AuthState } from './types';
@@ -0,0 +1,137 @@
1
+ import { createContext as A, useReducer as y, useEffect as d } from "react";
2
+ import { E } from "../../types/index.42c24946.js";
3
+ import { jsx as v } from "react/jsx-runtime";
4
+ import { u as D } from "../../hooks/useHostTools/index.66d9a667.js";
5
+ import { u as N } from "../../hooks/useNetwork/index.3d79002b.js";
6
+ import { u as O } from "../../hooks/useEnvironment/index.25f83176.js";
7
+ import { u as S } from "../../hooks/useLocalStorage/index.91bc0791.js";
8
+ import { g as U, s as u } from "../../utils/index.54ccec2f.js";
9
+ var i = /* @__PURE__ */ ((e) => (e.Initial = "INITIALIZE", e.Login = "LOGIN", e.Logout = "LOGOUT", e))(i || {});
10
+ const w = {
11
+ isAuthenticated: !1,
12
+ isInitialized: !1,
13
+ user: null
14
+ }, _ = (e, t) => {
15
+ switch (t.type) {
16
+ case "INITIALIZE":
17
+ return {
18
+ isAuthenticated: t.payload.isAuthenticated,
19
+ isInitialized: !0,
20
+ user: t.payload.user
21
+ };
22
+ case "LOGIN":
23
+ return {
24
+ ...e,
25
+ isAuthenticated: !0,
26
+ user: t.payload.user
27
+ };
28
+ case "LOGOUT":
29
+ return {
30
+ ...e,
31
+ isAuthenticated: !1,
32
+ user: null
33
+ };
34
+ default:
35
+ return e;
36
+ }
37
+ }, C = A(null);
38
+ function P(e) {
39
+ e({
40
+ type: i.Initial,
41
+ payload: {
42
+ isAuthenticated: !1,
43
+ user: null
44
+ }
45
+ });
46
+ }
47
+ function M(e) {
48
+ const {
49
+ children: t
50
+ } = e, [m, o] = y(_, w), {
51
+ events_add_listener: h
52
+ } = D(), {
53
+ networkOperation: r
54
+ } = N(), {
55
+ domain_token: f
56
+ } = O(), [p, l] = S(
57
+ "vSession",
58
+ new Date().getTime() + ""
59
+ );
60
+ d(() => {
61
+ (async () => {
62
+ r({
63
+ method: "GET",
64
+ endPoint: "auth/login",
65
+ parms: {
66
+ user_data: !0
67
+ },
68
+ checkUnAuthorized: !1,
69
+ responseToCamelCase: !0
70
+ }).then((s) => {
71
+ o({
72
+ type: i.Initial,
73
+ payload: {
74
+ isAuthenticated: !0,
75
+ user: s.user
76
+ }
77
+ }), U("userData", {
78
+ email: s.user.email,
79
+ remember: !0
80
+ })?.email !== s.user.email && u("userData", {
81
+ email: s.user.email
82
+ }, !0);
83
+ }).catch(() => {
84
+ P(o);
85
+ });
86
+ })();
87
+ }, [p]);
88
+ const I = async (a, s, n) => {
89
+ await r({
90
+ endPoint: "auth/login",
91
+ method: "POST",
92
+ data: {
93
+ email: a,
94
+ password: s,
95
+ domain_token: f
96
+ },
97
+ responseToCamelCase: !0
98
+ }).then((T) => {
99
+ const L = T.data;
100
+ n ? u("userData", {
101
+ email: a,
102
+ remember: n
103
+ }) : u("userData", {
104
+ email: "",
105
+ remember: n
106
+ }), o({
107
+ type: i.Login,
108
+ payload: {
109
+ user: L
110
+ }
111
+ }), l(new Date().getTime() + "");
112
+ });
113
+ }, c = async (a) => {
114
+ a && await r({
115
+ endPoint: "auth/logout",
116
+ method: "POST"
117
+ }), o({
118
+ type: i.Logout
119
+ }), l(new Date().getTime() + "");
120
+ }, g = () => {
121
+ c(!1);
122
+ };
123
+ return d(function() {
124
+ h(E.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, g);
125
+ }, []), /* @__PURE__ */ v(C.Provider, {
126
+ value: {
127
+ ...m,
128
+ login: I,
129
+ logout: c
130
+ },
131
+ children: t
132
+ });
133
+ }
134
+ export {
135
+ C as A,
136
+ M as a
137
+ };
@@ -1,11 +1,21 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { DomainCountry } from '../DomainCountryContext/types';
3
3
  import type { Maybe } from '../../types';
4
- export declare enum EnumTypes {
5
- Initial = "INITIALIZE",
6
- Login = "LOGIN",
7
- Logout = "LOGOUT"
4
+ import { EnumTypes } from './constants';
5
+ export interface UserAuth {
6
+ email: string;
7
+ id: number;
8
+ firstName: string;
9
+ lastName: string;
10
+ accountId: number;
11
+ domainCountry: DomainCountry;
12
+ avatarUrl?: Maybe<string>;
13
+ userTypeId?: number;
14
+ preferences?: {
15
+ deviceLabel?: string;
16
+ };
8
17
  }
18
+ export declare type AuthUserType = Maybe<UserAuth>;
9
19
  export declare type AuthProviderProps = {
10
20
  children: ReactNode;
11
21
  };
@@ -22,29 +32,18 @@ export declare type ActionMap<M extends {
22
32
  export declare type SessionAuthPayload = {
23
33
  [EnumTypes.Initial]: {
24
34
  isAuthenticated: boolean;
25
- user: AuthUser;
35
+ user: AuthUserType;
26
36
  };
27
37
  [EnumTypes.Login]: {
28
- user: AuthUser;
38
+ user: AuthUserType;
29
39
  };
30
40
  [EnumTypes.Logout]: undefined;
31
41
  };
32
42
  export declare type SessionActions = ActionMap<SessionAuthPayload>[keyof ActionMap<SessionAuthPayload>];
33
- export interface User {
34
- email: string;
35
- id: number;
36
- first_name: string;
37
- last_name: string;
38
- account_id: number;
39
- domain_country: DomainCountry;
40
- avatar_url?: Maybe<string>;
41
- user_type_id?: number;
42
- }
43
- export declare type AuthUser = Maybe<User>;
44
43
  export declare type AuthState = {
45
44
  isAuthenticated: boolean;
46
45
  isInitialized: boolean;
47
- user: AuthUser;
46
+ user: Maybe<UserAuth>;
48
47
  };
49
48
  export interface SessionContextType extends AuthState {
50
49
  login: (email: string, password: string, remember: boolean) => object | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { BaseProviderProps } from './types';
2
3
  declare const BaseContext: import("react").Context<unknown>;
3
4
  declare function BaseProvider<T>(props: BaseProviderProps<T>): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { createContext as u, useState as g, useEffect as d } from "react";
2
- import { u as f } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
3
- import { u as p } from "../../hooks/useEnvironment/index-D1xRKaoe.js";
4
- import { u as D } from "../../hooks/useNetwork/index--IzMsMJ2.js";
5
- import { C as l } from "../../types/index-TbOJOhBX.js";
6
- import { s as v } from "../../node_modules-C59GSzS1.js";
2
+ import { u as f } from "../../hooks/useFlagsStore/index.f7c613ac.js";
3
+ import { u as p } from "../../hooks/useEnvironment/index.25f83176.js";
4
+ import { u as D } from "../../hooks/useNetwork/index.3d79002b.js";
5
+ import { C as l } from "../../types/index.42c24946.js";
6
+ import { s as v } from "../../node_modules.04fac7e9.js";
7
7
  import { jsx as y } from "react/jsx-runtime";
8
8
  const $ = u(null);
9
9
  function C(r) {
@@ -46,8 +46,6 @@ function C(r) {
46
46
  }, []), /* @__PURE__ */ y($.Provider, {
47
47
  value: {
48
48
  ..._
49
- // formStatus,
50
- // setFormStatus,
51
49
  },
52
50
  children: e
53
51
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DomainProviderProps, Domain } from './types';
2
3
  declare const DomainContext: import("react").Context<Domain | null>;
3
4
  declare function DomainProvider(props: DomainProviderProps): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { createContext as d, useState as y, useCallback as T } from "react";
2
- import { E as r } from "../../types/index-TbOJOhBX.js";
2
+ import { E as r } from "../../types/index.42c24946.js";
3
3
  import { jsx as f } from "react/jsx-runtime";
4
- import { u as D } from "../../hooks/useHostTools/index-CL3d7qFm.js";
5
- import { u as M } from "../../hooks/usePropageteMF/index-DEVKsg4w.js";
4
+ import { u as D } from "../../hooks/useHostTools/index.66d9a667.js";
5
+ import { u as M } from "../../hooks/usePropageteMF/index.c440b829.js";
6
6
  const N = d(null);
7
7
  function A(e) {
8
8
  const {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DomainCountryContextType, DomainCountryProviderProps } from './types';
2
3
  declare const DomainCountryContext: import("react").Context<DomainCountryContextType | null>;
3
4
  declare function DomainCountryProvider(props: DomainCountryProviderProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EnvironmentContextType, EnvironmentProviderProps } from './types';
2
3
  declare const EnvironmentContext: import("react").Context<EnvironmentContextType | null>;
3
4
  declare function EnvironmentProvider(props: EnvironmentProviderProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { createContext as l, useRef as n } from "react";
2
2
  import { createStore as f } from "zustand";
3
3
  import { devtools as i } from "zustand/middleware";
4
- import { i as c } from "../../node_modules-C59GSzS1.js";
4
+ import { i as c } from "../../node_modules.04fac7e9.js";
5
5
  import { jsx as m } from "react/jsx-runtime";
6
6
  const g = (e) => f(
7
7
  i(
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FlagsProviderProps } from './types';
2
3
  declare const FlagsContext: import("react").Context<(Omit<Omit<import("zustand").StoreApi<import("./types").FlagsStateWithActions>, "setState"> & {
3
4
  setState<A extends string | {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { HostToolsType } from '../../types';
2
3
  import type { HostToolsProviderProps } from './types';
3
4
  declare const HostToolsContext: import("react").Context<HostToolsType | null>;
@@ -0,0 +1,74 @@
1
+ import { createContext as y, useState as L, useEffect as M, useCallback as c } from "react";
2
+ import { C as N } from "../../types/index.42c24946.js";
3
+ import { jsx as P } from "react/jsx-runtime";
4
+ import { u as _ } from "../../hooks/useFlagsStore/index.f7c613ac.js";
5
+ import { u as $ } from "../../hooks/useEnvironment/index.25f83176.js";
6
+ import { u as x } from "../../hooks/useHostTools/index.66d9a667.js";
7
+ import { u as E } from "../../hooks/useNetwork/index.3d79002b.js";
8
+ const b = y(null);
9
+ function j(m) {
10
+ const {
11
+ children: d,
12
+ componentsDictionary: f,
13
+ moduleId: a,
14
+ moduleNameField: l = "module_name",
15
+ currentLang: p = "en",
16
+ isAuth: u = !0
17
+ } = m, g = _((t) => t.flagsActions.addFlag), [r, h] = L(void 0), {
18
+ domain_token: D
19
+ } = $(), {
20
+ startProgress: v,
21
+ stopProgress: A
22
+ } = x(), {
23
+ networkOperation: C
24
+ } = E();
25
+ M(() => {
26
+ let t = !0;
27
+ return v(), C({
28
+ method: "GET",
29
+ endPoint: u ? `dictionaries/${a}` : `na/dictionaries/${a}`,
30
+ parms: {
31
+ comps: f,
32
+ ...u ? {} : {
33
+ domain_token: D
34
+ }
35
+ }
36
+ }).then((e) => {
37
+ t && (h({
38
+ ...e
39
+ }), g(N.FLAG_DICTIONARY_LOADED));
40
+ }).finally(() => {
41
+ A();
42
+ }), function() {
43
+ t = !1;
44
+ };
45
+ }, [p]);
46
+ const s = c((t, ...e) => {
47
+ if (r === void 0)
48
+ return "";
49
+ if (t === "")
50
+ return "No key";
51
+ let o;
52
+ const i = t.split(".");
53
+ try {
54
+ i.length === 1 && (o = r.data[t]), i.length === 2 && (o = r[i[0]][i[1]]);
55
+ } catch {
56
+ }
57
+ if (e.length > 0 && o)
58
+ for (let n = 0; n < e.length; n++)
59
+ o = o?.replaceAll(`$${n + 1}`, e[n]);
60
+ return o || `N_D:[${t}]`;
61
+ }, [r]), F = c(() => s(l), [l, s]);
62
+ return /* @__PURE__ */ P(b.Provider, {
63
+ value: {
64
+ moduleDictionary: r,
65
+ getLabel: s,
66
+ getModuleLabel: F
67
+ },
68
+ children: d
69
+ });
70
+ }
71
+ export {
72
+ b as M,
73
+ j as a
74
+ };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './types';
2
3
  declare const ModuleDictionaryContext: import("react").Context<ModuleDictionaryContextProps | null>;
3
4
  declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
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";
2
+ import { C as i } from "../../types/index.42c24946.js";
3
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";
4
+ import { u as E } from "../../hooks/useFlagsStore/index.f7c613ac.js";
5
+ import { u as h } from "../../hooks/useHostTools/index.66d9a667.js";
6
+ import { u as F } from "../../hooks/useNetwork/index.3d79002b.js";
7
7
  const L = f(null);
8
8
  function S(n) {
9
9
  const {
@@ -27,7 +27,6 @@ function S(n) {
27
27
  parms: {
28
28
  privileges: r
29
29
  }
30
- // isRemote: false
31
30
  }).then((s) => {
32
31
  e && (l({
33
32
  ...s.data
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ModulePrivilegesContextProps, ModulePrivilegesProviderProps } from './types';
2
3
  declare const ModulePrivilegesContext: import("react").Context<ModulePrivilegesContextProps | null>;
3
4
  declare function ModulePrivilegesProvider(props: ModulePrivilegesProviderProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { createContext as n } from "react";
2
2
  import { jsx as s } from "react/jsx-runtime";
3
- import { a as l } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
3
+ import { a as l } from "../../hooks/useFlagsStore/index.f7c613ac.js";
4
4
  const a = n(null);
5
5
  function m(e) {
6
6
  const {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ModuleSkeletonContextProps, ModuleSkeletonProviderProps } from './types';
2
3
  declare const ModuleSkeletonContext: import("react").Context<ModuleSkeletonContextProps | null>;
3
4
  declare function ModuleSkeletonProvider(props: ModuleSkeletonProviderProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { NetworkProviderProps } from './types';
2
3
  declare const NetworkContext: import("react").Context<import("./types").NetworkType | null>;
3
4
  declare function NetworkProvider(props: NetworkProviderProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { createContext as i, useCallback as c } from "react";
2
- import { u as m } from "../../hooks/useEnvironment/index-D1xRKaoe.js";
3
- import { u } from "../../hooks/useHostTools/index-CL3d7qFm.js";
2
+ import { u as m } from "../../hooks/useEnvironment/index.25f83176.js";
3
+ import { u } from "../../hooks/useHostTools/index.66d9a667.js";
4
4
  import { jsx as l } from "react/jsx-runtime";
5
5
  const p = i(null);
6
6
  function d(t) {
@@ -2,7 +2,7 @@ export { BaseContext, BaseProvider } from './BaseContext';
2
2
  export { EnvironmentContext, EnvironmentProvider } from './EnvironmentContext';
3
3
  export { HostToolsContext, HostToolsProvider } from './HostToolsContext';
4
4
  export { NetworkContext, NetworkProvider } from './NetworkContext';
5
- export { AuthContext, AuthProvider } from './AuthContext';
5
+ export * from './AuthContext';
6
6
  export { FlagsContext, FlagsProvider } from './FlagsContext';
7
7
  export { DomainContext, DomainProvider } from './DomainContext';
8
8
  export { ModuleDictionaryContext, ModuleDictionaryProvider } from './ModuleDictionaryContext';
@@ -0,0 +1,11 @@
1
+ import { useContext as o } from "react";
2
+ import { A as e } from "../../contexts/AuthContext/index.dd2ed9e6.js";
3
+ const n = () => {
4
+ const t = o(e);
5
+ if (!t)
6
+ throw new Error("Auth context must be use inside AuthProvider");
7
+ return t;
8
+ };
9
+ export {
10
+ n as u
11
+ };
@@ -1,2 +1,2 @@
1
- export declare const useAuth: () => import("../../contexts/AuthContext").SessionContextType;
1
+ export declare const useAuth: () => import("../../contexts/AuthContext/types").SessionContextType;
2
2
  export default useAuth;
@@ -0,0 +1,11 @@
1
+ import { useContext as t } from "react";
2
+ import { B as o } from "../../contexts/BaseContext/index.f9cdc955.js";
3
+ function r() {
4
+ const e = t(o);
5
+ if (!e)
6
+ throw new Error("useBase context must be use inside BaseContext");
7
+ return e;
8
+ }
9
+ export {
10
+ r as u
11
+ };
@@ -1,9 +1,10 @@
1
1
  import { useContext as t } from "react";
2
- import { D as n } from "../../contexts/DomainContext/index-D24R5afH.js";
3
- import { D as e } from "../../contexts/DomainCountryContext/index-Gjy6Za6i.js";
2
+ import { D as n } from "../../contexts/DomainContext/index.2ed56159.js";
3
+ import { D as e } from "../../contexts/DomainCountryContext/index.3cdf9462.js";
4
4
  const m = () => {
5
5
  const o = t(n);
6
- if (!o) throw new Error("useDomain context must be use inside DomainContext");
6
+ if (!o)
7
+ throw new Error("useDomain context must be use inside DomainContext");
7
8
  return o;
8
9
  }, u = () => {
9
10
  const o = t(e);
@@ -0,0 +1,11 @@
1
+ import { useContext as t } from "react";
2
+ import { E as e } from "../../contexts/EnvironmentContext/index.b33784cd.js";
3
+ const s = () => {
4
+ const n = t(e);
5
+ if (!n)
6
+ throw new Error("useEnvironment context must be use inside EnvironmentContext");
7
+ return n;
8
+ };
9
+ export {
10
+ s as u
11
+ };
@@ -1,10 +1,11 @@
1
1
  import { useContext as o } from "react";
2
- import { F as i } from "../../contexts/FlagsContext/index-DcIX8FKd.js";
2
+ import { F as i } from "../../contexts/FlagsContext/index.5b096265.js";
3
3
  import { useStore as l } from "zustand";
4
- import { s as a } from "../../node_modules-C59GSzS1.js";
4
+ import { s as a } from "../../node_modules.04fac7e9.js";
5
5
  function u(t, s) {
6
6
  const e = o(i);
7
- if (!e) throw new Error("useFlagsStore context must be use inside FlagsProvider");
7
+ if (!e)
8
+ throw new Error("useFlagsStore context must be use inside FlagsProvider");
8
9
  return l(e, t, s);
9
10
  }
10
11
  function f(t, s) {
@@ -0,0 +1,11 @@
1
+ import { useContext as t } from "react";
2
+ import { H as s } from "../../contexts/HostToolsContext/index.499db832.js";
3
+ const n = () => {
4
+ const o = t(s);
5
+ if (!o)
6
+ throw new Error("useHostTools context must be use inside HostToolsContext");
7
+ return o;
8
+ };
9
+ export {
10
+ n as u
11
+ };
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../contexts/ModuleDictionaryContext/index-kBzBlTUI.js";
2
+ import { M as e } from "../../contexts/ModuleDictionaryContext/index.63e1dbbd.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-DsoWo0kK.js";
2
+ import { M as t } from "../../contexts/ModulePrivilegesContext/index.1274092a.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-CkhzuYKp.js";
2
+ import { M as r } from "../../contexts/ModuleSkeletonContext/index.9267d86a.js";
3
3
  const S = () => {
4
4
  const [t, o] = n(!0), e = s(r);
5
5
  if (!e)
@@ -0,0 +1,11 @@
1
+ import { useContext as e } from "react";
2
+ import { N as o } from "../../contexts/NetworkContext/index.ec7405cd.js";
3
+ const s = () => {
4
+ const t = e(o);
5
+ if (!t)
6
+ throw new Error("useNetwork context must be use inside NetworkContext");
7
+ return t;
8
+ };
9
+ export {
10
+ s as u
11
+ };
@@ -1,6 +1,6 @@
1
1
  import { useState as n, useRef as H, useCallback as L, useEffect as m } from "react";
2
- import { u as U } from "../useHostTools/index-CL3d7qFm.js";
3
- import { u as j } from "../useNetwork/index--IzMsMJ2.js";
2
+ import { u as U } from "../useHostTools/index.66d9a667.js";
3
+ import { u as j } from "../useNetwork/index.3d79002b.js";
4
4
  const s = {
5
5
  page: 0,
6
6
  rowsPerPage: 25,
@@ -11,9 +11,7 @@ const s = {
11
11
  timeout: R = 5e3,
12
12
  queryParams: P,
13
13
  fireOnChangeParms: i,
14
- // Propiedad para permitir que un cambio en los parametros de la consulta dispare la recarga de la red
15
14
  fireOnFirstLoad: C = !0,
16
- // propiedad que evita que se cargue la red la en el primer render del hook
17
15
  rowsPerPage: c = s.rowsPerPage,
18
16
  startProgress: d,
19
17
  stopProgress: S,
@@ -55,7 +53,6 @@ const s = {
55
53
  r && (o(e.data), t.current.page = e.pager.page, a((G) => ({
56
54
  ...G,
57
55
  page: e.pager.page,
58
- // rowsPerPage: response.pager.limit,
59
56
  totalRecords: e.pager.total
60
57
  })));
61
58
  }).catch(() => {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { UsePaginateProps } from './types';
2
3
  import type { PagerState } from './types';
3
4
  export declare const usePaginate: <TRow>(props: UsePaginateProps<TRow>) => {
@@ -1,5 +1,5 @@
1
1
  import { useEffect as i } from "react";
2
- import { u as f } from "../useHostTools/index-CL3d7qFm.js";
2
+ import { u as f } from "../useHostTools/index.66d9a667.js";
3
3
  function c(s) {
4
4
  const { isMicroFrontEnd: e, event: t, setHandler: o } = s, { events_add_listener: r, events_remove_listener: n } = f();
5
5
  i(() => (e && r(t, o), () => {