@m4l/core 2.0.24 → 2.0.25
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/BaseContext/index.d.ts +1 -0
- package/contexts/BaseContext/store.js +26 -18
- package/contexts/BaseContext/types.d.ts +4 -0
- package/contexts/index.d.ts +1 -1
- package/index.js +30 -30
- package/package.json +1 -1
|
@@ -1,42 +1,50 @@
|
|
|
1
1
|
import { createStore as l } from "zustand";
|
|
2
2
|
import { devtools as m } from "zustand/middleware";
|
|
3
|
-
import { immer as
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
const { enabled:
|
|
7
|
-
return
|
|
3
|
+
import { immer as u } from "zustand/middleware/immer";
|
|
4
|
+
import c from "lodash-es/merge";
|
|
5
|
+
function v(e, o) {
|
|
6
|
+
const { enabled: a = !1 } = o;
|
|
7
|
+
return a && process.env.NODE_ENV === "development" ? m(e, o) : e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const
|
|
9
|
+
function V(e, o = !1) {
|
|
10
|
+
const a = {
|
|
11
11
|
...e
|
|
12
12
|
};
|
|
13
13
|
return l(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...
|
|
14
|
+
v(
|
|
15
|
+
u((s) => ({
|
|
16
|
+
...a,
|
|
17
17
|
actions: {
|
|
18
18
|
/**
|
|
19
|
-
* Setea un valor parcial en el estado y lo combina con el estado actual
|
|
19
|
+
* Setea un valor parcial en el estado y lo combina con el estado actual,
|
|
20
20
|
*/
|
|
21
|
-
setPartialValue: (
|
|
22
|
-
s((
|
|
23
|
-
|
|
21
|
+
setPartialValue: (r) => {
|
|
22
|
+
s((t) => {
|
|
23
|
+
Object.assign(t.value, r);
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Mergea un valor parcial en el estado y lo combina con el estado actual, sin perderse la anidación
|
|
28
|
+
*/
|
|
29
|
+
mergeValue: (r) => {
|
|
30
|
+
s((t) => {
|
|
31
|
+
c(t.value, r);
|
|
24
32
|
});
|
|
25
33
|
},
|
|
26
34
|
/**
|
|
27
35
|
* Setea un valor en el estado
|
|
28
36
|
*/
|
|
29
|
-
setKeyValue: (
|
|
37
|
+
setKeyValue: (r, t) => {
|
|
30
38
|
s((n) => {
|
|
31
|
-
n.value[
|
|
39
|
+
n.value[r] = t;
|
|
32
40
|
});
|
|
33
41
|
}
|
|
34
42
|
}
|
|
35
43
|
})),
|
|
36
|
-
{ name: `BaseProviderStore: ${e.storeId}`, enabled:
|
|
44
|
+
{ name: `BaseProviderStore: ${e.storeId}`, enabled: o }
|
|
37
45
|
)
|
|
38
46
|
);
|
|
39
47
|
}
|
|
40
48
|
export {
|
|
41
|
-
|
|
49
|
+
V as c
|
|
42
50
|
};
|
|
@@ -19,6 +19,10 @@ export interface BaseProviderStoreStateWithActions<T extends Record<KeyOFHash, a
|
|
|
19
19
|
* Modifica parcialmente el custom data.
|
|
20
20
|
*/
|
|
21
21
|
setPartialValue: (customData: Partial<T>) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Modifica parcialmente el custom data.
|
|
24
|
+
*/
|
|
25
|
+
mergeValue: (customData: Partial<T>) => void;
|
|
22
26
|
/**
|
|
23
27
|
* Modifica una propidadparcialmente el custom data.
|
|
24
28
|
*/
|
package/contexts/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './BaseContext';
|
|
2
2
|
export { EnvironmentContext, EnvironmentProvider } from './EnvironmentContext';
|
|
3
3
|
export { HostToolsContext, HostToolsProvider } from './HostToolsContext';
|
|
4
4
|
export { NetworkContext, NetworkProvider } from './NetworkContext';
|
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { C as r, E as t } from "./types/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { D, a as S } from "./contexts/
|
|
8
|
-
import { M as y, a as F } from "./contexts/
|
|
9
|
-
import { M as k, a as B } from "./contexts/
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { E as s, a as u } from "./contexts/EnvironmentContext/index.js";
|
|
3
|
+
import { H as i, a as m } from "./contexts/HostToolsContext/index.js";
|
|
4
|
+
import { N as p, a as f } from "./contexts/NetworkContext/index.js";
|
|
5
|
+
import { F as d, a as v } from "./contexts/FlagsContext/index.js";
|
|
6
|
+
import { D as P, a as C } from "./contexts/DomainContext/index.js";
|
|
7
|
+
import { M as D, a as S } from "./contexts/ModuleDictionaryContext/index.js";
|
|
8
|
+
import { M as y, a as F } from "./contexts/ModulePrivilegesContext/index.js";
|
|
9
|
+
import { M as k, a as B } from "./contexts/ModuleSkeletonContext/index.js";
|
|
10
|
+
import { D as L, a as A } from "./contexts/DomainCountryContext/index.js";
|
|
11
|
+
import { B as N, a as w } from "./contexts/BaseContext/BaseContext.js";
|
|
12
12
|
import { A as W, a as O } from "./contexts/AuthContext/AuthContext.js";
|
|
13
13
|
import { u as j } from "./hooks/useEnvironment/index.js";
|
|
14
14
|
import { a as z, u as G } from "./hooks/useFlagsStore/index.js";
|
|
@@ -35,28 +35,28 @@ import { a as Lo } from "./utils/axiosOperation/index.js";
|
|
|
35
35
|
export {
|
|
36
36
|
W as AuthContext,
|
|
37
37
|
O as AuthProvider,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
N as BaseContext,
|
|
39
|
+
w as BaseProvider,
|
|
40
40
|
r as CommonFlags,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
P as DomainContext,
|
|
42
|
+
L as DomainCountryContext,
|
|
43
|
+
A as DomainCountryProvider,
|
|
44
|
+
C as DomainProvider,
|
|
45
45
|
t as EmitEvents,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
s as EnvironmentContext,
|
|
47
|
+
u as EnvironmentProvider,
|
|
48
|
+
d as FlagsContext,
|
|
49
|
+
v as FlagsProvider,
|
|
50
|
+
i as HostToolsContext,
|
|
51
|
+
m as HostToolsProvider,
|
|
52
|
+
D as ModuleDictionaryContext,
|
|
53
|
+
S as ModuleDictionaryProvider,
|
|
54
|
+
y as ModulePrivilegesContext,
|
|
55
|
+
F as ModulePrivilegesProvider,
|
|
56
|
+
k as ModuleSkeletonContext,
|
|
57
|
+
B as ModuleSkeletonProvider,
|
|
58
|
+
p as NetworkContext,
|
|
59
|
+
f as NetworkProvider,
|
|
60
60
|
Lo as axiosOperation,
|
|
61
61
|
yo as evaluateWithContext,
|
|
62
62
|
Eo as getLocalStorage,
|