@ant-design/agentic-ui 2.0.15 → 2.0.17
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/AIBubble.js +3 -0
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +3 -1
- package/dist/Bubble/style.js +4 -1
- package/dist/Components/Loading/index.d.ts +2 -1
- package/dist/Components/Loading/index.js +3 -161
- package/dist/Components/lotties/LoadingLottie/index.d.ts +65 -0
- package/dist/Components/lotties/LoadingLottie/index.js +53 -0
- package/dist/Components/lotties/LoadingLottie/loading.json +1 -0
- package/dist/History/index.js +7 -2
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +11 -8
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +16 -12
- package/dist/MarkdownEditor/editor/utils/dom.d.ts +1 -1
- package/dist/MarkdownEditor/editor/utils/index.d.ts +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +9 -8
- package/dist/MarkdownInputField/AttachmentButton/index.d.ts +2 -0
- package/dist/MarkdownInputField/AttachmentButton/style.js +3 -3
- package/dist/MarkdownInputField/Enlargement/index.js +9 -29
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +30 -27
- package/dist/MarkdownInputField/FileMapView/index.d.ts +4 -4
- package/dist/MarkdownInputField/FileMapView/index.js +20 -13
- package/dist/MarkdownInputField/FileUploadManager/index.js +2 -2
- package/dist/MarkdownInputField/MarkdownInputField.d.ts +9 -19
- package/dist/MarkdownInputField/MarkdownInputField.js +218 -250
- package/dist/MarkdownInputField/RefinePromptButton/index.js +8 -53
- package/dist/MarkdownInputField/style.js +54 -47
- package/dist/Plugins/chart/AreaChart/index.d.ts +2 -2
- package/dist/Plugins/chart/AreaChart/index.js +9 -29
- package/dist/Plugins/chart/BarChart/index.d.ts +8 -8
- package/dist/Plugins/chart/BarChart/index.js +9 -8
- package/dist/Plugins/chart/DonutChart/constants.d.ts +0 -1
- package/dist/Plugins/chart/DonutChart/constants.js +0 -14
- package/dist/Plugins/chart/DonutChart/index.js +51 -16
- package/dist/Plugins/chart/DonutChart/style.js +7 -0
- package/dist/Plugins/chart/DonutChart/types.d.ts +2 -0
- package/dist/Plugins/chart/FunnelChart/index.d.ts +8 -8
- package/dist/Plugins/chart/FunnelChart/index.js +85 -66
- package/dist/Plugins/chart/FunnelChart/style.js +12 -0
- package/dist/Plugins/chart/LineChart/index.d.ts +2 -2
- package/dist/Plugins/chart/LineChart/index.js +16 -19
- package/dist/Plugins/chart/RadarChart/index.d.ts +11 -5
- package/dist/Plugins/chart/RadarChart/index.js +35 -50
- package/dist/Plugins/chart/RadarChart/style.js +8 -0
- package/dist/Plugins/chart/ScatterChart/index.d.ts +23 -6
- package/dist/Plugins/chart/ScatterChart/index.js +58 -57
- package/dist/Plugins/chart/ScatterChart/style.js +8 -0
- package/dist/Plugins/chart/components/ChartContainer/style.js +7 -1
- package/dist/Plugins/chart/hooks/useChartStatistic.d.ts +0 -6
- package/dist/Plugins/chart/hooks/useChartStatistic.js +0 -16
- package/dist/Workspace/File/PreviewComponent.js +3 -2
- package/dist/Workspace/File/style.js +2 -1
- package/dist/Workspace/RealtimeFollow/style.js +1 -6
- package/dist/Workspace/style.js +2 -1
- package/package.json +1 -1
- package/dist/Components/Loading/style.d.ts +0 -5
- package/dist/Components/Loading/style.js +0 -46
- package/dist/MarkdownInputField/Enlargement/style.d.ts +0 -10
- package/dist/MarkdownInputField/Enlargement/style.js +0 -75
|
@@ -78,7 +78,7 @@ import { useFileUploadManager } from "./FileUploadManager";
|
|
|
78
78
|
import { QuickActions } from "./QuickActions";
|
|
79
79
|
import { SendActions } from "./SendActions";
|
|
80
80
|
import { SkillModeBar } from "./SkillModeBar";
|
|
81
|
-
import {
|
|
81
|
+
import { useStyle } from "./style";
|
|
82
82
|
import { Suggestion } from "./Suggestion";
|
|
83
83
|
import TopOperatingArea from "./TopOperatingArea";
|
|
84
84
|
import { useVoiceInputManager } from "./VoiceInputManager";
|
|
@@ -98,7 +98,7 @@ var MarkdownInputField = (_a) => {
|
|
|
98
98
|
"onFocus",
|
|
99
99
|
"isShowTopOperatingArea"
|
|
100
100
|
]);
|
|
101
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
101
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
102
102
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
103
103
|
const baseCls = getPrefixCls("agentic-md-input-field");
|
|
104
104
|
const { wrapSSR, hashId } = useStyle(baseCls);
|
|
@@ -127,16 +127,27 @@ var MarkdownInputField = (_a) => {
|
|
|
127
127
|
const topOverlayPadding = (topRightPadding || 0) + (quickRightOffset || 0);
|
|
128
128
|
return Math.max(bottomOverlayPadding, topOverlayPadding);
|
|
129
129
|
}, [props.toolsRender, rightPadding, topRightPadding, quickRightOffset]);
|
|
130
|
+
const collapsedHeight = useMemo(() => {
|
|
131
|
+
var _a3;
|
|
132
|
+
const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
|
|
133
|
+
const base = typeof mh === "number" ? mh : mh ? parseFloat(String(mh)) || 114 : 114;
|
|
134
|
+
return base;
|
|
135
|
+
}, [(_a2 = props.style) == null ? void 0 : _a2.maxHeight, (_b2 = props.attachment) == null ? void 0 : _b2.enable]);
|
|
136
|
+
const collapsedHeightPx = useMemo(() => {
|
|
137
|
+
var _a3;
|
|
138
|
+
const extra = ((_a3 = props.attachment) == null ? void 0 : _a3.enable) ? 90 : 0;
|
|
139
|
+
return collapsedHeight + extra;
|
|
140
|
+
}, [(_c = props.style) == null ? void 0 : _c.maxHeight, (_d = props.attachment) == null ? void 0 : _d.enable]);
|
|
130
141
|
const [fileMap, setFileMap] = useMergedState(void 0, {
|
|
131
|
-
value: (
|
|
132
|
-
onChange: (
|
|
142
|
+
value: (_e = props.attachment) == null ? void 0 : _e.fileMap,
|
|
143
|
+
onChange: (_f = props.attachment) == null ? void 0 : _f.onFileMapChange
|
|
133
144
|
});
|
|
134
145
|
const isMultiRowLayout = useMemo(() => {
|
|
135
146
|
var _a3;
|
|
136
147
|
return !!((props == null ? void 0 : props.quickActionRender) || ((_a3 = props == null ? void 0 : props.refinePrompt) == null ? void 0 : _a3.enable) || (props == null ? void 0 : props.actionsRender) || (props == null ? void 0 : props.toolsRender));
|
|
137
148
|
}, [
|
|
138
149
|
props == null ? void 0 : props.quickActionRender,
|
|
139
|
-
(
|
|
150
|
+
(_g = props == null ? void 0 : props.refinePrompt) == null ? void 0 : _g.enable,
|
|
140
151
|
props == null ? void 0 : props.actionsRender,
|
|
141
152
|
props == null ? void 0 : props.toolsRender
|
|
142
153
|
]);
|
|
@@ -164,18 +175,6 @@ var MarkdownInputField = (_a) => {
|
|
|
164
175
|
(_b3 = (_a3 = markdownEditorRef.current) == null ? void 0 : _a3.store) == null ? void 0 : _b3.setMDContent(value);
|
|
165
176
|
}, [props.value]);
|
|
166
177
|
useImperativeHandle(props.inputRef, () => markdownEditorRef.current);
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
var _a3;
|
|
169
|
-
const targetElement = (_a3 = props.enlargeTargetRef) == null ? void 0 : _a3.current;
|
|
170
|
-
if (targetElement && isEnlarged) {
|
|
171
|
-
const computedStyle = window.getComputedStyle(targetElement);
|
|
172
|
-
if (computedStyle.position === "static") {
|
|
173
|
-
console.warn(
|
|
174
|
-
"MarkdownInputField: enlargeTargetRef 容器的 position 为 static,这可能导致放大功能无法正常工作。请为目标容器设置 position: relative、absolute 或 fixed。"
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}, [isEnlarged, props.enlargeTargetRef]);
|
|
179
178
|
const handleEnlargeClick = useRefFunction(() => {
|
|
180
179
|
setIsEnlarged(!isEnlarged);
|
|
181
180
|
});
|
|
@@ -204,32 +203,14 @@ var MarkdownInputField = (_a) => {
|
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
205
|
}));
|
|
207
|
-
const bgSize = useMemo(() => {
|
|
208
|
-
var _a3, _b3;
|
|
209
|
-
const height = ((_a3 = props.style) == null ? void 0 : _a3.height) ? addGlowBorderOffset(props.style.height) : addGlowBorderOffset("100%");
|
|
210
|
-
const width = ((_b3 = props.style) == null ? void 0 : _b3.width) ? addGlowBorderOffset(props.style.width) : addGlowBorderOffset("100%");
|
|
211
|
-
return { height, width };
|
|
212
|
-
}, [(_d = props.style) == null ? void 0 : _d.height, (_e = props.style) == null ? void 0 : _e.width]);
|
|
213
206
|
const enlargedStyle = useMemo(() => {
|
|
214
|
-
var _a3;
|
|
215
207
|
if (!isEnlarged)
|
|
216
208
|
return {};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
left: "0",
|
|
223
|
-
right: "0",
|
|
224
|
-
bottom: "0",
|
|
225
|
-
width: "auto",
|
|
226
|
-
height: `calc(100% - ${topOffset}px)`,
|
|
227
|
-
maxWidth: "none",
|
|
228
|
-
zIndex: 1e3
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
return {};
|
|
232
|
-
}, [isEnlarged, props.enlargeTargetRef]);
|
|
209
|
+
return {
|
|
210
|
+
maxHeight: "980px",
|
|
211
|
+
minHeight: "280px"
|
|
212
|
+
};
|
|
213
|
+
}, [isEnlarged]);
|
|
233
214
|
const beforeTools = useMemo(() => {
|
|
234
215
|
if (props.beforeToolsRender) {
|
|
235
216
|
return props.beforeToolsRender(__spreadProps(__spreadValues({}, props), {
|
|
@@ -288,6 +269,113 @@ var MarkdownInputField = (_a) => {
|
|
|
288
269
|
}),
|
|
289
270
|
[fileMap, markdownProps == null ? void 0 : markdownProps.attachment]
|
|
290
271
|
);
|
|
272
|
+
const attachmentList = useMemo(() => {
|
|
273
|
+
var _a3;
|
|
274
|
+
if (!((_a3 = props.attachment) == null ? void 0 : _a3.enable))
|
|
275
|
+
return null;
|
|
276
|
+
return /* @__PURE__ */ React.createElement(
|
|
277
|
+
AttachmentFileList,
|
|
278
|
+
{
|
|
279
|
+
fileMap,
|
|
280
|
+
onDelete: handleFileRemoval,
|
|
281
|
+
onRetry: handleFileRetry,
|
|
282
|
+
onClearFileMap: () => {
|
|
283
|
+
updateAttachmentFiles(/* @__PURE__ */ new Map());
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}, [
|
|
288
|
+
fileMap,
|
|
289
|
+
(_h = props.attachment) == null ? void 0 : _h.enable,
|
|
290
|
+
handleFileRemoval,
|
|
291
|
+
handleFileRetry,
|
|
292
|
+
updateAttachmentFiles
|
|
293
|
+
]);
|
|
294
|
+
const handleKeyDown = useRefFunction(
|
|
295
|
+
(e) => {
|
|
296
|
+
var _a3;
|
|
297
|
+
const triggerSendKey = props.triggerSendKey || "Enter";
|
|
298
|
+
if ((_a3 = markdownEditorRef == null ? void 0 : markdownEditorRef.current) == null ? void 0 : _a3.store.inputComposition)
|
|
299
|
+
return;
|
|
300
|
+
const isEnter = e.key === "Enter";
|
|
301
|
+
const isMod = e.ctrlKey || e.metaKey;
|
|
302
|
+
if (triggerSendKey === "Enter") {
|
|
303
|
+
if (!(isEnter && !isMod))
|
|
304
|
+
return;
|
|
305
|
+
e.stopPropagation();
|
|
306
|
+
e.preventDefault();
|
|
307
|
+
if (props.onSend)
|
|
308
|
+
sendMessage();
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
if (triggerSendKey === "Mod+Enter") {
|
|
312
|
+
if (!(isEnter && isMod))
|
|
313
|
+
return;
|
|
314
|
+
e.stopPropagation();
|
|
315
|
+
e.preventDefault();
|
|
316
|
+
if (props.onSend)
|
|
317
|
+
sendMessage();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
);
|
|
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
|
+
const sendActionsNode = /* @__PURE__ */ React.createElement(
|
|
346
|
+
SendActions,
|
|
347
|
+
{
|
|
348
|
+
attachment: __spreadProps(__spreadValues({}, props.attachment), {
|
|
349
|
+
supportedFormat,
|
|
350
|
+
fileMap,
|
|
351
|
+
onFileMapChange: setFileMap,
|
|
352
|
+
upload: ((_i = props.attachment) == null ? void 0 : _i.upload) ? (file) => props.attachment.upload(file, 0) : void 0
|
|
353
|
+
}),
|
|
354
|
+
voiceRecognizer: props.voiceRecognizer,
|
|
355
|
+
value,
|
|
356
|
+
disabled: props.disabled,
|
|
357
|
+
typing: props.typing,
|
|
358
|
+
isLoading,
|
|
359
|
+
fileUploadDone,
|
|
360
|
+
recording,
|
|
361
|
+
collapseSendActions,
|
|
362
|
+
allowEmptySubmit: props.allowEmptySubmit,
|
|
363
|
+
uploadImage,
|
|
364
|
+
onStartRecording: startRecording,
|
|
365
|
+
onStopRecording: stopRecording,
|
|
366
|
+
onSend: sendMessage,
|
|
367
|
+
onStop: () => {
|
|
368
|
+
var _a3;
|
|
369
|
+
setIsLoading(false);
|
|
370
|
+
(_a3 = props.onStop) == null ? void 0 : _a3.call(props);
|
|
371
|
+
},
|
|
372
|
+
actionsRender: props.actionsRender,
|
|
373
|
+
prefixCls: baseCls,
|
|
374
|
+
hashId,
|
|
375
|
+
hasTools: !!props.toolsRender,
|
|
376
|
+
onResize: setRightPadding
|
|
377
|
+
}
|
|
378
|
+
);
|
|
291
379
|
return wrapSSR(
|
|
292
380
|
/* @__PURE__ */ React.createElement(React.Fragment, null, isShowTopOperatingArea && /* @__PURE__ */ React.createElement("div", { className: classNames(`${baseCls}-top-area`, hashId) }, /* @__PURE__ */ React.createElement(
|
|
293
381
|
TopOperatingArea,
|
|
@@ -316,60 +404,17 @@ var MarkdownInputField = (_a) => {
|
|
|
316
404
|
[`${baseCls}-enlarged`]: isEnlarged
|
|
317
405
|
}),
|
|
318
406
|
style: __spreadProps(__spreadValues(__spreadValues({}, props.style), enlargedStyle), {
|
|
407
|
+
minHeight: `${collapsedHeight}px`,
|
|
408
|
+
height: isEnlarged ? `${(_k = (_j = props.enlargeable) == null ? void 0 : _j.height) != null ? _k : 980}px` : `max(${collapsedHeight}px,100%)`,
|
|
319
409
|
borderRadius: borderRadius || 16,
|
|
320
|
-
|
|
410
|
+
maxHeight: isEnlarged ? "none" : `max(${collapsedHeightPx}px,100%)`,
|
|
411
|
+
transition: "height, max-height 0.3s,border-radius 0.3s,box-shadow 0.3s,transform 0.3s,opacity 0.3s,background 0.3s"
|
|
321
412
|
}),
|
|
322
413
|
tabIndex: 1,
|
|
323
414
|
onMouseEnter: () => setHover(true),
|
|
324
415
|
onMouseLeave: () => setHover(false),
|
|
325
|
-
onKeyDown:
|
|
326
|
-
|
|
327
|
-
const { triggerSendKey = "Enter" } = props;
|
|
328
|
-
if ((_a3 = markdownEditorRef == null ? void 0 : markdownEditorRef.current) == null ? void 0 : _a3.store.inputComposition) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
if (triggerSendKey === "Enter" && e.key === "Enter" && !(e.ctrlKey || e.metaKey)) {
|
|
332
|
-
e.stopPropagation();
|
|
333
|
-
e.preventDefault();
|
|
334
|
-
if (props.onSend) {
|
|
335
|
-
sendMessage();
|
|
336
|
-
}
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
if (triggerSendKey === "Mod+Enter" && (e.ctrlKey || e.metaKey) && e.key === "Enter") {
|
|
340
|
-
e.stopPropagation();
|
|
341
|
-
e.preventDefault();
|
|
342
|
-
if (props.onSend) {
|
|
343
|
-
sendMessage();
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
onClick: (e) => {
|
|
348
|
-
var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
349
|
-
if ((_a3 = markdownEditorRef == null ? void 0 : markdownEditorRef.current) == null ? void 0 : _a3.store.inputComposition) {
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
if (props.disabled) {
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
if ((_b3 = actionsRef.current) == null ? void 0 : _b3.contains(e.target)) {
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
if ((_c2 = quickActionsRef.current) == null ? void 0 : _c2.contains(e.target)) {
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
if (((_e2 = (_d2 = markdownEditorRef.current) == null ? void 0 : _d2.store) == null ? void 0 : _e2.editor) && !ReactEditor.isFocused((_g2 = (_f2 = markdownEditorRef.current) == null ? void 0 : _f2.store) == null ? void 0 : _g2.editor)) {
|
|
362
|
-
const editor = (_h2 = markdownEditorRef.current) == null ? void 0 : _h2.markdownEditorRef.current;
|
|
363
|
-
if (editor) {
|
|
364
|
-
ReactEditor.focus(editor);
|
|
365
|
-
Transforms.move(editor, { distance: 1, unit: "offset" });
|
|
366
|
-
Transforms.select(editor, {
|
|
367
|
-
anchor: Editor.end(editor, []),
|
|
368
|
-
focus: Editor.end(editor, [])
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
416
|
+
onKeyDown: handleKeyDown,
|
|
417
|
+
onClick: handleContainerClick
|
|
373
418
|
},
|
|
374
419
|
/* @__PURE__ */ React.createElement(
|
|
375
420
|
"div",
|
|
@@ -378,38 +423,33 @@ var MarkdownInputField = (_a) => {
|
|
|
378
423
|
[`${baseCls}-hover`]: isHover
|
|
379
424
|
}),
|
|
380
425
|
style: {
|
|
381
|
-
minHeight: ((
|
|
382
|
-
height:
|
|
383
|
-
width:
|
|
426
|
+
minHeight: ((_l = props.style) == null ? void 0 : _l.minHeight) || 0,
|
|
427
|
+
height: "100%",
|
|
428
|
+
width: "100%"
|
|
384
429
|
}
|
|
385
430
|
}
|
|
386
431
|
),
|
|
387
432
|
/* @__PURE__ */ React.createElement(
|
|
388
433
|
"div",
|
|
389
434
|
{
|
|
435
|
+
className: classNames(`${baseCls}-border-wrapper`, hashId),
|
|
390
436
|
style: {
|
|
391
|
-
flex: 1,
|
|
392
|
-
backgroundColor: "#fff",
|
|
393
|
-
width: "100%",
|
|
394
437
|
height: isEnlarged ? "100%" : "auto",
|
|
395
|
-
|
|
396
|
-
zIndex: 9,
|
|
397
|
-
flexDirection: "column",
|
|
398
|
-
boxSizing: "border-box",
|
|
438
|
+
maxHeight: isEnlarged ? "100%" : "auto",
|
|
399
439
|
borderRadius: (borderRadius || 16) - 2 || 10,
|
|
400
440
|
cursor: isLoading || props.disabled ? "not-allowed" : "auto",
|
|
401
441
|
opacity: props.disabled ? 0.5 : 1,
|
|
402
|
-
minHeight: isEnlarged ? "auto" : isMultiRowLayout ?
|
|
403
|
-
transition: "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)"
|
|
442
|
+
minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : void 0
|
|
404
443
|
}
|
|
405
444
|
},
|
|
406
|
-
/* @__PURE__ */ React.createElement(
|
|
445
|
+
/* @__PURE__ */ React.createElement("div", { className: classNames(`${baseCls}-content-wrapper`, hashId) }, /* @__PURE__ */ React.createElement(
|
|
407
446
|
"div",
|
|
408
447
|
{
|
|
409
448
|
style: {
|
|
410
449
|
display: "flex",
|
|
411
450
|
flexDirection: "column",
|
|
412
|
-
|
|
451
|
+
borderTopLeftRadius: (borderRadius || 16) - 2 || 10,
|
|
452
|
+
borderTopRightRadius: (borderRadius || 16) - 2 || 10,
|
|
413
453
|
maxHeight: isEnlarged ? "none" : (() => {
|
|
414
454
|
var _a3, _b3;
|
|
415
455
|
const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
|
|
@@ -418,8 +458,7 @@ var MarkdownInputField = (_a) => {
|
|
|
418
458
|
return `min(${base + extra}px)`;
|
|
419
459
|
})(),
|
|
420
460
|
height: isEnlarged ? "100%" : "auto",
|
|
421
|
-
flex: 1
|
|
422
|
-
transition: "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)"
|
|
461
|
+
flex: 1
|
|
423
462
|
},
|
|
424
463
|
className: classNames(`${baseCls}-editor`, hashId, {
|
|
425
464
|
[`${baseCls}-editor-hover`]: isHover,
|
|
@@ -433,96 +472,92 @@ var MarkdownInputField = (_a) => {
|
|
|
433
472
|
onSkillModeOpenChange: props.onSkillModeOpenChange
|
|
434
473
|
}
|
|
435
474
|
),
|
|
436
|
-
/* @__PURE__ */ React.createElement(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
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
|
-
|
|
495
|
-
|
|
496
|
-
titlePlaceholderContent: props.placeholder,
|
|
497
|
-
toc: false,
|
|
498
|
-
pasteConfig: props.pasteConfig
|
|
499
|
-
}, markdownProps)
|
|
500
|
-
))
|
|
501
|
-
),
|
|
502
|
-
props.toolsRender ? /* @__PURE__ */ React.createElement(
|
|
475
|
+
/* @__PURE__ */ React.createElement(
|
|
476
|
+
"div",
|
|
477
|
+
{
|
|
478
|
+
className: classNames(`${baseCls}-editor-content`, hashId)
|
|
479
|
+
},
|
|
480
|
+
attachmentList,
|
|
481
|
+
/* @__PURE__ */ React.createElement(
|
|
482
|
+
BaseMarkdownEditor,
|
|
483
|
+
__spreadValues({
|
|
484
|
+
editorRef: markdownEditorRef,
|
|
485
|
+
leafRender: props.leafRender,
|
|
486
|
+
style: {
|
|
487
|
+
width: "100%",
|
|
488
|
+
flex: 1,
|
|
489
|
+
padding: 0,
|
|
490
|
+
paddingRight: computedRightPadding
|
|
491
|
+
},
|
|
492
|
+
toolBar: {
|
|
493
|
+
enable: false
|
|
494
|
+
},
|
|
495
|
+
floatBar: {
|
|
496
|
+
enable: false
|
|
497
|
+
},
|
|
498
|
+
readonly: isLoading,
|
|
499
|
+
contentStyle: {
|
|
500
|
+
padding: "var(--padding-card-base)"
|
|
501
|
+
},
|
|
502
|
+
textAreaProps: {
|
|
503
|
+
enable: true,
|
|
504
|
+
placeholder: props.placeholder,
|
|
505
|
+
triggerSendKey: props.triggerSendKey || "Enter"
|
|
506
|
+
},
|
|
507
|
+
tagInputProps: __spreadValues({
|
|
508
|
+
enable: true,
|
|
509
|
+
type: "dropdown"
|
|
510
|
+
}, tagInputProps),
|
|
511
|
+
initValue: props.value,
|
|
512
|
+
onChange: (value2) => {
|
|
513
|
+
var _a3;
|
|
514
|
+
setValue(value2);
|
|
515
|
+
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, value2);
|
|
516
|
+
},
|
|
517
|
+
onFocus: (value2, schema, e) => {
|
|
518
|
+
onFocus == null ? void 0 : onFocus(value2, schema, e);
|
|
519
|
+
activeInput(true);
|
|
520
|
+
},
|
|
521
|
+
onBlur: (value2, schema, e) => {
|
|
522
|
+
onBlur == null ? void 0 : onBlur(value2, schema, e);
|
|
523
|
+
activeInput(false);
|
|
524
|
+
},
|
|
525
|
+
onPaste: (e) => {
|
|
526
|
+
handlePaste(e);
|
|
527
|
+
},
|
|
528
|
+
titlePlaceholderContent: props.placeholder,
|
|
529
|
+
toc: false,
|
|
530
|
+
pasteConfig: props.pasteConfig
|
|
531
|
+
}, markdownProps)
|
|
532
|
+
)
|
|
533
|
+
)
|
|
534
|
+
), props.toolsRender ? /* @__PURE__ */ React.createElement(
|
|
503
535
|
"div",
|
|
504
536
|
{
|
|
505
537
|
style: {
|
|
538
|
+
backgroundColor: "#fff",
|
|
506
539
|
display: "flex",
|
|
507
540
|
boxSizing: "border-box",
|
|
541
|
+
borderBottomLeftRadius: (borderRadius || 16) - 2 || 10,
|
|
542
|
+
borderBottomRightRadius: (borderRadius || 16) - 2 || 10,
|
|
508
543
|
flexDirection: "row",
|
|
509
544
|
alignItems: "center",
|
|
510
545
|
justifyContent: "space-between",
|
|
511
546
|
gap: 8,
|
|
512
547
|
width: "100%",
|
|
513
|
-
paddingRight:
|
|
514
|
-
paddingLeft:
|
|
515
|
-
paddingBottom:
|
|
548
|
+
paddingRight: "var(--padding-card-base)",
|
|
549
|
+
paddingLeft: "var(--padding-card-base)",
|
|
550
|
+
paddingBottom: "var(--padding-card-base)"
|
|
516
551
|
}
|
|
517
552
|
},
|
|
518
|
-
|
|
553
|
+
/* @__PURE__ */ React.createElement(
|
|
519
554
|
"div",
|
|
520
555
|
{
|
|
521
556
|
ref: actionsRef,
|
|
522
557
|
contentEditable: false,
|
|
523
558
|
className: classNames(`${baseCls}-send-tools`, hashId)
|
|
524
559
|
},
|
|
525
|
-
props.toolsRender
|
|
560
|
+
props.toolsRender(__spreadProps(__spreadValues({
|
|
526
561
|
value,
|
|
527
562
|
fileMap,
|
|
528
563
|
onFileMapChange: setFileMap
|
|
@@ -530,77 +565,10 @@ var MarkdownInputField = (_a) => {
|
|
|
530
565
|
isHover,
|
|
531
566
|
isLoading,
|
|
532
567
|
fileUploadStatus: fileUploadDone ? "done" : "uploading"
|
|
533
|
-
}))
|
|
534
|
-
)
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
{
|
|
538
|
-
attachment: __spreadProps(__spreadValues({}, props.attachment), {
|
|
539
|
-
supportedFormat,
|
|
540
|
-
fileMap,
|
|
541
|
-
onFileMapChange: setFileMap,
|
|
542
|
-
upload: ((_h = props.attachment) == null ? void 0 : _h.upload) ? (file) => props.attachment.upload(file, 0) : void 0
|
|
543
|
-
}),
|
|
544
|
-
voiceRecognizer: props.voiceRecognizer,
|
|
545
|
-
value,
|
|
546
|
-
disabled: props.disabled,
|
|
547
|
-
typing: props.typing,
|
|
548
|
-
isLoading,
|
|
549
|
-
fileUploadDone,
|
|
550
|
-
recording,
|
|
551
|
-
collapseSendActions,
|
|
552
|
-
allowEmptySubmit: props.allowEmptySubmit,
|
|
553
|
-
uploadImage,
|
|
554
|
-
onStartRecording: startRecording,
|
|
555
|
-
onStopRecording: stopRecording,
|
|
556
|
-
onSend: sendMessage,
|
|
557
|
-
onStop: () => {
|
|
558
|
-
var _a3;
|
|
559
|
-
setIsLoading(false);
|
|
560
|
-
(_a3 = props.onStop) == null ? void 0 : _a3.call(props);
|
|
561
|
-
},
|
|
562
|
-
actionsRender: props.actionsRender,
|
|
563
|
-
prefixCls: baseCls,
|
|
564
|
-
hashId,
|
|
565
|
-
hasTools: !!props.toolsRender,
|
|
566
|
-
onResize: setRightPadding
|
|
567
|
-
}
|
|
568
|
-
)
|
|
569
|
-
) : /* @__PURE__ */ React.createElement(
|
|
570
|
-
SendActions,
|
|
571
|
-
{
|
|
572
|
-
attachment: __spreadProps(__spreadValues({}, props.attachment), {
|
|
573
|
-
supportedFormat,
|
|
574
|
-
fileMap,
|
|
575
|
-
onFileMapChange: setFileMap,
|
|
576
|
-
upload: ((_i = props.attachment) == null ? void 0 : _i.upload) ? (file) => props.attachment.upload(file, 0) : void 0
|
|
577
|
-
}),
|
|
578
|
-
voiceRecognizer: props.voiceRecognizer,
|
|
579
|
-
value,
|
|
580
|
-
disabled: props.disabled,
|
|
581
|
-
typing: props.typing,
|
|
582
|
-
isLoading,
|
|
583
|
-
fileUploadDone,
|
|
584
|
-
recording,
|
|
585
|
-
collapseSendActions,
|
|
586
|
-
allowEmptySubmit: props.allowEmptySubmit,
|
|
587
|
-
uploadImage,
|
|
588
|
-
onStartRecording: startRecording,
|
|
589
|
-
onStopRecording: stopRecording,
|
|
590
|
-
onSend: sendMessage,
|
|
591
|
-
onStop: () => {
|
|
592
|
-
var _a3;
|
|
593
|
-
setIsLoading(false);
|
|
594
|
-
(_a3 = props.onStop) == null ? void 0 : _a3.call(props);
|
|
595
|
-
},
|
|
596
|
-
actionsRender: props.actionsRender,
|
|
597
|
-
prefixCls: baseCls,
|
|
598
|
-
hashId,
|
|
599
|
-
hasTools: !!props.toolsRender,
|
|
600
|
-
onResize: setRightPadding
|
|
601
|
-
}
|
|
602
|
-
),
|
|
603
|
-
(props == null ? void 0 : props.quickActionRender) || ((_j = props.refinePrompt) == null ? void 0 : _j.enable) ? /* @__PURE__ */ React.createElement(
|
|
568
|
+
}))
|
|
569
|
+
),
|
|
570
|
+
sendActionsNode
|
|
571
|
+
) : sendActionsNode, (props == null ? void 0 : props.quickActionRender) || ((_m = props.refinePrompt) == null ? void 0 : _m.enable) ? /* @__PURE__ */ React.createElement(
|
|
604
572
|
QuickActions,
|
|
605
573
|
{
|
|
606
574
|
ref: quickActionsRef,
|
|
@@ -621,7 +589,7 @@ var MarkdownInputField = (_a) => {
|
|
|
621
589
|
quickActionRender: props.quickActionRender,
|
|
622
590
|
prefixCls: baseCls,
|
|
623
591
|
hashId,
|
|
624
|
-
enlargeable: props.enlargeable,
|
|
592
|
+
enlargeable: !!((_n = props.enlargeable) == null ? void 0 : _n.enable),
|
|
625
593
|
isEnlarged,
|
|
626
594
|
onEnlargeClick: handleEnlargeClick,
|
|
627
595
|
onResize: (width, rightOffset) => {
|
|
@@ -629,7 +597,7 @@ var MarkdownInputField = (_a) => {
|
|
|
629
597
|
setQuickRightOffset(rightOffset);
|
|
630
598
|
}
|
|
631
599
|
}
|
|
632
|
-
) : null
|
|
600
|
+
) : null)
|
|
633
601
|
)
|
|
634
602
|
)
|
|
635
603
|
))
|