@allurereport/web-dashboard 3.0.1 → 3.1.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/dist/multi/app-7b5d6350b95318ff266b.js +2 -0
- package/dist/multi/{app-d817a5a655317181a528.js.LICENSE.txt → app-7b5d6350b95318ff266b.js.LICENSE.txt} +7 -0
- package/dist/multi/manifest.json +21 -21
- package/dist/multi/{styles-addfb0e270ca070fb16b.css → styles-aac7a63204080ccd695a.css} +1 -1
- package/dist/single/app-97adb87875ceffb31341.js +2 -0
- package/dist/single/{app-8450c91141b1579a1c04.js.LICENSE.txt → app-97adb87875ceffb31341.js.LICENSE.txt} +7 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +6 -6
- package/src/components/Dashboard/index.tsx +5 -3
- package/src/components/Header/index.tsx +5 -2
- package/src/index.html +12 -12
- package/src/index.tsx +0 -2
- package/dist/multi/app-d817a5a655317181a528.js +0 -2
- package/dist/single/app-8450c91141b1579a1c04.js +0 -2
- package/src/stores/theme.ts +0 -32
- /package/dist/multi/{173.app-d817a5a655317181a528.js → 173.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{174.app-d817a5a655317181a528.js → 174.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{252.app-d817a5a655317181a528.js → 252.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{282.app-d817a5a655317181a528.js → 282.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{29.app-d817a5a655317181a528.js → 29.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{416.app-d817a5a655317181a528.js → 416.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{527.app-d817a5a655317181a528.js → 527.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{600.app-d817a5a655317181a528.js → 600.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{605.app-d817a5a655317181a528.js → 605.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{638.app-d817a5a655317181a528.js → 638.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{672.app-d817a5a655317181a528.js → 672.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{686.app-d817a5a655317181a528.js → 686.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{725.app-d817a5a655317181a528.js → 725.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{741.app-d817a5a655317181a528.js → 741.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{755.app-d817a5a655317181a528.js → 755.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{894.app-d817a5a655317181a528.js → 894.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{91.app-d817a5a655317181a528.js → 91.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{943.app-d817a5a655317181a528.js → 943.app-7b5d6350b95318ff266b.js} +0 -0
- /package/dist/multi/{980.app-d817a5a655317181a528.js → 980.app-7b5d6350b95318ff266b.js} +0 -0
package/src/stores/theme.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
-
import { signal } from "@preact/signals";
|
|
3
|
-
import type { DashboardReportOptions } from "../../types.js";
|
|
4
|
-
|
|
5
|
-
type Theme = "light" | "dark";
|
|
6
|
-
|
|
7
|
-
export const themeStore = signal<Theme>("light");
|
|
8
|
-
|
|
9
|
-
export const setTheme = (newTheme: Theme): void => {
|
|
10
|
-
themeStore.value = newTheme;
|
|
11
|
-
document.documentElement.setAttribute("data-theme", newTheme);
|
|
12
|
-
window.localStorage.setItem("theme", newTheme);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const toggleTheme = () => {
|
|
16
|
-
setTheme(themeStore.value === "light" ? "dark" : "light");
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const getTheme = () => {
|
|
20
|
-
const { theme } = getReportOptions<DashboardReportOptions>() ?? {};
|
|
21
|
-
const themeFromLS = (window.localStorage.getItem("theme") as Theme | null) || (theme as Theme);
|
|
22
|
-
|
|
23
|
-
if (themeFromLS) {
|
|
24
|
-
setTheme(themeFromLS);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
29
|
-
const initialTheme = prefersDarkScheme ? "dark" : "light";
|
|
30
|
-
|
|
31
|
-
setTheme(initialTheme);
|
|
32
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|