@lobehub/chat 0.142.2 → 0.142.4
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 +42 -0
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +1 -1
- package/package.json +3 -3
- package/src/app/chat/(desktop)/features/ChatHeader/HeaderAction.tsx +2 -2
- package/src/app/chat/(desktop)/index.tsx +12 -23
- package/src/app/chat/(mobile)/features/SessionHeader.tsx +2 -0
- package/src/app/chat/(mobile)/index.tsx +4 -7
- package/src/app/chat/(mobile)/{features/ChatHeader.tsx → mobile/ChatHeader/index.tsx} +2 -2
- package/src/app/chat/(mobile)/mobile/page.tsx +4 -4
- package/src/app/chat/{(desktop)/features → _layout/Desktop}/SessionList.tsx +2 -0
- package/src/app/chat/{(desktop)/layout.desktop.tsx → _layout/Desktop/index.tsx} +7 -6
- package/src/app/chat/_layout/Mobile/index.tsx +7 -0
- package/src/app/chat/features/{ChatHeader/ShareButton → ShareButton}/Preview.tsx +1 -1
- package/src/app/chat/layout.ts +8 -0
- package/src/app/chat/page.tsx +2 -0
- package/src/app/chat/settings/(desktop)/index.tsx +13 -19
- package/src/app/chat/settings/(mobile)/{features/Header.tsx → Header.tsx} +4 -1
- package/src/app/chat/settings/(mobile)/index.tsx +4 -3
- package/src/app/layout.tsx +7 -12
- package/src/app/market/(desktop)/index.tsx +8 -16
- package/src/app/market/(mobile)/index.tsx +12 -7
- package/src/app/market/_layout/Desktop/index.tsx +59 -0
- package/src/app/market/_layout/Mobile/Header.tsx +20 -0
- package/src/app/market/_layout/Mobile/index.tsx +14 -0
- package/src/app/market/layout.ts +8 -0
- package/src/app/settings/(desktop)/index.tsx +8 -10
- package/src/app/settings/(mobile)/index.tsx +53 -1
- package/src/app/settings/{(desktop)/features → _layout/Desktop}/Header.tsx +8 -3
- package/src/app/settings/{(desktop)/features → _layout/Desktop}/SideBar.tsx +8 -3
- package/src/app/settings/_layout/Desktop/index.tsx +27 -0
- package/src/app/settings/{(mobile)/features/Header/index.tsx → _layout/Mobile/SubSettingHeader.tsx} +9 -8
- package/src/app/settings/_layout/Mobile/index.tsx +23 -0
- package/src/app/settings/layout.ts +8 -0
- package/src/app/settings/page.tsx +4 -2
- package/src/app/welcome/(desktop)/index.tsx +9 -17
- package/src/app/welcome/(mobile)/index.tsx +12 -6
- package/src/app/welcome/_layout/Desktop.tsx +29 -0
- package/src/app/welcome/_layout/Mobile.tsx +9 -0
- package/src/app/welcome/layout.ts +8 -0
- package/src/components/client/ClientResponsiveContent/index.tsx +32 -0
- package/src/components/client/ClientResponsiveLayout.tsx +32 -0
- package/src/components/server/ServerLayout.tsx +20 -0
- package/src/features/AvatarWithUpload/index.tsx +12 -9
- package/src/features/MobileSwitchLoading/index.tsx +2 -0
- package/src/hooks/useActiveSettingsKey.ts +16 -0
- package/src/hooks/useActiveTabKey.ts +12 -0
- package/src/hooks/useIsSubSlug.ts +12 -0
- package/src/layout/AuthProvider/index.tsx +16 -0
- package/src/layout/{AppLayout.desktop.tsx → GlobalLayout/Desktop/Client.tsx} +11 -9
- package/src/layout/GlobalLayout/Desktop/index.tsx +16 -0
- package/src/layout/{AppLayout.mobile.tsx → GlobalLayout/Mobile/Client.tsx} +2 -16
- package/src/layout/GlobalLayout/Mobile/index.tsx +25 -0
- package/src/layout/GlobalLayout/index.tsx +8 -0
- package/src/styles/mobileHeader.ts +7 -0
- package/src/app/chat/settings/(desktop)/layout.desktop.tsx +0 -18
- package/src/app/chat/settings/(mobile)/layout.mobile.tsx +0 -9
- package/src/app/market/(desktop)/layout.desktop.tsx +0 -65
- package/src/app/market/(mobile)/features/Header.tsx +0 -10
- package/src/app/market/(mobile)/layout.mobile.tsx +0 -25
- package/src/app/settings/(desktop)/layout.desktop.tsx +0 -35
- package/src/app/settings/(desktop)/layout.responsive.tsx +0 -21
- package/src/app/settings/(mobile)/features/Header/Home.tsx +0 -8
- package/src/app/settings/(mobile)/layout.mobile.tsx +0 -21
- package/src/app/settings/(mobile)/mobile/index.tsx +0 -54
- package/src/app/settings/(mobile)/mobile/layout.mobile.tsx +0 -14
- package/src/app/settings/about/layout.tsx +0 -9
- package/src/app/settings/agent/layout.tsx +0 -9
- package/src/app/settings/common/layout.tsx +0 -9
- package/src/app/settings/layout.server.tsx +0 -19
- package/src/app/settings/llm/layout.tsx +0 -9
- package/src/app/settings/sync/layout.tsx +0 -9
- package/src/app/settings/tts/layout.tsx +0 -9
- package/src/app/welcome/(desktop)/layout.desktop.tsx +0 -31
- package/src/app/welcome/(mobile)/features/Header.tsx +0 -6
- package/src/app/welcome/(mobile)/features/Showcase.tsx +0 -16
- package/src/app/welcome/(mobile)/layout.mobile.tsx +0 -20
- package/src/components/ResponsiveContainer/index.tsx +0 -20
- package/src/layout/ServerResponsiveLayout/Client.tsx +0 -23
- package/src/layout/ServerResponsiveLayout/index.tsx +0 -21
- /package/src/app/chat/(mobile)/{features → mobile/ChatHeader}/ChatHeaderTitle.tsx +0 -0
- /package/src/app/chat/{(desktop)/features → _layout/Desktop}/SessionHeader.tsx +0 -0
- /package/src/app/chat/features/{ChatHeader/SettingButton.tsx → SettingButton.tsx} +0 -0
- /package/src/app/chat/features/{ChatHeader/ShareButton → ShareButton}/ShareModal.tsx +0 -0
- /package/src/app/chat/features/{ChatHeader/ShareButton → ShareButton}/index.tsx +0 -0
- /package/src/app/chat/features/{ChatHeader/ShareButton → ShareButton}/style.ts +0 -0
- /package/src/app/chat/features/{ChatHeader/ShareButton → ShareButton}/type.ts +0 -0
- /package/src/app/chat/features/{ChatHeader/ShareButton → ShareButton}/useScreenshot.ts +0 -0
- /package/src/app/chat/settings/(desktop)/{features/Header.tsx → Header.tsx} +0 -0
- /package/src/app/market/{(desktop)/features → _layout/Desktop}/AgentDetail.tsx +0 -0
- /package/src/app/market/{(desktop)/features → _layout/Desktop}/Header.tsx +0 -0
- /package/src/{features → layout/GlobalLayout/Desktop}/SideBar/BottomActions.tsx +0 -0
- /package/src/{features → layout/GlobalLayout/Desktop}/SideBar/TopActions.tsx +0 -0
- /package/src/{features → layout/GlobalLayout/Desktop}/SideBar/index.tsx +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.142.4](https://github.com/lobehub/lobe-chat/compare/v0.142.3...v0.142.4)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-03-26**</sup>
|
|
8
|
+
|
|
9
|
+
<br/>
|
|
10
|
+
|
|
11
|
+
<details>
|
|
12
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
13
|
+
|
|
14
|
+
</details>
|
|
15
|
+
|
|
16
|
+
<div align="right">
|
|
17
|
+
|
|
18
|
+
[](#readme-top)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
### [Version 0.142.3](https://github.com/lobehub/lobe-chat/compare/v0.142.2...v0.142.3)
|
|
23
|
+
|
|
24
|
+
<sup>Released on **2024-03-26**</sup>
|
|
25
|
+
|
|
26
|
+
#### 🐛 Bug Fixes
|
|
27
|
+
|
|
28
|
+
- **misc**: Pin `next-auth` temporary to fix build error.
|
|
29
|
+
|
|
30
|
+
<br/>
|
|
31
|
+
|
|
32
|
+
<details>
|
|
33
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
34
|
+
|
|
35
|
+
#### What's fixed
|
|
36
|
+
|
|
37
|
+
- **misc**: Pin `next-auth` temporary to fix build error, closes [#1739](https://github.com/lobehub/lobe-chat/issues/1739) ([e9ece9f](https://github.com/lobehub/lobe-chat/commit/e9ece9f))
|
|
38
|
+
|
|
39
|
+
</details>
|
|
40
|
+
|
|
41
|
+
<div align="right">
|
|
42
|
+
|
|
43
|
+
[](#readme-top)
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
5
47
|
### [Version 0.142.2](https://github.com/lobehub/lobe-chat/compare/v0.142.1...v0.142.2)
|
|
6
48
|
|
|
7
49
|
<sup>Released on **2024-03-25**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.142.
|
|
3
|
+
"version": "0.142.4",
|
|
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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@ant-design/icons": "^5",
|
|
82
82
|
"@anthropic-ai/sdk": "^0.18.0",
|
|
83
|
-
"@auth/core": "
|
|
83
|
+
"@auth/core": "0.28.0",
|
|
84
84
|
"@aws-sdk/client-bedrock-runtime": "^3.525.0",
|
|
85
85
|
"@azure/openai": "^1.0.0-beta.11",
|
|
86
86
|
"@cfworker/json-schema": "^1",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"modern-screenshot": "^4",
|
|
120
120
|
"nanoid": "^5",
|
|
121
121
|
"next": "^14.1",
|
|
122
|
-
"next-auth": "beta",
|
|
122
|
+
"next-auth": "5.0.0-beta.15",
|
|
123
123
|
"next-sitemap": "^4",
|
|
124
124
|
"numeral": "^2",
|
|
125
125
|
"nuqs": "^1",
|
|
@@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
|
7
7
|
import { useGlobalStore } from '@/store/global';
|
|
8
8
|
|
|
9
|
-
import SettingButton from '../../../features/
|
|
10
|
-
import ShareButton from '../../../features/
|
|
9
|
+
import SettingButton from '../../../features/SettingButton';
|
|
10
|
+
import ShareButton from '../../../features/ShareButton';
|
|
11
11
|
|
|
12
12
|
const HeaderAction = memo(() => {
|
|
13
13
|
const { t } = useTranslation('chat');
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { FC, memo } from 'react';
|
|
3
|
+
import { memo } from 'react';
|
|
5
4
|
import { Flexbox } from 'react-layout-kit';
|
|
6
5
|
|
|
7
|
-
import
|
|
8
|
-
import MobileSwitchLoading from '@/features/MobileSwitchLoading';
|
|
6
|
+
import ClientResponsiveContent from '@/components/client/ClientResponsiveContent';
|
|
9
7
|
|
|
10
|
-
import PageTitle from '../features/PageTitle';
|
|
11
8
|
import ChatHeader from './features/ChatHeader';
|
|
12
9
|
import Conversation from './features/Conversation';
|
|
13
10
|
import SideBar from './features/SideBar';
|
|
14
|
-
import Layout from './layout.desktop';
|
|
15
11
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<PageTitle />
|
|
25
|
-
<ChatHeader />
|
|
26
|
-
<Flexbox flex={1} height={'calc(100% - 64px)'} horizontal>
|
|
27
|
-
<Conversation />
|
|
28
|
-
<SideBar />
|
|
29
|
-
</Flexbox>
|
|
30
|
-
</Layout>
|
|
31
|
-
</ResponsiveContainer>
|
|
12
|
+
const Desktop = memo(() => (
|
|
13
|
+
<>
|
|
14
|
+
<ChatHeader />
|
|
15
|
+
<Flexbox flex={1} height={'calc(100% - 64px)'} horizontal>
|
|
16
|
+
<Conversation />
|
|
17
|
+
<SideBar />
|
|
18
|
+
</Flexbox>
|
|
19
|
+
</>
|
|
32
20
|
));
|
|
33
|
-
|
|
21
|
+
|
|
22
|
+
export default ClientResponsiveContent({ Desktop, Mobile: () => import('../(mobile)') });
|
|
@@ -10,6 +10,7 @@ import SyncStatusInspector from '@/features/SyncStatusInspector';
|
|
|
10
10
|
import { useGlobalStore } from '@/store/global';
|
|
11
11
|
import { commonSelectors } from '@/store/global/selectors';
|
|
12
12
|
import { useSessionStore } from '@/store/session';
|
|
13
|
+
import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
13
14
|
|
|
14
15
|
export const useStyles = createStyles(({ css, token }) => ({
|
|
15
16
|
logo: css`
|
|
@@ -43,6 +44,7 @@ const Header = memo(() => {
|
|
|
43
44
|
size={MOBILE_HEADER_ICON_SIZE}
|
|
44
45
|
/>
|
|
45
46
|
}
|
|
47
|
+
style={mobileHeaderSticky}
|
|
46
48
|
/>
|
|
47
49
|
);
|
|
48
50
|
});
|
|
@@ -3,25 +3,22 @@
|
|
|
3
3
|
import { useRouter } from 'next/navigation';
|
|
4
4
|
import { memo, useEffect } from 'react';
|
|
5
5
|
|
|
6
|
-
import AppLayoutMobile from '@/layout/AppLayout.mobile';
|
|
7
|
-
import { SidebarTabKey } from '@/store/global/initialState';
|
|
8
|
-
|
|
9
|
-
import PageTitle from '../features/PageTitle';
|
|
10
6
|
import SessionHeader from './features/SessionHeader';
|
|
11
7
|
import SessionList from './features/SessionList';
|
|
12
8
|
|
|
13
9
|
const ChatMobilePage = memo(() => {
|
|
14
10
|
const router = useRouter();
|
|
11
|
+
|
|
15
12
|
useEffect(() => {
|
|
16
13
|
router.prefetch('/chat/mobile');
|
|
17
14
|
router.prefetch('/settings');
|
|
18
15
|
}, []);
|
|
19
16
|
|
|
20
17
|
return (
|
|
21
|
-
|
|
22
|
-
<
|
|
18
|
+
<>
|
|
19
|
+
<SessionHeader />
|
|
23
20
|
<SessionList />
|
|
24
|
-
|
|
21
|
+
</>
|
|
25
22
|
);
|
|
26
23
|
});
|
|
27
24
|
|
|
@@ -2,8 +2,8 @@ import { MobileNavBar } from '@lobehub/ui';
|
|
|
2
2
|
import { useRouter } from 'next/navigation';
|
|
3
3
|
import { memo, useState } from 'react';
|
|
4
4
|
|
|
5
|
-
import SettingButton from '
|
|
6
|
-
import ShareButton from '
|
|
5
|
+
import SettingButton from '../../../features/SettingButton';
|
|
6
|
+
import ShareButton from '../../../features/ShareButton';
|
|
7
7
|
import ChatHeaderTitle from './ChatHeaderTitle';
|
|
8
8
|
|
|
9
9
|
const MobileHeader = memo(() => {
|
|
@@ -4,13 +4,12 @@ import dynamic from 'next/dynamic';
|
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
6
|
|
|
7
|
-
import ChatHeader from '@/app/chat/(mobile)/features/ChatHeader';
|
|
8
7
|
import Conversation from '@/features/Conversation';
|
|
9
|
-
import AppLayoutMobile from '@/layout/AppLayout.mobile';
|
|
10
8
|
import { useSessionStore } from '@/store/session';
|
|
11
9
|
|
|
12
10
|
import TelemetryNotification from '../../features/TelemetryNotification';
|
|
13
11
|
import ChatInput from '../features/ChatInput';
|
|
12
|
+
import ChatHeader from './ChatHeader';
|
|
14
13
|
|
|
15
14
|
const TopicList = dynamic(() => import('../features/TopicList'));
|
|
16
15
|
|
|
@@ -21,13 +20,14 @@ const Chat = memo(() => {
|
|
|
21
20
|
useFetchSessions();
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
|
-
|
|
23
|
+
<>
|
|
24
|
+
<ChatHeader />
|
|
25
25
|
<Flexbox height={'calc(100% - 44px)'} horizontal>
|
|
26
26
|
<Conversation chatInput={<ChatInput />} mobile />
|
|
27
27
|
<TopicList />
|
|
28
28
|
<TelemetryNotification mobile />
|
|
29
29
|
</Flexbox>
|
|
30
|
-
|
|
30
|
+
</>
|
|
31
31
|
);
|
|
32
32
|
});
|
|
33
33
|
export default Chat;
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
import { PropsWithChildren, memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import { SidebarTabKey } from '@/store/global/initialState';
|
|
6
|
+
import ClientResponsiveLayout from '@/components/client/ClientResponsiveLayout';
|
|
8
7
|
|
|
9
|
-
import ResponsiveSessionList from './
|
|
8
|
+
import ResponsiveSessionList from './SessionList';
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
const Desktop = memo(({ children }: PropsWithChildren) => {
|
|
12
11
|
return (
|
|
13
|
-
|
|
12
|
+
<>
|
|
14
13
|
<ResponsiveSessionList />
|
|
15
14
|
<Flexbox
|
|
16
15
|
flex={1}
|
|
@@ -20,6 +19,8 @@ export default memo(({ children }: PropsWithChildren) => {
|
|
|
20
19
|
>
|
|
21
20
|
{children}
|
|
22
21
|
</Flexbox>
|
|
23
|
-
|
|
22
|
+
</>
|
|
24
23
|
);
|
|
25
24
|
});
|
|
25
|
+
|
|
26
|
+
export default ClientResponsiveLayout({ Desktop, Mobile: () => import('../Mobile') });
|
|
@@ -9,7 +9,7 @@ import ChatList from '@/features/Conversation/components/ChatList';
|
|
|
9
9
|
import { useSessionStore } from '@/store/session';
|
|
10
10
|
import { agentSelectors, sessionSelectors } from '@/store/session/selectors';
|
|
11
11
|
|
|
12
|
-
import PluginTag from '
|
|
12
|
+
import PluginTag from '../PluginTag';
|
|
13
13
|
import { useStyles } from './style';
|
|
14
14
|
import { FieldType } from './type';
|
|
15
15
|
|
package/src/app/chat/page.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import DesktopPage from './(desktop)';
|
|
|
4
4
|
import MobilePage from './(mobile)';
|
|
5
5
|
import SessionHydration from './components/SessionHydration';
|
|
6
6
|
import Migration from './features/Migration';
|
|
7
|
+
import PageTitle from './features/PageTitle';
|
|
7
8
|
|
|
8
9
|
const Page = () => {
|
|
9
10
|
const mobile = isMobileDevice();
|
|
@@ -13,6 +14,7 @@ const Page = () => {
|
|
|
13
14
|
return (
|
|
14
15
|
<>
|
|
15
16
|
<Migration>
|
|
17
|
+
<PageTitle />
|
|
16
18
|
<Page />
|
|
17
19
|
</Migration>
|
|
18
20
|
<SessionHydration />
|
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import SafeSpacing from '@/components/SafeSpacing';
|
|
7
|
+
import ClientResponsiveContent from '@/components/client/ClientResponsiveContent';
|
|
8
|
+
import { HEADER_HEIGHT } from '@/const/layoutTokens';
|
|
9
9
|
|
|
10
10
|
import EditPage from '../features/EditPage';
|
|
11
|
-
import
|
|
11
|
+
import Header from './Header';
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
loading: MobileSwitchLoading,
|
|
15
|
-
ssr: false,
|
|
16
|
-
}) as FC;
|
|
17
|
-
|
|
18
|
-
const ChatSettings = memo(() => (
|
|
13
|
+
const Desktop = memo(() => (
|
|
19
14
|
<>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
<SessionHydration />
|
|
15
|
+
<Header />
|
|
16
|
+
<Flexbox align={'center'} flex={1} gap={16} padding={24} style={{ overflow: 'scroll' }}>
|
|
17
|
+
<SafeSpacing height={HEADER_HEIGHT - 16} />
|
|
18
|
+
<EditPage />
|
|
19
|
+
</Flexbox>
|
|
26
20
|
</>
|
|
27
21
|
));
|
|
28
22
|
|
|
29
|
-
export default
|
|
23
|
+
export default ClientResponsiveContent({ Desktop, Mobile: () => import('../(mobile)') });
|
|
@@ -3,9 +3,11 @@ import { useRouter } from 'next/navigation';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
7
7
|
import { pathString } from '@/utils/url';
|
|
8
8
|
|
|
9
|
+
import HeaderContent from '../features/HeaderContent';
|
|
10
|
+
|
|
9
11
|
const Header = memo(() => {
|
|
10
12
|
const { t } = useTranslation('setting');
|
|
11
13
|
const router = useRouter();
|
|
@@ -16,6 +18,7 @@ const Header = memo(() => {
|
|
|
16
18
|
onBackClick={() => router.push(pathString('/chat/mobile', { search: location.search }))}
|
|
17
19
|
right={<HeaderContent />}
|
|
18
20
|
showBackButton
|
|
21
|
+
style={mobileHeaderSticky}
|
|
19
22
|
/>
|
|
20
23
|
);
|
|
21
24
|
});
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
|
|
5
5
|
import EditPage from '../features/EditPage';
|
|
6
|
-
import
|
|
6
|
+
import Header from './Header';
|
|
7
7
|
|
|
8
8
|
const ChatSettings = memo(() => (
|
|
9
|
-
|
|
9
|
+
<>
|
|
10
|
+
<Header />
|
|
10
11
|
<EditPage />
|
|
11
|
-
|
|
12
|
+
</>
|
|
12
13
|
));
|
|
13
14
|
|
|
14
15
|
export default ChatSettings;
|
package/src/app/layout.tsx
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
import { SpeedInsights } from '@vercel/speed-insights/next';
|
|
2
2
|
import { ResolvingViewport } from 'next';
|
|
3
|
-
import { SessionProvider } from 'next-auth/react';
|
|
4
3
|
import { cookies } from 'next/headers';
|
|
5
4
|
import { PropsWithChildren } from 'react';
|
|
6
5
|
import { isRtlLang } from 'rtl-detect';
|
|
7
6
|
|
|
8
7
|
import Analytics from '@/components/Analytics';
|
|
9
|
-
import { getServerConfig } from '@/config/server';
|
|
10
8
|
import { DEFAULT_LANG, LOBE_LOCALE_COOKIE } from '@/const/locale';
|
|
9
|
+
import AuthProvider from '@/layout/AuthProvider';
|
|
10
|
+
import GlobalLayout from '@/layout/GlobalLayout';
|
|
11
11
|
import GlobalProvider from '@/layout/GlobalProvider';
|
|
12
|
-
import { API_ENDPOINTS } from '@/services/_url';
|
|
13
12
|
import { isMobileDevice } from '@/utils/responsive';
|
|
14
13
|
|
|
15
|
-
const { ENABLE_OAUTH_SSO = false } = getServerConfig();
|
|
16
|
-
|
|
17
14
|
const RootLayout = async ({ children }: PropsWithChildren) => {
|
|
18
15
|
const cookieStore = cookies();
|
|
19
16
|
|
|
20
17
|
const lang = cookieStore.get(LOBE_LOCALE_COOKIE);
|
|
21
18
|
const direction = isRtlLang(lang?.value || DEFAULT_LANG) ? 'rtl' : 'ltr';
|
|
22
19
|
|
|
23
|
-
const content = ENABLE_OAUTH_SSO ? (
|
|
24
|
-
<SessionProvider basePath={API_ENDPOINTS.oauth}>{children}</SessionProvider>
|
|
25
|
-
) : (
|
|
26
|
-
children
|
|
27
|
-
);
|
|
28
|
-
|
|
29
20
|
return (
|
|
30
21
|
<html dir={direction} lang={lang?.value || DEFAULT_LANG} suppressHydrationWarning>
|
|
31
22
|
<body>
|
|
32
|
-
<GlobalProvider>
|
|
23
|
+
<GlobalProvider>
|
|
24
|
+
<AuthProvider>
|
|
25
|
+
<GlobalLayout>{children}</GlobalLayout>
|
|
26
|
+
</AuthProvider>
|
|
27
|
+
</GlobalProvider>
|
|
33
28
|
<Analytics />
|
|
34
29
|
<SpeedInsights />
|
|
35
30
|
</body>
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { SpotlightCard, SpotlightCardProps } from '@lobehub/ui';
|
|
4
|
-
import dynamic from 'next/dynamic';
|
|
5
4
|
import { FC, memo } from 'react';
|
|
6
5
|
|
|
7
|
-
import
|
|
8
|
-
import MobileSwitchLoading from '@/features/MobileSwitchLoading';
|
|
6
|
+
import ClientResponsiveContent from '@/components/client/ClientResponsiveContent';
|
|
9
7
|
|
|
10
8
|
import AgentCard from '../features/AgentCard';
|
|
11
9
|
import Index from '../index';
|
|
12
|
-
import Layout from './layout.desktop';
|
|
13
10
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export default memo(() => (
|
|
20
|
-
<ResponsiveContainer Mobile={Mobile}>
|
|
21
|
-
<Layout>
|
|
22
|
-
<Index />
|
|
23
|
-
<AgentCard CardRender={SpotlightCard as FC<SpotlightCardProps>} />
|
|
24
|
-
</Layout>
|
|
25
|
-
</ResponsiveContainer>
|
|
11
|
+
const Desktop = memo(() => (
|
|
12
|
+
<>
|
|
13
|
+
<Index />
|
|
14
|
+
<AgentCard CardRender={SpotlightCard as FC<SpotlightCardProps>} />
|
|
15
|
+
</>
|
|
26
16
|
));
|
|
17
|
+
|
|
18
|
+
export default ClientResponsiveContent({ Desktop, Mobile: () => import('../(mobile)') });
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
3
4
|
import { memo } from 'react';
|
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
|
4
6
|
|
|
5
|
-
import AgentCard from '
|
|
6
|
-
|
|
7
|
+
import AgentCard from '../features/AgentCard';
|
|
7
8
|
import Index from '../index';
|
|
8
9
|
import CardRender from './features/AgentCard';
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
const DetailModal = dynamic(() => import('./features/AgentDetail'), { ssr: false });
|
|
10
12
|
|
|
11
13
|
export default memo(() => (
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
<>
|
|
15
|
+
<Flexbox flex={1} gap={16} style={{ padding: 16 }}>
|
|
16
|
+
<Index />
|
|
17
|
+
<AgentCard CardRender={CardRender} mobile />{' '}
|
|
18
|
+
</Flexbox>
|
|
19
|
+
<DetailModal />
|
|
20
|
+
</>
|
|
16
21
|
));
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { GridBackground } from '@lobehub/ui';
|
|
4
|
+
import { createStyles } from 'antd-style';
|
|
5
|
+
import dynamic from 'next/dynamic';
|
|
6
|
+
import { PropsWithChildren, memo } from 'react';
|
|
7
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
|
8
|
+
|
|
9
|
+
import SafeSpacing from '@/components/SafeSpacing';
|
|
10
|
+
import ClientResponsiveLayout from '@/components/client/ClientResponsiveLayout';
|
|
11
|
+
import { MAX_WIDTH } from '@/const/layoutTokens';
|
|
12
|
+
|
|
13
|
+
import Header from './Header';
|
|
14
|
+
|
|
15
|
+
const SideBar = dynamic(() => import('./AgentDetail'));
|
|
16
|
+
|
|
17
|
+
const useStyles = createStyles(({ css }) => ({
|
|
18
|
+
background: css`
|
|
19
|
+
width: 80%;
|
|
20
|
+
margin: -60px 0 -20px;
|
|
21
|
+
`,
|
|
22
|
+
title: css`
|
|
23
|
+
z-index: 2;
|
|
24
|
+
margin-top: 24px;
|
|
25
|
+
font-size: 56px;
|
|
26
|
+
font-weight: 800;
|
|
27
|
+
`,
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
const Desktop = memo<PropsWithChildren>(({ children }) => {
|
|
31
|
+
const { theme, styles } = useStyles();
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Flexbox flex={1} height={'100%'} id={'lobe-market-container'} style={{ position: 'relative' }}>
|
|
35
|
+
<Header />
|
|
36
|
+
<Flexbox flex={1} height={'calc(100% - 64px)'} horizontal>
|
|
37
|
+
<Flexbox align={'center'} flex={1} style={{ overflow: 'scroll', padding: 16 }}>
|
|
38
|
+
<SafeSpacing />
|
|
39
|
+
|
|
40
|
+
<Flexbox gap={16} style={{ maxWidth: MAX_WIDTH, position: 'relative', width: '100%' }}>
|
|
41
|
+
<Center>
|
|
42
|
+
<h1 className={styles.title}>Find & Use The Best Agents</h1>
|
|
43
|
+
<GridBackground
|
|
44
|
+
animation
|
|
45
|
+
className={styles.background}
|
|
46
|
+
colorFront={theme.colorText}
|
|
47
|
+
random
|
|
48
|
+
/>
|
|
49
|
+
</Center>
|
|
50
|
+
{children}
|
|
51
|
+
</Flexbox>
|
|
52
|
+
</Flexbox>
|
|
53
|
+
<SideBar />
|
|
54
|
+
</Flexbox>
|
|
55
|
+
</Flexbox>
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export default ClientResponsiveLayout({ Desktop, Mobile: () => import('../Mobile') });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Logo, MobileNavBar } from '@lobehub/ui';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
|
|
6
|
+
import { mobileHeaderSticky } from '@/styles/mobileHeader';
|
|
7
|
+
|
|
8
|
+
import ShareAgentButton from '../../features/ShareAgentButton';
|
|
9
|
+
|
|
10
|
+
const Header = memo(() => {
|
|
11
|
+
return (
|
|
12
|
+
<MobileNavBar
|
|
13
|
+
center={<Logo type={'text'} />}
|
|
14
|
+
right={<ShareAgentButton mobile />}
|
|
15
|
+
style={mobileHeaderSticky}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default Header;
|
|
@@ -3,23 +3,21 @@
|
|
|
3
3
|
import dynamic from 'next/dynamic';
|
|
4
4
|
import { FC, memo } from 'react';
|
|
5
5
|
|
|
6
|
-
import ResponsiveContainer from '@/components/ResponsiveContainer';
|
|
7
6
|
import MobileSwitchLoading from '@/features/MobileSwitchLoading';
|
|
8
|
-
import {
|
|
7
|
+
import { useIsMobile } from '@/hooks/useIsMobile';
|
|
9
8
|
|
|
10
9
|
import Common from '../common';
|
|
11
10
|
import { SettingsCommonProps } from '../common/Common';
|
|
12
|
-
import DesktopLayout from './layout.desktop';
|
|
13
11
|
|
|
14
12
|
const Mobile: FC = dynamic(() => import('../(mobile)'), {
|
|
15
13
|
loading: MobileSwitchLoading,
|
|
16
14
|
ssr: false,
|
|
17
15
|
}) as FC;
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const Desktop = memo<SettingsCommonProps>((props) => {
|
|
18
|
+
const mobile = useIsMobile();
|
|
19
|
+
|
|
20
|
+
return mobile ? <Mobile /> : <Common {...props} />;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default Desktop;
|