@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.
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/graphics/src/contexts/ThemeSettingsContext/store.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAI9B,MAAM,SAAS,CAAC;AAiHjB;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc,8BAA8B;;;;;;;;CAwKpF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
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 a } from "zustand/middleware/immer";
4
- import { getPaletteByPreset as f, createCustomShadows as y, shadows as g, typographyOld as U, getColorPresets as p } from "@m4l/styles";
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 l } from "./constants.js";
7
- function S(r, o = "m4l") {
8
- const n = typeof document > "u" ? null : document.documentElement;
9
- if (!n)
10
- return;
11
- const e = r?.palette?.mode;
12
- o === "m4l" && (typeof e == "string" || typeof e == "number") && n.style.setProperty(`--${o}-mode`, e.toString()), Object.keys(r).forEach((t) => {
13
- const i = r[t];
14
- if (typeof i == "string" || typeof i == "number") {
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 || l, n = o.themeMode === "light", e = f(o.themeColor), t = n ? e.light : e.dark;
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
- ...U,
22
+ ...T,
25
23
  palette: {
26
24
  ...r.themeOptions?.palette ?? {},
27
- ...t
25
+ ...e
28
26
  },
29
27
  shape: { borderRadius: 8 },
30
28
  direction: o.themeDirection,
31
- shadows: n ? g.light : g.dark,
29
+ shadows: n ? l.light : l.dark,
32
30
  customShadows: {
33
- primary: n ? `0 4px 8px -4px ${s(p(o.themeColor)?.enabledLight, 0.12)},
34
- 0 2px 27px 2px ${s(p(o.themeColor)?.enabledLight, 0.02)}` : `0 4px 8px -4px ${s(p(o.themeColor)?.enabledDark, 0.12)},
35
- 0 2px 27px 2px ${s(p(o.themeColor)?.enabledDark, 0.02)}`,
36
- ...y(o.themeMode),
37
- primary2: n ? `0px 2px 3px 0px ${s(p(o.themeColor)?.hoverOpacityLight, 0.2)}` : `0px 2px 3px 0px ${s(p(o.themeColor)?.hoverOpacityDark, 0.2)}`
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
- }, S(r.themeOptions);
38
+ }, c(r.themeOptions);
41
39
  }, h = (r) => {
42
40
  r.themeSettingsPersistFn?.(r.themeUserSettings);
43
- }, M = (r) => d(
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
- a((o, n) => ({
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((e) => {
57
- m(e);
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: (e) => {
68
- o((t) => {
69
- t.themeUserSettings = { ...t.themeUserSettings, ...e }, h(t), m(t);
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: (e) => {
80
- o((t) => {
81
- e !== t.themeUserSettings.themeMode && (t.themeUserSettings = {
82
- ...t.themeUserSettings,
83
- themeMode: e
84
- }, h(t), m(t));
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((e) => {
96
- e.open = !e.open;
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: (e) => {
107
- o((t) => {
108
- e !== t.themeUserSettings.themeDirection && (t.themeUserSettings = {
109
- ...t.themeUserSettings,
110
- themeDirection: e
111
- }, h(t), m(t));
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: (e) => {
122
- o((t) => {
123
- e !== t.themeUserSettings.themeColor && (t.themeUserSettings = {
124
- ...t.themeUserSettings,
125
- themeColor: e
126
- }, h(t), m(t));
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: (e) => {
137
- o((t) => {
138
- t.themeUserSettings = {
139
- ...t.themeUserSettings,
140
- themeLayout: e.target.value
141
- }, h(t), m(t);
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((e) => {
153
- e.themeUserSettings = {
154
- ...e.themeUserSettings,
155
- themeStretch: !e.themeUserSettings.themeStretch
156
- }, h(e), m(e);
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((e) => {
168
- e.themeUserSettings = {
169
- ...l
170
- }, h(e), m(e);
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
- M as createThemeSettingsStore
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,gBAA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,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/C,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,mBAAmB,CAAC,EAAE,aAAa,CAAC;IACpC;;;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,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';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/graphics/src/hooks/index.ts"],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E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,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 r } from "./components/GlobalStyles/index.js";
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 C, AppearanceComponentProvider as S } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
6
- import { createAppearanceComponentStore as l } from "./contexts/AppearanceComponentContext/AppearanceComponentStore.js";
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 h, LocalesProvider as v } from "./contexts/LocalesContext/index.js";
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 M, DeviceTypeProvider as b } from "./contexts/DeviceTypeContext/index.js";
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 te } from "./hooks/useResponsiveContainer/index.js";
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 Ce } from "./hooks/useResizeObserver/index.js";
29
- import { useResponsiveDesktop as Te } from "./hooks/useResponsive/index.js";
30
- import { useThemeMode as ce } from "./hooks/useThemeMode/index.js";
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 ye } from "./hooks/useRows/index.js";
34
- import { capitalize as Le } from "./utils/strings.js";
35
- import { getAnchorElPositionWindow as Fe } from "./utils/anchorEl.js";
36
- import { getContrastTextColor as Me } from "./utils/getContrastTextColor/getContrastTextColor.js";
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
- C as AppearanceComponentContext,
37
+ u as AppearanceComponentContext,
39
38
  S as AppearanceComponentProvider,
40
- M as DeviceTypeContext,
41
- b as DeviceTypeProvider,
39
+ b as DeviceTypeContext,
40
+ M as DeviceTypeProvider,
42
41
  i as FormatterContext,
43
42
  a as FormatterProvider,
44
- r as GlobalStyles,
43
+ t as GlobalStyles,
45
44
  P as HostThemeContext,
46
45
  F as HostThemeProvider,
47
46
  E as KEY_LOCAL_STORAGE_THEME_SETTINGS,
48
- h as LocalesContext,
49
- v as LocalesProvider,
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
- Le as capitalize,
60
- l as createAppearanceComponentStore,
58
+ ye as capitalize,
59
+ T as createAppearanceComponentStore,
61
60
  Y as createWithStorybookThemeContext,
62
61
  O as defaultThemeSettings,
63
- Fe as getAnchorElPositionWindow,
64
- Me as getContrastTextColor,
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
- Ce as useResizeObserver,
79
- te as useResponsiveContainerStore,
80
- Te as useResponsiveDesktop,
81
- ye as useRows,
82
- ce as useThemeMode,
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "7.5.0-beta-feature-731-m4l-components-code-editor.0",
3
+ "version": "7.5.0-beta-feature-731-code-editor.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,6 +0,0 @@
1
- export type ThemeMode = 'light' | 'dark';
2
- /**
3
- * Return the current document theme mode derived from the `--m4l-mode` CSS variable.
4
- */
5
- export declare function useThemeMode(): ThemeMode;
6
- //# sourceMappingURL=index.d.ts.map
@@ -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
- };