@myun/gimi-chat 0.9.22 → 0.9.23

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.
Files changed (39) hide show
  1. package/dist/apis/useApi.js +1 -1
  2. package/dist/components/ai-chat-dialogue/index copy.d.ts +16 -0
  3. package/dist/components/ai-chat-dialogue/index copy.js +1062 -0
  4. package/dist/components/ai-chat-dialogue/index.js +54 -49
  5. package/dist/components/ai-chat-dialogue/index.module copy.css +230 -0
  6. package/dist/components/ai-chat-dialogue/index.module.css +78 -136
  7. package/dist/components/chat-input/index.d.ts +4 -0
  8. package/dist/components/chat-input/index.js +176 -67
  9. package/dist/components/chat-input/index.module.css +60 -2
  10. package/dist/components/file-upload/index.js +120 -34
  11. package/dist/components/iconfont-com/index.js +1 -1
  12. package/dist/components/message-list/index.js +2 -1
  13. package/dist/components/templates/CommonChat.js +24 -5
  14. package/dist/components/templates/GimiChatComponent.js +4 -0
  15. package/dist/components/upload-list/CustomFile.d.ts +15 -0
  16. package/dist/components/upload-list/CustomFile.js +105 -0
  17. package/dist/components/upload-list/ImageFile.d.ts +18 -0
  18. package/dist/components/upload-list/ImageFile.js +68 -0
  19. package/dist/components/upload-list/customFile.module.css +122 -0
  20. package/dist/components/upload-list/imageFile.module.css +95 -0
  21. package/dist/components/upload-list/index.d.ts +4 -3
  22. package/dist/components/upload-list/index.js +95 -84
  23. package/dist/components/upload-list/index.module.css +68 -99
  24. package/dist/components/voice-bars/index.js +10 -9
  25. package/dist/components/voice-check-dialog/index.js +2 -1
  26. package/dist/components/voice-recording/index.d.ts +1 -1
  27. package/dist/components/voice-recording/index.js +2 -28
  28. package/dist/hooks/useChatMessage.d.ts +1 -1
  29. package/dist/hooks/useChatMessage.js +1 -1
  30. package/dist/hooks/useCommonChatAPI.js +13 -9
  31. package/dist/hooks/useFile.js +99 -7
  32. package/dist/i18n/locales/en-US.d.ts +9 -0
  33. package/dist/i18n/locales/en-US.js +10 -1
  34. package/dist/i18n/locales/zh-CN.d.ts +9 -0
  35. package/dist/i18n/locales/zh-CN.js +10 -1
  36. package/dist/types/chat.d.ts +2 -0
  37. package/dist/types/file.d.ts +2 -0
  38. package/dist/umd/index.min.js +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1,122 @@
