@m4l/graphics 7.5.0-beta-feature-731-m4l-components-code-editor.0 → 7.5.0-beta-feature-731-code-editor.0
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/ThemeSettingsContext/store.d.ts.map +1 -1
- package/contexts/ThemeSettingsContext/store.js +82 -67
- package/contexts/ThemeSettingsContext/types.d.ts +7 -0
- package/contexts/ThemeSettingsContext/types.d.ts.map +1 -1
- package/hooks/index.d.ts +0 -1
- package/hooks/index.d.ts.map +1 -1
- package/index.js +28 -30
- package/package.json +1 -1
- package/hooks/useThemeMode/index.d.ts +0 -6
- package/hooks/useThemeMode/index.d.ts.map +0 -1
- package/hooks/useThemeMode/index.js +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAI9B,MAAM,SAAS,CAAC;AAkHjB;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc,8BAA8B;;;;;;;;CA2LpF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
import { createStore as d } from "zustand";
|
|
2
2
|
import { devtools as u } from "zustand/middleware";
|
|
3
|
-
import { immer as
|
|
4
|
-
import {
|
|
3
|
+
import { immer as U } from "zustand/middleware/immer";
|
|
4
|
+
import { EmitEvents as f } from "@m4l/core";
|
|
5
|
+
import { getPaletteByPreset as x, createCustomShadows as C, shadows as l, typographyOld as T, getColorPresets as i } from "@m4l/styles";
|
|
5
6
|
import { alpha as s } from "@mui/system";
|
|
6
|
-
import { defaultThemeSettings as
|
|
7
|
-
function
|
|
8
|
-
const n =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const c = `--${o}-${t}`;
|
|
16
|
-
n.style.setProperty(c, i.toString());
|
|
17
|
-
} else typeof i == "object" && i !== null && S(i, `${o}-${t}`);
|
|
7
|
+
import { defaultThemeSettings as S } from "./constants.js";
|
|
8
|
+
function c(r, o = "m4l") {
|
|
9
|
+
const n = document.querySelector("[data-mui-color-scheme]");
|
|
10
|
+
n && Object.keys(r).forEach((t) => {
|
|
11
|
+
const e = r[t];
|
|
12
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
13
|
+
const p = `--${o}-${t}`;
|
|
14
|
+
n.style.setProperty(p, e.toString());
|
|
15
|
+
} else typeof e == "object" && e !== null && c(e, `${o}-${t}`);
|
|
18
16
|
});
|
|
19
17
|
}
|
|
20
18
|
const m = (r) => {
|
|
21
|
-
const o = r.themeUserSettings ||
|
|
19
|
+
const o = r.themeUserSettings || S, n = o.themeMode === "light", t = x(o.themeColor), e = n ? t.light : t.dark;
|
|
22
20
|
r.themeOptions = {
|
|
23
21
|
...r.themeOptions,
|
|
24
|
-
...
|
|
22
|
+
...T,
|
|
25
23
|
palette: {
|
|
26
24
|
...r.themeOptions?.palette ?? {},
|
|
27
|
-
...
|
|
25
|
+
...e
|
|
28
26
|
},
|
|
29
27
|
shape: { borderRadius: 8 },
|
|
30
28
|
direction: o.themeDirection,
|
|
31
|
-
shadows: n ?
|
|
29
|
+
shadows: n ? l.light : l.dark,
|
|
32
30
|
customShadows: {
|
|
33
|
-
primary: n ? `0 4px 8px -4px ${s(
|
|
34
|
-
0 2px 27px 2px ${s(
|
|
35
|
-
0 2px 27px 2px ${s(
|
|
36
|
-
...
|
|
37
|
-
primary2: n ? `0px 2px 3px 0px ${s(
|
|
31
|
+
primary: n ? `0 4px 8px -4px ${s(i(o.themeColor)?.enabledLight, 0.12)},
|
|
32
|
+
0 2px 27px 2px ${s(i(o.themeColor)?.enabledLight, 0.02)}` : `0 4px 8px -4px ${s(i(o.themeColor)?.enabledDark, 0.12)},
|
|
33
|
+
0 2px 27px 2px ${s(i(o.themeColor)?.enabledDark, 0.02)}`,
|
|
34
|
+
...C(o.themeMode),
|
|
35
|
+
primary2: n ? `0px 2px 3px 0px ${s(i(o.themeColor)?.hoverOpacityLight, 0.2)}` : `0px 2px 3px 0px ${s(i(o.themeColor)?.hoverOpacityDark, 0.2)}`
|
|
38
36
|
},
|
|
39
37
|
stretch: o.themeStretch
|
|
40
|
-
},
|
|
38
|
+
}, c(r.themeOptions);
|
|
41
39
|
}, h = (r) => {
|
|
42
40
|
r.themeSettingsPersistFn?.(r.themeUserSettings);
|
|
43
|
-
}
|
|
41
|
+
};
|
|
42
|
+
function g(r) {
|
|
43
|
+
r.hostToolsEventsEmit?.(
|
|
44
|
+
f.EMMIT_EVENT_HOST_THEME_CHANGE,
|
|
45
|
+
r.themeUserSettings.themeMode
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
const b = (r) => d(
|
|
44
49
|
u(
|
|
45
|
-
|
|
50
|
+
U((o, n) => ({
|
|
46
51
|
...r,
|
|
47
52
|
settingsActions: {
|
|
48
53
|
/**
|
|
@@ -53,8 +58,8 @@ const m = (r) => {
|
|
|
53
58
|
* @updatedUser Juan Escobar - automatic
|
|
54
59
|
*/
|
|
55
60
|
init: () => {
|
|
56
|
-
o((
|
|
57
|
-
m(
|
|
61
|
+
o((t) => {
|
|
62
|
+
m(t);
|
|
58
63
|
});
|
|
59
64
|
},
|
|
60
65
|
/**
|
|
@@ -64,9 +69,10 @@ const m = (r) => {
|
|
|
64
69
|
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
65
70
|
* @updatedUser Juan Escobar - automatic
|
|
66
71
|
*/
|
|
67
|
-
setThemeSettings: (
|
|
68
|
-
o((
|
|
69
|
-
|
|
72
|
+
setThemeSettings: (t) => {
|
|
73
|
+
o((e) => {
|
|
74
|
+
const p = e.themeUserSettings.themeMode;
|
|
75
|
+
e.themeUserSettings = { ...e.themeUserSettings, ...t }, h(e), m(e), p !== e.themeUserSettings.themeMode && g(e);
|
|
70
76
|
});
|
|
71
77
|
},
|
|
72
78
|
/**
|
|
@@ -76,12 +82,20 @@ const m = (r) => {
|
|
|
76
82
|
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
77
83
|
* @updatedUser Juan Escobar - automatic
|
|
78
84
|
*/
|
|
79
|
-
onChangeMode: (
|
|
80
|
-
o((
|
|
81
|
-
|
|
82
|
-
...
|
|
83
|
-
themeMode:
|
|
84
|
-
}, h(
|
|
85
|
+
onChangeMode: (t) => {
|
|
86
|
+
o((e) => {
|
|
87
|
+
t !== e.themeUserSettings.themeMode && (e.themeUserSettings = {
|
|
88
|
+
...e.themeUserSettings,
|
|
89
|
+
themeMode: t
|
|
90
|
+
}, h(e), m(e), g(e));
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* Register the host-tools emitter used to broadcast theme-mode changes.
|
|
95
|
+
*/
|
|
96
|
+
registerHostToolsEventsEmit: (t) => {
|
|
97
|
+
o((e) => {
|
|
98
|
+
e.hostToolsEventsEmit = t;
|
|
85
99
|
});
|
|
86
100
|
},
|
|
87
101
|
/**
|
|
@@ -92,8 +106,8 @@ const m = (r) => {
|
|
|
92
106
|
* @updatedUser Juan Escobar - automatic
|
|
93
107
|
*/
|
|
94
108
|
handleOpen: () => {
|
|
95
|
-
o((
|
|
96
|
-
|
|
109
|
+
o((t) => {
|
|
110
|
+
t.open = !t.open;
|
|
97
111
|
});
|
|
98
112
|
},
|
|
99
113
|
/**
|
|
@@ -103,12 +117,12 @@ const m = (r) => {
|
|
|
103
117
|
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
104
118
|
* @updatedUser Juan Escobar - automatic
|
|
105
119
|
*/
|
|
106
|
-
onChangeDirection: (
|
|
107
|
-
o((
|
|
108
|
-
|
|
109
|
-
...
|
|
110
|
-
themeDirection:
|
|
111
|
-
}, h(
|
|
120
|
+
onChangeDirection: (t) => {
|
|
121
|
+
o((e) => {
|
|
122
|
+
t !== e.themeUserSettings.themeDirection && (e.themeUserSettings = {
|
|
123
|
+
...e.themeUserSettings,
|
|
124
|
+
themeDirection: t
|
|
125
|
+
}, h(e), m(e));
|
|
112
126
|
});
|
|
113
127
|
},
|
|
114
128
|
/**
|
|
@@ -118,12 +132,12 @@ const m = (r) => {
|
|
|
118
132
|
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
119
133
|
* @updatedUser Juan Escobar - automatic
|
|
120
134
|
*/
|
|
121
|
-
onChangeColor: (
|
|
122
|
-
o((
|
|
123
|
-
|
|
124
|
-
...
|
|
125
|
-
themeColor:
|
|
126
|
-
}, h(
|
|
135
|
+
onChangeColor: (t) => {
|
|
136
|
+
o((e) => {
|
|
137
|
+
t !== e.themeUserSettings.themeColor && (e.themeUserSettings = {
|
|
138
|
+
...e.themeUserSettings,
|
|
139
|
+
themeColor: t
|
|
140
|
+
}, h(e), m(e));
|
|
127
141
|
});
|
|
128
142
|
},
|
|
129
143
|
/**
|
|
@@ -133,12 +147,12 @@ const m = (r) => {
|
|
|
133
147
|
* @updatedAt 2024-10-08 19:28:36 - automatic
|
|
134
148
|
* @updatedUser Juan Escobar - automatic
|
|
135
149
|
*/
|
|
136
|
-
onChangeLayout: (
|
|
137
|
-
o((
|
|
138
|
-
|
|
139
|
-
...
|
|
140
|
-
themeLayout:
|
|
141
|
-
}, h(
|
|
150
|
+
onChangeLayout: (t) => {
|
|
151
|
+
o((e) => {
|
|
152
|
+
e.themeUserSettings = {
|
|
153
|
+
...e.themeUserSettings,
|
|
154
|
+
themeLayout: t.target.value
|
|
155
|
+
}, h(e), m(e);
|
|
142
156
|
});
|
|
143
157
|
},
|
|
144
158
|
/**
|
|
@@ -149,11 +163,11 @@ const m = (r) => {
|
|
|
149
163
|
* @updatedUser Juan Escobar - automatic
|
|
150
164
|
*/
|
|
151
165
|
onToggleStretch: () => {
|
|
152
|
-
o((
|
|
153
|
-
|
|
154
|
-
...
|
|
155
|
-
themeStretch: !
|
|
156
|
-
}, h(
|
|
166
|
+
o((t) => {
|
|
167
|
+
t.themeUserSettings = {
|
|
168
|
+
...t.themeUserSettings,
|
|
169
|
+
themeStretch: !t.themeUserSettings.themeStretch
|
|
170
|
+
}, h(t), m(t);
|
|
157
171
|
});
|
|
158
172
|
},
|
|
159
173
|
/**
|
|
@@ -164,10 +178,11 @@ const m = (r) => {
|
|
|
164
178
|
* @updatedUser Juan Escobar - automatic
|
|
165
179
|
*/
|
|
166
180
|
onResetSetting: () => {
|
|
167
|
-
o((
|
|
168
|
-
e
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
o((t) => {
|
|
182
|
+
const e = t.themeUserSettings.themeMode;
|
|
183
|
+
t.themeUserSettings = {
|
|
184
|
+
...S
|
|
185
|
+
}, h(t), m(t), e !== t.themeUserSettings.themeMode && g(t);
|
|
171
186
|
});
|
|
172
187
|
}
|
|
173
188
|
}
|
|
@@ -176,5 +191,5 @@ const m = (r) => {
|
|
|
176
191
|
)
|
|
177
192
|
);
|
|
178
193
|
export {
|
|
179
|
-
|
|
194
|
+
b as createThemeSettingsStore
|
|
180
195
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EmmitFunction } from '@m4l/core';
|
|
1
2
|
import { PresetsOptionsColorMain, ThemeUserColor } from '@m4l/styles';
|
|
2
3
|
import { Theme } from '@mui/material/styles';
|
|
3
4
|
import { ReactNode } from 'react';
|
|
@@ -41,6 +42,11 @@ export interface ThemeSettingsStore {
|
|
|
41
42
|
* @updatedUser Juan Escobar - automatic
|
|
42
43
|
*/
|
|
43
44
|
themeSettingsPersistFn?: (newValue: ThemeUserSettings) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Host-owned event emitter injected when this store should broadcast mode changes
|
|
47
|
+
* through the shared host-tools contract.
|
|
48
|
+
*/
|
|
49
|
+
hostToolsEventsEmit?: EmmitFunction;
|
|
44
50
|
/**
|
|
45
51
|
* "open" es una variable que se encarga de abrir o cerrar el formulario
|
|
46
52
|
* @createdAt 2024-10-08 13:22:53 - automatic
|
|
@@ -59,6 +65,7 @@ export interface ThemeSettingsStateWithActions extends ThemeSettingsStore {
|
|
|
59
65
|
onChangeColor: (color: ThemeUserColor) => void;
|
|
60
66
|
onChangeLayout: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
61
67
|
handleOpen: () => void;
|
|
68
|
+
registerHostToolsEventsEmit: (eventsEmit?: EmmitFunction) => void;
|
|
62
69
|
setThemeSettings: (newValue: Partial<ThemeUserSettings>) => void;
|
|
63
70
|
};
|
|
64
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,uBAAuB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAG,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,KAAK,CAAC;AAC/C,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,YAAY,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,gBAAgB,CAAC;IAC/B,WAAW,EAAE,eAAe,CAAC;CAE9B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,YAAY,EAAE,KAAK,CAAC;IACpB;;;OAGG;IACH,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,MAAM,8BAA8B,GAAG,kBAAkB,CAAC;AAChE,MAAM,MAAM,8BAA8B,GAAG,8BAA8B,CAAC;AAE5E,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,eAAe,EAAE;QACf,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,eAAe,EAAE,MAAM,IAAI,CAAC;QAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;QAC3B,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;QAC5C,iBAAiB,EAAE,CAAC,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAC;QAC3D,aAAa,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;QAC/C,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACrE,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KAClE,CAAC;CACH;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC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AC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;QAC5C,iBAAiB,EAAE,CAAC,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAC;QAC3D,aAAa,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;QAC/C,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;QACrE,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,2BAA2B,EAAE,CAAC,UAAU,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;QAClE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KAClE,CAAC;CACH;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
|
package/hooks/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export { useOffSetTop } from './useOffSetTop';
|
|
|
10
10
|
export { useHostTheme } from './useHostTheme';
|
|
11
11
|
export { useResizeObserver } from './useResizeObserver';
|
|
12
12
|
export { useResponsiveDesktop } from './useResponsive';
|
|
13
|
-
export { useThemeMode } from './useThemeMode';
|
|
14
13
|
export { useThemeSettingsStore } from './useThemSettingsStore';
|
|
15
14
|
export { usePaginate } from './usePaginate';
|
|
16
15
|
export { useRows } from './useRows';
|
package/hooks/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,e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OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { GlobalStyles as
|
|
1
|
+
import { GlobalStyles as t } from "./components/GlobalStyles/index.js";
|
|
2
2
|
import { M4L_CHROMATIC_AUTOFILL as p, getInputAutofillBodyNestedStyles as m, getInputAutofillKeyframeStyles as n } from "./components/GlobalStyles/getInputAutofillGlobalStyles.js";
|
|
3
3
|
import { getLocaleFromNetwork as x } from "./contexts/LocalesContext/helper.js";
|
|
4
4
|
import { FormatterContext as i, FormatterProvider as a } from "./contexts/FormatterContext/index.js";
|
|
5
|
-
import { AppearanceComponentContext as
|
|
6
|
-
import { createAppearanceComponentStore as
|
|
5
|
+
import { AppearanceComponentContext as u, AppearanceComponentProvider as S } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
|
|
6
|
+
import { createAppearanceComponentStore as T } from "./contexts/AppearanceComponentContext/AppearanceComponentStore.js";
|
|
7
7
|
import { useAppearanceComponentStore as A } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
|
|
8
|
-
import { LocalesContext as
|
|
8
|
+
import { LocalesContext as d, LocalesProvider as h } from "./contexts/LocalesContext/index.js";
|
|
9
9
|
import { ResponsiveContainerContext as y, ResponsiveContainerProvider as R } from "./contexts/ResponsiveContainerContext/index.js";
|
|
10
10
|
import { HostThemeContext as P, HostThemeProvider as F } from "./contexts/HostThemeContext/index.js";
|
|
11
|
-
import { DeviceTypeContext as
|
|
11
|
+
import { DeviceTypeContext as b, DeviceTypeProvider as M } from "./contexts/DeviceTypeContext/index.js";
|
|
12
12
|
import { KEY_LOCAL_STORAGE_THEME_SETTINGS as E, defaultThemeSettings as O } from "./contexts/ThemeSettingsContext/constants.js";
|
|
13
13
|
import { ThemeSettingsContext as H, ThemeSettingsProvider as W } from "./contexts/ThemeSettingsContext/ThemeSettingsContext.js";
|
|
14
14
|
import { WithAppearanceContext as z } from "./decorators/WithAppearanceContext/WithAppearanceContext.js";
|
|
@@ -20,33 +20,32 @@ import { useComponentSize as Q } from "./hooks/useComponentSize/useComponentSize
|
|
|
20
20
|
import { useFormatter as X } from "./hooks/useFormatter/index.js";
|
|
21
21
|
import { useIsMountedRef as $ } from "./hooks/useIsMountedRef/index.js";
|
|
22
22
|
import { useLocales as oe } from "./hooks/useLocales/index.js";
|
|
23
|
-
import { useResponsiveContainerStore as
|
|
23
|
+
import { useResponsiveContainerStore as re } from "./hooks/useResponsiveContainer/index.js";
|
|
24
24
|
import { useUserAgent as me } from "./hooks/useUserAgent/index.js";
|
|
25
25
|
import { useIsMobile as se } from "./hooks/useIsMobile/index.js";
|
|
26
26
|
import { useOffSetTop as fe } from "./hooks/useOffSetTop.js";
|
|
27
27
|
import { useHostTheme as ae } from "./hooks/useHostTheme/index.js";
|
|
28
|
-
import { useResizeObserver as
|
|
29
|
-
import { useResponsiveDesktop as
|
|
30
|
-
import {
|
|
31
|
-
import { useThemeSettingsStore as de } from "./hooks/useThemSettingsStore/index.js";
|
|
28
|
+
import { useResizeObserver as ue } from "./hooks/useResizeObserver/index.js";
|
|
29
|
+
import { useResponsiveDesktop as le } from "./hooks/useResponsive/index.js";
|
|
30
|
+
import { useThemeSettingsStore as ce } from "./hooks/useThemSettingsStore/index.js";
|
|
32
31
|
import { usePaginate as ve } from "./hooks/usePaginate/index.js";
|
|
33
|
-
import { useRows as
|
|
34
|
-
import { capitalize as
|
|
35
|
-
import { getAnchorElPositionWindow as
|
|
36
|
-
import { getContrastTextColor as
|
|
32
|
+
import { useRows as he } from "./hooks/useRows/index.js";
|
|
33
|
+
import { capitalize as ye } from "./utils/strings.js";
|
|
34
|
+
import { getAnchorElPositionWindow as Le } from "./utils/anchorEl.js";
|
|
35
|
+
import { getContrastTextColor as Fe } from "./utils/getContrastTextColor/getContrastTextColor.js";
|
|
37
36
|
export {
|
|
38
|
-
|
|
37
|
+
u as AppearanceComponentContext,
|
|
39
38
|
S as AppearanceComponentProvider,
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
b as DeviceTypeContext,
|
|
40
|
+
M as DeviceTypeProvider,
|
|
42
41
|
i as FormatterContext,
|
|
43
42
|
a as FormatterProvider,
|
|
44
|
-
|
|
43
|
+
t as GlobalStyles,
|
|
45
44
|
P as HostThemeContext,
|
|
46
45
|
F as HostThemeProvider,
|
|
47
46
|
E as KEY_LOCAL_STORAGE_THEME_SETTINGS,
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
d as LocalesContext,
|
|
48
|
+
h as LocalesProvider,
|
|
50
49
|
p as M4L_CHROMATIC_AUTOFILL,
|
|
51
50
|
K as MFAppStorybook,
|
|
52
51
|
G as MFIsolationAppStorybook,
|
|
@@ -56,12 +55,12 @@ export {
|
|
|
56
55
|
W as ThemeSettingsProvider,
|
|
57
56
|
z as WithAppearanceContext,
|
|
58
57
|
B as WithStorybookThemeContext,
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
ye as capitalize,
|
|
59
|
+
T as createAppearanceComponentStore,
|
|
61
60
|
Y as createWithStorybookThemeContext,
|
|
62
61
|
O as defaultThemeSettings,
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
Le as getAnchorElPositionWindow,
|
|
63
|
+
Fe as getContrastTextColor,
|
|
65
64
|
m as getInputAutofillBodyNestedStyles,
|
|
66
65
|
n as getInputAutofillKeyframeStyles,
|
|
67
66
|
x as getLocaleFromNetwork,
|
|
@@ -75,11 +74,10 @@ export {
|
|
|
75
74
|
oe as useLocales,
|
|
76
75
|
fe as useOffSetTop,
|
|
77
76
|
ve as usePaginate,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
ce as
|
|
83
|
-
de as useThemeSettingsStore,
|
|
77
|
+
ue as useResizeObserver,
|
|
78
|
+
re as useResponsiveContainerStore,
|
|
79
|
+
le as useResponsiveDesktop,
|
|
80
|
+
he as useRows,
|
|
81
|
+
ce as useThemeSettingsStore,
|
|
84
82
|
me as useUserAgent
|
|
85
83
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/hooks/useThemeMode/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAiDzC;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAMxC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore as u } from "react";
|
|
2
|
-
const d = "--m4l-mode", o = "light";
|
|
3
|
-
function i(e) {
|
|
4
|
-
return e?.trim() === "dark" ? "dark" : o;
|
|
5
|
-
}
|
|
6
|
-
function n() {
|
|
7
|
-
return typeof document > "u" || typeof window > "u" ? o : i(
|
|
8
|
-
window.getComputedStyle(document.documentElement).getPropertyValue(d)
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
function m(e) {
|
|
12
|
-
if (typeof document > "u" || typeof MutationObserver > "u")
|
|
13
|
-
return () => {
|
|
14
|
-
};
|
|
15
|
-
const r = document.documentElement, t = new MutationObserver(() => {
|
|
16
|
-
e();
|
|
17
|
-
});
|
|
18
|
-
return t.observe(r, {
|
|
19
|
-
attributes: !0,
|
|
20
|
-
attributeFilter: ["style", "data-mui-color-scheme"]
|
|
21
|
-
}), () => {
|
|
22
|
-
t.disconnect();
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function s() {
|
|
26
|
-
return u(
|
|
27
|
-
m,
|
|
28
|
-
n,
|
|
29
|
-
n
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
s as useThemeMode
|
|
34
|
-
};
|