@ant-design/agentic-ui 2.30.14 → 2.30.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 -2
- package/dist/Bubble/ContentFilemapView.d.ts +2 -0
- package/dist/Bubble/ContentFilemapView.js +9 -6
- package/dist/Bubble/MessagesContent/index.js +7 -7
- package/dist/Bubble/UserBubble.js +2 -1
- package/dist/Hooks/useLanguage.d.ts +3 -1
- package/dist/I18n/locales.d.ts +3 -1
- package/dist/I18n/locales.js +8 -4
- package/dist/MarkdownEditor/editor/elements/Code/ReadonlyCode.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Code/index.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.d.ts +1 -6
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +2 -13
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +2 -1
- package/dist/MarkdownInputField/AttachmentButton/index.d.ts +30 -0
- package/dist/MarkdownInputField/AttachmentButton/index.js +22 -6
- package/dist/MarkdownInputField/AttachmentButton/utils.d.ts +3 -6
- package/dist/MarkdownInputField/FileMapView/index.js +1 -7
- package/dist/MarkdownInputField/FileMapView/style.js +1 -2
- package/dist/MarkdownInputField/FileUploadManager/index.js +36 -21
- package/dist/MarkdownInputField/MarkdownInputField.js +18 -6
- package/dist/MarkdownInputField/SendActions/index.js +2 -2
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.d.ts +1 -0
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.js +21 -0
- package/dist/MarkdownInputField/style.js +26 -2
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +4 -4
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.js +1 -1
- package/dist/Plugins/chart/ChartRender.js +3 -1
- package/dist/Plugins/chart/DonutChart/index.js +1 -1
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +6 -2
- package/dist/Workspace/File/FileComponent.js +178 -103
- package/dist/Workspace/File/style.js +20 -0
- package/package.json +1 -1
|
@@ -416,30 +416,32 @@ import { isMobileDevice, isVivoOrOppoDevice, isWeChat } from "../AttachmentButto
|
|
|
416
416
|
* 处理文件重试
|
|
417
417
|
*/ var handleFileRetry = useRefFunction(function(file) {
|
|
418
418
|
return _async_to_generator(function() {
|
|
419
|
-
var map, url, isSuccess, uploadResult, error,
|
|
419
|
+
var map, url, isSuccess, uploadResult, _attachment_onUploadError, error, _attachment_onUploadError1;
|
|
420
420
|
return _ts_generator(this, function(_state) {
|
|
421
421
|
switch(_state.label){
|
|
422
422
|
case 0:
|
|
423
|
+
map = new Map(fileMap);
|
|
424
|
+
_state.label = 1;
|
|
425
|
+
case 1:
|
|
423
426
|
_state.trys.push([
|
|
424
|
-
|
|
425
|
-
|
|
427
|
+
1,
|
|
428
|
+
6,
|
|
426
429
|
,
|
|
427
|
-
|
|
430
|
+
7
|
|
428
431
|
]);
|
|
429
432
|
file.status = 'uploading';
|
|
430
|
-
map = new Map(fileMap);
|
|
431
433
|
map.set(file.uuid || '', file);
|
|
432
434
|
updateAttachmentFiles(map);
|
|
433
435
|
isSuccess = false;
|
|
434
436
|
if (!(attachment === null || attachment === void 0 ? void 0 : attachment.uploadWithResponse)) return [
|
|
435
437
|
3,
|
|
436
|
-
|
|
438
|
+
3
|
|
437
439
|
];
|
|
438
440
|
return [
|
|
439
441
|
4,
|
|
440
442
|
attachment.uploadWithResponse(file, 0)
|
|
441
443
|
];
|
|
442
|
-
case
|
|
444
|
+
case 2:
|
|
443
445
|
uploadResult = _state.sent();
|
|
444
446
|
url = uploadResult.fileUrl;
|
|
445
447
|
isSuccess = uploadResult.uploadStatus === 'SUCCESS';
|
|
@@ -447,48 +449,61 @@ import { isMobileDevice, isVivoOrOppoDevice, isWeChat } from "../AttachmentButto
|
|
|
447
449
|
file.uploadResponse = uploadResult;
|
|
448
450
|
return [
|
|
449
451
|
3,
|
|
450
|
-
|
|
452
|
+
5
|
|
451
453
|
];
|
|
452
|
-
case
|
|
454
|
+
case 3:
|
|
453
455
|
if (!(attachment === null || attachment === void 0 ? void 0 : attachment.upload)) return [
|
|
454
456
|
3,
|
|
455
|
-
|
|
457
|
+
5
|
|
456
458
|
];
|
|
457
459
|
return [
|
|
458
460
|
4,
|
|
459
461
|
attachment.upload(file, 0)
|
|
460
462
|
];
|
|
461
|
-
case
|
|
463
|
+
case 4:
|
|
462
464
|
url = _state.sent();
|
|
463
465
|
isSuccess = !!url;
|
|
464
|
-
_state.label =
|
|
465
|
-
case
|
|
466
|
+
_state.label = 5;
|
|
467
|
+
case 5:
|
|
466
468
|
if (isSuccess && url) {
|
|
467
469
|
file.status = 'done';
|
|
468
470
|
file.url = url;
|
|
469
471
|
map.set(file.uuid || '', file);
|
|
470
472
|
updateAttachmentFiles(map);
|
|
471
473
|
} else {
|
|
474
|
+
;
|
|
472
475
|
file.status = 'error';
|
|
473
476
|
map.set(file.uuid || '', file);
|
|
474
477
|
updateAttachmentFiles(map);
|
|
478
|
+
attachment === null || attachment === void 0 ? void 0 : (_attachment_onUploadError = attachment.onUploadError) === null || _attachment_onUploadError === void 0 ? void 0 : _attachment_onUploadError.call(attachment, {
|
|
479
|
+
file: file,
|
|
480
|
+
error: null
|
|
481
|
+
});
|
|
475
482
|
}
|
|
476
483
|
return [
|
|
477
484
|
3,
|
|
478
|
-
|
|
485
|
+
7
|
|
479
486
|
];
|
|
480
|
-
case
|
|
487
|
+
case 6:
|
|
481
488
|
error = _state.sent();
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
489
|
+
if (attachment === null || attachment === void 0 ? void 0 : attachment.removeFileOnUploadError) {
|
|
490
|
+
map.delete(file.uuid || '');
|
|
491
|
+
updateAttachmentFiles(map);
|
|
492
|
+
} else {
|
|
493
|
+
file.status = 'error';
|
|
494
|
+
map.set(file.uuid || '', file);
|
|
495
|
+
updateAttachmentFiles(map);
|
|
496
|
+
}
|
|
497
|
+
attachment === null || attachment === void 0 ? void 0 : (_attachment_onUploadError1 = attachment.onUploadError) === null || _attachment_onUploadError1 === void 0 ? void 0 : _attachment_onUploadError1.call(attachment, {
|
|
498
|
+
file: file,
|
|
499
|
+
error: error
|
|
500
|
+
});
|
|
486
501
|
console.error('Error retrying file upload:', error);
|
|
487
502
|
return [
|
|
488
503
|
3,
|
|
489
|
-
|
|
504
|
+
7
|
|
490
505
|
];
|
|
491
|
-
case
|
|
506
|
+
case 7:
|
|
492
507
|
return [
|
|
493
508
|
2
|
|
494
509
|
];
|
|
@@ -135,6 +135,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
135
135
|
import { ConfigProvider } from "antd";
|
|
136
136
|
import classNames from "clsx";
|
|
137
137
|
import React, { memo, useContext, useState } from "react";
|
|
138
|
+
import { TextLoading } from "../Components/lotties/TextLoading";
|
|
139
|
+
import { useLocale } from "../I18n";
|
|
138
140
|
import { BaseMarkdownEditor } from "../MarkdownEditor";
|
|
139
141
|
import { BorderBeamAnimation } from "./BorderBeamAnimation";
|
|
140
142
|
import { useFileUploadManager } from "./FileUploadManager";
|
|
@@ -167,7 +169,7 @@ import { useVoiceInputManager } from "./VoiceInputManager";
|
|
|
167
169
|
* @param {string} [props.placeholder] - 占位符文本
|
|
168
170
|
* @param {string} [props.triggerSendKey='Enter'] - 触发发送的快捷键(Enter 发送,Shift+Enter 换行)
|
|
169
171
|
* @param {boolean} [props.disabled] - 是否禁用
|
|
170
|
-
* @param {boolean} [props.typing] -
|
|
172
|
+
* @param {boolean} [props.typing] - AI 回复中等场景下为 true,输入区只读并显示提示
|
|
171
173
|
* @param {AttachmentProps} [props.attachment] - 附件配置
|
|
172
174
|
* @param {string[]} [props.bgColorList] - 背景颜色列表,推荐使用3-4种颜色
|
|
173
175
|
* @param {React.RefObject} [props.inputRef] - 输入框引用
|
|
@@ -213,6 +215,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
213
215
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
214
216
|
var baseCls = getPrefixCls('agentic-md-input-field');
|
|
215
217
|
var _useStyle = useStyle(baseCls, props.disableHoverAnimation), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
218
|
+
var locale = useLocale();
|
|
216
219
|
// 状态管理
|
|
217
220
|
var _useMarkdownInputFieldState = useMarkdownInputFieldState({
|
|
218
221
|
value: props.value,
|
|
@@ -290,7 +293,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
290
293
|
stopRecording: stopRecording,
|
|
291
294
|
isEnlarged: isEnlarged,
|
|
292
295
|
setIsEnlarged: setIsEnlarged
|
|
293
|
-
}), handleEnlargeClick = _useMarkdownInputFieldHandlers.handleEnlargeClick, sendMessage = _useMarkdownInputFieldHandlers.sendMessage, handlePaste = _useMarkdownInputFieldHandlers.handlePaste, handleKeyDown = _useMarkdownInputFieldHandlers.handleKeyDown, activeInput = _useMarkdownInputFieldHandlers.activeInput;
|
|
296
|
+
}), handleEnlargeClick = _useMarkdownInputFieldHandlers.handleEnlargeClick, sendMessage = _useMarkdownInputFieldHandlers.sendMessage, handlePaste = _useMarkdownInputFieldHandlers.handlePaste, handleKeyDown = _useMarkdownInputFieldHandlers.handleKeyDown, handleContainerClick = _useMarkdownInputFieldHandlers.handleContainerClick, activeInput = _useMarkdownInputFieldHandlers.activeInput;
|
|
294
297
|
// 渲染辅助
|
|
295
298
|
var attachmentList = useAttachmentList({
|
|
296
299
|
attachment: attachment,
|
|
@@ -305,6 +308,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
305
308
|
isHover: isHover,
|
|
306
309
|
isLoading: isLoading
|
|
307
310
|
});
|
|
311
|
+
var editorReadonly = isLoading || !!props.typing;
|
|
308
312
|
var sendActionsNode = useSendActionsNode({
|
|
309
313
|
props: {
|
|
310
314
|
attachment: attachment,
|
|
@@ -356,7 +360,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
356
360
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
357
361
|
ref: inputRef,
|
|
358
362
|
"data-testid": testId !== null && testId !== void 0 ? testId : MARKDOWN_INPUT_FIELD_TEST_IDS.ROOT,
|
|
359
|
-
className: classNames(baseCls, hashId, props.className, (_obj = {}, _define_property(_obj, "".concat(baseCls, "-disabled"), props.disabled), _define_property(_obj, "".concat(baseCls, "-skill-mode"), (_props_skillMode = props.skillMode) === null || _props_skillMode === void 0 ? void 0 : _props_skillMode.open), _define_property(_obj, "".concat(baseCls, "-typing"),
|
|
363
|
+
className: classNames(baseCls, hashId, props.className, (_obj = {}, _define_property(_obj, "".concat(baseCls, "-disabled"), props.disabled), _define_property(_obj, "".concat(baseCls, "-skill-mode"), (_props_skillMode = props.skillMode) === null || _props_skillMode === void 0 ? void 0 : _props_skillMode.open), _define_property(_obj, "".concat(baseCls, "-typing"), !!props.typing), _define_property(_obj, "".concat(baseCls, "-loading"), isLoading), _define_property(_obj, "".concat(baseCls, "-is-multi-row"), isMultiRowLayout), _define_property(_obj, "".concat(baseCls, "-enlarged"), isEnlarged), _define_property(_obj, "".concat(baseCls, "-focused"), isFocused), _define_property(_obj, "".concat(baseCls, "-has-tools-wrapper"), !!props.toolsRender), _obj)),
|
|
360
364
|
style: _object_spread_props(_object_spread({}, props.style, enlargedStyle), {
|
|
361
365
|
height: isEnlarged ? "".concat((_ref = (_props_enlargeable = props.enlargeable) === null || _props_enlargeable === void 0 ? void 0 : _props_enlargeable.height) !== null && _ref !== void 0 ? _ref : 980, "px") : "min(".concat(collapsedHeightPx, "px,100%)"),
|
|
362
366
|
borderRadius: borderRadius || 12,
|
|
@@ -370,6 +374,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
370
374
|
onMouseLeave: function onMouseLeave() {
|
|
371
375
|
return setHover(false);
|
|
372
376
|
},
|
|
377
|
+
onClick: handleContainerClick,
|
|
373
378
|
onKeyDown: handleKeyDown
|
|
374
379
|
}, /*#__PURE__*/ React.createElement(BorderBeamAnimation, {
|
|
375
380
|
isVisible: isFocused && !animationComplete,
|
|
@@ -396,7 +401,14 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
396
401
|
}), /*#__PURE__*/ React.createElement("div", {
|
|
397
402
|
className: classNames("".concat(baseCls, "-editor-content"), hashId),
|
|
398
403
|
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.EDITOR_CONTENT
|
|
399
|
-
}, attachmentList, /*#__PURE__*/ React.createElement(
|
|
404
|
+
}, attachmentList, (props.typing || isLoading) && !value && /*#__PURE__*/ React.createElement("div", {
|
|
405
|
+
className: classNames("".concat(baseCls, "-typing-hint"), hashId),
|
|
406
|
+
"aria-live": "polite",
|
|
407
|
+
"aria-label": locale['input.typing.hint']
|
|
408
|
+
}, /*#__PURE__*/ React.createElement(TextLoading, {
|
|
409
|
+
text: locale['input.typing.hint'],
|
|
410
|
+
fontSize: 13
|
|
411
|
+
})), /*#__PURE__*/ React.createElement(BaseMarkdownEditor, _object_spread({
|
|
400
412
|
editorRef: markdownEditorRef,
|
|
401
413
|
leafRender: props.leafRender,
|
|
402
414
|
style: {
|
|
@@ -411,7 +423,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
411
423
|
floatBar: {
|
|
412
424
|
enable: false
|
|
413
425
|
},
|
|
414
|
-
readonly:
|
|
426
|
+
readonly: editorReadonly,
|
|
415
427
|
contentStyle: {
|
|
416
428
|
alignItems: 'flex-start',
|
|
417
429
|
padding: 'var(--padding-3x)',
|
|
@@ -474,7 +486,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
474
486
|
onFileMapChange: setFileMap,
|
|
475
487
|
isHover: isHover,
|
|
476
488
|
isLoading: isLoading,
|
|
477
|
-
disabled: props.disabled,
|
|
489
|
+
disabled: props.disabled || !!props.typing,
|
|
478
490
|
fileUploadStatus: fileUploadStatus,
|
|
479
491
|
refinePrompt: props.refinePrompt,
|
|
480
492
|
editorRef: markdownEditorRef,
|
|
@@ -90,13 +90,13 @@ import { MARKDOWN_INPUT_FIELD_TEST_IDS } from "../testIds";
|
|
|
90
90
|
var _attachment_onFileMapChange;
|
|
91
91
|
attachment === null || attachment === void 0 ? void 0 : (_attachment_onFileMapChange = attachment.onFileMapChange) === null || _attachment_onFileMapChange === void 0 ? void 0 : _attachment_onFileMapChange.call(attachment, fileMap);
|
|
92
92
|
},
|
|
93
|
-
disabled: !fileUploadDone || (attachment === null || attachment === void 0 ? void 0 : attachment.disabled)
|
|
93
|
+
disabled: !fileUploadDone || (attachment === null || attachment === void 0 ? void 0 : attachment.disabled) || !!typing
|
|
94
94
|
})) : null,
|
|
95
95
|
voiceRecognizer ? /*#__PURE__*/ React.createElement(VoiceInputButton, {
|
|
96
96
|
key: "voice-input-button",
|
|
97
97
|
title: collapseSendActions && defaultActionsLen > 2 ? (locale === null || locale === void 0 ? void 0 : locale['input.voiceInput']) || '语音输入' : '',
|
|
98
98
|
recording: recording,
|
|
99
|
-
disabled: disabled,
|
|
99
|
+
disabled: disabled || !!typing,
|
|
100
100
|
onStart: onStartRecording || function() {
|
|
101
101
|
return Promise.resolve();
|
|
102
102
|
},
|
|
@@ -27,6 +27,7 @@ export declare const useMarkdownInputFieldHandlers: ({ props, markdownEditorRef,
|
|
|
27
27
|
sendMessage: () => Promise<void>;
|
|
28
28
|
handlePaste: (e: React.ClipboardEvent<HTMLDivElement>) => Promise<void>;
|
|
29
29
|
handleKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
30
|
+
handleContainerClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
30
31
|
activeInput: (active: boolean) => void;
|
|
31
32
|
};
|
|
32
33
|
export {};
|
|
@@ -179,7 +179,9 @@ function _ts_generator(thisArg, body) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
import { Editor, Transforms } from "slate";
|
|
182
|
+
import { ReactEditor } from "slate-react";
|
|
182
183
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
184
|
+
import { EditorUtils } from "../../MarkdownEditor/editor/utils/editorUtils";
|
|
183
185
|
import { upLoadFileToServer } from "../AttachmentButton";
|
|
184
186
|
import { isMobileDevice } from "../AttachmentButton/utils";
|
|
185
187
|
import { getFileListFromDataTransferItems } from "../FilePaste";
|
|
@@ -384,6 +386,24 @@ import { getFileListFromDataTransferItems } from "../FilePaste";
|
|
|
384
386
|
// 这里不需要显式 return,函数结束自然会继续执行(但这里是 void,所以 return 也无妨)
|
|
385
387
|
// 注意:上面的 return 是阻止了默认行为并发送,这里的 implicit return 是允许默认行为(换行)
|
|
386
388
|
});
|
|
389
|
+
var handleContainerClick = useRefFunction(function(e) {
|
|
390
|
+
var _markdownEditorRef_current_markdownEditorRef, _markdownEditorRef_current;
|
|
391
|
+
if (props.disabled) return;
|
|
392
|
+
if (props.typing) return;
|
|
393
|
+
var editor = markdownEditorRef === null || markdownEditorRef === void 0 ? void 0 : (_markdownEditorRef_current = markdownEditorRef.current) === null || _markdownEditorRef_current === void 0 ? void 0 : (_markdownEditorRef_current_markdownEditorRef = _markdownEditorRef_current.markdownEditorRef) === null || _markdownEditorRef_current_markdownEditorRef === void 0 ? void 0 : _markdownEditorRef_current_markdownEditorRef.current;
|
|
394
|
+
if (!editor) return;
|
|
395
|
+
try {
|
|
396
|
+
if (ReactEditor.isFocused(editor)) return;
|
|
397
|
+
} catch (unused) {
|
|
398
|
+
// ignore
|
|
399
|
+
}
|
|
400
|
+
var target = e.target;
|
|
401
|
+
var isInteractive = target.closest('button') || target.closest('a') || target.closest('input') || target.closest('[contenteditable="true"]');
|
|
402
|
+
if (isInteractive) return;
|
|
403
|
+
EditorUtils.focus(editor);
|
|
404
|
+
var end = Editor.end(editor, []);
|
|
405
|
+
Transforms.select(editor, end);
|
|
406
|
+
});
|
|
387
407
|
var activeInput = useRefFunction(function(active) {
|
|
388
408
|
if (inputRef.current) {
|
|
389
409
|
if (active) {
|
|
@@ -402,6 +422,7 @@ import { getFileListFromDataTransferItems } from "../FilePaste";
|
|
|
402
422
|
sendMessage: sendMessage,
|
|
403
423
|
handlePaste: handlePaste,
|
|
404
424
|
handleKeyDown: handleKeyDown,
|
|
425
|
+
handleContainerClick: handleContainerClick,
|
|
405
426
|
activeInput: activeInput
|
|
406
427
|
};
|
|
407
428
|
};
|
|
@@ -174,6 +174,7 @@ var genStyle = function genStyle(token) {
|
|
|
174
174
|
maxHeight: 400,
|
|
175
175
|
height: '100%',
|
|
176
176
|
overflowY: 'visible',
|
|
177
|
+
cursor: 'text',
|
|
177
178
|
scrollbarColor: 'var(--color-gray-text-tertiary, #505c716b) transparent',
|
|
178
179
|
scrollbarWidth: 'thin',
|
|
179
180
|
'&&-disabled': {
|
|
@@ -186,7 +187,7 @@ var genStyle = function genStyle(token) {
|
|
|
186
187
|
}
|
|
187
188
|
},
|
|
188
189
|
// 仅覆盖 MarkdownInputField 内的代码块默认高度
|
|
189
|
-
'& [data-language][data-is-unclosed]': {
|
|
190
|
+
'& [data-language][data-is-unclosed="true"]': {
|
|
190
191
|
height: "".concat(DEFAULT_INPUT_CODE_BLOCK_HEIGHT, "px !important"),
|
|
191
192
|
minHeight: "".concat(DEFAULT_INPUT_CODE_BLOCK_HEIGHT, "px !important")
|
|
192
193
|
},
|
|
@@ -197,7 +198,8 @@ var genStyle = function genStyle(token) {
|
|
|
197
198
|
maxHeight: 'inherit',
|
|
198
199
|
minHeight: 0,
|
|
199
200
|
borderRadius: 'inherit',
|
|
200
|
-
overflow: 'hidden'
|
|
201
|
+
overflow: 'hidden',
|
|
202
|
+
position: 'relative'
|
|
201
203
|
}, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
|
|
202
204
|
padding: "".concat(MOBILE_PADDING, " !important")
|
|
203
205
|
}),
|
|
@@ -214,6 +216,28 @@ var genStyle = function genStyle(token) {
|
|
|
214
216
|
'&-loading': {
|
|
215
217
|
cursor: 'not-allowed'
|
|
216
218
|
},
|
|
219
|
+
'&-typing': {
|
|
220
|
+
cursor: 'not-allowed'
|
|
221
|
+
},
|
|
222
|
+
'&-typing-hint': {
|
|
223
|
+
position: 'absolute',
|
|
224
|
+
left: 'var(--padding-3x)',
|
|
225
|
+
top: '50%',
|
|
226
|
+
transform: 'translateY(-50%)',
|
|
227
|
+
pointerEvents: 'none',
|
|
228
|
+
zIndex: 10,
|
|
229
|
+
display: 'flex',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
gap: 6,
|
|
232
|
+
color: 'rgba(0,0,0,0.35)',
|
|
233
|
+
fontSize: 13,
|
|
234
|
+
userSelect: 'none'
|
|
235
|
+
},
|
|
236
|
+
'&-typing-hint-dots': {
|
|
237
|
+
display: 'inline-flex',
|
|
238
|
+
gap: 3,
|
|
239
|
+
alignItems: 'center'
|
|
240
|
+
},
|
|
217
241
|
'&-send-tools': {
|
|
218
242
|
boxSizing: 'border-box',
|
|
219
243
|
display: 'flex',
|
|
@@ -14,7 +14,7 @@ import type { CreateRecognizer } from '../VoiceInput';
|
|
|
14
14
|
* @property {React.CSSProperties} [style] - 应用于输入字段的内联样式
|
|
15
15
|
* @property {string} [className] - 应用于输入字段的 CSS 类名
|
|
16
16
|
* @property {boolean} [disabled] - 是否禁用输入字段
|
|
17
|
-
* @property {boolean} [typing] -
|
|
17
|
+
* @property {boolean} [typing] - AI 回复中等场景下为 true,输入区只读并显示提示
|
|
18
18
|
* @property {'Enter'} [triggerSendKey] - 触发发送操作的键盘快捷键(Enter 发送,Shift+Enter 换行)
|
|
19
19
|
* @property {function} [onSend] - 当内容发送时触发的异步回调函数
|
|
20
20
|
*/
|
|
@@ -51,8 +51,8 @@ export type MarkdownInputFieldProps = {
|
|
|
51
51
|
*/
|
|
52
52
|
disabled?: boolean;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @example typing={
|
|
54
|
+
* 为 true 时表示 AI 正在回复等场景:输入区只读、展示 typing 提示,且不可上传附件或语音输入。
|
|
55
|
+
* @example typing={isAssistantStreaming}
|
|
56
56
|
*/
|
|
57
57
|
typing?: boolean;
|
|
58
58
|
/**
|
|
@@ -112,7 +112,7 @@ export type MarkdownInputFieldProps = {
|
|
|
112
112
|
* attachment={{
|
|
113
113
|
* enable: true,
|
|
114
114
|
* accept: '.pdf,.doc,.docx',
|
|
115
|
-
*
|
|
115
|
+
* maxFileSize: 10 * 1024 * 1024, // 10MB(字节)
|
|
116
116
|
* onUpload: async (file) => {
|
|
117
117
|
* const url = await uploadFile(file);
|
|
118
118
|
* return { url };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @property {React.CSSProperties} [style] - 应用于输入字段的内联样式
|
|
9
9
|
* @property {string} [className] - 应用于输入字段的 CSS 类名
|
|
10
10
|
* @property {boolean} [disabled] - 是否禁用输入字段
|
|
11
|
-
* @property {boolean} [typing] -
|
|
11
|
+
* @property {boolean} [typing] - AI 回复中等场景下为 true,输入区只读并显示提示
|
|
12
12
|
* @property {'Enter'} [triggerSendKey] - 触发发送操作的键盘快捷键(Enter 发送,Shift+Enter 换行)
|
|
13
13
|
* @property {function} [onSend] - 当内容发送时触发的异步回调函数
|
|
14
14
|
*/ export { };
|
|
@@ -408,6 +408,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
|
|
|
408
408
|
var i18n = useContext(I18nContext);
|
|
409
409
|
var DonutChart = runtime.DonutChart, FunnelChart = runtime.FunnelChart, AreaChart = runtime.AreaChart, BarChart = runtime.BarChart, BoxPlotChart = runtime.BoxPlotChart, HistogramChart = runtime.HistogramChart, LineChart = runtime.LineChart, RadarChart = runtime.RadarChart, ScatterChart = runtime.ScatterChart;
|
|
410
410
|
if (chartType === 'pie') {
|
|
411
|
+
var pieSize = (config === null || config === void 0 ? void 0 : config.height) || 400;
|
|
411
412
|
return /*#__PURE__*/ React.createElement(DonutChart, {
|
|
412
413
|
key: "".concat(config === null || config === void 0 ? void 0 : config.index, "-pie"),
|
|
413
414
|
data: convertDonutData,
|
|
@@ -417,7 +418,8 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
|
|
|
417
418
|
showLegend: true
|
|
418
419
|
}
|
|
419
420
|
],
|
|
420
|
-
|
|
421
|
+
width: pieSize,
|
|
422
|
+
height: pieSize,
|
|
421
423
|
title: title,
|
|
422
424
|
showToolbar: true,
|
|
423
425
|
dataTime: dataTime,
|
|
@@ -578,7 +578,7 @@ import { useStyle } from "./style";
|
|
|
578
578
|
'transparent'
|
|
579
579
|
] : resolvedVisibleBackgroundColors.slice(0, values.length),
|
|
580
580
|
hoverBorderColor: chartHoverBorderColor,
|
|
581
|
-
borderWidth: cfg.chartStyle === 'pie' ?
|
|
581
|
+
borderWidth: cfg.chartStyle === 'pie' ? 2 : isMobile ? 1 : 1,
|
|
582
582
|
spacing: isSingleValueMode ? 0 : cfg.chartStyle === 'pie' ? 0 : isDarkTheme ? isMobile ? 4 : 8 : isMobile ? 3 : 6,
|
|
583
583
|
borderRadius: cfg.chartStyle === 'pie' ? 0 : 4,
|
|
584
584
|
hoverOffset: function hoverOffset(ctx) {
|
|
@@ -308,6 +308,8 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
308
308
|
'workspace.fileProcessError': string;
|
|
309
309
|
'workspace.download': string;
|
|
310
310
|
'workspace.empty': string;
|
|
311
|
+
'workspace.file.showMore': string;
|
|
312
|
+
'workspace.file.showMoreFiles': string;
|
|
311
313
|
'workspace.title': string;
|
|
312
314
|
'workspace.searchPlaceholder': string;
|
|
313
315
|
'workspace.noResultsFor': string;
|
|
@@ -352,7 +354,6 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
352
354
|
'suggestion.followUp': string;
|
|
353
355
|
'input.fileUpload': string;
|
|
354
356
|
'input.attachmentListTitle': string;
|
|
355
|
-
'chat.fileMapTitle': string;
|
|
356
357
|
'input.voiceInput': string;
|
|
357
358
|
'input.voiceInputting': string;
|
|
358
359
|
'input.placeholder': string;
|
|
@@ -364,6 +365,7 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
364
365
|
'input.sendButtonTooltip.newline': string;
|
|
365
366
|
'input.sendButtonTooltip.send.mod': string;
|
|
366
367
|
'input.sendButtonTooltip.newline.mod': string;
|
|
368
|
+
'input.typing.hint': string;
|
|
367
369
|
'common.name': string;
|
|
368
370
|
'common.updateTime': string;
|
|
369
371
|
'common.type': string;
|
|
@@ -704,6 +706,8 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
704
706
|
'workspace.fileProcessError': string;
|
|
705
707
|
'workspace.download': string;
|
|
706
708
|
'workspace.empty': string;
|
|
709
|
+
'workspace.file.showMore': string;
|
|
710
|
+
'workspace.file.showMoreFiles': string;
|
|
707
711
|
'workspace.title': string;
|
|
708
712
|
'workspace.searchPlaceholder': string;
|
|
709
713
|
'workspace.noResultsFor': string;
|
|
@@ -748,7 +752,6 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
748
752
|
'suggestion.followUp': string;
|
|
749
753
|
'input.fileUpload': string;
|
|
750
754
|
'input.attachmentListTitle': string;
|
|
751
|
-
'chat.fileMapTitle': string;
|
|
752
755
|
'input.voiceInput': string;
|
|
753
756
|
'input.voiceInputting': string;
|
|
754
757
|
'input.placeholder': string;
|
|
@@ -760,6 +763,7 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
760
763
|
'input.sendButtonTooltip.newline': string;
|
|
761
764
|
'input.sendButtonTooltip.send.mod': string;
|
|
762
765
|
'input.sendButtonTooltip.newline.mod': string;
|
|
766
|
+
'input.typing.hint': string;
|
|
763
767
|
'common.name': string;
|
|
764
768
|
'common.updateTime': string;
|
|
765
769
|
'common.type': string;
|