@lobehub/chat 0.113.0 → 0.113.1

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.113.1](https://github.com/lobehub/lobe-chat/compare/v0.113.0...v0.113.1)
6
+
7
+ <sup>Released on **2023-12-16**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix fontsize setting and audio download style.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix fontsize setting and audio download style, closes [#433](https://github.com/lobehub/lobe-chat/issues/433) ([6882752](https://github.com/lobehub/lobe-chat/commit/6882752))
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.113.0](https://github.com/lobehub/lobe-chat/compare/v0.112.1...v0.113.0)
6
31
 
7
32
  <sup>Released on **2023-12-16**</sup>
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Schriftgröße für Chat-Inhalte",
254
+ "marks": {
255
+ "large": "Groß",
256
+ "normal": "Normal",
257
+ "small": "Klein"
258
+ },
254
259
  "title": "Schriftgröße"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Font size for chat content",
254
+ "marks": {
255
+ "large": "Large",
256
+ "normal": "Normal",
257
+ "small": "Small"
258
+ },
254
259
  "title": "Font Size"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Tamaño de fuente para el contenido del chat",
254
+ "marks": {
255
+ "large": "Grande",
256
+ "normal": "Normal",
257
+ "small": "Pequeño"
258
+ },
254
259
  "title": "Tamaño de fuente"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Taille de la police du contenu du chat",
254
+ "marks": {
255
+ "large": "Grand",
256
+ "normal": "Normal",
257
+ "small": "Petit"
258
+ },
254
259
  "title": "Taille de la police"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "チャットのフォントサイズ",
254
+ "marks": {
255
+ "large": "大きい",
256
+ "normal": "標準",
257
+ "small": "小さい"
258
+ },
254
259
  "title": "フォントサイズ"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "채팅 내용의 글꼴 크기",
254
+ "marks": {
255
+ "large": "대",
256
+ "normal": "표준",
257
+ "small": "소"
258
+ },
254
259
  "title": "글꼴 크기"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Tamanho da fonte do conteúdo do chat",
254
+ "marks": {
255
+ "large": "Grande",
256
+ "normal": "Normal",
257
+ "small": "Pequeno"
258
+ },
254
259
  "title": "Tamanho da Fonte"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Размер шрифта для чата",
254
+ "marks": {
255
+ "large": "крупный",
256
+ "normal": "стандартный",
257
+ "small": "маленький"
258
+ },
254
259
  "title": "Размер шрифта"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "Sohbet içeriği için yazı boyutu",
254
+ "marks": {
255
+ "large": "Büyük",
256
+ "normal": "Normal",
257
+ "small": "Küçük"
258
+ },
254
259
  "title": "Yazı Boyutu"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "聊天内容的字体大小",
254
+ "marks": {
255
+ "large": "大",
256
+ "normal": "标准",
257
+ "small": "小"
258
+ },
254
259
  "title": "字体大小"
255
260
  },
256
261
  "lang": {
@@ -251,6 +251,11 @@
251
251
  },
252
252
  "fontSize": {
253
253
  "desc": "聊天內容的字體大小",
254
+ "marks": {
255
+ "large": "大",
256
+ "normal": "標準",
257
+ "small": "小"
258
+ },
254
259
  "title": "字體大小"
255
260
  },
256
261
  "lang": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.113.0",
3
+ "version": "0.113.1",
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",
@@ -18,7 +18,7 @@ const Player = memo<PlayerProps>(({ onRetry, error, onDelete, audio, isLoading,
18
18
  const { t } = useTranslation('chat');
19
19
 
20
20
  return (
21
- <Flexbox align={'center'} horizontal style={{ minWidth: 160, width: '100%' }}>
21
+ <Flexbox align={'center'} horizontal style={{ minWidth: 200, width: '100%' }}>
22
22
  {error ? (
23
23
  <Alert
24
24
  action={
@@ -5,20 +5,38 @@ import { useTranslation } from 'react-i18next';
5
5
  import { Flexbox } from 'react-layout-kit';
6
6
 
7
7
  import SafeSpacing from '@/components/SafeSpacing';
8
+ import { settingsSelectors, useGlobalStore } from '@/store/global';
8
9
 
9
10
  import ChatList from './ChatList';
10
11
  import ChatScrollAnchor from './ScrollAnchor';
11
12
  import { useInitConversation } from './useInitConversation';
12
13
 
13
- const useStyles = createStyles(
14
- ({ css, responsive, stylish }) => css`
15
- overflow: hidden scroll;
16
- height: 100%;
17
- ${responsive.mobile} {
18
- ${stylish.noScrollbar}
19
- width: 100vw;
20
- }
21
- `,
14
+ const useStyles = createStyles(({ css, responsive, stylish, cx }, fontSize: number = 14) =>
15
+ cx(
16
+ css`
17
+ overflow: hidden scroll;
18
+ height: 100%;
19
+
20
+ ${responsive.mobile} {
21
+ ${stylish.noScrollbar}
22
+ width: 100vw;
23
+ }
24
+ `,
25
+ fontSize !== 14 &&
26
+ css`
27
+ article[data-code-type='markdown'] {
28
+ p,
29
+ code,
30
+ pre,
31
+ ul,
32
+ ol,
33
+ li,
34
+ blockquote {
35
+ font-size: ${fontSize}px;
36
+ }
37
+ }
38
+ `,
39
+ ),
22
40
  );
23
41
 
24
42
  interface ConversationProps {
@@ -29,7 +47,8 @@ interface ConversationProps {
29
47
  const Conversation = memo<ConversationProps>(({ mobile, chatInput }) => {
30
48
  const ref = useRef(null);
31
49
  const { t } = useTranslation('chat');
32
- const { styles } = useStyles();
50
+ const fontSize = useGlobalStore((s) => settingsSelectors.currentSettings(s).fontSize);
51
+ const { styles } = useStyles(fontSize);
33
52
 
34
53
  // init conversation
35
54
  useInitConversation();
@@ -131,7 +131,33 @@ const Common = memo<SettingsCommonProps>(({ showAccessCodeConfig }) => {
131
131
  name: 'language',
132
132
  },
133
133
  {
134
- children: <SliderWithInput max={18} min={12} />,
134
+ children: (
135
+ <SliderWithInput
136
+ marks={{
137
+ 12: {
138
+ label: t('settingTheme.fontSize.marks.small'),
139
+ style: {
140
+ marginTop: 4,
141
+ },
142
+ },
143
+ 14: {
144
+ label: t('settingTheme.fontSize.marks.normal'),
145
+ style: {
146
+ marginTop: 4,
147
+ },
148
+ },
149
+ 18: {
150
+ label: t('settingTheme.fontSize.marks.large'),
151
+ style: {
152
+ marginTop: 4,
153
+ },
154
+ },
155
+ }}
156
+ max={18}
157
+ min={12}
158
+ step={1}
159
+ />
160
+ ),
135
161
  desc: t('settingTheme.fontSize.desc'),
136
162
  label: t('settingTheme.fontSize.title'),
137
163
  name: 'fontSize',
@@ -35,7 +35,7 @@ interface AvatarWithUploadProps {
35
35
  }
36
36
 
37
37
  const AvatarWithUpload = memo<AvatarWithUploadProps>(
38
- ({ size = 40, compressSize = 128, style, id }) => {
38
+ ({ size = 40, compressSize = 256, style, id }) => {
39
39
  const [avatar, setSettings] = useGlobalStore((st) => [st.settings.avatar, st.setSettings]);
40
40
  const { styles } = useStyle();
41
41
 
@@ -16,15 +16,18 @@ const useStyles = createStyles(({ css, token }) => ({
16
16
  desc: css`
17
17
  margin: 0 !important;
18
18
  font-size: 12px;
19
+ line-height: 1;
19
20
  color: ${token.colorTextDescription};
20
21
  `,
21
22
  link: css`
23
+ overflow: hidden;
22
24
  color: ${token.colorText};
23
25
  `,
24
26
  title: css`
27
+ margin: 0 !important;
25
28
  font-size: 14px;
26
29
  font-weight: bold;
27
- line-height: 2;
30
+ line-height: 1;
28
31
  `,
29
32
  }));
30
33
 
@@ -47,15 +50,19 @@ const PluginItem = memo<InstallPluginMeta>(({ identifier, homepage, author, type
47
50
  style={{ overflow: 'hidden', position: 'relative' }}
48
51
  >
49
52
  <Avatar avatar={meta.avatar} style={{ flex: 'none', overflow: 'hidden' }} />
50
- <Flexbox flex={1} style={{ overflow: 'hidden', position: 'relative' }}>
53
+ <Flexbox flex={1} gap={4} style={{ overflow: 'hidden', position: 'relative' }}>
51
54
  <Flexbox align={'center'} gap={8} horizontal>
52
55
  <Tooltip title={identifier}>
53
56
  {homepage ? (
54
57
  <Link className={styles.link} href={homepage} target={'_blank'}>
55
- <div className={styles.title}>{meta.title}</div>
58
+ <Paragraph className={styles.title} ellipsis={{ rows: 1 }}>
59
+ {meta.title}
60
+ </Paragraph>
56
61
  </Link>
57
62
  ) : (
58
- <div className={styles.title}>{meta.title}</div>
63
+ <Paragraph className={styles.title} ellipsis={{ rows: 1 }}>
64
+ {meta.title}
65
+ </Paragraph>
59
66
  )}
60
67
  </Tooltip>
61
68
  <PluginTag author={author} type={type} />
@@ -251,6 +251,11 @@ export default {
251
251
  },
252
252
  fontSize: {
253
253
  desc: '聊天内容的字体大小',
254
+ marks: {
255
+ large: '大',
256
+ normal: '标准',
257
+ small: '小',
258
+ },
254
259
  title: '字体大小',
255
260
  },
256
261
  lang: {