@lobehub/chat 0.2.0 → 0.3.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/const/layoutTokens.ts +3 -0
- package/src/features/AvatarWithUpload/index.tsx +3 -1
- package/src/features/FolderPanel/index.tsx +3 -1
- package/src/features/HeaderSpacing/index.tsx +7 -0
- package/src/pages/chat/[id]/Config/index.tsx +13 -9
- package/src/pages/chat/[id]/Conversation/Input.tsx +5 -2
- package/src/pages/chat/[id]/Conversation/index.tsx +2 -0
- package/src/pages/chat/[id]/edit/index.page.tsx +3 -0
- package/src/pages/chat/[id]/index.page.tsx +3 -9
- package/src/pages/chat/layout.tsx +1 -1
- package/src/pages/setting/SettingForm.tsx +1 -1
- package/src/pages/setting/index.page.tsx +2 -0
- /package/src/{pages/setting → features}/SliderWithInput/index.tsx +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.3.0](https://github.com/lobehub/lobe-chat/compare/v0.2.0...v0.3.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-07-18**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add new files, modify components, and adjust layout and styling.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add new files, modify components, and adjust layout and styling ([b8c3b38](https://github.com/lobehub/lobe-chat/commit/b8c3b38))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.2.0](https://github.com/lobehub/lobe-chat/compare/v0.1.6...v0.2.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-07-18**</sup>
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ interface AvatarWithUploadProps {
|
|
|
27
27
|
size?: number;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const AvatarWithUpload = memo<AvatarWithUploadProps>(({ size = 40 }) => {
|
|
31
31
|
const [avatar, setSettings] = useSettings((st) => [st.settings.avatar, st.setSettings], shallow);
|
|
32
32
|
const { styles } = useStyle();
|
|
33
33
|
|
|
@@ -43,3 +43,5 @@ export default memo<AvatarWithUploadProps>(({ size = 40 }) => {
|
|
|
43
43
|
</div>
|
|
44
44
|
);
|
|
45
45
|
});
|
|
46
|
+
|
|
47
|
+
export default AvatarWithUpload;
|
|
@@ -14,7 +14,7 @@ export const useStyles = createStyles(({ css, token }) => ({
|
|
|
14
14
|
`,
|
|
15
15
|
}));
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const FolderPanel = memo<PropsWithChildren>(({ children }) => {
|
|
18
18
|
const { styles } = useStyles();
|
|
19
19
|
const [sessionsWidth, sessionExpandable] = useSettings(
|
|
20
20
|
(s) => [s.sessionsWidth, s.sessionExpandable],
|
|
@@ -53,3 +53,5 @@ export default memo<PropsWithChildren>(({ children }) => {
|
|
|
53
53
|
</DraggablePanel>
|
|
54
54
|
);
|
|
55
55
|
});
|
|
56
|
+
|
|
57
|
+
export default FolderPanel;
|
|
@@ -2,20 +2,23 @@ import { ActionIcon, DraggablePanel, DraggablePanelContainer } from '@lobehub/ui
|
|
|
2
2
|
import { createStyles } from 'antd-style';
|
|
3
3
|
import { LucideEdit, LucideX } from 'lucide-react';
|
|
4
4
|
import Router from 'next/router';
|
|
5
|
+
import { rgba } from 'polished';
|
|
5
6
|
import { useTranslation } from 'react-i18next';
|
|
6
7
|
import { Flexbox } from 'react-layout-kit';
|
|
7
8
|
import { shallow } from 'zustand/shallow';
|
|
8
9
|
|
|
10
|
+
import { CHAT_SIDEBAR_WIDTH, HEADER_HEIGHT } from '@/const/layoutTokens';
|
|
9
11
|
import { useSessionStore } from '@/store/session';
|
|
10
12
|
|
|
11
13
|
import ReadMode from './ReadMode';
|
|
12
14
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const useStyles = createStyles(({ cx, css, token, stylish }) => ({
|
|
16
|
+
drawer: cx(
|
|
17
|
+
stylish.blurStrong,
|
|
18
|
+
css`
|
|
19
|
+
background: ${rgba(token.colorBgLayout, 0.4)};
|
|
20
|
+
`,
|
|
21
|
+
),
|
|
19
22
|
header: css`
|
|
20
23
|
border-bottom: 1px solid ${token.colorBorder};
|
|
21
24
|
`,
|
|
@@ -34,14 +37,15 @@ const Config = () => {
|
|
|
34
37
|
className={styles.drawer}
|
|
35
38
|
expand={showAgentSettings}
|
|
36
39
|
expandable={false}
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
headerHeight={HEADER_HEIGHT}
|
|
41
|
+
maxWidth={CHAT_SIDEBAR_WIDTH}
|
|
42
|
+
minWidth={CHAT_SIDEBAR_WIDTH}
|
|
39
43
|
mode={'float'}
|
|
40
44
|
pin
|
|
41
45
|
placement={'right'}
|
|
42
46
|
resize={{ left: false }}
|
|
43
47
|
>
|
|
44
|
-
<DraggablePanelContainer style={{ flex: 'none', minWidth:
|
|
48
|
+
<DraggablePanelContainer style={{ flex: 'none', minWidth: CHAT_SIDEBAR_WIDTH }}>
|
|
45
49
|
<Flexbox
|
|
46
50
|
align={'center'}
|
|
47
51
|
className={styles.header}
|
|
@@ -5,6 +5,7 @@ import { Archive, Eraser, Languages } from 'lucide-react';
|
|
|
5
5
|
import { memo, useMemo, useState } from 'react';
|
|
6
6
|
import { shallow } from 'zustand/shallow';
|
|
7
7
|
|
|
8
|
+
import { CHAT_TEXTAREA_HEIGHT, HEADER_HEIGHT } from '@/const/layoutTokens';
|
|
8
9
|
import { ModelTokens } from '@/const/modelTokens';
|
|
9
10
|
import { agentSelectors, chatSelectors, useSessionStore } from '@/store/session';
|
|
10
11
|
import { useSettings } from '@/store/settings';
|
|
@@ -29,7 +30,8 @@ const ChatInput = () => {
|
|
|
29
30
|
<DraggablePanel
|
|
30
31
|
expandable={false}
|
|
31
32
|
fullscreen={expand}
|
|
32
|
-
|
|
33
|
+
headerHeight={HEADER_HEIGHT}
|
|
34
|
+
minHeight={CHAT_TEXTAREA_HEIGHT}
|
|
33
35
|
onSizeChange={(_, size) => {
|
|
34
36
|
if (!size) return;
|
|
35
37
|
useSettings.setState({
|
|
@@ -38,6 +40,7 @@ const ChatInput = () => {
|
|
|
38
40
|
}}
|
|
39
41
|
placement="bottom"
|
|
40
42
|
size={{ height: inputHeight, width: '100%' }}
|
|
43
|
+
style={{ zIndex: 10 }}
|
|
41
44
|
>
|
|
42
45
|
<ChatInputArea
|
|
43
46
|
actions={
|
|
@@ -49,7 +52,7 @@ const ChatInput = () => {
|
|
|
49
52
|
}
|
|
50
53
|
expand={expand}
|
|
51
54
|
footer={<Button icon={<Icon icon={Archive} />} />}
|
|
52
|
-
minHeight={
|
|
55
|
+
minHeight={CHAT_TEXTAREA_HEIGHT}
|
|
53
56
|
onExpandChange={setExpand}
|
|
54
57
|
onInputChange={setText}
|
|
55
58
|
onSend={sendMessage}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
2
|
|
|
3
|
+
import HeaderSpacing from '@/features/HeaderSpacing';
|
|
3
4
|
import ChatInput from '@/pages/chat/[id]/Conversation/Input';
|
|
4
5
|
|
|
5
6
|
import ChatList from './ChatList';
|
|
@@ -8,6 +9,7 @@ const Conversation = () => {
|
|
|
8
9
|
return (
|
|
9
10
|
<>
|
|
10
11
|
<div style={{ flex: 1, overflowY: 'scroll' }}>
|
|
12
|
+
<HeaderSpacing />
|
|
11
13
|
<ChatList />
|
|
12
14
|
</div>
|
|
13
15
|
<ChatInput />
|
|
@@ -6,6 +6,8 @@ import { memo } from 'react';
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
8
8
|
|
|
9
|
+
import HeaderSpacing from '@/features/HeaderSpacing';
|
|
10
|
+
|
|
9
11
|
import ChatLayout from '../../layout';
|
|
10
12
|
import AgentConfig from './AgentConfig';
|
|
11
13
|
import AgentMeta from './AgentMeta';
|
|
@@ -51,6 +53,7 @@ const EditPage = memo(() => {
|
|
|
51
53
|
/>
|
|
52
54
|
{/*form*/}
|
|
53
55
|
<Flexbox className={styles.form} flex={1} gap={10} padding={24}>
|
|
56
|
+
<HeaderSpacing />
|
|
54
57
|
<AgentMeta />
|
|
55
58
|
<AgentConfig />
|
|
56
59
|
</Flexbox>
|
|
@@ -23,16 +23,10 @@ const Chat = memo(() => {
|
|
|
23
23
|
<Head>
|
|
24
24
|
<title>{pageTitle}</title>
|
|
25
25
|
</Head>
|
|
26
|
-
|
|
27
|
-
<Flexbox flex={1} height={'100vh'} style={{ overflow: 'hidden', position: 'relative' }}>
|
|
26
|
+
<Flexbox id={'lobe-conversion-container'} style={{ height: '100vh', position: 'relative' }}>
|
|
28
27
|
<Header />
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
style={{ height: 'calc(100vh - 64px)', position: 'relative' }}
|
|
32
|
-
>
|
|
33
|
-
<Conversation />
|
|
34
|
-
<Config />
|
|
35
|
-
</Flexbox>
|
|
28
|
+
<Conversation />
|
|
29
|
+
<Config />
|
|
36
30
|
</Flexbox>
|
|
37
31
|
</Layout>
|
|
38
32
|
);
|
|
@@ -8,8 +8,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
import { shallow } from 'zustand/shallow';
|
|
9
9
|
|
|
10
10
|
import AvatarWithUpload from '@/features/AvatarWithUpload';
|
|
11
|
+
import SliderWithInput from '@/features/SliderWithInput';
|
|
11
12
|
import { options } from '@/locales/options';
|
|
12
|
-
import SliderWithInput from '@/pages/setting/SliderWithInput';
|
|
13
13
|
import { settingsSelectors, useSettings } from '@/store/settings';
|
|
14
14
|
import { DEFAULT_SETTINGS } from '@/store/settings/initialState';
|
|
15
15
|
import { ConfigKeys } from '@/types/exportConfig';
|
|
@@ -3,6 +3,7 @@ import { memo, useEffect } from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
+
import HeaderSpacing from '@/features/HeaderSpacing';
|
|
6
7
|
import SideBar from '@/features/SideBar';
|
|
7
8
|
import { createI18nNext } from '@/locales/create';
|
|
8
9
|
import { Sessions } from '@/pages/chat/SessionList';
|
|
@@ -30,6 +31,7 @@ const SettingLayout = memo(() => {
|
|
|
30
31
|
<Flexbox flex={1}>
|
|
31
32
|
<Header />
|
|
32
33
|
<Flexbox align={'center'} flex={1} padding={24} style={{ overflow: 'auto' }}>
|
|
34
|
+
<HeaderSpacing />
|
|
33
35
|
<SettingForm />
|
|
34
36
|
</Flexbox>
|
|
35
37
|
</Flexbox>
|
|
File without changes
|