@lobehub/chat 0.77.1 → 0.77.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.77.2](https://github.com/lobehub/lobe-chat/compare/v0.77.1...v0.77.2)
6
+
7
+ <sup>Released on **2023-09-15**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **settings**: Fix settings route.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **settings**: Fix settings route, closes [#195](https://github.com/lobehub/lobe-chat/issues/195) ([1b7d84e](https://github.com/lobehub/lobe-chat/commit/1b7d84e))
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.77.1](https://github.com/lobehub/lobe-chat/compare/v0.77.0...v0.77.1)
6
31
 
7
32
  <sup>Released on **2023-09-14**</sup>
package/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.77.1",
3
+ "version": "0.77.2",
4
4
  "description": "Lobe Chat is an open-source chatbot client using Vercel AI SDK, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -0,0 +1,95 @@
1
+ import { GridBackground, Icon, Logo } from '@lobehub/ui';
2
+ import { createStyles, useResponsive } from 'antd-style';
3
+ import { PackageCheck } from 'lucide-react';
4
+ import { rgba } from 'polished';
5
+ import { ReactNode, memo } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+
8
+ import pkg from '@/../package.json';
9
+
10
+ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
11
+ background: css`
12
+ position: absolute;
13
+ bottom: -10%;
14
+ left: 0;
15
+ width: 100%;
16
+ `,
17
+ banner: css`
18
+ position: relative;
19
+
20
+ overflow: hidden;
21
+
22
+ width: 100%;
23
+ max-width: 1024px;
24
+ height: 160px;
25
+ padding: 4px;
26
+
27
+ background: radial-gradient(
28
+ 120% 120% at 20% 100%,
29
+ ${isDarkMode ? rgba(token.colorBgContainer, 0.5) : token.colorBgContainer} 32%,
30
+ ${isDarkMode ? token.colorPrimaryBgHover : rgba(token.colorPrimaryBgHover, 0.3)} 50%,
31
+ ${isDarkMode ? token.colorPrimaryHover : rgba(token.colorPrimaryHover, 0.3)} 100%
32
+ );
33
+ border: 1px solid ${token.colorBorderSecondary};
34
+ border-radius: ${token.borderRadiusLG}px;
35
+ `,
36
+ logo: css`
37
+ position: absolute;
38
+ top: 50%;
39
+ left: 32px;
40
+ transform: translateY(-50%);
41
+ `,
42
+ mobile: css`
43
+ margin-top: -16px;
44
+
45
+ .ant-tabs-tab,
46
+ .ant-tabs-tab + .ant-tabs-tab {
47
+ margin: 4px 8px !important;
48
+ }
49
+ `,
50
+ tag: css`
51
+ position: absolute;
52
+ top: 6px;
53
+ right: 12px;
54
+
55
+ font-family: ${token.fontFamilyCode};
56
+ font-size: 12px;
57
+ color: ${isDarkMode ? token.colorPrimaryBg : token.colorPrimaryActive};
58
+
59
+ opacity: 0.5;
60
+ `,
61
+ }));
62
+
63
+ const Banner = memo<{ nav: ReactNode }>(({ nav }) => {
64
+ const { styles, theme } = useStyles();
65
+ const { mobile } = useResponsive();
66
+
67
+ if (mobile)
68
+ return (
69
+ <Flexbox align={'flex-end'} className={styles.mobile} horizontal justify={'center'}>
70
+ {nav}
71
+ </Flexbox>
72
+ );
73
+
74
+ return (
75
+ <Flexbox align={'flex-end'} className={styles.banner} horizontal justify={'center'}>
76
+ <GridBackground
77
+ animation
78
+ className={styles.background}
79
+ colorBack={theme.colorFillSecondary}
80
+ colorFront={theme.colorPrimary}
81
+ random
82
+ />
83
+ {nav}
84
+ <div className={styles.logo}>
85
+ <Logo extra={'Chat'} type={'text'} />
86
+ </div>
87
+ <Flexbox align={'center'} className={styles.tag} gap={4} horizontal>
88
+ <Icon icon={PackageCheck} />
89
+ <div>{`${pkg.version}`}</div>
90
+ </Flexbox>
91
+ </Flexbox>
92
+ );
93
+ });
94
+
95
+ export default Banner;
@@ -1,5 +1,4 @@
1
- import { ChatHeader, ChatHeaderTitle } from '@lobehub/ui';
2
- import Router from 'next/router';
1
+ import { ChatHeader, ChatHeaderTitle, Logo } from '@lobehub/ui';
3
2
  import { memo } from 'react';
4
3
  import { useTranslation } from 'react-i18next';
5
4
 
@@ -8,9 +7,7 @@ const Index = memo(() => {
8
7
 
9
8
  return (
10
9
  <ChatHeader
11
- left={<ChatHeaderTitle title={t('header.global')} />}
12
- onBackClick={() => Router.back()}
13
- showBackButton
10
+ left={<ChatHeaderTitle title={<Logo extra={t('header.global')} type={'text'} />} />}
14
11
  />
15
12
  );
16
13
  });
