@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 'zustand/vanilla';
1
+ import type { StateCreator } from "zustand/vanilla";
2
2
 
3
- import type { UserStore } from '../../store';
4
- import { apiGetV1GatewayProfile } from './api';
3
+ import type { UserStore } from "../../store";
4
+ import type { AnimationMode, ThemeMode } from "./initialState";
5
5
 
6
- export interface UserProfileAction {
7
- getUserProfile: () => Promise<void>;
6
+ export interface UserSettingsAction {
7
+ setAnimationMode: (animationMode: AnimationMode) => void;
8
+ setThemeMode: (themeMode: ThemeMode) => void;
8
9
  }
9
10
 
10
- export const createProfileSlice: StateCreator<
11
+ export const createSettingsSlice: StateCreator<
11
12
  UserStore,
12
- [['zustand/devtools', never]],
13
+ [["zustand/devtools", never]],
13
14
  [],
14
- UserProfileAction
15
+ UserSettingsAction
15
16
  > = (set, get) => ({
16
- getUserProfile: async () => {
17
- const { data } = await apiGetV1GatewayProfile();
18
- set({ user: data });
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
- import type { User } from '@/types/user';
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 UserProfileState {
4
- user?: User;
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: UserProfileState = {
8
- user: {
9
- id: 0,
10
- name: '',
11
- cname: '',
12
- staffId: '',
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4399ywkf/cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "运维开发部脚手架",
5
5
  "main": "dist/index.js",
6
6
  "bin": {