@lobehub/chat 0.83.9 → 0.83.10
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 +37 -0
- package/package.json +2 -2
- package/src/app/chat/(desktop)/features/{ChatHeader/Desktop.tsx → ChatHeader.tsx} +2 -2
- package/src/app/chat/(desktop)/features/{ChatInput/Desktop.tsx → ChatInput.tsx} +5 -7
- package/src/app/chat/(desktop)/features/{SessionHeader/Desktop.tsx → SessionHeader.tsx} +1 -1
- package/src/app/chat/(desktop)/features/{SessionList/Desktop.tsx → SessionList.tsx} +5 -4
- package/src/app/chat/(desktop)/features/{SideBar/Desktop.tsx → SideBar.tsx} +5 -4
- package/src/app/chat/(desktop)/index.tsx +14 -8
- package/src/app/chat/(desktop)/{layout/Desktop.tsx → layout.desktop.tsx} +7 -8
- package/src/app/chat/(desktop)/layout.responsive.tsx +12 -0
- package/src/app/chat/(mobile)/features/ChatHeader.tsx +54 -1
- package/src/app/chat/(mobile)/features/ChatInput.tsx +28 -8
- package/src/app/chat/(mobile)/features/SessionList.tsx +13 -8
- package/src/app/chat/{components/Inspector/Mobile.tsx → (mobile)/features/TopicList.tsx} +6 -4
- package/src/app/chat/(mobile)/index.tsx +3 -5
- package/src/app/chat/(mobile)/layout.mobile.tsx +17 -0
- package/src/app/chat/(mobile)/mobile/index.tsx +19 -0
- package/src/app/chat/(mobile)/mobile/layout.mobile.tsx +11 -0
- package/src/app/chat/(mobile)/mobile/page.tsx +2 -20
- package/src/app/chat/{components → features}/ChatHeader/ShareButton/Preview.tsx +25 -9
- package/src/app/chat/{components → features}/ChatHeader/ShareButton/style.ts +7 -7
- package/src/app/chat/{components/ChatInput → features/ChatInputContent}/index.tsx +3 -1
- package/src/app/chat/{components/SessionList → features/SessionListContent}/Inbox/index.tsx +7 -5
- package/src/app/chat/{components/SessionList → features/SessionListContent}/index.tsx +3 -1
- package/src/app/chat/{components/Inspector → features/TopicListContent}/index.tsx +3 -1
- package/src/app/chat/page.tsx +3 -1
- package/src/app/chat/settings/(desktop)/index.tsx +14 -0
- package/src/app/chat/settings/(desktop)/layout.desktop.tsx +10 -15
- package/src/app/chat/settings/(desktop)/layout.responsive.tsx +12 -0
- package/src/app/chat/settings/(mobile)/index.tsx +14 -0
- package/src/app/chat/settings/(mobile)/layout.mobile.tsx +4 -8
- package/src/app/chat/settings/features/EditPage.tsx +38 -0
- package/src/app/chat/settings/page.tsx +9 -33
- package/src/app/market/(desktop)/{AgentDetail/Desktop.tsx → features/AgentDetail.tsx} +5 -3
- package/src/app/market/(desktop)/index.tsx +12 -0
- package/src/app/market/(desktop)/{layout/Desktop.tsx → layout.desktop.tsx} +5 -5
- package/src/app/market/(desktop)/layout.responsive.tsx +16 -0
- package/src/app/market/{components/AgentDetail/Mobile.tsx → (mobile)/features/AgentDetail.tsx} +6 -4
- package/src/app/market/(mobile)/index.tsx +12 -0
- package/src/app/market/(mobile)/layout.mobile.tsx +5 -5
- package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/Header.tsx +1 -0
- package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/index.tsx +3 -1
- package/src/app/market/features/TagList/index.tsx +2 -1
- package/src/app/market/page.tsx +8 -5
- package/src/app/settings/{features/Header/Desktop.tsx → (desktop)/features/Header.tsx} +2 -2
- package/src/app/settings/(desktop)/index.tsx +17 -0
- package/src/app/settings/{layout.desktop/Desktop.tsx → (desktop)/layout.desktop.tsx} +10 -9
- package/src/app/settings/(desktop)/layout.responsive.tsx +14 -0
- package/src/app/settings/{mobile → (mobile)/features}/ExtraList.tsx +1 -1
- package/src/app/settings/(mobile)/features/Header/Home.tsx +8 -0
- package/src/app/settings/{features/Header/Mobile.tsx → (mobile)/features/Header/index.tsx} +1 -0
- package/src/app/settings/(mobile)/index.tsx +3 -0
- package/src/app/settings/(mobile)/layout.mobile.tsx +19 -0
- package/src/app/settings/{mobile → (mobile)/mobile}/index.tsx +7 -7
- package/src/app/settings/(mobile)/mobile/layout.mobile.tsx +14 -0
- package/src/app/settings/agent/Agent.tsx +30 -0
- package/src/app/settings/agent/index.tsx +23 -0
- package/src/app/settings/agent/layout.tsx +1 -0
- package/src/app/settings/agent/page.tsx +2 -31
- package/src/app/settings/common/index.tsx +23 -0
- package/src/app/settings/common/layout.tsx +1 -0
- package/src/app/settings/common/page.tsx +2 -14
- package/src/app/settings/layout.server.tsx +12 -0
- package/src/app/settings/llm/index.tsx +23 -0
- package/src/app/settings/llm/layout.tsx +1 -0
- package/src/app/settings/llm/page.tsx +2 -14
- package/src/app/settings/page.tsx +14 -1
- package/src/app/welcome/(desktop)/features/Showcase.tsx +23 -0
- package/src/app/welcome/(desktop)/index.tsx +19 -0
- package/src/app/welcome/{DesktopLayout/Desktop.tsx → (desktop)/layout.desktop.tsx} +4 -4
- package/src/app/welcome/(desktop)/layout.responsive.tsx +14 -0
- package/src/app/welcome/(mobile)/features/Header.tsx +6 -0
- package/src/app/welcome/(mobile)/features/Showcase.tsx +16 -0
- package/src/app/welcome/(mobile)/index.tsx +10 -0
- package/src/app/welcome/(mobile)/layout.mobile.tsx +20 -0
- package/src/app/welcome/features/Banner/Hero.tsx +2 -3
- package/src/app/welcome/features/Banner/index.tsx +34 -31
- package/src/app/welcome/features/Banner/style.ts +10 -1
- package/src/app/welcome/page.tsx +9 -7
- package/src/components/ResponsiveIndex.tsx +17 -0
- package/src/features/MobileTabBar/index.tsx +1 -1
- package/src/features/SideBar/BottomActions.tsx +1 -1
- package/src/layout/{AppLayout.tsx → AppLayout.desktop.tsx} +2 -2
- package/src/layout/{AppMobileLayout.tsx → AppLayout.mobile.tsx} +2 -2
- package/src/layout/GlobalLayout/StoreHydration.tsx +15 -1
- package/src/layout/ResponsiveLayout.client.tsx +18 -0
- package/src/{components/ResponsiveLayout.tsx → layout/ResponsiveLayout.server.tsx} +4 -3
- package/src/store/session/slices/session/initialState.ts +2 -2
- package/src/app/chat/(desktop)/features/ChatHeader/index.tsx +0 -14
- package/src/app/chat/(desktop)/features/ChatInput/index.tsx +0 -22
- package/src/app/chat/(desktop)/features/SessionHeader/index.tsx +0 -14
- package/src/app/chat/(desktop)/features/SessionList/index.tsx +0 -20
- package/src/app/chat/(desktop)/features/SideBar/index.tsx +0 -20
- package/src/app/chat/(desktop)/layout/index.tsx +0 -25
- package/src/app/chat/(mobile)/features/Topics.tsx +0 -12
- package/src/app/chat/(mobile)/layout.tsx +0 -15
- package/src/app/chat/components/ChatHeader/Mobile.tsx +0 -54
- package/src/app/chat/components/ChatInput/Mobile.tsx +0 -35
- package/src/app/chat/components/SessionList/Mobile.tsx +0 -16
- package/src/app/chat/layout.tsx +0 -15
- package/src/app/chat/settings/layout.tsx +0 -14
- package/src/app/market/(desktop)/AgentDetail/index.tsx +0 -16
- package/src/app/market/(desktop)/Header/index.tsx +0 -13
- package/src/app/market/(desktop)/layout/index.tsx +0 -17
- package/src/app/market/(mobile)/AgentDetail.tsx +0 -12
- package/src/app/market/layout.tsx +0 -13
- package/src/app/settings/features/Header/index.tsx +0 -14
- package/src/app/settings/layout.desktop/index.tsx +0 -32
- package/src/app/settings/layout.mobile.tsx +0 -16
- package/src/app/settings/layout.tsx +0 -15
- package/src/app/settings/mobile/page.tsx +0 -7
- package/src/app/welcome/DesktopLayout/index.tsx +0 -15
- package/src/app/welcome/MobileLayout.tsx +0 -23
- package/src/app/welcome/layout.tsx +0 -22
- /package/src/app/chat/{components → features}/ChatHeader/PluginTag/PluginStatus.tsx +0 -0
- /package/src/app/chat/{components → features}/ChatHeader/PluginTag/index.tsx +0 -0
- /package/src/app/chat/{components → features}/ChatHeader/ShareButton/Inner.tsx +0 -0
- /package/src/app/chat/{components → features}/ChatHeader/ShareButton/index.tsx +0 -0
- /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/ActionBar/ActionLeft.tsx +0 -0
- /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/ActionBar/ActionRight.tsx +0 -0
- /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/ActionBar/Token.tsx +0 -0
- /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/Footer/SaveTopic.tsx +0 -0
- /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/Footer/index.tsx +0 -0
- /package/src/app/chat/features/{PageTitle.tsx → PageTitle/index.tsx} +0 -0
- /package/src/app/chat/{components/SessionList → features/SessionListContent}/CollapseGroup/index.tsx +0 -0
- /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/AddButton.tsx +0 -0
- /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/Item/Actions.tsx +0 -0
- /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/Item/index.tsx +0 -0
- /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/SkeletonList.tsx +0 -0
- /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/index.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/SystemRole/Header.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/SystemRole/index.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/SystemRole/style.ts +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/DefaultContent.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/SkeletonList.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/TopicContent.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/TopicItem.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/index.tsx +0 -0
- /package/src/app/chat/{components/Inspector → features/TopicListContent}/TopicSearchBar/index.tsx +0 -0
- /package/src/app/market/(desktop)/{Header/Desktop.tsx → features/Header.tsx} +0 -0
- /package/src/app/market/(mobile)/{Header.tsx → features/Header.tsx} +0 -0
- /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/Comment.tsx +0 -0
- /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/Loading.tsx +0 -0
- /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/TokenTag.tsx +0 -0
- /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/index.tsx +0 -0
- /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/style.ts +0 -0
- /package/src/app/welcome/{features/Footer/index.tsx → (desktop)/features/Footer.tsx} +0 -0
|
@@ -6,16 +6,15 @@ import { memo } from 'react';
|
|
|
6
6
|
import { Center } from 'react-layout-kit';
|
|
7
7
|
|
|
8
8
|
import pkg from '@/../package.json';
|
|
9
|
-
import Header from '@/app/market/(mobile)/Header';
|
|
10
9
|
import AgentCardBanner from '@/app/market/features/AgentCard/AgentCardBanner';
|
|
11
10
|
import AvatarWithUpload from '@/features/AvatarWithUpload';
|
|
12
|
-
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
13
11
|
import { useGlobalStore, useSwitchSideBarOnInit } from '@/store/global';
|
|
14
12
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
15
13
|
import { AVATAR } from '@/store/session/slices/chat/actions/share';
|
|
16
14
|
|
|
17
|
-
import List from '
|
|
18
|
-
import ExtraList from '
|
|
15
|
+
import List from '../../features/SideBar/List';
|
|
16
|
+
import ExtraList from '../features/ExtraList';
|
|
17
|
+
import Layout from './layout.mobile';
|
|
19
18
|
|
|
20
19
|
const useStyles = createStyles(({ css, token }) => ({
|
|
21
20
|
divider: css`
|
|
@@ -29,11 +28,12 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
|
29
28
|
}));
|
|
30
29
|
|
|
31
30
|
const Setting = memo(() => {
|
|
31
|
+
useSwitchSideBarOnInit(SidebarTabKey.Setting);
|
|
32
32
|
const avatar = useGlobalStore((s) => s.settings.avatar);
|
|
33
33
|
const { styles } = useStyles();
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
36
|
+
<Layout>
|
|
37
37
|
<AgentCardBanner
|
|
38
38
|
mask
|
|
39
39
|
meta={{ avatar: avatar || AVATAR }}
|
|
@@ -54,7 +54,7 @@ const Setting = memo(() => {
|
|
|
54
54
|
</Divider>
|
|
55
55
|
</Center>
|
|
56
56
|
</div>
|
|
57
|
-
</
|
|
57
|
+
</Layout>
|
|
58
58
|
);
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren, memo } from 'react';
|
|
4
|
+
import { Flexbox } from 'react-layout-kit';
|
|
5
|
+
|
|
6
|
+
import AppLayoutMobile from '@/layout/AppLayout.mobile';
|
|
7
|
+
|
|
8
|
+
import Header from '../features/Header/Home';
|
|
9
|
+
|
|
10
|
+
export default memo(({ children }: PropsWithChildren) => (
|
|
11
|
+
<AppLayoutMobile navBar={<Header />} showTabBar>
|
|
12
|
+
<Flexbox style={{ overflow: 'auto' }}>{children}</Flexbox>
|
|
13
|
+
</AppLayoutMobile>
|
|
14
|
+
));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import isEqual from 'fast-deep-equal';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
|
|
4
|
+
import AgentSetting from '@/features/AgentSetting';
|
|
5
|
+
import { settingsSelectors, useGlobalStore } from '@/store/global';
|
|
6
|
+
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
7
|
+
import { SettingsTabs } from '@/store/global/initialState';
|
|
8
|
+
|
|
9
|
+
const Agent = memo(() => {
|
|
10
|
+
useSwitchSideBarOnInit(SettingsTabs.Agent);
|
|
11
|
+
|
|
12
|
+
const config = useGlobalStore(settingsSelectors.defaultAgentConfig, isEqual);
|
|
13
|
+
const meta = useGlobalStore(settingsSelectors.defaultAgentMeta, isEqual);
|
|
14
|
+
const [updateAgent] = useGlobalStore((s) => [s.updateDefaultAgent]);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<AgentSetting
|
|
18
|
+
config={config}
|
|
19
|
+
meta={meta}
|
|
20
|
+
onConfigChange={(config) => {
|
|
21
|
+
updateAgent({ config });
|
|
22
|
+
}}
|
|
23
|
+
onMetaChange={(meta) => {
|
|
24
|
+
updateAgent({ meta });
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default Agent;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import PageTitle from '@/components/PageTitle';
|
|
7
|
+
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
8
|
+
import { SettingsTabs } from '@/store/global/initialState';
|
|
9
|
+
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
10
|
+
|
|
11
|
+
import Agent from './Agent';
|
|
12
|
+
|
|
13
|
+
export default memo(() => {
|
|
14
|
+
useSwitchSideBarOnInit(SettingsTabs.Agent);
|
|
15
|
+
const { t } = useTranslation('setting');
|
|
16
|
+
const pageTitle = genSiteHeadTitle(t('tab.agent'));
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<PageTitle title={pageTitle} />
|
|
20
|
+
<Agent />
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../layout.server';
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import Index from './index';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
|
|
6
|
-
import AgentSetting from '@/features/AgentSetting';
|
|
7
|
-
import { settingsSelectors, useGlobalStore } from '@/store/global';
|
|
8
|
-
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
9
|
-
import { SettingsTabs } from '@/store/global/initialState';
|
|
10
|
-
|
|
11
|
-
const Agent = memo(() => {
|
|
12
|
-
useSwitchSideBarOnInit(SettingsTabs.Agent);
|
|
13
|
-
|
|
14
|
-
const config = useGlobalStore(settingsSelectors.defaultAgentConfig, isEqual);
|
|
15
|
-
const meta = useGlobalStore(settingsSelectors.defaultAgentMeta, isEqual);
|
|
16
|
-
const [updateAgent] = useGlobalStore((s) => [s.updateDefaultAgent]);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<AgentSetting
|
|
20
|
-
config={config}
|
|
21
|
-
meta={meta}
|
|
22
|
-
onConfigChange={(config) => {
|
|
23
|
-
updateAgent({ config });
|
|
24
|
-
}}
|
|
25
|
-
onMetaChange={(meta) => {
|
|
26
|
-
updateAgent({ meta });
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export default Agent;
|
|
3
|
+
export default () => <Index />;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import PageTitle from '@/components/PageTitle';
|
|
7
|
+
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
8
|
+
import { SettingsTabs } from '@/store/global/initialState';
|
|
9
|
+
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
10
|
+
|
|
11
|
+
import Common from './Common';
|
|
12
|
+
|
|
13
|
+
export default memo(() => {
|
|
14
|
+
useSwitchSideBarOnInit(SettingsTabs.Common);
|
|
15
|
+
const { t } = useTranslation('setting');
|
|
16
|
+
const pageTitle = genSiteHeadTitle(t('tab.common'));
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<PageTitle title={pageTitle} />
|
|
20
|
+
<Common />
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../layout.server';
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import Index from './index';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
6
|
-
import { SettingsTabs } from '@/store/global/initialState';
|
|
7
|
-
|
|
8
|
-
import Common from './Common';
|
|
9
|
-
|
|
10
|
-
const CommonSetting = memo(() => {
|
|
11
|
-
useSwitchSideBarOnInit(SettingsTabs.Common);
|
|
12
|
-
return <Common />;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export default CommonSetting;
|
|
3
|
+
export default () => <Index />;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren, memo } from 'react';
|
|
2
|
+
|
|
3
|
+
import ResponsiveLayout from '@/layout/ResponsiveLayout.server';
|
|
4
|
+
|
|
5
|
+
import DesktopLayout from './(desktop)/layout.responsive';
|
|
6
|
+
import MobileLayout from './(mobile)/layout.mobile';
|
|
7
|
+
|
|
8
|
+
export default memo(({ children }: PropsWithChildren) => (
|
|
9
|
+
<ResponsiveLayout Desktop={DesktopLayout} Mobile={MobileLayout}>
|
|
10
|
+
{children}
|
|
11
|
+
</ResponsiveLayout>
|
|
12
|
+
));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import PageTitle from '@/components/PageTitle';
|
|
7
|
+
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
8
|
+
import { SettingsTabs } from '@/store/global/initialState';
|
|
9
|
+
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
10
|
+
|
|
11
|
+
import LLM from './LLM';
|
|
12
|
+
|
|
13
|
+
export default memo(() => {
|
|
14
|
+
useSwitchSideBarOnInit(SettingsTabs.LLM);
|
|
15
|
+
const { t } = useTranslation('setting');
|
|
16
|
+
const pageTitle = genSiteHeadTitle(t('tab.llm'));
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<PageTitle title={pageTitle} />
|
|
20
|
+
<LLM />
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../layout.server';
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import Index from './index';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useSwitchSideBarOnInit } from '@/store/global/hooks/useSwitchSettingsOnInit';
|
|
6
|
-
import { SettingsTabs } from '@/store/global/initialState';
|
|
7
|
-
|
|
8
|
-
import LLM from './LLM';
|
|
9
|
-
|
|
10
|
-
const LLMSetting = memo(() => {
|
|
11
|
-
useSwitchSideBarOnInit(SettingsTabs.LLM);
|
|
12
|
-
return <LLM />;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export default LLMSetting;
|
|
3
|
+
export default () => <Index />;
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
2
|
+
|
|
3
|
+
import DesktopPage from './(desktop)';
|
|
4
|
+
import MobilePage from './(mobile)';
|
|
5
|
+
|
|
6
|
+
const Page = () => {
|
|
7
|
+
const mobile = isMobileDevice();
|
|
8
|
+
|
|
9
|
+
const Page = mobile ? MobilePage : DesktopPage;
|
|
10
|
+
|
|
11
|
+
return <Page />;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default Page;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { GridShowcase } from '@lobehub/ui';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
|
6
|
+
|
|
7
|
+
import Banner from '@/app/welcome/features/Banner';
|
|
8
|
+
|
|
9
|
+
const Showcase = memo(() => (
|
|
10
|
+
<Flexbox
|
|
11
|
+
flex={1}
|
|
12
|
+
justify={'center'}
|
|
13
|
+
style={{ height: '100vh', position: 'relative', width: '100%' }}
|
|
14
|
+
>
|
|
15
|
+
<GridShowcase>
|
|
16
|
+
<Banner />
|
|
17
|
+
</GridShowcase>
|
|
18
|
+
{/*TODO:暂时隐藏,待模板完成后再补回*/}
|
|
19
|
+
{/*<AgentTemplate width={width} />*/}
|
|
20
|
+
</Flexbox>
|
|
21
|
+
));
|
|
22
|
+
|
|
23
|
+
export default Showcase;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
|
|
5
|
+
import ResponsiveIndex from '@/components/ResponsiveIndex';
|
|
6
|
+
|
|
7
|
+
import Mobile from '../(mobile)';
|
|
8
|
+
import Footer from './features/Footer';
|
|
9
|
+
import Showcase from './features/Showcase';
|
|
10
|
+
import Layout from './layout.responsive';
|
|
11
|
+
|
|
12
|
+
export default memo(() => (
|
|
13
|
+
<ResponsiveIndex Mobile={Mobile}>
|
|
14
|
+
<Layout>
|
|
15
|
+
<Showcase />
|
|
16
|
+
<Footer />
|
|
17
|
+
</Layout>
|
|
18
|
+
</ResponsiveIndex>
|
|
19
|
+
));
|
|
@@ -3,14 +3,14 @@ import Link from 'next/link';
|
|
|
3
3
|
import { PropsWithChildren, memo } from 'react';
|
|
4
4
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import AppLayoutDesktop from '@/layout/AppLayout.desktop';
|
|
7
7
|
|
|
8
8
|
import { useStyles } from '../features/Banner/style';
|
|
9
9
|
|
|
10
10
|
const Desktop = memo<PropsWithChildren>(({ children }) => {
|
|
11
11
|
const { styles } = useStyles();
|
|
12
12
|
return (
|
|
13
|
-
<
|
|
13
|
+
<AppLayoutDesktop>
|
|
14
14
|
<Center
|
|
15
15
|
className={styles.layout}
|
|
16
16
|
flex={1}
|
|
@@ -21,11 +21,11 @@ const Desktop = memo<PropsWithChildren>(({ children }) => {
|
|
|
21
21
|
<Link href={'/'}>
|
|
22
22
|
<Logo className={styles.logo} size={36} type={'text'} />
|
|
23
23
|
</Link>
|
|
24
|
-
<Flexbox className={styles.view} flex={1}
|
|
24
|
+
<Flexbox className={styles.view} flex={1}>
|
|
25
25
|
{children}
|
|
26
26
|
</Flexbox>
|
|
27
27
|
</Center>
|
|
28
|
-
</
|
|
28
|
+
</AppLayoutDesktop>
|
|
29
29
|
);
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren, memo } from 'react';
|
|
4
|
+
|
|
5
|
+
import ResponsiveLayout from '@/layout/ResponsiveLayout.client';
|
|
6
|
+
|
|
7
|
+
import MobileLayout from '../(mobile)/layout.mobile';
|
|
8
|
+
import DesktopLayout from './layout.desktop';
|
|
9
|
+
|
|
10
|
+
export default memo(({ children }: PropsWithChildren) => (
|
|
11
|
+
<ResponsiveLayout Desktop={DesktopLayout} Mobile={MobileLayout}>
|
|
12
|
+
{children}
|
|
13
|
+
</ResponsiveLayout>
|
|
14
|
+
));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
|
3
|
+
|
|
4
|
+
import Banner from '@/app/welcome/features/Banner';
|
|
5
|
+
|
|
6
|
+
const Showcase = memo(() => (
|
|
7
|
+
<Flexbox align={'center'} justify={'center'} style={{ height: 'calc(100vh - 44px)' }}>
|
|
8
|
+
<Center gap={16}>
|
|
9
|
+
<Banner mobile />
|
|
10
|
+
</Center>
|
|
11
|
+
{/*TODO:暂时隐藏,待模板完成后再补回*/}
|
|
12
|
+
{/*<AgentTemplate width={width} />*/}
|
|
13
|
+
</Flexbox>
|
|
14
|
+
));
|
|
15
|
+
|
|
16
|
+
export default Showcase;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useTheme } from 'antd-style';
|
|
4
|
+
import { PropsWithChildren, memo } from 'react';
|
|
5
|
+
|
|
6
|
+
import AppLayoutMobile from '@/layout/AppLayout.mobile';
|
|
7
|
+
|
|
8
|
+
import Header from './features/Header';
|
|
9
|
+
|
|
10
|
+
const MobileLayout = memo<PropsWithChildren>(({ children }) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<AppLayoutMobile navBar={<Header />} showTabBar style={{ background: theme.colorBgLayout }}>
|
|
15
|
+
<div style={{ paddingInline: 16 }}>{children}</div>
|
|
16
|
+
</AppLayoutMobile>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default MobileLayout;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { LogoThree } from '@lobehub/ui';
|
|
2
|
-
import { useResponsive } from 'antd-style';
|
|
3
2
|
import { memo, useMemo } from 'react';
|
|
4
3
|
import { useTranslation } from 'react-i18next';
|
|
5
4
|
|
|
6
5
|
import { genSize, useStyles } from './style';
|
|
7
6
|
|
|
8
|
-
const Hero = memo<{ width: number }>(({ width }) => {
|
|
7
|
+
const Hero = memo<{ mobile?: boolean; width: number }>(({ width, mobile }) => {
|
|
9
8
|
const size = useMemo(
|
|
10
9
|
() => ({
|
|
11
10
|
base: genSize(width / 3.5, 240),
|
|
@@ -16,7 +15,7 @@ const Hero = memo<{ width: number }>(({ width }) => {
|
|
|
16
15
|
[width],
|
|
17
16
|
);
|
|
18
17
|
const { styles } = useStyles(size.base);
|
|
19
|
-
|
|
18
|
+
|
|
20
19
|
const { t } = useTranslation('welcome');
|
|
21
20
|
|
|
22
21
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Icon } from '@lobehub/ui';
|
|
4
4
|
import { useSize } from 'ahooks';
|
|
5
5
|
import { Button, Upload } from 'antd';
|
|
6
6
|
import { SendHorizonal } from 'lucide-react';
|
|
@@ -16,13 +16,12 @@ import { useSessionStore } from '@/store/session';
|
|
|
16
16
|
import Hero from './Hero';
|
|
17
17
|
import { useStyles } from './style';
|
|
18
18
|
|
|
19
|
-
const Banner = memo<{ mobile?: boolean }>(() => {
|
|
19
|
+
const Banner = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
20
20
|
const { importConfig } = useImportConfig();
|
|
21
21
|
const ref = useRef(null);
|
|
22
22
|
const domSize = useSize(ref);
|
|
23
23
|
const width = domSize?.width || 1024;
|
|
24
24
|
const { t } = useTranslation('welcome');
|
|
25
|
-
|
|
26
25
|
const { styles } = useStyles();
|
|
27
26
|
|
|
28
27
|
const switchSession = useSessionStore((s) => s.switchSession);
|
|
@@ -32,34 +31,38 @@ const Banner = memo<{ mobile?: boolean }>(() => {
|
|
|
32
31
|
}, []);
|
|
33
32
|
|
|
34
33
|
return (
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
34
|
+
<>
|
|
35
|
+
<div className={styles.container} ref={ref}>
|
|
36
|
+
<Hero mobile={mobile} width={width} />
|
|
37
|
+
</div>
|
|
38
|
+
<Flexbox
|
|
39
|
+
className={styles.buttonGroup}
|
|
40
|
+
gap={16}
|
|
41
|
+
horizontal={!mobile}
|
|
42
|
+
justify={'center'}
|
|
43
|
+
width={'100%'}
|
|
44
|
+
>
|
|
45
|
+
<Upload maxCount={1} onChange={handleImport} showUploadList={false}>
|
|
46
|
+
<Button block={mobile} size={'large'}>
|
|
47
|
+
{t('button.import')}
|
|
48
|
+
</Button>
|
|
49
|
+
</Upload>
|
|
50
|
+
<Link
|
|
51
|
+
href={SESSION_CHAT_URL()}
|
|
52
|
+
onClick={(e) => {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
switchSession();
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<Button block={mobile} size={'large'} type={'primary'}>
|
|
58
|
+
<Flexbox align={'center'} gap={4} horizontal justify={'center'}>
|
|
59
|
+
{t('button.start')}
|
|
60
|
+
<Icon icon={SendHorizonal} />
|
|
61
|
+
</Flexbox>
|
|
62
|
+
</Button>
|
|
63
|
+
</Link>
|
|
64
|
+
</Flexbox>
|
|
65
|
+
</>
|
|
63
66
|
);
|
|
64
67
|
});
|
|
65
68
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { createStyles } from 'antd-style';
|
|
2
2
|
import { rgba } from 'polished';
|
|
3
3
|
|
|
4
|
-
export const useStyles = createStyles(({ css, token, stylish, cx }) => {
|
|
4
|
+
export const useStyles = createStyles(({ css, token, stylish, cx, prefixCls }) => {
|
|
5
5
|
return {
|
|
6
|
+
buttonGroup: css`
|
|
7
|
+
.${prefixCls}-upload {
|
|
8
|
+
width: 100% !important;
|
|
9
|
+
}
|
|
10
|
+
`,
|
|
6
11
|
container: css`
|
|
7
12
|
z-index: 10;
|
|
8
13
|
|
|
@@ -49,8 +54,12 @@ export const useStyles = createStyles(({ css, token, stylish, cx }) => {
|
|
|
49
54
|
view: cx(
|
|
50
55
|
stylish.noScrollbar,
|
|
51
56
|
css`
|
|
57
|
+
position: relative;
|
|
58
|
+
|
|
52
59
|
overflow-x: hidden;
|
|
53
60
|
overflow-y: auto;
|
|
61
|
+
|
|
62
|
+
max-width: 1024px;
|
|
54
63
|
height: 100vh;
|
|
55
64
|
padding: 32px 16px;
|
|
56
65
|
`,
|
package/src/app/welcome/page.tsx
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Metadata } from 'next';
|
|
1
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import DesktopPage from './(desktop)';
|
|
4
|
+
import MobilePage from './(mobile)';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
6
|
+
const Page = () => {
|
|
7
|
+
const mobile = isMobileDevice();
|
|
9
8
|
|
|
10
|
-
const Page =
|
|
9
|
+
const Page = mobile ? MobilePage : DesktopPage;
|
|
10
|
+
|
|
11
|
+
return <Page />;
|
|
12
|
+
};
|
|
11
13
|
|
|
12
14
|
export default Page;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { FC, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import { useIsMobile } from '@/hooks/useIsMobile';
|
|
6
|
+
|
|
7
|
+
interface ResponsiveIndexProps {
|
|
8
|
+
Mobile: FC;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
const ResponsiveIndex = ({ children, Mobile }: ResponsiveIndexProps) => {
|
|
12
|
+
const mobile = useIsMobile();
|
|
13
|
+
|
|
14
|
+
return mobile ? <Mobile /> : children;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default ResponsiveIndex;
|
|
@@ -5,7 +5,7 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
5
5
|
import SideBar from '@/features/SideBar';
|
|
6
6
|
import { useIsPWA } from '@/hooks/useIsPWA';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const AppLayoutDesktop = memo<PropsWithChildren>(({ children }) => {
|
|
9
9
|
const isPWA = useIsPWA();
|
|
10
10
|
const theme = useTheme();
|
|
11
11
|
return (
|
|
@@ -20,4 +20,4 @@ const AppLayout = memo<PropsWithChildren>(({ children }) => {
|
|
|
20
20
|
);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export default
|
|
23
|
+
export default AppLayoutDesktop;
|
|
@@ -43,7 +43,7 @@ interface AppMobileLayoutProps extends PropsWithChildren {
|
|
|
43
43
|
title?: MobileNavBarTitleProps;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const
|
|
46
|
+
const AppLayoutMobile = memo<AppMobileLayoutProps>(
|
|
47
47
|
({ children, showTabBar, navBar, style, className }) => {
|
|
48
48
|
const { styles, cx } = useStyles();
|
|
49
49
|
|
|
@@ -67,4 +67,4 @@ const AppMobileLayout = memo<AppMobileLayoutProps>(
|
|
|
67
67
|
},
|
|
68
68
|
);
|
|
69
69
|
|
|
70
|
-
export default
|
|
70
|
+
export default AppLayoutMobile;
|