@lobehub/chat 1.0.7 → 1.0.9
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/.env.example +52 -0
- package/CHANGELOG.md +58 -0
- package/README.md +51 -10
- package/README.zh-CN.md +51 -10
- package/docs/self-hosting/advanced/feature-flags.mdx +13 -11
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/server-database.mdx +401 -0
- package/docs/self-hosting/advanced/server-database.zh-CN.mdx +389 -0
- package/docs/self-hosting/advanced/settings-url-share.mdx +14 -0
- package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +13 -0
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +15 -15
- package/docs/usage/features/auth.mdx +60 -0
- package/docs/usage/features/auth.zh-CN.mdx +58 -0
- package/docs/usage/features/database.mdx +54 -0
- package/docs/usage/features/database.zh-CN.mdx +54 -0
- package/locales/ar/common.json +1 -1
- package/locales/bg-BG/common.json +1 -1
- package/locales/de-DE/common.json +1 -1
- package/locales/en-US/chat.json +14 -14
- package/locales/en-US/common.json +12 -12
- package/locales/en-US/market.json +6 -6
- package/locales/en-US/metadata.json +2 -2
- package/locales/en-US/setting.json +16 -16
- package/locales/en-US/welcome.json +2 -2
- package/locales/es-ES/common.json +1 -1
- package/locales/fr-FR/common.json +1 -1
- package/locales/it-IT/common.json +1 -1
- package/locales/ja-JP/common.json +1 -1
- package/locales/ko-KR/common.json +1 -1
- package/locales/nl-NL/common.json +1 -1
- package/locales/pl-PL/common.json +1 -1
- package/locales/pt-BR/common.json +1 -1
- package/locales/ru-RU/common.json +1 -1
- package/locales/tr-TR/common.json +1 -1
- package/locales/vi-VN/common.json +1 -1
- package/locales/zh-CN/common.json +1 -1
- package/locales/zh-TW/common.json +1 -1
- package/package.json +3 -3
- package/scripts/i18nWorkflow/utils.ts +1 -4
- package/scripts/migrateServerDB/index.ts +2 -0
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/SendMore.tsx +3 -5
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx +15 -6
- package/src/app/(main)/chat/(workspace)/features/ShareButton/Preview.tsx +3 -2
- package/src/app/(main)/chat/@session/_layout/Desktop/SessionHeader.tsx +3 -2
- package/src/app/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +3 -2
- package/src/app/(main)/market/_layout/Desktop/Header.tsx +3 -2
- package/src/app/(main)/market/_layout/Desktop/Hero.tsx +1 -1
- package/src/app/(main)/welcome/_layout/Desktop.tsx +3 -2
- package/src/app/layout.tsx +2 -1
- package/src/components/BrandWatermark/index.tsx +2 -2
- package/src/components/FullscreenLoading/index.tsx +3 -2
- package/src/config/featureFlags/schema.ts +1 -1
- package/src/config/file.ts +2 -2
- package/src/config/modelProviders/deepseek.ts +2 -2
- package/src/locales/default/common.ts +1 -1
- package/src/store/serverConfig/selectors.test.ts +1 -1
package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Icon } from '@lobehub/ui';
|
|
2
|
-
import { Button, Space } from 'antd';
|
|
2
|
+
import { Button, Skeleton, Space } from 'antd';
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { ChevronUp, CornerDownLeft, LucideCommand } from 'lucide-react';
|
|
5
5
|
import { rgba } from 'polished';
|
|
6
|
-
import { memo } from 'react';
|
|
6
|
+
import { memo, useEffect, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
9
9
|
|
|
@@ -50,8 +50,6 @@ const useStyles = createStyles(({ css, prefixCls, token }) => {
|
|
|
50
50
|
};
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
const isMac = isMacOS();
|
|
54
|
-
|
|
55
53
|
interface FooterProps {
|
|
56
54
|
setExpand?: (expand: boolean) => void;
|
|
57
55
|
}
|
|
@@ -86,9 +84,20 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
|
|
|
86
84
|
|
|
87
85
|
const sendMessage = useSendMessage();
|
|
88
86
|
|
|
87
|
+
const [isMac, setIsMac] = useState<boolean>();
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
setIsMac(isMacOS());
|
|
90
|
+
}, [setIsMac]);
|
|
91
|
+
|
|
89
92
|
const cmdEnter = (
|
|
90
93
|
<Flexbox gap={2} horizontal>
|
|
91
|
-
|
|
94
|
+
{typeof isMac === 'boolean' ? (
|
|
95
|
+
<Icon icon={isMac ? LucideCommand : ChevronUp} />
|
|
96
|
+
) : (
|
|
97
|
+
<Skeleton.Node active style={{ height: '100%', width: 12 }}>
|
|
98
|
+
{' '}
|
|
99
|
+
</Skeleton.Node>
|
|
100
|
+
)}
|
|
92
101
|
<Icon icon={CornerDownLeft} />
|
|
93
102
|
</Flexbox>
|
|
94
103
|
);
|
|
@@ -159,7 +168,7 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
|
|
|
159
168
|
>
|
|
160
169
|
{t('input.send')}
|
|
161
170
|
</Button>
|
|
162
|
-
<SendMore disabled={buttonDisabled} />
|
|
171
|
+
<SendMore disabled={buttonDisabled} isMac={isMac} />
|
|
163
172
|
</Space.Compact>
|
|
164
173
|
)}
|
|
165
174
|
</Flexbox>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Avatar, ChatHeaderTitle,
|
|
1
|
+
import { Avatar, ChatHeaderTitle, Markdown } from '@lobehub/ui';
|
|
2
|
+
import { LobeChat } from '@lobehub/ui/brand';
|
|
2
3
|
import { memo } from 'react';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
5
|
import { Flexbox } from 'react-layout-kit';
|
|
@@ -62,7 +63,7 @@ const Preview = memo<FieldType & { title?: string }>(
|
|
|
62
63
|
<ChatList />
|
|
63
64
|
{withFooter ? (
|
|
64
65
|
<Flexbox align={'center'} className={styles.footer} gap={4}>
|
|
65
|
-
<
|
|
66
|
+
<LobeChat type={'combine'} />
|
|
66
67
|
<div className={styles.url}>{pkg.homepage}</div>
|
|
67
68
|
</Flexbox>
|
|
68
69
|
) : (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { ActionIcon
|
|
3
|
+
import { ActionIcon } from '@lobehub/ui';
|
|
4
|
+
import { LobeChat } from '@lobehub/ui/brand';
|
|
4
5
|
import { createStyles } from 'antd-style';
|
|
5
6
|
import { MessageSquarePlus } from 'lucide-react';
|
|
6
7
|
import { memo } from 'react';
|
|
@@ -37,7 +38,7 @@ const Header = memo(() => {
|
|
|
37
38
|
<Flexbox className={styles.top} gap={16} padding={16}>
|
|
38
39
|
<Flexbox distribution={'space-between'} horizontal>
|
|
39
40
|
<Flexbox align={'center'} gap={4} horizontal>
|
|
40
|
-
<
|
|
41
|
+
<LobeChat className={styles.logo} size={36} type={'text'} />
|
|
41
42
|
{enableWebrtc && <SyncStatusTag />}
|
|
42
43
|
</Flexbox>
|
|
43
44
|
{showCreateSession && (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { ActionIcon,
|
|
3
|
+
import { ActionIcon, MobileNavBar } from '@lobehub/ui';
|
|
4
|
+
import { LobeChat } from '@lobehub/ui/brand';
|
|
4
5
|
import { MessageSquarePlus } from 'lucide-react';
|
|
5
6
|
import { useRouter } from 'next/navigation';
|
|
6
7
|
import { memo } from 'react';
|
|
@@ -23,7 +24,7 @@ const Header = memo(() => {
|
|
|
23
24
|
left={
|
|
24
25
|
<Flexbox align={'center'} gap={8} horizontal style={{ marginLeft: 8 }}>
|
|
25
26
|
<UserAvatar onClick={() => router.push('/me')} size={32} />
|
|
26
|
-
<
|
|
27
|
+
<LobeChat type={'text'} />
|
|
27
28
|
{enableWebrtc && <SyncStatusInspector placement={'bottom'} />}
|
|
28
29
|
</Flexbox>
|
|
29
30
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { ChatHeader
|
|
3
|
+
import { ChatHeader } from '@lobehub/ui';
|
|
4
|
+
import { LobeChat } from '@lobehub/ui/brand';
|
|
4
5
|
import { createStyles } from 'antd-style';
|
|
5
6
|
import { memo } from 'react';
|
|
6
7
|
|
|
@@ -18,7 +19,7 @@ const Header = memo(() => {
|
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<ChatHeader
|
|
21
|
-
left={<
|
|
22
|
+
left={<LobeChat className={styles.logo} extra={'Discover'} size={36} type={'text'} />}
|
|
22
23
|
right={<ShareAgentButton />}
|
|
23
24
|
/>
|
|
24
25
|
);
|
|
@@ -30,7 +30,7 @@ const Hero = memo(() => {
|
|
|
30
30
|
const { theme, styles } = useStyles();
|
|
31
31
|
return (
|
|
32
32
|
<Center>
|
|
33
|
-
<h1 className={styles.title}>Find & Use The Best
|
|
33
|
+
<h1 className={styles.title}>Find & Use The Best Assistants</h1>
|
|
34
34
|
<GridBackground animation className={styles.background} colorFront={theme.colorText} random />
|
|
35
35
|
</Center>
|
|
36
36
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { GridShowcase
|
|
1
|
+
import { GridShowcase } from '@lobehub/ui';
|
|
2
|
+
import { LobeHub } from '@lobehub/ui/brand';
|
|
2
3
|
import { PropsWithChildren } from 'react';
|
|
3
4
|
import { Flexbox } from 'react-layout-kit';
|
|
4
5
|
|
|
@@ -17,7 +18,7 @@ const DesktopLayout = ({ children }: PropsWithChildren) => {
|
|
|
17
18
|
style={{ overflow: 'hidden', position: 'relative' }}
|
|
18
19
|
width={'100%'}
|
|
19
20
|
>
|
|
20
|
-
<
|
|
21
|
+
<LobeHub size={36} style={{ alignSelf: 'flex-start' }} type={'text'} />
|
|
21
22
|
<GridShowcase
|
|
22
23
|
innerProps={{ gap: 24 }}
|
|
23
24
|
style={{ maxHeight: 'calc(100% - 104px)', maxWidth: 1024 }}
|
package/src/app/layout.tsx
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { SpeedInsights } from '@vercel/speed-insights/next';
|
|
2
2
|
import { ResolvingViewport } from 'next';
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
3
4
|
import { cookies } from 'next/headers';
|
|
4
5
|
import { ReactNode } from 'react';
|
|
5
6
|
import { isRtlLang } from 'rtl-detect';
|
|
6
7
|
|
|
7
8
|
import Analytics from '@/components/Analytics';
|
|
8
9
|
import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/const/locale';
|
|
9
|
-
import PWAInstall from '@/features/PWAInstall';
|
|
10
10
|
import AuthProvider from '@/layout/AuthProvider';
|
|
11
11
|
import GlobalProvider from '@/layout/GlobalProvider';
|
|
12
12
|
import { isMobileDevice } from '@/utils/responsive';
|
|
13
13
|
|
|
14
|
+
const PWAInstall = dynamic(() => import('@/features/PWAInstall'), { ssr: false });
|
|
14
15
|
const inVercel = process.env.VERCEL === '1';
|
|
15
16
|
|
|
16
17
|
type RootLayoutProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { LobeHub } from '@lobehub/ui/brand';
|
|
4
4
|
import { createStyles } from 'antd-style';
|
|
5
5
|
import Link from 'next/link';
|
|
6
6
|
import { memo } from 'react';
|
|
@@ -30,7 +30,7 @@ const BrandWatermark = memo<Omit<FlexboxProps, 'children'>>(({ style, ...rest })
|
|
|
30
30
|
>
|
|
31
31
|
<span>Powered by</span>
|
|
32
32
|
<Link className={styles.logoLink} href={'https://lobehub.com'} target={'_blank'}>
|
|
33
|
-
<
|
|
33
|
+
<LobeHub size={20} type={'text'} />
|
|
34
34
|
</Link>
|
|
35
35
|
</Flexbox>
|
|
36
36
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Icon
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
|
2
|
+
import { LobeChat } from '@lobehub/ui/brand';
|
|
2
3
|
import { Loader2 } from 'lucide-react';
|
|
3
4
|
import { memo } from 'react';
|
|
4
5
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
@@ -7,7 +8,7 @@ const FullscreenLoading = memo<{ title?: string }>(({ title }) => {
|
|
|
7
8
|
return (
|
|
8
9
|
<Flexbox height={'100%'} style={{ userSelect: 'none' }} width={'100%'}>
|
|
9
10
|
<Center flex={1} gap={12} width={'100%'}>
|
|
10
|
-
<
|
|
11
|
+
<LobeChat size={48} type={'combine'} />
|
|
11
12
|
<Center gap={16} horizontal>
|
|
12
13
|
<Icon icon={Loader2} spin />
|
|
13
14
|
{title}
|
package/src/config/file.ts
CHANGED
|
@@ -6,7 +6,7 @@ const DEFAULT_S3_FILE_PATH = 'files';
|
|
|
6
6
|
export const getFileConfig = () => {
|
|
7
7
|
return createEnv({
|
|
8
8
|
client: {
|
|
9
|
-
NEXT_PUBLIC_S3_DOMAIN: z.string().optional(),
|
|
9
|
+
NEXT_PUBLIC_S3_DOMAIN: z.string().url().optional(),
|
|
10
10
|
NEXT_PUBLIC_S3_FILE_PATH: z.string().optional(),
|
|
11
11
|
},
|
|
12
12
|
runtimeEnv: {
|
|
@@ -23,7 +23,7 @@ export const getFileConfig = () => {
|
|
|
23
23
|
// S3
|
|
24
24
|
S3_ACCESS_KEY_ID: z.string().optional(),
|
|
25
25
|
S3_BUCKET: z.string().optional(),
|
|
26
|
-
S3_ENDPOINT: z.string().optional(),
|
|
26
|
+
S3_ENDPOINT: z.string().url().optional(),
|
|
27
27
|
|
|
28
28
|
S3_REGION: z.string().optional(),
|
|
29
29
|
S3_SECRET_ACCESS_KEY: z.string().optional(),
|
|
@@ -11,10 +11,10 @@ const DeepSeek: ModelProviderCard = {
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
description: '擅长编程场景',
|
|
14
|
-
displayName: 'DeepSeek-coder',
|
|
14
|
+
displayName: 'DeepSeek-coder-V2',
|
|
15
15
|
enabled: true,
|
|
16
16
|
id: 'deepseek-coder',
|
|
17
|
-
tokens:
|
|
17
|
+
tokens: 32_768,
|
|
18
18
|
},
|
|
19
19
|
],
|
|
20
20
|
checkModel: 'deepseek-chat',
|