1
+ @charset "UTF-8";
2
+ .uploadBox {
3
+ display: flex;
4
+ align-items: center;
5
+ min-width: 200px; /* 最小宽度保证 */
6
+ max-width: 200px; /* 最大宽度限制 */
7
+ width: fit-content; /* 自动适应内容宽度 */
8
+ flex-shrink: 0;
9
+ border-radius: 12px;
10
+ background: var(---, #f2f3f7);
11
+ padding: 14px 16px 14px 12px;
12
+ margin-bottom: 12px;
13
+ position: relative;
14
+ }
15
+ .uploadBox:hover .delIcon {
16
+ display: flex;
17
+ }
18
+
19
+ .uploadIcon img {
20
+ width: 24px;
21
+ height: 22px;
22
+ margin-right: 8px;
23
+ }
24
+ .uploadIcon img img {
25
+ width: 100%;
26
+ height: 100%;
27
+ object-fit: cover;
28
+ }
29
+
30
+ .uploadName {
31
+ flex: 1; /* 让文件名占满剩余空间 */
32
+ color: #2e394c;
33
+ font-family: "PingFang SC";
34
+ font-size: 14px;
35
+ font-style: normal;
36
+ font-weight: 400;
37
+ line-height: normal;
38
+ min-width: 0; /* 关键:允许flex子元素缩小到内容尺寸以下 */
39
+ }
40
+ .uploadName .uploadfileName {
41
+ display: flex;
42
+ align-items: center;
43
+ max-width: 100%; /* 限制整个文件名区域宽度 */
44
+ }
45
+ .uploadName .uploadfileName .fileName {
46
+ /* 动态计算可用宽度,减去扩展名和间距 */
47
+ flex: 1;
48
+ min-width: 0; /* 允许文件名进一步缩小 */
49
+ white-space: nowrap;
50
+ overflow: hidden;
51
+ text-overflow: ellipsis;
52
+ margin-right: 4px; /* 与扩展名保持一点距离 */
53
+ }
54
+ .uploadName .uploadfileName .fileExtension {
55
+ white-space: nowrap; /* 确保扩展名不换行 */
56
+ color: #717F94; /* 可以给扩展名一个不同的颜色区分 */
57
+ }
58
+ .uploadName .sizeText .size {
59
+ margin-right: 4px;
60
+ font-size: 12px; /* 修复之前的语法错误,添加单位px */
61
+ color: #717F94;
62
+ }
63
+ .uploadName .sizeText .errorText {
64
+ color: #f33;
65
+ font-family: "PingFang SC";
66
+ font-size: 12px;
67
+ font-style: normal;
68
+ font-weight: 400;
69
+ line-height: normal;
70
+ }
71
+
72
+ .uploadStatus,
73
+ .uploadLoading {
74
+ display: flex;
75
+ align-items: center;
76
+ margin-left: 8px;
77
+ font-size: 14px;
78
+ flex-shrink: 0;
79
+ color: #717F94;
80
+ }
81
+ .uploadStatus img,
82
+ .uploadLoading img {
83
+ width: 18px;
84
+ height: 18px;
85
+ object-fit: cover;
86
+ margin-left: 5px;
87
+ }
88
+
89
+ .delIcon {
90
+ display: none;
91
+ position: absolute;
92
+ right: -7px;
93
+ top: -5px;
94
+ width: 14px;
95
+ height: 14px;
96
+ background-color: rgba(0, 0, 0, 0.6);
97
+ color: white;
98
+ border-radius: 50%;
99
+ align-items: center;
100
+ justify-content: center;
101
+ cursor: pointer;
102
+ background-color: white;
103
+ }
104
+ .delIcon img {
105
+ width: 100%;
106
+ height: 100%;
107
+ object-fit: cover;
108
+ }
109
+
110
+ .uploadError {
111
+ cursor: pointer;
112
+ color: #4086ff;
113
+ text-align: right;
114
+ font-family: "PingFang SC";
115
+ font-size: 14px;
116
+ font-style: normal;
117
+ font-weight: 400;
118
+ line-height: normal;
119
+ margin-left: 20px;
120
+ display: flex;
121
+ align-items: center;
122
+ }
@@ -0,0 +1,95 @@
1
+ .uploadBox {
2
+ display: flex;
3
+ align-items: center;
4
+ width: 54px;
5
+ height: 54px;
6
+ border-radius: 8px;
7
+ border: 0.5px solid #D9DCE5;
8
+ position: relative;
9
+ overflow: visible;
10
+ margin-bottom: 12px;
11
+ }
12
+ .uploadBox.messageImg {
13
+ width: 100px;
14
+ height: 100px;
15
+ border-radius: 16px;
16
+ border-width: 1px;
17
+ border-color: rgba(0, 0, 0, 0.07);
18
+ }
19
+ .uploadBox.messageImg .uploadImg {
20
+ border-radius: 16px;
21
+ }
22
+ .uploadBox.singleImg {
23
+ width: fit-content;
24
+ height: fit-content;
25
+ border-radius: 8px;
26
+ max-width: 320px;
27
+ max-height: 200px;
28
+ border-color: rgba(0, 0, 0, 0.07);
29
+ }
30
+ .uploadBox:hover .delIcon {
31
+ display: flex;
32
+ }
33
+ .uploadBox .uploadImg {
34
+ width: 100%;
35
+ height: 100%;
36
+ object-fit: cover;
37
+ border-radius: 8px;
38
+ }
39
+
40
+ .uploadStatus,
41
+ .uploadLoading {
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ bottom: 0;
46
+ right: 0;
47
+ border-radius: 8px;
48
+ border: 0.5px solid #D9DCE5;
49
+ background: rgba(0, 0, 0, 0.4);
50
+ }
51
+ .uploadStatus img,
52
+ .uploadLoading img {
53
+ position: absolute;
54
+ top: 50%;
55
+ left: 50%;
56
+ transform: translate(-50%, -50%);
57
+ width: 18px;
58
+ height: 18px;
59
+ object-fit: cover;
60
+ }
61
+
62
+ .delIcon {
63
+ display: none;
64
+ position: absolute;
65
+ right: -7px;
66
+ top: -5px;
67
+ width: 14px;
68
+ height: 14px;
69
+ background-color: rgba(0, 0, 0, 0.6);
70
+ color: white;
71
+ border-radius: 50%;
72
+ align-items: center;
73
+ justify-content: center;
74
+ cursor: pointer;
75
+ background-color: white;
76
+ }
77
+ .delIcon img {
78
+ width: 100%;
79
+ height: 100%;
80
+ object-fit: cover;
81
+ }
82
+
83
+ .uploadError {
84
+ cursor: pointer;
85
+ color: #4086ff;
86
+ text-align: right;
87
+ font-family: "PingFang SC";
88
+ font-size: 14px;
89
+ font-style: normal;
90
+ font-weight: 400;
91
+ line-height: normal;
92
+ margin-left: 20px;
93
+ display: flex;
94
+ align-items: center;
95
+ }
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
2
  import { FileStatus } from '../../interfaces/fileInterface';
3
3
  interface UploadFileProps {
4
- file: {
4
+ fileList: {
5
5
  fileType?: string;
6
6
  fileName?: string;
7
7
  status: FileStatus;
8
8
  [key: string]: any;
9
- };
10
- handleDelFile?: () => void;
9
+ }[];
10
+ handleDelFile?: (uid: string) => void;
11
11
  handleReTry?: (file: any) => void;
12
12
  showDel?: boolean;
13
+ isMessage?: boolean;
13
14
  }
14
15
  declare const UploadFile: React.FC<UploadFileProps>;
15
16
  export default UploadFile;
@@ -1,93 +1,104 @@
1
- import React from 'react';
2
- import { useTranslation } from 'react-i18next';
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useRef, useState, useEffect } from 'react';
12
+ import ImageFile from "./ImageFile";
13
+ import CustomFile from "./CustomFile";
3
14
  import styles from "./index.module.css";
