@lobehub/chat 0.82.9 → 0.83.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/locales/en_US/error.json +2 -1
  3. package/locales/en_US/plugin.json +1 -0
  4. package/locales/en_US/setting.json +2 -1
  5. package/locales/ru_RU/error.json +2 -1
  6. package/locales/ru_RU/plugin.json +1 -0
  7. package/locales/ru_RU/setting.json +2 -1
  8. package/locales/zh_CN/error.json +1 -0
  9. package/locales/zh_CN/plugin.json +2 -1
  10. package/locales/zh_CN/setting.json +2 -1
  11. package/locales/zh_TW/error.json +2 -1
  12. package/locales/zh_TW/plugin.json +1 -0
  13. package/locales/zh_TW/setting.json +2 -1
  14. package/package.json +6 -5
  15. package/src/app/chat/components/SessionList/List/Item/index.tsx +2 -2
  16. package/src/app/home/index.tsx +15 -11
  17. package/src/app/layout.tsx +4 -1
  18. package/src/app/settings/agent/Agent.tsx +3 -3
  19. package/src/app/settings/agent/index.tsx +1 -0
  20. package/src/app/settings/common/Common.tsx +109 -117
  21. package/src/app/settings/features/SideBar/List.tsx +11 -5
  22. package/src/app/settings/llm/LLM/index.tsx +2 -2
  23. package/src/config/client.ts +13 -0
  24. package/src/const/locale.ts +9 -0
  25. package/src/const/settings.ts +1 -1
  26. package/src/const/url.ts +1 -6
  27. package/src/helpers/export.ts +2 -2
  28. package/src/layout/GlobalLayout/Locale.tsx +44 -0
  29. package/src/layout/GlobalLayout/LocaleLoading.tsx +21 -0
  30. package/src/layout/GlobalLayout/StoreHydration.tsx +28 -0
  31. package/src/layout/GlobalLayout/index.tsx +29 -41
  32. package/src/locales/create.ts +43 -26
  33. package/src/locales/default/setting.ts +2 -1
  34. package/src/locales/options.ts +6 -5
  35. package/src/services/agentMarket.ts +6 -4
  36. package/src/services/pluginMarket.ts +2 -2
  37. package/src/store/global/hooks/useSwitchSettingsOnInit.ts +5 -2
  38. package/src/store/global/{selectors.test.ts → selectors/settings.test.ts} +11 -11
  39. package/src/store/global/selectors/settings.ts +44 -0
  40. package/src/store/global/selectors.ts +1 -36
  41. package/src/store/global/slices/common.ts +3 -4
  42. package/src/types/locale.ts +4 -0
  43. package/src/types/settings.ts +2 -2
  44. package/src/utils/env.ts +2 -0
  45. package/src/utils/responsive.ts +1 -1
  46. package/src/utils/switchLang.ts +5 -1
  47. package/src/layout/GlobalLayout/style.ts +0 -18
  48. /package/src/{components/AppTheme/index.tsx → layout/GlobalLayout/AppTheme.tsx} +0 -0
@@ -12,7 +12,7 @@ export const isMobileDevice = () => {
12
12
  const { get } = headers();
13
13
  const ua = get('user-agent');
14
14
 
15
- console.log(ua);
15
+ // console.log(ua);
16
16
  const device = new UAParser(ua || '').getDevice();
17
17
 
18
18
  return device.type === 'mobile';
@@ -1,6 +1,10 @@
1
1
  import { changeLanguage } from 'i18next';
2
2
 
3
- export const switchLang = (lang: string) => {
3
+ import { LocaleMode } from '@/types/locale';
4
+
5
+ export const switchLang = (locale: LocaleMode) => {
6
+ const lang = locale === 'auto' ? navigator.language : locale;
7
+
4
8
  changeLanguage(lang);
5
9
  document.documentElement.lang = lang;
6
10
  };
@@ -1,18 +0,0 @@
1
- import { createStyles } from 'antd-style';
2
-
3
- export const useStyles = createStyles(({ css, token }) => ({
4
- bg: css`
5
- overflow-y: scroll;
6
- display: flex;
7
- flex-direction: column;
8
- align-items: center;
9
-
10
- height: 100%;
11
-
12
- background: ${token.colorBgLayout};
13
-
14
- :has(#ChatLayout, #FlowLayout) {
15
- overflow: hidden;
16
- }
17
- `,
18
- }));