@etsoo/toolpad 1.0.42 → 1.0.45
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.
|
@@ -11,6 +11,10 @@ on:
|
|
|
11
11
|
# release:
|
|
12
12
|
# types: [created]
|
|
13
13
|
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write # Required for OIDC
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
14
18
|
jobs:
|
|
15
19
|
# Publish to NPM
|
|
16
20
|
publish-npm:
|
|
@@ -44,6 +48,4 @@ jobs:
|
|
|
44
48
|
|
|
45
49
|
# Publish to npm
|
|
46
50
|
# For scoped package, make it public for free service
|
|
47
|
-
- run: npm publish
|
|
48
|
-
env:
|
|
49
|
-
NODE_AUTH_TOKEN: ${{ secrets.ETSOONpmToken }}
|
|
51
|
+
- run: npm publish
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2004-
|
|
3
|
+
Copyright (c) 2004-2026 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -33,14 +33,13 @@ const AppProviderComponent_1 = require("../AppProvider/AppProviderComponent");
|
|
|
33
33
|
(0, vitest_1.test)("can switch theme", async () => {
|
|
34
34
|
const user = user_event_1.default.setup();
|
|
35
35
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(AppProviderComponent_1.AppProvider, { children: (0, jsx_runtime_1.jsx)(DashboardLayout_1.DashboardLayout, { showThemeSwitcher: true, children: "Hello world" }) }));
|
|
36
|
-
const getBackgroundColorCSSVariable = () => getComputedStyle(document.documentElement).getPropertyValue("--mui-palette-common-background");
|
|
37
36
|
const header = react_1.screen.getByRole("banner");
|
|
38
37
|
const themeSwitcherButton = (0, react_1.within)(header).getByLabelText("Switch to dark mode");
|
|
39
|
-
(0, vitest_1.expect)(
|
|
38
|
+
(0, vitest_1.expect)(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
|
|
40
39
|
await user.click(themeSwitcherButton);
|
|
41
|
-
(0, vitest_1.expect)(
|
|
40
|
+
(0, vitest_1.expect)(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("dark");
|
|
42
41
|
await user.click(themeSwitcherButton);
|
|
43
|
-
(0, vitest_1.expect)(
|
|
42
|
+
(0, vitest_1.expect)(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
|
|
44
43
|
});
|
|
45
44
|
(0, vitest_1.test)("navigation works correctly", async () => {
|
|
46
45
|
const NAVIGATION = [
|
|
@@ -28,14 +28,13 @@ describe("DashboardLayout", () => {
|
|
|
28
28
|
test("can switch theme", async () => {
|
|
29
29
|
const user = userEvent.setup();
|
|
30
30
|
render(_jsx(AppProvider, { children: _jsx(DashboardLayout, { showThemeSwitcher: true, children: "Hello world" }) }));
|
|
31
|
-
const getBackgroundColorCSSVariable = () => getComputedStyle(document.documentElement).getPropertyValue("--mui-palette-common-background");
|
|
32
31
|
const header = screen.getByRole("banner");
|
|
33
32
|
const themeSwitcherButton = within(header).getByLabelText("Switch to dark mode");
|
|
34
|
-
expect(
|
|
33
|
+
expect(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
|
|
35
34
|
await user.click(themeSwitcherButton);
|
|
36
|
-
expect(
|
|
35
|
+
expect(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("dark");
|
|
37
36
|
await user.click(themeSwitcherButton);
|
|
38
|
-
expect(
|
|
37
|
+
expect(document.documentElement.getAttribute("data-toolpad-color-scheme")).toBe("light");
|
|
39
38
|
});
|
|
40
39
|
test("navigation works correctly", async () => {
|
|
41
40
|
const NAVIGATION = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/toolpad",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
4
4
|
"author": "ETSOO",
|
|
5
5
|
"description": "Dashboard framework extention based on Toolpad Core",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -47,36 +47,35 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@emotion/react": "^11.14.0",
|
|
49
49
|
"@emotion/styled": "^11.14.1",
|
|
50
|
-
"@mui/icons-material": "7.3.
|
|
51
|
-
"@mui/material": "7.3.
|
|
52
|
-
"@mui/utils": "7.3.
|
|
50
|
+
"@mui/icons-material": "7.3.8",
|
|
51
|
+
"@mui/material": "7.3.8",
|
|
52
|
+
"@mui/utils": "7.3.8",
|
|
53
53
|
"invariant": "2.2.4",
|
|
54
|
-
"path-to-regexp": "6.3.0",
|
|
55
|
-
"react": "^19.2.
|
|
56
|
-
"react-dom": "^19.2.
|
|
54
|
+
"path-to-regexp": "^6.3.0",
|
|
55
|
+
"react": "^19.2.4",
|
|
56
|
+
"react-dom": "^19.2.4"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@babel/
|
|
60
|
-
"@babel/
|
|
61
|
-
"@babel/
|
|
62
|
-
"@babel/
|
|
63
|
-
"@babel/runtime-corejs3": "^7.28.4",
|
|
59
|
+
"@babel/core": "^7.29.0",
|
|
60
|
+
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
61
|
+
"@babel/preset-env": "^7.29.0",
|
|
62
|
+
"@babel/runtime-corejs3": "^7.29.0",
|
|
64
63
|
"@testing-library/jest-dom": "^6.9.1",
|
|
65
|
-
"@testing-library/react": "^16.3.
|
|
64
|
+
"@testing-library/react": "^16.3.2",
|
|
66
65
|
"@testing-library/user-event": "^14.6.1",
|
|
67
66
|
"@types/invariant": "2.2.37",
|
|
68
|
-
"@types/node": "^
|
|
69
|
-
"@types/react": "19.2.
|
|
70
|
-
"@types/react-dom": "19.2.
|
|
71
|
-
"@vitejs/plugin-react": "5.1.
|
|
72
|
-
"@vitest/browser": "4.0.
|
|
73
|
-
"@vitest/browser-playwright": "^4.0.
|
|
74
|
-
"jsdom": "^
|
|
75
|
-
"next": "^16.
|
|
76
|
-
"next-router-mock": "^1.0.
|
|
77
|
-
"playwright": "^1.
|
|
78
|
-
"react-router-dom": "^7.
|
|
79
|
-
"vitest": "4.0.
|
|
67
|
+
"@types/node": "^25.3.0",
|
|
68
|
+
"@types/react": "19.2.14",
|
|
69
|
+
"@types/react-dom": "19.2.3",
|
|
70
|
+
"@vitejs/plugin-react": "5.1.4",
|
|
71
|
+
"@vitest/browser": "4.0.18",
|
|
72
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
73
|
+
"jsdom": "^28.1.0",
|
|
74
|
+
"next": "^16.1.6",
|
|
75
|
+
"next-router-mock": "^1.0.5",
|
|
76
|
+
"playwright": "^1.58.2",
|
|
77
|
+
"react-router-dom": "^7.13.0",
|
|
78
|
+
"vitest": "4.0.18"
|
|
80
79
|
},
|
|
81
80
|
"peerDependenciesMeta": {
|
|
82
81
|
"next": {
|
|
@@ -45,26 +45,27 @@ describe("DashboardLayout", () => {
|
|
|
45
45
|
</AppProvider>
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
-
const getBackgroundColorCSSVariable = () =>
|
|
49
|
-
getComputedStyle(document.documentElement).getPropertyValue(
|
|
50
|
-
"--mui-palette-common-background"
|
|
51
|
-
);
|
|
52
|
-
|
|
53
48
|
const header = screen.getByRole("banner");
|
|
54
49
|
|
|
55
50
|
const themeSwitcherButton = within(header).getByLabelText(
|
|
56
51
|
"Switch to dark mode"
|
|
57
52
|
);
|
|
58
53
|
|
|
59
|
-
expect(
|
|
54
|
+
expect(
|
|
55
|
+
document.documentElement.getAttribute("data-toolpad-color-scheme")
|
|
56
|
+
).toBe("light");
|
|
60
57
|
|
|
61
58
|
await user.click(themeSwitcherButton);
|
|
62
59
|
|
|
63
|
-
expect(
|
|
60
|
+
expect(
|
|
61
|
+
document.documentElement.getAttribute("data-toolpad-color-scheme")
|
|
62
|
+
).toBe("dark");
|
|
64
63
|
|
|
65
64
|
await user.click(themeSwitcherButton);
|
|
66
65
|
|
|
67
|
-
expect(
|
|
66
|
+
expect(
|
|
67
|
+
document.documentElement.getAttribute("data-toolpad-color-scheme")
|
|
68
|
+
).toBe("light");
|
|
68
69
|
});
|
|
69
70
|
|
|
70
71
|
test("navigation works correctly", async () => {
|