@m4l/graphics 1.0.11 → 2.0.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/components/index.d8d41b1b.js +1 -0
- package/contexts/{index.9a0fbc7c.js → index.43eb2431.js} +8 -12
- package/hooks/index.a56c80bc.js +54 -0
- package/hooks/useIsMobile/{index.54bf37f7.js → index.a6493a85.js} +1 -1
- package/hooks/useResponsive/{index.ea7ff1dc.js → index.24a3087b.js} +2 -2
- package/index.js +13 -13
- package/package.json +2 -2
- package/vite-env.d.ts +1 -1
- package/components/index.8083534b.js +0 -4
- package/hooks/index.ff8c4415.js +0 -57
- /package/{node_modules.9690bbee.js → node_modules.f4ae204b.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import "./FormatterContext/index.92336f4c.js";
|
|
2
|
-
import "./LocalesContext/index.53f0b702.js";
|
|
3
1
|
import { createContext as f, useRef as T, useMemo as k, useLayoutEffect as y, useEffect as b } from "react";
|
|
4
|
-
import { c as v, d as R, i as P, l as E } from "../node_modules.
|
|
2
|
+
import { c as v, d as R, i as P, l as E } from "../node_modules.f4ae204b.js";
|
|
5
3
|
import { jsx as x } from "react/jsx-runtime";
|
|
6
|
-
import "date-fns/locale/en-US";
|
|
7
|
-
import "./HostThemeContext/index.89c85eb6.js";
|
|
8
4
|
import { useNetwork as M, useLocalStorageWithListener as w } from "@m4l/core";
|
|
9
|
-
import { getColorPresets as m, getColorState as d, typography as L, palette as
|
|
5
|
+
import { getColorPresets as m, getColorState as d, typography as L, palette as S, SECONDARY as A, COMMON as N, ERROR as D, WARNING as z, INFO as B, SUCCESS as $, shadows as p, createCustomShadows as j, defaultThemeOptions as W, defaultPreset as _, colorPresets as F } from "@m4l/styles";
|
|
10
6
|
import { alpha as I } from "@mui/system";
|
|
11
7
|
import { u as U } from "../hooks/useFirstRender/index.1e9b02fb.js";
|
|
12
8
|
const C = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, K = (r) => {
|
|
@@ -28,7 +24,7 @@ const C = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, K = (r) => {
|
|
|
28
24
|
{ name: "Responsive Relative Store" }
|
|
29
25
|
)
|
|
30
26
|
);
|
|
31
|
-
}, X = f(null),
|
|
27
|
+
}, X = f(null), te = (r) => {
|
|
32
28
|
const {
|
|
33
29
|
children: t,
|
|
34
30
|
observedDivRef: o
|
|
@@ -104,7 +100,7 @@ const c = (r) => {
|
|
|
104
100
|
typography: L,
|
|
105
101
|
palette: {
|
|
106
102
|
...r.themeOptions.palette,
|
|
107
|
-
...o ?
|
|
103
|
+
...o ? S.light : S.dark,
|
|
108
104
|
primary: m(t.themeColorPresets),
|
|
109
105
|
state: d(t.themeColorPresets, t.themeMode),
|
|
110
106
|
representative: t.themeMode === "light" ? m(t.themeColorPresets)?.light : m(t.themeColorPresets)?.darker,
|
|
@@ -160,7 +156,7 @@ const c = (r) => {
|
|
|
160
156
|
},
|
|
161
157
|
shape: { borderRadius: 8 },
|
|
162
158
|
direction: t.themeDirection,
|
|
163
|
-
shadows: o ?
|
|
159
|
+
shadows: o ? p.light : p.dark,
|
|
164
160
|
customShadows: {
|
|
165
161
|
primary: `0 8px 16px 0 ${I(
|
|
166
162
|
m(t.themeColorPresets)?.main || "#fff",
|
|
@@ -244,7 +240,7 @@ const c = (r) => {
|
|
|
244
240
|
{ name: "ExampleStore" }
|
|
245
241
|
)
|
|
246
242
|
), G = f(null);
|
|
247
|
-
function
|
|
243
|
+
function ne({
|
|
248
244
|
children: r,
|
|
249
245
|
themeSettings: t
|
|
250
246
|
}) {
|
|
@@ -274,7 +270,7 @@ function ie({
|
|
|
274
270
|
export {
|
|
275
271
|
X as R,
|
|
276
272
|
G as T,
|
|
277
|
-
|
|
278
|
-
|
|
273
|
+
te as a,
|
|
274
|
+
ne as b,
|
|
279
275
|
u as d
|
|
280
276
|
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useRef as n, useEffect as r, useState as i, useContext as u, useLayoutEffect as c } from "react";
|
|
2
|
+
import { H as m } from "../contexts/HostThemeContext/index.89c85eb6.js";
|
|
3
|
+
import { u as a } from "../node_modules.f4ae204b.js";
|
|
4
|
+
import { T as l } from "../contexts/index.43eb2431.js";
|
|
5
|
+
function S() {
|
|
6
|
+
const e = n(!0);
|
|
7
|
+
return r(
|
|
8
|
+
() => () => {
|
|
9
|
+
e.current = !1;
|
|
10
|
+
},
|
|
11
|
+
[]
|
|
12
|
+
), e;
|
|
13
|
+
}
|
|
14
|
+
function x(e) {
|
|
15
|
+
const [s, t] = i(!1), o = e || 100;
|
|
16
|
+
return r(() => (window.onscroll = () => {
|
|
17
|
+
window.pageYOffset > o ? t(!0) : t(!1);
|
|
18
|
+
}, () => {
|
|
19
|
+
window.onscroll = null;
|
|
20
|
+
}), [o]), s;
|
|
21
|
+
}
|
|
22
|
+
const h = () => {
|
|
23
|
+
const e = u(m);
|
|
24
|
+
if (!e)
|
|
25
|
+
throw new Error("useHostTheme context must be use inside HostThemeProvider");
|
|
26
|
+
return e;
|
|
27
|
+
};
|
|
28
|
+
function b(e) {
|
|
29
|
+
const s = n(null);
|
|
30
|
+
return c(() => {
|
|
31
|
+
const t = s?.current;
|
|
32
|
+
if (!t)
|
|
33
|
+
return;
|
|
34
|
+
const o = new ResizeObserver((f) => {
|
|
35
|
+
e(t, f[0]);
|
|
36
|
+
});
|
|
37
|
+
return o.observe(t), () => {
|
|
38
|
+
o.disconnect();
|
|
39
|
+
};
|
|
40
|
+
}, [e, s.current]), s;
|
|
41
|
+
}
|
|
42
|
+
function g(e, s) {
|
|
43
|
+
const t = u(l);
|
|
44
|
+
if (!t)
|
|
45
|
+
throw new Error("useSettingsStore context must be use inside SettignsContext");
|
|
46
|
+
return a(t, e, s);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
x as a,
|
|
50
|
+
h as b,
|
|
51
|
+
b as c,
|
|
52
|
+
g as d,
|
|
53
|
+
S as u
|
|
54
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as n, useEffect as o } from "react";
|
|
2
|
-
import { t as s } from "../../node_modules.
|
|
2
|
+
import { t as s } from "../../node_modules.f4ae204b.js";
|
|
3
3
|
const t = () => typeof navigator > "u" ? !1 : /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), l = () => {
|
|
4
4
|
const [i, r] = n(t());
|
|
5
5
|
return o(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext as t } from "react";
|
|
2
|
-
import { u as r } from "../../node_modules.
|
|
3
|
-
import { R as n } from "../../contexts/index.
|
|
2
|
+
import { u as r } from "../../node_modules.f4ae204b.js";
|
|
3
|
+
import { R as n } from "../../contexts/index.43eb2431.js";
|
|
4
4
|
import { useResponsive as i } from "@m4l/styles";
|
|
5
5
|
function f(e, s) {
|
|
6
6
|
const o = t(n);
|
package/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { G as l } from "./components/GlobalStyle/index.b7393a44.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { R as F, a as P, T as b, b as L, d as H } from "./contexts/index.
|
|
2
|
+
import { L as C, a as T, g } from "./contexts/LocalesContext/index.53f0b702.js";
|
|
3
|
+
import { F as R, a as S } from "./contexts/FormatterContext/index.92336f4c.js";
|
|
4
|
+
import { R as F, a as P, T as b, b as L, d as H } from "./contexts/index.43eb2431.js";
|
|
5
5
|
import { H as w, a as z } from "./contexts/HostThemeContext/index.89c85eb6.js";
|
|
6
6
|
import { u as I } from "./hooks/useFirstRender/index.1e9b02fb.js";
|
|
7
7
|
import { u as O } from "./hooks/useFormatter/index.57ac8cca.js";
|
|
8
|
-
import { b as A, u as D, a as E, c as N, d as W } from "./hooks/index.
|
|
8
|
+
import { b as A, u as D, a as E, c as N, d as W } from "./hooks/index.a56c80bc.js";
|
|
9
9
|
import { u as q } from "./hooks/useLocales/index.d5a80aff.js";
|
|
10
|
-
import { u as J, a as K } from "./hooks/useResponsive/index.
|
|
11
|
-
import { u as U } from "./hooks/useIsMobile/index.
|
|
10
|
+
import { u as J, a as K } from "./hooks/useResponsive/index.24a3087b.js";
|
|
11
|
+
import { u as U } from "./hooks/useIsMobile/index.a6493a85.js";
|
|
12
12
|
import { C as X, g as Y } from "./utils/index.6909c662.js";
|
|
13
13
|
import "@mui/material/styles";
|
|
14
14
|
import "@mui/material";
|
|
15
15
|
import "@m4l/styles";
|
|
16
16
|
import "react/jsx-runtime";
|
|
17
17
|
import "react";
|
|
18
|
-
import "@m4l/core";
|
|
19
18
|
import "@mui/x-date-pickers/AdapterDateFns";
|
|
20
19
|
import "@mui/x-date-pickers";
|
|
20
|
+
import "@m4l/core";
|
|
21
21
|
import "date-fns/locale/en-US";
|
|
22
|
-
import "./node_modules.
|
|
22
|
+
import "./node_modules.f4ae204b.js";
|
|
23
23
|
import "./commonjs.e3daa2e5.js";
|
|
24
24
|
import "@mui/system";
|
|
25
25
|
export {
|
|
26
26
|
X as Capitalize,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
R as FormatterContext,
|
|
28
|
+
S as FormatterProvider,
|
|
29
29
|
l as GlobalStyles,
|
|
30
30
|
w as HostThemeContext,
|
|
31
31
|
z as HostThemeProvider,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
C as LocalesContext,
|
|
33
|
+
T as LocalesProvider,
|
|
34
34
|
F as ResponsiveContainerContext,
|
|
35
35
|
P as ResponsiveContainerProvider,
|
|
36
36
|
b as ThemeSettingsContext,
|
|
37
37
|
L as ThemeSettingsProvider,
|
|
38
38
|
H as defaultThemeSettings,
|
|
39
39
|
Y as getAnchorElPositionWindow,
|
|
40
|
-
|
|
40
|
+
g as getLocaleFromNetwork,
|
|
41
41
|
I as useFirstRender,
|
|
42
42
|
O as useFormatter,
|
|
43
43
|
A as useHostTheme,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/graphics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "M4L Team*",
|
|
6
6
|
"dependencies": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@types/react": "^17.0.0 || ^18.0.0",
|
|
15
15
|
"react": "^17.0.0 || ^18.0.0",
|
|
16
|
-
"react-toastify": "
|
|
16
|
+
"react-toastify": "10.0.5",
|
|
17
17
|
"lodash.clonedeep": "^4.5.0",
|
|
18
18
|
"lodash.debounce": "^4.0.8",
|
|
19
19
|
"lodash.throttle": "^4.1.1"
|
package/vite-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
1
|
+
/// <reference types="vite/client" />
|
package/hooks/index.ff8c4415.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { useRef as r, useEffect as n, useState as f, useContext as u, useLayoutEffect as c } from "react";
|
|
2
|
-
import { H as m } from "../contexts/HostThemeContext/index.89c85eb6.js";
|
|
3
|
-
import { u as a } from "../node_modules.9690bbee.js";
|
|
4
|
-
import { T as p } from "../contexts/index.9a0fbc7c.js";
|
|
5
|
-
import "../contexts/FormatterContext/index.92336f4c.js";
|
|
6
|
-
import "../contexts/LocalesContext/index.53f0b702.js";
|
|
7
|
-
import "@m4l/styles";
|
|
8
|
-
function b() {
|
|
9
|
-
const e = r(!0);
|
|
10
|
-
return n(
|
|
11
|
-
() => () => {
|
|
12
|
-
e.current = !1;
|
|
13
|
-
},
|
|
14
|
-
[]
|
|
15
|
-
), e;
|
|
16
|
-
}
|
|
17
|
-
function g(e) {
|
|
18
|
-
const [o, t] = f(!1), s = e || 100;
|
|
19
|
-
return n(() => (window.onscroll = () => {
|
|
20
|
-
window.pageYOffset > s ? t(!0) : t(!1);
|
|
21
|
-
}, () => {
|
|
22
|
-
window.onscroll = null;
|
|
23
|
-
}), [s]), o;
|
|
24
|
-
}
|
|
25
|
-
const v = () => {
|
|
26
|
-
const e = u(m);
|
|
27
|
-
if (!e)
|
|
28
|
-
throw new Error("useHostTheme context must be use inside HostThemeProvider");
|
|
29
|
-
return e;
|
|
30
|
-
};
|
|
31
|
-
function H(e) {
|
|
32
|
-
const o = r(null);
|
|
33
|
-
return c(() => {
|
|
34
|
-
const t = o?.current;
|
|
35
|
-
if (!t)
|
|
36
|
-
return;
|
|
37
|
-
const s = new ResizeObserver((i) => {
|
|
38
|
-
e(t, i[0]);
|
|
39
|
-
});
|
|
40
|
-
return s.observe(t), () => {
|
|
41
|
-
s.disconnect();
|
|
42
|
-
};
|
|
43
|
-
}, [e, o.current]), o;
|
|
44
|
-
}
|
|
45
|
-
function O(e, o) {
|
|
46
|
-
const t = u(p);
|
|
47
|
-
if (!t)
|
|
48
|
-
throw new Error("useSettingsStore context must be use inside SettignsContext");
|
|
49
|
-
return a(t, e, o);
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
g as a,
|
|
53
|
-
v as b,
|
|
54
|
-
H as c,
|
|
55
|
-
O as d,
|
|
56
|
-
b as u
|
|
57
|
-
};
|
|
File without changes
|