@lobehub/chat 0.152.9 → 0.152.11
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/CHANGELOG.md +50 -0
- package/locales/ar/common.json +14 -0
- package/locales/bg-BG/common.json +14 -0
- package/locales/de-DE/common.json +14 -0
- package/locales/en-US/common.json +14 -0
- package/locales/es-ES/common.json +14 -0
- package/locales/fr-FR/common.json +14 -0
- package/locales/it-IT/common.json +14 -0
- package/locales/ja-JP/common.json +14 -0
- package/locales/ko-KR/common.json +14 -0
- package/locales/nl-NL/common.json +14 -0
- package/locales/pl-PL/common.json +14 -0
- package/locales/pt-BR/common.json +14 -0
- package/locales/ru-RU/common.json +14 -0
- package/locales/tr-TR/common.json +14 -0
- package/locales/vi-VN/common.json +14 -0
- package/locales/zh-CN/common.json +14 -0
- package/locales/zh-TW/common.json +14 -0
- package/next.config.mjs +7 -0
- package/package.json +1 -1
- package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +9 -5
- package/src/app/(main)/(mobile)/me/features/Cate.tsx +1 -3
- package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +1 -3
- package/src/app/(main)/(mobile)/me/page.tsx +3 -3
- package/src/app/(main)/@nav/_layout/Desktop/Avatar.test.tsx +55 -0
- package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +44 -2
- package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +4 -126
- package/src/app/(main)/@nav/_layout/Desktop/index.tsx +1 -1
- package/src/app/(main)/chat/features/SessionListContent/ListItem/index.tsx +5 -1
- package/src/app/(main)/market/features/AgentCard/index.tsx +4 -2
- package/src/app/(main)/market/features/AgentList.tsx +10 -1
- package/src/app/(main)/market/features/TagList.tsx +8 -4
- package/src/app/(main)/settings/_layout/Desktop/Header.tsx +1 -0
- package/src/app/(main)/settings/_layout/Mobile/Header.tsx +1 -1
- package/src/app/(main)/settings/common/features/Common.tsx +6 -6
- package/src/components/Cell/Divider.tsx +2 -2
- package/src/components/Cell/index.tsx +2 -1
- package/src/features/AvatarWithUpload/index.tsx +8 -44
- package/src/features/DataImporter/index.tsx +11 -1
- package/src/features/User/UserAvatar.tsx +67 -0
- package/src/features/User/UserInfo.tsx +41 -0
- package/src/features/User/UserPanel/LangButton.tsx +57 -0
- package/src/features/User/UserPanel/Popover.tsx +35 -0
- package/src/features/User/UserPanel/ThemeButton.tsx +70 -0
- package/src/features/User/UserPanel/UserInfo.tsx +35 -0
- package/src/features/User/UserPanel/index.tsx +62 -0
- package/src/features/User/UserPanel/useMenu.tsx +158 -0
- package/src/features/User/UserPanel/useNewVersion.tsx +12 -0
- package/src/layout/AuthProvider/NextAuth/UserUpdater.tsx +35 -0
- package/src/layout/AuthProvider/NextAuth/index.tsx +8 -1
- package/src/locales/default/common.ts +14 -0
- package/src/store/user/slices/auth/initialState.ts +6 -8
- package/src/store/user/slices/auth/selectors.ts +4 -1
- package/src/store/user/slices/preference/action.test.ts +41 -3
- package/src/store/user/slices/preference/action.ts +8 -2
- package/src/store/user/slices/preference/initialState.ts +14 -5
- package/src/store/user/slices/preference/selectors.test.ts +82 -0
- package/src/store/user/slices/preference/selectors.ts +4 -0
- package/src/store/user/slices/settings/actions/general.ts +8 -0
- package/src/types/user.ts +9 -0
- package/src/app/(main)/settings/page.tsx +0 -7
|
@@ -5,8 +5,10 @@ import type { StateCreator } from 'zustand/vanilla';
|
|
|
5
5
|
|
|
6
6
|
import { userService } from '@/services/user';
|
|
7
7
|
import type { UserStore } from '@/store/user';
|
|
8
|
+
import { LocaleMode } from '@/types/locale';
|
|
8
9
|
import { LobeAgentSettings } from '@/types/session';
|
|
9
10
|
import { GlobalSettings } from '@/types/settings';
|
|
11
|
+
import { switchLang } from '@/utils/client/switchLang';
|
|
10
12
|
import { difference } from '@/utils/difference';
|
|
11
13
|
import { merge } from '@/utils/merge';
|
|
12
14
|
|
|
@@ -14,6 +16,7 @@ export interface GeneralSettingsAction {
|
|
|
14
16
|
importAppSettings: (settings: GlobalSettings) => Promise<void>;
|
|
15
17
|
resetSettings: () => Promise<void>;
|
|
16
18
|
setSettings: (settings: DeepPartial<GlobalSettings>) => Promise<void>;
|
|
19
|
+
switchLocale: (locale: LocaleMode) => Promise<void>;
|
|
17
20
|
switchThemeMode: (themeMode: ThemeMode) => Promise<void>;
|
|
18
21
|
updateDefaultAgent: (agent: DeepPartial<LobeAgentSettings>) => Promise<void>;
|
|
19
22
|
}
|
|
@@ -47,6 +50,11 @@ export const generalSettingsSlice: StateCreator<
|
|
|
47
50
|
await userService.updateUserSettings(diffs);
|
|
48
51
|
await get().refreshUserConfig();
|
|
49
52
|
},
|
|
53
|
+
switchLocale: async (locale) => {
|
|
54
|
+
await get().setSettings({ language: locale });
|
|
55
|
+
|
|
56
|
+
switchLang(locale);
|
|
57
|
+
},
|
|
50
58
|
switchThemeMode: async (themeMode) => {
|
|
51
59
|
await get().setSettings({ themeMode });
|
|
52
60
|
},
|