@m4l/core 2.0.20-beta.1 → 2.0.21
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/FlagsContext/index.d.ts +1 -1
- package/contexts/FlagsContext/index.js +12 -11
- package/contexts/FlagsContext/store.d.ts +1 -1
- package/contexts/FlagsContext/store.js +16 -13
- package/contexts/FlagsContext/types.d.ts +27 -0
- package/index.d.ts +0 -1
- package/index.js +82 -116
- package/not_recognized/index.js +500 -16173
- package/package.json +1 -1
- package/test/index.d.ts +1 -2
- package/commonjs/index.js +0 -12
- package/test/constants.js +0 -72
- package/test/index.js +0 -1
- package/test/mocks.js +0 -10
- package/test/types.js +0 -1
- package/test/utils.js +0 -18
|
@@ -11,5 +11,5 @@ declare const FlagsContext: import('react').Context<(Omit<Omit<import('zustand')
|
|
|
11
11
|
/**
|
|
12
12
|
* Proveedor del contexto de banderas.
|
|
13
13
|
*/
|
|
14
|
-
declare function FlagsProvider({ children }: FlagsProviderProps): import("react").JSX.Element;
|
|
14
|
+
declare function FlagsProvider({ children, storeId, storeDevtoolsEnabled }: FlagsProviderProps): import("react").JSX.Element;
|
|
15
15
|
export { FlagsProvider, FlagsContext };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { c
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const r =
|
|
7
|
-
return r.current || (r.current =
|
|
8
|
-
flags: []
|
|
9
|
-
|
|
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);
|
|
5
|
+
function m({ children: e, storeId: t, storeDevtoolsEnabled: o }) {
|
|
6
|
+
const r = n();
|
|
7
|
+
return r.current || (r.current = c({
|
|
8
|
+
flags: [],
|
|
9
|
+
storeId: t
|
|
10
|
+
}, o)), /* @__PURE__ */ s(f.Provider, { value: r.current, children: e });
|
|
10
11
|
}
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
f as F,
|
|
14
|
+
m as a
|
|
14
15
|
};
|
|
@@ -2,7 +2,7 @@ import { FlagsStateWithActions, FlagsStoreState } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Crea el store de banderas.
|
|
4
4
|
*/
|
|
5
|
-
export declare const createFlagsStore: (initialState: FlagsStoreState) => Omit<Omit<import('zustand').StoreApi<FlagsStateWithActions>, "setState"> & {
|
|
5
|
+
export declare const createFlagsStore: (initialState: FlagsStoreState, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<FlagsStateWithActions>, "setState"> & {
|
|
6
6
|
setState<A extends string | {
|
|
7
7
|
type: unknown;
|
|
8
8
|
}>(partial: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: FlagsStateWithActions) => FlagsStateWithActions | Partial<FlagsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { createStore as
|
|
1
|
+
import { createStore as n } from "zustand";
|
|
2
2
|
import { devtools as f } from "zustand/middleware";
|
|
3
|
-
import { immer as
|
|
4
|
-
const d = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { immer as c } from "zustand/middleware/immer";
|
|
4
|
+
const d = (e, o) => {
|
|
5
|
+
const { enabled: r = !1 } = o;
|
|
6
|
+
return r && process.env.NODE_ENV === "development" ? f(e, o) : e;
|
|
7
|
+
}, v = (e, o = !1) => n(
|
|
8
|
+
d(
|
|
9
|
+
c((r) => ({
|
|
10
|
+
...e,
|
|
8
11
|
flagsActions: {
|
|
9
12
|
/**
|
|
10
13
|
* Limpia las banderas.
|
|
11
14
|
*/
|
|
12
15
|
clearFlags: () => {
|
|
13
|
-
r((
|
|
14
|
-
|
|
16
|
+
r((s) => {
|
|
17
|
+
s.flags = [];
|
|
15
18
|
});
|
|
16
19
|
},
|
|
17
20
|
/**
|
|
18
21
|
* Agrega una bandera.
|
|
19
22
|
*/
|
|
20
|
-
addFlag: (
|
|
23
|
+
addFlag: (s) => {
|
|
21
24
|
r((a) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
25
|
+
const t = a.flags;
|
|
26
|
+
t.findIndex((l) => l === s) < 0 && (a.flags = [...t, s]);
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
})),
|
|
28
|
-
{ name:
|
|
31
|
+
{ name: `FlagsStore: ${e.storeId}`, enabled: o }
|
|
29
32
|
)
|
|
30
33
|
);
|
|
31
34
|
export {
|
|
32
|
-
|
|
35
|
+
v as c
|
|
33
36
|
};
|
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface FlagsProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* "storeId" Id del store
|
|
5
|
+
*/
|
|
6
|
+
storeId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* "storeDevtoolsEnabled" Determina si se debe usar devtools para el store
|
|
9
|
+
*/
|
|
10
|
+
storeDevtoolsEnabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* "children" Componentes hijos
|
|
13
|
+
*/
|
|
3
14
|
children: ReactNode;
|
|
4
15
|
}
|
|
5
16
|
export type Flag = string;
|
|
6
17
|
export interface FlagsContextProps {
|
|
18
|
+
/**
|
|
19
|
+
* "flags" Banderas
|
|
20
|
+
*/
|
|
7
21
|
flags: Array<Flag>;
|
|
22
|
+
/**
|
|
23
|
+
* "clearFlags" Limpia las banderas
|
|
24
|
+
*/
|
|
8
25
|
clearFlags: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* "addFlag" Agrega una bandera
|
|
28
|
+
*/
|
|
9
29
|
addFlag: (flag: Flag) => void;
|
|
10
30
|
}
|
|
11
31
|
export interface FlagsStoreState {
|
|
32
|
+
/**
|
|
33
|
+
* "storeId" Id del store
|
|
34
|
+
*/
|
|
35
|
+
storeId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* "flags" Banderas
|
|
38
|
+
*/
|
|
12
39
|
flags: Array<Flag>;
|
|
13
40
|
}
|
|
14
41
|
export interface FlagsStateWithActions extends FlagsStoreState {
|
package/index.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export { EmmitEvents as EmitEvents, CommonFlags } from './types';
|
|
|
4
4
|
export type { Maybe, HostToolsType, NetworkProps, EnvironmentType, AxiosOperation, EventListenerBase, EmmitEventsGuard, ToasterFunctionProps, Toaster, } from './types';
|
|
5
5
|
export type { GetLabelType, Dictionary, ModuleDictionary, ComponentDictionary, } from './types/dictionary';
|
|
6
6
|
export * from './utils';
|
|
7
|
-
export * from './test';
|
package/index.js
CHANGED
|
@@ -1,118 +1,84 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { M as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { u as
|
|
16
|
-
import {
|
|
17
|
-
import { u as
|
|
18
|
-
import { u as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
import { u as
|
|
22
|
-
import { u as
|
|
23
|
-
import { u as
|
|
24
|
-
import { u as xo } from "./hooks/
|
|
25
|
-
import { u as
|
|
26
|
-
import { u as
|
|
27
|
-
import {
|
|
28
|
-
import { u as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { g as Eo } from "./utils/
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { s as Lo } from "./utils/setLocalStorage/index.js";
|
|
36
|
-
import { a as bo } from "./utils/axiosOperation/index.js";
|
|
37
|
-
import { h as qo, d as Wo, c as jo, e as Io, b as zo, g as Go, j as Jo, i as Ko, m as Qo, a as Ro, n as Uo, q as Vo, f as Xo, r as Yo } from "./test/constants.js";
|
|
38
|
-
import { m as $o, b as oe, d as ee, c as re, a as te, e as ae, f as se } from "./test/mocks.js";
|
|
39
|
-
import { c as ie } from "./test/utils.js";
|
|
40
|
-
import { act as ue } from "react";
|
|
41
|
-
const r = o.renderHook;
|
|
1
|
+
import { C as r, E as t } from "./types/index.js";
|
|
2
|
+
import { B as s, a as u } from "./contexts/BaseContext/BaseContext.js";
|
|
3
|
+
import { E as i, a as m } from "./contexts/EnvironmentContext/index.js";
|
|
4
|
+
import { H as p, a as f } from "./contexts/HostToolsContext/index.js";
|
|
5
|
+
import { N as d, a as v } from "./contexts/NetworkContext/index.js";
|
|
6
|
+
import { F as P, a as C } from "./contexts/FlagsContext/index.js";
|
|
7
|
+
import { D, a as S } from "./contexts/DomainContext/index.js";
|
|
8
|
+
import { M as y, a as F } from "./contexts/ModuleDictionaryContext/index.js";
|
|
9
|
+
import { M as k, a as B } from "./contexts/ModulePrivilegesContext/index.js";
|
|
10
|
+
import { M as L, a as A } from "./contexts/ModuleSkeletonContext/index.js";
|
|
11
|
+
import { D as N, a as w } from "./contexts/DomainCountryContext/index.js";
|
|
12
|
+
import { A as W, a as O } from "./contexts/AuthContext/AuthContext.js";
|
|
13
|
+
import { u as j } from "./hooks/useEnvironment/index.js";
|
|
14
|
+
import { a as z, u as G } from "./hooks/useFlagsStore/index.js";
|
|
15
|
+
import { u as J } from "./hooks/useHostTools/index.js";
|
|
16
|
+
import { u as Q } from "./hooks/useDomain/index.js";
|
|
17
|
+
import { u as U } from "./hooks/useLocalStorage/index.js";
|
|
18
|
+
import { u as X } from "./hooks/useLocalStorageWithListener/index.js";
|
|
19
|
+
import { u as Z } from "./hooks/useModuleDictionary/index.js";
|
|
20
|
+
import { u as $ } from "./hooks/useModulePrivileges/index.js";
|
|
21
|
+
import { u as eo } from "./hooks/useModuleSkeleton/index.js";
|
|
22
|
+
import { u as to } from "./hooks/useNetwork/index.js";
|
|
23
|
+
import { u as so } from "./hooks/usePaginate/index.js";
|
|
24
|
+
import { u as xo } from "./hooks/usePropageteMF/index.js";
|
|
25
|
+
import { u as mo } from "./hooks/useDomainCountry/index.js";
|
|
26
|
+
import { u as po } from "./hooks/useAuth/useAuth.js";
|
|
27
|
+
import { i as lo } from "./hooks/usePaginate/types.js";
|
|
28
|
+
import { a as go, u as Po } from "./hooks/useBase/useBase.js";
|
|
29
|
+
import { v as Mo } from "./utils/voidFunction.js";
|
|
30
|
+
import { g as So } from "./utils/getPropertyByString/index.js";
|
|
31
|
+
import { e as yo } from "./utils/evaluateWithContext/index.js";
|
|
32
|
+
import { g as Eo } from "./utils/getLocalStorage/index.js";
|
|
33
|
+
import { s as Bo } from "./utils/setLocalStorage/index.js";
|
|
34
|
+
import { a as Lo } from "./utils/axiosOperation/index.js";
|
|
42
35
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Uo as networkPropsForTesting,
|
|
92
|
-
Vo as queryPrivilegesForTesting,
|
|
93
|
-
ie as render,
|
|
94
|
-
r as renderHook,
|
|
95
|
-
Xo as resultAxiosOperationForTesting,
|
|
96
|
-
Yo as resultpPrivilegesForTesting,
|
|
97
|
-
u as screen,
|
|
98
|
-
Lo as setLocalStorage,
|
|
99
|
-
Fo as useAuth,
|
|
100
|
-
To as useBase,
|
|
101
|
-
Mo as useBaseStore,
|
|
102
|
-
Z as useDomain,
|
|
103
|
-
co as useDomainCountry,
|
|
104
|
-
K as useEnvironment,
|
|
105
|
-
R as useFlagsPresent,
|
|
106
|
-
U as useFlagsStore,
|
|
107
|
-
X as useHostTools,
|
|
108
|
-
oo as useLocalStorage,
|
|
109
|
-
ro as useLocalStorageWithListener,
|
|
110
|
-
ao as useModuleDictionary,
|
|
111
|
-
no as useModulePrivileges,
|
|
112
|
-
mo as useModuleSkeleton,
|
|
113
|
-
xo as useNetwork,
|
|
114
|
-
fo as usePaginate,
|
|
115
|
-
go as usePropageteMF,
|
|
116
|
-
x as userEvent,
|
|
117
|
-
yo as voidFunction
|
|
36
|
+
W as AuthContext,
|
|
37
|
+
O as AuthProvider,
|
|
38
|
+
s as BaseContext,
|
|
39
|
+
u as BaseProvider,
|
|
40
|
+
r as CommonFlags,
|
|
41
|
+
D as DomainContext,
|
|
42
|
+
N as DomainCountryContext,
|
|
43
|
+
w as DomainCountryProvider,
|
|
44
|
+
S as DomainProvider,
|
|
45
|
+
t as EmitEvents,
|
|
46
|
+
i as EnvironmentContext,
|
|
47
|
+
m as EnvironmentProvider,
|
|
48
|
+
P as FlagsContext,
|
|
49
|
+
C as FlagsProvider,
|
|
50
|
+
p as HostToolsContext,
|
|
51
|
+
f as HostToolsProvider,
|
|
52
|
+
y as ModuleDictionaryContext,
|
|
53
|
+
F as ModuleDictionaryProvider,
|
|
54
|
+
k as ModulePrivilegesContext,
|
|
55
|
+
B as ModulePrivilegesProvider,
|
|
56
|
+
L as ModuleSkeletonContext,
|
|
57
|
+
A as ModuleSkeletonProvider,
|
|
58
|
+
d as NetworkContext,
|
|
59
|
+
v as NetworkProvider,
|
|
60
|
+
Lo as axiosOperation,
|
|
61
|
+
yo as evaluateWithContext,
|
|
62
|
+
Eo as getLocalStorage,
|
|
63
|
+
So as getPropertyByString,
|
|
64
|
+
lo as initialPagerState,
|
|
65
|
+
Bo as setLocalStorage,
|
|
66
|
+
po as useAuth,
|
|
67
|
+
go as useBase,
|
|
68
|
+
Po as useBaseStore,
|
|
69
|
+
Q as useDomain,
|
|
70
|
+
mo as useDomainCountry,
|
|
71
|
+
j as useEnvironment,
|
|
72
|
+
z as useFlagsPresent,
|
|
73
|
+
G as useFlagsStore,
|
|
74
|
+
J as useHostTools,
|
|
75
|
+
U as useLocalStorage,
|
|
76
|
+
X as useLocalStorageWithListener,
|
|
77
|
+
Z as useModuleDictionary,
|
|
78
|
+
$ as useModulePrivileges,
|
|
79
|
+
eo as useModuleSkeleton,
|
|
80
|
+
to as useNetwork,
|
|
81
|
+
so as usePaginate,
|
|
82
|
+
xo as usePropageteMF,
|
|
83
|
+
Mo as voidFunction
|
|
118
84
|
};
|