@m4l/graphics 0.1.53 → 1.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/GlobalStyle/{index.fff91e86.js → index.c11ef3f3.js} +22 -16
- package/contexts/HostThemeContext/index.86691e12.js +43 -0
- package/contexts/HostThemeContext/types.d.ts +3 -3
- package/contexts/{index.921576cc.js → index.d28ab716.js} +2 -2
- package/hooks/{index.66afb19b.js → index.73785922.js} +11 -10
- package/hooks/index.d.ts +1 -0
- package/hooks/useIsMobile/index.3de7c47a.js +16 -0
- package/hooks/useIsMobile/index.d.ts +1 -0
- package/hooks/useResponsive/{index.c9515afc.js → index.2b01d764.js} +2 -2
- package/index.js +21 -19
- package/node_modules.9eeccca4.js +4558 -0
- package/package.json +1 -1
- package/contexts/HostThemeContext/index.4291ba89.js +0 -54
- package/node_modules.dbab0abd.js +0 -4438
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { useTheme as o } from "@mui/material/styles";
|
|
2
|
-
import { GlobalStyles as
|
|
3
|
-
import { globalRemSize as
|
|
4
|
-
import { jsx as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */ e
|
|
2
|
+
import { GlobalStyles as e } from "@mui/material";
|
|
3
|
+
import { globalRemSize as r } from "@m4l/styles";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
function p() {
|
|
6
|
+
const t = o();
|
|
7
|
+
return console.log("theme test", t), /* @__PURE__ */ a(e, {
|
|
8
8
|
styles: {
|
|
9
9
|
body: {
|
|
10
|
-
|
|
10
|
+
textRendering: "geometricPrecision",
|
|
11
|
+
width: "100%",
|
|
12
|
+
height: "100vh",
|
|
11
13
|
"*::-webkit-scrollbar": {
|
|
12
14
|
width: "7px",
|
|
13
15
|
height: "7px",
|
|
@@ -22,8 +24,12 @@ function s() {
|
|
|
22
24
|
backgroundColor: "transparent"
|
|
23
25
|
},
|
|
24
26
|
"*::-webkit-scrollbar-thumb": {
|
|
25
|
-
background:
|
|
27
|
+
background: t.vars.palette,
|
|
26
28
|
borderRadius: "2px!important"
|
|
29
|
+
},
|
|
30
|
+
"& #root": {
|
|
31
|
+
width: "100%",
|
|
32
|
+
height: "100%"
|
|
27
33
|
}
|
|
28
34
|
},
|
|
29
35
|
"#nprogress": {
|
|
@@ -34,9 +40,9 @@ function s() {
|
|
|
34
40
|
height: 2,
|
|
35
41
|
width: "100%",
|
|
36
42
|
position: "fixed",
|
|
37
|
-
zIndex:
|
|
38
|
-
backgroundColor:
|
|
39
|
-
boxShadow: `0 0 2px ${
|
|
43
|
+
zIndex: t.zIndex.snackbar,
|
|
44
|
+
backgroundColor: t.vars.palette.primary.main,
|
|
45
|
+
boxShadow: `0 0 2px ${t.vars.palette.primary.main}`
|
|
40
46
|
},
|
|
41
47
|
"& .peg": {
|
|
42
48
|
right: 0,
|
|
@@ -46,18 +52,18 @@ function s() {
|
|
|
46
52
|
display: "block",
|
|
47
53
|
position: "absolute",
|
|
48
54
|
transform: "rotate(3deg) translate(0px, -4px)",
|
|
49
|
-
boxShadow: `0 0 10px ${
|
|
55
|
+
boxShadow: `0 0 10px ${t.vars.palette.primary.main}, 0 0 5px ${t.vars.palette.primary.main}`
|
|
50
56
|
}
|
|
51
57
|
},
|
|
52
58
|
"& html": {
|
|
53
|
-
fontSize:
|
|
54
|
-
[
|
|
55
|
-
fontSize:
|
|
59
|
+
fontSize: r.desktop,
|
|
60
|
+
[t.breakpoints.down("sm")]: {
|
|
61
|
+
fontSize: r.mobile
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
});
|
|
60
66
|
}
|
|
61
67
|
export {
|
|
62
|
-
|
|
68
|
+
p as G
|
|
63
69
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createContext as l, useMemo as c } from "react";
|
|
2
|
+
import { CssBaseline as h } from "@mui/material";
|
|
3
|
+
import { createTheme as a, experimental_extendTheme as d, Experimental_CssVarsProvider as p, StyledEngineProvider as x } from "@mui/material/styles";
|
|
4
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
const T = l(null);
|
|
6
|
+
function g(i) {
|
|
7
|
+
const {
|
|
8
|
+
children: m,
|
|
9
|
+
hostThemeOptions: t,
|
|
10
|
+
fnComponentsOverrides: n
|
|
11
|
+
} = i, e = a({
|
|
12
|
+
...t
|
|
13
|
+
}), s = c(() => {
|
|
14
|
+
const r = d({
|
|
15
|
+
cssVarPrefix: "m4l",
|
|
16
|
+
colorSchemes: {
|
|
17
|
+
light: e,
|
|
18
|
+
finalTheme: e,
|
|
19
|
+
dark: e
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return r.components = n(r), r;
|
|
23
|
+
}, []);
|
|
24
|
+
return console.log("finalTheme", s), /* @__PURE__ */ o(p, {
|
|
25
|
+
theme: s,
|
|
26
|
+
children: /* @__PURE__ */ o(T.Provider, {
|
|
27
|
+
value: {
|
|
28
|
+
hostThemeOptions: t,
|
|
29
|
+
fnComponentsOverrides: n
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ f(x, {
|
|
32
|
+
injectFirst: !0,
|
|
33
|
+
children: [/* @__PURE__ */ o(h, {
|
|
34
|
+
enableColorScheme: !0
|
|
35
|
+
}), m]
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
T as H,
|
|
42
|
+
g as a
|
|
43
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Theme, CssVarsTheme } from '@mui/material/styles';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export declare type EventFunListener = (...args: any[]) => void;
|
|
4
4
|
export interface HostThemeType {
|
|
5
|
-
hostThemeOptions:
|
|
6
|
-
fnComponentsOverrides: (theme: Theme) => any;
|
|
5
|
+
hostThemeOptions: Theme;
|
|
6
|
+
fnComponentsOverrides: (theme: Omit<Theme, "palette" | "applyStyles"> & CssVarsTheme) => any;
|
|
7
7
|
}
|
|
8
8
|
export interface HostThemeProviderProps extends HostThemeType {
|
|
9
9
|
isMicroFrontEnd: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./FormatterContext/index.92336f4c.js";
|
|
2
2
|
import "./LocalesContext/index.53f0b702.js";
|
|
3
3
|
import { createContext as d, useRef as p, useMemo as v, useLayoutEffect as f } from "react";
|
|
4
|
-
import { c as u, d as R, i as g, l as h } from "../node_modules.
|
|
4
|
+
import { c as u, d as R, i as g, l as h } from "../node_modules.9eeccca4.js";
|
|
5
5
|
import { jsx as x } from "react/jsx-runtime";
|
|
6
6
|
import "date-fns/locale/en-US";
|
|
7
|
-
import "./HostThemeContext/index.
|
|
7
|
+
import "./HostThemeContext/index.86691e12.js";
|
|
8
8
|
const m = { xs: 600, sm: 900, md: 1200, lg: 1536, xl: 1920 }, S = (c) => {
|
|
9
9
|
const a = {
|
|
10
10
|
...c
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useRef as r, useEffect as n, useState as f, useContext as i, useLayoutEffect as c } from "react";
|
|
2
|
-
import { H as m } from "../contexts/HostThemeContext/index.
|
|
2
|
+
import { H as m } from "../contexts/HostThemeContext/index.86691e12.js";
|
|
3
3
|
import "../contexts/FormatterContext/index.92336f4c.js";
|
|
4
4
|
import "../contexts/LocalesContext/index.53f0b702.js";
|
|
5
|
-
import "../contexts/index.
|
|
5
|
+
import "../contexts/index.d28ab716.js";
|
|
6
|
+
import "../node_modules.9eeccca4.js";
|
|
6
7
|
import "@m4l/styles";
|
|
7
|
-
function
|
|
8
|
+
function h() {
|
|
8
9
|
const e = r(!0);
|
|
9
10
|
return n(
|
|
10
11
|
() => () => {
|
|
@@ -13,7 +14,7 @@ function b() {
|
|
|
13
14
|
[]
|
|
14
15
|
), e;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function v(e) {
|
|
17
18
|
const [o, t] = f(!1), s = e || 100;
|
|
18
19
|
return n(() => (window.onscroll = () => {
|
|
19
20
|
window.pageYOffset > s ? t(!0) : t(!1);
|
|
@@ -21,13 +22,13 @@ function h(e) {
|
|
|
21
22
|
window.onscroll = null;
|
|
22
23
|
}), [s]), o;
|
|
23
24
|
}
|
|
24
|
-
const
|
|
25
|
+
const x = () => {
|
|
25
26
|
const e = i(m);
|
|
26
27
|
if (!e)
|
|
27
28
|
throw new Error("useHostTheme context must be use inside HostThemeProvider");
|
|
28
29
|
return e;
|
|
29
30
|
};
|
|
30
|
-
function
|
|
31
|
+
function H(e) {
|
|
31
32
|
const o = r(null);
|
|
32
33
|
return c(() => {
|
|
33
34
|
const t = o?.current;
|
|
@@ -42,8 +43,8 @@ function x(e) {
|
|
|
42
43
|
}, [e, o.current]), o;
|
|
43
44
|
}
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
v as a,
|
|
47
|
+
x as b,
|
|
48
|
+
H as c,
|
|
49
|
+
h as u
|
|
49
50
|
};
|
package/hooks/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { useFormatter } from './useFormatter';
|
|
|
3
3
|
export { useIsMountedRef } from './useIsMountedRef';
|
|
4
4
|
export { useLocales } from './useLocales';
|
|
5
5
|
export { useResponsiveContainerStore } from './useResponsiveContainer';
|
|
6
|
+
export { useIsMobile } from './useIsMobile';
|
|
6
7
|
export { useOffSetTop } from './useOffSetTop';
|
|
7
8
|
export { useHostTheme } from './useHostTheme';
|
|
8
9
|
export { useResizeObserver } from './useResizeObserver';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState as n, useEffect as o } from "react";
|
|
2
|
+
import { t as s } from "../../node_modules.9eeccca4.js";
|
|
3
|
+
const t = () => typeof navigator > "u" ? !1 : /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), l = () => {
|
|
4
|
+
const [i, r] = n(t());
|
|
5
|
+
return o(() => {
|
|
6
|
+
const e = s(() => {
|
|
7
|
+
r(t());
|
|
8
|
+
}, 200);
|
|
9
|
+
return window.addEventListener("resize", e), e(), () => {
|
|
10
|
+
window.removeEventListener("resize", e), e.cancel();
|
|
11
|
+
};
|
|
12
|
+
}, []), i;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
l as u
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsMobile: () => boolean;
|
|
@@ -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.9eeccca4.js";
|
|
3
|
+
import { R as n } from "../../contexts/index.d28ab716.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,14 +1,15 @@
|
|
|
1
|
-
import { G as l } from "./components/GlobalStyle/index.
|
|
1
|
+
import { G as l } from "./components/GlobalStyle/index.c11ef3f3.js";
|
|
2
2
|
import { F as C, a as R } from "./contexts/FormatterContext/index.92336f4c.js";
|
|
3
3
|
import { L as c, a as F, g as L } from "./contexts/LocalesContext/index.53f0b702.js";
|
|
4
|
-
import { R as
|
|
5
|
-
import { H
|
|
4
|
+
import { R as b, a as g } from "./contexts/index.d28ab716.js";
|
|
5
|
+
import { H, a as T } from "./contexts/HostThemeContext/index.86691e12.js";
|
|
6
6
|
import { u as k } from "./hooks/useFirstRender/index.1e9b02fb.js";
|
|
7
7
|
import { u as z } from "./hooks/useFormatter/index.57ac8cca.js";
|
|
8
|
-
import { b as
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as N, a as W } from "./hooks/useResponsive/index.
|
|
11
|
-
import {
|
|
8
|
+
import { b as I, u as M, a as O, c as y } from "./hooks/index.73785922.js";
|
|
9
|
+
import { u as D } from "./hooks/useLocales/index.d5a80aff.js";
|
|
10
|
+
import { u as N, a as W } from "./hooks/useResponsive/index.2b01d764.js";
|
|
11
|
+
import { u as q } from "./hooks/useIsMobile/index.3de7c47a.js";
|
|
12
|
+
import { C as J, g as K } from "./utils/index.6909c662.js";
|
|
12
13
|
import "@mui/material/styles";
|
|
13
14
|
import "@mui/material";
|
|
14
15
|
import "@m4l/styles";
|
|
@@ -18,28 +19,29 @@ import "@m4l/core";
|
|
|
18
19
|
import "@mui/x-date-pickers/AdapterDateFns";
|
|
19
20
|
import "@mui/x-date-pickers";
|
|
20
21
|
import "date-fns/locale/en-US";
|
|
21
|
-
import "./node_modules.
|
|
22
|
+
import "./node_modules.9eeccca4.js";
|
|
22
23
|
import "./commonjs.e3daa2e5.js";
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
J as Capitalize,
|
|
25
26
|
C as FormatterContext,
|
|
26
27
|
R as FormatterProvider,
|
|
27
28
|
l as GlobalStyles,
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
H as HostThemeContext,
|
|
30
|
+
T as HostThemeProvider,
|
|
30
31
|
c as LocalesContext,
|
|
31
32
|
F as LocalesProvider,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
b as ResponsiveContainerContext,
|
|
34
|
+
g as ResponsiveContainerProvider,
|
|
35
|
+
K as getAnchorElPositionWindow,
|
|
35
36
|
L as getLocaleFromNetwork,
|
|
36
37
|
k as useFirstRender,
|
|
37
38
|
z as useFormatter,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
I as useHostTheme,
|
|
40
|
+
q as useIsMobile,
|
|
41
|
+
M as useIsMountedRef,
|
|
42
|
+
D as useLocales,
|
|
43
|
+
O as useOffSetTop,
|
|
44
|
+
y as useResizeObserver,
|
|
43
45
|
N as useResponsiveContainerStore,
|
|
44
46
|
W as useResponsiveDesktop
|
|
45
47
|
};
|