@lobehub/chat 0.89.10 → 0.90.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 +2 -1
- package/src/app/chat/features/ChatHeader/ShareButton/style.ts +1 -2
- package/src/app/chat/features/Conversation/index.tsx +1 -2
- package/src/app/chat/features/SessionListContent/List/index.tsx +14 -12
- package/src/app/chat/features/TopicListContent/SystemRole/style.ts +1 -2
- package/src/app/market/(mobile)/features/AgentCard.tsx +1 -1
- package/src/app/market/(mobile)/index.tsx +1 -1
- package/src/app/market/features/AgentCard/AgentCardItem.tsx +1 -2
- package/src/app/market/features/AgentCard/index.tsx +23 -6
- package/src/app/market/features/AgentCard/style.ts +3 -2
- package/src/app/welcome/features/Banner/style.ts +1 -2
- package/src/layout/AppLayout.mobile.tsx +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.90.0](https://github.com/lobehub/lobe-chat/compare/v0.89.10...v0.90.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-10-17**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add Lazyload.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add Lazyload ([27d6cb7](https://github.com/lobehub/lobe-chat/commit/27d6cb7))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.89.10](https://github.com/lobehub/lobe-chat/compare/v0.89.9...v0.89.10)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-10-17**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
4
4
|
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"react-i18next": "^13",
|
|
104
104
|
"react-intersection-observer": "^9",
|
|
105
105
|
"react-layout-kit": "^1",
|
|
106
|
+
"react-lazy-load": "^4",
|
|
106
107
|
"remark": "^14",
|
|
107
108
|
"remark-gfm": "^3",
|
|
108
109
|
"remark-html": "^15",
|
|
@@ -12,8 +12,7 @@ import ChatScrollAnchor from './ScrollAnchor';
|
|
|
12
12
|
|
|
13
13
|
const useStyles = createStyles(
|
|
14
14
|
({ css, responsive, stylish }) => css`
|
|
15
|
-
overflow
|
|
16
|
-
overflow-y: scroll;
|
|
15
|
+
overflow: hidden scroll;
|
|
17
16
|
height: 100%;
|
|
18
17
|
${responsive.mobile} {
|
|
19
18
|
${stylish.noScrollbar}
|
|
@@ -2,6 +2,7 @@ import { useResponsive } from 'antd-style';
|
|
|
2
2
|
import isEqual from 'fast-deep-equal';
|
|
3
3
|
import Link from 'next/link';
|
|
4
4
|
import { memo } from 'react';
|
|
5
|
+
import LazyLoad from 'react-lazy-load';
|
|
5
6
|
|
|
6
7
|
import { SESSION_CHAT_URL } from '@/const/url';
|
|
7
8
|
import { useSessionHydrated, useSessionStore } from '@/store/session';
|
|
@@ -23,18 +24,19 @@ const SessionList = memo(() => {
|
|
|
23
24
|
<SkeletonList />
|
|
24
25
|
) : list.length > 0 ? (
|
|
25
26
|
list.map(({ id }) => (
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
<LazyLoad height={70} key={id}>
|
|
28
|
+
<Link
|
|
29
|
+
aria-label={id}
|
|
30
|
+
href={SESSION_CHAT_URL(id, mobile)}
|
|
31
|
+
onClick={(e) => {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
if (mobile) switchSession(id);
|
|
34
|
+
else activeSession(id);
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<SessionItem id={id} />
|
|
38
|
+
</Link>
|
|
39
|
+
</LazyLoad>
|
|
38
40
|
))
|
|
39
41
|
) : (
|
|
40
42
|
<AddButton />
|
|
@@ -12,7 +12,7 @@ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
|
|
|
12
12
|
`,
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
const AgentCard = memo<SpotlightCardProps>(({ items, renderItem, gap =
|
|
15
|
+
const AgentCard = memo<SpotlightCardProps>(({ items, renderItem, gap = 16, ...props }) => {
|
|
16
16
|
const { styles } = useStyles();
|
|
17
17
|
return (
|
|
18
18
|
<Flexbox gap={gap} {...props}>
|
|
@@ -12,6 +12,6 @@ import Layout from './layout.mobile';
|
|
|
12
12
|
export default memo<{ defaultAgents?: AgentsMarketIndexItem[] }>(({ defaultAgents }) => (
|
|
13
13
|
<Layout>
|
|
14
14
|
<Index />
|
|
15
|
-
<AgentCard CardRender={CardRender} defaultAgents={defaultAgents} />
|
|
15
|
+
<AgentCard CardRender={CardRender} defaultAgents={defaultAgents} mobile />
|
|
16
16
|
</Layout>
|
|
17
17
|
));
|
|
@@ -28,7 +28,6 @@ const AgentCardItem = memo<AgentsMarketIndexItem>(({ meta, identifier }) => {
|
|
|
28
28
|
animation={isHovering}
|
|
29
29
|
avatar={avatar}
|
|
30
30
|
background={backgroundColor || theme.colorFillTertiary}
|
|
31
|
-
className={styles.avatar}
|
|
32
31
|
size={56}
|
|
33
32
|
/>
|
|
34
33
|
<Paragraph className={styles.title} ellipsis={{ rows: 1, tooltip: title }}>
|
|
@@ -38,7 +37,7 @@ const AgentCardItem = memo<AgentsMarketIndexItem>(({ meta, identifier }) => {
|
|
|
38
37
|
{description}
|
|
39
38
|
</Paragraph>
|
|
40
39
|
<Flexbox gap={6} horizontal style={{ flexWrap: 'wrap' }}>
|
|
41
|
-
{(tags as string[]).map((tag: string, index) => (
|
|
40
|
+
{(tags as string[]).filter(Boolean).map((tag: string, index) => (
|
|
42
41
|
<Tag key={index} style={{ margin: 0 }}>
|
|
43
42
|
{startCase(tag).trim()}
|
|
44
43
|
</Tag>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SpotlightCardProps } from '@lobehub/ui';
|
|
2
|
-
import { useResponsive } from 'antd-style';
|
|
3
2
|
import { FC, memo, useMemo } from 'react';
|
|
4
3
|
import { useTranslation } from 'react-i18next';
|
|
5
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
|
+
import LazyLoad from 'react-lazy-load';
|
|
6
6
|
|
|
7
7
|
import { agentMarketSelectors, useMarketStore } from '@/store/market';
|
|
8
8
|
import { AgentsMarketIndexItem } from '@/types/market';
|
|
@@ -12,16 +12,25 @@ import AgentCardItem from './AgentCardItem';
|
|
|
12
12
|
import Loading from './Loading';
|
|
13
13
|
import { useStyles } from './style';
|
|
14
14
|
|
|
15
|
-
const gridRender = (item
|
|
15
|
+
const gridRender: SpotlightCardProps['renderItem'] = (item) => {
|
|
16
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
|
+
const { styles } = useStyles();
|
|
18
|
+
return (
|
|
19
|
+
<LazyLoad className={styles.lazy}>
|
|
20
|
+
<AgentCardItem {...item} />
|
|
21
|
+
</LazyLoad>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
16
24
|
|
|
17
25
|
export interface AgentCardProps {
|
|
18
26
|
CardRender: FC<SpotlightCardProps>;
|
|
19
27
|
defaultAgents?: AgentsMarketIndexItem[];
|
|
28
|
+
mobile?: boolean;
|
|
20
29
|
}
|
|
21
30
|
|
|
22
|
-
const AgentCard = memo<AgentCardProps>(({ defaultAgents, CardRender }) => {
|
|
31
|
+
const AgentCard = memo<AgentCardProps>(({ defaultAgents, CardRender, mobile }) => {
|
|
23
32
|
const { t } = useTranslation('market');
|
|
24
|
-
|
|
33
|
+
|
|
25
34
|
const { styles } = useStyles();
|
|
26
35
|
|
|
27
36
|
const [useFetchAgentList, keywords] = useMarketStore((s) => [
|
|
@@ -44,13 +53,21 @@ const AgentCard = memo<AgentCardProps>(({ defaultAgents, CardRender }) => {
|
|
|
44
53
|
<Flexbox gap={mobile ? 16 : 24}>
|
|
45
54
|
<TagList />
|
|
46
55
|
{keywords ? (
|
|
47
|
-
<CardRender
|
|
56
|
+
<CardRender
|
|
57
|
+
items={agentListData}
|
|
58
|
+
renderItem={gridRender}
|
|
59
|
+
spotlight={mobile ? undefined : false}
|
|
60
|
+
/>
|
|
48
61
|
) : (
|
|
49
62
|
<>
|
|
50
63
|
<div className={styles.subTitle}>{t('title.recentSubmits')}</div>
|
|
51
64
|
<CardRender items={agentListData.slice(0, 3)} renderItem={gridRender} />
|
|
52
65
|
<div className={styles.subTitle}>{t('title.allAgents')}</div>
|
|
53
|
-
<CardRender
|
|
66
|
+
<CardRender
|
|
67
|
+
items={agentListData.slice(3)}
|
|
68
|
+
renderItem={gridRender}
|
|
69
|
+
spotlight={mobile ? undefined : false}
|
|
70
|
+
/>
|
|
54
71
|
</>
|
|
55
72
|
)}
|
|
56
73
|
</Flexbox>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { createStyles } from 'antd-style';
|
|
2
2
|
|
|
3
3
|
export const useStyles = createStyles(({ css, token, responsive }) => ({
|
|
4
|
-
avatar: css``,
|
|
5
|
-
|
|
6
4
|
container: css`
|
|
7
5
|
position: relative;
|
|
8
6
|
overflow: hidden;
|
|
@@ -17,6 +15,9 @@ export const useStyles = createStyles(({ css, token, responsive }) => ({
|
|
|
17
15
|
inner: css`
|
|
18
16
|
padding: 16px;
|
|
19
17
|
`,
|
|
18
|
+
lazy: css`
|
|
19
|
+
min-height: 232px;
|
|
20
|
+
`,
|
|
20
21
|
subTitle: css`
|
|
21
22
|
font-size: 24px;
|
|
22
23
|
font-weight: 600;
|