@allurereport/web-dashboard 3.0.1 → 3.2.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/{173.app-d817a5a655317181a528.js → 173.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{174.app-d817a5a655317181a528.js → 174.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{252.app-d817a5a655317181a528.js → 252.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{282.app-d817a5a655317181a528.js → 282.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{29.app-d817a5a655317181a528.js → 29.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{416.app-d817a5a655317181a528.js → 416.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{527.app-d817a5a655317181a528.js → 527.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{600.app-d817a5a655317181a528.js → 600.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{605.app-d817a5a655317181a528.js → 605.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{638.app-d817a5a655317181a528.js → 638.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{672.app-d817a5a655317181a528.js → 672.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{686.app-d817a5a655317181a528.js → 686.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{725.app-d817a5a655317181a528.js → 725.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{741.app-d817a5a655317181a528.js → 741.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/749.app-7ac8c7228f79c5ce8ff3.js +1 -0
- package/dist/multi/{755.app-d817a5a655317181a528.js → 755.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{894.app-d817a5a655317181a528.js → 894.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{943.app-d817a5a655317181a528.js → 943.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/{980.app-d817a5a655317181a528.js → 980.app-7ac8c7228f79c5ce8ff3.js} +1 -1
- package/dist/multi/app-7ac8c7228f79c5ce8ff3.js +2 -0
- package/dist/multi/{app-d817a5a655317181a528.js.LICENSE.txt → app-7ac8c7228f79c5ce8ff3.js.LICENSE.txt} +7 -0
- package/dist/multi/manifest.json +21 -21
- package/dist/multi/{styles-addfb0e270ca070fb16b.css → styles-6e84fb28f87ce39fa305.css} +1 -1
- package/dist/single/app-a852a6b926584d4d704b.js +2 -0
- package/dist/single/{app-8450c91141b1579a1c04.js.LICENSE.txt → app-a852a6b926584d4d704b.js.LICENSE.txt} +7 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +7 -8
- package/src/components/Dashboard/index.tsx +10 -8
- package/src/components/Header/index.tsx +5 -2
- package/src/index.html +12 -12
- package/src/index.tsx +0 -2
- package/src/locales/az.json +2 -2
- package/src/locales/de.json +2 -2
- package/src/locales/en.json +2 -2
- package/src/locales/es.json +2 -2
- package/src/locales/fr.json +2 -2
- package/src/locales/he.json +2 -2
- package/src/locales/hy.json +2 -2
- package/src/locales/it.json +2 -2
- package/src/locales/ja.json +2 -2
- package/src/locales/ka.json +2 -2
- package/src/locales/kr.json +2 -2
- package/src/locales/nl.json +2 -2
- package/src/locales/pl.json +2 -2
- package/src/locales/pt.json +2 -2
- package/src/locales/ru.json +2 -2
- package/src/locales/sv.json +2 -2
- package/src/locales/tr.json +2 -2
- package/src/locales/{ua.json → uk.json} +2 -2
- package/src/locales/zh.json +2 -2
- package/src/stores/locale.ts +68 -37
- package/types.d.ts +1 -1
- package/dist/multi/91.app-d817a5a655317181a528.js +0 -1
- package/dist/multi/app-d817a5a655317181a528.js +0 -2
- package/dist/single/app-8450c91141b1579a1c04.js +0 -2
- package/src/stores/theme.ts +0 -32
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
|
-
};
|