@lobehub/chat 0.84.0-beta.2 → 0.85.0

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 (203) hide show
  1. package/.github/workflows/lighthouse-badger-advanced.yml +74 -0
  2. package/.github/workflows/pre-welcome.yml +22 -0
  3. package/.github/workflows/release.yml +0 -3
  4. package/.github/workflows/sync.yml +11 -2
  5. package/.i18nrc.js +1 -2
  6. package/.releaserc.js +1 -14
  7. package/CHANGELOG.md +47 -10
  8. package/README.md +21 -0
  9. package/README.zh-CN.md +21 -0
  10. package/docs/Home.md +1 -0
  11. package/docs/Lighthouse.md +65 -0
  12. package/docs/Lighthouse.zh-CN.md +65 -0
  13. package/docs/_Sidebar.md +1 -0
  14. package/locales/en_US/common.json +5 -0
  15. package/locales/ja_JP/common.json +103 -0
  16. package/locales/ja_JP/empty.json +6 -0
  17. package/locales/ja_JP/error.json +42 -0
  18. package/locales/ja_JP/market.json +16 -0
  19. package/locales/ja_JP/plugin.json +107 -0
  20. package/locales/ja_JP/setting.json +225 -0
  21. package/locales/ja_JP/welcome.json +14 -0
  22. package/locales/ko_KR/common.json +103 -0
  23. package/locales/ko_KR/empty.json +6 -0
  24. package/locales/ko_KR/error.json +42 -0
  25. package/locales/ko_KR/market.json +16 -0
  26. package/locales/ko_KR/plugin.json +107 -0
  27. package/locales/ko_KR/setting.json +225 -0
  28. package/locales/ko_KR/welcome.json +14 -0
  29. package/locales/ru_RU/common.json +5 -0
  30. package/locales/zh_CN/common.json +5 -0
  31. package/locales/zh_TW/common.json +5 -0
  32. package/next.config.mjs +0 -3
  33. package/package.json +4 -4
  34. package/public/icons/maskable-icon-192x192.png +0 -0
  35. package/public/icons/maskable-icon-512x512.png +0 -0
  36. package/public/manifest.json +34 -5
  37. package/public/screenshots/screenshot-1.png +0 -0
  38. package/public/screenshots/screenshot-2.png +0 -0
  39. package/public/screenshots/screenshot-3.png +0 -0
  40. package/public/screenshots/screenshot-4.png +0 -0
  41. package/src/app/chat/(desktop)/features/{ChatHeader/Desktop.tsx → ChatHeader.tsx} +2 -2
  42. package/src/app/chat/(desktop)/features/{ChatInput/Desktop.tsx → ChatInput.tsx} +5 -7
  43. package/src/app/chat/(desktop)/features/{SessionHeader/Desktop.tsx → SessionHeader.tsx} +1 -1
  44. package/src/app/chat/(desktop)/features/{SessionList/Desktop.tsx → SessionList.tsx} +5 -4
  45. package/src/app/chat/(desktop)/features/{SideBar/Desktop.tsx → SideBar.tsx} +5 -4
  46. package/src/app/chat/(desktop)/index.tsx +14 -8
  47. package/src/app/chat/(desktop)/{layout/Desktop.tsx → layout.desktop.tsx} +7 -8
  48. package/src/app/chat/(desktop)/layout.responsive.tsx +12 -0
  49. package/src/app/chat/(mobile)/features/ChatHeader.tsx +54 -1
  50. package/src/app/chat/(mobile)/features/ChatInput.tsx +28 -8
  51. package/src/app/chat/(mobile)/features/SessionList.tsx +13 -8
  52. package/src/app/chat/{components/Inspector/Mobile.tsx → (mobile)/features/TopicList.tsx} +6 -4
  53. package/src/app/chat/(mobile)/index.tsx +3 -5
  54. package/src/app/chat/(mobile)/layout.mobile.tsx +17 -0
  55. package/src/app/chat/(mobile)/mobile/index.tsx +19 -0
  56. package/src/app/chat/(mobile)/mobile/layout.mobile.tsx +11 -0
  57. package/src/app/chat/(mobile)/mobile/page.tsx +2 -20
  58. package/src/app/chat/{components → features}/ChatHeader/ShareButton/Preview.tsx +25 -9
  59. package/src/app/chat/{components → features}/ChatHeader/ShareButton/style.ts +7 -7
  60. package/src/app/chat/{components/ChatInput → features/ChatInputContent}/Footer/SaveTopic.tsx +1 -1
  61. package/src/app/chat/{components/ChatInput → features/ChatInputContent}/index.tsx +3 -1
  62. package/src/app/chat/{components/SessionList → features/SessionListContent}/Inbox/index.tsx +7 -5
  63. package/src/app/chat/{components/SessionList → features/SessionListContent}/index.tsx +3 -1
  64. package/src/app/chat/{components/Inspector → features/TopicListContent}/index.tsx +3 -1
  65. package/src/app/chat/page.tsx +3 -1
  66. package/src/app/chat/settings/(desktop)/index.tsx +14 -0
  67. package/src/app/chat/settings/(desktop)/layout.desktop.tsx +10 -15
  68. package/src/app/chat/settings/(desktop)/layout.responsive.tsx +12 -0
  69. package/src/app/chat/settings/(mobile)/index.tsx +14 -0
  70. package/src/app/chat/settings/(mobile)/layout.mobile.tsx +4 -8
  71. package/src/app/chat/settings/features/EditPage.tsx +38 -0
  72. package/src/app/chat/settings/page.tsx +9 -33
  73. package/src/app/market/(desktop)/{AgentDetail/Desktop.tsx → features/AgentDetail.tsx} +5 -3
  74. package/src/app/market/(desktop)/index.tsx +12 -0
  75. package/src/app/market/(desktop)/{layout/Desktop.tsx → layout.desktop.tsx} +5 -5
  76. package/src/app/market/(desktop)/layout.responsive.tsx +16 -0
  77. package/src/app/market/{components/AgentDetail/Mobile.tsx → (mobile)/features/AgentDetail.tsx} +6 -4
  78. package/src/app/market/(mobile)/index.tsx +12 -0
  79. package/src/app/market/(mobile)/layout.mobile.tsx +5 -5
  80. package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/Header.tsx +1 -0
  81. package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/index.tsx +3 -1
  82. package/src/app/market/features/TagList/index.tsx +2 -1
  83. package/src/app/market/page.tsx +8 -5
  84. package/src/app/settings/{features/Header/Desktop.tsx → (desktop)/features/Header.tsx} +2 -2
  85. package/src/app/settings/(desktop)/index.tsx +17 -0
  86. package/src/app/settings/{layout.desktop/Desktop.tsx → (desktop)/layout.desktop.tsx} +10 -9
  87. package/src/app/settings/(desktop)/layout.responsive.tsx +14 -0
  88. package/src/app/settings/{mobile → (mobile)/features}/ExtraList.tsx +1 -1
  89. package/src/app/settings/(mobile)/features/Header/Home.tsx +8 -0
  90. package/src/app/settings/{features/Header/Mobile.tsx → (mobile)/features/Header/index.tsx} +1 -0
  91. package/src/app/settings/(mobile)/index.tsx +3 -0
  92. package/src/app/settings/(mobile)/layout.mobile.tsx +19 -0
  93. package/src/app/settings/{mobile → (mobile)/mobile}/index.tsx +9 -9
  94. package/src/app/settings/(mobile)/mobile/layout.mobile.tsx +14 -0
  95. package/src/app/settings/agent/Agent.tsx +30 -0
  96. package/src/app/settings/agent/index.tsx +23 -0
  97. package/src/app/settings/agent/layout.tsx +1 -0
  98. package/src/app/settings/agent/page.tsx +2 -31
  99. package/src/app/settings/common/index.tsx +23 -0
  100. package/src/app/settings/common/layout.tsx +1 -0
  101. package/src/app/settings/common/page.tsx +2 -14
  102. package/src/app/settings/features/SideBar/index.tsx +2 -0
  103. package/src/app/settings/features/UpgradeAlert.tsx +32 -0
  104. package/src/app/settings/layout.server.tsx +12 -0
  105. package/src/app/settings/llm/index.tsx +23 -0
  106. package/src/app/settings/llm/layout.tsx +1 -0
  107. package/src/app/settings/llm/page.tsx +2 -14
  108. package/src/app/settings/page.tsx +14 -1
  109. package/src/app/welcome/{features/Footer/index.tsx → (desktop)/features/Footer.tsx} +14 -3
  110. package/src/app/welcome/(desktop)/features/Showcase.tsx +23 -0
  111. package/src/app/welcome/(desktop)/index.tsx +19 -0
  112. package/src/app/welcome/{DesktopLayout/Desktop.tsx → (desktop)/layout.desktop.tsx} +5 -8
  113. package/src/app/welcome/(desktop)/layout.responsive.tsx +14 -0
  114. package/src/app/welcome/(mobile)/features/Header.tsx +6 -0
  115. package/src/app/welcome/(mobile)/features/Showcase.tsx +16 -0
  116. package/src/app/welcome/(mobile)/index.tsx +10 -0
  117. package/src/app/welcome/(mobile)/layout.mobile.tsx +20 -0
  118. package/src/app/welcome/features/Banner/Hero.tsx +2 -3
  119. package/src/app/welcome/features/Banner/index.tsx +34 -31
  120. package/src/app/welcome/features/Banner/style.ts +10 -1
  121. package/src/app/welcome/page.tsx +9 -7
  122. package/src/components/ResponsiveIndex.tsx +17 -0
  123. package/src/const/url.ts +2 -1
  124. package/src/const/version.ts +6 -0
  125. package/src/features/MobileTabBar/index.tsx +1 -1
  126. package/src/features/SideBar/BottomActions.tsx +107 -81
  127. package/src/layout/{AppLayout.tsx → AppLayout.desktop.tsx} +2 -2
  128. package/src/layout/{AppMobileLayout.tsx → AppLayout.mobile.tsx} +2 -2
  129. package/src/layout/GlobalLayout/AppTheme.tsx +3 -3
  130. package/src/layout/GlobalLayout/Locale.tsx +2 -2
  131. package/src/layout/GlobalLayout/StoreHydration.tsx +15 -1
  132. package/src/layout/ResponsiveLayout.client.tsx +18 -0
  133. package/src/{components/ResponsiveLayout.tsx → layout/ResponsiveLayout.server.tsx} +4 -3
  134. package/src/locales/default/common.ts +5 -0
  135. package/src/locales/options.ts +8 -1
  136. package/src/locales/resources/index.ts +4 -0
  137. package/src/locales/resources/ja_JP.ts +19 -0
  138. package/src/locales/resources/ko_KR.ts +19 -0
  139. package/src/services/latestVersion.ts +11 -1
  140. package/src/store/global/initialState.ts +11 -9
  141. package/src/store/global/slices/common.ts +12 -0
  142. package/src/store/session/slices/session/initialState.ts +2 -2
  143. package/src/utils/VersionController.ts +1 -1
  144. package/src/utils/responsive.ts +1 -1
  145. package/.dockerignore +0 -10
  146. package/Dockerfile +0 -47
  147. package/src/app/chat/(desktop)/features/ChatHeader/index.tsx +0 -14
  148. package/src/app/chat/(desktop)/features/ChatInput/index.tsx +0 -22
  149. package/src/app/chat/(desktop)/features/SessionHeader/index.tsx +0 -14
  150. package/src/app/chat/(desktop)/features/SessionList/index.tsx +0 -20
  151. package/src/app/chat/(desktop)/features/SideBar/index.tsx +0 -20
  152. package/src/app/chat/(desktop)/layout/index.tsx +0 -25
  153. package/src/app/chat/(mobile)/features/Topics.tsx +0 -12
  154. package/src/app/chat/(mobile)/layout.tsx +0 -15
  155. package/src/app/chat/components/ChatHeader/Mobile.tsx +0 -54
  156. package/src/app/chat/components/ChatInput/Mobile.tsx +0 -35
  157. package/src/app/chat/components/SessionList/Mobile.tsx +0 -16
  158. package/src/app/chat/layout.tsx +0 -15
  159. package/src/app/chat/settings/layout.tsx +0 -14
  160. package/src/app/market/(desktop)/AgentDetail/index.tsx +0 -16
  161. package/src/app/market/(desktop)/Header/index.tsx +0 -13
  162. package/src/app/market/(desktop)/layout/index.tsx +0 -17
  163. package/src/app/market/(mobile)/AgentDetail.tsx +0 -12
  164. package/src/app/market/layout.tsx +0 -13
  165. package/src/app/settings/features/Header/index.tsx +0 -14
  166. package/src/app/settings/layout.desktop/index.tsx +0 -32
  167. package/src/app/settings/layout.mobile.tsx +0 -16
  168. package/src/app/settings/layout.tsx +0 -15
  169. package/src/app/settings/mobile/page.tsx +0 -7
  170. package/src/app/welcome/DesktopLayout/index.tsx +0 -15
  171. package/src/app/welcome/MobileLayout.tsx +0 -23
  172. package/src/app/welcome/layout.tsx +0 -22
  173. /package/src/app/chat/{components → features}/ChatHeader/PluginTag/PluginStatus.tsx +0 -0
  174. /package/src/app/chat/{components → features}/ChatHeader/PluginTag/index.tsx +0 -0
  175. /package/src/app/chat/{components → features}/ChatHeader/ShareButton/Inner.tsx +0 -0
  176. /package/src/app/chat/{components → features}/ChatHeader/ShareButton/index.tsx +0 -0
  177. /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/ActionBar/ActionLeft.tsx +0 -0
  178. /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/ActionBar/ActionRight.tsx +0 -0
  179. /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/ActionBar/Token.tsx +0 -0
  180. /package/src/app/chat/{components/ChatInput → features/ChatInputContent}/Footer/index.tsx +0 -0
  181. /package/src/app/chat/features/{PageTitle.tsx → PageTitle/index.tsx} +0 -0
  182. /package/src/app/chat/{components/SessionList → features/SessionListContent}/CollapseGroup/index.tsx +0 -0
  183. /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/AddButton.tsx +0 -0
  184. /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/Item/Actions.tsx +0 -0
  185. /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/Item/index.tsx +0 -0
  186. /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/SkeletonList.tsx +0 -0
  187. /package/src/app/chat/{components/SessionList → features/SessionListContent}/List/index.tsx +0 -0
  188. /package/src/app/chat/{components/Inspector → features/TopicListContent}/SystemRole/Header.tsx +0 -0
  189. /package/src/app/chat/{components/Inspector → features/TopicListContent}/SystemRole/index.tsx +0 -0
  190. /package/src/app/chat/{components/Inspector → features/TopicListContent}/SystemRole/style.ts +0 -0
  191. /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/DefaultContent.tsx +0 -0
  192. /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/SkeletonList.tsx +0 -0
  193. /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/TopicContent.tsx +0 -0
  194. /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/TopicItem.tsx +0 -0
  195. /package/src/app/chat/{components/Inspector → features/TopicListContent}/Topic/index.tsx +0 -0
  196. /package/src/app/chat/{components/Inspector → features/TopicListContent}/TopicSearchBar/index.tsx +0 -0
  197. /package/src/app/market/(desktop)/{Header/Desktop.tsx → features/Header.tsx} +0 -0
  198. /package/src/app/market/(mobile)/{Header.tsx → features/Header.tsx} +0 -0
  199. /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/Comment.tsx +0 -0
  200. /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/Loading.tsx +0 -0
  201. /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/TokenTag.tsx +0 -0
  202. /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/index.tsx +0 -0
  203. /package/src/app/market/{components/AgentDetail → features/AgentDetailContent}/AgentInfo/style.ts +0 -0
