@ant-design/agentic-ui 2.29.53 → 2.29.54
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/Hooks/useElementSize.js +0 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.d.ts +2 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.js +3 -2
- package/dist/MarkdownInputField/MarkdownInputField.js +21 -13
- package/dist/MarkdownInputField/QuickActions/index.js +3 -1
- package/dist/MarkdownInputField/SendActions/index.js +5 -2
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldStyles.d.ts +2 -2
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldStyles.js +3 -3
- package/dist/MarkdownInputField/testIds.d.ts +28 -0
- package/dist/MarkdownInputField/testIds.js +16 -0
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +5 -0
- package/dist/MarkdownInputField/utils/renderHelpers.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -54,7 +54,6 @@ export var useElementSize = function useElementSize(element) {
|
|
|
54
54
|
if (!element.current) return;
|
|
55
55
|
var resizeObserver = new ResizeObserver(function(entries) {
|
|
56
56
|
var entry = entries[0];
|
|
57
|
-
console.log(entry);
|
|
58
57
|
setSize({
|
|
59
58
|
width: entry.borderBoxSize[0].inlineSize,
|
|
60
59
|
height: entry.borderBoxSize[0].blockSize
|
|
@@ -7,5 +7,7 @@ export type AttachmentFileListProps = {
|
|
|
7
7
|
onDownload?: (file: AttachmentFile) => void;
|
|
8
8
|
onRetry?: (file: AttachmentFile) => void;
|
|
9
9
|
onClearFileMap?: () => void;
|
|
10
|
+
/** E2E 测试 ID */
|
|
11
|
+
dataTestId?: string;
|
|
10
12
|
};
|
|
11
13
|
export declare const AttachmentFileList: React.FC<AttachmentFileListProps>;
|
|
@@ -110,7 +110,7 @@ var ClearButton = function ClearButton(param) {
|
|
|
110
110
|
}, /*#__PURE__*/ React.createElement(X, null));
|
|
111
111
|
};
|
|
112
112
|
export var AttachmentFileList = function AttachmentFileList(param) {
|
|
113
|
-
var fileMap = param.fileMap, onDelete = param.onDelete, onPreview = param.onPreview, onDownload = param.onDownload, onRetry = param.onRetry, onClearFileMap = param.onClearFileMap;
|
|
113
|
+
var fileMap = param.fileMap, onDelete = param.onDelete, onPreview = param.onPreview, onDownload = param.onDownload, onRetry = param.onRetry, onClearFileMap = param.onClearFileMap, dataTestId = param.dataTestId;
|
|
114
114
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
115
115
|
var prefix = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-attachment-list');
|
|
116
116
|
var _useStyle = useStyle(prefix), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
@@ -139,7 +139,8 @@ export var AttachmentFileList = function AttachmentFileList(param) {
|
|
|
139
139
|
if (!visible) setImgSrc(undefined);
|
|
140
140
|
};
|
|
141
141
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
142
|
-
className: classNames("".concat(prefix, "-container"), hashId, _define_property({}, "".concat(prefix, "-container-empty"), !hasFiles))
|
|
142
|
+
className: classNames("".concat(prefix, "-container"), hashId, _define_property({}, "".concat(prefix, "-container-empty"), !hasFiles)),
|
|
143
|
+
"data-testid": dataTestId
|
|
143
144
|
}, /*#__PURE__*/ React.createElement(motion.div, {
|
|
144
145
|
variants: ANIMATION_VARIANTS,
|
|
145
146
|
whileInView: "visible",
|
|
@@ -148,6 +148,7 @@ import { QuickActions } from "./QuickActions";
|
|
|
148
148
|
import { SkillModeBar } from "./SkillModeBar";
|
|
149
149
|
import { useStyle } from "./style";
|
|
150
150
|
import { Suggestion } from "./Suggestion";
|
|
151
|
+
import { MARKDOWN_INPUT_FIELD_TEST_IDS } from "./testIds";
|
|
151
152
|
import TopOperatingArea from "./TopOperatingArea";
|
|
152
153
|
import { useAttachmentList, useBeforeTools, useSendActionsNode } from "./utils/renderHelpers";
|
|
153
154
|
import { useVoiceInputManager } from "./VoiceInputManager";
|
|
@@ -196,16 +197,17 @@ import { useVoiceInputManager } from "./VoiceInputManager";
|
|
|
196
197
|
enable: false
|
|
197
198
|
};
|
|
198
199
|
var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
199
|
-
var tagInputProps = _0.tagInputProps, markdownProps = _0.markdownProps, _0_borderRadius = _0.borderRadius, borderRadius = _0_borderRadius === void 0 ? 16 : _0_borderRadius, onBlur = _0.onBlur, onFocus = _0.onFocus, _0_isShowTopOperatingArea = _0.isShowTopOperatingArea, isShowTopOperatingArea = _0_isShowTopOperatingArea === void 0 ? false : _0_isShowTopOperatingArea, props = _object_without_properties(_0, [
|
|
200
|
+
var tagInputProps = _0.tagInputProps, markdownProps = _0.markdownProps, _0_borderRadius = _0.borderRadius, borderRadius = _0_borderRadius === void 0 ? 16 : _0_borderRadius, onBlur = _0.onBlur, onFocus = _0.onFocus, _0_isShowTopOperatingArea = _0.isShowTopOperatingArea, isShowTopOperatingArea = _0_isShowTopOperatingArea === void 0 ? false : _0_isShowTopOperatingArea, testId = _0.testId, props = _object_without_properties(_0, [
|
|
200
201
|
"tagInputProps",
|
|
201
202
|
"markdownProps",
|
|
202
203
|
"borderRadius",
|
|
203
204
|
"onBlur",
|
|
204
205
|
"onFocus",
|
|
205
|
-
"isShowTopOperatingArea"
|
|
206
|
+
"isShowTopOperatingArea",
|
|
207
|
+
"testId"
|
|
206
208
|
]);
|
|
207
209
|
var _ref;
|
|
208
|
-
var _props_skillMode, _props_enlargeable, _props_refinePrompt, _props_enlargeable1, _props_enlargeable2;
|
|
210
|
+
var _props_skillMode, _props_enlargeable, _props_refinePrompt, _props_enlargeable1, _props_enlargeable2, _props_toolsRender;
|
|
209
211
|
// 默认关闭文件上传,需显式传入 attachment.enable: true 开启
|
|
210
212
|
var attachment = _object_spread({}, DEFAULT_ATTACHMENT, props.attachment);
|
|
211
213
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
@@ -232,7 +234,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
232
234
|
}), hasEnlargeAction = _useMarkdownInputFieldActions.hasEnlargeAction, hasRefineAction = _useMarkdownInputFieldActions.hasRefineAction, isMultiRowLayout = _useMarkdownInputFieldActions.isMultiRowLayout, totalActionCount = _useMarkdownInputFieldActions.totalActionCount;
|
|
233
235
|
// 样式计算
|
|
234
236
|
var _useMarkdownInputFieldStyles = useMarkdownInputFieldStyles({
|
|
235
|
-
|
|
237
|
+
hasTools: !!props.toolsRender || !!props.actionsRender,
|
|
236
238
|
maxHeight: props.maxHeight,
|
|
237
239
|
style: props.style,
|
|
238
240
|
attachment: attachment,
|
|
@@ -334,13 +336,15 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
334
336
|
});
|
|
335
337
|
var _obj, _obj1;
|
|
336
338
|
return wrapSSR(/*#__PURE__*/ React.createElement(React.Fragment, null, isShowTopOperatingArea && /*#__PURE__*/ React.createElement("div", {
|
|
337
|
-
className: classNames("".concat(baseCls, "-top-area"), hashId)
|
|
339
|
+
className: classNames("".concat(baseCls, "-top-area"), hashId),
|
|
340
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.TOP_AREA
|
|
338
341
|
}, /*#__PURE__*/ React.createElement(TopOperatingArea, {
|
|
339
342
|
targetRef: props.targetRef,
|
|
340
343
|
operationBtnRender: props.operationBtnRender,
|
|
341
344
|
isShowBackTo: props.isShowBackTo
|
|
342
345
|
})), beforeTools ? /*#__PURE__*/ React.createElement("div", {
|
|
343
|
-
className: classNames("".concat(baseCls, "-before-tools"), hashId)
|
|
346
|
+
className: classNames("".concat(baseCls, "-before-tools"), hashId),
|
|
347
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.BEFORE_TOOLS
|
|
344
348
|
}, beforeTools) : null, /*#__PURE__*/ React.createElement(Suggestion, {
|
|
345
349
|
tagInputProps: _object_spread({
|
|
346
350
|
enable: true,
|
|
@@ -348,7 +352,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
348
352
|
}, tagInputProps)
|
|
349
353
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
350
354
|
ref: inputRef,
|
|
351
|
-
"data-testid":
|
|
355
|
+
"data-testid": testId !== null && testId !== void 0 ? testId : MARKDOWN_INPUT_FIELD_TEST_IDS.ROOT,
|
|
352
356
|
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"), false), _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)),
|
|
353
357
|
style: _object_spread_props(_object_spread({}, props.style, enlargedStyle), {
|
|
354
358
|
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%)"),
|
|
@@ -381,12 +385,14 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
381
385
|
flex: 1,
|
|
382
386
|
minHeight: 0
|
|
383
387
|
},
|
|
384
|
-
className: classNames("".concat(baseCls, "-editor"), hashId, (_obj1 = {}, _define_property(_obj1, "".concat(baseCls, "-editor-hover"), isHover), _define_property(_obj1, "".concat(baseCls, "-editor-disabled"), props.disabled), _obj1))
|
|
388
|
+
className: classNames("".concat(baseCls, "-editor"), hashId, (_obj1 = {}, _define_property(_obj1, "".concat(baseCls, "-editor-hover"), isHover), _define_property(_obj1, "".concat(baseCls, "-editor-disabled"), props.disabled), _obj1)),
|
|
389
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.EDITOR
|
|
385
390
|
}, /*#__PURE__*/ React.createElement(SkillModeBar, {
|
|
386
391
|
skillMode: props.skillMode,
|
|
387
392
|
onSkillModeOpenChange: props.onSkillModeOpenChange
|
|
388
393
|
}), /*#__PURE__*/ React.createElement("div", {
|
|
389
|
-
className: classNames("".concat(baseCls, "-editor-content"), hashId)
|
|
394
|
+
className: classNames("".concat(baseCls, "-editor-content"), hashId),
|
|
395
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.EDITOR_CONTENT
|
|
390
396
|
}, attachmentList, /*#__PURE__*/ React.createElement(BaseMarkdownEditor, _object_spread({
|
|
391
397
|
editorRef: markdownEditorRef,
|
|
392
398
|
leafRender: props.leafRender,
|
|
@@ -484,13 +490,15 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
484
490
|
setTopRightPadding(width);
|
|
485
491
|
setQuickRightOffset(rightOffset);
|
|
486
492
|
}
|
|
487
|
-
}) : null))), props.toolsRender ? /*#__PURE__*/ React.createElement("div", {
|
|
488
|
-
className: classNames("".concat(baseCls, "-tools-wrapper"), hashId)
|
|
493
|
+
}) : null))), props.toolsRender || props.actionsRender ? /*#__PURE__*/ React.createElement("div", {
|
|
494
|
+
className: classNames("".concat(baseCls, "-tools-wrapper"), hashId),
|
|
495
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.TOOLS_WRAPPER
|
|
489
496
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
490
497
|
ref: actionsRef,
|
|
491
498
|
contentEditable: false,
|
|
492
|
-
className: classNames("".concat(baseCls, "-send-tools"), hashId)
|
|
493
|
-
|
|
499
|
+
className: classNames("".concat(baseCls, "-send-tools"), hashId),
|
|
500
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.SEND_TOOLS
|
|
501
|
+
}, props === null || props === void 0 ? void 0 : (_props_toolsRender = props.toolsRender) === null || _props_toolsRender === void 0 ? void 0 : _props_toolsRender.call(props, _object_spread_props(_object_spread({
|
|
494
502
|
value: value,
|
|
495
503
|
fileMap: fileMap,
|
|
496
504
|
onFileMapChange: setFileMap,
|
|
@@ -203,6 +203,7 @@ import React, { useState } from "react";
|
|
|
203
203
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
204
204
|
import Enlargement from "../Enlargement";
|
|
205
205
|
import { RefinePromptButton } from "../RefinePromptButton";
|
|
206
|
+
import { MARKDOWN_INPUT_FIELD_TEST_IDS } from "../testIds";
|
|
206
207
|
/**
|
|
207
208
|
* QuickActions 组件 - 快速操作区域
|
|
208
209
|
*
|
|
@@ -306,7 +307,8 @@ import { RefinePromptButton } from "../RefinePromptButton";
|
|
|
306
307
|
e.stopPropagation();
|
|
307
308
|
e.preventDefault();
|
|
308
309
|
},
|
|
309
|
-
className: classNames("".concat(prefixCls, "-quick-actions"), hashId, _define_property({}, "".concat(prefixCls, "-quick-actions-vertical"), enlargeable))
|
|
310
|
+
className: classNames("".concat(prefixCls, "-quick-actions"), hashId, _define_property({}, "".concat(prefixCls, "-quick-actions-vertical"), enlargeable)),
|
|
311
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.QUICK_ACTIONS
|
|
310
312
|
}, [
|
|
311
313
|
// Enlargement组件 - 显示在最上方
|
|
312
314
|
enlargeable && /*#__PURE__*/ React.createElement(Enlargement, {
|
|
@@ -60,6 +60,7 @@ import { I18nContext } from "../../I18n";
|
|
|
60
60
|
import { AttachmentButton } from "../AttachmentButton";
|
|
61
61
|
import { SendButton } from "../SendButton";
|
|
62
62
|
import { VoiceInputButton } from "../VoiceInput";
|
|
63
|
+
import { MARKDOWN_INPUT_FIELD_TEST_IDS } from "../testIds";
|
|
63
64
|
/**
|
|
64
65
|
* SendActions 组件 - 发送操作按钮区域
|
|
65
66
|
*
|
|
@@ -170,7 +171,8 @@ import { VoiceInputButton } from "../VoiceInput";
|
|
|
170
171
|
e.stopPropagation();
|
|
171
172
|
e.preventDefault();
|
|
172
173
|
},
|
|
173
|
-
className: classNames("".concat(prefixCls, "-send-actions"), _define_property({}, "".concat(prefixCls, "-send-has-tools"), hasTools), hashId)
|
|
174
|
+
className: classNames("".concat(prefixCls, "-send-actions"), _define_property({}, "".concat(prefixCls, "-send-has-tools"), hasTools), hashId),
|
|
175
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.SEND_ACTIONS
|
|
174
176
|
}, collapseSendActions && actionsList.length > 2 ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Popover, {
|
|
175
177
|
trigger: "click",
|
|
176
178
|
styles: {
|
|
@@ -196,7 +198,8 @@ import { VoiceInputButton } from "../VoiceInput";
|
|
|
196
198
|
style: {
|
|
197
199
|
fontSize: 16,
|
|
198
200
|
color: 'var(--color-gray-text-secondary)'
|
|
199
|
-
}
|
|
201
|
+
},
|
|
202
|
+
"data-testid": MARKDOWN_INPUT_FIELD_TEST_IDS.MORE_ACTIONS
|
|
200
203
|
}, /*#__PURE__*/ React.createElement(EllipsisVertical, null))), actionsList.find(function(item) {
|
|
201
204
|
if (/*#__PURE__*/ React.isValidElement(item) && (item === null || item === void 0 ? void 0 : item.key) === 'send-button') {
|
|
202
205
|
return true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MarkdownInputFieldProps } from '../types/MarkdownInputFieldProps';
|
|
3
3
|
interface UseMarkdownInputFieldStylesParams {
|
|
4
|
-
|
|
4
|
+
hasTools?: boolean;
|
|
5
5
|
maxHeight?: MarkdownInputFieldProps['maxHeight'];
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
attachment?: {
|
|
@@ -27,5 +27,5 @@ interface UseMarkdownInputFieldStylesReturn {
|
|
|
27
27
|
* 样式计算 Hook
|
|
28
28
|
* 计算组件所需的样式值
|
|
29
29
|
*/
|
|
30
|
-
export declare const useMarkdownInputFieldStyles: ({
|
|
30
|
+
export declare const useMarkdownInputFieldStyles: ({ hasTools, maxHeight, style, attachment, isEnlarged, rightPadding, topRightPadding, quickRightOffset, hasEnlargeAction, hasRefineAction, totalActionCount, isMultiRowLayout, }: UseMarkdownInputFieldStylesParams) => UseMarkdownInputFieldStylesReturn;
|
|
31
31
|
export {};
|
|
@@ -3,13 +3,13 @@ import { useMemo } from "react";
|
|
|
3
3
|
* 样式计算 Hook
|
|
4
4
|
* 计算组件所需的样式值
|
|
5
5
|
*/ export var useMarkdownInputFieldStyles = function useMarkdownInputFieldStyles(param) {
|
|
6
|
-
var
|
|
6
|
+
var hasTools = param.hasTools, maxHeight = param.maxHeight, style = param.style, attachment = param.attachment, isEnlarged = param.isEnlarged, rightPadding = param.rightPadding, topRightPadding = param.topRightPadding, quickRightOffset = param.quickRightOffset, hasEnlargeAction = param.hasEnlargeAction, hasRefineAction = param.hasRefineAction, totalActionCount = param.totalActionCount, isMultiRowLayout = param.isMultiRowLayout;
|
|
7
7
|
var computedRightPadding = useMemo(function() {
|
|
8
|
-
var bottomOverlayPadding =
|
|
8
|
+
var bottomOverlayPadding = hasTools ? 0 : rightPadding || 52;
|
|
9
9
|
var topOverlayPadding = (topRightPadding || 0) + (quickRightOffset || 0);
|
|
10
10
|
return Math.max(bottomOverlayPadding, topOverlayPadding);
|
|
11
11
|
}, [
|
|
12
|
-
|
|
12
|
+
hasTools,
|
|
13
13
|
rightPadding,
|
|
14
14
|
topRightPadding,
|
|
15
15
|
quickRightOffset
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MarkdownInputField 内置 testId 常量
|
|
3
|
+
* 用于 E2E 测试与自动化测试中的 data-testid 定位
|
|
4
|
+
*/
|
|
5
|
+
export declare const MARKDOWN_INPUT_FIELD_TEST_IDS: {
|
|
6
|
+
/** 根容器 */
|
|
7
|
+
readonly ROOT: "markdown-input-field";
|
|
8
|
+
/** 顶部操作区域 */
|
|
9
|
+
readonly TOP_AREA: "markdown-input-field-top-area";
|
|
10
|
+
/** 前置工具栏区域 */
|
|
11
|
+
readonly BEFORE_TOOLS: "markdown-input-field-before-tools";
|
|
12
|
+
/** 编辑器容器 */
|
|
13
|
+
readonly EDITOR: "markdown-input-field-editor";
|
|
14
|
+
/** 编辑器内容区 */
|
|
15
|
+
readonly EDITOR_CONTENT: "markdown-input-field-editor-content";
|
|
16
|
+
/** 快速操作区(放大、提示词优化等) */
|
|
17
|
+
readonly QUICK_ACTIONS: "markdown-input-field-quick-actions";
|
|
18
|
+
/** 工具栏包装器 */
|
|
19
|
+
readonly TOOLS_WRAPPER: "markdown-input-field-tools-wrapper";
|
|
20
|
+
/** 发送工具区域 */
|
|
21
|
+
readonly SEND_TOOLS: "markdown-input-field-send-tools";
|
|
22
|
+
/** 发送操作区(附件、语音、发送按钮等) */
|
|
23
|
+
readonly SEND_ACTIONS: "markdown-input-field-send-actions";
|
|
24
|
+
/** 更多操作按钮(折叠时的省略号) */
|
|
25
|
+
readonly MORE_ACTIONS: "markdown-input-field-more-actions";
|
|
26
|
+
/** 附件列表 */
|
|
27
|
+
readonly ATTACHMENT_LIST: "markdown-input-field-attachment-list";
|
|
28
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MarkdownInputField 内置 testId 常量
|
|
3
|
+
* 用于 E2E 测试与自动化测试中的 data-testid 定位
|
|
4
|
+
*/ export var MARKDOWN_INPUT_FIELD_TEST_IDS = {
|
|
5
|
+
/** 根容器 */ ROOT: 'markdown-input-field',
|
|
6
|
+
/** 顶部操作区域 */ TOP_AREA: 'markdown-input-field-top-area',
|
|
7
|
+
/** 前置工具栏区域 */ BEFORE_TOOLS: 'markdown-input-field-before-tools',
|
|
8
|
+
/** 编辑器容器 */ EDITOR: 'markdown-input-field-editor',
|
|
9
|
+
/** 编辑器内容区 */ EDITOR_CONTENT: 'markdown-input-field-editor-content',
|
|
10
|
+
/** 快速操作区(放大、提示词优化等) */ QUICK_ACTIONS: 'markdown-input-field-quick-actions',
|
|
11
|
+
/** 工具栏包装器 */ TOOLS_WRAPPER: 'markdown-input-field-tools-wrapper',
|
|
12
|
+
/** 发送工具区域 */ SEND_TOOLS: 'markdown-input-field-send-tools',
|
|
13
|
+
/** 发送操作区(附件、语音、发送按钮等) */ SEND_ACTIONS: 'markdown-input-field-send-actions',
|
|
14
|
+
/** 更多操作按钮(折叠时的省略号) */ MORE_ACTIONS: 'markdown-input-field-more-actions',
|
|
15
|
+
/** 附件列表 */ ATTACHMENT_LIST: 'markdown-input-field-attachment-list'
|
|
16
|
+
};
|
|
@@ -363,6 +363,11 @@ export type MarkdownInputFieldProps = {
|
|
|
363
363
|
* ```
|
|
364
364
|
*/
|
|
365
365
|
targetRef?: React.RefObject<HTMLDivElement>;
|
|
366
|
+
/**
|
|
367
|
+
* 测试 ID
|
|
368
|
+
* @description 用于 E2E 或自动化测试中的 `data-testid` 属性,覆盖根元素的默认 `markdown-input-field`
|
|
369
|
+
*/
|
|
370
|
+
testId?: string;
|
|
366
371
|
/**
|
|
367
372
|
* 顶部操作区域自定义操作按钮渲染函数
|
|
368
373
|
* @description 用于在顶部操作区域中央渲染自定义操作按钮
|
|
@@ -53,6 +53,7 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import React, { useMemo } from "react";
|
|
54
54
|
import { AttachmentFileList } from "../AttachmentButton/AttachmentFileList";
|
|
55
55
|
import { SendActions } from "../SendActions";
|
|
56
|
+
import { MARKDOWN_INPUT_FIELD_TEST_IDS } from "../testIds";
|
|
56
57
|
/**
|
|
57
58
|
* 附件列表渲染 Hook
|
|
58
59
|
*/ export var useAttachmentList = function useAttachmentList(param) {
|
|
@@ -65,7 +66,8 @@ import { SendActions } from "../SendActions";
|
|
|
65
66
|
onRetry: handleFileRetry,
|
|
66
67
|
onClearFileMap: function onClearFileMap() {
|
|
67
68
|
updateAttachmentFiles(undefined);
|
|
68
|
-
}
|
|
69
|
+
},
|
|
70
|
+
dataTestId: MARKDOWN_INPUT_FIELD_TEST_IDS.ATTACHMENT_LIST
|
|
69
71
|
});
|
|
70
72
|
}, [
|
|
71
73
|
attachment === null || attachment === void 0 ? void 0 : attachment.enable,
|
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export * from './MarkdownInputField/AttachmentButton/utils';
|
|
|
56
56
|
export { ActionItemContainer } from './MarkdownInputField/BeforeToolContainer/BeforeToolContainer';
|
|
57
57
|
export * from './MarkdownInputField/FileMapView';
|
|
58
58
|
export * from './MarkdownInputField/MarkdownInputField';
|
|
59
|
+
export { MARKDOWN_INPUT_FIELD_TEST_IDS } from './MarkdownInputField/testIds';
|
|
59
60
|
export * from './MarkdownInputField/VoiceInput';
|
|
60
61
|
export * from './Schema';
|
|
61
62
|
export * from './Schema/SchemaRenderer/templateEngine';
|
package/dist/index.js
CHANGED
|
@@ -65,6 +65,7 @@ export * from "./MarkdownInputField/AttachmentButton/utils";
|
|
|
65
65
|
export { ActionItemContainer } from "./MarkdownInputField/BeforeToolContainer/BeforeToolContainer";
|
|
66
66
|
export * from "./MarkdownInputField/FileMapView";
|
|
67
67
|
export * from "./MarkdownInputField/MarkdownInputField";
|
|
68
|
+
export { MARKDOWN_INPUT_FIELD_TEST_IDS } from "./MarkdownInputField/testIds";
|
|
68
69
|
export * from "./MarkdownInputField/VoiceInput";
|
|
69
70
|
// ─── Schema ──────────────────────────────────────────────────────────────────
|
|
70
71
|
export * from "./Schema";
|