@lobehub/chat 0.152.3 → 0.152.5

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 (211) hide show
  1. package/CHANGELOG.md +4 -29
  2. package/locales/ar/common.json +0 -14
  3. package/locales/ar/setting.json +1 -4
  4. package/locales/bg-BG/common.json +0 -14
  5. package/locales/bg-BG/setting.json +1 -4
  6. package/locales/de-DE/common.json +0 -14
  7. package/locales/de-DE/setting.json +1 -4
  8. package/locales/en-US/common.json +0 -14
  9. package/locales/en-US/setting.json +1 -4
  10. package/locales/es-ES/common.json +0 -14
  11. package/locales/es-ES/setting.json +1 -4
  12. package/locales/fr-FR/common.json +0 -14
  13. package/locales/fr-FR/setting.json +1 -4
  14. package/locales/it-IT/common.json +0 -14
  15. package/locales/it-IT/setting.json +1 -4
  16. package/locales/ja-JP/common.json +0 -14
  17. package/locales/ja-JP/setting.json +1 -4
  18. package/locales/ko-KR/common.json +0 -14
  19. package/locales/ko-KR/setting.json +1 -4
  20. package/locales/nl-NL/common.json +0 -14
  21. package/locales/nl-NL/setting.json +1 -4
  22. package/locales/pl-PL/common.json +0 -14
  23. package/locales/pl-PL/setting.json +1 -4
  24. package/locales/pt-BR/common.json +0 -14
  25. package/locales/pt-BR/setting.json +1 -4
  26. package/locales/ru-RU/common.json +0 -14
  27. package/locales/ru-RU/setting.json +1 -4
  28. package/locales/tr-TR/common.json +0 -14
  29. package/locales/tr-TR/setting.json +1 -4
  30. package/locales/vi-VN/common.json +0 -14
  31. package/locales/vi-VN/setting.json +1 -4
  32. package/locales/zh-CN/common.json +0 -14
  33. package/locales/zh-CN/setting.json +1 -4
  34. package/locales/zh-TW/common.json +0 -14
  35. package/locales/zh-TW/setting.json +1 -4
  36. package/package.json +1 -1
  37. package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +11 -0
  38. package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +120 -7
  39. package/src/app/(main)/@nav/_layout/Desktop/index.tsx +2 -7
  40. package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
  41. package/src/app/(main)/chat/(mobile)/features/SessionHeader.tsx +1 -1
  42. package/src/app/(main)/chat/_layout/Desktop/index.tsx +8 -6
  43. package/src/app/(main)/chat/_layout/Mobile/index.tsx +3 -5
  44. package/src/app/(main)/chat/features/SettingButton.tsx +5 -4
  45. package/src/app/(main)/chat/layout.ts +2 -5
  46. package/src/app/(main)/chat/settings/{_layout/Desktop → (desktop)}/Header.tsx +0 -2
  47. package/src/app/(main)/chat/settings/(desktop)/index.tsx +23 -0
  48. package/src/app/(main)/chat/settings/{_layout/Mobile → (mobile)}/Header.tsx +2 -3
  49. package/src/app/(main)/chat/settings/(mobile)/index.tsx +16 -0
  50. package/src/app/(main)/chat/settings/features/HeaderContent.tsx +9 -15
  51. package/src/app/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +0 -2
  52. package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +8 -16
  53. package/src/app/(main)/chat/settings/layout.tsx +2 -9
  54. package/src/app/(main)/chat/settings/page.tsx +9 -2
  55. package/src/app/(main)/market/{_layout/Desktop/DetailSidebar.tsx → @detail/_layout/Desktop.tsx} +2 -2
  56. package/src/app/(main)/market/{_layout/Mobile/DetailModal.tsx → @detail/_layout/Mobile.tsx} +2 -2
  57. package/src/app/(main)/market/@detail/default.tsx +10 -1
  58. package/src/app/(main)/market/_layout/Desktop/index.tsx +1 -2
  59. package/src/app/(main)/market/_layout/Mobile/index.tsx +1 -3
  60. package/src/app/(main)/settings/(desktop)/index.tsx +23 -0
  61. package/src/app/(main)/settings/(mobile)/features/AvatarBanner.tsx +68 -0
  62. package/src/app/(main)/settings/(mobile)/features/ExtraList.tsx +65 -0
  63. package/src/app/(main)/settings/(mobile)/index.tsx +53 -0
  64. package/src/app/(main)/settings/_layout/Desktop/Header.tsx +23 -78
  65. package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +27 -39
  66. package/src/app/(main)/settings/_layout/Desktop/index.tsx +17 -41
  67. package/src/app/(main)/settings/_layout/Mobile/{Header.tsx → SubSettingHeader.tsx} +1 -3
  68. package/src/app/(main)/settings/_layout/Mobile/index.tsx +18 -7
  69. package/src/app/(main)/settings/about/AboutList.tsx +53 -0
  70. package/src/app/(main)/settings/about/Analytics.tsx +40 -0
  71. package/src/app/(main)/settings/about/page.tsx +33 -13
  72. package/src/app/(main)/settings/about/style.ts +22 -0
  73. package/src/app/(main)/settings/agent/Agent.tsx +29 -0
  74. package/src/app/(main)/settings/agent/loading.tsx +3 -0
  75. package/src/app/(main)/settings/agent/page.tsx +16 -8
  76. package/src/app/(main)/settings/common/{features/Common.tsx → Common.tsx} +5 -7
  77. package/src/app/(main)/settings/common/{features/Theme/index.tsx → Theme.tsx} +6 -8
  78. package/src/app/(main)/settings/common/index.tsx +16 -11
  79. package/src/app/(main)/settings/common/loading.tsx +3 -0
  80. package/src/app/(main)/settings/common/page.tsx +7 -8
  81. package/src/app/(main)/settings/features/Footer.tsx +0 -2
  82. package/src/app/(main)/settings/features/SettingList/index.tsx +47 -0
  83. package/src/app/(main)/settings/features/UpgradeAlert.tsx +13 -21
  84. package/src/app/(main)/settings/hooks/useSyncSettings.ts +2 -2
  85. package/src/app/(main)/settings/layout.ts +1 -4
  86. package/src/app/(main)/settings/llm/Anthropic/index.tsx +10 -4
  87. package/src/app/(main)/settings/llm/Azure/index.tsx +1 -3
  88. package/src/app/(main)/settings/llm/Bedrock/index.tsx +1 -3
  89. package/src/app/(main)/settings/llm/Google/index.tsx +2 -4
  90. package/src/app/(main)/settings/llm/Groq/index.tsx +1 -3
  91. package/src/app/(main)/settings/llm/Minimax/index.tsx +9 -3
  92. package/src/app/(main)/settings/llm/Mistral/index.tsx +9 -3
  93. package/src/app/(main)/settings/llm/Moonshot/index.tsx +1 -3
  94. package/src/app/(main)/settings/llm/Ollama/index.tsx +1 -3
  95. package/src/app/(main)/settings/llm/OpenAI/index.tsx +0 -2
  96. package/src/app/(main)/settings/llm/OpenRouter/index.tsx +9 -3
  97. package/src/app/(main)/settings/llm/Perplexity/index.tsx +9 -3
  98. package/src/app/(main)/settings/llm/TogetherAI/index.tsx +9 -3
  99. package/src/app/(main)/settings/llm/ZeroOne/index.tsx +9 -3
  100. package/src/app/(main)/settings/llm/Zhipu/index.tsx +10 -3
  101. package/src/app/(main)/settings/llm/components/Checker.tsx +0 -2
  102. package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +1 -16
  103. package/src/app/(main)/settings/llm/index.tsx +24 -12
  104. package/src/app/(main)/settings/llm/layout.tsx +11 -0
  105. package/src/app/(main)/settings/llm/loading.tsx +3 -0
  106. package/src/app/(main)/settings/llm/page.tsx +0 -15
  107. package/src/app/(main)/settings/page.tsx +14 -2
  108. package/src/app/(main)/settings/sync/{features/DeviceInfo → DeviceInfo}/Card.tsx +5 -6
  109. package/src/app/(main)/settings/sync/DeviceInfo/DeviceName.tsx +66 -0
  110. package/src/app/(main)/settings/sync/{features/DeviceInfo → DeviceInfo}/index.tsx +36 -22
  111. package/src/app/(main)/settings/sync/PageTitle.tsx +11 -0
  112. package/src/app/(main)/settings/sync/{features/WebRTC → WebRTC}/ChannelNameInput.tsx +3 -3
  113. package/src/app/(main)/settings/sync/{features/WebRTC → WebRTC}/index.tsx +9 -10
  114. package/src/app/(main)/settings/sync/{features/DeviceInfo → components}/SystemIcon.tsx +14 -6
  115. package/src/app/(main)/settings/sync/layout.tsx +12 -0
  116. package/src/app/(main)/settings/sync/loading.tsx +3 -0
  117. package/src/app/(main)/settings/sync/page.tsx +15 -11
  118. package/src/app/(main)/settings/tts/{features/STT.tsx → TTS/index.tsx} +27 -11
  119. package/src/app/(main)/settings/tts/loading.tsx +3 -0
  120. package/src/app/(main)/settings/tts/page.tsx +16 -8
  121. package/src/app/layout.tsx +3 -11
  122. package/src/const/url.ts +0 -1
  123. package/src/features/AgentSetting/AgentConfig/index.tsx +202 -0
  124. package/src/features/AgentSetting/AgentConfig/useSyncConfig.ts +23 -0
  125. package/src/features/AgentSetting/AgentMeta/index.tsx +3 -4
  126. package/src/features/AgentSetting/AgentPlugin/index.tsx +66 -65
  127. package/src/features/AgentSetting/AgentPrompt/index.tsx +47 -101
  128. package/src/features/AgentSetting/AgentTTS/index.tsx +0 -4
  129. package/src/features/AgentSetting/StoreUpdater.tsx +0 -2
  130. package/src/features/AgentSetting/index.tsx +6 -6
  131. package/src/features/AgentSetting/store/index.ts +0 -2
  132. package/src/features/AvatarWithUpload/index.tsx +0 -2
  133. package/src/locales/default/common.ts +0 -14
  134. package/src/locales/default/setting.ts +0 -3
  135. package/src/store/global/initialState.ts +0 -1
  136. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -52
  137. package/src/app/(main)/(mobile)/me/features/Cate.tsx +0 -35
  138. package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +0 -26
  139. package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +0 -68
  140. package/src/app/(main)/(mobile)/me/layout.tsx +0 -11
  141. package/src/app/(main)/(mobile)/me/loading.tsx +0 -17
  142. package/src/app/(main)/(mobile)/me/page.tsx +0 -31
  143. package/src/app/(main)/@nav/features/UserAvatar.tsx +0 -24
  144. package/src/app/(main)/@nav/features/UserPanel/LangButton.tsx +0 -55
  145. package/src/app/(main)/@nav/features/UserPanel/Popover.tsx +0 -34
  146. package/src/app/(main)/@nav/features/UserPanel/ThemeButton.tsx +0 -70
  147. package/src/app/(main)/@nav/features/UserPanel/UserInfo.tsx +0 -35
  148. package/src/app/(main)/@nav/features/UserPanel/index.tsx +0 -69
  149. package/src/app/(main)/@nav/features/UserPanel/useMenu.tsx +0 -144
  150. package/src/app/(main)/@nav/features/UserPanel/useNewVersion.tsx +0 -12
  151. package/src/app/(main)/chat/_layout/type.ts +0 -5
  152. package/src/app/(main)/chat/settings/_layout/Desktop/index.tsx +0 -32
  153. package/src/app/(main)/chat/settings/_layout/Mobile/index.tsx +0 -15
  154. package/src/app/(main)/chat/settings/error.tsx +0 -5
  155. package/src/app/(main)/chat/settings/loading.tsx +0 -3
  156. package/src/app/(main)/chat/settings/m/page.tsx +0 -15
  157. package/src/app/(main)/chat/settings/not-found.tsx +0 -3
  158. package/src/app/(main)/market/@detail/loading.tsx +0 -1
  159. package/src/app/(main)/settings/@category/default.tsx +0 -16
  160. package/src/app/(main)/settings/@category/features/CategoryContent.tsx +0 -37
  161. package/src/app/(main)/settings/@category/features/UpgradeAlert.tsx +0 -38
  162. package/src/app/(main)/settings/_layout/type.ts +0 -6
  163. package/src/app/(main)/settings/about/features/AboutList.tsx +0 -122
  164. package/src/app/(main)/settings/about/features/Analytics.tsx +0 -42
  165. package/src/app/(main)/settings/about/index.tsx +0 -35
  166. package/src/app/(main)/settings/agent/index.tsx +0 -48
  167. package/src/app/(main)/settings/error.tsx +0 -5
  168. package/src/app/(main)/settings/hooks/useCategory.tsx +0 -54
  169. package/src/app/(main)/settings/llm/components/Footer.tsx +0 -26
  170. package/src/app/(main)/settings/loading.tsx +0 -9
  171. package/src/app/(main)/settings/m/page.tsx +0 -19
  172. package/src/app/(main)/settings/not-found.tsx +0 -3
  173. package/src/app/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +0 -63
  174. package/src/app/(main)/settings/sync/index.tsx +0 -17
  175. package/src/app/(main)/settings/tts/features/OpenAI.tsx +0 -54
  176. package/src/app/(main)/settings/tts/index.tsx +0 -15
  177. package/src/app/@modal/(.)settings/m/index.tsx +0 -34
  178. package/src/app/@modal/(.)settings/m/layout.tsx +0 -28
  179. package/src/app/@modal/(.)settings/m/loading.tsx +0 -5
  180. package/src/app/@modal/(.)settings/m/page.tsx +0 -10
  181. package/src/app/@modal/_layout/Desktop.tsx +0 -32
  182. package/src/app/@modal/_layout/Mobile.tsx +0 -1
  183. package/src/app/@modal/_layout/SettingModalLayout.tsx +0 -59
  184. package/src/app/@modal/chat/(.)settings/m/features/CategoryContent.tsx +0 -36
  185. package/src/app/@modal/chat/(.)settings/m/features/useCategory.tsx +0 -62
  186. package/src/app/@modal/chat/(.)settings/m/layout.tsx +0 -55
  187. package/src/app/@modal/chat/(.)settings/m/loading.tsx +0 -5
  188. package/src/app/@modal/chat/(.)settings/m/page.tsx +0 -34
  189. package/src/app/@modal/default.tsx +0 -1
  190. package/src/app/@modal/layout.tsx +0 -30
  191. package/src/app/@modal/loading.tsx +0 -5
  192. package/src/components/BrandWatermark/index.tsx +0 -39
  193. package/src/components/Cell/Divider.tsx +0 -19
  194. package/src/components/Cell/index.tsx +0 -38
  195. package/src/components/Menu/index.tsx +0 -97
  196. package/src/components/SkeletonLoading/index.tsx +0 -21
  197. package/src/features/AgentSetting/AgentChat/index.tsx +0 -135
  198. package/src/features/AgentSetting/AgentModal/index.tsx +0 -95
  199. package/src/hooks/useQuery.ts +0 -7
  200. package/src/hooks/useQueryRoute.ts +0 -16
  201. package/src/server/redirectHard.ts +0 -9
  202. /package/src/app/(main)/settings/{about/features → features/SettingList}/Item.tsx +0 -0
  203. /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/ThemeSwatchesNeutral.tsx +0 -0
  204. /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/ThemeSwatchesPrimary.tsx +0 -0
  205. /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/index.ts +0 -0
  206. /package/src/app/(main)/settings/sync/{features/Alert.tsx → Alert.tsx} +0 -0
  207. /package/src/app/(main)/settings/sync/{features/WebRTC → components}/SyncSwitch/index.css +0 -0
  208. /package/src/app/(main)/settings/sync/{features/WebRTC → components}/SyncSwitch/index.tsx +0 -0
  209. /package/src/app/(main)/settings/sync/{features/WebRTC/generateRandomRoomName.ts → util.ts} +0 -0
  210. /package/src/app/(main)/settings/tts/{features/const.ts → TTS/options.ts} +0 -0
  211. /package/src/features/AgentSetting/{AgentModal → AgentConfig}/ModelSelect.tsx +0 -0
