@4399ywkf/cli 1.0.6 → 1.0.7
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.
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type { StateCreator } from
|
|
1
|
+
import type { StateCreator } from "zustand/vanilla";
|
|
2
2
|
|
|
3
|
-
import type { UserStore } from
|
|
4
|
-
import {
|
|
3
|
+
import type { UserStore } from "../../store";
|
|
4
|
+
import type { AnimationMode, ThemeMode } from "./initialState";
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface UserSettingsAction {
|
|
7
|
+
setAnimationMode: (animationMode: AnimationMode) => void;
|
|
8
|
+
setThemeMode: (themeMode: ThemeMode) => void;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export const
|
|
11
|
+
export const createSettingsSlice: StateCreator<
|
|
11
12
|
UserStore,
|
|
12
|
-
[[
|
|
13
|
+
[["zustand/devtools", never]],
|
|
13
14
|
[],
|
|
14
|
-
|
|
15
|
+
UserSettingsAction
|
|
15
16
|
> = (set, get) => ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
setAnimationMode: (animationMode: AnimationMode) => {
|
|
18
|
+
set({ animationMode });
|
|
19
|
+
},
|
|
20
|
+
setThemeMode: (themeMode: ThemeMode) => {
|
|
21
|
+
set({ themeMode });
|
|
19
22
|
},
|
|
20
23
|
});
|
|
@@ -8,8 +8,6 @@ import React from "react";
|
|
|
8
8
|
import { createRouter } from "@/routes";
|
|
9
9
|
import { openUpdateVersionNotify } from "@/utils/updateVersion";
|
|
10
10
|
|
|
11
|
-
import Loading from "./loading";
|
|
12
|
-
|
|
13
11
|
dayjs.locale("zh-cn");
|
|
14
12
|
|
|
15
13
|
import "./index.css";
|
|
@@ -25,7 +23,6 @@ ConfigProvider.config({
|
|
|
25
23
|
|
|
26
24
|
const context = {
|
|
27
25
|
basename: BASENAME,
|
|
28
|
-
loadingComponent: () => <Loading name={"基座"} />,
|
|
29
26
|
rootElement: document.getElementById(AppName) ?? document.body,
|
|
30
27
|
};
|
|
31
28
|
|
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
export type AnimationMode = "disabled" | "agile" | "elegant";
|
|
2
|
+
export type ResponseAnimationStyle = "smooth" | "fadeIn" | "none";
|
|
3
|
+
export type ThemeMode = "auto" | "dark" | "light";
|
|
4
|
+
import type {
|
|
5
|
+
HighlighterProps,
|
|
6
|
+
MermaidProps,
|
|
7
|
+
NeutralColors,
|
|
8
|
+
PrimaryColors,
|
|
9
|
+
} from "@/styles";
|
|
2
10
|
|
|
3
|
-
export interface
|
|
4
|
-
|
|
11
|
+
export interface UserSettingsState {
|
|
12
|
+
animationMode?: AnimationMode;
|
|
13
|
+
neutralColor?: NeutralColors;
|
|
14
|
+
primaryColor?: PrimaryColors;
|
|
15
|
+
fontSize: number;
|
|
16
|
+
transitionMode?: ResponseAnimationStyle;
|
|
17
|
+
highlighterTheme?: HighlighterProps["theme"];
|
|
18
|
+
mermaidTheme?: MermaidProps["theme"];
|
|
19
|
+
|
|
20
|
+
themeMode?: ThemeMode;
|
|
5
21
|
}
|
|
6
22
|
|
|
7
|
-
export const initialState:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
export const initialState: UserSettingsState = {
|
|
24
|
+
animationMode: "agile",
|
|
25
|
+
neutralColor: undefined,
|
|
26
|
+
primaryColor: undefined,
|
|
27
|
+
fontSize: 14,
|
|
28
|
+
transitionMode: "fadeIn",
|
|
29
|
+
highlighterTheme: "lobe-theme",
|
|
30
|
+
mermaidTheme: "lobe-theme",
|
|
31
|
+
themeMode: "auto",
|
|
14
32
|
};
|
|
@@ -8,8 +8,6 @@ import React from "react";
|
|
|
8
8
|
import { createRouter } from "@/routes";
|
|
9
9
|
import { openUpdateVersionNotify } from "@/utils/updateVersion";
|
|
10
10
|
|
|
11
|
-
import Loading from "./loading";
|
|
12
|
-
|
|
13
11
|
dayjs.locale("zh-cn");
|
|
14
12
|
|
|
15
13
|
import "./index.css";
|
|
@@ -25,7 +23,6 @@ ConfigProvider.config({
|
|
|
25
23
|
|
|
26
24
|
const context = {
|
|
27
25
|
basename: BASENAME,
|
|
28
|
-
loadingComponent: () => <Loading name={"基座"} />,
|
|
29
26
|
rootElement: document.getElementById(AppName) ?? document.body,
|
|
30
27
|
};
|
|
31
28
|
|