@lobehub/chat 1.6.13 → 1.6.15

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 1.6.15](https://github.com/lobehub/lobe-chat/compare/v1.6.14...v1.6.15)
6
+
7
+ <sup>Released on **2024-07-26**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix file upload height.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix file upload height, closes [#3319](https://github.com/lobehub/lobe-chat/issues/3319) ([8343f35](https://github.com/lobehub/lobe-chat/commit/8343f35))
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 1.6.14](https://github.com/lobehub/lobe-chat/compare/v1.6.13...v1.6.14)
31
+
32
+ <sup>Released on **2024-07-26**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Improve input file upload.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Improve input file upload, closes [#3314](https://github.com/lobehub/lobe-chat/issues/3314) ([de85553](https://github.com/lobehub/lobe-chat/commit/de85553))
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 1.6.13](https://github.com/lobehub/lobe-chat/compare/v1.6.12...v1.6.13)
6
56
 
7
57
  <sup>Released on **2024-07-25**</sup>
package/README.md CHANGED
@@ -266,14 +266,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
266
266
 
267
267
  <!-- AGENT LIST -->
268
268
 
269
- | Recent Submits | Description |
270
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
271
- | [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | A highly advanced AI LLM transcending conventional AI. 'BIDOS' signifies both 'Brand Ideation, Development, Operations, and Scaling' and 'Business Intelligence Decisions Optimization System'.<br/>`brand-development` `ai-assistant` `market-analysis` `strategic-planning` `business-optimization` `business-intelligence` |
272
- | [Growth Coach](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | Specializes in helping users explore themselves through dialogue, find solutions, and paths to growth<br/>`growth-coach` `self-exploration` `goal-setting` `self-awareness` |
273
- | [Convert SQL Table Structure to Dao and Mapper](https://chat-preview.lobehub.com/market?agent=my-batis-generator)<br/><sup>By **[MeYoung](https://github.com/MeYoung)** on **2024-07-17**</sup> | Generate entity class and MyBatis Mapper based on a table structure<br/>`sql` `sql` `mybatis` |
274
- | [Auto Extraction Data](https://chat-preview.lobehub.com/market?agent=the-20-autoextract)<br/><sup>By **[vkhoilq](https://github.com/vkhoilq)** on **2024-07-17**</sup> | The20 Auto Extraction Data<br/>`the-20` `autoextract` |
275
-
276
- > 📊 Total agents: [<kbd>**304**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
269
+ | Recent Submits | Description |
270
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
271
+ | [Brand Pioneer](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | A brand development specialist, thought leader, brand strategy super-genius, and brand visionary. Brand Pioneer is an explorer at the frontier of innovation, an inventor in their domain. Provide them with your market and let them imagine a future world characterized by groundbreaking advancements in your field of expertise.<br/>`business` `brand-pioneer` `brand-development` `business-assistant` `brand-narrative` |
272
+ | [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | A highly advanced AI LLM transcending conventional AI. 'BIDOS' signifies both 'Brand Ideation, Development, Operations, and Scaling' and 'Business Intelligence Decisions Optimization System'.<br/>`brand-development` `ai-assistant` `market-analysis` `strategic-planning` `business-optimization` `business-intelligence` |
273
+ | [Growth Coach](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | Specializes in helping users explore themselves through dialogue, find solutions, and paths to growth<br/>`growth-coach` `self-exploration` `goal-setting` `self-awareness` |
274
+ | [Convert SQL Table Structure to Dao and Mapper](https://chat-preview.lobehub.com/market?agent=my-batis-generator)<br/><sup>By **[MeYoung](https://github.com/MeYoung)** on **2024-07-17**</sup> | Generate entity class and MyBatis Mapper based on a table structure<br/>`sql` `sql` `mybatis` |
275
+
276
+ > 📊 Total agents: [<kbd>**305**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
277
277
 
278
278
  <!-- AGENT LIST -->
279
279
 
package/README.zh-CN.md CHANGED
@@ -254,14 +254,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
254
254
 
255
255
  <!-- AGENT LIST -->
256
256
 
257
- | 最近新增 | 助手说明 |
258
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
259
- | [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | 一种高度先进的 AI LLM,超越传统人工智能。'BIDOS' 既代表 ' 品牌构思、发展、运营和扩展 ',也代表 ' 商业智能决策优化系统 '。<br/>`品牌发展` `ai助手` `市场分析` `战略规划` `业务优化` `商业智能` |
260
- | [成长教练](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | 擅长用对话的方式帮助用户自我探索,找到解决之道和成长之路<br/>`成长教练` `自我探索` `目标设定` `自我觉察` |
261
- | [SQL 表结构转 Dao 和 Mapper](https://chat-preview.lobehub.com/market?agent=my-batis-generator)<br/><sup>By **[MeYoung](https://github.com/MeYoung)** on **2024-07-17**</sup> | 给与一个表结构,生成表的实体和 MyBatis Mapper<br/>`sql` `sql` `mybatis` |
262
- | [自动提取数据](https://chat-preview.lobehub.com/market?agent=the-20-autoextract)<br/><sup>By **[vkhoilq](https://github.com/vkhoilq)** on **2024-07-17**</sup> | The20 自动提取数据<br/>`the-20` `autoextract` |
263
-
264
- > 📊 Total agents: [<kbd>**304**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
257
+ | 最近新增 | 助手说明 |
258
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
259
+ | [品牌先锋](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | 一位品牌发展专家、思想领袖、品牌战略超级天才和品牌远见者。品牌先锋是创新前沿的探险家,在其领域是一位发明家。将您的市场提供给他们,让他们想象一个未来世界,其中以您的专业领域的突破性进展为特征。<br/>`商业` `品牌先锋` `品牌发展` `商业助手` `品牌叙事` |
260
+ | [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | 一种高度先进的 AI LLM,超越传统人工智能。'BIDOS' 既代表 ' 品牌构思、发展、运营和扩展 ',也代表 ' 商业智能决策优化系统 '。<br/>`品牌发展` `ai助手` `市场分析` `战略规划` `业务优化` `商业智能` |
261
+ | [成长教练](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | 擅长用对话的方式帮助用户自我探索,找到解决之道和成长之路<br/>`成长教练` `自我探索` `目标设定` `自我觉察` |
262
+ | [SQL 表结构转 Dao 和 Mapper](https://chat-preview.lobehub.com/market?agent=my-batis-generator)<br/><sup>By **[MeYoung](https://github.com/MeYoung)** on **2024-07-17**</sup> | 给与一个表结构,生成表的实体和 MyBatis 的 Mapper<br/>`sql` `sql` `mybatis` |
263
+
264
+ > 📊 Total agents: [<kbd>**305**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
265
265
 
266
266
  <!-- AGENT LIST -->
267
267
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.6.13",
3
+ "version": "1.6.15",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -7,20 +7,17 @@ import { memo, useEffect, useState } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Center, Flexbox } from 'react-layout-kit';
9
9
 
10
- import DragUpload from '@/components/DragUpload';
11
10
  import StopLoadingIcon from '@/components/StopLoading';
12
11
  import SaveTopic from '@/features/ChatInput/Topic';
13
12
  import { useSendMessage } from '@/features/ChatInput/useSend';
14
- import { useAgentStore } from '@/store/agent';
15
- import { agentSelectors } from '@/store/agent/slices/chat';
16
13
  import { useChatStore } from '@/store/chat';
17
14
  import { chatSelectors, topicSelectors } from '@/store/chat/selectors';
18
15
  import { filesSelectors, useFileStore } from '@/store/file';
19
16
  import { useUserStore } from '@/store/user';
20
- import { modelProviderSelectors, preferenceSelectors } from '@/store/user/selectors';
17
+ import { preferenceSelectors } from '@/store/user/selectors';
21
18
  import { isMacOS } from '@/utils/platform';
22
19
 
23
- import { LocalFiles } from './LocalFiles';
20
+ import LocalFiles from '../LocalFiles';
24
21
  import SendMore from './SendMore';
25
22
 
26
23
  const useStyles = createStyles(({ css, prefixCls, token }) => {
@@ -51,10 +48,11 @@ const useStyles = createStyles(({ css, prefixCls, token }) => {
51
48
  });
52
49
 
53
50
  interface FooterProps {
51
+ expand: boolean;
54
52
  setExpand?: (expand: boolean) => void;
55
53
  }
56
54
 
57
- const Footer = memo<FooterProps>(({ setExpand }) => {
55
+ const Footer = memo<FooterProps>(({ setExpand, expand }) => {
58
56
  const { t } = useTranslation('chat');
59
57
 
60
58
  const { theme, styles } = useStyles();
@@ -75,28 +73,7 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
75
73
 
76
74
  const isImageUploading = useFileStore(filesSelectors.isImageUploading);
77
75
 
78
- const model = useAgentStore(agentSelectors.currentAgentModel);
79
-
80
- const enabledFiles = useUserStore(modelProviderSelectors.isModelEnabledFiles(model));
81
-
82
- const [useCmdEnterToSend, canUpload] = useUserStore((s) => [
83
- preferenceSelectors.useCmdEnterToSend(s),
84
- modelProviderSelectors.isModelEnabledUpload(model)(s),
85
- ]);
86
-
87
- const uploadFile = useFileStore((s) => s.uploadFile);
88
-
89
- const uploadImages = async (fileList: FileList | undefined) => {
90
- if (!fileList || fileList.length === 0) return;
91
-
92
- const pools = Array.from(fileList).map(async (file) => {
93
- // skip none-file items
94
- if (!file.type.startsWith('image') && !enabledFiles) return;
95
- await uploadFile(file);
96
- });
97
-
98
- await Promise.all(pools);
99
- };
76
+ const [useCmdEnterToSend] = useUserStore((s) => [preferenceSelectors.useCmdEnterToSend(s)]);
100
77
 
101
78
  const sendMessage = useSendMessage();
102
79
 
@@ -142,12 +119,7 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
142
119
  padding={'0 24px'}
143
120
  >
144
121
  <Flexbox align={'center'} gap={8} horizontal style={{ overflow: 'hidden' }}>
145
- {canUpload && (
146
- <>
147
- <DragUpload enabledFiles={enabledFiles} onUploadFiles={uploadImages} />
148
- <LocalFiles />
149
- </>
150
- )}
122
+ {expand && <LocalFiles />}
151
123
  </Flexbox>
152
124
  <Flexbox align={'center'} flex={'none'} gap={8} horizontal>
153
125
  <Flexbox
@@ -0,0 +1,46 @@
1
+ import { memo } from 'react';
2
+
3
+ import DragUpload from '@/components/DragUpload';
4
+ import { EditableFileList } from '@/features/FileList';
5
+ import { useAgentStore } from '@/store/agent';
6
+ import { agentSelectors } from '@/store/agent/slices/chat';
7
+ import { useFileStore } from '@/store/file';
8
+ import { useUserStore } from '@/store/user';
9
+ import { modelProviderSelectors } from '@/store/user/selectors';
10
+
11
+ interface LocalFilesProps {
12
+ padding?: number | string;
13
+ }
14
+
15
+ const LocalFiles = memo<LocalFilesProps>(({ padding }) => {
16
+ const model = useAgentStore(agentSelectors.currentAgentModel);
17
+
18
+ const enabledFiles = useUserStore(modelProviderSelectors.isModelEnabledFiles(model));
19
+ const canUpload = useUserStore(modelProviderSelectors.isModelEnabledUpload(model));
20
+
21
+ const inputFilesList = useFileStore((s) => s.inputFilesList);
22
+ const uploadFile = useFileStore((s) => s.uploadFile);
23
+
24
+ const uploadImages = async (fileList: FileList | undefined) => {
25
+ if (!fileList || fileList.length === 0) return;
26
+
27
+ const pools = Array.from(fileList).map(async (file) => {
28
+ // skip none-file items
29
+ if (!file.type.startsWith('image') && !enabledFiles) return;
30
+ await uploadFile(file);
31
+ });
32
+
33
+ await Promise.all(pools);
34
+ };
35
+
36
+ return (
37
+ canUpload && (
38
+ <>
39
+ <DragUpload enabledFiles={enabledFiles} onUploadFiles={uploadImages} />
40
+ <EditableFileList items={inputFilesList} padding={padding ?? 0} />
41
+ </>
42
+ )
43
+ );
44
+ });
45
+
46
+ export default LocalFiles;
@@ -9,11 +9,13 @@ import {
9
9
  CHAT_TEXTAREA_MAX_HEIGHT,
10
10
  HEADER_HEIGHT,
11
11
  } from '@/const/layoutTokens';
12
+ import { useFileStore } from '@/store/file';
12
13
  import { useGlobalStore } from '@/store/global';
13
14
  import { systemStatusSelectors } from '@/store/global/selectors';
14
15
 
15
16
  import Footer from './Footer';
16
17
  import Head from './Header';
18
+ import LocalFiles from './LocalFiles';
17
19
  import TextArea from './TextArea';
18
20
 
19
21
  const DesktopChatInput = memo(() => {
@@ -23,35 +25,40 @@ const DesktopChatInput = memo(() => {
23
25
  systemStatusSelectors.inputHeight(s),
24
26
  s.updateSystemStatus,
25
27
  ]);
28
+ const showFileList = useFileStore((s) => s.inputFilesList.length > 0);
26
29
 
27
30
  return (
28
- <DraggablePanel
29
- fullscreen={expand}
30
- headerHeight={HEADER_HEIGHT}
31
- maxHeight={CHAT_TEXTAREA_MAX_HEIGHT}
32
- minHeight={CHAT_TEXTAREA_HEIGHT}
33
- onSizeChange={(_, size) => {
34
- if (!size) return;
35
-
36
- updatePreference({
37
- inputHeight: typeof size.height === 'string' ? Number.parseInt(size.height) : size.height,
38
- });
39
- }}
40
- placement="bottom"
41
- size={{ height: inputHeight, width: '100%' }}
42
- style={{ zIndex: 10 }}
43
- >
44
- <Flexbox
45
- gap={8}
46
- height={'100%'}
47
- padding={'12px 0 16px'}
48
- style={{ minHeight: CHAT_TEXTAREA_HEIGHT, position: 'relative' }}
31
+ <>
32
+ {!expand && <LocalFiles padding={showFileList ? '8px 16px' : 0} />}
33
+ <DraggablePanel
34
+ fullscreen={expand}
35
+ headerHeight={HEADER_HEIGHT}
36
+ maxHeight={CHAT_TEXTAREA_MAX_HEIGHT}
37
+ minHeight={CHAT_TEXTAREA_HEIGHT}
38
+ onSizeChange={(_, size) => {
39
+ if (!size) return;
40
+
41
+ updatePreference({
42
+ inputHeight:
43
+ typeof size.height === 'string' ? Number.parseInt(size.height) : size.height,
44
+ });
45
+ }}
46
+ placement="bottom"
47
+ size={{ height: inputHeight, width: '100%' }}
48
+ style={{ zIndex: 10 }}
49
49
  >
50
- <Head expand={expand} setExpand={setExpand} />
51
- <TextArea setExpand={setExpand} />
52
- <Footer setExpand={setExpand} />
53
- </Flexbox>
54
- </DraggablePanel>
50
+ <Flexbox
51
+ gap={8}
52
+ height={'100%'}
53
+ padding={'12px 0 16px'}
54
+ style={{ minHeight: CHAT_TEXTAREA_HEIGHT, position: 'relative' }}
55
+ >
56
+ <Head expand={expand} setExpand={setExpand} />
57
+ <TextArea setExpand={setExpand} />
58
+ <Footer expand={expand} setExpand={setExpand} />
59
+ </Flexbox>
60
+ </DraggablePanel>
61
+ </>
55
62
  );
56
63
  });
57
64
 
@@ -4,7 +4,7 @@ export const HEADER_HEIGHT = 64;
4
4
  export const MOBILE_NABBAR_HEIGHT = 44;
5
5
  export const MOBILE_TABBAR_HEIGHT = 48;
6
6
  export const CHAT_TEXTAREA_MAX_HEIGHT = 800;
7
- export const CHAT_TEXTAREA_HEIGHT = 230;
7
+ export const CHAT_TEXTAREA_HEIGHT = 160;
8
8
  export const CHAT_TEXTAREA_HEIGHT_MOBILE = 108;
9
9
  export const CHAT_SIDEBAR_WIDTH = 280;
10
10
 
@@ -1,10 +0,0 @@
1
- import { memo } from 'react';
2
-
3
- import { EditableFileList } from '@/features/FileList';
4
- import { useFileStore } from '@/store/file';
5
-
6
- export const LocalFiles = memo(() => {
7
- const inputFilesList = useFileStore((s) => s.inputFilesList);
8
-
9
- return <EditableFileList items={inputFilesList} padding={0} />;
10
- });