@lobehub/chat 1.36.37 → 1.36.39
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 +50 -0
- package/changelog/v1.json +18 -0
- package/package.json +2 -2
- package/src/app/(main)/(mobile)/me/(home)/page.tsx +2 -2
- package/src/app/(main)/(mobile)/me/data/page.tsx +2 -2
- package/src/app/(main)/(mobile)/me/profile/page.tsx +2 -2
- package/src/app/(main)/(mobile)/me/settings/page.tsx +2 -2
- package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +3 -3
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/index.tsx +1 -3
- package/src/app/(main)/chat/(workspace)/@portal/default.tsx +2 -2
- package/src/app/(main)/chat/(workspace)/@topic/default.tsx +2 -2
- package/src/app/(main)/chat/(workspace)/page.tsx +1 -1
- package/src/app/(main)/discover/(detail)/assistant/[slug]/page.tsx +1 -1
- package/src/app/(main)/discover/(detail)/model/[...slugs]/page.tsx +1 -1
- package/src/app/(main)/discover/(detail)/plugin/[slug]/page.tsx +1 -1
- package/src/app/(main)/discover/(detail)/provider/[slug]/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/assistants/[slug]/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/assistants/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/models/[slug]/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/models/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/plugins/[slug]/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/plugins/page.tsx +1 -1
- package/src/app/(main)/discover/(list)/providers/page.tsx +1 -1
- package/src/app/(main)/discover/search/page.tsx +1 -1
- package/src/app/(main)/profile/[[...slugs]]/page.tsx +3 -2
- package/src/app/(main)/profile/layout.tsx +3 -2
- package/src/app/(main)/profile/loading.tsx +2 -2
- package/src/app/(main)/repos/[id]/evals/evaluation/page.tsx +1 -1
- package/src/app/(main)/repos/[id]/evals/layout.tsx +9 -3
- package/src/app/(main)/settings/about/page.tsx +2 -2
- package/src/app/(main)/settings/sync/page.tsx +3 -3
- package/src/app/@modal/(.)settings/modal/page.tsx +3 -3
- package/src/app/layout.tsx +2 -2
- package/src/components/server/ServerLayout.tsx +2 -2
- package/src/layout/GlobalProvider/index.tsx +1 -1
- package/src/utils/server/responsive.ts +4 -5
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.36.39](https://github.com/lobehub/lobe-chat/compare/v1.36.38...v1.36.39)
|
6
|
+
|
7
|
+
<sup>Released on **2024-12-20**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Refactor to use async `headers()`.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: Refactor to use async `headers()`, closes [#5097](https://github.com/lobehub/lobe-chat/issues/5097) ([e368f38](https://github.com/lobehub/lobe-chat/commit/e368f38))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.36.38](https://github.com/lobehub/lobe-chat/compare/v1.36.37...v1.36.38)
|
31
|
+
|
32
|
+
<sup>Released on **2024-12-20**</sup>
|
33
|
+
|
34
|
+
#### ♻ Code Refactoring
|
35
|
+
|
36
|
+
- **misc**: Refactor layout props.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Code refactoring
|
44
|
+
|
45
|
+
- **misc**: Refactor layout props, closes [#5093](https://github.com/lobehub/lobe-chat/issues/5093) ([2990b5a](https://github.com/lobehub/lobe-chat/commit/2990b5a))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.36.37](https://github.com/lobehub/lobe-chat/compare/v1.36.36...v1.36.37)
|
6
56
|
|
7
57
|
<sup>Released on **2024-12-19**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Refactor to use async headers()."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2024-12-20",
|
9
|
+
"version": "1.36.39"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"improvements": [
|
14
|
+
"Refactor layout props."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2024-12-20",
|
18
|
+
"version": "1.36.38"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {},
|
4
22
|
"date": "2024-12-19",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.36.
|
3
|
+
"version": "1.36.39",
|
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",
|
@@ -202,7 +202,7 @@
|
|
202
202
|
"react-i18next": "14.0.2",
|
203
203
|
"react-layout-kit": "^1.9.0",
|
204
204
|
"react-lazy-load": "^4.0.1",
|
205
|
-
"react-pdf": "^9.
|
205
|
+
"react-pdf": "^9.2.1",
|
206
206
|
"react-scan": "^0.0.46",
|
207
207
|
"react-virtuoso": "^4.12.0",
|
208
208
|
"react-wrap-balancer": "^1.1.1",
|
@@ -6,14 +6,14 @@ import ChatList from './features/ChatList';
|
|
6
6
|
import ThreadHydration from './features/ThreadHydration';
|
7
7
|
import ZenModeToast from './features/ZenModeToast';
|
8
8
|
|
9
|
-
const ChatConversation = () => {
|
10
|
-
const mobile = isMobileDevice();
|
9
|
+
const ChatConversation = async () => {
|
10
|
+
const mobile = await isMobileDevice();
|
11
11
|
|
12
12
|
return (
|
13
13
|
<>
|
14
14
|
<ZenModeToast />
|
15
15
|
<ChatList mobile={mobile} />
|
16
|
-
<ChatInput />
|
16
|
+
<ChatInput mobile={mobile} />
|
17
17
|
<ChatHydration />
|
18
18
|
<ThreadHydration />
|
19
19
|
</>
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import MobileChatInput from '@/features/ChatInput/Mobile';
|
2
|
-
import { isMobileDevice } from '@/utils/server/responsive';
|
3
2
|
|
4
3
|
import DesktopChatInput from './Desktop';
|
5
4
|
|
6
|
-
const ChatInput = () => {
|
7
|
-
const mobile = isMobileDevice();
|
5
|
+
const ChatInput = ({ mobile }: { mobile: boolean }) => {
|
8
6
|
const Input = mobile ? MobileChatInput : DesktopChatInput;
|
9
7
|
|
10
8
|
return <Input />;
|
@@ -8,8 +8,8 @@ import Mobile from './_layout/Mobile';
|
|
8
8
|
|
9
9
|
const PortalBody = lazy(() => import('@/features/Portal/router'));
|
10
10
|
|
11
|
-
const Inspector = () => {
|
12
|
-
const mobile = isMobileDevice();
|
11
|
+
const Inspector = async () => {
|
12
|
+
const mobile = await isMobileDevice();
|
13
13
|
|
14
14
|
const Layout = mobile ? Mobile : Desktop;
|
15
15
|
|
@@ -10,8 +10,8 @@ import SystemRole from './features/SystemRole';
|
|
10
10
|
|
11
11
|
const TopicContent = lazy(() => import('./features/TopicListContent'));
|
12
12
|
|
13
|
-
const Topic = () => {
|
14
|
-
const mobile = isMobileDevice();
|
13
|
+
const Topic = async () => {
|
14
|
+
const mobile = await isMobileDevice();
|
15
15
|
|
16
16
|
const Layout = mobile ? Mobile : Desktop;
|
17
17
|
|
@@ -18,7 +18,7 @@ export const generateMetadata = async () => {
|
|
18
18
|
};
|
19
19
|
|
20
20
|
const Page = async () => {
|
21
|
-
const mobile = isMobileDevice();
|
21
|
+
const mobile = await isMobileDevice();
|
22
22
|
const { t } = await translation('metadata');
|
23
23
|
const ld = ldModule.generate({
|
24
24
|
description: t('chat.title', { appName: BRANDING_NAME }),
|
@@ -62,7 +62,7 @@ const Page = async (props: DiscoverPageProps) => {
|
|
62
62
|
|
63
63
|
const { slug: identifier } = params;
|
64
64
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
65
|
-
const mobile = isMobileDevice();
|
65
|
+
const mobile = await isMobileDevice();
|
66
66
|
|
67
67
|
const discoverService = new DiscoverService();
|
68
68
|
const data = await discoverService.getAssistantById(locale, identifier);
|
@@ -72,7 +72,7 @@ const Page = async (props: Props) => {
|
|
72
72
|
const identifier = decodeURIComponent(slugs.join('/'));
|
73
73
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
74
74
|
const { t: td } = await translation('models', searchParams?.hl);
|
75
|
-
const mobile = isMobileDevice();
|
75
|
+
const mobile = await isMobileDevice();
|
76
76
|
|
77
77
|
const discoverService = new DiscoverService();
|
78
78
|
const data = await discoverService.getModelById(locale, identifier);
|
@@ -64,7 +64,7 @@ const Page = async (props: DiscoverPageProps) => {
|
|
64
64
|
|
65
65
|
const { slug: identifier } = params;
|
66
66
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
67
|
-
const mobile = isMobileDevice();
|
67
|
+
const mobile = await isMobileDevice();
|
68
68
|
|
69
69
|
const discoverService = new DiscoverService();
|
70
70
|
const data = await discoverService.getPluginById(locale, identifier, true);
|
@@ -62,7 +62,7 @@ const Page = async (props: DiscoverPageProps) => {
|
|
62
62
|
const { slug: identifier } = params;
|
63
63
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
64
64
|
const { t: td } = await translation('models', searchParams?.hl);
|
65
|
-
const mobile = isMobileDevice();
|
65
|
+
const mobile = await isMobileDevice();
|
66
66
|
|
67
67
|
const discoverService = new DiscoverService();
|
68
68
|
const data = await discoverService.getProviderById(locale, identifier);
|
@@ -32,7 +32,7 @@ const Page = async (props: DiscoverPageProps<AssistantCategory>) => {
|
|
32
32
|
|
33
33
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
34
34
|
const { t: td } = await translation('discover', searchParams?.hl);
|
35
|
-
const mobile = isMobileDevice();
|
35
|
+
const mobile = await isMobileDevice();
|
36
36
|
|
37
37
|
const discoverService = new DiscoverService();
|
38
38
|
const items = await discoverService.getAssistantCategory(locale, params.slug);
|
@@ -25,7 +25,7 @@ export const generateMetadata = async (props: Props) => {
|
|
25
25
|
const Page = async (props: Props) => {
|
26
26
|
const searchParams = await props.searchParams;
|
27
27
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
28
|
-
const mobile = isMobileDevice();
|
28
|
+
const mobile = await isMobileDevice();
|
29
29
|
|
30
30
|
const discoverService = new DiscoverService();
|
31
31
|
const items = await discoverService.getAssistantList(locale);
|
@@ -35,7 +35,7 @@ const Page = async (props: DiscoverPageProps) => {
|
|
35
35
|
const searchParams = await props.searchParams;
|
36
36
|
|
37
37
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
38
|
-
const mobile = isMobileDevice();
|
38
|
+
const mobile = await isMobileDevice();
|
39
39
|
|
40
40
|
const discoverService = new DiscoverService();
|
41
41
|
const list = await discoverService.getProviderList(locale);
|
@@ -29,7 +29,7 @@ const Page = async (props: Props) => {
|
|
29
29
|
const searchParams = await props.searchParams;
|
30
30
|
|
31
31
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
32
|
-
const mobile = isMobileDevice();
|
32
|
+
const mobile = await isMobileDevice();
|
33
33
|
|
34
34
|
const discoverService = new DiscoverService();
|
35
35
|
const items = await discoverService.getModelList(locale);
|
@@ -32,7 +32,7 @@ const Page = async (props: DiscoverPageProps<PluginCategory>) => {
|
|
32
32
|
|
33
33
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
34
34
|
const { t: td } = await translation('discover', searchParams?.hl);
|
35
|
-
const mobile = isMobileDevice();
|
35
|
+
const mobile = await isMobileDevice();
|
36
36
|
|
37
37
|
const discoverService = new DiscoverService();
|
38
38
|
const items = await discoverService.getPluginCategory(locale, params.slug);
|
@@ -26,7 +26,7 @@ export const generateMetadata = async (props: Props) => {
|
|
26
26
|
const Page = async (props: Props) => {
|
27
27
|
const searchParams = await props.searchParams;
|
28
28
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
29
|
-
const mobile = isMobileDevice();
|
29
|
+
const mobile = await isMobileDevice();
|
30
30
|
|
31
31
|
const discoverService = new DiscoverService();
|
32
32
|
const items = await discoverService.getPluginList(locale);
|
@@ -26,7 +26,7 @@ export const generateMetadata = async (props: Props) => {
|
|
26
26
|
const Page = async (props: Props) => {
|
27
27
|
const searchParams = await props.searchParams;
|
28
28
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
29
|
-
const mobile = isMobileDevice();
|
29
|
+
const mobile = await isMobileDevice();
|
30
30
|
|
31
31
|
const discoverService = new DiscoverService();
|
32
32
|
const items = await discoverService.getProviderList(locale);
|
@@ -56,7 +56,7 @@ const Page = async (props: Props) => {
|
|
56
56
|
const keywords = decodeURIComponent(q);
|
57
57
|
|
58
58
|
const { t, locale } = await translation('metadata', searchParams?.hl);
|
59
|
-
const mobile = isMobileDevice();
|
59
|
+
const mobile = await isMobileDevice();
|
60
60
|
|
61
61
|
const ld = ldModule.generate({
|
62
62
|
description: t('discover.description'),
|
@@ -6,10 +6,11 @@ import { isMobileDevice } from '@/utils/server/responsive';
|
|
6
6
|
|
7
7
|
import MobileLayout from './_layout/Mobile';
|
8
8
|
|
9
|
-
const Layout = ({ children }: PropsWithChildren) => {
|
9
|
+
const Layout = async ({ children }: PropsWithChildren) => {
|
10
10
|
if (!enableClerk) return notFound();
|
11
11
|
|
12
|
-
const mobile = isMobileDevice();
|
12
|
+
const mobile = await isMobileDevice();
|
13
|
+
|
13
14
|
if (mobile) return <MobileLayout>{children}</MobileLayout>;
|
14
15
|
|
15
16
|
return children;
|
@@ -3,8 +3,8 @@ import { Flexbox } from 'react-layout-kit';
|
|
3
3
|
import SkeletonLoading from '@/components/SkeletonLoading';
|
4
4
|
import { isMobileDevice } from '@/utils/server/responsive';
|
5
5
|
|
6
|
-
const Loading = () => {
|
7
|
-
const mobile = isMobileDevice();
|
6
|
+
const Loading = async () => {
|
7
|
+
const mobile = await isMobileDevice();
|
8
8
|
if (mobile) return <SkeletonLoading paragraph={{ rows: 8 }} />;
|
9
9
|
return (
|
10
10
|
<Flexbox horizontal style={{ position: 'relative' }} width={'100%'}>
|
@@ -1,14 +1,18 @@
|
|
1
1
|
import { notFound } from 'next/navigation';
|
2
|
-
import {
|
2
|
+
import { ReactNode } from 'react';
|
3
3
|
import { Flexbox } from 'react-layout-kit';
|
4
4
|
|
5
5
|
import { serverFeatureFlags } from '@/config/featureFlags';
|
6
|
-
import { PagePropsWithId } from '@/types/next';
|
7
6
|
|
8
7
|
import Container from './components/Container';
|
9
8
|
import { Tabs } from './components/Tabs';
|
10
9
|
|
11
|
-
|
10
|
+
interface LayoutProps {
|
11
|
+
children: ReactNode;
|
12
|
+
params: Promise<{ id: string }>;
|
13
|
+
}
|
14
|
+
|
15
|
+
const Layout = async (props: LayoutProps) => {
|
12
16
|
const enableRAGEval = serverFeatureFlags().enableRAGEval;
|
13
17
|
const params = await props.params;
|
14
18
|
|
@@ -21,3 +25,5 @@ export default async (props: PropsWithChildren<PagePropsWithId>) => {
|
|
21
25
|
</Flexbox>
|
22
26
|
);
|
23
27
|
};
|
28
|
+
|
29
|
+
export default Layout;
|
@@ -15,12 +15,12 @@ export const generateMetadata = async () => {
|
|
15
15
|
url: '/settings/sync',
|
16
16
|
});
|
17
17
|
};
|
18
|
-
export default () => {
|
18
|
+
export default async () => {
|
19
19
|
const enableWebrtc = serverFeatureFlags().enableWebrtc;
|
20
20
|
if (!enableWebrtc) return notFound();
|
21
21
|
|
22
|
-
const isMobile = isMobileDevice();
|
23
|
-
const { os, browser } = gerServerDeviceInfo();
|
22
|
+
const isMobile = await isMobileDevice();
|
23
|
+
const { os, browser } = await gerServerDeviceInfo();
|
24
24
|
|
25
25
|
return <Page browser={browser} mobile={isMobile} os={os} />;
|
26
26
|
};
|
@@ -7,9 +7,9 @@ import SettingsModal from './index';
|
|
7
7
|
* @refs: https://github.com/lobehub/lobe-chat/discussions/2295#discussioncomment-9290942
|
8
8
|
*/
|
9
9
|
|
10
|
-
const Page = () => {
|
11
|
-
const isMobile = isMobileDevice();
|
12
|
-
const { os, browser } = gerServerDeviceInfo();
|
10
|
+
const Page = async () => {
|
11
|
+
const isMobile = await isMobileDevice();
|
12
|
+
const { os, browser } = await gerServerDeviceInfo();
|
13
13
|
|
14
14
|
return <SettingsModal browser={browser} mobile={isMobile} os={os} />;
|
15
15
|
};
|
package/src/app/layout.tsx
CHANGED
@@ -25,7 +25,7 @@ const RootLayout = async ({ children, modal }: RootLayoutProps) => {
|
|
25
25
|
const locale = lang?.value || DEFAULT_LANG;
|
26
26
|
|
27
27
|
const direction = isRtlLang(locale) ? 'rtl' : 'ltr';
|
28
|
-
const mobile = isMobileDevice();
|
28
|
+
const mobile = await isMobileDevice();
|
29
29
|
|
30
30
|
return (
|
31
31
|
<html dir={direction} lang={locale} suppressHydrationWarning>
|
@@ -49,7 +49,7 @@ export default RootLayout;
|
|
49
49
|
export { generateMetadata } from './metadata';
|
50
50
|
|
51
51
|
export const generateViewport = async (): ResolvingViewport => {
|
52
|
-
const isMobile = isMobileDevice();
|
52
|
+
const isMobile = await isMobileDevice();
|
53
53
|
|
54
54
|
const dynamicScale = isMobile ? { maximumScale: 1, userScalable: false } : {};
|
55
55
|
|
@@ -9,8 +9,8 @@ interface ServerLayoutProps<T> {
|
|
9
9
|
|
10
10
|
const ServerLayout =
|
11
11
|
<T extends PropsWithChildren>({ Desktop, Mobile }: ServerLayoutProps<T>): FC<T> =>
|
12
|
-
(props: T) => {
|
13
|
-
const mobile = isMobileDevice();
|
12
|
+
async (props: T) => {
|
13
|
+
const mobile = await isMobileDevice();
|
14
14
|
return mobile ? <Mobile {...props} /> : <Desktop {...props} />;
|
15
15
|
};
|
16
16
|
|
@@ -68,7 +68,7 @@ const GlobalLayout = async ({ children }: PropsWithChildren) => {
|
|
68
68
|
// get default feature flags to use with ssr
|
69
69
|
const serverFeatureFlags = getServerFeatureFlagsValue();
|
70
70
|
const serverConfig = getServerGlobalConfig();
|
71
|
-
const isMobile = isMobileDevice();
|
71
|
+
const isMobile = await isMobileDevice();
|
72
72
|
return (
|
73
73
|
<StyleRegistry>
|
74
74
|
<Locale antdLocale={antdLocale} defaultLang={userLocale}>
|
@@ -4,12 +4,12 @@ import { UAParser } from 'ua-parser-js';
|
|
4
4
|
/**
|
5
5
|
* check mobile device in server
|
6
6
|
*/
|
7
|
-
export const isMobileDevice = () => {
|
7
|
+
export const isMobileDevice = async () => {
|
8
8
|
if (typeof process === 'undefined') {
|
9
9
|
throw new Error('[Server method] you are importing a server-only module outside of server');
|
10
10
|
}
|
11
11
|
|
12
|
-
const { get } = headers();
|
12
|
+
const { get } = await headers();
|
13
13
|
const ua = get('user-agent');
|
14
14
|
|
15
15
|
// console.debug(ua);
|
@@ -21,15 +21,14 @@ export const isMobileDevice = () => {
|
|
21
21
|
/**
|
22
22
|
* check mobile device in server
|
23
23
|
*/
|
24
|
-
export const gerServerDeviceInfo = () => {
|
24
|
+
export const gerServerDeviceInfo = async () => {
|
25
25
|
if (typeof process === 'undefined') {
|
26
26
|
throw new Error('[Server method] you are importing a server-only module outside of server');
|
27
27
|
}
|
28
28
|
|
29
|
-
const { get } = headers();
|
29
|
+
const { get } = await headers();
|
30
30
|
const ua = get('user-agent');
|
31
31
|
|
32
|
-
// console.debug(ua);
|
33
32
|
const parser = new UAParser(ua || '');
|
34
33
|
|
35
34
|
return {
|