@lobehub/chat 1.88.14 → 1.88.16
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/.cursor/rules/backend-architecture.mdc +94 -0
- package/.cursor/rules/cursor-ux-optimize.mdc +27 -0
- package/.cursor/rules/define-database-model.mdc +8 -0
- package/.cursor/rules/drizzle-schema-style-guide.mdc +202 -0
- package/.cursor/rules/i18n/i18n-auto-attached.mdc +6 -0
- package/.cursor/rules/i18n/i18n.mdc +183 -0
- package/.cursor/rules/packages/lobe-ui.mdc +72 -0
- package/.cursor/rules/packages/react-layout-kit.mdc +126 -0
- package/.cursor/rules/project-introduce.mdc +46 -0
- package/.cursor/rules/react-component.mdc +68 -0
- package/.cursorindexingignore +6 -0
- package/CHANGELOG.md +58 -0
- package/changelog/v1.json +21 -0
- package/package.json +1 -1
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +6 -0
- package/src/config/aiModels/deepseek.ts +1 -0
- package/src/config/aiModels/github.ts +55 -90
- package/src/libs/model-runtime/github/index.test.ts +2 -2
- package/src/libs/model-runtime/github/index.ts +6 -2
@@ -0,0 +1,126 @@
|
|
1
|
+
---
|
2
|
+
description: react flex layout package `react-layout-kit` usage
|
3
|
+
globs:
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# React Layout Kit 使用指南
|
7
|
+
|
8
|
+
`react-layout-kit` 是一个功能丰富的 React flex 布局组件库,在 lobe-chat 项目中被广泛使用。以下是重点组件的使用方法:
|
9
|
+
|
10
|
+
## Flexbox 组件
|
11
|
+
|
12
|
+
Flexbox 是最常用的布局组件,用于创建弹性布局,类似于 CSS 的 `display: flex`。
|
13
|
+
|
14
|
+
### 基本用法
|
15
|
+
|
16
|
+
```jsx
|
17
|
+
import { Flexbox } from 'react-layout-kit';
|
18
|
+
|
19
|
+
// 默认垂直布局
|
20
|
+
<Flexbox>
|
21
|
+
<div>子元素1</div>
|
22
|
+
<div>子元素2</div>
|
23
|
+
</Flexbox>
|
24
|
+
|
25
|
+
// 水平布局
|
26
|
+
<Flexbox horizontal>
|
27
|
+
<div>左侧元素</div>
|
28
|
+
<div>右侧元素</div>
|
29
|
+
</Flexbox>
|
30
|
+
```
|
31
|
+
|
32
|
+
### 常用属性
|
33
|
+
|
34
|
+
- `horizontal`: 布尔值,设置为水平方向布局
|
35
|
+
- `flex`: 数值或字符串,控制 flex 属性
|
36
|
+
- `gap`: 数值,设置子元素之间的间距
|
37
|
+
- `align`: 对齐方式,如 'center', 'flex-start' 等
|
38
|
+
- `justify`: 主轴对齐方式,如 'space-between', 'center' 等
|
39
|
+
- `padding`: 内边距值
|
40
|
+
- `paddingInline`: 水平内边距值
|
41
|
+
- `paddingBlock`: 垂直内边距值
|
42
|
+
- `width/height`: 设置宽高,通常用 `'100%'` 或具体像素值
|
43
|
+
- `style`: 自定义样式对象
|
44
|
+
|
45
|
+
### 实际应用示例
|
46
|
+
|
47
|
+
```jsx
|
48
|
+
// 经典三栏布局
|
49
|
+
<Flexbox horizontal height={'100%'} width={'100%'}>
|
50
|
+
{/* 左侧边栏 */}
|
51
|
+
<Flexbox
|
52
|
+
width={260}
|
53
|
+
style={{
|
54
|
+
borderRight: `1px solid ${theme.colorBorderSecondary}`,
|
55
|
+
height: '100%',
|
56
|
+
overflowY: 'auto',
|
57
|
+
}}
|
58
|
+
>
|
59
|
+
<SidebarContent />
|
60
|
+
</Flexbox>
|
61
|
+
|
62
|
+
{/* 中间内容区 */}
|
63
|
+
<Flexbox
|
64
|
+
flex={1}
|
65
|
+
style={{
|
66
|
+
height: '100%',
|
67
|
+
}}
|
68
|
+
>
|
69
|
+
{/* 主要内容 */}
|
70
|
+
<Flexbox flex={1} padding={24} style={{ overflowY: 'auto' }}>
|
71
|
+
<MainContent />
|
72
|
+
</Flexbox>
|
73
|
+
|
74
|
+
{/* 底部区域 */}
|
75
|
+
<Flexbox
|
76
|
+
style={{
|
77
|
+
borderTop: `1px solid ${theme.colorBorderSecondary}`,
|
78
|
+
padding: '16px 24px',
|
79
|
+
}}
|
80
|
+
>
|
81
|
+
<Footer />
|
82
|
+
</Flexbox>
|
83
|
+
</Flexbox>
|
84
|
+
</Flexbox>
|
85
|
+
```
|
86
|
+
|
87
|
+
## Center 组件
|
88
|
+
|
89
|
+
Center 是对 Flexbox 的封装,使子元素水平和垂直居中。
|
90
|
+
|
91
|
+
### 基本用法
|
92
|
+
|
93
|
+
```jsx
|
94
|
+
import { Center } from 'react-layout-kit';
|
95
|
+
|
96
|
+
<Center width={'100%'} height={'100%'}>
|
97
|
+
<Content />
|
98
|
+
</Center>
|
99
|
+
```
|
100
|
+
|
101
|
+
Center 组件继承了 Flexbox 的所有属性,同时默认设置了居中对齐。主要用于快速创建居中布局。
|
102
|
+
|
103
|
+
### 实际应用示例
|
104
|
+
|
105
|
+
```jsx
|
106
|
+
// 登录页面居中布局
|
107
|
+
<Flexbox height={'100%'} width={'100%'}>
|
108
|
+
<Center height={'100%'} width={'100%'}>
|
109
|
+
<LoginForm />
|
110
|
+
</Center>
|
111
|
+
</Flexbox>
|
112
|
+
|
113
|
+
// 图标居中显示
|
114
|
+
<Center className={styles.icon} flex={'none'} height={40} width={40}>
|
115
|
+
<Icon icon={icon} size={24} />
|
116
|
+
</Center>
|
117
|
+
```
|
118
|
+
|
119
|
+
## 最佳实践
|
120
|
+
|
121
|
+
1. 使用 `flex={1}` 让组件填充可用空间
|
122
|
+
2. 使用 `gap` 代替传统的 margin 设置元素间距
|
123
|
+
3. 嵌套 Flexbox 创建复杂布局
|
124
|
+
4. 设置 `overflow: 'auto'` 使内容可滚动
|
125
|
+
5. 使用 `horizontal` 创建水平布局,默认为垂直布局
|
126
|
+
6. 与 `antd-style` 的 `useTheme` hook 配合使用创建主题响应式的布局
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
description:
|
3
|
+
globs:
|
4
|
+
alwaysApply: true
|
5
|
+
---
|
6
|
+
## Project Description
|
7
|
+
|
8
|
+
You are developing an open-source, modern-design AI chat framework: lobe chat.
|
9
|
+
|
10
|
+
Emoji logo: 🤯
|
11
|
+
|
12
|
+
|
13
|
+
## Project Technologies Stack
|
14
|
+
|
15
|
+
read [package.json](mdc:package.json) to know all npm packages you can use.
|
16
|
+
read [folder-structure.mdx](mdc:docs/development/basic/folder-structure.mdx) to learn project structure.
|
17
|
+
|
18
|
+
The project uses the following technologies:
|
19
|
+
|
20
|
+
- pnpm as package manager
|
21
|
+
- Next.js 15 for frontend and backend, using app router instead of pages router
|
22
|
+
- react 19, using hooks, functional components, react server components
|
23
|
+
- TypeScript programming language
|
24
|
+
- antd, @lobehub/ui for component framework
|
25
|
+
- antd-style for css-in-js framework
|
26
|
+
- react-layout-kit for flex layout
|
27
|
+
- react-i18next for i18n
|
28
|
+
- lucide-react, @ant-design/icons for icons
|
29
|
+
- @lobehub/icons for AI provider/model logo icon
|
30
|
+
- @formkit/auto-animate for react list animation
|
31
|
+
- zustand for global state management
|
32
|
+
- nuqs for type-safe search params state manager
|
33
|
+
- SWR for react data fetch
|
34
|
+
- aHooks for react hooks library
|
35
|
+
- dayjs for date and time library
|
36
|
+
- lodash-es for utility library
|
37
|
+
- zod for data validation
|
38
|
+
- TRPC for type safe backend
|
39
|
+
- PGLite for client DB and PostgreSQL for backend DB
|
40
|
+
- Drizzle ORM
|
41
|
+
- Vitest for testing, testing-library for react component test
|
42
|
+
- Prettier for code formatting
|
43
|
+
- ESLint for code linting
|
44
|
+
- Cursor AI for code editing and AI coding assistance
|
45
|
+
|
46
|
+
Note: All tools and libraries used are the latest versions. The application only needs to be compatible with the latest browsers;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
---
|
2
|
+
description:
|
3
|
+
globs: *.tsx
|
4
|
+
alwaysApply: false
|
5
|
+
---
|
6
|
+
# react component 编写指南
|
7
|
+
|
8
|
+
- 如果要写复杂样式的话用 antd-style ,简单的话可以用 style 属性直接写内联样式
|
9
|
+
- 如果需要 flex 布局或者居中布局应该使用 react-layout-kit
|
10
|
+
- 选择组件库中的组件时优先使用 [lobe-ui.mdc](mdc:.cursor/rules/package-usage/lobe-ui.mdc) 有的,然后才是 antd 的,不知道 @lobehub/ui 的组件怎么用,有哪些属性,就自己搜下这个项目其它地方怎么用的,不要瞎猜
|
11
|
+
|
12
|
+
## 访问 theme 的两种方式
|
13
|
+
|
14
|
+
### 使用 antd-style 的 useTheme hook
|
15
|
+
|
16
|
+
```tsx
|
17
|
+
import { useTheme } from 'antd-style';
|
18
|
+
|
19
|
+
const MyComponent = () => {
|
20
|
+
const theme = useTheme();
|
21
|
+
|
22
|
+
return (
|
23
|
+
<div style={{
|
24
|
+
color: theme.colorPrimary,
|
25
|
+
backgroundColor: theme.colorBgContainer,
|
26
|
+
padding: theme.padding,
|
27
|
+
borderRadius: theme.borderRadius
|
28
|
+
}}>
|
29
|
+
使用主题 token 的组件
|
30
|
+
</div>
|
31
|
+
);
|
32
|
+
}
|
33
|
+
```
|
34
|
+
|
35
|
+
### 使用 antd-style 的 createStyles
|
36
|
+
|
37
|
+
```tsx
|
38
|
+
const useStyles = createStyles(({ css, token }) => {
|
39
|
+
return {
|
40
|
+
container: css`
|
41
|
+
background-color: ${token.colorBgContainer};
|
42
|
+
border-radius: ${token.borderRadius}px;
|
43
|
+
padding: ${token.padding}px;
|
44
|
+
color: ${token.colorText};
|
45
|
+
`,
|
46
|
+
title: css`
|
47
|
+
font-size: ${token.fontSizeLG}px;
|
48
|
+
font-weight: ${token.fontWeightStrong};
|
49
|
+
margin-bottom: ${token.marginSM}px;
|
50
|
+
`,
|
51
|
+
content: css`
|
52
|
+
font-size: ${token.fontSize}px;
|
53
|
+
line-height: ${token.lineHeight};
|
54
|
+
`
|
55
|
+
};
|
56
|
+
});
|
57
|
+
|
58
|
+
const Card: FC<CardProps> = ({ title, content }) => {
|
59
|
+
const { styles } = useStyles();
|
60
|
+
|
61
|
+
return (
|
62
|
+
<Flexbox className={styles.container}>
|
63
|
+
<div className={styles.title}>{title}</div>
|
64
|
+
<div className={styles.content}>{content}</div>
|
65
|
+
</Flexbox>
|
66
|
+
);
|
67
|
+
};
|
68
|
+
```
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,64 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.88.16](https://github.com/lobehub/lobe-chat/compare/v1.88.15...v1.88.16)
|
6
|
+
|
7
|
+
<sup>Released on **2025-05-29**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Cmd + click chat tab not open new tab.
|
12
|
+
|
13
|
+
#### 💄 Styles
|
14
|
+
|
15
|
+
- **misc**: Update GitHub models.
|
16
|
+
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
21
|
+
|
22
|
+
#### What's fixed
|
23
|
+
|
24
|
+
- **misc**: Cmd + click chat tab not open new tab, closes [#8001](https://github.com/lobehub/lobe-chat/issues/8001) ([d6d2129](https://github.com/lobehub/lobe-chat/commit/d6d2129))
|
25
|
+
|
26
|
+
#### Styles
|
27
|
+
|
28
|
+
- **misc**: Update GitHub models, closes [#8002](https://github.com/lobehub/lobe-chat/issues/8002) ([7b8f533](https://github.com/lobehub/lobe-chat/commit/7b8f533))
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
<div align="right">
|
33
|
+
|
34
|
+
[](#readme-top)
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
38
|
+
### [Version 1.88.15](https://github.com/lobehub/lobe-chat/compare/v1.88.14...v1.88.15)
|
39
|
+
|
40
|
+
<sup>Released on **2025-05-29**</sup>
|
41
|
+
|
42
|
+
#### 💄 Styles
|
43
|
+
|
44
|
+
- **misc**: Add fc ability to deepseek-reasoner model.
|
45
|
+
|
46
|
+
<br/>
|
47
|
+
|
48
|
+
<details>
|
49
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
50
|
+
|
51
|
+
#### Styles
|
52
|
+
|
53
|
+
- **misc**: Add fc ability to deepseek-reasoner model, closes [#8006](https://github.com/lobehub/lobe-chat/issues/8006) ([1511c75](https://github.com/lobehub/lobe-chat/commit/1511c75))
|
54
|
+
|
55
|
+
</details>
|
56
|
+
|
57
|
+
<div align="right">
|
58
|
+
|
59
|
+
[](#readme-top)
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
5
63
|
### [Version 1.88.14](https://github.com/lobehub/lobe-chat/compare/v1.88.13...v1.88.14)
|
6
64
|
|
7
65
|
<sup>Released on **2025-05-28**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,25 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"fixes": [
|
5
|
+
"Cmd + click chat tab not open new tab."
|
6
|
+
],
|
7
|
+
"improvements": [
|
8
|
+
"Update GitHub models."
|
9
|
+
]
|
10
|
+
},
|
11
|
+
"date": "2025-05-29",
|
12
|
+
"version": "1.88.16"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"children": {
|
16
|
+
"improvements": [
|
17
|
+
"Add fc ability to deepseek-reasoner model."
|
18
|
+
]
|
19
|
+
},
|
20
|
+
"date": "2025-05-29",
|
21
|
+
"version": "1.88.15"
|
22
|
+
},
|
2
23
|
{
|
3
24
|
"children": {
|
4
25
|
"fixes": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.88.
|
3
|
+
"version": "1.88.16",
|
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",
|
@@ -36,6 +36,12 @@ const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
|
|
36
36
|
aria-label={t('tab.chat')}
|
37
37
|
href={'/chat'}
|
38
38
|
onClick={(e) => {
|
39
|
+
// If Cmd key is pressed, let the default link behavior happen (open in new tab)
|
40
|
+
if (e.metaKey || e.ctrlKey) {
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
|
44
|
+
// Otherwise, prevent default and switch session within the current tab
|
39
45
|
e.preventDefault();
|
40
46
|
switchBackToChat(useSessionStore.getState().activeId);
|
41
47
|
}}
|