@lobehub/chat 0.98.0 → 0.98.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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.98.2](https://github.com/lobehub/lobe-chat/compare/v0.98.1...v0.98.2)
6
+
7
+ <sup>Released on **2023-11-07**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor antd locale file to useSWR.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Refactor antd locale file to useSWR ([2e1cd7c](https://github.com/lobehub/lobe-chat/commit/2e1cd7c))
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
+
30
+ ### [Version 0.98.1](https://github.com/lobehub/lobe-chat/compare/v0.98.0...v0.98.1)
31
+
32
+ <sup>Released on **2023-11-07**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Update welcome assetes.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Update welcome assetes ([8840554](https://github.com/lobehub/lobe-chat/commit/8840554))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ## [Version 0.98.0](https://github.com/lobehub/lobe-chat/compare/v0.97.1...v0.98.0)
6
56
 
7
57
  <sup>Released on **2023-11-07**</sup>
package/README.md CHANGED
@@ -35,6 +35,8 @@ LobeChat is an open-source, extensible ([Function Calling][fc-link]) high-perfor
35
35
  [![][share-reddit-shield]][share-reddit-link]
36
36
  [![][share-weibo-shield]][share-weibo-link]
37
37
 
38
+ <sup>Pioneering the new age of thinking and creating. Built for you, the Super Individual.</sup>
39
+
38
40
  ![](https://gw.alipayobjects.com/zos/kitchen/RKnWrrfuMl/welcome.webp)
39
41
 
40
42
  </div>
@@ -7,8 +7,8 @@
7
7
  "pickAgent": "Or choose from the following agent templates",
8
8
  "skip": "Skip Creation",
9
9
  "slogan": {
10
- "desc1": "Unlock the power of your brain and ignite your creativity. Your intelligent agent is always here.",
10
+ "desc1": "Pioneering the new age of thinking and creating. Built for you, the Super Individual.",
11
11
  "desc2": "Create your first agent and let's get started~",
12
- "title": "Give yourself a smarter brain"
12
+ "title": "Unlock the superpower of your brain"
13
13
  }
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.98.0",
3
+ "version": "0.98.2",
4
4
  "description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -46,7 +46,7 @@ const SystemRole = memo(() => {
46
46
 
47
47
  const handleOpen = () => {
48
48
  if (!init) return;
49
- setEditing(false);
49
+
50
50
  setOpen(true);
51
51
  };
52
52
 
@@ -82,9 +82,11 @@ const SystemRole = memo(() => {
82
82
  extra: (
83
83
  <AgentInfo
84
84
  meta={meta}
85
- onAvatarClick={() =>
86
- router.push(pathString('/chat/settings', { hash: location.hash }))
87
- }
85
+ onAvatarClick={() => {
86
+ setOpen(false);
87
+ setEditing(false);
88
+ router.push(pathString('/chat/settings', { hash: location.hash }));
89
+ }}
88
90
  style={{ marginBottom: 16 }}
89
91
  />
90
92
  ),
@@ -1,27 +1,40 @@
1
1
  import dynamic from 'next/dynamic';
2
2
  import { memo } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
+ import { Flexbox } from 'react-layout-kit';
4
5
 
5
6
  import { genSize, useStyles } from './style';
6
7
 
7
8
  const LogoThree = dynamic(() => import('@lobehub/ui/es/LogoThree'));
9
+ const LogoSpline = dynamic(() => import('@lobehub/ui/es/LogoThree/LogoSpline'));
8
10
 
9
11
  const Hero = memo<{ mobile?: boolean; width: number }>(({ width, mobile }) => {
10
- const size = {
12
+ const size: any = {
11
13
  base: genSize(width / 3.5, 240),
12
14
  desc: genSize(width / 50, 14),
13
- logo: genSize(width / 3.8, 180),
15
+ logo: genSize(width / 2.5, 180),
14
16
  title: genSize(width / 20, 32),
15
17
  };
18
+
19
+ size.marginTop = mobile ? -size.logo / 9 : -size.logo / 3;
20
+ size.marginBottom = mobile ? -size.logo / 9 : -size.logo / 4;
21
+
16
22
  const { styles } = useStyles(size.base);
17
23
 
18
24
  const { t } = useTranslation('welcome');
19
25
 
20
26
  return (
21
27
  <>
22
- <div style={{ height: size.logo, marginTop: -size.logo / 5, width: size.logo }}>
23
- <LogoThree size={size.logo} />
24
- </div>
28
+ <Flexbox
29
+ style={{
30
+ height: size.logo,
31
+ marginBottom: size.marginBottom,
32
+ marginTop: size.marginTop,
33
+ position: 'relative',
34
+ }}
35
+ >
36
+ {mobile ? <LogoThree size={size.logo} /> : <LogoSpline height={'100%'} width={'100%'} />}
37
+ </Flexbox>
25
38
  <div className={styles.title} style={{ fontSize: size.title }}>
26
39
  <strong style={mobile ? { fontSize: '1.2em' } : {}}>LobeChat</strong>
27
40
  {mobile ? <br /> : ' '}
@@ -1,6 +1,6 @@
1
1
  import { ConfigProvider } from 'antd';
2
- import defaultLocale from 'antd/locale/en_US';
3
2
  import { PropsWithChildren, memo, useState } from 'react';
3
+ import useSWR from 'swr';
4
4
 
5
5
  import { createI18nNext } from '@/locales/create';
6
6
  import { useOnFinishHydrationGlobal } from '@/store/global';
@@ -12,7 +12,11 @@ interface LocaleLayoutProps extends PropsWithChildren {
12
12
  }
13
13
 
14
14
  const InnerLocale = memo<LocaleLayoutProps>(({ children, lang }) => {
15
- const [locale, setLocale] = useState(defaultLocale);
15
+ const { data: locale } = useSWR(
16
+ lang,
17
+ async () =>
18
+ await import(`antd/locale/${lang?.includes('-') ? lang?.replace('-', '_') : 'en-US'}.js`),
19
+ );
16
20
  const [i18n] = useState(createI18nNext(lang));
17
21
 
18
22
  // if run on server side, init i18n instance everytime
@@ -27,19 +31,10 @@ const InnerLocale = memo<LocaleLayoutProps>(({ children, lang }) => {
27
31
  });
28
32
  }
29
33
 
30
- const getLocale = async (localeName: string) => {
31
- setLocale((await import(`antd/locale/${localeName}.js`)) as any);
32
- };
33
-
34
34
  useOnFinishHydrationGlobal((s) => {
35
35
  if (s.settings.language === 'auto') {
36
36
  switchLang('auto');
37
37
  }
38
-
39
- if (lang?.includes('-') && lang !== 'en-US') {
40
- const localeName = lang?.replace('-', '_');
41
- getLocale(localeName);
42
- }
43
38
  }, []);
44
39
 
45
40
  return <ConfigProvider locale={locale}>{children}</ConfigProvider>;