@lobehub/chat 0.42.2 → 0.43.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 0.43.0](https://github.com/lobehub/lobe-chat/compare/v0.42.3...v0.43.0)
6
+
7
+ <sup>Released on **2023-08-12**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: 支持切换语言.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **misc**: 支持切换语言, closes [#67](https://github.com/lobehub/lobe-chat/issues/67) ([63ed8ec](https://github.com/lobehub/lobe-chat/commit/63ed8ec))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.42.3](https://github.com/lobehub/lobe-chat/compare/v0.42.2...v0.42.3)
31
+
32
+ <sup>Released on **2023-08-12**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: 暂时隐藏 Hero 模板.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: 暂时隐藏 Hero 模板 ([8289ae6](https://github.com/lobehub/lobe-chat/commit/8289ae6))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.42.2](https://github.com/lobehub/lobe-chat/compare/v0.42.1...v0.42.2)
6
56
 
7
57
  <sup>Released on **2023-08-12**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.42.2",
3
+ "version": "0.43.0",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -1,6 +1,7 @@
1
1
  import { Form, type ItemGroup, ThemeSwitch } from '@lobehub/ui';
2
2
  import { Form as AntForm, App, Button, Input, Select } from 'antd';
3
3
  import isEqual from 'fast-deep-equal';
4
+ import { changeLanguage } from 'i18next';
4
5
  import { debounce } from 'lodash-es';
5
6
  import { AppWindow, Palette, Webhook } from 'lucide-react';
6
7
  import { memo, useCallback, useMemo } from 'react';
@@ -27,9 +28,10 @@ const Common = memo(() => {
27
28
  const { t } = useTranslation('setting');
28
29
  const [form] = AntForm.useForm();
29
30
  const clearSessions = useSessionStore((s) => s.clearSessions);
31
+
30
32
  const settings = useGlobalStore(settingsSelectors.currentSettings, isEqual);
31
33
  const [setThemeMode, setSettings, resetSettings] = useGlobalStore((s) => [
32
- s.setThemeMode,
34
+ s.switchThemeMode,
33
35
  s.setSettings,
34
36
  s.resetSettings,
35
37
  ]);
@@ -89,7 +91,14 @@ const Common = memo(() => {
89
91
  label: t('settingTheme.themeMode.title'),
90
92
  },
91
93
  {
92
- children: <Select options={options} />,
94
+ children: (
95
+ <Select
96
+ onChange={(e) => {
97
+ changeLanguage(e);
98
+ }}
99
+ options={options}
100
+ />
101
+ ),
93
102
  label: t('settingTheme.lang.title'),
94
103
  name: 'language',
95
104
  },
@@ -11,7 +11,6 @@ import { Flexbox } from 'react-layout-kit';
11
11
  import { useImportConfig } from '@/hooks/useImportConfig';
12
12
 
13
13
  import { useStyles } from '../style';
14
- import AgentTemplate from './AgentTemplate';
15
14
  import Hero from './Hero';
16
15
 
17
16
  const Banner = memo(() => {
@@ -29,7 +28,7 @@ const Banner = memo(() => {
29
28
  }, []);
30
29
 
31
30
  return (
32
- <>
31
+ <Flexbox height={'80vh'} style={{ marginTop: '10vh' }}>
33
32
  <GridShowcase>
34
33
  <div className={styles.container} ref={ref}>
35
34
  <Hero width={width} />
@@ -48,8 +47,9 @@ const Banner = memo(() => {
48
47
  </Upload>
49
48
  </Flexbox>
50
49
  </GridShowcase>
51
- <AgentTemplate width={width} />
52
- </>
50
+ {/*TODO:暂时隐藏,待模板完成后再补回*/}
51
+ {/*<AgentTemplate width={width} />*/}
52
+ </Flexbox>
53
53
  );
54
54
  });
55
55
 
@@ -29,7 +29,7 @@ export interface SettingsAction {
29
29
  * 设置主题模式
30
30
  * @param themeMode - 主题模式
31
31
  */
32
- setThemeMode: (themeMode: ThemeMode) => void;
32
+ switchThemeMode: (themeMode: ThemeMode) => void;
33
33
  }
34
34
 
35
35
  export const createSettingsSlice: StateCreator<
@@ -63,7 +63,7 @@ export const createSettingsSlice: StateCreator<
63
63
  const oldSetting = get().settings;
64
64
  set({ settings: merge(oldSetting, settings) }, false, t('setSettings', settings));
65
65
  },
66
- setThemeMode: (themeMode) => {
66
+ switchThemeMode: (themeMode) => {
67
67
  get().setSettings({ themeMode });
68
68
  },
69
69
  });