@lobehub/chat 0.50.0 → 0.51.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 +25 -0
- package/package.json +1 -1
- package/src/locales/default/common.ts +1 -0
- package/src/pages/chat/features/Conversation/Input/Footer.tsx +49 -0
- package/src/pages/chat/features/Conversation/Input/Token.tsx +1 -0
- package/src/pages/chat/features/Conversation/Input/index.tsx +3 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.51.0](https://github.com/lobehub/lobe-chat/compare/v0.50.0...v0.51.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-08-15**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add Footer component and modify Token and index files.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add Footer component and modify Token and index files ([41a3823](https://github.com/lobehub/lobe-chat/commit/41a3823))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.50.0](https://github.com/lobehub/lobe-chat/compare/v0.49.0...v0.50.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-08-15**</sup>
|
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Icon, Tooltip } from '@lobehub/ui';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import { useTheme } from 'antd-style';
|
|
4
|
+
import { ArrowBigUp, CornerDownLeft, LucideGalleryVerticalEnd } from 'lucide-react';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
|
+
|
|
9
|
+
export interface FooterProps {
|
|
10
|
+
hasTopic: boolean;
|
|
11
|
+
saveToTopic: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Footer = memo<FooterProps>(({ hasTopic, saveToTopic }) => {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const { t } = useTranslation('common');
|
|
17
|
+
|
|
18
|
+
const saveTopic = hasTopic ? null : (
|
|
19
|
+
<Tooltip title={t('topic.saveCurrentMessages')}>
|
|
20
|
+
<Button icon={<Icon icon={LucideGalleryVerticalEnd} />} onClick={saveToTopic} />
|
|
21
|
+
</Tooltip>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const footerTooltip = (
|
|
25
|
+
<Flexbox
|
|
26
|
+
gap={4}
|
|
27
|
+
horizontal
|
|
28
|
+
style={{ color: theme.colorTextDescription, fontSize: 12, marginRight: 12 }}
|
|
29
|
+
>
|
|
30
|
+
<Icon icon={CornerDownLeft} />
|
|
31
|
+
<span>{t('send')}</span>
|
|
32
|
+
<span>/</span>
|
|
33
|
+
<Flexbox horizontal>
|
|
34
|
+
<Icon icon={ArrowBigUp} />
|
|
35
|
+
<Icon icon={CornerDownLeft} />
|
|
36
|
+
</Flexbox>
|
|
37
|
+
<span>{t('warp')}</span>
|
|
38
|
+
</Flexbox>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{footerTooltip}
|
|
44
|
+
{saveTopic}
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default Footer;
|
|
@@ -22,6 +22,7 @@ const Token = memo<{ input: string }>(({ input }) => {
|
|
|
22
22
|
<Tooltip placement={'bottom'} title={t('tokenDetail', { chatsToken, systemRoleToken })}>
|
|
23
23
|
<TokenTag
|
|
24
24
|
maxValue={ModelTokens[model]}
|
|
25
|
+
style={{ marginLeft: 8 }}
|
|
25
26
|
text={{
|
|
26
27
|
overload: t('tokenTag.overload'),
|
|
27
28
|
remained: t('tokenTag.remained'),
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ChatInputArea, DraggablePanel
|
|
2
|
-
import { Button } from 'antd';
|
|
3
|
-
import { LucideGalleryVerticalEnd } from 'lucide-react';
|
|
1
|
+
import { ChatInputArea, DraggablePanel } from '@lobehub/ui';
|
|
4
2
|
import { memo, useState } from 'react';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
6
4
|
|
|
@@ -10,6 +8,7 @@ import { useSessionStore } from '@/store/session';
|
|
|
10
8
|
|
|
11
9
|
import InputActions from './Action';
|
|
12
10
|
import ActionsRight from './ActionRight';
|
|
11
|
+
import Footer from './Footer';
|
|
13
12
|
import Token from './Token';
|
|
14
13
|
|
|
15
14
|
const ChatInput = () => {
|
|
@@ -31,12 +30,6 @@ const ChatInput = () => {
|
|
|
31
30
|
],
|
|
32
31
|
);
|
|
33
32
|
|
|
34
|
-
const footer = hasTopic ? null : (
|
|
35
|
-
<Tooltip title={t('topic.saveCurrentMessages')}>
|
|
36
|
-
<Button icon={<Icon icon={LucideGalleryVerticalEnd} />} onClick={saveToTopic} />
|
|
37
|
-
</Tooltip>
|
|
38
|
-
);
|
|
39
|
-
|
|
40
33
|
return (
|
|
41
34
|
<DraggablePanel
|
|
42
35
|
expandable={false}
|
|
@@ -63,7 +56,7 @@ const ChatInput = () => {
|
|
|
63
56
|
}
|
|
64
57
|
actionsRight={<ActionsRight />}
|
|
65
58
|
expand={expand}
|
|
66
|
-
footer={
|
|
59
|
+
footer={<Footer hasTopic={hasTopic} saveToTopic={saveToTopic} />}
|
|
67
60
|
loading={isLoading}
|
|
68
61
|
minHeight={CHAT_TEXTAREA_HEIGHT}
|
|
69
62
|
onExpandChange={setExpand}
|