@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.
- package/dist/apis/useApi.js +1 -1
- package/dist/components/ai-chat-dialogue/index copy.d.ts +16 -0
- package/dist/components/ai-chat-dialogue/index copy.js +1062 -0
- package/dist/components/ai-chat-dialogue/index.js +54 -49
- package/dist/components/ai-chat-dialogue/index.module copy.css +230 -0
- package/dist/components/ai-chat-dialogue/index.module.css +78 -136
- package/dist/components/chat-input/index.d.ts +4 -0
- package/dist/components/chat-input/index.js +176 -67
- package/dist/components/chat-input/index.module.css +60 -2
- package/dist/components/file-upload/index.js +120 -34
- package/dist/components/iconfont-com/index.js +1 -1
- package/dist/components/message-list/index.js +2 -1
- package/dist/components/templates/CommonChat.js +24 -5
- package/dist/components/templates/GimiChatComponent.js +4 -0
- package/dist/components/upload-list/CustomFile.d.ts +15 -0
- package/dist/components/upload-list/CustomFile.js +105 -0
- package/dist/components/upload-list/ImageFile.d.ts +18 -0
- package/dist/components/upload-list/ImageFile.js +68 -0
- package/dist/components/upload-list/customFile.module.css +122 -0
- package/dist/components/upload-list/imageFile.module.css +95 -0
- package/dist/components/upload-list/index.d.ts +4 -3
- package/dist/components/upload-list/index.js +95 -84
- package/dist/components/upload-list/index.module.css +68 -99
- package/dist/components/voice-bars/index.js +10 -9
- package/dist/components/voice-check-dialog/index.js +2 -1
- package/dist/components/voice-recording/index.d.ts +1 -1
- package/dist/components/voice-recording/index.js +2 -28
- package/dist/hooks/useChatMessage.d.ts +1 -1
- package/dist/hooks/useChatMessage.js +1 -1
- package/dist/hooks/useCommonChatAPI.js +13 -9
- package/dist/hooks/useFile.js +99 -7
- package/dist/i18n/locales/en-US.d.ts +9 -0
- package/dist/i18n/locales/en-US.js +10 -1
- package/dist/i18n/locales/zh-CN.d.ts +9 -0
- package/dist/i18n/locales/zh-CN.js +10 -1
- package/dist/types/chat.d.ts +2 -0
- package/dist/types/file.d.ts +2 -0
- package/dist/umd/index.min.js +1 -1
- 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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
|
5
|
-
import
|
|
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
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
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
|
-
|
|
2
|
-
.uploadBox {
|
|
1
|
+
.imgList {
|
|
3
2
|
display: flex;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
.imgList::-webkit-scrollbar-track {
|
|
17
|
+
background: transparent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.customListWrapper {
|
|
21
|
+
position: relative;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
.
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
.
|
|
71
|
-
.uploadLoading {
|
|
43
|
+
.customList {
|
|
72
44
|
display: flex;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
transition: background 0.2s;
|
|
101
83
|
}
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
height: 100%;
|
|
105
|
-
object-fit: cover;
|
|
84
|
+
.scrollBtn:hover {
|
|
85
|
+
background: #E8E9ED;
|
|
106
86
|
}
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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 =
|
|
98
|
-
var maxExtra =
|
|
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:
|
|
160
|
-
gap:
|
|
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:
|
|
167
|
+
width: 3,
|
|
167
168
|
height: h,
|
|
168
|
-
background: '#
|
|
169
|
+
background: '#2E394C',
|
|
169
170
|
borderRadius: 4,
|
|
170
171
|
transition: 'height 0.1s ease-out'
|
|
171
172
|
}
|