@lobehub/chat 0.116.2 → 0.116.3

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.116.3](https://github.com/lobehub/lobe-chat/compare/v0.116.2...v0.116.3)
6
+
7
+ <sup>Released on **2023-12-26**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix typo.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix typo ([9d329a9](https://github.com/lobehub/lobe-chat/commit/9d329a9))
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.116.2](https://github.com/lobehub/lobe-chat/compare/v0.116.1...v0.116.2)
6
31
 
7
32
  <sup>Released on **2023-12-26**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.116.2",
3
+ "version": "0.116.3",
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",
@@ -1,6 +1,5 @@
1
1
  import { SiOpenai } from '@icons-pack/react-simple-icons';
2
2
  import { Avatar, ChatHeaderTitle, Logo, Markdown, Tag } from '@lobehub/ui';
3
- import { SegmentedProps } from 'antd';
4
3
  import { memo } from 'react';
5
4
  import { useTranslation } from 'react-i18next';
6
5
  import { Flexbox } from 'react-layout-kit';
@@ -14,32 +13,6 @@ import PluginTag from '../../ChatHeader/PluginTag';
14
13
  import { useStyles } from './style';
15
14
  import { FieldType } from './type';
16
15
 
17
- export enum ImageType {
18
- JPG = 'jpg',
19
- PNG = 'png',
20
- SVG = 'svg',
21
- WEBP = 'webp',
22
- }
23
-
24
- export const imageTypeOptions: SegmentedProps['options'] = [
25
- {
26
- label: 'JPG',
27
- value: ImageType.JPG,
28
- },
29
- {
30
- label: 'PNG',
31
- value: ImageType.PNG,
32
- },
33
- {
34
- label: 'SVG',
35
- value: ImageType.SVG,
36
- },
37
- {
38
- label: 'WEBP',
39
- value: ImageType.WEBP,
40
- },
41
- ];
42
-
43
16
  const Preview = memo<FieldType & { title?: string }>(
44
17
  ({ title, withSystemRole, withBackground, withFooter }) => {
45
18
  const [isInbox, description, avatar, backgroundColor, model, plugins, systemRole] =
@@ -9,14 +9,33 @@ import { FORM_STYLE } from '@/const/layoutTokens';
9
9
  import { useChatStore } from '@/store/chat';
10
10
  import { useGlobalStore } from '@/store/global';
11
11
 
12
- import Preview, { ImageType, imageTypeOptions } from './Preview';
13
- import { FieldType } from './type';
12
+ import Preview from './Preview';
13
+ import { FieldType, ImageType } from './type';
14
14
 
15
15
  enum Tab {
16
16
  Screenshot = 'screenshot',
17
17
  ShareGPT = 'sharegpt',
18
18
  }
19
19
 
20
+ export const imageTypeOptions: SegmentedProps['options'] = [
21
+ {
22
+ label: 'JPG',
23
+ value: ImageType.JPG,
24
+ },
25
+ {
26
+ label: 'PNG',
27
+ value: ImageType.PNG,
28
+ },
29
+ {
30
+ label: 'SVG',
31
+ value: ImageType.SVG,
32
+ },
33
+ {
34
+ label: 'WEBP',
35
+ value: ImageType.WEBP,
36
+ },
37
+ ];
38
+
20
39
  const DEFAULT_FIELD_VALUE: FieldType = {
21
40
  imageType: ImageType.JPG,
22
41
  withBackground: true,
@@ -31,7 +50,7 @@ const ShareModal = memo<ModalProps>(({ onCancel, open }) => {
31
50
  const { t } = useTranslation('chat');
32
51
  const avatar = useGlobalStore((s) => s.settings.avatar);
33
52
  const [shareLoading, shareToShareGPT] = useChatStore((s) => [s.shareLoading, s.shareToShareGPT]);
34
- const { loading, onDwnload, title } = useScreenshot(fieldValue.imageType);
53
+ const { loading, onDownload, title } = useScreenshot(fieldValue.imageType);
35
54
 
36
55
  const options: SegmentedProps['options'] = useMemo(
37
56
  () => [
@@ -95,7 +114,7 @@ const ShareModal = memo<ModalProps>(({ onCancel, open }) => {
95
114
  footer={
96
115
  <>
97
116
  {tab === Tab.Screenshot && (
98
- <Button block loading={loading} onClick={onDwnload} size={'large'} type={'primary'}>
117
+ <Button block loading={loading} onClick={onDownload} size={'large'} type={'primary'}>
99
118
  {t('shareModal.download')}
100
119
  </Button>
101
120
  )}
@@ -54,7 +54,7 @@ export const useScreenshot = (imageType: ImageType) => {
54
54
 
55
55
  return {
56
56
  loading,
57
- onDwnload: handleDownload,
57
+ onDownload: handleDownload,
58
58
  title,
59
59
  };
60
60
  };