@allurereport/web-summary 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/app-4049d48906080b36ee39.js +2 -0
- package/dist/{app-47bd4545267915e75245.js.LICENSE.txt → app-4049d48906080b36ee39.js.LICENSE.txt} +7 -0
- package/dist/manifest.json +1 -1
- package/package.json +6 -7
- package/src/components/ThemeButton/index.tsx +6 -17
- package/src/i18n/constants.ts +24 -18
- package/src/i18n/locales/az.json +22 -8
- package/src/i18n/locales/de.json +22 -8
- package/src/i18n/locales/en.json +23 -9
- package/src/i18n/locales/es.json +22 -8
- package/src/i18n/locales/fr.json +22 -8
- package/src/i18n/locales/he.json +22 -8
- package/src/i18n/locales/hy.json +22 -8
- package/src/i18n/locales/it.json +22 -8
- package/src/i18n/locales/ja.json +22 -8
- package/src/i18n/locales/ka.json +22 -8
- package/src/i18n/locales/kr.json +22 -8
- package/src/i18n/locales/nl.json +22 -8
- package/src/i18n/locales/pl.json +22 -8
- package/src/i18n/locales/pt.json +22 -8
- package/src/i18n/locales/ru.json +22 -8
- package/src/i18n/locales/sv.json +22 -8
- package/src/i18n/locales/tr.json +22 -8
- package/src/i18n/locales/zh.json +22 -8
- package/src/index.html +3 -0
- package/src/index.tsx +27 -46
- package/src/stores/index.ts +0 -1
- package/src/stores/locale.ts +25 -3
- package/src/styles.scss +0 -15
- package/tsconfig.json +1 -0
- package/types.d.ts +1 -1
- package/dist/app-47bd4545267915e75245.js +0 -2
- package/src/stores/theme.ts +0 -29
package/src/stores/theme.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { signal } from "@preact/signals";
|
|
2
|
-
|
|
3
|
-
type Theme = "light" | "dark";
|
|
4
|
-
|
|
5
|
-
export const themeStore = signal<Theme>("light");
|
|
6
|
-
|
|
7
|
-
export const setTheme = (newTheme: Theme): void => {
|
|
8
|
-
themeStore.value = newTheme;
|
|
9
|
-
document.documentElement.setAttribute("data-theme", newTheme);
|
|
10
|
-
window.localStorage.setItem("theme", newTheme);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const toggleTheme = () => {
|
|
14
|
-
setTheme(themeStore.value === "light" ? "dark" : "light");
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const getTheme = () => {
|
|
18
|
-
const themeFromLS = window.localStorage.getItem("theme") as Theme | null;
|
|
19
|
-
|
|
20
|
-
if (themeFromLS) {
|
|
21
|
-
setTheme(themeFromLS);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
26
|
-
const initialTheme = prefersDarkScheme ? "dark" : "light";
|
|
27
|
-
|
|
28
|
-
setTheme(initialTheme);
|
|
29
|
-
};
|