4
- import reTry from "../../assets/image/retry.png";
5
- import { FileStatus } from "../../interfaces/fileInterface";
6
- import { formatSizeToKB } from "../../utils/tools";
15
+ import IconFontCom from "../iconfont-com";
16
+ import classNames from 'classnames';
7
17
  var UploadFile = function UploadFile(_ref) {
8
- var file = _ref.file,
18
+ var _ref$fileList = _ref.fileList,
19
+ fileList = _ref$fileList === void 0 ? [] : _ref$fileList,
9
20
  handleDelFile = _ref.handleDelFile,
10
21
  handleReTry = _ref.handleReTry,
11
22
  _ref$showDel = _ref.showDel,
12
- showDel = _ref$showDel === void 0 ? true : _ref$showDel;
13
- var _useTranslation = useTranslation(),
14
- t = _useTranslation.t;
15
- // 使用useMemo缓存icon,避免每次渲染重新计算
16
- var _React$useMemo = React.useMemo(function () {
17
- var _file$fileName, _file$name;
18
- if (!file) return {};
19
- var fileType = file.fileName ? ((_file$fileName = file.fileName) === null || _file$fileName === void 0 ? void 0 : _file$fileName.split('.').pop()) || '' : ((_file$name = file.name) === null || _file$name === void 0 ? void 0 : _file$name.split('.').pop()) || '';
20
- var fileName = file.fileName ? file.fileName : file.name;
21
- var fileSize = formatSizeToKB(file.fileSize || file.size);
22
- var iconMap = {
23
- txt: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/17/b46c7_20250917144926.png',
24
- xlsx: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/17/0094f_20250917144837.png'
25
- };
26
- return {
27
- fileIcon: iconMap[fileType.toLowerCase()] || '',
28
- fileName: fileName,
29
- fileSize: fileSize
30
- };
31
- }, [file]),
32
- fileIcon = _React$useMemo.fileIcon,
33
- fileName = _React$useMemo.fileName,
34
- fileSize = _React$useMemo.fileSize; // 更精确的依赖
35
-
36
- // 缓存事件处理函数
37
- var handleRetryClick = React.useCallback(function () {
38
- if (handleReTry && file) {
39
- handleReTry(file);
40
- }
41
- }, [handleReTry, file]);
42
- var handleDeleteClick = React.useCallback(function () {
43
- if (handleDelFile) {
44
- handleDelFile();
45
- }
46
- }, [handleDelFile]);
47
- if (!file) return null; // 空状态处理
48
-
49
- var isError = file.status === FileStatus.UPLOAD_FAILED || file.status === FileStatus.ANALYSE_FAILED || file.status === FileStatus.NETWORK_ERROR;
50
- var isLoading = [FileStatus.PADDING, FileStatus.RETRING, FileStatus.UPLOADING].includes(file.status);
51
- return /*#__PURE__*/React.createElement("div", {
52
- className: styles.uploadBox
53
- }, /*#__PURE__*/React.createElement("div", {
54
- className: styles.uploadIcon
55
- }, /*#__PURE__*/React.createElement("img", {
56
- src: fileIcon,
57
- alt: "file-icon"
58
- })), /*#__PURE__*/React.createElement("div", {
59
- className: styles.uploadName
23
+ showDel = _ref$showDel === void 0 ? true : _ref$showDel,
24
+ _ref$isMessage = _ref.isMessage,
25
+ isMessage = _ref$isMessage === void 0 ? false : _ref$isMessage;
26
+ var allImages = (fileList === null || fileList === void 0 ? void 0 : fileList.length) > 0 && fileList.every(function (f) {
27
+ return f.isImage;
28
+ });
29
+ var scrollRef = useRef(null);
30
+ var _useState = useState(false),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ showLeft = _useState2[0],
33
+ setShowLeft = _useState2[1];
34
+ var _useState3 = useState(false),
35
+ _useState4 = _slicedToArray(_useState3, 2),
36
+ showRight = _useState4[0],
37
+ setShowRight = _useState4[1];
38
+ var checkScroll = function checkScroll() {
39
+ var el = scrollRef.current;
40
+ if (!el) return;
41
+ setShowLeft(el.scrollLeft > 0);
42
+ setShowRight(Math.ceil(el.scrollLeft + el.clientWidth) < el.scrollWidth);
43
+ };
44
+ useEffect(function () {
45
+ if (isMessage) return;
46
+ checkScroll();
47
+ }, [fileList]);
48
+ var scroll = function scroll(dir) {
49
+ var el = scrollRef.current;
50
+ if (!el) return;
51
+ el.scrollBy({
52
+ left: dir === 'left' ? -430 : 430,
53
+ behavior: 'smooth'
54
+ });
55
+ };
56
+ return /*#__PURE__*/React.createElement(React.Fragment, null, allImages ? /*#__PURE__*/React.createElement("div", {
57
+ className: classNames(styles.imgList, _defineProperty({}, styles.imgListMessage, isMessage))
58
+ }, fileList.map(function (file) {
59
+ return /*#__PURE__*/React.createElement(ImageFile, {
60
+ key: file.uid,
61
+ file: file,
62
+ handleDelFile: handleDelFile ? function () {
63
+ return handleDelFile(file.uid);
64
+ } : undefined,
65
+ handleReTry: handleReTry,
66
+ showDel: showDel,
67
+ isMessage: isMessage,
68
+ isSingle: (fileList === null || fileList === void 0 ? void 0 : fileList.length) === 1
69
+ });
70
+ })) : /*#__PURE__*/React.createElement("div", {
71
+ className: classNames(styles.customListWrapper)
60
72
  }, /*#__PURE__*/React.createElement("div", {
61
- className: styles.uploadfileName
62
- }, /*#__PURE__*/React.createElement("div", {
63
- className: styles.fileName
64
- }, fileName)), (fileSize || isError) && /*#__PURE__*/React.createElement("div", {
65
- className: styles.sizeText
66
- }, fileSize && !isError && /*#__PURE__*/React.createElement("span", {
67
- className: styles.size
68
- }, fileSize), isError && /*#__PURE__*/React.createElement("span", {
69
- className: styles.errorText
70
- }, file.status === FileStatus.UPLOAD_FAILED ? t('upload.status.uploadFailed') : file.status === FileStatus.NETWORK_ERROR ? t('upload.status.networkError') : t('upload.status.parseFailed')))), isLoading && /*#__PURE__*/React.createElement("div", {
71
- className: styles.uploadLoading
72
- }, /*#__PURE__*/React.createElement("span", null, file.status === FileStatus.PADDING ? t('upload.status.parsing') : file.status === FileStatus.UPLOADING ? t('upload.status.uploading') : t('upload.status.retrying')), /*#__PURE__*/React.createElement("img", {
73
- src: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202509/07/0a0fa_20250907093927.gif",
74
- alt: "loading"
75
- })), isError && /*#__PURE__*/React.createElement("div", {
76
- className: styles.uploadError,
77
- onClick: handleRetryClick
78
- }, t('common.retry'), /*#__PURE__*/React.createElement("img", {
79
- src: reTry,
80
- alt: "",
81
- style: {
82
- width: 16,
83
- height: 16
73
+ ref: scrollRef,
74
+ className: classNames(styles.customList, _defineProperty({}, styles.customListMessage, isMessage), _defineProperty({}, styles.customListLeft, showLeft), _defineProperty({}, styles.customListRight, showRight)),
75
+ onScroll: checkScroll
76
+ }, fileList.map(function (file) {
77
+ return /*#__PURE__*/React.createElement(CustomFile, {
78
+ key: file.uid,
79
+ file: file,
80
+ handleDelFile: handleDelFile ? function () {
81
+ return handleDelFile(file.uid);
82
+ } : undefined,
83
+ handleReTry: handleReTry,
84
+ showDel: showDel
85
+ });
86
+ })), showLeft && /*#__PURE__*/React.createElement("div", {
87
+ className: "".concat(styles.arrowBtn, " ").concat(styles.arrowLeft),
88
+ onClick: function onClick() {
89
+ return scroll('left');
90
+ }
91
+ }, /*#__PURE__*/React.createElement(IconFontCom, {
92
+ type: "icon-a-jiantouxi2x-copy",
93
+ size: 16
94
+ })), showRight && /*#__PURE__*/React.createElement("div", {
95
+ className: "".concat(styles.arrowBtn, " ").concat(styles.arrowRight),
96
+ onClick: function onClick() {
97
+ return scroll('right');
84
98
  }
85
- })), showDel && /*#__PURE__*/React.createElement("div", {
86
- className: styles.delIcon,
87
- onClick: handleDeleteClick
88
- }, /*#__PURE__*/React.createElement("img", {
89
- src: "https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/12/6fa3e_20250912145501.png",
90
- alt: "delete"
91
- })));
99
+ }, /*#__PURE__*/React.createElement(IconFontCom, {
100
+ type: "icon-a-jiantouxi2x",
101
+ size: 16
102
+ }))));
92
103
  };
