@lobehub/chat 0.83.10 → 0.84.0-beta.2

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.
Files changed (152) hide show
  1. package/.dockerignore +10 -0
  2. package/.github/workflows/release.yml +3 -0
  3. package/.releaserc.js +14 -1
  4. package/CHANGELOG.md +27 -14
  5. package/Dockerfile +47 -0
  6. package/next.config.mjs +3 -0
  7. package/package.json +4 -2
  8. package/src/app/chat/(desktop)/features/{ChatHeader.tsx → ChatHeader/Desktop.tsx} +2 -2
  9. package/src/app/chat/(desktop)/features/ChatHeader/index.tsx +14 -0
  10. package/src/app/chat/(desktop)/features/{ChatInput.tsx → ChatInput/Desktop.tsx} +7 -5
  11. package/src/app/chat/(desktop)/features/ChatInput/index.tsx +22 -0
  12. package/src/app/chat/(desktop)/features/{SessionHeader.tsx → SessionHeader/Desktop.tsx} +1 -1
  13. package/src/app/chat/(desktop)/features/SessionHeader/index.tsx +14 -0
  14. package/src/app/chat/(desktop)/features/{SessionList.tsx → SessionList/Desktop.tsx} +4 -5
  15. package/src/app/chat/(desktop)/features/SessionList/index.tsx +20 -0
  16. package/src/app/chat/(desktop)/features/{SideBar.tsx → SideBar/Desktop.tsx} +4 -5
  17. package/src/app/chat/(desktop)/features/SideBar/index.tsx +20 -0
  18. package/src/app/chat/(desktop)/index.tsx +8 -14
  19. package/src/app/chat/(desktop)/{layout.desktop.tsx → layout/Desktop.tsx} +8 -7
  20. package/src/app/chat/(desktop)/layout/index.tsx +25 -0
  21. package/src/app/chat/(mobile)/features/ChatHeader.tsx +1 -54
  22. package/src/app/chat/(mobile)/features/ChatInput.tsx +8 -28
  23. package/src/app/chat/(mobile)/features/SessionList.tsx +8 -13
  24. package/src/app/chat/(mobile)/features/Topics.tsx +12 -0
  25. package/src/app/chat/(mobile)/index.tsx +5 -3
  26. package/src/app/chat/(mobile)/layout.tsx +15 -0
  27. package/src/app/chat/(mobile)/mobile/page.tsx +20 -2
  28. package/src/app/chat/components/ChatHeader/Mobile.tsx +54 -0
  29. package/src/app/chat/{features → components}/ChatHeader/ShareButton/Preview.tsx +9 -25
  30. package/src/app/chat/{features → components}/ChatHeader/ShareButton/style.ts +7 -7
  31. package/src/app/chat/components/ChatInput/Mobile.tsx +35 -0
  32. package/src/app/chat/{features/ChatInputContent → components/ChatInput}/index.tsx +1 -3
  33. package/src/app/chat/{(mobile)/features/TopicList.tsx → components/Inspector/Mobile.tsx} +4 -6
  34. package/src/app/chat/{features/TopicListContent → components/Inspector}/index.tsx +1 -3
  35. package/src/app/chat/{features/SessionListContent → components/SessionList}/Inbox/index.tsx +5 -7
  36. package/src/app/chat/components/SessionList/Mobile.tsx +16 -0
  37. package/src/app/chat/{features/SessionListContent → components/SessionList}/index.tsx +1 -3
  38. package/src/app/chat/layout.tsx +15 -0
  39. package/src/app/chat/page.tsx +1 -3
  40. package/src/app/chat/settings/(desktop)/layout.desktop.tsx +15 -10
  41. package/src/app/chat/settings/(mobile)/layout.mobile.tsx +8 -4
  42. package/src/app/chat/settings/layout.tsx +14 -0
  43. package/src/app/chat/settings/page.tsx +33 -9
  44. package/src/app/market/(desktop)/{features/AgentDetail.tsx → AgentDetail/Desktop.tsx} +3 -5
  45. package/src/app/market/(desktop)/AgentDetail/index.tsx +16 -0
  46. package/src/app/market/(desktop)/Header/index.tsx +13 -0
  47. package/src/app/market/(desktop)/{layout.desktop.tsx → layout/Desktop.tsx} +5 -5
  48. package/src/app/market/(desktop)/layout/index.tsx +17 -0
  49. package/src/app/market/(mobile)/AgentDetail.tsx +12 -0
  50. package/src/app/market/(mobile)/layout.mobile.tsx +5 -5
  51. package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/Header.tsx +0 -1
  52. package/src/app/market/{(mobile)/features/AgentDetail.tsx → components/AgentDetail/Mobile.tsx} +4 -6
  53. package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/index.tsx +1 -3
  54. package/src/app/market/features/TagList/index.tsx +1 -2
  55. package/src/app/market/layout.tsx +13 -0
  56. package/src/app/market/page.tsx +5 -8
  57. package/src/app/settings/agent/page.tsx +31 -2
  58. package/src/app/settings/common/page.tsx +14 -2
  59. package/src/app/settings/{(desktop)/features/Header.tsx → features/Header/Desktop.tsx} +2 -2
  60. package/src/app/settings/{(mobile)/features/Header/index.tsx → features/Header/Mobile.tsx} +0 -1
  61. package/src/app/settings/features/Header/index.tsx +14 -0
  62. package/src/app/settings/{(desktop)/layout.desktop.tsx → layout.desktop/Desktop.tsx} +9 -10
  63. package/src/app/settings/layout.desktop/index.tsx +32 -0
  64. package/src/app/settings/layout.mobile.tsx +16 -0
  65. package/src/app/settings/layout.tsx +15 -0
  66. package/src/app/settings/llm/page.tsx +14 -2
  67. package/src/app/settings/{(mobile)/features → mobile}/ExtraList.tsx +1 -1
  68. package/src/app/settings/{(mobile)/mobile → mobile}/index.tsx +7 -7
  69. package/src/app/settings/mobile/page.tsx +7 -0
  70. package/src/app/settings/page.tsx +1 -14
  71. package/src/app/welcome/{(desktop)/layout.desktop.tsx → DesktopLayout/Desktop.tsx} +4 -4
  72. package/src/app/welcome/DesktopLayout/index.tsx +15 -0
  73. package/src/app/welcome/MobileLayout.tsx +23 -0
  74. package/src/app/welcome/features/Banner/Hero.tsx +3 -2
  75. package/src/app/welcome/features/Banner/index.tsx +31 -34
  76. package/src/app/welcome/features/Banner/style.ts +1 -10
  77. package/src/app/welcome/layout.tsx +22 -0
  78. package/src/app/welcome/page.tsx +7 -9
  79. package/src/{layout/ResponsiveLayout.server.tsx → components/ResponsiveLayout.tsx} +3 -4
  80. package/src/features/MobileTabBar/index.tsx +1 -1
  81. package/src/features/SideBar/BottomActions.tsx +1 -1
  82. package/src/layout/{AppLayout.desktop.tsx → AppLayout.tsx} +2 -2
  83. package/src/layout/{AppLayout.mobile.tsx → AppMobileLayout.tsx} +2 -2
  84. package/src/layout/GlobalLayout/StoreHydration.tsx +1 -15
  85. package/src/store/session/slices/session/initialState.ts +2 -2
  86. package/src/app/chat/(desktop)/layout.responsive.tsx +0 -12
  87. package/src/app/chat/(mobile)/layout.mobile.tsx +0 -17
  88. package/src/app/chat/(mobile)/mobile/index.tsx +0 -19
  89. package/src/app/chat/(mobile)/mobile/layout.mobile.tsx +0 -11
  90. package/src/app/chat/settings/(desktop)/index.tsx +0 -14
  91. package/src/app/chat/settings/(desktop)/layout.responsive.tsx +0 -12
  92. package/src/app/chat/settings/(mobile)/index.tsx +0 -14
  93. package/src/app/chat/settings/features/EditPage.tsx +0 -38
  94. package/src/app/market/(desktop)/index.tsx +0 -12
  95. package/src/app/market/(desktop)/layout.responsive.tsx +0 -16
  96. package/src/app/market/(mobile)/index.tsx +0 -12
  97. package/src/app/settings/(desktop)/index.tsx +0 -17
  98. package/src/app/settings/(desktop)/layout.responsive.tsx +0 -14
  99. package/src/app/settings/(mobile)/features/Header/Home.tsx +0 -8
  100. package/src/app/settings/(mobile)/index.tsx +0 -3
  101. package/src/app/settings/(mobile)/layout.mobile.tsx +0 -19
  102. package/src/app/settings/(mobile)/mobile/layout.mobile.tsx +0 -14
  103. package/src/app/settings/agent/Agent.tsx +0 -30
  104. package/src/app/settings/agent/index.tsx +0 -23
  105. package/src/app/settings/agent/layout.tsx +0 -1
  106. package/src/app/settings/common/index.tsx +0 -23
  107. package/src/app/settings/common/layout.tsx +0 -1
  108. package/src/app/settings/layout.server.tsx +0 -12
  109. package/src/app/settings/llm/index.tsx +0 -23
  110. package/src/app/settings/llm/layout.tsx +0 -1
  111. package/src/app/welcome/(desktop)/features/Showcase.tsx +0 -23
  112. package/src/app/welcome/(desktop)/index.tsx +0 -19
  113. package/src/app/welcome/(desktop)/layout.responsive.tsx +0 -14
  114. package/src/app/welcome/(mobile)/features/Header.tsx +0 -6
  115. package/src/app/welcome/(mobile)/features/Showcase.tsx +0 -16
  116. package/src/app/welcome/(mobile)/index.tsx +0 -10
  117. package/src/app/welcome/(mobile)/layout.mobile.tsx +0 -20
  118. package/src/components/ResponsiveIndex.tsx +0 -17
  119. package/src/layout/ResponsiveLayout.client.tsx +0 -18
  120. /package/src/app/chat/{features → components}/ChatHeader/PluginTag/PluginStatus.tsx +0 -0
  121. /package/src/app/chat/{features → components}/ChatHeader/PluginTag/index.tsx +0 -0
  122. /package/src/app/chat/{features → components}/ChatHeader/ShareButton/Inner.tsx +0 -0
  123. /package/src/app/chat/{features → components}/ChatHeader/ShareButton/index.tsx +0 -0
  124. /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/ActionBar/ActionLeft.tsx +0 -0
  125. /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/ActionBar/ActionRight.tsx +0 -0
  126. /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/ActionBar/Token.tsx +0 -0
  127. /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/Footer/SaveTopic.tsx +0 -0
  128. /package/src/app/chat/{features/ChatInputContent → components/ChatInput}/Footer/index.tsx +0 -0
  129. /package/src/app/chat/{features/TopicListContent → components/Inspector}/SystemRole/Header.tsx +0 -0
  130. /package/src/app/chat/{features/TopicListContent → components/Inspector}/SystemRole/index.tsx +0 -0
  131. /package/src/app/chat/{features/TopicListContent → components/Inspector}/SystemRole/style.ts +0 -0
  132. /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/DefaultContent.tsx +0 -0
  133. /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/SkeletonList.tsx +0 -0
  134. /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/TopicContent.tsx +0 -0
  135. /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/TopicItem.tsx +0 -0
  136. /package/src/app/chat/{features/TopicListContent → components/Inspector}/Topic/index.tsx +0 -0
  137. /package/src/app/chat/{features/TopicListContent → components/Inspector}/TopicSearchBar/index.tsx +0 -0
  138. /package/src/app/chat/{features/SessionListContent → components/SessionList}/CollapseGroup/index.tsx +0 -0
  139. /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/AddButton.tsx +0 -0
  140. /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/Item/Actions.tsx +0 -0
  141. /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/Item/index.tsx +0 -0
  142. /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/SkeletonList.tsx +0 -0
  143. /package/src/app/chat/{features/SessionListContent → components/SessionList}/List/index.tsx +0 -0
  144. /package/src/app/chat/features/{PageTitle/index.tsx → PageTitle.tsx} +0 -0
  145. /package/src/app/market/(desktop)/{features/Header.tsx → Header/Desktop.tsx} +0 -0
  146. /package/src/app/market/(mobile)/{features/Header.tsx → Header.tsx} +0 -0
  147. /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/Comment.tsx +0 -0
  148. /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/Loading.tsx +0 -0
  149. /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/TokenTag.tsx +0 -0
  150. /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/index.tsx +0 -0
  151. /package/src/app/market/{features/AgentDetailContent → components/AgentDetail}/AgentInfo/style.ts +0 -0
  152. /package/src/app/welcome/{(desktop)/features/Footer.tsx → features/Footer/index.tsx} +0 -0