@@ -1,70 +0,0 @@
1
- import { ActionIcon, Icon } from '@lobehub/ui';
2
- import { Popover } from 'antd';
3
- import { useTheme } from 'antd-style';
4
- import { Monitor, Moon, Sun } from 'lucide-react';
5
- import { memo, useMemo } from 'react';
6
- import { useTranslation } from 'react-i18next';
7
-
8
- import Menu, { type MenuProps } from '@/components/Menu';
9
- import { useUserStore } from '@/store/user';
10
- import { settingsSelectors } from '@/store/user/selectors';
11
-
12
- const themeIcons = {
13
- auto: Monitor,
14
- dark: Moon,
15
- light: Sun,
16
- };
17
-
18
- const ThemeButton = memo(() => {
19
- const theme = useTheme();
20
- const [themeMode, switchThemeMode] = useUserStore((s) => [
21
- settingsSelectors.currentSettings(s).themeMode,
22
- s.switchThemeMode,
23
- ]);
24
-
25
- const { t } = useTranslation('setting');
26
-
27
- const items: MenuProps['items'] = useMemo(
28
- () => [
29
- {
30
- icon: <Icon icon={themeIcons.auto} />,
31
- key: 'auto',
32
- label: t('settingTheme.themeMode.auto'),
33
- onClick: () => switchThemeMode('auto'),
34
- },
35
- {
36
- icon: <Icon icon={themeIcons.light} />,
37
- key: 'light',
38
- label: t('settingTheme.themeMode.light'),
39
- onClick: () => switchThemeMode('light'),
40
- },
41
- {
42
- icon: <Icon icon={themeIcons.dark} />,
43
- key: 'dark',
44
- label: t('settingTheme.themeMode.dark'),
45
- onClick: () => switchThemeMode('dark'),
46
- },
47
- ],
48
- [t],
49
- );
50
-
51
- return (
52
- <Popover
53
- arrow={false}
54
- content={<Menu items={items} selectable selectedKeys={[themeMode]} />}
55
- overlayInnerStyle={{
56
- padding: 0,
57
- }}
58
- placement={'right'}
59
- trigger={['click', 'hover']}
60
- >
61
- <ActionIcon
62
- icon={themeIcons[themeMode]}
63
- size={{ blockSize: 32, fontSize: 16 }}
64
- style={{ border: `1px solid ${theme.colorFillSecondary}` }}
65
- />
66
- </Popover>
67
- );
68
- });
69
-
70
- export default ThemeButton;
@@ -1,35 +0,0 @@
1
- import { createStyles } from 'antd-style';
2
- import { memo } from 'react';
3
- import { Flexbox } from 'react-layout-kit';
4
-
5
- import UserAvatar from '../UserAvatar';
6
-
7
- const useStyles = createStyles(({ css, token }) => ({
8
- nickname: css`
9
- font-size: 16px;
10
- font-weight: bold;
11
- line-height: 1;
12
- `,
13
- username: css`
14
- line-height: 1;
15
- color: ${token.colorTextDescription};
16
- `,
17
- }));
18
-
19
- // TODO
20
-
21
- const UserInfo = memo<{ onClick?: () => void }>(({ onClick }) => {
22
- const { styles, theme } = useStyles();
23
-
24
- return (
25
- <Flexbox align={'center'} gap={12} horizontal paddingBlock={12} paddingInline={16}>
26
- <UserAvatar background={theme.colorFill} onClick={onClick} size={48} />
27
- <Flexbox flex={1} gap={6}>
28
- <div className={styles.nickname}>{'社区版用户'}</div>
29
- <div className={styles.username}> {'Community Edition'}</div>
30
- </Flexbox>
31
- </Flexbox>
32
- );
33
- });
34
-
35
- export default UserInfo;
@@ -1,69 +0,0 @@
1
- 'use client';
2
-
3
- import { Alert } from '@lobehub/ui';
4
- import { Badge, ConfigProvider, Popover } from 'antd';
5
- import { createStyles } from 'antd-style';
6
- import { PropsWithChildren, memo, useCallback, useState } from 'react';
7
- import { useTranslation } from 'react-i18next';
8
- import { Flexbox } from 'react-layout-kit';
9
-
10
- import PopoverContent from './Popover';
11
- import { useNewVersion } from './useNewVersion';
12
-
13
- const useStyles = createStyles(({ css }) => ({
14
- popover: css`
15
- top: 8px !important;
16
- left: 8px !important;
17
- `,
18
- }));
19
-
20
- const UserPanel = memo<PropsWithChildren<{ bottom?: boolean }>>(({ children, bottom }) => {
21
- const hasNewVersion = useNewVersion();
22
- const [open, setOpen] = useState(false);
23
- const { styles } = useStyles();
24
- const { t } = useTranslation('common');
25
-
26
- const AvararBadge = useCallback(
27
- ({ children: badgeChildren, showBadge }: PropsWithChildren<{ showBadge?: boolean }>) => {
28
- if (bottom || !showBadge) return badgeChildren;
29
- return (
30
- <Flexbox>
31
- <ConfigProvider theme={{ components: { Badge: { dotSize: 8 } } }}>
32
- <Badge dot offset={[-4, 4]}>
33
- {badgeChildren}
34
- </Badge>
35
- </ConfigProvider>
36
- </Flexbox>
37
- );
38
- },
39
- [],
40
- );
41
-
42
- return (
43
- <AvararBadge showBadge={hasNewVersion}>
44
- <Popover
45
- arrow={false}
46
- content={
47
- <>
48
- {bottom && <Alert banner message={t('userPanel.warn')} type={'warning'} />}
49
- <PopoverContent closePopover={() => setOpen(false)} />
50
- </>
51
- }
52
- onOpenChange={setOpen}
53
- open={open}
54
- overlayInnerStyle={{
55
- padding: 0,
56
- }}
57
- placement={'topRight'}
58
- rootClassName={bottom ? undefined : styles.popover}
59
- trigger={['click']}
60
- >
61
- {children}
62
- </Popover>
63
- </AvararBadge>
64
- );
65
- });
66
-
67
- UserPanel.displayName = 'UserPanel';
68
-
69
- export default UserPanel;
@@ -1,144 +0,0 @@
1
- import { DiscordIcon, Icon } from '@lobehub/ui';
2
- import { Badge } from 'antd';
3
- import {
4
- Book,
5
- Feather,
6
- HardDriveDownload,
7
- HardDriveUpload,
8
- LifeBuoy,
9
- Mail,
10
- Settings2,
11
- } from 'lucide-react';
12
- import { PropsWithChildren, useCallback } from 'react';
13
- import { useTranslation } from 'react-i18next';
14
- import { Flexbox } from 'react-layout-kit';
15
-
16
- import { type MenuProps } from '@/components/Menu';
17
- import { AGENTS_INDEX_GITHUB_ISSUE, DISCORD, DOCUMENTS, EMAIL_SUPPORT } from '@/const/url';
18
- import DataImporter from '@/features/DataImporter';
19
- import { useQueryRoute } from '@/hooks/useQueryRoute';
20
- import { configService } from '@/services/config';
21
-
22
- import { useNewVersion } from './useNewVersion';
23
-
24
- export const useMenu = () => {
25
- const router = useQueryRoute();
26
- const hasNewVersion = useNewVersion();
27
-
28
- const { t } = useTranslation(['common', 'setting']);
29
-
30
- const NewVersionBadge = useCallback(
31
- ({ children, showBadge }: PropsWithChildren & { showBadge?: boolean }) => {
32
- if (!showBadge) return children;
33
- return (
34
- <Flexbox align={'center'} distribution={'space-between'} gap={8} horizontal width={'100%'}>
35
- <span>{children}</span>
36
- <Badge count={t('upgradeVersion.hasNew')} />
37
- </Flexbox>
38
- );
39
- },
40
- [t],
41
- );
42
-
43
- const exports: MenuProps['items'] = [
44
- {
45
- icon: <Icon icon={HardDriveUpload} />,
46
- key: 'import',
47
- label: <DataImporter>{t('import')}</DataImporter>,
48
- },
49
- {
50
- children: [
51
- {
52
- key: 'allAgent',
53
- label: <div>{t('exportType.allAgent')}</div>,
54
- onClick: configService.exportAgents,
55
- },
56
- {
57
- key: 'allAgentWithMessage',
58
- label: <div>{t('exportType.allAgentWithMessage')}</div>,
59
- onClick: configService.exportSessions,
60
- },
61
- {
62
- key: 'globalSetting',
63
- label: <div>{t('exportType.globalSetting')}</div>,
64
- onClick: configService.exportSettings,
65
- },
66
- {
67
- type: 'divider',
68
- },
69
- {
70
- key: 'all',
71
- label: <div>{t('exportType.all')}</div>,
72
- onClick: configService.exportAll,
73
- },
74
- ],
75
- icon: <Icon icon={HardDriveDownload} />,
76
- key: 'export',
77
- label: t('export'),
78
- },
79
- {
80
- type: 'divider',
81
- },
82
- ];
83
-
84
- const settings: MenuProps['items'] = [
85
- {
86
- icon: <Icon icon={Settings2} />,
87
- key: 'setting',
88
- label: <NewVersionBadge showBadge={hasNewVersion}>{t('userPanel.setting')}</NewVersionBadge>,
89
- onClick: () => {
90
- router.push('/settings/common');
91
- },
92
- },
93
- {
94
- type: 'divider',
95
- },
96
- ];
97
-
98
- const helps: MenuProps['items'] = [
99
- {
100
- icon: <Icon icon={DiscordIcon} />,
101
- key: 'discord',
102
- label: t('userPanel.discord'),
103
- onClick: () => window.open(DISCORD, '__blank'),
104
- },
105
- {
106
- children: [
107
- {
108
- icon: <Icon icon={Book} />,
109
- key: 'docs',
110
- label: t('userPanel.docs'),
111
- onClick: () => window.open(DOCUMENTS, '__blank'),
112
- },
113
- {
114
- icon: <Icon icon={Feather} />,
115
- key: 'feedback',
116
- label: t('userPanel.feedback'),
117
- onClick: () => window.open(AGENTS_INDEX_GITHUB_ISSUE, '__blank'),
118
- },
119
- {
120
- icon: <Icon icon={Mail} />,
121
- key: 'email',
122
- label: t('userPanel.email'),
123
- onClick: () => window.open(`mailto:${EMAIL_SUPPORT}`, '__blank'),
124
- },
125
- ],
126
- icon: <Icon icon={LifeBuoy} />,
127
- key: 'help',
128
- label: t('userPanel.help'),
129
- },
130
- ];
131
-
132
- const mainItems = [
133
- ...settings,
134
- ...exports,
135
- ...helps,
136
- {
137
- type: 'divider',
138
- },
139
- ].filter(Boolean) as MenuProps['items'];
140
-
141
- return {
142
- mainItems,
143
- };
144
- };
@@ -1,12 +0,0 @@
1
- import { useGlobalStore } from '@/store/global';
2
-
3
- export const useNewVersion = () => {
4
- const [hasNewVersion, useCheckLatestVersion] = useGlobalStore((s) => [
5
- s.hasNewVersion,
6
- s.useCheckLatestVersion,
7
- ]);
8
-
9
- useCheckLatestVersion();
10
-
11
- return hasNewVersion;
12
- };
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface LayoutProps {
4
- children: ReactNode;
5
- }
@@ -1,32 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { Flexbox } from 'react-layout-kit';
3
-
4
- import SafeSpacing from '@/components/SafeSpacing';
5
- import { HEADER_HEIGHT } from '@/const/layoutTokens';
6
-
7
- import Header from './Header';
8
-
9
- const Layout = ({ children }: PropsWithChildren) => (
10
- <>
11
- <Header />
12
- <Flexbox
13
- align={'center'}
14
- height={'100%'}
15
- style={{ overflowX: 'hidden', overflowY: 'auto' }}
16
- width={'100%'}
17
- >
18
- <SafeSpacing height={HEADER_HEIGHT - 16} />
19
- <Flexbox
20
- gap={64}
21
- style={{ maxWidth: 1024, padding: '1.75rem 1.5rem 1.75rem 2rem' }}
22
- width={'100%'}
23
- >
24
- {children}
25
- </Flexbox>
26
- </Flexbox>
27
- </>
28
- );
29
-
30
- Layout.displayName = 'DesktopSessionSettingsLayout';
31
-
32
- export default Layout;
@@ -1,15 +0,0 @@
1
- 'use client';
2
-
3
- import { PropsWithChildren } from 'react';
4
-
5
- import MobileContentLayout from '@/components/server/MobileNavLayout';
6
-
7
- import Header from './Header';
8
-
9
- const Layout = ({ children }: PropsWithChildren) => (
10
- <MobileContentLayout header={<Header />}>{children}</MobileContentLayout>
11
- );
12
-
13
- Layout.displayName = 'MobileSessionSettingsLayout';
14
-
15
- export default Layout;
@@ -1,5 +0,0 @@
1
- 'use client';
2
-
3
- import dynamic from 'next/dynamic';
4
-
5
- export default dynamic(() => import('@/components/Error'), { ssr: false });
@@ -1,3 +0,0 @@
1
- import SkeletonLoading from '@/components/SkeletonLoading';
2
-
3
- export default () => <SkeletonLoading paragraph={{ rows: 8 }} />;
@@ -1,15 +0,0 @@
1
- 'use client';
2
-
3
- import { useLayoutEffect } from 'react';
4
-
5
- import { useQueryRoute } from '@/hooks/useQueryRoute';
6
-
7
- export default () => {
8
- const router = useQueryRoute();
9
-
10
- useLayoutEffect(() => {
11
- router.replace('/chat/settings');
12
- }, []);
13
-
14
- return null;
15
- };
@@ -1,3 +0,0 @@
1
- import dynamic from 'next/dynamic';
2
-
3
- export default dynamic(() => import('@/components/404'), { ssr: false });
@@ -1 +0,0 @@
1
- export default () => null;
@@ -1,16 +0,0 @@
1
- import UpgradeAlert from '@/app/(main)/settings//features/UpgradeAlert';
2
-
3
- import CategoryContent from './features/CategoryContent';
4
-
5
- const Category = () => {
6
- return (
7
- <>
8
- <CategoryContent />
9
- <UpgradeAlert />
10
- </>
11
- );
12
- };
13
-
14
- Category.displayName = 'SettingCategory';
15
-
16
- export default Category;
@@ -1,37 +0,0 @@
1
- 'use client';
2
-
3
- import { memo } from 'react';
4
- import urlJoin from 'url-join';
5
-
6
- import Menu from '@/components/Menu';
7
- import { useActiveSettingsKey } from '@/hooks/useActiveSettingsKey';
8
- import { useQuery } from '@/hooks/useQuery';
9
- import { useQueryRoute } from '@/hooks/useQueryRoute';
10
- import { SettingsTabs } from '@/store/global/initialState';
11
-
12
- import { useCategory } from '../../hooks/useCategory';
13
-
14
- const CategoryContent = memo<{ modal?: boolean }>(({ modal }) => {
15
- const activeTab = useActiveSettingsKey();
16
- const { tab = SettingsTabs.Common } = useQuery();
17
- const cateItems = useCategory();
18
- const router = useQueryRoute();
19
-
20
- return (
21
- <Menu
22
- items={cateItems}
23
- onClick={({ key }) => {
24
- if (modal) {
25
- router.replace('/settings/m', { tab: key });
26
- } else {
27
- router.push(urlJoin('/settings', key));
28
- }
29
- }}
30
- selectable
31
- selectedKeys={[modal ? tab : (activeTab as any)]}
32
- variant={'compact'}
33
- />
34
- );
35
- });
36
-
37
- export default CategoryContent;
@@ -1,38 +0,0 @@
1
- import { Alert } from '@lobehub/ui';
2
- import { Button } from 'antd';
3
- import Link from 'next/link';
4
- import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- import { MANUAL_UPGRADE_URL } from '@/const/url';
8
- import { useGlobalStore } from '@/store/global';
9
-
10
- const UpgradeAlert = memo(() => {
11
- const [hasNewVersion, latestVersion] = useGlobalStore((s) => [s.hasNewVersion, s.latestVersion]);
12
- const { t } = useTranslation('common');
13
-
14
- if (!hasNewVersion) return null;
15
-
16
- return (
17
- <Alert
18
- action={
19
- <Link
20
- aria-label={t('upgradeVersion.action')}
21
- href={MANUAL_UPGRADE_URL}
22
- style={{ marginBottom: 12 }}
23
- target={'_blank'}
24
- >
25
- <Button block size={'small'} type={'primary'}>
26
- {t('upgradeVersion.action')}
27
- </Button>
28
- </Link>
29
- }
30
- closable
31
- message={t('upgradeVersion.newVersion', { version: latestVersion })}
32
- showIcon={false}
33
- type={'info'}
34
- />
35
- );
36
- });
37
-
38
- export default UpgradeAlert;
@@ -1,6 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface LayoutProps {
4
- category: ReactNode;
5
- children: ReactNode;
6
- }
@@ -1,122 +0,0 @@
1
- 'use client';
2
-
3
- import { Grid, Icon } from '@lobehub/ui';
4
- import { createStyles } from 'antd-style';
5
- import {
6
- Book,
7
- Feather,
8
- FileClock,
9
- Github,
10
- Heart,
11
- HeartHandshake,
12
- Home,
13
- Lock,
14
- Rss,
15
- } from 'lucide-react';
16
- import { memo } from 'react';
17
- import { useTranslation } from 'react-i18next';
18
- import { Flexbox } from 'react-layout-kit';
19
-
20
- import { ABOUT, CHANGELOG, FEEDBACK, GITHUB, PRIVACY_URL, TERMS_URL } from '@/const/url';
21
-
22
- const useStyles = createStyles(({ css, token, responsive }) => ({
23
- card: css`
24
- cursor: pointer;
25
-
26
- padding: 24px;
27
-
28
- background: ${token.colorFillTertiary};
29
- border: 1px solid ${token.colorFillSecondary};
30
- border-radius: ${token.borderRadiusLG}px;
31
-
32
- &:hover {
33
- background: ${token.colorFillSecondary};
34
- border: 1px solid ${token.colorFill};
35
- }
36
-
37
- ${responsive.mobile} {
38
- padding: 16px;
39
- }
40
- `,
41
- container: css`
42
- ${responsive.mobile} {
43
- padding-inline: 16px;
44
- }
45
- `,
46
- }));
47
-
48
- const AboutList = memo(() => {
49
- const { styles } = useStyles();
50
- const { t } = useTranslation('common');
51
-
52
- const items = [
53
- {
54
- icon: Home,
55
- label: t('officialSite'),
56
- onClick: () => window.open('https://lobehub.com', '__blank'),
57
- value: 'officialSite',
58
- },
59
-
60
- {
61
- icon: Book,
62
- label: t('document'),
63
- onClick: () => window.open(FEEDBACK, '__blank'),
64
- value: 'feedback',
65
- },
66
- {
67
- icon: Rss,
68
- label: t('blog'),
69
- onClick: () => window.open('https://lobehub.com/blog', '__blank'),
70
- value: 'blog',
71
- },
72
- {
73
- icon: Github,
74
- label: 'GitHub',
75
- onClick: () => window.open(GITHUB, '__blank'),
76
- value: 'feedback',
77
- },
78
- {
79
- icon: Feather,
80
- label: t('feedback'),
81
- onClick: () => window.open(FEEDBACK, '__blank'),
82
- value: 'feedback',
83
- },
84
- {
85
- icon: FileClock,
86
- label: t('changelog'),
87
- onClick: () => window.open(CHANGELOG, '__blank'),
88
- value: 'changelog',
89
- },
90
- {
91
- icon: HeartHandshake,
92
- label: t('terms'),
93
- onClick: () => window.open(TERMS_URL, '__blank'),
94
- value: 'terms',
95
- },
96
- {
97
- icon: Lock,
98
- label: t('privacy'),
99
- onClick: () => window.open(PRIVACY_URL, '__blank'),
100
- value: 'privacy',
101
- },
102
- {
103
- icon: Heart,
104
- label: t('about'),
105
- onClick: () => window.open(ABOUT, '__blank'),
106
- value: 'about',
107
- },
108
- ];
109
-
110
- return (
111
- <Grid className={styles.container} maxItemWidth={144} width={'100%'}>
112
- {items.map(({ value, icon, label, onClick }) => (
113
- <Flexbox className={styles.card} gap={8} horizontal key={value} onClick={onClick}>
114
- <Icon icon={icon} size={{ fontSize: 20 }} />
115
- {label}
116
- </Flexbox>
117
- ))}
118
- </Grid>
119
- );
120
- });
121
-
122
- export default AboutList;
@@ -1,42 +0,0 @@
1
- 'use client';
2
-
3
- import { Form, type ItemGroup } from '@lobehub/ui';
4
- import { Switch } from 'antd';
5
- import { memo } from 'react';
6
- import { useTranslation } from 'react-i18next';
7
-
8
- import { FORM_STYLE } from '@/const/layoutTokens';
9
- import { useUserStore } from '@/store/user';
10
- import { preferenceSelectors } from '@/store/user/slices/preference/selectors';
11
-
12
- type SettingItemGroup = ItemGroup;
13
-
14
- const Analytics = memo(() => {
15
- const { t } = useTranslation('setting');
16
- const checked = useUserStore(preferenceSelectors.userAllowTrace);
17
- const [updatePreference] = useUserStore((s) => [s.updatePreference]);
18
-
19
- const items: SettingItemGroup = {
20
- children: [
21
- {
22
- children: (
23
- <Switch
24
- checked={!!checked}
25
- onChange={(e) => {
26
- updatePreference({ telemetry: e });
27
- }}
28
- />
29
- ),
30
- desc: t('analytics.telemetry.desc'),
31
- label: t('analytics.telemetry.title'),
32
- minWidth: undefined,
33
- valuePropName: 'checked',
34
- },
35
- ],
36
- title: t('analytics.title'),
37
- };
38
-
39
- return <Form items={[items]} itemsType={'group'} {...FORM_STYLE} />;
40
- });
41
-
42
- export default Analytics;