@lobehub/chat 0.70.3 → 0.70.4

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.70.4](https://github.com/lobehub/lobe-chat/compare/v0.70.3...v0.70.4)
6
+
7
+ <sup>Released on **2023-09-09**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix route.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix route ([2d1e8d6](https://github.com/lobehub/lobe-chat/commit/2d1e8d6))
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.70.3](https://github.com/lobehub/lobe-chat/compare/v0.70.2...v0.70.3)
6
31
 
7
32
  <sup>Released on **2023-09-09**</sup>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "about": "About",
3
3
  "advanceSettings": "Advanced Settings",
4
- "agentDefaultMessage": "Hello, I'm **{{name}}**. You can start chatting with me right away or go to [Assistant Settings](/chat/{{id}}/setting) to complete my information.",
4
+ "agentDefaultMessage": "Hello, I'm **{{name}}**. You can start chatting with me right away or go to [Assistant Settings](/chat/setting#session={{id}}) to complete my information.",
5
5
  "agentDefaultMessageWithSystemRole": "Hello, I'm **{{name}}**, {{systemRole}}. Let's start chatting!",
6
6
  "agentMaxToken": "Max Session Length",
7
7
  "agentModel": "Model",
@@ -62,7 +62,7 @@
62
62
  "stop": "Stop",
63
63
  "tab": {
64
64
  "chat": "Chat",
65
- "market": "Assistant Market",
65
+ "market": "Discover",
66
66
  "setting": "Settings"
67
67
  },
68
68
  "temp": "Temporary",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "about": "Наш Github",
3
3
  "advanceSettings": "Дополнительные настройки",
4
- "agentDefaultMessage": "Здравствуйте, я **{{name}}**. Вы можете начать общаться со мной прямо сейчас или перейти на [Assistant Settings](/chat/{{id}}/setting) для моей настройки.",
4
+ "agentDefaultMessage": "Здравствуйте, я **{{name}}**. Вы можете начать общаться со мной прямо сейчас или перейти на [Assistant Settings](/chat/setting#session={{id}}) для моей настройки.",
5
5
  "agentDefaultMessageWithSystemRole": "Здравствуйте, Я **{{name}}**, {{systemRole}}. Давайте начнем общаться!",
6
6
  "agentMaxToken": "Максимальная длина запроса",
7
7
  "agentModel": "Модель",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "about": "关于",
3
3
  "advanceSettings": "高级设置",
4
- "agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/{{id}}/setting) 完善我的信息。",
4
+ "agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/setting#session={{id}}) 完善我的信息。",
5
5
  "agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!",
6
6
  "agentMaxToken": "会话最大长度",
7
7
  "agentModel": "模型",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.70.3",
3
+ "version": "0.70.4",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -36,7 +36,7 @@ export default memo<{ className?: string }>(({ className }) => {
36
36
  icon: (active) => <Icon className={active ? styles.active : undefined} icon={Sticker} />,
37
37
  key: 'market',
38
38
  onClick: () => {
39
- Router.push('/market');
39
+ Router.push({ hash: '', pathname: `/market` });
40
40
  },
41
41
  title: t('tab.market'),
42
42
  },
@@ -2,7 +2,7 @@ export default {
2
2
  about: '关于',
3
3
  advanceSettings: '高级设置',
4
4
  agentDefaultMessage:
5
- '你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/{{id}}/setting) 完善我的信息。',
5
+ '你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/setting#session={{id}}) 完善我的信息。',
6
6
  agentDefaultMessageWithSystemRole: '你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!',
7
7
  agentMaxToken: '会话最大长度',
8
8
  agentModel: '模型',
@@ -24,7 +24,7 @@ const MobileHeader = memo(() => {
24
24
  return (
25
25
  <MobileNavBar
26
26
  center={<MobileNavBarTitle desc={model} title={displayTitle} />}
27
- onBackClick={() => Router.push('/chat')}
27
+ onBackClick={() => Router.push({ hash: null, pathname: `/chat` })}
28
28
  right={
29
29
  <>
30
30
  <ActionIcon icon={LayoutList} onClick={() => toggleConfig()} />
@@ -1,17 +1,15 @@
1
1
  import { ChatHeader, ChatHeaderTitle } from '@lobehub/ui';
2
+ import Router from 'next/router';
2
3
  import { ReactNode, memo } from 'react';
3
4
  import { useTranslation } from 'react-i18next';
4
5
 
5
- import { useSessionStore } from '@/store/session';
6
-
7
6
  const Header = memo<{ children: ReactNode }>(({ children }) => {
8
7
  const { t } = useTranslation('setting');
9
- const onBack = useSessionStore((s) => s.switchBackToChat);
10
8
 
11
9
  return (
12
10
  <ChatHeader
13
11
  left={<ChatHeaderTitle title={t('header.session')} />}
14
- onBackClick={onBack}
12
+ onBackClick={() => Router.push({ hash: location.hash, pathname: `/chat` })}
15
13
  right={children}
16
14
  showBackButton
17
15
  />
@@ -9,7 +9,7 @@ const Header = memo<{ children: ReactNode }>(({ children }) => {
9
9
  return (
10
10
  <MobileNavBar
11
11
  center={<MobileNavBarTitle title={t('header.session')} />}
12
- onBackClick={() => Router.back()}
12
+ onBackClick={() => Router.push({ hash: location.hash, pathname: `/chat/mobile` })}
13
13
  right={children}
14
14
  showBackButton
15
15
  />
@@ -1,53 +1,29 @@
1
- import { ActionIcon, Logo, SearchBar } from '@lobehub/ui';
1
+ import { ChatHeader, Logo, SearchBar } from '@lobehub/ui';
2
2
  import { createStyles } from 'antd-style';
3
- import { MessageSquarePlus } from 'lucide-react';
4
3
  import Link from 'next/link';
5
4
  import { memo } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
7
- import { Flexbox } from 'react-layout-kit';
8
-
9
- import { useSessionStore } from '@/store/session';
10
6
 
11
7
  export const useStyles = createStyles(({ css, token }) => ({
12
8
  logo: css`
9
+ color: ${token.colorText};
13
10
  fill: ${token.colorText};
14
11
  `,
15
- top: css`
16
- position: sticky;
17
- top: 0;
18
- `,
19
12
  }));
20
13
 
21
14
  const Header = memo(() => {
22
15
  const { styles } = useStyles();
23
16
  const { t } = useTranslation('common');
24
- const [keywords, createSession] = useSessionStore((s) => [s.searchKeywords, s.createSession]);
25
17
 
26
18
  return (
27
- <Flexbox className={styles.top} gap={16} padding={16}>
28
- <Flexbox distribution={'space-between'} horizontal>
19
+ <ChatHeader
20
+ left={
29
21
  <Link href={'/'}>
30
- <Logo className={styles.logo} size={36} type={'text'} />
22
+ <Logo className={styles.logo} extra={t('tab.market')} size={36} type={'text'} />
31
23
  </Link>
32
- <ActionIcon
33
- icon={MessageSquarePlus}
34
- onClick={createSession}
35
- size={{ fontSize: 24 }}
36
- style={{ flex: 'none' }}
37
- title={t('newAgent')}
38
- />
39
- </Flexbox>
40
- <SearchBar
41
- allowClear
42
- enableShortKey
43
- onChange={(e) => useSessionStore.setState({ searchKeywords: e.target.value })}
44
- placeholder={t('searchAgentPlaceholder')}
45
- shortKey={'k'}
46
- spotlight
47
- type={'ghost'}
48
- value={keywords}
49
- />
50
- </Flexbox>
24
+ }
25
+ right={<SearchBar allowClear spotlight type={'ghost'} />}
26
+ />
51
27
  );
52
28
  });
53
29