@fe-free/ai 6.0.2 → 6.0.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
@@ -1,5 +1,15 @@
1
1
  # @fe-free/ai
2
2
 
3
+ ## 6.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: antd6
8
+ - Updated dependencies
9
+ - @fe-free/core@6.0.3
10
+ - @fe-free/icons@6.0.3
11
+ - @fe-free/tool@6.0.3
12
+
3
13
  ## 6.0.2
4
14
 
5
15
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/ai",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -18,18 +18,18 @@
18
18
  "lodash-es": "^4.17.21",
19
19
  "uuid": "^13.0.0",
20
20
  "zustand": "^4.5.7",
21
- "@fe-free/core": "6.0.2"
21
+ "@fe-free/core": "6.0.3"
22
22
  },
23
23
  "peerDependencies": {
24
- "antd": "^5.27.1",
24
+ "antd": "^6.2.1",
25
25
  "dayjs": "~1.11.10",
26
26
  "i18next": "^25.7.2",
27
27
  "i18next-browser-languagedetector": "^8.2.0",
28
28
  "i18next-icu": "^2.4.1",
29
29
  "react": "^19.2.0",
30
30
  "react-i18next": "^16.4.0",
31
- "@fe-free/icons": "6.0.2",
32
- "@fe-free/tool": "6.0.2"
31
+ "@fe-free/icons": "6.0.3",
32
+ "@fe-free/tool": "6.0.3"
33
33
  },