@@ -1,15 +1,3 @@
1
- 'use client';
1
+ import Index from './index';
2
2
 
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;
3
+ export default () => <Index />;
@@ -5,6 +5,7 @@ import { Flexbox } from 'react-layout-kit';
5
5
 
6
6
  import FolderPanel from '@/features/FolderPanel';
7
7
 
8
+ import UpgradeAlert from '../UpgradeAlert';
8
9
  import List from './List';
9
10
 
10
11
  const useStyles = createStyles(({ stylish, token, css }) => ({
@@ -29,6 +30,7 @@ const SideBar = memo(() => {
29
30
  <Logo className={styles.logo} size={36} type={'text'} />
30
31
  </div>
31
32
  </Flexbox>
33
+ <UpgradeAlert />
32
34
  <List />
33
35
  </DraggablePanelBody>
34
36
  </FolderPanel>
@@ -0,0 +1,32 @@
1
+ import { Alert, Button } from 'antd';
2
+ import Link from 'next/link';
3
+ import { memo } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ import { MANUAL_UPGRADE_URL } from '@/const/version';
7
+ import { useGlobalStore } from '@/store/global';
8
+
9
+ const UpgradeAlert = memo(() => {
10
+ const [hasNewVersion, latestVersion] = useGlobalStore((s) => [s.hasNewVersion, s.latestVersion]);
11
+ const { t } = useTranslation('common');
12
+
13
+ return (
14
+ hasNewVersion && (
15
+ <Alert
16
+ action={
17
+ <Link href={MANUAL_UPGRADE_URL} target={'_blank'}>
18
+ <Button size={'small'} type={'primary'}>
19
+ {t('upgradeVersion.action')}
20
+ </Button>
21
+ </Link>
22
+ }
23
+ banner
24
+ closable
25
+ message={t('upgradeVersion.newVersion', { version: latestVersion })}
26
+ type={'info'}
27
+ />
28
+ )
29
+ );
30
+ });
31
+
32
+ export default UpgradeAlert;
@@ -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
- 'use client';
1
+ import Index from './index';
2
2
 
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;
3
+ export default () => <Index />;
@@ -1 +1,14 @@
1
- export { default } from './common/page';
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;
@@ -6,7 +6,7 @@ import { Book, Github } from 'lucide-react';
6
6
  import { memo } from 'react';
7
7
  import { Flexbox } from 'react-layout-kit';
8
8
 
9
- import { CHANGELOG, DISCORD, GITHUB } from '@/const/url';
9
+ import { DISCORD, GITHUB, WIKI } from '@/const/url';
10
10
 
11
11
  const Footer = memo(() => {
12
12
  const theme = useTheme();
@@ -21,9 +21,20 @@ const Footer = memo(() => {
21
21
  icon={DiscordIcon}
22
22
  onClick={() => window.open(DISCORD, '__blank')}
23
23
  size={'site'}
24
+ title={'Discord'}
25
+ />
26
+ <ActionIcon
27
+ icon={Book}
28
+ onClick={() => window.open(WIKI, '__blank')}
29
+ size={'site'}
30
+ title={'Wiki'}
31
+ />
32
+ <ActionIcon
33
+ icon={Github}
34
+ onClick={() => window.open(GITHUB, '__blank')}
35
+ size={'site'}
36
+ title={'GitHub'}
24
37
  />
25
- <ActionIcon icon={Book} onClick={() => window.open(CHANGELOG, '__blank')} size={'site'} />
26
- <ActionIcon icon={Github} onClick={() => window.open(GITHUB, '__blank')} size={'site'} />
27
38
  </Flexbox>
28
39
  </Flexbox>
29
40
  );
@@ -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
+ ));
@@ -1,16 +1,15 @@
1
1
  import { Logo } from '@lobehub/ui';
2
- import Link from 'next/link';
3
2
  import { PropsWithChildren, memo } from 'react';
4
3
  import { Center, Flexbox } from 'react-layout-kit';
5
4
 
6
- import AppLayout from '@/layout/AppLayout';
5
+ import AppLayoutDesktop from '@/layout/AppLayout.desktop';
7
6
 
8
7
  import { useStyles } from '../features/Banner/style';
9
8
 
10
9
  const Desktop = memo<PropsWithChildren>(({ children }) => {
11
10
  const { styles } = useStyles();
12
11
  return (
13
- <AppLayout>
12
+ <AppLayoutDesktop>
14
13
  <Center
15
14
  className={styles.layout}
16
15
  flex={1}
@@ -18,14 +17,12 @@ const Desktop = memo<PropsWithChildren>(({ children }) => {
18
17
  horizontal
19
18
  style={{ position: 'relative' }}
20
19
  >
21
- <Link href={'/'}>
22
- <Logo className={styles.logo} size={36} type={'text'} />
23
- </Link>
24
- <Flexbox className={styles.view} flex={1} style={{ maxWidth: 1024 }}>
20
+ <Logo className={styles.logo} size={36} type={'text'} />
21
+ <Flexbox className={styles.view} flex={1}>
25
22
  {children}
26
23
  </Flexbox>
27
24
  </Center>
28
- </AppLayout>
25
+ </AppLayoutDesktop>
29
26
  );
30
27
  });
31
28
 
@@ -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,6 @@
1
+ import { Logo, MobileNavBar } from '@lobehub/ui';
2
+ import { memo } from 'react';
3
+
4
+ const Header = memo(() => <MobileNavBar center={<Logo type={'text'} />} />);
5
+
6
+ export default Header;
@@ -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,10 @@
1
+ import { memo } from 'react';
2
+
3
+ import Showcase from './features/Showcase';
4
+ import Layout from './layout.mobile';
5
+
6
+ export default memo(() => (
7
+ <Layout>
8
+ <Showcase />
9
+ </Layout>
10
+ ));
@@ -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
- const { mobile } = useResponsive();
18
+
20
19
  const { t } = useTranslation('welcome');
21
20
 
22
21
  return (
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { GridShowcase, Icon } from '@lobehub/ui';
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
- <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>
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
  `,
@@ -1,12 +1,14 @@
1
- import { t } from 'i18next';
2
- import { Metadata } from 'next';
1
+ import { isMobileDevice } from '@/utils/responsive';
3
2
 
4
- import Banner from './features/Banner';
3
+ import DesktopPage from './(desktop)';
4
+ import MobilePage from './(mobile)';
5
5
 
6
- export const generateMetadata = (): Metadata => ({
7
- title: t('header', { ns: 'welcome' }),
8
- });
6
+ const Page = () => {
7
+ const mobile = isMobileDevice();
9
8
 
10
- const Page = () => <Banner />;
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;
package/src/const/url.ts CHANGED
@@ -8,7 +8,8 @@ import { DEFAULT_LANG, checkLang } from './locale';
8
8
  import { INBOX_SESSION_ID } from './session';
9
9
 
10
10
  export const GITHUB = pkg.homepage;
11
- export const CHANGELOG = `${pkg.homepage}/blob/master/CHANGELOG.md`;
11
+ export const CHANGELOG = urlJoin(GITHUB, 'blob/master/CHANGELOG.md');
12
+ export const WIKI = urlJoin(GITHUB, 'wiki');
12
13
  export const ABOUT = pkg.homepage;
13
14
  export const FEEDBACK = pkg.bugs.url;
14
15
  export const DISCORD = 'https://discord.gg/AYFPHvv2jT';
@@ -0,0 +1,6 @@
1
+ import pkg from '@/../package.json';
2
+
3
+ export const CURRENT_VERSION = pkg.version;
4
+
5
+ export const MANUAL_UPGRADE_URL =
6
+ 'https://github.com/lobehub/lobe-chat/blob/main/docs/Upstream-Sync.md';
@@ -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/mobile');
52
+ router.push('/settings');
53
53
  },
54
54
  title: t('tab.setting'),
55
55
  },