@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.
Files changed (61) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/locales/ar/common.json +14 -0
  3. package/locales/bg-BG/common.json +14 -0
  4. package/locales/de-DE/common.json +14 -0
  5. package/locales/en-US/common.json +14 -0
  6. package/locales/es-ES/common.json +14 -0
  7. package/locales/fr-FR/common.json +14 -0
  8. package/locales/it-IT/common.json +14 -0
  9. package/locales/ja-JP/common.json +14 -0
  10. package/locales/ko-KR/common.json +14 -0
  11. package/locales/nl-NL/common.json +14 -0
  12. package/locales/pl-PL/common.json +14 -0
  13. package/locales/pt-BR/common.json +14 -0
  14. package/locales/ru-RU/common.json +14 -0
  15. package/locales/tr-TR/common.json +14 -0
  16. package/locales/vi-VN/common.json +14 -0
  17. package/locales/zh-CN/common.json +14 -0
  18. package/locales/zh-TW/common.json +14 -0
  19. package/next.config.mjs +7 -0
  20. package/package.json +1 -1
  21. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +9 -5
  22. package/src/app/(main)/(mobile)/me/features/Cate.tsx +1 -3
  23. package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +1 -3
  24. package/src/app/(main)/(mobile)/me/page.tsx +3 -3
  25. package/src/app/(main)/@nav/_layout/Desktop/Avatar.test.tsx +55 -0
  26. package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +44 -2
  27. package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +4 -126
  28. package/src/app/(main)/@nav/_layout/Desktop/index.tsx +1 -1
  29. package/src/app/(main)/chat/features/SessionListContent/ListItem/index.tsx +5 -1
  30. package/src/app/(main)/market/features/AgentCard/index.tsx +4 -2
  31. package/src/app/(main)/market/features/AgentList.tsx +10 -1
  32. package/src/app/(main)/market/features/TagList.tsx +8 -4
  33. package/src/app/(main)/settings/_layout/Desktop/Header.tsx +1 -0
  34. package/src/app/(main)/settings/_layout/Mobile/Header.tsx +1 -1
  35. package/src/app/(main)/settings/common/features/Common.tsx +6 -6
  36. package/src/components/Cell/Divider.tsx +2 -2
  37. package/src/components/Cell/index.tsx +2 -1
  38. package/src/features/AvatarWithUpload/index.tsx +8 -44
  39. package/src/features/DataImporter/index.tsx +11 -1
  40. package/src/features/User/UserAvatar.tsx +67 -0
  41. package/src/features/User/UserInfo.tsx +41 -0
  42. package/src/features/User/UserPanel/LangButton.tsx +57 -0
  43. package/src/features/User/UserPanel/Popover.tsx +35 -0
  44. package/src/features/User/UserPanel/ThemeButton.tsx +70 -0
  45. package/src/features/User/UserPanel/UserInfo.tsx +35 -0
  46. package/src/features/User/UserPanel/index.tsx +62 -0
  47. package/src/features/User/UserPanel/useMenu.tsx +158 -0
  48. package/src/features/User/UserPanel/useNewVersion.tsx +12 -0
  49. package/src/layout/AuthProvider/NextAuth/UserUpdater.tsx +35 -0
  50. package/src/layout/AuthProvider/NextAuth/index.tsx +8 -1
  51. package/src/locales/default/common.ts +14 -0
  52. package/src/store/user/slices/auth/initialState.ts +6 -8
  53. package/src/store/user/slices/auth/selectors.ts +4 -1
  54. package/src/store/user/slices/preference/action.test.ts +41 -3
  55. package/src/store/user/slices/preference/action.ts +8 -2
  56. package/src/store/user/slices/preference/initialState.ts +14 -5
  57. package/src/store/user/slices/preference/selectors.test.ts +82 -0
  58. package/src/store/user/slices/preference/selectors.ts +4 -0
  59. package/src/store/user/slices/settings/actions/general.ts +8 -0
  60. package/src/types/user.ts +9 -0
  61. 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
  },
@@ -0,0 +1,9 @@
1
+ export interface LobeUser {
2
+ avatar?: string;
3
+ email?: string | null;
4
+ firstName?: string | null;
5
+ fullName?: string | null;
6
+ id: string;
7
+ latestName?: string | null;
8
+ username?: string | null;
9
+ }
@@ -1,7 +0,0 @@
1
- import { redirect } from 'next/navigation';
2
-
3
- const Page = () => {
4
- return redirect('/settings/common');
5
- };
6
-
7
- export default Page;