34
34
  "scripts": {
35
35
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -1,5 +1,6 @@
1
1
  import Icons from '@fe-free/icons';
2
2
  import { Button } from 'antd';
3
+ import type { TextAreaRef } from 'antd/es/input/TextArea';
3
4
  import { useCallback, type RefObject } from 'react';
4
5
  import IconRecord from '../svgs/record.svg?react';
5
6
  import SendIcon from '../svgs/send.svg?react';
@@ -7,7 +8,7 @@ import type { MSenderProps } from './types';
7
8
 
8
9
  function Actions(
9
10
  props: MSenderProps & {
10
- refText: RefObject<HTMLTextAreaElement | null>;
11
+ refText: RefObject<TextAreaRef | null>;
11
12
  type: 'input' | 'record';
12
13
  setType: (type: 'input' | 'record') => void;
13
14
  },
@@ -1,4 +1,5 @@
1
1
  import { Input } from 'antd';
2
+ import type { TextAreaRef } from 'antd/es/input/TextArea';
2
3
  import classNames from 'classnames';
3
4
  import { useMemo, useRef, useState, type RefObject } from 'react';
4
5
  import { useTranslation } from 'react-i18next';
@@ -6,7 +7,7 @@ import { Actions } from './actions';
6
7
  import { RecordAction } from './record';
7
8
  import type { MSenderProps, MSenderRef } from './types';
8
9
 
9
- function Text(props: MSenderProps & { refText: RefObject<HTMLTextAreaElement | null> }) {
10
+ function Text(props: MSenderProps & { refText: RefObject<TextAreaRef | null> }) {
10
11
  const { value, onChange, placeholder, refText, autoFocus } = props;
11
12
 
12
13
  return (
@@ -39,7 +40,7 @@ function useProps(originProps: MSenderProps) {
39
40
  }
40
41
 
41
42
  function MSender(originProps: MSenderProps) {
42
- const refText = useRef<HTMLTextAreaElement>(null);
43
+ const refText = useRef<TextAreaRef | null>(null);
43
44
 
44
45
  const props = useProps(originProps);
45
46
  const { statement, defaultType } = props;
@@ -53,7 +54,7 @@ function MSender(originProps: MSenderProps) {
53
54
  <div
54
55
  ref={refContainer}
55
56
  className={classNames(
56
- 'fea-m-sender relative flex items-end rounded-xl border border-01 bg-white p-2.5',
57
+ 'fea-m-sender border-01 relative flex items-end rounded-xl border bg-white p-2.5',
57
58
  )}
58
59
  style={{
59
60
  boxShadow: '0px 2px 12px 0px #00000014',
@@ -65,7 +66,7 @@ function MSender(originProps: MSenderProps) {
65
66
  <Actions {...props} refText={refText} type={type} setType={setType} />
66
67
  {type === 'record' && <RecordAction {...props} refText={refText} setType={setType} />}
67
68
  </div>
68
- {statement && <div className="mt-1 text-center text-xs text-04">*{statement}</div>}
69
+ {statement && <div className="text-04 mt-1 text-center text-xs">*{statement}</div>}
69
70
  </div>
70
71
  );
71
72
  }
@@ -1,5 +1,6 @@
1
1
  import Icons from '@fe-free/icons';
2
2
  import { Button } from 'antd';
3
+ import type { TextAreaRef } from 'antd/es/input/TextArea';
3
4
  import classNames from 'classnames';
4
5
  import type { RefObject } from 'react';
5
6
  import { useCallback, useEffect, useRef, useState } from 'react';
@@ -7,9 +8,7 @@ import { RecordLoading } from '../helper';
7
8
  import IconKeyboard from '../svgs/keyboard.svg?react';
8
9
  import type { MSenderProps } from './types';
9
10
 
10
- function RecordAction(
11
- props: MSenderProps & { setType; refText: RefObject<HTMLTextAreaElement | null> },
12
- ) {
11
+ function RecordAction(props: MSenderProps & { setType; refText: RefObject<TextAreaRef | null> }) {
13
12
  const { allowSpeech, setType, refText, loading } = props;
14
13
 
15
14
  const containerRef = useRef<HTMLDivElement>(null);
@@ -1,6 +1,7 @@
1
1
  import Icons from '@fe-free/icons';
2
2
  import type { UploadFile } from 'antd';
3
3
  import { Button } from 'antd';
4
+ import type { TextAreaRef } from 'antd/es/input/TextArea';
4
5
  import type { RefObject } from 'react';
5
6
  import SendIcon from '../svgs/send.svg?react';
6
7
  import { FileAction } from './files';
@@ -9,7 +10,7 @@ import type { SenderProps } from './types';
9
10
 
10
11
  function Actions(
11
12
  props: SenderProps & {
12
- refText: RefObject<HTMLTextAreaElement | null>;
13
+ refText: RefObject<TextAreaRef | null>;
13
14
  refUpload: RefObject<HTMLDivElement | null>;
14
15
  isUploading: boolean;
15
16
  fileList: UploadFile[];
@@ -1,5 +1,6 @@
1
1
  import { useDrop } from 'ahooks';
2
2
  import { Input } from 'antd';
3
+ import type { TextAreaRef } from 'antd/es/input/TextArea';
3
4
  import type { UploadFile } from 'antd/lib';
4
5
  import classNames from 'classnames';
5
6
  import type { RefObject } from 'react';
@@ -11,7 +12,7 @@ import type { SenderProps, SenderRef } from './types';
11
12
 
12
13
  function Text(
13
14
  props: SenderProps & {
14
- refText: RefObject<HTMLTextAreaElement | null>;
15
+ refText: RefObject<TextAreaRef | null>;
15
16
  onSubmit?: () => void;
16
17
  },
17
18
  ) {
@@ -60,7 +61,7 @@ function Sender(originProps: SenderProps) {
60
61
  };
61
62
  }, [originProps, t]);
62
63
 
63
- const refText = useRef<HTMLTextAreaElement>(null);
64
+ const refText = useRef<TextAreaRef | null>(null);
64
65
 
65
66
  const { value, onChange, allowUpload, onSubmit, loading, allowSpeech } = props;
66
67
  const { filesMaxCount } = allowUpload || {};
@@ -157,7 +158,7 @@ function Sender(originProps: SenderProps) {
157
158
  <div
158
159
  ref={refContainer}
159
160
  className={classNames(
160
- 'fea-sender relative flex flex-col rounded-xl border border-01 bg-white p-2',
161
+ 'fea-sender border-01 relative flex flex-col rounded-xl border bg-white p-2',
161
162
  {
162
163
  'fea-sender-drag-hover': dragHover,
163
164
  },
@@ -197,7 +198,7 @@ function Sender(originProps: SenderProps) {
197
198
  />
198
199
  )}
199
200
  </div>
200
- {props.statement && <div className="mt-1 text-center text-xs text-03">{props.statement}</div>}
201
+ {props.statement && <div className="text-03 mt-1 text-center text-xs">{props.statement}</div>}
201
202
  </div>
202
203
  );
203
204
  }