93
104
  export default UploadFile;
@@ -1,120 +1,89 @@
1
- @charset "UTF-8";
2
- .uploadBox {
1
+ .imgList {
3
2
  display: flex;
4
- align-items: center;
5
- min-width: 228px; /* 最小宽度保证 */
6
- max-width: 380px; /* 最大宽度限制 */
7
- width: fit-content; /* 自动适应内容宽度 */
8
- flex-shrink: 0;
9
- border-radius: 12px;
10
- background: var(---, #f2f3f7);
11
- padding: 14px 16px 14px 12px;
12
- margin-bottom: 12px;
13
- position: relative;
14
- margin-top: 5px;
3
+ flex-wrap: nowrap;
4
+ gap: 10px;
5
+ padding-top: 10px;
6
+ overflow-x: auto;
7
+ overflow-y: hidden;
15
8
  }
16
-
17
- .uploadIcon img {
18
- width: 24px;
19
- height: 22px;
20
- margin-right: 8px;
9
+ .imgList::-webkit-scrollbar {
10
+ height: 6px;
11
+ }
12
+ .imgList::-webkit-scrollbar-thumb {
13
+ background: rgba(0, 0, 0, 0.2);
14
+ border-radius: 3px;
21
15
  }
22
- .uploadIcon img img {
23
- width: 100%;
24
- height: 100%;
25
- object-fit: cover;
16
+ .imgList::-webkit-scrollbar-track {
17
+ background: transparent;
18
+ }
19
+
20
+ .customListWrapper {
21
+ position: relative;
26
22
  }
27
23
 
28
- .uploadName {
29
- flex: 1; /* 让文件名占满剩余空间 */
30
- color: #2e394c;
31
- font-family: "PingFang SC";
32
- font-size: 14px;
33
- font-style: normal;
34
- font-weight: 400;
35
- line-height: normal;
36
- min-width: 0; /* 关键:允许flex子元素缩小到内容尺寸以下 */
37
- }
38
- .uploadName .uploadfileName {
24
+ .arrowBtn {
39
25
  display: flex;
40
26
  align-items: center;
41
- max-width: 100%; /* 限制整个文件名区域宽度 */
42
- }
43
- .uploadName .uploadfileName .fileName {
44
- /* 动态计算可用宽度,减去扩展名和间距 */
45
- flex: 1;
46
- min-width: 0; /* 允许文件名进一步缩小 */
47
- white-space: nowrap;
48
- overflow: hidden;
49
- text-overflow: ellipsis;
50
- margin-right: 4px; /* 与扩展名保持一点距离 */
51
- }
52
- .uploadName .uploadfileName .fileExtension {
53
- white-space: nowrap; /* 确保扩展名不换行 */
54
- color: #717F94; /* 可以给扩展名一个不同的颜色区分 */
55
- }
56
- .uploadName .sizeText .size {
57
- margin-right: 4px;
58
- font-size: 12px; /* 修复之前的语法错误,添加单位px */
59
- color: #717F94;
60
- }
61
- .uploadName .sizeText .errorText {
62
- color: #f33;
63
- font-family: "PingFang SC";
64
- font-size: 12px;
65
- font-style: normal;
66
- font-weight: 400;
67
- line-height: normal;
27
+ justify-content: center;
28
+ cursor: pointer;
29
+ position: absolute;
30
+ top: 50%;
31
+ transform: translateY(-50%);
32
+ z-index: 1;
33
+ }
34
+
35
+ .arrowLeft {
36
+ left: 0;
37
+ }
38
+
39
+ .arrowRight {
40
+ right: 0;
68
41
  }
69
42
 
70
- .uploadStatus,
71
- .uploadLoading {
43
+ .customList {
72
44
  display: flex;
73
- align-items: center;
74
- margin-left: 8px;
75
- font-size: 14px;
76
- flex-shrink: 0;
77
- color: #717F94;
45
+ flex-wrap: nowrap;
46
+ gap: 8px;
47
+ overflow-x: auto;
48
+ overflow-y: hidden;
49
+ scrollbar-width: none;
50
+ padding: 6px 10px 0 0;
51
+ }
52
+ .customList.customListMessage {
53
+ display: block;
54
+ }
55
+ .customList.customListLeft {
56
+ mask-image: linear-gradient(90deg, transparent 20px, #000 80px, #000);
78
57
  }
79
- .uploadStatus img,
80
- .uploadLoading img {
81
- width: 18px;
82
- height: 18px;
83
- object-fit: cover;
84
- margin-left: 5px;
58
+ .customList.customListRight {
59
+ mask-image: linear-gradient(270deg, transparent 20px, #000 80px, #000);
60
+ }
61
+ .customList::-webkit-scrollbar {
62
+ display: none;
85
63
  }
86
64
 
87
- .delIcon {
88
- position: absolute;
89
- right: -7px;
90
- top: -5px;
91
- width: 14px;
92
- height: 14px;
93
- background-color: rgba(0, 0, 0, 0.6);
94
- color: white;
65
+ .carouselWrapper {
66
+ padding-top: 10px;
67
+ }
68
+ .carouselWrapper :global .semi-carousel-arrow {
69
+ display: none;
70
+ }
71
+
72
+ .scrollBtn {
73
+ width: 24px;
74
+ height: 24px;
95
75
  border-radius: 50%;
76
+ background: #F2F3F7;
96
77
  display: flex;
97
78
  align-items: center;
98
79
  justify-content: center;
99
80
  cursor: pointer;
100
- background-color: white;
81
+ flex-shrink: 0;
82
+ transition: background 0.2s;
101
83
  }
102
- .delIcon img {
103
- width: 100%;
104
- height: 100%;
105
- object-fit: cover;
84
+ .scrollBtn:hover {
85
+ background: #E8E9ED;
106
86
  }
107
-
108
- .uploadError {
109
- cursor: pointer;
110
- color: #4086ff;
111
- text-align: right;
112
- font-family: "PingFang SC";
113
- font-size: 14px;
114
- font-style: normal;
115
- font-weight: 400;
116
- line-height: normal;
117
- margin-left: 20px;
118
- display: flex;
119
- align-items: center;
87
+ .scrollBtn:active {
88
+ background: #DCDEE5;
120
89
  }
@@ -13,9 +13,10 @@ export default function VoiceBars(_ref) {
13
13
  var _ref$parentWidth = _ref.parentWidth,
14
14
  parentWidth = _ref$parentWidth === void 0 ? undefined : _ref$parentWidth;
15
15
  var containerWidth = parentWidth !== null && parentWidth !== void 0 ? parentWidth : 0;
16
- var total = containerWidth > 0 ? Math.floor(containerWidth / 12) : 20;
16
+ // const total = containerWidth > 0 ? Math.floor(containerWidth / 12) : 20;
17
+ var total = 4;
17
18
  var _React$useState = React.useState(function () {
18
- return Array(total).fill(8);
19
+ return Array(total).fill(4);
19
20
  }),
20
21
  _React$useState2 = _slicedToArray(_React$useState, 2),
21
22
  volumes = _React$useState2[0],
@@ -24,7 +25,7 @@ export default function VoiceBars(_ref) {
24
25
  React.useEffect(function () {
25
26
  totalRef.current = total;
26
27
  setVolumes(function (prev) {
27
- return prev.length === total ? prev : Array(total).fill(8);
28
+ return prev.length === total ? prev : Array(total).fill(4);
28
29
  });
29
30
  }, [total]);
30
31
  React.useEffect(function () {
@@ -94,8 +95,8 @@ export default function VoiceBars(_ref) {
94
95
  var avg = sum / dataArray.length;
95
96
  var level = Math.min(1, Math.max(0, (avg - 10) / 70));
96
97
  var count = totalRef.current;
97
- var baseHeight = 8;
98
- var maxExtra = 28;
98
+ var baseHeight = 6;
99
+ var maxExtra = 16;
99
100
  var newBars = Array(count).fill(0).map(function (_, i) {
100
101
  var phase = t / 180 + i * 0.9;
101
102
  var shape = 0.25 + 0.75 * Math.abs(Math.sin(phase));
@@ -156,16 +157,16 @@ export default function VoiceBars(_ref) {
156
157
  display: 'flex',
157
158
  alignItems: 'center',
158
159
  justifyContent: 'center',
159
- height: 40,
160
- gap: 6
160
+ height: 32,
161
+ gap: 2
161
162
  }
162
163
  }, volumes.map(function (h, i) {
163
164
  return /*#__PURE__*/React.createElement("div", {
164
165
  key: i,
165
166
  style: {
166
- width: 6,
167
+ width: 3,
167
168
  height: h,
168
- background: '#4f8cff',
169
+ background: '#2E394C',
169
170
  borderRadius: 4,
170
171
  transition: 'height 0.1s ease-out'
171
172
  }