@lobehub/chat 0.83.10 → 0.84.0-beta.1
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/.dockerignore +10 -0
- package/.github/workflows/release.yml +3 -0
- package/.releaserc.js +14 -1
- package/CHANGELOG.md +5 -17
- package/Dockerfile +46 -0
- package/next.config.mjs +3 -0
- package/package.json +4 -2
- package/src/app/chat/(desktop)/features/{ChatHeader.tsx → ChatHeader/Desktop.tsx} +2 -2
- package/src/app/chat/(desktop)/features/ChatHeader/index.tsx +14 -0
- package/src/app/chat/(desktop)/features/{ChatInput.tsx → ChatInput/Desktop.tsx} +7 -5
- package/src/app/chat/(desktop)/features/ChatInput/index.tsx +22 -0
- package/src/app/chat/(desktop)/features/{SessionHeader.tsx → SessionHeader/Desktop.tsx} +1 -1
- package/src/app/chat/(desktop)/features/SessionHeader/index.tsx +14 -0
- package/src/app/chat/(desktop)/features/{SessionList.tsx → SessionList/Desktop.tsx} +4 -5
- package/src/app/chat/(desktop)/features/SessionList/index.tsx +20 -0
- package/src/app/chat/(desktop)/features/{SideBar.tsx → SideBar/Desktop.tsx} +4 -5
- package/src/app/chat/(desktop)/features/SideBar/index.tsx +20 -0
- package/src/app/chat/(desktop)/index.tsx +8 -14
- package/src/app/chat/(desktop)/{layout.desktop.tsx → layout/Desktop.tsx} +8 -7
- package/src/app/chat/(desktop)/layout/index.tsx +25 -0
- package/src/app/chat/(mobile)/features/ChatHeader.tsx +1 -54
- package/src/app/chat/(mobile)/features/ChatInput.tsx +8 -28
- package/src/app/chat/(mobile)/features/SessionList.tsx +8 -13
- package/src/app/chat/(mobile)/features/Topics.tsx +12 -0
- package/src/app/chat/(mobile)/index.tsx +5 -3
- package/src/app/chat/(mobile)/layout.tsx +15 -0
- package/src/app/chat/(mobile)/mobile/page.tsx +20 -2
- package/src/app/chat/components/ChatHeader/Mobile.tsx +54 -0
- package/src/app/chat/{features → components}/ChatHeader/ShareButton/Preview.tsx +9 -25
- package/src/app/chat/{features → components}/ChatHeader/ShareButton/style.ts +7 -7
- package/src/app/chat/components/ChatInput/Mobile.tsx +35 -0
- package/src/app/chat/{features/ChatInputContent → components/ChatInput}/index.tsx +1 -3
- package/src/app/chat/{(mobile)/features/TopicList.tsx → components/Inspector/Mobile.tsx} +4 -6
- package/src/app/chat/{features/TopicListContent → components/Inspector}/index.tsx +1 -3
- package/src/app/chat/{features/SessionListContent → components/SessionList}/Inbox/index.tsx +5 -7
- package/src/app/chat/components/SessionList/Mobile.tsx +16 -0
- package/src/app/chat/{features/SessionListContent → components/SessionList}/index.tsx +1 -3
- package/src/app/chat/layout.tsx +15 -0
- package/src/app/chat/page.tsx +1 -3
- package/src/app/chat/settings/(desktop)/layout.desktop.tsx +15 -10
- package/src/app/chat/settings/(mobile)/layout.mobile.tsx +8 -4
- package/src/app/chat/settings/layout.tsx +14 -0
- package/src/app/chat/settings/page.tsx +33 -9
- package/src/app/market/(desktop)/{features/AgentDetail.tsx → AgentDetail/Desktop.tsx} +3 -5
- package/src/app/market/(desktop)/AgentDetail/index.tsx +16 -0
- package/src/app/market/(desktop)/Header/index.tsx +13 -0
- package/src/app/market/(desktop)/{layout.desktop.tsx → layout/Desktop.tsx} +5 -5
- package/src/app/market/(desktop)/layout/index.tsx +17 -0
- package/src/app/market/(mobile)/AgentDetail.tsx +12 -0
- package/src/app/market/(mobile)/layout.mobile.tsx +5 -5
- package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/Header.tsx +0 -1
- package/src/app/market/{(mobile)/features/AgentDetail.tsx → components/AgentDetail/Mobile.tsx} +4 -6
- package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/index.tsx +1 -3
- package/src/app/market/features/TagList/index.tsx +1 -2
- package/src/app/market/layout.tsx +13 -0
- package/src/app/market/page.tsx +5 -8
- package/src/app/settings/agent/page.tsx +31 -2
- package/src/app/settings/common/page.tsx +14 -2
- package/src/app/settings/{(desktop)/features/Header.tsx → features/Header/Desktop.tsx} +2 -2
- package/src/app/settings/{(mobile)/features/Header/index.tsx → features/Header/Mobile.tsx} +0 -1
- package/src/app/settings/features/Header/index.tsx +14 -0
- package/src/app/settings/{(desktop)/layout.desktop.tsx → layout.desktop/Desktop.tsx} +9 -10
- package/src/app/settings/layout.desktop/index.tsx +32 -0
- package/src/app/settings/layout.mobile.tsx +16 -0
- package/src/app/settings/layout.tsx +15 -0
- package/src/app/settings/llm/page.tsx +14 -2
- package/src/app/settings/{(mobile)/features → mobile}/ExtraList.tsx +1 -1
- package/src/app/settings/{(mobile)/mobile → mobile}/index.tsx +7 -7
- package/src/app/settings/mobile/page.tsx +7 -0
- package/src/app/settings/page.tsx +1 -14
- package/src/app/welcome/{(desktop)/layout.desktop.tsx → DesktopLayout/Desktop.tsx} +4 -4
- package/src/app/welcome/DesktopLayout/index.tsx +15 -0
- package/src/app/welcome/MobileLayout.tsx +23 -0
- package/src/app/welcome/features/Banner/Hero.tsx +3 -2
- package/src/app/welcome/features/Banner/index.tsx +31 -34
- package/src/app/welcome/features/Banner/style.ts +1 -10
- package/src/app/welcome/layout.tsx +22 -0
- package/src/app/welcome/page.tsx +7 -9
- package/src/{layout/ResponsiveLayout.server.tsx → components/ResponsiveLayout.tsx} +3 -4
- package/src/features/MobileTabBar/index.tsx +1 -1
- package/src/features/SideBar/BottomActions.tsx +1 -1
- package/src/layout/{AppLayout.desktop.tsx → AppLayout.tsx} +2 -2
- package/src/layout/{AppLayout.mobile.tsx → AppMobileLayout.tsx} +2 -2
- package/src/layout/GlobalLayout/StoreHydration.tsx +1 -15
- package/src/store/session/slices/session/initialState.ts +2 -2
- package/src/app/chat/(desktop)/layout.responsive.tsx +0 -12
- package/src/app/chat/(mobile)/layout.mobile.tsx +0 -17
- package/src/app/chat/(mobile)/mobile/index.tsx +0 -19
- package/src/app/chat/(mobile)/mobile/layout.mobile.tsx +0 -11
- package/src/app/chat/settings/(desktop)/index.tsx +0 -14
- package/src/app/chat/settings/(desktop)/layout.responsive.tsx +0 -12
- package/src/app/chat/settings/(mobile)/index.tsx +0 -14
- package/src/app/chat/settings/features/EditPage.tsx +0 -38
- package/src/app/market/(desktop)/index.tsx +0 -12
- package/src/app/market/(desktop)/layout.responsive.tsx +0 -16
- package/src/app/market/(mobile)/index.tsx +0 -12
- package/src/app/settings/(desktop)/index.tsx +0 -17
- package/src/app/settings/(desktop)/layout.responsive.tsx +0 -14
- package/src/app/settings/(mobile)/features/Header/Home.tsx +0 -8
- package/src/app/settings/(mobile)/index.tsx +0 -3
- package/src/app/settings/(mobile)/layout.mobile.tsx +0 -19
- package/src/app/settings/(mobile)/mobile/layout.mobile.tsx +0 -14
- package/src/app/settings/agent/Agent.tsx +0 -30
- package/src/app/settings/agent/index.tsx +0 -23
- package/src/app/settings/agent/layout.tsx +0 -1
- package/src/app/settings/common/index.tsx +0 -23
- package/src/app/settings/common/layout.tsx +0 -1
- package/src/app/settings/layout.server.tsx +0 -12
- package/src/app/settings/llm/index.tsx +0 -23
- package/src/app/settings/llm/layout.tsx +0 -1
- package/src/app/welcome/(desktop)/features/Showcase.tsx +0 -23
- package/src/app/welcome/(desktop)/index.tsx +0 -19
- package/src/app/welcome/(desktop)/layout.responsive.tsx +0 -14
- 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)/index.tsx +0 -10
- package/src/app/welcome/(mobile)/layout.mobile.tsx +0 -20
- package/src/components/ResponsiveIndex.tsx +0 -17
- package/src/layout/ResponsiveLayout.client.tsx +0 -18
- /package/src/app/chat/{features → components}/ChatHeader/PluginTag/PluginStatus.tsx +0 -0
- /package/src/app/chat/{features → components}/ChatHeader/PluginTag/index.tsx +0 -0
- /package/src/app/chat/{features → components}/ChatHeader/ShareButton/Inner.tsx +0 -0
- /package/src/app/chat/{features → components}/ChatHeader/ShareButton/index.tsx +0 -0
- /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/ActionBar/ActionLeft.tsx +0 -0
- /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/ActionBar/ActionRight.tsx +0 -0
- /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/ActionBar/Token.tsx +0 -0
- /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/Footer/SaveTopic.tsx +0 -0
- /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/Footer/index.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/SystemRole/Header.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/SystemRole/index.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/SystemRole/style.ts +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/DefaultContent.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/SkeletonList.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/TopicContent.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/TopicItem.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/index.tsx +0 -0
- /package/src/app/chat/{features/TopicListContent → components/Inspector}/TopicSearchBar/index.tsx +0 -0
- /package/src/app/chat/{features/SessionListContent → components/SessionList}/CollapseGroup/index.tsx +0 -0
- /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/AddButton.tsx +0 -0
- /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/Item/Actions.tsx +0 -0
- /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/Item/index.tsx +0 -0
- /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/SkeletonList.tsx +0 -0
- /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/index.tsx +0 -0
- /package/src/app/chat/features/{PageTitle/index.tsx → PageTitle.tsx} +0 -0
- /package/src/app/market/(desktop)/{features/Header.tsx → Header/Desktop.tsx} +0 -0
- /package/src/app/market/(mobile)/{features/Header.tsx → Header.tsx} +0 -0
- /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/Comment.tsx +0 -0
- /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/Loading.tsx +0 -0
- /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/TokenTag.tsx +0 -0
- /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/index.tsx +0 -0
- /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/style.ts +0 -0
- /package/src/app/welcome/{(desktop)/features/Footer.tsx → features/Footer/index.tsx} +0 -0
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
import { PropsWithChildren } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
7
7
|
import { useSwitchSideBarOnInit } from '@/store/global';
|
|
8
8
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
9
9
|
|
|
10
|
-
import DetailModal from './
|
|
11
|
-
import Header from './
|
|
10
|
+
import DetailModal from './AgentDetail';
|
|
11
|
+
import Header from './Header';
|
|
12
12
|
|
|
13
13
|
const MarketLayout = ({ children }: PropsWithChildren) => {
|
|
14
14
|
useSwitchSideBarOnInit(SidebarTabKey.Market);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<
|
|
17
|
+
<AppMobileLayout navBar={<Header />} showTabBar>
|
|
18
18
|
<Flexbox flex={1} gap={16} style={{ padding: 16 }}>
|
|
19
19
|
{children}
|
|
20
20
|
</Flexbox>
|
|
21
21
|
<DetailModal />
|
|
22
|
-
</
|
|
22
|
+
</AppMobileLayout>
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
25
|
|
package/src/app/market/{(mobile)/features/AgentDetail.tsx → components/AgentDetail/Mobile.tsx}
RENAMED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Modal } from '@lobehub/ui';
|
|
2
|
-
import { memo } from 'react';
|
|
2
|
+
import { PropsWithChildren, memo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
|
|
5
5
|
import { agentMarketSelectors, useMarketStore } from '@/store/market';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const AgentDetail = memo(() => {
|
|
7
|
+
const Mobile = memo<PropsWithChildren>(({ children }) => {
|
|
10
8
|
const [showAgentSidebar, deactivateAgent] = useMarketStore((s) => [
|
|
11
9
|
agentMarketSelectors.showSideBar(s),
|
|
12
10
|
s.deactivateAgent,
|
|
@@ -16,9 +14,9 @@ const AgentDetail = memo(() => {
|
|
|
16
14
|
|
|
17
15
|
return (
|
|
18
16
|
<Modal onCancel={deactivateAgent} open={showAgentSidebar} title={t('sidebar.title')}>
|
|
19
|
-
|
|
17
|
+
{children}
|
|
20
18
|
</Modal>
|
|
21
19
|
);
|
|
22
20
|
});
|
|
23
21
|
|
|
24
|
-
export default
|
|
22
|
+
export default Mobile;
|
|
@@ -3,10 +3,8 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
3
3
|
|
|
4
4
|
import AgentInfo from './AgentInfo';
|
|
5
5
|
|
|
6
|
-
const AgentDetailContent = memo(() => (
|
|
6
|
+
export const AgentDetailContent = memo(() => (
|
|
7
7
|
<Flexbox>
|
|
8
8
|
<AgentInfo />
|
|
9
9
|
</Flexbox>
|
|
10
10
|
));
|
|
11
|
-
|
|
12
|
-
export default AgentDetailContent;
|
|
@@ -11,13 +11,12 @@ const TagList = memo(() => {
|
|
|
11
11
|
const keywords = useMarketStore((s) => s.searchKeywords);
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<Flexbox gap={
|
|
14
|
+
<Flexbox gap={8} horizontal style={{ flexWrap: 'wrap' }}>
|
|
15
15
|
{agentTagList.map((item) => (
|
|
16
16
|
<Button
|
|
17
17
|
key={item}
|
|
18
18
|
onClick={() => useMarketStore.setState({ searchKeywords: item })}
|
|
19
19
|
shape={'round'}
|
|
20
|
-
size={'small'}
|
|
21
20
|
type={keywords === item ? 'primary' : 'default'}
|
|
22
21
|
>
|
|
23
22
|
{startCase(item)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
import ResponsiveLayout from '@/components/ResponsiveLayout';
|
|
4
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
5
|
+
|
|
6
|
+
import Desktop from './(desktop)/layout';
|
|
7
|
+
import Mobile from './(mobile)/layout.mobile';
|
|
8
|
+
|
|
9
|
+
export default ({ children }: PropsWithChildren) => (
|
|
10
|
+
<ResponsiveLayout Desktop={Desktop} Mobile={Mobile} isMobile={isMobileDevice}>
|
|
11
|
+
{children}
|
|
12
|
+
</ResponsiveLayout>
|
|
13
|
+
);
|
package/src/app/market/page.tsx
CHANGED
|
@@ -4,10 +4,8 @@ import { LOBE_LOCALE_COOKIE } from '@/const/locale';
|
|
|
4
4
|
import { getAgentIndexJSON } from '@/const/url';
|
|
5
5
|
import { Locales } from '@/locales/resources';
|
|
6
6
|
import { LobeChatAgentsMarketIndex } from '@/types/market';
|
|
7
|
-
import { isMobileDevice } from '@/utils/responsive';
|
|
8
7
|
|
|
9
|
-
import
|
|
10
|
-
import MobilePage from './(mobile)';
|
|
8
|
+
import Market from './index';
|
|
11
9
|
|
|
12
10
|
const getAgentList = async (): Promise<LobeChatAgentsMarketIndex> => {
|
|
13
11
|
const cookieStore = cookies();
|
|
@@ -22,11 +20,10 @@ const getAgentList = async (): Promise<LobeChatAgentsMarketIndex> => {
|
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
const Page = async () => {
|
|
26
24
|
const data = await getAgentList();
|
|
27
|
-
const mobile = isMobileDevice();
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return <Page defaultAgents={data.agents} />;
|
|
26
|
+
return <Market defaultAgents={data.agents} />;
|
|
32
27
|
};
|
|
28
|
+
|
|
29
|
+
export default Page;
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import isEqual from 'fast-deep-equal';
|
|
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;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { memo } from 'react';
|
|
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;
|
|
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
|
|
5
5
|
import { useGlobalStore } from '@/store/global';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const Index = memo(() => {
|
|
8
8
|
const { t } = useTranslation('setting');
|
|
9
9
|
const tab = useGlobalStore((s) => s.settingsTab);
|
|
10
10
|
|
|
@@ -19,4 +19,4 @@ const Header = memo(() => {
|
|
|
19
19
|
);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export default
|
|
22
|
+
export default Index;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useResponsive } from 'antd-style';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
|
|
4
|
+
import Desktop from './Desktop';
|
|
5
|
+
import Mobile from './Mobile';
|
|
6
|
+
|
|
7
|
+
const Header = memo(() => {
|
|
8
|
+
const { mobile } = useResponsive();
|
|
9
|
+
const Render = mobile ? Mobile : Desktop;
|
|
10
|
+
|
|
11
|
+
return <Render />;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export default Header;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { PropsWithChildren
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
3
3
|
|
|
4
4
|
import SafeSpacing from '@/components/SafeSpacing';
|
|
5
|
-
import
|
|
6
|
-
import { useSwitchSideBarOnInit } from '@/store/global';
|
|
7
|
-
import { SidebarTabKey } from '@/store/global/initialState';
|
|
5
|
+
import AppLayout from '@/layout/AppLayout';
|
|
8
6
|
|
|
7
|
+
import Header from '../features/Header';
|
|
9
8
|
import SideBar from '../features/SideBar';
|
|
10
|
-
import Header from './features/Header';
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
useSwitchSideBarOnInit(SidebarTabKey.Setting);
|
|
10
|
+
const SettingLayout = ({ children }: PropsWithChildren) => {
|
|
14
11
|
return (
|
|
15
|
-
<
|
|
12
|
+
<AppLayout>
|
|
16
13
|
<SideBar />
|
|
17
14
|
<Flexbox flex={1} height={'100vh'} style={{ position: 'relative' }}>
|
|
18
15
|
<Header />
|
|
@@ -23,6 +20,8 @@ export default memo(({ children }: PropsWithChildren) => {
|
|
|
23
20
|
</Center>
|
|
24
21
|
</Flexbox>
|
|
25
22
|
</Flexbox>
|
|
26
|
-
</
|
|
23
|
+
</AppLayout>
|
|
27
24
|
);
|
|
28
|
-
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default SettingLayout;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import PageTitle from '@/components/PageTitle';
|
|
7
|
+
import ResponsiveLayout from '@/components/ResponsiveLayout';
|
|
8
|
+
import { useIsMobile } from '@/hooks/useIsMobile';
|
|
9
|
+
import { useSwitchSideBarOnInit } from '@/store/global';
|
|
10
|
+
import { SidebarTabKey } from '@/store/global/initialState';
|
|
11
|
+
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
12
|
+
|
|
13
|
+
import MobileLayout from '../layout.mobile';
|
|
14
|
+
import DesktopLayout from './Desktop';
|
|
15
|
+
|
|
16
|
+
const Setting = ({ children }: PropsWithChildren) => {
|
|
17
|
+
const { t } = useTranslation('setting');
|
|
18
|
+
const pageTitle = genSiteHeadTitle(t('header.global'));
|
|
19
|
+
|
|
20
|
+
useSwitchSideBarOnInit(SidebarTabKey.Setting);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<PageTitle title={pageTitle} />
|
|
25
|
+
<ResponsiveLayout Desktop={DesktopLayout} Mobile={MobileLayout} isMobile={useIsMobile}>
|
|
26
|
+
{children}
|
|
27
|
+
</ResponsiveLayout>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default Setting;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
import { Flexbox } from 'react-layout-kit';
|
|
5
|
+
|
|
6
|
+
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
7
|
+
|
|
8
|
+
import Header from './features/Header';
|
|
9
|
+
|
|
10
|
+
const SettingLayout = ({ children }: PropsWithChildren) => (
|
|
11
|
+
<AppMobileLayout navBar={<Header />}>
|
|
12
|
+
<Flexbox style={{ overflow: 'auto' }}>{children}</Flexbox>
|
|
13
|
+
</AppMobileLayout>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default SettingLayout;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
import ResponsiveLayout from '@/components/ResponsiveLayout';
|
|
4
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
5
|
+
|
|
6
|
+
import Desktop from './layout.desktop';
|
|
7
|
+
import Mobile from './layout.mobile';
|
|
8
|
+
|
|
9
|
+
const Layout = ({ children }: PropsWithChildren) => (
|
|
10
|
+
<ResponsiveLayout Desktop={Desktop} Mobile={Mobile} isMobile={isMobileDevice}>
|
|
11
|
+
{children}
|
|
12
|
+
</ResponsiveLayout>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default Layout;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { memo } from 'react';
|
|
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;
|
|
@@ -9,7 +9,7 @@ import { useExportConfig } from '@/hooks/useExportConfig';
|
|
|
9
9
|
import { useImportConfig } from '@/hooks/useImportConfig';
|
|
10
10
|
import { useGlobalStore } from '@/store/global';
|
|
11
11
|
|
|
12
|
-
import Item from '
|
|
12
|
+
import Item from '../features/SideBar/Item';
|
|
13
13
|
|
|
14
14
|
const ExtraList = memo(() => {
|
|
15
15
|
const { t } = useTranslation('common');
|
|
@@ -6,15 +6,16 @@ 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';
|
|
9
10
|
import AgentCardBanner from '@/app/market/features/AgentCard/AgentCardBanner';
|
|
10
11
|
import AvatarWithUpload from '@/features/AvatarWithUpload';
|
|
12
|
+
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
11
13
|
import { useGlobalStore, useSwitchSideBarOnInit } from '@/store/global';
|
|
12
14
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
13
15
|
import { AVATAR } from '@/store/session/slices/chat/actions/share';
|
|
14
16
|
|
|
15
|
-
import List from '
|
|
16
|
-
import ExtraList from '
|
|
17
|
-
import Layout from './layout.mobile';
|
|
17
|
+
import List from '../features/SideBar/List';
|
|
18
|
+
import ExtraList from './ExtraList';
|
|
18
19
|
|
|
19
20
|
const useStyles = createStyles(({ css, token }) => ({
|
|
20
21
|
divider: css`
|
|
@@ -28,12 +29,11 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
|
28
29
|
}));
|
|
29
30
|
|
|
30
31
|
const Setting = memo(() => {
|
|
31
|
-
useSwitchSideBarOnInit(SidebarTabKey.Setting);
|
|
32
32
|
const avatar = useGlobalStore((s) => s.settings.avatar);
|
|
33
33
|
const { styles } = useStyles();
|
|
34
|
-
|
|
34
|
+
useSwitchSideBarOnInit(SidebarTabKey.Setting);
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
36
|
+
<AppMobileLayout navBar={<Header />} showTabBar>
|
|
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
|
+
</AppMobileLayout>
|
|
58
58
|
);
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
export { default } from './common/page';
|
|
@@ -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 AppLayout from '@/layout/AppLayout';
|
|
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
|
+
<AppLayout>
|
|
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} style={{ maxWidth: 1024 }}>
|
|
25
25
|
{children}
|
|
26
26
|
</Flexbox>
|
|
27
27
|
</Center>
|
|
28
|
-
</
|
|
28
|
+
</AppLayout>
|
|
29
29
|
);
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useResponsive } from 'antd-style';
|
|
4
|
+
import { PropsWithChildren, memo } from 'react';
|
|
5
|
+
|
|
6
|
+
import Mobile from '../MobileLayout';
|
|
7
|
+
import Desktop from './Desktop';
|
|
8
|
+
|
|
9
|
+
const ResponsiveLayout = memo<PropsWithChildren>(({ children }) => {
|
|
10
|
+
const { mobile } = useResponsive();
|
|
11
|
+
|
|
12
|
+
return mobile ? <Mobile>{children}</Mobile> : <Desktop>{children}</Desktop>;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default ResponsiveLayout;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Logo, MobileNavBar } from '@lobehub/ui';
|
|
4
|
+
import { useTheme } from 'antd-style';
|
|
5
|
+
import { PropsWithChildren, memo } from 'react';
|
|
6
|
+
|
|
7
|
+
import AppMobileLayout from '@/layout/AppMobileLayout';
|
|
8
|
+
|
|
9
|
+
const MobileLayout = memo<PropsWithChildren>(({ children }) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<AppMobileLayout
|
|
14
|
+
navBar={<MobileNavBar center={<Logo type={'text'} />} />}
|
|
15
|
+
showTabBar
|
|
16
|
+
style={{ background: theme.colorBgLayout }}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</AppMobileLayout>
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default MobileLayout;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { LogoThree } from '@lobehub/ui';
|
|
2
|
+
import { useResponsive } from 'antd-style';
|
|
2
3
|
import { memo, useMemo } from 'react';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
5
|
|
|
5
6
|
import { genSize, useStyles } from './style';
|
|
6
7
|
|
|
7
|
-
const Hero = memo<{
|
|
8
|
+
const Hero = memo<{ width: number }>(({ width }) => {
|
|
8
9
|
const size = useMemo(
|
|
9
10
|
() => ({
|
|
10
11
|
base: genSize(width / 3.5, 240),
|
|
@@ -15,7 +16,7 @@ const Hero = memo<{ mobile?: boolean; width: number }>(({ width, mobile }) => {
|
|
|
15
16
|
[width],
|
|
16
17
|
);
|
|
17
18
|
const { styles } = useStyles(size.base);
|
|
18
|
-
|
|
19
|
+
const { mobile } = useResponsive();
|
|
19
20
|
const { t } = useTranslation('welcome');
|
|
20
21
|
|
|
21
22
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Icon } from '@lobehub/ui';
|
|
3
|
+
import { GridShowcase, 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,12 +16,13 @@ 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 }>(() => {
|
|
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
|
+
|
|
25
26
|
const { styles } = useStyles();
|
|
26
27
|
|
|
27
28
|
const switchSession = useSessionStore((s) => s.switchSession);
|
|
@@ -31,38 +32,34 @@ const Banner = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
|
31
32
|
}, []);
|
|
32
33
|
|
|
33
34
|
return (
|
|
34
|
-
|
|
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
|
-
</Button>
|
|
63
|
-
</Link>
|
|
64
|
-
</Flexbox>
|
|
65
|
-
</>
|
|
35
|
+
<Flexbox height={'80vh'} style={{ paddingTop: '10vh' }}>
|
|
36
|
+
<GridShowcase>
|
|
37
|
+
<div className={styles.container} ref={ref}>
|
|
38
|
+
<Hero width={width} />
|
|
39
|
+
</div>
|
|
40
|
+
<Flexbox gap={16} horizontal style={{ marginTop: 16 }}>
|
|
41
|
+
<Upload maxCount={1} onChange={handleImport} showUploadList={false}>
|
|
42
|
+
<Button size={'large'}>{t('button.import')}</Button>
|
|
43
|
+
</Upload>
|
|
44
|
+
<Link
|
|
45
|
+
href={SESSION_CHAT_URL()}
|
|
46
|
+
onClick={(e) => {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
switchSession();
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<Button size={'large'} type={'primary'}>
|
|
52
|
+
<Flexbox align={'center'} gap={4} horizontal>
|
|
53
|
+
{t('button.start')}
|
|
54
|
+
<Icon icon={SendHorizonal} />
|
|
55
|
+
</Flexbox>
|
|
56
|
+
</Button>
|
|
57
|
+
</Link>
|
|
58
|
+
</Flexbox>
|
|
59
|
+
</GridShowcase>
|
|
60
|
+
{/*TODO:暂时隐藏,待模板完成后再补回*/}
|
|
61
|
+
{/*<AgentTemplate width={width} />*/}
|
|
62
|
+
</Flexbox>
|
|
66
63
|
);
|
|
67
64
|
});
|
|
68
65
|
|
|
@@ -1,13 +1,8 @@
|
|
|
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 }) => {
|
|
5
5
|
return {
|
|
6
|
-
buttonGroup: css`
|
|
7
|
-
.${prefixCls}-upload {
|
|
8
|
-
width: 100% !important;
|
|
9
|
-
}
|
|
10
|
-
`,
|
|
11
6
|
container: css`
|
|
12
7
|
z-index: 10;
|
|
13
8
|
|
|
@@ -54,12 +49,8 @@ export const useStyles = createStyles(({ css, token, stylish, cx, prefixCls }) =
|
|
|
54
49
|
view: cx(
|
|
55
50
|
stylish.noScrollbar,
|
|
56
51
|
css`
|
|
57
|
-
position: relative;
|
|
58
|
-
|
|
59
52
|
overflow-x: hidden;
|
|
60
53
|
overflow-y: auto;
|
|
61
|
-
|
|
62
|
-
max-width: 1024px;
|
|
63
54
|
height: 100vh;
|
|
64
55
|
padding: 32px 16px;
|
|
65
56
|
`,
|