@lobehub/chat 0.127.0 → 0.127.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 (69) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +8 -8
  3. package/README.zh-CN.md +8 -8
  4. package/package.json +1 -1
  5. package/src/app/chat/(desktop)/layout.desktop.tsx +1 -3
  6. package/src/app/chat/(mobile)/index.tsx +2 -5
  7. package/src/app/chat/features/ChatHeader/SettingButton.tsx +1 -2
  8. package/src/app/home/Redirect.tsx +0 -4
  9. package/src/app/market/(desktop)/layout.desktop.tsx +1 -4
  10. package/src/app/market/(mobile)/layout.mobile.tsx +1 -4
  11. package/src/app/market/features/AgentDetailContent/AgentInfo/Header.tsx +0 -4
  12. package/src/app/settings/(desktop)/features/Header.tsx +3 -4
  13. package/src/app/settings/(desktop)/features/SideBar.tsx +42 -0
  14. package/src/app/settings/(desktop)/index.tsx +4 -3
  15. package/src/app/settings/(desktop)/layout.desktop.tsx +14 -9
  16. package/src/app/settings/(desktop)/layout.responsive.tsx +4 -4
  17. package/src/app/settings/(mobile)/features/ExtraList.tsx +7 -5
  18. package/src/app/settings/(mobile)/features/Header/index.tsx +8 -5
  19. package/src/app/settings/(mobile)/index.tsx +1 -3
  20. package/src/app/settings/(mobile)/layout.mobile.tsx +8 -6
  21. package/src/app/settings/(mobile)/mobile/index.tsx +3 -5
  22. package/src/app/settings/agent/Agent.tsx +0 -4
  23. package/src/app/settings/agent/layout.tsx +9 -1
  24. package/src/app/settings/agent/page.tsx +17 -2
  25. package/src/app/settings/common/index.tsx +0 -3
  26. package/src/app/settings/common/layout.tsx +9 -1
  27. package/src/app/settings/features/SettingList/Item.tsx +50 -0
  28. package/src/app/settings/features/{SideBar/List.tsx → SettingList/index.tsx} +14 -15
  29. package/src/app/settings/layout.server.tsx +10 -3
  30. package/src/app/settings/llm/Azure/index.tsx +78 -106
  31. package/src/app/settings/llm/Bedrock/index.tsx +60 -89
  32. package/src/app/settings/llm/Google/index.tsx +26 -55
  33. package/src/app/settings/llm/Moonshot/index.tsx +29 -54
  34. package/src/app/settings/llm/Ollama/index.tsx +35 -61
  35. package/src/app/settings/llm/OpenAI/index.tsx +91 -107
  36. package/src/app/settings/llm/Zhipu/index.tsx +29 -54
  37. package/src/app/settings/llm/components/ProviderConfig/index.tsx +58 -0
  38. package/src/app/settings/llm/index.tsx +42 -0
  39. package/src/app/settings/llm/layout.tsx +9 -1
  40. package/src/app/settings/llm/page.tsx +6 -46
  41. package/src/app/settings/tts/layout.tsx +9 -1
  42. package/src/app/settings/tts/page.tsx +17 -2
  43. package/src/const/settings.ts +1 -0
  44. package/src/features/MobileTabBar/index.tsx +7 -14
  45. package/src/features/SideBar/BottomActions.tsx +3 -9
  46. package/src/features/SideBar/TopActions.tsx +2 -7
  47. package/src/features/SideBar/index.tsx +7 -5
  48. package/src/layout/AppLayout.desktop.tsx +8 -3
  49. package/src/layout/AppLayout.mobile.tsx +4 -2
  50. package/src/layout/ResponsiveLayout.client.tsx +7 -7
  51. package/src/layout/ResponsiveLayout.server.tsx +6 -6
  52. package/src/services/_auth.test.ts +132 -0
  53. package/src/services/_auth.ts +1 -1
  54. package/src/store/global/hooks/index.ts +1 -1
  55. package/src/store/global/slices/common/action.test.ts +0 -12
  56. package/src/store/global/slices/common/action.ts +1 -6
  57. package/src/store/global/slices/common/initialState.ts +0 -2
  58. package/src/store/global/slices/settings/action.test.ts +0 -13
  59. package/src/store/global/slices/settings/action.ts +0 -5
  60. package/src/store/global/slices/settings/selectors/modelProvider.ts +7 -0
  61. package/src/types/settings/modelProvider.ts +1 -0
  62. package/src/app/settings/agent/index.tsx +0 -21
  63. package/src/app/settings/features/SideBar/Item.tsx +0 -44
  64. package/src/app/settings/features/SideBar/index.tsx +0 -42
  65. package/src/app/settings/tts/index.tsx +0 -21
  66. package/src/store/global/hooks/useSwitchSettingsOnInit.ts +0 -12
  67. package/src/store/global/hooks/useSwitchSideBarOnInit.ts +0 -13
  68. /package/src/app/settings/llm/{Checker.tsx → components/Checker.tsx} +0 -0
  69. /package/src/app/settings/llm/{useSyncSettings.ts → components/ProviderConfig/useSyncSettings.ts} +0 -0