@@ -9,7 +9,7 @@ const Header = memo(() => {
9
9
  return (
10
10
  <MobileNavBar
11
11
  center={<MobileNavBarTitle title={t('header.global')} />}
12
- onBackClick={() => Router.back()}
12
+ onBackClick={() => Router.push('/chat')}
13
13
  showBackButton
14
14
  />
15
15
  );
@@ -1,65 +1,16 @@
1
- import { GridBackground, Icon, Logo, TabsNav } from '@lobehub/ui';
2
- import { createStyles } from 'antd-style';
3
- import { PackageCheck } from 'lucide-react';
4
- import { rgba } from 'polished';
1
+ import { TabsNav } from '@lobehub/ui';
5
2
  import { memo, useMemo } from 'react';
6
3
  import { useTranslation } from 'react-i18next';
7
- import { Center, Flexbox } from 'react-layout-kit';
4
+ import { Center } from 'react-layout-kit';
8
5
 
9
6
  import { useGlobalStore } from '@/store/global';
10
7
 
11
- import pkg from '../../../../../package.json';
8
+ import Banner from '../Banner';
12
9
  import Agent from './Agent';
13
10
  import Common from './Common';
14
11
  import LLM from './LLM';
15
12
 
16
- const useStyles = createStyles(({ css, token, isDarkMode }) => ({
17
- background: css`
18
- position: absolute;
19
- bottom: -10%;
20
- left: 0;
21
- width: 100%;
22
- `,
23
- logo: css`
24
- position: absolute;
25
- top: 50%;
26
- left: 32px;
27
- transform: translateY(-50%);
28
- `,
29
- tabs: css`
30
- position: relative;
31
-
32
- overflow: hidden;
33
-
34
- width: 100%;
35
- max-width: 1024px;
36
- height: 160px;
37
- padding: 4px;
38
-
39
- background: radial-gradient(
40
- 120% 120% at 20% 100%,
41
- ${isDarkMode ? rgba(token.colorBgContainer, 0.5) : token.colorBgContainer} 32%,
42
- ${isDarkMode ? token.colorPrimaryBgHover : rgba(token.colorPrimaryBgHover, 0.3)} 50%,
43
- ${isDarkMode ? token.colorPrimaryHover : rgba(token.colorPrimaryHover, 0.3)} 100%
44
- );
45
- border: 1px solid ${token.colorBorderSecondary};
46
- border-radius: ${token.borderRadiusLG}px;
47
- `,
48
- tag: css`
49
- position: absolute;
50
- top: 6px;
51
- right: 12px;
52
-
53
- font-family: ${token.fontFamilyCode};
54
- font-size: 12px;
55
- color: ${isDarkMode ? token.colorPrimaryBg : token.colorPrimaryActive};
56
-
57
- opacity: 0.5;
58
- `,
59
- }));
60
-
61
13
  const Settings = memo(() => {
62
- const { styles, theme } = useStyles();
63
14
  const { t } = useTranslation('setting');
64
15
 
65
16
  const [tab, setTab] = useGlobalStore((s) => [s.settingsTab, s.switchSettingTabs]);
@@ -81,31 +32,19 @@ const Settings = memo(() => {
81
32
 
82
33
  return (
83
34
  <Center gap={16} width={'100%'}>
84
- <Flexbox align={'flex-end'} className={styles.tabs} horizontal justify={'center'}>
85
- <GridBackground
86
- animation
87
- className={styles.background}
88
- colorBack={theme.colorFillSecondary}
89
- colorFront={theme.colorPrimary}
90
- random
91
- />
92
- <TabsNav
93
- activeKey={tab}
94
- items={[
95
- { key: 'common', label: t('tab.common') },
96
- { key: 'llm', label: t('tab.llm') },
97
- { key: 'agent', label: t('tab.agent') },
98
- ]}
99
- onChange={(e) => setTab(e as any)}
100
- />
101
- <div className={styles.logo}>
102
- <Logo extra={'Chat'} type={'text'} />
103
- </div>
104
- <Flexbox align={'center'} className={styles.tag} gap={4} horizontal>
105
- <Icon icon={PackageCheck} />
106
- <div>{`${pkg.version}`}</div>
107
- </Flexbox>
108
- </Flexbox>
35
+ <Banner
36
+ nav={
37
+ <TabsNav
38
+ activeKey={tab}
39
+ items={[
40
+ { key: 'common', label: t('tab.common') },
41
+ { key: 'llm', label: t('tab.llm') },
42
+ { key: 'agent', label: t('tab.agent') },
43
+ ]}
44
+ onChange={(e) => setTab(e as any)}
45
+ />
46
+ }
47
+ />
109
48
  {content}
110
49
  </Center>
111
50
  );