@lobehub/chat 0.79.6 → 0.79.8

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.79.8](https://github.com/lobehub/lobe-chat/compare/v0.79.7...v0.79.8)
6
+
7
+ <sup>Released on **2023-09-27**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix safeare in mobile.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix safeare in mobile ([2adfb04](https://github.com/lobehub/lobe-chat/commit/2adfb04))
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.79.7](https://github.com/lobehub/lobe-chat/compare/v0.79.6...v0.79.7)
31
+
32
+ <sup>Released on **2023-09-27**</sup>
33
+
34
+ #### ♻ Code Refactoring
35
+
36
+ - **misc**: Use hook to check PWA env.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Code refactoring
44
+
45
+ - **misc**: Use hook to check PWA env ([b4234db](https://github.com/lobehub/lobe-chat/commit/b4234db))
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.79.6](https://github.com/lobehub/lobe-chat/compare/v0.79.5...v0.79.6)
6
56
 
7
57
  <sup>Released on **2023-09-27**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.79.6",
3
+ "version": "0.79.8",
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",
@@ -68,8 +68,8 @@
68
68
  "@emoji-mart/data": "^1",
69
69
  "@emoji-mart/react": "^1",
70
70
  "@icons-pack/react-simple-icons": "^9",
71
- "@lobehub/chat-plugin-sdk": "^1.17.7",
72
- "@lobehub/chat-plugins-gateway": "^1.5.3",
71
+ "@lobehub/chat-plugin-sdk": "latest",
72
+ "@lobehub/chat-plugins-gateway": "latest",
73
73
  "@lobehub/ui": "latest",
74
74
  "@vercel/analytics": "^1",
75
75
  "ahooks": "^3",
@@ -88,16 +88,16 @@
88
88
  "lucide-react": "latest",
89
89
  "nanoid": "^5",
90
90
  "next": "^13.5.3",
91
- "openai": "^4.10.0",
91
+ "openai": "^4",
92
92
  "polished": "^4",
93
93
  "react": "^18",
94
94
  "react-dom": "^18",
95
95
  "react-hotkeys-hook": "^4",
96
96
  "react-i18next": "^13",
97
97
  "react-intersection-observer": "^9",
98
- "react-layout-kit": "^1.7.4",
98
+ "react-layout-kit": "^1",
99
99
  "swr": "^2",
100
- "systemjs": "^6.14.2",
100
+ "systemjs": "^6",
101
101
  "ts-md5": "^1",
102
102
  "url-join": "^5",
103
103
  "use-merge-value": "^1",
@@ -118,7 +118,7 @@
118
118
  "@types/node": "^20",
119
119
  "@types/react": "^18",
120
120
  "@types/react-dom": "^18",
121
- "@types/systemjs": "^6.13.3",
121
+ "@types/systemjs": "^6",
122
122
  "@types/uuid": "^9",
123
123
  "@umijs/lint": "^4",
124
124
  "@vitest/coverage-v8": "latest",
Binary file
Binary file
@@ -4,23 +4,38 @@
4
4
  "display": "fullscreen",
5
5
  "icons": [
6
6
  {
7
- "src": "https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/android-chrome-192x192.png",
7
+ "src": "/icons/icon-192x192.png",
8
8
  "sizes": "192x192",
9
- "type": "image/png"
9
+ "type": "image/png",
10
+ "purpose": "any"
11
+ },
12
+ {
13
+ "src": "/icons/icon-maskable-192x192.png",
14
+ "sizes": "192x192",
15
+ "type": "image/png",
16
+ "purpose": "maskable"
10
17
  },
11
18
  {
12
- "src": "https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/android-chrome-512x512.png",
19
+ "src": "/icons/icon-512x512.png",
13
20
  "sizes": "512x512",
14
- "type": "image/png"
21
+ "type": "image/png",
22
+ "purpose": "any"
23
+ },
24
+ {
25
+ "src": "/icons/icon-maskable-512x512.png",
26
+ "sizes": "512x512",
27
+ "type": "image/png",
28
+ "purpose": "maskable"
15
29
  }
16
30
  ],
31
+ "id": "/",
17
32
  "name": "LobeChat",
18
33
  "orientation": "portrait",
19
34
  "scope": "/",
20
35
  "screenshots": [
21
36
  {
22
- "src": "https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/og-960x720.png",
23
- "sizes": "960x720",
37
+ "src": "https://registry.npmmirror.com/@lobehub/assets-favicons/1.4.0/files/assets/og-960x540.png",
38
+ "sizes": "960x540",
24
39
  "type": "image/png"
25
40
  }
26
41
  ],
@@ -1,4 +1,5 @@
1
1
  import { ChatList, RenderMessage } from '@lobehub/ui';
2
+ import { createStyles } from 'antd-style';
2
3
  import isEqual from 'fast-deep-equal';
3
4
  import { memo, useCallback } from 'react';
4
5
  import { useTranslation } from 'react-i18next';
@@ -15,10 +16,22 @@ import FunctionCall from './Plugins/FunctionCall';
15
16
  import PluginMessage from './Plugins/PluginMessage';
16
17
  import SkeletonList from './SkeletonList';
17
18
 
18
- const List = () => {
19
+ const useStyles = createStyles(({ css, responsive, cx, stylish }) =>
20
+ cx(
21
+ stylish.noScrollbar,
22
+ css`
23
+ overflow-x: hidden;
24
+ ${responsive.mobile} {
25
+ width: 100vw;
26
+ }
27
+ `,
28
+ ),
29
+ );
30
+
31
+ const List = memo(() => {
19
32
  const init = useSessionChatInit();
20
33
  const { t } = useTranslation('common');
21
-
34
+ const { styles } = useStyles();
22
35
  const data = useSessionStore(chatSelectors.currentChatsWithGuideMessage, isEqual);
23
36
 
24
37
  const [
@@ -83,6 +96,7 @@ const List = () => {
83
96
 
84
97
  return (
85
98
  <ChatList
99
+ className={styles}
86
100
  data={data}
87
101
  enableHistoryCount={enableHistoryCount}
88
102
  historyCount={historyCount}
@@ -120,6 +134,6 @@ const List = () => {
120
134
  type={displayMode || 'chat'}
121
135
  />
122
136
  );
123
- };
137
+ });
124
138
 
125
- export default memo(List);
139
+ export default List;
@@ -1,30 +1,36 @@
1
1
  import { ActionIcon } from '@lobehub/ui';
2
2
  import { Popconfirm } from 'antd';
3
+ import { useResponsive } from 'antd-style';
3
4
  import { Eraser } from 'lucide-react';
4
5
  import { memo } from 'react';
5
6
  import { useTranslation } from 'react-i18next';
6
7
 
7
8
  import { useSessionStore } from '@/store/session';
8
9
 
10
+ import SaveTopic from '../Footer/SaveTopic';
11
+
9
12
  const ActionsRight = memo(() => {
10
13
  const { t } = useTranslation('setting');
11
14
  const [clearMessage] = useSessionStore((s) => [s.clearMessage, s.updateAgentConfig]);
12
-
15
+ const { mobile } = useResponsive();
13
16
  return (
14
- <Popconfirm
15
- cancelText={t('cancel', { ns: 'common' })}
16
- okButtonProps={{ danger: true }}
17
- okText={t('ok', { ns: 'common' })}
18
- onConfirm={() => clearMessage()}
19
- placement={'topRight'}
20
- title={t('confirmClearCurrentMessages', { ns: 'common' })}
21
- >
22
- <ActionIcon
23
- icon={Eraser}
24
- placement={'bottom'}
25
- title={t('clearCurrentMessages', { ns: 'common' })}
26
- />
27
- </Popconfirm>
17
+ <>
18
+ {mobile && <SaveTopic />}
19
+ <Popconfirm
20
+ cancelText={t('cancel', { ns: 'common' })}
21
+ okButtonProps={{ danger: true }}
22
+ okText={t('ok', { ns: 'common' })}
23
+ onConfirm={() => clearMessage()}
24
+ placement={'topRight'}
25
+ title={t('confirmClearCurrentMessages', { ns: 'common' })}
26
+ >
27
+ <ActionIcon
28
+ icon={Eraser}
29
+ placement={'bottom'}
30
+ title={t('clearCurrentMessages', { ns: 'common' })}
31
+ />
32
+ </Popconfirm>
33
+ </>
28
34
  );
29
35
  });
30
36
 
@@ -1,12 +1,35 @@
1
+ import { createStyles } from 'antd-style';
1
2
  import { ReactNode, memo } from 'react';
2
3
 
4
+ import SafeSpacing from '@/components/SafeSpacing';
5
+ import { CHAT_TEXTAREA_HEIGHT_MOBILE } from '@/const/layoutTokens';
6
+
7
+ const useStyles = createStyles(
8
+ ({ css, token }) => css`
9
+ position: fixed;
10
+ right: 0;
11
+ bottom: 0;
12
+ left: 0;
13
+
14
+ width: 100vw;
15
+
16
+ background: ${token.colorBgLayout};
17
+ `,
18
+ );
19
+
3
20
  interface ChatInputMobileLayoutProps {
4
21
  children: ReactNode;
5
22
  expand?: boolean;
6
23
  }
7
24
 
8
25
  const ChatInputMobileLayout = memo<ChatInputMobileLayoutProps>(({ children }) => {
9
- return <div>{children}</div>;
26
+ const { styles } = useStyles();
27
+ return (
28
+ <>
29
+ <SafeSpacing height={CHAT_TEXTAREA_HEIGHT_MOBILE} mobile position={'bottom'} />
30
+ <div className={styles}>{children}</div>
31
+ </>
32
+ );
10
33
  });
11
34
 
12
35
  export default ChatInputMobileLayout;
@@ -13,8 +13,8 @@ import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
13
13
  import Conversation from './features/Conversation';
14
14
  import Header from './features/Header';
15
15
  import SideBar from './features/Sidebar';
16
+ import DesktopLayout from './layout.desktop';
16
17
  import MobileLayout from './layout.mobile';
17
- import DesktopLayout from './layout.pc';
18
18
 
19
19
  const Chat = memo(() => {
20
20
  const { mobile } = useResponsive();
@@ -11,8 +11,8 @@ import { useSessionStore } from '@/store/session';
11
11
  import { agentSelectors } from '@/store/session/selectors';
12
12
  import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
13
13
 
14
+ import DesktopLayout from './layout.desktop';
14
15
  import MobileLayout from './layout.mobile';
15
- import DesktopLayout from './layout.pc';
16
16
 
17
17
  const EditPage = memo(() => {
18
18
  const { mobile } = useResponsive();
@@ -4,7 +4,7 @@ import { Flexbox } from 'react-layout-kit';
4
4
  import SafeSpacing from '@/components/SafeSpacing';
5
5
  import { HEADER_HEIGHT } from '@/const/layoutTokens';
6
6
 
7
- import ChatLayout from '../layout.pc';
7
+ import ChatLayout from '../layout.desktop';
8
8
  import Header from './features/Header';
9
9
 
10
10
  const DesktopLayout = memo<PropsWithChildren>(({ children }) => {
@@ -19,7 +19,7 @@ const RootLayout = ({ children }: PropsWithChildren) => {
19
19
  const primaryColor = cookieStore.get(LOBE_THEME_PRIMARY_COLOR);
20
20
 
21
21
  return (
22
- <html lang="en">
22
+ <html lang="en-US">
23
23
  <body>
24
24
  <StyleRegistry>
25
25
  <Layout
@@ -10,8 +10,8 @@ import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
10
10
 
11
11
  import AgentCard from './features/AgentCard';
12
12
  import AgentSearchBar from './features/AgentSearchBar';
13
+ import DesktopLayout from './layout.desktop';
13
14
  import MobileLayout from './layout.mobile';
14
- import DesktopLayout from './layout.pc';
15
15
 
16
16
  const Market = memo(() => {
17
17
  const { t } = useTranslation('common');
@@ -8,13 +8,6 @@ const title = genSiteHeadTitle();
8
8
  const description = pkg.description;
9
9
  const metadata: Metadata = {
10
10
  appleWebApp: {
11
- startupImage: [
12
- 'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/splash-750x1624.png',
13
- {
14
- media: '(device-width: 768px) and (device-height: 1024px)',
15
- url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/splash-2048x2732.png',
16
- },
17
- ],
18
11
  statusBarStyle: 'black-translucent',
19
12
  title: title,
20
13
  },
@@ -23,10 +16,6 @@ const metadata: Metadata = {
23
16
  apple:
24
17
  'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/apple-touch-icon.png',
25
18
  icon: 'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/favicon-32x32.png',
26
- other: {
27
- rel: 'mask-icon',
28
- url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/safari-pinned-tab.svg',
29
- },
30
19
  shortcut:
31
20
  'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/favicon.ico',
32
21
  },
@@ -37,17 +26,17 @@ const metadata: Metadata = {
37
26
  {
38
27
  alt: title,
39
28
  height: 360,
40
- url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/og-480x360.png',
29
+ url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/1.4.0/files/assets/og-480x270.png',
41
30
  width: 480,
42
31
  },
43
32
  {
44
33
  alt: title,
45
34
  height: 720,
46
- url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/latest/files/assets/og-960x720.png',
35
+ url: 'https://registry.npmmirror.com/@lobehub/assets-favicons/1.4.0/files/assets/og-960x540.png',
47
36
  width: 960,
48
37
  },
49
38
  ],
50
- locale: 'en_US',
39
+ locale: 'en-US',
51
40
  siteName: title,
52
41
  title: title,
53
42
  type: 'website',
@@ -57,7 +46,7 @@ const metadata: Metadata = {
57
46
  { color: '#fff', media: '(prefers-color-scheme: light)' },
58
47
  { color: '#000', media: '(prefers-color-scheme: dark)' },
59
48
  ],
60
- title: genSiteHeadTitle(),
49
+ title: title,
61
50
  viewport: {
62
51
  initialScale: 1,
63
52
  maximumScale: 1,
@@ -9,8 +9,8 @@ import { useSwitchSideBarOnInit } from '@/store/global';
9
9
  import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
10
10
 
11
11
  import Settings from './features/Settings';
12
+ import DesktopLayout from './layout.desktop';
12
13
  import MobileLayout from './layout.mobile';
13
- import DesktopLayout from './layout.pc';
14
14
 
15
15
  const Setting = memo(() => {
16
16
  const { mobile } = useResponsive();
@@ -9,8 +9,8 @@ import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
9
9
 
10
10
  import Banner from './features/Banner';
11
11
  import Footer from './features/Footer';
12
+ import Layout from './layout.desktop';
12
13
  import Mobile from './layout.mobile';
13
- import Layout from './layout.pc';
14
14
 
15
15
  const Welcome = memo(() => {
16
16
  const { mobile } = useResponsive();
@@ -10,7 +10,7 @@ const WelcomeLayout = memo<PropsWithChildren>(({ children }) => {
10
10
  <AppMobileLayout
11
11
  navBar={<MobileNavBar center={<Logo type={'text'} />} />}
12
12
  showTabBar
13
- style={{ background: theme.colorBgContainer }}
13
+ style={{ background: theme.colorBgLayout }}
14
14
  >
15
15
  {children}
16
16
  </AppMobileLayout>
@@ -4,6 +4,7 @@ export const HEADER_HEIGHT = 64;
4
4
  export const MOBILE_NABBAR_HEIGHT = 44;
5
5
  export const MOBILE_TABBAR_HEIGHT = 48;
6
6
  export const CHAT_TEXTAREA_HEIGHT = 200;
7
+ export const CHAT_TEXTAREA_HEIGHT_MOBILE = 180;
7
8
  export const CHAT_SIDEBAR_WIDTH = 280;
8
9
  export const MARKET_SIDEBAR_WIDTH = 400;
9
10
  export const FOLDER_WIDTH = 256;
@@ -0,0 +1,14 @@
1
+ import { useEffect, useState } from 'react';
2
+
3
+ export const useIsPWA = () => {
4
+ const [isPWA, setIsPWA] = useState(false);
5
+
6
+ useEffect(() => {
7
+ const isInStandaloneMode = () => window.matchMedia('(display-mode: standalone)').matches;
8
+ if (isInStandaloneMode()) {
9
+ setIsPWA(true);
10
+ }
11
+ }, []);
12
+
13
+ return isPWA;
14
+ };
@@ -3,15 +3,15 @@ import { PropsWithChildren, memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
4
 
5
5
  import SideBar from '@/features/SideBar';
6
-
7
- const isPwa = window.matchMedia('(display-mode: standalone)').matches;
6
+ import { useIsPWA } from '@/hooks/useIsPWA';
8
7
 
9
8
  const AppLayout = memo<PropsWithChildren>(({ children }) => {
9
+ const isPWA = useIsPWA();
10
10
  const theme = useTheme();
11
11
  return (
12
12
  <Flexbox
13
13
  horizontal
14
- style={isPwa ? { borderTop: `1px solid ${theme.colorBorder}` } : {}}
14
+ style={isPWA ? { borderTop: `1px solid ${theme.colorBorder}` } : {}}
15
15
  width={'100%'}
16
16
  >
17
17
  <SideBar />