@@ -1,21 +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
-
10
- import Agent from './Agent';
11
-
12
- export default memo(() => {
13
- useSwitchSideBarOnInit(SettingsTabs.Agent);
14
- const { t } = useTranslation('setting');
15
- return (
16
- <>
17
- <PageTitle title={t('tab.agent')} />
18
- <Agent />
19
- </>
20
- );
21
- });
@@ -1,44 +0,0 @@
1
- import { Icon, List } from '@lobehub/ui';
2
- import { createStyles, useResponsive } from 'antd-style';
3
- import { ChevronRight, type LucideIcon } from 'lucide-react';
4
- import { CSSProperties, ReactNode, memo } from 'react';
5
-
6
- const { Item } = List;
7
-
8
- const useStyles = createStyles(({ css, token, responsive }) => ({
9
- container: css`
10
- position: relative;
11
- padding-top: 20px;
12
- padding-bottom: 20px;
13
- border-radius: ${token.borderRadius}px;
14
- ${responsive.mobile} {
15
- border-radius: 0;
16
- }
17
- `,
18
- }));
19
-
20
- export interface ItemProps {
21
- active?: boolean;
22
- className?: string;
23
- icon: LucideIcon;
24
- label: ReactNode;
25
- style?: CSSProperties;
26
- }
27
-
28
- const SettingItem = memo<ItemProps>(({ label, icon, active = false, style, className }) => {
29
- const { cx, styles } = useStyles();
30
- const { mobile } = useResponsive();
31
- return (
32
- <Item
33
- active={active}
34
- avatar={<Icon icon={icon} size={{ fontSize: 16 }} />}
35
- className={cx(styles.container, className)}
36
- style={style}
37
- title={label as string}
38
- >
39
- {mobile && <Icon icon={ChevronRight} size={{ fontSize: 16 }} />}
40
- </Item>
41
- );
42
- });
43
-
44
- export default SettingItem;
@@ -1,42 +0,0 @@
1
- import { DraggablePanelBody, Logo } from '@lobehub/ui';
2
- import { createStyles } from 'antd-style';
3
- import { memo } from 'react';
4
- import { Flexbox } from 'react-layout-kit';
5
-
6
- import FolderPanel from '@/features/FolderPanel';
7
-
8
- import UpgradeAlert from '../UpgradeAlert';
9
- import List from './List';
10
-
11
- const useStyles = createStyles(({ stylish, token, css }) => ({
12
- body: stylish.noScrollbar,
13
- logo: css`
14
- fill: ${token.colorText};
15
- `,
16
- top: css`
17
- position: sticky;
18
- top: 0;
19
- `,
20
- }));
21
-
22
- const SideBar = memo(() => {
23
- const { styles } = useStyles();
24
-
25
- return (
26
- <FolderPanel>
27
- <DraggablePanelBody className={styles.body} style={{ padding: 0 }}>
28
- <Flexbox className={styles.top} padding={16}>
29
- <div>
30
- <Logo className={styles.logo} extra={'Settings'} size={36} type={'text'} />
31
- </div>
32
- </Flexbox>
33
- <Flexbox gap={2} style={{ paddingInline: 8 }}>
34
- <UpgradeAlert />
35
- <List />
36
- </Flexbox>
37
- </DraggablePanelBody>
38
- </FolderPanel>
39
- );
40
- });
41
-
42
- export default SideBar;
@@ -1,21 +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
-
10
- import TTS from './TTS';
11
-
12
- export default memo(() => {
13
- useSwitchSideBarOnInit(SettingsTabs.TTS);
14
- const { t } = useTranslation('setting');
15
- return (
16
- <>
17
- <PageTitle title={t('tab.llm')} />
18
- <TTS />
19
- </>
20
- );
21
- });
@@ -1,12 +0,0 @@
1
- import { useOnFinishHydrationGlobal } from '@/store/global';
2
-
3
- import { SettingsTabs } from '../initialState';
4
-
5
- /**
6
- * 切换设置侧边栏选项
7
- */
8
- export const useSwitchSideBarOnInit = (key: SettingsTabs) => {
9
- useOnFinishHydrationGlobal((store) => {
10
- store.switchSettingTabs(key);
11
- });
12
- };
@@ -1,13 +0,0 @@
1
- import { SidebarTabKey } from '../initialState';
2
- import { useGlobalStore } from '../store';
3
- import { useOnFinishHydrationGlobal } from './useOnFinishHydrationGlobal';
4
-
5
- /**
6
- * 切换侧边栏选项
7
- * @desc 只会在应用初始化时(且水合后)执行一次
8
- */
9
- export const useSwitchSideBarOnInit = (key: SidebarTabKey) => {
10
- useOnFinishHydrationGlobal(() => {
11
- useGlobalStore.getState().switchSideBar(key);
12
- });
13
- };