@lobehub/chat 0.70.2 → 0.70.3
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 +1 -1
- package/src/const/url.ts +2 -0
- package/src/features/MobileTabBar/index.tsx +4 -12
- package/src/features/SideBar/BottomActions.tsx +12 -2
- package/src/features/SideBar/TopActions.tsx +7 -1
- package/src/layout/AppMobileLayout.tsx +11 -8
- package/src/pages/chat/features/Conversation/Input/index.tsx +4 -3
- package/src/pages/chat/features/Header/Mobile.tsx +1 -1
- package/src/pages/chat/features/Header/index.tsx +3 -4
- package/src/pages/chat/features/SessionList/Desktop.tsx +24 -0
- package/src/pages/chat/features/SessionList/{Header.tsx → Header/Desktop.tsx} +2 -26
- package/src/pages/chat/features/SessionList/Header/Mobile.tsx +42 -0
- package/src/pages/chat/features/SessionList/Header/index.tsx +14 -0
- package/src/pages/chat/features/SessionList/Mobile.tsx +26 -0
- package/src/pages/chat/features/SessionList/index.tsx +11 -25
- package/src/pages/chat/features/Sidebar/Desktop.tsx +58 -0
- package/src/pages/chat/features/Sidebar/{SystemRole.tsx → SystemRole/index.tsx} +3 -37
- package/src/pages/chat/features/Sidebar/SystemRole/style.ts +36 -0
- package/src/pages/chat/features/Sidebar/index.tsx +20 -78
- package/src/pages/chat/index.page.tsx +14 -13
- package/src/pages/chat/{mobile.tsx → layout.mobile.tsx} +2 -8
- package/src/pages/chat/layout.tsx +8 -13
- package/src/pages/chat/mobile/index.page.tsx +1 -1
- package/src/pages/chat/setting/features/Header/Desktop.tsx +21 -0
- package/src/pages/chat/setting/features/Header/Mobile.tsx +19 -0
- package/src/pages/chat/setting/features/Header/index.tsx +57 -0
- package/src/pages/chat/setting/index.page.tsx +5 -21
- package/src/pages/chat/setting/layout.mobile.tsx +18 -0
- package/src/pages/chat/setting/layout.tsx +22 -0
- package/src/pages/market/features/Header/Desktop.tsx +54 -0
- package/src/pages/market/features/Header/Mobile.tsx +42 -0
- package/src/pages/market/features/Header/index.tsx +13 -0
- package/src/pages/market/index.page.tsx +30 -0
- package/src/pages/market/layout.mobile.tsx +19 -0
- package/src/pages/market/layout.tsx +23 -0
- package/src/pages/settings/{Header.tsx → features/Header/Desktop.tsx} +2 -2
- package/src/pages/settings/features/Header/Mobile.tsx +18 -0
- package/src/pages/settings/features/Header/index.tsx +14 -0
- package/src/pages/settings/{Settings → features/Settings}/index.tsx +1 -2
- package/src/pages/settings/index.page.tsx +8 -21
- package/src/pages/settings/layout.mobile.tsx +18 -0
- package/src/pages/settings/layout.tsx +8 -1
- package/src/pages/welcome/{Banner → features/Banner}/AgentTemplate.tsx +1 -1
- package/src/pages/welcome/{Banner → features/Banner}/Hero.tsx +1 -1
- package/src/pages/welcome/{Banner → features/Banner}/index.tsx +1 -1
- package/src/pages/welcome/index.page.tsx +3 -3
- package/src/pages/welcome/layout.tsx +1 -1
- package/src/pages/chat/setting/Header.tsx +0 -82
- package/src/pages/chat/setting/mobile.tsx +0 -11
- package/src/pages/settings/mobile.tsx +0 -20
- /package/src/pages/chat/features/Header/{PC.tsx → Desktop.tsx} +0 -0
- /package/src/pages/chat/features/Header/{PluginTag.tsx → PluginTag/index.tsx} +0 -0
- /package/src/pages/chat/features/Header/{ShareButton.tsx → ShareButton/index.tsx} +0 -0
- /package/src/pages/chat/features/SessionList/{CollapseGroup.tsx → CollapseGroup/index.tsx} +0 -0
- /package/src/pages/chat/features/SessionList/{Inbox.tsx → Inbox/index.tsx} +0 -0
- /package/src/pages/chat/features/Sidebar/{Header.tsx → SystemRole/Header.tsx} +0 -0
- /package/src/pages/settings/{Settings → features/Settings}/Agent.tsx +0 -0
- /package/src/pages/settings/{Settings → features/Settings}/Common.tsx +0 -0
- /package/src/pages/settings/{ThemeSwatches → features/ThemeSwatches}/ThemeSwatchesNeutral.tsx +0 -0
- /package/src/pages/settings/{ThemeSwatches → features/ThemeSwatches}/ThemeSwatchesPrimary.tsx +0 -0
- /package/src/pages/settings/{ThemeSwatches → features/ThemeSwatches}/index.ts +0 -0
- /package/src/pages/welcome/{Banner → features/Banner}/AgentCard.tsx +0 -0
- /package/src/pages/welcome/{style.ts → features/Banner/style.ts} +0 -0
- /package/src/pages/welcome/{Footer → features/Footer}/index.tsx +0 -0
- /package/src/pages/welcome/{mobile.tsx → layout.mobile.tsx} +0 -0
|
@@ -2,17 +2,14 @@ import { useResponsive } from 'antd-style';
|
|
|
2
2
|
import Head from 'next/head';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { Flexbox } from 'react-layout-kit';
|
|
6
5
|
|
|
7
|
-
import SafeSpacing from '@/components/SafeSpacing';
|
|
8
6
|
import { createI18nNext } from '@/locales/create';
|
|
9
7
|
import { useOnFinishHydrationGlobal, useSwitchSideBarOnInit } from '@/store/global';
|
|
10
8
|
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
11
9
|
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import Mobile from './mobile';
|
|
10
|
+
import Settings from './features/Settings';
|
|
11
|
+
import DesktopLayout from './layout';
|
|
12
|
+
import MobileLayout from './layout.mobile';
|
|
16
13
|
|
|
17
14
|
const initI18n = createI18nNext({ namespace: 'setting' });
|
|
18
15
|
|
|
@@ -21,6 +18,8 @@ const Setting = memo(() => {
|
|
|
21
18
|
const { t } = useTranslation('setting');
|
|
22
19
|
const pageTitle = genSiteHeadTitle(t('header.global'));
|
|
23
20
|
|
|
21
|
+
const RenderLayout = mobile ? MobileLayout : DesktopLayout;
|
|
22
|
+
|
|
24
23
|
useSwitchSideBarOnInit('settings');
|
|
25
24
|
|
|
26
25
|
useOnFinishHydrationGlobal(() => {
|
|
@@ -32,21 +31,9 @@ const Setting = memo(() => {
|
|
|
32
31
|
<Head>
|
|
33
32
|
<title>{pageTitle}</title>
|
|
34
33
|
</Head>
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
<Settings />
|
|
39
|
-
</Flexbox>
|
|
40
|
-
</Mobile>
|
|
41
|
-
) : (
|
|
42
|
-
<SettingLayout>
|
|
43
|
-
<Header />
|
|
44
|
-
<Flexbox align={'center'} flex={1} padding={24} style={{ overflow: 'auto' }}>
|
|
45
|
-
<SafeSpacing />
|
|
46
|
-
<Settings />
|
|
47
|
-
</Flexbox>
|
|
48
|
-
</SettingLayout>
|
|
49
|
-
)}
|
|
34
|
+
<RenderLayout>
|
|
35
|
+
<Settings />
|
|
36
|
+
</RenderLayout>
|
|
50
37
|
</>
|
|
51
38
|
);
|
|
52
39
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode, memo } from 'react';
|
|
2
|
+
import { Flexbox } from 'react-layout-kit';
|
|
3
|
+
|
|
4
|
+
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
5
|
+
|
|
6
|
+
import Header from './features/Header';
|
|
7
|
+
|
|
8
|
+
const SettingLayout = memo<{ children: ReactNode }>(({ children }) => {
|
|
9
|
+
return (
|
|
10
|
+
<AppMobileLayout navBar={<Header />}>
|
|
11
|
+
<Flexbox align={'center'} padding={16} style={{ overflow: 'auto' }}>
|
|
12
|
+
{children}
|
|
13
|
+
</Flexbox>
|
|
14
|
+
</AppMobileLayout>
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default SettingLayout;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { ReactNode, memo } from 'react';
|
|
2
2
|
import { Flexbox } from 'react-layout-kit';
|
|
3
3
|
|
|
4
|
+
import SafeSpacing from '@/components/SafeSpacing';
|
|
4
5
|
import AppLayout from '@/layout/AppLayout';
|
|
5
6
|
|
|
7
|
+
import Header from './features/Header';
|
|
8
|
+
|
|
6
9
|
const SettingLayout = memo<{ children: ReactNode }>(({ children }) => {
|
|
7
10
|
return (
|
|
8
11
|
<AppLayout>
|
|
9
12
|
<Flexbox flex={1} height={'100vh'} style={{ position: 'relative' }}>
|
|
10
|
-
|
|
13
|
+
<Header />
|
|
14
|
+
<Flexbox align={'center'} flex={1} padding={24} style={{ overflow: 'auto' }}>
|
|
15
|
+
<SafeSpacing />
|
|
16
|
+
{children}
|
|
17
|
+
</Flexbox>
|
|
11
18
|
</Flexbox>
|
|
12
19
|
</AppLayout>
|
|
13
20
|
);
|
|
@@ -2,8 +2,8 @@ import { useResponsive } from 'antd-style';
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { Flexbox } from 'react-layout-kit';
|
|
4
4
|
|
|
5
|
-
import { useStyles } from '../style';
|
|
6
5
|
import AgentCard, { type AgentCardProps } from './AgentCard';
|
|
6
|
+
import { useStyles } from './style';
|
|
7
7
|
|
|
8
8
|
const items: AgentCardProps['meta'][] = [
|
|
9
9
|
{
|
|
@@ -3,7 +3,7 @@ import { useResponsive } from 'antd-style';
|
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
|
-
import { genSize, useStyles } from '
|
|
6
|
+
import { genSize, useStyles } from './style';
|
|
7
7
|
|
|
8
8
|
const Hero = memo<{ width: number }>(({ width }) => {
|
|
9
9
|
const size = useMemo(
|
|
@@ -11,8 +11,8 @@ import { SESSION_CHAT_URL } from '@/const/url';
|
|
|
11
11
|
import { useImportConfig } from '@/hooks/useImportConfig';
|
|
12
12
|
import { useSessionStore } from '@/store/session';
|
|
13
13
|
|
|
14
|
-
import { useStyles } from '../style';
|
|
15
14
|
import Hero from './Hero';
|
|
15
|
+
import { useStyles } from './style';
|
|
16
16
|
|
|
17
17
|
const Banner = memo<{ mobile?: boolean }>(() => {
|
|
18
18
|
const { importConfig } = useImportConfig();
|
|
@@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
|
|
6
6
|
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
7
7
|
|
|
8
|
-
import Banner from './Banner';
|
|
9
|
-
import Footer from './Footer';
|
|
8
|
+
import Banner from './features/Banner';
|
|
9
|
+
import Footer from './features/Footer';
|
|
10
10
|
import Layout from './layout';
|
|
11
|
-
import Mobile from './mobile';
|
|
11
|
+
import Mobile from './layout.mobile';
|
|
12
12
|
|
|
13
13
|
const Welcome = memo(() => {
|
|
14
14
|
const { mobile } = useResponsive();
|
|
@@ -4,7 +4,7 @@ import { PropsWithChildren, memo } from 'react';
|
|
|
4
4
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
6
|
import AppLayout from '../../layout/AppLayout';
|
|
7
|
-
import { useStyles } from './style';
|
|
7
|
+
import { useStyles } from './features/Banner/style';
|
|
8
8
|
|
|
9
9
|
const WelcomeLayout = memo<PropsWithChildren>(({ children }) => {
|
|
10
10
|
const { styles } = useStyles();
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActionIcon,
|
|
3
|
-
ChatHeader,
|
|
4
|
-
ChatHeaderTitle,
|
|
5
|
-
MobileNavBar,
|
|
6
|
-
MobileNavBarTitle,
|
|
7
|
-
} from '@lobehub/ui';
|
|
8
|
-
import { Dropdown, MenuProps } from 'antd';
|
|
9
|
-
import { HardDriveDownload, Share2 } from 'lucide-react';
|
|
10
|
-
import { memo, useMemo } from 'react';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
|
|
13
|
-
import { exportSingleAgent, exportSingleSession } from '@/helpers/export';
|
|
14
|
-
import { useSessionStore } from '@/store/session';
|
|
15
|
-
|
|
16
|
-
const Header = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
17
|
-
const { t } = useTranslation('setting');
|
|
18
|
-
const [id, onBack] = useSessionStore((s) => [s.activeId, s.switchBackToChat]);
|
|
19
|
-
|
|
20
|
-
const items = useMemo<MenuProps['items']>(
|
|
21
|
-
() => [
|
|
22
|
-
{
|
|
23
|
-
key: 'agent',
|
|
24
|
-
label: <div>{t('exportType.agent', { ns: 'common' })}</div>,
|
|
25
|
-
onClick: () => {
|
|
26
|
-
if (!id) return;
|
|
27
|
-
|
|
28
|
-
exportSingleAgent(id);
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
key: 'agentWithMessage',
|
|
33
|
-
label: <div>{t('exportType.agentWithMessage', { ns: 'common' })}</div>,
|
|
34
|
-
onClick: () => {
|
|
35
|
-
if (!id) return;
|
|
36
|
-
|
|
37
|
-
exportSingleSession(id);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
[],
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
if (mobile)
|
|
45
|
-
return (
|
|
46
|
-
<MobileNavBar
|
|
47
|
-
center={<MobileNavBarTitle title={t('header.session')} />}
|
|
48
|
-
onBackClick={onBack}
|
|
49
|
-
right={
|
|
50
|
-
<>
|
|
51
|
-
<ActionIcon icon={Share2} title={t('share', { ns: 'common' })} />
|
|
52
|
-
<Dropdown arrow={false} menu={{ items }} trigger={['click']}>
|
|
53
|
-
<ActionIcon icon={HardDriveDownload} title={t('export', { ns: 'common' })} />
|
|
54
|
-
</Dropdown>
|
|
55
|
-
</>
|
|
56
|
-
}
|
|
57
|
-
showBackButton
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<ChatHeader
|
|
63
|
-
left={<ChatHeaderTitle title={t('header.session')} />}
|
|
64
|
-
onBackClick={onBack}
|
|
65
|
-
right={
|
|
66
|
-
<>
|
|
67
|
-
<ActionIcon icon={Share2} size={{ fontSize: 24 }} title={t('share', { ns: 'common' })} />
|
|
68
|
-
<Dropdown arrow={false} menu={{ items }} trigger={['click']}>
|
|
69
|
-
<ActionIcon
|
|
70
|
-
icon={HardDriveDownload}
|
|
71
|
-
size={{ fontSize: 24 }}
|
|
72
|
-
title={t('export', { ns: 'common' })}
|
|
73
|
-
/>
|
|
74
|
-
</Dropdown>
|
|
75
|
-
</>
|
|
76
|
-
}
|
|
77
|
-
showBackButton
|
|
78
|
-
/>
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export default Header;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, memo } from 'react';
|
|
2
|
-
|
|
3
|
-
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
4
|
-
|
|
5
|
-
import Header from './Header';
|
|
6
|
-
|
|
7
|
-
const MobileLayout = memo<PropsWithChildren>(({ children }) => {
|
|
8
|
-
return <AppMobileLayout navBar={<Header mobile />}>{children}</AppMobileLayout>;
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export default MobileLayout;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { MobileNavBar, MobileNavBarTitle } from '@lobehub/ui';
|
|
2
|
-
import { ReactNode, memo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
5
|
-
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
6
|
-
|
|
7
|
-
const SettingLayout = memo<{ children: ReactNode }>(({ children }) => {
|
|
8
|
-
const { t } = useTranslation('setting');
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<AppMobileLayout
|
|
12
|
-
navBar={<MobileNavBar center={<MobileNavBarTitle title={t('header.global')} />} />}
|
|
13
|
-
showTabBar
|
|
14
|
-
>
|
|
15
|
-
{children}
|
|
16
|
-
</AppMobileLayout>
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export default SettingLayout;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/pages/settings/{ThemeSwatches → features/ThemeSwatches}/ThemeSwatchesNeutral.tsx
RENAMED
|
File without changes
|
/package/src/pages/settings/{ThemeSwatches → features/ThemeSwatches}/ThemeSwatchesPrimary.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|