@@ -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, prefixCls }) => {
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
  `,
@@ -0,0 +1,22 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ import { isMobileDevice } from '@/utils/responsive';
4
+
5
+ import Desktop from './DesktopLayout';
6
+ import Mobile from './MobileLayout';
7
+ import Footer from './features/Footer';
8
+
9
+ const Layout = ({ children }: PropsWithChildren) => {
10
+ const mobile = isMobileDevice();
11
+
12
+ return mobile ? (
13
+ <Mobile>{children}</Mobile>
14
+ ) : (
15
+ <Desktop>
16
+ {children}
17
+ <Footer />
18
+ </Desktop>
19
+ );
20
+ };
21
+
22
+ export default Layout;
@@ -1,14 +1,12 @@
1
- import { isMobileDevice } from '@/utils/responsive';
1
+ import { t } from 'i18next';
2
+ import { Metadata } from 'next';
2
3
 
3
- import DesktopPage from './(desktop)';
4
- import MobilePage from './(mobile)';
4
+ import Banner from './features/Banner';
5
5
 
6
- const Page = () => {
7
- const mobile = isMobileDevice();
6
+ export const generateMetadata = (): Metadata => ({
7
+ title: t('header', { ns: 'welcome' }),
8
+ });
8
9
 
9
- const Page = mobile ? MobilePage : DesktopPage;
10
-
11
- return <Page />;
12
- };
10
+ const Page = () => <Banner />;
13
11
 
14
12
  export default Page;
@@ -1,14 +1,13 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
2
 
3
- import { isMobileDevice } from '@/utils/responsive';
4
-
5
3
  interface ServerResponsiveLayoutProps {
6
4
  Desktop: (props: PropsWithChildren) => ReactNode;
7
5
  Mobile: (props: PropsWithChildren) => ReactNode;
8
6
  children?: ReactNode;
7
+ isMobile: () => boolean;
9
8
  }
10
- const ResponsiveLayout = ({ children, Desktop, Mobile }: ServerResponsiveLayoutProps) => {
11
- const mobile = isMobileDevice();
9
+ const ResponsiveLayout = ({ children, Desktop, Mobile, isMobile }: ServerResponsiveLayoutProps) => {
10
+ const mobile = isMobile();
12
11
 
13
12
  return mobile ? <Mobile>{children}</Mobile> : <Desktop>{children}</Desktop>;
14
13
  };
@@ -49,7 +49,7 @@ export default memo<{ className?: string }>(({ className }) => {
49
49
  key: SidebarTabKey.Setting,
50
50
  onClick: () => {
51
51
  setTab(SidebarTabKey.Setting);
52
- router.push('/settings');
52
+ router.push('/settings/mobile');
53
53
  },
54
54
  title: t('tab.setting'),
55
55
  },
@@ -102,7 +102,7 @@ const BottomActions = memo<BottomActionProps>(({ tab, setTab }) => {
102
102
  label: t('setting'),
103
103
  onClick: () => {
104
104
  setTab(SidebarTabKey.Setting);
105
- router.push('/settings/common');
105
+ router.push('/settings');
106
106
  },
107
107
  },
108
108
  ],
@@ -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 AppLayoutDesktop = memo<PropsWithChildren>(({ children }) => {
8
+ const AppLayout = memo<PropsWithChildren>(({ children }) => {
9
9
  const isPWA = useIsPWA();
10
10
  const theme = useTheme();
11
11
  return (
@@ -20,4 +20,4 @@ const AppLayoutDesktop = memo<PropsWithChildren>(({ children }) => {
20
20
  );
21
21
  });
22
22
 
23
- export default AppLayoutDesktop;
23
+ export default AppLayout;
@@ -43,7 +43,7 @@ interface AppMobileLayoutProps extends PropsWithChildren {
43
43
  title?: MobileNavBarTitleProps;
44
44
  }
45
45
 
46
- const AppLayoutMobile = memo<AppMobileLayoutProps>(
46
+ const AppMobileLayout = memo<AppMobileLayoutProps>(
47
47
  ({ children, showTabBar, navBar, style, className }) => {
48
48
  const { styles, cx } = useStyles();
49
49
 
@@ -67,4 +67,4 @@ const AppLayoutMobile = memo<AppMobileLayoutProps>(
67
67
  },
68
68
  );
69
69
 
70
- export default AppLayoutMobile;
70
+ export default AppMobileLayout;
@@ -1,14 +1,9 @@
1
- import { useResponsive } from 'antd-style';
2
1
  import { useRouter } from 'next/navigation';
3
2
  import { memo, useEffect } from 'react';
4
3
 
5
4
  import { useGlobalStore } from '@/store/global';
6
5
  import { usePluginStore } from '@/store/plugin';
7
- import {
8
- useEffectAfterSessionHydrated,
9
- useOnFinishHydrationSession,
10
- useSessionStore,
11
- } from '@/store/session';
6
+ import { useOnFinishHydrationSession, useSessionStore } from '@/store/session';
12
7
 
13
8
  const StoreHydration = memo(() => {
14
9
  const router = useRouter();
@@ -27,15 +22,6 @@ const StoreHydration = memo(() => {
27
22
  store.setState({ router });
28
23
  });
29
24
 
30
- const { mobile } = useResponsive();
31
-
32
- useEffectAfterSessionHydrated(
33
- (store) => {
34
- store.setState({ isMobile: mobile });
35
- },
36
- [mobile],
37
- );
38
-
39
25
  return null;
40
26
  });
41
27
 
@@ -33,7 +33,7 @@ export const initLobeSession: LobeAgentSession = {
33
33
 
34
34
  export const initInbox = merge({}, initLobeSession, {
35
35
  config: {
36
- systemRole: '',
36
+ systemRole: '你是一名 AI 助理',
37
37
  } as LobeAgentConfig,
38
38
  id: 'inbox',
39
39
  meta: {
@@ -42,7 +42,7 @@ export const initInbox = merge({}, initLobeSession, {
42
42
  } as Partial<LobeAgentSession>);
43
43
 
44
44
  export const initialSessionState: SessionState = {
45
- activeId: 'inbox',
45
+ activeId: undefined,
46
46
  inbox: initInbox,
47
47
  isMobile: false,
48
48
  searchKeywords: '',
@@ -1,12 +0,0 @@
1
- import { PropsWithChildren, memo } from 'react';
2
-
3
- import ResponsiveLayout from '@/layout/ResponsiveLayout.client';
4
-
5
- import Mobile from '../(mobile)/layout.mobile';
6
- import Desktop from './layout.desktop';
7
-
8
- export default memo(({ children }: PropsWithChildren) => (
9
- <ResponsiveLayout Desktop={Desktop} Mobile={Mobile}>
10
- {children}
11
- </ResponsiveLayout>
12
- ));
@@ -1,17 +0,0 @@
1
- 'use client';
2
-
3
- import { PropsWithChildren, memo } from 'react';
4
-
5
- import SessionHeader from '@/app/chat/(mobile)/features/SessionHeader';
6
- import AppLayoutMobile from '@/layout/AppLayout.mobile';
7
- import { useSwitchSideBarOnInit } from '@/store/global';
8
- import { SidebarTabKey } from '@/store/global/initialState';
9
-
10
- export default memo(({ children }: PropsWithChildren) => {
11
- useSwitchSideBarOnInit(SidebarTabKey.Chat);
12
- return (
13
- <AppLayoutMobile navBar={<SessionHeader />} showTabBar>
14
- {children}
15
- </AppLayoutMobile>
16
- );
17
- });
@@ -1,19 +0,0 @@
1
- 'use client';
2
-
3
- import { memo } from 'react';
4
- import { Flexbox } from 'react-layout-kit';
5
-
6
- import Conversation from '../../features/Conversation';
7
- import ChatInput from '../features/ChatInput';
8
- import TopicList from '../features/TopicList';
9
- import Layout from './layout.mobile';
10
-
11
- const Chat = memo(() => (
12
- <Layout>
13
- <Flexbox height={'calc(100vh - 44px)'} horizontal>
14
- <Conversation chatInput={<ChatInput />} mobile />
15
- <TopicList />
16
- </Flexbox>
17
- </Layout>
18
- ));
19
- export default Chat;
@@ -1,11 +0,0 @@
1
- 'use client';
2
-
3
- import { PropsWithChildren } from 'react';
4
-
5
- import AppLayoutMobile from '@/layout/AppLayout.mobile';
6
-
7
- import ChatHeader from '../features/ChatHeader';
8
-
9
- export default ({ children }: PropsWithChildren) => (
10
- <AppLayoutMobile navBar={<ChatHeader />}>{children}</AppLayoutMobile>
11
- );
@@ -1,14 +0,0 @@
1
- 'use client';
2
-
3
- import { memo } from 'react';
4
-
5
- import EditPage from '../features/EditPage';
6
- import Layout from './layout.responsive';
7
-
8
- const ChatSettings = memo(() => (
9
- <Layout>
10
- <EditPage />
11
- </Layout>
12
- ));
13
-
14
- export default ChatSettings;
@@ -1,12 +0,0 @@
1
- import { PropsWithChildren, memo } from 'react';
2
-
3
- import ResponsiveLayout from '@/layout/ResponsiveLayout.client';
4
-
5
- import Mobile from '../(mobile)/layout.mobile';
6
- import Desktop from './layout.desktop';
7
-
8
- export default memo(({ children }: PropsWithChildren) => (
9
- <ResponsiveLayout Desktop={Desktop} Mobile={Mobile}>
10
- {children}
11
- </ResponsiveLayout>
12
- ));
@@ -1,14 +0,0 @@
1
- 'use client';
2
-
3
- import { memo } from 'react';
4
-
5
- import EditPage from '../features/EditPage';
6
- import Layout from './layout.mobile';
7
-
8
- const ChatSettings = memo(() => (
9
- <Layout>
10
- <EditPage />
11
- </Layout>
12
- ));
13
-
14
- export default ChatSettings;
@@ -1,38 +0,0 @@
1
- 'use client';
2
-
3
- import isEqual from 'fast-deep-equal';
4
- import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- import PageTitle from '@/components/PageTitle';
8
- import AgentSetting from '@/features/AgentSetting';
9
- import { useSessionStore } from '@/store/session';
10
- import { agentSelectors } from '@/store/session/selectors';
11
- import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
12
-
13
- const EditPage = memo(() => {
14
- const { t } = useTranslation('setting');
15
- const config = useSessionStore(agentSelectors.currentAgentConfig, isEqual);
16
- const meta = useSessionStore(agentSelectors.currentAgentMeta, isEqual);
17
- const [updateAgentConfig, updateAgentMeta, title] = useSessionStore((s) => [
18
- s.updateAgentConfig,
19
- s.updateAgentMeta,
20
- agentSelectors.currentAgentTitle(s),
21
- ]);
22
-
23
- const pageTitle = genSiteHeadTitle(t('header.sessionWithName', { name: title }));
24
-
25
- return (
26
- <>
27
- <PageTitle title={pageTitle} />
28
- <AgentSetting
29
- config={config}
30
- meta={meta}
31
- onConfigChange={updateAgentConfig}
32
- onMetaChange={updateAgentMeta}
33
- />
34
- </>
35
- );
36
- });
37
-
38
- export default EditPage;
@@ -1,12 +0,0 @@
1
- import { memo } from 'react';
2
-
3
- import { AgentCardProps } from '@/app/market/features/AgentCard';
4
-
5
- import Index from '../index';
6
- import Layout from './layout.responsive';
7
-
8
- export default memo<AgentCardProps>((props) => (
9
- <Layout>
10
- <Index {...props} />
11
- </Layout>
12
- ));
@@ -1,16 +0,0 @@
1
- 'use client';
2
-
3
- import { PropsWithChildren } from 'react';
4
-
5
- import ResponsiveLayout from '@/layout/ResponsiveLayout.client';
6
-
7
- import Mobile from '../(mobile)/layout.mobile';
8
- import Desktop from './layout.desktop';
9
-
10
- const Market = ({ children }: PropsWithChildren) => (
11
- <ResponsiveLayout Desktop={Desktop} Mobile={Mobile}>
12
- {children}
13
- </ResponsiveLayout>
14
- );
15
-
16
- export default Market;
@@ -1,12 +0,0 @@
1
- import { memo } from 'react';
2
-
3
- import { AgentCardProps } from '@/app/market/features/AgentCard';
4
-
5
- import Index from '../index';
6
- import Layout from './layout.mobile';
7
-
8
- export default memo<AgentCardProps>((props) => (
9
- <Layout>
10
- <Index {...props} />
11
- </Layout>
12
- ));
@@ -1,17 +0,0 @@
1
- 'use client';
2
-
3
- import { memo } from 'react';
4
-
5
- import ResponsiveIndex from '@/components/ResponsiveIndex';
6
-
7
- import Mobile from '../(mobile)';
8
- import Common from '../common';
9
- import Layout from './layout.responsive';
10
-
11
- export default memo(() => (
12
- <ResponsiveIndex Mobile={Mobile}>
13
- <Layout>
14
- <Common />
15
- </Layout>
16
- </ResponsiveIndex>
17
- ));
@@ -1,14 +0,0 @@
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
- ));
@@ -1,8 +0,0 @@
1
- import { Logo, MobileNavBar } from '@lobehub/ui';
2
- import { memo } from 'react';
3
-
4
- const Header = memo(() => {
5
- return <MobileNavBar center={<Logo type={'text'} />} />;
6
- });
7
-
8
- export default Header;
@@ -1,3 +0,0 @@
1
- import Index from './mobile';
2
-
3
- export default () => <Index />;
@@ -1,19 +0,0 @@
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
- import { useSwitchSideBarOnInit } from '@/store/global';
8
- import { SidebarTabKey } from '@/store/global/initialState';
9
-
10
- import Header from './features/Header';
11
-
12
- export default memo(({ children }: PropsWithChildren) => {
13
- useSwitchSideBarOnInit(SidebarTabKey.Setting);
14
- return (
15
- <AppLayoutMobile navBar={<Header />}>
16
- <Flexbox style={{ overflow: 'auto' }}>{children}</Flexbox>
17
- </AppLayoutMobile>
18
- );
19
- });
@@ -1,14 +0,0 @@
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
- ));
@@ -1,30 +0,0 @@
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;
@@ -1,23 +0,0 @@
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
- });
@@ -1 +0,0 @@
1
- export { default } from '../layout.server';
@@ -1,23 +0,0 @@
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
- });
@@ -1 +0,0 @@
1
- export { default } from '../layout.server';
@@ -1,12 +0,0 @@
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
- ));
@@ -1,23 +0,0 @@
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
- });
@@ -1 +0,0 @@
1
- export { default } from '../layout.server';
@@ -1,23 +0,0 @@
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;
@@ -1,19 +0,0 @@
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
- ));