@ant-design/agentic-ui 2.0.18 → 2.0.21
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/Bubble/FileView.js +4 -3
- package/dist/Bubble/type.d.ts +2 -2
- package/dist/ChatBootPage/ButtonTabStyle.js +2 -2
- package/dist/ChatBootPage/CaseReply.d.ts +10 -2
- package/dist/ChatBootPage/CaseReply.js +20 -2
- package/dist/ChatBootPage/CaseReplyStyle.js +51 -9
- package/dist/Components/ActionIconBox/index.js +102 -46
- package/dist/Components/Button/ToggleButton/index.js +3 -3
- package/dist/Components/Button/ToggleButton/style.js +1 -1
- package/dist/Components/GradientText/index.d.ts +8 -0
- package/dist/Components/GradientText/index.js +32 -0
- package/dist/Components/GradientText/style.d.ts +5 -0
- package/dist/Components/GradientText/style.js +76 -0
- package/dist/Components/TextAnimate/index.d.ts +56 -0
- package/dist/Components/TextAnimate/index.js +388 -0
- package/dist/Components/TextAnimate/style.d.ts +5 -0
- package/dist/Components/TextAnimate/style.js +53 -0
- package/dist/Components/TypingAnimation/index.d.ts +19 -0
- package/dist/Components/TypingAnimation/index.js +182 -0
- package/dist/Components/TypingAnimation/style.d.ts +5 -0
- package/dist/Components/TypingAnimation/style.js +59 -0
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +1 -1
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.js +42 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +6 -32
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/index.js +5 -3
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +1 -1
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.d.ts +2 -2
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +166 -152
- package/dist/MarkdownInputField/FileMapView/index.d.ts +5 -5
- package/dist/MarkdownInputField/FileMapView/index.js +48 -35
- package/dist/MarkdownInputField/FileMapView/style.js +17 -9
- package/dist/MarkdownInputField/MarkdownInputField.js +159 -209
- package/dist/MarkdownInputField/QuickActions/index.js +6 -0
- package/dist/MarkdownInputField/VoiceInput/index.js +2 -1
- package/dist/MarkdownInputField/style.js +4 -55
- package/dist/WelcomeMessage/index.d.ts +12 -2
- package/dist/WelcomeMessage/index.js +40 -4
- package/dist/WelcomeMessage/style.js +1 -0
- package/dist/Workspace/File/FileComponent.js +23 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/package.json +4 -4
|
@@ -1,19 +1,40 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
1
22
|
// src/MarkdownInputField/FileMapView/index.tsx
|
|
2
23
|
import { FileSearch } from "@sofa-design/icons";
|
|
3
24
|
import { ConfigProvider, Image } from "antd";
|
|
4
25
|
import classNames from "classnames";
|
|
5
26
|
import { motion } from "framer-motion";
|
|
6
|
-
import React, { useContext, useMemo } from "react";
|
|
27
|
+
import React, { useContext, useMemo, useState } from "react";
|
|
7
28
|
import { isImageFile } from "../AttachmentButton/utils";
|
|
8
29
|
import { FileMapViewItem } from "./FileMapViewItem";
|
|
9
30
|
import { useStyle } from "./style";
|
|
10
31
|
var FileMapView = (props) => {
|
|
11
|
-
var _a
|
|
12
|
-
const { placement = "left"
|
|
32
|
+
var _a;
|
|
33
|
+
const { placement = "left" } = props;
|
|
13
34
|
const context = useContext(ConfigProvider.ConfigContext);
|
|
14
35
|
const prefix = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-file-view-list");
|
|
15
36
|
const { wrapSSR, hashId } = useStyle(prefix);
|
|
16
|
-
const
|
|
37
|
+
const [showAllFiles, setShowAllFiles] = useState(false);
|
|
17
38
|
const fileList = useMemo(() => {
|
|
18
39
|
var _a2;
|
|
19
40
|
if (!props.fileMap) {
|
|
@@ -21,25 +42,28 @@ var FileMapView = (props) => {
|
|
|
21
42
|
}
|
|
22
43
|
return Array.from(((_a2 = props.fileMap) == null ? void 0 : _a2.values()) || []);
|
|
23
44
|
}, [props.fileMap]);
|
|
24
|
-
const
|
|
45
|
+
const imgList = useMemo(() => {
|
|
25
46
|
return fileList.filter((file) => isImageFile(file));
|
|
26
47
|
}, [fileList]);
|
|
27
48
|
const allNoImageFiles = useMemo(() => {
|
|
28
49
|
return fileList.filter((file) => !isImageFile(file));
|
|
29
50
|
}, [fileList]);
|
|
30
|
-
const imgList = useMemo(() => {
|
|
31
|
-
if (!showMoreButton) {
|
|
32
|
-
return allImgFiles;
|
|
33
|
-
}
|
|
34
|
-
return allImgFiles.slice(0, Math.max(0, maxDisplayCount));
|
|
35
|
-
}, [allImgFiles, maxDisplayCount, showMoreButton]);
|
|
36
51
|
const noImageFileList = useMemo(() => {
|
|
37
|
-
if (
|
|
52
|
+
if (showAllFiles || props.maxDisplayCount === void 0) {
|
|
38
53
|
return allNoImageFiles;
|
|
39
54
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
return allNoImageFiles.slice(0, Math.max(0, props.maxDisplayCount));
|
|
56
|
+
}, [allNoImageFiles, props.maxDisplayCount, showAllFiles]);
|
|
57
|
+
const handleViewAllClick = () => __async(void 0, null, function* () {
|
|
58
|
+
if (props.onViewAll) {
|
|
59
|
+
const shouldExpand = yield props.onViewAll(fileList);
|
|
60
|
+
if (shouldExpand) {
|
|
61
|
+
setShowAllFiles(true);
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
setShowAllFiles(true);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
43
67
|
return wrapSSR(
|
|
44
68
|
/* @__PURE__ */ React.createElement(
|
|
45
69
|
"div",
|
|
@@ -126,9 +150,7 @@ var FileMapView = (props) => {
|
|
|
126
150
|
hashId,
|
|
127
151
|
props.className,
|
|
128
152
|
`${prefix}-${placement}`,
|
|
129
|
-
{
|
|
130
|
-
[`${prefix}-vertical`]: placement === "left"
|
|
131
|
-
}
|
|
153
|
+
`${prefix}-vertical`
|
|
132
154
|
),
|
|
133
155
|
style: props.style
|
|
134
156
|
},
|
|
@@ -138,20 +160,14 @@ var FileMapView = (props) => {
|
|
|
138
160
|
FileMapViewItem,
|
|
139
161
|
{
|
|
140
162
|
style: { width: (_a2 = props.style) == null ? void 0 : _a2.width },
|
|
141
|
-
onPreview: () => {
|
|
163
|
+
onPreview: props.onPreview ? () => {
|
|
142
164
|
var _a3;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
if (typeof window === "undefined")
|
|
148
|
-
return;
|
|
149
|
-
window.open(file.previewUrl || file.url, "_blank");
|
|
150
|
-
},
|
|
151
|
-
onDownload: () => {
|
|
165
|
+
(_a3 = props.onPreview) == null ? void 0 : _a3.call(props, file);
|
|
166
|
+
} : void 0,
|
|
167
|
+
onDownload: props.onDownload ? () => {
|
|
152
168
|
var _a3;
|
|
153
169
|
(_a3 = props.onDownload) == null ? void 0 : _a3.call(props, file);
|
|
154
|
-
},
|
|
170
|
+
} : void 0,
|
|
155
171
|
renderMoreAction: props.renderMoreAction,
|
|
156
172
|
customSlot: props.customSlot,
|
|
157
173
|
key: (file == null ? void 0 : file.uuid) || (file == null ? void 0 : file.name) || index,
|
|
@@ -162,15 +178,12 @@ var FileMapView = (props) => {
|
|
|
162
178
|
}
|
|
163
179
|
);
|
|
164
180
|
}),
|
|
165
|
-
|
|
181
|
+
props.maxDisplayCount !== void 0 && allNoImageFiles.length > props.maxDisplayCount && !showAllFiles ? /* @__PURE__ */ React.createElement(
|
|
166
182
|
"div",
|
|
167
183
|
{
|
|
168
|
-
style: { width: (
|
|
184
|
+
style: { width: (_a = props.style) == null ? void 0 : _a.width },
|
|
169
185
|
className: classNames(hashId, `${prefix}-more-file-container`),
|
|
170
|
-
onClick:
|
|
171
|
-
var _a2;
|
|
172
|
-
return (_a2 = props.onViewAll) == null ? void 0 : _a2.call(props, fileList);
|
|
173
|
-
}
|
|
186
|
+
onClick: handleViewAllClick
|
|
174
187
|
},
|
|
175
188
|
/* @__PURE__ */ React.createElement(FileSearch, { color: "var(--color-gray-text-secondary)" }),
|
|
176
189
|
/* @__PURE__ */ React.createElement("div", { className: classNames(hashId, `${prefix}-more-file-name`) }, /* @__PURE__ */ React.createElement("span", { style: { whiteSpace: "nowrap" } }, "查看此任务中的所有文件"))
|
|
@@ -45,9 +45,12 @@ var genStyle = (token) => {
|
|
|
45
45
|
},
|
|
46
46
|
"&-vertical": {
|
|
47
47
|
display: "flex",
|
|
48
|
-
flexDirection: "
|
|
48
|
+
flexDirection: "row",
|
|
49
|
+
flexWrap: "wrap",
|
|
49
50
|
alignItems: "flex-start",
|
|
50
|
-
gap: 4
|
|
51
|
+
gap: 4,
|
|
52
|
+
maxWidth: "calc(285px * 3 + 4px * 2)"
|
|
53
|
+
// 3列:每列285px,间距4px
|
|
51
54
|
},
|
|
52
55
|
"&::-webkit-scrollbar": {
|
|
53
56
|
width: 6
|
|
@@ -116,7 +119,7 @@ var genStyle = (token) => {
|
|
|
116
119
|
borderRadius: "var(--radius-card-base)"
|
|
117
120
|
},
|
|
118
121
|
"&-more-file-container": {
|
|
119
|
-
width: "
|
|
122
|
+
width: "285px",
|
|
120
123
|
height: "56px",
|
|
121
124
|
borderRadius: "var(--radius-card-base)",
|
|
122
125
|
background: "var(--color-gray-bg-card-white)",
|
|
@@ -140,7 +143,7 @@ var genStyle = (token) => {
|
|
|
140
143
|
color: "var(--color-gray-text-secondary)"
|
|
141
144
|
},
|
|
142
145
|
"&-item": {
|
|
143
|
-
width: "
|
|
146
|
+
width: "285px",
|
|
144
147
|
height: "56px",
|
|
145
148
|
borderRadius: "var(--radius-card-base)",
|
|
146
149
|
opacity: 1,
|
|
@@ -199,7 +202,7 @@ var genStyle = (token) => {
|
|
|
199
202
|
background: "var(--color-gray-bg-card-white)",
|
|
200
203
|
boxSizing: "border-box",
|
|
201
204
|
boxShadow: "var(--shadow-control-base)",
|
|
202
|
-
borderRadius: "var(--radius-
|
|
205
|
+
borderRadius: "var(--radius-base)",
|
|
203
206
|
border: "none",
|
|
204
207
|
overflow: "hidden",
|
|
205
208
|
img: {
|
|
@@ -230,20 +233,25 @@ var genStyle = (token) => {
|
|
|
230
233
|
"&-file-name": {
|
|
231
234
|
color: "var(--color-gray-text-default)",
|
|
232
235
|
fontSize: "var(--font-text-h6-base)",
|
|
233
|
-
width: "
|
|
236
|
+
width: "150px",
|
|
234
237
|
alignItems: "center",
|
|
235
238
|
lineHeight: "18px",
|
|
236
239
|
fontFamily: token.fontFamily,
|
|
237
240
|
gap: -1,
|
|
241
|
+
display: "flex",
|
|
242
|
+
overflow: "hidden",
|
|
238
243
|
"&-text": {
|
|
239
|
-
maxWidth: "
|
|
240
|
-
whiteSpace: "nowrap",
|
|
244
|
+
maxWidth: "150px",
|
|
245
|
+
whiteSpace: "nowrap !important",
|
|
246
|
+
wordWrap: "normal",
|
|
247
|
+
wordBreak: "keep-all",
|
|
241
248
|
width: "100%",
|
|
242
249
|
overflow: "hidden",
|
|
243
250
|
display: "inline-block",
|
|
244
251
|
textOverflow: "ellipsis",
|
|
245
252
|
height: 18,
|
|
246
|
-
lineHeight: 1
|
|
253
|
+
lineHeight: 1,
|
|
254
|
+
verticalAlign: "top"
|
|
247
255
|
}
|
|
248
256
|
},
|
|
249
257
|
"&-file-name-extension-container": {
|
|
@@ -63,8 +63,6 @@ import React, {
|
|
|
63
63
|
useRef,
|
|
64
64
|
useState
|
|
65
65
|
} from "react";
|
|
66
|
-
import { Editor, Transforms } from "slate";
|
|
67
|
-
import { ReactEditor } from "slate-react";
|
|
68
66
|
import { useRefFunction } from "../Hooks/useRefFunction";
|
|
69
67
|
import {
|
|
70
68
|
BaseMarkdownEditor
|
|
@@ -151,6 +149,23 @@ var MarkdownInputField = (_a) => {
|
|
|
151
149
|
props == null ? void 0 : props.actionsRender,
|
|
152
150
|
props == null ? void 0 : props.toolsRender
|
|
153
151
|
]);
|
|
152
|
+
const computedMinHeight = useMemo(() => {
|
|
153
|
+
var _a3, _b3, _c2;
|
|
154
|
+
if (isEnlarged)
|
|
155
|
+
return "auto";
|
|
156
|
+
if (((_a3 = props == null ? void 0 : props.enlargeable) == null ? void 0 : _a3.enable) && ((_b3 = props == null ? void 0 : props.refinePrompt) == null ? void 0 : _b3.enable)) {
|
|
157
|
+
return 160;
|
|
158
|
+
}
|
|
159
|
+
if (isMultiRowLayout)
|
|
160
|
+
return 106;
|
|
161
|
+
return ((_c2 = props.style) == null ? void 0 : _c2.minHeight) || 0;
|
|
162
|
+
}, [
|
|
163
|
+
isEnlarged,
|
|
164
|
+
(_h = props == null ? void 0 : props.enlargeable) == null ? void 0 : _h.enable,
|
|
165
|
+
(_i = props == null ? void 0 : props.refinePrompt) == null ? void 0 : _i.enable,
|
|
166
|
+
isMultiRowLayout,
|
|
167
|
+
(_j = props.style) == null ? void 0 : _j.minHeight
|
|
168
|
+
]);
|
|
154
169
|
const {
|
|
155
170
|
fileUploadDone,
|
|
156
171
|
supportedFormat,
|
|
@@ -286,7 +301,7 @@ var MarkdownInputField = (_a) => {
|
|
|
286
301
|
);
|
|
287
302
|
}, [
|
|
288
303
|
fileMap,
|
|
289
|
-
(
|
|
304
|
+
(_k = props.attachment) == null ? void 0 : _k.enable,
|
|
290
305
|
handleFileRemoval,
|
|
291
306
|
handleFileRetry,
|
|
292
307
|
updateAttachmentFiles
|
|
@@ -318,30 +333,6 @@ var MarkdownInputField = (_a) => {
|
|
|
318
333
|
}
|
|
319
334
|
}
|
|
320
335
|
);
|
|
321
|
-
const handleContainerClick = useRefFunction(
|
|
322
|
-
(e) => {
|
|
323
|
-
var _a3, _b3, _c2, _d2;
|
|
324
|
-
if ((_a3 = markdownEditorRef == null ? void 0 : markdownEditorRef.current) == null ? void 0 : _a3.store.inputComposition)
|
|
325
|
-
return;
|
|
326
|
-
if (props.disabled)
|
|
327
|
-
return;
|
|
328
|
-
if ((_b3 = actionsRef.current) == null ? void 0 : _b3.contains(e.target))
|
|
329
|
-
return;
|
|
330
|
-
if ((_c2 = quickActionsRef.current) == null ? void 0 : _c2.contains(e.target))
|
|
331
|
-
return;
|
|
332
|
-
const editor = (_d2 = markdownEditorRef.current) == null ? void 0 : _d2.markdownEditorRef.current;
|
|
333
|
-
if (!editor)
|
|
334
|
-
return;
|
|
335
|
-
if (ReactEditor.isFocused(editor))
|
|
336
|
-
return;
|
|
337
|
-
ReactEditor.focus(editor);
|
|
338
|
-
Transforms.move(editor, { distance: 1, unit: "offset" });
|
|
339
|
-
Transforms.select(editor, {
|
|
340
|
-
anchor: Editor.end(editor, []),
|
|
341
|
-
focus: Editor.end(editor, [])
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
336
|
const sendActionsNode = /* @__PURE__ */ React.createElement(
|
|
346
337
|
SendActions,
|
|
347
338
|
{
|
|
@@ -349,7 +340,7 @@ var MarkdownInputField = (_a) => {
|
|
|
349
340
|
supportedFormat,
|
|
350
341
|
fileMap,
|
|
351
342
|
onFileMapChange: setFileMap,
|
|
352
|
-
upload: ((
|
|
343
|
+
upload: ((_l = props.attachment) == null ? void 0 : _l.upload) ? (file) => props.attachment.upload(file, 0) : void 0
|
|
353
344
|
}),
|
|
354
345
|
voiceRecognizer: props.voiceRecognizer,
|
|
355
346
|
value,
|
|
@@ -404,210 +395,169 @@ var MarkdownInputField = (_a) => {
|
|
|
404
395
|
[`${baseCls}-enlarged`]: isEnlarged
|
|
405
396
|
}),
|
|
406
397
|
style: __spreadProps(__spreadValues(__spreadValues({}, props.style), enlargedStyle), {
|
|
407
|
-
height: isEnlarged ? `${(
|
|
398
|
+
height: isEnlarged ? `${(_n = (_m = props.enlargeable) == null ? void 0 : _m.height) != null ? _n : 980}px` : `min(${collapsedHeightPx}px,100%)`,
|
|
408
399
|
borderRadius: borderRadius || 16,
|
|
400
|
+
minHeight: computedMinHeight,
|
|
401
|
+
cursor: isLoading || props.disabled ? "not-allowed" : "auto",
|
|
402
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
409
403
|
maxHeight: isEnlarged ? "none" : `min(${collapsedHeightPx}px,100%)`,
|
|
410
404
|
transition: "height, max-height 0.3s,border-radius 0.3s,box-shadow 0.3s,transform 0.3s,opacity 0.3s,background 0.3s"
|
|
411
405
|
}),
|
|
412
406
|
tabIndex: 1,
|
|
413
407
|
onMouseEnter: () => setHover(true),
|
|
414
408
|
onMouseLeave: () => setHover(false),
|
|
415
|
-
onKeyDown: handleKeyDown
|
|
416
|
-
onClick: handleContainerClick
|
|
409
|
+
onKeyDown: handleKeyDown
|
|
417
410
|
},
|
|
418
411
|
/* @__PURE__ */ React.createElement(
|
|
419
412
|
"div",
|
|
420
413
|
{
|
|
421
|
-
className: classNames(`${baseCls}-background`, hashId, {
|
|
422
|
-
[`${baseCls}-hover`]: isHover
|
|
423
|
-
}),
|
|
424
414
|
style: {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
415
|
+
display: "flex",
|
|
416
|
+
flexDirection: "column",
|
|
417
|
+
borderTopLeftRadius: "inherit",
|
|
418
|
+
borderTopRightRadius: "inherit",
|
|
419
|
+
maxHeight: isEnlarged ? "none" : (() => {
|
|
420
|
+
var _a3, _b3;
|
|
421
|
+
const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
|
|
422
|
+
const base = typeof mh === "number" ? mh : mh ? parseFloat(String(mh)) || 400 : 400;
|
|
423
|
+
const extra = ((_b3 = props.attachment) == null ? void 0 : _b3.enable) ? 90 : 0;
|
|
424
|
+
return `min(${base + extra}px)`;
|
|
425
|
+
})(),
|
|
426
|
+
height: isEnlarged ? "100%" : "auto",
|
|
427
|
+
flex: 1
|
|
428
|
+
},
|
|
429
|
+
className: classNames(`${baseCls}-editor`, hashId, {
|
|
430
|
+
[`${baseCls}-editor-hover`]: isHover,
|
|
431
|
+
[`${baseCls}-editor-disabled`]: props.disabled
|
|
432
|
+
})
|
|
433
|
+
},
|
|
434
|
+
/* @__PURE__ */ React.createElement(
|
|
435
|
+
SkillModeBar,
|
|
436
|
+
{
|
|
437
|
+
skillMode: props.skillMode,
|
|
438
|
+
onSkillModeOpenChange: props.onSkillModeOpenChange
|
|
428
439
|
}
|
|
429
|
-
|
|
440
|
+
),
|
|
441
|
+
/* @__PURE__ */ React.createElement("div", { className: classNames(`${baseCls}-editor-content`, hashId) }, attachmentList, /* @__PURE__ */ React.createElement(
|
|
442
|
+
BaseMarkdownEditor,
|
|
443
|
+
__spreadValues({
|
|
444
|
+
editorRef: markdownEditorRef,
|
|
445
|
+
leafRender: props.leafRender,
|
|
446
|
+
style: {
|
|
447
|
+
width: "100%",
|
|
448
|
+
flex: 1,
|
|
449
|
+
padding: 0,
|
|
450
|
+
paddingRight: computedRightPadding
|
|
451
|
+
},
|
|
452
|
+
toolBar: {
|
|
453
|
+
enable: false
|
|
454
|
+
},
|
|
455
|
+
floatBar: {
|
|
456
|
+
enable: false
|
|
457
|
+
},
|
|
458
|
+
readonly: isLoading,
|
|
459
|
+
contentStyle: {
|
|
460
|
+
padding: "var(--padding-3x)"
|
|
461
|
+
},
|
|
462
|
+
textAreaProps: {
|
|
463
|
+
enable: true,
|
|
464
|
+
placeholder: props.placeholder,
|
|
465
|
+
triggerSendKey: props.triggerSendKey || "Enter"
|
|
466
|
+
},
|
|
467
|
+
tagInputProps: __spreadValues({
|
|
468
|
+
enable: true,
|
|
469
|
+
type: "dropdown"
|
|
470
|
+
}, tagInputProps),
|
|
471
|
+
initValue: props.value,
|
|
472
|
+
onChange: (value2) => {
|
|
473
|
+
var _a3;
|
|
474
|
+
setValue(value2);
|
|
475
|
+
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, value2);
|
|
476
|
+
},
|
|
477
|
+
onFocus: (value2, schema, e) => {
|
|
478
|
+
onFocus == null ? void 0 : onFocus(value2, schema, e);
|
|
479
|
+
activeInput(true);
|
|
480
|
+
},
|
|
481
|
+
onBlur: (value2, schema, e) => {
|
|
482
|
+
onBlur == null ? void 0 : onBlur(value2, schema, e);
|
|
483
|
+
activeInput(false);
|
|
484
|
+
},
|
|
485
|
+
onPaste: (e) => {
|
|
486
|
+
handlePaste(e);
|
|
487
|
+
},
|
|
488
|
+
titlePlaceholderContent: props.placeholder,
|
|
489
|
+
toc: false,
|
|
490
|
+
pasteConfig: props.pasteConfig
|
|
491
|
+
}, markdownProps)
|
|
492
|
+
))
|
|
430
493
|
),
|
|
431
|
-
/* @__PURE__ */ React.createElement(
|
|
494
|
+
props.toolsRender ? /* @__PURE__ */ React.createElement(
|
|
432
495
|
"div",
|
|
433
496
|
{
|
|
434
|
-
className: classNames(`${baseCls}-border-wrapper`, hashId),
|
|
435
497
|
style: {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
498
|
+
backgroundColor: "#fff",
|
|
499
|
+
display: "flex",
|
|
500
|
+
boxSizing: "border-box",
|
|
501
|
+
borderRadius: "inherit",
|
|
502
|
+
flexDirection: "row",
|
|
503
|
+
alignItems: "center",
|
|
504
|
+
justifyContent: "space-between",
|
|
505
|
+
gap: 8,
|
|
506
|
+
width: "100%",
|
|
507
|
+
paddingRight: "var(--padding-3x)",
|
|
508
|
+
paddingLeft: "var(--padding-3x)",
|
|
509
|
+
paddingBottom: "var(--padding-3x)"
|
|
442
510
|
}
|
|
443
511
|
},
|
|
444
512
|
/* @__PURE__ */ React.createElement(
|
|
445
513
|
"div",
|
|
446
514
|
{
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
515
|
+
ref: actionsRef,
|
|
516
|
+
contentEditable: false,
|
|
517
|
+
className: classNames(`${baseCls}-send-tools`, hashId)
|
|
451
518
|
},
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
width: "100%",
|
|
495
|
-
flex: 1,
|
|
496
|
-
padding: 0,
|
|
497
|
-
paddingRight: computedRightPadding
|
|
498
|
-
},
|
|
499
|
-
toolBar: {
|
|
500
|
-
enable: false
|
|
501
|
-
},
|
|
502
|
-
floatBar: {
|
|
503
|
-
enable: false
|
|
504
|
-
},
|
|
505
|
-
readonly: isLoading,
|
|
506
|
-
contentStyle: {
|
|
507
|
-
padding: "var(--padding-card-base)"
|
|
508
|
-
},
|
|
509
|
-
textAreaProps: {
|
|
510
|
-
enable: true,
|
|
511
|
-
placeholder: props.placeholder,
|
|
512
|
-
triggerSendKey: props.triggerSendKey || "Enter"
|
|
513
|
-
},
|
|
514
|
-
tagInputProps: __spreadValues({
|
|
515
|
-
enable: true,
|
|
516
|
-
type: "dropdown"
|
|
517
|
-
}, tagInputProps),
|
|
518
|
-
initValue: props.value,
|
|
519
|
-
onChange: (value2) => {
|
|
520
|
-
var _a3;
|
|
521
|
-
setValue(value2);
|
|
522
|
-
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, value2);
|
|
523
|
-
},
|
|
524
|
-
onFocus: (value2, schema, e) => {
|
|
525
|
-
onFocus == null ? void 0 : onFocus(value2, schema, e);
|
|
526
|
-
activeInput(true);
|
|
527
|
-
},
|
|
528
|
-
onBlur: (value2, schema, e) => {
|
|
529
|
-
onBlur == null ? void 0 : onBlur(value2, schema, e);
|
|
530
|
-
activeInput(false);
|
|
531
|
-
},
|
|
532
|
-
onPaste: (e) => {
|
|
533
|
-
handlePaste(e);
|
|
534
|
-
},
|
|
535
|
-
titlePlaceholderContent: props.placeholder,
|
|
536
|
-
toc: false,
|
|
537
|
-
pasteConfig: props.pasteConfig
|
|
538
|
-
}, markdownProps)
|
|
539
|
-
)
|
|
540
|
-
)
|
|
541
|
-
),
|
|
542
|
-
props.toolsRender ? /* @__PURE__ */ React.createElement(
|
|
543
|
-
"div",
|
|
544
|
-
{
|
|
545
|
-
style: {
|
|
546
|
-
backgroundColor: "#fff",
|
|
547
|
-
display: "flex",
|
|
548
|
-
boxSizing: "border-box",
|
|
549
|
-
borderRadius: "inherit",
|
|
550
|
-
flexDirection: "row",
|
|
551
|
-
alignItems: "center",
|
|
552
|
-
justifyContent: "space-between",
|
|
553
|
-
gap: 8,
|
|
554
|
-
width: "100%",
|
|
555
|
-
paddingRight: "var(--padding-card-base)",
|
|
556
|
-
paddingLeft: "var(--padding-card-base)",
|
|
557
|
-
paddingBottom: "var(--padding-card-base)"
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
/* @__PURE__ */ React.createElement(
|
|
561
|
-
"div",
|
|
562
|
-
{
|
|
563
|
-
ref: actionsRef,
|
|
564
|
-
contentEditable: false,
|
|
565
|
-
className: classNames(`${baseCls}-send-tools`, hashId)
|
|
566
|
-
},
|
|
567
|
-
props.toolsRender(__spreadProps(__spreadValues({
|
|
568
|
-
value,
|
|
569
|
-
fileMap,
|
|
570
|
-
onFileMapChange: setFileMap
|
|
571
|
-
}, props), {
|
|
572
|
-
isHover,
|
|
573
|
-
isLoading,
|
|
574
|
-
fileUploadStatus: fileUploadDone ? "done" : "uploading"
|
|
575
|
-
}))
|
|
576
|
-
),
|
|
577
|
-
sendActionsNode
|
|
578
|
-
) : sendActionsNode,
|
|
579
|
-
(props == null ? void 0 : props.quickActionRender) || ((_o = props.refinePrompt) == null ? void 0 : _o.enable) ? /* @__PURE__ */ React.createElement(
|
|
580
|
-
QuickActions,
|
|
581
|
-
{
|
|
582
|
-
ref: quickActionsRef,
|
|
583
|
-
value,
|
|
584
|
-
fileMap,
|
|
585
|
-
onFileMapChange: setFileMap,
|
|
586
|
-
isHover,
|
|
587
|
-
isLoading,
|
|
588
|
-
disabled: props.disabled,
|
|
589
|
-
fileUploadStatus: fileUploadDone ? "done" : "uploading",
|
|
590
|
-
refinePrompt: props.refinePrompt,
|
|
591
|
-
editorRef: markdownEditorRef,
|
|
592
|
-
onValueChange: (text) => {
|
|
593
|
-
var _a3;
|
|
594
|
-
setValue(text);
|
|
595
|
-
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, text);
|
|
596
|
-
},
|
|
597
|
-
quickActionRender: props.quickActionRender,
|
|
598
|
-
prefixCls: baseCls,
|
|
599
|
-
hashId,
|
|
600
|
-
enlargeable: !!((_p = props.enlargeable) == null ? void 0 : _p.enable),
|
|
601
|
-
isEnlarged,
|
|
602
|
-
onEnlargeClick: handleEnlargeClick,
|
|
603
|
-
onResize: (width, rightOffset) => {
|
|
604
|
-
setTopRightPadding(width);
|
|
605
|
-
setQuickRightOffset(rightOffset);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
) : null
|
|
609
|
-
)
|
|
610
|
-
)
|
|
519
|
+
props.toolsRender(__spreadProps(__spreadValues({
|
|
520
|
+
value,
|
|
521
|
+
fileMap,
|
|
522
|
+
onFileMapChange: setFileMap
|
|
523
|
+
}, props), {
|
|
524
|
+
isHover,
|
|
525
|
+
isLoading,
|
|
526
|
+
fileUploadStatus: fileUploadDone ? "done" : "uploading"
|
|
527
|
+
}))
|
|
528
|
+
),
|
|
529
|
+
sendActionsNode
|
|
530
|
+
) : sendActionsNode,
|
|
531
|
+
(props == null ? void 0 : props.quickActionRender) || ((_o = props.refinePrompt) == null ? void 0 : _o.enable) ? /* @__PURE__ */ React.createElement(
|
|
532
|
+
QuickActions,
|
|
533
|
+
{
|
|
534
|
+
ref: quickActionsRef,
|
|
535
|
+
value,
|
|
536
|
+
fileMap,
|
|
537
|
+
onFileMapChange: setFileMap,
|
|
538
|
+
isHover,
|
|
539
|
+
isLoading,
|
|
540
|
+
disabled: props.disabled,
|
|
541
|
+
fileUploadStatus: fileUploadDone ? "done" : "uploading",
|
|
542
|
+
refinePrompt: props.refinePrompt,
|
|
543
|
+
editorRef: markdownEditorRef,
|
|
544
|
+
onValueChange: (text) => {
|
|
545
|
+
var _a3;
|
|
546
|
+
setValue(text);
|
|
547
|
+
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, text);
|
|
548
|
+
},
|
|
549
|
+
quickActionRender: props.quickActionRender,
|
|
550
|
+
prefixCls: baseCls,
|
|
551
|
+
hashId,
|
|
552
|
+
enlargeable: !!((_p = props.enlargeable) == null ? void 0 : _p.enable),
|
|
553
|
+
isEnlarged,
|
|
554
|
+
onEnlargeClick: handleEnlargeClick,
|
|
555
|
+
onResize: (width, rightOffset) => {
|
|
556
|
+
setTopRightPadding(width);
|
|
557
|
+
setQuickRightOffset(rightOffset);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
) : null
|
|
611
561
|
)
|
|
612
562
|
))
|
|
613
563
|
);
|
|
@@ -60,7 +60,8 @@ var VoiceInputButton = (props) => {
|
|
|
60
60
|
/* @__PURE__ */ React.createElement(
|
|
61
61
|
Tooltip,
|
|
62
62
|
{
|
|
63
|
-
mouseEnterDelay:
|
|
63
|
+
mouseEnterDelay: 2,
|
|
64
|
+
arrow: false,
|
|
64
65
|
title: recording ? (locale == null ? void 0 : locale["input.voiceInputting"]) || "语音输入中,点击可停止。" : (locale == null ? void 0 : locale["input.voiceInput"]) || "语音输入"
|
|
65
66
|
},
|
|
66
67
|
/* @__PURE__ */ React.createElement(
|