@lobehub/chat 0.159.9 → 0.159.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.159.10](https://github.com/lobehub/lobe-chat/compare/v0.159.9...v0.159.10)
6
+
7
+ <sup>Released on **2024-05-15**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix setting modal on responsive and some other style problem.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix setting modal on responsive and some other style problem, closes [#2512](https://github.com/lobehub/lobe-chat/issues/2512) ([f6b4ca4](https://github.com/lobehub/lobe-chat/commit/f6b4ca4))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 0.159.9](https://github.com/lobehub/lobe-chat/compare/v0.159.8...v0.159.9)
6
31
 
7
32
  <sup>Released on **2024-05-14**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.159.9",
3
+ "version": "0.159.10",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -96,7 +96,7 @@
96
96
  "@lobehub/chat-plugins-gateway": "latest",
97
97
  "@lobehub/icons": "latest",
98
98
  "@lobehub/tts": "latest",
99
- "@lobehub/ui": "^1.138.23",
99
+ "@lobehub/ui": "^1.138.24",
100
100
  "@microsoft/fetch-event-source": "^2.0.1",
101
101
  "@next/third-parties": "^14.2.3",
102
102
  "@sentry/nextjs": "^7.114.0",
@@ -113,6 +113,6 @@ TopicListContent.displayName = 'TopicListContent';
113
113
 
114
114
  export default memo(() => (
115
115
  <Suspense fallback={<SkeletonList />}>
116
- <TopicListContent />;
116
+ <TopicListContent />
117
117
  </Suspense>
118
118
  ));
@@ -8,6 +8,7 @@ import { useTranslation } from 'react-i18next';
8
8
  import { Flexbox } from 'react-layout-kit';
9
9
 
10
10
  import { useInitAgentConfig } from '@/app/(main)/chat/(workspace)/_layout/useInitAgentConfig';
11
+ import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
11
12
  import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';
12
13
  import { useGlobalStore } from '@/store/global';
13
14
  import { useSessionStore } from '@/store/session';
@@ -45,7 +46,7 @@ const Main = memo(() => {
45
46
  />
46
47
  </Flexbox>
47
48
  ) : (
48
- <Flexbox align={'flex-start'} gap={12} horizontal>
49
+ <Flexbox align={'center'} gap={4} horizontal>
49
50
  {
50
51
  <ActionIcon
51
52
  aria-label={t('agentsAndConversations')}
@@ -57,7 +58,7 @@ const Main = memo(() => {
57
58
  showSessionPanel: !currentShowSessionPanel,
58
59
  });
59
60
  }}
60
- size="large"
61
+ size={DESKTOP_HEADER_ICON_SIZE}
61
62
  title={t('agentsAndConversations')}
62
63
  />
63
64
  }
@@ -1,20 +1,15 @@
1
1
  'use client';
2
2
 
3
3
  import { ActionIcon, ChatHeader, ChatHeaderTitle } from '@lobehub/ui';
4
- import { Drawer, type DrawerProps, Tag } from 'antd';
4
+ import { type DrawerProps, Popover } from 'antd';
5
5
  import { createStyles } from 'antd-style';
6
6
  import { Menu } from 'lucide-react';
7
- import { PropsWithChildren, memo, useState } from 'react';
8
- import { useTranslation } from 'react-i18next';
9
- import { Flexbox } from 'react-layout-kit';
10
-
11
- import BrandWatermark from '@/components/BrandWatermark';
12
- import { useActiveSettingsKey } from '@/hooks/useActiveSettingsKey';
13
- import { SettingsTabs } from '@/store/global/initialState';
7
+ import { PropsWithChildren, memo } from 'react';
14
8
 
15
9
  const useStyles = createStyles(({ token, css }) => ({
16
10
  container: css`
17
11
  position: relative;
12
+ flex: none;
18
13
  height: 54px;
19
14
  background: ${token.colorBgContainer};
20
15
  `,
@@ -25,68 +20,33 @@ const useStyles = createStyles(({ token, css }) => ({
25
20
  `,
26
21
  }));
27
22
 
28
- const Header = memo<PropsWithChildren & Pick<DrawerProps, 'getContainer'>>(
29
- ({ children, getContainer }) => {
30
- const [open, setOpen] = useState(false);
31
- const { styles, theme } = useStyles();
32
- const { t } = useTranslation('setting');
33
-
34
- const activeKey = useActiveSettingsKey();
23
+ const Header = memo<PropsWithChildren & Pick<DrawerProps, 'getContainer'>>(({ children }) => {
24
+ const { styles, theme } = useStyles();
35
25
 
36
- return (
37
- <>
38
- <ChatHeader
39
- className={styles.container}
40
- left={
41
- <div style={{ paddingLeft: 8 }}>
42
- <ChatHeaderTitle
43
- title={
44
- <Flexbox align={'center'} className={styles.title} gap={4} horizontal>
45
- <ActionIcon
46
- color={theme.colorText}
47
- icon={Menu}
48
- onClick={() => setOpen(true)}
49
- size={{ blockSize: 32, fontSize: 18 }}
50
- />
51
- {t(`tab.${activeKey}`)}
52
- {activeKey === SettingsTabs.Sync && (
53
- <Tag color={'gold'}>{t('tab.experiment')}</Tag>
54
- )}
55
- </Flexbox>
56
- }
26
+ return (
27
+ <ChatHeader
28
+ className={styles.container}
29
+ left={
30
+ <ChatHeaderTitle
31
+ title={
32
+ <Popover
33
+ arrow={false}
34
+ content={children}
35
+ overlayInnerStyle={{ minWidth: 240, padding: '2px 4px' }}
36
+ placement={'bottomLeft'}
37
+ trigger={['click']}
38
+ >
39
+ <ActionIcon
40
+ color={theme.colorText}
41
+ icon={Menu}
42
+ size={{ blockSize: 32, fontSize: 18 }}
57
43
  />
58
- </div>
44
+ </Popover>
59
45
  }
60
46
  />
61
- <Drawer
62
- bodyStyle={{
63
- display: 'flex',
64
- flexDirection: 'column',
65
- gap: 20,
66
- justifyContent: 'space-between',
67
- padding: 16,
68
- }}
69
- getContainer={getContainer}
70
- headerStyle={{ display: 'none' }}
71
- maskStyle={{ background: 'transparent' }}
72
- onClick={() => setOpen(false)}
73
- onClose={() => setOpen(false)}
74
- open={open}
75
- placement={'left'}
76
- rootStyle={{ position: 'absolute' }}
77
- style={{
78
- background: theme.colorBgContainer,
79
- borderRight: `1px solid ${theme.colorSplit}`,
80
- }}
81
- width={260}
82
- zIndex={10}
83
- >
84
- {children}
85
- <BrandWatermark paddingInline={12} />
86
- </Drawer>
87
- </>
88
- );
89
- },
90
- );
47
+ }
48
+ />
49
+ );
50
+ });
91
51
 
92
52
  export default Header;
@@ -18,11 +18,11 @@ const SettingModalLayout = memo<SettingLayoutProps>(({ children, category, desc,
18
18
  const ref = useRef<any>(null);
19
19
  const theme = useTheme();
20
20
  const { isDarkMode } = useThemeMode();
21
- const { md = true } = useResponsive();
21
+ const { mobile = false } = useResponsive();
22
22
 
23
23
  return (
24
- <>
25
- {md ? (
24
+ <Flexbox horizontal={!mobile} width={'100%'}>
25
+ {!mobile ? (
26
26
  <SideBar
27
27
  desc={desc}
28
28
  style={{
@@ -38,19 +38,25 @@ const SettingModalLayout = memo<SettingLayoutProps>(({ children, category, desc,
38
38
  )}
39
39
  <Flexbox
40
40
  align={'center'}
41
- gap={64}
41
+ gap={mobile ? 0 : 64}
42
+ ref={ref}
42
43
  style={{
43
- background: isDarkMode ? theme.colorFillQuaternary : theme.colorBgElevated,
44
+ background: mobile
45
+ ? theme.colorBgContainer
46
+ : isDarkMode
47
+ ? theme.colorFillQuaternary
48
+ : theme.colorBgElevated,
49
+ minHeight: '100%',
44
50
  overflowX: 'hidden',
45
51
  overflowY: 'auto',
46
- paddingBlock: 40,
47
- paddingInline: 56,
52
+ paddingBlock: mobile ? 0 : 40,
53
+ paddingInline: mobile ? 0 : 56,
48
54
  }}
49
55
  width={'100%'}
50
56
  >
51
57
  {children}
52
58
  </Flexbox>
53
- </>
59
+ </Flexbox>
54
60
  );
55
61
  });
56
62
 
@@ -12,7 +12,7 @@ import { MAX_WIDTH } from '@/const/layoutTokens';
12
12
  const NotFound = memo(() => {
13
13
  const { t } = useTranslation('error');
14
14
  return (
15
- <Flexbox align={'center'} justify={'center'} style={{ height: '100%', width: '100%' }}>
15
+ <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100%', width: '100%' }}>
16
16
  <h1
17
17
  style={{
18
18
  filter: 'blur(8px)',
@@ -24,7 +24,7 @@ const ErrorCapture = memo<ErrorCaptureProps>(({ reset, error }) => {
24
24
  }, [error]);
25
25
 
26
26
  return (
27
- <Flexbox align={'center'} justify={'center'} style={{ height: '100%', width: '100%' }}>
27
+ <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100%', width: '100%' }}>
28
28
  <h1
29
29
  style={{
30
30
  filter: 'blur(8px)',
@@ -1,5 +1,6 @@
1
1
  import { usePathname } from 'next/navigation';
2
2
 
3
+ import { useQuery } from '@/hooks/useQuery';
3
4
  import { SettingsTabs } from '@/store/global/initialState';
4
5
 
5
6
  /**
@@ -7,10 +8,13 @@ import { SettingsTabs } from '@/store/global/initialState';
7
8
  */
8
9
  export const useActiveSettingsKey = () => {
9
10
  const pathname = usePathname();
11
+ const { tab } = useQuery();
10
12
 
11
13
  const tabs = pathname.split('/').at(-1);
12
14
 
13
15
  if (tabs === 'settings') return SettingsTabs.Common;
14
16
 
17
+ if (tabs === 'modal') return tab as SettingsTabs;
18
+
15
19
  return tabs as SettingsTabs;
16
20
  };